Commit 97af6bcd authored by Steven Fuller's avatar Steven Fuller

Minor cleanups (once again)

parent 893a320a
CC = gcc
#CFLAGS = -O6 -fomit-frame-pointer -ffast-math -funroll-loops -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
#CFLAGS = -g -Wall -pedantic
CFLAGS = -g
CFLAGS = -g -Wall
#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 \
......@@ -21,8 +21,8 @@ NASM = nasm
all: swolf3d xwolf3d
$(SOBJS): version.h id_heads.h
$(XOBJS): version.h id_heads.h
$(SOBJS): version.h id_heads.h wl_def.h
$(XOBJS): version.h id_heads.h wl_def.h
.asm.o:
$(NASM) -f elf -o $@ $<
......
......@@ -31,10 +31,6 @@ int WolfMain(int argc, char *argv[]);
/* ------------------------------------------------------------------------ */
extern char signon;
#define introscn signon
#ifndef SPEAR
#ifndef UPLOAD
......@@ -59,9 +55,6 @@ extern char signon;
/* ---------------- */
#define GREXT "VGA"
typedef enum {false,true} boolean;
typedef unsigned char byte;
typedef unsigned short int word;
......@@ -88,6 +81,10 @@ typedef struct
#include "id_sd.h"
#include "id_us.h"
extern byte signon;
#define introscn signon
void Quit (char *error); // defined in user program
#define MAXTICS 10
......
......@@ -378,76 +378,11 @@ static char *ParmStrings[] = {"nojoys","nomouse",nil};
// Internal routines
///////////////////////////////////////////////////////////////////////////
//
// INL_KeyService() - Handles a keyboard interrupt (key up/down)
//
///////////////////////////////////////////////////////////////////////////
static void INL_KeyService(void)
{
static boolean special;
byte k, c, temp;
int i;
/* k = inportb(0x60); // Get the scan code */
if (k == 0xe0) // Special key prefix
special = true;
else if (k == 0xe1) // Handle Pause key
Paused = true;
else
{
if (k & 0x80) // Break code
{
k &= 0x7f;
// DEBUG - handle special keys: ctl-alt-delete, print scrn
Keyboard[k] = false;
}
else // Make code
{
LastCode = CurCode;
CurCode = LastScan = k;
Keyboard[k] = true;
if (special)
c = SpecialNames[k];
else
{
if (k == sc_CapsLock)
{
CapsLock ^= true;
}
if (Keyboard[sc_LShift] || Keyboard[sc_RShift]) // If shifted
{
c = ShiftNames[k];
if ((c >= 'A') && (c <= 'Z') && CapsLock)
c += 'a' - 'A';
}
else
{
c = ASCIINames[k];
if ((c >= 'a') && (c <= 'z') && CapsLock)
c -= 'a' - 'A';
}
}
if (c)
LastASCII = c;
}
special = false;
}
}
void keyboard_handler(int code, int press)
{
static boolean special;
byte k, c, temp;
int i;
byte k, c;
/* k = inportb(0x60); // Get the scan code */
k = code;
if (k == 0xe0) // Special key prefix
......
......@@ -134,7 +134,7 @@ void VL_Startup()
if (gfxbuf == NULL)
gfxbuf = malloc(320 * 200 * 1);
img = XCreateImage(dpy, vi->visual, 8, ZPixmap, 0, gfxbuf, 320, 200,
img = XCreateImage(dpy, vi->visual, 8, ZPixmap, 0, (char *)gfxbuf, 320, 200,
8, 320);
XMapWindow(dpy, win);
......@@ -275,8 +275,8 @@ void VL_SetPalette(byte *palette)
*/
void VL_GetPalette(byte *palette)
{
int i, r, g, b;
{
int i;
for (i = 0; i < 256; i++) {
palette[i*3+0] = clr[i].red >> 10;
......@@ -540,8 +540,7 @@ int XKeysymToScancode(unsigned int keysym)
void keyboard_handler(int code, int press)
{
static boolean special;
byte k, c, temp;
int i;
byte k, c;
k = code;
......
......@@ -414,7 +414,7 @@ enum {
SPR_MACHINEGUNATK4,
SPR_CHAINREADY,SPR_CHAINATK1,SPR_CHAINATK2,SPR_CHAINATK3,
SPR_CHAINATK4,
SPR_CHAINATK4
};
......@@ -868,6 +868,7 @@ void LevelCompleted (void);
void CheckHighScore (long score,word other);
void Victory (void);
void ClearSplitVWB (void);
void PG13();
/*
=============================================================================
......
......@@ -945,7 +945,7 @@ void HitVertWall (void)
{
int wallpic;
unsigned texture;
char *wall;
byte *wall;
#ifdef DEBUGx
printf ("HitVertWall: xtile = %d, TILE(yintercept) = %d\n",
......@@ -981,7 +981,7 @@ void HitHorizWall (void)
{
int wallpic;
unsigned texture;
char *wall;
byte *wall;
#ifdef DEBUGx
printf ("HitHorizWall: ytile = %d, TILE(xintercept) = %d\n",
......
......@@ -272,7 +272,7 @@ long DoChecksum(byte *source,unsigned size,long checksum)
boolean SaveTheGame(int file,int x,int y)
{
long avail,size,checksum;
long checksum;
objtype *ob,nullobj;
checksum = 0;
......@@ -358,8 +358,7 @@ boolean SaveTheGame(int file,int x,int y)
boolean LoadTheGame(int file,int x,int y)
{
long checksum,oldchecksum;
objtype *ob,nullobj;
objtype nullobj;
checksum = 0;
......@@ -557,15 +556,12 @@ void BuildTables (void)
void CalcProjection (long focal)
{
int i;
long intang;
int i;
long intang;
float angle;
double tang;
double planedist;
double globinhalf;
int halfview;
double halfangle,facedist;
int halfview;
double facedist;
focallength = focal;
facedist = focal+MINDIST;
......@@ -1021,7 +1017,7 @@ void DoJukebox(void)
void InitGame(void)
{
int i,x,y;
int i;
MM_Startup ();
VW_Startup ();
......@@ -1191,7 +1187,6 @@ void Quit(char *error)
void DemoLoop (void)
{
static int LastDemo;
int i;
//
// main game cycle
......@@ -1210,6 +1205,8 @@ void DemoLoop (void)
if ( i && ( (i+1) < _argc) ) {
i++;
for (; i < _argc; i++) {
if (_argv[i][0] == '-')
break;
IN_ClearKeysDown();
if (PlayDemoFromFile(_argv[i]))
IN_UserInput(3 * 70);
......@@ -1310,8 +1307,6 @@ void DemoLoop (void)
int WolfMain(int argc, char *argv[])
{
int i;
_argc = argc;
_argv = argv;
......
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