Commit 3d16d302 authored by Steven Fuller's avatar Steven Fuller

Minor changes

parent 40624c24
...@@ -38,6 +38,7 @@ unsigned long get_TimeCount() ...@@ -38,6 +38,7 @@ unsigned long get_TimeCount()
struct timeval t1; struct timeval t1;
long secs, usecs; long secs, usecs;
long tc; long tc;
//double d;
gettimeofday(&t1, NULL); gettimeofday(&t1, NULL);
secs = t1.tv_sec - t0.tv_sec; secs = t1.tv_sec - t0.tv_sec;
...@@ -46,8 +47,12 @@ unsigned long get_TimeCount() ...@@ -46,8 +47,12 @@ unsigned long get_TimeCount()
usecs += 1000000; usecs += 1000000;
secs--; secs--;
} }
//d = (double)tc0 + (double)secs * 70.0 + (double)usecs * 70.0 / 1000000.0;
//d = (double)tc0 + ((double)secs * 1000000.0 + (double)usecs) / (1000000.0/70.0);
//tc = (long)d;
tc = tc0 + secs * 70 + usecs * 70 / 1000000; tc = tc0 + secs * 70 + usecs * 70 / 1000000;
return tc; return tc;
} }
......
...@@ -630,6 +630,10 @@ static void MapRow() ...@@ -630,6 +630,10 @@ static void MapRow()
while (mr_count--) { while (mr_count--) {
ebx = ((esi & 0xFC000000) >> 25) | ((esi & 0xFC00) >> 3); ebx = ((esi & 0xFC000000) >> 25) | ((esi & 0xFC00) >> 3);
esi += edx; esi += edx;
//ebx = ((mr_yfrac & 0xFC00) >> (25-16)) | ((mr_xfrac & 0xFC00) >> 3);
//mr_yfrac += mr_ystep;
//mr_xfrac += mr_xstep;
/* /*
mr_dest[0] = planepics[0x1F00|(planepics[(ebx&0x1FFE)+0]&0xFF)]; mr_dest[0] = planepics[0x1F00|(planepics[(ebx&0x1FFE)+0]&0xFF)];
mr_dest[mr_rowofs] = planepics[0x1F00|(planepics[(ebx&0x1FFE)+1]&0xFF)]; mr_dest[mr_rowofs] = planepics[0x1F00|(planepics[(ebx&0x1FFE)+1]&0xFF)];
...@@ -771,6 +775,10 @@ void DrawPlanes() ...@@ -771,6 +775,10 @@ void DrawPlanes()
======================== ========================
*/ */
#ifndef DRAWCEIL
//#define DRAWCEIL
#endif
void ThreeDRefresh() void ThreeDRefresh()
{ {
...@@ -783,10 +791,12 @@ void ThreeDRefresh() ...@@ -783,10 +791,12 @@ void ThreeDRefresh()
// follow the walls from there to the right, drawwing as we go // follow the walls from there to the right, drawwing as we go
// //
DrawPlayBorder(); DrawPlayBorder();
#ifndef DRAWCEIL
ClearScreen(); ClearScreen();
#endif
WallRefresh(); WallRefresh();
#if 0 #ifdef DRAWCEIL
DrawPlanes(); /* silly floor/ceiling drawing */ DrawPlanes(); /* silly floor/ceiling drawing */
#endif #endif
// //
...@@ -816,7 +826,7 @@ void ThreeDRefresh() ...@@ -816,7 +826,7 @@ void ThreeDRefresh()
/* /*
xpartial = 16 bit fraction xpartial = 16 bit fraction
ystep = 32 bit fixed 32,16 ystep = 32 bit fixed 16,16
*/ */
static int samex(int intercept, int tile) static int samex(int intercept, int tile)
...@@ -926,7 +936,7 @@ static void AsmRefresh() ...@@ -926,7 +936,7 @@ static void AsmRefresh()
if (!samey (yintercept, ytile)) if (!samey (yintercept, ytile))
goto horizentry; goto horizentry;
vertentry: vertentry:
tilehit = tilemap [xtile][TILE(yintercept)]; tilehit = tilemap[xtile][TILE(yintercept)];
if (tilehit != 0) { if (tilehit != 0) {
if (tilehit & 0x80) { if (tilehit & 0x80) {
...@@ -959,16 +969,16 @@ static void AsmRefresh() ...@@ -959,16 +969,16 @@ static void AsmRefresh()
goto nextpix; goto nextpix;
} }
passvert: passvert:
spotvis [xtile][TILE(yintercept)] = 1; spotvis[xtile][TILE(yintercept)] = 1;
xtile += xtilestep; xtile += xtilestep;
yintercept += ystep; yintercept += ystep;
goto vertcheck; goto vertcheck;
horizcheck: horizcheck:
/* check intersections with horizontal walls */ /* check intersections with horizontal walls */
if (!samex (xintercept, xtile)) if (!samex(xintercept, xtile))
goto vertentry; goto vertentry;
horizentry: horizentry:
tilehit = tilemap [TILE(xintercept)][ytile]; tilehit = tilemap[TILE(xintercept)][ytile];
if (tilehit != 0) { if (tilehit != 0) {
if (tilehit & 0x80) { if (tilehit & 0x80) {
......
...@@ -488,8 +488,9 @@ void SetupGameLevel() ...@@ -488,8 +488,9 @@ void SetupGameLevel()
// //
// copy the wall data to a data segment array // copy the wall data to a data segment array
// //
memset(tilemap,0,sizeof(tilemap)); memset(tilemap, 0, sizeof(tilemap));
memset(actorat,0,sizeof(actorat)); memset(actorat, 0, sizeof(actorat));
map = mapsegs[0]; map = mapsegs[0];
for (y=0;y<mapheight;y++) for (y=0;y<mapheight;y++)
for (x=0;x<mapwidth;x++) for (x=0;x<mapwidth;x++)
......
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
/* scaling data for a given height */ /* scaling data for a given height */
typedef struct { typedef struct {
/* number of destination pixels each source pixels maps to in x and y */ /* number of destination pixels each source pixels maps to in x and y */
int count[65]; int count[64];
/* the destination pixel for each source pixel row */ /* the destination pixel for each source pixel row */
int desty[65]; int desty[64];
} t_scaledata; } t_scaledata;
static t_scaledata scaledata[MAXSCALEHEIGHT+1]; static t_scaledata scaledata[MAXSCALEHEIGHT+1];
...@@ -33,7 +33,6 @@ static void BuildCompScale(int height) ...@@ -33,7 +33,6 @@ static void BuildCompScale(int height)
toppix = (viewheight - height) / 2; toppix = (viewheight - height) / 2;
fix = 0; fix = 0;
/* TODO: <= 64, or < 64? */
for (src = 0; src < 64; src++) for (src = 0; src < 64; src++)
{ {
startpix = fix >> 16; startpix = fix >> 16;
...@@ -85,7 +84,7 @@ void SetupScaling(int maxscaleheight) ...@@ -85,7 +84,7 @@ void SetupScaling(int maxscaleheight)
} }
//=========================================================================== /* ======================================================================== */
/* TODO: this accesses gfxbuf directly! */ /* TODO: this accesses gfxbuf directly! */
static void ScaledDraw(byte *gfx, int scale, byte *vid, unsigned long tfrac, unsigned long tint, unsigned long delta) static void ScaledDraw(byte *gfx, int scale, byte *vid, unsigned long tfrac, unsigned long tint, unsigned long delta)
...@@ -98,6 +97,7 @@ static void ScaledDraw(byte *gfx, int scale, byte *vid, unsigned long tfrac, uns ...@@ -98,6 +97,7 @@ static void ScaledDraw(byte *gfx, int scale, byte *vid, unsigned long tfrac, uns
OldDelta = delta; OldDelta = delta;
delta += tfrac; delta += tfrac;
gfx += tint; gfx += tint;
if (OldDelta > delta) if (OldDelta > delta)
gfx += 1; gfx += 1;
} }
...@@ -163,12 +163,9 @@ static void ScaleLine() ...@@ -163,12 +163,9 @@ static void ScaleLine()
while (linecmds[0]) { while (linecmds[0]) {
y0 = linecmds[2] / 2; y0 = linecmds[2] / 2;
/* y1 = linecmds[0] / 2 - 1; */
y1 = linecmds[0] / 2; y1 = linecmds[0] / 2;
pixels = (unsigned char *)shapeptr + y0 + linecmds[1]; pixels = (unsigned char *)shapeptr + y0 + linecmds[1];
if (y1 >= 65) printf("overflow! %d\n", y1);
/* for (y = y0; y <= y1; y++) { */
for (y = y0; y < y1; y++) { for (y = y0; y < y1; y++) {
color = *pixels++; color = *pixels++;
ys = scaledata[linescale].desty[y]; ys = scaledata[linescale].desty[y];
...@@ -190,12 +187,6 @@ if (y1 >= 65) printf("overflow! %d\n", y1); ...@@ -190,12 +187,6 @@ if (y1 >= 65) printf("overflow! %d\n", y1);
= =
= Draws a compiled shape at [scale] pixels high = Draws a compiled shape at [scale] pixels high
= =
= each vertical line of the shape has a pointer to segment data:
= end of segment pixel*2 (0 terminates line) used to patch rtl in scaler
= top of virtual line with segment in proper place
= start of segment pixel*2, used to jsl into compiled scaler
= <repeat>
=
======================= =======================
*/ */
...@@ -386,12 +377,6 @@ void ScaleShape(int xcenter, int shapenum, unsigned height) ...@@ -386,12 +377,6 @@ void ScaleShape(int xcenter, int shapenum, unsigned height)
= =
= Draws a compiled shape at [scale] pixels high = Draws a compiled shape at [scale] pixels high
= =
= each vertical line of the shape has a pointer to segment data:
= end of segment pixel*2 (0 terminates line) used to patch rtl in scaler
= top of virtual line with segment in proper place
= start of segment pixel*2, used to jsl into compiled scaler
= <repeat>
=
======================= =======================
*/ */
......
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