Game: fix sprite jittering for SE31. Editor: copy relevant commandline switches to testplay_addparam on startup.

git-svn-id: https://svn.eduke32.com/eduke32@1081 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2008-09-28 21:48:31 +00:00
parent ca8f8d21ae
commit 0f0572ee69
2 changed files with 63 additions and 5 deletions

View file

@ -7231,6 +7231,10 @@ static void moveeffectors(void) //STATNUM 3
t[0] = 0;
t[3] = s->hitag;
callsound(s->sectnum,i);
for (j=headspritesect[s->sectnum]; j>=0; j=nextspritesect[j])
if (sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4)
hittype[j].bposz = sprite[j].z;
}
else
{
@ -7245,7 +7249,8 @@ static void moveeffectors(void) //STATNUM 3
g_player[sprite[j].yvel].ps->posz += l;
if (sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4)
{
hittype[j].bposz = sprite[j].z += l;
hittype[j].bposz = sprite[j].z;
sprite[j].z += l;
hittype[j].floorz = sc->floorz;
}
j = nextspritesect[j];
@ -7261,6 +7266,11 @@ static void moveeffectors(void) //STATNUM 3
t[2] = 0;
t[0] = 0;
t[3] = s->hitag;
for (j=headspritesect[s->sectnum]; j>=0; j=nextspritesect[j])
if (sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4)
hittype[j].bposz = sprite[j].z;
}
else
{
@ -7275,7 +7285,8 @@ static void moveeffectors(void) //STATNUM 3
g_player[sprite[j].yvel].ps->posz += l;
if (sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4)
{
hittype[j].bposz = sprite[j].z += l;
hittype[j].bposz = sprite[j].z;
sprite[j].z += l;
hittype[j].floorz = sc->floorz;
}
j = nextspritesect[j];
@ -7293,6 +7304,11 @@ static void moveeffectors(void) //STATNUM 3
t[0] = 0;
t[2] = 1;
t[3] = s->hitag;
for (j=headspritesect[s->sectnum]; j>=0; j=nextspritesect[j])
if (sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4)
hittype[j].bposz = sprite[j].z;
}
else
{
@ -7307,7 +7323,8 @@ static void moveeffectors(void) //STATNUM 3
g_player[sprite[j].yvel].ps->posz += l;
if (sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4)
{
hittype[j].bposz = sprite[j].z += l;
hittype[j].bposz = sprite[j].z;
sprite[j].z += l;
hittype[j].floorz = sc->floorz;
}
j = nextspritesect[j];
@ -7322,6 +7339,10 @@ static void moveeffectors(void) //STATNUM 3
callsound(s->sectnum,i);
t[2] = 1;
t[3] = s->hitag;
for (j=headspritesect[s->sectnum]; j>=0; j=nextspritesect[j])
if (sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4)
hittype[j].bposz = sprite[j].z;
}
else
{
@ -7336,7 +7357,8 @@ static void moveeffectors(void) //STATNUM 3
g_player[sprite[j].yvel].ps->posz -= l;
if (sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4)
{
hittype[j].bposz = sprite[j].z -= l;
hittype[j].bposz = sprite[j].z;
sprite[j].z -= l;
hittype[j].floorz = sc->floorz;
}
j = nextspritesect[j];

View file

@ -7320,13 +7320,24 @@ static void addgroup(const char *buffer)
CommandGrps = s;
}
#define COPYARG(i) \
Bmemcpy(&testplay_addparam[j], argv[i], lengths[i]); \
j += lengths[i]; \
testplay_addparam[j++] = ' ';
static void checkcommandline(int argc, const char **argv)
{
int i = 1;
int i = 1, j, maxlen=0, *lengths;
char *c, *k;
if (argc > 1)
{
lengths = Bmalloc(argc*sizeof(int));
for (j=1; j<argc; j++) maxlen += (lengths[j] = Bstrlen(argv[j]));
testplay_addparam = Bmalloc(maxlen+argc);
testplay_addparam[0] = 0;
j = 0;
while (i < argc)
{
c = (char *)argv[i];
@ -7343,6 +7354,8 @@ static void checkcommandline(int argc, const char **argv)
if (argc > i+1)
{
addgroup(argv[i+1]);
COPYARG(i);
COPYARG(i+1);
i++;
}
i++;
@ -7354,6 +7367,8 @@ static void checkcommandline(int argc, const char **argv)
if (argc > i+1)
{
addgamepath(argv[i+1]);
COPYARG(i);
COPYARG(i+1);
i++;
}
i++;
@ -7374,6 +7389,8 @@ static void checkcommandline(int argc, const char **argv)
if (argc > i+1)
{
Bstrcpy(defaultduke3dgrp,argv[i+1]);
COPYARG(i);
COPYARG(i+1);
i++;
}
i++;
@ -7382,12 +7399,14 @@ static void checkcommandline(int argc, const char **argv)
if (!Bstrcasecmp(c+1,"nam"))
{
strcpy(duke3dgrp, "nam.grp");
COPYARG(i);
i++;
continue;
}
if (!Bstrcasecmp(c+1,"ww2gi"))
{
strcpy(duke3dgrp, "ww2gi.grp");
COPYARG(i);
i++;
continue;
}
@ -7402,6 +7421,7 @@ static void checkcommandline(int argc, const char **argv)
{
initprintf("Autoload disabled\n");
NoAutoLoad = 1;
COPYARG(i);
i++;
continue;
}
@ -7409,6 +7429,7 @@ static void checkcommandline(int argc, const char **argv)
if (!Bstrcasecmp(c+1,"usecwd"))
{
usecwd = 1;
COPYARG(i);
i++;
continue;
}
@ -7426,6 +7447,7 @@ static void checkcommandline(int argc, const char **argv)
if (*c)
{
defsfilename = c;
COPYARG(i);
initprintf("Using DEF file: %s.\n",defsfilename);
}
break;
@ -7434,12 +7456,14 @@ static void checkcommandline(int argc, const char **argv)
c++;
if (!*c) break;
addgamepath(c);
COPYARG(i);
break;
case 'g':
case 'G':
c++;
if (!*c) break;
addgroup(c);
COPYARG(i);
break;
}
}
@ -7451,11 +7475,13 @@ static void checkcommandline(int argc, const char **argv)
if (!Bstrcasecmp(k,".grp") || !Bstrcasecmp(k,".zip"))
{
addgroup(argv[i++]);
COPYARG(i);
continue;
}
if (!Bstrcasecmp(k,".def"))
{
defsfilename = (char *)argv[i++];
COPYARG(i);
initprintf("Using DEF file: %s.\n",defsfilename);
continue;
}
@ -7463,8 +7489,18 @@ static void checkcommandline(int argc, const char **argv)
}
i++;
}
Bfree(lengths);
if (j > 0)
{
testplay_addparam[j-1] = 0;
Brealloc(testplay_addparam, j*sizeof(char));
}
else
Bfree(testplay_addparam);
}
}
#undef COPYARG
int ExtPreInit(int argc,const char **argv)
{