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
2757f756
Commit
2757f756
authored
Apr 30, 2000
by
Steven Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial (very hackish) OpenAL Support.
parent
c030b94b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
117 additions
and
40 deletions
+117
-40
sd_comm.h
src/sd_comm.h
+0
-1
sd_oal.c
src/sd_oal.c
+83
-4
wl_debug.c
src/wl_debug.c
+1
-2
wl_main.c
src/wl_main.c
+33
-33
No files found.
src/sd_comm.h
View file @
2757f756
...
@@ -135,7 +135,6 @@ extern boolean SD_MusicPlaying(void),
...
@@ -135,7 +135,6 @@ extern boolean SD_MusicPlaying(void),
extern
word
SD_SoundPlaying
(
void
);
extern
word
SD_SoundPlaying
(
void
);
extern
void
SD_SetDigiDevice
(
SDSMode
),
extern
void
SD_SetDigiDevice
(
SDSMode
),
SD_PlayDigitized
(
word
which
,
int
leftpos
,
int
rightpos
),
SD_StopDigitized
(
void
),
SD_StopDigitized
(
void
),
SD_Poll
(
void
);
SD_Poll
(
void
);
...
...
src/sd_oal.c
View file @
2757f756
...
@@ -70,6 +70,8 @@ static word sqMode,sqFadeStep;
...
@@ -70,6 +70,8 @@ static word sqMode,sqFadeStep;
/* ------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------ */
ALuint
*
sources
;
ALuint
*
buffers
;
void
*
cc
;
void
*
cc
;
void
SD_StopDigitized
(
void
)
void
SD_StopDigitized
(
void
)
...
@@ -84,10 +86,6 @@ void SD_SetPosition(int leftpos,int rightpos)
...
@@ -84,10 +86,6 @@ void SD_SetPosition(int leftpos,int rightpos)
{
{
}
}
void
SD_PlayDigitized
(
word
which
,
int
leftpos
,
int
rightpos
)
{
}
void
SD_SetDigiDevice
(
SDSMode
mode
)
void
SD_SetDigiDevice
(
SDSMode
mode
)
{
{
}
}
...
@@ -122,14 +120,86 @@ boolean SD_SetMusicMode(SMMode mode)
...
@@ -122,14 +120,86 @@ boolean SD_SetMusicMode(SMMode mode)
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
void
SD_Startup
(
void
)
void
SD_Startup
(
void
)
{
{
int
i
;
if
(
SD_Started
)
if
(
SD_Started
)
return
;
return
;
for
(
i
=
0
;
i
<
LASTSOUND
;
i
++
)
DigiMap
[
i
]
=
-
1
;
cc
=
alcCreateContext
(
NULL
);
cc
=
alcCreateContext
(
NULL
);
if
(
cc
==
NULL
)
if
(
cc
==
NULL
)
printf
(
"alcCreateContext failed..
\n
"
);
printf
(
"alcCreateContext failed..
\n
"
);
else
{
word
*
SoundList
=
PM_GetPage
(
ChunksInFile
-
1
);
PageListStruct
*
page
=
&
PMPages
[
ChunksInFile
-
1
];
int
p
=
page
->
length
;
int
x
=
0
,
w
,
y
,
z
;
for
(
i
=
0
;
i
<
p
/
2
;
i
+=
2
)
{
w
=
*
(
SoundList
+
i
);
y
=
*
(
SoundList
+
i
+
1
);
page
=
&
PMPages
[
w
+
PMSoundStart
];
if
(
page
->
length
==
0
)
{
x
++
;
// count it?
continue
;
}
for
(
z
=
0
;
z
<
y
;
w
++
,
z
++
)
{
page
=
&
PMPages
[
w
+
PMSoundStart
];
z
+=
page
->
length
;
}
x
++
;
}
buffers
=
(
ALuint
*
)
malloc
(
sizeof
(
ALuint
)
*
x
);
if
(
alGenBuffers
(
x
,
buffers
)
!=
x
)
printf
(
"OpenAL buffer allocation problem
\n
"
);
x
=
0
;
for
(
i
=
0
;
i
<
p
/
2
;
i
+=
2
)
{
byte
*
dat
;
w
=
*
(
SoundList
+
i
);
y
=
*
(
SoundList
+
i
+
1
);
page
=
&
PMPages
[
w
+
PMSoundStart
];
if
(
page
->
length
==
0
)
{
x
++
;
// count it?
continue
;
}
if
(
y
==
0
){
printf
(
"wtf?
\n
"
);
continue
;
}
dat
=
(
byte
*
)
malloc
(
y
);
for
(
z
=
0
;
z
<
y
;
w
++
)
{
page
=
&
PMPages
[
w
+
PMSoundStart
];
memcpy
(
dat
+
z
,
PM_GetPage
(
w
+
PMSoundStart
),
page
->
length
);
z
+=
page
->
length
;
}
alBufferData
(
buffers
[
x
],
AL_FORMAT_MONO8
,
dat
,
y
,
6896
);
if
(
alGetError
()
!=
AL_NO_ERROR
)
{
printf
(
"AL error
\n
"
);
}
free
(
dat
);
x
++
;
}
sources
=
(
ALuint
*
)
malloc
(
sizeof
(
ALuint
)
*
1
);
alGenSources
(
1
,
sources
);
}
SD_Started
=
true
;
SD_Started
=
true
;
}
}
...
@@ -178,6 +248,15 @@ boolean SD_PlaySound(soundnames sound)
...
@@ -178,6 +248,15 @@ boolean SD_PlaySound(soundnames sound)
boolean
ispos
;
boolean
ispos
;
int
lp
,
rp
;
int
lp
,
rp
;
printf
(
"Playing sound %d, digimap %d
\n
"
,
sound
,
DigiMap
[
sound
]);
fflush
(
stdout
);
if
(
DigiMap
[
sound
]
!=
-
1
)
{
alSourceStop
(
*
sources
);
alSourcei
(
*
sources
,
AL_BUFFER
,
buffers
[
DigiMap
[
sound
]]);
alSourcePlay
(
*
sources
);
}
lp
=
LeftPosition
;
lp
=
LeftPosition
;
rp
=
RightPosition
;
rp
=
RightPosition
;
LeftPosition
=
0
;
LeftPosition
=
0
;
...
...
src/wl_debug.c
View file @
2757f756
...
@@ -248,8 +248,7 @@ static char buf[10];
...
@@ -248,8 +248,7 @@ static char buf[10];
PM_GetPage(j);
PM_GetPage(j);
break;
break;
case sc_P:
case sc_P:
// if (sound != -1)
/* TODO: this would play the current digital sound */
// SD_PlayDigitized(sound);
break;
break;
case sc_Escape:
case sc_Escape:
done = true;
done = true;
...
...
src/wl_main.c
View file @
2757f756
...
@@ -796,7 +796,7 @@ static int wolfdigimap[] =
...
@@ -796,7 +796,7 @@ static int wolfdigimap[] =
NAZIFIRESND
,
21
,
NAZIFIRESND
,
21
,
SLURPIESND
,
22
,
SLURPIESND
,
22
,
YEAHSND
,
32
,
YEAHSND
,
32
,
#ifndef UPLOAD
#ifndef UPLOAD
// These are in all other episodes
// These are in all other episodes
...
@@ -813,21 +813,21 @@ static int wolfdigimap[] =
...
@@ -813,21 +813,21 @@ static int wolfdigimap[] =
NEINSOVASSND
,
28
,
NEINSOVASSND
,
28
,
DOGATTACKSND
,
29
,
DOGATTACKSND
,
29
,
LEVELDONESND
,
30
,
LEVELDONESND
,
30
,
MECHSTEPSND
,
31
,
MECHSTEPSND
,
31
,
SCHEISTSND
,
33
,
SCHEISTSND
,
33
,
DEATHSCREAM4SND
,
34
,
// AIIEEE
DEATHSCREAM4SND
,
34
,
// AIIEEE
DEATHSCREAM5SND
,
35
,
// DEE-DEE
DEATHSCREAM5SND
,
35
,
// DEE-DEE
DONNERSND
,
36
,
// EPISODE 4 BOSS DIE
DONNERSND
,
36
,
// EPISODE 4 BOSS DIE
EINESND
,
37
,
// EPISODE 4 BOSS SIGHTING
EINESND
,
37
,
// EPISODE 4 BOSS SIGHTING
ERLAUBENSND
,
38
,
// EPISODE 6 BOSS SIGHTING
ERLAUBENSND
,
38
,
// EPISODE 6 BOSS SIGHTING
DEATHSCREAM6SND
,
39
,
// FART
DEATHSCREAM6SND
,
39
,
// FART
DEATHSCREAM7SND
,
40
,
// GASP
DEATHSCREAM7SND
,
40
,
// GASP
DEATHSCREAM8SND
,
41
,
// GUH-BOY!
DEATHSCREAM8SND
,
41
,
// GUH-BOY!
DEATHSCREAM9SND
,
42
,
// AH GEEZ!
DEATHSCREAM9SND
,
42
,
// AH GEEZ!
KEINSND
,
43
,
// EPISODE 5 BOSS SIGHTING
KEINSND
,
43
,
// EPISODE 5 BOSS SIGHTING
MEINSND
,
44
,
// EPISODE 6 BOSS DIE
MEINSND
,
44
,
// EPISODE 6 BOSS DIE
ROSESND
,
45
,
// EPISODE 5 BOSS DIE
ROSESND
,
45
,
// EPISODE 5 BOSS DIE
#endif
#endif
#else
#else
...
@@ -852,14 +852,14 @@ static int wolfdigimap[] =
...
@@ -852,14 +852,14 @@ static int wolfdigimap[] =
NAZIFIRESND
,
17
,
NAZIFIRESND
,
17
,
SLURPIESND
,
18
,
SLURPIESND
,
18
,
LEVELDONESND
,
22
,
LEVELDONESND
,
22
,
DEATHSCREAM4SND
,
23
,
// AIIEEE
DEATHSCREAM4SND
,
23
,
// AIIEEE
DEATHSCREAM3SND
,
23
,
// DOUBLY-MAPPED!!!
DEATHSCREAM3SND
,
23
,
// DOUBLY-MAPPED!!!
DEATHSCREAM5SND
,
24
,
// DEE-DEE
DEATHSCREAM5SND
,
24
,
// DEE-DEE
DEATHSCREAM6SND
,
25
,
// FART
DEATHSCREAM6SND
,
25
,
// FART
DEATHSCREAM7SND
,
26
,
// GASP
DEATHSCREAM7SND
,
26
,
// GASP
DEATHSCREAM8SND
,
27
,
// GUH-BOY!
DEATHSCREAM8SND
,
27
,
// GUH-BOY!
DEATHSCREAM9SND
,
28
,
// AH GEEZ!
DEATHSCREAM9SND
,
28
,
// AH GEEZ!
GETGATLINGSND
,
38
,
// Got Gat replacement
GETGATLINGSND
,
38
,
// Got Gat replacement
#ifndef SPEARDEMO
#ifndef SPEARDEMO
DOGBARKSND
,
1
,
DOGBARKSND
,
1
,
...
@@ -867,16 +867,16 @@ static int wolfdigimap[] =
...
@@ -867,16 +867,16 @@ static int wolfdigimap[] =
SPIONSND
,
19
,
SPIONSND
,
19
,
NEINSOVASSND
,
20
,
NEINSOVASSND
,
20
,
DOGATTACKSND
,
21
,
DOGATTACKSND
,
21
,
TRANSSIGHTSND
,
29
,
// Trans Sight
TRANSSIGHTSND
,
29
,
// Trans Sight
TRANSDEATHSND
,
30
,
// Trans Death
TRANSDEATHSND
,
30
,
// Trans Death
WILHELMSIGHTSND
,
31
,
// Wilhelm Sight
WILHELMSIGHTSND
,
31
,
// Wilhelm Sight
WILHELMDEATHSND
,
32
,
// Wilhelm Death
WILHELMDEATHSND
,
32
,
// Wilhelm Death
UBERDEATHSND
,
33
,
// Uber Death
UBERDEATHSND
,
33
,
// Uber Death
KNIGHTSIGHTSND
,
34
,
// Death Knight Sight
KNIGHTSIGHTSND
,
34
,
// Death Knight Sight
KNIGHTDEATHSND
,
35
,
// Death Knight Death
KNIGHTDEATHSND
,
35
,
// Death Knight Death
ANGELSIGHTSND
,
36
,
// Angel Sight
ANGELSIGHTSND
,
36
,
// Angel Sight
ANGELDEATHSND
,
37
,
// Angel Death
ANGELDEATHSND
,
37
,
// Angel Death
GETSPEARSND
,
39
,
// Got Spear replacement
GETSPEARSND
,
39
,
// Got Spear replacement
#endif
#endif
#endif
#endif
LASTSOUND
LASTSOUND
...
...
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