Web_GetGroundY

This commit is contained in:
krystalgamer 2024-05-06 20:10:33 +02:00
parent 22828b2f01
commit 04055f6ab2
10 changed files with 121 additions and 14 deletions

15
m3dcolij.cpp Normal file
View File

@ -0,0 +1,15 @@
#include "m3dinit.h"
#include "m3dcolij.h"
#include "validate.h"
void M3dColij_InitLineInfo(SLineInfo *)
{
}
void validate_SLineInfo(void)
{
VALIDATE_SIZE(SLineInfo, 0xC * 2);
VALIDATE(SLineInfo, vec_0, 0x0);
VALIDATE(SLineInfo, vec_C, 0xC);
}

20
m3dcolij.h Normal file
View File

@ -0,0 +1,20 @@
#pragma once
#ifndef M3DCOLIJ_H
#define M3DCOLIJ_H
#include "export.h"
#include "vector.h"
struct SLineInfo
{
CVector vec_0;
CVector vec_C;
};
void validate_SLineInfo(void);
EXPORT void M3dColij_InitLineInfo(SLineInfo *);
#endif

3
m3dinit.cpp Normal file
View File

@ -0,0 +1,3 @@
#include "m3dinit.h"
#include "validate.h"

8
m3dinit.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef M3DINIT_H
#define M3DINIT_H
#pragma once
#include "export.h"
#endif

6
m3dzone.cpp Normal file
View File

@ -0,0 +1,6 @@
#include "m3dzone.h"
void M3dZone_LineToItem(SLineInfo *, int)
{
}

12
m3dzone.h Normal file
View File

@ -0,0 +1,12 @@
#pragma once
#ifndef M3DZONE_H
#define M3DZONE_H
#include "export.h"
#include "m3dcolij.h"
EXPORT void M3dZone_LineToItem(SLineInfo *, int);
#endif

View File

@ -67,6 +67,7 @@
#include "mem.h"
#include "exp.h"
#include "m3dcolij.h"
template<bool b>

View File

@ -160,6 +160,18 @@ SOURCE=.\m3d.cpp
# End Source File
# Begin Source File
SOURCE=.\m3dcolij.cpp
# End Source File
# Begin Source File
SOURCE=.\m3dinit.cpp
# End Source File
# Begin Source File
SOURCE=.\m3dzone.cpp
# End Source File
# Begin Source File
SOURCE=.\main.cpp
# End Source File
# Begin Source File
@ -340,6 +352,18 @@ SOURCE=.\m3d.h
# End Source File
# Begin Source File
SOURCE=.\m3dcolij.h
# End Source File
# Begin Source File
SOURCE=.\m3dinit.h
# End Source File
# Begin Source File
SOURCE=.\m3dzone.h
# End Source File
# Begin Source File
SOURCE=.\mem.h
# End Source File
# Begin Source File

39
web.cpp
View File

@ -1,5 +1,36 @@
#include "web.h"
#include "validate.h"
#include "m3dinit.h"
#include "m3dcolij.h"
#include "m3dzone.h"
SLineInfo gLineInfo;
int gGetGroundRelated;
int gGetGroundDefaultValue;
// @NotOk
// Order assignemnt slightly different and make sure globals are properly set
int Web_GetGroundY(const CVector* a1)
{
gLineInfo.vec_0.vy = a1->vy;
gLineInfo.vec_0.vx = a1->vx;
gLineInfo.vec_0.vz = a1->vz;
gLineInfo.vec_C.vx = a1->vx;
gLineInfo.vec_C.vy = a1->vy + 0x1388000;
gLineInfo.vec_C.vz = a1->vz;
M3dColij_InitLineInfo(&gLineInfo);
M3dZone_LineToItem(&gLineInfo, 1);
if (gGetGroundRelated)
return gGetGroundDefaultValue;
return gLineInfo.vec_C.vy;
}
void validate_CImpactWeb(void){
VALIDATE_SIZE(CImpactWeb, 0x8C);
@ -53,11 +84,3 @@ void validate_CWeb(void){
void validate_CSwinger(void){
VALIDATE_SIZE(CSwinger, 0x190);
}
void validate_SLineInfo(void)
{
VALIDATE_SIZE(SLineInfo, 0xC * 2);
VALIDATE(SLineInfo, vec_0, 0x0);
VALIDATE(SLineInfo, vec_C, 0xC);
}

7
web.h
View File

@ -73,12 +73,8 @@ class CSplat : public CQuadBit {
public:
};
struct SLineInfo
{
CVector vec_0;
CVector vec_C;
};
EXPORT int Web_GetGroundY(const CVector*);
void validate_CImpactWeb(void);
@ -88,4 +84,3 @@ void validate_CDomeRing(void);
void validate_CWeb(void);
void validate_CSwinger(void);
void validate_CSplat(void);
void validate_SLineInfo(void);