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
c030b94b
Commit
c030b94b
authored
Apr 30, 2000
by
Steven Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Pause key support. Renamed id_sd to sd_* and started on sd_oal
(OpenAL).
parent
4e05fcd2
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
301 additions
and
40 deletions
+301
-40
Makefile
src/Makefile
+9
-5
id_ca.c
src/id_ca.c
+7
-13
id_heads.h
src/id_heads.h
+1
-1
sd_comm.h
src/sd_comm.h
+3
-3
sd_null.c
src/sd_null.c
+0
-0
sd_oal.c
src/sd_oal.c
+272
-0
version.h
src/version.h
+1
-1
vi_glx.c
src/vi_glx.c
+2
-0
vi_svga.c
src/vi_svga.c
+1
-1
vi_xlib.c
src/vi_xlib.c
+2
-0
wl_game.c
src/wl_game.c
+0
-12
wl_play.c
src/wl_play.c
+3
-4
No files found.
src/Makefile
View file @
c030b94b
CC
=
gcc
#CFLAGS = -Wall -O6 -fomit-frame-pointer -ffast-math -funroll-loops -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
CFLAGS
=
-g
-Wall
#
CFLAGS = -g -Wall
#CFLAGS = -g
#CFLAGS = -Os
OBJS
=
objs.o misc.o id_ca.o id_sd.o id_vh.o id_us.o
\
CFLAGS
=
-g
-Wall
-I
/usr/local/openal/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
wl_debug.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 -lvga ElectricFence-2.2.2/libefence.a -lpthread
#LFLAGS = -lm
LFLAGS
=
-lm
-L
/usr/local/openal/lib
-lopenal
-lpthread
-ldl
SLFLAGS
=
$(LFLAGS)
-lvga
XLFLAGS
=
$(LFLAGS)
-L
/usr/X11R6/lib
-lX11
-lXext
GLFLAGS
=
$(LFLAGS)
-L
/usr/X11R6/lib
-lX11
-lXext
-lGL
...
...
src/id_ca.c
View file @
c030b94b
...
...
@@ -644,8 +644,7 @@ void CAL_SetupMapFile (void)
}
//==========================================================================
/* ======================================================================== */
/*
======================
...
...
@@ -657,13 +656,12 @@ void CAL_SetupMapFile (void)
void
CAL_SetupAudioFile
(
void
)
{
int
handle
,
i
;
int
handle
;
long
length
;
char
fname
[
13
];
//
// load maphead.ext (offsets and tileinfo for map file)
//
/* load maphead.ext (offsets and tileinfo for map file) */
strcpy
(
fname
,
aheadname
);
strcat
(
fname
,
extension
);
...
...
@@ -677,11 +675,8 @@ void CAL_SetupAudioFile (void)
close
(
handle
);
for
(
i
=
0
;
i
<
length
/
4
;
i
++
)
printf
(
"chunk %03d: %08ld
\n
"
,
i
,
audiostarts
[
i
]);
//
// open the data file
//
/* open the data file */
strcpy
(
fname
,
afilename
);
strcat
(
fname
,
extension
);
...
...
@@ -690,8 +685,7 @@ void CAL_SetupAudioFile (void)
CA_CannotOpen
(
fname
);
}
//==========================================================================
/* ======================================================================== */
/*
======================
...
...
src/id_heads.h
View file @
c030b94b
...
...
@@ -69,10 +69,10 @@ typedef struct
}
Rect
;
#include "vi_comm.h"
#include "sd_comm.h"
#include "id_ca.h"
#include "id_vh.h"
#include "id_sd.h"
#include "id_us.h"
extern
byte
signon
[];
...
...
src/
id_sd
.h
→
src/
sd_comm
.h
View file @
c030b94b
#ifndef __
ID_SD
_H__
#define __
ID_SD
_H__
#ifndef __
SD_COMM
_H__
#define __
SD_COMM
_H__
#define TickBase 70
// 70Hz per tick - used as a base for timer 0
#define TickBase 70
// 70Hz per tick
typedef
enum
{
sdm_Off
,
...
...
src/
id_sd
.c
→
src/
sd_null
.c
View file @
c030b94b
File moved
src/sd_oal.c
0 → 100644
View file @
c030b94b
/* id_sd.c */
#include "id_heads.h"
#include <AL/al.h>
#include <AL/alc.h>
// Global variables
boolean
SoundSourcePresent
,
AdLibPresent
,
SoundBlasterPresent
,
SBProPresent
,
NeedsDigitized
,
NeedsMusic
,
SoundPositioned
;
SDMode
SoundMode
;
SMMode
MusicMode
;
SDSMode
DigiMode
;
word
*
SoundTable
;
word
ssPort
=
2
;
int
DigiMap
[
LASTSOUND
];
// Internal variables
static
boolean
SD_Started
;
boolean
nextsoundpos
;
soundnames
SoundNumber
,
DigiNumber
;
word
SoundPriority
,
DigiPriority
;
int
LeftPosition
,
RightPosition
;
word
NumDigi
,
DigiLeft
,
DigiPage
;
word
*
DigiList
;
word
DigiLastStart
,
DigiLastEnd
;
boolean
DigiPlaying
;
static
boolean
DigiMissed
,
DigiLastSegment
;
static
memptr
DigiNextAddr
;
static
word
DigiNextLen
;
// SoundBlaster variables
static
boolean
sbNoCheck
,
sbNoProCheck
;
static
byte
sbOldIntMask
=
-
1
;
static
byte
*
sbNextSegPtr
;
static
longword
sbNextSegLen
;
static
SampledSound
*
sbSamples
;
// SoundSource variables
boolean
ssNoCheck
;
boolean
ssActive
;
word
ssControl
,
ssStatus
,
ssData
;
byte
ssOn
,
ssOff
;
byte
*
ssSample
;
longword
ssLengthLeft
;
// PC Sound variables
volatile
byte
pcLastSample
,
*
pcSound
;
longword
pcLengthLeft
;
word
pcSoundLookup
[
255
];
// AdLib variables
boolean
alNoCheck
;
byte
*
alSound
;
word
alBlock
;
longword
alLengthLeft
;
Instrument
alZeroInst
;
// Sequencer variables
boolean
sqActive
;
static
word
alFXReg
;
static
ActiveTrack
*
tracks
[
sqMaxTracks
],
mytracks
[
sqMaxTracks
];
static
word
sqMode
,
sqFadeStep
;
/* ------------------------------------------------------------------------ */
void
*
cc
;
void
SD_StopDigitized
(
void
)
{
}
void
SD_Poll
(
void
)
{
}
void
SD_SetPosition
(
int
leftpos
,
int
rightpos
)
{
}
void
SD_PlayDigitized
(
word
which
,
int
leftpos
,
int
rightpos
)
{
}
void
SD_SetDigiDevice
(
SDSMode
mode
)
{
}
// Public routines
///////////////////////////////////////////////////////////////////////////
//
// SD_SetSoundMode() - Sets which sound hardware to use for sound effects
//
///////////////////////////////////////////////////////////////////////////
boolean
SD_SetSoundMode
(
SDMode
mode
)
{
return
false
;
}
///////////////////////////////////////////////////////////////////////////
//
// SD_SetMusicMode() - sets the device to use for background music
//
///////////////////////////////////////////////////////////////////////////
boolean
SD_SetMusicMode
(
SMMode
mode
)
{
return
false
;
}
///////////////////////////////////////////////////////////////////////////
//
// SD_Startup() - starts up the Sound Mgr
//
///////////////////////////////////////////////////////////////////////////
void
SD_Startup
(
void
)
{
if
(
SD_Started
)
return
;
cc
=
alcCreateContext
(
NULL
);
if
(
cc
==
NULL
)
printf
(
"alcCreateContext failed..
\n
"
);
SD_Started
=
true
;
}
///////////////////////////////////////////////////////////////////////////
//
// SD_Shutdown() - shuts down the Sound Mgr
// Removes sound ISR and turns off whatever sound hardware was active
//
///////////////////////////////////////////////////////////////////////////
void
SD_Shutdown
(
void
)
{
if
(
!
SD_Started
)
return
;
if
(
cc
)
{
alcDestroyContext
(
cc
);
cc
=
NULL
;
}
SD_MusicOff
();
SD_StopSound
();
SD_Started
=
false
;
}
///////////////////////////////////////////////////////////////////////////
//
// SD_PositionSound() - Sets up a stereo imaging location for the next
// sound to be played. Each channel ranges from 0 to 15.
//
///////////////////////////////////////////////////////////////////////////
void
SD_PositionSound
(
int
leftvol
,
int
rightvol
)
{
LeftPosition
=
leftvol
;
RightPosition
=
rightvol
;
nextsoundpos
=
true
;
}
///////////////////////////////////////////////////////////////////////////
//
// SD_PlaySound() - plays the specified sound on the appropriate hardware
//
///////////////////////////////////////////////////////////////////////////
boolean
SD_PlaySound
(
soundnames
sound
)
{
boolean
ispos
;
int
lp
,
rp
;
lp
=
LeftPosition
;
rp
=
RightPosition
;
LeftPosition
=
0
;
RightPosition
=
0
;
ispos
=
nextsoundpos
;
nextsoundpos
=
false
;
return
false
;
}
///////////////////////////////////////////////////////////////////////////
//
// SD_SoundPlaying() - returns the sound number that's playing, or 0 if
// no sound is playing
//
///////////////////////////////////////////////////////////////////////////
word
SD_SoundPlaying
(
void
)
{
return
false
;
}
///////////////////////////////////////////////////////////////////////////
//
// SD_StopSound() - if a sound is playing, stops it
//
///////////////////////////////////////////////////////////////////////////
void
SD_StopSound
(
void
)
{
}
///////////////////////////////////////////////////////////////////////////
//
// SD_WaitSoundDone() - waits until the current sound is done playing
//
///////////////////////////////////////////////////////////////////////////
void
SD_WaitSoundDone
(
void
)
{
while
(
SD_SoundPlaying
())
;
}
///////////////////////////////////////////////////////////////////////////
//
// SD_MusicOn() - turns on the sequencer
//
///////////////////////////////////////////////////////////////////////////
void
SD_MusicOn
(
void
)
{
sqActive
=
true
;
}
///////////////////////////////////////////////////////////////////////////
//
// SD_MusicOff() - turns off the sequencer and any playing notes
//
///////////////////////////////////////////////////////////////////////////
void
SD_MusicOff
(
void
)
{
sqActive
=
false
;
}
///////////////////////////////////////////////////////////////////////////
//
// SD_StartMusic() - starts playing the music pointed to
//
///////////////////////////////////////////////////////////////////////////
void
SD_StartMusic
(
MusicGroup
*
music
)
{
SD_MusicOff
();
}
///////////////////////////////////////////////////////////////////////////
//
// SD_FadeOutMusic() - starts fading out the music. Call SD_MusicPlaying()
// to see if the fadeout is complete
//
///////////////////////////////////////////////////////////////////////////
void
SD_FadeOutMusic
(
void
)
{
}
///////////////////////////////////////////////////////////////////////////
//
// SD_MusicPlaying() - returns true if music is currently playing, false if
// not
//
///////////////////////////////////////////////////////////////////////////
boolean
SD_MusicPlaying
(
void
)
{
return
false
;
}
src/version.h
View file @
c030b94b
...
...
@@ -6,7 +6,7 @@
/* SDM = 2 */
/* SOD = 3 */
#ifndef WMODE
#define WMODE
3
#define WMODE
1
#endif
#if WMODE == 0
...
...
src/vi_glx.c
View file @
c030b94b
...
...
@@ -508,6 +508,8 @@ int XKeysymToScancode(unsigned int keysym)
return
sc_Y
;
case
XK_n
:
return
sc_N
;
case
XK_Pause
:
return
0xE1
;
default:
printf
(
"unknown: %s
\n
"
,
XKeysymToString
(
keysym
));
return
sc_None
;
...
...
src/vi_svga.c
View file @
c030b94b
...
...
@@ -358,7 +358,7 @@ void keyboard_handler(int code, int press)
if
(
k
==
0xe0
)
// Special key prefix
special
=
true
;
else
if
(
k
==
0xe1
)
// Handle Pause key
else
if
(
(
k
==
SCANCODE_BREAK
)
||
(
k
==
SCANCODE_BREAK_ALTERNATIVE
)
)
// Handle Pause key
Paused
=
true
;
else
{
...
...
src/vi_xlib.c
View file @
c030b94b
...
...
@@ -759,6 +759,8 @@ int XKeysymToScancode(unsigned int keysym)
return
sc_Y
;
case
XK_n
:
return
sc_N
;
case
XK_Pause
:
return
0xE1
;
default:
printf
(
"unknown: %s
\n
"
,
XKeysymToString
(
keysym
));
return
sc_None
;
...
...
src/wl_game.c
View file @
c030b94b
...
...
@@ -24,19 +24,7 @@ boolean spearflag;
//
int
ElevatorBackTo
[]
=
{
1
,
1
,
7
,
3
,
5
,
3
};
/*
=============================================================================
LOCAL VARIABLES
=============================================================================
*/
//===========================================================================
//===========================================================================
/*
==========================
...
...
src/wl_play.c
View file @
c030b94b
...
...
@@ -694,12 +694,11 @@ void CheckKeys (void)
DrawAllPlayBorder
();
}
//
// pause key weirdness can't be checked as a scan code
//
if
(
Paused
)
{
LatchDrawPic
(
20
-
4
,
80
-
2
*
8
,
PAUSEDPIC
);
VWB_DrawPic
(
128
,
64
,
PAUSEDPIC
);
VW_UpdateScreen
();
SD_MusicOff
();
IN_Ack
();
IN_ClearKeysDown
();
...
...
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