diff --git a/polymer/eduke32/build/src/winlayer.c b/polymer/eduke32/build/src/winlayer.c index 5d40476bb..99ad7621e 100644 --- a/polymer/eduke32/build/src/winlayer.c +++ b/polymer/eduke32/build/src/winlayer.c @@ -494,10 +494,20 @@ static void print_os_version(void) } break; } - if (osv.dwMajorVersion == 6 && osv.dwMinorVersion == 0) + + if (osv.dwMajorVersion == 6) { - ver = "Vista"; is_vista = 1; + switch (osv.dwMinorVersion) + { + case 0: + ver = "Vista"; + break; + case 1: + ver = "7"; + break; + } + break; } break; diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 4437c1fe1..6f28d262a 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -568,8 +568,8 @@ void A_DeleteSprite(int s) } if (apScriptGameEvent[EVENT_KILLIT]) { - static int p, pl; - pl=A_FindPlayer(&sprite[s],&p); + int p, pl=A_FindPlayer(&sprite[s],&p); + Gv_SetVar(g_iReturnVarID,0, -1, -1); X_OnEvent(EVENT_KILLIT, s, pl, p); if (Gv_GetVar(g_iReturnVarID, -1, -1)) @@ -7756,15 +7756,18 @@ void G_MoveWorld(void) do { i = headspritestat[k]; - while (i > 0) + + while (i >= 0) { - if (A_CheckSpriteFlags(i,SPRITE_NOEVENTCODE)) + j = nextspritestat[i]; + + if (A_CheckSpriteFlags(i, SPRITE_NOEVENTCODE)) { - i = nextspritestat[i]; + i = j; continue; } - j = nextspritestat[i]; - pl=A_FindPlayer(&sprite[i],&p); + + pl = A_FindPlayer(&sprite[i],&p); X_OnEvent(EVENT_GAME,i, pl, p); i = j; } diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 0e159620a..fdae2b7a2 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -44,7 +44,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #endif -#define BUILDDATE " 20081230" +#define BUILDDATE " 20090101" #define VERSION " 1.2.0devel" static int floor_over_floor; @@ -1951,14 +1951,18 @@ static void ReadPaletteTable() { int i,j,fp; char lookup_num; + + for (j = 0; j < 256; j++) + tempbuf[j] = j; + + for (i=1;iowner,SPRITE_NOPAL)) + if (sector[sect].floorpal && sector[sect].floorpal < g_numRealPalettes && !A_CheckSpriteFlags(t->owner,SPRITE_NOPAL)) t->pal = sector[sect].floorpal; if (s->owner == -1) continue; @@ -7204,7 +7204,7 @@ PALONLY: else t->picnum += T1; t->shade -= 6; - if (sector[sect].floorpal && sector[sect].floorpal < g_numPalettes && !A_CheckSpriteFlags(t->owner,SPRITE_NOPAL)) + if (sector[sect].floorpal && sector[sect].floorpal < g_numRealPalettes && !A_CheckSpriteFlags(t->owner,SPRITE_NOPAL)) t->pal = sector[sect].floorpal; break; @@ -7215,7 +7215,7 @@ PALONLY: break; } default: - if (sector[sect].floorpal && sector[sect].floorpal < g_numPalettes && !A_CheckSpriteFlags(t->owner,SPRITE_NOPAL)) + if (sector[sect].floorpal && sector[sect].floorpal < g_numRealPalettes && !A_CheckSpriteFlags(t->owner,SPRITE_NOPAL)) t->pal = sector[sect].floorpal; break; } @@ -10301,16 +10301,22 @@ static void G_LoadExtraPalettes(void) fp = kopen4loadfrommod(lookfn,0); if (fp != -1) - kread(fp,(char *)&g_numPalettes,1); + kread(fp,(char *)&g_numRealPalettes,1); else G_GameExit("\nERROR: File 'lookup.dat' not found."); #if defined(__APPLE__) && B_BIG_ENDIAN != 0 // this is almost as bad as just setting the value to 25 :P - g_numPalettes = (g_numPalettes * (uint64)0x0202020202 & (uint64)0x010884422010) % 1023; + g_numRealPalettes = (g_numRealPalettes * (uint64)0x0202020202 & (uint64)0x010884422010) % 1023; #endif - for (j=g_numPalettes-1;j>=0;j--) + for (j = 0; j < 256; j++) + tempbuf[j] = j; + + for (j=g_numRealPalettes+1;j=0;j--) { kread(fp,(signed char *)&look_pos,1); kread(fp,tempbuf,256); @@ -10319,11 +10325,11 @@ static void G_LoadExtraPalettes(void) for (j = 255; j>=0; j--) tempbuf[j] = j; - g_numPalettes++; - makepalookup(g_numPalettes, tempbuf, 15, 15, 15, 1); - makepalookup(g_numPalettes + 1, tempbuf, 15, 0, 0, 1); - makepalookup(g_numPalettes + 2, tempbuf, 0, 15, 0, 1); - makepalookup(g_numPalettes + 3, tempbuf, 0, 0, 15, 1); + g_numRealPalettes++; + makepalookup(g_numRealPalettes, tempbuf, 15, 15, 15, 1); + makepalookup(g_numRealPalettes + 1, tempbuf, 15, 0, 0, 1); + makepalookup(g_numRealPalettes + 2, tempbuf, 0, 15, 0, 1); + makepalookup(g_numRealPalettes + 3, tempbuf, 0, 0, 15, 1); kread(fp,&waterpal[0],768); kread(fp,&slimepal[0],768); diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index ceb88835c..8d838f137 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -1768,10 +1768,11 @@ static int C_GetNextValue(int type) i = l-1; do { + if (textptr[0] == '0' && textptr[1] == 'x') break; // kill the warning for hex if (!isdigit(textptr[i--])) { C_ReportError(-1); - initprintf("%s:%d: warning: invalid definition!\n",g_szScriptFileName,g_lineNumber); + initprintf("%s:%d: warning: invalid character in definition: '%c'!\n",g_szScriptFileName,g_lineNumber,textptr[i+1]); g_numCompilerWarnings++; break; } @@ -4620,6 +4621,14 @@ repeatcase: g_numCompilerErrors++; C_ReportError(ERROR_SYNTAXERROR); } + if (C_GetKeyword() == CON_RIGHTBRACE) // optimize "{ }" into "nullop" + { +// initprintf("%s:%d: optimizing \"{ }\" -> nullop\n",g_szScriptFileName,g_lineNumber); + *(--g_scriptPtr) = CON_NULLOP; + C_GetNextKeyword(); + g_scriptPtr--; + return 0; + } g_numBraces++; do done = C_ParseCommand(); diff --git a/polymer/eduke32/source/global.c b/polymer/eduke32/source/global.c index d0049a12f..ed80f7b3c 100644 --- a/polymer/eduke32/source/global.c +++ b/polymer/eduke32/source/global.c @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //------------------------------------------------------------------------- #include "duke3d.h" -const char *s_buildDate = "20081230"; +const char *s_buildDate = "20090101"; char *MusicPtr = NULL; int g_musicSize; diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 9db9f6f88..82ebcfc87 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -34,7 +34,7 @@ extern char pow2char[]; extern int everyothertime; static int g_whichPalForPlayer = 9; -int g_numPalettes; +int g_numRealPalettes; short SpriteCacheList[MAXTILES][3]; static char precachehightile[2][MAXTILES>>3]; diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index 313f1dd36..760722b1a 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -225,29 +225,31 @@ int dist(spritetype *s1,spritetype *s2) } } -int A_FindPlayer(spritetype *s,int *d) +int __fastcall A_FindPlayer(spritetype *s, int *d) { - int j, closest_player = 0; - int x, closest = 0x7fffffff; - if (ud.multimode < 2) { *d = klabs(g_player[myconnectindex].ps->oposx-s->x) + klabs(g_player[myconnectindex].ps->oposy-s->y) + ((klabs(g_player[myconnectindex].ps->oposz-s->z+(28<<8)))>>4); return myconnectindex; } - TRAVERSE_CONNECT(j) { - x = klabs(g_player[j].ps->oposx-s->x) + klabs(g_player[j].ps->oposy-s->y) + ((klabs(g_player[j].ps->oposz-s->z+(28<<8)))>>4); - if (x < closest && sprite[g_player[j].ps->i].extra > 0) - { - closest_player = j; - closest = x; - } - } + int j, closest_player = 0; + int x, closest = 0x7fffffff; - *d = closest; - return closest_player; + TRAVERSE_CONNECT(j) + { + x = klabs(g_player[j].ps->oposx-s->x) + klabs(g_player[j].ps->oposy-s->y) + ((klabs(g_player[j].ps->oposz-s->z+(28<<8)))>>4); + if (x < closest && sprite[g_player[j].ps->i].extra > 0) + { + closest_player = j; + closest = x; + } + } + + *d = closest; + return closest_player; + } } int P_FindOtherPlayer(int p,int *d)