summaryrefslogtreecommitdiff
path: root/apps/plugins/doom/r_main.h
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-03-28 15:44:01 +0000
committerDave Chapman <dave@dchapman.com>2006-03-28 15:44:01 +0000
commit47f4a458d636a889e955e68f896708f1276febc0 (patch)
tree99f770c02ef606f0abbdcd332ac39e69830d8007 /apps/plugins/doom/r_main.h
parentfff7d6157d56f233cad5c2003475e47a5ff809a7 (diff)
downloadrockbox-47f4a458d636a889e955e68f896708f1276febc0.zip
rockbox-47f4a458d636a889e955e68f896708f1276febc0.tar.gz
rockbox-47f4a458d636a889e955e68f896708f1276febc0.tar.bz2
rockbox-47f4a458d636a889e955e68f896708f1276febc0.tar.xz
Patch #2969 - Doom! Currently only working on the H300.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9312 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/doom/r_main.h')
-rw-r--r--apps/plugins/doom/r_main.h125
1 files changed, 125 insertions, 0 deletions
diff --git a/apps/plugins/doom/r_main.h b/apps/plugins/doom/r_main.h
new file mode 100644
index 0000000..10978b3
--- /dev/null
+++ b/apps/plugins/doom/r_main.h
@@ -0,0 +1,125 @@
+/* Emacs style mode select -*- C++ -*-
+ *-----------------------------------------------------------------------------
+ *
+ *
+ * PrBoom a Doom port merged with LxDoom and LSDLDoom
+ * based on BOOM, a modified and improved DOOM engine
+ * Copyright (C) 1999 by
+ * id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
+ * Copyright (C) 1999-2000 by
+ * Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
+ *
+ * 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.
+ *
+ * DESCRIPTION:
+ * Renderer main interface.
+ *
+ *-----------------------------------------------------------------------------*/
+
+#ifndef __R_MAIN__
+#define __R_MAIN__
+
+#include "d_player.h"
+#include "r_data.h"
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+//
+// POV related.
+//
+
+extern fixed_t viewcos;
+extern fixed_t viewsin;
+extern int viewwidth;
+extern int viewheight;
+extern int viewwindowx;
+extern int viewwindowy;
+extern int centerx;
+extern int centery;
+extern fixed_t centerxfrac;
+extern fixed_t centeryfrac;
+extern fixed_t projection;
+extern int validcount;
+extern int linecount;
+extern int loopcount;
+
+//
+// Rendering stats
+//
+
+extern int rendered_visplanes, rendered_segs, rendered_vissprites;
+extern boolean rendering_stats;
+
+//
+// Lighting LUT.
+// Used for z-depth cuing per column/row,
+// and other lighting effects (sector ambient, flash).
+//
+
+// Lighting constants.
+
+#define LIGHTLEVELS 16
+#define LIGHTSEGSHIFT 4
+#define MAXLIGHTSCALE 48
+#define LIGHTSCALESHIFT 12
+#define MAXLIGHTZ 128
+#define LIGHTZSHIFT 20
+
+// killough 3/20/98: Allow colormaps to be dynamic (e.g. underwater)
+extern lighttable_t *(*scalelight)[MAXLIGHTSCALE];
+extern lighttable_t *(*zlight)[MAXLIGHTZ];
+extern lighttable_t *fullcolormap;
+extern int numcolormaps; // killough 4/4/98: dynamic number of maps
+extern lighttable_t **colormaps;
+// killough 3/20/98, 4/4/98: end dynamic colormaps
+
+extern int extralight;
+extern lighttable_t *fixedcolormap;
+
+// Number of diminishing brightness levels.
+// There a 0-31, i.e. 32 LUT in the COLORMAP lump.
+
+#define NUMCOLORMAPS 32
+
+//
+// Function pointers to switch refresh/drawing functions.
+// Used to select shadow mode etc.
+//
+
+extern void (*colfunc)(void);
+
+//
+// Utility functions.
+//
+
+int R_PointOnSide(fixed_t x, fixed_t y, const node_t *node);
+int R_PointOnSegSide(fixed_t x, fixed_t y, const seg_t *line);
+angle_t R_PointToAngle(fixed_t x, fixed_t y);
+angle_t R_PointToAngle2(fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y2);
+subsector_t *R_PointInSubsector(fixed_t x, fixed_t y);
+
+//
+// REFRESH - the actual rendering functions.
+//
+
+void R_RenderPlayerView(player_t *player); // Called by G_Drawer.
+void R_Init(void); // Called by startup code.
+void R_SetViewSize(int blocks); // Called by M_Responder.
+void R_ExecuteSetViewSize(void); // cph - called by D_Display to complete a view resize
+
+#endif