git-svn-id: https://svn.eduke32.com/eduke32@1245 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2009-03-14 02:55:39 +00:00
parent f982323443
commit fb8ccf22af
8 changed files with 139 additions and 80 deletions

View file

@ -15,6 +15,8 @@
#include "kplib.h" #include "kplib.h"
#include "md4.h" #include "md4.h"
#include <math.h>
voxmodel_t *voxmodels[MAXVOXELS]; voxmodel_t *voxmodels[MAXVOXELS];
int32_t curextra=MAXTILES; int32_t curextra=MAXTILES;

View file

@ -205,7 +205,7 @@ void mmulti_initmultiplayers(int32_t argc, char **argv)
if (!argc) if (!argc)
{ {
// initprintf("mmulti_unstable: No configuration file specified!\n"); // initprintf("network: No configuration file specified!\n");
numplayers = 1; myconnectindex = 0; numplayers = 1; myconnectindex = 0;
connecthead = 0; connectpoint2[0] = -1; connecthead = 0; connectpoint2[0] = -1;
return; return;
@ -954,13 +954,13 @@ static int32_t open_udp_socket(int32_t ip, int32_t port)
if (natfree) if (natfree)
{ {
//initprintf("Stun is currently %s\n", (natfree) ? "Enabled":"Disabled"); //initprintf("Stun is currently %s\n", (natfree) ? "Enabled":"Disabled");
initprintf("mmulti_unstable: Stun enabled\n"); initprintf("network: Stun enabled\n");
} }
udpsocket = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); udpsocket = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
if ((signed)udpsocket == -1) if ((signed)udpsocket == -1)
{ {
initprintf("mmulti_unstable: socket creation failed: %s\n", netstrerror()); initprintf("network: socket creation failed: %s\n", netstrerror());
return(0); return(0);
} }
@ -981,7 +981,7 @@ static int32_t open_udp_socket(int32_t ip, int32_t port)
addr.sin_port = htons((uint16_t)port); addr.sin_port = htons((uint16_t)port);
if (bind(udpsocket, (struct sockaddr *) &addr, sizeof(addr)) == -1) if (bind(udpsocket, (struct sockaddr *) &addr, sizeof(addr)) == -1)
{ {
initprintf("mmulti_unstable: socket binding failed: %s\n", netstrerror()); initprintf("network: socket binding failed: %s\n", netstrerror());
return(0); return(0);
} }
@ -1049,12 +1049,12 @@ static int32_t wait_for_other_players(gcomtype *gcom, int32_t myip)
if (rc != sizeof(packet)) if (rc != sizeof(packet))
{ {
initprintf("mmulti_unstable: Missized packet or fragment from %s:%i ?!\n", ipstr, port); initprintf("network: Missized packet or fragment from %s:%i ?!\n", ipstr, port);
continue; continue;
} }
else if (packet.header != HEADER_PEER_GREETING) else if (packet.header != HEADER_PEER_GREETING)
{ {
initprintf("mmulti_unstable: Unexpected packet type from %s:%i ?!\n", ipstr, port); initprintf("network: Unexpected packet type from %s:%i ?!\n", ipstr, port);
continue; continue;
} }
@ -1065,7 +1065,7 @@ static int32_t wait_for_other_players(gcomtype *gcom, int32_t myip)
} }
if (i == max) if (i == max)
initprintf("mmulti_unstable: Disallowed player %s:%d ?!\n", ipstr, port); initprintf("network: Disallowed player %s:%d ?!\n", ipstr, port);
else if (heard_from[i] == 0) else if (heard_from[i] == 0)
{ {
packet.id = B_SWAP16(packet.id); packet.id = B_SWAP16(packet.id);
@ -1090,7 +1090,7 @@ static int32_t wait_for_other_players(gcomtype *gcom, int32_t myip)
if (quitevent) if (quitevent)
{ {
initprintf("Connection attempt aborted.\n"); initprintf("network: Connection attempt aborted.\n");
return(0); return(0);
} }
@ -1129,8 +1129,8 @@ static int32_t wait_for_other_players(gcomtype *gcom, int32_t myip)
{ {
if (heard_from[i] == heard_from[i+1]) /* blah. */ if (heard_from[i] == heard_from[i+1]) /* blah. */
{ {
initprintf("mmulti_unstable: ERROR: Two players have the same random ID!\n"); initprintf("network: ERROR: Two players have the same random ID!\n");
initprintf("mmulti_unstable: ERROR: Please restart the game to generate new IDs.\n"); initprintf("network: ERROR: Please restart the game to generate new IDs.\n");
return(0); return(0);
} }
@ -1179,11 +1179,11 @@ static int32_t wait_for_other_players(gcomtype *gcom, int32_t myip)
gcom->myconnectindex = i; gcom->myconnectindex = i;
} }
initprintf("mmulti_unstable: player #%i at %s:%i\n", i,static_ipstring(ip),allowed_addresses[i].port); initprintf("network: player #%i at %s:%i\n", i,static_ipstring(ip),allowed_addresses[i].port);
} }
// assert(gcom->myconnectindex); // assert(gcom->myconnectindex);
initprintf("mmulti_unstable: We are player #%i\n", gcom->myconnectindex); initprintf("network: We are player #%i\n", gcom->myconnectindex);
return(1); return(1);
} }
@ -1215,12 +1215,12 @@ static int32_t connect_to_server(gcomtype *gcom, int32_t myip)
my_id = (uint16_t) rand(); my_id = (uint16_t) rand();
} }
initprintf("mmulti_unstable: Using 0x%X as client ID\n", my_id); initprintf("network: Using 0x%X as client ID\n", my_id);
resendat = getticks(); resendat = getticks();
remaining = max = gcom->numplayers - 1; remaining = max = gcom->numplayers - 1;
initprintf("Waiting for %d player%s...\n", remaining, remaining==1 ? "":"s"); initprintf("network: Waiting for %d player%s...\n", remaining, remaining==1 ? "":"s");
if (remaining == 0) if (remaining == 0)
{ {
initprintf("Hmmm... don't have time to play with myself!\n"); initprintf("Hmmm... don't have time to play with myself!\n");
@ -1240,7 +1240,7 @@ static int32_t connect_to_server(gcomtype *gcom, int32_t myip)
//this is where special formatting of allow lines comes in //this is where special formatting of allow lines comes in
if (!heard_from[i]) if (!heard_from[i])
{ {
initprintf("%s %s:%d...\n",first_send?"Connecting to":"Retrying", initprintf("network: %s %s:%d...\n",first_send?"Connecting to":"Retrying",
static_ipstring(allowed_addresses[i].host),allowed_addresses[i].port); static_ipstring(allowed_addresses[i].host),allowed_addresses[i].port);
send_peer_greeting(allowed_addresses[i].host, send_peer_greeting(allowed_addresses[i].host,
@ -1265,12 +1265,12 @@ static int32_t connect_to_server(gcomtype *gcom, int32_t myip)
if (rc != sizeof(packet)) if (rc != sizeof(packet))
{ {
initprintf("mmulti_unstable: Missized packet or fragment from %s:%i ?!\n", ipstr, port); initprintf("network: Missized packet or fragment from %s:%i ?!\n", ipstr, port);
continue; continue;
} }
else if (packet.header != HEADER_PEER_GREETING) else if (packet.header != HEADER_PEER_GREETING)
{ {
initprintf("mmulti_unstable: Unexpected packet type from %s:%i ?!\n", ipstr, port); initprintf("network: Unexpected packet type from %s:%i ?!\n", ipstr, port);
continue; continue;
} }
@ -1289,9 +1289,9 @@ static int32_t connect_to_server(gcomtype *gcom, int32_t myip)
packet.id = B_SWAP16(packet.id); packet.id = B_SWAP16(packet.id);
heard_from[i] = packet.id; heard_from[i] = packet.id;
initprintf("Connected to %s:%i\n", initprintf("network: Connected to %s:%i\n",
ipstr, (unsigned)port); ipstr, (unsigned)port);
initprintf("Waiting for server to launch game\n"); initprintf("network: Waiting for server to launch game\n");
} }
else else
{ {
@ -1300,7 +1300,7 @@ static int32_t connect_to_server(gcomtype *gcom, int32_t myip)
packet.id = B_SWAP16(packet.id); packet.id = B_SWAP16(packet.id);
heard_from[i] = packet.id; heard_from[i] = packet.id;
initprintf("New player with id 0x%X\n", initprintf("network: New player with id 0x%X\n",
(int32_t) packet.id); (int32_t) packet.id);
gcom->numplayers++; gcom->numplayers++;
max++; max++;
@ -1311,7 +1311,7 @@ static int32_t connect_to_server(gcomtype *gcom, int32_t myip)
if (quitevent) if (quitevent)
{ {
initprintf("Connection attempt aborted.\n"); initprintf("network: Connection attempt aborted.\n");
return(0); return(0);
} }
@ -1328,8 +1328,8 @@ static int32_t connect_to_server(gcomtype *gcom, int32_t myip)
{ {
if (heard_from[i] == heard_from[i+1]) /* blah. */ if (heard_from[i] == heard_from[i+1]) /* blah. */
{ {
initprintf("mmulti_unstable: ERROR: Two players have the same random ID!\n"); initprintf("network: ERROR: Two players have the same random ID!\n");
initprintf("mmulti_unstable: ERROR: Please restart the game to generate new IDs.\n"); initprintf("network: ERROR: Please restart the game to generate new IDs.\n");
return(0); return(0);
} }
@ -1377,11 +1377,11 @@ static int32_t connect_to_server(gcomtype *gcom, int32_t myip)
gcom->myconnectindex = i; gcom->myconnectindex = i;
} }
// initprintf("mmulti_unstable: player #%i with id %d\n",i,heard_from[i]); // initprintf("network: player #%i with id %d\n",i,heard_from[i]);
} }
// assert(gcom->myconnectindex); // assert(gcom->myconnectindex);
// initprintf("mmulti_unstable: We are player #%i\n", gcom->myconnectindex); // initprintf("network: We are player #%i\n", gcom->myconnectindex);
return(1); return(1);
} }
@ -1406,7 +1406,7 @@ static int32_t connect_to_everyone(gcomtype *gcom, int32_t myip, int32_t bcast)
{ {
if (gcom->numplayers > 1) if (gcom->numplayers > 1)
{ {
initprintf("mmulti_unstable: Error: can't do both 'broadcast' and 'allow'.\n"); initprintf("network: Error: can't do both 'broadcast' and 'allow'.\n");
return(0); return(0);
} }
@ -1427,7 +1427,7 @@ static int32_t connect_to_everyone(gcomtype *gcom, int32_t myip, int32_t bcast)
} }
initprintf("mmulti_unstable: Using 0x%X as client ID\n", my_id); initprintf("network: Using 0x%X as client ID\n", my_id);
resendat = getticks(); resendat = getticks();
remaining = max = gcom->numplayers - 1; remaining = max = gcom->numplayers - 1;
@ -1465,7 +1465,7 @@ static int32_t connect_to_everyone(gcomtype *gcom, int32_t myip, int32_t bcast)
if (!heard_from[i]) if (!heard_from[i])
{ {
initprintf("%s %s:%d...\n",first_send?"Connecting to":"Retrying", initprintf("network: %s %s:%d...\n",first_send?"Connecting to":"Retrying",
static_ipstring(allowed_addresses[i].host),allowed_addresses[i].port); static_ipstring(allowed_addresses[i].host),allowed_addresses[i].port);
send_peer_greeting(allowed_addresses[i].host, send_peer_greeting(allowed_addresses[i].host,
@ -1526,7 +1526,7 @@ static int32_t connect_to_everyone(gcomtype *gcom, int32_t myip, int32_t bcast)
{ {
if (allowed_addresses[i].port != port) if (allowed_addresses[i].port != port)
{ {
initprintf("mmulti_unstable: Port number for player %d changed from %d to %d.\n",i,allowed_addresses[i].port,port); initprintf("network: Port number for player %d changed from %d to %d.\n",i,allowed_addresses[i].port,port);
/* initprintf("Different player Port Number detected. %s:%i\n",ipstr, /* initprintf("Different player Port Number detected. %s:%i\n",ipstr,
allowed_addresses[i].port); allowed_addresses[i].port);
initprintf("Changed to %s:%i, player may be behind a firewall.\n", ipstr, port); //addfaz NAT addition */ initprintf("Changed to %s:%i, player may be behind a firewall.\n", ipstr, port); //addfaz NAT addition */
@ -1549,13 +1549,13 @@ static int32_t connect_to_everyone(gcomtype *gcom, int32_t myip, int32_t bcast)
} }
if (i == max) if (i == max)
initprintf("mmulti_unstable: Disallowed player %s:%d ?!\n", ipstr, port); initprintf("network: Disallowed player %s:%d ?!\n", ipstr, port);
else if (rc != sizeof(packet)) else if (rc != sizeof(packet))
initprintf("mmulti_unstable: Missized packet or fragment from %s:%i ?!\n", ipstr, port); initprintf("network: Missized packet or fragment from %s:%i ?!\n", ipstr, port);
else if (packet.header != HEADER_PEER_GREETING) else if (packet.header != HEADER_PEER_GREETING)
initprintf("mmulti_unstable: Unexpected packet type from %s:%i ?!\n", ipstr, port); initprintf("network: Unexpected packet type from %s:%i ?!\n", ipstr, port);
else if (heard_from[i] == 0) else if (heard_from[i] == 0)
{ {
@ -1565,7 +1565,7 @@ static int32_t connect_to_everyone(gcomtype *gcom, int32_t myip, int32_t bcast)
allowed_addresses[i].port = port; allowed_addresses[i].port = port;
remaining--; remaining--;
initprintf("Connected to %s:%i (id 0x%X). %d player%s left.\n", initprintf("network: Connected to %s:%i (id 0x%X). %d player%s left.\n",
ipstr, port ,(int32_t) packet.id, ipstr, port ,(int32_t) packet.id,
remaining, remaining == 1 ? "" : "s"); remaining, remaining == 1 ? "" : "s");
@ -1589,7 +1589,7 @@ static int32_t connect_to_everyone(gcomtype *gcom, int32_t myip, int32_t bcast)
if (quitevent) if (quitevent)
{ {
initprintf("Connection attempt aborted.\n"); initprintf("network: Connection attempt aborted.\n");
return(0); return(0);
} }
@ -1606,8 +1606,8 @@ static int32_t connect_to_everyone(gcomtype *gcom, int32_t myip, int32_t bcast)
{ {
if (heard_from[i] == heard_from[i+1]) /* blah. */ if (heard_from[i] == heard_from[i+1]) /* blah. */
{ {
initprintf("mmulti_unstable: ERROR: Two players have the same random ID!\n"); initprintf("network: ERROR: Two players have the same random ID!\n");
initprintf("mmulti_unstable: ERROR: Please restart the game to generate new IDs.\n"); initprintf("network: ERROR: Please restart the game to generate new IDs.\n");
return(0); return(0);
} }
@ -1656,11 +1656,11 @@ static int32_t connect_to_everyone(gcomtype *gcom, int32_t myip, int32_t bcast)
gcom->myconnectindex = i; gcom->myconnectindex = i;
} }
initprintf("mmulti_unstable: player #%i at %s:%i\n", i,static_ipstring(ip),allowed_addresses[i].port); initprintf("network: player #%i at %s:%i\n", i,static_ipstring(ip),allowed_addresses[i].port);
} }
// assert(gcom->myconnectindex); // assert(gcom->myconnectindex);
initprintf("mmulti_unstable: We are player #%i\n", gcom->myconnectindex); initprintf("network: We are player #%i\n", gcom->myconnectindex);
/* /*
* Ok, we should have specific IPs and ports for all players, and * Ok, we should have specific IPs and ports for all players, and
@ -1811,7 +1811,7 @@ static int32_t parse_udp_config(int32_t argc, char **argv, gcomtype *gcom)
j = strtol(argv[i]+2, &p, 10); j = strtol(argv[i]+2, &p, 10);
if (!(*p) && j > 1024 && j<65535) udpport = j; if (!(*p) && j > 1024 && j<65535) udpport = j;
initprintf("mmulti_unstable: Using port %d\n", udpport); initprintf("network: Using port %d\n", udpport);
} }
} }
@ -1831,9 +1831,9 @@ static int32_t parse_udp_config(int32_t argc, char **argv, gcomtype *gcom)
udpmode = udpmode_server; udpmode = udpmode_server;
gcom->numplayers = (argv[i][4]-'0'); gcom->numplayers = (argv[i][4]-'0');
if ((argv[i][5] >= '0') && (argv[i][5] <= '9')) gcom->numplayers = gcom->numplayers*10+(argv[i][5]-'0'); if ((argv[i][5] >= '0') && (argv[i][5] <= '9')) gcom->numplayers = gcom->numplayers*10+(argv[i][5]-'0');
initprintf("mmulti_unstable: %d-player game server\n", gcom->numplayers--); initprintf("network: %d-player game server\n", gcom->numplayers--);
} }
initprintf("mmulti_unstable: Master-slave mode\n"); initprintf("network: Master-slave mode\n");
} }
else if (argv[i][2] == '1') else if (argv[i][2] == '1')
{ {
@ -1841,7 +1841,7 @@ static int32_t parse_udp_config(int32_t argc, char **argv, gcomtype *gcom)
udpmode = udpmode_peer; udpmode = udpmode_peer;
myconnectindex = daindex; myconnectindex = daindex;
// daindex++; // daindex++;
initprintf("mmulti_unstable: Peer-to-peer mode\n"); initprintf("network: Peer-to-peer mode\n");
} }
continue; continue;
} }
@ -1854,7 +1854,7 @@ static int32_t parse_udp_config(int32_t argc, char **argv, gcomtype *gcom)
{ {
// if ((danetmode == 1) && (daindex == myconnectindex)) daindex++; // if ((danetmode == 1) && (daindex == myconnectindex)) daindex++;
parse_interface(st, &allowed_addresses[daindex].host, &allowed_addresses[daindex].port); parse_interface(st, &allowed_addresses[daindex].host, &allowed_addresses[daindex].port);
initprintf("mmulti_unstable: Player %d at %s:%d\n",daindex,st,allowed_addresses[daindex].port); initprintf("network: Player %d at %s:%d\n",daindex,st,allowed_addresses[daindex].port);
daindex++; daindex++;
} }
else else
@ -1870,11 +1870,11 @@ static int32_t parse_udp_config(int32_t argc, char **argv, gcomtype *gcom)
// if ((danetmode == 1) && (daindex == myconnectindex)) daindex++; // if ((danetmode == 1) && (daindex == myconnectindex)) daindex++;
allowed_addresses[daindex].host = ntohl(*(int32_t *)lph->h_addr); allowed_addresses[daindex].host = ntohl(*(int32_t *)lph->h_addr);
allowed_addresses[daindex].port = pt; allowed_addresses[daindex].port = pt;
initprintf("mmulti_unstable: Player %d at %s:%d (%s)\n",daindex, initprintf("network: Player %d at %s:%d (%s)\n",daindex,
inet_ntoa(*(struct in_addr *)lph->h_addr),pt,argv[i]); inet_ntoa(*(struct in_addr *)lph->h_addr),pt,argv[i]);
daindex++; daindex++;
} }
else initprintf("mmulti_unstable: Failed resolving %s\n",argv[i]); else initprintf("network: Failed resolving %s\n",argv[i]);
} }
free(st); free(st);
} }
@ -1884,7 +1884,7 @@ static int32_t parse_udp_config(int32_t argc, char **argv, gcomtype *gcom)
} }
else else
{ {
initprintf("mmulti_unstable: Using '%s' as configuration file\n", argv[0]); initprintf("network: Using '%s' as configuration file\n", argv[0]);
ptr = buf; ptr = buf;
while ((tok = get_token(&ptr)) != NULL) while ((tok = get_token(&ptr)) != NULL)
@ -1898,7 +1898,7 @@ static int32_t parse_udp_config(int32_t argc, char **argv, gcomtype *gcom)
{ {
bogus = 0; bogus = 0;
} }
initprintf("mmulti_unstable: Using interface %s:%d\n", initprintf("network: Using interface %s:%d\n",
static_ipstring(ip), (int32_t) udpport); static_ipstring(ip), (int32_t) udpport);
} }
@ -2051,7 +2051,7 @@ void deinit_network_transport(gcomtype *gcom)
deinitialize_sockets(); deinitialize_sockets();
initprintf("UDP net deinitialized successfully.\n"); initprintf("UDP networking uninitialized successfully.\n");
} }

View file

@ -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 " 20090227" #define BUILDDATE " 20090313"
#define VERSION " 1.2.0devel" #define VERSION " 1.2.0devel"
static int32_t floor_over_floor; static int32_t floor_over_floor;

View file

@ -260,6 +260,8 @@ void CONFIG_SetDefaults(void)
ud.weaponscale = 100; ud.weaponscale = 100;
ud.textscale = 100; ud.textscale = 100;
ud.config.CheckForUpdates = 1;
Bstrcpy(ud.rtsname, "DUKE.RTS"); Bstrcpy(ud.rtsname, "DUKE.RTS");
Bstrcpy(szPlayerName, "Duke"); Bstrcpy(szPlayerName, "Duke");
@ -901,6 +903,7 @@ int32 CONFIG_ReadSetup(void)
{ {
SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "VoiceToggle",&ud.config.VoiceToggle); SCRIPT_GetNumber(ud.config.scripthandle, "Sound Setup", "VoiceToggle",&ud.config.VoiceToggle);
// hack to switch old VoiceToggle value over to new bitfield format
if (ud.config.VoiceToggle == 2) ud.config.VoiceToggle = 5; if (ud.config.VoiceToggle == 2) ud.config.VoiceToggle = 5;
} }
@ -958,7 +961,7 @@ int32 CONFIG_ReadSetup(void)
=================== ===================
*/ */
void CONFIG_WriteBinds(void) // save binds and aliases to disk void CONFIG_WriteBinds(void) // save binds and aliases to <cfgname>_binds.cfg
{ {
int32_t i; int32_t i;
FILE *fp; FILE *fp;

View file

@ -4534,6 +4534,10 @@ void G_DrawRooms(int32_t snum,int32_t smoothratio)
polymer_setanimatesprites(G_DoSpriteAnimations, ud.camerax,ud.cameray,ud.cameraang,smoothratio); polymer_setanimatesprites(G_DoSpriteAnimations, ud.camerax,ud.cameray,ud.cameraang,smoothratio);
#endif #endif
drawrooms(ud.camerax,ud.cameray,ud.cameraz,ud.cameraang,ud.camerahoriz,ud.camerasect); drawrooms(ud.camerax,ud.cameray,ud.cameraz,ud.cameraang,ud.camerahoriz,ud.camerasect);
#ifdef POLYMER
if (getrendermode() == 4)
polymer_resetlights();
#endif
G_DoSpriteAnimations(ud.camerax,ud.cameray,ud.cameraang,smoothratio); G_DoSpriteAnimations(ud.camerax,ud.cameray,ud.cameraang,smoothratio);
drawmasks(); drawmasks();
@ -6642,6 +6646,9 @@ void G_DoSpriteAnimations(int32_t x,int32_t y,int32_t a,int32_t smoothratio)
intptr_t l, t1,t3,t4; intptr_t l, t1,t3,t4;
spritetype *s,*t; spritetype *s,*t;
int32_t switchpic; int32_t switchpic;
#ifdef POLYMER
_prlight light;
#endif
if (!spritesortcnt) return; if (!spritesortcnt) return;
@ -7363,6 +7370,39 @@ PALONLY:
case SHRINKEREXPLOSION__STATIC: case SHRINKEREXPLOSION__STATIC:
case RPG__STATIC: case RPG__STATIC:
case FLOORFLAME__STATIC: case FLOORFLAME__STATIC:
#ifdef POLYMER
light.sector = t->sectnum;
light.x = t->x;
light.y = t->y;
light.z = t->z;
light.range = tilesizx[t->picnum]*tilesizy[t->picnum];
light.faderange = 0;
light.color[0] = 255;
light.color[1] = 80;
light.color[2] = 0;
if ((DynamicTileMap[s->picnum] == ATOMICHEALTH__STATIC) ||
(DynamicTileMap[s->picnum] == FREEZEBLAST__STATIC))
{
light.color[0] = 0;
light.color[1] = 0;
light.color[2] = 255;
}
if ((DynamicTileMap[s->picnum] == SHRINKSPARK__STATIC) ||
(DynamicTileMap[s->picnum] == SHRINKEREXPLOSION__STATIC))
{
light.color[0] = 0;
light.color[1] = 255;
light.color[2] = 0;
}
if (getrendermode() >= 4)
polymer_addlight(light);
#endif
if (t->picnum == EXPLOSION2) if (t->picnum == EXPLOSION2)
{ {
g_player[screenpeek].ps->visibility = -127; g_player[screenpeek].ps->visibility = -127;
@ -9339,10 +9379,16 @@ static int32_t loaddefinitions_game(const char *fn, int32_t preload)
static void G_AddGroup(const char *buffer) static void G_AddGroup(const char *buffer)
{ {
struct strllist *s; struct strllist *s;
char buf[BMAX_PATH];
s = (struct strllist *)Bcalloc(1,sizeof(struct strllist)); s = (struct strllist *)Bcalloc(1,sizeof(struct strllist));
s->str = Bstrdup(buffer);
if (Bstrchr(s->str,'.') == 0) Bstrcpy(buf, buffer);
Bstrcat(s->str,".grp");
if (Bstrchr(buf,'.') == 0)
Bstrcat(buf,".grp");
s->str = Bstrdup(buf);
if (CommandGrps) if (CommandGrps)
{ {
@ -10872,14 +10918,7 @@ void app_main(int32_t argc,const char **argv)
} }
} }
#if defined(POLYMOST) && defined(USE_OPENGL) // used with binds for fast function lookup
glusetexcache = glusetexcachecompression = -1;
#endif
#ifdef _WIN32
ud.config.CheckForUpdates = -1;
#endif
hash_init(&gamefuncH); hash_init(&gamefuncH);
for (i=NUMGAMEFUNCTIONS-1; i>=0; i--) for (i=NUMGAMEFUNCTIONS-1; i>=0; i--)
{ {
@ -10889,21 +10928,21 @@ void app_main(int32_t argc,const char **argv)
Bfree(str); Bfree(str);
} }
#if defined(POLYMOST) && defined(USE_OPENGL)
glusetexcache = glusetexcachecompression = -1;
#endif
/*
#ifdef _WIN32
ud.config.CheckForUpdates = -1;
#endif
*/
i = CONFIG_ReadSetup(); i = CONFIG_ReadSetup();
if (getenv("DUKE3DGRP")) duke3dgrp = getenv("DUKE3DGRP"); if (getenv("DUKE3DGRP")) duke3dgrp = getenv("DUKE3DGRP");
#if defined(POLYMOST) && defined(USE_OPENGL)
if (glusetexcache == -1 || glusetexcachecompression == -1)
{
i=wm_ynbox("Texture Cache",
"Would you like to enable the on-disk texture cache?\n\n"
"You generally want to say 'yes' here, especially if using the HRP.");
if (i) ud.config.useprecache = glusetexcompr = glusetexcache = glusetexcachecompression = 1;
else glusetexcache = glusetexcachecompression = 0;
}
#endif
#ifdef _WIN32 #ifdef _WIN32
/*
if (ud.config.CheckForUpdates == -1) if (ud.config.CheckForUpdates == -1)
{ {
i=wm_ynbox("Automatic Update Notifications", i=wm_ynbox("Automatic Update Notifications",
@ -10911,6 +10950,7 @@ void app_main(int32_t argc,const char **argv)
ud.config.CheckForUpdates = 0; ud.config.CheckForUpdates = 0;
if (i) ud.config.CheckForUpdates = 1; if (i) ud.config.CheckForUpdates = 1;
} }
*/
// initprintf("build %d\n",(uint8_t)atoi(BUILDDATE)); // initprintf("build %d\n",(uint8_t)atoi(BUILDDATE));
@ -10950,6 +10990,18 @@ void app_main(int32_t argc,const char **argv)
} }
} }
#endif #endif
#if defined(POLYMOST) && defined(USE_OPENGL)
if (glusetexcache == -1 || glusetexcachecompression == -1)
{
i=wm_ynbox("Texture Cache",
"Would you like to enable the on-disk texture cache?\n\n"
"You generally want to say 'yes' here, especially if using the HRP.");
if (i) ud.config.useprecache = glusetexcompr = glusetexcache = glusetexcachecompression = 1;
else glusetexcache = glusetexcachecompression = 0;
}
#endif
if (preinitengine()) if (preinitengine())
{ {
wm_msgbox("Build Engine Initialization Error", wm_msgbox("Build Engine Initialization Error",
@ -10963,7 +11015,7 @@ void app_main(int32_t argc,const char **argv)
{ {
// try and identify the 'defaultduke3dgrp' in the set of GRPs. // try and identify the 'defaultduke3dgrp' in the set of GRPs.
// if it is found, set up the environment accordingly for the game it represents. // if it is found, set up the environment accordingly for the game it represents.
// if it is not found, choose the first GRP from the list of // if it is not found, choose the first GRP from the list
struct grpfile *fg, *first = NULL; struct grpfile *fg, *first = NULL;
int32_t i; int32_t i;
for (fg = foundgrps; fg; fg=fg->next) for (fg = foundgrps; fg; fg=fg->next)
@ -11116,7 +11168,7 @@ CLEAN_DIRECTORY:
i = initgroupfile(duke3dgrp); i = initgroupfile(duke3dgrp);
if (i == -1) if (i == -1)
initprintf("Warning: could not find group file '%s'!\n",duke3dgrp); initprintf("Warning: could not find main group file '%s'!\n",duke3dgrp);
else else
initprintf("Using group file '%s' as main group file.\n", duke3dgrp); initprintf("Using group file '%s' as main group file.\n", duke3dgrp);
@ -11177,8 +11229,8 @@ CLEAN_DIRECTORY:
G_DoAutoload(CommandGrps->str); G_DoAutoload(CommandGrps->str);
} }
free(CommandGrps->str); Bfree(CommandGrps->str);
free(CommandGrps); Bfree(CommandGrps);
CommandGrps = s; CommandGrps = s;
} }
pathsearchmode = 0; pathsearchmode = 0;

View file

@ -5133,7 +5133,9 @@ repeatcase:
Bstrcpy(temp,tempbuf); Bstrcpy(temp,tempbuf);
CONFIG_WriteSetup(); CONFIG_WriteSetup();
if (mod_dir[0] != '/')
Bsprintf(setupfilename,"%s/",mod_dir); Bsprintf(setupfilename,"%s/",mod_dir);
else setupfilename[0] = 0;
Bstrcat(setupfilename,temp); Bstrcat(setupfilename,temp);
initprintf("Using config file '%s'.\n",setupfilename); initprintf("Using config file '%s'.\n",setupfilename);

View file

@ -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 = "20090227"; const char *s_buildDate = "20090313";
char *MusicPtr = NULL; char *MusicPtr = NULL;
int32_t g_musicSize; int32_t g_musicSize;

View file

@ -64,7 +64,7 @@ int32_t G_GetVersionFromWebsite(char *buffer)
struct sockaddr_in dest_addr; struct sockaddr_in dest_addr;
struct hostent *h; struct hostent *h;
char *host = "eduke32.sourceforge.net"; char *host = "eduke32.sourceforge.net";
char *req = "GET http://eduke32.sourceforge.net/VERSION HTTP/1.0\r\n\r\n"; char *req = "GET http://eduke32.sourceforge.net/VERSION HTTP/1.0\r\n\r\n\r\n";
char tempbuf[2048],otherbuf[16],ver[16]; char tempbuf[2048],otherbuf[16],ver[16];
SOCKET mysock; SOCKET mysock;