mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
git-svn-id: https://svn.eduke32.com/eduke32@1198 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
ac7607a8bb
commit
475d582283
10 changed files with 78 additions and 44 deletions
|
@ -494,10 +494,20 @@ static void print_os_version(void)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (osv.dwMajorVersion == 6 && osv.dwMinorVersion == 0)
|
|
||||||
|
if (osv.dwMajorVersion == 6)
|
||||||
{
|
{
|
||||||
ver = "Vista";
|
|
||||||
is_vista = 1;
|
is_vista = 1;
|
||||||
|
switch (osv.dwMinorVersion)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
ver = "Vista";
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
ver = "7";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -568,8 +568,8 @@ void A_DeleteSprite(int s)
|
||||||
}
|
}
|
||||||
if (apScriptGameEvent[EVENT_KILLIT])
|
if (apScriptGameEvent[EVENT_KILLIT])
|
||||||
{
|
{
|
||||||
static int p, pl;
|
int p, pl=A_FindPlayer(&sprite[s],&p);
|
||||||
pl=A_FindPlayer(&sprite[s],&p);
|
|
||||||
Gv_SetVar(g_iReturnVarID,0, -1, -1);
|
Gv_SetVar(g_iReturnVarID,0, -1, -1);
|
||||||
X_OnEvent(EVENT_KILLIT, s, pl, p);
|
X_OnEvent(EVENT_KILLIT, s, pl, p);
|
||||||
if (Gv_GetVar(g_iReturnVarID, -1, -1))
|
if (Gv_GetVar(g_iReturnVarID, -1, -1))
|
||||||
|
@ -7756,15 +7756,18 @@ void G_MoveWorld(void)
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
i = headspritestat[k];
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
j = nextspritestat[i];
|
|
||||||
pl=A_FindPlayer(&sprite[i],&p);
|
pl = A_FindPlayer(&sprite[i],&p);
|
||||||
X_OnEvent(EVENT_GAME,i, pl, p);
|
X_OnEvent(EVENT_GAME,i, pl, p);
|
||||||
i = j;
|
i = j;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BUILDDATE " 20081230"
|
#define BUILDDATE " 20090101"
|
||||||
#define VERSION " 1.2.0devel"
|
#define VERSION " 1.2.0devel"
|
||||||
|
|
||||||
static int floor_over_floor;
|
static int floor_over_floor;
|
||||||
|
@ -1951,14 +1951,18 @@ static void ReadPaletteTable()
|
||||||
{
|
{
|
||||||
int i,j,fp;
|
int i,j,fp;
|
||||||
char lookup_num;
|
char lookup_num;
|
||||||
|
|
||||||
|
for (j = 0; j < 256; j++)
|
||||||
|
tempbuf[j] = j;
|
||||||
|
|
||||||
|
for (i=1;i<MAXPALOOKUPS;i++)
|
||||||
|
makepalookup(i,tempbuf,0,0,0,1);
|
||||||
|
|
||||||
if ((fp=kopen4load("lookup.dat",0)) == -1)
|
if ((fp=kopen4load("lookup.dat",0)) == -1)
|
||||||
{
|
{
|
||||||
if ((fp=kopen4load("lookup.dat",1)) == -1)
|
if ((fp=kopen4load("lookup.dat",1)) == -1)
|
||||||
{
|
{
|
||||||
initprintf("LOOKUP.DAT not found, creating dummy palette lookups\n");
|
initprintf("LOOKUP.DAT not found\n");
|
||||||
for (i=0;i<256;i++)
|
|
||||||
tempbuf[i] = ((i+32)&255); //remap colors for screwy palette sectors
|
|
||||||
makepalookup(MAXPALOOKUPS,tempbuf,0,0,0,1);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -962,7 +962,7 @@ enum LogoFlags_t {
|
||||||
LOGO_TENSCREEN = 512
|
LOGO_TENSCREEN = 512
|
||||||
};
|
};
|
||||||
|
|
||||||
extern int g_numPalettes;
|
extern int g_numRealPalettes;
|
||||||
extern int g_scriptDebug;
|
extern int g_scriptDebug;
|
||||||
|
|
||||||
#define MAXCHEATLEN 20
|
#define MAXCHEATLEN 20
|
||||||
|
|
|
@ -59,7 +59,7 @@ extern int isanearoperator(int lotag);
|
||||||
extern inline int CheckPlayerInSector(int sect);
|
extern inline int CheckPlayerInSector(int sect);
|
||||||
extern int ldist(spritetype *s1,spritetype *s2);
|
extern int ldist(spritetype *s1,spritetype *s2);
|
||||||
extern int dist(spritetype *s1,spritetype *s2);
|
extern int dist(spritetype *s1,spritetype *s2);
|
||||||
extern int A_FindPlayer(spritetype *s,int *d);
|
extern int __fastcall A_FindPlayer(spritetype *s,int *d);
|
||||||
extern int P_FindOtherPlayer(int p,int *d);
|
extern int P_FindOtherPlayer(int p,int *d);
|
||||||
extern void G_DoSectorAnimations(void);
|
extern void G_DoSectorAnimations(void);
|
||||||
extern int GetAnimationGoal(int *animptr);
|
extern int GetAnimationGoal(int *animptr);
|
||||||
|
|
|
@ -7163,7 +7163,7 @@ void G_DoSpriteAnimations(int x,int y,int a,int smoothratio)
|
||||||
|
|
||||||
PALONLY:
|
PALONLY:
|
||||||
|
|
||||||
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;
|
t->pal = sector[sect].floorpal;
|
||||||
|
|
||||||
if (s->owner == -1) continue;
|
if (s->owner == -1) continue;
|
||||||
|
@ -7204,7 +7204,7 @@ PALONLY:
|
||||||
else t->picnum += T1;
|
else t->picnum += T1;
|
||||||
t->shade -= 6;
|
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;
|
t->pal = sector[sect].floorpal;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -7215,7 +7215,7 @@ PALONLY:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
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;
|
t->pal = sector[sect].floorpal;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -10301,16 +10301,22 @@ static void G_LoadExtraPalettes(void)
|
||||||
|
|
||||||
fp = kopen4loadfrommod(lookfn,0);
|
fp = kopen4loadfrommod(lookfn,0);
|
||||||
if (fp != -1)
|
if (fp != -1)
|
||||||
kread(fp,(char *)&g_numPalettes,1);
|
kread(fp,(char *)&g_numRealPalettes,1);
|
||||||
else
|
else
|
||||||
G_GameExit("\nERROR: File 'lookup.dat' not found.");
|
G_GameExit("\nERROR: File 'lookup.dat' not found.");
|
||||||
|
|
||||||
#if defined(__APPLE__) && B_BIG_ENDIAN != 0
|
#if defined(__APPLE__) && B_BIG_ENDIAN != 0
|
||||||
// this is almost as bad as just setting the value to 25 :P
|
// 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
|
#endif
|
||||||
|
|
||||||
for (j=g_numPalettes-1;j>=0;j--)
|
for (j = 0; j < 256; j++)
|
||||||
|
tempbuf[j] = j;
|
||||||
|
|
||||||
|
for (j=g_numRealPalettes+1;j<MAXPALOOKUPS;j++)
|
||||||
|
makepalookup(j,tempbuf,0,0,0,1);
|
||||||
|
|
||||||
|
for (j=g_numRealPalettes-1;j>=0;j--)
|
||||||
{
|
{
|
||||||
kread(fp,(signed char *)&look_pos,1);
|
kread(fp,(signed char *)&look_pos,1);
|
||||||
kread(fp,tempbuf,256);
|
kread(fp,tempbuf,256);
|
||||||
|
@ -10319,11 +10325,11 @@ static void G_LoadExtraPalettes(void)
|
||||||
|
|
||||||
for (j = 255; j>=0; j--)
|
for (j = 255; j>=0; j--)
|
||||||
tempbuf[j] = j;
|
tempbuf[j] = j;
|
||||||
g_numPalettes++;
|
g_numRealPalettes++;
|
||||||
makepalookup(g_numPalettes, tempbuf, 15, 15, 15, 1);
|
makepalookup(g_numRealPalettes, tempbuf, 15, 15, 15, 1);
|
||||||
makepalookup(g_numPalettes + 1, tempbuf, 15, 0, 0, 1);
|
makepalookup(g_numRealPalettes + 1, tempbuf, 15, 0, 0, 1);
|
||||||
makepalookup(g_numPalettes + 2, tempbuf, 0, 15, 0, 1);
|
makepalookup(g_numRealPalettes + 2, tempbuf, 0, 15, 0, 1);
|
||||||
makepalookup(g_numPalettes + 3, tempbuf, 0, 0, 15, 1);
|
makepalookup(g_numRealPalettes + 3, tempbuf, 0, 0, 15, 1);
|
||||||
|
|
||||||
kread(fp,&waterpal[0],768);
|
kread(fp,&waterpal[0],768);
|
||||||
kread(fp,&slimepal[0],768);
|
kread(fp,&slimepal[0],768);
|
||||||
|
|
|
@ -1768,10 +1768,11 @@ static int C_GetNextValue(int type)
|
||||||
i = l-1;
|
i = l-1;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
if (textptr[0] == '0' && textptr[1] == 'x') break; // kill the warning for hex
|
||||||
if (!isdigit(textptr[i--]))
|
if (!isdigit(textptr[i--]))
|
||||||
{
|
{
|
||||||
C_ReportError(-1);
|
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++;
|
g_numCompilerWarnings++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -4620,6 +4621,14 @@ repeatcase:
|
||||||
g_numCompilerErrors++;
|
g_numCompilerErrors++;
|
||||||
C_ReportError(ERROR_SYNTAXERROR);
|
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++;
|
g_numBraces++;
|
||||||
do
|
do
|
||||||
done = C_ParseCommand();
|
done = C_ParseCommand();
|
||||||
|
|
|
@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
#include "duke3d.h"
|
#include "duke3d.h"
|
||||||
|
|
||||||
const char *s_buildDate = "20081230";
|
const char *s_buildDate = "20090101";
|
||||||
char *MusicPtr = NULL;
|
char *MusicPtr = NULL;
|
||||||
int g_musicSize;
|
int g_musicSize;
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ extern char pow2char[];
|
||||||
|
|
||||||
extern int everyothertime;
|
extern int everyothertime;
|
||||||
static int g_whichPalForPlayer = 9;
|
static int g_whichPalForPlayer = 9;
|
||||||
int g_numPalettes;
|
int g_numRealPalettes;
|
||||||
short SpriteCacheList[MAXTILES][3];
|
short SpriteCacheList[MAXTILES][3];
|
||||||
|
|
||||||
static char precachehightile[2][MAXTILES>>3];
|
static char precachehightile[2][MAXTILES>>3];
|
||||||
|
|
|
@ -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)
|
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);
|
*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;
|
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);
|
int j, closest_player = 0;
|
||||||
if (x < closest && sprite[g_player[j].ps->i].extra > 0)
|
int x, closest = 0x7fffffff;
|
||||||
{
|
|
||||||
closest_player = j;
|
|
||||||
closest = x;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
*d = closest;
|
TRAVERSE_CONNECT(j)
|
||||||
return closest_player;
|
{
|
||||||
|
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)
|
int P_FindOtherPlayer(int p,int *d)
|
||||||
|
|
Loading…
Reference in a new issue