mirror of
https://notabug.org/scuti/lib3ddevil1
synced 2025-05-31 14:11:42 +05:30
Replaced old casts with function calls
This commit is contained in:
@@ -87,11 +87,11 @@ static bool getgheader(struct Header* h, const char* filedata) {
|
||||
static bool getmeshheader(struct MeshHeader **hs,
|
||||
unsigned int i,
|
||||
const char * const filedata) {
|
||||
bool done = false;
|
||||
if (hs == NULL || filedata == NULL) {
|
||||
bool done = false;
|
||||
struct Header *h = NULL;
|
||||
if (hs == NULL || !(getgheader(h, filedata))) {
|
||||
return done;
|
||||
}
|
||||
struct Header *h = (struct Header*)filedata;
|
||||
if (h -> numMesh < i) {
|
||||
return done;
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ static void printtph(struct TexturePack*);
|
||||
static void printtbd(struct TextureBatchDescriptor*);
|
||||
|
||||
// Get Texture Pack Header
|
||||
static bool getpackheader(struct TexturePack*, const char*);
|
||||
static inline bool getpackheader(struct TexturePack*, const char*);
|
||||
|
||||
// Get Texture Batch Descriptor.
|
||||
static bool gettexdescriptor(struct TextureBatchDescriptor**,
|
||||
@@ -58,7 +58,7 @@ static void printtbd(struct TextureBatchDescriptor *bd) {
|
||||
}
|
||||
}
|
||||
|
||||
static bool getpackheader(struct TexturePack* p, const char *filedata) {
|
||||
inline static bool getpackheader(struct TexturePack* p, const char *filedata) {
|
||||
if (filedata == NULL) {
|
||||
return false;
|
||||
}
|
||||
@@ -86,10 +86,9 @@ static bool gettexbatch(struct TextureBatch **batch,
|
||||
const char *filedata,
|
||||
unsigned int filesize) {
|
||||
struct TexturePack *p = NULL;
|
||||
if (filedata == NULL) { // no data to get batch from.
|
||||
if (!(getpackheader(p, filedata))) {
|
||||
return false;
|
||||
}
|
||||
p = (struct TexturePack*)filedata;
|
||||
if (i > p -> batchNumber) { // no such batch in texture pack
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user