Faster movement in Mapster32.

git-svn-id: https://svn.eduke32.com/eduke32@418 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-12-14 08:50:18 +00:00
parent a68248896c
commit cd4e66b71a
4 changed files with 62 additions and 58 deletions

View file

@ -647,7 +647,7 @@ void editinput(void)
if (goalz != posz) if (goalz != posz)
{ {
if (posz < goalz) hvel += 32; if (posz < goalz) hvel += 64;
if (posz > goalz) hvel = ((goalz-posz)>>3); if (posz > goalz) hvel = ((goalz-posz)>>3);
posz += hvel; posz += hvel;
@ -7251,20 +7251,20 @@ void keytimerstuff(void)
} }
else else
{ {
if (keystatus[buildkeys[2]] > 0) svel = min(svel+8,127); if (keystatus[buildkeys[2]] > 0) svel = min(svel+16,255); // svel and vel aren't even chars...
if (keystatus[buildkeys[3]] > 0) svel = max(svel-8,-128); if (keystatus[buildkeys[3]] > 0) svel = max(svel-16,-256);
} }
if (keystatus[buildkeys[0]] > 0) vel = min(vel+8,127); if (keystatus[buildkeys[0]] > 0) vel = min(vel+16,255);
if (keystatus[buildkeys[1]] > 0) vel = max(vel-8,-128); if (keystatus[buildkeys[1]] > 0) vel = max(vel-16,-256);
/* if (keystatus[buildkeys[12]] > 0) svel = min(svel+8,127); /* if (keystatus[buildkeys[12]] > 0) svel = min(svel+8,127);
if (keystatus[buildkeys[13]] > 0) svel = max(svel-8,-128); */ if (keystatus[buildkeys[13]] > 0) svel = max(svel-8,-128); */
if (angvel < 0) angvel = min(angvel+12,0); if (angvel < 0) angvel = min(angvel+12,0);
if (angvel > 0) angvel = max(angvel-12,0); if (angvel > 0) angvel = max(angvel-12,0);
if (svel < 0) svel = min(svel+2,0); if (svel < 0) svel = min(svel+6,0);
if (svel > 0) svel = max(svel-2,0); if (svel > 0) svel = max(svel-6,0);
if (vel < 0) vel = min(vel+2,0); if (vel < 0) vel = min(vel+6,0);
if (vel > 0) vel = max(vel-2,0); if (vel > 0) vel = max(vel-6,0);
/* if(mlook) /* if(mlook)
posz -= (horiz-101)*(vel/40); */ posz -= (horiz-101)*(vel/40); */
} }

View file

@ -4464,7 +4464,7 @@ int ExtInit(void)
{ {
int i; int i;
#if 1 #if 1
i=wm_ynbox("Texture caching", i=wm_ynbox("Texture Caching",
"Would you like to enable the on-disk texture cache? " "Would you like to enable the on-disk texture cache? "
"This feature may use up to 200 megabytes of disk " "This feature may use up to 200 megabytes of disk "
"space if you have a great deal of high resolution " "space if you have a great deal of high resolution "
@ -4760,11 +4760,9 @@ void ExtCheckKeys(void)
Keys3d(); Keys3d();
m32_showmouse(); m32_showmouse();
if (sidemode != 1) editinput(); if (sidemode != 1) editinput();
return;
} }
else
{
Keys2d(); Keys2d();
}
} }
void faketimerhandler(void) void faketimerhandler(void)
@ -4777,11 +4775,7 @@ void faketimerhandler(void)
if (counter>=5) counter=0; if (counter>=5) counter=0;
sampletimer(); sampletimer();
if (totalclock < ototalclock+TICSPERFRAME) if (totalclock < ototalclock+TICSPERFRAME || qsetmode != 200 || sidemode != 1)
return;
if (qsetmode != 200)
return;
if (sidemode != 1)
return; return;
ototalclock = totalclock; ototalclock = totalclock;

View file

@ -45,13 +45,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "util_lib.h" #include "util_lib.h"
#ifdef _WIN32
#include <shellapi.h>
extern int getversionfromwebsite(char *buffer);
#define BUILDDATE 20061214
#define UPDATEINTERVAL 86400 // 24h
#endif
#define IDFSIZE 479985668 #define IDFSIZE 479985668
#define IDFILENAME "DUKE3D.IDF" #define IDFILENAME "DUKE3D.IDF"
#define TIMERUPDATESIZ 32 #define TIMERUPDATESIZ 32
#define BUILDDATE 20061212
long cameradist = 0, cameraclock = 0; long cameradist = 0, cameraclock = 0;
char playerswhenstarted; char playerswhenstarted;
char qe,cp,usecwd = 0; char qe,cp,usecwd = 0;
@ -1411,7 +1416,7 @@ void check_fta_sounds(short i)
} }
} }
inline short inventory(spritetype *s) short inventory(spritetype *s)
{ {
switch (dynamictostatic[s->picnum]) switch (dynamictostatic[s->picnum])
{ {
@ -1427,23 +1432,23 @@ inline short inventory(spritetype *s)
return 0; return 0;
} }
inline int checkspriteflags(short sActor, int iType) int checkspriteflags(short sActor, int iType)
{ {
int i; int i;
i = spriteflags[sprite[sActor].picnum]; i = spriteflags[sprite[sActor].picnum];
i ^= actorspriteflags[sActor]; i ^= actorspriteflags[sActor];
if (i & iType) return 1; if (i & iType) return 1;
else return 0; return 0;
} }
inline int checkspriteflagsp(short sPicnum, int iType) inline int checkspriteflagsp(short sPicnum, int iType)
{ {
if (spriteflags[sPicnum] & iType) return 1; if (spriteflags[sPicnum] & iType) return 1;
else return 0; return 0;
} }
inline short badguypic(short pn) short badguypic(short pn)
{ {
//this case can't be handled by the dynamictostatic system because it adds //this case can't be handled by the dynamictostatic system because it adds
//stuff to the value from names.h so handling separately //stuff to the value from names.h so handling separately
@ -9476,7 +9481,7 @@ void sendplayerupdate(void)
void sendboardname(void) void sendboardname(void)
{ {
if (ud.multimode > 1) if (numplayers > 1)
{ {
int j; int j;
int ch; int ch;
@ -9502,22 +9507,22 @@ void mpchangemap(char volume, char level)
{ {
int i; int i;
tempbuf[0] = 5; packbuf[0] = 5;
tempbuf[1] = ud.m_level_number = level; packbuf[1] = ud.m_level_number = level;
tempbuf[2] = ud.m_volume_number = volume; packbuf[2] = ud.m_volume_number = volume;
tempbuf[3] = ud.m_player_skill+1; packbuf[3] = ud.m_player_skill+1;
tempbuf[4] = ud.m_monsters_off; packbuf[4] = ud.m_monsters_off;
tempbuf[5] = ud.m_respawn_monsters; packbuf[5] = ud.m_respawn_monsters;
tempbuf[6] = ud.m_respawn_items; packbuf[6] = ud.m_respawn_items;
tempbuf[7] = ud.m_respawn_inventory; packbuf[7] = ud.m_respawn_inventory;
tempbuf[8] = ud.m_coop; packbuf[8] = ud.m_coop;
tempbuf[9] = ud.m_marker; packbuf[9] = ud.m_marker;
tempbuf[10] = ud.m_ffire; packbuf[10] = ud.m_ffire;
tempbuf[11] = ud.m_noexits; packbuf[11] = ud.m_noexits;
for (i=connecthead;i>=0;i=connectpoint2[i]) for (i=connecthead;i>=0;i=connectpoint2[i])
{ {
if (i != myconnectindex) sendpacket(i,tempbuf,12); if (i != myconnectindex) sendpacket(i,packbuf,12);
if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master
} }
} }
@ -9552,7 +9557,7 @@ void updateplayer(void)
for (l=0;(unsigned)l<sizeof(myname)-1;l++) for (l=0;(unsigned)l<sizeof(myname)-1;l++)
ud.user_name[myconnectindex][l] = Btoupper(myname[l]); ud.user_name[myconnectindex][l] = Btoupper(myname[l]);
if (ud.multimode > 1) if (numplayers > 1)
{ {
sendplayerupdate(); sendplayerupdate();
if (sprite[ps[myconnectindex].i].picnum == APLAYER && sprite[ps[myconnectindex].i].pal != 1) if (sprite[ps[myconnectindex].i].picnum == APLAYER && sprite[ps[myconnectindex].i].pal != 1)
@ -9738,7 +9743,7 @@ void app_main(int argc,char **argv)
#if defined(POLYMOST) && defined(USE_OPENGL) #if defined(POLYMOST) && defined(USE_OPENGL)
if (glusetexcache == -1 || glusetexcachecompression == -1) if (glusetexcache == -1 || glusetexcachecompression == -1)
{ {
i=wm_ynbox("Texture caching", i=wm_ynbox("Texture Caching",
"Would you like to enable the on-disk texture cache? " "Would you like to enable the on-disk texture cache? "
"This feature may use up to 200 megabytes of disk " "This feature may use up to 200 megabytes of disk "
"space if you have a great deal of high resolution " "space if you have a great deal of high resolution "
@ -9752,36 +9757,28 @@ void app_main(int argc,char **argv)
#ifdef _WIN32 #ifdef _WIN32
if (checkforupdates == -1) if (checkforupdates == -1)
{ {
i=wm_ynbox("Automatic update notification", i=wm_ynbox("Automatic Release Notification",
"Would you like EDuke32 to automatically check for updates? " "Would you like EDuke32 to automatically check for new releases "
"This feature will contact the EDuke32 site at game startup " "at startup?");
"once every 24 hours in order to determine if a new " checkforupdates = 0;
"version is available. If so, you will be prompted to "
"download it.");
if (i) checkforupdates = 1; if (i) checkforupdates = 1;
else checkforupdates = 0;
} }
if (checkforupdates == 1) if (checkforupdates == 1)
{ {
i = time(NULL); if (time(NULL) - lastupdatecheck > UPDATEINTERVAL)
if (i > lastupdatecheck+86400)
{ {
#include <shellapi.h>
extern int getversionfromwebsite(char *buffer);
if (getversionfromwebsite(tempbuf)) if (getversionfromwebsite(tempbuf))
{ {
lastupdatecheck = i; lastupdatecheck = time(NULL);
if (atol(tempbuf) > BUILDDATE) if (atol(tempbuf) > BUILDDATE)
{ {
if (wm_ynbox("EDuke32","A new version of EDuke32 is available. " if (wm_ynbox("EDuke32","A new version of EDuke32 is available. "
"Would you like to download it now?")) "Browse to http://www.eduke32.com now?"))
{ {
SHELLEXECUTEINFOA sinfo; SHELLEXECUTEINFOA sinfo;
char *p = "http://www.eduke32.com/"; char *p = "http://www.eduke32.com";
Bmemset(&sinfo, 0, sizeof(sinfo)); Bmemset(&sinfo, 0, sizeof(sinfo));
sinfo.cbSize = sizeof(sinfo); sinfo.cbSize = sizeof(sinfo);

View file

@ -2546,8 +2546,12 @@ cheat_for_port_credits:
"Display other player IDs", "Display other player IDs",
"-", "-",
"Show startup window", "Show startup window",
#ifdef _WIN32
"Release notification",
#else
"-", "-",
"-", "-",
#endif
"-", "-",
"-", "-",
"-", "-",
@ -2643,7 +2647,16 @@ cheat_for_port_credits:
modval(0,1,(int *)&ForceSetup,1,probey==io); modval(0,1,(int *)&ForceSetup,1,probey==io);
gametextpal(d,yy, ForceSetup ? "On" : "Off", MENUHIGHLIGHT(io), 0); gametextpal(d,yy, ForceSetup ? "On" : "Off", MENUHIGHLIGHT(io), 0);
break; break;
#ifdef _WIN32
case 7: case 7:
if (x==io) checkforupdates = 1-checkforupdates;
modval(0,1,(int *)&checkforupdates,1,probey==io);
gametextpal(d,yy, checkforupdates ? "On" : "Off", MENUHIGHLIGHT(io), 0);
break;
case 8:
#else
case 7:
#endif
if (x==io) cmenu(200); if (x==io) cmenu(200);
break; break;
default: default: