mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
More sensible dragging in side view mode. When pasting walls in 3D mode, match the actual pixel width of the source wall.
git-svn-id: https://svn.eduke32.com/eduke32@1733 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
92fc1d3566
commit
7bd0e9709a
5 changed files with 209 additions and 161 deletions
|
@ -585,8 +585,8 @@ void qsetmode640350(void);
|
|||
void qsetmode640480(void);
|
||||
void qsetmodeany(int32_t,int32_t);
|
||||
void clear2dscreen(void);
|
||||
void draw2dgrid(int32_t posxe, int32_t posye, int32_t posze, int16_t ange, int32_t zoome, int16_t gride);
|
||||
void draw2dscreen(const vec3_t *pos, int16_t ange, int32_t zoome, int16_t gride);
|
||||
void draw2dgrid(int32_t posxe, int32_t posye, int32_t posze, int16_t cursectnum, int16_t ange, int32_t zoome, int16_t gride);
|
||||
void draw2dscreen(const vec3_t *pos, int16_t cursectnum, int16_t ange, int32_t zoome, int16_t gride);
|
||||
int32_t drawline16(int32_t x1, int32_t y1, int32_t x2, int32_t y2, char col);
|
||||
void drawcircle16(int32_t x1, int32_t y1, int32_t r, int32_t eccen, char col);
|
||||
|
||||
|
|
|
@ -77,6 +77,8 @@ extern int16_t *m32_wallsprite;
|
|||
extern int8_t sideview_reversehrot;
|
||||
extern inline int32_t scalescreeny(int32_t sy);
|
||||
extern void screencoords(int32_t *xres, int32_t *yres, int32_t x, int32_t y, int32_t zoome);
|
||||
//extern void invscreencoords(int32_t *dx, int32_t *dy, int32_t sx, int32_t sy, int32_t zoome);
|
||||
extern int32_t getinvdisplacement(int32_t *dx, int32_t *dy, int32_t dz);
|
||||
extern inline int32_t getscreenvdisp(int32_t bz, int32_t zoome);
|
||||
extern void setup_sideview_sincos(void);
|
||||
extern void m32_setkeyfilter(int32_t on);
|
||||
|
|
|
@ -122,7 +122,7 @@ int32_t lastpm16time = 0;
|
|||
int32_t numsprites;
|
||||
extern int32_t mapversion;
|
||||
|
||||
int16_t highlight[MAXWALLS];
|
||||
int16_t highlight[MAXWALLS+MAXSPRITES];
|
||||
int16_t highlightsector[MAXSECTORS], highlightsectorcnt = -1;
|
||||
extern char textfont[128][8];
|
||||
|
||||
|
@ -1889,7 +1889,7 @@ void overheadeditor(void)
|
|||
drawmapview(pos.x, pos.y, zoom, 1536);
|
||||
}
|
||||
|
||||
draw2dgrid(pos.x,pos.y,pos.z,ang,zoom,grid);
|
||||
draw2dgrid(pos.x,pos.y,pos.z,cursectnum,ang,zoom,grid);
|
||||
|
||||
ExtPreCheckKeys();
|
||||
|
||||
|
@ -1918,7 +1918,7 @@ void overheadeditor(void)
|
|||
}
|
||||
}
|
||||
|
||||
draw2dscreen(&pos,ang,zoom,grid);
|
||||
draw2dscreen(&pos,cursectnum,ang,zoom,grid);
|
||||
VM_OnEvent(EVENT_DRAW2DSCREEN, -1);
|
||||
|
||||
begindrawing(); //{{{
|
||||
|
@ -2299,21 +2299,9 @@ void overheadeditor(void)
|
|||
if (keystatus[88]) //F12
|
||||
{
|
||||
keystatus[88] = 0;
|
||||
/*
|
||||
j = ydim16; ydim16 = ydim;
|
||||
clear2dscreen();
|
||||
draw2dgrid(pos.x,pos.y,ang,zoom,grid);
|
||||
draw2dscreen(pos.x,pos.y,ang,zoom,grid);
|
||||
*/
|
||||
|
||||
//__clearscreen_beforecapture__
|
||||
screencapture("captxxxx.tga", eitherSHIFT);
|
||||
|
||||
/*
|
||||
ydim16 = j;
|
||||
clear2dscreen();
|
||||
draw2dgrid(pos.x,pos.y,ang,zoom,grid);
|
||||
draw2dscreen(pos.x,pos.y,ang,zoom,grid);
|
||||
*/
|
||||
showframe(1);
|
||||
}
|
||||
if (keystatus[0x30]) // B (clip Blocking xor) (2D)
|
||||
|
@ -3164,10 +3152,26 @@ SKIP:
|
|||
if ((bstatus&1) > (oldmousebstatus&1))
|
||||
pointhighlight = getpointhighlight(mousxplc, mousyplc, pointhighlight);
|
||||
|
||||
if (pointhighlight >= 0)
|
||||
if (pointhighlight >= 0 && (!m32_sideview || m32_sideelev>=32))
|
||||
{
|
||||
dax = mousxplc;
|
||||
day = mousyplc;
|
||||
if (m32_sideview)
|
||||
{
|
||||
int32_t dz;
|
||||
if (pointhighlight>=16384)
|
||||
dz = sprite[pointhighlight&16383].z - pos.z;
|
||||
else
|
||||
dz = getflorzofslope(sectorofwall(pointhighlight),
|
||||
wall[pointhighlight].x, wall[pointhighlight].y) - pos.z;
|
||||
getinvdisplacement(&dax,&day, -dz);
|
||||
dax += mousxplc;
|
||||
day += mousyplc;
|
||||
}
|
||||
else
|
||||
{
|
||||
dax = mousxplc;
|
||||
day = mousyplc;
|
||||
}
|
||||
|
||||
if (gridlock && grid > 0)
|
||||
locktogrid(&dax, &day);
|
||||
|
||||
|
@ -3189,6 +3193,7 @@ SKIP:
|
|||
dax -= sprite[pointhighlight&16383].x;
|
||||
day -= sprite[pointhighlight&16383].y;
|
||||
}
|
||||
|
||||
for (i=0; i<highlightcnt; i++)
|
||||
{
|
||||
if ((highlight[i]&0xc000) == 0)
|
||||
|
@ -3245,7 +3250,7 @@ SKIP:
|
|||
sectorhighlightstat = -1;
|
||||
}
|
||||
|
||||
if ((bstatus&6) > 0)
|
||||
if (bstatus&(2|4)) // change arrow position
|
||||
{
|
||||
if (eitherCTRL)
|
||||
{
|
||||
|
@ -3293,8 +3298,7 @@ SKIP:
|
|||
{
|
||||
if (inside(pos.x, pos.y, i)==1)
|
||||
{
|
||||
screencoords(&dax,&day, 0,0, zoom);
|
||||
day += getscreenvdisp(getflorzofslope(i, pos.x, pos.y)-pos.z, zoom);
|
||||
day = getscreenvdisp(getflorzofslope(i, pos.x, pos.y)-pos.z, zoom);
|
||||
|
||||
x2 = max(4, mulscale14(64,zoom));
|
||||
y2 = scalescreeny(x2);
|
||||
|
@ -3302,17 +3306,17 @@ SKIP:
|
|||
if (klabs(day) < y1)
|
||||
y1 = day;
|
||||
|
||||
drawline16base(halfxdim16+dax, midydim16+day, -x2,-y2, x2,y2, editorcolors[14]);
|
||||
drawline16base(halfxdim16+dax, midydim16+day, -x2,y2, x2,-y2, editorcolors[14]);
|
||||
drawline16base(halfxdim16, midydim16+day, -x2,-y2, x2,y2, editorcolors[14]);
|
||||
drawline16base(halfxdim16, midydim16+day, -x2,y2, x2,-y2, editorcolors[14]);
|
||||
}
|
||||
}
|
||||
|
||||
drawlinepat = 0x11111111;
|
||||
if (y1 != INT_MAX)
|
||||
{
|
||||
drawlinepat = 0x11111111;
|
||||
drawline16base(halfxdim16,midydim16, dax,0, dax,y1, editorcolors[14]);
|
||||
drawlinepat = opat;
|
||||
}
|
||||
drawline16base(halfxdim16,midydim16, 0,0, 0,y1, editorcolors[14]);
|
||||
else
|
||||
drawline16base(halfxdim16,midydim16, 0,0, 0,getscreenvdisp(-pos.z, zoom), editorcolors[14]);
|
||||
drawlinepat = opat;
|
||||
}
|
||||
|
||||
searchx = halfxdim16;
|
||||
|
@ -3357,16 +3361,22 @@ SKIP:
|
|||
{
|
||||
if (eitherCTRL)
|
||||
{
|
||||
m32_sideang += 32;
|
||||
m32_sideang &= (2047&~63);
|
||||
if (m32_sideang&63)
|
||||
{
|
||||
m32_sideang += (1-2*keystatus[0x10])*(1-2*sideview_reversehrot)*32;
|
||||
m32_sideang &= (2047&~63);
|
||||
}
|
||||
else
|
||||
{
|
||||
m32_sideang += (1-2*keystatus[0x10])*(1-2*sideview_reversehrot)*64;
|
||||
m32_sideang &= 2047;
|
||||
}
|
||||
|
||||
keystatus[0x10] = keystatus[0x11] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (keystatus[0x10])
|
||||
m32_sideang -= (1-2*sideview_reversehrot)*synctics<<(eitherSHIFT*2);
|
||||
else
|
||||
m32_sideang += (1-2*sideview_reversehrot)*synctics<<(eitherSHIFT*2);
|
||||
|
||||
m32_sideang += (1-2*keystatus[0x10])*(1-2*sideview_reversehrot)*synctics<<(eitherSHIFT*2);
|
||||
m32_sideang &= 2047;
|
||||
}
|
||||
_printmessage16("Sideview angle: %d", (int32_t)m32_sideang);
|
||||
|
@ -5210,6 +5220,9 @@ static int32_t getlinehighlight(int32_t xplc, int32_t yplc, int32_t line)
|
|||
if (mouseb & 1)
|
||||
return line;
|
||||
|
||||
if ((pointhighlight&0xc000) == 16384)
|
||||
return (-1);
|
||||
|
||||
dist = 1024;
|
||||
closest = -1;
|
||||
for (i=0; i<numwalls; i++)
|
||||
|
@ -5233,13 +5246,14 @@ static int32_t getlinehighlight(int32_t xplc, int32_t yplc, int32_t line)
|
|||
if (dmulscale32(xplc-x1,y2-y1,-(x2-x1),yplc-y1) >= 0)
|
||||
closest = wall[closest].nextwall;
|
||||
}
|
||||
if ((pointhighlight&0xc000) == 16384) return (-1);
|
||||
|
||||
return(closest);
|
||||
}
|
||||
|
||||
int32_t getpointhighlight(int32_t xplc, int32_t yplc, int32_t point)
|
||||
{
|
||||
int32_t i, dst, dist = 512, closest = -1;
|
||||
int32_t i, j, dst, dist = 512, closest = -1;
|
||||
int32_t dax,day;
|
||||
|
||||
if (numwalls == 0)
|
||||
return(-1);
|
||||
|
@ -5250,22 +5264,49 @@ int32_t getpointhighlight(int32_t xplc, int32_t yplc, int32_t point)
|
|||
if (grid < 1)
|
||||
dist = 0;
|
||||
|
||||
for (i=0; i<numwalls; i++)
|
||||
{
|
||||
dst = klabs(xplc-wall[i].x) + klabs(yplc-wall[i].y);
|
||||
if (dst <= dist)
|
||||
dist = dst, closest = i;
|
||||
}
|
||||
for (i=0; i<numsectors; i++)
|
||||
for (j=sector[i].wallptr; j<sector[i].wallptr+sector[i].wallnum; j++)
|
||||
{
|
||||
if (!m32_sideview)
|
||||
dst = klabs(xplc-wall[j].x) + klabs(yplc-wall[j].y);
|
||||
else
|
||||
{
|
||||
screencoords(&dax,&day, wall[j].x-pos.x,wall[j].y-pos.y, zoom);
|
||||
day += getscreenvdisp(getflorzofslope(i, wall[j].x,wall[j].y)-pos.z, zoom);
|
||||
|
||||
if (halfxdim16+dax < 0 || halfxdim16+dax >= xdim || midydim16+day < 0 || midydim16+day >= ydim)
|
||||
continue;
|
||||
|
||||
dst = klabs(halfxdim16+dax-searchx) + klabs(midydim16+day-searchy);
|
||||
}
|
||||
|
||||
if (dst <= dist)
|
||||
dist = dst, closest = j;
|
||||
}
|
||||
|
||||
if (zoom >= 256)
|
||||
for (i=0; i<MAXSPRITES; i++)
|
||||
if (sprite[i].statnum < MAXSTATUS)
|
||||
{
|
||||
dst = klabs(xplc-sprite[i].x) + klabs(yplc-sprite[i].y);
|
||||
if (!m32_sideview)
|
||||
dst = klabs(xplc-sprite[i].x) + klabs(yplc-sprite[i].y);
|
||||
else
|
||||
{
|
||||
screencoords(&dax,&day, sprite[i].x-pos.x,sprite[i].y-pos.y, zoom);
|
||||
day += getscreenvdisp(sprite[i].z-pos.z, zoom);
|
||||
|
||||
if (halfxdim16+dax < 0 || halfxdim16+dax >= xdim || midydim16+day < 0 || midydim16+day >= ydim)
|
||||
continue;
|
||||
|
||||
dst = klabs(halfxdim16+dax-searchx) + klabs(midydim16+day-searchy);
|
||||
}
|
||||
|
||||
// was (dst <= dist), but this way, when duplicating sprites,
|
||||
// the selected ones are dragged first
|
||||
if (dst < dist || (dst == dist && (show2dsprite[i>>3]&(1<<(i&7)))))
|
||||
dist = dst, closest = i+16384;
|
||||
}
|
||||
|
||||
return(closest);
|
||||
}
|
||||
|
||||
|
|
|
@ -48,9 +48,13 @@
|
|||
float debug1, debug2;
|
||||
#endif
|
||||
|
||||
void drawpixel_safe(void* s, char a)
|
||||
static void drawpixel_safe(void* s, char a)
|
||||
{
|
||||
#if defined __GNUC__
|
||||
if (__builtin_expect((intptr_t)s >= frameplace && (intptr_t)s < frameplace+bytesperline*ydim, 1))
|
||||
#else
|
||||
if ((intptr_t)s >= frameplace && (intptr_t)s < frameplace+bytesperline*ydim)
|
||||
#endif
|
||||
drawpixel(s, a);
|
||||
#ifdef DEBUGGINGAIDS
|
||||
else
|
||||
|
@ -11716,28 +11720,31 @@ int32_t drawline16(int32_t x1, int32_t y1, int32_t x2, int32_t y2, char col)
|
|||
uint32_t patc=0;
|
||||
intptr_t p;
|
||||
|
||||
dx = x2-x1; dy = y2-y1;
|
||||
dx = x2-x1;
|
||||
dy = y2-y1;
|
||||
|
||||
if (dx >= 0)
|
||||
{
|
||||
if ((x1 >= xres) || (x2 < 0)) return 0;
|
||||
if (x1 >= xres || x2 < 0) return 0;
|
||||
if (x1 < 0) { if (dy) y1 += scale(0-x1,dy,dx); x1 = 0; }
|
||||
if (x2 >= xres) { if (dy) y2 += scale(xres-1-x2,dy,dx); x2 = xres-1; }
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((x2 >= xres) || (x1 < 0)) return 0;
|
||||
if (x2 >= xres || x1 < 0) return 0;
|
||||
if (x2 < 0) { if (dy) y2 += scale(0-x2,dy,dx); x2 = 0; }
|
||||
if (x1 >= xres) { if (dy) y1 += scale(xres-1-x1,dy,dx); x1 = xres-1; }
|
||||
}
|
||||
|
||||
if (dy >= 0)
|
||||
{
|
||||
if ((y1 >= ydim16) || (y2 < 0)) return 0;
|
||||
if (y1 >= ydim16 || y2 < 0) return 0;
|
||||
if (y1 < 0) { if (dx) x1 += scale(0-y1,dx,dy); y1 = 0; if (x1 < 0) x1 = 0; }
|
||||
if (y2 >= ydim16) { if (dx) x2 += scale(ydim16-1-y2,dx,dy); y2 = ydim16-1; if (x2 < 0) x2 = 0; }
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((y2 >= ydim16) || (y1 < 0)) return 0;
|
||||
if (y2 >= ydim16 || y1 < 0) return 0;
|
||||
if (y2 < 0) { if (dx) x2 += scale(0-y2,dx,dy); y2 = 0; if (x2 < 0) x2 = 0; }
|
||||
if (y1 >= ydim16) { if (dx) x1 += scale(ydim16-1-y1,dx,dy); y1 = ydim16-1; if (x1 < 0) x1 = 0; }
|
||||
}
|
||||
|
@ -12051,6 +12058,30 @@ void screencoords(int32_t *xres, int32_t *yres, int32_t x, int32_t y, int32_t zo
|
|||
*yres = scalescreeny(mulscale14(y,zoome));
|
||||
}
|
||||
|
||||
#if 0
|
||||
void invscreencoords(int32_t *dx, int32_t *dy, int32_t sx, int32_t sy, int32_t zoome)
|
||||
{
|
||||
if (m32_sidesin==0 || zoome==0) { *dx=0; *dy=0; return; }
|
||||
|
||||
sy = divscale14(divscale14(sy, m32_sidesin), zoome);
|
||||
sx = divscale14(sx, zoome);
|
||||
|
||||
rotatepoint(0,0, sx,sy, -m32_sideang, dx,dy);
|
||||
}
|
||||
#endif
|
||||
|
||||
// invscreencoords with sx==0 and sy==getscreenvdisp(dz, zoom)
|
||||
int32_t getinvdisplacement(int32_t *dx, int32_t *dy, int32_t dz)
|
||||
{
|
||||
if (m32_sidesin==0)
|
||||
return 1;
|
||||
|
||||
dz = (((int64_t)dz * (int64_t)m32_sidecos)/(int64_t)m32_sidesin)>>4;
|
||||
rotatepoint(0,0, 0,dz, -m32_sideang, dx,dy);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// return vertical screen coordinate displacement for BUILD z coord
|
||||
inline int32_t getscreenvdisp(int32_t bz, int32_t zoome)
|
||||
{
|
||||
|
@ -12111,7 +12142,7 @@ static int sideview_cmppoints(const int16_t *sw1, const int16_t *sw2)
|
|||
//
|
||||
// draw2dgrid
|
||||
//
|
||||
void draw2dgrid(int32_t posxe, int32_t posye, int32_t posze, int16_t ange, int32_t zoome, int16_t gride)
|
||||
void draw2dgrid(int32_t posxe, int32_t posye, int32_t posze, int16_t cursectnum, int16_t ange, int32_t zoome, int16_t gride)
|
||||
{
|
||||
int64_t i, xp1, yp1, xp2=0, yp2, tempy;
|
||||
|
||||
|
@ -12127,7 +12158,11 @@ void draw2dgrid(int32_t posxe, int32_t posye, int32_t posze, int16_t ange, int32
|
|||
int32_t sx1,sy1, sx2,sy2, dx=0,dy=0;
|
||||
int32_t xinc=0, yinc=2048>>gride, yofs;
|
||||
|
||||
yofs = getscreenvdisp((yinc-posze)&((yinc<<4)-1), zoome);
|
||||
// yofs = getscreenvdisp((yinc-posze)&((yinc<<4)-1), zoome);
|
||||
if (cursectnum<0 || cursectnum>=numsectors)
|
||||
yofs = getscreenvdisp(-posze, zoome);
|
||||
else
|
||||
yofs = getscreenvdisp(getflorzofslope(cursectnum, posxe,posye)-posze, zoome);
|
||||
|
||||
while (scalescreeny(mulscale14(yinc, zoome))==0 && gride>2)
|
||||
{
|
||||
|
@ -12307,6 +12342,7 @@ static void drawscreen_drawwall(int32_t i, int32_t posxe, int32_t posye, int32_t
|
|||
|
||||
if (m32_sideview)
|
||||
{
|
||||
// draw vertical line to neighboring wall
|
||||
int32_t fz, fz2, fzn;
|
||||
int32_t sect=sectorofwall(i);
|
||||
|
||||
|
@ -12438,6 +12474,7 @@ static void drawscreen_drawsprite(int32_t j, int32_t posxe, int32_t posye, int32
|
|||
{
|
||||
int32_t x1, y1, x2, y2;
|
||||
char col;
|
||||
int16_t hitblocking=(sprite[j].cstat&256), flooraligned=(sprite[j].cstat&32), wallaligned=(sprite[j].cstat&16);
|
||||
|
||||
int16_t angofs = m32_sideview ? m32_sideang : 0;
|
||||
|
||||
|
@ -12488,114 +12525,19 @@ static void drawscreen_drawsprite(int32_t j, int32_t posxe, int32_t posye, int32
|
|||
|
||||
drawline16mid(x1,y1, x1+x2,y1+y2, editorcolors[col]);
|
||||
|
||||
if ((sprite[j].cstat&256) > 0)
|
||||
if (hitblocking)
|
||||
{
|
||||
drawline16mid(x1,y1+1, x1+x2,y1+y2+1, editorcolors[col]);
|
||||
drawline16mid(x1,y1-1, x1+x2,y1+y2-1, editorcolors[col]);
|
||||
drawline16mid(x1-1,y1, x1+x2-1,y1+y2, editorcolors[col]);
|
||||
drawline16mid(x1+1,y1, x1+x2+1,y1+y2, editorcolors[col]);
|
||||
|
||||
if ((sprite[j].cstat&32) > 0)
|
||||
{
|
||||
int32_t fx = mulscale10(mulscale6(tilesizx[sprite[j].picnum], sprite[j].xrepeat),zoome) >> 1;
|
||||
int32_t fy = mulscale10(mulscale6(tilesizy[sprite[j].picnum], sprite[j].yrepeat),zoome) >> 1;
|
||||
int32_t co[4][2], ii;
|
||||
int32_t sinang = sintable[(sprite[j].ang+angofs+1536)&2047];
|
||||
int32_t cosang = sintable[(sprite[j].ang+angofs+1024)&2047];
|
||||
int32_t r,s;
|
||||
|
||||
co[0][0] = co[3][0] = -fx;
|
||||
co[0][1] = co[1][1] = -fy;
|
||||
co[1][0] = co[2][0] = fx;
|
||||
co[2][1] = co[3][1] = fy;
|
||||
|
||||
for (ii=3; ii>=0; ii--)
|
||||
{
|
||||
r = mulscale14(cosang,co[ii][0]) - mulscale14(sinang,co[ii][1]);
|
||||
s = mulscale14(sinang,co[ii][0]) + mulscale14(cosang,co[ii][1]);
|
||||
s = scalescreeny(s);
|
||||
co[ii][0] = r;
|
||||
co[ii][1] = s;
|
||||
}
|
||||
drawlinepat = 0xcfcfcfcf;
|
||||
for (ii=3; ii>=0; ii--)
|
||||
{
|
||||
drawline16mid(x1+co[ii][0], y1-co[ii][1], x1+co[(ii+1)&3][0], y1-co[(ii+1)&3][1], editorcolors[col]);
|
||||
drawline16mid(x1+co[ii][0], y1-co[ii][1]+1, x1+co[(ii+1)&3][0], y1-co[(ii+1)&3][1]+1, editorcolors[col]);
|
||||
drawline16mid(x1+co[ii][0], y1-co[ii][1]-1, x1+co[(ii+1)&3][0], y1-co[(ii+1)&3][1]-1, editorcolors[col]);
|
||||
drawline16mid(x1+co[ii][0]+1, y1-co[ii][1], x1+co[(ii+1)&3][0]+1, y1-co[(ii+1)&3][1], editorcolors[col]);
|
||||
drawline16mid(x1+co[ii][0]-1, y1-co[ii][1], x1+co[(ii+1)&3][0]-1, y1-co[(ii+1)&3][1], editorcolors[col]);
|
||||
drawline16mid(x1, y1, x1 + co[(ii+1)&3][0], y1 - co[(ii+1)&3][1], editorcolors[col]);
|
||||
}
|
||||
drawlinepat = 0xffffffff;
|
||||
}
|
||||
else if ((sprite[j].cstat&16) > 0)
|
||||
{
|
||||
int32_t fx = mulscale6(tilesizx[sprite[j].picnum], sprite[j].xrepeat);
|
||||
int32_t one=(((sprite[j].ang+angofs+256)&512) == 0), no=!one;
|
||||
|
||||
x2 = mulscale11(sintable[(sprite[j].ang+angofs+2560)&2047],zoome) / 6144;
|
||||
y2 = mulscale11(sintable[(sprite[j].ang+angofs+2048)&2047],zoome) / 6144;
|
||||
y2 = scalescreeny(y2);
|
||||
|
||||
if (!(sprite[j].cstat&64))
|
||||
{
|
||||
drawline16mid(x1-no,y1-one, x1-x2-no,y1-y2-one, editorcolors[col]);
|
||||
drawline16mid(x1,y1, x1-x2,y1-y2, editorcolors[col]);
|
||||
drawline16mid(x1+no,y1+one, x1-x2+no,y1-y2+one, editorcolors[col]);
|
||||
}
|
||||
|
||||
drawline16mid(x1-no,y1-one, x1+x2-no,y1+y2-one, editorcolors[col]);
|
||||
drawline16mid(x1,y1, x1+x2,y1+y2, editorcolors[col]);
|
||||
drawline16mid(x1+no,y1+one, x1+x2+no,y1+y2+one, editorcolors[col]);
|
||||
|
||||
|
||||
x2 = mulscale13(sintable[(sprite[j].ang+angofs+1024)&2047],zoome) * fx / 4096;
|
||||
y2 = mulscale13(sintable[(sprite[j].ang+angofs+512)&2047],zoome) * fx / 4096;
|
||||
y2 = scalescreeny(y2);
|
||||
|
||||
drawline16mid(x1+1,y1, x1+x2+1,y1+y2, editorcolors[col]);
|
||||
drawline16mid(x1-1,y1, x1-x2-1,y1-y2, editorcolors[col]);
|
||||
drawline16mid(x1-1,y1, x1+x2-1,y1+y2, editorcolors[col]);
|
||||
drawline16mid(x1+1,y1, x1-x2+1,y1-y2, editorcolors[col]);
|
||||
|
||||
drawline16mid(x1,y1, x1-x2,y1-y2, editorcolors[col]);
|
||||
drawline16mid(x1,y1, x1+x2,y1+y2, editorcolors[col]);
|
||||
|
||||
drawline16mid(x1,y1-1, x1+x2,y1+y2-1, editorcolors[col]);
|
||||
drawline16mid(x1,y1+1, x1-x2,y1-y2+1, editorcolors[col]);
|
||||
drawline16mid(x1,y1+1, x1+x2,y1+y2+1, editorcolors[col]);
|
||||
drawline16mid(x1,y1-1, x1-x2,y1-y2-1, editorcolors[col]);
|
||||
}
|
||||
|
||||
col += 8;
|
||||
}
|
||||
else if ((sprite[j].cstat&16) > 0)
|
||||
{
|
||||
int32_t fx = mulscale6(tilesizx[sprite[j].picnum], sprite[j].xrepeat);
|
||||
|
||||
x2 = mulscale11(sintable[(sprite[j].ang+angofs+2560)&2047],zoome) / 6144;
|
||||
y2 = mulscale11(sintable[(sprite[j].ang+angofs+2048)&2047],zoome) / 6144;
|
||||
y2 = scalescreeny(y2);
|
||||
|
||||
drawline16mid(x1,y1, x1+x2,y1+y2, editorcolors[col]);
|
||||
if (!(sprite[j].cstat&64))
|
||||
drawline16mid(x1,y1, x1-x2,y1-y2, editorcolors[col]);
|
||||
|
||||
x2 = mulscale13(sintable[(sprite[j].ang+angofs+1024)&2047],zoome) * fx / 4096;
|
||||
y2 = mulscale13(sintable[(sprite[j].ang+angofs+512)&2047],zoome) * fx / 4096;
|
||||
y2 = scalescreeny(y2);
|
||||
|
||||
drawline16mid(x1,y1, x1+x2,y1+y2, editorcolors[col]);
|
||||
drawline16mid(x1,y1, x1-x2,y1-y2, editorcolors[col]);
|
||||
|
||||
col += 8;
|
||||
}
|
||||
else if ((sprite[j].cstat&32) > 0)
|
||||
if (flooraligned)
|
||||
{
|
||||
int32_t fx = mulscale10(mulscale6(tilesizx[sprite[j].picnum], sprite[j].xrepeat),zoome) >> 1;
|
||||
int32_t fy = mulscale10(mulscale6(tilesizy[sprite[j].picnum], sprite[j].yrepeat),zoome) >> 1;
|
||||
int32_t co[4][2], ii;
|
||||
int32_t co[4][2], ii, in;
|
||||
int32_t sinang = sintable[(sprite[j].ang+angofs+1536)&2047];
|
||||
int32_t cosang = sintable[(sprite[j].ang+angofs+1024)&2047];
|
||||
int32_t r,s;
|
||||
|
@ -12613,22 +12555,76 @@ static void drawscreen_drawsprite(int32_t j, int32_t posxe, int32_t posye, int32
|
|||
co[ii][0] = r;
|
||||
co[ii][1] = s;
|
||||
}
|
||||
|
||||
drawlinepat = 0xcfcfcfcf;
|
||||
for (ii=3; ii>=0; ii--)
|
||||
{
|
||||
drawline16mid(x1+co[ii][0], y1-co[ii][1], x1+co[(ii+1)&3][0], y1-co[(ii+1)&3][1], editorcolors[col]);
|
||||
drawline16mid(x1, y1, x1+co[(ii+1)&3][0], y1-co[(ii+1)&3][1], editorcolors[col]);
|
||||
in = (ii+1)&3;
|
||||
drawline16mid(x1+co[ii][0], y1-co[ii][1], x1+co[in][0], y1-co[in][1], editorcolors[col]);
|
||||
if (hitblocking)
|
||||
{
|
||||
drawline16mid(x1+co[ii][0], y1-co[ii][1]+1, x1+co[in][0], y1-co[in][1]+1, editorcolors[col]);
|
||||
drawline16mid(x1+co[ii][0], y1-co[ii][1]-1, x1+co[in][0], y1-co[in][1]-1, editorcolors[col]);
|
||||
drawline16mid(x1+co[ii][0]+1, y1-co[ii][1], x1+co[in][0]+1, y1-co[in][1], editorcolors[col]);
|
||||
drawline16mid(x1+co[ii][0]-1, y1-co[ii][1], x1+co[in][0]-1, y1-co[in][1], editorcolors[col]);
|
||||
}
|
||||
drawline16mid(x1, y1, x1 + co[in][0], y1 - co[in][1], editorcolors[col]);
|
||||
}
|
||||
drawlinepat = 0xffffffff;
|
||||
}
|
||||
else if (wallaligned)
|
||||
{
|
||||
int32_t fx = mulscale6(tilesizx[sprite[j].picnum], sprite[j].xrepeat);
|
||||
int32_t one=(((sprite[j].ang+angofs+256)&512) == 0), no=!one;
|
||||
|
||||
x2 = mulscale11(sintable[(sprite[j].ang+angofs+2560)&2047],zoome) / 6144;
|
||||
y2 = mulscale11(sintable[(sprite[j].ang+angofs+2048)&2047],zoome) / 6144;
|
||||
y2 = scalescreeny(y2);
|
||||
|
||||
drawline16mid(x1,y1, x1+x2,y1+y2, editorcolors[col]);
|
||||
if (!(sprite[j].cstat&64)) // not 1-sided
|
||||
{
|
||||
drawline16mid(x1,y1, x1-x2,y1-y2, editorcolors[col]);
|
||||
if (hitblocking)
|
||||
{
|
||||
drawline16mid(x1-no,y1-one, x1-x2-no,y1-y2-one, editorcolors[col]);
|
||||
drawline16mid(x1+no,y1+one, x1-x2+no,y1-y2+one, editorcolors[col]);
|
||||
}
|
||||
}
|
||||
|
||||
if (hitblocking)
|
||||
{
|
||||
drawline16mid(x1-no,y1-one, x1+x2-no,y1+y2-one, editorcolors[col]);
|
||||
drawline16mid(x1+no,y1+one, x1+x2+no,y1+y2+one, editorcolors[col]);
|
||||
}
|
||||
|
||||
|
||||
x2 = mulscale13(sintable[(sprite[j].ang+angofs+1024)&2047],zoome) * fx / 4096;
|
||||
y2 = mulscale13(sintable[(sprite[j].ang+angofs+512)&2047],zoome) * fx / 4096;
|
||||
y2 = scalescreeny(y2);
|
||||
|
||||
drawline16mid(x1,y1, x1-x2,y1-y2, editorcolors[col]);
|
||||
drawline16mid(x1,y1, x1+x2,y1+y2, editorcolors[col]);
|
||||
|
||||
if (hitblocking)
|
||||
{
|
||||
drawline16mid(x1+1,y1, x1+x2+1,y1+y2, editorcolors[col]);
|
||||
drawline16mid(x1-1,y1, x1-x2-1,y1-y2, editorcolors[col]);
|
||||
drawline16mid(x1-1,y1, x1+x2-1,y1+y2, editorcolors[col]);
|
||||
drawline16mid(x1+1,y1, x1-x2+1,y1-y2, editorcolors[col]);
|
||||
|
||||
drawline16mid(x1,y1-1, x1+x2,y1+y2-1, editorcolors[col]);
|
||||
drawline16mid(x1,y1+1, x1-x2,y1-y2+1, editorcolors[col]);
|
||||
drawline16mid(x1,y1+1, x1+x2,y1+y2+1, editorcolors[col]);
|
||||
drawline16mid(x1,y1-1, x1-x2,y1-y2-1, editorcolors[col]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// draw2dscreen
|
||||
//
|
||||
void draw2dscreen(const vec3_t *pos, int16_t ange, int32_t zoome, int16_t gride)
|
||||
void draw2dscreen(const vec3_t *pos, int16_t cursectnum, int16_t ange, int32_t zoome, int16_t gride)
|
||||
{
|
||||
int32_t i, j, x1, y1;
|
||||
int16_t angofs = m32_sideview ? m32_sideang : 0;
|
||||
|
@ -12660,7 +12656,7 @@ void draw2dscreen(const vec3_t *pos, int16_t ange, int32_t zoome, int16_t gride)
|
|||
clear2dscreen();
|
||||
|
||||
// faketimerhandler();
|
||||
draw2dgrid(posxe,posye,posze,ange,zoome,gride);
|
||||
draw2dgrid(posxe,posye,posze,cursectnum,ange,zoome,gride);
|
||||
}
|
||||
|
||||
faketimerhandler();
|
||||
|
|
|
@ -99,6 +99,13 @@ int32_t scripthistend = 0;
|
|||
|
||||
int32_t showambiencesounds=2;
|
||||
|
||||
static uint32_t templenrepquot;
|
||||
static void fixxrepeat(int16_t i, uint32_t lenrepquot)
|
||||
{
|
||||
if (lenrepquot != 0)
|
||||
wall[i].xrepeat = clamp(divscale12(wallength(i), lenrepquot), 1, 255);
|
||||
}
|
||||
|
||||
//////////////////// Key stuff ////////////////////
|
||||
|
||||
#define eitherALT (keystatus[KEYSC_LALT] || keystatus[KEYSC_RALT])
|
||||
|
@ -6192,8 +6199,10 @@ static void Keys3d(void)
|
|||
{
|
||||
temppicnum = AIMED_SELOVR_WALL(picnum);
|
||||
tempxrepeat = AIMED_SEL_WALL(xrepeat);
|
||||
tempxrepeat = max(1, tempxrepeat);
|
||||
tempyrepeat = AIMED_SEL_WALL(yrepeat);
|
||||
tempcstat = AIMED_SEL_WALL(cstat);
|
||||
templenrepquot = divscale12(wallength(searchwall), tempxrepeat);
|
||||
}
|
||||
else if (AIMING_AT_CEILING_OR_FLOOR)
|
||||
{
|
||||
|
@ -6293,9 +6302,9 @@ static void Keys3d(void)
|
|||
wall[i].xrepeat = tempxrepeat;
|
||||
wall[i].yrepeat = tempyrepeat;
|
||||
wall[i].cstat = tempcstat;
|
||||
fixxrepeat(i, templenrepquot);
|
||||
}
|
||||
|
||||
fixrepeats((int16_t)i);
|
||||
i = wall[i].point2;
|
||||
}
|
||||
while (i != searchwall);
|
||||
|
@ -6361,8 +6370,8 @@ static void Keys3d(void)
|
|||
wall[searchwall].lotag = templotag;
|
||||
wall[searchwall].hitag = temphitag;
|
||||
wall[searchwall].extra = tempextra;
|
||||
fixxrepeat(searchwall, templenrepquot);
|
||||
}
|
||||
fixrepeats(searchwall);
|
||||
asksave = 1;
|
||||
}
|
||||
else if (AIMING_AT_MASKWALL)
|
||||
|
@ -6382,8 +6391,8 @@ static void Keys3d(void)
|
|||
wall[searchwall].lotag = templotag;
|
||||
wall[searchwall].hitag = temphitag;
|
||||
wall[searchwall].extra = tempextra;
|
||||
fixxrepeat(searchwall, templenrepquot);
|
||||
}
|
||||
fixrepeats(searchwall);
|
||||
asksave = 1;
|
||||
}
|
||||
else if (AIMING_AT_CEILING_OR_FLOOR)
|
||||
|
|
Loading…
Reference in a new issue