Commit 65bf0a75 authored by Steven Fuller's avatar Steven Fuller

wl_draw.c: put old FizzleFade back.

parent 376b0103
...@@ -6,6 +6,8 @@ the file formats may change at any time). ...@@ -6,6 +6,8 @@ the file formats may change at any time).
NOTE: This requires SDL 1.2 (http://www.libsdl.org) NOTE: This requires SDL 1.2 (http://www.libsdl.org)
NOTE: edit version.h to change the gametype.
How to use: How to use:
About: About:
......
Priority Levels: I > R > M (I, R required to be complete before full release) Priority Levels: I > R > M (I, R required to be complete before full release)
Program: P=PC Wolf3D, M=Mac Wolf3D, B=Both Program: P=PC Wolf3D, M=Mac Wolf3D, B=Both
P R - create a better "read direction" for menu movement P M - create a better "read direction" for menu movement
P M - convert while (Keyboard[sc_Blah]) IN_CheckAck() to IN_WaitKeyDown(sc.. 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 M - finish changing the game movement to the new style
P R - update input menus/config P R - update input menus/config
P M - cleanup/rewrite menu code P M - cleanup/rewrite menu code
P R - update sound menus/config P R - update sound menus/config
...@@ -17,11 +17,9 @@ B I - complete savegame, config formats ...@@ -17,11 +17,9 @@ B I - complete savegame, config formats
M I - add SDL M I - add SDL
B R - decide if to keep SVGA/X11 targets B R - decide if to keep SVGA/X11 targets
B M - configure scripts? (autoconf/automake/etc) B M - configure scripts? (autoconf/automake/etc)
B M - port to dreamcast?
B M - add compression to savegames/config
B I - play through game (w/ sound and music) to make sure things work B I - play through game (w/ sound and music) to make sure things work
B M - use stdint.h where appropiate B M - use stdint.h where appropiate
B M - finish serializing reads/writes, endian issues. B R - finish serializing reads/writes, endian issues.
- PC version should be OK for loading -- savegames not yet tested. - PC version should be OK for loading -- savegames not yet tested.
P M - fix raycast bug where at certain points you can see through corners P M - fix raycast bug where at certain points you can see through corners
B I - merge other TODO lists into this list B I - merge other TODO lists into this list
...@@ -29,14 +27,12 @@ B M - use something like config file or getenv to point at data directories ...@@ -29,14 +27,12 @@ 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 P I - finish handling/mapping for all keys in sys. specific code
B I - add mouse support B I - add mouse support
B M - add joystick/gamepad support B M - add joystick/gamepad support
P I - fill in the new fizzlefade function
P I - add sound "emulation" to the necessary targets so WaitSoundDone works P I - add sound "emulation" to the necessary targets so WaitSoundDone works
P R - change boolean SD_PlaySound to void SD_PlaySound P R - change boolean SD_PlaySound to void SD_PlaySound
P M - position pushwall sounds P M - position pushwall sounds
P M - id_ca.c cache code: fix/readd/rewrite the "garbage collection" system P M - id_ca.c cache code: fix/readd/rewrite the "garbage collection" system
P M - rewrite id_ca.c: uniform memory handling system P M - rewrite id_ca.c: uniform memory handling system
P M - either move id_heads into wl_def or split header files apart P M - either move id_heads into wl_def or split header files apart
P R - rewrite fmopl.c to avoid licensing issues (or provide as a separate patch? may not be advisable since id owns copyright on wolf code)
P R - remove CA_LoadAllSounds now that the sound code does everything P R - remove CA_LoadAllSounds now that the sound code does everything
B I - README, etc. B I - README, etc.
B M - Code Documentation B M - Code Documentation
...@@ -49,7 +45,6 @@ B M - [X11] use the data in the visual/image for formatting colors ...@@ -49,7 +45,6 @@ B M - [X11] use the data in the visual/image for formatting colors
Complete: Complete:
P I - fix or remove fizzle fade P I - fix or remove fizzle fade
- Removed [nice, but very hacky effect]
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
* what exactly is the point of all the DigiMode checks in wl_act2.c? * what exactly is the point of all the DigiMode checks in wl_act2.c?
* add ylookup? * add ylookup?
...@@ -85,16 +80,11 @@ Sound Menu: ...@@ -85,16 +80,11 @@ Sound Menu:
- On [AdLib/OPL2] - On [AdLib/OPL2]
- Off - Off
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
Where to Look for/Save Files: File searchpath:
1. ~/.wolf3d <- always used for saving
~/.wolf3d 2. $WOLF3D_DATA
cwd 3. realpath
/usr/games/share 4. cwd
$ENVIRONMENT_VARIABLE
Need to establish where to look, order to look, strict/lenient loading (load
all files from the determined game directory, or look in order for each
file), and where to put savegames and config files.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
Save game header: Save game header:
8 bytes: WOLF3D, 0, 0 8 bytes: WOLF3D, 0, 0
...@@ -102,16 +92,14 @@ Save game header: ...@@ -102,16 +92,14 @@ Save game header:
4 bytes: version (integer) 4 bytes: version (integer)
4 bytes: game type (WL1, WL6, SDM, SOD) 4 bytes: game type (WL1, WL6, SDM, SOD)
4 bytes: seconds past 1970 (time(NULL)) 4 bytes: seconds past 1970 (time(NULL))
4 bytes: padding 4 bytes: padding (filesize?)
4 bytes: checksum for the data (after text string) 4 bytes: checksum for the data (after text string)
32 bytes: text string 32 bytes: text string
Version 0xFFFFFFFF Data: (Unofficial Save Game data) Version 0xFFFFFFFF Data: (Official) \ These are the same.
Version 0x00000000 Data: (Official) /
<see wl_main.c> <see wl_main.c>
Version 0x00000000 Data: (Official)
<undetermined>
Version 0x00000001 Data: (Official) Version 0x00000001 Data: (Official)
<undetermined but will be compressed> <undetermined but will be compressed>
...@@ -123,14 +111,13 @@ Config header: ...@@ -123,14 +111,13 @@ Config header:
4 bytes: version (integer) 4 bytes: version (integer)
4 bytes: game type (WL1, WL6, SDM, SOD) 4 bytes: game type (WL1, WL6, SDM, SOD)
4 bytes: seconds past 1970 (time(NULL)) 4 bytes: seconds past 1970 (time(NULL))
4 bytes: padding 4 bytes: padding (filesize?)
4 bytes: checksum for the data 4 bytes: checksum for the data
Version 0xFFFFFFFF Data: (Unofficial Config data) Version 0xFFFFFFFF Data: (Old Config data)
<see wl_main.c>
Version 0x00000000 Data: (Official) Version 0x00000000 Data: (Official)
<undetermined> <see wl_main.c>
Version 0x00000001 Data: (Official) Version 0x00000001 Data: (Official)
<undetermined but will be compressed> <undetermined but will be compressed>
......
...@@ -606,7 +606,7 @@ void DrawPlanes() ...@@ -606,7 +606,7 @@ void DrawPlanes()
/* ======================================================================== */ /* ======================================================================== */
static unsigned int Ceiling[]= static const unsigned int Ceiling[]=
{ {
#ifndef SPEAR #ifndef SPEAR
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xbfbf, 0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xbfbf,
...@@ -655,7 +655,6 @@ static void ClearScreen() ...@@ -655,7 +655,6 @@ static void ClearScreen()
void ThreeDRefresh() void ThreeDRefresh()
{ {
/* clear out the traced array */ /* clear out the traced array */
memset(spotvis, 0, sizeof(spotvis)); memset(spotvis, 0, sizeof(spotvis));
...@@ -1248,101 +1247,91 @@ passhoriz: ...@@ -1248,101 +1247,91 @@ passhoriz:
void FizzleFade(boolean abortable, int frames, int color) void FizzleFade(boolean abortable, int frames, int color)
{ {
}
#if 0
static int xarr[1280];
static int yarr[1280];
static int myrand()
{
return rand();
}
static void fillarray(int *arr, int len)
{
int i;
for (i = 0; i < len; i++)
arr[i] = i;
}
static void randarray(int *arr, int len)
{
int i, j, k;
for (i = 0; i < len; i++) {
j = myrand() % len;
k = arr[i];
arr[i] = arr[j];
arr[j] = k;
}
}
void FizzleFade(boolean abortable, int frames, int color)
{
boolean retr;
int pixperframe; int pixperframe;
int x, y, xc, yc; unsigned x, y, p, frame;
int count, p, frame; int multiplier;
int width, height;
count = viewwidth * viewheight; long rndval;
pixperframe = count / frames; int retr;
srand(time(NULL));
fillarray(xarr, viewwidth); rndval = 1;
randarray(xarr, viewwidth); pixperframe = 64000/frames;
fillarray(yarr, viewheight - 1);
randarray(yarr, viewheight - 1);
IN_StartAck(); IN_StartAck();
frame = 0; frame = 0;
set_TimeCount(0); set_TimeCount(0);
xc = 0; if (vwidth % 320 || vheight % 200)
yc = 0; return;
x = 0; if ((vwidth / 320) != (vheight / 200))
y = 0; return;
multiplier = vwidth / 320;
if (multiplier > 3)
return;
width = viewwidth / multiplier;
height = viewheight / multiplier;
retr = false; retr = -1;
do { do {
if (abortable && IN_CheckAck()) if (abortable && IN_CheckAck())
retr = true; retr = true;
else else
for (p = 0; p < pixperframe; p++) { for (p = 0; p < pixperframe; p++) {
y = (rndval & 0x00FF) - 1;
gfxbuf[(xarr[x]+xoffset)+(yarr[y]+yoffset)*vwidth] = color; x = (rndval & 0x00FFFF00) >> 8;
count--;
x++;
if (x >= viewwidth)
x = 0;
y++;
if (y >= (viewheight-1))
y = 0;
yc++; if (rndval & 1) {
if (yc >= (viewheight-1)) { rndval >>= 1;
yc = 0; rndval ^= 0x00012000;
y++; } else
rndval >>= 1;
if (y >= (viewheight-1)) if ((x >= width) || (y >= height))
y = 0; continue;
switch(multiplier) {
case 3:
x *= 3;
y *= 3;
gfxbuf[(x+0+xoffset)+(y+0+yoffset)*vwidth] = color;
gfxbuf[(x+0+xoffset)+(y+0+yoffset)*vwidth] = color;
gfxbuf[(x+1+xoffset)+(y+0+yoffset)*vwidth] = color;
gfxbuf[(x+1+xoffset)+(y+1+yoffset)*vwidth] = color;
gfxbuf[(x+0+xoffset)+(y+1+yoffset)*vwidth] = color;
gfxbuf[(x+2+xoffset)+(y+0+yoffset)*vwidth] = color;
gfxbuf[(x+2+xoffset)+(y+1+yoffset)*vwidth] = color;
gfxbuf[(x+2+xoffset)+(y+2+yoffset)*vwidth] = color;
gfxbuf[(x+1+xoffset)+(y+2+yoffset)*vwidth] = color;
gfxbuf[(x+0+xoffset)+(y+2+yoffset)*vwidth] = color;
break;
case 2:
x *= 2;
y *= 2;
gfxbuf[(x+0+xoffset)+(y+0+yoffset)*vwidth] = color;
gfxbuf[(x+1+xoffset)+(y+0+yoffset)*vwidth] = color;
gfxbuf[(x+1+xoffset)+(y+1+yoffset)*vwidth] = color;
gfxbuf[(x+0+xoffset)+(y+1+yoffset)*vwidth] = color;
break;
case 1:
gfxbuf[(x+0+xoffset)+(y+0+yoffset)*vwidth] = color;
break;
} }
if (rndval == 1) {
/* entire sequence has been completed */
retr = false;
break;
}
} }
VW_UpdateScreen(); VW_UpdateScreen();
frame++; frame++;
while (get_TimeCount() < frame); while (get_TimeCount() < frame);
} while (!retr && (count > 0)); } while (retr == -1);
VW_UpdateScreen(); VW_UpdateScreen();
} }
#endif
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