CON fix from JFDuke that I missed somewhere along the line + SDL mousewheel fix from Mephisto

git-svn-id: https://svn.eduke32.com/eduke32@258 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-08-07 06:18:57 +00:00
parent ab6da3c5a4
commit 660815a3fd
5 changed files with 38 additions and 25 deletions

View file

@ -7446,7 +7446,7 @@ void loadtile(short tilenume)
kread(artfil,ptr,dasiz);
faketimerhandler();
artfilplc = tilefileoffs[tilenume]+dasiz;
} else Bmemset((char *)waloff[tilenume],1,dasiz);
} else Bmemset((char *)waloff[tilenume],0,dasiz);
}

View file

@ -39,6 +39,10 @@ int startwin_settitle(const char *s) { s=s; return 0; }
// undefine to restrict windowed resolutions to conventional sizes
#define ANY_WINDOWED_SIZE
// fix for mousewheel
#define MWHEELTICKS 10
static unsigned long mwheelup, mwheeldown;
int _buildargc = 1;
char **_buildargv = NULL;
extern long app_main(long argc, char *argv[]);
@ -1299,14 +1303,22 @@ int handleevents(void)
case SDL_BUTTON_LEFT: j = 0; break;
case SDL_BUTTON_RIGHT: j = 1; break;
case SDL_BUTTON_MIDDLE: j = 2; break;
default: j = -1; break;
default: j = ev.button.button; break;
}
if (j<0) break;
if (ev.button.state == SDL_PRESSED)
if (ev.button.state == SDL_PRESSED) {
if (ev.button.button == SDL_BUTTON_WHEELUP) {
mwheelup = totalclock;
}
if (ev.button.button == SDL_BUTTON_WHEELDOWN) {
mwheeldown = totalclock;
}
mouseb |= (1<<j);
else
mouseb &= ~(1<<j);
}
else {
if (j < 4) mouseb &= ~(1<<j);
}
if (mousepresscallback)
mousepresscallback(j+1, ev.button.state == SDL_PRESSED);
@ -1371,6 +1383,17 @@ int handleevents(void)
sampletimer();
if (moustat) {
if ((mwheelup) && (mwheelup <= (totalclock - MWHEELTICKS))) {
mouseb &= ~16;
mwheelup = 0;
}
if ((mwheeldown) && (mwheeldown <= (totalclock - MWHEELTICKS))) {
mouseb &= ~32;
mwheeldown = 0;
}
}
startwin_idle(NULL);
#undef SetKey

View file

@ -7667,10 +7667,16 @@ static tokenlist rancidtokens[] =
extern const char *getexternaladdress(void);
static int parse_rancid_net(scriptfile *script)
int load_rancid_net(char *fn)
{
int tokn;
char *cmdtokptr;
scriptfile *script;
script = scriptfile_fromfile(fn);
if (!script) return -1;
while (1) {
tokn = getatoken(script,rancidtokens,sizeof(rancidtokens)/sizeof(tokenlist));
cmdtokptr = script->ltextptr;
@ -7712,17 +7718,6 @@ static int parse_rancid_net(scriptfile *script)
break;
}
}
return 0;
}
int load_rancid_net(char *fn)
{
scriptfile *script;
script = scriptfile_fromfile(fn);
if (!script) return -1;
parse_rancid_net(script);
scriptfile_close(script);
scriptfile_clearsymbols();
@ -7997,12 +7992,7 @@ void checkcommandline(int argc,char **argv)
{
Bstrcpy(confilename,c);
userconfiles = 1;
/* if(SafeFileExists(c) == 0)
{
initprintf("Could not find CON file '%s'.\n",confilename );
exit(-1);
}
else */ initprintf("Using CON file: '%s'\n",confilename);
initprintf("Using CON file: '%s'\n",confilename);
}
break;
case 'g':

View file

@ -2601,7 +2601,7 @@ char parsecommand(void)
{
if(keyword() >= 0)
{
scriptptr += (4-j);
for (i=4-j; i; i--) *(scriptptr++) = 0;
break;
}
switch(j)

View file

@ -3928,7 +3928,7 @@ SKIPJIBS:
case CON_DEBUG:
insptr++;
printf("%ld\n",*insptr++);
initprintf("%ld\n",*insptr++);
break;
case CON_ENDOFGAME: