Fixed all memory leaks and possible heap corruptions with the game objects

This commit is contained in:
theclub654 2023-11-21 22:37:09 -05:00
parent f98ec174c0
commit 17a3e8ed25
192 changed files with 2076 additions and 1039 deletions

View File

@ -1,5 +1,10 @@
#include "alarm.h"
void* NewAlarm()
{
return new ALARM;
}
void InitAlarm(ALARM* palarm)
{
InitSo(palarm);
@ -10,6 +15,11 @@ void DeleteAlarm(LO* plo)
delete(ALARM*)plo;
}
void* NewAlbrk()
{
return new ALBRK;
}
void DeleteAlbrk(LO* plo)
{
delete (ALBRK*)plo;

View File

@ -41,6 +41,8 @@ class ALBRK : public BRK
struct ALARM* palarm;
};
void* NewAlarm();
void InitAlarm(ALARM* palarm);
void DeleteAlarm(LO* plo);
void* NewAlbrk();
void DeleteAlbrk(LO* plo);

View File

@ -1,12 +1,11 @@
#include "alo.h"
std::vector<void*> allWorldObjs;
std::vector<LO*> allWorldObjs;
std::vector<ALO*> allSWAloObjs;
void* CreateAlo()
void* NewAlo()
{
ALO alo;
return &alo;
return new ALO;
}
void InitAlo(ALO* palo)
@ -262,7 +261,7 @@ void RenderAloAsBone(ALO* palo, CM* pcm, RO* pro)
}
void DrawLo(ALO* palo)
void DrawAlo(ALO* palo)
{
for (int i = 0; i < palo->globset.aglob.size(); i++)
@ -280,9 +279,7 @@ void DeleteWorld(SW* psw)
DeleteModel(allSWAloObjs[i]);
for (int i = 0; i < allWorldObjs.size(); i++)
DeleteObject((LO*)allWorldObjs[i]);
delete(SW*)psw;
allWorldObjs[i]->pvtlo->pfnDeleteLo(allWorldObjs[i]);
allSWAloObjs.clear();
allSWAloObjs.shrink_to_fit();
@ -290,6 +287,7 @@ void DeleteWorld(SW* psw)
allWorldObjs.shrink_to_fit();
g_psw = nullptr;
std::cout << "World Deleted\n";
}
void DeleteModel(ALO *palo)

View File

@ -108,11 +108,11 @@ public:
};
// Create ALO
void* CreateAlo();
void* NewAlo();
// Initialize ALO object
void InitAlo(ALO* palo); // NOT FINISHED
// Adds alo parent and all the alo childs into the world
void AddAloHierarchy(ALO *palo); // NOT FINISHED
void AddAloHierarchy(ALO *palo);
void RemoveAloHierarchy(ALO *palo); // NOT FINISHED
void OnAloAdd(ALO* palo); // NOT FINISHED
void OnAloRemove(ALO* palo);
@ -129,7 +129,7 @@ void RenderAloSelf(ALO* palo, CM* pcm, RO* pro);
void RenderAloGlobset(ALO* palo, CM* pcm, RO* pro);
void RenderAloLine(ALO* palo, CM* pcm, glm::vec3* ppos0, glm::vec3* ppos1, float rWidth, float uAlpha);
void RenderAloAsBone(ALO* palo, CM* pcm, RO* pro);
void DrawLo(ALO *palo);
void DrawAlo(ALO *palo);
// Deletes all world data from memory
void DeleteWorld(SW* psw);
// Deletes Model from VRAM

View File

@ -1,8 +1,12 @@
#include "aseg.h"
void* NewAseg()
{
return new ASEG;
}
void InitAseg(ASEG* paseg)
{
//std::cout << "ASEG Size: " << sizeof(ASEG)<<"\n";
InitLo(paseg);
}
@ -305,6 +309,11 @@ void DeleteAseg(LO* plo)
delete(ASEG*)plo;
}
void* NewAsegbl()
{
return new ASEGBL;
}
void DeleteAsegbl(LO* plo)
{
delete(ASEGBL*)plo;

View File

@ -51,8 +51,10 @@ class ASEGBL : public ASEG
static int LoadAsegaCount;
void* NewAseg();
void InitAseg(ASEG* paseg);
void LoadAsegFromBrx(ASEG* paseg, CBinaryInputStream* pbis);
void LoadAsegEventsFromBrx(CBinaryInputStream* pbis, int fFrame);
void DeleteAseg(LO* plo);
void* NewAsegbl();
void DeleteAsegbl(LO* plo);

View File

@ -1,8 +1,12 @@
#include "barrier.h"
void* NewBarrier()
{
return new BARRIER;
}
void InitBarrier(BARRIER* pbarrier)
{
//std::cout << "BARRIER Size: " << sizeof(BARRIER) << "\n";
InitSo(pbarrier);
}

View File

@ -25,5 +25,6 @@ class BARRIER : public SO
struct SO* psoLastWarped;
};
void* NewBarrier();
void InitBarrier(BARRIER* pbarrier);
void DeleteBarrier(LO* plo);

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,10 @@
#include "binoc.h"
void* NewScan()
{
return new SCAN;
}
void DeleteScan(LO* plo)
{
delete(SCAN*)plo;

View File

@ -7,4 +7,5 @@ class SCAN : public PNT
TBID tbidCaption;
};
void* NewScan();
void DeleteScan(LO* plo);

View File

@ -1,5 +1,10 @@
#include "blip.h"
void* NewBlipg()
{
return new BLIPG;
}
void InitBlipg(BLIPG* pblipg)
{
//std::cout << "BLIPG Size: " << sizeof(BLIPG) << "\n";

View File

@ -45,6 +45,7 @@ class BLIPG : public ALO
DLE dle;
};
void* NewBlipg();
void InitBlipg(BLIPG* pblipg);
void OnBlipgAdd(BLIPG* pblipg);
void RenderBlipgSelf(BLIPG* pblipg, CM* pcm, RO* pro);

View File

@ -1,8 +1,12 @@
#include "bomb.h"
void* NewBomb()
{
return new BOMB;
}
void InitBomb(BOMB* pbomb)
{
//std::cout << "BOMB Size: " << sizeof(BOMB) << "\n";
InitSo(pbomb);
}

View File

@ -41,6 +41,7 @@ class BOMB : public SO
struct SFX* psfxDet;
};
void* NewBomb();
void InitBomb(BOMB* pbomb);
void OnBombAdd(BOMB* pbomb);
void LoadBombFromBrx(BOMB* pbomb, CBinaryInputStream* pbis);

View File

@ -1,5 +1,10 @@
#include "bone.h"
void* NewBone()
{
return new BONE;
}
void RenderBoneSelf(BONE* pbone, CM* pcm, RO* pro)
{
RenderSoSelf(pbone, pcm, pro);
@ -10,6 +15,11 @@ void DeleteBone(LO* plo)
delete (BONE*)plo;
}
void* NewLBone()
{
return new LBONE;
}
void RenderLboneSelf(LBONE* plbone, CM* pcm, RO* pro)
{
RenderAloSelf(plbone, pcm, pro);

View File

@ -11,7 +11,9 @@ class LBONE : public ALO
public:
};
void* NewBone();
void RenderBoneSelf(BONE* pbone, CM* pcm, RO* pro);
void DeleteBone(LO* plo);
void* NewLBone();
void RenderLboneSelf(LBONE* plbone, CM* pcm, RO* pro);
void DeleteLBone(LO* plo);

View File

@ -1,5 +1,10 @@
#include "break.h"
void* NewBrk()
{
return new BRK;
}
void InitBrk(BRK* pbrk)
{
InitSo(pbrk);
@ -10,11 +15,21 @@ void DeleteBrk(LO* plo)
delete (BRK*)plo;
}
void* NewBrkp()
{
return new BRKP;
}
void DeleteBrkp(LO* plo)
{
delete (BRKP*)plo;
}
void* NewBreak()
{
return new BREAK;
}
void InitBreak(BREAK* pbreak)
{
InitBrk(pbreak);
@ -25,6 +40,11 @@ void DeleteBreak(LO* plo)
delete (BREAK*)plo;
}
void* NewFragile()
{
return new FRAGILE;
}
void InitFragile(FRAGILE* pfragile)
{
InitBrk(pfragile);
@ -35,7 +55,12 @@ void DeleteFragile(LO* plo)
delete (FRAGILE*)plo;
}
void DeleteZapBreak(LO* plo)
void* NewZapbreak()
{
return new ZAPBREAK;
}
void DeleteZapbreak(LO* plo)
{
delete (ZAPBREAK*)plo;
}

View File

@ -93,12 +93,17 @@ class ZAPBREAK : public FRAGILE
struct PO* ppoZap;
};
void* NewBrk();
void InitBrk(BRK* pbrk);
void DeleteBrk(LO* plo);
void* NewBrkp();
void DeleteBrkp(LO* plo);
void* NewBreak();
void InitBreak(BREAK* pbreak);
void DeleteBreak(LO* plo);
void* NewFragile();
void InitFragile(FRAGILE* pfragile);
void DeleteFragile(LO* plo);
void DeleteZapBreak(LO* plo);
void* NewZapbreak();
void DeleteZapbreak(LO* plo);
void LoadBrkFromBrx(BRK* pbrk, CBinaryInputStream* pbis);

View File

@ -9,16 +9,16 @@ LO* PloNew(CID cid, SW* psw, ALO* paloParent, OID oid, int isplice)
{
VTLO *pvtlo = (VTLO*)g_mpcidpvt[cid];
SW* localObject = (SW*)new int[pvtlo->cb]();
LO *localObject = (LO*)pvtlo->pfnNewLo();
localObject->pvtlo = pvtlo;
localObject->oid = oid;
if (cid == CID_SW)
{
InitSwDlHash(localObject);
InitSwDlHash((SW*)localObject);
localObject->paloParent = paloParent;
psw = localObject;
psw = (SW*)localObject;
}
else

View File

@ -1,7 +1,7 @@
#pragma once
#include "lo.h"
extern std::vector<void*> allWorldObjs;
extern std::vector<LO*> allWorldObjs;
// Initializes Options
void StartupBrx();

View File

@ -1,8 +1,12 @@
#include "button.h"
void* NewButton()
{
return new BUTTON;
}
void InitButton(BUTTON* pbutton)
{
//std::cout << "BUTTON Size: " << sizeof(BUTTON) << "\n";
InitSo(pbutton);
}
@ -11,9 +15,13 @@ void DeleteButton(LO* plo)
delete(BUTTON*)plo;
}
void* NewVolbtn()
{
return new VOLBTN;
}
void InitVolbtn(VOLBTN* pvolbtn)
{
//std::cout << "VOLBTN Size: " << sizeof(VOLBTN) << "\n";
InitSo(pvolbtn);
}

View File

@ -88,8 +88,10 @@ class VOLBTN : public SO
int fSendChangeEvents;
};
void* NewButton();
void InitButton(BUTTON* pbutton);
void DeleteButton(LO* plo);
void* NewVolbtn();
void InitVolbtn(VOLBTN* pvolbtn);
void LoadButtonFromBrx(BUTTON *pbutton, CBinaryInputStream *pbis);
void LoadVolbtnFromBrx(VOLBTN *pvolbtn, CBinaryInputStream *pbis);

View File

@ -1,8 +1,12 @@
#include "can.h"
void* NewCan()
{
return new CAN;
}
void InitCan(CAN* pcan)
{
std::cout << "CAN Size: " << sizeof(CAN) << "\n";
InitBreak(pcan);
}

View File

@ -37,5 +37,6 @@ class CAN : public BREAK
int cFired;
};
void* NewCan();
void InitCan(CAN *pcan);
void DeleteCan(LO* plo);

View File

@ -1,8 +1,12 @@
#include "chkpnt.h"
void* NewChkpnt()
{
return new CHKPNT;
}
void InitChkpnt(CHKPNT* pchkpnt)
{
//std::cout << "VOL Size: " << sizeof(VOL) << "\n";
InitAlo(pchkpnt);
}
@ -16,6 +20,11 @@ void DeleteChkpnt(LO* plo)
delete(CHKPNT*)plo;
}
void* NewVol()
{
return new VOL;
}
void LoadVolFromBrx(VOL* pvol, CBinaryInputStream* pbis)
{
pbis->ReadMatrix();

View File

@ -28,8 +28,10 @@ class VOL : public XFM
struct TBSP* atbsp;
};
void* NewChkpnt();
void InitChkpnt(CHKPNT* pchkpnt);
void LoadChkpntFromBrx(CHKPNT* pchkpnt, CBinaryInputStream* pbis);
void DeleteChkpnt(LO* plo);
void* NewVol();
void LoadVolFromBrx(VOL* pvol, CBinaryInputStream* pbis);
void DeleteVol(LO* plo);

View File

@ -1,11 +1,15 @@
#include "cm.h"
void* NewCm()
{
return new CM;
}
void InitCm(CM* pcm)
{
//std::cout << "CM Size: " << sizeof(CM) << "\n";
InitLo(pcm);
pcm->radFOV = 45.0;
pcm->radFOV = 1.0;
pcm->rAspect = 1.298701;
pcm->sNearClip = 100.0;
pcm->sFarClip = 20000.0;
@ -18,4 +22,4 @@ void InitCm(CM* pcm)
void DeleteCm(LO* plo)
{
delete(CM*)plo;
}
}

View File

@ -138,10 +138,15 @@ struct CPTN : public CPLCY
float vz;
glm::vec3 posEyePrev;
};
// Camera Object
class CM : public LO
{
public:
glm::vec3 pos;
glm::vec4 anormalFrustrumTranspose[3];
glm::mat3 mat;
float rMRDAdjust;
glm::mat4 matProj;
glm::mat4 matWorldToClip;
glm::mat4 matClipToWorld;
@ -201,6 +206,7 @@ public:
CPTN cptn;
};
void* NewCm();
// Initialize camera object
void InitCm(CM* pcm); // NOT FINISHED
void DeleteCm(LO* plo);

View File

@ -1,8 +1,12 @@
#include "cnvo.h"
void* NewCnvo()
{
return new CNVO;
}
void InitCnvo(CNVO* pcnvo)
{
//std::cout << "CNVO Size: " << sizeof(CNVO) << "\n";
InitSo(pcnvo);
}

View File

@ -9,6 +9,7 @@ class CNVO : public SO
float svvAvg;
};
void* NewCnvo();
void InitCnvo(CNVO* pcnvo);
void LoadCnvoFromBrx(CNVO* pcnvo, CBinaryInputStream* pbis);
void DeleteCnvo(LO* plo);

View File

@ -1,12 +1,16 @@
#include "coin.h"
void* NewDprize()
{
return new DPRIZE;
}
void InitDprize(DPRIZE *pdprize)
{
pdprize->dprizesInit = DPRIZES_Normal;
pdprize->dprizes = DPRIZES_Nil;
pdprize->svcAttract = 30.0;
pdprize->oidInitialState = OID_Nil;
//std::cout << "DPRIZE SIZE: " << sizeof(DPRIZE) << "\n";
InitAlo(pdprize);
AppendDlEntry(&pdprize->psw->dlDprize, pdprize);
@ -17,9 +21,13 @@ void DeleteDprize(LO* plo)
delete(DPRIZE*)plo;
}
void* NewCharm()
{
return new CHARM;
}
void InitCharm(CHARM* pcharm)
{
//std::cout << "CHARM Size: " << sizeof(CHARM) << "\n";
InitDprize(pcharm);
}
@ -28,9 +36,13 @@ void DeleteCharm(LO* plo)
delete(CHARM*)plo;
}
void* NewCoin()
{
return new COIN;
}
void InitCoin(COIN* pcoin)
{
//std::cout << "COIN Size: " << sizeof(COIN) << "\n";
InitDprize(pcoin);
}
@ -39,9 +51,13 @@ void DeleteCoin(LO* plo)
delete(COIN*)plo;
}
void* NewKey()
{
return new KEY;
}
void InitKey(KEY* pkey)
{
//std::cout << "KEY Size: " << sizeof(KEY) << "\n";
InitDprize(pkey);
}
@ -50,9 +66,13 @@ void DeleteKey(LO* plo)
delete(KEY*)plo;
}
void* NewGold()
{
return new GOLD;
}
void InitGold(GOLD* pgold)
{
//std::cout << "GOLD Size: " << sizeof(GOLD) << "\n";
InitDprize(pgold);
pgold->psw->cgoldAll++;
}

View File

@ -76,14 +76,19 @@ class GOLD : public DPRIZE
int fStartTimedChallenge;
};
void* NewDprize();
void InitDprize(DPRIZE *pdprize);//NOT FINISHED
void DeleteDprize(LO* plo);
void* NewCharm();
void InitCharm(CHARM* pcharm);
void DeleteCharm(LO* plo);
void* NewCoin();
void InitCoin(COIN* pcoin);
void DeleteCoin(LO* plo);
void* NewKey();
void InitKey(KEY* pkey);
void DeleteKey(LO* plo);
void* NewGold();
void InitGold(GOLD* pgold);
void DeleteGold(LO* plo);
void LoadDprizeFromBrx(DPRIZE* pdprize, CBinaryInputStream *pbis);//NOT FINISHED

View File

@ -1,15 +1,12 @@
#include "crusher.h"
void* CreateCrfodb()
void* NewCrfodb()
{
CRFODB crfodb;
return &crfodb;
return new CRFODB;
}
void InitCrfodb(CRFODB* pcrfodb)
{
std::cout << "CRFODB Size: " << sizeof(CRFODB) << "\n";
std::cout << "CRBRAIN Size: " << sizeof(CRBRAIN) << "\n";
InitStepGuard(pcrfodb);
}
@ -18,10 +15,9 @@ void DeleteCrfodb(LO* plo)
delete (CRFODB*)plo;
}
void* CreateCrfod()
void* NewCrfod()
{
CRFOD crfod;
return &crfod;
return new CRFOD;
}
void OnCrfodAdd(CRFOD* pcrfod)
@ -35,10 +31,9 @@ void DeleteCrfod(LO* plo)
delete (CRFOD*)plo;
}
void* CreateCrfodk()
void* NewCrfodk()
{
CRFODK crfodk;
return &crfodk;
return new CRFODK;
}
void DeleteCrfodk(LO* plo)
@ -46,6 +41,11 @@ void DeleteCrfodk(LO* plo)
delete (CRFODK*)plo;
}
void* NewCrbrain()
{
return new CRBRAIN;
}
void InitCrbrain(CRBRAIN* pcrbrain)
{
InitAlo(pcrbrain);

View File

@ -26,13 +26,14 @@ class CRFODK : public CRFOD
public:
};
void*CreateCrfodb();
void* NewCrfodb();
void InitCrfodb(CRFODB *pcrfodb);
void DeleteCrfodb(LO* plo);
void*CreateCrfod();
void*NewCrfod();
void OnCrfodAdd(CRFOD* pcrfod);
void DeleteCrfod(LO* plo);
void*CreateCrfodk();
void* NewCrfodk();
void DeleteCrfodk(LO* plo);
void* NewCrbrain();
void InitCrbrain(CRBRAIN* pcrbrain);
void DeleteCrbrain(LO* plo);

View File

@ -1,5 +1,10 @@
#include "cycle.h"
void* NewCycle()
{
return new CYCLE;
}
void InitCycle(CYCLE* pcycle)
{
std::cout << "CYCLE Size: " << sizeof(CYCLE) << "\n";

View File

@ -50,6 +50,7 @@ class CYCLE : public PO
float tCycles;
};
void* NewCycle();
void InitCycle(CYCLE *pcycle);
void RenderCycleSelf(CYCLE* pcycle, CM* pcm, RO* pro);
void DeleteCycle(LO* plo);

View File

@ -1,8 +1,12 @@
#include "dart.h"
void* NewDart()
{
return new DART;
}
void InitDart(DART* pdart)
{
//std::cout << "DART Size: " << sizeof(DART) << "\n";
InitSo(pdart);
}

View File

@ -33,6 +33,7 @@ class DART : public SO
struct EXPL* pexpl;
};
void*NewDart();
void InitDart(DART* pdart);
void OnDartAdd(DART* pdart);
void LoadDartFromBrx(DART* pdart, CBinaryInputStream* pbis);

View File

@ -1,12 +1,16 @@
#include "dartgun.h"
void* NewDartgun()
{
return new DARTGUN;
}
void InitDartgun(DARTGUN* pdartgun)
{
//std::cout << "DARTGUN Size: " << sizeof(DARTGUN) << "\n";
InitBreak(pdartgun);
}
void DeleteDartGun(LO* plo)
void DeleteDartgun(LO* plo)
{
delete (DARTGUN*)plo;
}

View File

@ -29,5 +29,6 @@ class DARTGUN : public BREAK
int fJtInTargetArea;
};
void* NewDartgun();
void InitDartgun(DARTGUN* pdartgun);
void DeleteDartGun(LO* plo);
void DeleteDartgun(LO* plo);

View File

@ -9,7 +9,7 @@ extern bool loadEmitMesh;
// Local Obeject
class LO;
enum MSGID;
void* CreateLo();
void* NewLo();
void InitLo(LO* plo);
void SetLoDefaults(LO* plo);
void AddLo(LO* plo);
@ -28,9 +28,10 @@ void SubscribeLoObject(LO* plo, LO* ploTarget);
void UnsubscribeLoObject(LO* plo, LO* ploTarget);
void SubscribeLoStruct(LO* plo, void* pfnmq, void* pvContext);
void UnsubscribeLoStruct(LO* plo, void* pfnmq, void* pvContext);
void DeleteLo(LO* plo);
// A Local Object;
void* CreateAlo();
void* NewAlo();
void InitAlo(ALO* palo);
void AddAloHierarchy(ALO* palo);
void RemoveAloHierarchy(ALO* palo);
@ -48,7 +49,7 @@ void DeleteAlo(LO* palo);
// Static Object
class SO;
struct SOP;
void* CreateSo();
void* NewSo();
void InitSo(SO* pso);
void OnSoAdd(SO* pso);
void LoadSoFromBrx(SO* pso, CBinaryInputStream* pbis);
@ -58,19 +59,19 @@ void DeleteSo(LO* plo);
// Player Object
class PO;
void* CreatePo();
void* NewPo();
void InitPo(PO* ppo);
void OnPoAdd(PO* ppo);
void DeletePo(LO* plo);
class STEP;
void* CreateStep();
void* NewStep();
void InitStep(STEP* pstep);
void DeleteStep(LO* plo);
// Sly
class JT;
void* CreateJt();
void* NewJt();
void InitJt(JT* pjt);
void LoadJtFromBrx(JT* pjt, CBinaryInputStream* pbis);
void RenderJtAll(JT* pjt, CM* pcm, RO* pro);
@ -79,7 +80,8 @@ void DeleteJt(LO* plo);
// Guard
class STEPGUARD;
void* CreateStepguard();
void* NewStepguard();
void InitStepGuard(STEPGUARD *pstepguard);
void OnStepguardAdd(STEPGUARD* pstepguard);
void LoadStepGuardFromBrx(STEPGUARD *pstepguard, CBinaryInputStream* pbis);
@ -87,280 +89,327 @@ void RenderStepguardSelf(STEPGUARD* pstepguard, CM* pcm, RO* pro);
void DeleteStepguard(LO* plo);
class SMARTGUARD;
void* CreateSmartguard();
void* NewSmartguard();
void InitSmartGuard(SMARTGUARD* psmartguard);
void DeleteSmartGuard(LO* plo);
class GOMER;
void* CreateGomer();
void* NewGomer();
void InitGomer(GOMER* pgomer);
void DeleteGomer(LO* plo);
class UBG;
void* CreateUbg();
void* NewUbg();
void DeleteUbg(LO* plo);
class MBG;
void* CreateMbg();
void* NewMbg();
void InitMbg(MBG* pmbg);
void LoadMbgFromBrx(MBG *pmbg, CBinaryInputStream* pbis);
void DeleteMbg(LO* plo);
class BHG;
void* CreateBhg();
void* NewBhg();
void InitBhg(BHG* pbhg);
void DeleteBhg(LO* plo);
class MURRAY;
void* CreateMurray();
void* NewMurray();
void InitMurray(MURRAY* pmurray);
void DeleteMurray(LO* plo);
class PUFFC;
void* CreatePuffc();
void* NewPuffc();
void DeletePuffc(LO* plo);
class CRFOD;
void* CreateCrfod();
void* NewCrfod();
void OnCrfodAdd(CRFOD* pcrfod);
void DeleteCrfod(LO* plo);
class CRFODB;
void* CreateCrfodb();
void* NewCrfodb();
void InitCrfodb(CRFODB* pcrfodb);
void DeleteCrfodb(LO* plo);
class CRFODK;
void* CreateCrfodk();
void* NewCrfodk();
void DeleteCrfodk(LO* plo);
class TANK;
void* NewTank();
void InitTank(TANK* ptank);
void RenderTankAll(TANK* ptank, CM* pcm, RO* pro);
void DeleteTank(LO* plo);
class JP;
void* NewJp();
void InitJp(JP* pjp);
void RenderJpAll(JP* pjp, CM* pcm, RO* pro);
void DeleteJp(LO* plo);
class HG;
void* NewHg();
void InitHg(HG* phg);
void DeleteHg(LO* plo);
class MECHA;
void* NewMecha();
void InitMecha(MECHA* pmecha);
void DeleteMecha(LO* plo);
class ROV;
void* NewRov();
void InitRov(ROV* prov);
void LoadRovFromBrx(ROV *prov, CBinaryInputStream* pbis);
void DeleteRov(LO* plo);
class TURRET;
void* NewTurret();
void DeleteTurret(LO* plo);
class VAULT;
void* NewVault();
void InitVault(VAULT* pvault);
void DeleteVault(LO* plo);
class PUFFER;
void* NewPuffer();
void InitPuffer(PUFFER* ppuffer);
void LoadPufferFromBrx(PUFFER *ppuffer, CBinaryInputStream* pbis);
void DeletePuffer(LO* plo);
class MGV;
void* NewMgv();
void InitMgv(MGV* pmgv);
void LoadMgvFromBrx(MGV *pmgv, CBinaryInputStream* pbis);
void DeleteMGV(LO* plo);
void DeleteMgv(LO* plo);
class SUV;
void* NewSuv();
void InitSuv(SUV* psuv);
void DeleteSUV(LO* plo);
void DeleteSuv(LO* plo);
class CYCLE;
void* NewCycle();
void InitCycle(CYCLE* pcycle);
void RenderCycleSelf(CYCLE* pcycle, CM* pcm, RO* pro);
void DeleteCycle(LO* plo);
class LGN;
void* NewLgn();
void InitLgn(LGN* plgn);
void RenderLgnAll(LGN* plgn, CM* pcm, RO* pro);
void DeleteLgn(LO* plo);
class JACK;
void* NewJack();
void InitJack(JACK* pjack);
void DeleteJack(LO* plo);
class RIPG;
void* NewRipg();
void InitRipg(RIPG* pripg);
void DeleteRipg(LO* plo);
class WATER;
void* NewWater();
void InitWater(WATER* pwater);
void DeleteWater(LO* plo);
class BRK;
void* NewBrk();
void InitBrk(BRK* pbrk);
void LoadBrkFromBrx(BRK *pbrk, CBinaryInputStream* pbis);
void DeleteBrk(LO* plo);
class BREAK;
void* NewBreak();
void InitBreak(BREAK* pbreak);
void DeleteBreak(LO* plo);
class ALBRK;
void* NewAlbrk();
void DeleteAlbrk(LO* plo);
class CAN;
void* NewCan();
void InitCan(CAN* pcan);
void DeleteCan(LO* plo);
class DARTGUN;
void* NewDartgun();
void InitDartgun(DARTGUN* pdartgun);
void DeleteDartGun(LO* plo);
void DeleteDartgun(LO* plo);
class SWP;
void* NewSwp();
void InitSwp(SWP* pswp);
void DeleteSwp(LO* plo);
class FRAGILE;
void* NewFragile();
void InitFragile(FRAGILE* pfragile);
void DeleteFragile(LO* plo);
class ZAPBREAK;
void DeleteZapBreak(LO* plo);
void* NewZapbreak();
void DeleteZapbreak(LO* plo);
class BRKP;
void* NewBrkp();
void DeleteBrkp(LO* plo);
class BUTTON;
void* NewButton();
void InitButton(BUTTON* pbutton);
void LoadButtonFromBrx(BUTTON* pbutton, CBinaryInputStream* pbis);
void DeleteButton(LO* plo);
class VOLBTN;
void* NewVolbtn();
void InitVolbtn(VOLBTN* pvolbtn);
void LoadVolbtnFromBrx(VOLBTN* pvolbtn, CBinaryInputStream* pbis);
void DeleteVolbtn(LO* plo);
class JLOVOL;
void* NewJlovol();
void InitJlovol(JLOVOL* pjlovol);
void DeleteJlovol(LO* plo);
class SQUISH;
void* NewSquish();
void LoadSquishFromBrx(SQUISH* psquish, CBinaryInputStream* pbis);
void DeleteSquish(LO* plo);
class BONE;
void* NewBone();
void DeleteBone(LO* plo);
class LBONE;
void RenderBoneSelf(BONE* pbone, CM* pcm, RO* pro);
void RenderLboneSelf(LBONE* plbone, CM* pcm, RO* pro);
void DeleteLBone(LO* plo);
class SPRIZE;
void* NewSprize();
void InitSprize(SPRIZE* psprize);
void LoadSprizeFromBrx(SPRIZE* psprize, CBinaryInputStream* pbis);
void DeleteSprize(LO* plo);
class SCPRIZE;
void* NewScprize();
void InitScprize(SCPRIZE* pscprize);
void DeleteScprize(LO* plo);
class LIFETKN;
void* NewLifetkn();
void DeleteLifetkn(LO* plo);
class CLUE;
void* NewClue();
void InitClue(CLUE* pclue);
void LoadClueFromBrx(CLUE* pclue, CBinaryInputStream* pbis);
void RenderClueAll(CLUE* pclue, CM* pcm, RO* pro);
void DeleteClue(LO* plo);
class ALARM;
void* NewAlarm();
void InitAlarm(ALARM* palarm);
void DeleteAlarm(LO* plo);
class SENSOR;
void* NewSensor();
void InitSensor(SENSOR* psensor);
void DeleteSensor(LO* plo);
// Laser Sensor
class LASEN;
void* NewLasen();
void InitLasen(LASEN* plasen);
void LoadLasenFromBrx(LASEN* plasen, CBinaryInputStream* pbis);
void DeleteLasen(LO* plo);
class CAMSEN;
void* NewCamsen();
void InitCamsen(CAMSEN* pcamsen);
void DeleteCamsen(LO* plo);
class PRSEN;
void* NewPrsen();
void InitPrsen(PRSEN* pprsen);
void DeletePrsen(LO* plo);
class BARRIER;
void* NewBarrier();
void InitBarrier(BARRIER* pbarrier);
void DeleteBarrier(LO* plo);
class IKH;
void* NewIkh();
void DeleteIkh(LO* plo);
class TZP;
void* NewTzp();
void InitTzp(TZP* ptzp);
void RenderTzpAll(TZP* ptzp, CM* pcm, RO* pro);
void DeleteTzp(LO* plo);
class VOLZP;
void* NewVolzp();
void InitVolzp(VOLZP* pvolzp);
void DeleteVolzp(LO* plo);
// Convo
class CNVO;
void* NewCnvo();
void InitCnvo(CNVO* pcnvo);
void LoadCnvoFromBrx(CNVO* pcnvo, CBinaryInputStream* pbis);
void DeleteCnvo(LO* plo);
class HBSK;
void* NewHbsk();
void InitHbsk(HBSK* phbsk);
void OnHbskAdd(HBSK* phbsk);
void LoadHbskFromBrx(HBSK* phbsk, CBinaryInputStream* pbis);
void DeleteHbsk(LO* plo);
class BOMB;
void* NewBomb();
void InitBomb(BOMB* pbomb);
void OnBombAdd(BOMB* pbomb);
void LoadBombFromBrx(BOMB* pbomb, CBinaryInputStream* pbis);
void DeleteBomb(LO* plo);
class MISSILE;
void* NewMissile();
void InitMissile(MISSILE* pmissile);
void LoadMissileFromBrx(MISSILE* pmissile, CBinaryInputStream* pbis);
void RenderMissileAll(MISSILE* pmissile, CM* pcm, RO* pro);
void DeleteMissile(LO* plo);
class ACCMISS;
void* NewAccmiss();
void InitAccmiss(ACCMISS* paccmiss);
void DeleteAccmiss(LO* plo);
class TARMISS;
void* NewTarmiss();
void InitTarmiss(TARMISS* ptarmiss);
void DeleteTarmiss(LO* plo);
class SPLMISS;
void* NewSplmiss();
void DeleteSplmiss(LO* plo);
class GROUNDMISS;
void* NewGroundmiss();
void InitGroundmiss(GROUNDMISS* pgroundmiss);
void DeleteGroundmiss(LO* plo);
class FLY;
void* NewFly();
void InitFly(FLY* pfly);
void LoadFlyFromBrx(FLY* pfly, CBinaryInputStream* pbis);
void DeleteFly(LO* plo);
class RAT;
void* NewRat();
void InitRat(RAT* prat);
void OnRatAdd(RAT* prat);
void LoadRatFromBrx(RAT* prat, CBinaryInputStream* pbis);
@ -368,368 +417,456 @@ void RenderRatAll(RAT* prat, CM* pcm, RO* pro);
void DeleteRat(LO* plo);
class ROH;
void* NewRoh();
void InitRoh(ROH* proh);
void LoadRohFromBrx(ROH* proh, CBinaryInputStream* pbis);
void DeleteRoh(LO* plo);
class ROC;
void* NewRoc();
void InitRoc(ROC* proc);
void LoadRocFromBrx(ROC* proc, CBinaryInputStream* pbis);
void DeleteRoc(LO* plo);
class ROST;
void* NewRost();
void InitRost(ROST* prost);
void LoadRostFromBrx(ROST* prost, CBinaryInputStream* pbis);
void DeleteRost(LO* plo);
class ROP;
void* NewRop();
void InitRop(ROP* prop);
void LoadRopFromBrx(ROP* prop, CBinaryInputStream* pbis);
void DeleteRop(LO* plo);
class DART;
void* NewDart();
void InitDart(DART* pdart);
void OnDartAdd(DART* pdart);
void LoadDartFromBrx(DART* pdart, CBinaryInputStream* pbis);
void DeleteDart(LO* plo);
class UBV;
void* NewUbv();
void DeleteUbv(LO* plo);
class UBP;
void* NewUbp();
void InitUbg(UBG* pubg);
void RenderUbpAll(UBP* pubp, CM* pcm, RO* pro);
void DeleteUbp(LO* plo);
class DSP;
void* NewDsp();
void DeleteDsp(LO* plo);
class JLO;
void* NewJlo();
void InitJlo(JLO* pjlo);
void LoadJloFromBrx(JLO* pjlo, CBinaryInputStream* pbis);
void DeleteJlo(LO* plo);
class PUFFT;
void* NewPufft();
void DeletePufft(LO* plo);
class MRKV;
void* NewMrkv();
void InitMrkv(MRKV* pmrkv);
void DeleteMrkv(LO* plo);
class LGNB;
void* NewLgnb();
void InitLgnb(LGNB* plgnb);
void DeleteLgnb(LO* plo);
class BLIPG;
void* NewBlipg();
void InitBlipg(BLIPG* pblipg);
void OnBlipgAdd(BLIPG* pblipg);
void RenderBlipgSelf(BLIPG* pblipg, CM* pcm, RO* pro);
void DeleteBlipg(LO* plo);
class CAMERA;
void* NewCamera();
void InitCamera(CAMERA* pcamera);
void DeleteCamera(LO* plo);
class LBONE;
void* NewLBone();
void RenderBoneSelf(BONE* pbone, CM* pcm, RO* pro);
void RenderLboneSelf(LBONE* plbone, CM* pcm, RO* pro);
void DeleteLBone(LO* plo);
class EMITTER;
void* NewEmitter();
void InitEmitter(EMITTER* pemitter);
void LoadEmitterFromBrx(EMITTER* pemitter, CBinaryInputStream* pbis);
void RenderEmitterSelf(EMITTER* pemitter, CM* pcm, RO* pro);
void DeleteEmitter(LO* plo);
class LIGHT;
void* NewLight();
void InitLight(LIGHT* plight);
void OnLightAdd(LIGHT* plight);
void DeleteLight(LO* plo);
class LIKH;
void* NewLikh();
void DeleteLikh(LO* plo);
// Check Point
class CHKPNT;
void* NewChkpnt();
void InitChkpnt(CHKPNT* pchkpnt);
void LoadChkpntFromBrx(CHKPNT* pchkpnt, CBinaryInputStream* pbis);
void DeleteChkpnt(LO* plo);
class PROXY;
void* NewProxy();
void InitProxy(PROXY* pproxy);
void LoadProxyFromBrx(PROXY* pproxy, CBinaryInputStream* pbis);
void DeleteProxy(LO* plo);
class SKY;
void* NewSky();
void DeleteSky(LO* plo);
class DPRIZE;
void* NewDprize();
void InitDprize(DPRIZE* pdprize);
void LoadDprizeFromBrx(DPRIZE* pdprize, CBinaryInputStream* pbis);
void DeleteDprize(LO* plo);
class CHARM;
void* NewCharm();
void InitCharm(CHARM* pcharm);
void RenderDprizeAll(DPRIZE* pdprize, CM* pcm, RO* pro);
void DeleteCharm(LO* plo);
class COIN;
void* NewCoin();
void InitCoin(COIN* pcoin);
void DeleteCoin(LO* plo);
class KEY;
void* NewKey();
void InitKey(KEY* pkey);
void DeleteKey(LO* plo);
class GOLD;
void* NewGold();
void InitGold(GOLD* pgold);
void DeleteGold(LO* plo);
class LOCK;
void* NewLock();
void LoadLockFromBrx(LOCK* plock, CBinaryInputStream* pbis);
void DeleteLock(LO* plo);
class LOCKG;
void* NewLockg();
void LoadLockgFromBrx(LOCKG* plockg, CBinaryInputStream* pbis);
void DeleteLockg(LO* plo);
class TAIL;
void* NewTail();
void InitTail(TAIL* ptail);
void DeleteTail(LO* plo);
class ROB;
void* NewRob();
void InitRob(ROB* prob);
void DeleteRob(LO* plo);
class FLASH;
void* NewFlash();
void InitFlash(FLASH* pflash);
void LoadFlashFromBrx(FLASH* pflash, CBinaryInputStream* pbis);
void DeleteFlash(LO* plo);
class DYSH;
void* NewDysh();
void InitDysh(DYSH* pdysh);
void RenderDyshSelf(DYSH* pdysh, CM* pcm, RO* pro);
void DeleteDysh(LO* plo);
class SCENTMAP;
void* NewScentmap();
void InitScentmap(SCENTMAP* pscentmap);
void DeleteScentmap(LO* plo);
class WAYPOINT;
void* NewWaypoint();
void InitWaypoint(WAYPOINT* pwaypoint);
void DeleteWaypoint(LO* plo);
class TN;
void* NewTn();
void InitTn(TN* ptn);
void LoadTnFromBrx(TN* ptn, CBinaryInputStream* pbis);
void LoadTbspFromBrx(CBinaryInputStream* pbis);
void DeleteTn(LO* plo);
class JLOC;
void* NewJloc();
void InitJloc(JLOC* pjloc);
void LoadJlocFromBrx(JLOC* pjloc, CBinaryInputStream* pbis);
void DeleteJloc(LO* plo);
class DIALOG;
void* NewDialog();
void InitDialog(DIALOG* pdialog);
void LoadDialogFromBrx(DIALOG* pdialog, CBinaryInputStream* pbis);
void DeleteDialog(LO* plo);
class SPEAKER;
void* NewSpeaker();
void InitSpeaker(SPEAKER* pspeaker);
void DeleteSpeaker(LO* plo);
class ROPE;
void* NewRope();
void InitRope(ROPE* prope);
void RenderRopeAll(ROPE* prope, CM* pcm, RO* pro);
void DeleteRope(LO* plo);
class WM;
void* NewWm();
void RenderWmAll(WM* pwm, CM* pcm, RO* pro);
void DeleteWm(LO* plo);
class PUFFB;
void* NewPuffb();
void DeletePuffb(LO* plo);
class CRBRAIN;
void* NewCrbrain();
void InitCrbrain(CRBRAIN* pcrbrain);
void DeleteCrbrain(LO* plo);
class MGC;
void* NewMgc();
void InitMgc(MGC* pmgc);
void LoadMgcFromBrx(MGC* pmgc, CBinaryInputStream* pbis);
void DeleteMgc(LO* plo);
class JACKB;
void* NewJackb();
void InitJackb(JACKB* pjackb);
void DeleteJackb(LO* plo);
class JACKN;
void* NewJackn();
void InitJackn(JACKN* pjackn);
void LoadJacknFromBrx(JACKN* pjackn, CBinaryInputStream* pbis);
void DeleteJackn(LO* plo);
class JACKF;
void* NewJackf();
void InitJackf(JACKF* pjackf);
void DeleteJackf(LO* plo);
// Static World
class SW;
void* CreateSw();
void* NewSw();
void InitSw(SW* psw);
void LoadSwFromBrx(SW* psw, CBinaryInputStream* pbis);
void UpdateSw(SW* psw, float dt);
void GetSwParams(SW* psw, SOP** ppsop);
void DeleteSwObj(LO* plo);
// Camera
void* NewCm();
void InitCm(CM* pcm);
void DeleteCm(LO* plo);
class SHAPE;
void* NewShape();
void InitShape(SHAPE* pshape);
void LoadShapeFromBrx(SHAPE* pshape, CBinaryInputStream* pbis);
void DeleteShape(LO* plo);
class HSHAPE;
void* NewHshape();
void InitHshape(HSHAPE* phshape);
void OnHshapeAdd(HSHAPE* phshape);
void DeleteHshape(LO* plo);
class PIPE;
void* NewPipe();
void InitPipe(PIPE* ppipe);
void OnPipeAdd(PIPE* ppipe);
void OnPipeRemove(PIPE* ppipe);
void DeletePipe(LO* plo);
class RAIL;
void* NewRail();
void OnRailAdd(RAIL* prail);
void DeleteRail(LO* plo);
class LANDING;
void* NewLanding();
void OnLandingAdd(LANDING* planding);
void DeleteLanding(LO* plo);
class XFM;
void* NewXfm();
void InitXfm(XFM* pxfm);
void LoadXfmFromBrx(XFM* pxfm, CBinaryInputStream* pbis);
void DeleteXfm(LO* plo);
class WARP;
void* NewWarp();
void LoadWarpFromBrx(WARP* pwarp, CBinaryInputStream* pbis);
void DeleteWarp(LO* plo);
class TARGET;
void* NewTarget();
void InitTarget(TARGET* ptarget);
void OnTargetAdd(TARGET* ptarget);
void DeleteTarget(LO* plo);
class HND;
void* NewHnd();
void InitHnd(HND* phnd);
void LoadHndFromBrx(HND* phnd, CBinaryInputStream* pbis);
void DeleteHnd(LO* plo);
class EXPL;
void* NewExpl();
void DeleteExpl(LO* plo);
class EXPLG;
void* NewExplg();
void LoadExplgFromBrx(EXPLG* pexplg, CBinaryInputStream* pbis);
void DeleteExplg(LO* plo);
class EXPLO;
void* NewExplo();
void InitExplo(EXPLO* pexplo);
void LoadExploFromBrx(EXPLO* pexplo, CBinaryInputStream* pbis);
void DeleteExplo(LO* plo);
class EXPLS;
void* NewExpls();
void InitExpls(EXPLS* pexpls);
void DeleteExpls(LO* plo);
class VOL;
void* NewVol();
void LoadVolFromBrx(VOL* pvol, CBinaryInputStream* pbis);
void DeleteVol(LO* plo);
class RATHOLE;
void* NewRathole();
void OnRatholeAdd(RATHOLE* prathole);
void DeleteRathole(LO* plo);
class PUFFV;
void* NewPuffv();
void InitPuffv(PUFFV* ppuffv);
void DeletePuffv(LO* plo);
class EXIT;
void* NewExit();
void LoadExitFromBrx(EXIT* pexit, CBinaryInputStream* pbis);
void DeleteExit(LO* plo);
class PNT;
void* NewPnt();
void LoadPntFromBrx(PNT* pnt, CBinaryInputStream* pbis);
void DeletePnt(LO* plo);
class HPNT;
void* NewHpnt();
void InitHpnt(HPNT* phpnt);
void OnHpntAdd(HPNT* phpnt);
void DeleteHpnt(LO* plo);
class JMT;
void* NewJmt();
void OnJmtAdd(JMT* pjmt);
void DeleteJmt(LO* plo);
class SPIRE;
void* NewSpire();
void OnSpireAdd(SPIRE* pspire);
void DeleteSpire(LO* plo);
class SCAN;
void* NewScan();
void DeleteScan(LO* plo);
// Animation Segment
class ASEG;
void* NewAseg();
void InitAseg(ASEG* paseg);
void LoadAsegFromBrx(ASEG* paseg, CBinaryInputStream* pbis);
void DeleteAseg(LO* plo);
class ASEGBL;
void* NewAsegbl();
void DeleteAsegbl(LO* plo);
class MAP;
void* NewMap();
void DeleteMap(LO* plo);
// Visibility Map
class VISMAP;
void* NewVismap();
void InitVismap(VISMAP* pvismap);
void LoadVismapFromBrx(VISMAP* pvismap, CBinaryInputStream* pbis);
void DeleteVismap(LO* plo);
class FRZG;
void* NewFrzg();
void DeleteFrzg(LO* plo);
class SM;
void* NewSm();
void LoadSmFromBrx(SM* psm, CBinaryInputStream* pbis);
void DeleteSm(LO* plo);
class SGG;
void* NewSgg();
void InitSgg(SGG* psgg);
void DeleteSgg(LO* plo);
// AI Path's
class PATHZONE;
void* NewPathzone();
void OnPathzoneAdd(PATHZONE* ppathzone);
void LoadPathZoneFromBrx(PATHZONE* ppathzone, CBinaryInputStream* pbis);
void DeletePathzone(LO* plo);
// Reach Map
class RCHM;
void* NewRchm();
void InitRchm(RCHM* prchm);
void LoadRchmFromBrx(RCHM* prchm, CBinaryInputStream* pbis);
void DeleteRchm(LO* plo);
class RWM;
void* NewRwm();
void InitRwm(RWM* prwm);
void DeleteRwm(LO* plo);
class WR;
void* NewWr();
void InitWr(WR* pwr);
void DeleteWr(LO* plo);
class KEYHOLE;
void* NewKeyhole();
void InitKeyhole(KEYHOLE* pkeyhole);
void LoadKeyholeFromBrx(KEYHOLE* pkeyhole, CBinaryInputStream* pbis);
void DeleteKeyhole(LO* plo);
class JSG;
void* NewJsg();
void InitJsg(JSG* pjsg);
void DeleteJsg(LO* plo);

View File

@ -1,8 +1,12 @@
#include "dialog.h"
void* NewDialog()
{
return new DIALOG;
}
void InitDialog(DIALOG* pdialog)
{
//std::cout << "DIALOG Size: " << sizeof(DIALOG) << "\n";
InitAlo(pdialog);
}

View File

@ -70,6 +70,7 @@ class DIALOG : public ALO
int fCrucial;
};
void* NewDialog();
void InitDialog(DIALOG* pdialog);
void LoadDialogFromBrx(DIALOG* pdialog, CBinaryInputStream* pbis);
void LoadDialogEventsFromBrx(CBinaryInputStream *pbis);

View File

@ -1,5 +1,10 @@
#include "dsp.h"
void* NewDsp()
{
return new DSP;
}
void DeleteDsp(LO* plo)
{
delete (DSP*)plo;

View File

@ -13,4 +13,5 @@ class DSP : public SO
struct TARGET* ptargetCur;
};
void* NewDsp();
void DeleteDsp(LO* plo);

View File

@ -1,8 +1,12 @@
#include "dysh.h"
void* NewDysh()
{
return new DYSH;
}
void InitDysh(DYSH* pdysh)
{
//std::cout << "DYSH Size: " << sizeof(DYSH) << "\n";
InitAlo(pdysh);
}

View File

@ -7,6 +7,7 @@ class DYSH : public ALO
struct SHADOW* pshadowGen;
};
void* NewDysh();
void InitDysh(DYSH* pdysh);
void RenderDyshSelf(DYSH* pdysh, CM* pcm, RO* pro);
void DeleteDysh(LO* plo);

View File

@ -1,8 +1,12 @@
#include "emitter.h"
void* NewExplo()
{
return new EXPLO;
}
void InitExplo(EXPLO* pexplo)
{
//std::cout << "EXPLO Size: " << sizeof(EXPLO) << "\n";
InitXfm(pexplo);
}
@ -11,9 +15,13 @@ void DeleteExplo(LO* plo)
delete(EXPLO*)plo;
}
void* NewEmitter()
{
return new EMITTER;
}
void InitEmitter(EMITTER* pemitter)
{
//std::cout << "EMITTER Size: " << sizeof(EMITTER) << "\n";
InitAlo(pemitter);
}
@ -22,14 +30,23 @@ void DeleteEmitter(LO* plo)
delete(EMITTER*)plo;
}
void* NewExpl()
{
return new EXPL;
}
void DeleteExpl(LO* plo)
{
delete(EXPL*)plo;
}
void* NewExpls()
{
return new EXPLS;
}
void InitExpls(EXPLS* pexpls)
{
//std::cout << "EXPLS Size: " << sizeof(EXPLS) << "\n";
InitExplo(pexpls);
}
@ -70,7 +87,6 @@ void LoadEmitterFromBrx(EMITTER *pemitter, CBinaryInputStream *pbis)
{
LoadAloFromBrx(pemitter, pbis);
//std::cout << std::hex << pbis->file.tellg() << "\n";
int8_t crvType = pbis->S8Read();
if (crvType != -1)
@ -116,6 +132,11 @@ void LoadExplgFromBrx(EXPLG *pexplg,CBinaryInputStream *pbis)
}
}
void* NewExplg()
{
return new EXPLG;
}
void DeleteExplg(LO* plo)
{
delete(EXPLG*)plo;

View File

@ -85,17 +85,22 @@ class EXPLS : public EXPLO
public:
};
void* NewExplo();
void InitExplo(EXPLO* pexplo);
void DeleteExplo(LO* plo);
void* NewEmitter();
void InitEmitter(EMITTER* pemitter);
void DeleteEmitter(LO* plo);
void* NewExpl();
void DeleteExpl(LO* plo);
void* NewExpls();
void InitExpls(EXPLS* pexpls);
void DeleteExpls(LO* plo);
void LoadEmitMeshFromBrx(CBinaryInputStream* pbis);
void LoadEmitblipColorsFromBrx(int crgba, CBinaryInputStream* pbis);
void LoadEmitterFromBrx(EMITTER* pemitter, CBinaryInputStream* pbis);
void LoadExplgFromBrx(EXPLG* pexplg, CBinaryInputStream* pbis);
void* NewExplg();
void DeleteExplg(LO* plo);
void LoadExploFromBrx(EXPLO *pexplo, CBinaryInputStream *pbis);
void RenderEmitterSelf(EMITTER* pemitter, CM* pcm, RO* pro);

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
#pragma once
#include "lo.h"
void DeleteObject(LO* plo);
//void DeleteObject(LO* plo);

View File

@ -1,8 +1,12 @@
#include "flash.h"
void* NewFlash()
{
return new FLASH;
}
void InitFlash(FLASH* pflash)
{
//std::cout << "FLASH Size: " << sizeof(FLASH) << "\n";
InitAlo(pflash);
}

View File

@ -15,6 +15,7 @@ class FLASH : public ALO
float gScaleTarget;
};
void* NewFlash();
void InitFlash(FLASH* pflash);
void LoadFlashFromBrx(FLASH* pflash, CBinaryInputStream* pbis);
void DeleteFlash(LO* plo);

View File

@ -1,5 +1,10 @@
#include "fly.h"
void* NewFly()
{
return new FLY;
}
void InitFly(FLY* pfly)
{
//std::cout << "FLY Size: " << sizeof(FLY) << "\n";

View File

@ -67,6 +67,7 @@ class FLY : public SO
int ccoin;
};
void* NewFly();
void InitFly(FLY* pfly);
void LoadFlyFromBrx(FLY* pfly, CBinaryInputStream* pbis);
void DeleteFly(LO* plo);

View File

@ -1,5 +1,10 @@
#include "frzg.h"
void* NewFrzg()
{
return new FRZG;
}
void DeleteFrzg(LO* plo)
{
delete(FRZG*)plo;

View File

@ -9,4 +9,5 @@ class FRZG : public LO
MRG mrg;
};
void* NewFrzg();
void DeleteFrzg(LO* plo);

View File

@ -148,7 +148,7 @@ void LoadGlobsetFromBrx(GLOBSET* pglobset, CBinaryInputStream* pbis, ALO* palo)
for (int f = 0; f < indexCount; f++)
pglobset->aglob[i].asubglob[a].indexes[f] = (VTXFLG)pbis->U32Read();
pglobset->aglob[i].asubglob[a].indices = ConvertStripsToTriLists(pglobset->aglob[i].asubglob[a].indexes);
ConvertStripsToTriLists(pglobset->aglob[i].asubglob[a].indexes, pglobset->aglob[i].asubglob[a].indices);
pglobset->aglob[i].asubglob[a].pshd = &g_ashd[pbis->U16Read()];
@ -239,10 +239,8 @@ void LoadGlobsetFromBrx(GLOBSET* pglobset, CBinaryInputStream* pbis, ALO* palo)
}
}
std::vector <uint16_t> ConvertStripsToTriLists(std::vector <VTXFLG> indexes)
void ConvertStripsToTriLists(std::vector <VTXFLG> &indexes, std::vector <uint16_t> &indices)
{
std::vector <uint16_t> indices;
uint32_t idx = 0;
for (int i = 2; i < indexes.size(); i++)
@ -260,8 +258,6 @@ std::vector <uint16_t> ConvertStripsToTriLists(std::vector <VTXFLG> indexes)
}
idx++;
}
return indices;
}
void MakeGLBuffers(GLOBSET *pglobset)

View File

@ -107,6 +107,6 @@ struct GLOBSET // NOT DONE
// Loads 3D models from binary file
void LoadGlobsetFromBrx(GLOBSET *pglobset, CBinaryInputStream *pbis, ALO* palo); // NOT FINISHED
// Converts tri strips to tri list
std::vector <uint16_t> ConvertStripsToTriLists(std::vector <VTXFLG> indexes);
void ConvertStripsToTriLists(std::vector <VTXFLG> &indexes, std::vector <uint16_t> &indices);
// Storing 3D models in VRAM
void MakeGLBuffers(GLOBSET *pglobset);

View File

@ -1,9 +1,8 @@
#include "gomer.h"
void* CreateGomer()
void* NewGomer()
{
GOMER gomer;
return &gomer;
return new GOMER;
}
void InitGomer(GOMER* pgomer)

View File

@ -17,6 +17,6 @@ class GOMER:public STEPGUARD
int fAbandonExternal;
};
void*CreateGomer();
void* NewGomer();
void InitGomer(GOMER* pgomer);
void DeleteGomer(LO* plo);

View File

@ -1,5 +1,10 @@
#include "hg.h"
void* NewHg()
{
return new HG;
}
void InitHg(HG* phg)
{
InitStep(phg);

View File

@ -1,10 +1,34 @@
#pragma once
#include "step.h"
enum HGS
{
HGS_Nil = -1,
HGS_Passive = 0,
HGS_Stand = 1,
HGS_Run = 2,
HGS_Glide = 3,
HGS_Zap = 4,
HGS_Dead = 5,
HGS_Peek = 6,
HGS_Max = 7
};
class HG : public STEP
{
public:
HGS hgs;
float tHgs;
struct ASEGA* pasegaCur;
float swPan;
float radBank;
float radTilt;
BLRUN ablrunRun[6];
struct ASEGBL* pasegblRun;
SFF sffRun;
struct ASEG* pasegGlide;
};
void* NewHg();
void InitHg(HG* phg);
void DeleteHg(LO* plo);

View File

@ -1,8 +1,12 @@
#include "hide.h"
void* NewHbsk()
{
return new HBSK;
}
void InitHbsk(HBSK* phbsk)
{
//std::cout << "HBSK Size: " << sizeof(HBSK) << "\n";
InitSo(phbsk);
}
@ -16,9 +20,13 @@ void DeleteHbsk(LO* plo)
delete (HBSK*)plo;
}
void* NewHshape()
{
return new HSHAPE;
}
void InitHshape(HSHAPE* phshape)
{
//std::cout << "HSHAPE Size: " << sizeof(HSHAPE) << "\n";
InitShape(phshape);
}
@ -32,9 +40,13 @@ void DeleteHshape(LO* plo)
delete(HSHAPE*)plo;
}
void* NewHpnt()
{
return new HPNT;
}
void InitHpnt(HPNT* phpnt)
{
//std::cout << "HPNT Size: " << sizeof(HPNT) << "\n";
InitLo(phpnt);
}

View File

@ -59,12 +59,15 @@ class HPNT : public PNT
float dzIgnore;
};
void* NewHbsk();
void InitHbsk(HBSK* phbsk);
void OnHbskAdd(HBSK* phbsk);
void DeleteHbsk(LO* plo);
void* NewHshape();
void InitHshape(HSHAPE* phshape);
void OnHshapeAdd(HSHAPE* phshape);
void DeleteHshape(LO* plo);
void* NewHpnt();
void InitHpnt(HPNT* phpnt);
void DeleteHpnt(LO* plo);
void OnHpntAdd(HPNT* phpnt);

View File

@ -1,8 +1,12 @@
#include "hnd.h"
void* NewHnd()
{
return new HND;
}
void InitHnd(HND* phnd)
{
//std::cout << "HND Size: " << sizeof(HND) << "\n";
InitTarget(phnd);
}

View File

@ -20,6 +20,7 @@ class HND : public TARGET
float sRadiusHook;
};
void* NewHnd();
void InitHnd(HND* phnd);
void LoadHndFromBrx(HND* phnd, CBinaryInputStream* pbis);
void DeleteHnd(LO* plo);

View File

@ -1,10 +1,20 @@
#include "ik.h"
void* NewIkh()
{
return new IKH;
}
void DeleteIkh(LO* plo)
{
delete(IKH*)plo;
}
void* NewLikh()
{
return new LIKH;
}
void DeleteLikh(LO* plo)
{
delete(LIKH*)plo;

View File

@ -11,5 +11,7 @@ class LIKH : public ALO
public:
};
void* NewIkh();
void DeleteIkh(LO* plo);
void* NewLikh();
void DeleteLikh(LO* plo);

View File

@ -611,3 +611,23 @@ Column 0 Sort=0v
RefScale=13
Column 0 Sort=0v
[Table][0x3049C71D,4]
RefScale=13
Column 0 Sort=0v
[Table][0xBB11FDC5,4]
RefScale=13
Column 0 Sort=0v
[Table][0xBBE08129,4]
RefScale=13
Column 0 Sort=0v
[Table][0x55E330B6,4]
RefScale=13
Column 0 Sort=0v
[Table][0x706FBB04,4]
RefScale=13
Column 0 Sort=0v

View File

@ -1,11 +1,12 @@
#include "jack.h"
void* NewJack()
{
return new JACK;
}
void InitJack(JACK* pjack)
{
std::cout << "JACK Size: " << sizeof(JACK) << "\n";
std::cout << "JACKB Size: " << sizeof(JACKB) << "\n";
std::cout << "JACKN Size: " << sizeof(JACKN) << "\n";
std::cout << "JACKF Size: " << sizeof(JACKF) << "\n";
InitPo(pjack);
}
@ -14,6 +15,11 @@ void DeleteJack(LO* plo)
delete (JACK*)plo;
}
void* NewJackb()
{
return new JACKB;
}
void InitJackb(JACKB* pjackb)
{
InitAlo(pjackb);
@ -24,6 +30,11 @@ void DeleteJackb(LO* plo)
delete(JACKB*)plo;
}
void* NewJackn()
{
return new JACKN;
}
void InitJackn(JACKN* pjackn)
{
InitAlo(pjackn);
@ -34,6 +45,11 @@ void DeleteJackn(LO* plo)
delete(JACKN*)plo;
}
void* NewJackf()
{
return new JACKF;
}
void InitJackf(JACKF* pjackf)
{
InitAlo(pjackf);

View File

@ -120,12 +120,16 @@ class JACKF : public ALO
int c;
};
void* NewJack();
void InitJack(JACK *pjack);
void DeleteJack(LO* plo);
void* NewJackb();
void InitJackb(JACKB* pjackb);
void DeleteJackb(LO* plo);
void* NewJackn();
void InitJackn(JACKN* pjackn);
void DeleteJackn(LO* plo);
void* NewJackf();
void InitJackf(JACKF* pjackf);
void DeleteJackf(LO* plo);
void LoadJacknFromBrx(JACKN* pjackn, CBinaryInputStream* pbis);

View File

@ -1,8 +1,12 @@
#include "jlo.h"
void* NewJlovol()
{
return new JLOVOL;
}
void InitJlovol(JLOVOL* pjlovol)
{
//std::cout << "JLOVOL Size: " << sizeof(JLOVOL) << "\n";
InitVolbtn(pjlovol);
}
@ -11,9 +15,13 @@ void DeleteJlovol(LO* plo)
delete(JLOVOL*)plo;
}
void* NewJlo()
{
return new JLO;
}
void InitJlo(JLO* pjlo)
{
//std::cout << "JLO Size: " << sizeof(JLO) << "\n";
InitSo(pjlo);
}
@ -22,9 +30,13 @@ void DeleteJlo(LO* plo)
delete (JLO*)plo;
}
void* NewJloc()
{
return new JLOC;
}
void InitJloc(JLOC* pjloc)
{
//std::cout << "JLOC Size: " << sizeof(JLOC) << "\n";
InitAlo(pjloc);
}

View File

@ -82,10 +82,13 @@ class JLOVOL : public VOLBTN
DLE dleJlo;
};
void* NewJlovol();
void InitJlovol(JLOVOL* pjlovol);
void DeleteJlovol(LO* plo);
void* NewJlo();
void InitJlo(JLO* pjlo);
void DeleteJlo(LO* plo);
void* NewJloc();
void InitJloc(JLOC* pjloc);
void DeleteJloc(LO* plo);
void LoadJloFromBrx(JLO* pjlo, CBinaryInputStream* pbis);

View File

@ -1,8 +1,12 @@
#include "jp.h"
void* NewJp()
{
return new JP;
}
void InitJp(JP* pjp)
{
std::cout << "JP Size: " << sizeof(JP) << "\n";
InitStep(pjp);
}

View File

@ -45,5 +45,6 @@ class JP : public STEP
struct XP* pxpZap;
};
void* NewJp();
void InitJp(JP* pjp);
void RenderJpAll(JP* pjp, CM* pcm, RO* pro);

View File

@ -1,8 +1,12 @@
#include "jsg.h"
void* NewJsg()
{
return new JSG;
}
void InitJsg(JSG* pjsg)
{
//std::cout << "JSG Size: " << sizeof(JSG) << "\n";
InitLo(pjsg);
}

View File

@ -17,5 +17,6 @@ class JSG : public LO
int fHideTn;
};
void* NewJsg();
void InitJsg(JSG* pjsg);
void DeleteJsg(LO* plo);

View File

@ -1,9 +1,8 @@
#include "jt.h"
void* CreateJt()
void* NewJt()
{
JT jt;
return &jt;
return new JT;
}
void InitJt(JT* pjt)

View File

@ -459,7 +459,7 @@ class JT : public STEP
float uFsp;
};
void* CreateJt();
void* NewJt();
void InitJt(JT *pjt); // NOT FINSHED
void LoadJtFromBrx(JT *pjt, CBinaryInputStream *pbis); // NOT FINSHED
void RenderJtAll(JT* pjt, CM* pcm, RO* pro);

View File

@ -1,8 +1,12 @@
#include "jump.h"
void* NewJmt()
{
return new JMT;
}
void OnJmtAdd(JMT* pjmt)
{
std::cout << "JMT Size: " << sizeof(JMT) << "\n";
OnLoAdd(pjmt);
}

View File

@ -10,5 +10,6 @@ class JMT : public PNT
struct SO* psoSetIgnoreJt;
};
void* NewJmt();
void OnJmtAdd(JMT* pjmt);
void DeleteJmt(LO* plo);

View File

@ -1,8 +1,12 @@
#include "keyhole.h"
void* NewKeyhole()
{
return new KEYHOLE;
}
void InitKeyhole(KEYHOLE *pkeyhole)
{
//std::cout << "KEYHOLE Size: " << sizeof(KEYHOLE) << "\n";
InitLo(pkeyhole);
g_pkeyhole = pkeyhole;
}

View File

@ -23,6 +23,7 @@ class KEYHOLE : public LO
KS mpkpks[5];
};
void* NewKeyhole();
void InitKeyhole(KEYHOLE *pkeyhole);
void LoadKeyholeFromBrx(KEYHOLE* pkeyhole, CBinaryInputStream* pbis);
void DeleteKeyhole(LO* plo);

View File

@ -1,5 +1,10 @@
#include "landing.h"
void* NewLanding()
{
return new LANDING;
}
void OnLandingAdd(LANDING* planding)
{
OnLoAdd(planding);

View File

@ -7,5 +7,6 @@ class LANDING : public SHAPE
DLE dleLanding;
};
void* NewLanding();
void OnLandingAdd(LANDING* planding);
void DeleteLanding(LO* plo);

View File

@ -1,8 +1,12 @@
#include "lgn.h"
void* NewLgn()
{
return new LGN;
}
void InitLgn(LGN* plgn)
{
std::cout << "LGN Size: " << sizeof(LGN) << "\n";
InitPo(plgn);
}
@ -11,9 +15,13 @@ void DeleteLgn(LO* plo)
delete (LGN*)plo;
}
void* NewLgnb()
{
return new LGNB;
}
void InitLgnb(LGNB* plgnb)
{
std::cout << "LGNB Size: " << sizeof(LGNB) << "\n";
InitSo(plgnb);
}
@ -22,9 +30,13 @@ void DeleteLgnb(LO* plo)
delete(LGNB*)plo;
}
void* NewSwp()
{
return new SWP;
}
void InitSwp(SWP* pswp)
{
std::cout << "SWP Size: " << sizeof(SWP) << "\n";
InitBreak(pswp);
}

View File

@ -63,10 +63,13 @@ class SWP : public BREAK
struct EXPL* pexplCrash;
};
void* NewLgn();
void InitLgn(LGN* plgn);
void DeleteLgn(LO* plo);
void* NewLgnb();
void InitLgnb(LGNB* plgnb);
void DeleteLgnb(LO* plo);
void* NewSwp();
void InitSwp(SWP* pswp);
void DeleteSwp(LO* plo);
void RenderLgnAll(LGN* plgn, CM* pcm, RO* pro);

View File

@ -1,5 +1,10 @@
#include "light.h"
void* NewLight()
{
return new LIGHT;
}
void InitLight(LIGHT* plight)
{
InitAlo(plight);

View File

@ -47,6 +47,7 @@ class LIGHT : public ALO
DLE dleLight;
};
void* NewLight();
void InitLight(LIGHT* plight);
void OnLightAdd(LIGHT* plight);
void AddLightToSw(LIGHT* plight);

View File

@ -1,9 +1,8 @@
#include "lo.h"
void* CreateLo()
void* NewLo()
{
LO lo;
return &lo;
return new LO;
}
void InitLo(LO* plo)

View File

@ -96,7 +96,7 @@ class LO : public BASIC
};
// Creates a new local object
void* CreateLo();
void* NewLo();
// Initializes Local Object
void InitLo(LO *parentLo);
void SetLoDefaults(LO* parentLo);

View File

@ -32,7 +32,7 @@ int main(int cphzArgs, char* aphzArgs[])
if (g_psw != nullptr)
{
//glShader.Use();
DrawSwAll(g_psw, g_pcm);
DrawSwAll();
}
RenderOpenFileGui();
@ -46,10 +46,8 @@ int main(int cphzArgs, char* aphzArgs[])
glfwSwapInterval(1);
glfwPollEvents();
}
if (g_psw != nullptr)
DeleteWorld(g_psw);
DeleteSw(g_psw);
glShader.Delete();
g_gl.GLFWTerminate();
return 0;

View File

@ -5,8 +5,8 @@
#include "debug.h"
void RenderSw(SW* psw, CM* pcm);
void DrawSwAll(SW* psw, CM* pcm);
void DeleteWorld(SW* psw);
void DrawSwAll();
void DeleteSw(SW* psw);
// Main loop
int main(int cphzArgs, char* aphzArgs[]);

View File

@ -1,5 +1,10 @@
#include "map2d.h"
void* NewMap()
{
return new MAP;
}
void DeleteMap(LO* plo)
{
delete(MAP*)plo;

View File

@ -14,4 +14,5 @@ class MAP : public LO
char* mpiposab;
};
void* NewMap();
void DeleteMap(LO* plo);

View File

@ -1,22 +1,18 @@
#include "mb.h"
void* CreateMbg()
void* NewMbg()
{
MBG mbg;
return &mbg;
return new MBG;
}
void InitMbg(MBG *pmbg)
{
std::cout << "MBG Size: " << sizeof(MBG) << "\n";
std::cout << "BHG Size: " << sizeof(BHG) << "\n";
InitStepGuard(pmbg);
}
void* CreateBhg()
void* NewBhg()
{
BHG bhg;
return &bhg;
return new BHG;
}
void InitBhg(BHG *pbhg)
@ -29,9 +25,13 @@ void DeleteBhg(LO* plo)
delete (BHG*)plo;
}
void* NewScentmap()
{
return new SCENTMAP;
}
void InitScentmap(SCENTMAP* pscentmap)
{
std::cout << "SCENTMAP Size:" << sizeof(SCENTMAP) << "\n";
InitAlo(pscentmap);
}

View File

@ -55,11 +55,12 @@ class SCENTMAP : public ALO
glm::vec3 posMax;
};
void*CreateMbg();
void* NewMbg();
void InitMbg(MBG* pmbg);
void*CreateBhg();
void* NewBhg();
void InitBhg(BHG* pbhg);
void DeleteBhg(LO* plo);
void* NewScentmap();
void InitScentmap(SCENTMAP* pscentmap);
void DeleteScentmap(LO* plo);
void LoadMbgFromBrx(MBG *pmbg, CBinaryInputStream *pbis);

View File

@ -1,8 +1,12 @@
#include "mecha.h"
void* NewMecha()
{
return new MECHA;
}
void InitMecha(MECHA* pmecha)
{
std::cout << "MECHA Size: " << sizeof(MECHA) << "\n";
InitStep(pmecha);
}

Some files were not shown because too many files have changed in this diff Show More