mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-29 12:40:58 +00:00
Add MD2_INDENT and MD2_VERSION so we can cleanly check that it's a valid MD2 from magic number/version
This commit is contained in:
parent
29d8e34d03
commit
b150e842fc
2 changed files with 7 additions and 2 deletions
|
@ -304,8 +304,8 @@ static md2_model_t *md2_readModel(const char *filename)
|
|||
// initialize model and read header
|
||||
|
||||
if (fread(&model->header, sizeof (model->header), 1, file) != 1
|
||||
|| model->header.magic !=
|
||||
(INT32)(('2' << 24) + ('P' << 16) + ('D' << 8) + 'I'))
|
||||
|| model->header.magic != MD2_IDENT
|
||||
|| model->header.version != MD2_VERSION)
|
||||
{
|
||||
fclose(file);
|
||||
free(model);
|
||||
|
|
|
@ -23,6 +23,11 @@
|
|||
|
||||
#include "hw_glob.h"
|
||||
|
||||
// magic number "IDP2" or 844121161
|
||||
#define MD2_IDENT (INT32)(('2' << 24) + ('P' << 16) + ('D' << 8) + 'I')
|
||||
// model version
|
||||
#define MD2_VERSION 8
|
||||
|
||||
#define MD2_MAX_TRIANGLES 8192
|
||||
#define MD2_MAX_VERTICES 4096
|
||||
#define MD2_MAX_TEXCOORDS 4096
|
||||
|
|
Loading…
Reference in a new issue