mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
Correct relative floor texture alignment (with slopes too). Also avoids
a crash with mirrors in the editor. git-svn-id: https://svn.eduke32.com/eduke32@719 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
72867ff880
commit
6c11addc08
2 changed files with 28 additions and 11 deletions
|
@ -2,7 +2,6 @@
|
|||
// TODO :
|
||||
// - CORE STUFF
|
||||
// o put all the sector/wall geometry in VBOs
|
||||
// o there's still a texture alignment problem with slopes (waterfall in launch facility)
|
||||
// o wall palette problem (toxic waterfall in the abyss is blue)
|
||||
// o there's also the texture alignment problem Hunter reported (san andreas fault)
|
||||
// o also sliding doors are still fucked up sometimes (like under the bar in E1L2)
|
||||
|
@ -11,17 +10,12 @@
|
|||
// o remove all the IM matrix crap and write real functions now that it works
|
||||
// o polymer.c possibly needs to be split in several source files
|
||||
// o some crap really needs factorization
|
||||
// o only make parallaxes write into the depth buffer if map boundary (e1l2)
|
||||
// o ... possibly more important stuff I don't have in mind right now
|
||||
// - SPRITES
|
||||
// o port sprite panning and fullbrights from hacked polymost (:(
|
||||
// o draw all opaques first, keep translucent for later with masks
|
||||
// - SKIES
|
||||
// o figure a better way to handle ART skies - maybe add symetric caps that would fade to black like a big gem or something wow this is a long column lol ;0)
|
||||
// o implement polymost skyboxes
|
||||
// - MIRRORS
|
||||
// o figure out how to get mirror data from game
|
||||
// o unified mirror transformation (not just walls)
|
||||
// - MDSPRITES
|
||||
// o need to reimplement them - hopefully the loader can be reused without too much hassle
|
||||
// o need full translation and rotation support from CON to attach to game world or tags
|
||||
|
|
|
@ -869,7 +869,8 @@ static void polymer_inb4mirror(GLfloat* buffer, GLdouble* plane)
|
|||
|
||||
static void polymer_animatesprites(void)
|
||||
{
|
||||
asi.animatesprites(globalposx, globalposy, viewangle, asi.smoothratio);
|
||||
if (asi.animatesprites)
|
||||
asi.animatesprites(globalposx, globalposy, viewangle, asi.smoothratio);
|
||||
}
|
||||
|
||||
// SECTORS
|
||||
|
@ -913,8 +914,8 @@ static int polymer_updatesector(short sectnum)
|
|||
walltype *wal;
|
||||
int i, j;
|
||||
int ceilz, florz;
|
||||
int tex, tey;
|
||||
float secangcos, secangsin, scalecoef;
|
||||
int tex, tey, heidiff;
|
||||
float secangcos, secangsin, scalecoef, xpancoef, ypancoef;
|
||||
int ang, needfloor, wallinvalidate;
|
||||
short curstat, curpicnum, floorpicnum, ceilingpicnum;
|
||||
char curxpanning, curypanning;
|
||||
|
@ -1034,6 +1035,12 @@ static int polymer_updatesector(short sectnum)
|
|||
tex = (curstat & 64) ? ((wal->x - wall[sec->wallptr].x) * secangsin) + ((-wal->y - -wall[sec->wallptr].y) * secangcos) : wal->x;
|
||||
tey = (curstat & 64) ? ((wal->x - wall[sec->wallptr].x) * secangcos) - ((wall[sec->wallptr].y - wal->y) * secangsin) : -wal->y;
|
||||
|
||||
if ((curstat & (2+64)) == (2+64))
|
||||
{
|
||||
heidiff = curbuffer[(i*5)+1] - curbuffer[1];
|
||||
tey = sqrt((tey * tey) + (heidiff * heidiff));
|
||||
}
|
||||
|
||||
if (curstat & 4)
|
||||
swaplong(&tex, &tey);
|
||||
|
||||
|
@ -1042,8 +1049,24 @@ static int polymer_updatesector(short sectnum)
|
|||
|
||||
scalecoef = (curstat & 8) ? 8.0f : 16.0f;
|
||||
|
||||
curbuffer[(i*5)+3] = ((float)(tex) / (scalecoef * tilesizx[curpicnum])) + ((float)(curxpanning) / 256.0f);
|
||||
curbuffer[(i*5)+4] = ((float)(tey) / (scalecoef * tilesizy[curpicnum])) + ((float)(curypanning) / 256.0f);
|
||||
if (curxpanning)
|
||||
{
|
||||
xpancoef = (float)(pow2long[picsiz[curpicnum] & 15]);
|
||||
xpancoef *= (float)(curxpanning) / (256.0f * (float)(tilesizx[curpicnum]));
|
||||
}
|
||||
else
|
||||
xpancoef = 0;
|
||||
|
||||
if (curypanning)
|
||||
{
|
||||
ypancoef = (float)(pow2long[picsiz[curpicnum] >> 4]);
|
||||
ypancoef *= (float)(curypanning) / (256.0f * (float)(tilesizy[curpicnum]));
|
||||
}
|
||||
else
|
||||
ypancoef = 0;
|
||||
|
||||
curbuffer[(i*5)+3] = ((float)(tex) / (scalecoef * tilesizx[curpicnum])) + xpancoef;
|
||||
curbuffer[(i*5)+4] = ((float)(tey) / (scalecoef * tilesizy[curpicnum])) + ypancoef;
|
||||
|
||||
j--;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue