Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wolf3d
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
wolf3d
Commits
c0fedd7d
Commit
c0fedd7d
authored
Jul 18, 2001
by
Steven Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wolfenstein 3D should now work correctly on MSBFirst systems (system tested
has sizeof(int) == sizeof(long) == 4.)
parent
229813c7
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
188 additions
and
33 deletions
+188
-33
Makefile
src/Makefile
+6
-5
NOTES
src/NOTES
+1
-1
TODO
src/TODO
+7
-6
id_ca.c
src/id_ca.c
+21
-14
id_heads.h
src/id_heads.h
+2
-1
id_vh.c
src/id_vh.c
+10
-0
misc.h
src/misc.h
+14
-0
version.h
src/version.h
+1
-1
vi_xlib.c
src/vi_xlib.c
+29
-5
wl_draw.c
src/wl_draw.c
+97
-0
No files found.
src/Makefile
View file @
c0fedd7d
CC
=
gcc
CC
=
gcc
#CC = gcc-3.0
#CFLAGS = -g -O2 -Wall -pedantic
#CFLAGS = -Wall -pedantic -O6 -fomit-frame-pointer -ffast-math -funroll-loops -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
CFLAGS
=
-g
-Wall
-pedantic
CFLAGS
=
-g
-Wall
-pedantic
#CFLAGS = -Wall -pedantic -std=c99
#CFLAGS = -g -O2 -Wall -pedantic
#CFLAGS = -Os -Wall -peantic
#CFLAGS = -Wall -O6 -fomit-frame-pointer -ffast-math -funroll-loops -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
#CFLAGS = -Os -Wall -peantic -fomit-frame-pointer -ffast-math -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
#CFLAGS = -g -Wall -pedantic -std=gnu99
#CFLAGS = -Os -Wall -pedantic
#CFLAGS = -Os -Wall -fomit-frame-pointer -ffast-math -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
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
\
...
...
src/NOTES
View file @
c0fedd7d
...
@@ -27,7 +27,7 @@ Just some random facts/thoughts/ideas/musings:
...
@@ -27,7 +27,7 @@ Just some random facts/thoughts/ideas/musings:
NewWolf: http://wolfgl.narod.ru/
NewWolf: http://wolfgl.narod.ru/
- Acorn/Archemedes
- Acorn/Archemedes
* PC source released
August(?) ??, 1995:
* PC source released
Jul 21, 1995 [http://www.3dgamers.com/games/wolfenstein3d/]
- ftp://ftp.idsoftware.com/idstuff/source/wolfsrc.zip
- ftp://ftp.idsoftware.com/idstuff/source/wolfsrc.zip
* now many ports, projects, etc
* now many ports, projects, etc
- http://www.abraxis.com/brucel/wolf3d.html
- http://www.abraxis.com/brucel/wolf3d.html
...
...
src/TODO
View file @
c0fedd7d
Priority Levels: I > R > M (I, R required to be complete before 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 R - 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..
...
@@ -21,8 +21,9 @@ B M - port to dreamcast?
...
@@ -21,8 +21,9 @@ B M - port to dreamcast?
B M - add compression to savegames/config
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 M - finish serializing reads/writes, endian issues.
P I - fix raycast bug where at certain points you can see through corners
- 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
B I - merge other TODO lists into this list
B I - merge other TODO lists into this list
B M - use something like config file or getenv to point at data directories
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
...
@@ -43,10 +44,12 @@ P M - rename visable to visible
...
@@ -43,10 +44,12 @@ P M - rename visable to visible
B M - change the commandline handling (use something like getopt?)
B M - change the commandline handling (use something like getopt?)
P R - rewrite RLEWexpand to not use words
P R - rewrite RLEWexpand to not use words
B M - openal support
B M - openal support
B I - when window loses focus, it should clear the keys
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]
- 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?
...
@@ -63,9 +66,7 @@ PlayDemoFromFile specifically
...
@@ -63,9 +66,7 @@ PlayDemoFromFile specifically
* deathcam went by too fast, same with the spear of destiny ending animation
* deathcam went by too fast, same with the spear of destiny ending animation
- probably due to waiting for sounds to finish
- probably due to waiting for sounds to finish
* split wl_draw into two files (draw independent, draw dependent)
* split wl_draw into two files (draw independent, draw dependent)
* when window loses focus, it should clear the keys
------------------------------------------------------------------------------
------------------------------------------------------------------------------
fix:
void ControlMovement(objtype *ob) (wl_agent.c)
void ControlMovement(objtype *ob) (wl_agent.c)
void UpdateInput() / void PollControls() (wl_play.c)
void UpdateInput() / void PollControls() (wl_play.c)
------------------------------------------------------------------------------
------------------------------------------------------------------------------
...
...
src/id_ca.c
View file @
c0fedd7d
...
@@ -189,6 +189,9 @@ void CAL_HuffExpand(byte *source, byte *dest, long length, huffnode *htable)
...
@@ -189,6 +189,9 @@ void CAL_HuffExpand(byte *source, byte *dest, long length, huffnode *htable)
= CAL_CarmackExpand
= CAL_CarmackExpand
= Length is the length of the EXPANDED data
= Length is the length of the EXPANDED data
=
=
= Note: This function happens to implicity swap words' bytes around.
= For maps, this happens to be the desired effect.
=
======================
======================
*/
*/
...
@@ -267,13 +270,14 @@ void CA_RLEWexpand(word *source, word *dest, long length, word rlewtag)
...
@@ -267,13 +270,14 @@ void CA_RLEWexpand(word *source, word *dest, long length, word rlewtag)
/* expand it */
/* expand it */
do
{
do
{
value
=
*
source
++
;
value
=
*
source
++
;
if
(
value
!=
rlewtag
)
if
(
value
!=
rlewtag
)
/* uncompressed */
/* uncompressed */
*
dest
++
=
value
;
*
dest
++
=
value
;
else
{
else
{
/* compressed string */
/* compressed string */
count
=
SwapInt16L
(
*
source
);
source
++
;
count
=
*
source
++
;
value
=
*
source
++
;
value
=
*
source
++
;
for
(
i
=
0
;
i
<
count
;
i
++
)
for
(
i
=
0
;
i
<
count
;
i
++
)
*
dest
++
=
value
;
*
dest
++
=
value
;
...
@@ -383,8 +387,7 @@ static void CAL_SetupMapFile()
...
@@ -383,8 +387,7 @@ static void CAL_SetupMapFile()
if
(
handle
==
-
1
)
if
(
handle
==
-
1
)
CA_CannotOpen
(
fname
);
CA_CannotOpen
(
fname
);
/* RLEWtag = ReadInt16(handle); */
RLEWtag
=
ReadInt16
(
handle
);
ReadBytes
(
handle
,
(
byte
*
)
&
RLEWtag
,
2
);
/* RLEWtag = word */
/* open the data file */
/* open the data file */
strcpy
(
fname
,
gmapsname
);
strcpy
(
fname
,
gmapsname
);
...
@@ -680,7 +683,6 @@ void CA_CacheMap(int mapnum)
...
@@ -680,7 +683,6 @@ void CA_CacheMap(int mapnum)
byte
*
source
;
byte
*
source
;
memptr
buffer2seg
;
memptr
buffer2seg
;
long
expanded
;
long
expanded
;
int
i
;
mapon
=
mapnum
;
mapon
=
mapnum
;
...
@@ -697,19 +699,22 @@ void CA_CacheMap(int mapnum)
...
@@ -697,19 +699,22 @@ void CA_CacheMap(int mapnum)
ReadBytes
(
maphandle
,
(
byte
*
)
source
,
compressed
);
ReadBytes
(
maphandle
,
(
byte
*
)
source
,
compressed
);
expanded
=
source
[
0
]
|
(
source
[
1
]
<<
8
);
expanded
=
source
[
0
]
|
(
source
[
1
]
<<
8
);
MM_GetPtr
(
&
buffer2seg
,
expanded
);
MM_GetPtr
(
&
buffer2seg
,
expanded
);
/* NOTE: CarmackExpand implicitly fixes endianness, a RLEW'd only map
would (likely) need to be swapped in CA_RLEWexpand
Wolfenstein 3D/Spear of Destiny maps are always Carmack'd so this
case is OK. CA_RLEWexpand would need to be adjusted for Blake Stone
and the like.
*/
CAL_CarmackExpand
(
source
+
2
,
(
word
*
)
buffer2seg
,
expanded
);
CAL_CarmackExpand
(
source
+
2
,
(
word
*
)
buffer2seg
,
expanded
);
MM_FreePtr
((
void
*
)
&
source
);
MM_FreePtr
((
void
*
)
&
source
);
expanded
=
64
*
64
*
2
;
expanded
=
64
*
64
*
2
;
CA_RLEWexpand
(((
word
*
)
buffer2seg
)
+
1
,
mapsegs
[
plane
],
expanded
,
RLEWtag
);
CA_RLEWexpand
(((
word
*
)
buffer2seg
)
+
1
,
mapsegs
[
plane
],
expanded
,
RLEWtag
);
MM_FreePtr
(
&
buffer2seg
);
MM_FreePtr
(
&
buffer2seg
);
/* swap for big-endian */
for
(
i
=
0
;
i
<
64
*
64
;
i
++
)
mapsegs
[
plane
][
i
]
=
SwapInt16L
(
mapsegs
[
plane
][
i
]);
}
}
}
}
...
@@ -791,12 +796,14 @@ static void PML_OpenPageFile()
...
@@ -791,12 +796,14 @@ static void PML_OpenPageFile()
memset
(
PMPages
,
0
,
sizeof
(
PageListStruct
)
*
ChunksInFile
);
memset
(
PMPages
,
0
,
sizeof
(
PageListStruct
)
*
ChunksInFile
);
/* Read in the chunk offsets */
/* Read in the chunk offsets */
for
(
i
=
0
,
page
=
PMPages
;
i
<
ChunksInFile
;
i
++
,
page
++
)
for
(
i
=
0
,
page
=
PMPages
;
i
<
ChunksInFile
;
i
++
,
page
++
)
{
page
->
offset
=
ReadInt32
(
PageFile
);
page
->
offset
=
ReadInt32
(
PageFile
);
}
/* Read in the chunk lengths */
/* Read in the chunk lengths */
for
(
i
=
0
,
page
=
PMPages
;
i
<
ChunksInFile
;
i
++
,
page
++
)
for
(
i
=
0
,
page
=
PMPages
;
i
<
ChunksInFile
;
i
++
,
page
++
)
{
page
->
length
=
ReadInt16
(
PageFile
);
page
->
length
=
ReadInt16
(
PageFile
);
}
}
}
static
void
PML_ClosePageFile
()
static
void
PML_ClosePageFile
()
...
...
src/id_heads.h
View file @
c0fedd7d
...
@@ -5,7 +5,8 @@
...
@@ -5,7 +5,8 @@
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <time.h>
#include <time.h>
#include <stdint.h>
#include <sys/types.h>
#include <inttypes.h>
#include <glob.h>
#include <glob.h>
#include <ctype.h>
#include <ctype.h>
#include <math.h>
#include <math.h>
...
...
src/id_vh.c
View file @
c0fedd7d
...
@@ -14,6 +14,8 @@ int xfrac, yfrac;
...
@@ -14,6 +14,8 @@ int xfrac, yfrac;
/* ======================================================================== */
/* ======================================================================== */
#define SKIPFADE 0
void
VL_FillPalette
(
int
red
,
int
green
,
int
blue
)
void
VL_FillPalette
(
int
red
,
int
green
,
int
blue
)
{
{
byte
pal
[
768
];
byte
pal
[
768
];
...
@@ -39,6 +41,9 @@ void VL_FillPalette(int red, int green, int blue)
...
@@ -39,6 +41,9 @@ void VL_FillPalette(int red, int green, int blue)
void
VL_FadeOut
(
int
start
,
int
end
,
int
red
,
int
green
,
int
blue
,
int
steps
)
void
VL_FadeOut
(
int
start
,
int
end
,
int
red
,
int
green
,
int
blue
,
int
steps
)
{
{
#ifdef SKIPFADE
VL_FillPalette
(
red
,
green
,
blue
);
#else
int
i
,
j
,
orig
,
delta
;
int
i
,
j
,
orig
,
delta
;
byte
*
origptr
,
*
newptr
;
byte
*
origptr
,
*
newptr
;
...
@@ -68,6 +73,7 @@ void VL_FadeOut(int start, int end, int red, int green, int blue, int steps)
...
@@ -68,6 +73,7 @@ void VL_FadeOut(int start, int end, int red, int green, int blue, int steps)
/* final color */
/* final color */
VL_FillPalette
(
red
,
green
,
blue
);
VL_FillPalette
(
red
,
green
,
blue
);
#endif
screenfaded
=
true
;
screenfaded
=
true
;
}
}
...
@@ -82,6 +88,9 @@ void VL_FadeOut(int start, int end, int red, int green, int blue, int steps)
...
@@ -82,6 +88,9 @@ void VL_FadeOut(int start, int end, int red, int green, int blue, int steps)
void
VL_FadeIn
(
int
start
,
int
end
,
const
byte
*
palette
,
int
steps
)
void
VL_FadeIn
(
int
start
,
int
end
,
const
byte
*
palette
,
int
steps
)
{
{
#ifdef SKIPFADE
VL_SetPalette
(
palette
);
#else
int
i
,
j
,
delta
;
int
i
,
j
,
delta
;
VL_GetPalette
(
&
palette1
[
0
][
0
]);
VL_GetPalette
(
&
palette1
[
0
][
0
]);
...
@@ -104,6 +113,7 @@ void VL_FadeIn(int start, int end, const byte *palette, int steps)
...
@@ -104,6 +113,7 @@ void VL_FadeIn(int start, int end, const byte *palette, int steps)
/* final color */
/* final color */
VL_SetPalette
(
palette
);
VL_SetPalette
(
palette
);
#endif
screenfaded
=
false
;
screenfaded
=
false
;
}
}
...
...
src/misc.h
View file @
c0fedd7d
...
@@ -46,4 +46,18 @@ extern int16_t ReadInt16(int fp);
...
@@ -46,4 +46,18 @@ extern int16_t ReadInt16(int fp);
extern
int32_t
ReadInt32
(
int
fp
);
extern
int32_t
ReadInt32
(
int
fp
);
extern
int
ReadBytes
(
int
fp
,
byte
*
d
,
int
len
);
extern
int
ReadBytes
(
int
fp
,
byte
*
d
,
int
len
);
static
__inline__
uint16_t
SwapInt16
(
uint16_t
i
)
{
return
((
uint16_t
)
i
>>
8
)
|
((
uint16_t
)
i
<<
8
);
}
static
__inline__
uint32_t
SwapInt32
(
uint32_t
i
)
{
return
((
uint32_t
)(
i
&
0xFF000000
)
>>
24
)
|
((
uint32_t
)(
i
&
0x00FF0000
)
>>
8
)
|
((
uint32_t
)(
i
&
0x0000FF00
)
<<
8
)
|
((
uint32_t
)(
i
&
0x000000FF
)
<<
24
);
}
#endif
#endif
src/version.h
View file @
c0fedd7d
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
/* SDM = 2 */
/* SDM = 2 */
/* SOD = 3 */
/* SOD = 3 */
#ifndef WMODE
#ifndef WMODE
#define WMODE
1
#define WMODE
0
#endif
#endif
/* --- End of User-Modifiable Variables --- */
/* --- End of User-Modifiable Variables --- */
...
...
src/vi_xlib.c
View file @
c0fedd7d
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
#include <X11/Xatom.h>
#include <X11/Xatom.h>
#include <X11/extensions/XShm.h>
#include <X11/extensions/XShm.h>
byte
*
gfxbuf
=
NULL
;
byte
*
gfxbuf
=
NULL
;
byte
*
disbuf
=
NULL
;
byte
*
disbuf
=
NULL
;
...
@@ -35,6 +36,9 @@ static byte cpal[768];
...
@@ -35,6 +36,9 @@ static byte cpal[768];
static
word
spal
[
768
];
static
word
spal
[
768
];
static
dword
ipal
[
768
];
static
dword
ipal
[
768
];
static
int
ByteOrder
;
/* 0 = LSBFirst, 1 = MSBFirst */
static
int
NeedSwap
;
int
MyDepth
;
int
MyDepth
;
void
GetVisual
()
void
GetVisual
()
...
@@ -277,10 +281,17 @@ void VL_Startup()
...
@@ -277,10 +281,17 @@ void VL_Startup()
XInitImage
(
img
);
XInitImage
(
img
);
XDestroyImage
(
imgtmp
);
XDestroyImage
(
imgtmp
);
}
}
MyDepth
=
GetBPP
();
#if BYTE_ORDER == BIG_ENDIAN
ByteOrder
=
1
;
#else
ByteOrder
=
0
;
#endif
NeedSwap
=
(
ByteOrder
!=
img
->
byte_order
);
if
(
img
)
MyDepth
=
GetBPP
();
XMapRaised
(
dpy
,
win
);
XMapRaised
(
dpy
,
win
);
}
}
...
@@ -327,12 +338,13 @@ void VW_UpdateScreen()
...
@@ -327,12 +338,13 @@ void VW_UpdateScreen()
case
15
:
case
15
:
case
16
:
case
16
:
ptrs
=
(
word
*
)
disbuf
;
ptrs
=
(
word
*
)
disbuf
;
for
(
i
=
0
;
i
<
64000
;
i
++
)
{
for
(
i
=
0
;
i
<
64000
;
i
++
)
{
*
ptrs
=
spal
[
gfxbuf
[
i
]];
*
ptrs
=
spal
[
gfxbuf
[
i
]];
ptrs
++
;
ptrs
++
;
}
}
break
;
break
;
case
24
:
case
24
:
/* Endian Safe? Untested. */
ptrb
=
disbuf
;
ptrb
=
disbuf
;
for
(
i
=
0
;
i
<
64000
;
i
++
)
{
for
(
i
=
0
;
i
<
64000
;
i
++
)
{
*
ptrb
=
cpal
[
gfxbuf
[
i
]
*
3
+
2
]
<<
2
;
ptrb
++
;
*
ptrb
=
cpal
[
gfxbuf
[
i
]
*
3
+
2
]
<<
2
;
ptrb
++
;
...
@@ -342,10 +354,15 @@ void VW_UpdateScreen()
...
@@ -342,10 +354,15 @@ void VW_UpdateScreen()
break
;
break
;
case
32
:
case
32
:
ptri
=
(
dword
*
)
disbuf
;
ptri
=
(
dword
*
)
disbuf
;
for
(
i
=
0
;
i
<
64000
;
i
++
)
{
for
(
i
=
0
;
i
<
64000
;
i
++
)
{
*
ptri
=
ipal
[
gfxbuf
[
i
]];
*
ptri
=
ipal
[
gfxbuf
[
i
]];
ptri
++
;
ptri
++
;
}
}
break
;
default:
break
;
/* ... */
}
}
}
}
...
@@ -418,17 +435,24 @@ void VL_SetPalette(const byte *palette)
...
@@ -418,17 +435,24 @@ void VL_SetPalette(const byte *palette)
}
else
{
}
else
{
memcpy
(
cpal
,
palette
,
768
);
memcpy
(
cpal
,
palette
,
768
);
for
(
i
=
0
;
i
<
256
;
i
++
)
{
for
(
i
=
0
;
i
<
256
;
i
++
)
{
/* TODO: this should really use the visual for creating the pixel */
switch
(
MyDepth
)
{
switch
(
MyDepth
)
{
case
8
:
case
8
:
break
;
break
;
case
15
:
case
15
:
/* Endian Safe? Untested. */
spal
[
i
]
=
((
palette
[
i
*
3
+
0
]
>>
1
)
<<
10
)
|
((
palette
[
i
*
3
+
1
]
>>
1
)
<<
5
)
|
((
palette
[
i
*
3
+
2
]
>>
1
)
<<
0
);
spal
[
i
]
=
((
palette
[
i
*
3
+
0
]
>>
1
)
<<
10
)
|
((
palette
[
i
*
3
+
1
]
>>
1
)
<<
5
)
|
((
palette
[
i
*
3
+
2
]
>>
1
)
<<
0
);
if
(
NeedSwap
)
spal
[
i
]
=
SwapInt16
(
spal
[
i
]);
break
;
break
;
case
16
:
case
16
:
spal
[
i
]
=
((
palette
[
i
*
3
+
0
]
>>
1
)
<<
11
)
|
((
palette
[
i
*
3
+
1
]
>>
0
)
<<
5
)
|
((
palette
[
i
*
3
+
2
]
>>
1
)
<<
0
);
spal
[
i
]
=
((
palette
[
i
*
3
+
0
]
>>
1
)
<<
11
)
|
((
palette
[
i
*
3
+
1
]
>>
0
)
<<
5
)
|
((
palette
[
i
*
3
+
2
]
>>
1
)
<<
0
);
if
(
NeedSwap
)
spal
[
i
]
=
SwapInt16
(
spal
[
i
]);
break
;
break
;
case
32
:
case
32
:
ipal
[
i
]
=
(
palette
[
i
*
3
+
0
]
<<
18
)
|
(
palette
[
i
*
3
+
1
]
<<
10
)
|
(
palette
[
i
*
3
+
2
]
<<
2
);
ipal
[
i
]
=
(
palette
[
i
*
3
+
0
]
<<
18
)
|
(
palette
[
i
*
3
+
1
]
<<
10
)
|
(
palette
[
i
*
3
+
2
]
<<
2
);
if
(
NeedSwap
)
ipal
[
i
]
=
SwapInt32
(
ipal
[
i
]);
break
;
break
;
}
}
}
}
...
...
src/wl_draw.c
View file @
c0fedd7d
...
@@ -1249,3 +1249,100 @@ passhoriz:
...
@@ -1249,3 +1249,100 @@ 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 x, y, xc, yc;
int count, p, frame;
count = viewwidth * viewheight;
pixperframe = count / frames;
srand(time(NULL));
fillarray(xarr, viewwidth);
randarray(xarr, viewwidth);
fillarray(yarr, viewheight - 1);
randarray(yarr, viewheight - 1);
IN_StartAck();
frame = 0;
set_TimeCount(0);
xc = 0;
yc = 0;
x = 0;
y = 0;
retr = false;
do {
if (abortable && IN_CheckAck())
retr = true;
else
for (p = 0; p < pixperframe; p++) {
gfxbuf[(xarr[x]+xoffset)+(yarr[y]+yoffset)*vwidth] = color;
count--;
x++;
if (x >= viewwidth)
x = 0;
y++;
if (y >= (viewheight-1))
y = 0;
yc++;
if (yc >= (viewheight-1)) {
yc = 0;
y++;
if (y >= (viewheight-1))
y = 0;
}
}
VW_UpdateScreen();
frame++;
while (get_TimeCount() < frame);
} while (!retr && (count > 0));
VW_UpdateScreen();
}
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment