DocOc::DocOc and DocOck_CreateDocOck

This commit is contained in:
krystalgamer 2024-05-17 18:29:20 +02:00
parent 7b02488d05
commit d52f363f81
4 changed files with 84 additions and 8 deletions

View File

@ -629,6 +629,7 @@ void validate_CBaddy(void){
VALIDATE_SIZE(CBaddy, 0x324);
VALIDATE(CBaddy, field_194, 0x194);
VALIDATE(CBaddy, field_198, 0x198);
VALIDATE(CBaddy, field_1A8, 0x1A8);
VALIDATE(CBaddy, field_1F4, 0x1F4);

View File

@ -37,7 +37,8 @@ public:
EXPORT void ParseScript(unsigned __int16*);
int field_194;
unsigned char padAfter194[0x1A8-0x194-4];
int field_198;
unsigned char padAfter198[0x1A8-0x198-4];
CVector field_1A8;

View File

@ -1,6 +1,76 @@
#include "docock.h"
#include "validate.h"
#include "trig.h"
#include "panel.h"
// @NotOk
// globals
// also the loops starts at 338 not 334 (it offsets negatively for some reason...)
CDocOc::CDocOc(int *a2, int a3)
{
this->field_328 = 0;
this->field_32C = 0;
this->field_330 = 0;
for (int i = 0; i<30;i++)
{
this->field_334[i].vx = 0;
this->field_334[i].vy = 0;
this->field_334[i].vz = 0;
}
this->field_50C.vx = 0;
this->field_50C.vy = 0;
this->field_50C.vz = 0;
unsigned __int16 *LinksPointer = reinterpret_cast<unsigned __int16*>(Trig_GetLinksPointer(a3));
print_if_false(*LinksPointer == 1, "Error");
Trig_GetPosition(&this->field_50C, LinksPointer[1]);
this->field_4A8 = reinterpret_cast<int>(
this->SquirtAngles(reinterpret_cast<__int16*>(this->SquirtPos(a2))));
this->InitItem("docock");
this->mFlags |= 0x480;
this->mCBodyFlags &= 0xFFEF;
this->field_3C = 0x549E80;
this->field_E2 = 600;
this->field_DC = 0;
this->AttachTo(reinterpret_cast<CBody**>(0x56E9900));
this->field_1F4 = a3;
this->field_DE = a3;
this->field_38 = 308;
this->field_31C.bothFlags = 1;
this->field_554 = 4;
this->field_4EC = 1;
this->field_324 = 25;
this->field_21E = 100;
if (*reinterpret_cast<unsigned char*>(0x0060CFC5))
{
this->mFlags |= 0x200;
this->field_28 = 2048;
this->field_2A = 2048;
this->field_2C = 2048;
}
Panel_CreateHealthBar(this, 308);
this->field_194 = 0xFFFC0000;
this->field_198 = 0x3FFF;
}
// @Ok
void DocOck_CreateDocOck(const unsigned int *stack, unsigned int *result)
{
int* v2 = reinterpret_cast<int*>(*stack);
int v3 = static_cast<int>(stack[1]);
*result = reinterpret_cast<unsigned int>(new CDocOc(v2, v3));
}
void validate_CDocOc(void){
VALIDATE_SIZE(CDocOc, 0x590);
@ -13,7 +83,5 @@ void validate_CDocOc(void){
VALIDATE(CDocOc, field_4A8, 0x4A8);
VALIDATE(CDocOc, field_4EC, 0x4EC);
VALIDATE(CDocOc, field_50C, 0x50C);
VALIDATE(CDocOc, field_510, 0x510);
VALIDATE(CDocOc, field_514, 0x514);
VALIDATE(CDocOc, field_554, 0x554);
}
}

View File

@ -1,11 +1,16 @@
#pragma once
#ifndef DOCOCK_H
#define DOCOCK_H
#include "export.h"
#include "baddy.h"
class CDocOc : public CBaddy {
public:
EXPORT CDocOc(int*, int);
int field_324;
int field_328;
int field_32C;
@ -19,9 +24,7 @@ public:
int field_4EC;
unsigned char padAfter4EC[0x1C];
int field_50C;
int field_510;
int field_514;
CVector field_50C;
unsigned char padAfter514[0x40-4];
int field_554;
@ -29,4 +32,7 @@ public:
};
void validate_CDocOc(void);
void validate_CDocOc(void);
EXPORT void DocOck_CreateDocOck(const unsigned int *stack, unsigned int *result);
#endif