mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-26 03:30:46 +00:00
More Polymost cleanup, also consolidate tilesizx and tilesizy into a single tilesiz vec2_t to ensure both x and y are always in the same cache line. I may add a new vec2_16t later. Still need to take care of emulating the old flat array for the sake of CON access.
git-svn-id: https://svn.eduke32.com/eduke32@4623 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
e20f297774
commit
144a4798ce
26 changed files with 840 additions and 847 deletions
|
@ -277,6 +277,22 @@ static inline void sprite_tracker_hook(uintptr_t address);
|
||||||
|
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int32_t x, y;
|
||||||
|
} vec2_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int32_t x, y, z;
|
||||||
|
} vec3_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
float x, y;
|
||||||
|
} fvec2_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
float x, y, z;
|
||||||
|
} fvec3_t;
|
||||||
|
|
||||||
// Links to various ABIs specifying (or documenting non-normatively) the
|
// Links to various ABIs specifying (or documenting non-normatively) the
|
||||||
// alignment requirements of aggregates:
|
// alignment requirements of aggregates:
|
||||||
//
|
//
|
||||||
|
@ -829,7 +845,8 @@ EXTERN int16_t headspritesect[MAXSECTORS+1], headspritestat[MAXSTATUS+1];
|
||||||
EXTERN int16_t prevspritesect[MAXSPRITES], prevspritestat[MAXSPRITES];
|
EXTERN int16_t prevspritesect[MAXSPRITES], prevspritestat[MAXSPRITES];
|
||||||
EXTERN int16_t nextspritesect[MAXSPRITES], nextspritestat[MAXSPRITES];
|
EXTERN int16_t nextspritesect[MAXSPRITES], nextspritestat[MAXSPRITES];
|
||||||
|
|
||||||
EXTERN int16_t tilesizx[MAXTILES], tilesizy[MAXTILES];
|
EXTERN vec2_t tilesiz[MAXTILES];
|
||||||
|
|
||||||
EXTERN char picsiz[MAXTILES];
|
EXTERN char picsiz[MAXTILES];
|
||||||
EXTERN char walock[MAXTILES];
|
EXTERN char walock[MAXTILES];
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -1046,14 +1063,6 @@ OTHER VARIABLES:
|
||||||
you call the loadboard function.
|
you call the loadboard function.
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
int32_t x, y;
|
|
||||||
} vec2_t;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
int32_t x, y, z;
|
|
||||||
} vec3_t;
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
vec3_t pos;
|
vec3_t pos;
|
||||||
int16_t sprite, wall, sect;
|
int16_t sprite, wall, sect;
|
||||||
|
|
|
@ -176,60 +176,11 @@ extern float gyxscale, gxyaspect, ghalfx, grhalfxdown10;
|
||||||
|
|
||||||
extern char ptempbuf[MAXWALLSB<<1];
|
extern char ptempbuf[MAXWALLSB<<1];
|
||||||
|
|
||||||
static inline void polymost_setupdetailtexture(int32_t *texunits, int32_t tex)
|
|
||||||
{
|
|
||||||
bglActiveTextureARB(++*texunits);
|
|
||||||
|
|
||||||
bglEnable(GL_TEXTURE_2D);
|
|
||||||
bglBindTexture(GL_TEXTURE_2D, tex);
|
|
||||||
|
|
||||||
bglTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
|
|
||||||
bglTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE);
|
|
||||||
|
|
||||||
bglTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_PREVIOUS_ARB);
|
|
||||||
bglTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, GL_SRC_COLOR);
|
|
||||||
|
|
||||||
bglTexEnvf(GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, GL_TEXTURE);
|
|
||||||
bglTexEnvf(GL_TEXTURE_ENV, GL_OPERAND1_RGB_ARB, GL_SRC_COLOR);
|
|
||||||
|
|
||||||
bglTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_ARB, GL_REPLACE);
|
|
||||||
bglTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_PREVIOUS_ARB);
|
|
||||||
bglTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA);
|
|
||||||
|
|
||||||
bglTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, 2.0f);
|
|
||||||
|
|
||||||
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
|
|
||||||
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void polymost_setupglowtexture(int32_t *texunits, int32_t tex)
|
|
||||||
{
|
|
||||||
bglActiveTextureARB(++*texunits);
|
|
||||||
|
|
||||||
bglEnable(GL_TEXTURE_2D);
|
|
||||||
bglBindTexture(GL_TEXTURE_2D, tex);
|
|
||||||
|
|
||||||
bglTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
|
|
||||||
bglTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_INTERPOLATE_ARB);
|
|
||||||
|
|
||||||
bglTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_PREVIOUS_ARB);
|
|
||||||
bglTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, GL_SRC_COLOR);
|
|
||||||
|
|
||||||
bglTexEnvf(GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, GL_TEXTURE);
|
|
||||||
bglTexEnvf(GL_TEXTURE_ENV, GL_OPERAND1_RGB_ARB, GL_SRC_COLOR);
|
|
||||||
|
|
||||||
bglTexEnvf(GL_TEXTURE_ENV, GL_SOURCE2_RGB_ARB, GL_TEXTURE);
|
|
||||||
bglTexEnvf(GL_TEXTURE_ENV, GL_OPERAND2_RGB_ARB, GL_ONE_MINUS_SRC_ALPHA);
|
|
||||||
|
|
||||||
bglTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_ARB, GL_REPLACE);
|
|
||||||
bglTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_PREVIOUS_ARB);
|
|
||||||
bglTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA);
|
|
||||||
|
|
||||||
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
|
|
||||||
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
|
|
||||||
}
|
|
||||||
#include "texcache.h"
|
#include "texcache.h"
|
||||||
|
|
||||||
|
extern void polymost_setupglowtexture(int32_t texunits, int32_t tex);
|
||||||
|
extern void polymost_setupdetailtexture(int32_t texunits, int32_t tex);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -631,7 +631,7 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
// must be after loadpics(), which inits BUILD's cache
|
// must be after loadpics(), which inits BUILD's cache
|
||||||
|
|
||||||
i = MAXTILES-1;
|
i = MAXTILES-1;
|
||||||
if (tilesizx[i]==0 && tilesizy[i]==0)
|
if (tilesiz[i].x==0 && tilesiz[i].x==0)
|
||||||
{
|
{
|
||||||
static char R[8*16] = { //
|
static char R[8*16] = { //
|
||||||
0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0,
|
0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0,
|
||||||
|
@ -648,7 +648,7 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
|
|
||||||
walock[i] = 255; // permanent tile
|
walock[i] = 255; // permanent tile
|
||||||
picsiz[i] = 5 + (5<<4);
|
picsiz[i] = 5 + (5<<4);
|
||||||
tilesizx[i] = sx; tilesizy[i] = sy;
|
tilesiz[i].x = sx; tilesiz[i].y = sy;
|
||||||
allocache(&waloff[i], sx*sy, &walock[i]);
|
allocache(&waloff[i], sx*sy, &walock[i]);
|
||||||
newtile = (char *)waloff[i];
|
newtile = (char *)waloff[i];
|
||||||
|
|
||||||
|
@ -968,11 +968,11 @@ static void handle_sprite_in_clipboard(int32_t i)
|
||||||
int32_t j, k;
|
int32_t j, k;
|
||||||
|
|
||||||
sprite[i].picnum = temppicnum;
|
sprite[i].picnum = temppicnum;
|
||||||
if (tilesizx[temppicnum] <= 0 || tilesizy[temppicnum] <= 0)
|
if (tilesiz[temppicnum].x <= 0 || tilesiz[temppicnum].y <= 0)
|
||||||
{
|
{
|
||||||
j = 0;
|
j = 0;
|
||||||
for (k=0; k<MAXTILES; k++)
|
for (k=0; k<MAXTILES; k++)
|
||||||
if (tilesizx[k] > 0 && tilesizy[k] > 0)
|
if (tilesiz[k].x > 0 && tilesiz[k].y > 0)
|
||||||
{
|
{
|
||||||
j = k;
|
j = k;
|
||||||
break;
|
break;
|
||||||
|
@ -1313,7 +1313,7 @@ void editinput(void)
|
||||||
correct_ornamented_sprite(i, hit.wall);
|
correct_ornamented_sprite(i, hit.wall);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sprite[i].cstat |= (tilesizy[sprite[i].picnum]>=32);
|
sprite[i].cstat |= (tilesiz[sprite[i].picnum].y>=32);
|
||||||
|
|
||||||
correct_sprite_yoffset(i);
|
correct_sprite_yoffset(i);
|
||||||
|
|
||||||
|
@ -2175,7 +2175,7 @@ static int32_t insert_sprite_common(int32_t sectnum, int32_t dax, int32_t day)
|
||||||
void correct_sprite_yoffset(int32_t i)
|
void correct_sprite_yoffset(int32_t i)
|
||||||
{
|
{
|
||||||
int32_t tileyofs = picanm[sprite[i].picnum].yofs;
|
int32_t tileyofs = picanm[sprite[i].picnum].yofs;
|
||||||
int32_t tileysiz = tilesizy[sprite[i].picnum];
|
int32_t tileysiz = tilesiz[sprite[i].picnum].y;
|
||||||
|
|
||||||
if (klabs(tileyofs) >= tileysiz)
|
if (klabs(tileyofs) >= tileysiz)
|
||||||
{
|
{
|
||||||
|
@ -6567,7 +6567,7 @@ end_join_sectors:
|
||||||
}
|
}
|
||||||
else handle_sprite_in_clipboard(i);
|
else handle_sprite_in_clipboard(i);
|
||||||
|
|
||||||
if (tilesizy[sprite[i].picnum] >= 32)
|
if (tilesiz[sprite[i].picnum].y >= 32)
|
||||||
sprite[i].cstat |= 1;
|
sprite[i].cstat |= 1;
|
||||||
|
|
||||||
correct_sprite_yoffset(i);
|
correct_sprite_yoffset(i);
|
||||||
|
@ -10512,14 +10512,14 @@ static void AlignWalls_(int32_t tilenum, int32_t z0, int32_t z1, int32_t doxpann
|
||||||
{
|
{
|
||||||
int32_t n;
|
int32_t n;
|
||||||
|
|
||||||
if (tilesizx[tilenum]==0 || tilesizy[tilenum]==0)
|
if (tilesiz[tilenum].x==0 || tilesiz[tilenum].y==0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//do the x alignment
|
//do the x alignment
|
||||||
if (doxpanning)
|
if (doxpanning)
|
||||||
wall[w1_pan].xpanning = (uint8_t)((wall[w0_pan].xpanning + (wall[w0_rep].xrepeat<<3))%tilesizx[tilenum]);
|
wall[w1_pan].xpanning = (uint8_t)((wall[w0_pan].xpanning + (wall[w0_rep].xrepeat<<3))%tilesiz[tilenum].x);
|
||||||
|
|
||||||
for (n=picsiz[tilenum]>>4; (1<<n)<tilesizy[tilenum]; n++);
|
for (n=picsiz[tilenum]>>4; (1<<n)<tilesiz[tilenum].y; n++);
|
||||||
|
|
||||||
wall[w1_rep].yrepeat = wall[w0_rep].yrepeat;
|
wall[w1_rep].yrepeat = wall[w0_rep].yrepeat;
|
||||||
wall[w1_pan].ypanning = (uint8_t)(wall[w0_pan].ypanning + (((z1-z0)*wall[w0_rep].yrepeat)>>(n+3)));
|
wall[w1_pan].ypanning = (uint8_t)(wall[w0_pan].ypanning + (((z1-z0)*wall[w0_rep].yrepeat)>>(n+3)));
|
||||||
|
|
|
@ -171,7 +171,7 @@ static int32_t check_tile(const char *defcmd, int32_t tile, const scriptfile *sc
|
||||||
|
|
||||||
static void tile_from_truecolpic(int32_t tile, const palette_t *picptr, int32_t alphacut)
|
static void tile_from_truecolpic(int32_t tile, const palette_t *picptr, int32_t alphacut)
|
||||||
{
|
{
|
||||||
const int32_t xsiz = tilesizx[tile], ysiz = tilesizy[tile];
|
const int32_t xsiz = tilesiz[tile].x, ysiz = tilesiz[tile].y;
|
||||||
int32_t i, j;
|
int32_t i, j;
|
||||||
|
|
||||||
char *ftd = (char *)Xmalloc(xsiz*ysiz);
|
char *ftd = (char *)Xmalloc(xsiz*ysiz);
|
||||||
|
|
|
@ -205,8 +205,7 @@ static int32_t lastageclock;
|
||||||
// necessary (have per-map ART files).
|
// necessary (have per-map ART files).
|
||||||
static uint8_t *g_bakTileFileNum;
|
static uint8_t *g_bakTileFileNum;
|
||||||
static int32_t *g_bakTileFileOffs;
|
static int32_t *g_bakTileFileOffs;
|
||||||
static int16_t *g_bakTileSizX;
|
static vec2_t *g_bakTileSiz;
|
||||||
static int16_t *g_bakTileSizY;
|
|
||||||
static picanm_t *g_bakPicAnm;
|
static picanm_t *g_bakPicAnm;
|
||||||
// NOTE: picsiz[] is not backed up, but recalculated when necessary.
|
// NOTE: picsiz[] is not backed up, but recalculated when necessary.
|
||||||
|
|
||||||
|
@ -2280,7 +2279,7 @@ int32_t xb1[MAXWALLSB]; // Polymost uses this as a temp array
|
||||||
static int32_t yb1[MAXWALLSB], xb2[MAXWALLSB], yb2[MAXWALLSB];
|
static int32_t yb1[MAXWALLSB], xb2[MAXWALLSB], yb2[MAXWALLSB];
|
||||||
int32_t rx1[MAXWALLSB], ry1[MAXWALLSB];
|
int32_t rx1[MAXWALLSB], ry1[MAXWALLSB];
|
||||||
static int32_t rx2[MAXWALLSB], ry2[MAXWALLSB];
|
static int32_t rx2[MAXWALLSB], ry2[MAXWALLSB];
|
||||||
int16_t p2[MAXWALLSB], thesector[MAXWALLSB];
|
int16_t bunchp2[MAXWALLSB], thesector[MAXWALLSB];
|
||||||
|
|
||||||
int16_t bunchfirst[MAXWALLSB], bunchlast[MAXWALLSB];
|
int16_t bunchfirst[MAXWALLSB], bunchlast[MAXWALLSB];
|
||||||
|
|
||||||
|
@ -2570,8 +2569,9 @@ int32_t engine_addtsprite(int16_t z, int16_t sectnum)
|
||||||
//
|
//
|
||||||
static void scansector(int16_t startsectnum)
|
static void scansector(int16_t startsectnum)
|
||||||
{
|
{
|
||||||
int32_t xp1, yp1, xp2=0, yp2=0, tempint;
|
int32_t tempint;
|
||||||
int32_t sectorbordercnt;
|
int32_t sectorbordercnt;
|
||||||
|
vec2_t p1, p2 ={ 0, 0 };
|
||||||
|
|
||||||
if (startsectnum < 0)
|
if (startsectnum < 0)
|
||||||
return;
|
return;
|
||||||
|
@ -2635,73 +2635,71 @@ static void scansector(int16_t startsectnum)
|
||||||
|
|
||||||
if ((z == startwall) || (wall[z-1].point2 != z))
|
if ((z == startwall) || (wall[z-1].point2 != z))
|
||||||
{
|
{
|
||||||
xp1 = dmulscale6(y1,cosglobalang,-x1,singlobalang);
|
p1.x = dmulscale6(y1,cosglobalang,-x1,singlobalang);
|
||||||
yp1 = dmulscale6(x1,cosviewingrangeglobalang,y1,sinviewingrangeglobalang);
|
p1.y = dmulscale6(x1,cosviewingrangeglobalang,y1,sinviewingrangeglobalang);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
p1 = p2;
|
||||||
xp1 = xp2;
|
|
||||||
yp1 = yp2;
|
p2.x = dmulscale6(y2,cosglobalang,-x2,singlobalang);
|
||||||
}
|
p2.y = dmulscale6(x2,cosviewingrangeglobalang,y2,sinviewingrangeglobalang);
|
||||||
xp2 = dmulscale6(y2,cosglobalang,-x2,singlobalang);
|
if ((p1.y < 256) && (p2.y < 256)) goto skipitaddwall;
|
||||||
yp2 = dmulscale6(x2,cosviewingrangeglobalang,y2,sinviewingrangeglobalang);
|
|
||||||
if ((yp1 < 256) && (yp2 < 256)) goto skipitaddwall;
|
|
||||||
|
|
||||||
//If wall's NOT facing you
|
//If wall's NOT facing you
|
||||||
if (dmulscale32(xp1,yp2,-xp2,yp1) >= 0) goto skipitaddwall;
|
if (dmulscale32(p1.x, p2.y,-p2.x, p1.y) >= 0) goto skipitaddwall;
|
||||||
|
|
||||||
if (xp1 >= -yp1)
|
if (p1.x >= -p1.y)
|
||||||
{
|
{
|
||||||
if ((xp1 > yp1) || (yp1 == 0)) goto skipitaddwall;
|
if ((p1.x > p1.y) || (p1.y == 0)) goto skipitaddwall;
|
||||||
xb1[numscans] = halfxdimen + scale(xp1,halfxdimen,yp1);
|
xb1[numscans] = halfxdimen + scale(p1.x,halfxdimen,p1.y);
|
||||||
if (xp1 >= 0) xb1[numscans]++; //Fix for SIGNED divide
|
if (p1.x >= 0) xb1[numscans]++; //Fix for SIGNED divide
|
||||||
if (xb1[numscans] >= xdimen) xb1[numscans] = xdimen-1;
|
if (xb1[numscans] >= xdimen) xb1[numscans] = xdimen-1;
|
||||||
yb1[numscans] = yp1;
|
yb1[numscans] = p1.y;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (xp2 < -yp2) goto skipitaddwall;
|
if (p2.x < -p2.y) goto skipitaddwall;
|
||||||
xb1[numscans] = 0;
|
xb1[numscans] = 0;
|
||||||
tempint = yp1-yp2+xp1-xp2;
|
tempint = (p1.x + p1.y) - (p2.x + p2.y);
|
||||||
if (tempint == 0) goto skipitaddwall;
|
if (tempint == 0) goto skipitaddwall;
|
||||||
yb1[numscans] = yp1 + scale(yp2-yp1,xp1+yp1,tempint);
|
yb1[numscans] = p1.y + scale(p2.y-p1.y,p1.x+p1.y,tempint);
|
||||||
}
|
}
|
||||||
if (yb1[numscans] < 256) goto skipitaddwall;
|
if (yb1[numscans] < 256) goto skipitaddwall;
|
||||||
|
|
||||||
if (xp2 <= yp2)
|
if (p2.x <= p2.y)
|
||||||
{
|
{
|
||||||
if ((xp2 < -yp2) || (yp2 == 0)) goto skipitaddwall;
|
if ((p2.x < -p2.y) || (p2.y == 0)) goto skipitaddwall;
|
||||||
xb2[numscans] = halfxdimen + scale(xp2,halfxdimen,yp2) - 1;
|
xb2[numscans] = halfxdimen + scale(p2.x,halfxdimen,p2.y) - 1;
|
||||||
if (xp2 >= 0) xb2[numscans]++; //Fix for SIGNED divide
|
if (p2.x >= 0) xb2[numscans]++; //Fix for SIGNED divide
|
||||||
if (xb2[numscans] >= xdimen) xb2[numscans] = xdimen-1;
|
if (xb2[numscans] >= xdimen) xb2[numscans] = xdimen-1;
|
||||||
yb2[numscans] = yp2;
|
yb2[numscans] = p2.y;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (xp1 > yp1) goto skipitaddwall;
|
if (p1.x > p1.y) goto skipitaddwall;
|
||||||
xb2[numscans] = xdimen-1;
|
xb2[numscans] = xdimen-1;
|
||||||
tempint = xp2-xp1+yp1-yp2;
|
tempint = (p1.y - p1.x) + (p2.x - p2.y);
|
||||||
if (tempint == 0) goto skipitaddwall;
|
if (tempint == 0) goto skipitaddwall;
|
||||||
yb2[numscans] = yp1 + scale(yp2-yp1,yp1-xp1,tempint);
|
yb2[numscans] = p1.y + scale(p2.y-p1.y,p1.y-p1.x,tempint);
|
||||||
}
|
}
|
||||||
if ((yb2[numscans] < 256) || (xb1[numscans] > xb2[numscans])) goto skipitaddwall;
|
if ((yb2[numscans] < 256) || (xb1[numscans] > xb2[numscans])) goto skipitaddwall;
|
||||||
|
|
||||||
//Made it all the way!
|
//Made it all the way!
|
||||||
thesector[numscans] = sectnum; thewall[numscans] = z;
|
thesector[numscans] = sectnum; thewall[numscans] = z;
|
||||||
rx1[numscans] = xp1; ry1[numscans] = yp1;
|
rx1[numscans] = p1.x; ry1[numscans] = p1.y;
|
||||||
rx2[numscans] = xp2; ry2[numscans] = yp2;
|
rx2[numscans] = p2.x; ry2[numscans] = p2.y;
|
||||||
p2[numscans] = numscans+1;
|
bunchp2[numscans] = numscans+1;
|
||||||
numscans++;
|
numscans++;
|
||||||
skipitaddwall:
|
skipitaddwall:
|
||||||
|
|
||||||
if ((wall[z].point2 < z) && (scanfirst < numscans))
|
if ((wall[z].point2 < z) && (scanfirst < numscans))
|
||||||
p2[numscans-1] = scanfirst, scanfirst = numscans;
|
bunchp2[numscans-1] = scanfirst, scanfirst = numscans;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (z=numscansbefore; z<numscans; z++)
|
for (z=numscansbefore; z<numscans; z++)
|
||||||
if ((wall[thewall[z]].point2 != thewall[p2[z]]) || (xb2[z] >= xb1[p2[z]]))
|
if ((wall[thewall[z]].point2 != thewall[bunchp2[z]]) || (xb2[z] >= xb1[bunchp2[z]]))
|
||||||
{
|
{
|
||||||
bunchfirst[numbunches++] = p2[z], p2[z] = -1;
|
bunchfirst[numbunches++] = bunchp2[z], bunchp2[z] = -1;
|
||||||
#ifdef YAX_ENABLE
|
#ifdef YAX_ENABLE
|
||||||
if (scansector_retfast)
|
if (scansector_retfast)
|
||||||
return;
|
return;
|
||||||
|
@ -2711,7 +2709,7 @@ skipitaddwall:
|
||||||
for (z=bunchfrst; z<numbunches; z++)
|
for (z=bunchfrst; z<numbunches; z++)
|
||||||
{
|
{
|
||||||
int32_t zz;
|
int32_t zz;
|
||||||
for (zz=bunchfirst[z]; p2[zz]>=0; zz=p2[zz]);
|
for (zz=bunchfirst[z]; bunchp2[zz]>=0; zz=bunchp2[zz]);
|
||||||
bunchlast[z] = zz;
|
bunchlast[z] = zz;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2723,38 +2721,38 @@ skipitaddwall:
|
||||||
|
|
||||||
#define WSHELPER_DECL inline //ATTRIBUTE((always_inline))
|
#define WSHELPER_DECL inline //ATTRIBUTE((always_inline))
|
||||||
|
|
||||||
static WSHELPER_DECL void tweak_tsizes(int32_t *tsizx, int32_t *tsizy)
|
static WSHELPER_DECL void tweak_tsizes(vec2_t *tsiz)
|
||||||
{
|
{
|
||||||
if (pow2long[picsiz[globalpicnum]&15] == *tsizx)
|
if (pow2long[picsiz[globalpicnum]&15] == tsiz->x)
|
||||||
*tsizx = *tsizx-1;
|
tsiz->x--;
|
||||||
else
|
else
|
||||||
*tsizx = -*tsizx;
|
tsiz->x = -tsiz->x;
|
||||||
|
|
||||||
if (pow2long[picsiz[globalpicnum]>>4] == *tsizy)
|
if (pow2long[picsiz[globalpicnum]>>4] == tsiz->y)
|
||||||
*tsizy = (picsiz[globalpicnum]>>4);
|
tsiz->y = (picsiz[globalpicnum]>>4);
|
||||||
else
|
else
|
||||||
*tsizy = -*tsizy;
|
tsiz->y = -tsiz->y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static WSHELPER_DECL void calc_bufplc(intptr_t *bufplc, int32_t lw, int32_t tsizx, int32_t tsizy)
|
static WSHELPER_DECL void calc_bufplc(intptr_t *bufplc, int32_t lw, vec2_t tsiz)
|
||||||
{
|
{
|
||||||
// CAUTION: lw can be negative!
|
// CAUTION: lw can be negative!
|
||||||
int32_t i = lw + globalxpanning;
|
int32_t i = lw + globalxpanning;
|
||||||
|
|
||||||
// if (i >= tsizx)
|
// if (i >= tsizx)
|
||||||
{
|
{
|
||||||
if (tsizx < 0)
|
if (tsiz.x < 0)
|
||||||
i = (uint32_t)i % -tsizx;
|
i = (uint32_t)i % -tsiz.x;
|
||||||
else
|
else
|
||||||
i &= tsizx;
|
i &= tsiz.x;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tsizy < 0)
|
if (tsiz.y < 0)
|
||||||
i *= -tsizy;
|
i *= -tsiz.y;
|
||||||
else
|
else
|
||||||
i <<= tsizy;
|
i <<= tsiz.y;
|
||||||
|
|
||||||
// Bassert(i >= 0 && i < tilesizx[globalpicnum]*tilesizy[globalpicnum]);
|
// Bassert(i >= 0 && i < tilesiz[globalpicnum].x*tilesiz[globalpicnum].y);
|
||||||
|
|
||||||
// Address is at the first row of tile storage (which is column-major).
|
// Address is at the first row of tile storage (which is column-major).
|
||||||
*bufplc = waloff[globalpicnum] + i;
|
*bufplc = waloff[globalpicnum] + i;
|
||||||
|
@ -2807,24 +2805,25 @@ static void maskwallscan(int32_t x1, int32_t x2, int32_t saturatevplc)
|
||||||
{
|
{
|
||||||
int32_t x;
|
int32_t x;
|
||||||
intptr_t p, fpalookup;
|
intptr_t p, fpalookup;
|
||||||
int32_t y1ve[4], y2ve[4], tsizx, tsizy;
|
int32_t y1ve[4], y2ve[4];
|
||||||
#ifdef MULTI_COLUMN_VLINE
|
#ifdef MULTI_COLUMN_VLINE
|
||||||
char bad;
|
char bad;
|
||||||
int32_t u4, d4, dax, z;
|
int32_t u4, d4, dax, z;
|
||||||
#endif
|
#endif
|
||||||
|
vec2_t tsiz;
|
||||||
setgotpic(globalpicnum);
|
setgotpic(globalpicnum);
|
||||||
if (globalshiftval < 0)
|
if (globalshiftval < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
tsizx = tilesizx[globalpicnum];
|
tsiz = tilesiz[globalpicnum];
|
||||||
tsizy = tilesizy[globalpicnum];
|
|
||||||
if ((tsizx <= 0) || (tsizy <= 0)) return;
|
if ((tsiz.x <= 0) || (tsiz.y <= 0)) return;
|
||||||
if ((uwall[x1] > ydimen) && (uwall[x2] > ydimen)) return;
|
if ((uwall[x1] > ydimen) && (uwall[x2] > ydimen)) return;
|
||||||
if ((dwall[x1] < 0) && (dwall[x2] < 0)) return;
|
if ((dwall[x1] < 0) && (dwall[x2] < 0)) return;
|
||||||
|
|
||||||
if (waloff[globalpicnum] == 0) loadtile(globalpicnum);
|
if (waloff[globalpicnum] == 0) loadtile(globalpicnum);
|
||||||
|
|
||||||
tweak_tsizes(&tsizx, &tsizy);
|
tweak_tsizes(&tsiz);
|
||||||
|
|
||||||
if (palookup[globalpal] == NULL)
|
if (palookup[globalpal] == NULL)
|
||||||
globalpal = 0;
|
globalpal = 0;
|
||||||
|
@ -2854,7 +2853,7 @@ static void maskwallscan(int32_t x1, int32_t x2, int32_t saturatevplc)
|
||||||
|
|
||||||
palookupoffse[0] = fpalookup + getpalookupsh(mulscale16(swall[x],globvis));
|
palookupoffse[0] = fpalookup + getpalookupsh(mulscale16(swall[x],globvis));
|
||||||
|
|
||||||
calc_bufplc(&bufplce[0], lwall[x], tsizx, tsizy);
|
calc_bufplc(&bufplce[0], lwall[x], tsiz);
|
||||||
calc_vplcinc(&vplce[0], &vince[0], swall, x, y1ve[0]);
|
calc_vplcinc(&vplce[0], &vince[0], swall, x, y1ve[0]);
|
||||||
|
|
||||||
mvlineasm1(vince[0],palookupoffse[0],y2ve[0]-y1ve[0]-1,vplce[0],bufplce[0],p+ylookup[y1ve[0]]);
|
mvlineasm1(vince[0],palookupoffse[0],y2ve[0]-y1ve[0]-1,vplce[0],bufplce[0],p+ylookup[y1ve[0]]);
|
||||||
|
@ -2870,7 +2869,7 @@ static void maskwallscan(int32_t x1, int32_t x2, int32_t saturatevplc)
|
||||||
y2ve[z] = min(dwall[dax],startdmost[dax+windowx1]-windowy1)-1;
|
y2ve[z] = min(dwall[dax],startdmost[dax+windowx1]-windowy1)-1;
|
||||||
if (y2ve[z] < y1ve[z]) { bad += pow2char[z]; continue; }
|
if (y2ve[z] < y1ve[z]) { bad += pow2char[z]; continue; }
|
||||||
|
|
||||||
calc_bufplc(&bufplce[z], lwall[dax], tsizx, tsizy);
|
calc_bufplc(&bufplce[z], lwall[dax], tsiz);
|
||||||
calc_vplcinc(&vplce[z], &vince[z], swall, dax, y1ve[z]);
|
calc_vplcinc(&vplce[z], &vince[z], swall, dax, y1ve[z]);
|
||||||
}
|
}
|
||||||
if (bad == 15) continue;
|
if (bad == 15) continue;
|
||||||
|
@ -2927,7 +2926,7 @@ do_mvlineasm1:
|
||||||
|
|
||||||
palookupoffse[0] = fpalookup + getpalookupsh(mulscale16(swall[x],globvis));
|
palookupoffse[0] = fpalookup + getpalookupsh(mulscale16(swall[x],globvis));
|
||||||
|
|
||||||
calc_bufplc(&bufplce[0], lwall[x], tsizx, tsizy);
|
calc_bufplc(&bufplce[0], lwall[x], tsiz);
|
||||||
calc_vplcinc(&vplce[0], &vince[0], swall, x, y1ve[0]);
|
calc_vplcinc(&vplce[0], &vince[0], swall, x, y1ve[0]);
|
||||||
|
|
||||||
#ifdef NONPOW2_YSIZE_ASM
|
#ifdef NONPOW2_YSIZE_ASM
|
||||||
|
@ -3058,10 +3057,10 @@ static inline int32_t bunchfront(int32_t b1, int32_t b2)
|
||||||
|
|
||||||
if (x1b1 >= x1b2)
|
if (x1b1 >= x1b2)
|
||||||
{
|
{
|
||||||
for (i=b2f; xb2[i]<x1b1; i=p2[i]);
|
for (i=b2f; xb2[i]<x1b1; i=bunchp2[i]);
|
||||||
return(wallfront(b1f,i));
|
return(wallfront(b1f,i));
|
||||||
}
|
}
|
||||||
for (i=b1f; xb2[i]<x1b2; i=p2[i]);
|
for (i=b1f; xb2[i]<x1b2; i=bunchp2[i]);
|
||||||
return(wallfront(i,b2f));
|
return(wallfront(i,b2f));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3527,7 +3526,7 @@ static int32_t setup_globals_cf1(const sectortype *sec, int32_t pal, int32_t zd,
|
||||||
globalpicnum = picnum;
|
globalpicnum = picnum;
|
||||||
if ((unsigned)globalpicnum >= MAXTILES) globalpicnum = 0;
|
if ((unsigned)globalpicnum >= MAXTILES) globalpicnum = 0;
|
||||||
setgotpic(globalpicnum);
|
setgotpic(globalpicnum);
|
||||||
if ((tilesizx[globalpicnum] <= 0) || (tilesizy[globalpicnum] <= 0)) return 1;
|
if ((tilesiz[globalpicnum].x <= 0) || (tilesiz[globalpicnum].y <= 0)) return 1;
|
||||||
DO_TILE_ANIM(globalpicnum, 0);
|
DO_TILE_ANIM(globalpicnum, 0);
|
||||||
|
|
||||||
if (waloff[globalpicnum] == 0) loadtile(globalpicnum);
|
if (waloff[globalpicnum] == 0) loadtile(globalpicnum);
|
||||||
|
@ -3813,7 +3812,8 @@ static void wallscan(int32_t x1, int32_t x2,
|
||||||
{
|
{
|
||||||
int32_t x;
|
int32_t x;
|
||||||
intptr_t fpalookup;
|
intptr_t fpalookup;
|
||||||
int32_t y1ve[4], y2ve[4], tsizx, tsizy;
|
int32_t y1ve[4], y2ve[4];
|
||||||
|
vec2_t tsiz;
|
||||||
#ifdef MULTI_COLUMN_VLINE
|
#ifdef MULTI_COLUMN_VLINE
|
||||||
char bad;
|
char bad;
|
||||||
int32_t u4, d4, z;
|
int32_t u4, d4, z;
|
||||||
|
@ -3830,15 +3830,15 @@ static void wallscan(int32_t x1, int32_t x2,
|
||||||
|
|
||||||
if (x2 >= xdim) x2 = xdim-1;
|
if (x2 >= xdim) x2 = xdim-1;
|
||||||
|
|
||||||
tsizx = tilesizx[globalpicnum];
|
tsiz = tilesiz[globalpicnum];
|
||||||
tsizy = tilesizy[globalpicnum];
|
|
||||||
if ((tsizx <= 0) || (tsizy <= 0)) return;
|
if ((tsiz.x <= 0) || (tsiz.y <= 0)) return;
|
||||||
if ((uwal[x1] > ydimen) && (uwal[x2] > ydimen)) return;
|
if ((uwal[x1] > ydimen) && (uwal[x2] > ydimen)) return;
|
||||||
if ((dwal[x1] < 0) && (dwal[x2] < 0)) return;
|
if ((dwal[x1] < 0) && (dwal[x2] < 0)) return;
|
||||||
|
|
||||||
if (waloff[globalpicnum] == 0) loadtile(globalpicnum);
|
if (waloff[globalpicnum] == 0) loadtile(globalpicnum);
|
||||||
|
|
||||||
tweak_tsizes(&tsizx, &tsizy);
|
tweak_tsizes(&tsiz);
|
||||||
|
|
||||||
fpalookup = FP_OFF(palookup[globalpal]);
|
fpalookup = FP_OFF(palookup[globalpal]);
|
||||||
|
|
||||||
|
@ -3862,7 +3862,7 @@ static void wallscan(int32_t x1, int32_t x2,
|
||||||
|
|
||||||
palookupoffse[0] = fpalookup + getpalookupsh(mulscale16(swal[x],globvis));
|
palookupoffse[0] = fpalookup + getpalookupsh(mulscale16(swal[x],globvis));
|
||||||
|
|
||||||
calc_bufplc(&bufplce[0], lwal[x], tsizx, tsizy);
|
calc_bufplc(&bufplce[0], lwal[x], tsiz);
|
||||||
calc_vplcinc(&vplce[0], &vince[0], swal, x, y1ve[0]);
|
calc_vplcinc(&vplce[0], &vince[0], swal, x, y1ve[0]);
|
||||||
|
|
||||||
vlineasm1(vince[0],palookupoffse[0],y2ve[0]-y1ve[0]-1,vplce[0],bufplce[0],x+frameoffset+ylookup[y1ve[0]]);
|
vlineasm1(vince[0],palookupoffse[0],y2ve[0]-y1ve[0]-1,vplce[0],bufplce[0],x+frameoffset+ylookup[y1ve[0]]);
|
||||||
|
@ -3876,7 +3876,7 @@ static void wallscan(int32_t x1, int32_t x2,
|
||||||
y2ve[z] = min(dwal[x+z],dmost[x+z])-1;
|
y2ve[z] = min(dwal[x+z],dmost[x+z])-1;
|
||||||
if (y2ve[z] < y1ve[z]) { bad += pow2char[z]; continue; }
|
if (y2ve[z] < y1ve[z]) { bad += pow2char[z]; continue; }
|
||||||
|
|
||||||
calc_bufplc(&bufplce[z], lwal[x+z], tsizx, tsizy);
|
calc_bufplc(&bufplce[z], lwal[x+z], tsiz);
|
||||||
calc_vplcinc(&vplce[z], &vince[z], swal, x+z, y1ve[z]);
|
calc_vplcinc(&vplce[z], &vince[z], swal, x+z, y1ve[z]);
|
||||||
}
|
}
|
||||||
if (bad == 15) continue;
|
if (bad == 15) continue;
|
||||||
|
@ -3933,7 +3933,7 @@ do_vlineasm1:
|
||||||
|
|
||||||
palookupoffse[0] = fpalookup + getpalookupsh(mulscale16(swal[x],globvis));
|
palookupoffse[0] = fpalookup + getpalookupsh(mulscale16(swal[x],globvis));
|
||||||
|
|
||||||
calc_bufplc(&bufplce[0], lwal[x], tsizx, tsizy);
|
calc_bufplc(&bufplce[0], lwal[x], tsiz);
|
||||||
calc_vplcinc(&vplce[0], &vince[0], swal, x, y1ve[0]);
|
calc_vplcinc(&vplce[0], &vince[0], swal, x, y1ve[0]);
|
||||||
|
|
||||||
#ifdef NONPOW2_YSIZE_ASM
|
#ifdef NONPOW2_YSIZE_ASM
|
||||||
|
@ -3958,6 +3958,8 @@ static void transmaskvline(int32_t x)
|
||||||
intptr_t bufplc,p;
|
intptr_t bufplc,p;
|
||||||
int32_t y1v, y2v;
|
int32_t y1v, y2v;
|
||||||
|
|
||||||
|
vec2_t ntsiz;
|
||||||
|
|
||||||
if ((x < 0) || (x >= xdimen)) return;
|
if ((x < 0) || (x >= xdimen)) return;
|
||||||
|
|
||||||
y1v = max(uwall[x],startumost[x+windowx1]-windowy1);
|
y1v = max(uwall[x],startumost[x+windowx1]-windowy1);
|
||||||
|
@ -3967,7 +3969,9 @@ static void transmaskvline(int32_t x)
|
||||||
|
|
||||||
palookupoffs = FP_OFF(palookup[globalpal]) + getpalookupsh(mulscale16(swall[x],globvis));
|
palookupoffs = FP_OFF(palookup[globalpal]) + getpalookupsh(mulscale16(swall[x],globvis));
|
||||||
|
|
||||||
calc_bufplc(&bufplc, lwall[x], -tilesizx[globalpicnum], -tilesizy[globalpicnum]);
|
ntsiz.x = -tilesiz[globalpicnum].x;
|
||||||
|
ntsiz.y = -tilesiz[globalpicnum].y;
|
||||||
|
calc_bufplc(&bufplc, lwall[x], ntsiz);
|
||||||
calc_vplcinc(&vplc, &vinc, swall, x, y1v);
|
calc_vplcinc(&vplc, &vinc, swall, x, y1v);
|
||||||
|
|
||||||
p = ylookup[y1v]+x+frameoffset;
|
p = ylookup[y1v]+x+frameoffset;
|
||||||
|
@ -3992,6 +3996,8 @@ static void transmaskvline2(int32_t x)
|
||||||
|
|
||||||
uintptr_t p;
|
uintptr_t p;
|
||||||
|
|
||||||
|
vec2_t ntsiz;
|
||||||
|
|
||||||
if ((x < 0) || (x >= xdimen)) return;
|
if ((x < 0) || (x >= xdimen)) return;
|
||||||
if (x == xdimen-1) { transmaskvline(x); return; }
|
if (x == xdimen-1) { transmaskvline(x); return; }
|
||||||
|
|
||||||
|
@ -4009,8 +4015,11 @@ static void transmaskvline2(int32_t x)
|
||||||
|
|
||||||
setuptvlineasm2(globalshiftval,palookupoffse[0],palookupoffse[1]);
|
setuptvlineasm2(globalshiftval,palookupoffse[0],palookupoffse[1]);
|
||||||
|
|
||||||
calc_bufplc(&bufplce[0], lwall[x], -tilesizx[globalpicnum], -tilesizy[globalpicnum]);
|
ntsiz.x = -tilesiz[globalpicnum].x;
|
||||||
calc_bufplc(&bufplce[1], lwall[x2], -tilesizx[globalpicnum], -tilesizy[globalpicnum]);
|
ntsiz.y = -tilesiz[globalpicnum].y;
|
||||||
|
|
||||||
|
calc_bufplc(&bufplce[0], lwall[x], ntsiz);
|
||||||
|
calc_bufplc(&bufplce[1], lwall[x2], ntsiz);
|
||||||
calc_vplcinc(&vplce[0], &vince[0], swall, x, y1ve[0]);
|
calc_vplcinc(&vplce[0], &vince[0], swall, x, y1ve[0]);
|
||||||
calc_vplcinc(&vplce[1], &vince[1], swall, x2, y1ve[1]);
|
calc_vplcinc(&vplce[1], &vince[1], swall, x2, y1ve[1]);
|
||||||
|
|
||||||
|
@ -4057,9 +4066,9 @@ static void transmaskwallscan(int32_t x1, int32_t x2, int32_t saturatevplc)
|
||||||
|
|
||||||
setgotpic(globalpicnum);
|
setgotpic(globalpicnum);
|
||||||
|
|
||||||
Bassert(globalshiftval>=0 || ((tilesizx[globalpicnum] <= 0) || (tilesizy[globalpicnum] <= 0)));
|
Bassert(globalshiftval>=0 || ((tilesiz[globalpicnum].x <= 0) || (tilesiz[globalpicnum].y <= 0)));
|
||||||
// globalshiftval<0 implies following condition
|
// globalshiftval<0 implies following condition
|
||||||
if ((tilesizx[globalpicnum] <= 0) || (tilesizy[globalpicnum] <= 0))
|
if ((tilesiz[globalpicnum].x <= 0) || (tilesiz[globalpicnum].y <= 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (waloff[globalpicnum] == 0) loadtile(globalpicnum);
|
if (waloff[globalpicnum] == 0) loadtile(globalpicnum);
|
||||||
|
@ -4335,7 +4344,7 @@ static void grouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat)
|
||||||
|
|
||||||
DO_TILE_ANIM(globalpicnum, sectnum);
|
DO_TILE_ANIM(globalpicnum, sectnum);
|
||||||
setgotpic(globalpicnum);
|
setgotpic(globalpicnum);
|
||||||
if ((tilesizx[globalpicnum] <= 0) || (tilesizy[globalpicnum] <= 0)) return;
|
if ((tilesiz[globalpicnum].x <= 0) || (tilesiz[globalpicnum].y <= 0)) return;
|
||||||
if (waloff[globalpicnum] == 0) loadtile(globalpicnum);
|
if (waloff[globalpicnum] == 0) loadtile(globalpicnum);
|
||||||
|
|
||||||
wal = &wall[sec->wallptr];
|
wal = &wall[sec->wallptr];
|
||||||
|
@ -4520,7 +4529,7 @@ static void parascan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat, i
|
||||||
DO_TILE_ANIM(globalpicnum, sectnum);
|
DO_TILE_ANIM(globalpicnum, sectnum);
|
||||||
|
|
||||||
logtilesizy = (picsiz[globalpicnum]>>4);
|
logtilesizy = (picsiz[globalpicnum]>>4);
|
||||||
tsizy = tilesizy[globalpicnum];
|
tsizy = tilesiz[globalpicnum].y;
|
||||||
|
|
||||||
if (tsizy==0)
|
if (tsizy==0)
|
||||||
return;
|
return;
|
||||||
|
@ -4566,7 +4575,7 @@ static void parascan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat, i
|
||||||
|
|
||||||
x = -1;
|
x = -1;
|
||||||
|
|
||||||
for (z=bunchfirst[bunch]; z>=0; z=p2[z])
|
for (z=bunchfirst[bunch]; z>=0; z=bunchp2[z])
|
||||||
{
|
{
|
||||||
wallnum = thewall[z]; nextsectnum = wall[wallnum].nextsector;
|
wallnum = thewall[z]; nextsectnum = wall[wallnum].nextsector;
|
||||||
|
|
||||||
|
@ -4681,7 +4690,7 @@ static void setup_globals_wall1(const walltype *wal, int32_t dapicnum)
|
||||||
static void setup_globals_wall2(const walltype *wal, uint8_t secvisibility, int32_t topzref, int32_t botzref)
|
static void setup_globals_wall2(const walltype *wal, uint8_t secvisibility, int32_t topzref, int32_t botzref)
|
||||||
{
|
{
|
||||||
const int32_t logtilesizy = (picsiz[globalpicnum]>>4);
|
const int32_t logtilesizy = (picsiz[globalpicnum]>>4);
|
||||||
const int32_t tsizy = tilesizy[globalpicnum];
|
const int32_t tsizy = tilesiz[globalpicnum].y;
|
||||||
|
|
||||||
if (tsizy==0)
|
if (tsizy==0)
|
||||||
{
|
{
|
||||||
|
@ -4787,7 +4796,7 @@ static void drawalls(int32_t bunch)
|
||||||
sectnum = thesector[z]; sec = §or[sectnum];
|
sectnum = thesector[z]; sec = §or[sectnum];
|
||||||
|
|
||||||
andwstat1 = 0xff; andwstat2 = 0xff;
|
andwstat1 = 0xff; andwstat2 = 0xff;
|
||||||
for (; z>=0; z=p2[z]) //uplc/dplc calculation
|
for (; z>=0; z=bunchp2[z]) //uplc/dplc calculation
|
||||||
{
|
{
|
||||||
andwstat1 &= wallmost(uplc,z,sectnum,(uint8_t)0);
|
andwstat1 &= wallmost(uplc,z,sectnum,(uint8_t)0);
|
||||||
andwstat2 &= wallmost(dplc,z,sectnum,(uint8_t)1);
|
andwstat2 &= wallmost(dplc,z,sectnum,(uint8_t)1);
|
||||||
|
@ -4890,7 +4899,7 @@ static void drawalls(int32_t bunch)
|
||||||
|
|
||||||
|
|
||||||
//DRAW WALLS SECTION!
|
//DRAW WALLS SECTION!
|
||||||
for (z=bunchfirst[bunch]; z>=0; z=p2[z])
|
for (z=bunchfirst[bunch]; z>=0; z=bunchp2[z])
|
||||||
{
|
{
|
||||||
x1 = xb1[z]; x2 = xb2[z];
|
x1 = xb1[z]; x2 = xb2[z];
|
||||||
if (umost[x2] >= dmost[x2])
|
if (umost[x2] >= dmost[x2])
|
||||||
|
@ -5538,14 +5547,14 @@ static void setup_globals_sprite1(const spritetype *tspr, const sectortype *sec,
|
||||||
globalpicnum = tilenum;
|
globalpicnum = tilenum;
|
||||||
if ((unsigned)globalpicnum >= MAXTILES) globalpicnum = 0;
|
if ((unsigned)globalpicnum >= MAXTILES) globalpicnum = 0;
|
||||||
// sprite panning
|
// sprite panning
|
||||||
globalxpanning = (((256-spriteext[tspr->owner].xpanning)&255) * tilesizx[globalpicnum])>>8;
|
globalxpanning = (((256-spriteext[tspr->owner].xpanning)&255) * tilesiz[globalpicnum].x)>>8;
|
||||||
globalypanning = 0;
|
globalypanning = 0;
|
||||||
|
|
||||||
globvis = globalvisibility;
|
globvis = globalvisibility;
|
||||||
if (sec->visibility != 0) globvis = mulscale4(globvis, (uint8_t)(sec->visibility+16));
|
if (sec->visibility != 0) globvis = mulscale4(globvis, (uint8_t)(sec->visibility+16));
|
||||||
|
|
||||||
logtilesizy = (picsiz[globalpicnum]>>4);
|
logtilesizy = (picsiz[globalpicnum]>>4);
|
||||||
tsizy = tilesizy[globalpicnum];
|
tsizy = tilesiz[globalpicnum].y;
|
||||||
|
|
||||||
globalshiftval = logtilesizy;
|
globalshiftval = logtilesizy;
|
||||||
#if !defined CLASSIC_NONPOW2_YSIZE_SPRITES
|
#if !defined CLASSIC_NONPOW2_YSIZE_SPRITES
|
||||||
|
@ -5674,7 +5683,7 @@ static void drawsprite_classic(int32_t snum)
|
||||||
|
|
||||||
if ((cstat&48) != 48)
|
if ((cstat&48) != 48)
|
||||||
{
|
{
|
||||||
if (spritenum < 0 || tilesizx[tilenum] <= 0 || tilesizy[tilenum] <= 0)
|
if (spritenum < 0 || tilesiz[tilenum].x <= 0 || tilesiz[tilenum].y <= 0)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5704,12 +5713,12 @@ draw_as_face_sprite:
|
||||||
|
|
||||||
xv = mulscale16(((int32_t)tspr->xrepeat)<<16,xyaspect);
|
xv = mulscale16(((int32_t)tspr->xrepeat)<<16,xyaspect);
|
||||||
|
|
||||||
xspan = tilesizx[tilenum];
|
xspan = tilesiz[tilenum].x;
|
||||||
yspan = tilesizy[tilenum];
|
yspan = tilesiz[tilenum].y;
|
||||||
xsiz = mulscale30(siz,xv*xspan);
|
xsiz = mulscale30(siz,xv*xspan);
|
||||||
ysiz = mulscale14(siz,tspr->yrepeat*yspan);
|
ysiz = mulscale14(siz,tspr->yrepeat*yspan);
|
||||||
|
|
||||||
if ((tilesizx[tilenum]>>11) >= xsiz || yspan >= (ysiz>>1))
|
if ((tilesiz[tilenum].x>>11) >= xsiz || yspan >= (ysiz>>1))
|
||||||
return; //Watch out for divscale overflow
|
return; //Watch out for divscale overflow
|
||||||
|
|
||||||
x1 = xb-(xsiz>>1);
|
x1 = xb-(xsiz>>1);
|
||||||
|
@ -5858,7 +5867,7 @@ draw_as_face_sprite:
|
||||||
if ((cstat&4) > 0) xoff = -xoff;
|
if ((cstat&4) > 0) xoff = -xoff;
|
||||||
if ((cstat&8) > 0) yoff = -yoff;
|
if ((cstat&8) > 0) yoff = -yoff;
|
||||||
|
|
||||||
xspan = tilesizx[tilenum]; yspan = tilesizy[tilenum];
|
xspan = tilesiz[tilenum].x; yspan = tilesiz[tilenum].y;
|
||||||
xv = tspr->xrepeat*sintable[(tspr->ang+2560+1536)&2047];
|
xv = tspr->xrepeat*sintable[(tspr->ang+2560+1536)&2047];
|
||||||
yv = tspr->xrepeat*sintable[(tspr->ang+2048+1536)&2047];
|
yv = tspr->xrepeat*sintable[(tspr->ang+2048+1536)&2047];
|
||||||
i = (xspan>>1)+xoff;
|
i = (xspan>>1)+xoff;
|
||||||
|
@ -6124,8 +6133,8 @@ draw_as_face_sprite:
|
||||||
|
|
||||||
if ((cstat&4) > 0) xoff = -xoff;
|
if ((cstat&4) > 0) xoff = -xoff;
|
||||||
if ((cstat&8) > 0) yoff = -yoff;
|
if ((cstat&8) > 0) yoff = -yoff;
|
||||||
xspan = tilesizx[tilenum];
|
xspan = tilesiz[tilenum].x;
|
||||||
yspan = tilesizy[tilenum];
|
yspan = tilesiz[tilenum].y;
|
||||||
|
|
||||||
//Rotate center point
|
//Rotate center point
|
||||||
dax = tspr->x-globalposx;
|
dax = tspr->x-globalposx;
|
||||||
|
@ -6930,7 +6939,7 @@ static int32_t clippoly(int32_t npoints, int32_t clipstat)
|
||||||
{
|
{
|
||||||
rx2[npoints2] = addscaleclamp(rx1[z], rx1[zz]-rx1[z], s1, s2);
|
rx2[npoints2] = addscaleclamp(rx1[z], rx1[zz]-rx1[z], s1, s2);
|
||||||
ry2[npoints2] = addscaleclamp(ry1[z], ry1[zz]-ry1[z], s1, s2);
|
ry2[npoints2] = addscaleclamp(ry1[z], ry1[zz]-ry1[z], s1, s2);
|
||||||
if (s1 < 0) p2[splitcnt++] = npoints2;
|
if (s1 < 0) bunchp2[splitcnt++] = npoints2;
|
||||||
xb2[npoints2] = npoints2+1;
|
xb2[npoints2] = npoints2+1;
|
||||||
npoints2++;
|
npoints2++;
|
||||||
}
|
}
|
||||||
|
@ -6952,13 +6961,13 @@ static int32_t clippoly(int32_t npoints, int32_t clipstat)
|
||||||
for (z=1; z<splitcnt; z++)
|
for (z=1; z<splitcnt; z++)
|
||||||
for (zz=0; zz<z; zz++)
|
for (zz=0; zz<z; zz++)
|
||||||
{
|
{
|
||||||
z1 = p2[z]; z2 = xb2[z1]; z3 = p2[zz]; z4 = xb2[z3];
|
z1 = bunchp2[z]; z2 = xb2[z1]; z3 = bunchp2[zz]; z4 = xb2[z3];
|
||||||
s1 = klabs(rx2[z1]-rx2[z2])+klabs(ry2[z1]-ry2[z2]);
|
s1 = klabs(rx2[z1]-rx2[z2])+klabs(ry2[z1]-ry2[z2]);
|
||||||
s1 += klabs(rx2[z3]-rx2[z4])+klabs(ry2[z3]-ry2[z4]);
|
s1 += klabs(rx2[z3]-rx2[z4])+klabs(ry2[z3]-ry2[z4]);
|
||||||
s2 = klabs(rx2[z1]-rx2[z4])+klabs(ry2[z1]-ry2[z4]);
|
s2 = klabs(rx2[z1]-rx2[z4])+klabs(ry2[z1]-ry2[z4]);
|
||||||
s2 += klabs(rx2[z3]-rx2[z2])+klabs(ry2[z3]-ry2[z2]);
|
s2 += klabs(rx2[z3]-rx2[z2])+klabs(ry2[z3]-ry2[z2]);
|
||||||
if (s2 < s1)
|
if (s2 < s1)
|
||||||
{ t = xb2[p2[z]]; xb2[p2[z]] = xb2[p2[zz]]; xb2[p2[zz]] = t; }
|
{ t = xb2[bunchp2[z]]; xb2[bunchp2[z]] = xb2[bunchp2[zz]]; xb2[bunchp2[zz]] = t; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6979,7 +6988,7 @@ static int32_t clippoly(int32_t npoints, int32_t clipstat)
|
||||||
{
|
{
|
||||||
rx1[npoints] = addscaleclamp(rx2[z], rx2[zz]-rx2[z], s1, s2);
|
rx1[npoints] = addscaleclamp(rx2[z], rx2[zz]-rx2[z], s1, s2);
|
||||||
ry1[npoints] = addscaleclamp(ry2[z], ry2[zz]-ry2[z], s1, s2);
|
ry1[npoints] = addscaleclamp(ry2[z], ry2[zz]-ry2[z], s1, s2);
|
||||||
if (s1 < 0) p2[splitcnt++] = npoints;
|
if (s1 < 0) bunchp2[splitcnt++] = npoints;
|
||||||
xb1[npoints] = npoints+1;
|
xb1[npoints] = npoints+1;
|
||||||
npoints++;
|
npoints++;
|
||||||
}
|
}
|
||||||
|
@ -7001,13 +7010,13 @@ static int32_t clippoly(int32_t npoints, int32_t clipstat)
|
||||||
for (z=1; z<splitcnt; z++)
|
for (z=1; z<splitcnt; z++)
|
||||||
for (zz=0; zz<z; zz++)
|
for (zz=0; zz<z; zz++)
|
||||||
{
|
{
|
||||||
z1 = p2[z]; z2 = xb1[z1]; z3 = p2[zz]; z4 = xb1[z3];
|
z1 = bunchp2[z]; z2 = xb1[z1]; z3 = bunchp2[zz]; z4 = xb1[z3];
|
||||||
s1 = klabs(rx1[z1]-rx1[z2])+klabs(ry1[z1]-ry1[z2]);
|
s1 = klabs(rx1[z1]-rx1[z2])+klabs(ry1[z1]-ry1[z2]);
|
||||||
s1 += klabs(rx1[z3]-rx1[z4])+klabs(ry1[z3]-ry1[z4]);
|
s1 += klabs(rx1[z3]-rx1[z4])+klabs(ry1[z3]-ry1[z4]);
|
||||||
s2 = klabs(rx1[z1]-rx1[z4])+klabs(ry1[z1]-ry1[z4]);
|
s2 = klabs(rx1[z1]-rx1[z4])+klabs(ry1[z1]-ry1[z4]);
|
||||||
s2 += klabs(rx1[z3]-rx1[z2])+klabs(ry1[z3]-ry1[z2]);
|
s2 += klabs(rx1[z3]-rx1[z2])+klabs(ry1[z3]-ry1[z2]);
|
||||||
if (s2 < s1)
|
if (s2 < s1)
|
||||||
{ t = xb1[p2[z]]; xb1[p2[z]] = xb1[p2[zz]]; xb1[p2[zz]] = t; }
|
{ t = xb1[bunchp2[z]]; xb1[bunchp2[z]] = xb1[bunchp2[zz]]; xb1[bunchp2[zz]] = t; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (clipstat&0x5) //Need to clip bottom or right
|
if (clipstat&0x5) //Need to clip bottom or right
|
||||||
|
@ -7029,7 +7038,7 @@ static int32_t clippoly(int32_t npoints, int32_t clipstat)
|
||||||
{
|
{
|
||||||
rx2[npoints2] = addscaleclamp(rx1[z], rx1[zz]-rx1[z], s1, s2);
|
rx2[npoints2] = addscaleclamp(rx1[z], rx1[zz]-rx1[z], s1, s2);
|
||||||
ry2[npoints2] = addscaleclamp(ry1[z], ry1[zz]-ry1[z], s1, s2);
|
ry2[npoints2] = addscaleclamp(ry1[z], ry1[zz]-ry1[z], s1, s2);
|
||||||
if (s1 < 0) p2[splitcnt++] = npoints2;
|
if (s1 < 0) bunchp2[splitcnt++] = npoints2;
|
||||||
xb2[npoints2] = npoints2+1;
|
xb2[npoints2] = npoints2+1;
|
||||||
npoints2++;
|
npoints2++;
|
||||||
}
|
}
|
||||||
|
@ -7051,13 +7060,13 @@ static int32_t clippoly(int32_t npoints, int32_t clipstat)
|
||||||
for (z=1; z<splitcnt; z++)
|
for (z=1; z<splitcnt; z++)
|
||||||
for (zz=0; zz<z; zz++)
|
for (zz=0; zz<z; zz++)
|
||||||
{
|
{
|
||||||
z1 = p2[z]; z2 = xb2[z1]; z3 = p2[zz]; z4 = xb2[z3];
|
z1 = bunchp2[z]; z2 = xb2[z1]; z3 = bunchp2[zz]; z4 = xb2[z3];
|
||||||
s1 = klabs(rx2[z1]-rx2[z2])+klabs(ry2[z1]-ry2[z2]);
|
s1 = klabs(rx2[z1]-rx2[z2])+klabs(ry2[z1]-ry2[z2]);
|
||||||
s1 += klabs(rx2[z3]-rx2[z4])+klabs(ry2[z3]-ry2[z4]);
|
s1 += klabs(rx2[z3]-rx2[z4])+klabs(ry2[z3]-ry2[z4]);
|
||||||
s2 = klabs(rx2[z1]-rx2[z4])+klabs(ry2[z1]-ry2[z4]);
|
s2 = klabs(rx2[z1]-rx2[z4])+klabs(ry2[z1]-ry2[z4]);
|
||||||
s2 += klabs(rx2[z3]-rx2[z2])+klabs(ry2[z3]-ry2[z2]);
|
s2 += klabs(rx2[z3]-rx2[z2])+klabs(ry2[z3]-ry2[z2]);
|
||||||
if (s2 < s1)
|
if (s2 < s1)
|
||||||
{ t = xb2[p2[z]]; xb2[p2[z]] = xb2[p2[zz]]; xb2[p2[zz]] = t; }
|
{ t = xb2[bunchp2[z]]; xb2[bunchp2[z]] = xb2[bunchp2[zz]]; xb2[bunchp2[zz]] = t; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -7078,7 +7087,7 @@ static int32_t clippoly(int32_t npoints, int32_t clipstat)
|
||||||
{
|
{
|
||||||
rx1[npoints] = addscaleclamp(rx2[z], rx2[zz]-rx2[z], s1, s2);
|
rx1[npoints] = addscaleclamp(rx2[z], rx2[zz]-rx2[z], s1, s2);
|
||||||
ry1[npoints] = addscaleclamp(ry2[z], ry2[zz]-ry2[z], s1, s2);
|
ry1[npoints] = addscaleclamp(ry2[z], ry2[zz]-ry2[z], s1, s2);
|
||||||
if (s1 < 0) p2[splitcnt++] = npoints;
|
if (s1 < 0) bunchp2[splitcnt++] = npoints;
|
||||||
xb1[npoints] = npoints+1;
|
xb1[npoints] = npoints+1;
|
||||||
npoints++;
|
npoints++;
|
||||||
}
|
}
|
||||||
|
@ -7100,13 +7109,13 @@ static int32_t clippoly(int32_t npoints, int32_t clipstat)
|
||||||
for (z=1; z<splitcnt; z++)
|
for (z=1; z<splitcnt; z++)
|
||||||
for (zz=0; zz<z; zz++)
|
for (zz=0; zz<z; zz++)
|
||||||
{
|
{
|
||||||
z1 = p2[z]; z2 = xb1[z1]; z3 = p2[zz]; z4 = xb1[z3];
|
z1 = bunchp2[z]; z2 = xb1[z1]; z3 = bunchp2[zz]; z4 = xb1[z3];
|
||||||
s1 = klabs(rx1[z1]-rx1[z2])+klabs(ry1[z1]-ry1[z2]);
|
s1 = klabs(rx1[z1]-rx1[z2])+klabs(ry1[z1]-ry1[z2]);
|
||||||
s1 += klabs(rx1[z3]-rx1[z4])+klabs(ry1[z3]-ry1[z4]);
|
s1 += klabs(rx1[z3]-rx1[z4])+klabs(ry1[z3]-ry1[z4]);
|
||||||
s2 = klabs(rx1[z1]-rx1[z4])+klabs(ry1[z1]-ry1[z4]);
|
s2 = klabs(rx1[z1]-rx1[z4])+klabs(ry1[z1]-ry1[z4]);
|
||||||
s2 += klabs(rx1[z3]-rx1[z2])+klabs(ry1[z3]-ry1[z2]);
|
s2 += klabs(rx1[z3]-rx1[z2])+klabs(ry1[z3]-ry1[z2]);
|
||||||
if (s2 < s1)
|
if (s2 < s1)
|
||||||
{ t = xb1[p2[z]]; xb1[p2[z]] = xb1[p2[zz]]; xb1[p2[zz]] = t; }
|
{ t = xb1[bunchp2[z]]; xb1[bunchp2[z]] = xb1[bunchp2[zz]]; xb1[bunchp2[zz]] = t; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return(npoints);
|
return(npoints);
|
||||||
|
@ -7313,8 +7322,8 @@ static void dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t
|
||||||
if (cx2 > xres-1) cx2 = xres-1;
|
if (cx2 > xres-1) cx2 = xres-1;
|
||||||
if (cy2 > yres-1) cy2 = yres-1;
|
if (cy2 > yres-1) cy2 = yres-1;
|
||||||
|
|
||||||
xsiz = tilesizx[picnum];
|
xsiz = tilesiz[picnum].x;
|
||||||
ysiz = tilesizy[picnum];
|
ysiz = tilesiz[picnum].y;
|
||||||
|
|
||||||
if (dastat & RS_TOPLEFT)
|
if (dastat & RS_TOPLEFT)
|
||||||
{
|
{
|
||||||
|
@ -9469,7 +9478,7 @@ killsprite:
|
||||||
if ((s->cstat&48) != 32)
|
if ((s->cstat&48) != 32)
|
||||||
{
|
{
|
||||||
int32_t yoff = picanm[s->picnum].yofs + s->yoffset;
|
int32_t yoff = picanm[s->picnum].yofs + s->yoffset;
|
||||||
int32_t yspan = (tilesizy[s->picnum]*s->yrepeat<<2);
|
int32_t yspan = (tilesiz[s->picnum].y*s->yrepeat<<2);
|
||||||
|
|
||||||
spritesz[k] -= (yoff*s->yrepeat)<<2;
|
spritesz[k] -= (yoff*s->yrepeat)<<2;
|
||||||
|
|
||||||
|
@ -9527,7 +9536,7 @@ killsprite:
|
||||||
_point2d pos;
|
_point2d pos;
|
||||||
|
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
curpolygonoffset = 0;
|
curpolygonoffset = 0.f;
|
||||||
#endif
|
#endif
|
||||||
pos.x = (float)globalposx;
|
pos.x = (float)globalposx;
|
||||||
pos.y = (float)globalposy;
|
pos.y = (float)globalposy;
|
||||||
|
@ -9805,7 +9814,7 @@ void drawmapview(int32_t dax, int32_t day, int32_t zoome, int16_t ang)
|
||||||
globalpicnum = sec->floorpicnum;
|
globalpicnum = sec->floorpicnum;
|
||||||
if ((unsigned)globalpicnum >= (unsigned)MAXTILES) globalpicnum = 0;
|
if ((unsigned)globalpicnum >= (unsigned)MAXTILES) globalpicnum = 0;
|
||||||
setgotpic(globalpicnum);
|
setgotpic(globalpicnum);
|
||||||
if ((tilesizx[globalpicnum] <= 0) || (tilesizy[globalpicnum] <= 0)) continue;
|
if ((tilesiz[globalpicnum].x <= 0) || (tilesiz[globalpicnum].y <= 0)) continue;
|
||||||
DO_TILE_ANIM(globalpicnum, s);
|
DO_TILE_ANIM(globalpicnum, s);
|
||||||
if (waloff[globalpicnum] == 0) loadtile(globalpicnum);
|
if (waloff[globalpicnum] == 0) loadtile(globalpicnum);
|
||||||
globalbufplc = waloff[globalpicnum];
|
globalbufplc = waloff[globalpicnum];
|
||||||
|
@ -9884,7 +9893,7 @@ void drawmapview(int32_t dax, int32_t day, int32_t zoome, int16_t ang)
|
||||||
y1 = spr->y;
|
y1 = spr->y;
|
||||||
get_floorspr_points(spr, 0, 0, &x1, &x2, &x3, &x4,
|
get_floorspr_points(spr, 0, 0, &x1, &x2, &x3, &x4,
|
||||||
&y1, &y2, &y3, &y4);
|
&y1, &y2, &y3, &y4);
|
||||||
xspan = tilesizx[spr->picnum];
|
xspan = tilesiz[spr->picnum].x;
|
||||||
|
|
||||||
xb1[0] = 1; xb1[1] = 2; xb1[2] = 3; xb1[3] = 0;
|
xb1[0] = 1; xb1[1] = 2; xb1[2] = 3; xb1[3] = 0;
|
||||||
npoints = 4;
|
npoints = 4;
|
||||||
|
@ -9926,7 +9935,7 @@ void drawmapview(int32_t dax, int32_t day, int32_t zoome, int16_t ang)
|
||||||
globalpal = spr->pal; // GL needs this, software doesn't
|
globalpal = spr->pal; // GL needs this, software doesn't
|
||||||
if ((unsigned)globalpicnum >= (unsigned)MAXTILES) globalpicnum = 0;
|
if ((unsigned)globalpicnum >= (unsigned)MAXTILES) globalpicnum = 0;
|
||||||
setgotpic(globalpicnum);
|
setgotpic(globalpicnum);
|
||||||
if ((tilesizx[globalpicnum] <= 0) || (tilesizy[globalpicnum] <= 0)) continue;
|
if ((tilesiz[globalpicnum].x <= 0) || (tilesiz[globalpicnum].y <= 0)) continue;
|
||||||
DO_TILE_ANIM(globalpicnum, s);
|
DO_TILE_ANIM(globalpicnum, s);
|
||||||
if (waloff[globalpicnum] == 0) loadtile(globalpicnum);
|
if (waloff[globalpicnum] == 0) loadtile(globalpicnum);
|
||||||
globalbufplc = waloff[globalpicnum];
|
globalbufplc = waloff[globalpicnum];
|
||||||
|
@ -10065,8 +10074,7 @@ void E_MapArt_Clear(void)
|
||||||
// Restore original per-tile arrays
|
// Restore original per-tile arrays
|
||||||
RESTORE_MAPART_ARRAY(tilefilenum, g_bakTileFileNum);
|
RESTORE_MAPART_ARRAY(tilefilenum, g_bakTileFileNum);
|
||||||
RESTORE_MAPART_ARRAY(tilefileoffs, g_bakTileFileOffs);
|
RESTORE_MAPART_ARRAY(tilefileoffs, g_bakTileFileOffs);
|
||||||
RESTORE_MAPART_ARRAY(tilesizx, g_bakTileSizX);
|
RESTORE_MAPART_ARRAY(tilesiz, g_bakTileSiz);
|
||||||
RESTORE_MAPART_ARRAY(tilesizy, g_bakTileSizY);
|
|
||||||
RESTORE_MAPART_ARRAY(picanm, g_bakPicAnm);
|
RESTORE_MAPART_ARRAY(picanm, g_bakPicAnm);
|
||||||
|
|
||||||
E_RecalcPicSiz();
|
E_RecalcPicSiz();
|
||||||
|
@ -10108,8 +10116,7 @@ void E_MapArt_Setup(const char *filename)
|
||||||
// Allocate backup arrays.
|
// Allocate backup arrays.
|
||||||
ALLOC_MAPART_ARRAY(tilefilenum, g_bakTileFileNum);
|
ALLOC_MAPART_ARRAY(tilefilenum, g_bakTileFileNum);
|
||||||
ALLOC_MAPART_ARRAY(tilefileoffs, g_bakTileFileOffs);
|
ALLOC_MAPART_ARRAY(tilefileoffs, g_bakTileFileOffs);
|
||||||
ALLOC_MAPART_ARRAY(tilesizx, g_bakTileSizX);
|
ALLOC_MAPART_ARRAY(tilesiz, g_bakTileSiz);
|
||||||
ALLOC_MAPART_ARRAY(tilesizy, g_bakTileSizY);
|
|
||||||
ALLOC_MAPART_ARRAY(picanm, g_bakPicAnm);
|
ALLOC_MAPART_ARRAY(picanm, g_bakPicAnm);
|
||||||
|
|
||||||
for (i=MAXARTFILES_BASE; i<MAXARTFILES_TOTAL; i++)
|
for (i=MAXARTFILES_BASE; i<MAXARTFILES_TOTAL; i++)
|
||||||
|
@ -11400,20 +11407,20 @@ static void set_picsiz(int32_t picnum)
|
||||||
int32_t j;
|
int32_t j;
|
||||||
|
|
||||||
j = 15;
|
j = 15;
|
||||||
while ((j > 1) && (pow2long[j] > tilesizx[picnum]))
|
while ((j > 1) && (pow2long[j] > tilesiz[picnum].x))
|
||||||
j--;
|
j--;
|
||||||
picsiz[picnum] = j;
|
picsiz[picnum] = j;
|
||||||
|
|
||||||
j = 15;
|
j = 15;
|
||||||
while ((j > 1) && (pow2long[j] > tilesizy[picnum]))
|
while ((j > 1) && (pow2long[j] > tilesiz[picnum].y))
|
||||||
j--;
|
j--;
|
||||||
picsiz[picnum] |= j<<4;
|
picsiz[picnum] |= j<<4;
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_tilesiz(int32_t picnum, int16_t dasizx, int16_t dasizy)
|
void set_tilesiz(int32_t picnum, int16_t dasizx, int16_t dasizy)
|
||||||
{
|
{
|
||||||
tilesizx[picnum] = dasizx;
|
tilesiz[picnum].x = dasizx;
|
||||||
tilesizy[picnum] = dasizy;
|
tilesiz[picnum].y = dasizy;
|
||||||
|
|
||||||
set_picsiz(picnum);
|
set_picsiz(picnum);
|
||||||
}
|
}
|
||||||
|
@ -11423,7 +11430,7 @@ int32_t tile_exists(int32_t picnum)
|
||||||
if (waloff[picnum] == 0)
|
if (waloff[picnum] == 0)
|
||||||
loadtile(picnum);
|
loadtile(picnum);
|
||||||
|
|
||||||
return (waloff[picnum] != 0 && tilesizx[picnum] > 0 && tilesizy[picnum] > 0);
|
return (waloff[picnum] != 0 && tilesiz[picnum].x > 0 && tilesiz[picnum].y > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *E_GetArtFileName(int32_t tilefilei)
|
static const char *E_GetArtFileName(int32_t tilefilei)
|
||||||
|
@ -11459,6 +11466,7 @@ static int32_t E_ReadArtFile(int32_t tilefilei)
|
||||||
|
|
||||||
const char *fn = E_GetArtFileName(tilefilei);
|
const char *fn = E_GetArtFileName(tilefilei);
|
||||||
const int32_t permap = (tilefilei >= MAXARTFILES_BASE); // is it a per-map ART file?
|
const int32_t permap = (tilefilei >= MAXARTFILES_BASE); // is it a per-map ART file?
|
||||||
|
int16_t *tilesizx, *tilesizy;
|
||||||
|
|
||||||
if ((fil = kopen4load(fn,0)) != -1)
|
if ((fil = kopen4load(fn,0)) != -1)
|
||||||
{
|
{
|
||||||
|
@ -11521,8 +11529,10 @@ static int32_t E_ReadArtFile(int32_t tilefilei)
|
||||||
Bmemset(&walock[localtilestart], 1, localnumtiles*sizeof(walock[0]));
|
Bmemset(&walock[localtilestart], 1, localnumtiles*sizeof(walock[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
kread(fil, &tilesizx[localtilestart], localnumtiles*sizeof(int16_t));
|
tilesizx = (int16_t *)Xmalloc(localnumtiles * sizeof(int16_t));
|
||||||
kread(fil, &tilesizy[localtilestart], localnumtiles*sizeof(int16_t));
|
tilesizy = (int16_t *)Xmalloc(localnumtiles * sizeof(int16_t));
|
||||||
|
kread(fil, tilesizx, localnumtiles*sizeof(int16_t));
|
||||||
|
kread(fil, tilesizy, localnumtiles*sizeof(int16_t));
|
||||||
kread(fil, &picanm[localtilestart], localnumtiles*sizeof(picanm_t));
|
kread(fil, &picanm[localtilestart], localnumtiles*sizeof(picanm_t));
|
||||||
|
|
||||||
for (i=localtilestart; i<=localtileend; i++)
|
for (i=localtilestart; i<=localtileend; i++)
|
||||||
|
@ -11530,8 +11540,8 @@ static int32_t E_ReadArtFile(int32_t tilefilei)
|
||||||
EDUKE32_STATIC_ASSERT(sizeof(picanm_t) == 4);
|
EDUKE32_STATIC_ASSERT(sizeof(picanm_t) == 4);
|
||||||
EDUKE32_STATIC_ASSERT(PICANM_ANIMTYPE_MASK == 192);
|
EDUKE32_STATIC_ASSERT(PICANM_ANIMTYPE_MASK == 192);
|
||||||
|
|
||||||
tilesizx[i] = B_LITTLE16(tilesizx[i]);
|
tilesiz[i].x = B_LITTLE16(tilesizx[i-localtilestart]);
|
||||||
tilesizy[i] = B_LITTLE16(tilesizy[i]);
|
tilesiz[i].y = B_LITTLE16(tilesizy[i-localtilestart]);
|
||||||
|
|
||||||
// Old on-disk format: anim type is in the 2 highest bits of the lowest byte.
|
// Old on-disk format: anim type is in the 2 highest bits of the lowest byte.
|
||||||
picanm[i].sf &= ~192;
|
picanm[i].sf &= ~192;
|
||||||
|
@ -11542,10 +11552,13 @@ static int32_t E_ReadArtFile(int32_t tilefilei)
|
||||||
picanm[i].sf &= ~PICANM_MISC_MASK;
|
picanm[i].sf &= ~PICANM_MISC_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DO_FREE_AND_NULL(tilesizx);
|
||||||
|
DO_FREE_AND_NULL(tilesizy);
|
||||||
|
|
||||||
offscount = 4+4+4+4+(localnumtiles<<3);
|
offscount = 4+4+4+4+(localnumtiles<<3);
|
||||||
for (i=localtilestart; i<=localtileend; i++)
|
for (i=localtilestart; i<=localtileend; i++)
|
||||||
{
|
{
|
||||||
int32_t dasiz = tilesizx[i]*tilesizy[i];
|
int32_t dasiz = tilesiz[i].x * tilesiz[i].y;
|
||||||
|
|
||||||
tilefilenum[i] = tilefilei;
|
tilefilenum[i] = tilefilei;
|
||||||
tilefileoffs[i] = offscount;
|
tilefileoffs[i] = offscount;
|
||||||
|
@ -11583,8 +11596,7 @@ int32_t loadpics(const char *filename, int32_t askedsize)
|
||||||
|
|
||||||
Bstrncpyz(artfilename, filename, sizeof(artfilename));
|
Bstrncpyz(artfilename, filename, sizeof(artfilename));
|
||||||
|
|
||||||
Bmemset(tilesizx, 0, sizeof(tilesizx));
|
Bmemset(&tilesiz[0], 0, sizeof(vec2_t) * MAXTILES);
|
||||||
Bmemset(tilesizy, 0, sizeof(tilesizy));
|
|
||||||
Bmemset(picanm, 0, sizeof(picanm));
|
Bmemset(picanm, 0, sizeof(picanm));
|
||||||
|
|
||||||
// artsize = 0;
|
// artsize = 0;
|
||||||
|
@ -11627,7 +11639,7 @@ void loadtile(int16_t tilenume)
|
||||||
int32_t i, dasiz;
|
int32_t i, dasiz;
|
||||||
|
|
||||||
if ((unsigned)tilenume >= (unsigned)MAXTILES) return;
|
if ((unsigned)tilenume >= (unsigned)MAXTILES) return;
|
||||||
if ((dasiz = tilesizx[tilenume]*tilesizy[tilenume]) <= 0) return;
|
if ((dasiz = tilesiz[tilenume].x*tilesiz[tilenume].y) <= 0) return;
|
||||||
|
|
||||||
i = tilefilenum[tilenume];
|
i = tilefilenum[tilenume];
|
||||||
|
|
||||||
|
@ -11764,8 +11776,8 @@ void copytilepiece(int32_t tilenume1, int32_t sx1, int32_t sy1, int32_t xsiz, in
|
||||||
char *ptr1, *ptr2, dat;
|
char *ptr1, *ptr2, dat;
|
||||||
int32_t xsiz1, ysiz1, xsiz2, ysiz2, i, j, x1, y1, x2, y2;
|
int32_t xsiz1, ysiz1, xsiz2, ysiz2, i, j, x1, y1, x2, y2;
|
||||||
|
|
||||||
xsiz1 = tilesizx[tilenume1]; ysiz1 = tilesizy[tilenume1];
|
xsiz1 = tilesiz[tilenume1].x; ysiz1 = tilesiz[tilenume1].y;
|
||||||
xsiz2 = tilesizx[tilenume2]; ysiz2 = tilesizy[tilenume2];
|
xsiz2 = tilesiz[tilenume2].x; ysiz2 = tilesiz[tilenume2].y;
|
||||||
if ((xsiz1 > 0) && (ysiz1 > 0) && (xsiz2 > 0) && (ysiz2 > 0))
|
if ((xsiz1 > 0) && (ysiz1 > 0) && (xsiz2 > 0) && (ysiz2 > 0))
|
||||||
{
|
{
|
||||||
if (waloff[tilenume1] == 0) loadtile(tilenume1);
|
if (waloff[tilenume1] == 0) loadtile(tilenume1);
|
||||||
|
@ -12003,7 +12015,7 @@ int32_t spriteheightofsptr(const spritetype *spr, int32_t *height, int32_t alsot
|
||||||
int32_t hei, zofs=0;
|
int32_t hei, zofs=0;
|
||||||
const int32_t picnum=spr->picnum, yrepeat=spr->yrepeat;
|
const int32_t picnum=spr->picnum, yrepeat=spr->yrepeat;
|
||||||
|
|
||||||
hei = (tilesizy[picnum]*yrepeat)<<2;
|
hei = (tilesiz[picnum].y*yrepeat)<<2;
|
||||||
*height = hei;
|
*height = hei;
|
||||||
|
|
||||||
if (spr->cstat&128)
|
if (spr->cstat&128)
|
||||||
|
@ -12393,7 +12405,7 @@ static void get_wallspr_points(const spritetype *spr, int32_t *x1, int32_t *x2,
|
||||||
dax = sintable[ang&2047]*xrepeat;
|
dax = sintable[ang&2047]*xrepeat;
|
||||||
day = sintable[(ang+1536)&2047]*xrepeat;
|
day = sintable[(ang+1536)&2047]*xrepeat;
|
||||||
|
|
||||||
l = tilesizx[tilenum];
|
l = tilesiz[tilenum].x;
|
||||||
k = (l>>1)+xoff;
|
k = (l>>1)+xoff;
|
||||||
|
|
||||||
*x1 -= mulscale16(dax,k);
|
*x1 -= mulscale16(dax,k);
|
||||||
|
@ -12416,8 +12428,8 @@ static void get_floorspr_points(const spritetype *spr, int32_t px, int32_t py,
|
||||||
const int32_t cosang = sintable[(spr->ang+512)&2047];
|
const int32_t cosang = sintable[(spr->ang+512)&2047];
|
||||||
const int32_t sinang = sintable[spr->ang&2047];
|
const int32_t sinang = sintable[spr->ang&2047];
|
||||||
|
|
||||||
const int32_t xspan=tilesizx[tilenum], xrepeat=spr->xrepeat;
|
const int32_t xspan=tilesiz[tilenum].x, xrepeat=spr->xrepeat;
|
||||||
const int32_t yspan=tilesizy[tilenum], yrepeat=spr->yrepeat;
|
const int32_t yspan=tilesiz[tilenum].y, yrepeat=spr->yrepeat;
|
||||||
|
|
||||||
int32_t xoff = picanm[tilenum].xofs + spr->xoffset;
|
int32_t xoff = picanm[tilenum].xofs + spr->xoffset;
|
||||||
int32_t yoff = picanm[tilenum].yofs + spr->yoffset;
|
int32_t yoff = picanm[tilenum].yofs + spr->yoffset;
|
||||||
|
@ -12498,7 +12510,7 @@ static int32_t try_facespr_intersect(const spritetype *spr, const vec3_t *refpos
|
||||||
const int32_t offy = scale(vy,topu,bot);
|
const int32_t offy = scale(vy,topu,bot);
|
||||||
const int32_t dist = offx*offx + offy*offy;
|
const int32_t dist = offx*offx + offy*offy;
|
||||||
|
|
||||||
i = tilesizx[spr->picnum]*spr->xrepeat;
|
i = tilesiz[spr->picnum].x*spr->xrepeat;
|
||||||
if (dist <= mulscale7(i,i))
|
if (dist <= mulscale7(i,i))
|
||||||
{
|
{
|
||||||
const int32_t intx = xs + scale(vx,topt,bot);
|
const int32_t intx = xs + scale(vx,topt,bot);
|
||||||
|
@ -12742,11 +12754,11 @@ restart_grand:
|
||||||
if (waloff[tilenum])
|
if (waloff[tilenum])
|
||||||
{
|
{
|
||||||
// daz-intz > 0 && daz-intz < k
|
// daz-intz > 0 && daz-intz < k
|
||||||
int32_t xtex = mulscale16(ucoefup16, tilesizx[tilenum]);
|
int32_t xtex = mulscale16(ucoefup16, tilesiz[tilenum].x);
|
||||||
int32_t vcoefup16 = 65536-divscale16(daz-intz, k);
|
int32_t vcoefup16 = 65536-divscale16(daz-intz, k);
|
||||||
int32_t ytex = mulscale16(vcoefup16, tilesizy[tilenum]);
|
int32_t ytex = mulscale16(vcoefup16, tilesiz[tilenum].y);
|
||||||
|
|
||||||
const char *texel = (char *)(waloff[tilenum] + tilesizy[tilenum]*xtex + ytex);
|
const char *texel = (char *)(waloff[tilenum] + tilesiz[tilenum].y*xtex + ytex);
|
||||||
if (*texel == 255)
|
if (*texel == 255)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -13215,7 +13227,7 @@ static int32_t clipsprite_initindex(int32_t curidx, spritetype *curspr, int32_t
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((curspr->cstat&128) != (sector[j].CM_CSTAT&128))
|
if ((curspr->cstat&128) != (sector[j].CM_CSTAT&128))
|
||||||
daz += (((curspr->cstat&128)>>6)-1)*((tilesizy[curspr->picnum]*curspr->yrepeat)<<1);
|
daz += (((curspr->cstat&128)>>6)-1)*((tilesiz[curspr->picnum].y*curspr->yrepeat)<<1);
|
||||||
|
|
||||||
*clipsectcnt = clipsectnum = 0;
|
*clipsectcnt = clipsectnum = 0;
|
||||||
// init sectors for this index
|
// init sectors for this index
|
||||||
|
@ -14720,7 +14732,7 @@ void rotatesprite_(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum,
|
||||||
if ((cx1 > cx2) || (cy1 > cy2)) return;
|
if ((cx1 > cx2) || (cy1 > cy2)) return;
|
||||||
if (z <= 16) return;
|
if (z <= 16) return;
|
||||||
DO_TILE_ANIM(picnum, 0xc000);
|
DO_TILE_ANIM(picnum, 0xc000);
|
||||||
if ((tilesizx[picnum] <= 0) || (tilesizy[picnum] <= 0)) return;
|
if ((tilesiz[picnum].x <= 0) || (tilesiz[picnum].y <= 0)) return;
|
||||||
|
|
||||||
// Experimental / development bits. ONLY FOR INTERNAL USE!
|
// Experimental / development bits. ONLY FOR INTERNAL USE!
|
||||||
// bit RS_CENTERORIGIN: see dorotspr_handle_bit2
|
// bit RS_CENTERORIGIN: see dorotspr_handle_bit2
|
||||||
|
@ -14766,8 +14778,8 @@ void rotatesprite_(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum,
|
||||||
if (per2->sy != per->sy) continue;
|
if (per2->sy != per->sy) continue;
|
||||||
if (per2->z != per->z) continue;
|
if (per2->z != per->z) continue;
|
||||||
if (per2->a != per->a) continue;
|
if (per2->a != per->a) continue;
|
||||||
if (tilesizx[per2->picnum] > tilesizx[per->picnum]) continue;
|
if (tilesiz[per2->picnum].x > tilesiz[per->picnum].x) continue;
|
||||||
if (tilesizy[per2->picnum] > tilesizy[per->picnum]) continue;
|
if (tilesiz[per2->picnum].y > tilesiz[per->picnum].y) continue;
|
||||||
if (per2->cx1 < per->cx1) continue;
|
if (per2->cx1 < per->cx1) continue;
|
||||||
if (per2->cy1 < per->cy1) continue;
|
if (per2->cy1 < per->cy1) continue;
|
||||||
if (per2->cx2 > per->cx2) continue;
|
if (per2->cx2 > per->cx2) continue;
|
||||||
|
@ -14790,8 +14802,8 @@ void rotatesprite_(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum,
|
||||||
if (per2->cy2 > per->cy2) continue;
|
if (per2->cy2 > per->cy2) continue;
|
||||||
if ((per2->sx>>16) < (per->sx>>16)) continue;
|
if ((per2->sx>>16) < (per->sx>>16)) continue;
|
||||||
if ((per2->sy>>16) < (per->sy>>16)) continue;
|
if ((per2->sy>>16) < (per->sy>>16)) continue;
|
||||||
if ((per2->sx>>16)+tilesizx[per2->picnum] > (per->sx>>16)+tilesizx[per->picnum]) continue;
|
if ((per2->sx>>16)+tilesiz[per2->picnum].x > (per->sx>>16)+tilesiz[per->picnum].x) continue;
|
||||||
if ((per2->sy>>16)+tilesizy[per2->picnum] > (per->sy>>16)+tilesizy[per->picnum]) continue;
|
if ((per2->sy>>16)+tilesiz[per2->picnum].y > (per->sy>>16)+tilesiz[per->picnum].y) continue;
|
||||||
|
|
||||||
per2->pagesleft = 0;
|
per2->pagesleft = 0;
|
||||||
}
|
}
|
||||||
|
@ -15254,7 +15266,7 @@ char getpixel(int32_t x, int32_t y)
|
||||||
void setviewtotile(int16_t tilenume, int32_t xsiz, int32_t ysiz)
|
void setviewtotile(int16_t tilenume, int32_t xsiz, int32_t ysiz)
|
||||||
{
|
{
|
||||||
//DRAWROOMS TO TILE BACKUP&SET CODE
|
//DRAWROOMS TO TILE BACKUP&SET CODE
|
||||||
tilesizx[tilenume] = xsiz; tilesizy[tilenume] = ysiz;
|
tilesiz[tilenume].x = xsiz; tilesiz[tilenume].y = ysiz;
|
||||||
bakxsiz[setviewcnt] = xsiz; bakysiz[setviewcnt] = ysiz;
|
bakxsiz[setviewcnt] = xsiz; bakysiz[setviewcnt] = ysiz;
|
||||||
bakframeplace[setviewcnt] = frameplace; frameplace = waloff[tilenume];
|
bakframeplace[setviewcnt] = frameplace; frameplace = waloff[tilenume];
|
||||||
bakwindowx1[setviewcnt] = windowx1; bakwindowy1[setviewcnt] = windowy1;
|
bakwindowx1[setviewcnt] = windowx1; bakwindowy1[setviewcnt] = windowy1;
|
||||||
|
@ -15328,7 +15340,7 @@ void squarerotatetile(int16_t tilenume)
|
||||||
int32_t siz;
|
int32_t siz;
|
||||||
|
|
||||||
//supports square tiles only for rotation part
|
//supports square tiles only for rotation part
|
||||||
if ((siz = tilesizx[tilenume]) == tilesizy[tilenume])
|
if ((siz = tilesiz[tilenume].x) == tilesiz[tilenume].y)
|
||||||
{
|
{
|
||||||
int32_t i = siz-1;
|
int32_t i = siz-1;
|
||||||
|
|
||||||
|
@ -16617,8 +16629,8 @@ static void drawscreen_drawsprite(int32_t j, int32_t posxe, int32_t posye, int32
|
||||||
|
|
||||||
if (flooraligned)
|
if (flooraligned)
|
||||||
{
|
{
|
||||||
int32_t fx = mulscale10(mulscale6(tilesizx[sprite[j].picnum], sprite[j].xrepeat),zoome) >> 1;
|
int32_t fx = mulscale10(mulscale6(tilesiz[sprite[j].picnum].x, sprite[j].xrepeat),zoome) >> 1;
|
||||||
int32_t fy = mulscale10(mulscale6(tilesizy[sprite[j].picnum], sprite[j].yrepeat),zoome) >> 1;
|
int32_t fy = mulscale10(mulscale6(tilesiz[sprite[j].picnum].y, sprite[j].yrepeat),zoome) >> 1;
|
||||||
int32_t co[4][2], ii, in;
|
int32_t co[4][2], ii, in;
|
||||||
int32_t sinang = sintable[(sprite[j].ang+angofs+1536)&2047];
|
int32_t sinang = sintable[(sprite[j].ang+angofs+1536)&2047];
|
||||||
int32_t cosang = sintable[(sprite[j].ang+angofs+1024)&2047];
|
int32_t cosang = sintable[(sprite[j].ang+angofs+1024)&2047];
|
||||||
|
@ -16655,7 +16667,7 @@ static void drawscreen_drawsprite(int32_t j, int32_t posxe, int32_t posye, int32
|
||||||
}
|
}
|
||||||
else if (wallaligned)
|
else if (wallaligned)
|
||||||
{
|
{
|
||||||
int32_t fx = mulscale6(tilesizx[sprite[j].picnum], sprite[j].xrepeat);
|
int32_t fx = mulscale6(tilesiz[sprite[j].picnum].x, sprite[j].xrepeat);
|
||||||
int32_t one=(((sprite[j].ang+angofs+256)&512) == 0), no=!one;
|
int32_t one=(((sprite[j].ang+angofs+256)&512) == 0), no=!one;
|
||||||
|
|
||||||
x2 = mulscale11(sintable[(sprite[j].ang+angofs+2560)&2047],zoome) / 6144;
|
x2 = mulscale11(sintable[(sprite[j].ang+angofs+2560)&2047],zoome) / 6144;
|
||||||
|
|
|
@ -66,7 +66,7 @@ extern int32_t hitallsprites;
|
||||||
|
|
||||||
extern int32_t xb1[MAXWALLSB];
|
extern int32_t xb1[MAXWALLSB];
|
||||||
extern int32_t rx1[MAXWALLSB], ry1[MAXWALLSB];
|
extern int32_t rx1[MAXWALLSB], ry1[MAXWALLSB];
|
||||||
extern int16_t p2[MAXWALLSB];
|
extern int16_t bunchp2[MAXWALLSB];
|
||||||
extern int16_t numscans, numbunches;
|
extern int16_t numscans, numbunches;
|
||||||
|
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
|
|
|
@ -175,7 +175,7 @@ int32_t hicsetsubsttex(int32_t picnum, int32_t palnum, const char *filen, float
|
||||||
hicreplc[picnum] = hrn;
|
hicreplc[picnum] = hrn;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tilesizx[picnum]<=0 || tilesizy[picnum]<=0)
|
if (tilesiz[picnum].x<=0 || tilesiz[picnum].y<=0)
|
||||||
{
|
{
|
||||||
static int32_t first=1;
|
static int32_t first=1;
|
||||||
if (first)
|
if (first)
|
||||||
|
|
|
@ -2027,7 +2027,7 @@ static int32_t md3draw(md3model_t *m, const spritetype *tspr)
|
||||||
// dereferenced unconditionally below anyway.
|
// dereferenced unconditionally below anyway.
|
||||||
const spriteext_t *const sext = ((unsigned)owner < MAXSPRITES+MAXUNIQHUDID) ? &spriteext[owner] : NULL;
|
const spriteext_t *const sext = ((unsigned)owner < MAXSPRITES+MAXUNIQHUDID) ? &spriteext[owner] : NULL;
|
||||||
const uint8_t lpal = ((unsigned)owner < MAXSPRITES) ? sprite[tspr->owner].pal : tspr->pal;
|
const uint8_t lpal = ((unsigned)owner < MAXSPRITES) ? sprite[tspr->owner].pal : tspr->pal;
|
||||||
const int32_t sizyrep = tilesizy[tspr->picnum]*tspr->yrepeat;
|
const int32_t sizyrep = tilesiz[tspr->picnum].y*tspr->yrepeat;
|
||||||
|
|
||||||
if (r_vbos && (m->vbos == NULL))
|
if (r_vbos && (m->vbos == NULL))
|
||||||
mdloadvbos(m);
|
mdloadvbos(m);
|
||||||
|
@ -2295,7 +2295,7 @@ static int32_t md3draw(md3model_t *m, const spritetype *tspr)
|
||||||
{
|
{
|
||||||
mdskinmap_t *sk;
|
mdskinmap_t *sk;
|
||||||
|
|
||||||
polymost_setupdetailtexture(&texunits, i);
|
polymost_setupdetailtexture(++texunits, i);
|
||||||
|
|
||||||
for (sk = m->skinmap; sk; sk = sk->next)
|
for (sk = m->skinmap; sk; sk = sk->next)
|
||||||
if ((int32_t)sk->palette == DETAILPAL && sk->skinnum == tile2model[Ptile2tile(tspr->picnum,lpal)].skinnum && sk->surfnum == surfi)
|
if ((int32_t)sk->palette == DETAILPAL && sk->skinnum == tile2model[Ptile2tile(tspr->picnum,lpal)].skinnum && sk->surfnum == surfi)
|
||||||
|
@ -2308,12 +2308,11 @@ static int32_t md3draw(md3model_t *m, const spritetype *tspr)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r_glowmapping && !(tspr->cstat&CSTAT_SPRITE_MDHACK))
|
if (r_glowmapping && !(tspr->cstat&CSTAT_SPRITE_MDHACK))
|
||||||
i = mdloadskin((md2model_t *)m,tile2model[Ptile2tile(tspr->picnum,lpal)].skinnum,GLOWPAL,surfi);
|
{
|
||||||
else
|
i = mdloadskin((md2model_t *) m, tile2model[Ptile2tile(tspr->picnum, lpal)].skinnum, GLOWPAL, surfi);
|
||||||
i = 0;
|
|
||||||
|
|
||||||
if (i)
|
if (i)
|
||||||
polymost_setupglowtexture(&texunits, i);
|
polymost_setupglowtexture(++texunits, i);
|
||||||
|
}
|
||||||
|
|
||||||
if (r_vertexarrays && r_vbos)
|
if (r_vertexarrays && r_vbos)
|
||||||
{
|
{
|
||||||
|
@ -3218,7 +3217,7 @@ int32_t voxdraw(voxmodel_t *m, const spritetype *tspr)
|
||||||
m0.z *= f; a0.z *= f;
|
m0.z *= f; a0.z *= f;
|
||||||
|
|
||||||
k0 = (float)tspr->z;
|
k0 = (float)tspr->z;
|
||||||
if (globalorientation&128) k0 += (float)((tilesizy[tspr->picnum]*tspr->yrepeat)<<1);
|
if (globalorientation&128) k0 += (float)((tilesiz[tspr->picnum].y*tspr->yrepeat)<<1);
|
||||||
|
|
||||||
f = (65536.0*512.0)/((float)xdimen*viewingrange);
|
f = (65536.0*512.0)/((float)xdimen*viewingrange);
|
||||||
g = 32.0/((float)xdimen*gxyaspect);
|
g = 32.0/((float)xdimen*gxyaspect);
|
||||||
|
|
|
@ -2478,7 +2478,7 @@ static int32_t polymer_updatesector(int16_t sectnum)
|
||||||
if (curxpanning)
|
if (curxpanning)
|
||||||
{
|
{
|
||||||
xpancoef = (float)(pow2long[picsiz[curpicnum] & 15]);
|
xpancoef = (float)(pow2long[picsiz[curpicnum] & 15]);
|
||||||
xpancoef *= (float)(curxpanning) / (256.0f * (float)(tilesizx[curpicnum]));
|
xpancoef *= (float)(curxpanning) / (256.0f * (float)(tilesiz[curpicnum].x));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
xpancoef = 0;
|
xpancoef = 0;
|
||||||
|
@ -2486,13 +2486,13 @@ static int32_t polymer_updatesector(int16_t sectnum)
|
||||||
if (curypanning)
|
if (curypanning)
|
||||||
{
|
{
|
||||||
ypancoef = (float)(pow2long[picsiz[curpicnum] >> 4]);
|
ypancoef = (float)(pow2long[picsiz[curpicnum] >> 4]);
|
||||||
ypancoef *= (float)(curypanning) / (256.0f * (float)(tilesizy[curpicnum]));
|
ypancoef *= (float)(curypanning) / (256.0f * (float)(tilesiz[curpicnum].y));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ypancoef = 0;
|
ypancoef = 0;
|
||||||
|
|
||||||
curbuffer[(i*5)+3] = ((float)(tex) / (scalecoef * tilesizx[curpicnum])) + xpancoef;
|
curbuffer[(i*5)+3] = ((float)(tex) / (scalecoef * tilesiz[curpicnum].x)) + xpancoef;
|
||||||
curbuffer[(i*5)+4] = ((float)(tey) / (scalecoef * tilesizy[curpicnum])) + ypancoef;
|
curbuffer[(i*5)+4] = ((float)(tey) / (scalecoef * tilesiz[curpicnum].y)) + ypancoef;
|
||||||
|
|
||||||
j--;
|
j--;
|
||||||
}
|
}
|
||||||
|
@ -2817,19 +2817,19 @@ static float calc_ypancoef(char curypanning, int16_t curpicnum, int32_t dopancor
|
||||||
{
|
{
|
||||||
float ypancoef = (float)(pow2long[picsiz[curpicnum] >> 4]);
|
float ypancoef = (float)(pow2long[picsiz[curpicnum] >> 4]);
|
||||||
|
|
||||||
if (ypancoef < tilesizy[curpicnum])
|
if (ypancoef < tilesiz[curpicnum].y)
|
||||||
ypancoef *= 2;
|
ypancoef *= 2;
|
||||||
|
|
||||||
if (dopancor)
|
if (dopancor)
|
||||||
{
|
{
|
||||||
int32_t yoffs;
|
int32_t yoffs;
|
||||||
|
|
||||||
ftol((ypancoef - tilesizy[curpicnum]) * (255.0f / ypancoef), &yoffs);
|
ftol((ypancoef - tilesiz[curpicnum].y) * (255.0f / ypancoef), &yoffs);
|
||||||
if (curypanning > 256 - yoffs)
|
if (curypanning > 256 - yoffs)
|
||||||
curypanning -= yoffs;
|
curypanning -= yoffs;
|
||||||
}
|
}
|
||||||
|
|
||||||
ypancoef *= (float)curypanning / (256.0f * (float)tilesizy[curpicnum]);
|
ypancoef *= (float)curypanning / (256.0f * (float)tilesiz[curpicnum].y);
|
||||||
|
|
||||||
return ypancoef;
|
return ypancoef;
|
||||||
}
|
}
|
||||||
|
@ -2979,8 +2979,8 @@ static void polymer_updatewall(int16_t wallnum)
|
||||||
else
|
else
|
||||||
dist = (float)(xref == 0);
|
dist = (float)(xref == 0);
|
||||||
|
|
||||||
w->wall.buffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + wal->xpanning) / (float)(tilesizx[curpicnum]);
|
w->wall.buffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + wal->xpanning) / (float)(tilesiz[curpicnum].x);
|
||||||
w->wall.buffer[(i * 5) + 4] = (-(float)(yref + (w->wall.buffer[(i * 5) + 1] * 16)) / ((tilesizy[curpicnum] * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
w->wall.buffer[(i * 5) + 4] = (-(float)(yref + (w->wall.buffer[(i * 5) + 1] * 16)) / ((tilesiz[curpicnum].y * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
||||||
|
|
||||||
if (wal->cstat & 256) w->wall.buffer[(i * 5) + 4] = -w->wall.buffer[(i * 5) + 4];
|
if (wal->cstat & 256) w->wall.buffer[(i * 5) + 4] = -w->wall.buffer[(i * 5) + 4];
|
||||||
|
|
||||||
|
@ -3041,8 +3041,8 @@ static void polymer_updatewall(int16_t wallnum)
|
||||||
else
|
else
|
||||||
dist = (float)(xref == 0);
|
dist = (float)(xref == 0);
|
||||||
|
|
||||||
w->wall.buffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + curxpanning) / (float)(tilesizx[curpicnum]);
|
w->wall.buffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + curxpanning) / (float)(tilesiz[curpicnum].x);
|
||||||
w->wall.buffer[(i * 5) + 4] = (-(float)(yref + (w->wall.buffer[(i * 5) + 1] * 16)) / ((tilesizy[curpicnum] * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
w->wall.buffer[(i * 5) + 4] = (-(float)(yref + (w->wall.buffer[(i * 5) + 1] * 16)) / ((tilesiz[curpicnum].y * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
||||||
|
|
||||||
if ((!(wal->cstat & 2) && (wal->cstat & 256)) ||
|
if ((!(wal->cstat & 2) && (wal->cstat & 256)) ||
|
||||||
((wal->cstat & 2) && (wall[nwallnum].cstat & 256)))
|
((wal->cstat & 2) && (wall[nwallnum].cstat & 256)))
|
||||||
|
@ -3122,8 +3122,8 @@ static void polymer_updatewall(int16_t wallnum)
|
||||||
else
|
else
|
||||||
dist = (float)(xref == 0);
|
dist = (float)(xref == 0);
|
||||||
|
|
||||||
w->over.buffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + wal->xpanning) / (float)(tilesizx[curpicnum]);
|
w->over.buffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + wal->xpanning) / (float)(tilesiz[curpicnum].x);
|
||||||
w->over.buffer[(i * 5) + 4] = (-(float)(yref + (w->over.buffer[(i * 5) + 1] * 16)) / ((tilesizy[curpicnum] * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
w->over.buffer[(i * 5) + 4] = (-(float)(yref + (w->over.buffer[(i * 5) + 1] * 16)) / ((tilesiz[curpicnum].y * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
||||||
|
|
||||||
if (wal->cstat & 256) w->over.buffer[(i * 5) + 4] = -w->over.buffer[(i * 5) + 4];
|
if (wal->cstat & 256) w->over.buffer[(i * 5) + 4] = -w->over.buffer[(i * 5) + 4];
|
||||||
|
|
||||||
|
@ -3168,8 +3168,8 @@ static void polymer_updatewall(int16_t wallnum)
|
||||||
else
|
else
|
||||||
dist = (float)(xref == 0);
|
dist = (float)(xref == 0);
|
||||||
|
|
||||||
w->mask.buffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + wal->xpanning) / (float)(tilesizx[curpicnum]);
|
w->mask.buffer[(i * 5) + 3] = ((dist * 8.0f * wal->xrepeat) + wal->xpanning) / (float)(tilesiz[curpicnum].x);
|
||||||
w->mask.buffer[(i * 5) + 4] = (-(float)(yref + (w->mask.buffer[(i * 5) + 1] * 16)) / ((tilesizy[curpicnum] * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
w->mask.buffer[(i * 5) + 4] = (-(float)(yref + (w->mask.buffer[(i * 5) + 1] * 16)) / ((tilesiz[curpicnum].y * 2048.0f) / (float)(wal->yrepeat))) + ypancoef;
|
||||||
|
|
||||||
if (wal->cstat & 256) w->mask.buffer[(i * 5) + 4] = -w->mask.buffer[(i * 5) + 4];
|
if (wal->cstat & 256) w->mask.buffer[(i * 5) + 4] = -w->mask.buffer[(i * 5) + 4];
|
||||||
|
|
||||||
|
@ -3598,8 +3598,8 @@ void polymer_updatesprite(int32_t snum)
|
||||||
|
|
||||||
yratio = (float)(tspr->yrepeat) * 0.25f;
|
yratio = (float)(tspr->yrepeat) * 0.25f;
|
||||||
|
|
||||||
xsize = tilesizx[curpicnum];
|
xsize = tilesiz[curpicnum].x;
|
||||||
ysize = tilesizy[curpicnum];
|
ysize = tilesiz[curpicnum].y;
|
||||||
|
|
||||||
if (usehightile && h_xsize[curpicnum])
|
if (usehightile && h_xsize[curpicnum])
|
||||||
{
|
{
|
||||||
|
@ -4073,21 +4073,21 @@ static void polymer_drawmdsprite(spritetype *tspr)
|
||||||
}
|
}
|
||||||
if (((tspr->cstat>>4) & 3) == 2)
|
if (((tspr->cstat>>4) & 3) == 2)
|
||||||
{
|
{
|
||||||
bglTranslatef(0.0f, 0.0, -(float)(tilesizy[tspr->picnum] * tspr->yrepeat) / 8.0f);
|
bglTranslatef(0.0f, 0.0, -(float)(tilesiz[tspr->picnum].y * tspr->yrepeat) / 8.0f);
|
||||||
bglRotatef(90.0f, 0.0f, 0.0f, 1.0f);
|
bglRotatef(90.0f, 0.0f, 0.0f, 1.0f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
bglRotatef(-90.0f, 1.0f, 0.0f, 0.0f);
|
bglRotatef(-90.0f, 1.0f, 0.0f, 0.0f);
|
||||||
|
|
||||||
if ((tspr->cstat & 128) && (((tspr->cstat>>4) & 3) != 2))
|
if ((tspr->cstat & 128) && (((tspr->cstat>>4) & 3) != 2))
|
||||||
bglTranslatef(0.0f, 0.0, -(float)(tilesizy[tspr->picnum] * tspr->yrepeat) / 8.0f);
|
bglTranslatef(0.0f, 0.0, -(float)(tilesiz[tspr->picnum].y * tspr->yrepeat) / 8.0f);
|
||||||
|
|
||||||
// yoffset differs from zadd in that it does not follow cstat&8 y-flipping
|
// yoffset differs from zadd in that it does not follow cstat&8 y-flipping
|
||||||
bglTranslatef(0.0f, 0.0, m->yoffset * 64 * scale * tspr->yrepeat);
|
bglTranslatef(0.0f, 0.0, m->yoffset * 64 * scale * tspr->yrepeat);
|
||||||
|
|
||||||
if (tspr->cstat & 8)
|
if (tspr->cstat & 8)
|
||||||
{
|
{
|
||||||
bglTranslatef(0.0f, 0.0, (float)(tilesizy[tspr->picnum] * tspr->yrepeat) / 4.0f);
|
bglTranslatef(0.0f, 0.0, (float)(tilesiz[tspr->picnum].y * tspr->yrepeat) / 4.0f);
|
||||||
bglScalef(1.0f, 1.0f, -1.0f);
|
bglScalef(1.0f, 1.0f, -1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4533,14 +4533,14 @@ static void polymer_getbuildmaterial(_prmaterial* material, int16_t tile
|
||||||
if (pr_artmapping && polymer_eligible_for_artmap(tilenum, pth)) {
|
if (pr_artmapping && polymer_eligible_for_artmap(tilenum, pth)) {
|
||||||
if (!prartmaps[tilenum]) {
|
if (!prartmaps[tilenum]) {
|
||||||
char *tilebuffer = (char *)waloff[tilenum];
|
char *tilebuffer = (char *)waloff[tilenum];
|
||||||
char *tempbuffer = (char *)Xmalloc(tilesizx[tilenum] * tilesizy[tilenum]);
|
char *tempbuffer = (char *)Xmalloc(tilesiz[tilenum].x * tilesiz[tilenum].y);
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
|
|
||||||
i = k = 0;
|
i = k = 0;
|
||||||
while (i < tilesizy[tilenum]) {
|
while (i < tilesiz[tilenum].y) {
|
||||||
j = 0;
|
j = 0;
|
||||||
while (j < tilesizx[tilenum]) {
|
while (j < tilesiz[tilenum].x) {
|
||||||
tempbuffer[k] = tilebuffer[(j * tilesizy[tilenum]) + i];
|
tempbuffer[k] = tilebuffer[(j * tilesiz[tilenum].y) + i];
|
||||||
k++;
|
k++;
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
|
@ -4552,8 +4552,8 @@ static void polymer_getbuildmaterial(_prmaterial* material, int16_t tile
|
||||||
bglTexImage2D(GL_TEXTURE_2D,
|
bglTexImage2D(GL_TEXTURE_2D,
|
||||||
0,
|
0,
|
||||||
GL_R8,
|
GL_R8,
|
||||||
tilesizx[tilenum],
|
tilesiz[tilenum].x,
|
||||||
tilesizy[tilenum],
|
tilesiz[tilenum].y,
|
||||||
0,
|
0,
|
||||||
GL_RED,
|
GL_RED,
|
||||||
GL_UNSIGNED_BYTE,
|
GL_UNSIGNED_BYTE,
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -37,7 +37,7 @@ static pthtyp *texcache_tryart(int32_t dapicnum, int32_t dapalnum, int32_t dasha
|
||||||
for (pth=texcache.list[j]; pth; pth=pth->next)
|
for (pth=texcache.list[j]; pth; pth=pth->next)
|
||||||
if (pth->picnum == dapicnum && pth->palnum == dapalnum && pth->shade == dashade &&
|
if (pth->picnum == dapicnum && pth->palnum == dapalnum && pth->shade == dashade &&
|
||||||
(pth->flags & (PTH_CLAMPED+PTH_HIGHTILE)) == TO_PTH_CLAMPED(dameth) &&
|
(pth->flags & (PTH_CLAMPED+PTH_HIGHTILE)) == TO_PTH_CLAMPED(dameth) &&
|
||||||
polymost_want_npotytex(dameth, tilesizy[dapicnum]) == !!(pth->flags&PTH_NPOTWALL)
|
polymost_want_npotytex(dameth, tilesiz[dapicnum].y) == !!(pth->flags&PTH_NPOTWALL)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (pth->flags & PTH_INVALIDATED)
|
if (pth->flags & PTH_INVALIDATED)
|
||||||
|
|
|
@ -431,7 +431,7 @@ int32_t A_MoveSpriteClipdist(int32_t spritenum, const vec3_t *change, uint32_t c
|
||||||
}
|
}
|
||||||
|
|
||||||
dasectnum = spr->sectnum;
|
dasectnum = spr->sectnum;
|
||||||
daz = spr->z - 2*tilesizy[spr->picnum]*spr->yrepeat;
|
daz = spr->z - 2*tilesiz[spr->picnum].y*spr->yrepeat;
|
||||||
|
|
||||||
{
|
{
|
||||||
const int32_t oldz=spr->z;
|
const int32_t oldz=spr->z;
|
||||||
|
@ -804,8 +804,8 @@ static void A_MoveSector(int32_t i)
|
||||||
|
|
||||||
// this is the same crap as in game.c's tspr manipulation. puke.
|
// this is the same crap as in game.c's tspr manipulation. puke.
|
||||||
// XXX: may access tilesizy out-of-bounds by bad user code.
|
// XXX: may access tilesizy out-of-bounds by bad user code.
|
||||||
#define LIGHTRAD (s->yrepeat * tilesizy[s->picnum + LIGHTRAD_PICOFS])
|
#define LIGHTRAD (s->yrepeat * tilesiz[s->picnum + LIGHTRAD_PICOFS].y)
|
||||||
#define LIGHTRAD2 (((s->yrepeat) + (rand()%(s->yrepeat>>2))) * tilesizy[s->picnum + LIGHTRAD_PICOFS])
|
#define LIGHTRAD2 (((s->yrepeat) + (rand()%(s->yrepeat>>2))) * tilesiz[s->picnum + LIGHTRAD_PICOFS].y)
|
||||||
|
|
||||||
void G_AddGameLight(int32_t radius, int32_t srcsprite, int32_t zoffset, int32_t range, int32_t color, int32_t priority)
|
void G_AddGameLight(int32_t radius, int32_t srcsprite, int32_t zoffset, int32_t range, int32_t color, int32_t priority)
|
||||||
{
|
{
|
||||||
|
@ -2722,7 +2722,7 @@ ACTOR_STATIC void Proj_MoveCustom(int32_t i)
|
||||||
Bmemcpy(&davect, s, sizeof(vec3_t));
|
Bmemcpy(&davect, s, sizeof(vec3_t));
|
||||||
|
|
||||||
if (proj->flashcolor)
|
if (proj->flashcolor)
|
||||||
G_AddGameLight(0, i, ((s->yrepeat*tilesizy[s->picnum])<<1), 2048, proj->flashcolor, PR_LIGHT_PRIO_LOW_GAME);
|
G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 2048, proj->flashcolor, PR_LIGHT_PRIO_LOW_GAME);
|
||||||
|
|
||||||
if (proj->workslike & PROJECTILE_BOUNCESOFFWALLS && s->yvel < 1)
|
if (proj->workslike & PROJECTILE_BOUNCESOFFWALLS && s->yvel < 1)
|
||||||
{
|
{
|
||||||
|
@ -8020,7 +8020,7 @@ static void A_DoLight(int32_t i)
|
||||||
s->x += dx>>7;
|
s->x += dx>>7;
|
||||||
s->y += dy>>7;
|
s->y += dy>>7;
|
||||||
|
|
||||||
G_AddGameLight(0, i, ((s->yrepeat*tilesizy[s->picnum])<<1), 1024-ii*256,
|
G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 1024-ii*256,
|
||||||
ii==0 ? (48+(255<<8)+(48<<16)) : 255+(48<<8)+(48<<16), PR_LIGHT_PRIO_LOW);
|
ii==0 ? (48+(255<<8)+(48<<16)) : 255+(48<<8)+(48<<16), PR_LIGHT_PRIO_LOW);
|
||||||
|
|
||||||
s->x -= dx>>7;
|
s->x -= dx>>7;
|
||||||
|
@ -8033,7 +8033,7 @@ static void A_DoLight(int32_t i)
|
||||||
switch (DYNAMICTILEMAP(sprite[i].picnum))
|
switch (DYNAMICTILEMAP(sprite[i].picnum))
|
||||||
{
|
{
|
||||||
case ATOMICHEALTH__STATIC:
|
case ATOMICHEALTH__STATIC:
|
||||||
G_AddGameLight(0, i, ((s->yrepeat*tilesizy[s->picnum])<<1), LIGHTRAD2 * 3, 128+(128<<8)+(255<<16),PR_LIGHT_PRIO_HIGH_GAME);
|
G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), LIGHTRAD2 * 3, 128+(128<<8)+(255<<16),PR_LIGHT_PRIO_HIGH_GAME);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FIRE__STATIC:
|
case FIRE__STATIC:
|
||||||
|
@ -8067,7 +8067,7 @@ static void A_DoLight(int32_t i)
|
||||||
if (jj==-1 && numsavedfires<32)
|
if (jj==-1 && numsavedfires<32)
|
||||||
{
|
{
|
||||||
jj = numsavedfires;
|
jj = numsavedfires;
|
||||||
G_AddGameLight(0, i, ((s->yrepeat*tilesizy[s->picnum])<<1), LIGHTRAD2, color, PR_LIGHT_PRIO_HIGH_GAME);
|
G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), LIGHTRAD2, color, PR_LIGHT_PRIO_HIGH_GAME);
|
||||||
savedfires[jj][0] = s->sectnum;
|
savedfires[jj][0] = s->sectnum;
|
||||||
savedfires[jj][1] = s->x>>3;
|
savedfires[jj][1] = s->x>>3;
|
||||||
savedfires[jj][2] = s->y>>3;
|
savedfires[jj][2] = s->y>>3;
|
||||||
|
@ -8079,12 +8079,12 @@ static void A_DoLight(int32_t i)
|
||||||
|
|
||||||
case OOZFILTER__STATIC:
|
case OOZFILTER__STATIC:
|
||||||
if (s->xrepeat > 4)
|
if (s->xrepeat > 4)
|
||||||
G_AddGameLight(0, i, ((s->yrepeat*tilesizy[s->picnum])<<1), 4096, 128+(255<<8)+(128<<16),PR_LIGHT_PRIO_HIGH_GAME);
|
G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 4096, 128+(255<<8)+(128<<16),PR_LIGHT_PRIO_HIGH_GAME);
|
||||||
break;
|
break;
|
||||||
case FLOORFLAME__STATIC:
|
case FLOORFLAME__STATIC:
|
||||||
case FIREBARREL__STATIC:
|
case FIREBARREL__STATIC:
|
||||||
case FIREVASE__STATIC:
|
case FIREVASE__STATIC:
|
||||||
G_AddGameLight(0, i, ((s->yrepeat*tilesizy[s->picnum])<<1), LIGHTRAD, 255+(95<<8),PR_LIGHT_PRIO_HIGH_GAME);
|
G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), LIGHTRAD, 255+(95<<8),PR_LIGHT_PRIO_HIGH_GAME);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EXPLOSION2__STATIC:
|
case EXPLOSION2__STATIC:
|
||||||
|
@ -8097,7 +8097,7 @@ static void A_DoLight(int32_t i)
|
||||||
s->x -= x;
|
s->x -= x;
|
||||||
s->y -= y;
|
s->y -= y;
|
||||||
|
|
||||||
G_AddGameLight(0, i, ((s->yrepeat*tilesizy[s->picnum])<<1), LIGHTRAD, 255+(95<<8),
|
G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), LIGHTRAD, 255+(95<<8),
|
||||||
s->yrepeat > 32 ? PR_LIGHT_PRIO_HIGH_GAME : PR_LIGHT_PRIO_LOW_GAME);
|
s->yrepeat > 32 ? PR_LIGHT_PRIO_HIGH_GAME : PR_LIGHT_PRIO_LOW_GAME);
|
||||||
|
|
||||||
s->x += x;
|
s->x += x;
|
||||||
|
@ -8106,7 +8106,7 @@ static void A_DoLight(int32_t i)
|
||||||
break;
|
break;
|
||||||
case FORCERIPPLE__STATIC:
|
case FORCERIPPLE__STATIC:
|
||||||
case TRANSPORTERBEAM__STATIC:
|
case TRANSPORTERBEAM__STATIC:
|
||||||
G_AddGameLight(0, i, ((s->yrepeat*tilesizy[s->picnum])<<1), LIGHTRAD, 80+(80<<8)+(255<<16),PR_LIGHT_PRIO_LOW_GAME);
|
G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), LIGHTRAD, 80+(80<<8)+(255<<16),PR_LIGHT_PRIO_LOW_GAME);
|
||||||
break;
|
break;
|
||||||
case GROWSPARK__STATIC:
|
case GROWSPARK__STATIC:
|
||||||
{
|
{
|
||||||
|
@ -8116,7 +8116,7 @@ static void A_DoLight(int32_t i)
|
||||||
s->x -= x;
|
s->x -= x;
|
||||||
s->y -= y;
|
s->y -= y;
|
||||||
|
|
||||||
G_AddGameLight(0, i, ((s->yrepeat*tilesizy[s->picnum])<<1), 2048, 255+(95<<8),PR_LIGHT_PRIO_HIGH_GAME);
|
G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 2048, 255+(95<<8),PR_LIGHT_PRIO_HIGH_GAME);
|
||||||
|
|
||||||
s->x += x;
|
s->x += x;
|
||||||
s->y += y;
|
s->y += y;
|
||||||
|
@ -8130,26 +8130,26 @@ static void A_DoLight(int32_t i)
|
||||||
s->x -= x;
|
s->x -= x;
|
||||||
s->y -= y;
|
s->y -= y;
|
||||||
|
|
||||||
G_AddGameLight(0, i, ((s->yrepeat*tilesizy[s->picnum])<<1), 2048, 128+(255<<8)+(128<<16),PR_LIGHT_PRIO_HIGH_GAME);
|
G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 2048, 128+(255<<8)+(128<<16),PR_LIGHT_PRIO_HIGH_GAME);
|
||||||
|
|
||||||
s->x += x;
|
s->x += x;
|
||||||
s->y += y;
|
s->y += y;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FREEZEBLAST__STATIC:
|
case FREEZEBLAST__STATIC:
|
||||||
G_AddGameLight(0, i, ((s->yrepeat*tilesizy[s->picnum])<<1), LIGHTRAD<<2, 128+(128<<8)+(255<<16),PR_LIGHT_PRIO_HIGH_GAME);
|
G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), LIGHTRAD<<2, 128+(128<<8)+(255<<16),PR_LIGHT_PRIO_HIGH_GAME);
|
||||||
break;
|
break;
|
||||||
case COOLEXPLOSION1__STATIC:
|
case COOLEXPLOSION1__STATIC:
|
||||||
G_AddGameLight(0, i, ((s->yrepeat*tilesizy[s->picnum])<<1), LIGHTRAD<<2, 128+(0<<8)+(255<<16),PR_LIGHT_PRIO_HIGH_GAME);
|
G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), LIGHTRAD<<2, 128+(0<<8)+(255<<16),PR_LIGHT_PRIO_HIGH_GAME);
|
||||||
break;
|
break;
|
||||||
case SHRINKSPARK__STATIC:
|
case SHRINKSPARK__STATIC:
|
||||||
G_AddGameLight(0, i, ((s->yrepeat*tilesizy[s->picnum])<<1), LIGHTRAD, 128+(255<<8)+(128<<16),PR_LIGHT_PRIO_HIGH_GAME);
|
G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), LIGHTRAD, 128+(255<<8)+(128<<16),PR_LIGHT_PRIO_HIGH_GAME);
|
||||||
break;
|
break;
|
||||||
case FIRELASER__STATIC:
|
case FIRELASER__STATIC:
|
||||||
G_AddGameLight(0, i, ((s->yrepeat*tilesizy[s->picnum])<<1), 64 * s->yrepeat, 255+(95<<8),PR_LIGHT_PRIO_LOW_GAME);
|
G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 64 * s->yrepeat, 255+(95<<8),PR_LIGHT_PRIO_LOW_GAME);
|
||||||
break;
|
break;
|
||||||
case RPG__STATIC:
|
case RPG__STATIC:
|
||||||
G_AddGameLight(0, i, ((s->yrepeat*tilesizy[s->picnum])<<1), 128 * s->yrepeat, 255+(95<<8),PR_LIGHT_PRIO_LOW_GAME);
|
G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 128 * s->yrepeat, 255+(95<<8),PR_LIGHT_PRIO_LOW_GAME);
|
||||||
break;
|
break;
|
||||||
case SHOTSPARK1__STATIC:
|
case SHOTSPARK1__STATIC:
|
||||||
if (actor[i].t_data[2] == 0) // check for first frame of action
|
if (actor[i].t_data[2] == 0) // check for first frame of action
|
||||||
|
@ -8160,7 +8160,7 @@ static void A_DoLight(int32_t i)
|
||||||
s->x -= x;
|
s->x -= x;
|
||||||
s->y -= y;
|
s->y -= y;
|
||||||
|
|
||||||
G_AddGameLight(0, i, ((s->yrepeat*tilesizy[s->picnum])<<1), 16 * s->yrepeat, 255+(95<<8),PR_LIGHT_PRIO_LOW_GAME);
|
G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 16 * s->yrepeat, 255+(95<<8),PR_LIGHT_PRIO_LOW_GAME);
|
||||||
actor[i].lightcount = 1;
|
actor[i].lightcount = 1;
|
||||||
|
|
||||||
s->x += x;
|
s->x += x;
|
||||||
|
|
|
@ -375,8 +375,8 @@ int32_t G_PlayAnim(const char *fn, char t)
|
||||||
if (!animbuf[t-1])
|
if (!animbuf[t-1])
|
||||||
allocache((intptr_t *)&animbuf[t-1], length+1, &animlock[t-1]);
|
allocache((intptr_t *)&animbuf[t-1], length+1, &animlock[t-1]);
|
||||||
|
|
||||||
tilesizx[TILE_ANIM] = 200;
|
tilesiz[TILE_ANIM].x = 200;
|
||||||
tilesizy[TILE_ANIM] = 320;
|
tilesiz[TILE_ANIM].y = 320;
|
||||||
|
|
||||||
kread(handle, animbuf[t-1], length);
|
kread(handle, animbuf[t-1], length);
|
||||||
kclose(handle);
|
kclose(handle);
|
||||||
|
|
|
@ -2115,15 +2115,15 @@ static void ExtSE40Draw(int32_t spnum,int32_t x,int32_t y,int32_t z,int16_t a,in
|
||||||
// return;
|
// return;
|
||||||
// gotpic[FOF>>3] &= ~(1<<(FOF&7));
|
// gotpic[FOF>>3] &= ~(1<<(FOF&7));
|
||||||
|
|
||||||
if (tilesizx[562])
|
if (tilesiz[562].x)
|
||||||
{
|
{
|
||||||
fofsizex = tilesizx[562];
|
fofsizex = tilesiz[562].x;
|
||||||
tilesizx[562] = 0;
|
tilesiz[562].x = 0;
|
||||||
}
|
}
|
||||||
if (tilesizy[562])
|
if (tilesiz[562].y)
|
||||||
{
|
{
|
||||||
fofsizey = tilesizy[562];
|
fofsizey = tilesiz[562].y;
|
||||||
tilesizy[562] = 0;
|
tilesiz[562].y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
floor1=spnum;
|
floor1=spnum;
|
||||||
|
@ -2467,7 +2467,7 @@ int32_t AskIfSure(const char *text)
|
||||||
|
|
||||||
static int32_t IsValidTile(int32_t idTile)
|
static int32_t IsValidTile(int32_t idTile)
|
||||||
{
|
{
|
||||||
return (idTile>=0 && idTile<MAXTILES) && (tilesizx[idTile] && tilesizy[idTile]);
|
return (idTile>=0 && idTile<MAXTILES) && (tilesiz[idTile].x && tilesiz[idTile].y);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t SelectAllTiles(int32_t iCurrentTile)
|
static int32_t SelectAllTiles(int32_t iCurrentTile)
|
||||||
|
@ -3348,7 +3348,7 @@ static const char *GetTilePixels(int32_t idTile)
|
||||||
static void classic_drawtilescreen(int32_t x, int32_t y, int32_t idTile, int32_t TileDim,
|
static void classic_drawtilescreen(int32_t x, int32_t y, int32_t idTile, int32_t TileDim,
|
||||||
const char *pRawPixels)
|
const char *pRawPixels)
|
||||||
{
|
{
|
||||||
int32_t dispxsz = tilesizx[idTile], dispysz = tilesizy[idTile];
|
int32_t dispxsz = tilesiz[idTile].x, dispysz = tilesiz[idTile].y;
|
||||||
int32_t divinc = 1, mulinc = 1;
|
int32_t divinc = 1, mulinc = 1;
|
||||||
|
|
||||||
int32_t xofs, yofs;
|
int32_t xofs, yofs;
|
||||||
|
@ -3378,7 +3378,7 @@ static void classic_drawtilescreen(int32_t x, int32_t y, int32_t idTile, int32_t
|
||||||
pScreen = (char *)ylookup[y]+x+frameplace;
|
pScreen = (char *)ylookup[y]+x+frameplace;
|
||||||
for (xofs = 0; xofs < dispxsz; xofs++)
|
for (xofs = 0; xofs < dispxsz; xofs++)
|
||||||
{
|
{
|
||||||
pScreen[xofs] = pRawPixels[((yofs*divinc)/mulinc) + (((xofs*divinc)/mulinc)*tilesizy[idTile])];
|
pScreen[xofs] = pRawPixels[((yofs*divinc)/mulinc) + (((xofs*divinc)/mulinc)*tilesiz[idTile].y)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
y -= yofs;
|
y -= yofs;
|
||||||
|
@ -3457,7 +3457,7 @@ static void tilescreen_drawrest(int32_t iSelected, int32_t showmsg)
|
||||||
printext256(xdim-(Bstrlen(names[idTile])<<3)-1,ydim-10,whitecol,-1,names[idTile],0);
|
printext256(xdim-(Bstrlen(names[idTile])<<3)-1,ydim-10,whitecol,-1,names[idTile],0);
|
||||||
|
|
||||||
// Tile dimensions.
|
// Tile dimensions.
|
||||||
Bsprintf(szT,"%dx%d",tilesizx[idTile],tilesizy[idTile]);
|
Bsprintf(szT,"%dx%d",tilesiz[idTile].x,tilesiz[idTile].y);
|
||||||
printext256(xdim>>2,ydim-10,whitecol,-1,szT,0);
|
printext256(xdim>>2,ydim-10,whitecol,-1,szT,0);
|
||||||
|
|
||||||
// EditArt offset flags.
|
// EditArt offset flags.
|
||||||
|
@ -3650,7 +3650,7 @@ static void drawtileinfo(const char *title,int32_t x,int32_t y,int32_t picnum,in
|
||||||
int32_t small = (xdimgame<=640);
|
int32_t small = (xdimgame<=640);
|
||||||
int32_t oviewingrange=viewingrange, oyxaspect=yxaspect;
|
int32_t oviewingrange=viewingrange, oyxaspect=yxaspect;
|
||||||
|
|
||||||
if (tilesizx[picnum]>0 && tilesizy[picnum]>0)
|
if (tilesiz[picnum].x>0 && tilesiz[picnum].y>0)
|
||||||
{
|
{
|
||||||
double scalediv;
|
double scalediv;
|
||||||
int32_t scale=65536;
|
int32_t scale=65536;
|
||||||
|
@ -3660,7 +3660,7 @@ static void drawtileinfo(const char *title,int32_t x,int32_t y,int32_t picnum,in
|
||||||
x1 /= 2;
|
x1 /= 2;
|
||||||
|
|
||||||
x1 = (int32_t)(x1 * 320.0/xdimgame);
|
x1 = (int32_t)(x1 * 320.0/xdimgame);
|
||||||
scalediv = max(tilesizx[picnum],tilesizy[picnum])/24.0;
|
scalediv = max(tilesiz[picnum].x,tilesiz[picnum].y)/24.0;
|
||||||
scale = (int32_t)((double)scale/scalediv);
|
scale = (int32_t)((double)scale/scalediv);
|
||||||
|
|
||||||
setaspect(65536L, (int32_t)divscale16(ydim*320L,xdim*200L));
|
setaspect(65536L, (int32_t)divscale16(ydim*320L,xdim*200L));
|
||||||
|
@ -3868,7 +3868,7 @@ static void TextEntryMode(int16_t startspr)
|
||||||
alphidx = i;
|
alphidx = i;
|
||||||
basetile = t;
|
basetile = t;
|
||||||
if (spcgap[i] == 0)
|
if (spcgap[i] == 0)
|
||||||
spcgap[i] = 3*tilesizx[t]/2;
|
spcgap[i] = 3*tilesiz[t].x/2;
|
||||||
goto ENDFOR1;
|
goto ENDFOR1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3894,8 +3894,8 @@ ENDFOR1:
|
||||||
Bmemcpy(sp, &sprite[startspr], sizeof(spritetype));
|
Bmemcpy(sp, &sprite[startspr], sizeof(spritetype));
|
||||||
sp->yoffset = 0;
|
sp->yoffset = 0;
|
||||||
sp->picnum = SMALLFNTCURSOR;
|
sp->picnum = SMALLFNTCURSOR;
|
||||||
sp->xrepeat = clamp(sp->xrepeat/tilesizx[sp->picnum], 2, 255);
|
sp->xrepeat = clamp(sp->xrepeat/tilesiz[sp->picnum].x, 2, 255);
|
||||||
sp->yrepeat = clamp((sp->yrepeat*tilesizy[sprite[startspr].picnum])/tilesizy[sp->picnum], 4, 255);
|
sp->yrepeat = clamp((sp->yrepeat*tilesiz[sprite[startspr].picnum].y)/tilesiz[sp->picnum].y, 4, 255);
|
||||||
sp->pal = 0;
|
sp->pal = 0;
|
||||||
sp->cstat = 18;
|
sp->cstat = 18;
|
||||||
|
|
||||||
|
@ -3966,7 +3966,7 @@ ENDFOR1:
|
||||||
daang = sp->ang;
|
daang = sp->ang;
|
||||||
}
|
}
|
||||||
|
|
||||||
j = sp->xrepeat*(hgap+tilesizx[sp->picnum]+2);
|
j = sp->xrepeat*(hgap+tilesiz[sp->picnum].x+2);
|
||||||
{
|
{
|
||||||
vec3_t vect;
|
vec3_t vect;
|
||||||
vect.x = dax + ((j*sintable[daang])>>17);
|
vect.x = dax + ((j*sintable[daang])>>17);
|
||||||
|
@ -3981,7 +3981,7 @@ ENDFOR1:
|
||||||
|
|
||||||
// mapping char->tilenum
|
// mapping char->tilenum
|
||||||
t = alphabets[alphidx].pic[ch-33];
|
t = alphabets[alphidx].pic[ch-33];
|
||||||
j = sp->xrepeat*(hgap+tilesizx[sp->picnum]+tilesizx[t]);
|
j = sp->xrepeat*(hgap+tilesiz[sp->picnum].x+tilesiz[t].x);
|
||||||
|
|
||||||
dax += (j*sintable[daang])>>17;
|
dax += (j*sintable[daang])>>17;
|
||||||
day -= (j*sintable[(daang+512)&2047])>>17;
|
day -= (j*sintable[(daang+512)&2047])>>17;
|
||||||
|
@ -4070,13 +4070,13 @@ ENDFOR1:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprite[linebegspr].z -= ((sprite[linebegspr].yrepeat*(vgap+tilesizy[basetile]))<<2);
|
sprite[linebegspr].z -= ((sprite[linebegspr].yrepeat*(vgap+tilesiz[basetile].y))<<2);
|
||||||
asksave = 1;
|
asksave = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ch == 13) // enter
|
else if (ch == 13) // enter
|
||||||
{
|
{
|
||||||
sprite[linebegspr].z += ((sprite[linebegspr].yrepeat*(vgap+tilesizy[basetile]))<<2);
|
sprite[linebegspr].z += ((sprite[linebegspr].yrepeat*(vgap+tilesiz[basetile].y))<<2);
|
||||||
curspr = linebegspr;
|
curspr = linebegspr;
|
||||||
doingspace = 0;
|
doingspace = 0;
|
||||||
asksave = 1;
|
asksave = 1;
|
||||||
|
@ -5082,7 +5082,7 @@ static void Keys3d(void)
|
||||||
pic += dir + MAXTILES;
|
pic += dir + MAXTILES;
|
||||||
pic %= MAXTILES;
|
pic %= MAXTILES;
|
||||||
}
|
}
|
||||||
while (tilesizx[pic]<=0 || tilesizy[pic]<=0);
|
while (tilesiz[pic].x<=0 || tilesiz[pic].y<=0);
|
||||||
AIMED_SELOVR_PICNUM = pic;
|
AIMED_SELOVR_PICNUM = pic;
|
||||||
|
|
||||||
if (AIMING_AT_SPRITE)
|
if (AIMING_AT_SPRITE)
|
||||||
|
@ -6152,7 +6152,7 @@ static void Keys3d(void)
|
||||||
updownunits = klabs(mousey);
|
updownunits = klabs(mousey);
|
||||||
|
|
||||||
if (!AIMING_AT_SPRITE)
|
if (!AIMING_AT_SPRITE)
|
||||||
updownunits = klabs((int32_t)(mousey*128./tilesizy[wall[searchwall].picnum]));
|
updownunits = klabs((int32_t)(mousey*128./tilesiz[wall[searchwall].picnum].y));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (eitherCTRL && !eitherALT)
|
else if (eitherCTRL && !eitherALT)
|
||||||
|
@ -6375,7 +6375,7 @@ static void Keys3d(void)
|
||||||
{
|
{
|
||||||
// world-aligned texture
|
// world-aligned texture
|
||||||
|
|
||||||
if (tilesizx[tile]<=0 || tilesizy[tile]<=0)
|
if (tilesiz[tile].x<=0 || tilesiz[tile].y<=0)
|
||||||
{
|
{
|
||||||
message("Can't align sector %d's %s, reference sector %d's has void tile",
|
message("Can't align sector %d's %s, reference sector %d's has void tile",
|
||||||
searchsector, typestr[searchstat], tempsectornum);
|
searchsector, typestr[searchstat], tempsectornum);
|
||||||
|
@ -6708,11 +6708,11 @@ paste_ceiling_or_floor:
|
||||||
{
|
{
|
||||||
sprite[searchwall].picnum = temppicnum;
|
sprite[searchwall].picnum = temppicnum;
|
||||||
|
|
||||||
if (tilesizx[temppicnum] <= 0 || tilesizy[temppicnum] <= 0)
|
if (tilesiz[temppicnum].x <= 0 || tilesiz[temppicnum].y <= 0)
|
||||||
{
|
{
|
||||||
j = 0;
|
j = 0;
|
||||||
for (k=0; k<MAXTILES; k++)
|
for (k=0; k<MAXTILES; k++)
|
||||||
if (tilesizx[k] > 0 && tilesizy[k] > 0)
|
if (tilesiz[k].x > 0 && tilesiz[k].y > 0)
|
||||||
{
|
{
|
||||||
j = k;
|
j = k;
|
||||||
break;
|
break;
|
||||||
|
@ -10181,7 +10181,7 @@ void ExtPreCheckKeys(void) // just before drawrooms
|
||||||
if (frames==5) picnum+=(((totalclock>>5)%5))*5;
|
if (frames==5) picnum+=(((totalclock>>5)%5))*5;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tilesizx[picnum] == 0)
|
if (tilesiz[picnum].x == 0)
|
||||||
picnum -= 5; //Hack, for actors
|
picnum -= 5; //Hack, for actors
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10196,7 +10196,7 @@ void ExtPreCheckKeys(void) // just before drawrooms
|
||||||
shade = 6;
|
shade = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
ovhscrcoords(sprite[i].x, sprite[i].y-(tilesizy[picnum]<<2), &xp1, &yp1);
|
ovhscrcoords(sprite[i].x, sprite[i].y-(tilesiz[picnum].y<<2), &xp1, &yp1);
|
||||||
|
|
||||||
ydim16 = ydim-STATUS2DSIZ2; // XXX?
|
ydim16 = ydim-STATUS2DSIZ2; // XXX?
|
||||||
|
|
||||||
|
@ -10400,7 +10400,7 @@ void ExtAnalyzeSprites(int32_t ourx, int32_t oury, int32_t oura, int32_t smoothr
|
||||||
if (frames==4) tspr->picnum += (((4-(totalclock>>5)))&3)*5;
|
if (frames==4) tspr->picnum += (((4-(totalclock>>5)))&3)*5;
|
||||||
if (frames==5) tspr->picnum += ((totalclock>>5)%5)*5;
|
if (frames==5) tspr->picnum += ((totalclock>>5)%5)*5;
|
||||||
|
|
||||||
if (tilesizx[tspr->picnum] == 0)
|
if (tilesiz[tspr->picnum].x == 0)
|
||||||
tspr->picnum -= 5; //Hack, for actors
|
tspr->picnum -= 5; //Hack, for actors
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -279,8 +279,8 @@ int32_t textsc(int32_t sc)
|
||||||
static void G_PatchStatusBar(int32_t x1, int32_t y1, int32_t x2, int32_t y2)
|
static void G_PatchStatusBar(int32_t x1, int32_t y1, int32_t x2, int32_t y2)
|
||||||
{
|
{
|
||||||
int32_t scl = sbarsc(65536);
|
int32_t scl = sbarsc(65536);
|
||||||
int32_t tx = sbarx16((160<<16) - (tilesizx[BOTTOMSTATUSBAR]<<15)); // centered
|
int32_t tx = sbarx16((160<<16) - (tilesiz[BOTTOMSTATUSBAR].x<<15)); // centered
|
||||||
int32_t ty = sbary(200-tilesizy[BOTTOMSTATUSBAR]);
|
int32_t ty = sbary(200-tilesiz[BOTTOMSTATUSBAR].y);
|
||||||
|
|
||||||
int32_t clx1 = sbarsc(scale(x1,xdim,320)), cly1 = sbarsc(scale(y1,ydim,200));
|
int32_t clx1 = sbarsc(scale(x1,xdim,320)), cly1 = sbarsc(scale(y1,ydim,200));
|
||||||
int32_t clx2 = sbarsc(scale(x2,xdim,320)), cly2 = sbarsc(scale(y2,ydim,200));
|
int32_t clx2 = sbarsc(scale(x2,xdim,320)), cly2 = sbarsc(scale(y2,ydim,200));
|
||||||
|
@ -524,7 +524,7 @@ vec2_t G_ScreenTextSize(const int32_t font,
|
||||||
space = '\x7F'; // tile after '~'
|
space = '\x7F'; // tile after '~'
|
||||||
tile = G_GetStringTile(font, &space, f);
|
tile = G_GetStringTile(font, &space, f);
|
||||||
|
|
||||||
extent.x += (tilesizx[tile] * z);
|
extent.x += (tilesiz[tile].x * z);
|
||||||
}
|
}
|
||||||
|
|
||||||
// prepare the height // near-CODEDUP the other two near-CODEDUPs for this section
|
// prepare the height // near-CODEDUP the other two near-CODEDUPs for this section
|
||||||
|
@ -538,7 +538,7 @@ vec2_t G_ScreenTextSize(const int32_t font,
|
||||||
line = '\x7F'; // tile after '~'
|
line = '\x7F'; // tile after '~'
|
||||||
tile = G_GetStringTile(font, &line, f);
|
tile = G_GetStringTile(font, &line, f);
|
||||||
|
|
||||||
tempyextent += tilesizy[tile] * z;
|
tempyextent += tilesiz[tile].y * z;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetIfGreater(&extent.y, tempyextent);
|
SetIfGreater(&extent.y, tempyextent);
|
||||||
|
@ -569,7 +569,7 @@ vec2_t G_ScreenTextSize(const int32_t font,
|
||||||
line = '\x7F'; // tile after '~'
|
line = '\x7F'; // tile after '~'
|
||||||
tile = G_GetStringTile(font, &line, f);
|
tile = G_GetStringTile(font, &line, f);
|
||||||
|
|
||||||
tempyextent += tilesizy[tile] * z;
|
tempyextent += tilesiz[tile].y * z;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetIfGreater(&extent.y, tempyextent);
|
SetIfGreater(&extent.y, tempyextent);
|
||||||
|
@ -590,17 +590,17 @@ vec2_t G_ScreenTextSize(const int32_t font,
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// width
|
// width
|
||||||
extent.x = tilesizx[tile] * z;
|
extent.x = tilesiz[tile].x * z;
|
||||||
|
|
||||||
// obnoxious hardcoded functionality from gametext
|
// obnoxious hardcoded functionality from gametext
|
||||||
if (NUMHACKACTIVE)
|
if (NUMHACKACTIVE)
|
||||||
{
|
{
|
||||||
char numeral = '0'; // this is subject to change as an implementation detail
|
char numeral = '0'; // this is subject to change as an implementation detail
|
||||||
extent.x = (tilesizx[G_GetStringTile(font, &numeral, f)]-1) * z;
|
extent.x = (tilesiz[G_GetStringTile(font, &numeral, f)].x-1) * z;
|
||||||
}
|
}
|
||||||
|
|
||||||
// height
|
// height
|
||||||
SetIfGreater(&extent.y, (tilesizy[tile] * z));
|
SetIfGreater(&extent.y, (tilesiz[tile].y * z));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -659,7 +659,7 @@ vec2_t G_ScreenTextSize(const int32_t font,
|
||||||
line = '\x7F'; // tile after '~'
|
line = '\x7F'; // tile after '~'
|
||||||
tile = G_GetStringTile(font, &line, f);
|
tile = G_GetStringTile(font, &line, f);
|
||||||
|
|
||||||
tempyextent += tilesizy[tile] * z;
|
tempyextent += tilesiz[tile].y * z;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetIfGreater(&extent.y, tempyextent);
|
SetIfGreater(&extent.y, tempyextent);
|
||||||
|
@ -932,7 +932,7 @@ vec2_t G_ScreenText(const int32_t font,
|
||||||
space = '\x7F'; // tile after '~'
|
space = '\x7F'; // tile after '~'
|
||||||
tile = G_GetStringTile(font, &space, f);
|
tile = G_GetStringTile(font, &space, f);
|
||||||
|
|
||||||
extent.x += (tilesizx[tile] * z);
|
extent.x += (tilesiz[tile].x * z);
|
||||||
}
|
}
|
||||||
|
|
||||||
// prepare the height // near-CODEDUP the other two near-CODEDUPs for this section
|
// prepare the height // near-CODEDUP the other two near-CODEDUPs for this section
|
||||||
|
@ -946,7 +946,7 @@ vec2_t G_ScreenText(const int32_t font,
|
||||||
line = '\x7F'; // tile after '~'
|
line = '\x7F'; // tile after '~'
|
||||||
tile = G_GetStringTile(font, &line, f);
|
tile = G_GetStringTile(font, &line, f);
|
||||||
|
|
||||||
tempyextent += tilesizy[tile] * z;
|
tempyextent += tilesiz[tile].y * z;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetIfGreater(&extent.y, tempyextent);
|
SetIfGreater(&extent.y, tempyextent);
|
||||||
|
@ -972,7 +972,7 @@ vec2_t G_ScreenText(const int32_t font,
|
||||||
line = '\x7F'; // tile after '~'
|
line = '\x7F'; // tile after '~'
|
||||||
tile = G_GetStringTile(font, &line, f);
|
tile = G_GetStringTile(font, &line, f);
|
||||||
|
|
||||||
tempyextent += tilesizy[tile] * z;
|
tempyextent += tilesiz[tile].y * z;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetIfGreater(&extent.y, tempyextent);
|
SetIfGreater(&extent.y, tempyextent);
|
||||||
|
@ -1016,17 +1016,17 @@ vec2_t G_ScreenText(const int32_t font,
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// width
|
// width
|
||||||
extent.x = tilesizx[tile] * z;
|
extent.x = tilesiz[tile].x * z;
|
||||||
|
|
||||||
// obnoxious hardcoded functionality from gametext
|
// obnoxious hardcoded functionality from gametext
|
||||||
if (NUMHACKACTIVE)
|
if (NUMHACKACTIVE)
|
||||||
{
|
{
|
||||||
char numeral = '0'; // this is subject to change as an implementation detail
|
char numeral = '0'; // this is subject to change as an implementation detail
|
||||||
extent.x = (tilesizx[G_GetStringTile(font, &numeral, f)]-1) * z;
|
extent.x = (tilesiz[G_GetStringTile(font, &numeral, f)].x-1) * z;
|
||||||
}
|
}
|
||||||
|
|
||||||
// height
|
// height
|
||||||
SetIfGreater(&extent.y, (tilesizy[tile] * z));
|
SetIfGreater(&extent.y, (tilesiz[tile].y * z));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1082,7 +1082,7 @@ vec2_t G_ScreenText(const int32_t font,
|
||||||
line = '\x7F'; // tile after '~'
|
line = '\x7F'; // tile after '~'
|
||||||
tile = G_GetStringTile(font, &line, f);
|
tile = G_GetStringTile(font, &line, f);
|
||||||
|
|
||||||
tempyextent += tilesizy[tile] * z;
|
tempyextent += tilesiz[tile].y * z;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetIfGreater(&extent.y, tempyextent);
|
SetIfGreater(&extent.y, tempyextent);
|
||||||
|
@ -1764,7 +1764,7 @@ static void G_DrawAltDigiNum(int32_t x, int32_t y, int32_t n, char s, int32_t cs
|
||||||
for (k=i-1; k>=0; k--)
|
for (k=i-1; k>=0; k--)
|
||||||
{
|
{
|
||||||
p = althud_numbertile + b[k]-'0';
|
p = althud_numbertile + b[k]-'0';
|
||||||
j += tilesizx[p]+1;
|
j += tilesiz[p].x+1;
|
||||||
}
|
}
|
||||||
c = x-(j>>1);
|
c = x-(j>>1);
|
||||||
|
|
||||||
|
@ -1776,7 +1776,7 @@ static void G_DrawAltDigiNum(int32_t x, int32_t y, int32_t n, char s, int32_t cs
|
||||||
if (shd && getrendermode() >= REND_POLYMOST && althud_shadows)
|
if (shd && getrendermode() >= REND_POLYMOST && althud_shadows)
|
||||||
rotatesprite_fs(sbarxr(c+j-1),sbary(y+1),sbscale,0,p,127,4,cs|POLYMOSTTRANS2);
|
rotatesprite_fs(sbarxr(c+j-1),sbary(y+1),sbscale,0,p,127,4,cs|POLYMOSTTRANS2);
|
||||||
rotatesprite_fs(sbarxr(c+j),sbary(y),sbscale,0,p,s,althud_numberpal,cs);
|
rotatesprite_fs(sbarxr(c+j),sbary(y),sbscale,0,p,s,althud_numberpal,cs);
|
||||||
j -= tilesizx[p]+1;
|
j -= tilesiz[p].x+1;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1788,7 +1788,7 @@ static void G_DrawAltDigiNum(int32_t x, int32_t y, int32_t n, char s, int32_t cs
|
||||||
if (shd && getrendermode() >= REND_POLYMOST && althud_shadows)
|
if (shd && getrendermode() >= REND_POLYMOST && althud_shadows)
|
||||||
rotatesprite_fs(sbarx(c+j+1),sbary(y+1),sbscale,0,p,127,4,cs|POLYMOSTTRANS2);
|
rotatesprite_fs(sbarx(c+j+1),sbary(y+1),sbscale,0,p,127,4,cs|POLYMOSTTRANS2);
|
||||||
rotatesprite_fs(sbarx(c+j),sbary(y),sbscale,0,p,s,althud_numberpal,cs);
|
rotatesprite_fs(sbarx(c+j),sbary(y),sbscale,0,p,s,althud_numberpal,cs);
|
||||||
j += tilesizx[p]+1;
|
j += tilesiz[p].x+1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1825,14 +1825,14 @@ static void G_DrawInventory(const DukePlayer_t *p)
|
||||||
y = 172<<16;
|
y = 172<<16;
|
||||||
|
|
||||||
if (ud.screen_size == 4 && ud.althud == 1) // modern mini-HUD
|
if (ud.screen_size == 4 && ud.althud == 1) // modern mini-HUD
|
||||||
y -= invensc(tilesizy[BIGALPHANUM]+10); // slide on the y-axis
|
y -= invensc(tilesiz[BIGALPHANUM].y+10); // slide on the y-axis
|
||||||
}
|
}
|
||||||
else // full HUD
|
else // full HUD
|
||||||
{
|
{
|
||||||
y = (200<<16) - (sbarsc(tilesizy[BOTTOMSTATUSBAR]<<16) + (12<<16) + (tilesizy[BOTTOMSTATUSBAR]<<(16-1)));
|
y = (200<<16) - (sbarsc(tilesiz[BOTTOMSTATUSBAR].y<<16) + (12<<16) + (tilesiz[BOTTOMSTATUSBAR].y<<(16-1)));
|
||||||
|
|
||||||
if (!ud.statusbarmode) // original non-overlay mode
|
if (!ud.statusbarmode) // original non-overlay mode
|
||||||
y += sbarsc(tilesizy[BOTTOMSTATUSBAR]<<16)>>1; // account for the viewport y-size as the HUD scales
|
y += sbarsc(tilesiz[BOTTOMSTATUSBAR].y<<16)>>1; // account for the viewport y-size as the HUD scales
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ud.screen_size == 4 && !ud.althud) // classic mini-HUD
|
if (ud.screen_size == 4 && !ud.althud) // classic mini-HUD
|
||||||
|
@ -1975,7 +1975,7 @@ static void G_DrawStatusBar(int32_t snum)
|
||||||
const int32_t althud = ud.althud;
|
const int32_t althud = ud.althud;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const int32_t SBY = (200-tilesizy[BOTTOMSTATUSBAR]);
|
const int32_t SBY = (200-tilesiz[BOTTOMSTATUSBAR].y);
|
||||||
|
|
||||||
const int32_t sb15 = sbarsc(32768), sb15h = sbarsc(49152);
|
const int32_t sb15 = sbarsc(32768), sb15h = sbarsc(49152);
|
||||||
const int32_t sb16 = sbarsc(65536);
|
const int32_t sb16 = sbarsc(65536);
|
||||||
|
@ -3127,7 +3127,7 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16
|
||||||
l = spr->xrepeat;
|
l = spr->xrepeat;
|
||||||
dax = sintable[k&2047]*l;
|
dax = sintable[k&2047]*l;
|
||||||
day = sintable[(k+1536)&2047]*l;
|
day = sintable[(k+1536)&2047]*l;
|
||||||
l = tilesizx[tilenum];
|
l = tilesiz[tilenum].x;
|
||||||
k = (l>>1)+xoff;
|
k = (l>>1)+xoff;
|
||||||
x1 -= mulscale16(dax,k);
|
x1 -= mulscale16(dax,k);
|
||||||
x2 = x1+mulscale16(dax,l);
|
x2 = x1+mulscale16(dax,l);
|
||||||
|
@ -3160,9 +3160,9 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16
|
||||||
k = spr->ang;
|
k = spr->ang;
|
||||||
cosang = sintable[(k+512)&2047];
|
cosang = sintable[(k+512)&2047];
|
||||||
sinang = sintable[k&2047];
|
sinang = sintable[k&2047];
|
||||||
xspan = tilesizx[tilenum];
|
xspan = tilesiz[tilenum].x;
|
||||||
xrepeat = spr->xrepeat;
|
xrepeat = spr->xrepeat;
|
||||||
yspan = tilesizy[tilenum];
|
yspan = tilesiz[tilenum].y;
|
||||||
yrepeat = spr->yrepeat;
|
yrepeat = spr->yrepeat;
|
||||||
|
|
||||||
dax = ((xspan>>1)+xoff)*xrepeat;
|
dax = ((xspan>>1)+xoff)*xrepeat;
|
||||||
|
@ -3232,8 +3232,8 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16
|
||||||
{
|
{
|
||||||
if (wal->nextwall >= 0) continue;
|
if (wal->nextwall >= 0) continue;
|
||||||
|
|
||||||
if (tilesizx[wal->picnum] == 0) continue;
|
if (tilesiz[wal->picnum].x == 0) continue;
|
||||||
if (tilesizy[wal->picnum] == 0) continue;
|
if (tilesiz[wal->picnum].y == 0) continue;
|
||||||
|
|
||||||
if (j == k)
|
if (j == k)
|
||||||
{
|
{
|
||||||
|
@ -3320,7 +3320,7 @@ void G_GetCrosshairColor(void)
|
||||||
ptr = (char *)waloff[CROSSHAIR];
|
ptr = (char *)waloff[CROSSHAIR];
|
||||||
}
|
}
|
||||||
|
|
||||||
ii = tilesizx[CROSSHAIR]*tilesizy[CROSSHAIR];
|
ii = tilesiz[CROSSHAIR].x * tilesiz[CROSSHAIR].y;
|
||||||
|
|
||||||
if (ii <= 0) return;
|
if (ii <= 0) return;
|
||||||
|
|
||||||
|
@ -3358,7 +3358,7 @@ void G_SetCrosshairColor(int32_t r, int32_t g, int32_t b)
|
||||||
ptr = (char *)waloff[CROSSHAIR];
|
ptr = (char *)waloff[CROSSHAIR];
|
||||||
}
|
}
|
||||||
|
|
||||||
ii = tilesizx[CROSSHAIR]*tilesizy[CROSSHAIR];
|
ii = tilesiz[CROSSHAIR].x * tilesiz[CROSSHAIR].y;
|
||||||
if (ii <= 0) return;
|
if (ii <= 0) return;
|
||||||
|
|
||||||
if (getrendermode() == REND_CLASSIC)
|
if (getrendermode() == REND_CLASSIC)
|
||||||
|
@ -3845,10 +3845,10 @@ void G_DisplayRest(int32_t smoothratio)
|
||||||
{
|
{
|
||||||
if (ud.althud == 2)
|
if (ud.althud == 2)
|
||||||
i = 2;
|
i = 2;
|
||||||
else i = sbarsc(ud.althud?tilesizy[BIGALPHANUM]+10:tilesizy[INVENTORYBOX]+2);
|
else i = sbarsc(ud.althud ? tilesiz[BIGALPHANUM].y+10 : tilesiz[INVENTORYBOX].y+2);
|
||||||
}
|
}
|
||||||
else if (ud.screen_size > 2)
|
else if (ud.screen_size > 2)
|
||||||
i = sbarsc(tilesizy[BOTTOMSTATUSBAR]+1);
|
i = sbarsc(tilesiz[BOTTOMSTATUSBAR].y+1);
|
||||||
else
|
else
|
||||||
i = 2;
|
i = 2;
|
||||||
|
|
||||||
|
@ -4016,7 +4016,7 @@ void G_DrawBackground(void)
|
||||||
|
|
||||||
flushperms();
|
flushperms();
|
||||||
|
|
||||||
if (tilesizx[dapicnum] == 0 || tilesizy[dapicnum] == 0)
|
if (tilesiz[dapicnum].x == 0 || tilesiz[dapicnum].y == 0)
|
||||||
{
|
{
|
||||||
pus = pub = NUMPAGES;
|
pus = pub = NUMPAGES;
|
||||||
return;
|
return;
|
||||||
|
@ -4035,7 +4035,7 @@ void G_DrawBackground(void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const int32_t MENUTILE = MENUSCREEN;//(getrendermode() == REND_CLASSIC ? MENUSCREEN : LOADSCREEN);
|
const int32_t MENUTILE = MENUSCREEN;//(getrendermode() == REND_CLASSIC ? MENUSCREEN : LOADSCREEN);
|
||||||
const int32_t fstilep = tilesizx[MENUTILE]>=320 && tilesizy[MENUTILE]==200;
|
const int32_t fstilep = tilesiz[MENUTILE].x>=320 && tilesiz[MENUTILE].y==200;
|
||||||
int32_t bgtile = (fstilep ? MENUTILE : BIGHOLE);
|
int32_t bgtile = (fstilep ? MENUTILE : BIGHOLE);
|
||||||
|
|
||||||
clearallviews(0);
|
clearallviews(0);
|
||||||
|
@ -4052,35 +4052,35 @@ void G_DrawBackground(void)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if ((unsigned)bgtile < MAXTILES)
|
if ((unsigned)bgtile < MAXTILES)
|
||||||
for (y=y1; y<y2; y+=tilesizy[bgtile])
|
for (y=y1; y<y2; y+=tilesiz[bgtile].y)
|
||||||
for (x=0; x<xdim; x+=tilesizx[bgtile])
|
for (x=0; x<xdim; x+=tilesiz[bgtile].x)
|
||||||
rotatesprite_fs(x<<16,y<<16,65536L,0,bgtile,16,0,8+16+64);
|
rotatesprite_fs(x<<16,y<<16,65536L,0,bgtile,16,0,8+16+64);
|
||||||
}
|
}
|
||||||
else rotatesprite_fs(160<<16,100<<16,65536L,0,bgtile,16,0,2+8+64+(ud.bgstretch?1024:0));
|
else rotatesprite_fs(160<<16,100<<16,65536L,0,bgtile,16,0,2+8+64+(ud.bgstretch?1024:0));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
y2 = scale(ydim,200-sbarsc(tilesizy[BOTTOMSTATUSBAR]),200);
|
y2 = scale(ydim,200-sbarsc(tilesiz[BOTTOMSTATUSBAR].y),200);
|
||||||
|
|
||||||
if (ud.screen_size > 8)
|
if (ud.screen_size > 8)
|
||||||
{
|
{
|
||||||
// across top
|
// across top
|
||||||
for (y=0; y<windowy1; y+=tilesizy[dapicnum])
|
for (y=0; y<windowy1; y+=tilesiz[dapicnum].y)
|
||||||
for (x=0; x<xdim; x+=tilesizx[dapicnum])
|
for (x=0; x<xdim; x+=tilesiz[dapicnum].x)
|
||||||
rotatesprite(x<<16,y<<16,65536L,0,dapicnum,8,0,8+16+64,0,y1,xdim-1,windowy1-1);
|
rotatesprite(x<<16,y<<16,65536L,0,dapicnum,8,0,8+16+64,0,y1,xdim-1,windowy1-1);
|
||||||
|
|
||||||
// sides
|
// sides
|
||||||
rx = windowx2-windowx2%tilesizx[dapicnum];
|
rx = windowx2-windowx2%tilesiz[dapicnum].x;
|
||||||
for (y=windowy1-windowy1%tilesizy[dapicnum]; y<windowy2; y+=tilesizy[dapicnum])
|
for (y=windowy1-windowy1%tilesiz[dapicnum].y; y<windowy2; y+=tilesiz[dapicnum].y)
|
||||||
for (x=0; x<windowx1 || x+rx<xdim; x+=tilesizx[dapicnum])
|
for (x=0; x<windowx1 || x+rx<xdim; x+=tilesiz[dapicnum].x)
|
||||||
{
|
{
|
||||||
rotatesprite(x<<16,y<<16,65536L,0,dapicnum,8,0,8+16+64,0,windowy1,windowx1-1,windowy2-1);
|
rotatesprite(x<<16,y<<16,65536L,0,dapicnum,8,0,8+16+64,0,windowy1,windowx1-1,windowy2-1);
|
||||||
rotatesprite((x+rx)<<16,y<<16,65536L,0,dapicnum,8,0,8+16+64,windowx2,windowy1,xdim-1,windowy2-1);
|
rotatesprite((x+rx)<<16,y<<16,65536L,0,dapicnum,8,0,8+16+64,windowx2,windowy1,xdim-1,windowy2-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// along bottom
|
// along bottom
|
||||||
for (y=windowy2-(windowy2%tilesizy[dapicnum]); y<y2; y+=tilesizy[dapicnum])
|
for (y=windowy2-(windowy2%tilesiz[dapicnum].y); y<y2; y+=tilesiz[dapicnum].y)
|
||||||
for (x=0; x<xdim; x+=tilesizx[dapicnum])
|
for (x=0; x<xdim; x+=tilesiz[dapicnum].x)
|
||||||
rotatesprite(x<<16,y<<16,65536L,0,dapicnum,8,0,8+16+64,0,windowy2,xdim-1,y2-1);
|
rotatesprite(x<<16,y<<16,65536L,0,dapicnum,8,0,8+16+64,0,windowy2,xdim-1,y2-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4089,8 +4089,8 @@ void G_DrawBackground(void)
|
||||||
{
|
{
|
||||||
// when not rendering a game, fullscreen wipe
|
// when not rendering a game, fullscreen wipe
|
||||||
x2 = (xdim - sbarsc((int32_t)(ydim*1.333333333333333333f))) >> 1;
|
x2 = (xdim - sbarsc((int32_t)(ydim*1.333333333333333333f))) >> 1;
|
||||||
for (y=y2-y2%tilesizy[dapicnum]; y<ydim; y+=tilesizy[dapicnum])
|
for (y=y2-y2%tilesiz[dapicnum].y; y<ydim; y+=tilesiz[dapicnum].y)
|
||||||
for (x=0; x<xdim>>1; x+=tilesizx[dapicnum])
|
for (x=0; x<xdim>>1; x+=tilesiz[dapicnum].x)
|
||||||
{
|
{
|
||||||
rotatesprite(x<<16,y<<16,65536L,0,dapicnum,8,0,8+16+64,0,y2,x2,ydim-1);
|
rotatesprite(x<<16,y<<16,65536L,0,dapicnum,8,0,8+16+64,0,y2,x2,ydim-1);
|
||||||
rotatesprite((xdim-x)<<16,y<<16,65536L,0,dapicnum,8,0,8+16+64,xdim-x2-1,y2,xdim-1,ydim-1);
|
rotatesprite((xdim-x)<<16,y<<16,65536L,0,dapicnum,8,0,8+16+64,xdim-x2-1,y2,xdim-1,ydim-1);
|
||||||
|
@ -4110,7 +4110,7 @@ void G_DrawBackground(void)
|
||||||
x1 = max(windowx1-4,0);
|
x1 = max(windowx1-4,0);
|
||||||
y1 = max(windowy1-4,y);
|
y1 = max(windowy1-4,y);
|
||||||
x2 = min(windowx2+4,xdim-1);
|
x2 = min(windowx2+4,xdim-1);
|
||||||
y2 = min(windowy2+4,scale(ydim,200-sbarsc(tilesizy[BOTTOMSTATUSBAR]),200)-1);
|
y2 = min(windowy2+4,scale(ydim,200-sbarsc(tilesiz[BOTTOMSTATUSBAR].y),200)-1);
|
||||||
|
|
||||||
for (y=y1+4; y<y2-4; y+=64)
|
for (y=y1+4; y<y2-4; y+=64)
|
||||||
{
|
{
|
||||||
|
@ -4206,10 +4206,10 @@ static void G_SE40(int32_t smoothratio)
|
||||||
if (level)
|
if (level)
|
||||||
{
|
{
|
||||||
// renderz = sector[sprite[sprite2].sectnum].ceilingz;
|
// renderz = sector[sprite[sprite2].sectnum].ceilingz;
|
||||||
renderz = sprite[sprite2].z - (sprite[sprite2].yrepeat * tilesizy[sprite[sprite2].picnum]<<1);
|
renderz = sprite[sprite2].z - (sprite[sprite2].yrepeat * tilesiz[sprite[sprite2].picnum].y<<1);
|
||||||
picnum = sector[sprite[sprite2].sectnum].ceilingpicnum;
|
picnum = sector[sprite[sprite2].sectnum].ceilingpicnum;
|
||||||
sector[sprite[sprite2].sectnum].ceilingpicnum = 562;
|
sector[sprite[sprite2].sectnum].ceilingpicnum = 562;
|
||||||
tilesizx[562] = tilesizy[562] = 0;
|
tilesiz[562].x = tilesiz[562].y = 0;
|
||||||
|
|
||||||
pix_diff = klabs(z) >> 8;
|
pix_diff = klabs(z) >> 8;
|
||||||
newz = - ((pix_diff / 128) + 1) * (128<<8);
|
newz = - ((pix_diff / 128) + 1) * (128<<8);
|
||||||
|
@ -4231,7 +4231,7 @@ static void G_SE40(int32_t smoothratio)
|
||||||
renderz = sprite[sprite2].z;
|
renderz = sprite[sprite2].z;
|
||||||
picnum = sector[sprite[sprite2].sectnum].floorpicnum;
|
picnum = sector[sprite[sprite2].sectnum].floorpicnum;
|
||||||
sector[sprite[sprite2].sectnum].floorpicnum = 562;
|
sector[sprite[sprite2].sectnum].floorpicnum = 562;
|
||||||
tilesizx[562] = tilesizy[562] = 0;
|
tilesiz[562].x = tilesiz[562].y = 0;
|
||||||
|
|
||||||
pix_diff = klabs(z) >> 8;
|
pix_diff = klabs(z) >> 8;
|
||||||
newz = ((pix_diff / 128) + 1) * (128<<8);
|
newz = ((pix_diff / 128) + 1) * (128<<8);
|
||||||
|
@ -5861,7 +5861,7 @@ int32_t A_Spawn(int32_t j, int32_t pn)
|
||||||
case EXPLOSION2__STATIC:
|
case EXPLOSION2__STATIC:
|
||||||
if (sp->yrepeat > 32)
|
if (sp->yrepeat > 32)
|
||||||
{
|
{
|
||||||
G_AddGameLight(0, i, ((sp->yrepeat*tilesizy[sp->picnum])<<1), 32768, 255+(95<<8),PR_LIGHT_PRIO_MAX_GAME);
|
G_AddGameLight(0, i, ((sp->yrepeat*tilesiz[sp->picnum].y)<<1), 32768, 255+(95<<8),PR_LIGHT_PRIO_MAX_GAME);
|
||||||
actor[i].lightcount = 2;
|
actor[i].lightcount = 2;
|
||||||
}
|
}
|
||||||
case EXPLOSION2BOT__STATIC:
|
case EXPLOSION2BOT__STATIC:
|
||||||
|
@ -7812,7 +7812,7 @@ PALONLY:
|
||||||
// XXX: t->picnum can be out-of-bounds by bad user code.
|
// XXX: t->picnum can be out-of-bounds by bad user code.
|
||||||
|
|
||||||
if (l > 0)
|
if (l > 0)
|
||||||
while (tilesizx[t->picnum] == 0 && t->picnum > 0)
|
while (tilesiz[t->picnum].x == 0 && t->picnum > 0)
|
||||||
t->picnum -= l; //Hack, for actors
|
t->picnum -= l; //Hack, for actors
|
||||||
|
|
||||||
if (actor[i].dispicnum >= 0)
|
if (actor[i].dispicnum >= 0)
|
||||||
|
@ -11043,7 +11043,7 @@ static void G_Startup(void)
|
||||||
|
|
||||||
ReadSaveGameHeaders();
|
ReadSaveGameHeaders();
|
||||||
|
|
||||||
tilesizx[MIRROR] = tilesizy[MIRROR] = 0;
|
tilesiz[MIRROR].x = tilesiz[MIRROR].y = 0;
|
||||||
|
|
||||||
screenpeek = myconnectindex;
|
screenpeek = myconnectindex;
|
||||||
|
|
||||||
|
|
|
@ -1483,7 +1483,7 @@ skip_check:
|
||||||
vm.g_sp->xrepeat += ksgn(j);
|
vm.g_sp->xrepeat += ksgn(j);
|
||||||
|
|
||||||
if ((vm.g_sp->picnum == APLAYER && vm.g_sp->yrepeat < 36) || *insptr < vm.g_sp->yrepeat ||
|
if ((vm.g_sp->picnum == APLAYER && vm.g_sp->yrepeat < 36) || *insptr < vm.g_sp->yrepeat ||
|
||||||
((vm.g_sp->yrepeat*(tilesizy[vm.g_sp->picnum]+8))<<2) < (actor[vm.g_i].floorz - actor[vm.g_i].ceilingz))
|
((vm.g_sp->yrepeat*(tilesiz[vm.g_sp->picnum].y+8))<<2) < (actor[vm.g_i].floorz - actor[vm.g_i].ceilingz))
|
||||||
{
|
{
|
||||||
j = ((*insptr)-vm.g_sp->yrepeat)<<1;
|
j = ((*insptr)-vm.g_sp->yrepeat)<<1;
|
||||||
if (klabs(j)) vm.g_sp->yrepeat += ksgn(j);
|
if (klabs(j)) vm.g_sp->yrepeat += ksgn(j);
|
||||||
|
|
|
@ -2668,7 +2668,7 @@ static void __fastcall VM_SetSprite(int32_t lVar1, int32_t lLabelID, int32_t lVa
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case ACTOR_ALPHA:
|
case ACTOR_ALPHA:
|
||||||
spriteext[iActor].alpha=(float)(lVar1/255.0f);
|
spriteext[iActor].alpha=(float)lVar1 * (1.f/255.0f);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -1451,8 +1451,8 @@ static void Gv_AddSystemVars(void)
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
// SYSTEM_GAMEARRAY
|
// SYSTEM_GAMEARRAY
|
||||||
Gv_NewArray("tilesizx", (void *)tilesizx, MAXTILES, GAMEARRAY_READONLY|GAMEARRAY_OFSHORT);
|
Gv_NewArray("tilesizx", NULL/*(void *)tilesizx*/, MAXTILES, GAMEARRAY_READONLY|GAMEARRAY_OFSHORT);
|
||||||
Gv_NewArray("tilesizy", (void *)tilesizy, MAXTILES, GAMEARRAY_READONLY|GAMEARRAY_OFSHORT);
|
Gv_NewArray("tilesizy", NULL/*(void *)tilesizy*/, MAXTILES, GAMEARRAY_READONLY|GAMEARRAY_OFSHORT);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1679,7 +1679,7 @@ static int32_t correct_picnum(int16_t *picnumptr)
|
||||||
{
|
{
|
||||||
int32_t picnum = *picnumptr;
|
int32_t picnum = *picnumptr;
|
||||||
|
|
||||||
if ((unsigned)picnum >= MAXTILES || tilesizx[picnum] <= 0)
|
if ((unsigned)picnum >= MAXTILES || tilesiz[picnum].x <= 0)
|
||||||
{
|
{
|
||||||
*picnumptr = 0;
|
*picnumptr = 0;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -674,8 +674,8 @@ static void Gv_AddSystemVars(void)
|
||||||
Gv_NewArray("headsectbunchf", (void *)headsectbunch[1], YAX_MAXBUNCHES, GAMEARRAY_READONLY|GAMEARRAY_OFSHORT);
|
Gv_NewArray("headsectbunchf", (void *)headsectbunch[1], YAX_MAXBUNCHES, GAMEARRAY_READONLY|GAMEARRAY_OFSHORT);
|
||||||
Gv_NewArray("nextsectbunchf", (void *)nextsectbunch[1], MAXSECTORS, GAMEARRAY_READONLY|GAMEARRAY_OFSHORT);
|
Gv_NewArray("nextsectbunchf", (void *)nextsectbunch[1], MAXSECTORS, GAMEARRAY_READONLY|GAMEARRAY_OFSHORT);
|
||||||
#endif
|
#endif
|
||||||
Gv_NewArray("tilesizx", (void *)tilesizx, MAXTILES, GAMEARRAY_READONLY|GAMEARRAY_OFSHORT);
|
// Gv_NewArray("tilesizx", (void *)tilesizx, MAXTILES, GAMEARRAY_READONLY|GAMEARRAY_OFSHORT);
|
||||||
Gv_NewArray("tilesizy", (void *)tilesizy, MAXTILES, GAMEARRAY_READONLY|GAMEARRAY_OFSHORT);
|
// Gv_NewArray("tilesizy", (void *)tilesizy, MAXTILES, GAMEARRAY_READONLY|GAMEARRAY_OFSHORT);
|
||||||
// Gv_NewArray("picsiz", (void *)picsiz, MAXTILES, GAMEARRAY_READONLY|GAMEARRAY_OFCHAR);
|
// Gv_NewArray("picsiz", (void *)picsiz, MAXTILES, GAMEARRAY_READONLY|GAMEARRAY_OFCHAR);
|
||||||
Gv_NewArray("picanm", (void *)picanm, MAXTILES, GAMEARRAY_READONLY|GAMEARRAY_OFINT);
|
Gv_NewArray("picanm", (void *)picanm, MAXTILES, GAMEARRAY_READONLY|GAMEARRAY_OFINT);
|
||||||
|
|
||||||
|
|
|
@ -1765,7 +1765,7 @@ static void M_PreMenuDraw(MenuID_t cm, MenuGroup_t *group, MenuEntry_t *entry)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_PLAYER:
|
case MENU_PLAYER:
|
||||||
rotatesprite_fs((260)<<16,(24+(tilesizy[APLAYER]>>1))<<16,49152L,0,1441-((((4-(totalclock>>4)))&3)*5),0,entry == &ME_PLAYER_TEAM ? G_GetTeamPalette(ud.team) : ud.color,10);
|
rotatesprite_fs((260)<<16,(24+(tilesiz[APLAYER].y>>1))<<16,49152L,0,1441-((((4-(totalclock>>4)))&3)*5),0,entry == &ME_PLAYER_TEAM ? G_GetTeamPalette(ud.team) : ud.color,10);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_MACROS:
|
case MENU_MACROS:
|
||||||
|
@ -3548,17 +3548,17 @@ static int32_t M_RunMenu_MenuMenu(MenuMenu_t *menu, MenuEntry_t *currentry, int3
|
||||||
MenuRangeInt32_t *object = (MenuRangeInt32_t*)entry->entry;
|
MenuRangeInt32_t *object = (MenuRangeInt32_t*)entry->entry;
|
||||||
|
|
||||||
int32_t s, p;
|
int32_t s, p;
|
||||||
const int32_t z = scale(65536, height, tilesizy[SLIDEBAR]<<16);
|
const int32_t z = scale(65536, height, tilesiz[SLIDEBAR].y<<16);
|
||||||
M_ShadePal(object->font, status, &s, &p);
|
M_ShadePal(object->font, status, &s, &p);
|
||||||
|
|
||||||
if (status & (1<<3))
|
if (status & (1<<3))
|
||||||
x -= scale(tilesizx[SLIDEBAR]<<16, height, tilesizy[SLIDEBAR]<<16);
|
x -= scale(tilesiz[SLIDEBAR].x<<16, height, tilesiz[SLIDEBAR].y<<16);
|
||||||
|
|
||||||
rotatesprite_fs(x, y - menu->scrollPos, z, 0, SLIDEBAR, s, entry->disabled ? 1 : 0, 2|8|16|ROTATESPRITE_FULL16);
|
rotatesprite_fs(x, y - menu->scrollPos, z, 0, SLIDEBAR, s, entry->disabled ? 1 : 0, 2|8|16|ROTATESPRITE_FULL16);
|
||||||
|
|
||||||
rotatesprite_fs(
|
rotatesprite_fs(
|
||||||
x + (1<<16) + scale(scale((tilesizx[SLIDEBAR]-2-tilesizx[SLIDEBAR+1])<<16, height, tilesizy[SLIDEBAR]<<16), *object->variable - object->min, object->max - object->min),
|
x + (1<<16) + scale(scale((tilesiz[SLIDEBAR].x-2-tilesiz[SLIDEBAR+1].x)<<16, height, tilesiz[SLIDEBAR].y<<16), *object->variable - object->min, object->max - object->min),
|
||||||
y + scale((tilesizy[SLIDEBAR]-tilesizy[SLIDEBAR+1])<<15, height, tilesizy[SLIDEBAR]<<16) - menu->scrollPos,
|
y + scale((tilesiz[SLIDEBAR].y-tilesiz[SLIDEBAR+1].y)<<15, height, tilesiz[SLIDEBAR].y<<16) - menu->scrollPos,
|
||||||
z, 0, SLIDEBAR+1, s, entry->disabled ? 1 : 0, 2|8|16|ROTATESPRITE_FULL16);
|
z, 0, SLIDEBAR+1, s, entry->disabled ? 1 : 0, 2|8|16|ROTATESPRITE_FULL16);
|
||||||
|
|
||||||
if (object->displaytype > 0)
|
if (object->displaytype > 0)
|
||||||
|
@ -3594,17 +3594,17 @@ static int32_t M_RunMenu_MenuMenu(MenuMenu_t *menu, MenuEntry_t *currentry, int3
|
||||||
MenuRangeFloat_t *object = (MenuRangeFloat_t*)entry->entry;
|
MenuRangeFloat_t *object = (MenuRangeFloat_t*)entry->entry;
|
||||||
|
|
||||||
int32_t s, p;
|
int32_t s, p;
|
||||||
const int32_t z = scale(65536, height, tilesizy[SLIDEBAR]<<16);
|
const int32_t z = scale(65536, height, tilesiz[SLIDEBAR].y<<16);
|
||||||
M_ShadePal(object->font, status, &s, &p);
|
M_ShadePal(object->font, status, &s, &p);
|
||||||
|
|
||||||
if (status & (1<<3))
|
if (status & (1<<3))
|
||||||
x -= scale(tilesizx[SLIDEBAR]<<16, height, tilesizy[SLIDEBAR]<<16);
|
x -= scale(tilesiz[SLIDEBAR].x<<16, height, tilesiz[SLIDEBAR].y<<16);
|
||||||
|
|
||||||
rotatesprite_fs(x, y - menu->scrollPos, z, 0, SLIDEBAR, s, p, 2|8|16|ROTATESPRITE_FULL16);
|
rotatesprite_fs(x, y - menu->scrollPos, z, 0, SLIDEBAR, s, p, 2|8|16|ROTATESPRITE_FULL16);
|
||||||
|
|
||||||
rotatesprite_fs(
|
rotatesprite_fs(
|
||||||
x + (1<<16) + ((float) scale((tilesizx[SLIDEBAR]-2-tilesizx[SLIDEBAR+1])<<16, height, tilesizy[SLIDEBAR]<<16) * (*object->variable - object->min) / (object->max - object->min)),
|
x + (1<<16) + ((float) scale((tilesiz[SLIDEBAR].x-2-tilesiz[SLIDEBAR+1].x)<<16, height, tilesiz[SLIDEBAR].y<<16) * (*object->variable - object->min) / (object->max - object->min)),
|
||||||
y + scale((tilesizy[SLIDEBAR]-tilesizy[SLIDEBAR+1])<<15, height, tilesizy[SLIDEBAR]<<16) - menu->scrollPos,
|
y + scale((tilesiz[SLIDEBAR].y-tilesiz[SLIDEBAR+1].y)<<15, height, tilesiz[SLIDEBAR].y<<16) - menu->scrollPos,
|
||||||
z, 0, SLIDEBAR+1, s, p, 2|8|16|ROTATESPRITE_FULL16);
|
z, 0, SLIDEBAR+1, s, p, 2|8|16|ROTATESPRITE_FULL16);
|
||||||
|
|
||||||
if (object->displaytype > 0)
|
if (object->displaytype > 0)
|
||||||
|
@ -3640,17 +3640,17 @@ static int32_t M_RunMenu_MenuMenu(MenuMenu_t *menu, MenuEntry_t *currentry, int3
|
||||||
MenuRangeDouble_t *object = (MenuRangeDouble_t*)entry->entry;
|
MenuRangeDouble_t *object = (MenuRangeDouble_t*)entry->entry;
|
||||||
|
|
||||||
int32_t s, p;
|
int32_t s, p;
|
||||||
const int32_t z = scale(65536, height, tilesizy[SLIDEBAR]<<16);
|
const int32_t z = scale(65536, height, tilesiz[SLIDEBAR].y<<16);
|
||||||
M_ShadePal(object->font, status, &s, &p);
|
M_ShadePal(object->font, status, &s, &p);
|
||||||
|
|
||||||
if (status & (1<<3))
|
if (status & (1<<3))
|
||||||
x -= scale(tilesizx[SLIDEBAR]<<16, height, tilesizy[SLIDEBAR]<<16);
|
x -= scale(tilesiz[SLIDEBAR].x<<16, height, tilesiz[SLIDEBAR].y<<16);
|
||||||
|
|
||||||
rotatesprite_fs(x, y - menu->scrollPos, z, 0, SLIDEBAR, s, p, 2|8|16|ROTATESPRITE_FULL16);
|
rotatesprite_fs(x, y - menu->scrollPos, z, 0, SLIDEBAR, s, p, 2|8|16|ROTATESPRITE_FULL16);
|
||||||
|
|
||||||
rotatesprite_fs(
|
rotatesprite_fs(
|
||||||
x + (1<<16) + ((double) scale((tilesizx[SLIDEBAR]-2-tilesizx[SLIDEBAR+1])<<16, height, tilesizy[SLIDEBAR]<<16) * (*object->variable - object->min) / (object->max - object->min)),
|
x + (1<<16) + ((double) scale((tilesiz[SLIDEBAR].x-2-tilesiz[SLIDEBAR+1].x)<<16, height, tilesiz[SLIDEBAR].y<<16) * (*object->variable - object->min) / (object->max - object->min)),
|
||||||
y + scale((tilesizy[SLIDEBAR]-tilesizy[SLIDEBAR+1])<<15, height, tilesizy[SLIDEBAR]<<16) - menu->scrollPos,
|
y + scale((tilesiz[SLIDEBAR].y-tilesiz[SLIDEBAR+1].y)<<15, height, tilesiz[SLIDEBAR].y<<16) - menu->scrollPos,
|
||||||
z, 0, SLIDEBAR+1, s, p, 2|8|16|ROTATESPRITE_FULL16);
|
z, 0, SLIDEBAR+1, s, p, 2|8|16|ROTATESPRITE_FULL16);
|
||||||
|
|
||||||
if (object->displaytype > 0)
|
if (object->displaytype > 0)
|
||||||
|
@ -3690,7 +3690,7 @@ static int32_t M_RunMenu_MenuMenu(MenuMenu_t *menu, MenuEntry_t *currentry, int3
|
||||||
const vec2_t dim = M_MenuText(x, y + (height>>1), object->font, object->editfield, status | (1<<5));
|
const vec2_t dim = M_MenuText(x, y + (height>>1), object->font, object->editfield, status | (1<<5));
|
||||||
const int32_t h = max(dim.y, entry->font->yline);
|
const int32_t h = max(dim.y, entry->font->yline);
|
||||||
|
|
||||||
rotatesprite_fs(x + dim.x + (1<<16) + scale(tilesizx[SPINNINGNUKEICON]<<15, h, tilesizy[SPINNINGNUKEICON]<<16), y + (height>>1) - menu->scrollPos, scale(65536, h, tilesizy[SPINNINGNUKEICON]<<16), 0, SPINNINGNUKEICON+(((totalclock>>3))%7), cursorShade, 0, 10);
|
rotatesprite_fs(x + dim.x + (1<<16) + scale(tilesiz[SPINNINGNUKEICON].x<<15, h, tilesiz[SPINNINGNUKEICON].y<<16), y + (height>>1) - menu->scrollPos, scale(65536, h, tilesiz[SPINNINGNUKEICON].y<<16), 0, SPINNINGNUKEICON+(((totalclock>>3))%7), cursorShade, 0, 10);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
M_MenuText(x, y + (height>>1) - menu->scrollPos, object->font, object->variable, status);
|
M_MenuText(x, y + (height>>1) - menu->scrollPos, object->font, object->variable, status);
|
||||||
|
@ -3715,8 +3715,8 @@ static int32_t M_RunMenu_MenuMenu(MenuMenu_t *menu, MenuEntry_t *currentry, int3
|
||||||
// draw indicators if applicable
|
// draw indicators if applicable
|
||||||
if (totalextent > menu->bottomcutoff)
|
if (totalextent > menu->bottomcutoff)
|
||||||
{
|
{
|
||||||
rotatesprite((320 - tilesizx[SELECTDIR])<<16, menu->ytop, 65536, 0, SELECTDIR, menu->scrollPos > 0 ? 0 : 20, 0, 26, 0, 0, xdim-1, scale(ydim, menu->ytop + (tilesizy[SELECTDIR]<<15), 200<<16) - 1);
|
rotatesprite((320 - tilesiz[SELECTDIR].x)<<16, menu->ytop, 65536, 0, SELECTDIR, menu->scrollPos > 0 ? 0 : 20, 0, 26, 0, 0, xdim-1, scale(ydim, menu->ytop + (tilesiz[SELECTDIR].y<<15), 200<<16) - 1);
|
||||||
rotatesprite((320 - tilesizx[SELECTDIR])<<16, menu->bottomcutoff - (tilesizy[SELECTDIR]<<16), 65536, 0, SELECTDIR, menu->ytop + menu->totalHeight - menu->scrollPos > menu->bottomcutoff ? 0 : 20, 0, 26, 0, scale(ydim, menu->bottomcutoff - (tilesizy[SELECTDIR]<<15), 200<<16), xdim-1, ydim-1);
|
rotatesprite((320 - tilesiz[SELECTDIR].x)<<16, menu->bottomcutoff - (tilesiz[SELECTDIR].y<<16), 65536, 0, SELECTDIR, menu->ytop + menu->totalHeight - menu->scrollPos > menu->bottomcutoff ? 0 : 20, 0, 26, 0, scale(ydim, menu->bottomcutoff - (tilesiz[SELECTDIR].y<<15), 200<<16), xdim-1, ydim-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return menu->totalHeight;
|
return menu->totalHeight;
|
||||||
|
@ -3775,8 +3775,8 @@ static void M_RunMenu_MenuOptionList(MenuOption_t *object)
|
||||||
// draw indicators if applicable
|
// draw indicators if applicable
|
||||||
if (y > object->options->list->bottomcutoff)
|
if (y > object->options->list->bottomcutoff)
|
||||||
{
|
{
|
||||||
rotatesprite((320 - tilesizx[SELECTDIR])<<16, object->options->list->pos.y, 65536, 0, SELECTDIR, object->options->scrollPos > 0 ? 0 : 20, 0, 26, 0, 0, xdim-1, scale(ydim, object->options->list->pos.y + (tilesizy[SELECTDIR]<<15), 200<<16) - 1);
|
rotatesprite((320 - tilesiz[SELECTDIR].x)<<16, object->options->list->pos.y, 65536, 0, SELECTDIR, object->options->scrollPos > 0 ? 0 : 20, 0, 26, 0, 0, xdim-1, scale(ydim, object->options->list->pos.y + (tilesiz[SELECTDIR].y<<15), 200<<16) - 1);
|
||||||
rotatesprite((320 - tilesizx[SELECTDIR])<<16, object->options->list->bottomcutoff - (tilesizy[SELECTDIR]<<16), 65536, 0, SELECTDIR, y - object->options->scrollPos > object->options->list->bottomcutoff ? 0 : 20, 0, 26, 0, scale(ydim, object->options->list->bottomcutoff - (tilesizy[SELECTDIR]<<15), 200<<16), xdim-1, ydim-1);
|
rotatesprite((320 - tilesiz[SELECTDIR].x)<<16, object->options->list->bottomcutoff - (tilesiz[SELECTDIR].y<<16), 65536, 0, SELECTDIR, y - object->options->scrollPos > object->options->list->bottomcutoff ? 0 : 20, 0, 26, 0, scale(ydim, object->options->list->bottomcutoff - (tilesiz[SELECTDIR].y<<15), 200<<16), xdim-1, ydim-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1844,7 +1844,7 @@ void Net_SendMessage(void)
|
||||||
{
|
{
|
||||||
const vec2_t dim = G_ScreenTextSize(STARTALPHANUM, i, 0, textsc(65536), 0, typebuf, 8|16|ROTATESPRITE_FULL16, 5<<16, 7<<16, 0, 0, TEXT_LITERALESCAPE, 0, 0, xdim-1, ydim-1);
|
const vec2_t dim = G_ScreenTextSize(STARTALPHANUM, i, 0, textsc(65536), 0, typebuf, 8|16|ROTATESPRITE_FULL16, 5<<16, 7<<16, 0, 0, TEXT_LITERALESCAPE, 0, 0, xdim-1, ydim-1);
|
||||||
|
|
||||||
l = i + dim.x + scale(textsc((tilesizx[SPINNINGNUKEICON]+2)<<13), ydim, 200);
|
l = i + dim.x + scale(textsc((tilesiz[SPINNINGNUKEICON].x+2)<<13), ydim, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (l >= (xdim<<16))
|
if (l >= (xdim<<16))
|
||||||
|
@ -1853,7 +1853,7 @@ void Net_SendMessage(void)
|
||||||
{
|
{
|
||||||
const vec2_t dim = G_ScreenText(STARTALPHANUM, i, j, textsc(65536), 0, 0, typebuf, 1, 0, 8|16|ROTATESPRITE_FULL16, 0, 5<<16, 7<<16, 0, 0, TEXT_YCENTER|TEXT_LITERALESCAPE, 0, 0, xdim-1, ydim-1);
|
const vec2_t dim = G_ScreenText(STARTALPHANUM, i, j, textsc(65536), 0, 0, typebuf, 1, 0, 8|16|ROTATESPRITE_FULL16, 0, 5<<16, 7<<16, 0, 0, TEXT_YCENTER|TEXT_LITERALESCAPE, 0, 0, xdim-1, ydim-1);
|
||||||
|
|
||||||
i += dim.x + scale(textsc((tilesizx[SPINNINGNUKEICON]+1)<<12), ydim, 200);
|
i += dim.x + scale(textsc((tilesiz[SPINNINGNUKEICON].x+1)<<12), ydim, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
rotatesprite_fs(i, j, textsc(32768), 0, SPINNINGNUKEICON+((totalclock>>3)%7), 4-(sintable[(totalclock<<4)&2047]>>11), 0, 0);
|
rotatesprite_fs(i, j, textsc(32768), 0, SPINNINGNUKEICON+((totalclock>>3)%7), 4-(sintable[(totalclock<<4)&2047]>>11), 0, 0);
|
||||||
|
|
|
@ -366,7 +366,7 @@ static int32_t GetAutoAimAngle(int32_t i, int32_t p, int32_t atwith,
|
||||||
if (j >= 0)
|
if (j >= 0)
|
||||||
{
|
{
|
||||||
const spritetype *const spr = &sprite[j];
|
const spritetype *const spr = &sprite[j];
|
||||||
int32_t cen = 2*(spr->yrepeat*tilesizy[spr->picnum]) + cen_add;
|
int32_t cen = 2*(spr->yrepeat*tilesiz[spr->picnum].y) + cen_add;
|
||||||
int32_t dst;
|
int32_t dst;
|
||||||
|
|
||||||
if (flags)
|
if (flags)
|
||||||
|
@ -1049,12 +1049,12 @@ static int32_t A_ShootCustom(const int32_t i, const int32_t atwith, int16_t sa,
|
||||||
proj->range = 1024;
|
proj->range = 1024;
|
||||||
|
|
||||||
if (Proj_CheckBlood(srcvect, &hit, proj->range,
|
if (Proj_CheckBlood(srcvect, &hit, proj->range,
|
||||||
mulscale3(proj->yrepeat, tilesizy[proj->decal]) << 8))
|
mulscale3(proj->yrepeat, tilesiz[proj->decal].y) << 8))
|
||||||
{
|
{
|
||||||
const walltype *const hitwal = &wall[hit.wall];
|
const walltype *const hitwal = &wall[hit.wall];
|
||||||
|
|
||||||
if (FindDistance2D(hitwal->x - wall[hitwal->point2].x, hitwal->y - wall[hitwal->point2].y) >
|
if (FindDistance2D(hitwal->x - wall[hitwal->point2].x, hitwal->y - wall[hitwal->point2].y) >
|
||||||
(mulscale3(proj->xrepeat + 8, tilesizx[proj->decal])))
|
(mulscale3(proj->xrepeat + 8, tilesiz[proj->decal].x)))
|
||||||
{
|
{
|
||||||
if (SectorContainsSE13(hitwal->nextsector))
|
if (SectorContainsSE13(hitwal->nextsector))
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -1136,7 +1136,7 @@ int32_t A_ShootWithZvel(int32_t i, int32_t atwith, int32_t override_zvel)
|
||||||
{
|
{
|
||||||
sa = s->ang;
|
sa = s->ang;
|
||||||
Bmemcpy(&srcvect,s,sizeof(vec3_t));
|
Bmemcpy(&srcvect,s,sizeof(vec3_t));
|
||||||
srcvect.z -= (((s->yrepeat*tilesizy[s->picnum])<<1)-(4<<8));
|
srcvect.z -= (((s->yrepeat*tilesiz[s->picnum].y)<<1)-(4<<8));
|
||||||
|
|
||||||
if (s->picnum != ROTATEGUN)
|
if (s->picnum != ROTATEGUN)
|
||||||
{
|
{
|
||||||
|
@ -2003,10 +2003,10 @@ void P_DisplayScuba(int32_t snum)
|
||||||
g_snum = snum;
|
g_snum = snum;
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
if (getrendermode() >= REND_POLYMOST)
|
if (getrendermode() >= REND_POLYMOST)
|
||||||
G_DrawTileScaled(44, (200-tilesizy[SCUBAMASK]), SCUBAMASK, 0, 2+16+DRAWEAP_CENTER, p);
|
G_DrawTileScaled(44, (200-tilesiz[SCUBAMASK].y), SCUBAMASK, 0, 2+16+DRAWEAP_CENTER, p);
|
||||||
#endif
|
#endif
|
||||||
G_DrawTileScaled(43, (200-tilesizy[SCUBAMASK]), SCUBAMASK, 0, 2+16+DRAWEAP_CENTER, p);
|
G_DrawTileScaled(43, (200-tilesiz[SCUBAMASK].y), SCUBAMASK, 0, 2+16+DRAWEAP_CENTER, p);
|
||||||
G_DrawTileScaled(320-43, (200-tilesizy[SCUBAMASK]), SCUBAMASK, 0, 2+4+16+DRAWEAP_CENTER, p);
|
G_DrawTileScaled(320-43, (200-tilesiz[SCUBAMASK].y), SCUBAMASK, 0, 2+4+16+DRAWEAP_CENTER, p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -553,7 +553,7 @@ void G_CacheMapData(void)
|
||||||
void G_SetupCamTile(int32_t i,int32_t wn)
|
void G_SetupCamTile(int32_t i,int32_t wn)
|
||||||
{
|
{
|
||||||
//if (waloff[wn] == 0) loadtile(wn);
|
//if (waloff[wn] == 0) loadtile(wn);
|
||||||
setviewtotile(wn,tilesizy[wn],tilesizx[wn]);
|
setviewtotile(wn,tilesiz[wn].y, tilesiz[wn].x);
|
||||||
|
|
||||||
yax_preparedrawrooms();
|
yax_preparedrawrooms();
|
||||||
drawrooms(SX,SY,SZ,SA,100+sprite[i].shade,SECT);
|
drawrooms(SX,SY,SZ,SA,100+sprite[i].shade,SECT);
|
||||||
|
@ -601,7 +601,7 @@ void G_UpdateScreenArea(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ud.screen_size >= 8 && ud.statusbarmode==0)
|
if (ud.screen_size >= 8 && ud.statusbarmode==0)
|
||||||
y2 -= (ss+scale(tilesizy[BOTTOMSTATUSBAR],ud.statusbarscale,100));
|
y2 -= (ss+scale(tilesiz[BOTTOMSTATUSBAR].y,ud.statusbarscale,100));
|
||||||
|
|
||||||
y1 = scale(y1,ydim,200);
|
y1 = scale(y1,ydim,200);
|
||||||
y2 = scale(y2,ydim,200)+(getrendermode() != REND_CLASSIC);
|
y2 = scale(y2,ydim,200)+(getrendermode() != REND_CLASSIC);
|
||||||
|
|
|
@ -195,8 +195,8 @@ int32_t G_LoadSaveHeaderNew(int32_t spot, savehead_t *saveh)
|
||||||
walock[TILE_LOADSHOT] = 255;
|
walock[TILE_LOADSHOT] = 255;
|
||||||
if (waloff[TILE_LOADSHOT] == 0)
|
if (waloff[TILE_LOADSHOT] == 0)
|
||||||
allocache(&waloff[TILE_LOADSHOT], 320*200, &walock[TILE_LOADSHOT]);
|
allocache(&waloff[TILE_LOADSHOT], 320*200, &walock[TILE_LOADSHOT]);
|
||||||
tilesizx[TILE_LOADSHOT] = 200;
|
tilesiz[TILE_LOADSHOT].x = 200;
|
||||||
tilesizy[TILE_LOADSHOT] = 320;
|
tilesiz[TILE_LOADSHOT].y = 320;
|
||||||
if (screenshotofs)
|
if (screenshotofs)
|
||||||
{
|
{
|
||||||
if (kdfread((char *)waloff[TILE_LOADSHOT], 320, 200, fil) != 200)
|
if (kdfread((char *)waloff[TILE_LOADSHOT], 320, 200, fil) != 200)
|
||||||
|
|
|
@ -382,7 +382,7 @@ void G_AnimateCamSprite(void)
|
||||||
else if (OW >= 0 && dist(&sprite[ps->i], &sprite[i]) < 8192)
|
else if (OW >= 0 && dist(&sprite[ps->i], &sprite[i]) < 8192)
|
||||||
{
|
{
|
||||||
if (waloff[TILE_VIEWSCR] == 0)
|
if (waloff[TILE_VIEWSCR] == 0)
|
||||||
allocatepermanenttile(TILE_VIEWSCR,tilesizx[PN],tilesizy[PN]);
|
allocatepermanenttile(TILE_VIEWSCR,tilesiz[PN].x,tilesiz[PN].y);
|
||||||
else
|
else
|
||||||
walock[TILE_VIEWSCR] = 255;
|
walock[TILE_VIEWSCR] = 255;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue