#include <stdio.h>
#include <math.h>
+#if wxUSE_GLCANVAS
+
#define MK_ID(a,b,c,d) ((((wxUint32)(a))<<24)| \
(((wxUint32)(b))<<16)| \
(((wxUint32)(c))<< 8)| \
-int lw_is_lwobject(const char *lw_file)
+bool lw_is_lwobject(const char *lw_file)
{
FILE *f = fopen(lw_file, "rb");
if (f) {
wxInt32 lwob = read_long(f);
fclose(f);
if (form == ID_FORM && nlen != 0 && lwob == ID_LWOB)
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
lwObject *lw_object_read(const char *lw_file)
{
- FILE *f = NULL;
- lwObject *lw_object = NULL;
-
- wxInt32 form_bytes = 0;
- wxInt32 read_bytes = 0;
/* open file */
- f = fopen(lw_file, "rb");
+ FILE *f = fopen(lw_file, "rb");
if (f == NULL) {
return NULL;
}
fclose(f);
return NULL;
}
- form_bytes = read_long(f);
+
+ wxInt32 read_bytes = 0;
+
+ wxInt32 form_bytes = read_long(f);
read_bytes += 4;
if (read_long(f) != ID_LWOB) {
}
/* create new lwObject */
- lw_object = (lwObject*) calloc(sizeof(lwObject),1);
+ lwObject *lw_object = (lwObject*) calloc(sizeof(lwObject),1);
/* read chunks */
while (read_bytes < form_bytes) {
}
}
+#endif