mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-12-12 21:31:57 +00:00
- use floats for sprite depth sorting in the hardware renderer.
Fixed point is clearly insufficient here. # Conflicts: # src/hwrenderer/scene/hw_drawlist.cpp # src/hwrenderer/scene/hw_drawstructs.h # Conflicts: # src/hwrenderer/scene/hw_drawlist.cpp # src/hwrenderer/scene/hw_sprites.cpp
This commit is contained in:
parent
2d1e19dc4b
commit
462368b61d
3 changed files with 7 additions and 8 deletions
|
@ -602,10 +602,9 @@ inline int GLDrawList::CompareSprites(SortNode * a,SortNode * b)
|
|||
GLSprite * s1=&sprites[drawitems[a->itemindex].index];
|
||||
GLSprite * s2=&sprites[drawitems[b->itemindex].index];
|
||||
|
||||
int res = s1->depth - s2->depth;
|
||||
|
||||
if (res != 0) return -res;
|
||||
else return (i_compatflags & COMPATF_SPRITESORT)? s2->index-s1->index : s1->index-s2->index;
|
||||
if (s1->depth < s2->depth) return 1;
|
||||
if (s1->depth > s2->depth) return -1;
|
||||
return (i_compatflags & COMPATF_SPRITESORT)? s2->index-s1->index : s1->index-s2->index;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -952,7 +952,7 @@ void GLSprite::Process(AActor* thing, sector_t * sector, int thruportal)
|
|||
gltexture = NULL;
|
||||
}
|
||||
|
||||
depth = FloatToFixed((x - r_viewpoint.Pos.X) * r_viewpoint.TanCos + (y - r_viewpoint.Pos.Y) * r_viewpoint.TanSin);
|
||||
depth = (float)((x - r_viewpoint.Pos.X) * r_viewpoint.TanCos + (y - r_viewpoint.Pos.Y) * r_viewpoint.TanSin);
|
||||
|
||||
// light calculation
|
||||
|
||||
|
|
|
@ -374,7 +374,7 @@ public:
|
|||
|
||||
int translation;
|
||||
int index;
|
||||
int depth;
|
||||
float depth;
|
||||
|
||||
float topclip;
|
||||
float bottomclip;
|
||||
|
@ -385,15 +385,15 @@ public:
|
|||
float vt,vb;
|
||||
float x1,y1,z1;
|
||||
float x2,y2,z2;
|
||||
float trans;
|
||||
int dynlightindex;
|
||||
|
||||
FMaterial *gltexture;
|
||||
float trans;
|
||||
AActor * actor;
|
||||
particle_t * particle;
|
||||
TArray<lightlist_t> *lightlist;
|
||||
DRotator Angles;
|
||||
|
||||
int dynlightindex;
|
||||
|
||||
void SplitSprite(sector_t * frontsector, bool translucent);
|
||||
void SetLowerParam();
|
||||
|
|
Loading…
Reference in a new issue