diff --git a/source/build/include/build.h b/source/build/include/build.h index f02cb6edf..9f0a7e8f4 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -839,6 +839,11 @@ typedef struct { int8_t xofs, yofs; uint8_t sf; // anim. speed and flags uint8_t extra; + + void Clear() + { + extra = sf = yofs = xofs = num = 0; + } } picanm_t; EXTERN picanm_t picanm[MAXTILES]; typedef struct { int16_t newtile; int16_t owner; } rottile_t; @@ -1053,7 +1058,7 @@ typedef struct { typedef struct artheader_t { int32_t tilestart, tileend, numtiles; } artheader_t; -#define ARTv1_UNITOFFSET ((signed)(4*sizeof(int32_t) + 2*sizeof(int16_t) + sizeof(picanm_t))) +#define ARTv1_UNITOFFSET 24 // using siseof does not work because picanm_t is not the in-file format. int32_t enginePreInit(void); // a partial setup of the engine used for launch windows int32_t engineInit(void); diff --git a/source/build/src/defs.cpp b/source/build/src/defs.cpp index 59297c7aa..398946fc1 100644 --- a/source/build/src/defs.cpp +++ b/source/build/src/defs.cpp @@ -1017,7 +1017,7 @@ static int32_t defsparser(scriptfile *script) if (texstatus < 0) break; - Bmemset(&picanm[tile], 0, sizeof(picanm_t)); + picanm[tile].Clear(); break; } @@ -1041,8 +1041,8 @@ static int32_t defsparser(scriptfile *script) if (xsiz > 0 && ysiz > 0) { tileSetSize(tile, xsiz, ysiz); - Bmemset(&picanm[tile], 0, sizeof(picanm_t)); - tileSetupDummy(tile); + picanm[tile].Clear(); + tileSetupDummy(tile); } break; @@ -1072,8 +1072,8 @@ static int32_t defsparser(scriptfile *script) for (i=tile1; i<=tile2; i++) { tileSetSize(i, xsiz, ysiz); - Bmemset(&picanm[i], 0, sizeof(picanm_t)); - tileSetupDummy(i); + picanm[i].Clear(); + tileSetupDummy(i); } break; @@ -2287,8 +2287,8 @@ static int32_t defsparser(scriptfile *script) if (xsiz > 0 && ysiz > 0) { tileSetSize(tile, xsiz, ysiz); - Bmemset(&picanm[tile], 0, sizeof(picanm_t)); - tileSetupDummy(tile); + picanm[tile].Clear(); + tileSetupDummy(tile); } #ifdef USE_OPENGL xscale = 1.0f / xscale; diff --git a/source/build/src/tiles.cpp b/source/build/src/tiles.cpp index f71b8cce4..fd02162ab 100644 --- a/source/build/src/tiles.cpp +++ b/source/build/src/tiles.cpp @@ -132,10 +132,6 @@ void artClearMapArt(void) #ifdef USE_OPENGL //POGOTODO: review this to ensure we're not invalidating more than we have to gltexinvalidatetype(INVALIDATE_ART); -# ifdef POLYMER - if (videoGetRenderMode() == REND_POLYMER) - polymer_texinvalidate(); -# endif #endif } @@ -255,8 +251,7 @@ static void tileSoftDelete(int32_t const tile) waloff[tile] = 0; faketile[tile>>3] &= ~pow2char[tile&7]; - - Bmemset(&picanm[tile], 0, sizeof(picanm_t)); + picanm[tile].Clear(); } void tileDelete(int32_t const tile) @@ -507,9 +502,7 @@ static int32_t artReadIndexedFile(int32_t tilefilei) const int32_t permap = (tilefilei >= MAXARTFILES_BASE); // is it a per-map ART file? buildvfs_kfd fil; - auto kopen4loadfunc = bloodhack == 2 ? kopen4loadfrommod : kopen4load; - - if ((fil = kopen4loadfunc(fn, 0)) != buildvfs_kfd_invalid) + if ((fil = kopen4loadfrommod(fn, 0)) != buildvfs_kfd_invalid) { artheader_t local; int const headerval = artReadHeader(fil, fn, &local); @@ -543,11 +536,7 @@ static int32_t artReadIndexedFile(int32_t tilefilei) artReadManifest(fil, &local); -#ifndef USE_PHYSFS if (cache1d_file_fromzip(fil)) -#else - if (1) -#endif { if (permap) artPreloadFileSafe(fil, &local); @@ -570,10 +559,6 @@ static int32_t artReadIndexedFile(int32_t tilefilei) } } -#ifdef DEBUGGINGAIDS - if (permap) - initprintf("Read in per-map ART file \"%s\"\n", fn); -#endif kclose(fil); return 0; } @@ -619,7 +604,6 @@ int32_t artLoadFiles(const char *filename, int32_t askedsize) // // loadtile // -static void tilePostLoad(int16_t tilenume); bool tileLoad(int16_t tileNum) { @@ -636,23 +620,6 @@ bool tileLoad(int16_t tileNum) tileLoadData(tileNum, dasiz, (char *) waloff[tileNum]); - /* -#ifdef USE_OPENGL - if (videoGetRenderMode() >= REND_POLYMOST && - in3dmode()) - { - //POGOTODO: this type stuff won't be necessary down the line -- review this - int type; - for (type = 0; type <= 1; ++type) - { - gltexinvalidate(tileNum, 0, (type ? DAMETH_CLAMPED : DAMETH_MASK) | PTH_INDEXED); - texcache_fetch(tileNum, 0, 0, (type ? DAMETH_CLAMPED : DAMETH_MASK) | PTH_INDEXED); - } - } -#endif -*/ - - tilePostLoad(tileNum); return (waloff[tileNum] != 0 && tilesiz[tileNum].x > 0 && tilesiz[tileNum].y > 0); } @@ -742,39 +709,6 @@ void tileLoadData(int16_t tilenume, int32_t dasiz, char *buffer) artfilplc = tilefileoffs[tilenume]+dasiz; } -static void tilePostLoad(int16_t tilenume) -{ -#if !defined DEBUG_TILESIZY_512 && !defined DEBUG_TILEOFFSETS - UNREFERENCED_PARAMETER(tilenume); -#endif -#ifdef DEBUG_TILESIZY_512 - if (tilesizy[tilenume] >= 512) - { - int32_t i; - char *p = (char *) waloff[tilenume]; - for (i=0; i