Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
port Output_InsertPolygons_I
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Nov 14, 2023
1 parent 0fa5cae commit 42761b1
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 11 deletions.
16 changes: 8 additions & 8 deletions docs/progress.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/progress.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@ typedef enum LARA_MESH {
0041B910 00000041 + void __cdecl Matrix_RotYXZ_I(int16_t y, int16_t x, int16_t z);
0041B960 0000003D + void __cdecl Matrix_RotYXZsuperpack_I(int16_t **pprot1, int16_t **pprot2, int32_t skip);
0041B9A0 000000A1 + void __cdecl Matrix_RotYXZsuperpack(int16_t **pprot, int32_t skip);
0041BA50 0000002A - void __cdecl Output_InsertPolygons_I(int16_t *ptr, int32_t clip);
0041BA50 0000002A + void __cdecl Output_InsertPolygons_I(int16_t *ptr, int32_t clip);
0041BA80 000001A5 + void __cdecl Matrix_Interpolate(void);
0041BC30 000000FC + void __cdecl Matrix_InterpolateArm(void);
0041BD30 0000014B - void __cdecl Gun_DrawFlash(int32_t weapon_type, int32_t clip);
Expand Down
12 changes: 11 additions & 1 deletion src/game/output.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "game/output.h"

#include "game/math.h"
#include "game/matrix.h"
#include "game/shell.h"
#include "global/const.h"
#include "global/funcs.h"
Expand Down Expand Up @@ -326,7 +327,7 @@ void __cdecl Output_Init(
}
}

void __cdecl Output_InsertPolygons(const int16_t *obj_ptr, int32_t clip)
void __cdecl Output_InsertPolygons(const int16_t *obj_ptr, const int32_t clip)
{
g_FltWinLeft = g_PhdWinMinX;
g_FltWinTop = g_PhdWinMinY;
Expand All @@ -345,6 +346,15 @@ void __cdecl Output_InsertPolygons(const int16_t *obj_ptr, int32_t clip)
}
}

void __cdecl Output_InsertPolygons_I(
const int16_t *const ptr, const int32_t clip)
{
Matrix_Push();
Matrix_Interpolate();
Output_InsertPolygons(ptr, clip);
Matrix_Pop();
}

void __cdecl Output_InsertRoom(const int16_t *obj_ptr, int32_t is_outside)
{
g_FltWinLeft = (g_PhdWinMinX + g_PhdWinLeft);
Expand Down
1 change: 1 addition & 0 deletions src/game/output.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ void __cdecl Output_Init(
int32_t screen_height);

void __cdecl Output_InsertPolygons(const int16_t *obj_ptr, int32_t clip);
void __cdecl Output_InsertPolygons_I(const int16_t *ptr, int32_t clip);
void __cdecl Output_InsertRoom(const int16_t *obj_ptr, int32_t is_outside);
void __cdecl Output_InsertSkybox(const int16_t *obj_ptr);
const int16_t *__cdecl Output_CalcObjectVertices(const int16_t *obj_ptr);
Expand Down
1 change: 0 additions & 1 deletion src/global/funcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@
#define Object_DrawAnimatingItem ((void __cdecl (*)(struct ITEM_INFO *item))0x00419A70)
#define Lara_Draw ((void __cdecl (*)(struct ITEM_INFO *item))0x00419DF0)
#define Lara_Draw_I ((void __cdecl (*)(struct ITEM_INFO *item, int16_t *frame1, int16_t *frame2, int32_t frac, int32_t rate))0x0041AB20)
#define Output_InsertPolygons_I ((void __cdecl (*)(int16_t *ptr, int32_t clip))0x0041BA50)
#define Gun_DrawFlash ((void __cdecl (*)(int32_t weapon_type, int32_t clip))0x0041BD30)
#define Output_CalculateObjectLighting ((void __cdecl (*)(struct ITEM_INFO *item, int16_t *frame))0x0041BEA0)
#define Item_GetFrames ((int32_t __cdecl (*)(struct ITEM_INFO *item, int16_t *frmptr[], int32_t *rate))0x0041BF90)
Expand Down
1 change: 1 addition & 0 deletions src/inject_exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ static void Inject_Output(void)
INJECT(1, 0x004093A0, Output_InsertObjectGT3_ZBuffered);
INJECT(1, 0x00409450, Output_InsertObjectG4_ZBuffered);
INJECT(1, 0x004098F0, Output_InsertObjectG3_ZBuffered);
INJECT(1, 0x0041BA50, Output_InsertPolygons_I);
}

static void Inject_Music(void)
Expand Down

0 comments on commit 42761b1

Please sign in to comment.