mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-31 13:00:59 +00:00
- use floats for sprite depth sorting in the hardware renderer.
Fixed point is clearly insufficient here.
This commit is contained in:
parent
a056307218
commit
617b6cd987
3 changed files with 7 additions and 8 deletions
|
@ -585,10 +585,9 @@ inline int HWDrawList::CompareSprites(SortNode * a,SortNode * b)
|
||||||
HWSprite * s1= sprites[drawitems[a->itemindex].index];
|
HWSprite * s1= sprites[drawitems[a->itemindex].index];
|
||||||
HWSprite * s2= sprites[drawitems[b->itemindex].index];
|
HWSprite * s2= sprites[drawitems[b->itemindex].index];
|
||||||
|
|
||||||
int res = s1->depth - s2->depth;
|
if (s1->depth < s2->depth) return 1;
|
||||||
|
if (s1->depth > s2->depth) return -1;
|
||||||
if (res != 0) return -res;
|
return reverseSort? s2->index-s1->index : s1->index-s2->index;
|
||||||
else return reverseSort? s2->index-s1->index : s1->index-s2->index;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
|
@ -354,7 +354,7 @@ public:
|
||||||
|
|
||||||
int translation;
|
int translation;
|
||||||
int index;
|
int index;
|
||||||
int depth;
|
float depth;
|
||||||
int vertexindex;
|
int vertexindex;
|
||||||
|
|
||||||
float topclip;
|
float topclip;
|
||||||
|
@ -366,15 +366,15 @@ public:
|
||||||
float vt,vb;
|
float vt,vb;
|
||||||
float x1,y1,z1;
|
float x1,y1,z1;
|
||||||
float x2,y2,z2;
|
float x2,y2,z2;
|
||||||
|
float trans;
|
||||||
|
int dynlightindex;
|
||||||
|
|
||||||
FMaterial *gltexture;
|
FMaterial *gltexture;
|
||||||
float trans;
|
|
||||||
AActor * actor;
|
AActor * actor;
|
||||||
particle_t * particle;
|
particle_t * particle;
|
||||||
TArray<lightlist_t> *lightlist;
|
TArray<lightlist_t> *lightlist;
|
||||||
DRotator Angles;
|
DRotator Angles;
|
||||||
|
|
||||||
int dynlightindex;
|
|
||||||
|
|
||||||
void SplitSprite(HWDrawInfo *di, sector_t * frontsector, bool translucent);
|
void SplitSprite(HWDrawInfo *di, sector_t * frontsector, bool translucent);
|
||||||
void PerformSpriteClipAdjustment(AActor *thing, const DVector2 &thingpos, float spriteheight);
|
void PerformSpriteClipAdjustment(AActor *thing, const DVector2 &thingpos, float spriteheight);
|
||||||
|
|
|
@ -903,7 +903,7 @@ void HWSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t
|
||||||
gltexture = nullptr;
|
gltexture = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
depth = FloatToFixed((x - vp.Pos.X) * vp.TanCos + (y - vp.Pos.Y) * vp.TanSin);
|
depth = (float)((x - vp.Pos.X) * vp.TanCos + (y - vp.Pos.Y) * vp.TanSin);
|
||||||
|
|
||||||
// light calculation
|
// light calculation
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue