mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 15:01:41 +00:00
Take the first step towards render plugins.
No clients link. Even if they did, nothing would work.
This commit is contained in:
parent
1cbabf72c9
commit
a4c280f2b2
143 changed files with 1475 additions and 1304 deletions
|
@ -39,7 +39,7 @@ if test "x$HAVE_FBDEV" = xyes; then
|
|||
NQ_TARGETS="$NQ_TARGETS nq-fbdev\$(EXEEXT)"
|
||||
CL_TARGETS="$CL_TARGETS FBDEV"
|
||||
VID_TARGETS="$VID_TARGETS libQFfbdev.la"
|
||||
QF_NEED(QFrenderer, [sw])
|
||||
QF_NEED(vid_render, [sw])
|
||||
QF_NEED(QFmodels, [sw])
|
||||
QF_NEED(alias, [sw])
|
||||
QF_NEED(brush, [sw])
|
||||
|
@ -61,7 +61,7 @@ if test "x$HAVE_X" = xyes; then
|
|||
NQ_DESKTOP_DATA="$NQ_DESKTOP_DATA quakeforge-nq-glx.desktop"
|
||||
CL_TARGETS="$CL_TARGETS GLX"
|
||||
VID_TARGETS="$VID_TARGETS libQFglx.la"
|
||||
QF_NEED(QFrenderer, [gl])
|
||||
QF_NEED(vid_render, [gl])
|
||||
QF_NEED(QFmodels, [gl])
|
||||
QF_NEED(alias, [gl])
|
||||
QF_NEED(brush, [gl])
|
||||
|
@ -78,7 +78,7 @@ if test "x$HAVE_X" = xyes; then
|
|||
NQ_DESKTOP_DATA="$NQ_DESKTOP_DATA quakeforge-nq-glslx.desktop"
|
||||
CL_TARGETS="$CL_TARGETS GLSLX"
|
||||
VID_TARGETS="$VID_TARGETS libQFglslx.la"
|
||||
QF_NEED(QFrenderer, [glsl])
|
||||
QF_NEED(vid_render, [glsl])
|
||||
QF_NEED(QFmodels, [glsl])
|
||||
QF_NEED(alias, [glsl])
|
||||
QF_NEED(brush, [glsl])
|
||||
|
@ -95,7 +95,7 @@ if test "x$HAVE_X" = xyes; then
|
|||
NQ_DESKTOP_DATA="$NQ_DESKTOP_DATA quakeforge-nq-x11.desktop"
|
||||
CL_TARGETS="$CL_TARGETS X11"
|
||||
VID_TARGETS="$VID_TARGETS libQFx11.la"
|
||||
QF_NEED(QFrenderer, [sw])
|
||||
QF_NEED(vid_render, [sw])
|
||||
QF_NEED(QFmodels, [sw])
|
||||
QF_NEED(alias, [sw])
|
||||
QF_NEED(brush, [sw])
|
||||
|
@ -115,7 +115,7 @@ if test "x$HAVE_MGL" = xyes; then
|
|||
NQ_TARGETS="$NQ_TARGETS nq-mgl\$(EXEEXT)"
|
||||
CL_TARGETS="$CL_TARGETS MGL"
|
||||
VID_TARGETS="$VID_TARGETS libQFwgl.la"
|
||||
QF_NEED(QFrenderer, [sw])
|
||||
QF_NEED(vid_render, [sw])
|
||||
QF_NEED(QFmodels, [sw])
|
||||
QF_NEED(alias, [sw])
|
||||
QF_NEED(brush, [sw])
|
||||
|
@ -137,7 +137,7 @@ if test "x$HAVE_SDL" = xyes; then
|
|||
NQ_DESKTOP_DATA="$NQ_DESKTOP_DATA quakeforge-nq-sdl.desktop"
|
||||
CL_TARGETS="$CL_TARGETS SDL"
|
||||
VID_TARGETS="$VID_TARGETS libQFsdl.la"
|
||||
QF_NEED(QFrenderer, [sw])
|
||||
QF_NEED(vid_render, [sw])
|
||||
QF_NEED(QFmodels, [sw])
|
||||
QF_NEED(alias, [sw])
|
||||
QF_NEED(brush, [sw])
|
||||
|
@ -157,7 +157,7 @@ if test "x$HAVE_SDL" = xyes; then
|
|||
NQ_DESKTOP_DATA="$NQ_DESKTOP_DATA quakeforge-nq-sdl32.desktop"
|
||||
CL_TARGETS="$CL_TARGETS SDL32"
|
||||
VID_TARGETS="$VID_TARGETS libQFsdl32.la"
|
||||
QF_NEED(QFrenderer, [sw32])
|
||||
QF_NEED(vid_render, [sw32])
|
||||
QF_NEED(QFmodels, [sw])
|
||||
QF_NEED(alias, [sw])
|
||||
QF_NEED(brush, [sw])
|
||||
|
@ -174,7 +174,7 @@ if test "x$HAVE_SDL" = xyes; then
|
|||
NQ_DESKTOP_DATA="$NQ_DESKTOP_DATA quakeforge-nq-sgl.desktop"
|
||||
CL_TARGETS="$CL_TARGETS SDL-GL"
|
||||
VID_TARGETS="$VID_TARGETS libQFsgl.la"
|
||||
QF_NEED(QFrenderer, [gl])
|
||||
QF_NEED(vid_render, [gl])
|
||||
QF_NEED(QFmodels, [gl])
|
||||
QF_NEED(alias, [gl])
|
||||
QF_NEED(brush, [gl])
|
||||
|
@ -191,7 +191,7 @@ if test "x$HAVE_SDL" = xyes; then
|
|||
NQ_DESKTOP_DATA="$NQ_DESKTOP_DATA quakeforge-nq-sglsl.desktop"
|
||||
CL_TARGETS="$CL_TARGETS SDL-GLSL"
|
||||
VID_TARGETS="$VID_TARGETS libQFsglsl.la"
|
||||
QF_NEED(QFrenderer, [glsl])
|
||||
QF_NEED(vid_render, [glsl])
|
||||
QF_NEED(QFmodels, [glsl])
|
||||
QF_NEED(alias, [glsl])
|
||||
QF_NEED(brush, [glsl])
|
||||
|
@ -208,7 +208,7 @@ if test "x$HAVE_SVGA" = xyes; then
|
|||
NQ_TARGETS="$NQ_TARGETS nq-svga\$(EXEEXT)"
|
||||
CL_TARGETS="$CL_TARGETS SVGAlib"
|
||||
VID_TARGETS="$VID_TARGETS libQFsvga.la"
|
||||
QF_NEED(QFrenderer, [sw])
|
||||
QF_NEED(vid_render, [sw])
|
||||
QF_NEED(QFmodels, [sw])
|
||||
QF_NEED(alias, [sw])
|
||||
QF_NEED(brush, [sw])
|
||||
|
@ -226,7 +226,7 @@ if test "x$HAVE_SVGA" = xyes; then
|
|||
NQ_TARGETS="$NQ_TARGETS nq-3dfx\$(EXEEXT)"
|
||||
CL_TARGETS="$CL_TARGETS 3dfx"
|
||||
VID_TARGETS="$VID_TARGETS libQFtdfx.la"
|
||||
QF_NEED(QFrenderer, [gl])
|
||||
QF_NEED(vid_render, [gl])
|
||||
QF_NEED(QFmodels, [gl])
|
||||
QF_NEED(alias, [gl])
|
||||
QF_NEED(brush, [gl])
|
||||
|
@ -243,7 +243,7 @@ if test "x$mingw" = xyes; then
|
|||
NQ_TARGETS="$NQ_TARGETS nq-wgl\$(EXEEXT)"
|
||||
CL_TARGETS="$CL_TARGETS WGL"
|
||||
VID_TARGETS="$VID_TARGETS libQFwgl.la"
|
||||
QF_NEED(QFrenderer, [gl])
|
||||
QF_NEED(vid_render, [gl])
|
||||
QF_NEED(QFmodels, [gl])
|
||||
QF_NEED(alias, [gl])
|
||||
QF_NEED(brush, [gl])
|
||||
|
@ -338,8 +338,7 @@ QF_SUBST(progs_gz)
|
|||
QF_PROCESS_NEED_DIRS(top, [libs hw nq qtv qw tools ruamoko])
|
||||
|
||||
QF_PROCESS_NEED_LIBS(swrend, [asm])
|
||||
QF_PROCESS_NEED_LIBS(QFrenderer, [gl glsl sw sw32])
|
||||
QF_PROCESS_NEED_DIRS(QFrenderer, [gl glsl sw sw32])
|
||||
QF_PROCESS_NEED_DIRS(vid_render, [gl glsl sw sw32])
|
||||
QF_PROCESS_NEED_LIBS(QFmodels, [gl glsl sw])
|
||||
QF_PROCESS_NEED_LIBS(alias, [gl glsl sw])
|
||||
QF_PROCESS_NEED_LIBS(brush, [gl glsl sw])
|
||||
|
@ -388,6 +387,7 @@ if test "x$static_plugins" = xauto; then
|
|||
fi
|
||||
fi
|
||||
if test "x$static_plugins" = xyes; then
|
||||
QF_PROCESS_NEED_STATIC_PLUGINS(vid_render, [gl glsl sw sw32])
|
||||
QF_PROCESS_NEED_STATIC_PLUGINS(console, [server], [\$(top_builddir)/libs/console], [server])
|
||||
QF_PROCESS_NEED_STATIC_PLUGINS(console, [client], [\$(top_builddir)/libs/console], [client])
|
||||
|
||||
|
@ -402,6 +402,7 @@ if test "x$static_plugins" = xyes; then
|
|||
CDTYPE="$CDTYPE (static)"
|
||||
fi
|
||||
else
|
||||
QF_PROCESS_NEED_PLUGINS(vid_render, [gl glsl sw sw32])
|
||||
QF_PROCESS_NEED_PLUGINS(console, [server], [server])
|
||||
QF_PROCESS_NEED_PLUGINS(console, [client], [client])
|
||||
QF_PROCESS_NEED_PLUGINS(snd_output, [sdl mme sgi sun win dx oss alsa])
|
||||
|
|
|
@ -59,7 +59,7 @@ void Draw_Init (void);
|
|||
also standard ascii (brown). 0x01-0x1f and 0x80-0x9f are
|
||||
various drawing characters, and 0x7f is a backwards arrow.
|
||||
*/
|
||||
void Draw_Character (int x, int y, unsigned int ch);
|
||||
void Draw_Character (int x, int y, unsigned ch);
|
||||
|
||||
/** Draws a character string to the screen.
|
||||
No line wrapping is performed.
|
||||
|
|
|
@ -61,6 +61,7 @@ typedef struct plugin_funcs_s {
|
|||
struct console_funcs_s *console;
|
||||
struct snd_output_funcs_s *snd_output;
|
||||
struct snd_render_funcs_s *snd_render;
|
||||
struct vid_render_funcs_s *vid_render;
|
||||
} plugin_funcs_t;
|
||||
|
||||
typedef struct plugin_data_s {
|
||||
|
@ -70,6 +71,7 @@ typedef struct plugin_data_s {
|
|||
struct console_data_s *console;
|
||||
struct snd_output_data_s *snd_output;
|
||||
struct snd_render_data_s *snd_render;
|
||||
struct vid_render_data_s *vid_render;
|
||||
} plugin_data_t;
|
||||
|
||||
typedef struct plugin_s {
|
||||
|
|
153
include/QF/plugin/vid_render.h
Normal file
153
include/QF/plugin/vid_render.h
Normal file
|
@ -0,0 +1,153 @@
|
|||
/*
|
||||
QF/plugin/vid_render.h
|
||||
|
||||
Video Renderer plugin data types
|
||||
|
||||
Copyright (C) 2001 Jeff Teunissen <deek@quakeforge.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to:
|
||||
|
||||
Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA
|
||||
|
||||
$Id$
|
||||
*/
|
||||
#ifndef __QF_plugin_vid_render_h_
|
||||
#define __QF_plugin_vid_render_h_
|
||||
|
||||
#include <QF/draw.h>
|
||||
#include <QF/plugin.h>
|
||||
#include <QF/qtypes.h>
|
||||
#include <QF/render.h>
|
||||
#include <QF/screen.h>
|
||||
|
||||
struct plitem_s;
|
||||
struct cvar_s;
|
||||
|
||||
/*
|
||||
All video plugins must export these functions
|
||||
*/
|
||||
|
||||
typedef struct vid_particle_funcs_s {
|
||||
void (*R_RocketTrail) (const struct entity_s *ent);
|
||||
void (*R_GrenadeTrail) (const struct entity_s *ent);
|
||||
void (*R_BloodTrail) (const struct entity_s *ent);
|
||||
void (*R_SlightBloodTrail) (const struct entity_s *ent);
|
||||
void (*R_WizTrail) (const struct entity_s *ent);
|
||||
void (*R_FlameTrail) (const struct entity_s *ent);
|
||||
void (*R_VoorTrail) (const struct entity_s *ent);
|
||||
void (*R_GlowTrail) (const struct entity_s *ent, int glow_color);
|
||||
|
||||
void (*R_RunParticleEffect) (const vec3_t org, const vec3_t dir,
|
||||
int color, int count);
|
||||
void (*R_BloodPuffEffect) (const vec3_t org, int count);
|
||||
void (*R_GunshotEffect) (const vec3_t org, int count);
|
||||
void (*R_LightningBloodEffect) (const vec3_t org);
|
||||
void (*R_SpikeEffect) (const vec3_t org);
|
||||
void (*R_KnightSpikeEffect) (const vec3_t org);
|
||||
void (*R_SuperSpikeEffect) (const vec3_t org);
|
||||
void (*R_WizSpikeEffect) (const vec3_t org);
|
||||
|
||||
void (*R_BlobExplosion) (const vec3_t org);
|
||||
void (*R_ParticleExplosion) (const vec3_t org);
|
||||
void (*R_ParticleExplosion2) (const vec3_t org, int colorStart,
|
||||
int colorLength);
|
||||
void (*R_LavaSplash) (const vec3_t org);
|
||||
void (*R_TeleportSplash) (const vec3_t org);
|
||||
void (*R_DarkFieldParticles) (const struct entity_s *ent);
|
||||
void (*R_EntityParticles) (const struct entity_s *ent);
|
||||
} vid_particle_funcs_t;
|
||||
|
||||
typedef struct vid_render_funcs_s {
|
||||
void (*Draw_Init) (void);
|
||||
void (*Draw_Character) (int x, int y, unsigned ch);
|
||||
void (*Draw_String) (int x, int y, const char *str);
|
||||
void (*Draw_nString) (int x, int y, const char *str, int count);
|
||||
void (*Draw_AltString) (int x, int y, const char *str);
|
||||
void (*Draw_ConsoleBackground) (int lines, byte alpha);
|
||||
void (*Draw_Crosshair) (void);
|
||||
void (*Draw_CrosshairAt) (int ch, int x, int y);
|
||||
void (*Draw_TileClear) (int x, int y, int w, int h);
|
||||
void (*Draw_Fill) (int x, int y, int w, int h, int c);
|
||||
void (*Draw_TextBox) (int x, int y, int width, int lines, byte alpha);
|
||||
void (*Draw_FadeScreen) (void);
|
||||
void (*Draw_BlendScreen) (quat_t color);
|
||||
qpic_t *(*Draw_CachePic) (const char *path, qboolean alpha);
|
||||
void (*Draw_UncachePic) (const char *path);
|
||||
qpic_t *(*Draw_MakePic) (int width, int height, const byte *data);
|
||||
void (*Draw_DestroyPic) (qpic_t *pic);
|
||||
qpic_t *(*Draw_PicFromWad) (const char *name);
|
||||
void (*Draw_Pic) (int x, int y, qpic_t *pic);
|
||||
void (*Draw_Picf) (float x, float y, qpic_t *pic);
|
||||
void (*Draw_SubPic) (int x, int y, qpic_t *pic, int srcx, int srcy, int width, int height);
|
||||
|
||||
|
||||
// scr_funcs is a null terminated array
|
||||
void (*SCR_UpdateScreen) (double realtime, SCR_Func scr_3dfunc,
|
||||
SCR_Func *scr_funcs);
|
||||
void (*SCR_DrawRam) (void);
|
||||
void (*SCR_DrawFPS) (void);
|
||||
void (*SCR_DrawTime) (void);
|
||||
void (*SCR_DrawTurtle) (void);
|
||||
void (*SCR_DrawPause) (void);
|
||||
struct tex_s *(*SCR_CaptureBGR) (void);
|
||||
|
||||
void (*Fog_Update) (float density, float red, float green, float blue,
|
||||
float time);
|
||||
void (*Fog_ParseWorldspawn) (struct plitem_s *worldspawn);
|
||||
|
||||
void (*R_ClearState) (void);
|
||||
void (*R_LoadSkys) (const char *);
|
||||
void (*R_NewMap) (model_t *worldmodel, model_t **models, int num_models);
|
||||
void (*R_AddEfrags) (entity_t *ent);
|
||||
void (*R_RemoveEfrags) (entity_t *ent);
|
||||
dlight_t *(*R_AllocDlight) (int key);
|
||||
entity_t *(*R_AllocEntity) (void);
|
||||
void (*R_RenderView) (void);
|
||||
void (*R_DecayLights) (double frametime);
|
||||
void (*D_FlushCaches) (void);
|
||||
|
||||
vid_particle_funcs_t *particles;
|
||||
} vid_render_funcs_t;
|
||||
|
||||
typedef struct vid_render_data_s {
|
||||
viddef_t *vid;
|
||||
refdef_t *refdef;
|
||||
vrect_t *scr_vrect;
|
||||
int scr_copytop;
|
||||
int scr_copyeverything;
|
||||
int scr_fullupdate; // set to 0 to force full redraw
|
||||
void (*viewsize_callback) (struct cvar_s *);
|
||||
struct cvar_s *scr_viewsize;
|
||||
float min_wateralpha;
|
||||
qboolean active;
|
||||
qboolean force_fullscreen;
|
||||
qboolean inhibit_viewmodel;
|
||||
qboolean paused;
|
||||
int lineadj;
|
||||
struct entity_s *view_model;
|
||||
struct entity_s *player_entity;
|
||||
float gravity;
|
||||
double frametime;
|
||||
double realtime;
|
||||
lightstyle_t *lightstyle;
|
||||
vec_t *origin;
|
||||
vec_t *vpn;
|
||||
vec_t *vright;
|
||||
vec_t *vup;
|
||||
} vid_render_data_t;
|
||||
|
||||
#endif // __QF_plugin_vid_render_h_
|
|
@ -34,6 +34,9 @@
|
|||
#include "QF/qdefs.h" // FIXME
|
||||
#include "QF/vid.h"
|
||||
|
||||
extern struct vid_render_funcs_s *r_funcs;
|
||||
extern struct vid_render_data_s *r_data;
|
||||
|
||||
// dynamic lights ===========================================================
|
||||
|
||||
typedef struct dlight_s
|
||||
|
@ -50,17 +53,12 @@ typedef struct dlight_s
|
|||
extern dlight_t *r_dlights;
|
||||
extern unsigned int r_maxdlights;
|
||||
|
||||
// FIXME: client_state_t should hold all pieces of the client state
|
||||
typedef struct
|
||||
{
|
||||
int length;
|
||||
char map[MAX_STYLESTRING];
|
||||
} lightstyle_t;
|
||||
|
||||
extern lightstyle_t r_lightstyle[MAX_LIGHTSTYLES];
|
||||
|
||||
// FIXME: lightstyle_t and r_lightstyle were in client.h, is this the best place for them?
|
||||
|
||||
//===============
|
||||
|
||||
typedef struct entity_s {
|
||||
|
@ -131,78 +129,27 @@ typedef struct
|
|||
int ambientlight;
|
||||
} refdef_t;
|
||||
|
||||
// REFRESH ====================================================================
|
||||
// color shifts =============================================================
|
||||
|
||||
extern refdef_t r_refdef;
|
||||
extern vec3_t r_origin, vpn, vright, vup;
|
||||
typedef struct {
|
||||
int destcolor[3];
|
||||
int percent; // 0-255
|
||||
} cshift_t;
|
||||
|
||||
#define CSHIFT_CONTENTS 0
|
||||
#define CSHIFT_DAMAGE 1
|
||||
#define CSHIFT_BONUS 2
|
||||
#define CSHIFT_POWERUP 3
|
||||
#define NUM_CSHIFTS 4
|
||||
|
||||
// REFRESH ====================================================================
|
||||
|
||||
extern struct texture_s *r_notexture_mip;
|
||||
|
||||
extern entity_t r_worldentity;
|
||||
|
||||
extern void (*r_viewsize_callback)(struct cvar_s *var);
|
||||
extern int r_viewsize;
|
||||
|
||||
void R_Init (void);
|
||||
void R_Init_Cvars (void);
|
||||
void R_InitEfrags (void);
|
||||
void R_ClearState (void);
|
||||
void R_InitSky (struct texture_s *mt); // called at level load
|
||||
void R_Textures_Init (void);
|
||||
void R_RenderView (void); // must set r_refdef first
|
||||
void R_ViewChanged (float aspect); // must set r_refdef first
|
||||
// called whenever r_refdef or vid change
|
||||
|
||||
void R_AddEfrags (entity_t *ent);
|
||||
void R_RemoveEfrags (entity_t *ent);
|
||||
|
||||
void R_NewMap (model_t *worldmodel, struct model_s **models, int num_models);
|
||||
|
||||
// LordHavoc: relative bmodel lighting
|
||||
void R_PushDlights (const vec3_t entorigin);
|
||||
void R_DrawWaterSurfaces (void);
|
||||
|
||||
void Fog_Update (float density, float red, float green, float blue,
|
||||
float time);
|
||||
struct plitem_s;
|
||||
void Fog_ParseWorldspawn (struct plitem_s *worldspawn);
|
||||
float *Fog_GetColor (void);
|
||||
float Fog_GetDensity (void);
|
||||
void Fog_SetupFrame (void);
|
||||
void Fog_EnableGFog (void);
|
||||
void Fog_DisableGFog (void);
|
||||
void Fog_StartAdditive (void);
|
||||
void Fog_StopAdditive (void);
|
||||
void Fog_Init (void);
|
||||
|
||||
extern int r_lineadj;
|
||||
|
||||
void *D_SurfaceCacheAddress (void);
|
||||
int D_SurfaceCacheForRes (int width, int height);
|
||||
void D_FlushCaches (void);
|
||||
void D_DeleteSurfaceCache (void);
|
||||
void D_InitCaches (void *buffer, int size);
|
||||
void R_SetVrect (vrect_t *pvrect, vrect_t *pvrectin, int lineadj);
|
||||
|
||||
void R_LoadSkys (const char *);
|
||||
|
||||
void R_ClearEfrags (void);
|
||||
void R_ClearEnts (void);
|
||||
void R_EnqueueEntity (struct entity_s *ent);
|
||||
struct entity_s *R_AllocEntity (void);
|
||||
void R_FreeAllEntities (void);
|
||||
|
||||
dlight_t *R_AllocDlight (int key);
|
||||
void R_DecayLights (double frametime);
|
||||
void R_ClearDlights (void);
|
||||
|
||||
int R_InitGraphTextures (int base);
|
||||
void R_LineGraph (int x, int y, int *h_vals, int count);
|
||||
struct progs_s;
|
||||
void R_Progs_Init (struct progs_s *pr);
|
||||
|
||||
void R_DrawAliasModel (entity_t *e);
|
||||
|
||||
void R_MarkLeaves (void);
|
||||
|
||||
#endif // __render_h
|
||||
|
|
|
@ -36,10 +36,6 @@ void SCR_Init_Cvars (void);
|
|||
void SCR_Init (void);
|
||||
|
||||
typedef void (*SCR_Func)(void);
|
||||
// scr_funcs is a null terminated array
|
||||
void SCR_UpdateScreen (double realtime, SCR_Func scr_3dfunc,
|
||||
SCR_Func *scr_funcs);
|
||||
void SCR_UpdateWholeScreen (void);
|
||||
|
||||
void SCR_SizeUp (void);
|
||||
void SCR_SizeDown (void);
|
||||
|
@ -50,21 +46,14 @@ void SCR_BeginLoadingPlaque (void);
|
|||
void SCR_EndLoadingPlaque (void);
|
||||
|
||||
struct view_s;
|
||||
void SCR_DrawRam (void);
|
||||
void SCR_DrawFPS (void);
|
||||
void SCR_DrawTime (void);
|
||||
void SCR_DrawTurtle (void);
|
||||
void SCR_DrawPause (void);
|
||||
|
||||
struct tex_s *SCR_ScreenShot (int width, int height);
|
||||
struct tex_s *SCR_CaptureBGR (void);
|
||||
void SCR_DrawStringToSnap (const char *s, struct tex_s *tex, int x, int y);
|
||||
int MipColor (int r, int g, int b);
|
||||
int SCR_ModalMessage (const char *text);
|
||||
|
||||
extern float scr_con_current;
|
||||
|
||||
extern int scr_fullupdate; // set to 0 to force full redraw
|
||||
extern int sb_lines;
|
||||
|
||||
extern int clearnotify; // set to 0 whenever notify text is drawn
|
||||
|
@ -76,8 +65,6 @@ extern struct cvar_s *scr_fov;
|
|||
extern struct cvar_s *scr_viewsize;
|
||||
|
||||
// only the refresh window will be updated unless these variables are flagged
|
||||
extern int scr_copytop;
|
||||
extern int scr_copyeverything;
|
||||
|
||||
extern struct qpic_s *scr_ram;
|
||||
extern struct qpic_s *scr_net;
|
||||
|
|
|
@ -78,7 +78,6 @@ typedef struct {
|
|||
void (*do_screen_buffer)(void);
|
||||
} viddef_t;
|
||||
|
||||
extern viddef_t vid; // global video state
|
||||
extern unsigned short d_8to16table[256];
|
||||
extern unsigned int d_8to24table[256];
|
||||
|
||||
|
|
|
@ -29,7 +29,8 @@
|
|||
#ifndef _D_LOCAL_H
|
||||
#define _D_LOCAL_H
|
||||
|
||||
#include "r_shared.h"
|
||||
#include "QF/model.h"
|
||||
#include "QF/qtypes.h"
|
||||
|
||||
//
|
||||
// TODO: fine-tune this; it's based on providing some overage even if there
|
||||
|
@ -80,14 +81,15 @@ extern fixed16_t sadjust, tadjust;
|
|||
extern fixed16_t bbextents, bbextentt;
|
||||
|
||||
// FIXME: Better way of handling D_DrawSpans depths?
|
||||
void D_DrawSpans (espan_t *pspans);
|
||||
void D_DrawSpans8 (espan_t *pspans);
|
||||
void D_DrawSpans16 (espan_t *pspans);
|
||||
void D_DrawZSpans (espan_t *pspans);
|
||||
void Turbulent (espan_t *pspan);
|
||||
struct espan_s;
|
||||
void D_DrawSpans (struct espan_s *pspans);
|
||||
void D_DrawSpans8 (struct espan_s *pspans);
|
||||
void D_DrawSpans16 (struct espan_s *pspans);
|
||||
void D_DrawZSpans (struct espan_s *pspans);
|
||||
void Turbulent (struct espan_s *pspan);
|
||||
void D_SpriteDrawSpans (sspan_t *pspan);
|
||||
|
||||
void D_DrawSkyScans (espan_t *pspan);
|
||||
void D_DrawSkyScans (struct espan_s *pspan);
|
||||
|
||||
void R_ShowSubDiv (void);
|
||||
extern void (*prealspandrawer)(void);
|
||||
|
@ -104,7 +106,7 @@ extern short *d_pzbuffer;
|
|||
extern unsigned int d_zrowbytes, d_zwidth;
|
||||
|
||||
extern int *d_pscantable;
|
||||
extern int d_scantable[MAXHEIGHT];
|
||||
extern int d_scantable[];
|
||||
|
||||
extern int d_vrectx, d_vrecty, d_vrectright_particle, d_vrectbottom_particle;
|
||||
|
||||
|
@ -112,12 +114,12 @@ extern int d_y_aspect_shift, d_pix_min, d_pix_max, d_pix_shift;
|
|||
|
||||
extern byte *d_viewbuffer;
|
||||
|
||||
extern short *zspantable[MAXHEIGHT];
|
||||
extern short *zspantable[];
|
||||
|
||||
extern int d_minmip;
|
||||
extern float d_scalemip[3];
|
||||
|
||||
extern void (*d_drawspans) (espan_t *pspan);
|
||||
extern void (*d_drawspans) (struct espan_s *pspan);
|
||||
|
||||
void D_RasterizeAliasPolySmooth (void);
|
||||
void D_PolysetCalcGradients (int skinwidth);
|
||||
|
|
|
@ -95,14 +95,12 @@ extern struct cvar_s *r_waterripple;
|
|||
extern struct cvar_s *r_waterwarp;
|
||||
extern struct cvar_s *r_zgraph;
|
||||
|
||||
extern struct cvar_s *scr_centertime;
|
||||
extern struct cvar_s *scr_consize;
|
||||
extern struct cvar_s *scr_conspeed;
|
||||
extern struct cvar_s *scr_fov;
|
||||
extern struct cvar_s *scr_fisheye;
|
||||
extern struct cvar_s *scr_fviews;
|
||||
extern struct cvar_s *scr_ffov;
|
||||
extern struct cvar_s *scr_printspeed;
|
||||
extern struct cvar_s *scr_showpause;
|
||||
extern struct cvar_s *scr_showram;
|
||||
extern struct cvar_s *scr_showturtle;
|
||||
|
|
|
@ -46,34 +46,6 @@ typedef enum {
|
|||
|
||||
struct entity_s;
|
||||
|
||||
extern void (*R_RocketTrail) (const struct entity_s *ent);
|
||||
extern void (*R_GrenadeTrail) (const struct entity_s *ent);
|
||||
extern void (*R_BloodTrail) (const struct entity_s *ent);
|
||||
extern void (*R_SlightBloodTrail) (const struct entity_s *ent);
|
||||
extern void (*R_WizTrail) (const struct entity_s *ent);
|
||||
extern void (*R_FlameTrail) (const struct entity_s *ent);
|
||||
extern void (*R_VoorTrail) (const struct entity_s *ent);
|
||||
extern void (*R_GlowTrail) (const struct entity_s *ent, int glow_color);
|
||||
|
||||
extern void (*R_RunParticleEffect) (const vec3_t org, const vec3_t dir,
|
||||
int color, int count);
|
||||
extern void (*R_BloodPuffEffect) (const vec3_t org, int count);
|
||||
extern void (*R_GunshotEffect) (const vec3_t org, int count);
|
||||
extern void (*R_LightningBloodEffect) (const vec3_t org);
|
||||
extern void (*R_SpikeEffect) (const vec3_t org);
|
||||
extern void (*R_KnightSpikeEffect) (const vec3_t org);
|
||||
extern void (*R_SuperSpikeEffect) (const vec3_t org);
|
||||
extern void (*R_WizSpikeEffect) (const vec3_t org);
|
||||
|
||||
extern void (*R_BlobExplosion) (const vec3_t org);
|
||||
extern void (*R_ParticleExplosion) (const vec3_t org);
|
||||
extern void (*R_ParticleExplosion2) (const vec3_t org, int colorStart,
|
||||
int colorLength);
|
||||
extern void (*R_LavaSplash) (const vec3_t org);
|
||||
extern void (*R_TeleportSplash) (const vec3_t org);
|
||||
extern void (*R_DarkFieldParticles) (const struct entity_s *ent);
|
||||
extern void (*R_EntityParticles) (const struct entity_s *ent);
|
||||
|
||||
void R_PushDlights (const vec3_t entorigin);
|
||||
struct cvar_s;
|
||||
void R_MaxDlightsCheck (struct cvar_s *var);
|
||||
|
|
79
include/r_internal.h
Normal file
79
include/r_internal.h
Normal file
|
@ -0,0 +1,79 @@
|
|||
#ifndef __r_internal_h
|
||||
#define __r_internal_h
|
||||
|
||||
#include "QF/vid.h"
|
||||
#include "QF/plugin/vid_render.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_dynamic.h"
|
||||
#include "r_local.h"
|
||||
#include "r_screen.h"
|
||||
#include "r_shared.h"
|
||||
|
||||
extern viddef_t vid; // global video state
|
||||
|
||||
extern vid_render_data_t vr_data;
|
||||
extern vid_render_funcs_t vr_funcs;
|
||||
|
||||
extern refdef_t r_refdef;
|
||||
extern int r_viewsize;
|
||||
|
||||
void R_LineGraph (int x, int y, int *h_vals, int count);
|
||||
|
||||
void Fog_Update (float density, float red, float green, float blue,
|
||||
float time);
|
||||
struct plitem_s;
|
||||
void Fog_ParseWorldspawn (struct plitem_s *worldspawn);
|
||||
|
||||
float *Fog_GetColor (void);
|
||||
float Fog_GetDensity (void);
|
||||
void Fog_SetupFrame (void);
|
||||
void Fog_EnableGFog (void);
|
||||
void Fog_DisableGFog (void);
|
||||
void Fog_StartAdditive (void);
|
||||
void Fog_StopAdditive (void);
|
||||
void Fog_Init (void);
|
||||
|
||||
void R_Init_Cvars (void);
|
||||
void R_InitEfrags (void);
|
||||
void R_ClearState (void);
|
||||
void R_InitSky (struct texture_s *mt); // called at level load
|
||||
void R_Textures_Init (void);
|
||||
void R_RenderView (void); // must set r_refdef first
|
||||
void R_ViewChanged (float aspect); // must set r_refdef first
|
||||
// called whenever r_refdef or vid change
|
||||
|
||||
void R_AddEfrags (entity_t *ent);
|
||||
void R_RemoveEfrags (entity_t *ent);
|
||||
|
||||
void R_NewMap (model_t *worldmodel, model_t **models, int num_models);
|
||||
|
||||
// LordHavoc: relative bmodel lighting
|
||||
void R_PushDlights (const vec3_t entorigin);
|
||||
void R_DrawWaterSurfaces (void);
|
||||
|
||||
void *D_SurfaceCacheAddress (void);
|
||||
int D_SurfaceCacheForRes (int width, int height);
|
||||
void D_FlushCaches (void);
|
||||
void D_DeleteSurfaceCache (void);
|
||||
void D_InitCaches (void *buffer, int size);
|
||||
void R_SetVrect (vrect_t *pvrect, vrect_t *pvrectin, int lineadj);
|
||||
|
||||
void R_LoadSkys (const char *);
|
||||
|
||||
void R_ClearEfrags (void);
|
||||
void R_ClearEnts (void);
|
||||
void R_EnqueueEntity (struct entity_s *ent);
|
||||
entity_t *R_AllocEntity (void);
|
||||
void R_FreeAllEntities (void);
|
||||
|
||||
dlight_t *R_AllocDlight (int key);
|
||||
void R_DecayLights (double frametime);
|
||||
void R_ClearDlights (void);
|
||||
|
||||
int R_InitGraphTextures (int base);
|
||||
|
||||
void R_DrawAliasModel (entity_t *e);
|
||||
|
||||
void R_MarkLeaves (void);
|
||||
|
||||
#endif//__r_internal_h
|
|
@ -42,20 +42,6 @@
|
|||
#define BMODEL_FULLY_CLIPPED 0x10 // value returned by R_BmodelCheckBBox ()
|
||||
// if bbox is trivially rejected
|
||||
|
||||
// color shifts =============================================================
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int destcolor[3];
|
||||
int percent; // 0-255
|
||||
} cshift_t;
|
||||
|
||||
#define CSHIFT_CONTENTS 0
|
||||
#define CSHIFT_DAMAGE 1
|
||||
#define CSHIFT_BONUS 2
|
||||
#define CSHIFT_POWERUP 3
|
||||
#define NUM_CSHIFTS 4
|
||||
|
||||
// viewmodel lighting =======================================================
|
||||
|
||||
typedef struct {
|
||||
|
@ -131,7 +117,6 @@ void R_RenderWorld (void);
|
|||
extern plane_t screenedge[4];
|
||||
|
||||
extern vec3_t r_origin;
|
||||
|
||||
extern vec3_t r_entorigin;
|
||||
|
||||
extern int r_visframecount;
|
||||
|
@ -146,12 +131,6 @@ void R_DrawPolyList (void);
|
|||
|
||||
// Surface cache related ==========
|
||||
extern qboolean r_cache_thrash; // set if thrashing the surface cache
|
||||
extern qboolean r_inhibit_viewmodel;
|
||||
extern qboolean r_force_fullscreen;
|
||||
extern qboolean r_paused;
|
||||
extern entity_t *r_view_model;
|
||||
extern entity_t *r_player_entity;
|
||||
extern qboolean r_active;
|
||||
|
||||
// current entity info
|
||||
extern qboolean insubmodel;
|
||||
|
@ -266,8 +245,6 @@ void R_ReadPointFile_f (void);
|
|||
void R_InitSprites (void);
|
||||
void R_SurfacePatch (void);
|
||||
|
||||
extern float r_gravity;
|
||||
|
||||
// renderer stuff again ===================================
|
||||
|
||||
extern int r_amodels_drawn;
|
||||
|
|
|
@ -32,8 +32,19 @@
|
|||
#ifndef __r_screen_h
|
||||
#define __r_screen_h
|
||||
|
||||
#include "QF/screen.h"
|
||||
#include "QF/vid.h"
|
||||
|
||||
void SCR_UpdateScreen (double realtime, SCR_Func scr_3dfunc,
|
||||
SCR_Func *scr_funcs);
|
||||
void SCR_DrawRam (void);
|
||||
void SCR_DrawFPS (void);
|
||||
void SCR_DrawTime (void);
|
||||
void SCR_DrawTurtle (void);
|
||||
void SCR_DrawPause (void);
|
||||
struct tex_s *SCR_CaptureBGR (void);
|
||||
|
||||
|
||||
extern int scr_copytop;
|
||||
extern int scr_copyeverything;
|
||||
|
||||
|
|
|
@ -143,9 +143,6 @@ extern void R_MakeSky (void);
|
|||
extern int gl_solidskytexture;
|
||||
extern int gl_alphaskytexture;
|
||||
|
||||
extern double r_realtime;
|
||||
extern double r_frametime;
|
||||
|
||||
// flags in finalvert_t.flags
|
||||
#define ALIAS_LEFT_CLIP 0x0001
|
||||
#define ALIAS_TOP_CLIP 0x0002
|
||||
|
|
|
@ -65,6 +65,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "QF/plugin/general.h"
|
||||
#include "QF/plugin/console.h"
|
||||
#include "QF/plugin/vid_render.h"
|
||||
|
||||
#include "compat.h"
|
||||
|
||||
|
@ -178,7 +179,7 @@ Resize (old_console_t *con)
|
|||
char tbuf[CON_TEXTSIZE];
|
||||
int width, oldwidth, oldtotallines, numlines, numchars, i, j;
|
||||
|
||||
width = (vid.conwidth >> 3) - 2;
|
||||
width = (r_data->vid->conwidth >> 3) - 2;
|
||||
|
||||
if (width < 1) { // video hasn't been initialized yet
|
||||
width = 38;
|
||||
|
@ -232,7 +233,7 @@ C_CheckResize (void)
|
|||
Resize (&con_main);
|
||||
Resize (&con_chat);
|
||||
|
||||
view_resize (con_data.view, vid.conwidth, vid.conheight);
|
||||
view_resize (con_data.view, r_data->vid->conwidth, r_data->vid->conheight);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -665,7 +666,7 @@ draw_console (view_t *view)
|
|||
if (con_data.force_commandline) {
|
||||
alpha = 255;
|
||||
} else {
|
||||
float y = vid.conheight * con_size->value;
|
||||
float y = r_data->vid->conheight * con_size->value;
|
||||
alpha = 255 * con_alpha->value * view->ylen / y;
|
||||
alpha = min (alpha, 255);
|
||||
}
|
||||
|
@ -680,7 +681,7 @@ static void
|
|||
draw_say (view_t *view)
|
||||
{
|
||||
clearnotify = 0;
|
||||
scr_copytop = 1;
|
||||
r_data->scr_copytop = 1;
|
||||
|
||||
if (chat_team) {
|
||||
Draw_String (view->xabs + 8, view->yabs, "say_team:");
|
||||
|
@ -715,7 +716,7 @@ draw_notify (view_t *view)
|
|||
text = con->text + (i % con_totallines) * con_linewidth;
|
||||
|
||||
clearnotify = 0;
|
||||
scr_copytop = 1;
|
||||
r_data->scr_copytop = 1;
|
||||
|
||||
Draw_nString (x, y, text, con_linewidth);
|
||||
y += 8;
|
||||
|
@ -728,9 +729,9 @@ setup_console (void)
|
|||
float lines;
|
||||
|
||||
if (con_data.force_commandline) {
|
||||
lines = con_data.lines = vid.conheight;
|
||||
lines = con_data.lines = r_data->vid->conheight;
|
||||
} else if (key_dest == key_console) {
|
||||
lines = vid.conheight * bound (0.2, con_size->value, 1);
|
||||
lines = r_data->vid->conheight * bound (0.2, con_size->value, 1);
|
||||
} else {
|
||||
lines = 0;
|
||||
}
|
||||
|
@ -742,8 +743,8 @@ setup_console (void)
|
|||
con_data.lines += max (0.2, con_speed->value) * *con_data.frametime;
|
||||
con_data.lines = min (con_data.lines, lines);
|
||||
}
|
||||
if (con_data.lines >= vid.conheight - r_lineadj)
|
||||
scr_copyeverything = 1;
|
||||
if (con_data.lines >= r_data->vid->conheight - r_data->lineadj)
|
||||
r_data->scr_copyeverything = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -53,7 +53,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
#include "QF/GL/funcs.h"
|
||||
#include "QF/GL/qf_textures.h"
|
||||
|
||||
#include "r_cvar.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
typedef struct {
|
||||
tex_t *tex;
|
||||
|
|
|
@ -50,6 +50,8 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
#include "QF/GLSL/defines.h"
|
||||
#include "QF/GLSL/funcs.h"
|
||||
|
||||
#include "r_internal.h"
|
||||
|
||||
static GLuint cmap_tex[MAX_TRANSLATIONS];
|
||||
static GLuint skin_tex[MAX_TRANSLATIONS];
|
||||
|
||||
|
|
|
@ -51,11 +51,6 @@ Mod_LoadSpriteModel (model_t *mod, void *buf)
|
|||
{
|
||||
}
|
||||
|
||||
void
|
||||
R_InitSky (struct texture_s *mt)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Mod_ProcessTexture (texture_t *tx)
|
||||
{
|
||||
|
|
|
@ -51,7 +51,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
#include "QF/sys.h"
|
||||
#include "QF/va.h"
|
||||
|
||||
#include "QF/GLSL/funcs.h"
|
||||
#include "QF/plugin/vid_render.h"
|
||||
|
||||
typedef struct skinbank_s {
|
||||
char *name;
|
||||
|
@ -88,7 +88,7 @@ Skin_SetTranslation (int cmap, int top, int bottom)
|
|||
}
|
||||
|
||||
dest = translations[cmap - 1];
|
||||
source = vid.colormap8;
|
||||
source = r_data->vid->colormap8;
|
||||
memcpy (dest, source, VID_GRADES * 256);
|
||||
|
||||
for (i = 0; i < VID_GRADES; i++, dest += 256, source += 256) {
|
||||
|
@ -183,7 +183,7 @@ Skin_SetSkin (skin_t *skin, int cmap, const char *skinname)
|
|||
name = 0;
|
||||
break;
|
||||
}
|
||||
tex = LoadPCX (file, 0, vid.palette);
|
||||
tex = LoadPCX (file, 0, r_data->vid->palette);
|
||||
Qclose (file);
|
||||
if (!tex || tex->width > 320 || tex->height > 200) {
|
||||
Sys_Printf ("Bad skin %s\n", name);
|
||||
|
@ -196,7 +196,7 @@ Skin_SetSkin (skin_t *skin, int cmap, const char *skinname)
|
|||
out->width = PLAYER_WIDTH;
|
||||
out->height = PLAYER_HEIGHT;
|
||||
out->format = tex_palette;
|
||||
out->palette = vid.palette;
|
||||
out->palette = r_data->vid->palette;
|
||||
memset (out->data, 0, PLAYER_WIDTH * PLAYER_HEIGHT);
|
||||
opix = out->data;
|
||||
ipix = tex->data;
|
||||
|
|
|
@ -1,39 +1,48 @@
|
|||
AUTOMAKE_OPTIONS= foreign
|
||||
|
||||
SUBDIRS= @QFrenderer_dirs@
|
||||
SUBDIRS= @vid_render_dirs@
|
||||
DIST_SUBDIRS= gl glsl sw sw32
|
||||
INCLUDES= -I$(top_srcdir)/include
|
||||
|
||||
#lib_ldflags=-version-info $(QUAKE_LIBRARY_VERSION_INFO) \
|
||||
# -rpath $(libdir) -no-undefined
|
||||
lib_ldflags=-version-info $(QUAKE_LIBRARY_VERSION_INFO) \
|
||||
-rpath $(libdir) -no-undefined
|
||||
plugin_ldflags= @plugin_ldflags@ -avoid-version -module -rpath $(plugindir)
|
||||
plugin_libadd= @plugin_libadd@
|
||||
EXEEXT=
|
||||
|
||||
#lib_LTLIBRARIES= @VID_REND_TARGETS@
|
||||
noinst_LTLIBRARIES= @QFrenderer_libs@
|
||||
plugin_LTLIBRARIES= @vid_render_plugins@
|
||||
noinst_LTLIBRARIES= libQFrenderer.la @vid_render_static_plugins@
|
||||
|
||||
EXTRA_LTLIBRARIES= libQFrenderer_sw.la libQFrenderer_sw32.la \
|
||||
libQFrenderer_gl.la libQFrenderer_glsl.la
|
||||
EXTRA_LTLIBRARIES= \
|
||||
vid_render_sw.la vid_render_sw32.la \
|
||||
vid_render_gl.la vid_render_glsl.la
|
||||
|
||||
common_sources= \
|
||||
crosshair.c noisetextures.c r_alias.c r_bsp.c r_cvar.c r_dyn_textures.c \
|
||||
r_efrag.c r_ent.c r_graph.c r_light.c r_main.c r_part.c r_progs.c \
|
||||
r_screen.c
|
||||
r_efrag.c r_ent.c r_graph.c r_light.c r_main.c r_part.c r_screen.c
|
||||
|
||||
libQFrenderer_gl_la_LDFLAGS= $(lib_ldflags)
|
||||
libQFrenderer_gl_la_LIBADD= gl/libgl.la
|
||||
libQFrenderer_gl_la_DEPENDENCIES= gl/libgl.la
|
||||
libQFrenderer_gl_la_SOURCES= $(common_sources)
|
||||
libQFrenderer_la_LDFLAGS= $(lib_ldflags)
|
||||
libQFrenderer_la_LIBADD=
|
||||
libQFrenderer_la_DEPENDENCIES=
|
||||
libQFrenderer_la_SOURCES= r_init.c r_progs.c
|
||||
|
||||
libQFrenderer_glsl_la_LDFLAGS= $(lib_ldflags)
|
||||
libQFrenderer_glsl_la_LIBADD= glsl/libglsl.la
|
||||
libQFrenderer_glsl_la_DEPENDENCIES= glsl/libglsl.la
|
||||
libQFrenderer_glsl_la_SOURCES= $(common_sources)
|
||||
vid_render_gl_la_LDFLAGS= $(plugin_ldflags)
|
||||
vid_render_gl_la_LIBADD= gl/libgl.la
|
||||
vid_render_gl_la_DEPENDENCIES= gl/libgl.la
|
||||
vid_render_gl_la_SOURCES= $(common_sources) #vid_render_gl.c
|
||||
|
||||
libQFrenderer_sw_la_LDFLAGS= @STATIC@
|
||||
libQFrenderer_sw_la_LIBADD= sw/libsw.la
|
||||
libQFrenderer_sw_la_DEPENDENCIES= sw/libsw.la
|
||||
libQFrenderer_sw_la_SOURCES= $(common_sources)
|
||||
vid_render_glsl_la_LDFLAGS= $(plugin_ldflags)
|
||||
vid_render_glsl_la_LIBADD= glsl/libglsl.la
|
||||
vid_render_glsl_la_DEPENDENCIES=glsl/libglsl.la
|
||||
vid_render_glsl_la_SOURCES= $(common_sources) #vid_render_glsl.c
|
||||
|
||||
libQFrenderer_sw32_la_LDFLAGS= $(lib_ldflags)
|
||||
libQFrenderer_sw32_la_LIBADD= sw32/libsw32.la
|
||||
libQFrenderer_sw32_la_DEPENDENCIES= sw32/libsw32.la
|
||||
libQFrenderer_sw32_la_SOURCES= $(common_sources)
|
||||
vid_render_sw_la_LDFLAGS= $(plugin_ldflags)
|
||||
vid_render_sw_la_LIBADD= sw/libsw.la
|
||||
vid_render_sw_la_DEPENDENCIES= sw/libsw.la
|
||||
vid_render_sw_la_SOURCES= $(common_sources) #vid_render_sw.c
|
||||
|
||||
vid_render_sw32_la_LDFLAGS= $(plugin_ldflags)
|
||||
vid_render_sw32_la_LIBADD= sw32/libsw32.la
|
||||
vid_render_sw32_la_DEPENDENCIES=sw32/libsw32.la
|
||||
vid_render_sw32_la_SOURCES= $(common_sources) #vid_render_sw32.c
|
||||
|
|
|
@ -35,7 +35,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
#include "QF/qtypes.h"
|
||||
#include "QF/wadfile.h"
|
||||
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
// NOTE: this array is INCORRECT for direct uploading in GL
|
||||
// but is optimal for SW
|
||||
|
|
|
@ -60,9 +60,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
|
||||
#include "compat.h"
|
||||
#include "gl_draw.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_local.h"
|
||||
#include "r_shared.h"
|
||||
#include "r_internal.h"
|
||||
#include "sbar.h"
|
||||
#include "varrays.h"
|
||||
|
||||
|
|
|
@ -47,10 +47,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/GL/funcs.h"
|
||||
#include "QF/GL/qf_rlight.h"
|
||||
|
||||
#include "r_cvar.h"
|
||||
#include "r_dynamic.h"
|
||||
#include "r_local.h"
|
||||
#include "r_shared.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
float gl_bubble_sintable[33], gl_bubble_costable[33];
|
||||
|
||||
|
@ -129,7 +126,7 @@ R_RenderDlights (void)
|
|||
|
||||
l = r_dlights;
|
||||
for (i = 0; i < r_maxdlights; i++, l++) {
|
||||
if (l->die < r_realtime || !l->radius)
|
||||
if (l->die < vr_data.realtime || !l->radius)
|
||||
continue;
|
||||
R_RenderDlight (l);
|
||||
}
|
||||
|
|
|
@ -54,10 +54,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/GL/qf_vid.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_dynamic.h"
|
||||
#include "r_local.h"
|
||||
#include "r_shared.h"
|
||||
#include "r_internal.h"
|
||||
#include "varrays.h"
|
||||
|
||||
static int ramp1[8] = { 0x6f, 0x6d, 0x6b, 0x69, 0x67, 0x65, 0x63, 0x61 };
|
||||
|
@ -248,7 +245,7 @@ R_ParticleExplosion_QF (const vec3_t org)
|
|||
if (numparticles >= r_maxparticles)
|
||||
return;
|
||||
particle_new_random (pt_smokecloud, part_tex_smoke, org, 4, 30, 8,
|
||||
r_realtime + 5.0, (rand () & 7) + 8,
|
||||
vr_data.realtime + 5.0, (rand () & 7) + 8,
|
||||
0.5 + qfrandom (0.25), 0.0);
|
||||
}
|
||||
|
||||
|
@ -264,7 +261,7 @@ R_ParticleExplosion2_QF (const vec3_t org, int colorStart, int colorLength)
|
|||
|
||||
for (i = 0; i < j; i++) {
|
||||
particle_new_random (pt_blob, part_tex_dot, org, 16, 2, 256,
|
||||
r_realtime + 0.3,
|
||||
vr_data.realtime + 0.3,
|
||||
colorStart + (i % colorLength), 1.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -282,12 +279,12 @@ R_BlobExplosion_QF (const vec3_t org)
|
|||
|
||||
for (i = 0; i < j >> 1; i++) {
|
||||
particle_new_random (pt_blob, part_tex_dot, org, 12, 2, 256,
|
||||
r_realtime + 1.0 + (rand () & 7) * 0.05,
|
||||
vr_data.realtime + 1.0 + (rand () & 7) * 0.05,
|
||||
66 + i % 6, 1.0, 0.0);
|
||||
}
|
||||
for (i = 0; i < j / 2; i++) {
|
||||
particle_new_random (pt_blob2, part_tex_dot, org, 12, 2, 256,
|
||||
r_realtime + 1.0 + (rand () & 7) * 0.05,
|
||||
vr_data.realtime + 1.0 + (rand () & 7) * 0.05,
|
||||
150 + i % 6, 1.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -298,7 +295,7 @@ R_RunSparkEffect_QF (const vec3_t org, int count, int ofuzz)
|
|||
if (numparticles >= r_maxparticles)
|
||||
return;
|
||||
particle_new (pt_smokecloud, part_tex_smoke, org, ofuzz * 0.08,
|
||||
vec3_origin, r_realtime + 9, 12 + (rand () & 3),
|
||||
vec3_origin, vr_data.realtime + 9, 12 + (rand () & 3),
|
||||
0.25 + qfrandom (0.125), 0.0);
|
||||
|
||||
if (numparticles + count >= r_maxparticles)
|
||||
|
@ -312,8 +309,8 @@ R_RunSparkEffect_QF (const vec3_t org, int count, int ofuzz)
|
|||
int color = rand () & 7;
|
||||
|
||||
particle_new_random (pt_fallfadespark, part_tex_dot, org, orgfuzz,
|
||||
0.7, 96, r_realtime + 5.0, ramp1[color], 1.0,
|
||||
color);
|
||||
0.7, 96, vr_data.realtime + 5.0, ramp1[color],
|
||||
1.0, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -325,7 +322,7 @@ R_BloodPuff_QF (const vec3_t org, int count)
|
|||
return;
|
||||
|
||||
particle_new (pt_bloodcloud, part_tex_smoke, org, count / 5, vec3_origin,
|
||||
r_realtime + 99.0, 70 + (rand () & 3), 0.5, 0.0);
|
||||
vr_data.realtime + 99.0, 70 + (rand () & 3), 0.5, 0.0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -353,14 +350,15 @@ R_LightningBloodEffect_QF (const vec3_t org)
|
|||
if (numparticles >= r_maxparticles)
|
||||
return;
|
||||
particle_new (pt_smokecloud, part_tex_smoke, org, 3.0, vec3_origin,
|
||||
r_realtime + 9.0, 12 + (rand () & 3),
|
||||
vr_data.realtime + 9.0, 12 + (rand () & 3),
|
||||
0.25 + qfrandom (0.125), 0.0);
|
||||
|
||||
if (numparticles + count >= r_maxparticles)
|
||||
count = r_maxparticles - numparticles;
|
||||
while (count--)
|
||||
particle_new_random (pt_fallfade, part_tex_spark, org, 12, 2.0, 128,
|
||||
r_realtime + 5.0, 244 + (count % 3), 1.0, 0.0);
|
||||
vr_data.realtime + 5.0, 244 + (count % 3), 1.0,
|
||||
0.0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -387,7 +385,7 @@ R_RunParticleEffect_QF (const vec3_t org, const vec3_t dir, int color,
|
|||
porg[2] = org[2] + scale * (((rnd >> 11) & 15) - 7.5);
|
||||
// Note that ParseParticleEffect handles (dir * 15)
|
||||
particle_new (pt_grav, part_tex_dot, porg, 1.5, dir,
|
||||
r_realtime + 0.1 * (i % 5),
|
||||
vr_data.realtime + 0.1 * (i % 5),
|
||||
(color & ~7) + (rnd & 7), 1.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -412,13 +410,13 @@ R_KnightSpikeEffect_QF (const vec3_t org)
|
|||
if (numparticles >= r_maxparticles)
|
||||
return;
|
||||
particle_new (pt_smokecloud, part_tex_smoke, org, 1.0, vec3_origin,
|
||||
r_realtime + 9.0, 234, 0.25 + qfrandom (0.125), 0.0);
|
||||
vr_data.realtime + 9.0, 234, 0.25 + qfrandom (0.125), 0.0);
|
||||
|
||||
if (numparticles + count >= r_maxparticles)
|
||||
count = r_maxparticles - numparticles;
|
||||
while (count--)
|
||||
particle_new_random (pt_fallfade, part_tex_dot, org, 6, 0.7, 96,
|
||||
r_realtime + 5.0, 234, 1.0, 0.0);
|
||||
vr_data.realtime + 5.0, 234, 1.0, 0.0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -429,13 +427,13 @@ R_WizSpikeEffect_QF (const vec3_t org)
|
|||
if (numparticles >= r_maxparticles)
|
||||
return;
|
||||
particle_new (pt_smokecloud, part_tex_smoke, org, 2.0, vec3_origin,
|
||||
r_realtime + 9.0, 63, 0.25 + qfrandom (0.125), 0.0);
|
||||
vr_data.realtime + 9.0, 63, 0.25 + qfrandom (0.125), 0.0);
|
||||
|
||||
if (numparticles + count >= r_maxparticles)
|
||||
count = r_maxparticles - numparticles;
|
||||
while (count--)
|
||||
particle_new_random (pt_fallfade, part_tex_dot, org, 12, 0.7, 96,
|
||||
r_realtime + 5.0, 63, 1.0, 0.0);
|
||||
vr_data.realtime + 5.0, 63, 1.0, 0.0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -468,7 +466,7 @@ R_LavaSplash_QF (const vec3_t org)
|
|||
vel = 50.0 + 0.5 * (float) (rnd & 127);
|
||||
VectorScale (dir, vel, pvel);
|
||||
particle_new (pt_grav, part_tex_dot, porg, 3, pvel,
|
||||
r_realtime + 2.0 + ((rnd >> 7) & 31) * 0.02,
|
||||
vr_data.realtime + 2.0 + ((rnd >> 7) & 31) * 0.02,
|
||||
224 + ((rnd >> 12) & 7), 0.75, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -506,7 +504,7 @@ R_TeleportSplash_QF (const vec3_t org)
|
|||
vel = 50 + ((rnd >> 6) & 63);
|
||||
VectorScale (pdir, vel, pvel);
|
||||
particle_new (pt_grav, part_tex_spark, porg, 0.6, pvel,
|
||||
(r_realtime + 0.2 + (rand () & 15) * 0.01),
|
||||
(vr_data.realtime + 0.2 + (rand () & 15) * 0.01),
|
||||
(7 + ((rnd >> 12) & 7)), 1.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -526,7 +524,7 @@ R_RocketTrail_QF (const entity_t *ent)
|
|||
VectorCopy (ent->old_origin, old_origin);
|
||||
VectorSubtract (ent->origin, old_origin, vec);
|
||||
maxlen = VectorNormalize (vec);
|
||||
origlen = r_frametime / maxlen;
|
||||
origlen = vr_data.frametime / maxlen;
|
||||
pscale = 1.5 + qfrandom (1.5);
|
||||
|
||||
while (len < maxlen) {
|
||||
|
@ -536,7 +534,7 @@ R_RocketTrail_QF (const entity_t *ent)
|
|||
|
||||
particle_new (pt_smoke, part_tex_smoke, old_origin,
|
||||
pscale + percent * 4.0, vec3_origin,
|
||||
r_realtime + 2.0 - percent * 2.0,
|
||||
vr_data.realtime + 2.0 - percent * 2.0,
|
||||
12 + (rand () & 3),
|
||||
0.5 + qfrandom (0.125) - percent * 0.40, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
|
@ -560,7 +558,7 @@ R_GrenadeTrail_QF (const entity_t *ent)
|
|||
VectorCopy (ent->old_origin, old_origin);
|
||||
VectorSubtract (ent->origin, old_origin, vec);
|
||||
maxlen = VectorNormalize (vec);
|
||||
origlen = r_frametime / maxlen;
|
||||
origlen = vr_data.frametime / maxlen;
|
||||
pscale = 6.0 + qfrandom (7.0);
|
||||
|
||||
while (len < maxlen) {
|
||||
|
@ -570,7 +568,7 @@ R_GrenadeTrail_QF (const entity_t *ent)
|
|||
|
||||
particle_new (pt_smoke, part_tex_smoke, old_origin,
|
||||
pscale + percent * 4.0, vec3_origin,
|
||||
r_realtime + 2.0 - percent * 2.0,
|
||||
vr_data.realtime + 2.0 - percent * 2.0,
|
||||
1 + (rand () & 3),
|
||||
0.625 + qfrandom (0.125) - percent * 0.40, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
|
@ -595,7 +593,7 @@ R_BloodTrail_QF (const entity_t *ent)
|
|||
VectorCopy (ent->old_origin, old_origin);
|
||||
VectorSubtract (ent->origin, old_origin, vec);
|
||||
maxlen = VectorNormalize (vec);
|
||||
origlen = r_frametime / maxlen;
|
||||
origlen = vr_data.frametime / maxlen;
|
||||
pscale = 5.0 + qfrandom (10.0);
|
||||
|
||||
while (len < maxlen) {
|
||||
|
@ -611,8 +609,8 @@ R_BloodTrail_QF (const entity_t *ent)
|
|||
pvel[2] -= percent * 40.0;
|
||||
|
||||
particle_new (pt_grav, part_tex_smoke, porg, pscale, pvel,
|
||||
r_realtime + 2.0 - percent * 2.0, 68 + (rand () & 3),
|
||||
1.0, 0.0);
|
||||
vr_data.realtime + 2.0 - percent * 2.0,
|
||||
68 + (rand () & 3), 1.0, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -635,7 +633,7 @@ R_SlightBloodTrail_QF (const entity_t *ent)
|
|||
VectorCopy (ent->old_origin, old_origin);
|
||||
VectorSubtract (ent->origin, old_origin, vec);
|
||||
maxlen = VectorNormalize (vec);
|
||||
origlen = r_frametime / maxlen;
|
||||
origlen = vr_data.frametime / maxlen;
|
||||
pscale = 1.5 + qfrandom (7.5);
|
||||
|
||||
while (len < maxlen) {
|
||||
|
@ -651,8 +649,8 @@ R_SlightBloodTrail_QF (const entity_t *ent)
|
|||
pvel[2] -= percent * 40;
|
||||
|
||||
particle_new (pt_grav, part_tex_smoke, porg, pscale, pvel,
|
||||
r_realtime + 1.5 - percent * 1.5, 68 + (rand () & 3),
|
||||
0.75, 0.0);
|
||||
vr_data.realtime + 1.5 - percent * 1.5,
|
||||
68 + (rand () & 3), 0.75, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -675,7 +673,7 @@ R_WizTrail_QF (const entity_t *ent)
|
|||
VectorCopy (ent->old_origin, old_origin);
|
||||
VectorSubtract (ent->origin, old_origin, vec);
|
||||
maxlen = VectorNormalize (vec);
|
||||
origlen = r_frametime / maxlen;
|
||||
origlen = vr_data.frametime / maxlen;
|
||||
VectorScale (vec, maxlen - dist, subtract);
|
||||
|
||||
while (len < maxlen) {
|
||||
|
@ -693,8 +691,8 @@ R_WizTrail_QF (const entity_t *ent)
|
|||
|
||||
particle_new (pt_flame, part_tex_smoke, old_origin,
|
||||
2.0 + qfrandom (1.0) - percent * 2.0, pvel,
|
||||
r_realtime + 0.5 - percent * 0.5, 52 + (rand () & 4),
|
||||
1.0 - percent * 0.125, 0.0);
|
||||
vr_data.realtime + 0.5 - percent * 0.5,
|
||||
52 + (rand () & 4), 1.0 - percent * 0.125, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -716,7 +714,7 @@ R_FlameTrail_QF (const entity_t *ent)
|
|||
VectorCopy (ent->old_origin, old_origin);
|
||||
VectorSubtract (ent->origin, old_origin, vec);
|
||||
maxlen = VectorNormalize (vec);
|
||||
origlen = r_frametime / maxlen;
|
||||
origlen = vr_data.frametime / maxlen;
|
||||
VectorScale (vec, maxlen - dist, subtract);
|
||||
|
||||
while (len < maxlen) {
|
||||
|
@ -734,7 +732,7 @@ R_FlameTrail_QF (const entity_t *ent)
|
|||
|
||||
particle_new (pt_flame, part_tex_smoke, old_origin,
|
||||
2.0 + qfrandom (1.0) - percent * 2.0, pvel,
|
||||
r_realtime + 0.5 - percent * 0.5, 234,
|
||||
vr_data.realtime + 0.5 - percent * 0.5, 234,
|
||||
1.0 - percent * 0.125, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
|
@ -757,7 +755,7 @@ R_VoorTrail_QF (const entity_t *ent)
|
|||
VectorCopy (ent->old_origin, old_origin);
|
||||
VectorSubtract (ent->origin, old_origin, vec);
|
||||
maxlen = VectorNormalize (vec);
|
||||
origlen = r_frametime / maxlen;
|
||||
origlen = vr_data.frametime / maxlen;
|
||||
VectorScale (vec, maxlen - dist, subtract);
|
||||
|
||||
while (len < maxlen) {
|
||||
|
@ -767,7 +765,7 @@ R_VoorTrail_QF (const entity_t *ent)
|
|||
porg[j] = old_origin[j] + qfrandom (16.0) - 8.0;
|
||||
|
||||
particle_new (pt_static, part_tex_dot, porg, 1.0 + qfrandom (1.0),
|
||||
vec3_origin, r_realtime + 0.3 - percent * 0.3,
|
||||
vec3_origin, vr_data.realtime + 0.3 - percent * 0.3,
|
||||
9 * 16 + 8 + (rand () & 3), 1.0, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
|
@ -790,7 +788,7 @@ R_GlowTrail_QF (const entity_t *ent, int glow_color)
|
|||
VectorCopy (ent->old_origin, old_origin);
|
||||
VectorSubtract (ent->origin, old_origin, vec);
|
||||
maxlen = VectorNormalize (vec);
|
||||
origlen = r_frametime / maxlen;
|
||||
origlen = vr_data.frametime / maxlen;
|
||||
VectorScale (vec, (maxlen - dist), subtract);
|
||||
|
||||
while (len < maxlen) {
|
||||
|
@ -802,7 +800,8 @@ R_GlowTrail_QF (const entity_t *ent, int glow_color)
|
|||
org[2] = old_origin[2] + ((rnd >> 6) & 7) * (5.0/7.0) - 2.5;
|
||||
|
||||
particle_new (pt_smoke, part_tex_dot, org, 1.0, vec3_origin,
|
||||
r_realtime + 2.0 - percent * 0.2, glow_color, 1.0, 0.0);
|
||||
vr_data.realtime + 2.0 - percent * 0.2,
|
||||
glow_color, 1.0, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -819,7 +818,7 @@ R_ParticleExplosion_EE (const vec3_t org)
|
|||
if (numparticles >= r_maxparticles)
|
||||
return;
|
||||
particle_new_random (pt_smokecloud, part_tex_smoke, org, 4, 30, 8,
|
||||
r_realtime + 5.0, rand () & 255,
|
||||
vr_data.realtime + 5.0, rand () & 255,
|
||||
0.5 + qfrandom (0.25), 0.0);
|
||||
}
|
||||
|
||||
|
@ -853,7 +852,7 @@ R_TeleportSplash_EE (const vec3_t org)
|
|||
vel = 50 + ((rnd >> 6) & 63);
|
||||
VectorScale (dir, vel, pvel);
|
||||
particle_new (pt_grav, part_tex_spark, porg, 0.6, pvel,
|
||||
(r_realtime + 0.2 + (rand () & 15) * 0.01),
|
||||
(vr_data.realtime + 0.2 + (rand () & 15) * 0.01),
|
||||
qfrandom (1.0), 1.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -873,7 +872,7 @@ R_RocketTrail_EE (const entity_t *ent)
|
|||
VectorCopy (ent->old_origin, old_origin);
|
||||
VectorSubtract (ent->origin, old_origin, vec);
|
||||
maxlen = VectorNormalize (vec);
|
||||
origlen = r_frametime / maxlen;
|
||||
origlen = vr_data.frametime / maxlen;
|
||||
pscale = 1.5 + qfrandom (1.5);
|
||||
|
||||
while (len < maxlen) {
|
||||
|
@ -883,7 +882,7 @@ R_RocketTrail_EE (const entity_t *ent)
|
|||
|
||||
particle_new (pt_smoke, part_tex_smoke, old_origin,
|
||||
pscale + percent * 4.0, vec3_origin,
|
||||
r_realtime + 2.0 - percent * 2.0,
|
||||
vr_data.realtime + 2.0 - percent * 2.0,
|
||||
rand () & 255,
|
||||
0.5 + qfrandom (0.125) - percent * 0.40, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
|
@ -908,7 +907,7 @@ R_GrenadeTrail_EE (const entity_t *ent)
|
|||
VectorCopy (ent->old_origin, old_origin);
|
||||
VectorSubtract (ent->origin, ent->old_origin, vec);
|
||||
maxlen = VectorNormalize (vec);
|
||||
origlen = r_frametime / maxlen;
|
||||
origlen = vr_data.frametime / maxlen;
|
||||
pscale = 6.0 + qfrandom (7.0);
|
||||
|
||||
while (len < maxlen) {
|
||||
|
@ -918,7 +917,7 @@ R_GrenadeTrail_EE (const entity_t *ent)
|
|||
|
||||
particle_new (pt_smoke, part_tex_smoke, old_origin,
|
||||
pscale + percent * 4.0, vec3_origin,
|
||||
r_realtime + 2.0 - percent * 2.0,
|
||||
vr_data.realtime + 2.0 - percent * 2.0,
|
||||
rand () & 255,
|
||||
0.625 + qfrandom (0.125) - percent * 0.40, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
|
@ -943,11 +942,11 @@ R_ParticleExplosion_ID (const vec3_t org)
|
|||
|
||||
for (i = 0; i < j >> 1; i++) {
|
||||
particle_new_random (pt_explode, part_tex_dot, org, 16, 1.0, 256,
|
||||
r_realtime + 5.0, ramp1[0], 1.0, i & 3);
|
||||
vr_data.realtime + 5.0, ramp1[0], 1.0, i & 3);
|
||||
}
|
||||
for (i = 0; i < j / 2; i++) {
|
||||
particle_new_random (pt_explode2, part_tex_dot, org, 16, 1.0, 256,
|
||||
r_realtime + 5.0, ramp1[0], 1.0, i & 3);
|
||||
vr_data.realtime + 5.0, ramp1[0], 1.0, i & 3);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -964,12 +963,12 @@ R_BlobExplosion_ID (const vec3_t org)
|
|||
|
||||
for (i = 0; i < j >> 1; i++) {
|
||||
particle_new_random (pt_blob, part_tex_dot, org, 12, 1.0, 256,
|
||||
r_realtime + 1.0 + (rand () & 8) * 0.05,
|
||||
vr_data.realtime + 1.0 + (rand () & 8) * 0.05,
|
||||
66 + i % 6, 1.0, 0.0);
|
||||
}
|
||||
for (i = 0; i < j / 2; i++) {
|
||||
particle_new_random (pt_blob2, part_tex_dot, org, 12, 1.0, 256,
|
||||
r_realtime + 1.0 + (rand () & 8) * 0.05,
|
||||
vr_data.realtime + 1.0 + (rand () & 8) * 0.05,
|
||||
150 + i % 6, 1.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -1004,7 +1003,7 @@ R_RunParticleEffect_ID (const vec3_t org, const vec3_t dir, int color,
|
|||
|
||||
// Note that ParseParticleEffect handles (dir * 15)
|
||||
particle_new (pt_grav, part_tex_dot, porg, 1.0, dir,
|
||||
r_realtime + 0.1 * (i % 5),
|
||||
vr_data.realtime + 0.1 * (i % 5),
|
||||
(color & ~7) + (rnd & 7), 1.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -1081,7 +1080,7 @@ R_LavaSplash_ID (const vec3_t org)
|
|||
vel = 50 + (rnd & 63);
|
||||
VectorScale (dir, vel, pvel);
|
||||
particle_new (pt_grav, part_tex_dot, porg, 1.0, pvel,
|
||||
r_realtime + 2 + ((rnd >> 7) & 31) * 0.02,
|
||||
vr_data.realtime + 2 + ((rnd >> 7) & 31) * 0.02,
|
||||
224 + ((rnd >> 12) & 7), 1.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -1119,7 +1118,7 @@ R_TeleportSplash_ID (const vec3_t org)
|
|||
vel = 50 + ((rnd >> 6) & 63);
|
||||
VectorScale (pdir, vel, pvel);
|
||||
particle_new (pt_grav, part_tex_dot, porg, 1.0, pvel,
|
||||
(r_realtime + 0.2 + (rand () & 7) * 0.02),
|
||||
(vr_data.realtime + 0.2 + (rand () & 7) * 0.02),
|
||||
(7 + ((rnd >> 12) & 7)), 1.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -1158,7 +1157,7 @@ R_DarkFieldParticles_ID (const entity_t *ent)
|
|||
vel = 50 + ((rnd >> 9) & 63);
|
||||
VectorScale (dir, vel, pvel);
|
||||
particle_new (pt_slowgrav, part_tex_dot, porg, 1.5, pvel,
|
||||
(r_realtime + 0.2 + (rnd & 7) * 0.02),
|
||||
(vr_data.realtime + 0.2 + (rnd & 7) * 0.02),
|
||||
(150 + rand () % 6), 1.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -1187,14 +1186,14 @@ R_EntityParticles_ID (const entity_t *ent)
|
|||
}
|
||||
|
||||
for (i = 0; i < j; i++) {
|
||||
angle = r_realtime * avelocities[i][0];
|
||||
angle = vr_data.realtime * avelocities[i][0];
|
||||
cy = cos (angle);
|
||||
sy = sin (angle);
|
||||
angle = r_realtime * avelocities[i][1];
|
||||
angle = vr_data.realtime * avelocities[i][1];
|
||||
cp = cos (angle);
|
||||
sp = sin (angle);
|
||||
// Next 3 lines results aren't currently used, may be in future. --Despair
|
||||
// angle = r_realtime * avelocities[i][2];
|
||||
// angle = vr_data.realtime * avelocities[i][2];
|
||||
// sr = sin (angle);
|
||||
// cr = cos (angle);
|
||||
|
||||
|
@ -1209,7 +1208,7 @@ R_EntityParticles_ID (const entity_t *ent)
|
|||
porg[2] = ent->origin[2] + r_avertexnormals[i][2] * dist +
|
||||
forward[2] * beamlength;
|
||||
particle_new (pt_explode, part_tex_dot, porg, 1.0, vec3_origin,
|
||||
r_realtime + 0.01, 0x6f, 1.0, 0);
|
||||
vr_data.realtime + 0.01, 0x6f, 1.0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1237,7 +1236,7 @@ R_RocketTrail_ID (const entity_t *ent)
|
|||
ramp = rnd & 3;
|
||||
|
||||
particle_new (pt_fire, part_tex_dot, org, 1.0, vec3_origin,
|
||||
r_realtime + 2.0, ramp3[ramp], 1.0, ramp);
|
||||
vr_data.realtime + 2.0, ramp3[ramp], 1.0, ramp);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -1269,7 +1268,7 @@ R_GrenadeTrail_ID (const entity_t *ent)
|
|||
ramp = (rnd & 3) + 2;
|
||||
|
||||
particle_new (pt_fire, part_tex_dot, org, 1.0, vec3_origin,
|
||||
r_realtime + 2.0, ramp3[ramp], 1.0, ramp);
|
||||
vr_data.realtime + 2.0, ramp3[ramp], 1.0, ramp);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -1300,7 +1299,7 @@ R_BloodTrail_ID (const entity_t *ent)
|
|||
porg[2] = old_origin[2] + ((rnd >> 6) & 7) * (5.0/7.0) - 2.5;
|
||||
|
||||
particle_new (pt_grav, part_tex_dot, porg, 1.0, vec3_origin,
|
||||
r_realtime + 2.0, 67 + (rnd & 3), 1.0, 0.0);
|
||||
vr_data.realtime + 2.0, 67 + (rnd & 3), 1.0, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -1331,7 +1330,7 @@ R_SlightBloodTrail_ID (const entity_t *ent)
|
|||
porg[2] = old_origin[2] + ((rnd >> 6) & 7) * (5.0/7.0) - 2.5;
|
||||
|
||||
particle_new (pt_grav, part_tex_dot, porg, 1.0, vec3_origin,
|
||||
r_realtime + 1.5, 67 + (rnd & 3), 1.0, 0.0);
|
||||
vr_data.realtime + 1.5, 67 + (rnd & 3), 1.0, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -1367,8 +1366,8 @@ R_WizTrail_ID (const entity_t *ent)
|
|||
pvel[2] = 0.0;
|
||||
|
||||
particle_new (pt_static, part_tex_dot, old_origin, 1.0, pvel,
|
||||
r_realtime + 0.5, 52 + ((tracercount & 4) << 1), 1.0,
|
||||
0.0);
|
||||
vr_data.realtime + 0.5, 52 + ((tracercount & 4) << 1),
|
||||
1.0, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -1404,8 +1403,8 @@ R_FlameTrail_ID (const entity_t *ent)
|
|||
pvel[2] = 0.0;
|
||||
|
||||
particle_new (pt_static, part_tex_dot, old_origin, 1.0, pvel,
|
||||
r_realtime + 0.5, 230 + ((tracercount & 4) << 1), 1.0,
|
||||
0.0);
|
||||
vr_data.realtime + 0.5, 230 + ((tracercount & 4) << 1),
|
||||
1.0, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -1436,7 +1435,8 @@ R_VoorTrail_ID (const entity_t *ent)
|
|||
porg[2] = old_origin[2] + ((rnd >> 11) & 15) - 7.5;
|
||||
|
||||
particle_new (pt_static, part_tex_dot, porg, 1.0, vec3_origin,
|
||||
r_realtime + 0.3, 9 * 16 + 8 + (rnd & 3), 1.0, 0.0);
|
||||
vr_data.realtime + 0.3, 9 * 16 + 8 + (rnd & 3),
|
||||
1.0, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -1546,7 +1546,7 @@ R_DrawParticles (void)
|
|||
|
||||
// LordHavoc: immediate removal of unnecessary particles (must be done
|
||||
// to ensure compactor below operates properly in all cases)
|
||||
if (part->die < r_realtime) {
|
||||
if (part->die < vr_data.realtime) {
|
||||
freeparticles[j++] = part;
|
||||
} else {
|
||||
maxparticle = k;
|
||||
|
@ -1574,7 +1574,7 @@ R_DrawParticles (void)
|
|||
while (maxparticle >= activeparticles) {
|
||||
*freeparticles[k++] = particles[maxparticle--];
|
||||
while (maxparticle >= activeparticles &&
|
||||
particles[maxparticle].die <= r_realtime)
|
||||
particles[maxparticle].die <= vr_data.realtime)
|
||||
maxparticle--;
|
||||
}
|
||||
numparticles = activeparticles;
|
||||
|
@ -1583,26 +1583,125 @@ R_DrawParticles (void)
|
|||
qfglDepthMask (GL_TRUE);
|
||||
}
|
||||
|
||||
static vid_particle_funcs_t particles_QF = {
|
||||
R_RocketTrail_QF,
|
||||
R_GrenadeTrail_QF,
|
||||
R_BloodTrail_QF,
|
||||
R_SlightBloodTrail_QF,
|
||||
R_WizTrail_QF,
|
||||
R_FlameTrail_QF,
|
||||
R_VoorTrail_QF,
|
||||
R_GlowTrail_QF,
|
||||
R_RunParticleEffect_QF,
|
||||
R_BloodPuffEffect_QF,
|
||||
R_GunshotEffect_QF,
|
||||
R_LightningBloodEffect_QF,
|
||||
R_SpikeEffect_QF,
|
||||
R_KnightSpikeEffect_QF,
|
||||
R_SuperSpikeEffect_QF,
|
||||
R_WizSpikeEffect_QF,
|
||||
R_BlobExplosion_QF,
|
||||
R_ParticleExplosion_QF,
|
||||
R_ParticleExplosion2_QF,
|
||||
R_LavaSplash_QF,
|
||||
R_TeleportSplash_QF,
|
||||
R_DarkFieldParticles_ID,
|
||||
R_EntityParticles_ID,
|
||||
};
|
||||
|
||||
static vid_particle_funcs_t particles_ID = {
|
||||
R_RocketTrail_ID,
|
||||
R_GrenadeTrail_ID,
|
||||
R_BloodTrail_ID,
|
||||
R_SlightBloodTrail_ID,
|
||||
R_WizTrail_ID,
|
||||
R_FlameTrail_ID,
|
||||
R_VoorTrail_ID,
|
||||
R_GlowTrail_QF,
|
||||
R_RunParticleEffect_ID,
|
||||
R_BloodPuffEffect_ID,
|
||||
R_GunshotEffect_ID,
|
||||
R_LightningBloodEffect_ID,
|
||||
R_SpikeEffect_ID,
|
||||
R_KnightSpikeEffect_ID,
|
||||
R_SuperSpikeEffect_ID,
|
||||
R_WizSpikeEffect_ID,
|
||||
R_BlobExplosion_ID,
|
||||
R_ParticleExplosion_ID,
|
||||
R_ParticleExplosion2_QF,
|
||||
R_LavaSplash_ID,
|
||||
R_TeleportSplash_ID,
|
||||
R_DarkFieldParticles_ID,
|
||||
R_EntityParticles_ID,
|
||||
};
|
||||
|
||||
static vid_particle_funcs_t particles_QF_egg = {
|
||||
R_RocketTrail_EE,
|
||||
R_GrenadeTrail_EE,
|
||||
R_BloodTrail_QF,
|
||||
R_SlightBloodTrail_QF,
|
||||
R_WizTrail_QF,
|
||||
R_FlameTrail_QF,
|
||||
R_VoorTrail_QF,
|
||||
R_GlowTrail_QF,
|
||||
R_RunParticleEffect_QF,
|
||||
R_BloodPuffEffect_QF,
|
||||
R_GunshotEffect_QF,
|
||||
R_LightningBloodEffect_QF,
|
||||
R_SpikeEffect_QF,
|
||||
R_KnightSpikeEffect_QF,
|
||||
R_SuperSpikeEffect_QF,
|
||||
R_WizSpikeEffect_QF,
|
||||
R_BlobExplosion_QF,
|
||||
R_ParticleExplosion_EE,
|
||||
R_ParticleExplosion2_QF,
|
||||
R_LavaSplash_QF,
|
||||
R_TeleportSplash_EE,
|
||||
R_DarkFieldParticles_ID,
|
||||
R_EntityParticles_ID,
|
||||
};
|
||||
|
||||
static vid_particle_funcs_t particles_ID_egg = {
|
||||
R_RocketTrail_EE,
|
||||
R_GrenadeTrail_EE,
|
||||
R_BloodTrail_ID,
|
||||
R_SlightBloodTrail_ID,
|
||||
R_WizTrail_ID,
|
||||
R_FlameTrail_ID,
|
||||
R_VoorTrail_ID,
|
||||
R_GlowTrail_QF,
|
||||
R_RunParticleEffect_ID,
|
||||
R_BloodPuffEffect_ID,
|
||||
R_GunshotEffect_ID,
|
||||
R_LightningBloodEffect_ID,
|
||||
R_SpikeEffect_ID,
|
||||
R_KnightSpikeEffect_ID,
|
||||
R_SuperSpikeEffect_ID,
|
||||
R_WizSpikeEffect_ID,
|
||||
R_BlobExplosion_ID,
|
||||
R_ParticleExplosion_EE,
|
||||
R_ParticleExplosion2_QF,
|
||||
R_LavaSplash_ID,
|
||||
R_TeleportSplash_EE,
|
||||
R_DarkFieldParticles_ID,
|
||||
R_EntityParticles_ID,
|
||||
};
|
||||
|
||||
void
|
||||
r_easter_eggs_f (cvar_t *var)
|
||||
{
|
||||
if (easter_eggs && !gl_feature_mach64) {
|
||||
if (easter_eggs->int_val) {
|
||||
R_ParticleExplosion = R_ParticleExplosion_EE;
|
||||
R_TeleportSplash = R_TeleportSplash_EE;
|
||||
R_RocketTrail = R_RocketTrail_EE;
|
||||
R_GrenadeTrail = R_GrenadeTrail_EE;
|
||||
if (r_particles_style->int_val) {
|
||||
vr_funcs.particles = &particles_QF_egg;
|
||||
} else {
|
||||
vr_funcs.particles = &particles_ID_egg;
|
||||
}
|
||||
} else if (r_particles_style) {
|
||||
if (r_particles_style->int_val) {
|
||||
R_ParticleExplosion = R_ParticleExplosion_QF;
|
||||
R_TeleportSplash = R_TeleportSplash_QF;
|
||||
R_RocketTrail = R_RocketTrail_QF;
|
||||
R_GrenadeTrail = R_GrenadeTrail_QF;
|
||||
vr_funcs.particles = &particles_QF;
|
||||
} else {
|
||||
R_ParticleExplosion = R_ParticleExplosion_ID;
|
||||
R_TeleportSplash = R_TeleportSplash_ID;
|
||||
R_RocketTrail = R_RocketTrail_ID;
|
||||
R_GrenadeTrail = R_GrenadeTrail_ID;
|
||||
vr_funcs.particles = &particles_ID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1611,53 +1710,6 @@ r_easter_eggs_f (cvar_t *var)
|
|||
void
|
||||
r_particles_style_f (cvar_t *var)
|
||||
{
|
||||
if (r_particles_style) {
|
||||
if (r_particles_style->int_val && !gl_feature_mach64) {
|
||||
R_BlobExplosion = R_BlobExplosion_QF;
|
||||
R_LavaSplash = R_LavaSplash_QF;
|
||||
|
||||
R_BloodPuffEffect = R_BloodPuffEffect_QF;
|
||||
R_GunshotEffect = R_GunshotEffect_QF;
|
||||
R_LightningBloodEffect = R_LightningBloodEffect_QF;
|
||||
|
||||
R_RunParticleEffect = R_RunParticleEffect_QF;
|
||||
R_SpikeEffect = R_SpikeEffect_QF;
|
||||
R_SuperSpikeEffect = R_SuperSpikeEffect_QF;
|
||||
R_KnightSpikeEffect = R_KnightSpikeEffect_QF;
|
||||
R_WizSpikeEffect = R_WizSpikeEffect_QF;
|
||||
|
||||
R_BloodTrail = R_BloodTrail_QF;
|
||||
R_SlightBloodTrail = R_SlightBloodTrail_QF;
|
||||
R_WizTrail = R_WizTrail_QF;
|
||||
R_FlameTrail = R_FlameTrail_QF;
|
||||
R_VoorTrail = R_VoorTrail_QF;
|
||||
} else {
|
||||
R_BlobExplosion = R_BlobExplosion_ID;
|
||||
R_LavaSplash = R_LavaSplash_ID;
|
||||
|
||||
R_BloodPuffEffect = R_BloodPuffEffect_ID;
|
||||
R_GunshotEffect = R_GunshotEffect_ID;
|
||||
R_LightningBloodEffect = R_LightningBloodEffect_ID;
|
||||
|
||||
R_RunParticleEffect = R_RunParticleEffect_ID;
|
||||
R_SpikeEffect = R_SpikeEffect_ID;
|
||||
R_SuperSpikeEffect = R_SuperSpikeEffect_ID;
|
||||
R_KnightSpikeEffect = R_KnightSpikeEffect_ID;
|
||||
R_WizSpikeEffect = R_WizSpikeEffect_ID;
|
||||
|
||||
R_BloodTrail = R_BloodTrail_ID;
|
||||
R_SlightBloodTrail = R_SlightBloodTrail_ID;
|
||||
R_WizTrail = R_WizTrail_ID;
|
||||
R_FlameTrail = R_FlameTrail_ID;
|
||||
R_VoorTrail = R_VoorTrail_ID;
|
||||
}
|
||||
}
|
||||
R_DarkFieldParticles = R_DarkFieldParticles_ID;
|
||||
R_EntityParticles = R_EntityParticles_ID;
|
||||
R_ParticleExplosion2 = R_ParticleExplosion2_QF;
|
||||
R_GlowTrail = R_GlowTrail_QF;
|
||||
// Handle R_GrenadeTrail, R_RocketTrail, R_ParticleExplosion,
|
||||
// R_TeleportSplash
|
||||
r_easter_eggs_f (easter_eggs);
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
#include "QF/GL/qf_textures.h"
|
||||
#include "QF/GL/qf_vid.h"
|
||||
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
int gl_part_tex;
|
||||
static GLint part_tex_internal_format = 2;
|
||||
|
|
|
@ -41,7 +41,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
#include "QF/GL/funcs.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "r_shared.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
//==============================================================================
|
||||
//
|
||||
|
@ -73,10 +73,10 @@ Fog_Update (float density, float red, float green, float blue, float time)
|
|||
//save previous settings for fade
|
||||
if (time > 0) {
|
||||
//check for a fade in progress
|
||||
if (fade_done > r_realtime) {
|
||||
if (fade_done > vr_data.realtime) {
|
||||
float f;
|
||||
|
||||
f = (fade_done - r_realtime) / fade_time;
|
||||
f = (fade_done - vr_data.realtime) / fade_time;
|
||||
old_density = f * old_density + (1.0 - f) * fog_density;
|
||||
old_red = f * old_red + (1.0 - f) * fog_red;
|
||||
old_green = f * old_green + (1.0 - f) * fog_green;
|
||||
|
@ -94,7 +94,7 @@ Fog_Update (float density, float red, float green, float blue, float time)
|
|||
fog_green = green;
|
||||
fog_blue = blue;
|
||||
fade_time = time;
|
||||
fade_done = r_realtime + time;
|
||||
fade_done = vr_data.realtime + time;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -188,8 +188,8 @@ Fog_GetColor (void)
|
|||
float f;
|
||||
int i;
|
||||
|
||||
if (fade_done > r_realtime) {
|
||||
f = (fade_done - r_realtime) / fade_time;
|
||||
if (fade_done > vr_data.realtime) {
|
||||
f = (fade_done - vr_data.realtime) / fade_time;
|
||||
c[0] = f * old_red + (1.0 - f) * fog_red;
|
||||
c[1] = f * old_green + (1.0 - f) * fog_green;
|
||||
c[2] = f * old_blue + (1.0 - f) * fog_blue;
|
||||
|
@ -219,8 +219,8 @@ Fog_GetDensity (void)
|
|||
{
|
||||
float f;
|
||||
|
||||
if (fade_done > r_realtime) {
|
||||
f = (fade_done - r_realtime) / fade_time;
|
||||
if (fade_done > vr_data.realtime) {
|
||||
f = (fade_done - vr_data.realtime) / fade_time;
|
||||
return f * old_density + (1.0 - f) * fog_density;
|
||||
} else {
|
||||
return fog_density;
|
||||
|
|
|
@ -49,7 +49,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/GL/funcs.h"
|
||||
#include "QF/GL/qf_textures.h"
|
||||
|
||||
#include "r_cvar.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
#define NUM_GRAPH_TEXTURES 8
|
||||
|
||||
|
|
|
@ -54,9 +54,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/GL/qf_vid.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_local.h"
|
||||
#include "r_shared.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
static int dlightdivtable[8192];
|
||||
static int gl_internalformat; // 1 or 3
|
||||
|
|
|
@ -59,9 +59,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/GL/qf_vid.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_dynamic.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
typedef struct {
|
||||
vec3_t normal;
|
||||
|
@ -422,7 +420,7 @@ R_DrawAliasModel (entity_t *e)
|
|||
|
||||
if (gl_vector_light->int_val) {
|
||||
for (l = r_dlights, lnum = 0; lnum < r_maxdlights; lnum++, l++) {
|
||||
if (l->die >= r_realtime) {
|
||||
if (l->die >= vr_data.realtime) {
|
||||
VectorSubtract (l->origin, e->origin, dist);
|
||||
if ((d = DotProduct (dist, dist)) > // Out of range
|
||||
((l->radius + radius) * (l->radius + radius))) {
|
||||
|
@ -473,7 +471,7 @@ R_DrawAliasModel (entity_t *e)
|
|||
VectorCopy (ambientcolor, emission);
|
||||
|
||||
for (l = r_dlights, lnum = 0; lnum < r_maxdlights; lnum++, l++) {
|
||||
if (l->die >= r_realtime) {
|
||||
if (l->die >= vr_data.realtime) {
|
||||
VectorSubtract (l->origin, e->origin, dist);
|
||||
|
||||
if ((d = DotProduct (dist, dist)) > (l->radius + radius) *
|
||||
|
|
|
@ -46,8 +46,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/sys.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "r_local.h"
|
||||
#include "r_shared.h"
|
||||
#include "r_internal.h"
|
||||
#include "varrays.h"
|
||||
|
||||
static int sVAsize;
|
||||
|
@ -83,7 +82,7 @@ R_GetSpriteFrame (entity_t *currententity)
|
|||
numframes = pspritegroup->numframes;
|
||||
fullinterval = pintervals[numframes - 1];
|
||||
|
||||
time = r_realtime + currententity->syncbase;
|
||||
time = vr_data.realtime + currententity->syncbase;
|
||||
|
||||
// when loading in Mod_LoadSpriteGroup, we guaranteed all interval
|
||||
// values are positive, so we don't have to worry about division by 0
|
||||
|
|
|
@ -61,9 +61,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "compat.h"
|
||||
#include "gl_draw.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_dynamic.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
#include "varrays.h"
|
||||
|
||||
int c_brush_polys, c_alias_polys;
|
||||
|
@ -266,8 +264,8 @@ R_DrawEntitiesOnList (void)
|
|||
static void
|
||||
R_DrawViewModel (void)
|
||||
{
|
||||
currententity = r_view_model;
|
||||
if (r_inhibit_viewmodel
|
||||
currententity = vr_data.view_model;
|
||||
if (vr_data.inhibit_viewmodel
|
||||
|| !r_drawviewmodel->int_val
|
||||
|| gl_envmap
|
||||
|| !r_drawentities->int_val
|
||||
|
@ -530,7 +528,7 @@ R_Mirror (void)
|
|||
r_refdef.viewangles[1] = atan2 (vpn[1], vpn[0]) / M_PI * 180;
|
||||
r_refdef.viewangles[2] = -r_refdef.viewangles[2];
|
||||
|
||||
R_EnqueueEntity (r_player_entity);
|
||||
R_EnqueueEntity (vr_data.player_entity);
|
||||
|
||||
gldepthmin = 0.5;
|
||||
gldepthmax = 1;
|
||||
|
|
|
@ -61,8 +61,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/GL/qf_textures.h"
|
||||
#include "QF/GL/qf_vid.h"
|
||||
|
||||
#include "r_dynamic.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
#include "varrays.h"
|
||||
|
||||
/*
|
||||
|
@ -145,6 +144,7 @@ R_Init (void)
|
|||
"Load a pointfile to determine map leaks");
|
||||
Cmd_AddCommand ("loadsky", R_LoadSky_f, "Load a skybox");
|
||||
|
||||
Draw_Init ();
|
||||
SCR_Init ();
|
||||
R_InitBubble ();
|
||||
|
||||
|
|
|
@ -54,9 +54,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
#include "QF/GL/qf_vid.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_local.h"
|
||||
#include "r_shared.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
static instsurf_t *waterchain = NULL;
|
||||
static instsurf_t **waterchain_tail = &waterchain;
|
||||
|
@ -315,6 +313,7 @@ R_DrawWaterSurfaces (void)
|
|||
int i;
|
||||
instsurf_t *s;
|
||||
msurface_t *fa;
|
||||
float wateralpha = max (vr_data.min_wateralpha, r_wateralpha->value);
|
||||
|
||||
if (!waterchain)
|
||||
return;
|
||||
|
@ -322,9 +321,9 @@ R_DrawWaterSurfaces (void)
|
|||
// go back to the world matrix
|
||||
qfglLoadMatrixf (r_world_matrix);
|
||||
|
||||
if (cl_wateralpha < 1.0) {
|
||||
if (wateralpha < 1.0) {
|
||||
qfglDepthMask (GL_FALSE);
|
||||
color_white[3] = cl_wateralpha * 255;
|
||||
color_white[3] = wateralpha * 255;
|
||||
qfglColor4ubv (color_white);
|
||||
}
|
||||
|
||||
|
@ -346,7 +345,7 @@ R_DrawWaterSurfaces (void)
|
|||
waterchain = NULL;
|
||||
waterchain_tail = &waterchain;
|
||||
|
||||
if (cl_wateralpha < 1.0) {
|
||||
if (wateralpha < 1.0) {
|
||||
qfglDepthMask (GL_TRUE);
|
||||
qfglColor3ubv (color_white);
|
||||
}
|
||||
|
@ -562,7 +561,8 @@ R_DrawBrushModel (entity_t *e)
|
|||
vec3_t lightorigin;
|
||||
|
||||
for (k = 0; k < r_maxdlights; k++) {
|
||||
if ((r_dlights[k].die < r_realtime) || (!r_dlights[k].radius))
|
||||
if ((r_dlights[k].die < vr_data.realtime)
|
||||
|| (!r_dlights[k].radius))
|
||||
continue;
|
||||
|
||||
VectorSubtract (r_dlights[k].origin, e->origin, lightorigin);
|
||||
|
|
|
@ -56,10 +56,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
|
||||
#include "compat.h"
|
||||
#include "gl_draw.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_dynamic.h"
|
||||
#include "r_local.h"
|
||||
#include "r_screen.h"
|
||||
#include "r_internal.h"
|
||||
#include "sbar.h"
|
||||
|
||||
/* SCREEN SHOTS */
|
||||
|
@ -171,11 +168,11 @@ SCR_TileClear (void)
|
|||
{
|
||||
if (r_refdef.vrect.x > 0) {
|
||||
// left
|
||||
Draw_TileClear (0, 0, r_refdef.vrect.x, vid.height - r_lineadj);
|
||||
Draw_TileClear (0, 0, r_refdef.vrect.x, vid.height - vr_data.lineadj);
|
||||
// right
|
||||
Draw_TileClear (r_refdef.vrect.x + r_refdef.vrect.width, 0,
|
||||
vid.width - r_refdef.vrect.x + r_refdef.vrect.width,
|
||||
vid.height - r_lineadj);
|
||||
vid.height - vr_data.lineadj);
|
||||
}
|
||||
if (r_refdef.vrect.y > 0) {
|
||||
// top
|
||||
|
@ -186,7 +183,7 @@ SCR_TileClear (void)
|
|||
Draw_TileClear (r_refdef.vrect.x,
|
||||
r_refdef.vrect.y + r_refdef.vrect.height,
|
||||
r_refdef.vrect.width,
|
||||
vid.height - r_lineadj -
|
||||
vid.height - vr_data.lineadj -
|
||||
(r_refdef.vrect.height + r_refdef.vrect.y));
|
||||
}
|
||||
}
|
||||
|
@ -212,7 +209,7 @@ SCR_UpdateScreen (double realtime, SCR_Func scr_3dfunc, SCR_Func *scr_funcs)
|
|||
if (begun)
|
||||
GL_EndRendering ();
|
||||
|
||||
r_realtime = realtime;
|
||||
vr_data.realtime = realtime;
|
||||
|
||||
vid.numpages = 2 + gl_triplebuffer->int_val;
|
||||
|
||||
|
|
|
@ -53,8 +53,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/GL/qf_vid.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_shared.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
static const char *suf[6] = { "rt", "bk", "lf", "ft", "up", "dn" };
|
||||
int gl_solidskytexture;
|
||||
|
@ -364,7 +363,7 @@ R_DrawSkyDome (void)
|
|||
// base sky
|
||||
qfglDisable (GL_BLEND);
|
||||
qfglBindTexture (GL_TEXTURE_2D, gl_solidskytexture);
|
||||
speedscale = r_realtime / 16.0;
|
||||
speedscale = vr_data.realtime / 16.0;
|
||||
speedscale -= floor (speedscale);
|
||||
R_DrawSkyLayer (speedscale);
|
||||
qfglEnable (GL_BLEND);
|
||||
|
@ -372,7 +371,7 @@ R_DrawSkyDome (void)
|
|||
// clouds
|
||||
if (gl_sky_multipass->int_val) {
|
||||
qfglBindTexture (GL_TEXTURE_2D, gl_alphaskytexture);
|
||||
speedscale = r_realtime / 8.0;
|
||||
speedscale = vr_data.realtime / 8.0;
|
||||
speedscale -= floor (speedscale);
|
||||
R_DrawSkyLayer (speedscale);
|
||||
}
|
||||
|
|
|
@ -57,8 +57,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/GL/qf_sky.h"
|
||||
#include "QF/GL/qf_vid.h"
|
||||
|
||||
#include "r_cvar.h"
|
||||
#include "r_shared.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
#include "compat.h"
|
||||
|
||||
|
@ -745,7 +744,7 @@ draw_id_sky_polys (const instsurf_t *sky_chain)
|
|||
const instsurf_t *sc = sky_chain;
|
||||
float speedscale;
|
||||
|
||||
speedscale = r_realtime / 16;
|
||||
speedscale = vr_data.realtime / 16;
|
||||
speedscale -= floor (speedscale);
|
||||
|
||||
qfglBindTexture (GL_TEXTURE_2D, gl_solidskytexture);
|
||||
|
@ -757,7 +756,7 @@ draw_id_sky_polys (const instsurf_t *sky_chain)
|
|||
if (gl_sky_multipass->int_val) {
|
||||
sc = sky_chain;
|
||||
|
||||
speedscale = r_realtime / 8;
|
||||
speedscale = vr_data.realtime / 8;
|
||||
speedscale -= floor (speedscale);
|
||||
|
||||
qfglBindTexture (GL_TEXTURE_2D, gl_alphaskytexture);
|
||||
|
|
|
@ -54,7 +54,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/GL/qf_vid.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_internal.h"
|
||||
#include "sbar.h"
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -34,8 +34,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/cvar.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "r_cvar.h"
|
||||
#include "r_shared.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
#include "QF/GL/defines.h"
|
||||
#include "QF/GL/funcs.h"
|
||||
|
@ -62,7 +61,7 @@ GL_EmitWaterPolys (msurface_t *fa)
|
|||
int i;
|
||||
glpoly_t *p;
|
||||
|
||||
timetemp = r_realtime * TURBSCALE;
|
||||
timetemp = vr_data.realtime * TURBSCALE;
|
||||
|
||||
for (p = fa->polys; p; p = p->next) {
|
||||
qfglBegin (GL_POLYGON);
|
||||
|
|
|
@ -50,7 +50,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
#include "QF/GLSL/qf_textures.h"
|
||||
#include "QF/GLSL/qf_vid.h"
|
||||
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
static const char quakemdl_vert[] =
|
||||
#include "quakemdl.vc"
|
||||
|
@ -149,7 +149,7 @@ calc_lighting (entity_t *ent, float *ambient, float *shadelight,
|
|||
*shadelight = *ambient;
|
||||
|
||||
for (i = 0; i < r_maxdlights; i++) {
|
||||
if (r_dlights[i].die >= r_realtime) {
|
||||
if (r_dlights[i].die >= vr_data.realtime) {
|
||||
VectorSubtract (ent->origin, r_dlights[i].origin, dist);
|
||||
add = r_dlights[i].radius - VectorLength (dist);
|
||||
if (add > 0)
|
||||
|
|
|
@ -56,8 +56,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
#include "QF/GLSL/qf_textures.h"
|
||||
#include "QF/GLSL/qf_vid.h"
|
||||
|
||||
#include "r_cvar.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
typedef struct {
|
||||
GLushort count;
|
||||
|
@ -526,7 +525,7 @@ R_BuildDisplayLists (model_t **models, int num_models)
|
|||
QuatSet (1, 0, 0, 0, sky_rotation[1]);
|
||||
QuatSet (0, 0, 0, 0, sky_velocity);
|
||||
QuatExp (sky_velocity, sky_velocity);
|
||||
sky_time = r_realtime;
|
||||
sky_time = vr_data.realtime;
|
||||
|
||||
// now run through all surfaces, chaining them to their textures, thus
|
||||
// effectively sorting the surfaces by texture (without worrying about
|
||||
|
@ -659,7 +658,8 @@ R_DrawBrushModel (entity_t *e)
|
|||
vec3_t lightorigin;
|
||||
|
||||
for (k = 0; k < r_maxdlights; k++) {
|
||||
if ((r_dlights[k].die < r_realtime) || (!r_dlights[k].radius))
|
||||
if ((r_dlights[k].die < vr_data.realtime)
|
||||
|| (!r_dlights[k].radius))
|
||||
continue;
|
||||
|
||||
VectorSubtract (r_dlights[k].origin, e->origin, lightorigin);
|
||||
|
@ -905,7 +905,7 @@ turb_begin (void)
|
|||
qfglEnable (GL_TEXTURE_2D);
|
||||
qfglBindTexture (GL_TEXTURE_2D, glsl_palette);
|
||||
|
||||
qfglUniform1f (quake_turb.realtime.location, r_realtime);
|
||||
qfglUniform1f (quake_turb.realtime.location, vr_data.realtime);
|
||||
|
||||
qfglUniform1i (quake_turb.texture.location, 0);
|
||||
qfglActiveTexture (GL_TEXTURE0 + 0);
|
||||
|
@ -935,12 +935,12 @@ spin (mat4_t mat)
|
|||
mat4_t m;
|
||||
float blend;
|
||||
|
||||
while (r_realtime - sky_time > 1) {
|
||||
while (vr_data.realtime - sky_time > 1) {
|
||||
QuatCopy (sky_rotation[1], sky_rotation[0]);
|
||||
QuatMult (sky_velocity, sky_rotation[0], sky_rotation[1]);
|
||||
sky_time += 1;
|
||||
}
|
||||
blend = bound (0, (r_realtime - sky_time), 1);
|
||||
blend = bound (0, (vr_data.realtime - sky_time), 1);
|
||||
|
||||
QuatBlend (sky_rotation[0], sky_rotation[1], blend, q);
|
||||
Mat4Identity (mat);
|
||||
|
@ -987,7 +987,7 @@ sky_begin (void)
|
|||
qfglEnable (GL_TEXTURE_2D);
|
||||
qfglBindTexture (GL_TEXTURE_2D, glsl_palette);
|
||||
|
||||
qfglUniform1f (quake_skyid.realtime.location, r_realtime);
|
||||
qfglUniform1f (quake_skyid.realtime.location, vr_data.realtime);
|
||||
|
||||
qfglUniform1i (quake_skyid.trans.location, 0);
|
||||
qfglActiveTexture (GL_TEXTURE0 + 0);
|
||||
|
|
|
@ -54,9 +54,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
#include "QF/GLSL/qf_vid.h"
|
||||
|
||||
#include "gl_draw.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_local.h"
|
||||
#include "r_shared.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
typedef struct {
|
||||
int texnum;
|
||||
|
|
|
@ -41,7 +41,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
#include "QF/GLSL/funcs.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "r_shared.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
//==============================================================================
|
||||
//
|
||||
|
@ -73,10 +73,10 @@ Fog_Update (float density, float red, float green, float blue, float time)
|
|||
//save previous settings for fade
|
||||
if (time > 0) {
|
||||
//check for a fade in progress
|
||||
if (fade_done > r_realtime) {
|
||||
if (fade_done > vr_data.realtime) {
|
||||
float f;
|
||||
|
||||
f = (fade_done - r_realtime) / fade_time;
|
||||
f = (fade_done - vr_data.realtime) / fade_time;
|
||||
old_density = f * old_density + (1.0 - f) * fog_density;
|
||||
old_red = f * old_red + (1.0 - f) * fog_red;
|
||||
old_green = f * old_green + (1.0 - f) * fog_green;
|
||||
|
@ -94,7 +94,7 @@ Fog_Update (float density, float red, float green, float blue, float time)
|
|||
fog_green = green;
|
||||
fog_blue = blue;
|
||||
fade_time = time;
|
||||
fade_done = r_realtime + time;
|
||||
fade_done = vr_data.realtime + time;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -188,8 +188,8 @@ Fog_GetColor (void)
|
|||
float f;
|
||||
int i;
|
||||
|
||||
if (fade_done > r_realtime) {
|
||||
f = (fade_done - r_realtime) / fade_time;
|
||||
if (fade_done > vr_data.realtime) {
|
||||
f = (fade_done - vr_data.realtime) / fade_time;
|
||||
c[0] = f * old_red + (1.0 - f) * fog_red;
|
||||
c[1] = f * old_green + (1.0 - f) * fog_green;
|
||||
c[2] = f * old_blue + (1.0 - f) * fog_blue;
|
||||
|
@ -219,8 +219,8 @@ Fog_GetDensity (void)
|
|||
{
|
||||
float f;
|
||||
|
||||
if (fade_done > r_realtime) {
|
||||
f = (fade_done - r_realtime) / fade_time;
|
||||
if (fade_done > vr_data.realtime) {
|
||||
f = (fade_done - vr_data.realtime) / fade_time;
|
||||
return f * old_density + (1.0 - f) * fog_density;
|
||||
} else {
|
||||
return fog_density;
|
||||
|
|
|
@ -52,7 +52,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
#include "QF/GLSL/qf_textures.h"
|
||||
#include "QF/GLSL/qf_vid.h"
|
||||
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
#define BLOCK_SIZE (BLOCK_WIDTH * BLOCK_HEIGHT)
|
||||
|
||||
|
|
|
@ -54,10 +54,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
#include "QF/GLSL/qf_textures.h"
|
||||
|
||||
#include "gl_draw.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_dynamic.h"
|
||||
#include "r_local.h"
|
||||
#include "r_screen.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
mat4_t glsl_projection;
|
||||
mat4_t glsl_view;
|
||||
|
@ -182,8 +179,8 @@ R_RenderEntities (void)
|
|||
static void
|
||||
R_DrawViewModel (void)
|
||||
{
|
||||
currententity = r_view_model;
|
||||
if (r_inhibit_viewmodel
|
||||
currententity = vr_data.view_model;
|
||||
if (vr_data.inhibit_viewmodel
|
||||
|| !r_drawviewmodel->int_val
|
||||
|| !r_drawentities->int_val
|
||||
|| !currententity->model)
|
||||
|
@ -247,6 +244,7 @@ R_RenderView (void)
|
|||
VISIBLE void
|
||||
R_Init (void)
|
||||
{
|
||||
Draw_Init ();
|
||||
SCR_Init ();
|
||||
R_InitBsp ();
|
||||
R_InitAlias ();
|
||||
|
|
|
@ -54,10 +54,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
#include "QF/GLSL/qf_textures.h"
|
||||
#include "QF/GLSL/qf_vid.h"
|
||||
|
||||
#include "r_cvar.h"
|
||||
#include "r_dynamic.h"
|
||||
#include "r_local.h"
|
||||
#include "r_shared.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
//FIXME not part of GLES, but needed for GL
|
||||
#ifndef GL_VERTEX_PROGRAM_POINT_SIZE
|
||||
|
@ -333,7 +330,7 @@ R_ParticleExplosion_QF (const vec3_t org)
|
|||
if (numparticles >= r_maxparticles)
|
||||
return;
|
||||
particle_new_random (pt_smokecloud, part_tex_smoke, org, 4, 30, 8,
|
||||
r_realtime + 5.0, (rand () & 7) + 8,
|
||||
vr_data.realtime + 5.0, (rand () & 7) + 8,
|
||||
0.5 + qfrandom (0.25), 0.0);
|
||||
}
|
||||
|
||||
|
@ -349,7 +346,7 @@ R_ParticleExplosion2_QF (const vec3_t org, int colorStart, int colorLength)
|
|||
|
||||
for (i = 0; i < j; i++) {
|
||||
particle_new_random (pt_blob, part_tex_dot, org, 16, 2, 256,
|
||||
r_realtime + 0.3,
|
||||
vr_data.realtime + 0.3,
|
||||
colorStart + (i % colorLength), 1.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -367,12 +364,12 @@ R_BlobExplosion_QF (const vec3_t org)
|
|||
|
||||
for (i = 0; i < j >> 1; i++) {
|
||||
particle_new_random (pt_blob, part_tex_dot, org, 12, 2, 256,
|
||||
r_realtime + 1.0 + (rand () & 7) * 0.05,
|
||||
vr_data.realtime + 1.0 + (rand () & 7) * 0.05,
|
||||
66 + i % 6, 1.0, 0.0);
|
||||
}
|
||||
for (i = 0; i < j / 2; i++) {
|
||||
particle_new_random (pt_blob2, part_tex_dot, org, 12, 2, 256,
|
||||
r_realtime + 1.0 + (rand () & 7) * 0.05,
|
||||
vr_data.realtime + 1.0 + (rand () & 7) * 0.05,
|
||||
150 + i % 6, 1.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -383,7 +380,7 @@ R_RunSparkEffect_QF (const vec3_t org, int count, int ofuzz)
|
|||
if (numparticles >= r_maxparticles)
|
||||
return;
|
||||
particle_new (pt_smokecloud, part_tex_smoke, org, ofuzz * 0.08,
|
||||
vec3_origin, r_realtime + 9, 12 + (rand () & 3),
|
||||
vec3_origin, vr_data.realtime + 9, 12 + (rand () & 3),
|
||||
0.25 + qfrandom (0.125), 0.0);
|
||||
|
||||
if (numparticles + count >= r_maxparticles)
|
||||
|
@ -397,8 +394,8 @@ R_RunSparkEffect_QF (const vec3_t org, int count, int ofuzz)
|
|||
int color = rand () & 7;
|
||||
|
||||
particle_new_random (pt_fallfadespark, part_tex_dot, org, orgfuzz,
|
||||
0.7, 96, r_realtime + 5.0, ramp1[color], 1.0,
|
||||
color);
|
||||
0.7, 96, vr_data.realtime + 5.0, ramp1[color],
|
||||
1.0, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -410,7 +407,7 @@ R_BloodPuff_QF (const vec3_t org, int count)
|
|||
return;
|
||||
|
||||
particle_new (pt_bloodcloud, part_tex_smoke, org, count / 5, vec3_origin,
|
||||
r_realtime + 99.0, 70 + (rand () & 3), 0.5, 0.0);
|
||||
vr_data.realtime + 99.0, 70 + (rand () & 3), 0.5, 0.0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -438,14 +435,15 @@ R_LightningBloodEffect_QF (const vec3_t org)
|
|||
if (numparticles >= r_maxparticles)
|
||||
return;
|
||||
particle_new (pt_smokecloud, part_tex_smoke, org, 3.0, vec3_origin,
|
||||
r_realtime + 9.0, 12 + (rand () & 3),
|
||||
vr_data.realtime + 9.0, 12 + (rand () & 3),
|
||||
0.25 + qfrandom (0.125), 0.0);
|
||||
|
||||
if (numparticles + count >= r_maxparticles)
|
||||
count = r_maxparticles - numparticles;
|
||||
while (count--)
|
||||
particle_new_random (pt_fallfade, part_tex_spark, org, 12, 2.0, 128,
|
||||
r_realtime + 5.0, 244 + (count % 3), 1.0, 0.0);
|
||||
vr_data.realtime + 5.0, 244 + (count % 3),
|
||||
1.0, 0.0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -472,7 +470,7 @@ R_RunParticleEffect_QF (const vec3_t org, const vec3_t dir, int color,
|
|||
porg[2] = org[2] + scale * (((rnd >> 11) & 15) - 7.5);
|
||||
// Note that ParseParticleEffect handles (dir * 15)
|
||||
particle_new (pt_grav, part_tex_dot, porg, 1.5, dir,
|
||||
r_realtime + 0.1 * (i % 5),
|
||||
vr_data.realtime + 0.1 * (i % 5),
|
||||
(color & ~7) + (rnd & 7), 1.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -497,13 +495,13 @@ R_KnightSpikeEffect_QF (const vec3_t org)
|
|||
if (numparticles >= r_maxparticles)
|
||||
return;
|
||||
particle_new (pt_smokecloud, part_tex_smoke, org, 1.0, vec3_origin,
|
||||
r_realtime + 9.0, 234, 0.25 + qfrandom (0.125), 0.0);
|
||||
vr_data.realtime + 9.0, 234, 0.25 + qfrandom (0.125), 0.0);
|
||||
|
||||
if (numparticles + count >= r_maxparticles)
|
||||
count = r_maxparticles - numparticles;
|
||||
while (count--)
|
||||
particle_new_random (pt_fallfade, part_tex_dot, org, 6, 0.7, 96,
|
||||
r_realtime + 5.0, 234, 1.0, 0.0);
|
||||
vr_data.realtime + 5.0, 234, 1.0, 0.0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -514,13 +512,13 @@ R_WizSpikeEffect_QF (const vec3_t org)
|
|||
if (numparticles >= r_maxparticles)
|
||||
return;
|
||||
particle_new (pt_smokecloud, part_tex_smoke, org, 2.0, vec3_origin,
|
||||
r_realtime + 9.0, 63, 0.25 + qfrandom (0.125), 0.0);
|
||||
vr_data.realtime + 9.0, 63, 0.25 + qfrandom (0.125), 0.0);
|
||||
|
||||
if (numparticles + count >= r_maxparticles)
|
||||
count = r_maxparticles - numparticles;
|
||||
while (count--)
|
||||
particle_new_random (pt_fallfade, part_tex_dot, org, 12, 0.7, 96,
|
||||
r_realtime + 5.0, 63, 1.0, 0.0);
|
||||
vr_data.realtime + 5.0, 63, 1.0, 0.0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -553,7 +551,7 @@ R_LavaSplash_QF (const vec3_t org)
|
|||
vel = 50.0 + 0.5 * (float) (rnd & 127);
|
||||
VectorScale (dir, vel, pvel);
|
||||
particle_new (pt_grav, part_tex_dot, porg, 3, pvel,
|
||||
r_realtime + 2.0 + ((rnd >> 7) & 31) * 0.02,
|
||||
vr_data.realtime + 2.0 + ((rnd >> 7) & 31) * 0.02,
|
||||
224 + ((rnd >> 12) & 7), 0.75, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -591,7 +589,7 @@ R_TeleportSplash_QF (const vec3_t org)
|
|||
vel = 50 + ((rnd >> 6) & 63);
|
||||
VectorScale (pdir, vel, pvel);
|
||||
particle_new (pt_grav, part_tex_spark, porg, 0.6, pvel,
|
||||
(r_realtime + 0.2 + (rand () & 15) * 0.01),
|
||||
(vr_data.realtime + 0.2 + (rand () & 15) * 0.01),
|
||||
(7 + ((rnd >> 12) & 7)), 1.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -611,7 +609,7 @@ R_RocketTrail_QF (const entity_t *ent)
|
|||
VectorCopy (ent->old_origin, old_origin);
|
||||
VectorSubtract (ent->origin, old_origin, vec);
|
||||
maxlen = VectorNormalize (vec);
|
||||
origlen = r_frametime / maxlen;
|
||||
origlen = vr_data.frametime / maxlen;
|
||||
pscale = 1.5 + qfrandom (1.5);
|
||||
|
||||
while (len < maxlen) {
|
||||
|
@ -621,7 +619,7 @@ R_RocketTrail_QF (const entity_t *ent)
|
|||
|
||||
particle_new (pt_smoke, part_tex_smoke, old_origin,
|
||||
pscale + percent * 4.0, vec3_origin,
|
||||
r_realtime + 2.0 - percent * 2.0,
|
||||
vr_data.realtime + 2.0 - percent * 2.0,
|
||||
12 + (rand () & 3),
|
||||
0.5 + qfrandom (0.125) - percent * 0.40, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
|
@ -645,7 +643,7 @@ R_GrenadeTrail_QF (const entity_t *ent)
|
|||
VectorCopy (ent->old_origin, old_origin);
|
||||
VectorSubtract (ent->origin, old_origin, vec);
|
||||
maxlen = VectorNormalize (vec);
|
||||
origlen = r_frametime / maxlen;
|
||||
origlen = vr_data.frametime / maxlen;
|
||||
pscale = 6.0 + qfrandom (7.0);
|
||||
|
||||
while (len < maxlen) {
|
||||
|
@ -655,7 +653,7 @@ R_GrenadeTrail_QF (const entity_t *ent)
|
|||
|
||||
particle_new (pt_smoke, part_tex_smoke, old_origin,
|
||||
pscale + percent * 4.0, vec3_origin,
|
||||
r_realtime + 2.0 - percent * 2.0,
|
||||
vr_data.realtime + 2.0 - percent * 2.0,
|
||||
1 + (rand () & 3),
|
||||
0.625 + qfrandom (0.125) - percent * 0.40, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
|
@ -680,7 +678,7 @@ R_BloodTrail_QF (const entity_t *ent)
|
|||
VectorCopy (ent->old_origin, old_origin);
|
||||
VectorSubtract (ent->origin, old_origin, vec);
|
||||
maxlen = VectorNormalize (vec);
|
||||
origlen = r_frametime / maxlen;
|
||||
origlen = vr_data.frametime / maxlen;
|
||||
pscale = 5.0 + qfrandom (10.0);
|
||||
|
||||
while (len < maxlen) {
|
||||
|
@ -696,8 +694,8 @@ R_BloodTrail_QF (const entity_t *ent)
|
|||
pvel[2] -= percent * 40.0;
|
||||
|
||||
particle_new (pt_grav, part_tex_smoke, porg, pscale, pvel,
|
||||
r_realtime + 2.0 - percent * 2.0, 68 + (rand () & 3),
|
||||
1.0, 0.0);
|
||||
vr_data.realtime + 2.0 - percent * 2.0,
|
||||
68 + (rand () & 3), 1.0, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -720,7 +718,7 @@ R_SlightBloodTrail_QF (const entity_t *ent)
|
|||
VectorCopy (ent->old_origin, old_origin);
|
||||
VectorSubtract (ent->origin, old_origin, vec);
|
||||
maxlen = VectorNormalize (vec);
|
||||
origlen = r_frametime / maxlen;
|
||||
origlen = vr_data.frametime / maxlen;
|
||||
pscale = 1.5 + qfrandom (7.5);
|
||||
|
||||
while (len < maxlen) {
|
||||
|
@ -736,8 +734,8 @@ R_SlightBloodTrail_QF (const entity_t *ent)
|
|||
pvel[2] -= percent * 40;
|
||||
|
||||
particle_new (pt_grav, part_tex_smoke, porg, pscale, pvel,
|
||||
r_realtime + 1.5 - percent * 1.5, 68 + (rand () & 3),
|
||||
0.75, 0.0);
|
||||
vr_data.realtime + 1.5 - percent * 1.5,
|
||||
68 + (rand () & 3), 0.75, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -760,7 +758,7 @@ R_WizTrail_QF (const entity_t *ent)
|
|||
VectorCopy (ent->old_origin, old_origin);
|
||||
VectorSubtract (ent->origin, old_origin, vec);
|
||||
maxlen = VectorNormalize (vec);
|
||||
origlen = r_frametime / maxlen;
|
||||
origlen = vr_data.frametime / maxlen;
|
||||
VectorScale (vec, maxlen - dist, subtract);
|
||||
|
||||
while (len < maxlen) {
|
||||
|
@ -778,8 +776,8 @@ R_WizTrail_QF (const entity_t *ent)
|
|||
|
||||
particle_new (pt_flame, part_tex_smoke, old_origin,
|
||||
2.0 + qfrandom (1.0) - percent * 2.0, pvel,
|
||||
r_realtime + 0.5 - percent * 0.5, 52 + (rand () & 4),
|
||||
1.0 - percent * 0.125, 0.0);
|
||||
vr_data.realtime + 0.5 - percent * 0.5,
|
||||
52 + (rand () & 4), 1.0 - percent * 0.125, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -801,7 +799,7 @@ R_FlameTrail_QF (const entity_t *ent)
|
|||
VectorCopy (ent->old_origin, old_origin);
|
||||
VectorSubtract (ent->origin, old_origin, vec);
|
||||
maxlen = VectorNormalize (vec);
|
||||
origlen = r_frametime / maxlen;
|
||||
origlen = vr_data.frametime / maxlen;
|
||||
VectorScale (vec, maxlen - dist, subtract);
|
||||
|
||||
while (len < maxlen) {
|
||||
|
@ -819,7 +817,7 @@ R_FlameTrail_QF (const entity_t *ent)
|
|||
|
||||
particle_new (pt_flame, part_tex_smoke, old_origin,
|
||||
2.0 + qfrandom (1.0) - percent * 2.0, pvel,
|
||||
r_realtime + 0.5 - percent * 0.5, 234,
|
||||
vr_data.realtime + 0.5 - percent * 0.5, 234,
|
||||
1.0 - percent * 0.125, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
|
@ -842,7 +840,7 @@ R_VoorTrail_QF (const entity_t *ent)
|
|||
VectorCopy (ent->old_origin, old_origin);
|
||||
VectorSubtract (ent->origin, old_origin, vec);
|
||||
maxlen = VectorNormalize (vec);
|
||||
origlen = r_frametime / maxlen;
|
||||
origlen = vr_data.frametime / maxlen;
|
||||
VectorScale (vec, maxlen - dist, subtract);
|
||||
|
||||
while (len < maxlen) {
|
||||
|
@ -852,7 +850,7 @@ R_VoorTrail_QF (const entity_t *ent)
|
|||
porg[j] = old_origin[j] + qfrandom (16.0) - 8.0;
|
||||
|
||||
particle_new (pt_static, part_tex_dot, porg, 1.0 + qfrandom (1.0),
|
||||
vec3_origin, r_realtime + 0.3 - percent * 0.3,
|
||||
vec3_origin, vr_data.realtime + 0.3 - percent * 0.3,
|
||||
9 * 16 + 8 + (rand () & 3), 1.0, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
|
@ -875,7 +873,7 @@ R_GlowTrail_QF (const entity_t *ent, int glow_color)
|
|||
VectorCopy (ent->old_origin, old_origin);
|
||||
VectorSubtract (ent->origin, old_origin, vec);
|
||||
maxlen = VectorNormalize (vec);
|
||||
origlen = r_frametime / maxlen;
|
||||
origlen = vr_data.frametime / maxlen;
|
||||
VectorScale (vec, (maxlen - dist), subtract);
|
||||
|
||||
while (len < maxlen) {
|
||||
|
@ -887,7 +885,8 @@ R_GlowTrail_QF (const entity_t *ent, int glow_color)
|
|||
org[2] = old_origin[2] + ((rnd >> 6) & 7) * (5.0/7.0) - 2.5;
|
||||
|
||||
particle_new (pt_smoke, part_tex_dot, org, 1.0, vec3_origin,
|
||||
r_realtime + 2.0 - percent * 0.2, glow_color, 1.0, 0.0);
|
||||
vr_data.realtime + 2.0 - percent * 0.2, glow_color,
|
||||
1.0, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -904,7 +903,7 @@ R_ParticleExplosion_EE (const vec3_t org)
|
|||
if (numparticles >= r_maxparticles)
|
||||
return;
|
||||
particle_new_random (pt_smokecloud, part_tex_smoke, org, 4, 30, 8,
|
||||
r_realtime + 5.0, rand () & 255,
|
||||
vr_data.realtime + 5.0, rand () & 255,
|
||||
0.5 + qfrandom (0.25), 0.0);
|
||||
}
|
||||
|
||||
|
@ -938,7 +937,7 @@ R_TeleportSplash_EE (const vec3_t org)
|
|||
vel = 50 + ((rnd >> 6) & 63);
|
||||
VectorScale (dir, vel, pvel);
|
||||
particle_new (pt_grav, part_tex_spark, porg, 0.6, pvel,
|
||||
(r_realtime + 0.2 + (rand () & 15) * 0.01),
|
||||
(vr_data.realtime + 0.2 + (rand () & 15) * 0.01),
|
||||
qfrandom (1.0), 1.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -958,7 +957,7 @@ R_RocketTrail_EE (const entity_t *ent)
|
|||
VectorCopy (ent->old_origin, old_origin);
|
||||
VectorSubtract (ent->origin, old_origin, vec);
|
||||
maxlen = VectorNormalize (vec);
|
||||
origlen = r_frametime / maxlen;
|
||||
origlen = vr_data.frametime / maxlen;
|
||||
pscale = 1.5 + qfrandom (1.5);
|
||||
|
||||
while (len < maxlen) {
|
||||
|
@ -968,7 +967,7 @@ R_RocketTrail_EE (const entity_t *ent)
|
|||
|
||||
particle_new (pt_smoke, part_tex_smoke, old_origin,
|
||||
pscale + percent * 4.0, vec3_origin,
|
||||
r_realtime + 2.0 - percent * 2.0,
|
||||
vr_data.realtime + 2.0 - percent * 2.0,
|
||||
rand () & 255,
|
||||
0.5 + qfrandom (0.125) - percent * 0.40, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
|
@ -993,7 +992,7 @@ R_GrenadeTrail_EE (const entity_t *ent)
|
|||
VectorCopy (ent->old_origin, old_origin);
|
||||
VectorSubtract (ent->origin, ent->old_origin, vec);
|
||||
maxlen = VectorNormalize (vec);
|
||||
origlen = r_frametime / maxlen;
|
||||
origlen = vr_data.frametime / maxlen;
|
||||
pscale = 6.0 + qfrandom (7.0);
|
||||
|
||||
while (len < maxlen) {
|
||||
|
@ -1003,7 +1002,7 @@ R_GrenadeTrail_EE (const entity_t *ent)
|
|||
|
||||
particle_new (pt_smoke, part_tex_smoke, old_origin,
|
||||
pscale + percent * 4.0, vec3_origin,
|
||||
r_realtime + 2.0 - percent * 2.0,
|
||||
vr_data.realtime + 2.0 - percent * 2.0,
|
||||
rand () & 255,
|
||||
0.625 + qfrandom (0.125) - percent * 0.40, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
|
@ -1028,11 +1027,11 @@ R_ParticleExplosion_ID (const vec3_t org)
|
|||
|
||||
for (i = 0; i < j >> 1; i++) {
|
||||
particle_new_random (pt_explode, part_tex_dot, org, 16, 1.0, 256,
|
||||
r_realtime + 5.0, ramp1[0], 1.0, i & 3);
|
||||
vr_data.realtime + 5.0, ramp1[0], 1.0, i & 3);
|
||||
}
|
||||
for (i = 0; i < j / 2; i++) {
|
||||
particle_new_random (pt_explode2, part_tex_dot, org, 16, 1.0, 256,
|
||||
r_realtime + 5.0, ramp1[0], 1.0, i & 3);
|
||||
vr_data.realtime + 5.0, ramp1[0], 1.0, i & 3);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1049,12 +1048,12 @@ R_BlobExplosion_ID (const vec3_t org)
|
|||
|
||||
for (i = 0; i < j >> 1; i++) {
|
||||
particle_new_random (pt_blob, part_tex_dot, org, 12, 1.0, 256,
|
||||
r_realtime + 1.0 + (rand () & 8) * 0.05,
|
||||
vr_data.realtime + 1.0 + (rand () & 8) * 0.05,
|
||||
66 + i % 6, 1.0, 0.0);
|
||||
}
|
||||
for (i = 0; i < j / 2; i++) {
|
||||
particle_new_random (pt_blob2, part_tex_dot, org, 12, 1.0, 256,
|
||||
r_realtime + 1.0 + (rand () & 8) * 0.05,
|
||||
vr_data.realtime + 1.0 + (rand () & 8) * 0.05,
|
||||
150 + i % 6, 1.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -1089,7 +1088,7 @@ R_RunParticleEffect_ID (const vec3_t org, const vec3_t dir, int color,
|
|||
|
||||
// Note that ParseParticleEffect handles (dir * 15)
|
||||
particle_new (pt_grav, part_tex_dot, porg, 1.0, dir,
|
||||
r_realtime + 0.1 * (i % 5),
|
||||
vr_data.realtime + 0.1 * (i % 5),
|
||||
(color & ~7) + (rnd & 7), 1.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -1166,7 +1165,7 @@ R_LavaSplash_ID (const vec3_t org)
|
|||
vel = 50 + (rnd & 63);
|
||||
VectorScale (dir, vel, pvel);
|
||||
particle_new (pt_grav, part_tex_dot, porg, 1.0, pvel,
|
||||
r_realtime + 2 + ((rnd >> 7) & 31) * 0.02,
|
||||
vr_data.realtime + 2 + ((rnd >> 7) & 31) * 0.02,
|
||||
224 + ((rnd >> 12) & 7), 1.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -1204,7 +1203,7 @@ R_TeleportSplash_ID (const vec3_t org)
|
|||
vel = 50 + ((rnd >> 6) & 63);
|
||||
VectorScale (pdir, vel, pvel);
|
||||
particle_new (pt_grav, part_tex_dot, porg, 1.0, pvel,
|
||||
(r_realtime + 0.2 + (rand () & 7) * 0.02),
|
||||
(vr_data.realtime + 0.2 + (rand () & 7) * 0.02),
|
||||
(7 + ((rnd >> 12) & 7)), 1.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -1243,7 +1242,7 @@ R_DarkFieldParticles_ID (const entity_t *ent)
|
|||
vel = 50 + ((rnd >> 9) & 63);
|
||||
VectorScale (dir, vel, pvel);
|
||||
particle_new (pt_slowgrav, part_tex_dot, porg, 1.5, pvel,
|
||||
(r_realtime + 0.2 + (rnd & 7) * 0.02),
|
||||
(vr_data.realtime + 0.2 + (rnd & 7) * 0.02),
|
||||
(150 + rand () % 6), 1.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
@ -1272,14 +1271,14 @@ R_EntityParticles_ID (const entity_t *ent)
|
|||
}
|
||||
|
||||
for (i = 0; i < j; i++) {
|
||||
angle = r_realtime * avelocities[i][0];
|
||||
angle = vr_data.realtime * avelocities[i][0];
|
||||
cy = cos (angle);
|
||||
sy = sin (angle);
|
||||
angle = r_realtime * avelocities[i][1];
|
||||
angle = vr_data.realtime * avelocities[i][1];
|
||||
cp = cos (angle);
|
||||
sp = sin (angle);
|
||||
// Next 3 lines results aren't currently used, may be in future. --Despair
|
||||
// angle = r_realtime * avelocities[i][2];
|
||||
// angle = vr_data.realtime * avelocities[i][2];
|
||||
// sr = sin (angle);
|
||||
// cr = cos (angle);
|
||||
|
||||
|
@ -1294,7 +1293,7 @@ R_EntityParticles_ID (const entity_t *ent)
|
|||
porg[2] = ent->origin[2] + vertex_normals[i][2] * dist +
|
||||
forward[2] * beamlength;
|
||||
particle_new (pt_explode, part_tex_dot, porg, 1.0, vec3_origin,
|
||||
r_realtime + 0.01, 0x6f, 1.0, 0);
|
||||
vr_data.realtime + 0.01, 0x6f, 1.0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1322,7 +1321,7 @@ R_RocketTrail_ID (const entity_t *ent)
|
|||
ramp = rnd & 3;
|
||||
|
||||
particle_new (pt_fire, part_tex_dot, org, 1.0, vec3_origin,
|
||||
r_realtime + 2.0, ramp3[ramp], 1.0, ramp);
|
||||
vr_data.realtime + 2.0, ramp3[ramp], 1.0, ramp);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -1354,7 +1353,7 @@ R_GrenadeTrail_ID (const entity_t *ent)
|
|||
ramp = (rnd & 3) + 2;
|
||||
|
||||
particle_new (pt_fire, part_tex_dot, org, 1.0, vec3_origin,
|
||||
r_realtime + 2.0, ramp3[ramp], 1.0, ramp);
|
||||
vr_data.realtime + 2.0, ramp3[ramp], 1.0, ramp);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -1385,7 +1384,7 @@ R_BloodTrail_ID (const entity_t *ent)
|
|||
porg[2] = old_origin[2] + ((rnd >> 6) & 7) * (5.0/7.0) - 2.5;
|
||||
|
||||
particle_new (pt_grav, part_tex_dot, porg, 1.0, vec3_origin,
|
||||
r_realtime + 2.0, 67 + (rnd & 3), 1.0, 0.0);
|
||||
vr_data.realtime + 2.0, 67 + (rnd & 3), 1.0, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -1416,7 +1415,7 @@ R_SlightBloodTrail_ID (const entity_t *ent)
|
|||
porg[2] = old_origin[2] + ((rnd >> 6) & 7) * (5.0/7.0) - 2.5;
|
||||
|
||||
particle_new (pt_grav, part_tex_dot, porg, 1.0, vec3_origin,
|
||||
r_realtime + 1.5, 67 + (rnd & 3), 1.0, 0.0);
|
||||
vr_data.realtime + 1.5, 67 + (rnd & 3), 1.0, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -1452,8 +1451,8 @@ R_WizTrail_ID (const entity_t *ent)
|
|||
pvel[2] = 0.0;
|
||||
|
||||
particle_new (pt_static, part_tex_dot, old_origin, 1.0, pvel,
|
||||
r_realtime + 0.5, 52 + ((tracercount & 4) << 1), 1.0,
|
||||
0.0);
|
||||
vr_data.realtime + 0.5, 52 + ((tracercount & 4) << 1),
|
||||
1.0, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -1489,8 +1488,8 @@ R_FlameTrail_ID (const entity_t *ent)
|
|||
pvel[2] = 0.0;
|
||||
|
||||
particle_new (pt_static, part_tex_dot, old_origin, 1.0, pvel,
|
||||
r_realtime + 0.5, 230 + ((tracercount & 4) << 1), 1.0,
|
||||
0.0);
|
||||
vr_data.realtime + 0.5, 230 + ((tracercount & 4) << 1),
|
||||
1.0, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -1521,7 +1520,8 @@ R_VoorTrail_ID (const entity_t *ent)
|
|||
porg[2] = old_origin[2] + ((rnd >> 11) & 15) - 7.5;
|
||||
|
||||
particle_new (pt_static, part_tex_dot, porg, 1.0, vec3_origin,
|
||||
r_realtime + 0.3, 9 * 16 + 8 + (rnd & 3), 1.0, 0.0);
|
||||
vr_data.realtime + 0.3, 9 * 16 + 8 + (rnd & 3),
|
||||
1.0, 0.0);
|
||||
if (numparticles >= r_maxparticles)
|
||||
break;
|
||||
len += dist;
|
||||
|
@ -1640,7 +1640,7 @@ draw_qf_particles (void)
|
|||
|
||||
// LordHavoc: immediate removal of unnecessary particles (must be done
|
||||
// to ensure compactor below operates properly in all cases)
|
||||
if (part->die < r_realtime) {
|
||||
if (part->die < vr_data.realtime) {
|
||||
freeparticles[j++] = part;
|
||||
} else {
|
||||
maxparticle = k;
|
||||
|
@ -1662,7 +1662,7 @@ draw_qf_particles (void)
|
|||
while (maxparticle >= activeparticles) {
|
||||
*freeparticles[k++] = particles[maxparticle--];
|
||||
while (maxparticle >= activeparticles &&
|
||||
particles[maxparticle].die <= r_realtime)
|
||||
particles[maxparticle].die <= vr_data.realtime)
|
||||
maxparticle--;
|
||||
}
|
||||
numparticles = activeparticles;
|
||||
|
@ -1728,7 +1728,7 @@ draw_id_particles (void)
|
|||
|
||||
// LordHavoc: immediate removal of unnecessary particles (must be done
|
||||
// to ensure compactor below operates properly in all cases)
|
||||
if (part->die < r_realtime) {
|
||||
if (part->die < vr_data.realtime) {
|
||||
freeparticles[j++] = part;
|
||||
} else {
|
||||
maxparticle = k;
|
||||
|
@ -1747,7 +1747,7 @@ draw_id_particles (void)
|
|||
while (maxparticle >= activeparticles) {
|
||||
*freeparticles[k++] = particles[maxparticle--];
|
||||
while (maxparticle >= activeparticles &&
|
||||
particles[maxparticle].die <= r_realtime)
|
||||
particles[maxparticle].die <= vr_data.realtime)
|
||||
maxparticle--;
|
||||
}
|
||||
numparticles = activeparticles;
|
||||
|
@ -1771,26 +1771,125 @@ R_DrawParticles (void)
|
|||
}
|
||||
}
|
||||
|
||||
static vid_particle_funcs_t particles_QF = {
|
||||
R_RocketTrail_QF,
|
||||
R_GrenadeTrail_QF,
|
||||
R_BloodTrail_QF,
|
||||
R_SlightBloodTrail_QF,
|
||||
R_WizTrail_QF,
|
||||
R_FlameTrail_QF,
|
||||
R_VoorTrail_QF,
|
||||
R_GlowTrail_QF,
|
||||
R_RunParticleEffect_QF,
|
||||
R_BloodPuffEffect_QF,
|
||||
R_GunshotEffect_QF,
|
||||
R_LightningBloodEffect_QF,
|
||||
R_SpikeEffect_QF,
|
||||
R_KnightSpikeEffect_QF,
|
||||
R_SuperSpikeEffect_QF,
|
||||
R_WizSpikeEffect_QF,
|
||||
R_BlobExplosion_QF,
|
||||
R_ParticleExplosion_QF,
|
||||
R_ParticleExplosion2_QF,
|
||||
R_LavaSplash_QF,
|
||||
R_TeleportSplash_QF,
|
||||
R_DarkFieldParticles_ID,
|
||||
R_EntityParticles_ID,
|
||||
};
|
||||
|
||||
static vid_particle_funcs_t particles_ID = {
|
||||
R_RocketTrail_ID,
|
||||
R_GrenadeTrail_ID,
|
||||
R_BloodTrail_ID,
|
||||
R_SlightBloodTrail_ID,
|
||||
R_WizTrail_ID,
|
||||
R_FlameTrail_ID,
|
||||
R_VoorTrail_ID,
|
||||
R_GlowTrail_QF,
|
||||
R_RunParticleEffect_ID,
|
||||
R_BloodPuffEffect_ID,
|
||||
R_GunshotEffect_ID,
|
||||
R_LightningBloodEffect_ID,
|
||||
R_SpikeEffect_ID,
|
||||
R_KnightSpikeEffect_ID,
|
||||
R_SuperSpikeEffect_ID,
|
||||
R_WizSpikeEffect_ID,
|
||||
R_BlobExplosion_ID,
|
||||
R_ParticleExplosion_ID,
|
||||
R_ParticleExplosion2_QF,
|
||||
R_LavaSplash_ID,
|
||||
R_TeleportSplash_ID,
|
||||
R_DarkFieldParticles_ID,
|
||||
R_EntityParticles_ID,
|
||||
};
|
||||
|
||||
static vid_particle_funcs_t particles_QF_egg = {
|
||||
R_RocketTrail_EE,
|
||||
R_GrenadeTrail_EE,
|
||||
R_BloodTrail_QF,
|
||||
R_SlightBloodTrail_QF,
|
||||
R_WizTrail_QF,
|
||||
R_FlameTrail_QF,
|
||||
R_VoorTrail_QF,
|
||||
R_GlowTrail_QF,
|
||||
R_RunParticleEffect_QF,
|
||||
R_BloodPuffEffect_QF,
|
||||
R_GunshotEffect_QF,
|
||||
R_LightningBloodEffect_QF,
|
||||
R_SpikeEffect_QF,
|
||||
R_KnightSpikeEffect_QF,
|
||||
R_SuperSpikeEffect_QF,
|
||||
R_WizSpikeEffect_QF,
|
||||
R_BlobExplosion_QF,
|
||||
R_ParticleExplosion_EE,
|
||||
R_ParticleExplosion2_QF,
|
||||
R_LavaSplash_QF,
|
||||
R_TeleportSplash_EE,
|
||||
R_DarkFieldParticles_ID,
|
||||
R_EntityParticles_ID,
|
||||
};
|
||||
|
||||
static vid_particle_funcs_t particles_ID_egg = {
|
||||
R_RocketTrail_EE,
|
||||
R_GrenadeTrail_EE,
|
||||
R_BloodTrail_ID,
|
||||
R_SlightBloodTrail_ID,
|
||||
R_WizTrail_ID,
|
||||
R_FlameTrail_ID,
|
||||
R_VoorTrail_ID,
|
||||
R_GlowTrail_QF,
|
||||
R_RunParticleEffect_ID,
|
||||
R_BloodPuffEffect_ID,
|
||||
R_GunshotEffect_ID,
|
||||
R_LightningBloodEffect_ID,
|
||||
R_SpikeEffect_ID,
|
||||
R_KnightSpikeEffect_ID,
|
||||
R_SuperSpikeEffect_ID,
|
||||
R_WizSpikeEffect_ID,
|
||||
R_BlobExplosion_ID,
|
||||
R_ParticleExplosion_EE,
|
||||
R_ParticleExplosion2_QF,
|
||||
R_LavaSplash_ID,
|
||||
R_TeleportSplash_EE,
|
||||
R_DarkFieldParticles_ID,
|
||||
R_EntityParticles_ID,
|
||||
};
|
||||
|
||||
void
|
||||
r_easter_eggs_f (cvar_t *var)
|
||||
{
|
||||
if (easter_eggs) {
|
||||
if (easter_eggs->int_val) {
|
||||
R_ParticleExplosion = R_ParticleExplosion_EE;
|
||||
R_TeleportSplash = R_TeleportSplash_EE;
|
||||
R_RocketTrail = R_RocketTrail_EE;
|
||||
R_GrenadeTrail = R_GrenadeTrail_EE;
|
||||
if (r_particles_style->int_val) {
|
||||
vr_funcs.particles = &particles_QF_egg;
|
||||
} else {
|
||||
vr_funcs.particles = &particles_ID_egg;
|
||||
}
|
||||
} else if (r_particles_style) {
|
||||
if (r_particles_style->int_val) {
|
||||
R_ParticleExplosion = R_ParticleExplosion_QF;
|
||||
R_TeleportSplash = R_TeleportSplash_QF;
|
||||
R_RocketTrail = R_RocketTrail_QF;
|
||||
R_GrenadeTrail = R_GrenadeTrail_QF;
|
||||
vr_funcs.particles = &particles_QF;
|
||||
} else {
|
||||
R_ParticleExplosion = R_ParticleExplosion_ID;
|
||||
R_TeleportSplash = R_TeleportSplash_ID;
|
||||
R_RocketTrail = R_RocketTrail_ID;
|
||||
R_GrenadeTrail = R_GrenadeTrail_ID;
|
||||
vr_funcs.particles = &particles_ID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1799,53 +1898,6 @@ r_easter_eggs_f (cvar_t *var)
|
|||
void
|
||||
r_particles_style_f (cvar_t *var)
|
||||
{
|
||||
if (r_particles_style) {
|
||||
if (r_particles_style->int_val) {
|
||||
R_BlobExplosion = R_BlobExplosion_QF;
|
||||
R_LavaSplash = R_LavaSplash_QF;
|
||||
|
||||
R_BloodPuffEffect = R_BloodPuffEffect_QF;
|
||||
R_GunshotEffect = R_GunshotEffect_QF;
|
||||
R_LightningBloodEffect = R_LightningBloodEffect_QF;
|
||||
|
||||
R_RunParticleEffect = R_RunParticleEffect_QF;
|
||||
R_SpikeEffect = R_SpikeEffect_QF;
|
||||
R_SuperSpikeEffect = R_SuperSpikeEffect_QF;
|
||||
R_KnightSpikeEffect = R_KnightSpikeEffect_QF;
|
||||
R_WizSpikeEffect = R_WizSpikeEffect_QF;
|
||||
|
||||
R_BloodTrail = R_BloodTrail_QF;
|
||||
R_SlightBloodTrail = R_SlightBloodTrail_QF;
|
||||
R_WizTrail = R_WizTrail_QF;
|
||||
R_FlameTrail = R_FlameTrail_QF;
|
||||
R_VoorTrail = R_VoorTrail_QF;
|
||||
} else {
|
||||
R_BlobExplosion = R_BlobExplosion_ID;
|
||||
R_LavaSplash = R_LavaSplash_ID;
|
||||
|
||||
R_BloodPuffEffect = R_BloodPuffEffect_ID;
|
||||
R_GunshotEffect = R_GunshotEffect_ID;
|
||||
R_LightningBloodEffect = R_LightningBloodEffect_ID;
|
||||
|
||||
R_RunParticleEffect = R_RunParticleEffect_ID;
|
||||
R_SpikeEffect = R_SpikeEffect_ID;
|
||||
R_SuperSpikeEffect = R_SuperSpikeEffect_ID;
|
||||
R_KnightSpikeEffect = R_KnightSpikeEffect_ID;
|
||||
R_WizSpikeEffect = R_WizSpikeEffect_ID;
|
||||
|
||||
R_BloodTrail = R_BloodTrail_ID;
|
||||
R_SlightBloodTrail = R_SlightBloodTrail_ID;
|
||||
R_WizTrail = R_WizTrail_ID;
|
||||
R_FlameTrail = R_FlameTrail_ID;
|
||||
R_VoorTrail = R_VoorTrail_ID;
|
||||
}
|
||||
}
|
||||
R_DarkFieldParticles = R_DarkFieldParticles_ID;
|
||||
R_EntityParticles = R_EntityParticles_ID;
|
||||
R_ParticleExplosion2 = R_ParticleExplosion2_QF;
|
||||
R_GlowTrail = R_GlowTrail_QF;
|
||||
// Handle R_GrenadeTrail, R_RocketTrail, R_ParticleExplosion,
|
||||
// R_TeleportSplash
|
||||
r_easter_eggs_f (easter_eggs);
|
||||
}
|
||||
|
||||
|
|
|
@ -58,10 +58,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
#include "QF/GLSL/qf_vid.h"
|
||||
|
||||
#include "gl_draw.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_dynamic.h"
|
||||
#include "r_screen.h"
|
||||
#include "r_shared.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
/* Unknown renamed to GLErr_Unknown to solve conflict with winioctl.h */
|
||||
unsigned int GLErr_InvalidEnum;
|
||||
|
@ -135,11 +132,11 @@ SCR_TileClear (void)
|
|||
{
|
||||
if (r_refdef.vrect.x > 0) {
|
||||
// left
|
||||
Draw_TileClear (0, 0, r_refdef.vrect.x, vid.height - r_lineadj);
|
||||
Draw_TileClear (0, 0, r_refdef.vrect.x, vid.height - vr_data.lineadj);
|
||||
// right
|
||||
Draw_TileClear (r_refdef.vrect.x + r_refdef.vrect.width, 0,
|
||||
vid.width - r_refdef.vrect.x + r_refdef.vrect.width,
|
||||
vid.height - r_lineadj);
|
||||
vid.height - vr_data.lineadj);
|
||||
}
|
||||
if (r_refdef.vrect.y > 0) {
|
||||
// top
|
||||
|
@ -150,7 +147,7 @@ SCR_TileClear (void)
|
|||
Draw_TileClear (r_refdef.vrect.x,
|
||||
r_refdef.vrect.y + r_refdef.vrect.height,
|
||||
r_refdef.vrect.width,
|
||||
vid.height - r_lineadj -
|
||||
vid.height - vr_data.lineadj -
|
||||
(r_refdef.vrect.height + r_refdef.vrect.y));
|
||||
}
|
||||
}
|
||||
|
@ -169,7 +166,7 @@ SCR_UpdateScreen (double realtime, SCR_Func scr_3dfunc, SCR_Func *scr_funcs)
|
|||
GL_EndRendering ();
|
||||
}
|
||||
|
||||
r_realtime = realtime;
|
||||
vr_data.realtime = realtime;
|
||||
vid.numpages = 2 + gl_triplebuffer->int_val;
|
||||
|
||||
if (!scr_initialized)
|
||||
|
|
|
@ -52,7 +52,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
#include "QF/GLSL/qf_textures.h"
|
||||
#include "QF/GLSL/qf_vid.h"
|
||||
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
static const char quakesprite_vert[] =
|
||||
#include "quakespr.vc"
|
||||
|
@ -142,7 +142,7 @@ R_GetSpriteFrames (entity_t *ent, msprite_t *sprite, mspriteframe_t **frame1,
|
|||
numframes = group->numframes;
|
||||
fullinterval = intervals[numframes - 1];
|
||||
|
||||
time = r_realtime + currententity->syncbase;
|
||||
time = vr_data.realtime + currententity->syncbase;
|
||||
targettime = time - ((int) (time / fullinterval)) * fullinterval;
|
||||
|
||||
for (i = 0; i < numframes - 1; i++) {
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
||||
|
||||
|
@ -65,7 +65,7 @@ R_AliasGetSkindesc (int skinnum, aliashdr_t *ahdr)
|
|||
numskins = paliasskingroup->numskins;
|
||||
fullskininterval = pskinintervals[numskins - 1];
|
||||
|
||||
skintime = r_realtime + currententity->syncbase;
|
||||
skintime = vr_data.realtime + currententity->syncbase;
|
||||
|
||||
// when loading in Mod_LoadAliasSkinGroup, we guaranteed all interval
|
||||
// values are positive, so we don't have to worry about division by 0
|
||||
|
@ -120,7 +120,7 @@ alias_get_frame (int framenum, aliashdr_t *hdr, float *frame_interval)
|
|||
numframes = group->numframes;
|
||||
fullinterval = intervals[numframes - 1];
|
||||
|
||||
time = r_realtime + currententity->syncbase;
|
||||
time = vr_data.realtime + currententity->syncbase;
|
||||
|
||||
// when loading in Mod_LoadAliasGroup, we guaranteed all interval values
|
||||
// are positive, so we don't have to worry about division by 0
|
||||
|
|
|
@ -40,9 +40,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
#include "QF/cvar.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "r_cvar.h"
|
||||
#include "r_local.h"
|
||||
#include "r_shared.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
mvertex_t *r_pcurrentvertbase;
|
||||
mleaf_t *r_viewleaf;
|
||||
|
@ -115,7 +113,7 @@ R_TextureAnimation (msurface_t *surf)
|
|||
if (!base->anim_total)
|
||||
return base;
|
||||
|
||||
relative = (int) (r_realtime * 10) % base->anim_total;
|
||||
relative = (int) (vr_data.realtime * 10) % base->anim_total;
|
||||
|
||||
count = 0;
|
||||
while (base->anim_min > relative || base->anim_max <= relative) {
|
||||
|
|
|
@ -42,8 +42,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/render.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_dynamic.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
cvar_t *easter_eggs;
|
||||
|
||||
|
@ -125,21 +124,17 @@ cvar_t *r_waterripple;
|
|||
cvar_t *r_waterwarp;
|
||||
cvar_t *r_zgraph;
|
||||
|
||||
cvar_t *scr_centertime;
|
||||
cvar_t *scr_fov;
|
||||
cvar_t *scr_fisheye;
|
||||
cvar_t *scr_fviews;
|
||||
cvar_t *scr_ffov;
|
||||
cvar_t *scr_printspeed;
|
||||
cvar_t *scr_showpause;
|
||||
cvar_t *scr_showram;
|
||||
cvar_t *scr_showturtle;
|
||||
cvar_t *scr_viewsize;
|
||||
|
||||
void (*r_viewsize_callback)(cvar_t *var);
|
||||
int r_viewsize;
|
||||
|
||||
float cl_wateralpha;
|
||||
quat_t crosshair_color;
|
||||
|
||||
static void
|
||||
|
@ -230,8 +225,8 @@ viewsize_f (cvar_t *var)
|
|||
} else {
|
||||
vid.recalc_refdef = true;
|
||||
r_viewsize = bound (0, var->int_val, 100);
|
||||
if (r_viewsize_callback)
|
||||
r_viewsize_callback (var);
|
||||
if (vr_data.viewsize_callback)
|
||||
vr_data.viewsize_callback (var);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -428,8 +423,6 @@ R_Init_Cvars (void)
|
|||
r_zgraph = Cvar_Get ("r_zgraph", "0", CVAR_NONE, NULL,
|
||||
"Toggle the graph that reports the changes of "
|
||||
"z-axis position");
|
||||
scr_centertime = Cvar_Get ("scr_centertime", "2", CVAR_NONE, NULL, "How "
|
||||
"long in seconds screen hints are displayed");
|
||||
scr_fov = Cvar_Get ("fov", "90", CVAR_NONE, NULL, "Your field of view in "
|
||||
"degrees. Smaller than 90 zooms in. Don't touch in "
|
||||
"fisheye mode, use ffov instead.");
|
||||
|
@ -439,9 +432,6 @@ R_Init_Cvars (void)
|
|||
"fisheye views.");
|
||||
scr_ffov = Cvar_Get ("ffov", "180", CVAR_NONE, scr_ffov_f, "Your field of "
|
||||
"view in degrees in fisheye mode.");
|
||||
scr_printspeed = Cvar_Get ("scr_printspeed", "8", CVAR_NONE, NULL,
|
||||
"How fast the text is displayed at the end of "
|
||||
"the single player episodes");
|
||||
scr_showpause = Cvar_Get ("showpause", "1", CVAR_NONE, NULL,
|
||||
"Toggles display of pause graphic");
|
||||
scr_showram = Cvar_Get ("showram", "1", CVAR_NONE, NULL,
|
||||
|
|
|
@ -43,7 +43,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
#include "QF/qtypes.h"
|
||||
|
||||
#include "noisetextures.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
tex_t *
|
||||
R_DotParticleTexture (void)
|
||||
|
|
|
@ -36,7 +36,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/render.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
static mnode_t *r_pefragtopnode;
|
||||
static vec3_t r_emins, r_emaxs;
|
||||
|
|
|
@ -47,9 +47,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/sound.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "r_dynamic.h"
|
||||
#include "r_local.h"
|
||||
#include "r_shared.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
#define ENT_POOL_SIZE 32
|
||||
|
||||
|
@ -128,7 +126,7 @@ R_EntityBlend (entity_t *ent, int pose, float interval)
|
|||
|
||||
ent->frame_interval = interval;
|
||||
if (ent->pose2 != pose) {
|
||||
ent->frame_start_time = r_realtime;
|
||||
ent->frame_start_time = vr_data.realtime;
|
||||
if (ent->pose2 == -1) {
|
||||
ent->pose1 = pose;
|
||||
} else {
|
||||
|
@ -136,10 +134,11 @@ R_EntityBlend (entity_t *ent, int pose, float interval)
|
|||
}
|
||||
ent->pose2 = pose;
|
||||
blend = 0.0;
|
||||
} else if (r_paused) {
|
||||
} else if (vr_data.paused) {
|
||||
blend = 1.0;
|
||||
} else {
|
||||
blend = (r_realtime - ent->frame_start_time) / ent->frame_interval;
|
||||
blend = (vr_data.realtime - ent->frame_start_time)
|
||||
/ ent->frame_interval;
|
||||
blend = min (blend, 1.0);
|
||||
}
|
||||
return blend;
|
||||
|
|
|
@ -33,10 +33,10 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "QF/draw.h"
|
||||
#include "QF/render.h"
|
||||
#include "QF/plugin.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "r_local.h"
|
||||
#include "sbar.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
|
||||
#define MAX_TIMINGS 100
|
||||
|
|
78
libs/video/renderer/r_init.c
Normal file
78
libs/video/renderer/r_init.c
Normal file
|
@ -0,0 +1,78 @@
|
|||
/*
|
||||
#FILENAME#
|
||||
|
||||
#DESCRIPTION#
|
||||
|
||||
Copyright (C) 2001 #AUTHOR#
|
||||
|
||||
Author: #AUTHOR#
|
||||
Date: #DATE#
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to:
|
||||
|
||||
Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA
|
||||
|
||||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include "QF/cvar.h"
|
||||
#include "QF/qtypes.h"
|
||||
#include "QF/render.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "r_internal.h"
|
||||
|
||||
cvar_t *vidrend_plugin;
|
||||
plugin_t *vidrendmodule = NULL;
|
||||
|
||||
VID_RENDER_PLUGIN_PROTOS
|
||||
static plugin_list_t vidrend_plugin_list[] = {
|
||||
VID_RENDER_PLUGIN_LIST
|
||||
};
|
||||
|
||||
vid_render_data_t *r_data;
|
||||
vid_render_funcs_t *r_funcs;
|
||||
|
||||
#define U __attribute__ ((used))
|
||||
static U void (*const r_progs_init)(struct progs_s *) = R_Progs_Init;
|
||||
#undef U
|
||||
|
||||
VISIBLE void
|
||||
R_Init (void)
|
||||
{
|
||||
PI_RegisterPlugins (vidrend_plugin_list);
|
||||
vidrend_plugin = Cvar_Get ("vid_render", VID_RENDER_DEFAULT, CVAR_ROM, 0,
|
||||
"Video Render Plugin to use");
|
||||
vidrendmodule = PI_LoadPlugin ("vid_render", vidrend_plugin->string);
|
||||
if (!vidrendmodule) {
|
||||
Sys_Error ("Loading of video render module: %s failed!\n",
|
||||
vidrend_plugin->string);
|
||||
}
|
||||
r_funcs = vidrendmodule->functions->vid_render;
|
||||
r_data = vidrendmodule->data->vid_render;
|
||||
}
|
|
@ -45,13 +45,9 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/render.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_dynamic.h"
|
||||
#include "r_local.h"
|
||||
#include "r_shared.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
dlight_t *r_dlights;
|
||||
lightstyle_t r_lightstyle[MAX_LIGHTSTYLES];
|
||||
vec3_t ambientcolor;
|
||||
|
||||
unsigned int r_maxdlights;
|
||||
|
@ -80,14 +76,14 @@ R_AnimateLight (void)
|
|||
|
||||
// light animations
|
||||
// 'm' is normal light, 'a' is no light, 'z' is double bright
|
||||
i = (int) (r_realtime * 10);
|
||||
i = (int) (vr_data.realtime * 10);
|
||||
for (j = 0; j < MAX_LIGHTSTYLES; j++) {
|
||||
if (!r_lightstyle[j].length) {
|
||||
if (!vr_data.lightstyle[j].length) {
|
||||
d_lightstylevalue[j] = 256;
|
||||
continue;
|
||||
}
|
||||
k = i % r_lightstyle[j].length;
|
||||
k = r_lightstyle[j].map[k] - 'a';
|
||||
k = i % vr_data.lightstyle[j].length;
|
||||
k = vr_data.lightstyle[j].map[k] - 'a';
|
||||
k = k * 22;
|
||||
d_lightstylevalue[j] = k;
|
||||
}
|
||||
|
@ -267,7 +263,7 @@ R_PushDlights (const vec3_t entorigin)
|
|||
l = r_dlights;
|
||||
|
||||
for (i = 0; i < r_maxdlights; i++, l++) {
|
||||
if (l->die < r_realtime || !l->radius)
|
||||
if (l->die < vr_data.realtime || !l->radius)
|
||||
continue;
|
||||
VectorSubtract (l->origin, entorigin, lightorigin);
|
||||
R_MarkLights (lightorigin, l, 1 << i, r_worldentity.model);
|
||||
|
@ -466,7 +462,7 @@ R_AllocDlight (int key)
|
|||
// then look for anything else
|
||||
dl = r_dlights;
|
||||
for (i = 0; i < r_maxdlights; i++, dl++) {
|
||||
if (dl->die < r_realtime) {
|
||||
if (dl->die < vr_data.realtime) {
|
||||
memset (dl, 0, sizeof (*dl));
|
||||
dl->key = key;
|
||||
dl->color[0] = dl->color[1] = dl->color[2] = 1;
|
||||
|
@ -488,7 +484,7 @@ R_DecayLights (double frametime)
|
|||
|
||||
dl = r_dlights;
|
||||
for (i = 0; i < r_maxdlights; i++, dl++) {
|
||||
if (dl->die < r_realtime || !dl->radius)
|
||||
if (dl->die < vr_data.realtime || !dl->radius)
|
||||
continue;
|
||||
|
||||
dl->radius -= frametime * dl->decay;
|
||||
|
|
|
@ -31,8 +31,7 @@
|
|||
# include "config.h"
|
||||
#endif
|
||||
|
||||
static __attribute__ ((used)) const char rcsid[] =
|
||||
"$Id$";
|
||||
static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
|
@ -44,8 +43,9 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/cvar.h"
|
||||
#include "QF/qtypes.h"
|
||||
#include "QF/render.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "r_cvar.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
qboolean r_inhibit_viewmodel;
|
||||
qboolean r_force_fullscreen;
|
||||
|
@ -85,9 +85,5 @@ VISIBLE refdef_t r_refdef;
|
|||
|
||||
int d_lightstylevalue[256]; // 8.8 fraction of base light value
|
||||
|
||||
#define U __attribute__ ((used))
|
||||
static U void (*const r_progs_init)(struct progs_s *) = R_Progs_Init;
|
||||
#undef U
|
||||
|
||||
byte color_white[4] = { 255, 255, 255, 0 }; // alpha will be explicitly set
|
||||
byte color_black[4] = { 0, 0, 0, 0 }; // alpha will be explicitly set
|
||||
|
|
|
@ -37,38 +37,11 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/sys.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "r_dynamic.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
unsigned int r_maxparticles, numparticles;
|
||||
particle_t *active_particles, *free_particles, *particles, **freeparticles;
|
||||
vec3_t r_pright, r_pup, r_ppn;
|
||||
float r_gravity;
|
||||
|
||||
void (*R_RocketTrail) (const struct entity_s *ent);
|
||||
void (*R_GrenadeTrail) (const struct entity_s *ent);
|
||||
void (*R_BloodTrail) (const struct entity_s *ent);
|
||||
void (*R_SlightBloodTrail) (const struct entity_s *ent);
|
||||
void (*R_WizTrail) (const struct entity_s *ent);
|
||||
void (*R_FlameTrail) (const struct entity_s *ent);
|
||||
void (*R_VoorTrail) (const struct entity_s *ent);
|
||||
void (*R_GlowTrail) (const struct entity_s *ent, int glow_color);
|
||||
void (*R_RunParticleEffect) (const vec3_t org, const vec3_t dir, int color, int count);
|
||||
void (*R_BloodPuffEffect) (const vec3_t org, int count);
|
||||
void (*R_GunshotEffect) (const vec3_t org, int count);
|
||||
void (*R_LightningBloodEffect) (const vec3_t org);
|
||||
void (*R_SpikeEffect) (const vec3_t org);
|
||||
void (*R_KnightSpikeEffect) (const vec3_t org);
|
||||
void (*R_SuperSpikeEffect) (const vec3_t org);
|
||||
void (*R_WizSpikeEffect) (const vec3_t org);
|
||||
void (*R_BlobExplosion) (const vec3_t org);
|
||||
void (*R_ParticleExplosion) (const vec3_t org);
|
||||
void (*R_ParticleExplosion2) (const vec3_t org, int colorStart, int colorLength);
|
||||
void (*R_LavaSplash) (const vec3_t org);
|
||||
void (*R_TeleportSplash) (const vec3_t org);
|
||||
void (*R_DarkFieldParticles) (const struct entity_s *ent);
|
||||
void (*R_EntityParticles) (const struct entity_s *ent);
|
||||
|
||||
|
||||
/*
|
||||
R_MaxParticlesCheck
|
||||
|
@ -123,19 +96,19 @@ static int ramp3[8] = { 0x6d, 0x6b, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01 };
|
|||
static inline float
|
||||
grav (void)
|
||||
{
|
||||
return r_frametime * r_gravity * 0.05;
|
||||
return vr_data.frametime * vr_data.gravity * 0.05;
|
||||
}
|
||||
|
||||
static inline float
|
||||
fast_grav (void)
|
||||
{
|
||||
return r_frametime * r_gravity;
|
||||
return vr_data.frametime * vr_data.gravity;
|
||||
}
|
||||
|
||||
static inline void
|
||||
add_vel (particle_t *part)
|
||||
{
|
||||
VectorMultAdd (part->org, r_frametime, part->vel, part->org);
|
||||
VectorMultAdd (part->org, vr_data.frametime, part->vel, part->org);
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
@ -159,7 +132,7 @@ add_fastgrav (particle_t *part)
|
|||
static inline qboolean
|
||||
add_ramp (particle_t *part, float time, int max)
|
||||
{
|
||||
part->ramp += r_frametime * time;
|
||||
part->ramp += vr_data.frametime * time;
|
||||
if (part->ramp >= max) {
|
||||
part->die = -1;
|
||||
return true;
|
||||
|
@ -170,7 +143,7 @@ add_ramp (particle_t *part, float time, int max)
|
|||
static inline qboolean
|
||||
fade_alpha (particle_t *part, float time)
|
||||
{
|
||||
part->alpha -= r_frametime * time;
|
||||
part->alpha -= vr_data.frametime * time;
|
||||
if (part->alpha <= 0.0) {
|
||||
part->die = -1;
|
||||
return true;
|
||||
|
@ -209,7 +182,7 @@ part_phys_explode (particle_t *part)
|
|||
return;
|
||||
add_vel (part);
|
||||
part->color = ramp1[(int) part->ramp];
|
||||
VectorMultAdd (part->vel, r_frametime * 4.0, part->vel, part->vel);
|
||||
VectorMultAdd (part->vel, vr_data.frametime * 4.0, part->vel, part->vel);
|
||||
add_grav (part);
|
||||
}
|
||||
|
||||
|
@ -220,7 +193,7 @@ part_phys_explode2 (particle_t *part)
|
|||
return;
|
||||
add_vel (part);
|
||||
part->color = ramp2[(int) part->ramp];
|
||||
VectorMultAdd (part->vel, r_frametime, part->vel, part->vel);
|
||||
VectorMultAdd (part->vel, vr_data.frametime, part->vel, part->vel);
|
||||
add_grav (part);
|
||||
}
|
||||
|
||||
|
@ -228,7 +201,7 @@ static void
|
|||
part_phys_blob (particle_t *part)
|
||||
{
|
||||
add_vel (part);
|
||||
VectorMultAdd (part->vel, r_frametime * 4.0, part->vel, part->vel);
|
||||
VectorMultAdd (part->vel, vr_data.frametime * 4.0, part->vel, part->vel);
|
||||
add_grav (part);
|
||||
}
|
||||
|
||||
|
@ -236,8 +209,8 @@ static void
|
|||
part_phys_blob2 (particle_t *part)
|
||||
{
|
||||
add_vel (part);
|
||||
part->vel[0] -= part->vel[0] * r_frametime * 4.0;
|
||||
part->vel[1] -= part->vel[1] * r_frametime * 4.0;
|
||||
part->vel[0] -= part->vel[0] * vr_data.frametime * 4.0;
|
||||
part->vel[1] -= part->vel[1] * vr_data.frametime * 4.0;
|
||||
add_grav (part);
|
||||
}
|
||||
|
||||
|
@ -247,8 +220,8 @@ part_phys_smoke (particle_t *part)
|
|||
if (fade_alpha (part, 0.4))
|
||||
return;
|
||||
add_vel (part);
|
||||
part->scale += r_frametime * 4.0;
|
||||
//part->org[2] += r_frametime * 30.0;
|
||||
part->scale += vr_data.frametime * 4.0;
|
||||
//part->org[2] += vr_data.frametime * 30.0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -257,8 +230,8 @@ part_phys_smokecloud (particle_t *part)
|
|||
if (fade_alpha (part, 0.55))
|
||||
return;
|
||||
add_vel (part);
|
||||
part->scale += r_frametime * 50.0;
|
||||
part->vel[2] += r_frametime * 30.0;
|
||||
part->scale += vr_data.frametime * 50.0;
|
||||
part->vel[2] += vr_data.frametime * 30.0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -267,7 +240,7 @@ part_phys_bloodcloud (particle_t *part)
|
|||
if (fade_alpha (part, 0.25))
|
||||
return;
|
||||
add_vel (part);
|
||||
part->scale += r_frametime * 4.0;
|
||||
part->scale += vr_data.frametime * 4.0;
|
||||
add_grav (part);
|
||||
}
|
||||
|
||||
|
@ -298,7 +271,7 @@ part_phys_flame (particle_t *part)
|
|||
if (fade_alpha (part, 0.125))
|
||||
return;
|
||||
add_vel (part);
|
||||
part->scale -= r_frametime * 2.0;
|
||||
part->scale -= vr_data.frametime * 2.0;
|
||||
}
|
||||
|
||||
static pt_phys_func part_phys[] = {
|
||||
|
|
|
@ -45,6 +45,8 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/render.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "r_internal.h"
|
||||
|
||||
typedef struct {
|
||||
pr_int_t width;
|
||||
pr_int_t height;
|
||||
|
@ -76,9 +78,9 @@ static void
|
|||
bi_draw_free_qpic (qpic_res_t *qp)
|
||||
{
|
||||
if (qp->cached)
|
||||
Draw_UncachePic (qp->name);
|
||||
r_funcs->Draw_UncachePic (qp->name);
|
||||
else
|
||||
Draw_DestroyPic (qp->pic);
|
||||
r_funcs->Draw_DestroyPic (qp->pic);
|
||||
if (qp->name)
|
||||
free (qp->name);
|
||||
}
|
||||
|
@ -141,7 +143,7 @@ bi_Draw_MakePic (progs_t *pr)
|
|||
qpic_res_t *qp;
|
||||
bi_qpic_t *bq;
|
||||
|
||||
pic = Draw_MakePic (width, height, data);
|
||||
pic = r_funcs->Draw_MakePic (width, height, data);
|
||||
qp = qpic_new (res);
|
||||
qp->name = 0;
|
||||
qp->pic = pic;
|
||||
|
@ -164,7 +166,7 @@ bi_Draw_CachePic (progs_t *pr)
|
|||
qpic_res_t *qp;
|
||||
bi_qpic_t *bq;
|
||||
|
||||
pic = Draw_CachePic (name, alpha);
|
||||
pic = r_funcs->Draw_CachePic (name, alpha);
|
||||
qp = Hash_Find (res->pic_hash, name);
|
||||
if (qp) {
|
||||
RETURN_POINTER (pr, qp->bq);
|
||||
|
@ -192,7 +194,7 @@ bi_Draw_Pic (progs_t *pr)
|
|||
qpic_res_t *qp = get_qpic (pr, __FUNCTION__, bq->pic_handle);
|
||||
qpic_t *pic = qp->pic;
|
||||
|
||||
Draw_Pic (x, y, pic);
|
||||
r_funcs->Draw_Pic (x, y, pic);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -204,7 +206,7 @@ bi_Draw_Picf (progs_t *pr)
|
|||
qpic_res_t *qp = get_qpic (pr, __FUNCTION__, bq->pic_handle);
|
||||
qpic_t *pic = qp->pic;
|
||||
|
||||
Draw_Picf (x, y, pic);
|
||||
r_funcs->Draw_Picf (x, y, pic);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -220,7 +222,7 @@ bi_Draw_SubPic (progs_t *pr)
|
|||
int width = P_INT (pr, 5);
|
||||
int height = P_INT (pr, 6);
|
||||
|
||||
Draw_SubPic (x, y, pic, srcx, srcy, width, height);
|
||||
r_funcs->Draw_SubPic (x, y, pic, srcx, srcy, width, height);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -232,7 +234,7 @@ bi_Draw_CenterPic (progs_t *pr)
|
|||
qpic_res_t *qp = get_qpic (pr, __FUNCTION__, bq->pic_handle);
|
||||
qpic_t *pic = qp->pic;
|
||||
|
||||
Draw_Pic (x - pic->width / 2, y, pic);
|
||||
r_funcs->Draw_Pic (x - pic->width / 2, y, pic);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -242,7 +244,7 @@ bi_Draw_Character (progs_t *pr)
|
|||
int y = P_INT (pr, 1);
|
||||
int c = P_INT (pr, 2);
|
||||
|
||||
Draw_Character (x, y, c);
|
||||
r_funcs->Draw_Character (x, y, c);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -252,7 +254,7 @@ bi_Draw_String (progs_t *pr)
|
|||
int y = P_INT (pr, 1);
|
||||
const char *text = P_GSTRING (pr, 2);
|
||||
|
||||
Draw_String (x, y, text);
|
||||
r_funcs->Draw_String (x, y, text);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -263,7 +265,7 @@ bi_Draw_nString (progs_t *pr)
|
|||
const char *text = P_GSTRING (pr, 2);
|
||||
int n = P_INT (pr, 3);
|
||||
|
||||
Draw_nString (x, y, text, n);
|
||||
r_funcs->Draw_nString (x, y, text, n);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -273,7 +275,7 @@ bi_Draw_AltString (progs_t *pr)
|
|||
int y = P_INT (pr, 1);
|
||||
const char *text = P_GSTRING (pr, 2);
|
||||
|
||||
Draw_AltString (x, y, text);
|
||||
r_funcs->Draw_AltString (x, y, text);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -291,7 +293,7 @@ bi_Draw_Fill (progs_t *pr)
|
|||
int h = P_INT (pr, 3);
|
||||
int color = P_INT (pr, 4);
|
||||
|
||||
Draw_Fill (x, y, w, h, color);
|
||||
r_funcs->Draw_Fill (x, y, w, h, color);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -301,7 +303,7 @@ bi_Draw_Crosshair (progs_t *pr)
|
|||
int x = P_INT (pr, 1);
|
||||
int y = P_INT (pr, 2);
|
||||
|
||||
Draw_CrosshairAt (ch, x, y);
|
||||
r_funcs->Draw_CrosshairAt (ch, x, y);
|
||||
}
|
||||
|
||||
static const char *
|
||||
|
|
|
@ -28,8 +28,7 @@
|
|||
# include "config.h"
|
||||
#endif
|
||||
|
||||
static __attribute__ ((used)) const char rcsid[] =
|
||||
"$Id$";
|
||||
static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
|
@ -49,9 +48,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/view.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_local.h"
|
||||
#include "r_screen.h"
|
||||
#include "r_internal.h"
|
||||
#include "sbar.h"
|
||||
|
||||
/*
|
||||
|
@ -128,7 +125,7 @@ R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
|
|||
int h;
|
||||
|
||||
// intermission is always full screen
|
||||
if (r_viewsize >= 100 || r_force_fullscreen /* FIXME: better test */) {
|
||||
if (r_viewsize >= 100 || vr_data.force_fullscreen /*FIXME: better test*/) {
|
||||
size = 100.0;
|
||||
lineadj = 0;
|
||||
} else {
|
||||
|
@ -158,6 +155,7 @@ void
|
|||
SCR_CalcRefdef (void)
|
||||
{
|
||||
vrect_t vrect;
|
||||
refdef_t *refdef = r_data->refdef;
|
||||
|
||||
// force a background redraw
|
||||
scr_fullupdate = 0;
|
||||
|
@ -171,12 +169,12 @@ SCR_CalcRefdef (void)
|
|||
vrect.width = vid.width;
|
||||
vrect.height = vid.height;
|
||||
|
||||
R_SetVrect (&vrect, &scr_vrect, r_lineadj);
|
||||
R_SetVrect (&vrect, &scr_vrect, vr_data.lineadj);
|
||||
|
||||
r_refdef.vrect = scr_vrect;
|
||||
r_refdef.fov_x = scr_fov->value;
|
||||
r_refdef.fov_y =
|
||||
CalcFov (r_refdef.fov_x, r_refdef.vrect.width, r_refdef.vrect.height);
|
||||
refdef->vrect = scr_vrect;
|
||||
refdef->fov_x = scr_fov->value;
|
||||
refdef->fov_y =
|
||||
CalcFov (refdef->fov_x, refdef->vrect.width, refdef->vrect.height);
|
||||
|
||||
// notify the refresh of the change
|
||||
R_ViewChanged (vid.aspect);
|
||||
|
@ -245,7 +243,7 @@ SCR_DrawTurtle (void)
|
|||
if (!scr_showturtle->int_val)
|
||||
return;
|
||||
|
||||
if (r_frametime < 0.1) {
|
||||
if (vr_data.frametime < 0.1) {
|
||||
count = 0;
|
||||
return;
|
||||
}
|
||||
|
@ -265,7 +263,7 @@ SCR_DrawPause (void)
|
|||
if (!scr_showpause->int_val) // turn off for screenshots
|
||||
return;
|
||||
|
||||
if (!r_paused)
|
||||
if (!vr_data.paused)
|
||||
return;
|
||||
|
||||
pic = Draw_CachePic ("gfx/pause.lmp", true);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
AUTOMAKE_OPTIONS= foreign
|
||||
|
||||
AM_CFLAGS= @PREFER_NON_PIC@
|
||||
CCASFLAGS+= @PREFER_NON_PIC@
|
||||
AM_CFLAGS= @PREFER_PIC@
|
||||
CCASFLAGS+= @PREFER_PIC@
|
||||
INCLUDES= -I$(top_srcdir)/include
|
||||
|
||||
asm = @swrend_libs@
|
||||
|
@ -17,7 +17,7 @@ asm_src= \
|
|||
sw_src= \
|
||||
d_edge.c d_fill.c d_init.c d_modech.c d_part.c d_polyse.c d_scan.c \
|
||||
d_sky.c d_sprite.c d_surf.c d_vars.c d_zpoint.c draw.c fpu.c nonintel.c \
|
||||
screen.c sw_fog.c sw_graph.c sw_raclip.c sw_ralias.c sw_rbsp.c sw_rdraw.c \
|
||||
screen.c sw_graph.c sw_raclip.c sw_ralias.c sw_rbsp.c sw_rdraw.c \
|
||||
sw_redge.c sw_rmain.c sw_rmisc.c sw_rpart.c sw_rsky.c sw_rsprite.c \
|
||||
sw_rsurf.c
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/render.h"
|
||||
|
||||
#include "d_local.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
static int miplevel;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
"$Id$";
|
||||
|
||||
#include "d_iface.h"
|
||||
|
||||
#include "r_internal.h"
|
||||
|
||||
void
|
||||
D_FillRect (vrect_t *rect, int color)
|
||||
|
|
|
@ -36,7 +36,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "compat.h"
|
||||
#include "d_local.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
#define NUM_MIPS 4
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/render.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "r_internal.h"
|
||||
#include "d_local.h"
|
||||
|
||||
int d_vrectx, d_vrecty, d_vrectright_particle, d_vrectbottom_particle;
|
||||
|
|
|
@ -32,7 +32,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
"$Id$";
|
||||
|
||||
#include "d_local.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
|
||||
#ifdef PIC
|
||||
|
|
|
@ -35,7 +35,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/render.h"
|
||||
|
||||
#include "d_local.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
int ubasestep, errorterm, erroradjustup, erroradjustdown;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/render.h"
|
||||
|
||||
#include "d_local.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
byte *r_turb_pbase;
|
||||
byte *r_turb_pdest;
|
||||
|
@ -79,7 +79,7 @@ D_WarpScreen (void)
|
|||
(int) ((float) u * wratio * w / (w + AMP2 * 2));
|
||||
}
|
||||
|
||||
turb = intsintable + ((int) (r_realtime * SPEED) & (CYCLE - 1));
|
||||
turb = intsintable + ((int) (vr_data.realtime * SPEED) & (CYCLE - 1));
|
||||
dest = ((byte*)vid.buffer) + scr_vrect.y * vid.rowbytes + scr_vrect.x;
|
||||
|
||||
for (v = 0; v < scr_vrect.height; v++, dest += vid.rowbytes) {
|
||||
|
@ -127,7 +127,7 @@ Turbulent (espan_t *pspan)
|
|||
float sdivz, tdivz, zi, z, du, dv, spancountminus1;
|
||||
float sdivz16stepu, tdivz16stepu, zi16stepu;
|
||||
|
||||
r_turb_turb = sintable + ((int) (r_realtime * SPEED) & (CYCLE - 1));
|
||||
r_turb_turb = sintable + ((int) (vr_data.realtime * SPEED) & (CYCLE - 1));
|
||||
|
||||
r_turb_sstep = 0; // keep compiler happy
|
||||
r_turb_tstep = 0; // ditto
|
||||
|
|
|
@ -34,7 +34,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/render.h"
|
||||
|
||||
#include "d_local.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
#define SKY_SPAN_SHIFT 5
|
||||
#define SKY_SPAN_MAX (1 << SKY_SPAN_SHIFT)
|
||||
|
|
|
@ -34,6 +34,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/render.h"
|
||||
|
||||
#include "d_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
static int sprite_height;
|
||||
static int minindex, maxindex;
|
||||
|
|
|
@ -39,7 +39,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "compat.h"
|
||||
#include "d_local.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
float surfscale;
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
"$Id$";
|
||||
|
||||
#include "d_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
|
||||
void
|
||||
|
|
|
@ -46,7 +46,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
#include "QF/sys.h"
|
||||
|
||||
#include "d_iface.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
typedef struct {
|
||||
vrect_t rect;
|
||||
|
|
|
@ -35,7 +35,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
"$Id$";
|
||||
|
||||
#ifndef USE_INTEL_ASM
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
void
|
||||
R_HighFPPrecision (void)
|
||||
|
|
|
@ -36,7 +36,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#endif
|
||||
|
||||
#ifndef USE_INTEL_ASM
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
int r_bmodelactive;
|
||||
|
||||
|
|
|
@ -51,9 +51,7 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
|||
#include "QF/va.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_local.h"
|
||||
#include "r_screen.h"
|
||||
#include "r_internal.h"
|
||||
#include "sbar.h"
|
||||
|
||||
/* SCREEN SHOTS */
|
||||
|
@ -200,7 +198,7 @@ SCR_UpdateScreen (double realtime, SCR_Func scr_3dfunc, SCR_Func *scr_funcs)
|
|||
if (scr_skipupdate)
|
||||
return;
|
||||
|
||||
r_realtime = realtime;
|
||||
vr_data.realtime = realtime;
|
||||
|
||||
scr_copytop = 0;
|
||||
scr_copyeverything = 0;
|
||||
|
@ -262,7 +260,7 @@ SCR_UpdateScreen (double realtime, SCR_Func scr_3dfunc, SCR_Func *scr_funcs)
|
|||
vrect.x = 0;
|
||||
vrect.y = 0;
|
||||
vrect.width = vid.width;
|
||||
vrect.height = vid.height - r_lineadj;
|
||||
vrect.height = vid.height - vr_data.lineadj;
|
||||
vrect.next = 0;
|
||||
|
||||
VID_Update (&vrect);
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1996-2001 Id Software, Inc.
|
||||
Copyright (C) 2002-2009 John Fitzgibbons and others
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
//sw_fog.c -- global and volumetric fog
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
static __attribute__ ((used)) const char rcsid[] = "$Id$";
|
||||
|
||||
#include "QF/render.h"
|
||||
|
||||
void
|
||||
Fog_Update (float density, float red, float green, float blue, float time)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Fog_ParseWorldspawn (struct plitem_s *worldspawn)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Fog_Init (void)
|
||||
{
|
||||
}
|
|
@ -35,8 +35,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/draw.h"
|
||||
#include "QF/render.h"
|
||||
|
||||
#include "r_local.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
/*
|
||||
R_LineGraph
|
||||
|
|
|
@ -34,7 +34,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/render.h"
|
||||
|
||||
#include "d_local.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
static finalvert_t fv[2][8];
|
||||
static auxvert_t av[8];
|
||||
|
|
|
@ -31,14 +31,15 @@
|
|||
static __attribute__ ((used)) const char rcsid[] =
|
||||
"$Id$";
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "QF/image.h"
|
||||
#include "QF/render.h"
|
||||
#include "QF/skin.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "d_ifacea.h"
|
||||
#include "r_local.h"
|
||||
#include "stdlib.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
#define LIGHT_MIN 5 // lowest light value we'll allow, to
|
||||
// avoid the need for inner-loop light
|
||||
|
@ -663,7 +664,7 @@ R_AliasDrawModel (alight_t *plighting)
|
|||
#endif
|
||||
}
|
||||
|
||||
if (currententity != r_view_model)
|
||||
if (currententity != vr_data.view_model)
|
||||
ziscale = (float) 0x8000 *(float) 0x10000;
|
||||
else
|
||||
ziscale = (float) 0x8000 *(float) 0x10000 *3.0;
|
||||
|
|
|
@ -36,7 +36,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/render.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
// current entity info
|
||||
qboolean insubmodel;
|
||||
|
|
|
@ -33,7 +33,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "QF/render.h"
|
||||
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
#define MAXLEFTCLIPEDGES 100
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/sound.h"
|
||||
|
||||
#include "d_ifacea.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
/*
|
||||
FIXME
|
||||
|
|
|
@ -53,9 +53,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/sys.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_dynamic.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
#ifdef PIC
|
||||
# undef USE_INTEL_ASM //XXX asm pic hack
|
||||
|
@ -125,6 +123,7 @@ R_Init (void)
|
|||
// get stack position so we can guess if we are going to overflow
|
||||
r_stack_start = (byte *) & dummy;
|
||||
|
||||
Draw_Init ();
|
||||
SCR_Init ();
|
||||
R_SetFPCW ();
|
||||
#ifdef USE_INTEL_ASM
|
||||
|
@ -386,7 +385,7 @@ R_DrawEntitiesOnList (void)
|
|||
lighting.plightvec = lightvec;
|
||||
|
||||
for (lnum = 0; lnum < r_maxdlights; lnum++) {
|
||||
if (r_dlights[lnum].die >= r_realtime) {
|
||||
if (r_dlights[lnum].die >= vr_data.realtime) {
|
||||
VectorSubtract (currententity->origin,
|
||||
r_dlights[lnum].origin, dist);
|
||||
add = r_dlights[lnum].radius - VectorLength (dist);
|
||||
|
@ -425,12 +424,12 @@ R_DrawViewModel (void)
|
|||
float minlight;
|
||||
dlight_t *dl;
|
||||
|
||||
if (r_inhibit_viewmodel
|
||||
if (vr_data.inhibit_viewmodel
|
||||
|| !r_drawviewmodel->int_val
|
||||
|| !r_drawentities->int_val)
|
||||
return;
|
||||
|
||||
currententity = r_view_model;
|
||||
currententity = vr_data.view_model;
|
||||
if (!currententity->model)
|
||||
return;
|
||||
|
||||
|
@ -454,7 +453,7 @@ R_DrawViewModel (void)
|
|||
continue;
|
||||
if (!dl->radius)
|
||||
continue;
|
||||
if (dl->die < r_realtime)
|
||||
if (dl->die < vr_data.realtime)
|
||||
continue;
|
||||
|
||||
VectorSubtract (currententity->origin, dl->origin, dist);
|
||||
|
@ -578,7 +577,7 @@ R_DrawBEntitiesOnList (void)
|
|||
vec3_t lightorigin;
|
||||
|
||||
for (k = 0; k < r_maxdlights; k++) {
|
||||
if ((r_dlights[k].die < r_realtime) ||
|
||||
if ((r_dlights[k].die < vr_data.realtime) ||
|
||||
(!r_dlights[k].radius)) continue;
|
||||
|
||||
VectorSubtract (r_dlights[k].origin,
|
||||
|
|
|
@ -38,7 +38,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/sys.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
|
||||
static void
|
||||
|
@ -281,7 +281,7 @@ R_SetupFrame (void)
|
|||
vrect.width = vid.width;
|
||||
vrect.height = vid.height;
|
||||
|
||||
R_SetVrect (&vrect, &r_refdef.vrect, r_lineadj);
|
||||
R_SetVrect (&vrect, &r_refdef.vrect, vr_data.lineadj);
|
||||
R_ViewChanged (vid.aspect);
|
||||
} else {
|
||||
w = vid.width;
|
||||
|
@ -303,7 +303,7 @@ R_SetupFrame (void)
|
|||
vrect.height = (int) h;
|
||||
|
||||
R_SetVrect (&vrect, &r_refdef.vrect,
|
||||
(int) ((float) r_lineadj *
|
||||
(int) ((float) vr_data.lineadj *
|
||||
(h / (float) vid.height)));
|
||||
R_ViewChanged (vid.aspect * (h / w) * ((float) vid.width /
|
||||
(float) vid.height));
|
||||
|
|
|
@ -47,9 +47,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/va.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_dynamic.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
static int ramp1[8] = { 0x6f, 0x6d, 0x6b, 0x69, 0x67, 0x65, 0x63, 0x61 };
|
||||
//static int ramp2[8] = { 0x6f, 0x6e, 0x6d, 0x6c, 0x6b, 0x6a, 0x68, 0x66 };
|
||||
|
@ -148,7 +146,7 @@ R_ParticleExplosion_QF (const vec3_t org)
|
|||
p->next = active_particles;
|
||||
active_particles = p;
|
||||
|
||||
p->die = r_realtime + 5;
|
||||
p->die = vr_data.realtime + 5;
|
||||
p->color = ramp1[0];
|
||||
p->ramp = rand () & 3;
|
||||
if (i & 1)
|
||||
|
@ -178,7 +176,7 @@ R_ParticleExplosion2_QF (const vec3_t org, int colorStart, int colorLength)
|
|||
p->next = active_particles;
|
||||
active_particles = p;
|
||||
|
||||
p->die = r_realtime + 0.3;
|
||||
p->die = vr_data.realtime + 0.3;
|
||||
p->color = colorStart + (colorMod % colorLength);
|
||||
colorMod++;
|
||||
|
||||
|
@ -208,7 +206,7 @@ R_BlobExplosion_QF (const vec3_t org)
|
|||
p->next = active_particles;
|
||||
active_particles = p;
|
||||
|
||||
p->die = r_realtime + 1 + (rand () & 8) * 0.05;
|
||||
p->die = vr_data.realtime + 1 + (rand () & 8) * 0.05;
|
||||
|
||||
if (i & 1) {
|
||||
p->type = pt_blob;
|
||||
|
@ -243,7 +241,7 @@ R_RunParticleEffect_QF (const vec3_t org, const vec3_t dir, int color,
|
|||
p->next = active_particles;
|
||||
active_particles = p;
|
||||
|
||||
p->die = r_realtime + 0.1 * (rand () % 5);
|
||||
p->die = vr_data.realtime + 0.1 * (rand () % 5);
|
||||
p->color = (color & ~7) + (rand () & 7);
|
||||
p->type = pt_grav;
|
||||
p->phys = R_ParticlePhysics (p->type);
|
||||
|
@ -263,7 +261,7 @@ R_SpikeEffect_QF (const vec3_t org)
|
|||
static void
|
||||
R_SuperSpikeEffect_QF (const vec3_t org)
|
||||
{
|
||||
R_RunParticleEffect (org, vec3_origin, 0, 20);
|
||||
R_RunParticleEffect_QF (org, vec3_origin, 0, 20);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -317,7 +315,7 @@ R_LavaSplash_QF (const vec3_t org)
|
|||
p->next = active_particles;
|
||||
active_particles = p;
|
||||
|
||||
p->die = r_realtime + 2 + (rand () & 31) * 0.02;
|
||||
p->die = vr_data.realtime + 2 + (rand () & 31) * 0.02;
|
||||
p->color = 224 + (rand () & 7);
|
||||
p->type = pt_grav;
|
||||
p->phys = R_ParticlePhysics (p->type);
|
||||
|
@ -357,7 +355,7 @@ R_TeleportSplash_QF (const vec3_t org)
|
|||
p->next = active_particles;
|
||||
active_particles = p;
|
||||
|
||||
p->die = r_realtime + 0.2 + (rand () & 7) * 0.02;
|
||||
p->die = vr_data.realtime + 0.2 + (rand () & 7) * 0.02;
|
||||
p->color = 7 + (rand () & 7);
|
||||
p->type = pt_grav;
|
||||
p->phys = R_ParticlePhysics (p->type);
|
||||
|
@ -403,7 +401,7 @@ R_DarkFieldParticles_ID (const entity_t *ent)
|
|||
|
||||
rnd = rand ();
|
||||
|
||||
p->die = r_realtime + 0.2 + (rnd & 7) * 0.02;
|
||||
p->die = vr_data.realtime + 0.2 + (rnd & 7) * 0.02;
|
||||
p->color = 150 + rand () % 6;
|
||||
p->type = pt_slowgrav;
|
||||
p->phys = R_ParticlePhysics (p->type);
|
||||
|
@ -443,14 +441,14 @@ R_EntityParticles_ID (const entity_t *ent)
|
|||
}
|
||||
|
||||
for (i = 0; i < NUMVERTEXNORMALS; i++) {
|
||||
angle = r_realtime * avelocities[i][0];
|
||||
angle = vr_data.realtime * avelocities[i][0];
|
||||
cy = cos (angle);
|
||||
sy = sin (angle);
|
||||
angle = r_realtime * avelocities[i][1];
|
||||
angle = vr_data.realtime * avelocities[i][1];
|
||||
cp = cos (angle);
|
||||
sp = sin (angle);
|
||||
// Next 3 lines results aren't currently used, may be in future. --Despair
|
||||
// angle = r_realtime * avelocities[i][2];
|
||||
// angle = vr_data.realtime * avelocities[i][2];
|
||||
// sr = sin (angle);
|
||||
// cr = cos (angle);
|
||||
|
||||
|
@ -465,7 +463,7 @@ R_EntityParticles_ID (const entity_t *ent)
|
|||
p->next = active_particles;
|
||||
active_particles = p;
|
||||
|
||||
p->die = r_realtime + 0.01;
|
||||
p->die = vr_data.realtime + 0.01;
|
||||
p->color = 0x6f;
|
||||
p->type = pt_explode;
|
||||
p->phys = R_ParticlePhysics (p->type);
|
||||
|
@ -506,7 +504,7 @@ R_RocketTrail_QF (const entity_t *ent)
|
|||
|
||||
VectorZero (p->vel);
|
||||
|
||||
p->die = r_realtime + 2;
|
||||
p->die = vr_data.realtime + 2;
|
||||
p->ramp = (rand () & 3);
|
||||
p->color = ramp3[(int) p->ramp];
|
||||
p->type = pt_fire;
|
||||
|
@ -545,7 +543,7 @@ R_GrenadeTrail_QF (const entity_t *ent)
|
|||
|
||||
VectorZero (p->vel);
|
||||
|
||||
p->die = r_realtime + 2;
|
||||
p->die = vr_data.realtime + 2;
|
||||
p->ramp = (rand () & 3) + 2;
|
||||
p->color = ramp3[(int) p->ramp];
|
||||
p->type = pt_fire;
|
||||
|
@ -584,7 +582,7 @@ R_BloodTrail_QF (const entity_t *ent)
|
|||
|
||||
VectorZero (p->vel);
|
||||
|
||||
p->die = r_realtime + 2;
|
||||
p->die = vr_data.realtime + 2;
|
||||
p->type = pt_slowgrav;
|
||||
p->phys = R_ParticlePhysics (p->type);
|
||||
p->color = 67 + (rand () & 3);
|
||||
|
@ -623,7 +621,7 @@ R_SlightBloodTrail_QF (const entity_t *ent)
|
|||
|
||||
VectorZero (p->vel);
|
||||
|
||||
p->die = r_realtime + 2;
|
||||
p->die = vr_data.realtime + 2;
|
||||
p->type = pt_slowgrav;
|
||||
p->phys = R_ParticlePhysics (p->type);
|
||||
p->color = 67 + (rand () & 3);
|
||||
|
@ -660,7 +658,7 @@ R_WizTrail_QF (const entity_t *ent)
|
|||
p->next = active_particles;
|
||||
active_particles = p;
|
||||
|
||||
p->die = r_realtime + 0.5;
|
||||
p->die = vr_data.realtime + 0.5;
|
||||
p->type = pt_static;
|
||||
p->phys = R_ParticlePhysics (p->type);
|
||||
p->color = 52 + ((tracercount & 4) << 1);
|
||||
|
@ -707,7 +705,7 @@ R_FlameTrail_QF (const entity_t *ent)
|
|||
p->next = active_particles;
|
||||
active_particles = p;
|
||||
|
||||
p->die = r_realtime + 0.5;
|
||||
p->die = vr_data.realtime + 0.5;
|
||||
p->type = pt_static;
|
||||
p->phys = R_ParticlePhysics (p->type);
|
||||
p->color = 230 + ((tracercount & 4) << 1);
|
||||
|
@ -755,7 +753,7 @@ R_VoorTrail_QF (const entity_t *ent)
|
|||
|
||||
VectorZero (p->vel);
|
||||
|
||||
p->die = r_realtime + 0.3;
|
||||
p->die = vr_data.realtime + 0.3;
|
||||
p->type = pt_static;
|
||||
p->phys = R_ParticlePhysics (p->type);
|
||||
p->color = 9 * 16 + 8 + (rand () & 3);
|
||||
|
@ -776,7 +774,7 @@ R_DrawParticles (void)
|
|||
VectorCopy (vpn, r_ppn);
|
||||
|
||||
for (particle = &active_particles; *particle;) {
|
||||
if ((*particle)->die < r_realtime) {
|
||||
if ((*particle)->die < vr_data.realtime) {
|
||||
p = (*particle)->next;
|
||||
(*particle)->next = free_particles;
|
||||
free_particles = (*particle);
|
||||
|
@ -802,34 +800,36 @@ r_particles_style_f (cvar_t *var)
|
|||
{
|
||||
}
|
||||
|
||||
static vid_particle_funcs_t particles_QF = {
|
||||
R_RocketTrail_QF,
|
||||
R_GrenadeTrail_QF,
|
||||
R_BloodTrail_QF,
|
||||
R_SlightBloodTrail_QF,
|
||||
R_WizTrail_QF,
|
||||
R_FlameTrail_QF,
|
||||
R_VoorTrail_QF,
|
||||
0,//R_GlowTrail_QF,
|
||||
R_RunParticleEffect_QF,
|
||||
R_BloodPuffEffect_QF,
|
||||
R_GunshotEffect_QF,
|
||||
R_LightningBloodEffect_QF,
|
||||
R_SpikeEffect_QF,
|
||||
R_KnightSpikeEffect_QF,
|
||||
R_SuperSpikeEffect_QF,
|
||||
R_WizSpikeEffect_QF,
|
||||
R_BlobExplosion_QF,
|
||||
R_ParticleExplosion_QF,
|
||||
R_ParticleExplosion2_QF,
|
||||
R_LavaSplash_QF,
|
||||
R_TeleportSplash_QF,
|
||||
R_DarkFieldParticles_ID,
|
||||
R_EntityParticles_ID,
|
||||
};
|
||||
|
||||
static void
|
||||
R_ParticleFunctionInit (void)
|
||||
{
|
||||
R_BlobExplosion = R_BlobExplosion_QF;
|
||||
R_ParticleExplosion = R_ParticleExplosion_QF;
|
||||
R_ParticleExplosion2 = R_ParticleExplosion2_QF;
|
||||
R_LavaSplash = R_LavaSplash_QF;
|
||||
R_TeleportSplash = R_TeleportSplash_QF;
|
||||
R_DarkFieldParticles = R_DarkFieldParticles_ID;
|
||||
R_EntityParticles = R_EntityParticles_ID;
|
||||
|
||||
R_BloodPuffEffect = R_BloodPuffEffect_QF;
|
||||
R_GunshotEffect = R_GunshotEffect_QF;
|
||||
R_LightningBloodEffect = R_LightningBloodEffect_QF;
|
||||
|
||||
R_RunParticleEffect = R_RunParticleEffect_QF;
|
||||
R_SpikeEffect = R_SpikeEffect_QF;
|
||||
R_SuperSpikeEffect = R_SuperSpikeEffect_QF;
|
||||
R_KnightSpikeEffect = R_KnightSpikeEffect_QF;
|
||||
R_WizSpikeEffect = R_WizSpikeEffect_QF;
|
||||
|
||||
R_RocketTrail = R_RocketTrail_QF;
|
||||
R_GrenadeTrail = R_GrenadeTrail_QF;
|
||||
R_BloodTrail = R_BloodTrail_QF;
|
||||
R_SlightBloodTrail = R_SlightBloodTrail_QF;
|
||||
R_WizTrail = R_WizTrail_QF;
|
||||
R_FlameTrail = R_FlameTrail_QF;
|
||||
R_VoorTrail = R_VoorTrail_QF;
|
||||
vr_funcs.particles = &particles_QF;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -33,7 +33,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "QF/render.h"
|
||||
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
|
||||
static int iskyspeed = 8;
|
||||
|
@ -207,7 +207,7 @@ R_SetSkyFrame (void)
|
|||
s2 = iskyspeed2 / g;
|
||||
temp = SKYSIZE * s1 * s2;
|
||||
|
||||
skytime = r_realtime - ((int) (r_realtime / temp) * temp);
|
||||
skytime = vr_data.realtime - ((int) (vr_data.realtime / temp) * temp);
|
||||
|
||||
r_skymade = 0;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/render.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
static int clip_current;
|
||||
static vec5_t clip_verts[2][MAXWORKINGVERTS];
|
||||
|
@ -264,7 +264,7 @@ R_GetSpriteframe (msprite_t *psprite)
|
|||
numframes = pspritegroup->numframes;
|
||||
fullinterval = pintervals[numframes - 1];
|
||||
|
||||
time = r_realtime + currententity->syncbase;
|
||||
time = vr_data.realtime + currententity->syncbase;
|
||||
|
||||
// when loading in Mod_LoadSpriteGroup, we guaranteed all interval
|
||||
// values are positive, so we don't have to worry about division by 0
|
||||
|
|
|
@ -34,7 +34,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/render.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
drawsurf_t r_drawsurf;
|
||||
|
||||
|
@ -439,7 +439,7 @@ R_GenTurbTile (byte *pbasetex, void *pdest)
|
|||
int i, j, s, t;
|
||||
byte *pd;
|
||||
|
||||
turb = sintable + ((int) (r_realtime * SPEED) & (CYCLE - 1));
|
||||
turb = sintable + ((int) (vr_data.realtime * SPEED) & (CYCLE - 1));
|
||||
pd = (byte *) pdest;
|
||||
|
||||
for (i = 0; i < TILE_SIZE; i++) {
|
||||
|
|
|
@ -8,7 +8,7 @@ noinst_LTLIBRARIES= libsw32.la
|
|||
sw32_src= \
|
||||
d_edge.c d_fill.c d_init.c d_modech.c d_part.c d_polyse.c d_scan.c \
|
||||
d_sky.c d_sprite.c d_surf.c d_vars.c d_zpoint.c draw.c screen.c \
|
||||
sw32_fog.c sw32_graph.c sw32_raclip.c sw32_ralias.c sw32_rbsp.c \
|
||||
sw32_graph.c sw32_raclip.c sw32_ralias.c sw32_rbsp.c \
|
||||
sw32_rdraw.c sw32_redge.c sw32_rmain.c sw32_rmisc.c sw32_rpart.c \
|
||||
sw32_rsky.c sw32_rsprite.c sw32_rsurf.c
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/sys.h"
|
||||
|
||||
#include "d_local.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
static int miplevel;
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/sys.h"
|
||||
|
||||
#include "d_iface.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
|
||||
void
|
||||
|
|
|
@ -36,7 +36,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "compat.h"
|
||||
#include "d_local.h"
|
||||
#include "r_cvar.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
#define NUM_MIPS 4
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/render.h"
|
||||
|
||||
#include "d_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
int d_vrectx, d_vrecty, d_vrectright_particle, d_vrectbottom_particle;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/sys.h"
|
||||
|
||||
#include "d_local.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
|
||||
void
|
||||
|
|
|
@ -35,7 +35,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/sys.h"
|
||||
|
||||
#include "d_local.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
static int ubasestep, errorterm, erroradjustup, erroradjustdown;
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "compat.h"
|
||||
#include "d_local.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
static byte *r_turb_pbase;
|
||||
static void *r_turb_pdest;
|
||||
|
@ -85,7 +85,7 @@ D_WarpScreen (void)
|
|||
(int) ((float) u * wratio * w / (w + AMP2 * 2));
|
||||
}
|
||||
|
||||
turb = intsintable + ((int) (r_realtime * SPEED) & (CYCLE - 1));
|
||||
turb = intsintable + ((int) (vr_data.realtime * SPEED) & (CYCLE - 1));
|
||||
dest = (byte *)vid.buffer + scr_vrect.y * vid.rowbytes +
|
||||
scr_vrect.x;
|
||||
|
||||
|
@ -131,7 +131,7 @@ D_WarpScreen (void)
|
|||
(int) ((float) u * wratio * w / (w + AMP2 * 2));
|
||||
}
|
||||
|
||||
turb = intsintable + ((int) (r_realtime * SPEED) & (CYCLE - 1));
|
||||
turb = intsintable + ((int) (vr_data.realtime * SPEED) & (CYCLE - 1));
|
||||
dest = (short *) vid.buffer + scr_vrect.y * (vid.rowbytes >> 1) +
|
||||
scr_vrect.x;
|
||||
|
||||
|
@ -177,7 +177,7 @@ D_WarpScreen (void)
|
|||
(int) ((float) u * wratio * w / (w + AMP2 * 2));
|
||||
}
|
||||
|
||||
turb = intsintable + ((int) (r_realtime * SPEED) & (CYCLE - 1));
|
||||
turb = intsintable + ((int) (vr_data.realtime * SPEED) & (CYCLE - 1));
|
||||
dest = (int *) vid.buffer + scr_vrect.y * (vid.rowbytes >> 2) +
|
||||
scr_vrect.x;
|
||||
|
||||
|
@ -263,7 +263,7 @@ Turbulent (espan_t *pspan)
|
|||
float sdivz, tdivz, zi, z, du, dv, spancountminus1;
|
||||
float sdivz16stepu, tdivz16stepu, zi16stepu;
|
||||
|
||||
r_turb_turb = sintable + ((int) (r_realtime * SPEED) & (CYCLE - 1));
|
||||
r_turb_turb = sintable + ((int) (vr_data.realtime * SPEED) & (CYCLE - 1));
|
||||
|
||||
r_turb_sstep = 0; // keep compiler happy
|
||||
r_turb_tstep = 0; // ditto
|
||||
|
|
|
@ -35,7 +35,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/sys.h"
|
||||
|
||||
#include "d_local.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
#define SKY_SPAN_SHIFT 5
|
||||
#define SKY_SPAN_MAX (1 << SKY_SPAN_SHIFT)
|
||||
|
|
|
@ -36,6 +36,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "compat.h"
|
||||
#include "d_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
static int sprite_height;
|
||||
static int minindex, maxindex;
|
||||
|
|
|
@ -39,7 +39,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "compat.h"
|
||||
#include "d_local.h"
|
||||
#include "r_local.h"
|
||||
#include "r_internal.h"
|
||||
|
||||
static float surfscale;
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue