gzdoom-gles/src/swrenderer/things/r_visiblesprite.h

74 lines
2 KiB
C
Raw Normal View History

//
// Copyright (C) 1993-1996 by id Software, Inc.
//
// This source is available for distribution and/or modification
// only under the terms of the DOOM Source Code License as
// published by id Software. All rights reserved.
//
// The source is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
// for more details.
//
2016-12-30 06:15:10 +00:00
#pragma once
2017-01-01 09:28:35 +00:00
#include "swrenderer/line/r_line.h"
#include "swrenderer/scene/r_opaque_pass.h"
#include "swrenderer/things/r_visiblespritelist.h"
2016-12-30 06:15:10 +00:00
#define MINZ double((2048*4) / double(1 << 20))
2016-12-30 06:15:10 +00:00
namespace swrenderer
{
class VisibleSprite
2016-12-30 06:15:10 +00:00
{
public:
void Render();
bool IsCurrentPortalUniq(int portalUniq) const { return CurrentPortalUniq == portalUniq; }
const FVector3 &WorldPos() const { return gpos; }
double SortDist2D() const { return DVector2(deltax, deltay).LengthSquared(); }
float SortDist() const { return idepth; }
protected:
virtual bool IsParticle() const { return false; }
virtual bool IsVoxel() const { return false; }
virtual bool IsWallSprite() const { return false; }
virtual void Render(short *cliptop, short *clipbottom, int minZ, int maxZ) = 0;
FTexture *pic;
2016-12-30 06:15:10 +00:00
short x1, x2;
float gzb, gzt; // global bottom / top for silhouette clipping
2016-12-30 06:15:10 +00:00
double floorclip;
double texturemid; // floorclip
float yscale; // voxel and floorclip
sector_t *heightsec; // height sector for underwater/fake ceiling
WaterFakeSide FakeFlatStat; // which side of fake/floor ceiling sprite is on
F3DFloor *fakefloor; // 3d floor clipping
2016-12-30 06:15:10 +00:00
F3DFloor *fakeceiling;
FVector3 gpos; // origin in world coordinates
sector_t *sector; // sector this sprite is in
// Light shared calculation?
visstyle_t Style;
2017-01-12 19:13:21 +00:00
bool foggy;
short renderflags;
float depth; // Sort (draw segments), also light
float deltax, deltay; // Sort (2d/voxel version)
float idepth; // Sort (non-voxel version)
2017-01-12 19:13:21 +00:00
int CurrentPortalUniq; // to identify the portal that this thing is in. used for clipping.
2016-12-30 06:15:10 +00:00
};
}