Addressed warnings for texture module

This commit is contained in:
_ 2018-04-19 05:30:13 -07:00
parent ed2ee7bf71
commit dd5af2004d
2 changed files with 38 additions and 31 deletions

View File

@ -39,16 +39,27 @@ struct TextureBatch {
#pragma pack(pop) #pragma pack(pop)
typedef struct { typedef struct {
// input: pointer to struct
void (* const printheader) (struct TexturePack*); void (* const printheader) (struct TexturePack*);
// input: pointer to struct
void (* const printbatchdesc)(struct TextureBatchDescriptor*); void (* const printbatchdesc)(struct TextureBatchDescriptor*);
// input: pointer of pointer to struct, order, file data, file size
// ** = 'pass by reference' of a pointer to struct
bool (* const getbatchdesc) (struct TextureBatchDescriptor**, bool (* const getbatchdesc) (struct TextureBatchDescriptor**,
unsigned int, unsigned int,
const char *, const char *,
unsigned int); unsigned int);
// input: pointer of pointer to struct, order, file data, file size
// ** = 'pass by reference' of a pointer to struct
bool (* const getbatch) (struct TextureBatch**, bool (* const getbatch) (struct TextureBatch**,
unsigned int, unsigned int,
const char*, const char*,
unsigned int); unsigned int);
// input: pointer to struct, order, file data, file size
bool (* const gettextures) (struct Texture*, bool (* const gettextures) (struct Texture*,
unsigned int, unsigned int,
const char*, const char*,
@ -56,34 +67,4 @@ typedef struct {
} fn_devil1tex; } fn_devil1tex;
extern fn_devil1tex const DEVIL1TEX; extern fn_devil1tex const DEVIL1TEX;
// -------------------------------------------------------+
// Functions
// -------------------------------------------------------+
// Print Texture Pack Header.
static void printtph(struct TexturePack*);
// Print Texture Batch Descriptor.
static void printtbd(struct TextureBatchDescriptor*);
// Get Texture Batch Descriptor.
// ** = 'pass by reference' of a pointer to struct
static bool gettexdescriptor(struct TextureBatchDescriptor**,
unsigned int,
const char *,
unsigned int);
// Get Texture Batch.
// ** = 'pass by reference' of a pointer to struct
static bool gettexbatch(struct TextureBatch**,
unsigned int,
const char*,
unsigned int);
// Unpack Texture Batch
static bool unpacktexbatch(struct Texture*,
unsigned int,
const char*,
const unsigned int);
#endif #endif

View File

@ -2,6 +2,32 @@
#include <stdio.h> #include <stdio.h>
#include <stdbool.h> #include <stdbool.h>
// Print Texture Pack Header.
static void printtph(struct TexturePack*);
// Print Texture Batch Descriptor.
static void printtbd(struct TextureBatchDescriptor*);
// Get Texture Batch Descriptor.
static bool gettexdescriptor(struct TextureBatchDescriptor**,
unsigned int,
const char *,
unsigned int);
// Get Texture Batch.
static bool gettexbatch(struct TextureBatch**,
unsigned int,
const char*,
unsigned int);
// Unpack Texture Batch
static bool unpacktexbatch(struct Texture*,
unsigned int,
const char*,
const unsigned int);
fn_devil1tex const DEVIL1TEX = {printtph, fn_devil1tex const DEVIL1TEX = {printtph,
printtbd, printtbd,
gettexdescriptor, gettexdescriptor,