2006-02-24 04:48:15 +00:00
|
|
|
// Emacs style mode select -*- C++ -*-
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// $Id:$
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
// DESCRIPTION:
|
|
|
|
// Rendering of moving objects, sprites.
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __R_THINGS__
|
|
|
|
#define __R_THINGS__
|
|
|
|
|
|
|
|
// [RH] Particle details
|
|
|
|
struct particle_t
|
|
|
|
{
|
|
|
|
fixed_t x,y,z;
|
|
|
|
fixed_t velx,vely,velz;
|
|
|
|
fixed_t accx,accy,accz;
|
2006-09-14 00:02:31 +00:00
|
|
|
BYTE ttl;
|
|
|
|
BYTE trans;
|
|
|
|
BYTE size;
|
|
|
|
BYTE fade;
|
2006-02-24 04:48:15 +00:00
|
|
|
int color;
|
|
|
|
WORD tnext;
|
|
|
|
WORD snext;
|
|
|
|
};
|
|
|
|
|
2006-12-21 04:34:43 +00:00
|
|
|
extern WORD NumParticles;
|
|
|
|
extern WORD ActiveParticles;
|
|
|
|
extern WORD InactiveParticles;
|
2006-02-24 04:48:15 +00:00
|
|
|
extern particle_t *Particles;
|
|
|
|
|
|
|
|
const WORD NO_PARTICLE = 0xffff;
|
|
|
|
|
|
|
|
inline particle_t *NewParticle (void)
|
|
|
|
{
|
|
|
|
particle_t *result = NULL;
|
|
|
|
if (InactiveParticles != NO_PARTICLE)
|
|
|
|
{
|
|
|
|
result = Particles + InactiveParticles;
|
|
|
|
InactiveParticles = result->tnext;
|
|
|
|
result->tnext = ActiveParticles;
|
2006-12-21 04:34:43 +00:00
|
|
|
ActiveParticles = WORD(result - Particles);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
void R_InitParticles ();
|
2006-05-12 03:14:40 +00:00
|
|
|
void R_DeinitParticles ();
|
2006-02-24 04:48:15 +00:00
|
|
|
void R_ClearParticles ();
|
|
|
|
void R_DrawParticle (vissprite_t *);
|
|
|
|
void R_ProjectParticle (particle_t *, const sector_t *sector, int shade, int fakeside);
|
|
|
|
void R_FindParticleSubsectors ();
|
|
|
|
|
|
|
|
extern TArray<WORD> ParticlesInSubsec;
|
|
|
|
|
|
|
|
extern int MaxVisSprites;
|
|
|
|
|
|
|
|
extern vissprite_t **vissprites, **firstvissprite;
|
|
|
|
extern vissprite_t **vissprite_p;
|
|
|
|
|
|
|
|
// Constant arrays used for psprite clipping
|
|
|
|
// and initializing clipping.
|
|
|
|
extern short zeroarray[MAXWIDTH];
|
|
|
|
extern short screenheightarray[MAXWIDTH];
|
|
|
|
|
|
|
|
// vars for R_DrawMaskedColumn
|
|
|
|
extern short* mfloorclip;
|
|
|
|
extern short* mceilingclip;
|
|
|
|
extern fixed_t spryscale;
|
|
|
|
extern fixed_t sprtopscreen;
|
|
|
|
extern bool sprflipvert;
|
|
|
|
|
|
|
|
extern fixed_t pspritexscale;
|
|
|
|
extern fixed_t pspriteyscale;
|
|
|
|
extern fixed_t pspritexiscale;
|
|
|
|
|
|
|
|
|
|
|
|
void R_DrawMaskedColumn (const BYTE *column, const FTexture::Span *spans);
|
|
|
|
|
|
|
|
|
|
|
|
void R_CacheSprite (spritedef_t *sprite);
|
|
|
|
void R_SortVisSprites (int (STACK_ARGS *compare)(const void *, const void *), size_t first);
|
|
|
|
void R_AddSprites (sector_t *sec, int lightlevel, int fakeside);
|
|
|
|
void R_AddPSprites ();
|
|
|
|
void R_DrawSprites ();
|
|
|
|
void R_InitSprites ();
|
2006-05-12 03:14:40 +00:00
|
|
|
void R_DeinitSprites ();
|
2006-02-24 04:48:15 +00:00
|
|
|
void R_ClearSprites ();
|
|
|
|
void R_DrawMasked ();
|
|
|
|
|
|
|
|
void R_ClipVisSprite (vissprite_t *vis, int xl, int xh);
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|