in all cases, the rendering gets initialized with genMessages case 9 and 10
the rendering then is performed with genMessages case 7 (MPR_MSG_PACKET, which is checked prior to the case switch)
the switch for what render routine to execute happens in asm_10002E43:
Code: Select all
.text:10002E43 call dword ptr [edx+38h]
Code: Select all
.text:100180AD mov [edi+eax], edx
it actually merges two pointer arrays, for which only the 15th entry changes, the one of interest
it is called by
Code: Select all
.text:10018114 call sub_10018080
.text:1001919B call sub_100180D0
.text:10015EAD call dword ptr [eax+edx*4] (engMessage case 7)
Code: Select all
.text:10003D53 mov dword ptr [eax+38h], offset sub_1000EC60
.text:10003D60 mov dword ptr [ecx+38h], offset sub_10005B70 <- eax flags = 11002002h (mode 3, 4)
.text:10003D74 mov dword ptr [edx+38h], offset sub_1000D6E0
.text:10003D81 mov dword ptr [eax+38h], offset sub_10004390
.text:10003D9C mov dword ptr [ecx+38h], offset sub_1000F990
.text:10003DA9 mov dword ptr [edx+38h], offset sub_1000DE40
.text:10003DBA mov dword ptr [eax+38h], offset sub_10004F00
.text:10003DC7 mov dword ptr [ecx+38h], offset sub_10004F00
.text:10003DE2 mov dword ptr [edx+38h], offset sub_1000D340
.text:10003DEF mov dword ptr [eax+38h], offset sub_1000D340
.text:10003E00 mov dword ptr [ecx+38h], offset sub_10006700
.text:10003E0D mov dword ptr [edx+38h], offset sub_10003140
.text:10003E21 mov dword ptr [eax+38h], offset sub_10010C70
.text:10003E2E mov dword ptr [ecx+38h], offset sub_10007E80
.text:10003E52 mov dword ptr [eax+38h], offset sub_100165D0
.text:10003E5F mov dword ptr [ecx+38h], offset sub_10016F30
.text:10003E73 mov dword ptr [edx+38h], offset sub_10016B80
.text:10003E80 mov dword ptr [eax+38h], offset sub_10017750
.text:10003EB6 mov dword ptr [ecx+38h], offset sub_100072A0
.text:10003ECA mov [eax+38h], off_10298110[edx*4]
for eax flags = 11002007h: sub_100098C0 (mode 7, 8)
for eax flags = 11006002h: sub_10016F30 (crystal entity mode 6)
.text:10003EE3 mov dword ptr [edx+38h], offset sub_1000CE40
.text:10003EF0 mov dword ptr [eax+38h], offset sub_1000C790 <- eax flags = 01200001h, 01200401h (mode 2, 12)
.text:10003EFD mov dword ptr [ecx+38h], offset sub_1000CAD0
.text:10003F0F mov dword ptr [edx+38h], offset sub_10018380 <- eax flags = 01200000h (mode 1)
.text:10003F1E mov dword ptr [eax+38h], offset sub_100040D0
Code: Select all
.text:100180E8 call sub_10003CE0
.text:1001919B call sub_100180D0
.text:10015EAD call dword ptr [eax+edx*4] (engMessage case 7)
the third dword of the message is the render mode, which triggers this all
yes, another mode switch for switching the flags for selecting the render routine...
Code: Select all
.text:10015EA6 mov edx, [esi] <-- where packet type = 2
.text:10015EAD call dword ptr [eax+edx*4]
->
.text:10019160 mov eax, [esp+arg_4]
.text:10019164 mov eax, [eax+8] <-- render mode
Code: Select all
.text:10019195 mov [ecx+4], edx
Code: Select all
mode 1: .bss:1003EE24 dd offset unk_1200000 (a few ships & outposts + crystal entity)
mode 2: .bss:1003EE28 dd offset unk_1200001(some ships, outposts & starbases)
mode 3: .bss:1003EE2C dd 11202002h (romulan starbase) => writes optional palette data
mode 4: .bss:1003EE30 dd 11002002h (many ships & outposts + crystal entity) => writes optional palette data
mode 5: .bss:1003EE34 dd 11206002h (unused)
mode 6: .bss:1003EE38 dd 11006002h (crystal entity)
mode 7: .bss:1003EE3C dd 11202007h (sheliak, starbases, federation heavy escort)
mode 8: .bss:1003EE40 dd 11002007h (most ships & outposts)
mode 9: .bss:1003EE44 dd 11206007h (unused)
mode 10: .bss:10031EE48 dd 11006007h (unused)
mode 11: .bss:1003EE4C dd offset unk_1200400 (unused)
mode 12: .bss:1003EE50 dd offset unk_1200401 (starbases)
mode 13: .bss:1003EE54 dd 11202406h (unused)
mode 14: .bss:1003EE58 dd 11002406h (unused)
mode 15: .bss:1003EE5C dd 11206406h (unused)
mode 16: .bss:1003EE60 dd 11006406h (unused)
mode 17: .bss:1003EE64 dd 11202407h (unused)
mode 18: .bss:1003EE68 dd 11002407h (unused)
mode 19: .bss:1003EE6C dd 11206407h (unused)
mode 20: .bss:1003EE70 dd 11006407h (unused)
used ship model render modes are:
Code: Select all
crystal entity: 1, 4, 6 => 6 for translucency?
borg cube: 8?
yridian scout: 4, 8 (4 altering and only when the back becomes visible)
vulcan ship: 8
acamarian raider: 8
tamarian defender: 8
talarian warship: 4, 8 (4 altering and only when the back becomes visible)
pakled transport: 8
sheliak raider: 7
ktarian raider: 4, 8 (altering for back and front)
bajoran fighter: 8
trill warship: 8
cardassian scout: 2, 8 (2 altering and only when the back becomes visible)
cardassian destroyer: 8
cardassian cruiser: 8
cardassian heavey cruiser: 8
cardassian attack cruiser: 4, 8 (altering for back and front)
cardassian battleship: 2, 8 (2 altering and only when the back becomes visible)
cardassian colony ship: 2, 4, 8 (altering for back and front)
cardassian outpost: 8
cardassian starbase: 2, 7, C (altering)
cardassian troop transport: 8
federation scout: 2, 8 (2 altering and only when the front becomes visible) => no optional palette data (federation tested only)
federation destroyer: 8 => no optional palette data
federation heavy destroyer: 4, 8 (altering for back and front) => writes optional palette data
federation heavy escort: 1, 7 (altering for back and front) => no optional palette data
federation heavy cruiser: 4, 8 (4 altering and only when the front becomes visible) => writes optional palette data
federation light cruiser: 4, 8 (4 altering and only when the front becomes visible) => writes optional palette data
federation strike cruiser: 8 => no optional palette data
federation command cruiser: 4, 8 (4 altering and only when the front becomes visible) => writes optional palette data
federation dreadnought: 8 => no optional palette data
federation colony ship: 4, 8 (4 altering and only when the back becomes visible) => writes optional palette data
federation outpost: 1, 2, 8 (altering, 1 when top becomes visible) => no optional palette data
federation starbase: 7, C (altering) => no optional palette data
federation troop transport: 4, 8 (altering for back and front) => writes optional palette data
ferengi explorer: 2, 4, 8 (altering for back and front, 4 rarely seen)
ferengi light raider: 4, 8 (4 altering and only when the bottom becomes visible)
ferengi war cruiser: 4, 8 (4 altering and only when the bottom becomes visible)
ferengi strike cruiser: 4, 8 (4 altering and only when the bottom becomes visible)
ferengi marauder: 8
ferengi colony ship: 2, 4, 8 (altering for back and front)
ferengi outpost: 8
ferengi starbase: 7, C (altering)
ferengi troop transport: 8
klingon scout: 2, 4, 8 (altering for back and front)
klingon destroyer: 8
klingon battle cruiser: 8
klingon heavy cruiser: 4, 8 (4 altering and only when the back becomes visible)
klingon strike cruiser: 4, 8 (altering for back and front)
klingon attack cruiser: 8
klingon colony ship: 8
klingon outpost: 8
klingon starbase: 7, C (altering)
klingon assault transport: 8
romulan scout: 4, 8 (altering for back and front)
romulan destroyer: 4, 8 (altering for back and front)
romulan battle cruiser: 4, 8 (altering for back and front)
romulan cruiser: 4, 8 (altering for back and front)
romulan strike cruiser: 4, 8 (altering for back and front)
romulan warbird: 1, 8 (altering for back and front)
romulan colony ship: 1, 8 (altering for back and front)
romulan outpost: 4, 8 (altering for back and front)
romulan starbase: 2, 3, 7, C (altering, C rarely seen)
romulan troop transport: 8
Code: Select all
.text:10015E44 call sub_10018060
the active render mode integer is read from and stored to:
Code: Select all
.text:10015E24 mov eax, ds:dword_1001B110
.text:10015E6A mov ds:dword_1001B110, edi
the ship model is updated by
Code: Select all
.text:1001881E mov [edi+24h], ebx
.text:10018E43 call sub_10018800 (engMessage case 9, first message per model rendering)
instead it is updated by engMessage case 7 type C MPR_PKT_TRIFAN! (Ch 4h 6h)
Code: Select all
.text:10005BF2 call sub_5CF8500
.text:10002E43 call dword ptr [edx+38h]
.text:100156E5 call sub_5CE1C50
.text:10001522 call sub_5CF5630
.text:1001A271 call [esp+2Ch+var_8]
.text:10015EAD call dword ptr [eax+edx*4] (engMessage case 7 of type C)
Code: Select all
sub_10004390 (unused)
sub_10005B70 (mode 3, 4)
sub_1000D6E0 (unused)
sub_1000EC60 (unused)
sub_100165D0 (unused)
sub_10016B80 (unused)
sub_10016F30 (unused)
sub_10017750 (unused)
I'm not sure whether that's a feasible approach, maybe it'll be easier to just move the whole palette entries
knowing the routines of interest however might help reduce work and also will help when testing
e.g. you might try to nop seemingly unused routines and see if it breaks anything
in addition, like already proposed, you might skip relocation of successive data after the palettes to reduce work
Nonetheless, I rather switch over to UE now and leave further tests to both of you.
I'm sure it can be done, but it'll be quite some work whatever approach you choose and too much work for me to proceed with.