diff --git a/polymer/eduke32/build/src/mdsprite.c b/polymer/eduke32/build/src/mdsprite.c index 3375fed31..f63c2c64a 100644 --- a/polymer/eduke32/build/src/mdsprite.c +++ b/polymer/eduke32/build/src/mdsprite.c @@ -97,6 +97,36 @@ void freeallmodels() } } +void freevbos() +{ + int i; + + for (i=0;imdnum == 3) + { + md3model *m = (md3model *)models[i]; + if (m->vbos) + { +// OSD_Printf("freeing model %d vbo\n",i); + bglDeleteBuffersARB(m->head.numsurfs, m->vbos); + free(m->vbos); + m->vbos = NULL; + } + } + + if (allocvbos) + { + bglDeleteBuffersARB(allocvbos, indexvbos); + bglDeleteBuffersARB(allocvbos, vertvbos); + /* + free(indexvbos); + free(vertvbos); + indexvbos = vertvbos = NULL; + */ + allocvbos = 0; + } +} + void clearskins() { mdmodel *m; @@ -2074,10 +2104,11 @@ static void md3free(md3model *m) if (m->vindexes) free(m->vindexes); if (m->maxdepths) free(m->maxdepths); - if (r_vbos && m->vbos) + if (m->vbos) { bglDeleteBuffersARB(m->head.numsurfs, m->vbos); free(m->vbos); + m->vbos = NULL; } free(m); diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index 18b5e1b31..8c5c8cb7c 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -636,6 +636,7 @@ float glox1, gloy1, glox2, gloy2; //Use this for both initialization and uninitialization of OpenGL. static int gltexcacnum = -1; +extern void freevbos(void); void polymost_glreset() { int i; @@ -717,6 +718,7 @@ void polymost_glreset() } firstcacheindex.next = NULL; } + freevbos(); } // one-time initialization of OpenGL for polymost diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index fdae2b7a2..73f9f2b27 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -7246,23 +7246,23 @@ static void InitCustomColors(void) vgapal16[9*4+2] = 7; */ int i; palette_t *edcol; -/* + /* -char vgapal16[4*256] = -{ - 00,00,00,00, 42,00,00,00, 00,42,00,00, 42,42,00,00, 00,00,42,00, - 42,00,42,00, 00,21,42,00, 42,42,42,00, 21,21,21,00, 63,21,21,00, - 21,63,21,00, 63,63,21,00, 21,21,63,00, 63,21,63,00, 21,63,63,00, - 63,63,63,00 -}; -*/ -/* editorcolors[0] = getclosestcol(0,0,0); - editorcolors[1] = getclosestcol(0,0,42); - editorcolors[2] = getclosestcol(0,42,0); - editorcolors[3] = getclosestcol(0,42,42); - editorcolors[4] = getclosestcol(42,0,0); - editorcolors[5] = getclosestcol(0,0,0); -*/ + char vgapal16[4*256] = + { + 00,00,00,00, 42,00,00,00, 00,42,00,00, 42,42,00,00, 00,00,42,00, + 42,00,42,00, 00,21,42,00, 42,42,42,00, 21,21,21,00, 63,21,21,00, + 21,63,21,00, 63,63,21,00, 21,21,63,00, 63,21,63,00, 21,63,63,00, + 63,63,63,00 + }; + */ + /* editorcolors[0] = getclosestcol(0,0,0); + editorcolors[1] = getclosestcol(0,0,42); + editorcolors[2] = getclosestcol(0,42,0); + editorcolors[3] = getclosestcol(0,42,42); + editorcolors[4] = getclosestcol(42,0,0); + editorcolors[5] = getclosestcol(0,0,0); + */ extern int getclosestcol(int r, int g, int b); @@ -8879,39 +8879,39 @@ void ExtPreCheckKeys(void) // just before drawrooms case LIZMANFEEDING : case LIZMANJUMP : + { + int k; + if (frames!=0) { - int k; - if (frames!=0) + if (frames==10) frames=0; + k = 1536;//getangle(tspr->x-posx,tspr->y-posy); + k = (((sprite[i].ang+3072+128-k)&2047)>>8)&7; + //This guy has only 5 pictures for 8 angles (3 are x-flipped) + if (k <= 4) { - if (frames==10) frames=0; - k = 1536;//getangle(tspr->x-posx,tspr->y-posy); - k = (((sprite[i].ang+3072+128-k)&2047)>>8)&7; - //This guy has only 5 pictures for 8 angles (3 are x-flipped) - if (k <= 4) - { - picnum += k; - ang = 0; - flags &= ~4; - } - else - { - picnum += 8-k; - ang = 1024; - flags |= 4; - } + picnum += k; + ang = 0; + flags &= ~4; } - - if (graphicsmode == 2) + else { - if (frames==2) picnum+=((((4-(totalclock>>5)))&1)*5); - if (frames==4) picnum+=((((4-(totalclock>>5)))&3)*5); - if (frames==5) picnum+=(((totalclock>>5)%5))*5; + picnum += 8-k; + ang = 1024; + flags |= 4; } - - if (tilesizx[picnum] == 0) - picnum -= 5; //Hack, for actors } - break; + + if (graphicsmode == 2) + { + if (frames==2) picnum+=((((4-(totalclock>>5)))&1)*5); + if (frames==4) picnum+=((((4-(totalclock>>5)))&3)*5); + if (frames==5) picnum+=(((totalclock>>5)%5))*5; + } + + if (tilesizx[picnum] == 0) + picnum -= 5; //Hack, for actors + } + break; default: break; @@ -8932,7 +8932,7 @@ void ExtPreCheckKeys(void) // just before drawrooms if (xp1 < 4 || xp1 > xdim-6 || yp1 < 4 || yp1 > ydim16-6) continue; rotatesprite(xp1<<16,yp1<<16,zoom<<5,ang,picnum, - shade,sprite[i].pal,flags,0,0,xdim-1,ydim16-1); + shade,sprite[i].pal,flags,0,0,xdim-1,ydim16-1); } } diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index bf1b3ef18..98d0e8070 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -1278,10 +1278,10 @@ void faketimerhandler(void) } if (myconnectindex == connecthead) - for(i=connectpoint2[connecthead];i>=0;i=connectpoint2[i]) + for (i=connectpoint2[connecthead];i>=0;i=connectpoint2[i]) packbuf[j++] = min(max(g_player[i].myminlag,-128),127); - for(i=connecthead;i>=0;i=connectpoint2[i]) + for (i=connecthead;i>=0;i=connectpoint2[i]) g_player[i].myminlag = 0x7fffffff; } #endif diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 2168933fd..6257cb3ac 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -81,7 +81,7 @@ int g_iThisActorID=-1; // var ID of "THISACTOR" intptr_t *actorLoadEventScrptr[MAXTILES]; intptr_t *apScriptGameEvent[MAXGAMEEVENTS]; -intptr_t *g_parsingEventPtr=NULL; +static intptr_t *g_parsingEventPtr=NULL; gamevar_t aGameVars[MAXGAMEVARS]; gamearray_t aGameArrays[MAXGAMEARRAYS]; @@ -1000,6 +1000,8 @@ void freehash() HASH_free(&labelH); } +static int g_ifElseAborted; + static int C_IncreaseScriptSize(int size) { intptr_t oscriptPtr = (unsigned)(g_scriptPtr-script); @@ -1024,11 +1026,11 @@ static int C_IncreaseScriptSize(int size) for (i=g_scriptSize-1;i>=0;i--) { // initprintf("%d\n",i); - if (bitptr[i>>3]&(BITPTR_POINTER<<(i&7)) && !((intptr_t)script[i] >= (intptr_t)(&script[0]) && (intptr_t)script[i] < (intptr_t)(&script[g_scriptSize]))) - { - g_numCompilerErrors++; - initprintf("Internal compiler error at %d (0x%x)\n",i,i); - } + /* if (bitptr[i>>3]&(BITPTR_POINTER<<(i&7)) && !((intptr_t)script[i] >= (intptr_t)(&script[0]) && (intptr_t)script[i] < (intptr_t)(&script[g_scriptSize]))) + { + g_numCompilerErrors++; + initprintf("Internal compiler error at %d (0x%x)\n",i,i); + } */ // if (bitptr[i] == 0 && ((intptr_t)script[i] >= (intptr_t)(&script[0]) && (intptr_t)script[i] < (intptr_t)(&script[g_scriptSize]))) // initprintf("oh no!\n"); if (bitptr[i>>3]&(BITPTR_POINTER<<(i&7)) /*&& ((intptr_t)script[i] >= (intptr_t)(&script[0]) && (intptr_t)script[i] < (intptr_t)(&script[g_scriptSize]))*/) @@ -1148,6 +1150,7 @@ static int C_IncreaseScriptSize(int size) j = (intptr_t)apScriptGameEvent[i]+(intptr_t)&script[0]; apScriptGameEvent[i] = (intptr_t *)j; } + Bfree(scriptptrs); return 0; } @@ -1507,7 +1510,9 @@ static int C_GetNextKeyword(void) //Returns its code # i = HASH_find(&keywH,tempbuf); if (i>=0) { - *g_scriptPtr = i + (g_lineNumber<<12); + if (i == CON_LEFTBRACE || i == CON_RIGHTBRACE || i == CON_NULLOP) + *g_scriptPtr = i + (31337<<12); + else *g_scriptPtr = i + (g_lineNumber<<12); bitptr[(g_scriptPtr-script)>>3] &= ~(1<<((g_scriptPtr-script)&7)); textptr += l; g_scriptPtr++; @@ -1795,6 +1800,30 @@ static int C_GetNextValue(int type) return 0; // literal value } +static int C_CheckEmptyBranch(int tw, intptr_t lastScriptPtr) +{ + if (Bstrncmp(keyw[tw],"if",2) && tw != CON_ELSE) + { + g_ifElseAborted = 0; + return 0; + } + + if ((*(g_scriptPtr) & 0xFFF) != CON_NULLOP || *(g_scriptPtr)>>12 != 31337) + g_ifElseAborted = 0; + + if (g_ifElseAborted) + { +// C_ReportError(-1); + g_scriptPtr = lastScriptPtr + &script[0]; + initprintf("%s:%d: removing empty '%s' branch\n",g_szScriptFileName,g_lineNumber, + keyw[*(g_scriptPtr) & 0xFFF]); + if (g_ifElseAborted) + *(g_scriptPtr) = (CON_NULLOP + (31337<<12)); + return 1; + } + return 0; +} + static int C_ParseCommand(void); static int C_CountCaseStatements() @@ -1844,7 +1873,8 @@ static int C_ParseCommand(void) exit(0); } - if (g_numCompilerErrors > 63 || (*textptr == '\0') || (*(textptr+1) == '\0')) return 1; + if (g_numCompilerErrors > 63 || (*textptr == '\0') || (*(textptr+1) == '\0')) + return 1; if (g_scriptDebug) C_ReportError(-1); @@ -2921,11 +2951,20 @@ static int C_ParseCommand(void) if (g_checkingIfElse) { intptr_t offset; + intptr_t lastScriptPtr = g_scriptPtr - &script[0] - 1; + g_ifElseAborted = 0; g_checkingIfElse--; tempscrptr = g_scriptPtr; offset = (unsigned)(tempscrptr-script); g_scriptPtr++; //Leave a spot for the fail location C_ParseCommand(); + + if (C_CheckEmptyBranch(tw, lastScriptPtr)) + { +// g_scriptPtr; + return 0; + } + tempscrptr = (intptr_t *)script+offset; *tempscrptr = (intptr_t) g_scriptPtr; bitptr[(tempscrptr-script)>>3] |= (BITPTR_POINTER<<((tempscrptr-script)&7)); @@ -4002,15 +4041,20 @@ static int C_ParseCommand(void) case CON_WHILEVARVARN: { intptr_t offset; + intptr_t lastScriptPtr = g_scriptPtr - &script[0] - 1; + + g_ifElseAborted = 0; C_GetManyVars(2); tempscrptr = g_scriptPtr; offset = (unsigned)(g_scriptPtr-script); g_scriptPtr++; // Leave a spot for the fail location - j = C_GetKeyword(); C_ParseCommand(); + if (C_CheckEmptyBranch(tw, lastScriptPtr)) + return 0; + tempscrptr = (intptr_t *)script+offset; *tempscrptr = (intptr_t) g_scriptPtr; bitptr[(tempscrptr-script)>>3] |= (BITPTR_POINTER<<((tempscrptr-script)&7)); @@ -4044,7 +4088,9 @@ static int C_ParseCommand(void) case CON_WHILEVARN: { intptr_t offset; + intptr_t lastScriptPtr = (g_scriptPtr-script-1); + g_ifElseAborted = 0; // get the ID of the DEF C_GetNextVar(); C_GetNextValue(LABEL_DEFINE); // the number to check against... @@ -4053,9 +4099,11 @@ static int C_ParseCommand(void) offset = (unsigned)(tempscrptr-script); g_scriptPtr++; //Leave a spot for the fail location - j = C_GetKeyword(); C_ParseCommand(); + if (C_CheckEmptyBranch(tw, lastScriptPtr)) + return 0; + tempscrptr = (intptr_t *)script+offset; *tempscrptr = (intptr_t) g_scriptPtr; bitptr[(tempscrptr-script)>>3] |= (BITPTR_POINTER<<((tempscrptr-script)&7)); @@ -4243,7 +4291,6 @@ static int C_ParseCommand(void) bitptr[(g_scriptPtr-script)>>3] &= ~(1<<((g_scriptPtr-script)&7)); *g_scriptPtr++=0; // leave spot for 'default' location (null if none) - j = C_GetKeyword(); temptextptr=textptr; // probably does not allow nesting... @@ -4532,6 +4579,13 @@ repeatcase: case CON_IFAI: case CON_IFACTION: case CON_IFMOVE: + case CON_IFP: + { + intptr_t offset; + intptr_t lastScriptPtr = (g_scriptPtr-&script[0]-1); + + g_ifElseAborted = 0; + switch (tw) { case CON_IFAI: @@ -4553,6 +4607,19 @@ repeatcase: C_GetNextValue(LABEL_DEFINE); C_GetNextValue(LABEL_DEFINE); break; + case CON_IFP: + j = 0; + do + { + C_GetNextValue(LABEL_DEFINE); + g_scriptPtr--; + j |= *g_scriptPtr; + } + while (C_GetKeyword() == -1); + bitptr[(g_scriptPtr-script)>>3] &= ~(1<<((g_scriptPtr-script)&7)); + *g_scriptPtr = j; + g_scriptPtr++; + break; case CON_IFSOUND: if (C_CheckEventSync(g_currentEvent)) { @@ -4564,6 +4631,24 @@ repeatcase: break; } + tempscrptr = g_scriptPtr; + offset = (unsigned)(tempscrptr-script); + + g_scriptPtr++; //Leave a spot for the fail location + + C_ParseCommand(); + + if (C_CheckEmptyBranch(tw, lastScriptPtr)) + return 0; + + tempscrptr = (intptr_t *)script+offset; + *tempscrptr = (intptr_t) g_scriptPtr; + bitptr[(tempscrptr-script)>>3] |= (BITPTR_POINTER<<((tempscrptr-script)&7)); + + g_checkingIfElse++; + return 0; + } + case CON_IFONWATER: case CON_IFINWATER: case CON_IFACTORNOTSTAYPUT: @@ -4572,7 +4657,6 @@ repeatcase: case CON_IFSQUISHED: case CON_IFDEAD: case CON_IFCANSHOOTTARGET: - case CON_IFP: case CON_IFHITSPACE: case CON_IFOUTSIDE: case CON_IFMULTIPLAYER: @@ -4586,28 +4670,20 @@ repeatcase: case CON_IFNOSOUNDS: { intptr_t offset; - if (tw == CON_IFP) - { - j = 0; - do - { - C_GetNextValue(LABEL_DEFINE); - g_scriptPtr--; - j |= *g_scriptPtr; - } - while (C_GetKeyword() == -1); - bitptr[(g_scriptPtr-script)>>3] &= ~(1<<((g_scriptPtr-script)&7)); - *g_scriptPtr = j; - g_scriptPtr++; - } + intptr_t lastScriptPtr = (g_scriptPtr-&script[0]-1); + + g_ifElseAborted = 0; tempscrptr = g_scriptPtr; offset = (unsigned)(tempscrptr-script); g_scriptPtr++; //Leave a spot for the fail location - j = C_GetKeyword(); C_ParseCommand(); + + if (C_CheckEmptyBranch(tw, lastScriptPtr)) + return 0; + tempscrptr = (intptr_t *)script+offset; *tempscrptr = (intptr_t) g_scriptPtr; bitptr[(tempscrptr-script)>>3] |= (BITPTR_POINTER<<((tempscrptr-script)&7)); @@ -4615,28 +4691,32 @@ repeatcase: g_checkingIfElse++; return 0; } + case CON_LEFTBRACE: if (!(g_processingState || g_parsingActorPtr || g_parsingEventPtr)) { g_numCompilerErrors++; C_ReportError(ERROR_SYNTAXERROR); } - if (C_GetKeyword() == CON_NULLOP) + /* if (C_GetKeyword() == CON_NULLOP) + { + // initprintf("%s:%d: warning: 'nullop' statement has no effect\n",g_szScriptFileName,g_lineNumber); + C_GetNextKeyword(); + g_scriptPtr--; + } + */ +#if 0 + if (C_GetKeyword() == CON_RIGHTBRACE) // rewrite "{ }" into "nullop" { - initprintf("%s:%d: warning: 'nullop' statement has no effect\n",g_szScriptFileName,g_lineNumber); - C_GetNextKeyword(); - g_scriptPtr--; - } - if (C_GetKeyword() == CON_RIGHTBRACE) // optimize "{ }" into "nullop" - { - if (g_scriptDebug) - initprintf("%s:%d: rewriting empty braces '{ }' as 'nullop'\n",g_szScriptFileName,g_lineNumber); +// initprintf("%s:%d: rewriting empty braces '{ }' as 'nullop' from left\n",g_szScriptFileName,g_lineNumber); *(--g_scriptPtr) = CON_NULLOP; C_GetNextKeyword(); g_scriptPtr--; return 0; } +#endif g_numBraces++; + do done = C_ParseCommand(); while (done == 0); @@ -4644,6 +4724,21 @@ repeatcase: case CON_RIGHTBRACE: g_numBraces--; + + if ((*(g_scriptPtr-2)>>12) == (31337) && + ((*(g_scriptPtr-2) & 0xFFF) == CON_LEFTBRACE)) // rewrite "{ }" into "nullop" + { +// initprintf("%s:%d: rewriting empty braces '{ }' as 'nullop' from right\n",g_szScriptFileName,g_lineNumber); + *(g_scriptPtr-2) = CON_NULLOP + (31337<<12); + g_scriptPtr -= 2; + + if (C_GetKeyword() != CON_ELSE && (*(g_scriptPtr-2)&0xFFF) != CON_ELSE) + g_ifElseAborted = 1; + else g_ifElseAborted = 0; + + return 1; + } + if (g_numBraces < 0) { if (g_checkingSwitch) @@ -5273,7 +5368,12 @@ repeatcase: if (tw == CON_NULLOP) { if (C_GetKeyword() != CON_ELSE) - initprintf("%s:%d: warning: found 'nullop' without 'else'\n",g_szScriptFileName,g_lineNumber); + { + C_ReportError(-1); + initprintf("%s:%d: removing 'nullop' found without 'else'\n",g_szScriptFileName,g_lineNumber); + g_scriptPtr--; + g_ifElseAborted = 1; + } } case CON_STOPALLSOUNDS: return 0; diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index c65b3444c..9ac80d4fb 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -52,13 +52,13 @@ void X_ScriptInfo(void) { intptr_t *p; if (insptr) - for (p=insptr-20;p>12&&(*p&0xFFF)>12,keyw[*p&0xFFF]); - else - initprintf(" %d",*p); - } + for (p=insptr-20;p>12&&(*p&0xFFF)>12,keyw[*p&0xFFF]); + else + initprintf(" %d",*p); + } if (g_i) initprintf("current actor: %d (%d)\n",g_i,g_sp->picnum); initprintf("g_errorLineNum: %d, g_tw: %d\n",g_errorLineNum,g_tw); @@ -1101,7 +1101,7 @@ static int X_DoExecute(void) default: // fix for flying/jumping monsters getting stuck in water if (g_sp->hitag & jumptoplayer || (actorscrptr[g_sp->picnum] && - moveptr >= &script[0] && moveptr <= (&script[0]+g_scriptSize) && *(moveptr+1))) + moveptr >= &script[0] && moveptr <= (&script[0]+g_scriptSize) && *(moveptr+1))) { // OSD_Printf("%d\n",*(moveptr+1)); break; @@ -1656,44 +1656,44 @@ static int X_DoExecute(void) int i = Gv_GetVarX(*insptr++); j = Gv_GetVarX(*insptr++); - if ((i<0 || i>=MAXSPRITES) && g_scriptSanityChecks) - { - OSD_Printf(CON_ERROR "Invalid sprite: %d\n",g_errorLineNum,keyw[g_tw],i); - break; - } - if ((j<0 || j>=MAXSTATUS) && g_scriptSanityChecks) - { - OSD_Printf(CON_ERROR "Invalid statnum: %d\n",g_errorLineNum,keyw[g_tw],j); - break; - } - if (sprite[i].statnum == j) break; - - /* initialize actor data when changing to an actor statnum because there's usually - garbage left over from being handled as a hard coded object */ - - if (sprite[i].statnum > STAT_ZOMBIEACTOR && (j == STAT_ACTOR || j == STAT_ZOMBIEACTOR)) - { - ActorExtra[i].lastvx = 0; - ActorExtra[i].lastvy = 0; - ActorExtra[i].timetosleep = 0; - ActorExtra[i].cgg = 0; - ActorExtra[i].movflag = 0; - ActorExtra[i].tempang = 0; - ActorExtra[i].dispicnum = 0; - T1=T2=T3=T4=T5=T6=T7=T8=T9=0; - ActorExtra[i].flags = 0; - sprite[i].hitag = 0; - - // pointers - if (actorscrptr[sprite[i].picnum]) - { - T5 = *(actorscrptr[sprite[i].picnum]+1); - T2 = *(actorscrptr[sprite[i].picnum]+2); - sprite[i].hitag = *(actorscrptr[sprite[i].picnum]+3); - } - } - changespritestat(i,j); + if ((i<0 || i>=MAXSPRITES) && g_scriptSanityChecks) + { + OSD_Printf(CON_ERROR "Invalid sprite: %d\n",g_errorLineNum,keyw[g_tw],i); break; + } + if ((j<0 || j>=MAXSTATUS) && g_scriptSanityChecks) + { + OSD_Printf(CON_ERROR "Invalid statnum: %d\n",g_errorLineNum,keyw[g_tw],j); + break; + } + if (sprite[i].statnum == j) break; + + /* initialize actor data when changing to an actor statnum because there's usually + garbage left over from being handled as a hard coded object */ + + if (sprite[i].statnum > STAT_ZOMBIEACTOR && (j == STAT_ACTOR || j == STAT_ZOMBIEACTOR)) + { + ActorExtra[i].lastvx = 0; + ActorExtra[i].lastvy = 0; + ActorExtra[i].timetosleep = 0; + ActorExtra[i].cgg = 0; + ActorExtra[i].movflag = 0; + ActorExtra[i].tempang = 0; + ActorExtra[i].dispicnum = 0; + T1=T2=T3=T4=T5=T6=T7=T8=T9=0; + ActorExtra[i].flags = 0; + sprite[i].hitag = 0; + + // pointers + if (actorscrptr[sprite[i].picnum]) + { + T5 = *(actorscrptr[sprite[i].picnum]+1); + T2 = *(actorscrptr[sprite[i].picnum]+2); + sprite[i].hitag = *(actorscrptr[sprite[i].picnum]+3); + } + } + changespritestat(i,j); + break; } case CON_STARTLEVEL: diff --git a/polymer/eduke32/source/gamevars.c b/polymer/eduke32/source/gamevars.c index 084b5294d..ba4a9314e 100644 --- a/polymer/eduke32/source/gamevars.c +++ b/polymer/eduke32/source/gamevars.c @@ -560,7 +560,7 @@ int __fastcall Gv_GetVar(int id, int iActor, int iPlayer) } switch (aGameVars[id].dwFlags & (GAMEVAR_USER_MASK|GAMEVAR_INTPTR| - GAMEVAR_SHORTPTR|GAMEVAR_CHARPTR)) + GAMEVAR_SHORTPTR|GAMEVAR_CHARPTR)) { default: if (neg) return (-aGameVars[id].val.lValue); @@ -606,7 +606,7 @@ void __fastcall Gv_SetVar(int id, int lValue, int iActor, int iPlayer) //AddLog(g_szBuf); switch (aGameVars[id].dwFlags & (GAMEVAR_USER_MASK|GAMEVAR_INTPTR| - GAMEVAR_SHORTPTR|GAMEVAR_CHARPTR)) + GAMEVAR_SHORTPTR|GAMEVAR_CHARPTR)) { default: aGameVars[id].val.lValue=lValue; @@ -683,7 +683,7 @@ int __fastcall Gv_GetVarX(int id) } switch (aGameVars[id].dwFlags & (GAMEVAR_USER_MASK|GAMEVAR_INTPTR| - GAMEVAR_SHORTPTR|GAMEVAR_CHARPTR)) + GAMEVAR_SHORTPTR|GAMEVAR_CHARPTR)) { default: if (neg) return (-aGameVars[id].val.lValue); @@ -710,7 +710,7 @@ int __fastcall Gv_GetVarX(int id) void __fastcall Gv_SetVarX(int id, int lValue) { switch (aGameVars[id].dwFlags & (GAMEVAR_USER_MASK|GAMEVAR_INTPTR| - GAMEVAR_SHORTPTR|GAMEVAR_CHARPTR)) + GAMEVAR_SHORTPTR|GAMEVAR_CHARPTR)) { default: aGameVars[id].val.lValue=lValue; diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 82ebcfc87..07019817e 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -369,11 +369,11 @@ static void G_DoLoadScreen(char *statustext, int percent) } if (statustext) gametext(160,180,statustext,0,2+8+16); -/* j = usehightile; - usehightile = 0; - rotatesprite(34<<16,144<<16,65536,0,LASERLINE,0,0,2+8+16,0,0,scale(scale(xdim-1,288,320),percent,100),ydim-1); - rotatesprite(154<<16,144<<16,65536,0,LASERLINE,0,0,2+8+16,0,0,scale(scale(xdim-1,288,320),percent,100),ydim-1); - usehightile = j; */ + /* j = usehightile; + usehightile = 0; + rotatesprite(34<<16,144<<16,65536,0,LASERLINE,0,0,2+8+16,0,0,scale(scale(xdim-1,288,320),percent,100),ydim-1); + rotatesprite(154<<16,144<<16,65536,0,LASERLINE,0,0,2+8+16,0,0,scale(scale(xdim-1,288,320),percent,100),ydim-1); + usehightile = j; */ { int ii = scale(288,percent,100); int x = 32; @@ -381,9 +381,10 @@ static void G_DoLoadScreen(char *statustext, int percent) usehightile = 0; do { - rotatesprite(x<<16,140<<16,49152,0,NOTCHON,0,2,2+8+16,0,0,xdim-1,ydim-1); + rotatesprite(x<<16,140<<16,49152,0,NOTCHON,0,2,2+8+16,0,0,xdim-1,ydim-1); x++; - } while (x < ii); + } + while (x < ii); usehightile = j; } X_OnEvent(EVENT_DISPLAYLOADINGSCREEN, g_player[screenpeek].ps->i, screenpeek, -1);