World of Might and Magic
0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
|
См. документацию.
46 static_assert(
sizeof(
BSPModelData) == 188,
"Wrong type size");
47 static_assert(
sizeof(
BSPNode) == 8,
"Wrong type size");
48 static_assert(
sizeof(Vec3_int_) == 12,
"Wrong type size");
51 memcpy(&uNumBModels,
data, 4);
54 std::vector<BSPModelData> models;
55 for (
unsigned int i = 0; i < uNumBModels; ++i) {
59 models.push_back(model);
62 unsigned int model_index = 0;
67 new_model.
index = model_index;
74 new_model.
sMinX = model.sMinX;
75 new_model.
sMinY = model.sMinY;
76 new_model.
sMinZ = model.sMinZ;
77 new_model.
sMaxX = model.sMaxX;
78 new_model.
sMaxY = model.sMaxY;
79 new_model.
sMaxZ = model.sMaxZ;
89 unsigned int verticesSize = model.uNumVertices *
sizeof(Vec3_int_);
94 for (
size_t i = 0; i < model.uNumFaces; i++) {
95 new_model.
pFaces.emplace_back();
102 unsigned int facesOrderingSize = model.uNumFaces *
sizeof(short);
105 data += facesOrderingSize;
107 for (
size_t i = 0; i < model.uNumNodes; i++) {
110 new_model.
pNodes.push_back(node);
114 const char *textureFilenames =
115 (
const char *)malloc(10 * model.uNumFaces);
116 memcpy((
char *)textureFilenames,
data, 10 * model.uNumFaces);
117 data += 10 * model.uNumFaces;
118 for (
unsigned int j = 0; j < model.uNumFaces; ++j) {
119 const char *texFilename = &textureFilenames[j * 10];
120 new_model.
pFaces[j].SetTexture(texFilename);
121 if (new_model.
pFaces[j].sCogTriggeredID) {
122 if (new_model.
pFaces[j].HasEventHint())
123 new_model.
pFaces[j].uAttributes |= FACE_HAS_EVENT;
125 new_model.
pFaces[j].uAttributes &= ~FACE_HAS_EVENT;
129 free((
void *)textureFilenames);
178 sizeof(this->pXInterceptDisplacements));
180 sizeof(this->pYInterceptDisplacements));
182 sizeof(this->pZInterceptDisplacements));
207 signed int event_index;
unsigned __int16 uint16_t
struct BSPVertexBuffer pVertices
uint16_t pTextureUIDs[20]
GLenum GLuint GLint GLenum face
void ToggleIsTextureFrameTable()
int16_t pYInterceptDisplacements[20]
int FindTextureByName(const char *Str2)
struct TextureFrameTable * pTextureFrameTable
bool IsTextureFrameTable()
struct BBox_short_ pBoundingBox
uint8_t * Load(uint8_t *data)
struct BBox_short_ pBoundingBox
uint16_t * pFacesOrdering
int16_t pXInterceptDisplacements[20]
int16_t pXInterceptDisplacements[20]
std::array< char, 9216 > pLevelEVT
std::vector< BSPNode > pNodes
struct Plane_int_ pFacePlane
int16_t pZInterceptDisplacements[20]
Texture * GetBitmap(const String &name)
void SetTexture(const String &filename)
std::array< EventIndex, 4400 > pLevelEVT_Index
bool Deserialize(struct ODMFace_MM7 *)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
signed int uLevelEVT_NumEvents
std::vector< ODMFace > pFaces
Vec3_int_ vBoundingCenter
struct Plane_int_ pFacePlane
unsigned __int32 uint32_t
unsigned int uTotalGameTimeElapsed
int16_t pZInterceptDisplacements[20]
int16_t pYInterceptDisplacements[20]
uint16_t pTextureVIDs[20]
Texture * GetFrameTexture(int uFrameID, int time)