diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index 59bfc7966..c6923dc66 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -773,7 +773,6 @@ extern char **g_defModules; extern int g_defModulesNum; #ifdef USE_OPENGL - typedef struct { // maps build tiles to particular animation frames of a model @@ -785,7 +784,7 @@ typedef struct char pal; } tile2model_t; -#define EXTRATILES MAXTILES +# define EXTRATILES MAXTILES EXTERN int32_t mdinited; EXTERN tile2model_t tile2model[MAXTILES+EXTRATILES]; @@ -795,7 +794,7 @@ static inline int32_t md_tilehasmodel(int32_t tilenume,int32_t pal) if (!mdinited) return -1; return tile2model[Ptile2tile(tilenume,pal)].modelid; } -#endif +#endif // defined USE_OPENGL int32_t md_defineframe(int32_t modelid, const char *framename, int32_t tilenume, int32_t skinnum, float smoothduration, int32_t pal); int32_t md_defineanimation(int32_t modelid, const char *framestart, const char *frameend, int32_t fps, int32_t flags); diff --git a/polymer/eduke32/build/include/mdsprite.h b/polymer/eduke32/build/include/mdsprite.h index a386f33b7..499da8e3a 100644 --- a/polymer/eduke32/build/include/mdsprite.h +++ b/polymer/eduke32/build/include/mdsprite.h @@ -3,11 +3,7 @@ #include "hightile.h" -//#ifdef __POWERPC__ #define SHIFTMOD32(a) ((a)&31) -//#else -//#define SHIFTMOD32(a) (a) -//#endif typedef struct { @@ -206,22 +202,6 @@ typedef struct int32_t is8bit; } voxmodel_t; -/* -typedef struct -{ - // maps build tiles to particular animation frames of a model - int32_t modelid; - int32_t skinnum; - int32_t framenum; // calculate the number from the name when declaring - float smoothduration; - int32_t next; - char pal; -} tile2model_t; - -#define EXTRATILES MAXTILES -EXTERN tile2model_t tile2model[MAXTILES+EXTRATILES]; -*/ - EXTERN mdmodel_t **models; void updateanimation(md2model_t *m, spritetype *tspr); diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index e6d8ba9ad..068e1baeb 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -4534,6 +4534,12 @@ static void drawalls(int32_t bunch) #endif if (nextsectnum >= 0) { + // 2 <--- 3 + // x------------------x + // 0 ---> 1 + // + // 4 (our pos) + getzsofslope((int16_t)sectnum,wal->x,wal->y,&cz[0],&fz[0]); getzsofslope((int16_t)sectnum,wall[wal->point2].x,wall[wal->point2].y,&cz[1],&fz[1]); getzsofslope((int16_t)nextsectnum,wal->x,wal->y,&cz[2],&fz[2]); @@ -4622,6 +4628,7 @@ static void drawalls(int32_t bunch) } } } + if ((cz[2] < cz[0]) || (cz[3] < cz[1]) || (globalposz < cz[4])) { i = x2-x1+1; @@ -4734,6 +4741,7 @@ static void drawalls(int32_t bunch) } } } + if ((fz[2] > fz[0]) || (fz[3] > fz[1]) || (globalposz > fz[4])) { i = x2-x1+1; @@ -7249,8 +7257,6 @@ static void initfastcolorlookup(int32_t rscale, int32_t gscale, int32_t bscale) j += 129-(i<<1); } - //clearbufbyte(colhere,sizeof(colhere),0L); - //clearbufbyte(colhead,sizeof(colhead),0L); Bmemset(colhere,0,sizeof(colhere)); Bmemset(colhead,0,sizeof(colhead)); @@ -7855,13 +7861,9 @@ void uninitengine(void) polymost_glreset(); hicinit(); freeallmodels(); -#ifdef POLYMER +# ifdef POLYMER polymer_uninit(); -#endif - /* if (cachefilehandle > -1) - Bclose(cachefilehandle); - if (cacheindexptr != NULL) - Bfclose(cacheindexptr); */ +# endif #endif if (artfil != -1) @@ -8110,7 +8112,7 @@ void drawrooms(int32_t daposx, int32_t daposy, int32_t daposz, { // numbunches==0 can happen if the mirror is far away... the game code decides // to draw it, but scansector gets zero bunches. Result: big screwup! - // Leave inpreparesector as is, it's restored by completemirror. + // Leave inpreparemirror as is, it's restored by completemirror. if (numbunches==0) { enddrawing(); //!!! @@ -13686,7 +13688,7 @@ void completemirror(void) if (mirrorsx2 < mirrorsx1) return; begindrawing(); - p = frameplace+ylookup[windowy1+mirrorsy1]+windowx1+mirrorsx1; + p = frameplace + ylookup[windowy1+mirrorsy1] + windowx1+mirrorsx1; i = windowx2-windowx1-mirrorsx2-mirrorsx1; mirrorsx2 -= mirrorsx1; for (dy=mirrorsy2-mirrorsy1-1; dy>=0; dy--) { diff --git a/polymer/eduke32/build/src/mdsprite.c b/polymer/eduke32/build/src/mdsprite.c index 641aaaa5a..228d4d4a7 100644 --- a/polymer/eduke32/build/src/mdsprite.c +++ b/polymer/eduke32/build/src/mdsprite.c @@ -227,14 +227,6 @@ int32_t md_setmisc(int32_t modelid, float scale, int32_t shadeoff, float zadd, i return 0; } -/* -int32_t md_tilehasmodel(int32_t tilenume,int32_t pal) -{ - if (!mdinited) return -1; - return tile2model[Ptile2tile(tilenume,pal)].modelid; -} -*/ - static int32_t framename2index(mdmodel_t *vm, const char *nam) { int32_t i = 0; @@ -522,9 +514,6 @@ int32_t md_undefinemodel(int32_t modelid) return 0; } -static md2model_t *modelhead; -static mdskinmap_t *skhead; - static int32_t daskinloader(int32_t filh, intptr_t *fptr, int32_t *bpl, int32_t *sizx, int32_t *sizy, int32_t *osizx, int32_t *osizy, char *hasalpha, int32_t pal, char effect) { int32_t picfillen, j,y,x; @@ -801,8 +790,6 @@ int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf) int32_t startticks, willprint=0; - modelhead=m; // for palmaps - if (m->mdnum == 2) surf = 0; if ((unsigned)pal >= (unsigned)MAXPALOOKUPS) return 0; @@ -847,7 +834,7 @@ int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf) //OSD_Printf("Using MD2/MD3 skin (%d) %s, pal=%d\n",number,skinfile,pal); } } - skhead=sk; // for palmaps + if (!skinfile[0]) return 0; if (*texidx) return *texidx; diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index 2f123310d..3d0977320 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -1280,7 +1280,7 @@ static int32_t LoadCacheOffsets(void) while (!scriptfile_eof(script)) { - if (scriptfile_getstring(script, &fname)) break; // filename + if (scriptfile_getstring(script, &fname)) break; // hashed filename if (scriptfile_getnumber(script, &foffset)) break; // offset in cache if (scriptfile_getnumber(script, &fsize)) break; // size @@ -1886,7 +1886,7 @@ static int32_t gloadtile_hi(int32_t dapic,int32_t dapalnum, int32_t facen, hicre if (pic) Bfree(pic); if (tsizx>>r_downsize <= tilesizx[dapic] || tsizy>>r_downsize <= tilesizy[dapic]) - hicr->flags |= 17; + hicr->flags |= (16+1); pth->picnum = dapic; pth->effects = effect; @@ -1908,7 +1908,7 @@ static int32_t gloadtile_hi(int32_t dapic,int32_t dapalnum, int32_t facen, hicre if (xsiz == pow2long[j]) { x |= 1; } if (ysiz == pow2long[j]) { x |= 2; } } - cachead.flags = (x!=3) | (hasalpha != 255 ? 2 : 0) | (hicr->flags & 16?8:0); // handle nocompress + cachead.flags = (x!=3) | (hasalpha != 255 ? 2 : 0) | (hicr->flags&16 ? 8 : 0); // handle nocompress /// OSD_Printf("Caching \"%s\"\n", fn); writexcache(fn, picfillen+(dapalnum<<8), dameth, effect, &cachead); diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index e2e2256bc..e9ffadfa3 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -8116,7 +8116,7 @@ static int32_t S_DefineSound(int32_t ID,char *name) { if (ID >= MAXSOUNDS) return 1; - g_sounds[ID].filename1 =S_OggifyFilename(g_sounds[ID].filename1,name,g_sounds[ID].filename); + g_sounds[ID].filename1 = S_OggifyFilename(g_sounds[ID].filename1,name,g_sounds[ID].filename); // initprintf("(%s)(%s)(%s)\n",g_sounds[ID].filename1,name,g_sounds[ID].filename); // S_LoadSound(ID); return 0; @@ -8163,7 +8163,7 @@ static int32_t S_DefineMusic(char *ID,char *name) return 0; } -static int32_t parsedefinitions_game(scriptfile *script, const int32_t preload); +static int32_t parsedefinitions_game(scriptfile *script, int32_t preload); static void parsedefinitions_game_include(const char *fn, scriptfile *script, char *cmdtokptr, const int32_t preload) { @@ -8190,7 +8190,7 @@ static void parsedefinitions_game_include(const char *fn, scriptfile *script, ch } } -static int32_t parsedefinitions_game(scriptfile *script, const int32_t preload) +static int32_t parsedefinitions_game(scriptfile *script, int32_t preload) { int32_t tokn; char *cmdtokptr;