From a773bca350b0bc8b3792e5a560f3acc8332bcf20 Mon Sep 17 00:00:00 2001 From: Michael0933 Date: Sat, 27 Jan 2024 00:44:25 +0100 Subject: [PATCH] [MONSTER]: Implement MONSTER_InitVertexColors --- KAIN2/Game/MONSTER/MONSTER.C | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/KAIN2/Game/MONSTER/MONSTER.C b/KAIN2/Game/MONSTER/MONSTER.C index b6985dccf..cb45984cf 100644 --- a/KAIN2/Game/MONSTER/MONSTER.C +++ b/KAIN2/Game/MONSTER/MONSTER.C @@ -1589,28 +1589,20 @@ void ProcessBloodyMess(struct _Instance *instance, int vertidx, int segidx, int } -// autogenerated function stub: -// void /*$ra*/ MONSTER_InitVertexColors(struct _Instance *instance /*$s1*/, struct _Model *model /*$s0*/) -void MONSTER_InitVertexColors(struct _Instance *instance, struct _Model *model) -{ // line 3017, offset 0x8008c030 - /* begin block 1 */ - // Start line: 3018 - // Start offset: 0x8008C030 - // Variables: - int i; // $s0 - CVECTOR *ptr; // $v0 - /* end block 1 */ - // End offset: 0x8008C084 - // End Line: 3027 +void MONSTER_InitVertexColors(struct _Instance* instance, struct _Model* model) // Matching - 100% +{ + int i; + CVECTOR* ptr; - /* begin block 2 */ - // Start line: 6403 - /* end block 2 */ - // End Line: 6404 - UNIMPLEMENTED(); + instance->perVertexColor = (CVECTOR*)MEMPACK_Malloc(model->numVertices * 4, 33); + ptr = instance->perVertexColor; + for (i = model->numVertices; i != 0; i--) + { + *(long*)ptr = 0xFFFFFF; + ptr++; + } } - // autogenerated function stub: // int /*$ra*/ MONSTER_StartVertexBlood(struct _Instance *instance /*$s2*/, struct _SVector *location /*$s0*/, int amount /*$s4*/) int MONSTER_StartVertexBlood(struct _Instance *instance, struct _SVector *location, int amount)