2022-11-14 02:18:45 +00:00
|
|
|
#ifndef _CMODEL
|
|
|
|
#define _CMODEL
|
|
|
|
|
2024-10-22 23:12:41 +00:00
|
|
|
#include "Kyoto/Graphics/CCubeModel.hpp"
|
|
|
|
#include "rstl/single_ptr.hpp"
|
|
|
|
#include <Kyoto/Graphics/CTexture.hpp>
|
|
|
|
#include <Kyoto/TToken.hpp>
|
|
|
|
#include <rstl/auto_ptr.hpp>
|
|
|
|
#include <rstl/vector.hpp>
|
2022-11-14 02:18:45 +00:00
|
|
|
|
2024-10-22 23:12:41 +00:00
|
|
|
class CModelFlags;
|
|
|
|
class IObjectStore;
|
|
|
|
class CCubeSurface;
|
2022-11-14 02:18:45 +00:00
|
|
|
class CModel {
|
2024-10-22 23:12:41 +00:00
|
|
|
struct SShader {
|
|
|
|
rstl::vector< TCachedToken< CTexture > > x0_textures;
|
|
|
|
uchar* x10_data;
|
|
|
|
|
|
|
|
SShader(uchar* data) : x10_data(data) {};
|
|
|
|
|
|
|
|
void UnlockTextures();
|
|
|
|
};
|
2023-01-12 20:37:45 +00:00
|
|
|
static uint sTotalMemory;
|
2024-10-22 23:12:41 +00:00
|
|
|
static CModel* sThisFrameList;
|
|
|
|
static CModel* sOneFrameList;
|
|
|
|
static CModel* sTwoFrameList;
|
|
|
|
|
2022-11-14 02:18:45 +00:00
|
|
|
public:
|
2024-10-22 23:12:41 +00:00
|
|
|
CModel(const rstl::auto_ptr< uchar >& data, int length, IObjectStore& store);
|
2022-11-14 02:18:45 +00:00
|
|
|
void Touch(int) const;
|
|
|
|
void Draw(const CModelFlags&) const;
|
2022-11-25 12:41:28 +00:00
|
|
|
bool IsLoaded(int matIdx) const;
|
2023-01-12 20:37:45 +00:00
|
|
|
|
|
|
|
static void AddToTotal(uint amt) { sTotalMemory += amt; }
|
|
|
|
static void RemoveFromTotal(uint amt) { sTotalMemory -= amt; }
|
2024-10-22 23:12:41 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
rstl::auto_ptr< uchar > x0_data;
|
|
|
|
uint x4_dataLen;
|
|
|
|
rstl::vector< CCubeSurface* > x8_surfaces;
|
|
|
|
rstl::vector<SShader> x18_matSets;
|
|
|
|
rstl::single_ptr<CCubeModel> x28_modelInstance;
|
|
|
|
ushort x2c_currentMatxIdx;
|
|
|
|
ushort x2e_lastMaterialFrame;
|
|
|
|
CModel* x30_prev;
|
|
|
|
CModel* x34_next;
|
|
|
|
uint x38_lastFrame;
|
2022-11-14 02:18:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _CMODEL
|