mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
Huge, awesome patch from Hunter_rus
git-svn-id: https://svn.eduke32.com/eduke32@728 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
26de39bc2e
commit
310c7240e1
11 changed files with 3176 additions and 1905 deletions
|
@ -38,12 +38,14 @@ extern int zmode, kensplayerheight;
|
||||||
extern short defaultspritecstat;
|
extern short defaultspritecstat;
|
||||||
|
|
||||||
extern short temppicnum, tempcstat, templotag, temphitag, tempextra;
|
extern short temppicnum, tempcstat, templotag, temphitag, tempextra;
|
||||||
extern unsigned char tempshade, temppal, tempxrepeat, tempyrepeat;
|
extern unsigned char temppal, tempxrepeat, tempyrepeat;
|
||||||
|
signed char tempshade;
|
||||||
extern unsigned char somethingintab;
|
extern unsigned char somethingintab;
|
||||||
|
|
||||||
extern unsigned char buildkeys[NUMBUILDKEYS];
|
extern unsigned char buildkeys[NUMBUILDKEYS];
|
||||||
|
|
||||||
extern int ydim16, xdimgame, ydimgame, bppgame, xdim2d, ydim2d, forcesetup;
|
extern int ydim16, xdimgame, ydimgame, bppgame, xdim2d, ydim2d, forcesetup;
|
||||||
|
extern char unrealedlook, quickmapcycling;
|
||||||
|
|
||||||
|
|
||||||
extern int ExtInit(void);
|
extern int ExtInit(void);
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -199,6 +199,10 @@ int loadsetup(const char *fn)
|
||||||
|
|
||||||
if (readconfig(fp, "mousesensitivity", val, VL) > 0) msens = Bstrtod(val, NULL);
|
if (readconfig(fp, "mousesensitivity", val, VL) > 0) msens = Bstrtod(val, NULL);
|
||||||
|
|
||||||
|
if (readconfig(fp, "mousenavigation", val, VL) > 0) unrealedlook = Batoi(val);
|
||||||
|
|
||||||
|
if (readconfig(fp, "quickmapcycling", val, VL) > 0) quickmapcycling = Batoi(val);
|
||||||
|
|
||||||
for (i=0;i<256;i++)remap[i]=i;
|
for (i=0;i<256;i++)remap[i]=i;
|
||||||
remapinit=1;
|
remapinit=1;
|
||||||
if (readconfig(fp, "remap", val, VL) > 0)
|
if (readconfig(fp, "remap", val, VL) > 0)
|
||||||
|
@ -299,6 +303,12 @@ int writesetup(const char *fn)
|
||||||
"; Mouse sensitivity\n"
|
"; Mouse sensitivity\n"
|
||||||
"mousesensitivity = %g\n"
|
"mousesensitivity = %g\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"; Mouse navigation\n"
|
||||||
|
"mousenavigation = %d\n"
|
||||||
|
"\n"
|
||||||
|
"; Quick map cycling\n"
|
||||||
|
"quickmapcycling = %d\n"
|
||||||
|
"\n"
|
||||||
#if 1
|
#if 1
|
||||||
"; Key Settings\n"
|
"; Key Settings\n"
|
||||||
"; Here's a map of all the keyboard scan codes: NOTE: values are listed in hex!\n"
|
"; Here's a map of all the keyboard scan codes: NOTE: values are listed in hex!\n"
|
||||||
|
@ -358,7 +368,7 @@ int writesetup(const char *fn)
|
||||||
#if 0
|
#if 0
|
||||||
option[7]>>4, option[2],
|
option[7]>>4, option[2],
|
||||||
#endif
|
#endif
|
||||||
option[3], msens,
|
option[3], msens, unrealedlook, quickmapcycling,
|
||||||
#if 1
|
#if 1
|
||||||
keys[0], keys[1], keys[2], keys[3], keys[4], keys[5],
|
keys[0], keys[1], keys[2], keys[3], keys[4], keys[5],
|
||||||
keys[6], keys[7], keys[8], keys[9], keys[10], keys[11],
|
keys[6], keys[7], keys[8], keys[9], keys[10], keys[11],
|
||||||
|
|
|
@ -11011,6 +11011,7 @@ void draw2dgrid(int posxe, int posye, short ange, int zoome, short gride)
|
||||||
//
|
//
|
||||||
|
|
||||||
char spritecol2d[MAXTILES][2];
|
char spritecol2d[MAXTILES][2];
|
||||||
|
int showfirstwall=0;
|
||||||
|
|
||||||
void draw2dscreen(int posxe, int posye, short ange, int zoome, short gride)
|
void draw2dscreen(int posxe, int posye, short ange, int zoome, short gride)
|
||||||
{
|
{
|
||||||
|
@ -11061,6 +11062,7 @@ void draw2dscreen(int posxe, int posye, short ange, int zoome, short gride)
|
||||||
if ((i == linehighlight) || ((linehighlight >= 0) && (i == wall[linehighlight].nextwall)))
|
if ((i == linehighlight) || ((linehighlight >= 0) && (i == wall[linehighlight].nextwall)))
|
||||||
if (totalclock & 16) col += (2<<2);
|
if (totalclock & 16) col += (2<<2);
|
||||||
}
|
}
|
||||||
|
if (showfirstwall && (sector[searchsector].wallptr==i||sector[searchsector].wallptr==wall[i].nextwall))col = 14;
|
||||||
|
|
||||||
xp1 = mulscale14(wal->x-posxe,zoome);
|
xp1 = mulscale14(wal->x-posxe,zoome);
|
||||||
yp1 = mulscale14(wal->y-posye,zoome);
|
yp1 = mulscale14(wal->y-posye,zoome);
|
||||||
|
@ -11474,6 +11476,30 @@ void printext256(int xpos, int ypos, short col, short backcol, char *name, char
|
||||||
|
|
||||||
for (i=0;name[i];i++)
|
for (i=0;name[i];i++)
|
||||||
{
|
{
|
||||||
|
if (name[i] == '^' && isdigit(name[i+1]))
|
||||||
|
{
|
||||||
|
char smallbuf[8];
|
||||||
|
int bi=0;
|
||||||
|
while (isdigit(name[i+1]) && bi<8)
|
||||||
|
{
|
||||||
|
smallbuf[bi++]=name[i+1];
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
smallbuf[bi++]=0;
|
||||||
|
if (col)col = atol(smallbuf);
|
||||||
|
|
||||||
|
if (gammabrightness)
|
||||||
|
{
|
||||||
|
p = curpalette[col];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p.r = britable[curbrightness][ curpalette[col].r ];
|
||||||
|
p.g = britable[curbrightness][ curpalette[col].g ];
|
||||||
|
p.b = britable[curbrightness][ curpalette[col].b ];
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
letptr = &fontptr[name[i]<<3];
|
letptr = &fontptr[name[i]<<3];
|
||||||
xx = stx-fontsize;
|
xx = stx-fontsize;
|
||||||
yy = ypos+7 + 2; //+1 is hack!
|
yy = ypos+7 + 2; //+1 is hack!
|
||||||
|
@ -11511,6 +11537,19 @@ void printext256(int xpos, int ypos, short col, short backcol, char *name, char
|
||||||
begindrawing(); //{{{
|
begindrawing(); //{{{
|
||||||
for (i=0;name[i];i++)
|
for (i=0;name[i];i++)
|
||||||
{
|
{
|
||||||
|
if (name[i] == '^' && isdigit(name[i+1]))
|
||||||
|
{
|
||||||
|
char smallbuf[8];
|
||||||
|
int bi=0;
|
||||||
|
while (isdigit(name[i+1]) && bi<8)
|
||||||
|
{
|
||||||
|
smallbuf[bi++]=name[i+1];
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
smallbuf[bi++]=0;
|
||||||
|
if (col)col = atol(smallbuf);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
letptr = &fontptr[name[i]<<3];
|
letptr = &fontptr[name[i]<<3];
|
||||||
ptr = (char *)(ylookup[ypos+7]+(stx-fontsize)+frameplace);
|
ptr = (char *)(ylookup[ypos+7]+(stx-fontsize)+frameplace);
|
||||||
for (y=7;y>=0;y--)
|
for (y=7;y>=0;y--)
|
||||||
|
|
|
@ -441,7 +441,7 @@ void applypalmap(char *pic, char *palmap, int size, int pal)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void applypalmapSkin(char *pic, int sizx, int sizy, int pal)
|
static void applypalmapSkin(char *pic, int sizx, int sizy, md2model *m, int number, int pal, int surf)
|
||||||
{
|
{
|
||||||
int stage;
|
int stage;
|
||||||
|
|
||||||
|
@ -449,11 +449,12 @@ static void applypalmapSkin(char *pic, int sizx, int sizy, int pal)
|
||||||
for (stage=0;stage<MAXPALCONV;stage++)
|
for (stage=0;stage<MAXPALCONV;stage++)
|
||||||
{
|
{
|
||||||
int pal1=0,pal2=pal;
|
int pal1=0,pal2=pal;
|
||||||
mdskinmap_t *sk;
|
mdskinmap_t *sk=modelhead->skinmap;
|
||||||
getpalmap(&stage,&pal1,&pal2);
|
getpalmap(&stage,&pal1,&pal2);
|
||||||
if (!pal1)return;
|
if (!pal1)return;
|
||||||
|
|
||||||
for (sk = modelhead->skinmap; sk; sk = sk->next)
|
mdloadskin((md2model *)m,number,pal1,surf);
|
||||||
|
for (; sk; sk = sk->next)
|
||||||
if ((int)sk->palette == pal1&&sk->palmap)break;
|
if ((int)sk->palette == pal1&&sk->palmap)break;
|
||||||
if (!sk||sk->size!=sizx*sizy)continue;
|
if (!sk||sk->size!=sizx*sizy)continue;
|
||||||
|
|
||||||
|
@ -461,7 +462,7 @@ static void applypalmapSkin(char *pic, int sizx, int sizy, int pal)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int daskinloader(int filh, int *fptr, int *bpl, int *sizx, int *sizy, int *osizx, int *osizy, char *hasalpha, int pal, char effect)
|
static int daskinloader(int filh, int *fptr, int *bpl, int *sizx, int *sizy, int *osizx, int *osizy, char *hasalpha, int pal, char effect, md2model *m, int number, int surf)
|
||||||
{
|
{
|
||||||
int picfillen, j,y,x;
|
int picfillen, j,y,x;
|
||||||
char *picfil,*cptr,al=255;
|
char *picfil,*cptr,al=255;
|
||||||
|
@ -498,7 +499,7 @@ static int daskinloader(int filh, int *fptr, int *bpl, int *sizx, int *sizy, int
|
||||||
{ free(picfil); free(pic); return -1; }
|
{ free(picfil); free(pic); return -1; }
|
||||||
free(picfil);
|
free(picfil);
|
||||||
|
|
||||||
applypalmapSkin((char *)pic,tsizx,tsizy,pal);
|
applypalmapSkin((char *)pic,tsizx,tsizy,m,number,pal,surf);
|
||||||
cptr = &britable[gammabrightness ? 0 : curbrightness][0];
|
cptr = &britable[gammabrightness ? 0 : curbrightness][0];
|
||||||
r=(glinfo.bgra)?hictinting[pal].b:hictinting[pal].r;
|
r=(glinfo.bgra)?hictinting[pal].b:hictinting[pal].r;
|
||||||
g=hictinting[pal].g;
|
g=hictinting[pal].g;
|
||||||
|
@ -763,7 +764,7 @@ int mdloadskin(md2model *m, int number, int pal, int surf)
|
||||||
cachefil = -1; // the compressed version will be saved to disk
|
cachefil = -1; // the compressed version will be saved to disk
|
||||||
|
|
||||||
if ((filh = kopen4load(fn, 0)) < 0) return -1;
|
if ((filh = kopen4load(fn, 0)) < 0) return -1;
|
||||||
if (daskinloader(filh,&fptr,&bpl,&xsiz,&ysiz,&osizx,&osizy,&hasalpha,pal,(globalnoeffect)?0:hictinting[pal].f))
|
if (daskinloader(filh,&fptr,&bpl,&xsiz,&ysiz,&osizx,&osizy,&hasalpha,pal,(globalnoeffect)?0:hictinting[pal].f,m,number,surf))
|
||||||
{
|
{
|
||||||
kclose(filh);
|
kclose(filh);
|
||||||
initprintf("Failed loading skin file \"%s\"\n", fn);
|
initprintf("Failed loading skin file \"%s\"\n", fn);
|
||||||
|
@ -1617,8 +1618,6 @@ static int md3draw(md3model *m, spritetype *tspr)
|
||||||
}
|
}
|
||||||
for (surfi=0;surfi<m->head.numsurfs;surfi++)
|
for (surfi=0;surfi<m->head.numsurfs;surfi++)
|
||||||
{
|
{
|
||||||
int pal1;
|
|
||||||
|
|
||||||
s = &m->head.surfs[surfi];
|
s = &m->head.surfs[surfi];
|
||||||
v0 = &s->xyzn[m->cframe*s->numverts];
|
v0 = &s->xyzn[m->cframe*s->numverts];
|
||||||
v1 = &s->xyzn[m->nframe*s->numverts];
|
v1 = &s->xyzn[m->nframe*s->numverts];
|
||||||
|
@ -1680,9 +1679,6 @@ static int md3draw(md3model *m, spritetype *tspr)
|
||||||
mat[3] = mat[7] = mat[11] = 0.f; mat[15] = 1.f; bglLoadMatrixf(mat);
|
mat[3] = mat[7] = mat[11] = 0.f; mat[15] = 1.f; bglLoadMatrixf(mat);
|
||||||
// PLAG: End
|
// PLAG: End
|
||||||
|
|
||||||
for (pal1=SPECPAL;pal1<=REDPAL;pal1++)
|
|
||||||
mdloadskin((md2model *)m,tile2model[Ptile2tile(tspr->picnum,sprite[tspr->owner].pal)].skinnum,pal1,surfi);
|
|
||||||
|
|
||||||
i = mdloadskin((md2model *)m,tile2model[Ptile2tile(tspr->picnum,sprite[tspr->owner].pal)].skinnum,globalpal,surfi); if (!i) continue;
|
i = mdloadskin((md2model *)m,tile2model[Ptile2tile(tspr->picnum,sprite[tspr->owner].pal)].skinnum,globalpal,surfi); if (!i) continue;
|
||||||
//i = mdloadskin((md2model *)m,tile2model[Ptile2tile(tspr->picnum,sprite[tspr->owner].pal)].skinnum,surfi); //hack for testing multiple surfaces per MD3
|
//i = mdloadskin((md2model *)m,tile2model[Ptile2tile(tspr->picnum,sprite[tspr->owner].pal)].skinnum,surfi); //hack for testing multiple surfaces per MD3
|
||||||
bglBindTexture(GL_TEXTURE_2D, i);
|
bglBindTexture(GL_TEXTURE_2D, i);
|
||||||
|
|
|
@ -1249,7 +1249,7 @@ void writexcache(char *fn, int len, int dameth, char effect, texcacheheader *hea
|
||||||
unsigned int padx=0, pady=0;
|
unsigned int padx=0, pady=0;
|
||||||
GLuint gi;
|
GLuint gi;
|
||||||
|
|
||||||
if (!glinfo.texcompr || !glusetexcompr || !glusetexcache) return;
|
if (!glinfo.texcompr || !glusetexcompr || !glusetexcache) {initprintf("\n");return;}
|
||||||
if (!bglCompressedTexImage2DARB || !bglGetCompressedTexImageARB)
|
if (!bglCompressedTexImage2DARB || !bglGetCompressedTexImageARB)
|
||||||
{
|
{
|
||||||
// lacking the necessary extensions to do this
|
// lacking the necessary extensions to do this
|
||||||
|
@ -4118,6 +4118,7 @@ void polymost_drawrooms()
|
||||||
{
|
{
|
||||||
short hitsect, hitwall, hitsprite;
|
short hitsect, hitwall, hitsprite;
|
||||||
int vx, vy, vz, hitx, hity, hitz;
|
int vx, vy, vz, hitx, hity, hitz;
|
||||||
|
int cz, fz;
|
||||||
|
|
||||||
ox2 = (searchx-ghalfx)/1.2; oy2 = (searchy-ghoriz)/ 1.2; oz2 = ghalfx;
|
ox2 = (searchx-ghalfx)/1.2; oy2 = (searchy-ghoriz)/ 1.2; oz2 = ghalfx;
|
||||||
|
|
||||||
|
@ -4139,9 +4140,12 @@ void polymost_drawrooms()
|
||||||
hitallsprites = 1;
|
hitallsprites = 1;
|
||||||
hitscan(globalposx,globalposy,globalposz,globalcursectnum, //Start position
|
hitscan(globalposx,globalposy,globalposz,globalcursectnum, //Start position
|
||||||
vx>>12,vy>>12,vz>>8,&hitsect,&hitwall,&hitsprite,&hitx,&hity,&hitz,0xffff0030);
|
vx>>12,vy>>12,vz>>8,&hitsect,&hitwall,&hitsprite,&hitx,&hity,&hitz,0xffff0030);
|
||||||
|
getzsofslope(hitsect,hitx,hity,&cz,&fz);
|
||||||
hitallsprites = 0;
|
hitallsprites = 0;
|
||||||
|
|
||||||
searchsector = hitsect;
|
searchsector = hitsect;
|
||||||
|
if (hitz<cz) searchstat = 1;else
|
||||||
|
if (hitz>fz) searchstat = 2;else
|
||||||
if (hitwall >= 0)
|
if (hitwall >= 0)
|
||||||
{
|
{
|
||||||
searchwall = hitwall; searchstat = 0;
|
searchwall = hitwall; searchstat = 0;
|
||||||
|
@ -5547,6 +5551,31 @@ int polymost_printext256(int xpos, int ypos, short col, short backcol, char *nam
|
||||||
bglBegin(GL_QUADS);
|
bglBegin(GL_QUADS);
|
||||||
for (c=0; name[c]; c++)
|
for (c=0; name[c]; c++)
|
||||||
{
|
{
|
||||||
|
if (name[c] == '^' && isdigit(name[c+1]))
|
||||||
|
{
|
||||||
|
char smallbuf[8];
|
||||||
|
int bi=0;
|
||||||
|
while (isdigit(name[c+1]) && bi<8)
|
||||||
|
{
|
||||||
|
smallbuf[bi++]=name[c+1];
|
||||||
|
c++;
|
||||||
|
}
|
||||||
|
smallbuf[bi++]=0;
|
||||||
|
if (col)col = atol(smallbuf);
|
||||||
|
|
||||||
|
if (gammabrightness)
|
||||||
|
{
|
||||||
|
p = curpalette[col];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p.r = britable[curbrightness][ curpalette[col].r ];
|
||||||
|
p.g = britable[curbrightness][ curpalette[col].g ];
|
||||||
|
p.b = britable[curbrightness][ curpalette[col].b ];
|
||||||
|
}
|
||||||
|
bglColor4ub(p.r,p.g,p.b,255);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
tx = (float)(name[c]%32)/32.0;
|
tx = (float)(name[c]%32)/32.0;
|
||||||
ty = (float)((name[c]/32) + (fontsize*8))/16.0;
|
ty = (float)((name[c]/32) + (fontsize*8))/16.0;
|
||||||
|
|
||||||
|
@ -5932,8 +5961,6 @@ void polymost_precache(int dapicnum, int dapalnum, int datype)
|
||||||
|
|
||||||
for (i=0;i<=j;i++)
|
for (i=0;i<=j;i++)
|
||||||
{
|
{
|
||||||
int pal1;
|
|
||||||
for (pal1=SPECPAL;pal1<=REDPAL;pal1++)mdloadskin((md2model*)models[mid],0,pal1,i);
|
|
||||||
mdloadskin((md2model*)models[mid], 0, dapalnum, i);
|
mdloadskin((md2model*)models[mid], 0, dapalnum, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2393,10 +2393,15 @@ static void moveweapons(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (f=1;f<=hittype[i].projectile.velmult;f++)
|
for (f=1;f<=hittype[i].projectile.velmult;f++)
|
||||||
|
{
|
||||||
|
dax = s->x;
|
||||||
|
day = s->y;
|
||||||
|
daz = s->z;
|
||||||
j = movesprite(i,
|
j = movesprite(i,
|
||||||
(k*(sintable[(s->ang+512)&2047]))>>14,
|
(k*(sintable[(s->ang+512)&2047]))>>14,
|
||||||
(k*(sintable[s->ang&2047]))>>14,ll,qq);
|
(k*(sintable[s->ang&2047]))>>14,ll,qq);
|
||||||
|
if (j)break;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(hittype[i].projectile.workslike & PROJECTILE_FLAG_BOUNCESOFFWALLS) && s->yvel >= 0)
|
if (!(hittype[i].projectile.workslike & PROJECTILE_FLAG_BOUNCESOFFWALLS) && s->yvel >= 0)
|
||||||
if (FindDistance2D(s->x-sprite[s->yvel].x,s->y-sprite[s->yvel].y) < 256)
|
if (FindDistance2D(s->x-sprite[s->yvel].x,s->y-sprite[s->yvel].y) < 256)
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -6676,6 +6676,10 @@ void animatesprites(int x,int y,int a,int smoothratio)
|
||||||
#if defined(POLYMOST) && defined(USE_OPENGL)
|
#if defined(POLYMOST) && defined(USE_OPENGL)
|
||||||
if (bpp > 8 && usemodels && md_tilehasmodel(t->picnum,t->pal) >= 0 && !(spriteext[i].flags&SPREXT_NOTMD))
|
if (bpp > 8 && usemodels && md_tilehasmodel(t->picnum,t->pal) >= 0 && !(spriteext[i].flags&SPREXT_NOTMD))
|
||||||
{
|
{
|
||||||
|
int v=getangle(t->xvel,t->zvel>>4);
|
||||||
|
if (v>1023)v-=2048;
|
||||||
|
spriteext[i].pitch=v;
|
||||||
|
|
||||||
t->cstat &= ~4;
|
t->cstat &= ~4;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,7 +172,7 @@ int ReadGameVars(int fil)
|
||||||
{
|
{
|
||||||
//Bsprintf(g_szBuf,"Reading value array for %s (%d)",aGameVars[i].szLabel,sizeof(int) * MAXPLAYERS);
|
//Bsprintf(g_szBuf,"Reading value array for %s (%d)",aGameVars[i].szLabel,sizeof(int) * MAXPLAYERS);
|
||||||
//AddLog(g_szBuf);
|
//AddLog(g_szBuf);
|
||||||
if (kdfread(aGameArrays[i].plValues,sizeof(intptr_t) * aGameArrays[i].size, 1, fil) != 1) goto corrupt;
|
if (kdfread(aGameArrays[i].plValues,sizeof(intptr_t) * aGameArrays[i].size, 1, fil) < 1) goto corrupt;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bsprintf(g_szBuf,"CP:%s %d",__FILE__,__LINE__);
|
// Bsprintf(g_szBuf,"CP:%s %d",__FILE__,__LINE__);
|
||||||
|
|
|
@ -1,203 +1,205 @@
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2004, 2007 - EDuke32 developers
|
Copyright (C) 2004, 2007 - EDuke32 developers
|
||||||
|
|
||||||
This file is part of EDuke32
|
This file is part of EDuke32
|
||||||
|
|
||||||
EDuke32 is free software; you can redistribute it and/or
|
EDuke32 is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License version 2
|
modify it under the terms of the GNU General Public License version 2
|
||||||
as published by the Free Software Foundation.
|
as published by the Free Software Foundation.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
See the GNU General Public License for more details.
|
See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
|
|
||||||
#define TICSPERFRAME 3
|
#define TICSPERFRAME 3
|
||||||
|
|
||||||
// #define VULGARITY
|
// #define VULGARITY
|
||||||
|
|
||||||
char *defsfilename = "duke3d.def";
|
char *defsfilename = "duke3d.def";
|
||||||
|
|
||||||
extern char keystatus[];
|
extern char keystatus[];
|
||||||
extern short defaultspritecstat;
|
extern short defaultspritecstat;
|
||||||
extern int posx, posy, posz, horiz, qsetmode;
|
extern int posx, posy, posz, horiz, qsetmode;
|
||||||
extern short ang, cursectnum;
|
extern short ang, cursectnum;
|
||||||
extern short ceilingheinum, floorheinum;
|
extern short ceilingheinum, floorheinum;
|
||||||
extern char names[MAXTILES][25];
|
extern char names[MAXTILES][25];
|
||||||
|
|
||||||
extern int ydim16, xdimgame, ydimgame, bppgame, xdim2d, ydim2d;
|
extern int ydim16, xdimgame, ydimgame, bppgame, xdim2d, ydim2d;
|
||||||
|
|
||||||
extern int zmode, kensplayerheight, zlock;
|
extern int zmode, kensplayerheight, zlock;
|
||||||
|
|
||||||
extern short editstatus, searchit;
|
extern short editstatus, searchit;
|
||||||
extern int searchx, searchy, osearchx, osearchy; //search input
|
extern int searchx, searchy, osearchx, osearchy; //search input
|
||||||
extern short searchsector, searchwall, searchstat; //search output
|
extern short searchsector, searchwall, searchstat; //search output
|
||||||
|
|
||||||
extern short temppicnum, tempcstat, templotag, temphitag, tempextra;
|
extern short temppicnum, tempcstat, templotag, temphitag, tempextra;
|
||||||
extern unsigned char tempshade, temppal, tempvis, tempxrepeat, tempyrepeat, somethingintab;
|
extern unsigned char temppal, tempvis, tempxrepeat, tempyrepeat, somethingintab;
|
||||||
|
extern signed char tempshade;
|
||||||
static int ototalclock = 0, clockval[16], clockcnt = 0;
|
|
||||||
|
static int ototalclock = 0, clockval[16], clockcnt = 0;
|
||||||
#define NUMOPTIONS 9
|
|
||||||
#define NUMKEYS 19
|
#define NUMOPTIONS 9
|
||||||
|
#define NUMKEYS 19
|
||||||
char option[NUMOPTIONS] = {0,0,0,0,0,0,1,0,0};
|
|
||||||
unsigned char keys[NUMBUILDKEYS] =
|
char option[NUMOPTIONS] = {0,0,0,0,0,0,1,0,0};
|
||||||
{
|
unsigned char keys[NUMBUILDKEYS] =
|
||||||
0xc8,0xd0,0xcb,0xcd,0x2a,0x9d,0x1d,0x39,
|
{
|
||||||
0x1e,0x2c,0xd1,0xc9,0x47,0x49,
|
0xc8,0xd0,0xcb,0xcd,0x2a,0x9d,0x1d,0x39,
|
||||||
0x9c,0x1c,0xd,0xc,0xf,0x29
|
0x1e,0x2c,0xd1,0xc9,0x47,0x49,
|
||||||
};
|
0x9c,0x1c,0xd,0xc,0xf,0x29
|
||||||
|
};
|
||||||
int nextvoxid = 0;
|
|
||||||
|
int nextvoxid = 0;
|
||||||
extern int whitecol;
|
|
||||||
extern char vgapal16[4*256];
|
extern int whitecol;
|
||||||
extern void AutoAlignWalls(int nWall0, int ply);
|
extern char vgapal16[4*256];
|
||||||
extern char changechar(char dachar, int dadir, char smooshyalign, char boundcheck);
|
extern void AutoAlignWalls(int nWall0, int ply);
|
||||||
extern void _printmessage16(char name[82]);
|
extern char changechar(char dachar, int dadir, char smooshyalign, char boundcheck);
|
||||||
extern void updatenumsprites(void);
|
extern void _printmessage16(char name[82]);
|
||||||
|
extern void updatenumsprites(void);
|
||||||
extern int lastpm16time, synctics;
|
|
||||||
extern int halfxdim16, midydim16, zoom;
|
extern int lastpm16time, synctics;
|
||||||
extern void fixrepeats(short i);
|
extern int halfxdim16, midydim16, zoom;
|
||||||
|
extern void fixrepeats(short i);
|
||||||
char autospritehelp=0,autosecthelp=0;
|
|
||||||
short MinRate=24, MinD=3;
|
char autospritehelp=0,autosecthelp=0;
|
||||||
int xoldtimerhandler, lastmessagetime;
|
short MinRate=24, MinD=3;
|
||||||
|
int xoldtimerhandler, lastmessagetime=-1;
|
||||||
char tempbuf[1024]; //1024
|
|
||||||
int numsprite[MAXSPRITES];
|
char tempbuf[1024]; //1024
|
||||||
int multisprite[MAXSPRITES];
|
int numsprite[MAXSPRITES];
|
||||||
char lo[32];
|
int multisprite[MAXSPRITES];
|
||||||
char levelname[255];
|
char lo[32];
|
||||||
short curwall=0,curwallnum=0;
|
char levelname[255];
|
||||||
short cursearchsprite=0,cursearchspritenum=0,cursector_lotag=0,cursectornum=0;
|
short curwall=0,curwallnum=0;
|
||||||
short search_lotag=0,search_hitag=0;
|
short cursearchsprite=0,cursearchspritenum=0,cursector_lotag=0,cursectornum=0;
|
||||||
char wallsprite=0;
|
short search_lotag=0,search_hitag=0;
|
||||||
char helpon=0;
|
char wallsprite=0;
|
||||||
//static char onwater=0;
|
char helpon=0;
|
||||||
unsigned char onnames=4, usedcount=1;
|
//static char onwater=0;
|
||||||
short cursprite;
|
unsigned char onnames=4, usedcount=1;
|
||||||
int mousxplc, mousyplc, ppointhighlight;
|
short cursprite;
|
||||||
int counter=0;
|
int mousxplc, mousyplc, ppointhighlight;
|
||||||
unsigned char nosprites=0,purpleon=0,skill=4;
|
int counter=0;
|
||||||
unsigned char framerateon=1,tabgraphic=2,shadepreview=0,autosave=1,sidemode=0;
|
unsigned char nosprites=0,purpleon=0,skill=4;
|
||||||
extern int vel, svel, hvel, angvel;
|
unsigned char framerateon=1,tabgraphic=2,shadepreview=0,autosave=1,sidemode=0;
|
||||||
int xvel, yvel, timoff;
|
extern int vel, svel, hvel, angvel;
|
||||||
|
int xvel, yvel, timoff;
|
||||||
static void SearchSectorsForward();
|
|
||||||
static void SearchSectorsBackward();
|
static void SearchSectorsForward();
|
||||||
static inline void SpriteName(short spritenum, char *lo2);
|
static void SearchSectorsBackward();
|
||||||
static void PrintStatus(char *string,int num,char x,char y,char color);
|
static inline void SpriteName(short spritenum, char *lo2);
|
||||||
static void SetBOSS1Palette();
|
static void PrintStatus(char *string,int num,char x,char y,char color);
|
||||||
// static void SetSLIMEPalette();
|
static void SetBOSS1Palette();
|
||||||
static void SetWATERPalette();
|
// static void SetSLIMEPalette();
|
||||||
static void SetGAMEPalette();
|
static void SetWATERPalette();
|
||||||
static void kensetpalette(char *vgapal);
|
static void SetGAMEPalette();
|
||||||
|
static void kensetpalette(char *vgapal);
|
||||||
extern short grid;
|
|
||||||
|
extern short grid;
|
||||||
static void EditSpriteData(short spritenum);
|
|
||||||
static void EditWallData(short wallnum);
|
static void EditSpriteData(short spritenum);
|
||||||
static void EditSectorData(short sectnum);
|
static void EditWallData(short wallnum);
|
||||||
static void FuncMenu(void);
|
static void EditSectorData(short sectnum);
|
||||||
|
static void FuncMenu(void);
|
||||||
char GAMEpalette[768];
|
|
||||||
char WATERpalette[768];
|
char GAMEpalette[768];
|
||||||
char SLIMEpalette[768];
|
char WATERpalette[768];
|
||||||
char TITLEpalette[768];
|
char SLIMEpalette[768];
|
||||||
char REALMSpalette[768];
|
char TITLEpalette[768];
|
||||||
char BOSS1palette[768];
|
char REALMSpalette[768];
|
||||||
|
char BOSS1palette[768];
|
||||||
char num_tables;
|
|
||||||
|
char num_tables;
|
||||||
int updownunits=1024;
|
|
||||||
extern short highlightsector[MAXSECTORS], highlightsectorcnt;
|
int updownunits=1024;
|
||||||
extern short highlight[MAXWALLS];
|
extern short highlightsector[MAXSECTORS], highlightsectorcnt;
|
||||||
extern short pointhighlight, linehighlight, highlightcnt;
|
extern short highlight[MAXWALLS];
|
||||||
extern short asksave;
|
extern short pointhighlight, linehighlight, highlightcnt;
|
||||||
|
extern short asksave;
|
||||||
char getmessage[162], getmessageleng;
|
|
||||||
int getmessagetimeoff, charsperline;
|
char getmessage[162], getmessageleng;
|
||||||
extern int startposx, startposy, startposz;
|
int getmessagetimeoff, charsperline;
|
||||||
extern short startang, startsectnum;
|
extern int startposx, startposy, startposz;
|
||||||
|
extern short startang, startsectnum;
|
||||||
int autosavetimer;
|
|
||||||
extern int numsprites;
|
int autosavetimer;
|
||||||
extern char spritecol2d[MAXTILES][2];
|
extern int numsprites;
|
||||||
extern char custom2dcolors;
|
extern int showfirstwall;
|
||||||
extern char mlook;
|
extern char spritecol2d[MAXTILES][2];
|
||||||
|
extern char custom2dcolors;
|
||||||
int intro=0;
|
extern char mlook;
|
||||||
extern int ydim16, halfxdim16, midydim16, zoom;
|
|
||||||
extern intptr_t frameplace;
|
int intro=0;
|
||||||
extern char pow2char[8];
|
extern int ydim16, halfxdim16, midydim16, zoom;
|
||||||
|
extern intptr_t frameplace;
|
||||||
static int acurpalette=0;
|
extern char pow2char[8];
|
||||||
|
|
||||||
extern void showsectordata(short sectnum);
|
static int acurpalette=0;
|
||||||
extern void showwalldata(short wallnum);
|
|
||||||
extern void showspritedata(short spritenum);
|
extern void showsectordata(short sectnum);
|
||||||
extern int checksectorpointer(short i, short sectnum);
|
extern void showwalldata(short wallnum);
|
||||||
|
extern void showspritedata(short spritenum);
|
||||||
extern double msens;
|
extern int checksectorpointer(short i, short sectnum);
|
||||||
|
|
||||||
void ContextHelp(short spritenum);
|
extern double msens;
|
||||||
void ResetKeys();
|
|
||||||
|
void ContextHelp(short spritenum);
|
||||||
extern void fixspritesectors(void);
|
void ResetKeys();
|
||||||
#define KEY_PRESSED(sc) KB_KeyPressed((sc))
|
|
||||||
|
extern void fixspritesectors(void);
|
||||||
// This table defines the various zoom levels, the numbers being the pixel width
|
#define KEY_PRESSED(sc) KB_KeyPressed((sc))
|
||||||
// and height of the sprite when plotted on the screen. Probably zooms in too far
|
|
||||||
// for some, but I'm a blind old git :-(
|
// This table defines the various zoom levels, the numbers being the pixel width
|
||||||
|
// and height of the sprite when plotted on the screen. Probably zooms in too far
|
||||||
#define FUCKING_GOOD_EYESIGHT 16
|
// for some, but I'm a blind old git :-(
|
||||||
|
|
||||||
static const int ZoomToThumbSize[] =
|
#define FUCKING_GOOD_EYESIGHT 16
|
||||||
{
|
|
||||||
FUCKING_GOOD_EYESIGHT, 32, 64, 128, 192, 256, 384, 512
|
static const int ZoomToThumbSize[] =
|
||||||
} ;
|
{
|
||||||
|
FUCKING_GOOD_EYESIGHT, 32, 64, 128, 192, 256, 384, 512
|
||||||
#define NUM_ZOOMS (sizeof(ZoomToThumbSize)/sizeof(ZoomToThumbSize[0]))
|
} ;
|
||||||
|
|
||||||
#define INITIAL_ZOOM 2
|
#define NUM_ZOOMS (sizeof(ZoomToThumbSize)/sizeof(ZoomToThumbSize[0]))
|
||||||
|
|
||||||
typedef struct
|
#define INITIAL_ZOOM 2
|
||||||
{
|
|
||||||
int *pIds ; // ptr to list of tile Ids
|
typedef struct
|
||||||
int nIds ; // num of tile ids
|
{
|
||||||
char *szText ; // description to present to user.
|
int *pIds ; // ptr to list of tile Ids
|
||||||
char key1 ; // key1 and key2 are two alternative keypresses used to
|
int nIds ; // num of tile ids
|
||||||
char key2 ; // select tile set. Bodge to do eary upper/lower case handling
|
char *szText ; // description to present to user.
|
||||||
} TileGroup;
|
char key1 ; // key1 and key2 are two alternative keypresses used to
|
||||||
|
char key2 ; // select tile set. Bodge to do eary upper/lower case handling
|
||||||
#define MAX_TILE_GROUPS 32
|
} TileGroup;
|
||||||
#define MAX_TILE_GROUP_ENTRIES 1024
|
|
||||||
|
#define MAX_TILE_GROUPS 32
|
||||||
TileGroup s_TileGroups[MAX_TILE_GROUPS];
|
#define MAX_TILE_GROUP_ENTRIES 1024
|
||||||
|
|
||||||
static unsigned int tile_groups = 0;
|
TileGroup s_TileGroups[MAX_TILE_GROUPS];
|
||||||
|
|
||||||
#define FIRST_USER_ART_TILE 3584
|
static unsigned int tile_groups = 0;
|
||||||
// Some atomic tiles are sprinkled in the V1.3d's area but
|
|
||||||
// this is where the main atomic tiles start :-
|
#define FIRST_USER_ART_TILE 3584
|
||||||
#define FIRST_ATOMIC_TILE 4096
|
// Some atomic tiles are sprinkled in the V1.3d's area but
|
||||||
#define FIRST_EXTENDED_TILE 6144
|
// this is where the main atomic tiles start :-
|
||||||
#define SECOND_EXTENDED_TILE 9216
|
#define FIRST_ATOMIC_TILE 4096
|
||||||
|
#define FIRST_EXTENDED_TILE 6144
|
||||||
extern short localartfreq[MAXTILES];
|
#define SECOND_EXTENDED_TILE 9216
|
||||||
extern short localartlookup[MAXTILES], localartlookupnum;
|
|
||||||
extern int lockclock;
|
extern short localartfreq[MAXTILES];
|
||||||
extern void clearkeys(void);
|
extern short localartlookup[MAXTILES], localartlookupnum;
|
||||||
|
extern int lockclock;
|
||||||
|
extern void clearkeys(void);
|
||||||
|
|
Loading…
Reference in a new issue