]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_brush.c
some work on SV_TestEntityPosition and entity unsticking, now only checks against...
[xonotic/darkplaces.git] / model_brush.c
index 44aeb7ae44708db5be9fdc9c62029efea7c02526..8ba4db8eb70e8e4d3e87b4d6536a5b9c687000a1 100644 (file)
@@ -2095,8 +2095,6 @@ static void Mod_Q1BSP_LoadFaces(lump_t *l)
                // lighting info
                for (i = 0;i < MAXLIGHTMAPS;i++)
                        surface->lightmapinfo->styles[i] = in->styles[i];
-               // force lightmap upload on first time seeing the surface
-               surface->cached_dlight = true;
                surface->lightmapinfo->lightmaptexturestride = 0;
                surface->lightmaptexture = NULL;
                i = LittleLong(in->lightofs);
@@ -2116,6 +2114,7 @@ static void Mod_Q1BSP_LoadFaces(lump_t *l)
                else // LordHavoc: white lighting (bsp version 29)
                        surface->lightmapinfo->samples = loadmodel->brushq1.lightdata + (i * 3);
 
+               // check if we should apply a lightmap to this
                if (!(surface->lightmapinfo->texinfo->flags & TEX_SPECIAL) || surface->lightmapinfo->samples)
                {
                        int i, iu, iv;
@@ -2123,6 +2122,8 @@ static void Mod_Q1BSP_LoadFaces(lump_t *l)
 
                        if (ssize > 256 || tsize > 256)
                                Host_Error("Bad surface extents");
+                       // force lightmap upload on first time seeing the surface
+                       surface->cached_dlight = true;
                        // stainmap for permanent marks on walls
                        surface->lightmapinfo->stainsamples = (unsigned char *)Mem_Alloc(loadmodel->mempool, ssize * tsize * 3);
                        // clear to white
@@ -3162,10 +3163,10 @@ void Mod_Q1BSP_Load(model_t *mod, void *buffer, void *bufferend)
        {
                if (i == LUMP_ENTITIES)
                        continue;
-               mod->brush.qw_md4sum ^= Com_BlockChecksum(mod_base + header->lumps[i].fileofs, header->lumps[i].filelen);
+               mod->brush.qw_md4sum ^= LittleLong(Com_BlockChecksum(mod_base + header->lumps[i].fileofs, header->lumps[i].filelen));
                if (i == LUMP_VISIBILITY || i == LUMP_LEAFS || i == LUMP_NODES)
                        continue;
-               mod->brush.qw_md4sum2 ^= Com_BlockChecksum(mod_base + header->lumps[i].fileofs, header->lumps[i].filelen);
+               mod->brush.qw_md4sum2 ^= LittleLong(Com_BlockChecksum(mod_base + header->lumps[i].fileofs, header->lumps[i].filelen));
        }
 
        Mod_Q1BSP_LoadEntities(&header->lumps[LUMP_ENTITIES]);