Commit c3ef597e authored by Steven Fuller's avatar Steven Fuller

Made vi_glx build compile without wl_scale/wl_draw

parent fc4b151a
......@@ -4,12 +4,13 @@ CC = gcc
CFLAGS = -g
#CFLAGS = -Os
OBJS = objs.o misc.o id_ca.o id_sd.o id_vh.o id_us.o \
wl_scale.o wl_draw.o wl_act1.o wl_act2.o wl_agent.o wl_game.o \
wl_act1.o wl_act2.o wl_agent.o wl_game.o \
wl_inter.o wl_menu.o wl_play.o wl_state.o wl_text.o wl_main.o \
wl_debug.o
SOBJS = $(OBJS) vi_svga.o
XOBJS = $(OBJS) vi_xlib.o
GOBJS = $(OBJS) vi_glx.o
ROBJS = wl_draw.o wl_scale.o
SOBJS = $(OBJS) $(ROBJS) vi_svga.o
XOBJS = $(OBJS) $(ROBJS) vi_xlib.o
GOBJS = $(OBJS) vi_ogl.o vi_glx.o
LFLAGS = -lm
#LFLAGS = -lm -lvga ElectricFence-2.2.2/libefence.a -lpthread
......
......@@ -84,6 +84,7 @@ also, the higher bitrates are a hack since a palette lookup has to be done
for every byte when transferring to the pixmap, palette fades require a
screen update
* mitshm
* make sure none of the code tries to handle gfx/sound data directly
Specific:
* memory/sound intro screen goes
......
......@@ -84,7 +84,8 @@ typedef enum {
LASTSOUND
} soundnames;
#define YEAHSND NOWAYSND // TODO: YEAHSND not defined in here
/* TODO: YEAHSND not defined in here */
#define YEAHSND NOWAYSND
//
// Base offsets
......
......@@ -25,7 +25,7 @@ typedef enum {
H_LEFTWINDOWPIC, // 18
H_RIGHTWINDOWPIC, // 19
H_BOTTOMINFOPIC, // 20
H_SPEARINFO, /* TODO: this ruins the numbers :) */ // 21
H_SPEARINFO, // 21
// Lump Start
C_OPTIONSPIC, // 22
C_CURSOR1PIC, // 23
......
......@@ -1429,36 +1429,6 @@ void MM_SortMem (void)
{
}
/*
======================
=
= MM_UnusedMemory
=
= Returns the total free space without purging
=
======================
*/
long MM_UnusedMemory(void)
{
return 0;
}
/*
======================
=
= MM_TotalFree
=
= Returns the total free space with purging
=
======================
*/
long MM_TotalFree (void)
{
return 0;
}
boolean PMStarted;
char PageFileName[13] = {"vswap."};
int PageFile = -1;
......
......@@ -95,9 +95,6 @@ void MM_SetPurge (memptr *baseptr, int purge);
void MM_SetLock (memptr *baseptr, boolean locked);
void MM_SortMem (void);
long MM_UnusedMemory (void);
long MM_TotalFree (void);
#define PMPageSize 4096
typedef enum
......
......@@ -14,9 +14,6 @@
#include <glob.h>
#include <math.h>
#include <vga.h>
#include <vgakeyboard.h>
#include "misc.h"
#include "version.h"
......
......@@ -165,6 +165,8 @@ void VW_UpdateScreen()
=======================
*/
void Init3D();
void VL_Startup()
{
if (gfxbuf == NULL)
......@@ -182,6 +184,7 @@ void VL_Startup()
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
Init3D();
}
/*
......
......@@ -2,6 +2,9 @@
#include "id_heads.h"
#include <vga.h>
#include <vgakeyboard.h>
byte *gfxbuf = NULL;
void VL_WaitVBL(int vbls)
......
......@@ -205,8 +205,8 @@ void PlaceItemType (int itemtype, int tilex, int tiley)
//
for (type=0 ; ; type++)
{
if (statinfo[type].picnum == -1) // end of list
Quit ("PlaceItemType: couldn't find type!");
if (statinfo[type].picnum == -1) /* end of list */
Quit("PlaceItemType: couldn't find type!");
if (statinfo[type].type == itemtype)
break;
}
......@@ -219,12 +219,12 @@ void PlaceItemType (int itemtype, int tilex, int tiley)
if (spot==laststatobj)
{
if (spot == &statobjlist[MAXSTATS])
return; // no free spots
laststatobj++; // space at end
return; /* no free spots */
laststatobj++; /* space at end */
break;
}
if (spot->shapenum == -1) // -1 is a free spot
if (spot->shapenum == -1) /* -1 is a free spot */
break;
}
//
......
......@@ -893,10 +893,9 @@ void VictoryTile (void)
===================
*/
void Thrust (int angle, long speed)
void Thrust(int angle, long speed)
{
long xmove,ymove;
long slowmax;
unsigned offset;
......@@ -927,7 +926,7 @@ void Thrust (int angle, long speed)
player->areanumber = *(mapsegs[0] + offset) -AREATILE;
if (*(mapsegs[1] + offset) == EXITTILE)
VictoryTile ();
VictoryTile();
}
......
......@@ -41,35 +41,6 @@ void ViewMap (void);
//===========================================================================
/*
==================
=
= DebugMemory
=
==================
*/
void DebugMemory (void)
{
int i;
char scratch[80],str[10];
long mem;
CenterWindow (16,7);
US_CPrint ("Memory Usage");
US_CPrint ("------------");
US_Print ("k\nFree :");
US_PrintUnsigned (MM_UnusedMemory()/1024);
US_Print ("k\nWith purge:");
US_PrintUnsigned (MM_TotalFree()/1024);
US_Print ("k\n");
VW_UpdateScreen();
IN_Ack ();
}
//===========================================================================
/*
==================
=
......@@ -174,6 +145,7 @@ void PicturePause (void)
void ShapeTest (void)
{
#if 0 /* TODO: this code want to access the raycasting renderer directly */
extern word NumDigi;
extern word *DigiList;
static char buf[10];
......@@ -190,7 +162,6 @@ static char buf[10];
for (i = 0,done = false;!done;)
{
US_ClearWindow();
// sound = -1;
page = &PMPages[i];
US_Print(" Page #");
......@@ -268,7 +239,6 @@ static char buf[10];
}
if (j < NumDigi)
{
// sound = j;
US_Print("\n Sound #");
US_PrintUnsigned(j);
US_Print("\n Segment #");
......@@ -294,8 +264,10 @@ static char buf[10];
VW_UpdateScreen();
while (!(scan = LastScan))
while (!(scan = LastScan)) {
SD_Poll();
IN_CheckAck();
}
IN_ClearKey(scan);
switch (scan)
......@@ -337,6 +309,7 @@ static char buf[10];
}
}
SD_StopDigitized();
#endif
}
//===========================================================================
......@@ -414,11 +387,6 @@ int DebugKeys()
IN_Ack ();
return 1;
}
else if (Keyboard[sc_M]) // M = memory info
{
DebugMemory();
return 1;
}
else if (Keyboard[sc_N]) // N = no clip
{
noclip^=1;
......@@ -444,7 +412,7 @@ int DebugKeys()
return 1;
}
else if (Keyboard[sc_Q]) // Q = fast quit
Quit (NULL);
Quit(NULL);
else if (Keyboard[sc_S]) // S = slow motion
{
singlestep^=1;
......
......@@ -414,7 +414,7 @@ enum {
SPR_MACHINEGUNATK4,
SPR_CHAINREADY,SPR_CHAINATK1,SPR_CHAINATK2,SPR_CHAINATK3,
SPR_CHAINATK4
SPR_CHAINATK4, SPR_NULLSPRITE
};
......@@ -724,11 +724,6 @@ extern int pixelangle[MAXVIEWWIDTH];
extern long finetangent[FINEANGLES/4];
extern fixed sintable[], *costable;
//
// derived constants
//
extern fixed maxslope;
extern char configname[13];
void HelpScreens (void);
......@@ -921,7 +916,6 @@ extern unsigned pwallpos;
fixed FixedByFrac (fixed a, fixed b);
void TransformActor (objtype *ob);
void BuildTables (void);
void ClearScreen (void);
int CalcRotate (objtype *ob);
void DrawScaleds (void);
void CalcTics (void);
......
......@@ -9,34 +9,18 @@
#define ACTORSIZE 0x4000
long lasttimecount;
long frameon;
unsigned wallheight[MAXVIEWWIDTH];
#define mindist MINDIST
//
// math tables
//
int pixelangle[MAXVIEWWIDTH];
long finetangent[FINEANGLES/4];
fixed sintable[ANGLES+ANGLES/4+1],*costable = sintable+(ANGLES/4);
//int pixelangle[MAXVIEWWIDTH]; /* TODO: i put these in wl_main */
//long finetangent[FINEANGLES/4];
//
// refresh variables
//
fixed viewx,viewy; // the focal point
int viewangle;
fixed viewsin,viewcos;
void TransformActor (objtype *ob);
void BuildTables (void);
void ClearScreen (void);
int CalcRotate (objtype *ob);
void DrawScaleds (void);
void CalcTics (void);
void ThreeDRefresh (void);
//
// ray tracing variables
......@@ -55,33 +39,10 @@ int xtilestep,ytilestep;
long xintercept,yintercept;
long xstep,ystep;
int horizwall[MAXWALLTILES],vertwall[MAXWALLTILES];
extern unsigned xoffset, yoffset;
void AsmRefresh (void);
/*
========================
=
= FixedByFrac
=
= multiply a 16/16 bit, 2's complement fixed point number by a 16 bit
= fraction, passed as a signed magnitude 32 bit number
=
========================
*/
fixed FixedByFrac (fixed a, fixed b)
{
long long ra = a;
long long rb = b;
long long r;
r = ra * rb;
r >>= 16;
return (fixed)r;
}
//==========================================================================
/*
......@@ -103,7 +64,6 @@ fixed FixedByFrac (fixed a, fixed b)
========================
*/
//
// transform actor
//
......@@ -366,7 +326,7 @@ void HitVertDoor (void)
//==========================================================================
unsigned vgaCeiling[]=
unsigned Ceiling[]=
{
#ifndef SPEAR
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xbfbf,
......@@ -385,14 +345,14 @@ unsigned vgaCeiling[]=
/*
=====================
=
= VGAClearScreen
= ClearScreen
=
=====================
*/
void VGAClearScreen (void)
void ClearScreen()
{
unsigned ceiling = vgaCeiling[gamestate.episode*10+mapon] & 0xFF;
unsigned ceiling = Ceiling[gamestate.episode*10+mapon] & 0xFF;
unsigned floor = 0x19;
VL_Bar(xoffset, yoffset, viewwidth, viewheight / 2, ceiling);
......@@ -409,7 +369,7 @@ void VGAClearScreen (void)
=====================
*/
int CalcRotate (objtype *ob)
int CalcRotate(objtype *ob)
{
int angle,viewangle;
......@@ -610,43 +570,6 @@ void DrawPlayerWeapon (void)
//==========================================================================
/*
=====================
=
= CalcTics
=
=====================
*/
void CalcTics (void)
{
long newtime;
//
// calculate tics since last refresh for adaptive timing
//
if (lasttimecount > get_TimeCount())
set_TimeCount(lasttimecount); // if the game was paused a LONG time
do
{
newtime = get_TimeCount();
tics = newtime-lasttimecount;
} while (!tics); // make sure at least one tic passes
lasttimecount = newtime;
if (tics>MAXTICS)
{
set_TimeCount(get_TimeCount() - (tics-MAXTICS));
tics = MAXTICS;
}
}
//==========================================================================
/*
====================
=
......@@ -688,7 +611,7 @@ void WallRefresh (void)
========================
*/
void ThreeDRefresh (void)
void ThreeDRefresh()
{
//
......@@ -700,7 +623,7 @@ void ThreeDRefresh (void)
// follow the walls from there to the right, drawwing as we go
//
DrawPlayBorder();
VGAClearScreen ();
ClearScreen();
WallRefresh ();
......@@ -708,7 +631,7 @@ void ThreeDRefresh (void)
// draw all the scaled images
//
DrawScaleds(); // draw scaled stuff
DrawPlayerWeapon (); /* draw player's hands */
DrawPlayerWeapon(); /* draw player's hands */
//
// show screen and time last cycle
......
......@@ -46,7 +46,7 @@ int viewwidth;
int viewheight;
int centerx;
int shootdelta; // pixels away from centerx a target can be
fixed scale,maxslope;
fixed scale;
long heightnumerator;
void Quit(char *error);
......@@ -54,7 +54,18 @@ void Quit(char *error);
boolean startgame,loadedgame;
int mouseadjustment;
char configname[13]="config.";
/* These are refuges from wl_draw.c */
long frameon;
long lasttimecount;
fixed viewsin, viewcos;
fixed viewx, viewy; // the focal point
int pixelangle[MAXVIEWWIDTH];
long finetangent[FINEANGLES/4];
int horizwall[MAXWALLTILES], vertwall[MAXWALLTILES];
char configname[13] = "config.";
fixed sintable[ANGLES+ANGLES/4+1], *costable = sintable+(ANGLES/4);
unsigned xoffset, yoffset;
......@@ -62,13 +73,55 @@ int _argc;
char **_argv;
/*
=============================================================================
========================
=
= FixedByFrac
=
= multiply a 16/16 bit, 2's complement fixed point number by a 16 bit
= fraction, passed as a signed magnitude 32 bit number
=
========================
*/
LOCAL VARIABLES
fixed FixedByFrac(fixed a, fixed b)
{
long long ra = a;
long long rb = b;
long long r;
=============================================================================
r = ra * rb;
r >>= 16;
return (fixed)r;
}
/*
=====================
=
= CalcTics
=
=====================
*/
void CalcTics()
{
long newtime;
/* calculate tics since last refresh for adaptive timing */
if (lasttimecount > get_TimeCount())
set_TimeCount(lasttimecount); /* if paused for a long time */
do {
newtime = get_TimeCount();
tics = newtime - lasttimecount;
} while (!tics); /* make sure at least one tic passes */
lasttimecount = newtime;
if (tics > MAXTICS) {
set_TimeCount(get_TimeCount() - (tics - MAXTICS));
tics = MAXTICS;
}
}
/*
====================
......@@ -592,13 +645,6 @@ void CalcProjection (long focal)
pixelangle[halfview-1-i] = intang;
pixelangle[halfview+i] = -intang;
}
//
// if a point's abs(y/x) is greater than maxslope, the point is outside
// the view area
//
maxslope = finetangent[pixelangle[0]];
maxslope >>= 8;
}
......@@ -1019,15 +1065,15 @@ void InitGame(void)
{
int i;
MM_Startup ();
VW_Startup ();
IN_Startup ();
PM_Startup ();
SD_Startup ();
CA_Startup ();
US_Startup ();
MM_Startup();
PM_Startup();
CA_Startup();
VW_Startup();
IN_Startup();
SD_Startup();
US_Startup();
SignonScreen ();
SignonScreen();
//
// build some tables
......@@ -1086,7 +1132,7 @@ void InitGame(void)
==========================
*/
boolean SetViewSize (unsigned width, unsigned height)
boolean SetViewSize(unsigned width, unsigned height)
{
viewwidth = width&~15; // must be divisable by 16
viewheight = height&~1; // must be even
......@@ -1104,7 +1150,7 @@ boolean SetViewSize (unsigned width, unsigned height)
//
// build all needed compiled scalers
//
SetupScaling (viewwidth*1.5);
SetupScaling(viewwidth*1.5);
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment