port FlameEmitter_Control

This commit is contained in:
Marcin Kurczewski 2024-09-10 23:08:10 +02:00
parent 5b91fcbf7d
commit f95f525fba
No known key found for this signature in database
GPG Key ID: CC65E6FD28CAE42A
7 changed files with 45 additions and 10 deletions

View File

@ -69,10 +69,10 @@
</g>
<g transform="translate(0 116)">
<text x="0" y="7.50">Tomb2.exe progress according to the physical function order:</text>
<text class="todo" style="font-size: 12px; " x="747" y="9"><tspan text-anchor="end"><tspan class="decompiled">61.90% (754)</tspan> · <tspan class="known">35.63% (434)</tspan> · <tspan class="todo">0% (0)</tspan> · <tspan class="unused">2.46% (30)</tspan></tspan></text>
<text class="todo" style="font-size: 12px; " x="747" y="9"><tspan text-anchor="end"><tspan class="decompiled">61.99% (755)</tspan> · <tspan class="known">35.55% (433)</tspan> · <tspan class="todo">0% (0)</tspan> · <tspan class="unused">2.46% (30)</tspan></tspan></text>
<g transform="translate(0 20)">
<rect width="462.43" height="6" x="0" y="0" class="decompiled"/>
<rect width="266.17" height="6" x="462.43" y="0" class="known"/>
<rect width="463.04" height="6" x="0" y="0" class="decompiled"/>
<rect width="265.56" height="6" x="463.04" y="0" class="known"/>
<rect width="18.40" height="6" x="728.60" y="0" class="unused"/>
</g>
<g transform="translate(0 31)">
@ -862,7 +862,7 @@
<rect width="12" height="12" x="495" y="225" class="known"><title>void __cdecl DartEmitterControl(int16_t item_num);</title></rect>
<rect width="12" height="12" x="510" y="225" class="known"><title>void __cdecl DartsControl(int16_t item_num);</title></rect>
<rect width="12" height="12" x="525" y="225" class="known"><title>void __cdecl DartEffectControl(int16_t fx_num);</title></rect>
<rect width="12" height="12" x="540" y="225" class="known"><title>void __cdecl FlameEmitterControl(int16_t item_num);</title></rect>
<rect width="12" height="12" x="540" y="225" class="decompiled"><title>void __cdecl FlameEmitter_Control(int16_t item_num);</title></rect>
<rect width="12" height="12" x="555" y="225" class="decompiled"><title>void __cdecl Flame_Control(int16_t fx_num);</title></rect>
<rect width="12" height="12" x="570" y="225" class="decompiled"><title>void __cdecl Lara_CatchFire(void);</title></rect>
<rect width="12" height="12" x="585" y="225" class="decompiled"><title>void __cdecl Lara_TouchLava(ITEM_INFO *item);</title></rect>
@ -1298,10 +1298,10 @@
</g>
<g transform="translate(0 546)">
<text x="0" y="7.50">Tomb2.exe progress according to the function sizes:</text>
<text class="todo" style="font-size: 12px; " x="747" y="9"><tspan text-anchor="end"><tspan class="decompiled">65.40%</tspan> · <tspan class="known">34.28%</tspan> · <tspan class="todo">0%</tspan> · <tspan class="unused">0.33%</tspan></tspan></text>
<text class="todo" style="font-size: 12px; " x="747" y="9"><tspan text-anchor="end"><tspan class="decompiled">65.44%</tspan> · <tspan class="known">34.23%</tspan> · <tspan class="todo">0%</tspan> · <tspan class="unused">0.33%</tspan></tspan></text>
<g transform="translate(0 20)">
<rect width="488.52" height="6" x="0" y="0" class="decompiled"/>
<rect width="256.04" height="6" x="488.52" y="0" class="known"/>
<rect width="488.84" height="6" x="0" y="0" class="decompiled"/>
<rect width="255.72" height="6" x="488.84" y="0" class="known"/>
<rect width="2.44" height="6" x="744.56" y="0" class="unused"/>
</g>
<g transform="translate(0 31)">
@ -1883,7 +1883,7 @@
<rect width="7.91" height="8.03" x="589.71" y="185.54" class="known"><title>bool __cdecl GetRegistryGuidValue(LPCTSTR lpValueName, GUID *value, GUID *defaultValue);</title></rect>
<rect width="7.84" height="8.03" x="600.62" y="185.54" class="decompiled"><title>void __cdecl Lara_Col_Reach(ITEM_INFO *item, COLL_INFO *coll);</title></rect>
<rect width="7.84" height="8.03" x="611.46" y="185.54" class="known"><title>int32_t __cdecl GetCollisionAnim(ITEM_INFO *skidoo, XYZ_32 *moved);</title></rect>
<rect width="7.84" height="8.03" x="622.29" y="185.54" class="known"><title>void __cdecl FlameEmitterControl(int16_t item_num);</title></rect>
<rect width="7.84" height="8.03" x="622.29" y="185.54" class="decompiled"><title>void __cdecl FlameEmitter_Control(int16_t item_num);</title></rect>
<rect width="7.84" height="8.03" x="633.13" y="185.54" class="decompiled"><title>bool __cdecl WinVidCopyBitmapToBuffer(LPDDS surface, const BYTE *bitmap);</title></rect>
<rect width="7.76" height="8.03" x="643.97" y="185.54" class="decompiled"><title>void __cdecl CutscenePlayer1_Initialise(int16_t item_num);</title></rect>
<rect width="7.76" height="8.03" x="654.73" y="185.54" class="known"><title>void __cdecl FloodFX(ITEM_INFO *item);</title></rect>

Before

Width:  |  Height:  |  Size: 364 KiB

After

Width:  |  Height:  |  Size: 364 KiB

View File

@ -3729,7 +3729,7 @@ typedef enum {
0x00442840 0x013E -R void __cdecl DartEmitterControl(int16_t item_num);
0x00442980 0x0155 -R void __cdecl DartsControl(int16_t item_num);
0x00442AE0 0x004B -R void __cdecl DartEffectControl(int16_t fx_num);
0x00442B30 0x0090 -R void __cdecl FlameEmitterControl(int16_t item_num);
0x00442B30 0x0090 + void __cdecl FlameEmitter_Control(int16_t item_num);
0x00442BC0 0x0164 + void __cdecl Flame_Control(int16_t fx_num);
0x00442D30 0x0049 + void __cdecl Lara_CatchFire(void);
0x00442D80 0x00E6 + void __cdecl Lara_TouchLava(ITEM_INFO *item);

View File

@ -127,6 +127,7 @@ dll_sources = [
'src/game/objects/general/final_level_counter.c',
'src/game/objects/names.c',
'src/game/objects/traps/ember_emitter.c',
'src/game/objects/traps/flame_emitter.c',
'src/game/objects/vars.c',
'src/game/objects/vehicles/boat.c',
'src/game/option/option.c',

View File

@ -0,0 +1,30 @@
#include "game/objects/traps/flame_emitter.h"
#include "game/effects.h"
#include "game/items.h"
#include "global/vars.h"
void __cdecl FlameEmitter_Control(const int16_t item_num)
{
ITEM_INFO *const item = &g_Items[item_num];
if (!Item_IsTriggerActive(item)) {
if (item->data != NULL) {
const int32_t flame_num = ((int32_t)(intptr_t)item->data) - 1;
Effect_Kill(flame_num);
item->data = NULL;
}
} else if (item->data == NULL) {
const int16_t fx_num = Effect_Create(item->room_num);
if (fx_num != NO_ITEM) {
FX_INFO *const fx = &g_Effects[fx_num];
fx->pos.x = item->pos.x;
fx->pos.y = item->pos.y;
fx->pos.z = item->pos.z;
fx->frame_num = 0;
fx->object_id = O_FLAME;
fx->counter = 0;
}
item->data = (void *)(fx_num + 1);
}
}

View File

@ -0,0 +1,3 @@
#include <stdint.h>
void __cdecl FlameEmitter_Control(int16_t item_num);

View File

@ -258,7 +258,6 @@
#define DartEmitterControl ((void __cdecl (*)(int16_t item_num))0x00442840)
#define DartsControl ((void __cdecl (*)(int16_t item_num))0x00442980)
#define DartEffectControl ((void __cdecl (*)(int16_t fx_num))0x00442AE0)
#define FlameEmitterControl ((void __cdecl (*)(int16_t item_num))0x00442B30)
#define GiantYetiControl ((void __cdecl (*)(int16_t item_num))0x00443050)
#define YetiControl ((void __cdecl (*)(int16_t item_num))0x00443350)
#define WinInReadJoystick ((DWORD __cdecl (*)(int32_t *x, int32_t *y))0x004472A0)

View File

@ -45,6 +45,7 @@
#include "game/objects/general/door.h"
#include "game/objects/general/final_level_counter.h"
#include "game/objects/traps/ember_emitter.h"
#include "game/objects/traps/flame_emitter.h"
#include "game/objects/vehicles/boat.h"
#include "game/option/option.h"
#include "game/output.h"
@ -950,6 +951,7 @@ static void Inject_Objects(const bool enable)
INJECT(enable, 0x00416DB0, Diver_Control);
INJECT(enable, 0x004336F0, BodyPart_Control);
INJECT(enable, 0x00434400, FinalLevelCounter_Control);
INJECT(enable, 0x00442B30, FlameEmitter_Control);
INJECT(enable, 0x00442BC0, Flame_Control);
INJECT(enable, 0x00442E70, EmberEmitter_Control);
INJECT(enable, 0x00442F40, Ember_Control);