]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
work around gcc lacking support for no-size arrays in structures
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 26 Nov 2000 09:18:57 +0000 (09:18 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 26 Nov 2000 09:18:57 +0000 (09:18 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@107 d7cf8633-e32d-0410-b094-e92efae38249

model_alias.c
model_alias.h

index 2f7b5f2409e90ec8f35ffd1dc5a4d7face22e104..d4fe29716cb2ca922009129b81e597a9675eef69 100644 (file)
@@ -722,7 +722,7 @@ void Mod_LoadQ2AliasModel (model_t *mod, void *buffer)
        mod->type = mod_alias;
        mod->aliastype = ALIASTYPE_MD2;
 
        mod->type = mod_alias;
        mod->aliastype = ALIASTYPE_MD2;
 
-       framesize = sizeof(md2memframe_t) + LittleLong(pinmodel->num_xyz) * sizeof(trivert2);
+       framesize = sizeof(md2memframesize_t) + LittleLong(pinmodel->num_xyz) * sizeof(trivert2);
        // LordHavoc: calculate size for in memory version
        size = sizeof(md2mem_t)
                 + LittleLong(pinmodel->num_st) * sizeof(md2stvert_t)
        // LordHavoc: calculate size for in memory version
        size = sizeof(md2mem_t)
                 + LittleLong(pinmodel->num_st) * sizeof(md2stvert_t)
index aafcb33d4578e9e77865ca7a7d9fe8dd7c3a1ee3..2b0031e200724c959cbc0e81db375628f0daad86 100644 (file)
@@ -151,7 +151,7 @@ typedef struct
        float           scale[3];       // multiply byte verts by this
        float           translate[3];   // then add this
        char            name[16];       // frame name from grabbing
        float           scale[3];       // multiply byte verts by this
        float           translate[3];   // then add this
        char            name[16];       // frame name from grabbing
-       trivertx_t      verts[];        // variable sized
+       trivertx_t      verts[1];       // variable sized
 } md2frame_t;
 
 // LordHavoc: memory representation is different than disk
 } md2frame_t;
 
 // LordHavoc: memory representation is different than disk
@@ -159,9 +159,16 @@ typedef struct
 {
        float           scale[3];       // multiply byte verts by this
        float           translate[3];   // then add this
 {
        float           scale[3];       // multiply byte verts by this
        float           translate[3];   // then add this
-       trivert2        verts[];        // variable sized
+       trivert2        verts[1];       // variable sized
 } md2memframe_t;
 
 } md2memframe_t;
 
+// must match md2memframe_t, this is just used for sizeof()
+typedef struct
+{
+       float           scale[3];       // multiply byte verts by this
+       float           translate[3];   // then add this
+} md2memframesize_t;
+
 
 // the glcmd format:
 // a positive integer starts a tristrip command, followed by that many
 
 // the glcmd format:
 // a positive integer starts a tristrip command, followed by that many