mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
git-svn-id: https://svn.eduke32.com/eduke32@1150 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
f2a2b491d6
commit
26a97cb6b7
15 changed files with 262 additions and 209 deletions
|
@ -164,7 +164,7 @@ EDITOROBJS=$(OBJ)/astub.$o
|
||||||
ifeq ($(PLATFORM),LINUX)
|
ifeq ($(PLATFORM),LINUX)
|
||||||
OURCFLAGS += -fno-pic
|
OURCFLAGS += -fno-pic
|
||||||
NASMFLAGS += -f elf
|
NASMFLAGS += -f elf
|
||||||
LIBS += -lvorbisfile -lvorbis -logg
|
LIBS += -lvorbisfile -lvorbis -logg -lprofiler
|
||||||
USE_OPENAL = 0
|
USE_OPENAL = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -139,7 +139,7 @@ EDITOROBJS=$(OBJ)/build.$o \
|
||||||
|
|
||||||
ifeq ($(PLATFORM),LINUX)
|
ifeq ($(PLATFORM),LINUX)
|
||||||
ASFLAGS+= -f elf
|
ASFLAGS+= -f elf
|
||||||
LIBS+= -lm
|
LIBS+= -lm -lprofiler
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),DARWIN)
|
ifeq ($(PLATFORM),DARWIN)
|
||||||
ENGINEOBJS += $(OBJ)/StartupWinController.editor.$o \
|
ENGINEOBJS += $(OBJ)/StartupWinController.editor.$o \
|
||||||
|
|
|
@ -72,6 +72,7 @@ enum
|
||||||
T_SETUPTILE,T_SETUPTILERANGE,
|
T_SETUPTILE,T_SETUPTILERANGE,
|
||||||
T_ANIMTILERANGE,
|
T_ANIMTILERANGE,
|
||||||
T_CACHESIZE,
|
T_CACHESIZE,
|
||||||
|
T_IMPORTTILE,
|
||||||
T_MUSIC,T_ID,T_SOUND,
|
T_MUSIC,T_ID,T_SOUND,
|
||||||
T_REDPAL,T_BLUEPAL,T_BROWNPAL,T_GREYPAL,T_GREENPAL,T_SPECPAL
|
T_REDPAL,T_BLUEPAL,T_BROWNPAL,T_GREYPAL,T_GREENPAL,T_SPECPAL
|
||||||
};
|
};
|
||||||
|
@ -126,6 +127,7 @@ static tokenlist basetokens[] =
|
||||||
{ "setuptilerange", T_SETUPTILERANGE },
|
{ "setuptilerange", T_SETUPTILERANGE },
|
||||||
{ "animtilerange", T_ANIMTILERANGE },
|
{ "animtilerange", T_ANIMTILERANGE },
|
||||||
{ "cachesize", T_CACHESIZE },
|
{ "cachesize", T_CACHESIZE },
|
||||||
|
{ "importtile", T_IMPORTTILE },
|
||||||
};
|
};
|
||||||
|
|
||||||
static tokenlist modeltokens[] =
|
static tokenlist modeltokens[] =
|
||||||
|
@ -589,6 +591,49 @@ static int defsparser(scriptfile *script)
|
||||||
picanm[tile1]=(spd<<24)+(type<<6)+tile2-tile1;
|
picanm[tile1]=(spd<<24)+(type<<6)+tile2-tile1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case T_IMPORTTILE:
|
||||||
|
{
|
||||||
|
int tile, xsiz, ysiz, j;
|
||||||
|
extern char faketile[MAXTILES];
|
||||||
|
extern char *faketiledata[MAXTILES];
|
||||||
|
int *picptr = NULL;
|
||||||
|
int bpl;
|
||||||
|
char *fn;
|
||||||
|
palette_t *col;
|
||||||
|
extern int getclosestcol(int r, int g, int b);
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (scriptfile_getsymbol(script,&tile)) break;
|
||||||
|
if (scriptfile_getstring(script,&fn)) break;
|
||||||
|
|
||||||
|
kpzload(fn, (intptr_t *)&picptr, &bpl, &xsiz, &ysiz);
|
||||||
|
|
||||||
|
initprintf("got bpl %d xsiz %d ysiz %d\n",bpl,xsiz,ysiz);
|
||||||
|
|
||||||
|
faketiledata[tile] = Bmalloc(xsiz*ysiz);
|
||||||
|
|
||||||
|
for (i=0;i<(xsiz*ysiz);i++)
|
||||||
|
{
|
||||||
|
col = (palette_t *)&picptr[i];
|
||||||
|
faketiledata[tile][i] = getclosestcol(col->b>>2,col->g>>2,col->r>>2);
|
||||||
|
// initprintf(" %d %d %d %d\n",col->r,col->g,col->b,col->f);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (xsiz > 0 && ysiz > 0)
|
||||||
|
{
|
||||||
|
tilesizx[tile] = xsiz;
|
||||||
|
tilesizy[tile] = ysiz;
|
||||||
|
faketile[tile] = 2;
|
||||||
|
picanm[tile] = 0;
|
||||||
|
|
||||||
|
j = 15; while ((j > 1) && (pow2long[j] > xsiz)) j--;
|
||||||
|
picsiz[tile] = ((char)j);
|
||||||
|
j = 15; while ((j > 1) && (pow2long[j] > ysiz)) j--;
|
||||||
|
picsiz[tile] += ((char)(j<<4));
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
case T_DUMMYTILE:
|
case T_DUMMYTILE:
|
||||||
{
|
{
|
||||||
int tile, xsiz, ysiz, j;
|
int tile, xsiz, ysiz, j;
|
||||||
|
|
|
@ -8047,6 +8047,7 @@ int loadpics(char *filename, int askedsize)
|
||||||
//
|
//
|
||||||
char cachedebug = 0;
|
char cachedebug = 0;
|
||||||
char faketile[MAXTILES];
|
char faketile[MAXTILES];
|
||||||
|
char *faketiledata[MAXTILES];
|
||||||
int h_xsize[MAXTILES], h_ysize[MAXTILES];
|
int h_xsize[MAXTILES], h_ysize[MAXTILES];
|
||||||
signed char h_xoffs[MAXTILES], h_yoffs[MAXTILES];
|
signed char h_xoffs[MAXTILES], h_yoffs[MAXTILES];
|
||||||
|
|
||||||
|
@ -8093,7 +8094,14 @@ void loadtile(short tilenume)
|
||||||
faketimerhandler();
|
faketimerhandler();
|
||||||
artfilplc = tilefileoffs[tilenume]+dasiz;
|
artfilplc = tilefileoffs[tilenume]+dasiz;
|
||||||
}
|
}
|
||||||
else { Bmemset((char *)waloff[tilenume],0,dasiz); faketimerhandler(); }
|
else
|
||||||
|
{
|
||||||
|
if (faketile[tilenume] == 1 || (faketile[tilenume] == 2 && faketiledata[tilenume] == NULL))
|
||||||
|
Bmemset((char *)waloff[tilenume],0,dasiz);
|
||||||
|
else if (faketile[tilenume] == 2)
|
||||||
|
Bmemcpy((char *)waloff[tilenume],faketiledata[tilenume],dasiz);
|
||||||
|
faketimerhandler();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void checktile(short tilenume)
|
void checktile(short tilenume)
|
||||||
|
|
|
@ -516,6 +516,10 @@
|
||||||
RelativePath=".\source\keys.h"
|
RelativePath=".\source\keys.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\source\macros.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\source\mapster32.h"
|
RelativePath=".\source\mapster32.h"
|
||||||
>
|
>
|
||||||
|
@ -556,10 +560,6 @@
|
||||||
RelativePath=".\source\startwin.game.h"
|
RelativePath=".\source\startwin.game.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath=".\source\swmacros.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
</Filter>
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
|
|
|
@ -1324,13 +1324,14 @@ static void G_MoveFallers(void)
|
||||||
A_SetSprite(i,CLIPMASK0);
|
A_SetSprite(i,CLIPMASK0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (G_CheckForSpaceFloor(s->sectnum)) x = 0;
|
if (G_CheckForSpaceFloor(s->sectnum))
|
||||||
|
x = 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (G_CheckForSpaceCeiling(s->sectnum))
|
if (G_CheckForSpaceCeiling(s->sectnum))
|
||||||
x = SpriteGravity/6;
|
x = g_spriteGravity/6;
|
||||||
else
|
else
|
||||||
x = SpriteGravity;
|
x = g_spriteGravity;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->z < (sector[sect].floorz-FOURSLEIGHT))
|
if (s->z < (sector[sect].floorz-FOURSLEIGHT))
|
||||||
|
@ -2389,7 +2390,7 @@ static void G_MoveWeapons(void)
|
||||||
|
|
||||||
if (ActorExtra[i].projectile.workslike & PROJECTILE_SPIT)
|
if (ActorExtra[i].projectile.workslike & PROJECTILE_SPIT)
|
||||||
if (s->zvel < 6144)
|
if (s->zvel < 6144)
|
||||||
s->zvel += SpriteGravity-112;
|
s->zvel += g_spriteGravity-112;
|
||||||
|
|
||||||
k = s->xvel;
|
k = s->xvel;
|
||||||
ll = s->zvel;
|
ll = s->zvel;
|
||||||
|
@ -2878,7 +2879,7 @@ static void G_MoveWeapons(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (s->picnum == SPIT) if (s->zvel < 6144)
|
else if (s->picnum == SPIT) if (s->zvel < 6144)
|
||||||
s->zvel += SpriteGravity-112;
|
s->zvel += g_spriteGravity-112;
|
||||||
|
|
||||||
if (j != 0)
|
if (j != 0)
|
||||||
{
|
{
|
||||||
|
@ -4944,11 +4945,11 @@ static void G_MoveMisc(void) // STATNUM 5
|
||||||
if (sector[sect].lotag == 2)
|
if (sector[sect].lotag == 2)
|
||||||
{
|
{
|
||||||
if (s->zvel < 64)
|
if (s->zvel < 64)
|
||||||
s->zvel += (SpriteGravity>>5)+(krand()&7);
|
s->zvel += (g_spriteGravity>>5)+(krand()&7);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (s->zvel < 144)
|
if (s->zvel < 144)
|
||||||
s->zvel += (SpriteGravity>>5)+(krand()&7);
|
s->zvel += (g_spriteGravity>>5)+(krand()&7);
|
||||||
}
|
}
|
||||||
|
|
||||||
A_SetSprite(i,CLIPMASK0);
|
A_SetSprite(i,CLIPMASK0);
|
||||||
|
@ -5039,7 +5040,7 @@ static void G_MoveMisc(void) // STATNUM 5
|
||||||
s->zvel += 48;
|
s->zvel += 48;
|
||||||
else s->zvel = 1024;
|
else s->zvel = 1024;
|
||||||
}
|
}
|
||||||
else s->zvel += SpriteGravity-50;
|
else s->zvel += g_spriteGravity-50;
|
||||||
}
|
}
|
||||||
|
|
||||||
s->x += (s->xvel*sintable[(s->ang+512)&2047])>>14;
|
s->x += (s->xvel*sintable[(s->ang+512)&2047])>>14;
|
||||||
|
@ -5195,7 +5196,7 @@ static void G_MoveMisc(void) // STATNUM 5
|
||||||
t[0]++;
|
t[0]++;
|
||||||
t[0] &= 3;
|
t[0] &= 3;
|
||||||
}
|
}
|
||||||
if (s->zvel < 128) s->zvel += (SpriteGravity/13); // 8
|
if (s->zvel < 128) s->zvel += (g_spriteGravity/13); // 8
|
||||||
else s->zvel -= 64;
|
else s->zvel -= 64;
|
||||||
if (s->xvel > 0)
|
if (s->xvel > 0)
|
||||||
s->xvel -= 4;
|
s->xvel -= 4;
|
||||||
|
@ -5210,7 +5211,7 @@ static void G_MoveMisc(void) // STATNUM 5
|
||||||
t[0]++;
|
t[0]++;
|
||||||
t[0] &= 3;
|
t[0] &= 3;
|
||||||
}
|
}
|
||||||
if (s->zvel < 512) s->zvel += (SpriteGravity/3); // 52;
|
if (s->zvel < 512) s->zvel += (g_spriteGravity/3); // 52;
|
||||||
if (s->xvel > 0)
|
if (s->xvel > 0)
|
||||||
s->xvel --;
|
s->xvel --;
|
||||||
// else KILLIT(i);
|
// else KILLIT(i);
|
||||||
|
@ -5284,7 +5285,7 @@ static void G_MoveMisc(void) // STATNUM 5
|
||||||
else t[0]++;
|
else t[0]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (s->zvel < 4096) s->zvel += SpriteGravity-50;
|
if (s->zvel < 4096) s->zvel += g_spriteGravity-50;
|
||||||
s->x += (s->xvel*sintable[(s->ang+512)&2047])>>14;
|
s->x += (s->xvel*sintable[(s->ang+512)&2047])>>14;
|
||||||
s->y += (s->xvel*sintable[s->ang&2047])>>14;
|
s->y += (s->xvel*sintable[s->ang&2047])>>14;
|
||||||
s->z += s->zvel;
|
s->z += s->zvel;
|
||||||
|
|
|
@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#define APPNAME "EDuke32"
|
#define APPNAME "EDuke32"
|
||||||
#define VERSION " 1.5.0devel"
|
#define VERSION " 1.5.0devel"
|
||||||
// this is checked against http://eduke32.com/VERSION
|
// this is checked against http://eduke32.com/VERSION
|
||||||
extern char *s_builddate;
|
extern const char *s_buildDate;
|
||||||
#define HEAD2 APPNAME VERSION
|
#define HEAD2 APPNAME VERSION
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -55,7 +55,7 @@ extern "C" {
|
||||||
|
|
||||||
#include "function.h"
|
#include "function.h"
|
||||||
|
|
||||||
#include "swmacros.h"
|
#include "macros.h"
|
||||||
|
|
||||||
#define HORIZ_MIN -99
|
#define HORIZ_MIN -99
|
||||||
#define HORIZ_MAX 299
|
#define HORIZ_MAX 299
|
||||||
|
@ -491,7 +491,7 @@ typedef struct {
|
||||||
|
|
||||||
extern char tempbuf[2048], packbuf[576], menutextbuf[128];
|
extern char tempbuf[2048], packbuf[576], menutextbuf[128];
|
||||||
|
|
||||||
extern int SpriteGravity;
|
extern int g_spriteGravity;
|
||||||
|
|
||||||
extern int g_impactDamage,g_actorRespawnTime,g_itemRespawnTime;
|
extern int g_impactDamage,g_actorRespawnTime,g_itemRespawnTime;
|
||||||
extern int g_startArmorAmount;
|
extern int g_startArmorAmount;
|
||||||
|
@ -546,6 +546,7 @@ typedef struct {
|
||||||
short tempang,actorstayput,dispicnum;
|
short tempang,actorstayput,dispicnum;
|
||||||
short timetosleep;
|
short timetosleep;
|
||||||
char cgg;
|
char cgg;
|
||||||
|
char filler;
|
||||||
projectile_t projectile;
|
projectile_t projectile;
|
||||||
} actordata_t;
|
} actordata_t;
|
||||||
|
|
||||||
|
|
|
@ -49,8 +49,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
#include <winsock2.h>
|
|
||||||
#include <ws2tcpip.h>
|
|
||||||
extern int G_GetVersionFromWebsite(char *buffer);
|
extern int G_GetVersionFromWebsite(char *buffer);
|
||||||
#define UPDATEINTERVAL 604800 // 1w
|
#define UPDATEINTERVAL 604800 // 1w
|
||||||
#else
|
#else
|
||||||
|
@ -169,101 +167,6 @@ unsigned int g_frameDelay = 0;
|
||||||
extern char forcegl;
|
extern char forcegl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
int G_GetVersionFromWebsite(char *buffer) // FIXME: this probably belongs in game land
|
|
||||||
{
|
|
||||||
int wsainitialized = 0;
|
|
||||||
int bytes_sent, i=0, j=0;
|
|
||||||
struct sockaddr_in dest_addr;
|
|
||||||
struct hostent *h;
|
|
||||||
char *host = "eduke32.sourceforge.net";
|
|
||||||
char *req = "GET http://eduke32.sourceforge.net/VERSION HTTP/1.0\r\n\r\n";
|
|
||||||
char tempbuf[2048],otherbuf[16],ver[16];
|
|
||||||
SOCKET mysock;
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
if (wsainitialized == 0)
|
|
||||||
{
|
|
||||||
WSADATA ws;
|
|
||||||
|
|
||||||
if (WSAStartup(0x101,&ws) == SOCKET_ERROR)
|
|
||||||
{
|
|
||||||
initprintf("update: Winsock error in G_GetVersionFromWebsite() (%d)\n",errno);
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
wsainitialized = 1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((h=gethostbyname(host)) == NULL)
|
|
||||||
{
|
|
||||||
initprintf("update: gethostbyname() error in G_GetVersionFromWebsite() (%d)\n",h_errno);
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
dest_addr.sin_addr.s_addr = ((struct in_addr *)(h->h_addr))->s_addr;
|
|
||||||
dest_addr.sin_family = AF_INET;
|
|
||||||
dest_addr.sin_port = htons(80);
|
|
||||||
|
|
||||||
memset(&(dest_addr.sin_zero), '\0', 8);
|
|
||||||
|
|
||||||
|
|
||||||
mysock = socket(PF_INET, SOCK_STREAM, 0);
|
|
||||||
|
|
||||||
if (mysock == INVALID_SOCKET)
|
|
||||||
{
|
|
||||||
initprintf("update: socket() error in G_GetVersionFromWebsite() (%d)\n",errno);
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
initprintf("Connecting to http://%s\n",host);
|
|
||||||
if (connect(mysock, (struct sockaddr *)&dest_addr, sizeof(struct sockaddr)) == SOCKET_ERROR)
|
|
||||||
{
|
|
||||||
initprintf("update: connect() error in G_GetVersionFromWebsite() (%d)\n",errno);
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
bytes_sent = send(mysock, req, strlen(req), 0);
|
|
||||||
if (bytes_sent == SOCKET_ERROR)
|
|
||||||
{
|
|
||||||
initprintf("update: send() error in G_GetVersionFromWebsite() (%d)\n",errno);
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// initprintf("sent %d bytes\n",bytes_sent);
|
|
||||||
recv(mysock, (char *)&tempbuf, sizeof(tempbuf), 0);
|
|
||||||
closesocket(mysock);
|
|
||||||
|
|
||||||
memcpy(&otherbuf,&tempbuf,sizeof(otherbuf));
|
|
||||||
|
|
||||||
strtok(otherbuf," ");
|
|
||||||
if (atol(strtok(NULL," ")) == 200)
|
|
||||||
{
|
|
||||||
for (i=0;(unsigned)i<strlen(tempbuf);i++) // HACK: all of this needs to die a fiery death; we just skip to the content
|
|
||||||
{
|
|
||||||
// instead of actually parsing any of the http headers
|
|
||||||
if (i > 4)
|
|
||||||
if (tempbuf[i-1] == '\n' && tempbuf[i-2] == '\r' && tempbuf[i-3] == '\n' && tempbuf[i-4] == '\r')
|
|
||||||
{
|
|
||||||
while (j < 9)
|
|
||||||
{
|
|
||||||
ver[j] = tempbuf[i];
|
|
||||||
i++, j++;
|
|
||||||
}
|
|
||||||
ver[j] = '\0';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (j)
|
|
||||||
{
|
|
||||||
strcpy(buffer,ver);
|
|
||||||
return(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int kopen4loadfrommod(char *filename, char searchfirst)
|
int kopen4loadfrommod(char *filename, char searchfirst)
|
||||||
{
|
{
|
||||||
static char fn[BMAX_PATH];
|
static char fn[BMAX_PATH];
|
||||||
|
@ -980,9 +883,9 @@ void getpackets(void)
|
||||||
for (i=connectpoint2[connecthead];i>=0;i=connectpoint2[i])
|
for (i=connectpoint2[connecthead];i>=0;i=connectpoint2[i])
|
||||||
if (i != other) sendpacket(i,packbuf,packbufleng);
|
if (i != other) sendpacket(i,packbuf,packbufleng);
|
||||||
|
|
||||||
if (packbuf[2] != (char)atoi(s_builddate))
|
if (packbuf[2] != (char)atoi(s_buildDate))
|
||||||
{
|
{
|
||||||
initprintf("Player %d has version %d, expecting %d\n",packbuf[2],(char)atoi(s_builddate));
|
initprintf("Player %d has version %d, expecting %d\n",packbuf[2],(char)atoi(s_buildDate));
|
||||||
G_GameExit("You cannot play with different versions of EDuke32!");
|
G_GameExit("You cannot play with different versions of EDuke32!");
|
||||||
}
|
}
|
||||||
if (packbuf[3] != BYTEVERSION)
|
if (packbuf[3] != BYTEVERSION)
|
||||||
|
@ -2974,7 +2877,7 @@ void G_GameExit(const char *t)
|
||||||
if (!(t[0] == ' ' && t[1] == 0))
|
if (!(t[0] == ' ' && t[1] == 0))
|
||||||
{
|
{
|
||||||
char titlebuf[256];
|
char titlebuf[256];
|
||||||
Bsprintf(titlebuf,HEAD2 " %s",s_builddate);
|
Bsprintf(titlebuf,HEAD2 " %s",s_buildDate);
|
||||||
wm_msgbox(titlebuf, (char *)t);
|
wm_msgbox(titlebuf, (char *)t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8871,7 +8774,7 @@ static void G_ShowParameterHelp(void)
|
||||||
"\nSee eduke32 -debughelp for debug parameters"
|
"\nSee eduke32 -debughelp for debug parameters"
|
||||||
;
|
;
|
||||||
#if defined RENDERTYPEWIN
|
#if defined RENDERTYPEWIN
|
||||||
Bsprintf(tempbuf,HEAD2 " %s",s_builddate);
|
Bsprintf(tempbuf,HEAD2 " %s",s_buildDate);
|
||||||
wm_msgbox(tempbuf,s);
|
wm_msgbox(tempbuf,s);
|
||||||
#else
|
#else
|
||||||
initprintf("%s\n",s);
|
initprintf("%s\n",s);
|
||||||
|
@ -8901,7 +8804,7 @@ static void G_ShowDebugHelp(void)
|
||||||
"-z#/-condebug\tEnable line-by-line CON compile debugging at level #\n"
|
"-z#/-condebug\tEnable line-by-line CON compile debugging at level #\n"
|
||||||
;
|
;
|
||||||
#if defined RENDERTYPEWIN
|
#if defined RENDERTYPEWIN
|
||||||
Bsprintf(tempbuf,HEAD2 " %s",s_builddate);
|
Bsprintf(tempbuf,HEAD2 " %s",s_buildDate);
|
||||||
wm_msgbox(tempbuf,s);
|
wm_msgbox(tempbuf,s);
|
||||||
#else
|
#else
|
||||||
initprintf("%s\n",s);
|
initprintf("%s\n",s);
|
||||||
|
@ -10656,7 +10559,7 @@ static void Net_SendVersion(void)
|
||||||
|
|
||||||
buf[0] = PACKET_TYPE_VERSION;
|
buf[0] = PACKET_TYPE_VERSION;
|
||||||
buf[1] = myconnectindex;
|
buf[1] = myconnectindex;
|
||||||
buf[2] = (char)atoi(s_builddate);
|
buf[2] = (char)atoi(s_buildDate);
|
||||||
buf[3] = BYTEVERSION;
|
buf[3] = BYTEVERSION;
|
||||||
buf[4] = g_numSyncBytes;
|
buf[4] = g_numSyncBytes;
|
||||||
|
|
||||||
|
@ -10920,7 +10823,7 @@ void app_main(int argc,const char **argv)
|
||||||
(int(*)(void))GetTime,
|
(int(*)(void))GetTime,
|
||||||
GAME_onshowosd
|
GAME_onshowosd
|
||||||
);
|
);
|
||||||
Bsprintf(tempbuf,HEAD2 " %s",s_builddate);
|
Bsprintf(tempbuf,HEAD2 " %s",s_buildDate);
|
||||||
wm_setapptitle(tempbuf);
|
wm_setapptitle(tempbuf);
|
||||||
|
|
||||||
initprintf("%s\n",apptitle);
|
initprintf("%s\n",apptitle);
|
||||||
|
@ -11058,7 +10961,7 @@ void app_main(int argc,const char **argv)
|
||||||
initprintf("Current version is %d",atoi(tempbuf));
|
initprintf("Current version is %d",atoi(tempbuf));
|
||||||
ud.config.LastUpdateCheck = time(NULL);
|
ud.config.LastUpdateCheck = time(NULL);
|
||||||
|
|
||||||
if (atoi(tempbuf) > atoi(s_builddate))
|
if (atoi(tempbuf) > atoi(s_buildDate))
|
||||||
{
|
{
|
||||||
if (wm_ynbox("EDuke32","A new version of EDuke32 is available. "
|
if (wm_ynbox("EDuke32","A new version of EDuke32 is available. "
|
||||||
"Browse to http://eduke32.sourceforge.net now?"))
|
"Browse to http://eduke32.sourceforge.net now?"))
|
||||||
|
@ -11359,7 +11262,7 @@ void app_main(int argc,const char **argv)
|
||||||
|
|
||||||
initprintf("Initializing OSD...\n");
|
initprintf("Initializing OSD...\n");
|
||||||
|
|
||||||
Bsprintf(tempbuf,HEAD2 " %s",s_builddate);
|
Bsprintf(tempbuf,HEAD2 " %s",s_buildDate);
|
||||||
OSD_SetVersionString(tempbuf, 10,0);
|
OSD_SetVersionString(tempbuf, 10,0);
|
||||||
registerosdcommands();
|
registerosdcommands();
|
||||||
|
|
||||||
|
@ -12318,7 +12221,7 @@ static void Net_DoPrediction(void)
|
||||||
{
|
{
|
||||||
myonground = 0;
|
myonground = 0;
|
||||||
|
|
||||||
myzvel += (SpriteGravity+80);
|
myzvel += (g_spriteGravity+80);
|
||||||
|
|
||||||
if (myzvel >= (4096+2048)) myzvel = (4096+2048);
|
if (myzvel >= (4096+2048)) myzvel = (4096+2048);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5330,7 +5330,7 @@ repeatcase:
|
||||||
g_actorRespawnTime = params[j++];
|
g_actorRespawnTime = params[j++];
|
||||||
g_itemRespawnTime = params[j++];
|
g_itemRespawnTime = params[j++];
|
||||||
g_playerFriction = params[j++];
|
g_playerFriction = params[j++];
|
||||||
if (g_scriptVersion == 14) SpriteGravity = params[j++];
|
if (g_scriptVersion == 14) g_spriteGravity = params[j++];
|
||||||
g_rpgBlastRadius = params[j++];
|
g_rpgBlastRadius = params[j++];
|
||||||
g_pipebombBlastRadius = params[j++];
|
g_pipebombBlastRadius = params[j++];
|
||||||
g_shrinkerBlastRadius = params[j++];
|
g_shrinkerBlastRadius = params[j++];
|
||||||
|
|
|
@ -312,14 +312,14 @@ void A_GetZLimits(int iActor)
|
||||||
void A_Fall(int iActor)
|
void A_Fall(int iActor)
|
||||||
{
|
{
|
||||||
spritetype *s = &sprite[iActor];
|
spritetype *s = &sprite[iActor];
|
||||||
int hz,lz,c = SpriteGravity;
|
int hz,lz,c = g_spriteGravity;
|
||||||
|
|
||||||
if (G_CheckForSpaceFloor(s->sectnum))
|
if (G_CheckForSpaceFloor(s->sectnum))
|
||||||
c = 0;
|
c = 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (G_CheckForSpaceCeiling(s->sectnum) || sector[s->sectnum].lotag == 2)
|
if (G_CheckForSpaceCeiling(s->sectnum) || sector[s->sectnum].lotag == 2)
|
||||||
c = SpriteGravity/6;
|
c = g_spriteGravity/6;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((s->statnum == 1 || s->statnum == 10 || s->statnum == 2 || s->statnum == 6))
|
if ((s->statnum == 1 || s->statnum == 10 || s->statnum == 2 || s->statnum == 6))
|
||||||
|
@ -641,15 +641,12 @@ static inline void X_DoConditional(int condition)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// int *it = 0x00589a04;
|
|
||||||
|
|
||||||
static int X_DoExecute(void)
|
static int X_DoExecute(void)
|
||||||
{
|
{
|
||||||
int j, l, s, tw = *insptr;
|
int j, l, s, tw = *insptr;
|
||||||
|
|
||||||
if (g_killitFlag) return 1;
|
if (g_killitFlag) return 1;
|
||||||
|
|
||||||
// if(*it == 1668249134L) G_GameExit("\nERR");
|
|
||||||
// Bsprintf(g_szBuf,"Parsing: %d",*insptr);
|
// Bsprintf(g_szBuf,"Parsing: %d",*insptr);
|
||||||
// AddLog(g_szBuf);
|
// AddLog(g_szBuf);
|
||||||
|
|
||||||
|
@ -1034,10 +1031,10 @@ static int X_DoExecute(void)
|
||||||
insptr++;
|
insptr++;
|
||||||
g_sp->xoffset = g_sp->yoffset = 0;
|
g_sp->xoffset = g_sp->yoffset = 0;
|
||||||
|
|
||||||
j = SpriteGravity;
|
j = g_spriteGravity;
|
||||||
|
|
||||||
if (G_CheckForSpaceCeiling(g_sp->sectnum) || sector[g_sp->sectnum].lotag == 2)
|
if (G_CheckForSpaceCeiling(g_sp->sectnum) || sector[g_sp->sectnum].lotag == 2)
|
||||||
j = SpriteGravity/6;
|
j = g_spriteGravity/6;
|
||||||
else if (G_CheckForSpaceFloor(g_sp->sectnum))
|
else if (G_CheckForSpaceFloor(g_sp->sectnum))
|
||||||
j = 0;
|
j = 0;
|
||||||
|
|
||||||
|
@ -1591,7 +1588,7 @@ static int X_DoExecute(void)
|
||||||
Bstrcpy(ScriptQuotes[i],g_player[g_p].user_name);
|
Bstrcpy(ScriptQuotes[i],g_player[g_p].user_name);
|
||||||
break;
|
break;
|
||||||
case STR_VERSION:
|
case STR_VERSION:
|
||||||
Bsprintf(tempbuf,HEAD2 " %s",s_builddate);
|
Bsprintf(tempbuf,HEAD2 " %s",s_buildDate);
|
||||||
Bstrcpy(ScriptQuotes[i],tempbuf);
|
Bstrcpy(ScriptQuotes[i],tempbuf);
|
||||||
break;
|
break;
|
||||||
case STR_GAMETYPE:
|
case STR_GAMETYPE:
|
||||||
|
|
|
@ -1321,7 +1321,7 @@ static void Gv_AddSystemVars(void)
|
||||||
Gv_SetupVar("numplayers",(intptr_t)&numplayers, GAMEVAR_SYSTEM | GAMEVAR_INTPTR | GAMEVAR_READONLY);
|
Gv_SetupVar("numplayers",(intptr_t)&numplayers, GAMEVAR_SYSTEM | GAMEVAR_INTPTR | GAMEVAR_READONLY);
|
||||||
Gv_SetupVar("viewingrange",(intptr_t)&viewingrange, GAMEVAR_SYSTEM | GAMEVAR_INTPTR | GAMEVAR_READONLY | GAMEVAR_SYNCCHECK);
|
Gv_SetupVar("viewingrange",(intptr_t)&viewingrange, GAMEVAR_SYSTEM | GAMEVAR_INTPTR | GAMEVAR_READONLY | GAMEVAR_SYNCCHECK);
|
||||||
Gv_SetupVar("yxaspect",(intptr_t)&yxaspect, GAMEVAR_SYSTEM | GAMEVAR_INTPTR | GAMEVAR_READONLY | GAMEVAR_SYNCCHECK);
|
Gv_SetupVar("yxaspect",(intptr_t)&yxaspect, GAMEVAR_SYSTEM | GAMEVAR_INTPTR | GAMEVAR_READONLY | GAMEVAR_SYNCCHECK);
|
||||||
Gv_SetupVar("gravitationalconstant",(intptr_t)&SpriteGravity, GAMEVAR_SYSTEM | GAMEVAR_INTPTR);
|
Gv_SetupVar("gravitationalconstant",(intptr_t)&g_spriteGravity, GAMEVAR_SYSTEM | GAMEVAR_INTPTR);
|
||||||
Gv_SetupVar("gametype_flags",(intptr_t)&GametypeFlags[ud.coop], GAMEVAR_SYSTEM | GAMEVAR_INTPTR);
|
Gv_SetupVar("gametype_flags",(intptr_t)&GametypeFlags[ud.coop], GAMEVAR_SYSTEM | GAMEVAR_INTPTR);
|
||||||
Gv_SetupVar("framerate",(intptr_t)&g_currentFrameRate, GAMEVAR_SYSTEM | GAMEVAR_INTPTR | GAMEVAR_READONLY | GAMEVAR_SYNCCHECK);
|
Gv_SetupVar("framerate",(intptr_t)&g_currentFrameRate, GAMEVAR_SYSTEM | GAMEVAR_INTPTR | GAMEVAR_READONLY | GAMEVAR_SYNCCHECK);
|
||||||
Gv_SetupVar("CLIPMASK0", CLIPMASK0, GAMEVAR_SYSTEM|GAMEVAR_READONLY);
|
Gv_SetupVar("CLIPMASK0", CLIPMASK0, GAMEVAR_SYSTEM|GAMEVAR_READONLY);
|
||||||
|
@ -1473,7 +1473,7 @@ void Gv_RefreshPointers(void)
|
||||||
aGameVars[Gv_GetVarIndex("g_currentMenu")].lValue = (intptr_t)&g_currentMenu;
|
aGameVars[Gv_GetVarIndex("g_currentMenu")].lValue = (intptr_t)&g_currentMenu;
|
||||||
aGameVars[Gv_GetVarIndex("viewingrange")].lValue = (intptr_t)&viewingrange;
|
aGameVars[Gv_GetVarIndex("viewingrange")].lValue = (intptr_t)&viewingrange;
|
||||||
aGameVars[Gv_GetVarIndex("yxaspect")].lValue = (intptr_t)&yxaspect;
|
aGameVars[Gv_GetVarIndex("yxaspect")].lValue = (intptr_t)&yxaspect;
|
||||||
aGameVars[Gv_GetVarIndex("gravitationalconstant")].lValue = (intptr_t)&SpriteGravity;
|
aGameVars[Gv_GetVarIndex("gravitationalconstant")].lValue = (intptr_t)&g_spriteGravity;
|
||||||
aGameVars[Gv_GetVarIndex("GametypeFlags")].lValue = (intptr_t)&GametypeFlags[ud.coop];
|
aGameVars[Gv_GetVarIndex("GametypeFlags")].lValue = (intptr_t)&GametypeFlags[ud.coop];
|
||||||
aGameVars[Gv_GetVarIndex("framerate")].lValue = (intptr_t)&g_currentFrameRate;
|
aGameVars[Gv_GetVarIndex("framerate")].lValue = (intptr_t)&g_currentFrameRate;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
#include "duke3d.h"
|
#include "duke3d.h"
|
||||||
|
|
||||||
char *s_builddate = "20081122";
|
const char *s_buildDate = "20081122";
|
||||||
char *MusicPtr = NULL;
|
char *MusicPtr = NULL;
|
||||||
int g_musicSize;
|
int g_musicSize;
|
||||||
|
|
||||||
|
@ -31,8 +31,8 @@ short g_globalRandom;
|
||||||
short neartagsector, neartagwall, neartagsprite;
|
short neartagsector, neartagwall, neartagsprite;
|
||||||
|
|
||||||
int neartaghitdist,lockclock,g_startArmorAmount;
|
int neartaghitdist,lockclock,g_startArmorAmount;
|
||||||
// JBF: SpriteGravity modified to default to Atomic ed. default when using 1.3d CONs
|
// JBF: g_spriteGravity modified to default to Atomic ed. default when using 1.3d CONs
|
||||||
int SpriteGravity=176;
|
int g_spriteGravity=176;
|
||||||
|
|
||||||
// int temp_data[MAXSPRITES][6];
|
// int temp_data[MAXSPRITES][6];
|
||||||
actordata_t ActorExtra[MAXSPRITES];
|
actordata_t ActorExtra[MAXSPRITES];
|
||||||
|
|
|
@ -4085,7 +4085,7 @@ void P_ProcessInput(int snum)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
p->on_ground = 0;
|
p->on_ground = 0;
|
||||||
p->poszv += (SpriteGravity+80); // (TICSPERFRAME<<6);
|
p->poszv += (g_spriteGravity+80); // (TICSPERFRAME<<6);
|
||||||
if (p->poszv >= (4096+2048)) p->poszv = (4096+2048);
|
if (p->poszv >= (4096+2048)) p->poszv = (4096+2048);
|
||||||
if (p->poszv > 2400 && p->falling_counter < 255)
|
if (p->poszv > 2400 && p->falling_counter < 255)
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,6 +31,9 @@ Windows-specific hooks for JonoF's Duke3D port.
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <shellapi.h>
|
||||||
|
#include <winsock2.h>
|
||||||
|
#include <ws2tcpip.h>
|
||||||
|
|
||||||
#include "winlayer.h"
|
#include "winlayer.h"
|
||||||
|
|
||||||
|
@ -87,3 +90,98 @@ void Error(char *error, ...)
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
int G_GetVersionFromWebsite(char *buffer)
|
||||||
|
{
|
||||||
|
int wsainitialized = 0;
|
||||||
|
int bytes_sent, i=0, j=0;
|
||||||
|
struct sockaddr_in dest_addr;
|
||||||
|
struct hostent *h;
|
||||||
|
char *host = "eduke32.sourceforge.net";
|
||||||
|
char *req = "GET http://eduke32.sourceforge.net/VERSION HTTP/1.0\r\n\r\n";
|
||||||
|
char tempbuf[2048],otherbuf[16],ver[16];
|
||||||
|
SOCKET mysock;
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
if (wsainitialized == 0)
|
||||||
|
{
|
||||||
|
WSADATA ws;
|
||||||
|
|
||||||
|
if (WSAStartup(0x101,&ws) == SOCKET_ERROR)
|
||||||
|
{
|
||||||
|
// initprintf("update: Winsock error in G_GetVersionFromWebsite() (%d)\n",errno);
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
wsainitialized = 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if ((h=gethostbyname(host)) == NULL)
|
||||||
|
{
|
||||||
|
// initprintf("update: gethostbyname() error in G_GetVersionFromWebsite() (%d)\n",h_errno);
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
dest_addr.sin_addr.s_addr = ((struct in_addr *)(h->h_addr))->s_addr;
|
||||||
|
dest_addr.sin_family = AF_INET;
|
||||||
|
dest_addr.sin_port = htons(80);
|
||||||
|
|
||||||
|
memset(&(dest_addr.sin_zero), '\0', 8);
|
||||||
|
|
||||||
|
|
||||||
|
mysock = socket(PF_INET, SOCK_STREAM, 0);
|
||||||
|
|
||||||
|
if (mysock == INVALID_SOCKET)
|
||||||
|
{
|
||||||
|
// initprintf("update: socket() error in G_GetVersionFromWebsite() (%d)\n",errno);
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
initprintf("Connecting to http://%s\n",host);
|
||||||
|
if (connect(mysock, (struct sockaddr *)&dest_addr, sizeof(struct sockaddr)) == SOCKET_ERROR)
|
||||||
|
{
|
||||||
|
// initprintf("update: connect() error in G_GetVersionFromWebsite() (%d)\n",errno);
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
bytes_sent = send(mysock, req, strlen(req), 0);
|
||||||
|
if (bytes_sent == SOCKET_ERROR)
|
||||||
|
{
|
||||||
|
// initprintf("update: send() error in G_GetVersionFromWebsite() (%d)\n",errno);
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// initprintf("sent %d bytes\n",bytes_sent);
|
||||||
|
recv(mysock, (char *)&tempbuf, sizeof(tempbuf), 0);
|
||||||
|
closesocket(mysock);
|
||||||
|
|
||||||
|
memcpy(&otherbuf,&tempbuf,sizeof(otherbuf));
|
||||||
|
|
||||||
|
strtok(otherbuf," ");
|
||||||
|
if (atol(strtok(NULL," ")) == 200)
|
||||||
|
{
|
||||||
|
for (i=0;(unsigned)i<strlen(tempbuf);i++) // HACK: all of this needs to die a fiery death; we just skip to the content
|
||||||
|
{
|
||||||
|
// instead of actually parsing any of the http headers
|
||||||
|
if (i > 4)
|
||||||
|
if (tempbuf[i-1] == '\n' && tempbuf[i-2] == '\r' && tempbuf[i-3] == '\n' && tempbuf[i-4] == '\r')
|
||||||
|
{
|
||||||
|
while (j < 9)
|
||||||
|
{
|
||||||
|
ver[j] = tempbuf[i];
|
||||||
|
i++, j++;
|
||||||
|
}
|
||||||
|
ver[j] = '\0';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (j)
|
||||||
|
{
|
||||||
|
strcpy(buffer,ver);
|
||||||
|
return(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue