From 2ef3a94061ef5331a4af581c89f99a0f91b465a3 Mon Sep 17 00:00:00 2001 From: theoddone33 Date: Mon, 4 Aug 2003 01:29:48 +0000 Subject: [PATCH] Beginning removal of GLU. General codebase cleanup. git-svn-id: svn://svn.icculus.org/hheretic/trunk@7 eb238505-0f32-0410-b369-e4014cc52c4b --- Makefile | 127 ---------------------------------------------- base/d_main.c | 3 +- base/p_enemy.c | 1 + base/p_map.c | 1 + base/p_maputl.c | 1 + base/p_setup.c | 3 +- base/p_sight.c | 1 + base/p_user.c | 1 + base/r_data.c | 1 + base/r_main.c | 1 + base/r_plane.c | 2 +- base/w_wad.c | 1 + include/config.h | 2 +- include/m_bams.h | 2 +- opengl/m_bams.c | 2 +- opengl/ogl_draw.c | 3 +- opengl/ogl_font.c | 1 - opengl/ogl_rend.c | 14 ++--- opengl/ogl_tex.c | 1 - sdl/i_sdlgl.c | 2 - 20 files changed, 20 insertions(+), 150 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index 646032f..0000000 --- a/Makefile +++ /dev/null @@ -1,127 +0,0 @@ -# Generated automatically from Makefile.in by configure. -# This Makefile understands the following targets: -# -# sdl build SDL (software) version -# clean: remove all intermediate files - -# Basic stuff -SHELL = /bin/sh - -top_srcdir = . -srcdir = . -prefix = /usr/local -exec_prefix = ${prefix} -bindir = $(exec_prefix)/bin -infodir = $(prefix)/info -libdir = $(prefix)/lib/gnudl -mandir = $(prefix)/man/man1 -includedir = $(prefix)/include - -CC = gcc -DEFS = -DHAVE_CONFIG_H -CPPFLAGS = -g -O2 -Wall -CFLAGS = $(CPPFLAGS) -LDFLAGS = -BLIBS = -lpthread -GLLIBS = -L/usr/X11R6/lib -lGL -lGLU -SDLLIBS = -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -lpthread -SDLFLAGS = -I/usr/local/include -I/usr/local/include/SDL -D_REENTRANT -GLHEXEN = false -HAVE_SDL = yes - -# Directories - -TOPSRCDIR = . -TOPOBJDIR = . -SRCDIR = . -MODULE = none - -INCSUBDIR = include - -CPPFLAGS += -I./include - -# Objects to build - -SDLOBJS = \ - sdl/i_sdl.o - -GLBASE = sdl/i_sdlgl.o - -GLOBJS = \ - opengl/ogl_clip.o \ - opengl/ogl_draw.o \ - opengl/ogl_font.o \ - opengl/ogl_rend.o \ - opengl/ogl_rl.o \ - opengl/ogl_sky.o \ - opengl/ogl_tex.o \ - opengl/m_bams.o - -BASEOBJS = \ - base/i_linux.o \ - base/oss.o \ - base/i_sound.o \ - base/am_map.o \ - base/ct_chat.o \ - base/d_net.o \ - base/f_finale.o \ - base/g_game.o \ - base/d_main.o \ - base/info.o \ - base/in_lude.o \ - base/mn_menu.o \ - base/m_misc.o \ - base/p_ceilng.o \ - base/p_doors.o \ - base/p_enemy.o \ - base/p_floor.o \ - base/p_inter.o \ - base/p_lights.o \ - base/p_map.o \ - base/p_maputl.o \ - base/p_mobj.o \ - base/p_plats.o \ - base/p_pspr.o \ - base/p_setup.o \ - base/p_sight.o \ - base/p_spec.o \ - base/p_switch.o \ - base/p_telept.o \ - base/p_tick.o \ - base/p_user.o \ - base/r_bsp.o \ - base/r_data.o \ - base/r_draw.o \ - base/r_main.o \ - base/r_plane.o \ - base/r_segs.o \ - base/r_things.o \ - base/sb_bar.o \ - base/sounds.o \ - base/tables.o \ - base/v_video.o \ - base/w_wad.o \ - base/z_zone.o - -ifeq "$(GLHEXEN)" "true" -opengl: $(GLBASE) $(GLOBJS) $(BASEOBJS) - $(CC) -o hheretic-gl $(GLBASE) $(GLOBJS) $(BASEOBJS) $(GLLIBS) $(SDLLIBS) -else -ifeq "$(HAVE_SDL)" "yes" -sdl: $(SDLOBJS) $(BASEOBJS) - $(CC) -o hheretic-sdl $(SDLOBJS) $(BASEOBJS) $(SDLLIBS) -endif -endif - -clean: - $(RM) base/*.o - $(RM) x11/*.o - $(RM) svgalib/*.o - $(RM) opengl/*.o - $(RM) sdl/*.o - -%.o: %.c - $(CC) $< -o $@ -c $(CFLAGS) - -%.o: %.cpp - $(CXX) $< -o $@ -c $(CPPFLAGS) diff --git a/base/d_main.c b/base/d_main.c index 258ecd2..d6cb53b 100644 --- a/base/d_main.c +++ b/base/d_main.c @@ -92,7 +92,8 @@ int eventtail; void D_PostEvent(event_t *ev) { events[eventhead] = *ev; - eventhead = (++eventhead)&(MAXEVENTS-1); + eventhead++; + eventhead &= (MAXEVENTS-1); } //--------------------------------------------------------------------------- diff --git a/base/p_enemy.c b/base/p_enemy.c index 5c5863d..f20d594 100644 --- a/base/p_enemy.c +++ b/base/p_enemy.c @@ -1,6 +1,7 @@ // P_enemy.c +#include #include "doomdef.h" #include "p_local.h" #include "soundst.h" diff --git a/base/p_map.c b/base/p_map.c index 07c7d86..9ed9a1b 100644 --- a/base/p_map.c +++ b/base/p_map.c @@ -1,5 +1,6 @@ // P_map.c +#include #include "doomdef.h" #include "p_local.h" #include "soundst.h" diff --git a/base/p_maputl.c b/base/p_maputl.c index 279fe32..58b4619 100644 --- a/base/p_maputl.c +++ b/base/p_maputl.c @@ -1,6 +1,7 @@ // P_maputl.c +#include #include "doomdef.h" #include "p_local.h" diff --git a/base/p_setup.c b/base/p_setup.c index 7232728..a5b7f40 100644 --- a/base/p_setup.c +++ b/base/p_setup.c @@ -653,8 +653,7 @@ void P_ConvexCarver(subsector_t *ssec, int num, divline_t *list) // Add the new vertex. Also modify the sidelist. edgepoints = (fvertex_t*)realloc(edgepoints,(++numedgepoints)*sizeof(fvertex_t)); - if(numedgepoints >= MAX_CC_SIDES) I_Error("Too many points in -carver.\n"); + if(numedgepoints >= MAX_CC_SIDES) I_Error("Too many points in carver.\n"); // Make room for the new vertex. memmove(edgepoints+endIdx+1, edgepoints+endIdx, diff --git a/base/p_sight.c b/base/p_sight.c index fe5cf04..36decd6 100644 --- a/base/p_sight.c +++ b/base/p_sight.c @@ -1,5 +1,6 @@ // P_sight.c +#include #include "doomdef.h" #include "p_local.h" diff --git a/base/p_user.c b/base/p_user.c index 0975e74..f402214 100644 --- a/base/p_user.c +++ b/base/p_user.c @@ -1,6 +1,7 @@ // P_user.c +#include #include "doomdef.h" #include "p_local.h" #include "soundst.h" diff --git a/base/r_data.c b/base/r_data.c index d1bdefe..2cd5d4e 100644 --- a/base/r_data.c +++ b/base/r_data.c @@ -1,6 +1,7 @@ // R_data.c +#include #include "doomdef.h" #include "r_local.h" #include "p_local.h" diff --git a/base/r_main.c b/base/r_main.c index 48e873a..37279fb 100644 --- a/base/r_main.c +++ b/base/r_main.c @@ -1,5 +1,6 @@ // R_main.c +#include #include #include "doomdef.h" #include "r_local.h" diff --git a/base/r_plane.c b/base/r_plane.c index af14a88..1ad52a1 100644 --- a/base/r_plane.c +++ b/base/r_plane.c @@ -472,5 +472,5 @@ extern int columnofs[MAXWIDTH]; Z_ChangeTag (tempSource, PU_CACHE); } -#endif !RENDER3D +#endif // !RENDER3D } diff --git a/base/w_wad.c b/base/w_wad.c index 7dff5c8..2afa641 100644 --- a/base/w_wad.c +++ b/base/w_wad.c @@ -10,6 +10,7 @@ #include +#include #include #include #include diff --git a/include/config.h b/include/config.h index ebf664c..aebc4fb 100644 --- a/include/config.h +++ b/include/config.h @@ -42,7 +42,7 @@ /* #undef ASSASSIN */ /* Define if building for OpenGL */ -/* #undef RENDER3D */ +#define RENDER3D 1 /* Define if building for demo wadfile */ /* #undef DEMO_WAD */ diff --git a/include/m_bams.h b/include/m_bams.h index 80e963d..6a77d48 100644 --- a/include/m_bams.h +++ b/include/m_bams.h @@ -32,4 +32,4 @@ typedef unsigned short binangle; void bamsInit(); // Fill in the tables. binangle bamsAtan2(int y,int x); -#endif \ No newline at end of file +#endif diff --git a/opengl/m_bams.c b/opengl/m_bams.c index 25feea4..004fe6d 100644 --- a/opengl/m_bams.c +++ b/opengl/m_bams.c @@ -55,4 +55,4 @@ binangle bamsAtan2(int y,int x) } // This is the final angle. return bang; -} \ No newline at end of file +} diff --git a/opengl/ogl_draw.c b/opengl/ogl_draw.c index cc4a771..82f1106 100644 --- a/opengl/ogl_draw.c +++ b/opengl/ogl_draw.c @@ -22,7 +22,6 @@ #include #include #include -#include #include "doomdef.h" #include "ogl_def.h" #include "p_local.h" @@ -58,7 +57,7 @@ void OGL_DrawRawScreen(int lump) // Raw screens are 320 x 200. glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); - gluOrtho2D(0, screenWidth, screenHeight, 0); + glOrtho (0, screenWidth, screenHeight, 0, -1, 1); OGL_SetRawImage(lump,1); tcbottom = lumptexsizes[lump].h / (float)FindNextPower2(lumptexsizes[lump].h); diff --git a/opengl/ogl_font.c b/opengl/ogl_font.c index de5c31e..808ba00 100644 --- a/opengl/ogl_font.c +++ b/opengl/ogl_font.c @@ -11,7 +11,6 @@ #endif #include -#include #include #include "ogl_font.h" #include diff --git a/opengl/ogl_rend.c b/opengl/ogl_rend.c index 47a57b4..d869a73 100644 --- a/opengl/ogl_rend.c +++ b/opengl/ogl_rend.c @@ -22,7 +22,6 @@ #include #include #include -#include #include "doomdef.h" #include "r_local.h" #include "p_local.h" @@ -65,9 +64,9 @@ int dlMaxRad = 64; // Dynamic lights maximum radius. // PRIVATE DATA DEFINITIONS ------------------------------------------------ -static int viewpw, viewph; // Viewport size. -static float nearClip, farClip; static float yfov; +static float nearClip = 5, farClip = 8000; +static float viewph, viewpw; static float viewsidex, viewsidey; // For the black fog. static boolean firstsubsector; // No range checking for the first one. @@ -120,10 +119,6 @@ void OGL_InitRenderer() // Initializes the renderer to 2D state. // PC_Init(&rlclock); // PC_Init(&miscclock); - // The variables. - nearClip = 5; - farClip = 8000; - // Here we configure the OpenGL state and set projection matrix. glFrontFace(GL_CW); glDisable(GL_CULL_FACE); @@ -136,7 +131,7 @@ void OGL_InitRenderer() // Initializes the renderer to 2D state. // The projection matrix. glMatrixMode(GL_PROJECTION); glLoadIdentity(); - gluOrtho2D(0,320,200,0); + glOrtho (0, 320, 200, 0, -1, 1); // Initialize the modelview matrix. glMatrixMode(GL_MODELVIEW); @@ -235,7 +230,7 @@ void OGL_Restore2DState(int step) extern int screenblocks; glMatrixMode(GL_PROJECTION); glLoadIdentity(); - gluOrtho2D(0, 320, (screenblocks<11)?161:200, 0); + glOrtho (0, 320, (screenblocks<11)?161:200, 0, -1, 1); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } @@ -258,7 +253,6 @@ static void OGL_ProjectionMatrix() glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(yfov=90.0/aspect, aspect, nearClip, farClip); - // We'd like to have a left-handed coordinate system. glScalef(1,1,-1); } diff --git a/opengl/ogl_tex.c b/opengl/ogl_tex.c index 6fdd77c..723e0c9 100644 --- a/opengl/ogl_tex.c +++ b/opengl/ogl_tex.c @@ -14,7 +14,6 @@ #include #include -#include #include "doomdef.h" #include "r_local.h" #include "ogl_def.h" diff --git a/sdl/i_sdlgl.c b/sdl/i_sdlgl.c index 6ec8ac9..9797c7f 100644 --- a/sdl/i_sdlgl.c +++ b/sdl/i_sdlgl.c @@ -10,7 +10,6 @@ #include #include #include -#include #include "doomdef.h" #include "r_local.h" #include "p_local.h" // for P_AproxDistance @@ -176,7 +175,6 @@ void I_InitGraphics(void) printf( " Vendor: %s\n", glGetString(GL_VENDOR) ); printf( " Renderer: %s\n", glGetString(GL_RENDERER) ); printf( " Version: %s\n", glGetString(GL_VERSION) ); - printf( " GLU Version: %s\n", gluGetString((GLenum)GLU_VERSION) ); // Check the maximum texture size. glGetIntegerv( GL_MAX_TEXTURE_SIZE, &maxTexSize ); -- 2.39.2