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
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_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
SOBJS = $(OBJS) $(ROBJS) vi_svga.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:
* TODO
Sound Menu:
* Sound Effects:
- PCM
- OPL2
* Digital Sound Effects:
- On [PCM]
- Off
* Sound Effects
- On [AdLib/OPL2]
- PC Speaker?
- None
- Off
* Music:
- OPL2
- None
* Sampling Rate:
- 44100
- 22050
- On [AdLib/OPL2]
- Off
------------------------------------------------------------------------------
* 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?
* remove farmapylookup?
* would be nice if Quit() used vsnprintf, etc
* actor walking through door is drawn in front of door: near end of E1M1 for
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
* menu code is a mess, always does things differently than the rest of the
code, it really needs to be cleaned up
......@@ -101,3 +120,6 @@ Version 0x00000001 Data: (Official)
<undetermined but will be compressed>
------------------------------------------------------------------------------
fix:
void ControlMovement(objtype *ob) (wl_agent.c)
void UpdateInput() / void PollControls() (wl_play.c)
#ifndef __ID_HEADS_H__
#define __ID_HEADS_H__
#ifdef _WIN32
/* TODO: rename dosism, because for example djgpp has glob() */
#define DOSISM /* for junk which isn't abstracted (namely stuff in wl_menu.c with glob/findfirst and misc.c) */
#undef HAVE_FFBLK /* TODO: what to do with hacks like this */
#define WIN32_LEAN_AND_MEAN
#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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <stdint.h>
#include <unistd.h>
#include <sys/time.h>
#include <values.h>
#include <glob.h>
#include <ctype.h>
#include <fcntl.h>
#include <math.h>
#ifdef __cplusplus
typedef bool boolean;
......@@ -37,20 +21,6 @@ typedef bool boolean;
typedef enum { false, true } boolean;
#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
#define O_BINARY 0
#endif
......@@ -115,7 +85,7 @@ int MS_CheckParm(char *string);
void Quit(char *error);
#undef PI
#define PI 3.141592657
#define PI 3.1415926535897932384626433832795028841971693993751058209749445920
#define MAXTICS 10
#define DEMOTICS 4
......
#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 */
static struct timeval t0;
......@@ -95,8 +73,6 @@ char *ultoa(unsigned long value, char *string, int radix)
return string;
}
#endif /* DOSISM */
/* from Dan Olson */
static void put_dos2ansi(byte attrib)
{
......
......@@ -10,8 +10,6 @@ void SavePCXRGBToFile(unsigned char *buf, int width, int height, char *name);
void set_TimeCount(unsigned long t);
unsigned long get_TimeCount();
#ifndef DOSISM
long filelength(int handle);
#define stricmp strcasecmp
......@@ -22,8 +20,6 @@ char *itoa(int value, char *string, int radix);
char *ltoa(long value, char *string, int radix);
char *ultoa(unsigned long value, char *string, int radix);
#endif /* DOSISM */
uint16_t SwapInt16L(uint16_t i);
uint32_t SwapInt32L(uint32_t i);
......
This diff is collapsed.
......@@ -47,8 +47,6 @@ typedef int8_t ScanCode;
#define sc_LShift 0x2a
#define sc_RShift 0x36
/* TODO */
/*
#define sc_UpArrow 0x48
#define sc_DownArrow 0x50
#define sc_LeftArrow 0x4b
......@@ -57,16 +55,6 @@ typedef int8_t ScanCode;
#define sc_End 0x4f
#define sc_PgUp 0x49
#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_Delete 0x53
......@@ -163,7 +151,6 @@ typedef struct {
left, right, downleft, down, downright;
} KeyboardDef;
// Global variables
extern boolean Keyboard[], MousePresent, JoysPresent[];
extern boolean Paused;
......@@ -174,6 +161,8 @@ extern ControlType Controls[MaxPlayers];
#define IN_KeyDown(code) (Keyboard[(code)])
extern void INL_Update();
extern void IN_Startup(), IN_Shutdown(), IN_ClearKeysDown(),
IN_ReadControl(int,ControlInfo *),
IN_GetJoyAbs(word joy,word *xp,word *yp),
......@@ -183,7 +172,6 @@ extern void IN_Startup(), IN_Shutdown(), IN_ClearKeysDown(),
extern boolean IN_UserInput(longword delay);
extern char *IN_GetScanName(ScanCode);
byte IN_MouseButtons();
byte IN_JoyButtons();
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -106,7 +106,7 @@ void CheckWeaponChange()
=======================
*/
void ControlMovement (objtype *ob)
void ControlMovement(objtype *ob)
{
int angle;
int angleunits;
......@@ -1221,7 +1221,7 @@ void T_Attack(objtype *ob)
if ( buttonstate[bt_attack] && !buttonheld[bt_attack])
buttonstate[bt_attack] = false;
ControlMovement (ob);
ControlMovement(ob);
if (gamestate.victoryflag) // watching the BJ actor
return;
......
......@@ -338,7 +338,7 @@ static void DrawScaleds()
}
//==========================================================================
/* ======================================================================== */
/*
==============
......@@ -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)
{
unsigned long TheFrac;
unsigned long y;
unsigned int y, frac, delta;
if (height) {
TheFrac = (64 << 16) / height;
frac = (64 << 16) / height;
delta = (64 << 16) - frac*height;
if (height < viewheight) {
y = yoffset + (viewheight - height) / 2;
ScaledDraw(source, height, gfxbuf + (y * vwidth) + x + xoffset,
0, TheFrac);
delta, frac);
return;
}
y = (height - viewheight) / 2;
y *= TheFrac;
y *= frac;
ScaledDraw(source, viewheight, gfxbuf + (yoffset * vwidth) + x + xoffset,
y, TheFrac);
y+delta, frac);
}
}
static void ScaleLineTrans(unsigned int height, byte *source, int x)
{
unsigned long TheFrac;
unsigned long y;
unsigned int y, frac, delta;
if (height) {
TheFrac = (64 << 16) / height;
frac = (64 << 16) / height;
delta = (64 << 16) - frac*height;
if (height < viewheight) {
y = yoffset + (viewheight - height) / 2;
ScaledDrawTrans(source, height, gfxbuf + (y * vwidth) + x + xoffset,
0, TheFrac);
delta, frac);
return;
}
y = (height - viewheight) / 2;
y *= TheFrac;
y *= frac;
ScaledDrawTrans(&source[y >> 24], viewheight, gfxbuf + (yoffset * vwidth) + x + xoffset,
y, TheFrac);
y+delta, frac);
}
}
......@@ -1047,9 +1047,9 @@ static void AsmRefresh()
int xstep, ystep;
midangle = viewangle*(FINEANGLES/ANGLES);
xpartialdown = viewx&(TILEGLOBAL-1);
xpartialdown = (viewx&(TILEGLOBAL-1));
xpartialup = TILEGLOBAL-xpartialdown;
ypartialdown = viewy&(TILEGLOBAL-1);
ypartialdown = (viewy&(TILEGLOBAL-1));
ypartialup = TILEGLOBAL-ypartialdown;
focaltx = viewx>>TILESHIFT;
......@@ -1101,11 +1101,11 @@ for (postx = 0; postx < viewwidth; postx++) {
goto entry90;
}
yintercept = viewy + xpartialbyystep();
/* add tilestep to fix raycasting problems? */
yintercept = viewy + xpartialbyystep(); // + xtilestep;
xtile = focaltx + xtilestep;
xintercept = viewx + ypartialbyxstep();
xintercept = viewx + ypartialbyxstep(); // + ytilestep;
ytile = focalty + ytilestep;
/* CORE LOOP */
......@@ -1113,12 +1113,13 @@ for (postx = 0; postx < viewwidth; postx++) {
#define TILE(n) ((n)>>16)
/* check intersections with vertical walls */
vertcheck:
vertcheck:
if (!samey(yintercept, ytile))
goto horizentry;
vertentry:
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 & 0x80) {
......@@ -1167,6 +1168,7 @@ horizcheck:
horizentry:
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 & 0x80) {
......
......@@ -12,7 +12,7 @@
=============================================================================
*/
#define FOCALLENGTH (0x5700l) // in global coordinates
#define FOCALLENGTH 0x5700 // in global coordinates
#define VIEWGLOBAL 0x10000 // globals visable flush to wall
char str[80], str2[20];
......@@ -26,7 +26,7 @@ int vwidth, vheight; /* size of screen */
int viewsize;
int centerx;
int shootdelta; // pixels away from centerx a target can be
int shootdelta; /* pixels away from centerx a target can be */
fixed scale;
long heightnumerator;
......@@ -36,7 +36,7 @@ int mouseadjustment;
long frameon;
long lasttimecount;
fixed viewsin, viewcos;
fixed viewx, viewy; // the focal point
fixed viewx, viewy; /* the focal point */
int pixelangle[MAXVIEWWIDTH];
long finetangent[FINEANGLES/4];
int horizwall[MAXWALLTILES], vertwall[MAXWALLTILES];
......@@ -762,7 +762,6 @@ int MS_CheckParm(char *check)
static int wolfdigimap[] =
{
// These first sounds are in the upload version
#ifndef SPEAR
HALTSND, 0,
DOGBARKSND, 1,
......@@ -786,7 +785,6 @@ static int wolfdigimap[] =
SLURPIESND, 22,
YEAHSND, 32,
#ifndef UPLOAD
// These are in all other episodes
DOGDEATHSND, 16,
AHHHGSND, 17,
DIESND, 18,
......@@ -815,10 +813,8 @@ static int wolfdigimap[] =
MEINSND, 44, // EPISODE 6 BOSS DIE
ROSESND, 45, // EPISODE 5 BOSS DIE
#endif
#else
//
// SPEAR OF DESTINY DIGISOUNDS
//
#else /* SPEAR OF DESTINY DIGISOUNDS */
HALTSND, 0,
CLOSEDOORSND, 2,
OPENDOORSND, 3,
......@@ -866,7 +862,6 @@ static int wolfdigimap[] =
LASTSOUND
};
void InitDigiMap()
{
int *map;
......@@ -875,7 +870,7 @@ void InitDigiMap()
DigiMap[map[0]] = map[1];
}
//===========================================================================
/* ======================================================================== */
/*
==================
......@@ -895,14 +890,15 @@ void BuildTables()
/* 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);
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 */
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
......@@ -1085,7 +1081,7 @@ CP_itemtype MusicMenu[]=
};
#endif
static int songs[]=
static const int songs[] =
{
#ifndef SPEAR
GETTHEM_MUS,
......@@ -1418,7 +1414,7 @@ void DemoLoop()
VW_FadeOut();
if (IN_KeyDown(sc_Tab) && MS_CheckParm("debugmode"))
RecordDemo ();
RecordDemo();
else
US_ControlPanel(0);
......@@ -1432,7 +1428,7 @@ void DemoLoop()
}
//===========================================================================
/* ======================================================================== */
/*
......
......@@ -220,7 +220,7 @@ static char
{
1,0xe,0xf,0x1d,sc_LShift,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,
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
},
*ExtScanNames[] = // Names corresponding to ExtScanCodes
......
......@@ -47,7 +47,7 @@ memptr demobuffer;
//
// 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];
static void RemoveObj(objtype *gone);
......@@ -61,7 +61,7 @@ static void RemoveObj(objtype *gone);
*/
/* LIST OF SONGS FOR EACH VERSION */
static int songs[]=
static const int songs[]=
{
#ifndef SPEAR
/* Episode One */
......@@ -263,7 +263,6 @@ void PollJoystickButtons()
}
}
/*
===================
=
......@@ -315,8 +314,6 @@ void PollMouseMove()
controly += mouseymove*20/(13-mouseadjustment);
}
/*
===================
=
......@@ -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,32 +425,10 @@ void PollControls()
return;
}
//
// get button states
//
/* Update keys */
IN_CheckAck();
PollKeyboardButtons();
if (mouseenabled)
PollMouseButtons();
if (joystickenabled)
PollJoystickButtons();
//
// get movements
//
PollKeyboardMove();
if (mouseenabled)
PollMouseMove();
if (joystickenabled)
PollJoystickMove();
UpdateInput();
//
// bound movement to a maximum
......@@ -740,9 +739,7 @@ void InitActorList()
objfreelist = &objlist[0];
lastobj = NULL;
//
// give the player the first free spots
//
/* give the player the first free spots */
GetNewActor();
player = new;
......@@ -799,7 +796,7 @@ void GetNewActor()
static void RemoveObj(objtype *gone)
{
if (gone == player)
Quit ("RemoveObj: Tried to remove the player!");
Quit("RemoveObj: Tried to remove the player!");
gone->state = s_none;
......
......@@ -102,7 +102,7 @@ void NewState(objtype *ob, int state) /* stateenum */
= ob->tilex = new destination
= ob->tiley
= 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.
= The actor code should wait until
......
......@@ -557,7 +557,7 @@ void CacheLayoutGraphics()
}
if (ch == 'T') // timed draw graphic command, so mark graphics
{
ParseTimedCommand ();
ParseTimedCommand();
CA_CacheGrChunk(picnum);
}
}
......@@ -580,7 +580,7 @@ void CacheLayoutGraphics()
void ShowArticle(char *article)
{
unsigned oldfontnumber;
boolean newpage,firstpage;
boolean newpage, firstpage;
text = article;
......@@ -588,7 +588,7 @@ void ShowArticle(char *article)
fontnumber = 0;
CA_CacheGrChunk(STARTFONT);
VW_Bar (0,0,320,200,BACKCOLOR);
CacheLayoutGraphics ();
CacheLayoutGraphics();
newpage = true;
firstpage = true;
......@@ -598,18 +598,17 @@ void ShowArticle(char *article)
if (newpage)
{
newpage = false;
PageLayout (true);
VW_UpdateScreen ();
PageLayout(true);
VW_UpdateScreen();
if (firstpage)
{
VL_FadeIn(0,255,gamepal,10);
// VW_FadeIn ()
firstpage = false;
}
}
LastScan = 0;
while (!LastScan) IN_CheckAck(); /* TODO: update events */
while (!LastScan) IN_CheckAck(); /* update events */
switch (LastScan)
{
......@@ -627,7 +626,7 @@ void ShowArticle(char *article)
case sc_Enter:
case sc_DownArrow:
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)
{
newpage = true;
......@@ -645,10 +644,10 @@ void ShowArticle(char *article)
}
//===========================================================================
/* ======================================================================== */
int endextern = T_ENDART1;
int helpextern = T_HELPART;
#define endextern T_ENDART1
#define helpextern T_HELPART
/*
=================
......@@ -691,7 +690,7 @@ void EndText()
CA_UpLevel();
artnum = endextern+gamestate.episode;
CA_CacheGrChunk (artnum);
CA_CacheGrChunk(artnum);
text = (char *)grsegs[artnum];
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