+qboolean LoadWAL_GetMetadata(const unsigned char *f, int filesize, int *retwidth, int *retheight, int *retflags, int *retvalue, int *retcontents, char *retanimname32c)
+{
+ const q2wal_t *inwal = (const q2wal_t *)f;
+
+ if (filesize < (int) sizeof(q2wal_t))
+ {
+ Con_Print("LoadWAL: invalid WAL file\n");
+ if (retwidth)
+ *retwidth = 16;
+ if (retheight)
+ *retheight = 16;
+ if (retflags)
+ *retflags = 0;
+ if (retvalue)
+ *retvalue = 0;
+ if (retcontents)
+ *retcontents = 0;
+ if (retanimname32c)
+ memset(retanimname32c, 0, 32);
+ return false;
+ }
+
+ if (retwidth)
+ *retwidth = LittleLong(inwal->width);
+ if (retheight)
+ *retheight = LittleLong(inwal->height);
+ if (retflags)
+ *retflags = LittleLong(inwal->flags);
+ if (retvalue)
+ *retvalue = LittleLong(inwal->value);
+ if (retcontents)
+ *retcontents = LittleLong(inwal->contents);
+ if (retanimname32c)
+ {
+ memcpy(retanimname32c, inwal->animname, 32);
+ retanimname32c[31] = 0;
+ }
+ return true;
+}
+