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
7289833d
Commit
7289833d
authored
Aug 08, 2000
by
Steven Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No idea...
Although sounds sound correct in openal now...
parent
88291afa
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
40 deletions
+25
-40
Makefile
src/Makefile
+3
-3
TODO
src/TODO
+7
-0
sd_oal.c
src/sd_oal.c
+9
-10
vi_ogl.c
src/vi_ogl.c
+0
-2
wl_def.h
src/wl_def.h
+1
-1
wl_draw.c
src/wl_draw.c
+0
-19
wl_scale.c
src/wl_scale.c
+5
-5
No files found.
src/Makefile
View file @
7289833d
...
...
@@ -5,19 +5,19 @@ CC = gcc
#CFLAGS = -g -Wall
CFLAGS
=
-g
#CFLAGS = -Os
#
CFLAGS = -g -Wall -I/home/relnev/cvs/oal/include
CFLAGS
=
-g
-Wall
-I
/home/relnev/cvs/oal/include
OBJS
=
objs.o misc.o id_ca.o id_vh.o id_us.o
\
wl_act1.o wl_act2.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 gfxsave.o sd_
null.o
# sd_
oal.o # sd_null.o
wl_debug.o gfxsave.o sd_oal.o
# sd_null.o
ROBJS
=
wl_draw.o wl_scale.o
SOBJS
=
$(OBJS)
$(ROBJS)
vi_svga.o
XOBJS
=
$(OBJS)
$(ROBJS)
vi_xlib.o
GOBJS
=
$(OBJS)
vi_ogl.o vi_glx.o
#LFLAGS = -lm
LFLAGS
=
-lm
-L
/home/relnev/cvs/oal/linux/src
-lopenal
-lpthread
-ldl
LFLAGS
=
-lm
/home/relnev/cvs/oal/linux/src/libopenal.a
-lpthread
-ldl
SLFLAGS
=
$(LFLAGS)
-lvga
XLFLAGS
=
$(LFLAGS)
-L
/usr/X11R6/lib
-lX11
-lXext
-lXxf86vm
-lXxf86dga
...
...
src/TODO
View file @
7289833d
...
...
@@ -90,6 +90,13 @@ either that or use extern "C" { ... } in the header files
wall drawing is done, just needed to fix sprite code
* check in wolftools and add mac wolftools (currently the res dumping stuff)
* have vi_xlib.c compile without the extensions
* cat file.c | perl -e 'while($in = <STDIN>)
{$in =~ s/\/\/(.*)$/\/\* \1\ *\//gm;print $in;}'
or
cat foo.txt |sed -e "s/\/\/\(.*\)$/\/\*\1\*\//g"
* oal version locks up at end of level (hit switch but before the ratios)
the api is a bit unstable at the moment so wait for 1.0 of linux version to
be released before fixing it, although that lame sampling bug got fixed
Things to try:
* Any speed gain with comparing values in screen before writing?
...
...
src/sd_oal.c
View file @
7289833d
...
...
@@ -145,9 +145,9 @@ void SD_Startup(void)
}
buffers
=
(
ALuint
*
)
malloc
(
sizeof
(
ALuint
)
*
x
);
if
(
alGenBuffers
(
x
,
buffers
)
!=
x
)
printf
(
"OpenAL buffer allocation problem
\n
"
);
//
if (alGenBuffers(x, buffers) != x)
//
printf("OpenAL buffer allocation problem\n");
alGenBuffers
(
x
,
buffers
);
x
=
0
;
for
(
i
=
0
;
i
<
p
/
2
;
i
+=
2
)
{
...
...
@@ -174,9 +174,7 @@ void SD_Startup(void)
memcpy
(
dat
+
z
,
PM_GetPage
(
w
+
PMSoundStart
),
page
->
length
);
z
+=
page
->
length
;
}
/* TODO: openal bug! */
//alBufferData(buffers[x], AL_FORMAT_MONO8, dat, y, 6896);
alBufferData
(
buffers
[
x
],
AL_FORMAT_MONO8
,
dat
,
y
,
22050
/
4
);
alBufferData
(
buffers
[
x
],
AL_FORMAT_MONO8
,
dat
,
y
,
6896
);
if
(
alGetError
()
!=
AL_NO_ERROR
)
{
printf
(
"AL error
\n
"
);
...
...
@@ -232,8 +230,9 @@ void SD_PlaySound(soundnames sound)
if
(
DigiMap
[
sound
]
!=
-
1
)
{
/* TODO: openal bug? (need to stop before play) */
/* what is there to replayce SourceIsPlaying (was removed from AL)? */
for
(
i
=
0
;
i
<
4
;
i
++
)
{
if
(
alSourceIsPlaying
(
sources
[
i
])
==
AL_FALSE
)
{
/* if (alSourceIsPlaying(sources[i]) == AL_FALSE) */
{
//alSourceStop(*sources);
alSourcefv
(
sources
[
i
],
AL_POSITION
,
gval
);
alSource3f
(
sources
[
i
],
AL_DIRECTION
,
-
pval
[
0
],
0
.
0
f
,
-
pval
[
2
]);
...
...
@@ -273,7 +272,7 @@ void PlaySoundLocGlobal(word sound, fixed x, fixed y)
if
(
DigiMap
[
sound
]
!=
-
1
)
{
/* TODO: openal bug? (need to stop before play) */
for
(
i
=
0
;
i
<
4
;
i
++
)
{
if
(
alSourceIsPlaying
(
sources
[
i
])
==
AL_FALSE
)
{
/* if (alSourceIsPlaying(sources[i]) == AL_FALSE) */
{
//alSourceStop(*sources);
val
[
0
]
=
x
>>
15
;
val
[
1
]
=
0
.
0
f
;
...
...
@@ -300,10 +299,10 @@ word SD_SoundPlaying(void)
/* Watch out for any looped sounds */
for
(
i
=
0
;
i
<
4
;
i
++
)
{
if
(
alSourceIsPlaying
(
sources
[
i
])
==
AL_TRUE
)
{
/* if (alSourceIsPlaying(sources[i]) == AL_TRUE) */
{
ALint
ret
;
alGetSourcei
(
sources
[
i
],
AL_LOOPING
,
&
ret
);
alGetSourcei
(
sources
[
i
],
AL_
SOURCE_
LOOPING
,
&
ret
);
if
(
ret
==
AL_FALSE
)
return
true
;
}
...
...
src/vi_ogl.c
View file @
7289833d
...
...
@@ -234,8 +234,6 @@ void ScalePost(byte *wall, int texture)
byte *source;
height = (wallheight [postx] & 0xfff8) >> 1;
if (height > maxscaleshl2)
height = maxscaleshl2;
source = wall+texture;
xBuildCompScale (height/2, source, postx);
...
...
src/wl_def.h
View file @
7289833d
...
...
@@ -951,7 +951,7 @@ typedef struct
/* table data after dataofs[rightpix-leftpix+1] */
}
PACKED
t_compshape
;
extern
int
maxscale
,
maxscaleshl2
;
extern
int
maxscale
;
void
SetupScaling
(
int
maxscaleheight
);
void
ScaleShape
(
int
xcenter
,
int
shapenum
,
unsigned
height
);
...
...
src/wl_draw.c
View file @
7289833d
...
...
@@ -227,31 +227,12 @@ int CalcHeight (void)
unsigned
postx
;
#if 0
void
ScalePost
(
byte
*
wall
,
int
texture
)
{
int
height
;
byte
*
source
;
height
=
(
wallheight
[
postx
]
&
0xfff8
)
>>
1
;
if (height > maxscaleshl2)
height = maxscaleshl2;
source = wall+texture;
xBuildCompScale (height/2, source, postx);
}
#endif
/* TODO: this is new ScalePost for new scaling routine */
void
ScalePost
(
byte
*
wall
,
int
texture
)
{
int
height
;
byte
*
source
;
height
=
(
wallheight
[
postx
]
&
0xfff8
)
>>
1
;
/* TODO: i can remove maxscaleshl2 now */
//if (height > maxscaleshl2)
// height = maxscaleshl2;
source
=
wall
+
texture
;
xBuildCompScale
(
height
/
2
,
source
,
postx
);
...
...
src/wl_scale.c
View file @
7289833d
...
...
@@ -22,7 +22,7 @@ typedef struct {
t_scaledata
scaledata
[
MAXSCALEHEIGHT
+
1
];
int
maxscale
,
maxscaleshl2
;
int
maxscale
;
void
BuildCompScale
(
int
height
)
{
...
...
@@ -74,8 +74,6 @@ void SetupScaling(int maxscaleheight)
int
i
;
maxscale
=
maxscaleheight
-
1
;
maxscaleshl2
=
maxscale
<<
2
;
//
// build the compiled scalers
//
...
...
@@ -143,9 +141,9 @@ void xBuildCompScale(int height, byte *source, int x)
#endif
/* TODO: this accesses gfxbuf directly! */
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
)
{
fixed
OldDelta
;
unsigned
long
OldDelta
;
while
(
scale
--
)
{
*
vid
=
*
gfx
;
...
...
@@ -262,6 +260,8 @@ void ScaleShape(int xcenter, int shapenum, unsigned height)
shape
=
PM_GetSpritePage
(
shapenum
);
scale
=
height
>>
2
;
// low three bits are fractional
scale
+=
4
;
/* sprites look a bit better pulled up some */
if
(
!
scale
||
scale
>
maxscale
)
return
;
// too close or far away
...
...
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