Finish matching xSurface

This commit is contained in:
tgsm
2024-06-27 18:11:25 -04:00
committed by Steven Casper
parent 2e4509c82c
commit 89958ffe40
4 changed files with 16 additions and 29 deletions
+1 -1
View File
@@ -333,7 +333,7 @@ config.libs = [
Object(NonMatching, "SB/Core/x/xSpline.cpp"),
Object(NonMatching, "SB/Core/x/xstransvc.cpp"),
Object(NonMatching, "SB/Core/x/xString.cpp"),
Object(NonMatching, "SB/Core/x/xSurface.cpp"),
Object(Matching, "SB/Core/x/xSurface.cpp"),
Object(NonMatching, "SB/Core/x/xTimer.cpp"),
Object(NonMatching, "SB/Core/x/xTRC.cpp"),
Object(Matching, "SB/Core/x/xutil.cpp"),
+11 -23
View File
@@ -3,18 +3,16 @@
#include <types.h>
extern xSurface* surfs;
extern uint16 nsurfs;
xSurface* surfs;
uint16 nsurfs;
#if 0
// The for loop is off.
void xSurfaceInit(uint16 num_surfs)
{
nsurfs = num_surfs;
if (num_surfs != 0)
{
surfs = (xSurface*)xMemAllocSize(num_surfs * sizeof(xSurface));
for (int32 i = 0; i < nsurfs; i++)
for (uint16 i = 0; i < nsurfs; i++)
{
surfs[i].idx = i;
}
@@ -25,11 +23,11 @@ void xSurfaceInit(uint16 num_surfs)
}
}
#endif
extern "C" {
extern void __copy(void* dst, const void* src, uint32 n);
}
#if 0
// Close to being finished.
void xSurface::operator=(const xSurface& ent)
xSurface& xSurface::operator=(const xSurface& ent)
{
xBase::operator=(ent);
this->idx = ent.idx;
@@ -37,20 +35,10 @@ void xSurface::operator=(const xSurface& ent)
this->ent = ent.ent;
this->friction = ent.friction;
this->state = ent.state;
this->pad = ent.pad; // Make this call __copy();
// FIXME: Is this auto-inserted by the compiler?
__copy(&pad, &ent.pad, 3);
this->moprops = ent.moprops;
}
#endif
void xSurface::operator=(const xBase& ent)
{
this->id = ent.id;
this->baseType = ent.baseType;
this->linkCount = ent.linkCount;
this->baseFlags = ent.baseFlags;
this->link = ent.link;
this->eventFunc = ent.eventFunc;
return *this;
}
void xSurfaceExit()
@@ -67,7 +55,7 @@ void xSurfaceLoad(xSurface* ent, xSerial* s)
xBaseLoad((xBase*)ent, s);
}
void xSurfaceReset()
void xSurfaceReset(xSurface* ent)
{
}
+3 -4
View File
@@ -20,8 +20,7 @@ struct xSurface : xBase
uint8 pad[3];
void* moprops;
void operator=(const xSurface& ent);
void operator=(const xBase& ent);
xSurface& operator=(const xSurface& ent);
};
#define XSURFACE_TYPE_1 1
@@ -31,8 +30,8 @@ void xSurfaceInit(uint16 num_surfs);
void xSurfaceExit();
void xSurfaceSave(xSurface* ent, xSerial* s);
void xSurfaceLoad(xSurface* ent, xSerial* s);
void xSurfaceReset();
void xSurfaceReset(xSurface* ent);
uint16 xSurfaceGetNumSurfaces();
xSurface* xSurfaceGetByIdx(uint16 n);
#endif
#endif
+1 -1
View File
@@ -48,7 +48,7 @@ void zSurfaceExit()
void zSurfaceResetSurface(xSurface* surf)
{
xSurfaceReset();
xSurfaceReset(surf);
surf->friction = ((zSurfaceProps*)(surf->moprops))->asset->friction;
}