Commit b5746514 authored by Steven Fuller's avatar Steven Fuller

Updated TODO list

misc.c, misc.h, id_heads.h: removed most of the "DOSISM" junk for now

vi_*, vi_comm.c: finally moved the wolf3d input code into a seperate file

wl_draw.c: fixed a texture bug (slivers didn't "line up" correctly)

rest: misc. changes as usual
parent 0e85990d
...@@ -10,7 +10,7 @@ CFLAGS = -g -Wall -pedantic ...@@ -10,7 +10,7 @@ CFLAGS = -g -Wall -pedantic
OBJS = objs.o misc.o id_ca.o id_vh.o id_us.o \ OBJS = objs.o misc.o id_ca.o id_vh.o id_us.o \
wl_act1.o wl_act2.o wl_act3.o wl_agent.o wl_game.o \ wl_act1.o wl_act2.o wl_act3.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_inter.o wl_menu.o wl_play.o wl_state.o wl_text.o wl_main.o \
wl_debug.o wl_debug.o vi_comm.o
ROBJS = wl_draw.o ROBJS = wl_draw.o
SOBJS = $(OBJS) $(ROBJS) vi_svga.o SOBJS = $(OBJS) $(ROBJS) vi_svga.o
XOBJS = $(OBJS) $(ROBJS) vi_xlib.o XOBJS = $(OBJS) $(ROBJS) vi_xlib.o
......
Priority Levels: I > R > M (I, R required to be complete before release)
Program: P=PC Wolf3D, M=Mac Wolf3D, B=Both
P R - create a better "read direction" for menu movement
P M - convert while (Keyboard[sc_Blah]) IN_CheckAck() to IN_WaitKeyDown(sc..
P I - finish changing the game movement to the new style
P R - update input menus/config
P M - rewrite menu code
P R - update sound menus/config
P I - rewrite sound code: get rid of packed structs, clean up thread stuff
P R - openal sound
P I - fix issues (speed, hacks) with variable screen size
P M - BSP trees (or something similar), then OpenGL support
M R - port menu code (after fixed up)
M R - add sound
M M - complete/fix opengl mode
M M - add music (would need to RE the sound lib)
B I - complete savegame, config formats
M I - add SDL
B R - decide if to keep SVGA/X11 targets
B M - configure scripts?
B M - port to dreamcast?
B M - add compression to savegames/config
B I - play through (w/ sound and music) to make sure things work
B M - use stdint.h where appropiate
B M - finish serializing reads/writes, endian issues
P I - fix raycast bug where at certain points you can see through corners
B I - merge other TODO lists into this list
B M - use something like config file or getenv to point at data directories
P I - finish handling/mapping for all keys in sys. specific code
B I - add mouse support
B M - add joystick/gamepad support
Complete:
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
Control Menu: Control Menu:
* TODO * TODO
Sound Menu: Sound Menu:
* Sound Effects: * Digital Sound Effects:
- PCM - On [PCM]
- OPL2 - Off
* Sound Effects
- On [AdLib/OPL2]
- PC Speaker? - PC Speaker?
- None - Off
* Music: * Music:
- OPL2 - On [AdLib/OPL2]
- None - Off
* Sampling Rate:
- 44100
- 22050
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
* use int16_t, etc (stdint)
* finish serializing reads/writes, endian issues
* fix fix fix different size stuff
works alright at some res, but breaks on others currently
add support for resolution changing at any time?
probably will only support 320x200, 640x400, 960x600
* add ylookup? * add ylookup?
* remove farmapylookup? * remove farmapylookup?
* would be nice if Quit() used vsnprintf, etc * would be nice if Quit() used vsnprintf, etc
* actor walking through door is drawn in front of door: near end of E1M1 for * actor walking through door is drawn in front of door: near end of E1M1 for
example (is this reproducible?) example (is this reproducible?)
* getenv so that you can point an env. var to the proper dir
* rewrite hw (sound, input) code, remove stuff like SD_SetSoundMode
* fix the input code, everything is spread out... ideally everything should
work the same, let the input handler do it all instead
i think its safe for now to go with the scancodes as being the "universal"
key type, and for everything not scancode-based, have a function to
translate
* use static and const where appropriate * use static and const where appropriate
* menu code is a mess, always does things differently than the rest of the * menu code is a mess, always does things differently than the rest of the
code, it really needs to be cleaned up code, it really needs to be cleaned up
...@@ -101,3 +120,6 @@ Version 0x00000001 Data: (Official) ...@@ -101,3 +120,6 @@ Version 0x00000001 Data: (Official)
<undetermined but will be compressed> <undetermined but will be compressed>
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
fix:
void ControlMovement(objtype *ob) (wl_agent.c)
void UpdateInput() / void PollControls() (wl_play.c)
#ifndef __ID_HEADS_H__ #ifndef __ID_HEADS_H__
#define __ID_HEADS_H__ #define __ID_HEADS_H__
#ifdef _WIN32 #include <stdio.h>
#include <stdlib.h>
/* TODO: rename dosism, because for example djgpp has glob() */ #include <string.h>
#define DOSISM /* for junk which isn't abstracted (namely stuff in wl_menu.c with glob/findfirst and misc.c) */ #include <time.h>
#undef HAVE_FFBLK /* TODO: what to do with hacks like this */ #include <sys/stat.h>
#include <sys/types.h>
#define WIN32_LEAN_AND_MEAN #include <stdint.h>
#include <windows.h>
#include <io.h>
#include <dos.h>
#ifdef __cplusplus
typedef bool boolean;
#else
#define boolean BOOLEAN
#define false FALSE
#define true TRUE
#endif
#define ssize_t SSIZE_T
#else
#undef DOSISM
#include <unistd.h> #include <unistd.h>
#include <sys/time.h> #include <sys/time.h>
#include <values.h>
#include <glob.h> #include <glob.h>
#include <ctype.h>
#include <fcntl.h>
#include <math.h>
#ifdef __cplusplus #ifdef __cplusplus
typedef bool boolean; typedef bool boolean;
...@@ -37,20 +21,6 @@ typedef bool boolean; ...@@ -37,20 +21,6 @@ typedef bool boolean;
typedef enum { false, true } boolean; typedef enum { false, true } boolean;
#endif #endif
#endif
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <stdint.h>
#include <math.h>
#ifndef O_BINARY #ifndef O_BINARY
#define O_BINARY 0 #define O_BINARY 0
#endif #endif
...@@ -115,7 +85,7 @@ int MS_CheckParm(char *string); ...@@ -115,7 +85,7 @@ int MS_CheckParm(char *string);
void Quit(char *error); void Quit(char *error);
#undef PI #undef PI
#define PI 3.141592657 #define PI 3.1415926535897932384626433832795028841971693993751058209749445920
#define MAXTICS 10 #define MAXTICS 10
#define DEMOTICS 4 #define DEMOTICS 4
......
#include "wl_def.h" #include "wl_def.h"
#ifdef DOSISM /* TODO: bad name.. since djgpp code would use interrupt (maybe uclock?) most likely */
#define TICKCOUNT 70
long TimeCount;
double AdjClock = CLOCKS_PER_SEC / TICKCOUNT;
double LastClock;
void set_TimeCount(unsigned long count)
{
/* TODO: would using queryperformancecounter be better? */
TimeCount = count;
LastClock = clock();
}
unsigned long get_TimeCount()
{
return (unsigned long)(TimeCount + ((clock() - LastClock) / AdjClock));
}
#else /* DOSISM */
/* TimeCount from David Haslam -- dch@sirius.demon.co.uk */ /* TimeCount from David Haslam -- dch@sirius.demon.co.uk */
static struct timeval t0; static struct timeval t0;
...@@ -95,8 +73,6 @@ char *ultoa(unsigned long value, char *string, int radix) ...@@ -95,8 +73,6 @@ char *ultoa(unsigned long value, char *string, int radix)
return string; return string;
} }
#endif /* DOSISM */
/* from Dan Olson */ /* from Dan Olson */
static void put_dos2ansi(byte attrib) static void put_dos2ansi(byte attrib)
{ {
......
...@@ -10,8 +10,6 @@ void SavePCXRGBToFile(unsigned char *buf, int width, int height, char *name); ...@@ -10,8 +10,6 @@ void SavePCXRGBToFile(unsigned char *buf, int width, int height, char *name);
void set_TimeCount(unsigned long t); void set_TimeCount(unsigned long t);
unsigned long get_TimeCount(); unsigned long get_TimeCount();
#ifndef DOSISM
long filelength(int handle); long filelength(int handle);
#define stricmp strcasecmp #define stricmp strcasecmp
...@@ -22,8 +20,6 @@ char *itoa(int value, char *string, int radix); ...@@ -22,8 +20,6 @@ char *itoa(int value, char *string, int radix);
char *ltoa(long value, char *string, int radix); char *ltoa(long value, char *string, int radix);
char *ultoa(unsigned long value, char *string, int radix); char *ultoa(unsigned long value, char *string, int radix);
#endif /* DOSISM */
uint16_t SwapInt16L(uint16_t i); uint16_t SwapInt16L(uint16_t i);
uint32_t SwapInt32L(uint32_t i); uint32_t SwapInt32L(uint32_t i);
......
This diff is collapsed.
...@@ -47,26 +47,14 @@ typedef int8_t ScanCode; ...@@ -47,26 +47,14 @@ typedef int8_t ScanCode;
#define sc_LShift 0x2a #define sc_LShift 0x2a
#define sc_RShift 0x36 #define sc_RShift 0x36
/* TODO */ #define sc_UpArrow 0x48
/* #define sc_DownArrow 0x50
#define sc_UpArrow 0x48 #define sc_LeftArrow 0x4b
#define sc_DownArrow 0x50 #define sc_RightArrow 0x4d
#define sc_LeftArrow 0x4b
#define sc_RightArrow 0x4d
#define sc_Home 0x47 #define sc_Home 0x47
#define sc_End 0x4f #define sc_End 0x4f
#define sc_PgUp 0x49 #define sc_PgUp 0x49
#define sc_PgDn 0x51 #define sc_PgDn 0x51
*/
/* SVGAlib specific */
#define sc_UpArrow 103
#define sc_DownArrow 108
#define sc_LeftArrow 105
#define sc_RightArrow 106
#define sc_Home 102
#define sc_End 107
#define sc_PgUp 104
#define sc_PgDn 109
#define sc_Insert 0x52 #define sc_Insert 0x52
#define sc_Delete 0x53 #define sc_Delete 0x53
...@@ -163,7 +151,6 @@ typedef struct { ...@@ -163,7 +151,6 @@ typedef struct {
left, right, downleft, down, downright; left, right, downleft, down, downright;
} KeyboardDef; } KeyboardDef;
// Global variables
extern boolean Keyboard[], MousePresent, JoysPresent[]; extern boolean Keyboard[], MousePresent, JoysPresent[];
extern boolean Paused; extern boolean Paused;
...@@ -174,6 +161,8 @@ extern ControlType Controls[MaxPlayers]; ...@@ -174,6 +161,8 @@ extern ControlType Controls[MaxPlayers];
#define IN_KeyDown(code) (Keyboard[(code)]) #define IN_KeyDown(code) (Keyboard[(code)])
extern void INL_Update();
extern void IN_Startup(), IN_Shutdown(), IN_ClearKeysDown(), extern void IN_Startup(), IN_Shutdown(), IN_ClearKeysDown(),
IN_ReadControl(int,ControlInfo *), IN_ReadControl(int,ControlInfo *),
IN_GetJoyAbs(word joy,word *xp,word *yp), IN_GetJoyAbs(word joy,word *xp,word *yp),
...@@ -183,7 +172,6 @@ extern void IN_Startup(), IN_Shutdown(), IN_ClearKeysDown(), ...@@ -183,7 +172,6 @@ extern void IN_Startup(), IN_Shutdown(), IN_ClearKeysDown(),
extern boolean IN_UserInput(longword delay); extern boolean IN_UserInput(longword delay);
extern char *IN_GetScanName(ScanCode); extern char *IN_GetScanName(ScanCode);
byte IN_MouseButtons(); byte IN_MouseButtons();
byte IN_JoyButtons(); byte IN_JoyButtons();
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -106,7 +106,7 @@ void CheckWeaponChange() ...@@ -106,7 +106,7 @@ void CheckWeaponChange()
======================= =======================
*/ */
void ControlMovement (objtype *ob) void ControlMovement(objtype *ob)
{ {
int angle; int angle;
int angleunits; int angleunits;
...@@ -1221,7 +1221,7 @@ void T_Attack(objtype *ob) ...@@ -1221,7 +1221,7 @@ void T_Attack(objtype *ob)
if ( buttonstate[bt_attack] && !buttonheld[bt_attack]) if ( buttonstate[bt_attack] && !buttonheld[bt_attack])
buttonstate[bt_attack] = false; buttonstate[bt_attack] = false;
ControlMovement (ob); ControlMovement(ob);
if (gamestate.victoryflag) // watching the BJ actor if (gamestate.victoryflag) // watching the BJ actor
return; return;
......
...@@ -338,7 +338,7 @@ static void DrawScaleds() ...@@ -338,7 +338,7 @@ static void DrawScaleds()
} }
//========================================================================== /* ======================================================================== */
/* /*
============== ==============
...@@ -603,7 +603,7 @@ static void ClearScreen() ...@@ -603,7 +603,7 @@ static void ClearScreen()
*/ */
#ifndef DRAWCEIL #ifndef DRAWCEIL
/* #define DRAWCEIL */ /* #define DRAWCEIL */
#endif #endif
void ThreeDRefresh() void ThreeDRefresh()
...@@ -662,51 +662,51 @@ static void ScaledDrawTrans(byte *gfx, int count, byte *vid, unsigned int frac, ...@@ -662,51 +662,51 @@ static void ScaledDrawTrans(byte *gfx, int count, byte *vid, unsigned int frac,
static void ScaleLine(unsigned int height, byte *source, int x) static void ScaleLine(unsigned int height, byte *source, int x)
{ {
unsigned long TheFrac; unsigned int y, frac, delta;
unsigned long y;
if (height) { if (height) {
TheFrac = (64 << 16) / height; frac = (64 << 16) / height;
delta = (64 << 16) - frac*height;
if (height < viewheight) { if (height < viewheight) {
y = yoffset + (viewheight - height) / 2; y = yoffset + (viewheight - height) / 2;
ScaledDraw(source, height, gfxbuf + (y * vwidth) + x + xoffset, ScaledDraw(source, height, gfxbuf + (y * vwidth) + x + xoffset,
0, TheFrac); delta, frac);
return; return;
} }
y = (height - viewheight) / 2; y = (height - viewheight) / 2;
y *= TheFrac; y *= frac;
ScaledDraw(source, viewheight, gfxbuf + (yoffset * vwidth) + x + xoffset, ScaledDraw(source, viewheight, gfxbuf + (yoffset * vwidth) + x + xoffset,
y, TheFrac); y+delta, frac);
} }
} }
static void ScaleLineTrans(unsigned int height, byte *source, int x) static void ScaleLineTrans(unsigned int height, byte *source, int x)
{ {
unsigned long TheFrac; unsigned int y, frac, delta;
unsigned long y;
if (height) { if (height) {
TheFrac = (64 << 16) / height; frac = (64 << 16) / height;
delta = (64 << 16) - frac*height;
if (height < viewheight) { if (height < viewheight) {
y = yoffset + (viewheight - height) / 2; y = yoffset + (viewheight - height) / 2;
ScaledDrawTrans(source, height, gfxbuf + (y * vwidth) + x + xoffset, ScaledDrawTrans(source, height, gfxbuf + (y * vwidth) + x + xoffset,
0, TheFrac); delta, frac);
return; return;
} }
y = (height - viewheight) / 2; y = (height - viewheight) / 2;
y *= TheFrac; y *= frac;
ScaledDrawTrans(&source[y >> 24], viewheight, gfxbuf + (yoffset * vwidth) + x + xoffset, ScaledDrawTrans(&source[y >> 24], viewheight, gfxbuf + (yoffset * vwidth) + x + xoffset,
y, TheFrac); y+delta, frac);
} }
} }
...@@ -1047,9 +1047,9 @@ static void AsmRefresh() ...@@ -1047,9 +1047,9 @@ static void AsmRefresh()
int xstep, ystep; int xstep, ystep;
midangle = viewangle*(FINEANGLES/ANGLES); midangle = viewangle*(FINEANGLES/ANGLES);
xpartialdown = viewx&(TILEGLOBAL-1); xpartialdown = (viewx&(TILEGLOBAL-1));
xpartialup = TILEGLOBAL-xpartialdown; xpartialup = TILEGLOBAL-xpartialdown;
ypartialdown = viewy&(TILEGLOBAL-1); ypartialdown = (viewy&(TILEGLOBAL-1));
ypartialup = TILEGLOBAL-ypartialdown; ypartialup = TILEGLOBAL-ypartialdown;
focaltx = viewx>>TILESHIFT; focaltx = viewx>>TILESHIFT;
...@@ -1101,11 +1101,11 @@ for (postx = 0; postx < viewwidth; postx++) { ...@@ -1101,11 +1101,11 @@ for (postx = 0; postx < viewwidth; postx++) {
goto entry90; goto entry90;
} }
/* add tilestep to fix raycasting problems? */
yintercept = viewy + xpartialbyystep(); yintercept = viewy + xpartialbyystep(); // + xtilestep;
xtile = focaltx + xtilestep; xtile = focaltx + xtilestep;
xintercept = viewx + ypartialbyxstep(); xintercept = viewx + ypartialbyxstep(); // + ytilestep;
ytile = focalty + ytilestep; ytile = focalty + ytilestep;
/* CORE LOOP */ /* CORE LOOP */
...@@ -1113,13 +1113,14 @@ for (postx = 0; postx < viewwidth; postx++) { ...@@ -1113,13 +1113,14 @@ for (postx = 0; postx < viewwidth; postx++) {
#define TILE(n) ((n)>>16) #define TILE(n) ((n)>>16)
/* check intersections with vertical walls */ /* check intersections with vertical walls */
vertcheck: vertcheck:
if (!samey(yintercept, ytile)) if (!samey(yintercept, ytile))
goto horizentry; goto horizentry;
vertentry: vertentry:
tilehit = tilemap[xtile][TILE(yintercept)]; tilehit = tilemap[xtile][TILE(yintercept)];
/* printf("vert: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d\n", postx, tilehit, xtile, ytile, xintercept, yintercept, xpartialup, xpartialdown, ypartialup, ypartialdown, xpartial, ypartial, doorhit, angle, midangle, focaltx, focalty, xstep, ystep); */
if (tilehit) { if (tilehit) {
if (tilehit & 0x80) { if (tilehit & 0x80) {
if (tilehit & 0x40) { if (tilehit & 0x40) {
...@@ -1167,7 +1168,8 @@ horizcheck: ...@@ -1167,7 +1168,8 @@ horizcheck:
horizentry: horizentry:
tilehit = tilemap[TILE(xintercept)][ytile]; tilehit = tilemap[TILE(xintercept)][ytile];
/* printf("horz: %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d\n", postx, tilehit, xtile, ytile, xintercept, yintercept, xpartialup, xpartialdown, ypartialup, ypartialdown, xpartial, ypartial, doorhit, angle, midangle, focaltx, focalty, xstep, ystep); */
if (tilehit) { if (tilehit) {
if (tilehit & 0x80) { if (tilehit & 0x80) {
if (tilehit & 0x40) { if (tilehit & 0x40) {
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
============================================================================= =============================================================================
*/ */
#define FOCALLENGTH (0x5700l) // in global coordinates #define FOCALLENGTH 0x5700 // in global coordinates
#define VIEWGLOBAL 0x10000 // globals visable flush to wall #define VIEWGLOBAL 0x10000 // globals visable flush to wall
char str[80], str2[20]; char str[80], str2[20];
...@@ -26,7 +26,7 @@ int vwidth, vheight; /* size of screen */ ...@@ -26,7 +26,7 @@ int vwidth, vheight; /* size of screen */
int viewsize; int viewsize;
int centerx; int centerx;
int shootdelta; // pixels away from centerx a target can be int shootdelta; /* pixels away from centerx a target can be */
fixed scale; fixed scale;
long heightnumerator; long heightnumerator;
...@@ -36,7 +36,7 @@ int mouseadjustment; ...@@ -36,7 +36,7 @@ int mouseadjustment;
long frameon; long frameon;
long lasttimecount; long lasttimecount;
fixed viewsin, viewcos; fixed viewsin, viewcos;
fixed viewx, viewy; // the focal point fixed viewx, viewy; /* the focal point */
int pixelangle[MAXVIEWWIDTH]; int pixelangle[MAXVIEWWIDTH];
long finetangent[FINEANGLES/4]; long finetangent[FINEANGLES/4];
int horizwall[MAXWALLTILES], vertwall[MAXWALLTILES]; int horizwall[MAXWALLTILES], vertwall[MAXWALLTILES];
...@@ -740,9 +740,9 @@ int MS_CheckParm(char *check) ...@@ -740,9 +740,9 @@ int MS_CheckParm(char *check)
for (i = 1; i < _argc; i++) { for (i = 1; i < _argc; i++) {
parm = _argv[i]; parm = _argv[i];
while (!isalpha(*parm)) // skip - / \ etc.. in front of parm while (!isalpha(*parm)) // skip - / \ etc.. in front of parm
if (!*parm++) if (!*parm++)
break; // hit end of string without an alphanum break; // hit end of string without an alphanum
if (!stricmp(check, parm)) if (!stricmp(check, parm))
return i; return i;
...@@ -762,7 +762,6 @@ int MS_CheckParm(char *check) ...@@ -762,7 +762,6 @@ int MS_CheckParm(char *check)
static int wolfdigimap[] = static int wolfdigimap[] =
{ {
// These first sounds are in the upload version
#ifndef SPEAR #ifndef SPEAR
HALTSND, 0, HALTSND, 0,
DOGBARKSND, 1, DOGBARKSND, 1,
...@@ -786,7 +785,6 @@ static int wolfdigimap[] = ...@@ -786,7 +785,6 @@ static int wolfdigimap[] =
SLURPIESND, 22, SLURPIESND, 22,
YEAHSND, 32, YEAHSND, 32,
#ifndef UPLOAD #ifndef UPLOAD
// These are in all other episodes
DOGDEATHSND, 16, DOGDEATHSND, 16,
AHHHGSND, 17, AHHHGSND, 17,
DIESND, 18, DIESND, 18,
...@@ -815,10 +813,8 @@ static int wolfdigimap[] = ...@@ -815,10 +813,8 @@ static int wolfdigimap[] =
MEINSND, 44, // EPISODE 6 BOSS DIE MEINSND, 44, // EPISODE 6 BOSS DIE
ROSESND, 45, // EPISODE 5 BOSS DIE ROSESND, 45, // EPISODE 5 BOSS DIE
#endif #endif
#else
// #else /* SPEAR OF DESTINY DIGISOUNDS */
// SPEAR OF DESTINY DIGISOUNDS
//
HALTSND, 0, HALTSND, 0,
CLOSEDOORSND, 2, CLOSEDOORSND, 2,
OPENDOORSND, 3, OPENDOORSND, 3,
...@@ -866,7 +862,6 @@ static int wolfdigimap[] = ...@@ -866,7 +862,6 @@ static int wolfdigimap[] =
LASTSOUND LASTSOUND
}; };
void InitDigiMap() void InitDigiMap()
{ {
int *map; int *map;
...@@ -875,7 +870,7 @@ void InitDigiMap() ...@@ -875,7 +870,7 @@ void InitDigiMap()
DigiMap[map[0]] = map[1]; DigiMap[map[0]] = map[1];
} }
//=========================================================================== /* ======================================================================== */
/* /*
================== ==================
...@@ -895,14 +890,15 @@ void BuildTables() ...@@ -895,14 +890,15 @@ void BuildTables()
/* calculate fine tangents */ /* calculate fine tangents */
for (i = 0; i < FINEANGLES/8; i++) { finetangent[0] = 0;
for (i = 1; i < FINEANGLES/8; i++) {
tang = tan((double)i/radtoint); tang = tan((double)i/radtoint);
finetangent[i] = tang*TILEGLOBAL; finetangent[i] = tang*TILEGLOBAL;
finetangent[FINEANGLES/4-1-i] = 1/tang*TILEGLOBAL; finetangent[FINEANGLES/4-1-i] = TILEGLOBAL/tang;
} }
/* fight off asymptotic behaviour at 90 degrees */ /* fight off asymptotic behaviour at 90 degrees */
finetangent[FINEANGLES/4-1] = finetangent[FINEANGLES/4-2]; finetangent[FINEANGLES/4-1] = finetangent[FINEANGLES/4-2]+1;
// //
// costable overlays sintable with a quarter phase shift // costable overlays sintable with a quarter phase shift
...@@ -1085,7 +1081,7 @@ CP_itemtype MusicMenu[]= ...@@ -1085,7 +1081,7 @@ CP_itemtype MusicMenu[]=
}; };
#endif #endif
static int songs[]= static const int songs[] =
{ {
#ifndef SPEAR #ifndef SPEAR
GETTHEM_MUS, GETTHEM_MUS,
...@@ -1418,7 +1414,7 @@ void DemoLoop() ...@@ -1418,7 +1414,7 @@ void DemoLoop()
VW_FadeOut(); VW_FadeOut();
if (IN_KeyDown(sc_Tab) && MS_CheckParm("debugmode")) if (IN_KeyDown(sc_Tab) && MS_CheckParm("debugmode"))
RecordDemo (); RecordDemo();
else else
US_ControlPanel(0); US_ControlPanel(0);
...@@ -1432,7 +1428,7 @@ void DemoLoop() ...@@ -1432,7 +1428,7 @@ void DemoLoop()
} }
//=========================================================================== /* ======================================================================== */
/* /*
......
...@@ -220,7 +220,7 @@ static char ...@@ -220,7 +220,7 @@ static char
{ {
1,0xe,0xf,0x1d,sc_LShift,0x39,0x3a,0x3b,0x3c,0x3d,0x3e, 1,0xe,0xf,0x1d,sc_LShift,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,
0x3f,0x40,0x41,0x42,0x43,0x44,0x57,0x59,0x46,0x1c,sc_RShift, 0x3f,0x40,0x41,0x42,0x43,0x44,0x57,0x59,0x46,0x1c,sc_RShift,
0x37,0x38,0x47,0x49,0x4f,0x51,0x52,0x53,0x45,sc_UpArrow, 0x37,0x38,sc_Home,sc_PgUp,sc_End,sc_PgDn,sc_Insert,sc_Delete,0x45,sc_UpArrow,
sc_DownArrow,sc_LeftArrow,sc_RightArrow,0x00 sc_DownArrow,sc_LeftArrow,sc_RightArrow,0x00
}, },
*ExtScanNames[] = // Names corresponding to ExtScanCodes *ExtScanNames[] = // Names corresponding to ExtScanCodes
......
...@@ -47,7 +47,7 @@ memptr demobuffer; ...@@ -47,7 +47,7 @@ memptr demobuffer;
// //
// curent user input // curent user input
// //
int controlx,controly; // range from -100 to 100 per tic int controlx,controly; /* range from -100 to 100 per tic */
boolean buttonstate[NUMBUTTONS]; boolean buttonstate[NUMBUTTONS];
static void RemoveObj(objtype *gone); static void RemoveObj(objtype *gone);
...@@ -61,7 +61,7 @@ static void RemoveObj(objtype *gone); ...@@ -61,7 +61,7 @@ static void RemoveObj(objtype *gone);
*/ */
/* LIST OF SONGS FOR EACH VERSION */ /* LIST OF SONGS FOR EACH VERSION */
static int songs[]= static const int songs[]=
{ {
#ifndef SPEAR #ifndef SPEAR
/* Episode One */ /* Episode One */
...@@ -263,7 +263,6 @@ void PollJoystickButtons() ...@@ -263,7 +263,6 @@ void PollJoystickButtons()
} }
} }
/* /*
=================== ===================
= =
...@@ -315,8 +314,6 @@ void PollMouseMove() ...@@ -315,8 +314,6 @@ void PollMouseMove()
controly += mouseymove*20/(13-mouseadjustment); controly += mouseymove*20/(13-mouseadjustment);
} }
/* /*
=================== ===================
= =
...@@ -355,6 +352,30 @@ void PollJoystickMove() ...@@ -355,6 +352,30 @@ void PollJoystickMove()
} }
} }
void UpdateInput()
{
//
// get button states
//
PollKeyboardButtons();
if (mouseenabled)
PollMouseButtons();
if (joystickenabled)
PollJoystickButtons();
//
// get movements
//
PollKeyboardMove();
if (mouseenabled)
PollMouseMove();
if (joystickenabled)
PollJoystickMove();
}
/* /*
=================== ===================
...@@ -404,33 +425,11 @@ void PollControls() ...@@ -404,33 +425,11 @@ void PollControls()
return; return;
} }
//
// get button states
//
/* Update keys */ /* Update keys */
IN_CheckAck(); IN_CheckAck();
PollKeyboardButtons(); UpdateInput();
if (mouseenabled)
PollMouseButtons();
if (joystickenabled)
PollJoystickButtons();
//
// get movements
//
PollKeyboardMove();
if (mouseenabled)
PollMouseMove();
if (joystickenabled)
PollJoystickMove();
// //
// bound movement to a maximum // bound movement to a maximum
// //
...@@ -740,9 +739,7 @@ void InitActorList() ...@@ -740,9 +739,7 @@ void InitActorList()
objfreelist = &objlist[0]; objfreelist = &objlist[0];
lastobj = NULL; lastobj = NULL;
// /* give the player the first free spots */
// give the player the first free spots
//
GetNewActor(); GetNewActor();
player = new; player = new;
...@@ -799,7 +796,7 @@ void GetNewActor() ...@@ -799,7 +796,7 @@ void GetNewActor()
static void RemoveObj(objtype *gone) static void RemoveObj(objtype *gone)
{ {
if (gone == player) if (gone == player)
Quit ("RemoveObj: Tried to remove the player!"); Quit("RemoveObj: Tried to remove the player!");
gone->state = s_none; gone->state = s_none;
...@@ -879,7 +876,7 @@ void StartMusic() ...@@ -879,7 +876,7 @@ void StartMusic()
byte redshifts[NUMREDSHIFTS][768]; byte redshifts[NUMREDSHIFTS][768];
byte whiteshifts[NUMREDSHIFTS][768]; byte whiteshifts[NUMREDSHIFTS][768];
int damagecount,bonuscount; int damagecount,bonuscount;
boolean palshifted; boolean palshifted;
/* /*
...@@ -895,7 +892,7 @@ void InitRedShifts() ...@@ -895,7 +892,7 @@ void InitRedShifts()
byte *workptr; byte *workptr;
const byte *baseptr; const byte *baseptr;
int i,j,delta; int i,j,delta;
// //
......
...@@ -99,10 +99,10 @@ void NewState(objtype *ob, int state) /* stateenum */ ...@@ -99,10 +99,10 @@ void NewState(objtype *ob, int state) /* stateenum */
= =
= If move is either clear or blocked only by a door, returns TRUE and sets = If move is either clear or blocked only by a door, returns TRUE and sets
= =
= ob->tilex = new destination = ob->tilex = new destination
= ob->tiley = ob->tiley
= ob->areanumber = the floor tile number (0-(NUMAREAS-1)) of destination = ob->areanumber = the floor tile number (0-(NUMAREAS-1)) of destination
= ob->distance = TILEGLOBAl, or -doornumber if a door is blocking the way = ob->distance = TILEGLOBAL, or -doornumber if a door is blocking the way
= =
= If a door is in the way, an OpenDoor call is made to start it opening. = If a door is in the way, an OpenDoor call is made to start it opening.
= The actor code should wait until = The actor code should wait until
...@@ -113,7 +113,7 @@ void NewState(objtype *ob, int state) /* stateenum */ ...@@ -113,7 +113,7 @@ void NewState(objtype *ob, int state) /* stateenum */
*/ */
#define CHECKDIAG(x,y) \ #define CHECKDIAG(x,y) \
{ \ { \
temp = actorat[x][y]; \ temp = actorat[x][y]; \
if (temp) \ if (temp) \
{ \ { \
...@@ -125,7 +125,7 @@ void NewState(objtype *ob, int state) /* stateenum */ ...@@ -125,7 +125,7 @@ void NewState(objtype *ob, int state) /* stateenum */
} }
#define CHECKSIDE(x,y) \ #define CHECKSIDE(x,y) \
{ \ { \
temp = actorat[x][y]; \ temp = actorat[x][y]; \
if (temp) \ if (temp) \
{ \ { \
......
...@@ -557,7 +557,7 @@ void CacheLayoutGraphics() ...@@ -557,7 +557,7 @@ void CacheLayoutGraphics()
} }
if (ch == 'T') // timed draw graphic command, so mark graphics if (ch == 'T') // timed draw graphic command, so mark graphics
{ {
ParseTimedCommand (); ParseTimedCommand();
CA_CacheGrChunk(picnum); CA_CacheGrChunk(picnum);
} }
} }
...@@ -579,8 +579,8 @@ void CacheLayoutGraphics() ...@@ -579,8 +579,8 @@ void CacheLayoutGraphics()
void ShowArticle(char *article) void ShowArticle(char *article)
{ {
unsigned oldfontnumber; unsigned oldfontnumber;
boolean newpage,firstpage; boolean newpage, firstpage;
text = article; text = article;
...@@ -588,7 +588,7 @@ void ShowArticle(char *article) ...@@ -588,7 +588,7 @@ void ShowArticle(char *article)
fontnumber = 0; fontnumber = 0;
CA_CacheGrChunk(STARTFONT); CA_CacheGrChunk(STARTFONT);
VW_Bar (0,0,320,200,BACKCOLOR); VW_Bar (0,0,320,200,BACKCOLOR);
CacheLayoutGraphics (); CacheLayoutGraphics();
newpage = true; newpage = true;
firstpage = true; firstpage = true;
...@@ -598,18 +598,17 @@ void ShowArticle(char *article) ...@@ -598,18 +598,17 @@ void ShowArticle(char *article)
if (newpage) if (newpage)
{ {
newpage = false; newpage = false;
PageLayout (true); PageLayout(true);
VW_UpdateScreen (); VW_UpdateScreen();
if (firstpage) if (firstpage)
{ {
VL_FadeIn(0,255,gamepal,10); VL_FadeIn(0,255,gamepal,10);
// VW_FadeIn ()
firstpage = false; firstpage = false;
} }
} }
LastScan = 0; LastScan = 0;
while (!LastScan) IN_CheckAck(); /* TODO: update events */ while (!LastScan) IN_CheckAck(); /* update events */
switch (LastScan) switch (LastScan)
{ {
...@@ -627,7 +626,7 @@ void ShowArticle(char *article) ...@@ -627,7 +626,7 @@ void ShowArticle(char *article)
case sc_Enter: case sc_Enter:
case sc_DownArrow: case sc_DownArrow:
case sc_PgDn: case sc_PgDn:
case sc_RightArrow: // the text allready points at next page case sc_RightArrow: // the text already points at next page
if (pagenum<numpages) if (pagenum<numpages)
{ {
newpage = true; newpage = true;
...@@ -645,10 +644,10 @@ void ShowArticle(char *article) ...@@ -645,10 +644,10 @@ void ShowArticle(char *article)
} }
//=========================================================================== /* ======================================================================== */
int endextern = T_ENDART1; #define endextern T_ENDART1
int helpextern = T_HELPART; #define helpextern T_HELPART
/* /*
================= =================
...@@ -691,7 +690,7 @@ void EndText() ...@@ -691,7 +690,7 @@ void EndText()
CA_UpLevel(); CA_UpLevel();
artnum = endextern+gamestate.episode; artnum = endextern+gamestate.episode;
CA_CacheGrChunk (artnum); CA_CacheGrChunk(artnum);
text = (char *)grsegs[artnum]; text = (char *)grsegs[artnum];
ShowArticle(text); ShowArticle(text);
......
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