Commit f0d81dbd authored by Steven Fuller's avatar Steven Fuller

Almost there but something is wrong with the raycasting (specifically pixelangle?)

parent b2cc1455
CC = gcc
#CFLAGS = -Wall -O6 -fomit-frame-pointer -mpentiumpro -mcpu=pentiumpro -march=pentiumpro -DUSEVGA
CFLAGS = -g -DUSEVGA
CFLAGS = -g -DUSEVGA -fwritable-strings
#CFLAGS = -g -Wall -DUSEVGA -DDEBUG
#CFLAGS = -g -DUSEVGA -DDEBUG
#CFLAGS = -g -pg -DDEBUG
......
......@@ -7,3 +7,5 @@ code, it really needs to be cleaned up
* id_ca.c cache code: nice idea but messy and maybe can be fixed
in an effort to not allocate everything to memory and forget about it
* remove virtualreality
* clean up header files, especially wl_def.h, where some externs arent in
the right place
......@@ -13,12 +13,12 @@
typedef struct
{
/* 0-255 is a character, > is a pointer to a node */
unsigned short int bit0,bit1;
word bit0, bit1;
} PACKED huffnode;
typedef struct
{
unsigned short int RLEWtag;
word RLEWtag;
long headeroffsets[100];
} PACKED mapfiletype;
......@@ -1576,7 +1576,7 @@ memptr PM_GetPage(int pagenum)
page = &PMPages[pagenum];
if (page->addr == NULL) {
page->lastHit = 0;
MM_GetPtr(page->addr, PMPageSize);
MM_GetPtr((memptr)&page->addr, PMPageSize);
PML_ReadFromFile(page->addr, page->offset, page->length);
}
page->lastHit++;
......
......@@ -14,7 +14,7 @@ typedef struct
{
long planestart[3];
word planelength[3];
word width,height;
word width, height;
char name[16];
} PACKED maptype;
......
......@@ -12,6 +12,7 @@
#include <values.h>
#include <sys/types.h>
#include <glob.h>
#include <math.h>
#include "misc.h"
......
......@@ -529,8 +529,8 @@ void IN_Ack (void)
{
IN_StartAck ();
while (!IN_CheckAck ())
;
return; /* TODO: fix when keyboard implemented */
while (!IN_CheckAck ()) ;
}
///////////////////////////////////////////////////////////////////////////
......@@ -546,12 +546,13 @@ boolean IN_UserInput(longword delay)
longword lasttime;
lasttime = get_TimeCount();
IN_StartAck ();
do
{
do {
if (IN_CheckAck())
return true;
} while ( (get_TimeCount() - lasttime) < delay );
return false;
}
......
......@@ -70,7 +70,7 @@ void VWB_DrawTile8 (int x, int y, int tile)
LatchDrawChar(x,y,tile);
}
void VWB_DrawPic (int x, int y, int chunknum)
void VWB_DrawPic(int x, int y, int chunknum)
{
int picnum = chunknum - STARTPICS;
unsigned width,height;
......
......@@ -8,15 +8,15 @@
typedef struct
{
int width, height;
} pictabletype;
word width, height;
} PACKED pictabletype;
typedef struct
{
int height;
int location[256];
word height;
word location[256];
char width[256];
} fontstruct;
} PACKED fontstruct;
/* ======================================================================== */
......
#ifndef __WL_DEF_H__
#define __WL_DEF_H__
#include "id_heads.h"
#include <math.h>
#include <values.h>
#include "wl_menu.h"
......@@ -731,8 +732,7 @@ extern fixed sintable[], *costable;
//
// derived constants
//
extern fixed scale, maxslope;
extern long heightnumerator;
extern fixed maxslope;
extern int minheightdiv;
extern char configname[13];
......@@ -895,8 +895,6 @@ void PicturePause (void);
=============================================================================
*/
extern unsigned screenloc[3];
extern long lasttimecount;
extern long frameon;
extern boolean fizzlein;
......@@ -907,13 +905,6 @@ extern fixed tileglobal;
extern fixed focallength;
extern fixed mindist;
//
// math tables
//
extern int pixelangle[MAXVIEWWIDTH];
extern long finetangent[FINEANGLES/4];
extern fixed sintable[], *costable;
//
// derived constants
//
......@@ -992,10 +983,10 @@ boolean CheckSight (objtype *ob);
typedef struct
{
unsigned leftpix,rightpix;
unsigned dataofs[64];
word leftpix,rightpix;
word dataofs[64];
/* table data after dataofs[rightpix-leftpix+1] */
} t_compshape;
} PACKED t_compshape;
extern int maxscale,maxscaleshl2;
......@@ -1178,3 +1169,7 @@ void SpawnHitler (int tilex, int tiley);
extern void HelpScreens(void);
extern void EndText(void);
#elif
#error "fix me TODO"
#endif
......@@ -17,8 +17,6 @@ fixed tileglobal = TILEGLOBAL;
#define mindist MINDIST
unsigned char tempy[4096]; /* TODO: testing code only... */
//
// math tables
//
......@@ -785,18 +783,11 @@ void HitVertWall (void);
void HitHorizPWall (void);
void HitVertPWall (void);
int tempylock;
void AsmRefresh (void)
{
fixed doorxhit, dooryhit;
int angle; /* ray angle through pixx */
int i;
tempylock = 1;
for (i = 0; i < 4096; i++) { /* TODO: testing */
tempy[i] = tilemap[i % 64][i / 64] ? '1' : '0';
}
for (pixx = 0; pixx < viewwidth; pixx++) {
angle = midangle + pixelangle[pixx];
......@@ -870,7 +861,6 @@ for (i = 0; i < 4096; i++) { /* TODO: testing */
printf ("vert: %d %x %d, %d\n", pixx, tilehit, xtile, TILE(yintercept));
#endif
if (tilehit != 0) {
tempy[xtile + TILE(yintercept) * 64] = 'X';
if (tilehit & 0x80) {
if (tilehit & 0x40) {
/* vertpushwall */
......@@ -916,7 +906,6 @@ for (i = 0; i < 4096; i++) { /* TODO: testing */
printf ("horiz: %d %x %d, %d\n", pixx, tilehit, TILE(xintercept), ytile);
#endif
if (tilehit != 0) {
tempy[TILE(xintercept) + ytile * 64] = 'Y';
if (tilehit & 0x80) {
/* horizdoor */
if (tilehit & 0x40) {
......@@ -954,7 +943,6 @@ for (i = 0; i < 4096; i++) { /* TODO: testing */
goto horizcheck;
nextpix:
}
tempylock = 0;
}
......
......@@ -499,7 +499,7 @@ void ShutdownId (void)
==================
*/
const float radtoint = (float)FINEANGLES/2/PI;
const float radtoint = (float)FINEANGLES/2.0f/PI;
void BuildTables (void)
{
......@@ -1095,7 +1095,7 @@ void InitGame (void)
BuildTables (); // trig tables
SetupWalls ();
NewViewSize (viewsize);
NewViewSize(viewsize);
//
......@@ -1170,7 +1170,7 @@ void ShowViewSize (int width)
}
void NewViewSize (int width)
void NewViewSize(int width)
{
CA_UpLevel ();
MM_SortMem ();
......@@ -1258,20 +1258,11 @@ void Quit (char *error)
void DemoLoop (void)
{
static int LastDemo;
int i,level;
long nsize;
memptr nullblock;
//
// main game cycle
//
// nsize = (long)40*1024;
// MM_GetPtr(&nullblock,nsize);
#ifndef DEMOTEST
#ifndef UPLOAD
#ifndef GOODTIMES
......@@ -1297,8 +1288,6 @@ void DemoLoop (void)
#ifndef JAPAN
if (!NoWait)
PG13 ();
#endif
#endif
while (1)
......@@ -1309,8 +1298,6 @@ void DemoLoop (void)
// title page
//
MM_SortMem ();
#ifndef DEMOTEST
#ifdef SPEAR
CA_CacheGrChunk (TITLEPALETTE);
......@@ -1351,7 +1338,6 @@ void DemoLoop (void)
if (IN_UserInput(TickBase*10))
break;
#endif
//
// demo
//
......
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