mirror of
https://github.com/halpz/re3.git
synced 2025-07-22 04:59:44 +00:00
buildings directory
This commit is contained in:
22
src/buildings/Building.cpp
Normal file
22
src/buildings/Building.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
#include "common.h"
|
||||
|
||||
#include "Building.h"
|
||||
#include "Streaming.h"
|
||||
#include "Pools.h"
|
||||
|
||||
void *CBuilding::operator new(size_t sz) { return CPools::GetBuildingPool()->New(); }
|
||||
void CBuilding::operator delete(void *p, size_t sz) { CPools::GetBuildingPool()->Delete((CBuilding*)p); }
|
||||
|
||||
void
|
||||
CBuilding::ReplaceWithNewModel(int32 id)
|
||||
{
|
||||
DeleteRwObject();
|
||||
|
||||
if (CModelInfo::GetModelInfo(m_modelIndex)->GetNumRefs() == 0)
|
||||
CStreaming::RemoveModel(m_modelIndex);
|
||||
m_modelIndex = id;
|
||||
|
||||
if(bIsBIGBuilding)
|
||||
if(m_level == LEVEL_GENERIC || m_level == CGame::currLevel)
|
||||
CStreaming::RequestModel(id, STREAMFLAGS_DONT_REMOVE);
|
||||
}
|
21
src/buildings/Building.h
Normal file
21
src/buildings/Building.h
Normal file
@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include "Entity.h"
|
||||
|
||||
class CBuilding : public CEntity
|
||||
{
|
||||
public:
|
||||
CBuilding(void) {
|
||||
m_type = ENTITY_TYPE_BUILDING;
|
||||
bUsesCollision = true;
|
||||
}
|
||||
static void *operator new(size_t);
|
||||
static void operator delete(void*, size_t);
|
||||
|
||||
void ReplaceWithNewModel(int32 id);
|
||||
|
||||
virtual bool GetIsATreadable(void) { return false; }
|
||||
};
|
||||
|
||||
VALIDATE_SIZE(CBuilding, 0x64);
|
||||
|
12
src/buildings/Solid.h
Normal file
12
src/buildings/Solid.h
Normal file
@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "Entity.h"
|
||||
|
||||
class CSolid : public CEntity
|
||||
{
|
||||
public:
|
||||
CSolid(void) {
|
||||
m_type = ENTITY_TYPE_BUILDING;
|
||||
bUsesCollision = true;
|
||||
}
|
||||
};
|
8
src/buildings/Treadable.cpp
Normal file
8
src/buildings/Treadable.cpp
Normal file
@ -0,0 +1,8 @@
|
||||
#include "common.h"
|
||||
|
||||
#include "rpworld.h"
|
||||
#include "Treadable.h"
|
||||
#include "Pools.h"
|
||||
|
||||
void *CTreadable::operator new(size_t sz) { return CPools::GetTreadablePool()->New(); }
|
||||
void CTreadable::operator delete(void *p, size_t sz) { CPools::GetTreadablePool()->Delete((CTreadable*)p); }
|
17
src/buildings/Treadable.h
Normal file
17
src/buildings/Treadable.h
Normal file
@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include "Building.h"
|
||||
|
||||
class CTreadable : public CBuilding
|
||||
{
|
||||
public:
|
||||
static void *operator new(size_t);
|
||||
static void operator delete(void*, size_t);
|
||||
|
||||
int16 m_nodeIndices[2][12]; // first car, then ped
|
||||
|
||||
bool GetIsATreadable(void) { return true; }
|
||||
};
|
||||
|
||||
VALIDATE_SIZE(CTreadable, 0x94);
|
||||
|
Reference in New Issue
Block a user