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
930c3b32
Commit
930c3b32
authored
Nov 12, 2002
by
Steven Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set gfxbuf pointer after a SDL_Flip.
preliminary changes for SDL joystick support.
parent
ce67e229
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
289 additions
and
77 deletions
+289
-77
Makefile
src/Makefile
+5
-3
README
src/README
+0
-14
vi_comm.c
src/vi_comm.c
+0
-57
vi_comm.h
src/vi_comm.h
+1
-0
vi_null.c
src/vi_null.c
+104
-0
vi_sdl.c
src/vi_sdl.c
+62
-0
vi_svga.c
src/vi_svga.c
+57
-0
vi_xlib.c
src/vi_xlib.c
+57
-0
wl_act2.c
src/wl_act2.c
+1
-1
wl_main.c
src/wl_main.c
+2
-2
No files found.
src/Makefile
View file @
930c3b32
CC
=
gcc
CC
=
gcc
#CC = gcc-3.0
#CC = gcc-3.0
#CC=/opt/intel/compiler60/ia32/bin/icc
CFLAGS
=
-g
-Wall
-pedantic
CFLAGS
=
-g
-Wall
-pedantic
#CFLAGS = -g -O2 -Wall -pedantic
#CFLAGS = -g -O2 -Wall -pedantic
...
@@ -7,7 +8,7 @@ CFLAGS = -g -Wall -pedantic
...
@@ -7,7 +8,7 @@ CFLAGS = -g -Wall -pedantic
#CFLAGS = -g -Wall -pedantic -std=gnu99
#CFLAGS = -g -Wall -pedantic -std=gnu99
#CFLAGS = -Os -Wall -pedantic
#CFLAGS = -Os -Wall -pedantic
#CFLAGS = -Os -Wall -fomit-frame-pointer -ffast-math -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
#CFLAGS = -Os -Wall -fomit-frame-pointer -ffast-math -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
#CFLAGS=-O3 -xiMK -tpp6 -c99 -wp_ipo -g
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
\
wl_inter.o wl_menu.o wl_play.o wl_state.o wl_text.o wl_main.o
\
wl_inter.o wl_menu.o wl_play.o wl_state.o wl_text.o wl_main.o
\
...
@@ -17,6 +18,7 @@ SOBJS = $(OBJS) $(ROBJS) vi_svga.o
...
@@ -17,6 +18,7 @@ SOBJS = $(OBJS) $(ROBJS) vi_svga.o
XOBJS
=
$(OBJS)
$(ROBJS)
vi_xlib.o
XOBJS
=
$(OBJS)
$(ROBJS)
vi_xlib.o
DOBJS
=
$(OBJS)
$(ROBJS)
vi_sdl.o
DOBJS
=
$(OBJS)
$(ROBJS)
vi_sdl.o
#LFLAGS = -lm -wp_ipo
LFLAGS
=
-lm
LFLAGS
=
-lm
OBJS
+=
sd_null.o
OBJS
+=
sd_null.o
...
@@ -28,7 +30,7 @@ CFLAGS += $(shell sdl-config --cflags)
...
@@ -28,7 +30,7 @@ CFLAGS += $(shell sdl-config --cflags)
SLFLAGS
=
$(LFLAGS)
-lvga
SLFLAGS
=
$(LFLAGS)
-lvga
XLFLAGS
=
$(LFLAGS)
-L
/usr/X11R6/lib
-lX11
-lXext
XLFLAGS
=
$(LFLAGS)
-L
/usr/X11R6/lib
-lX11
-lXext
DLFLAGS
=
$(LFLAGS)
$(
shell
sdl-config
--libs
)
-L
/usr/X11R6/lib
-lX11
-lXext
DLFLAGS
=
$(LFLAGS)
$(
shell
sdl-config
--libs
)
NASM
=
nasm
NASM
=
nasm
...
@@ -54,7 +56,7 @@ sdlwolf3d: $(DOBJS)
...
@@ -54,7 +56,7 @@ sdlwolf3d: $(DOBJS)
$(CC)
-o
sdlwolf3d
$(DOBJS)
$(DLFLAGS)
$(CC)
-o
sdlwolf3d
$(DOBJS)
$(DLFLAGS)
clean
:
clean
:
rm
-rf
swolf3d xwolf3d sdlwolf3d
*
.o
rm
-rf
swolf3d xwolf3d sdlwolf3d
*
.o
*
.il
distclean
:
clean
distclean
:
clean
rm
-rf
*
~ DEADJOE
rm
-rf
*
~ DEADJOE
...
...
src/README
View file @
930c3b32
TODO: I still need to write this file
Save game and configuration file formats are not yet "solid" (files created
Save game and configuration file formats are not yet "solid" (files created
with an older version may not work with a new binary), but they probably
with an older version may not work with a new binary), but they probably
won't have to change.
won't have to change.
Sound support is still "experiemental." Currently requires OSS support.
Edit the Makefile and change:
OBJS += sd_null.o
#OBJS += sd_oss.o fmopl.o
#CFLAGS += -D_REENTRANT
#LFLAGS += -lpthread
to:
#OBJS += sd_null.o
OBJS += sd_oss.o fmopl.o
CFLAGS += -D_REENTRANT
LFLAGS += -lpthread
and recompile. Hopefully it doesn't sound too terrible...
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.
NOTE: edit version.h to change the gametype.
...
...
src/vi_comm.c
View file @
930c3b32
...
@@ -141,53 +141,6 @@ boolean IN_UserInput(longword delay)
...
@@ -141,53 +141,6 @@ boolean IN_UserInput(longword delay)
//===========================================================================
//===========================================================================
/*
===================
=
= IN_JoyButtons
=
===================
*/
byte
IN_JoyButtons
()
{
return
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// IN_GetJoyAbs() - Reads the absolute position of the specified joystick
//
///////////////////////////////////////////////////////////////////////////
void
IN_GetJoyAbs
(
word
joy
,
word
*
xp
,
word
*
yp
)
{
*
xp
=
0
;
*
yp
=
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// INL_GetJoyDelta() - Returns the relative movement of the specified
// joystick (from +/-127)
//
///////////////////////////////////////////////////////////////////////////
void
INL_GetJoyDelta
(
word
joy
,
int
*
dx
,
int
*
dy
)
{
*
dx
=
0
;
*
dy
=
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// INL_GetJoyButtons() - Returns the button status of the specified
// joystick
//
///////////////////////////////////////////////////////////////////////////
static
word
INL_GetJoyButtons
(
word
joy
)
{
return
0
;
}
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
//
//
// INL_StartKbd() - Sets up my keyboard stuff for use
// INL_StartKbd() - Sets up my keyboard stuff for use
...
@@ -216,16 +169,6 @@ static void INL_ShutMouse(void)
...
@@ -216,16 +169,6 @@ static void INL_ShutMouse(void)
{
{
}
}
///////////////////////////////////////////////////////////////////////////
//
// IN_SetupJoy() - Sets up thresholding values and calls INL_SetJoyScale()
// to set up scaling values
//
///////////////////////////////////////////////////////////////////////////
void
IN_SetupJoy
(
word
joy
,
word
minx
,
word
maxx
,
word
miny
,
word
maxy
)
{
}
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
//
//
// INL_StartJoy() - Detects & auto-configures the specified joystick
// INL_StartJoy() - Detects & auto-configures the specified joystick
...
...
src/vi_comm.h
View file @
930c3b32
...
@@ -165,6 +165,7 @@ extern char *IN_GetScanName(ScanCode);
...
@@ -165,6 +165,7 @@ extern char *IN_GetScanName(ScanCode);
byte
IN_MouseButtons
();
byte
IN_MouseButtons
();
byte
IN_JoyButtons
();
byte
IN_JoyButtons
();
word
INL_GetJoyButtons
(
word
joy
);
void
IN_GetMouseDelta
(
int
*
dx
,
int
*
dy
);
void
IN_GetMouseDelta
(
int
*
dx
,
int
*
dy
);
void
INL_GetJoyDelta
(
word
joy
,
int
*
dx
,
int
*
dy
);
void
INL_GetJoyDelta
(
word
joy
,
int
*
dx
,
int
*
dy
);
...
...
src/vi_null.c
View file @
930c3b32
...
@@ -108,6 +108,110 @@ void INL_Update()
...
@@ -108,6 +108,110 @@ void INL_Update()
{
{
}
}
/*
===================
=
= IN_JoyButtons
=
===================
*/
byte
IN_JoyButtons
()
{
return
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// IN_GetJoyAbs() - Reads the absolute position of the specified joystick
//
///////////////////////////////////////////////////////////////////////////
void
IN_GetJoyAbs
(
word
joy
,
word
*
xp
,
word
*
yp
)
{
*
xp
=
0
;
*
yp
=
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// INL_GetJoyDelta() - Returns the relative movement of the specified
// joystick (from +/-127)
//
///////////////////////////////////////////////////////////////////////////
void
INL_GetJoyDelta
(
word
joy
,
int
*
dx
,
int
*
dy
)
{
*
dx
=
0
;
*
dy
=
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// INL_GetJoyButtons() - Returns the button status of the specified
// joystick
//
///////////////////////////////////////////////////////////////////////////
word
INL_GetJoyButtons
(
word
joy
)
{
return
0
;
}
/*
===================
=
= IN_JoyButtons
=
===================
*/
byte
IN_JoyButtons
()
{
return
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// IN_GetJoyAbs() - Reads the absolute position of the specified joystick
//
///////////////////////////////////////////////////////////////////////////
void
IN_GetJoyAbs
(
word
joy
,
word
*
xp
,
word
*
yp
)
{
*
xp
=
0
;
*
yp
=
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// INL_GetJoyDelta() - Returns the relative movement of the specified
// joystick (from +/-127)
//
///////////////////////////////////////////////////////////////////////////
void
INL_GetJoyDelta
(
word
joy
,
int
*
dx
,
int
*
dy
)
{
*
dx
=
0
;
*
dy
=
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// INL_GetJoyButtons() - Returns the button status of the specified
// joystick
//
///////////////////////////////////////////////////////////////////////////
static
word
INL_GetJoyButtons
(
word
joy
)
{
return
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// IN_SetupJoy() - Sets up thresholding values and calls INL_SetJoyScale()
// to set up scaling values
//
///////////////////////////////////////////////////////////////////////////
void
IN_SetupJoy
(
word
joy
,
word
minx
,
word
maxx
,
word
miny
,
word
maxy
)
{
}
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
{
vwidth
=
320
;
vwidth
=
320
;
...
...
src/vi_sdl.c
View file @
930c3b32
...
@@ -60,6 +60,8 @@ void VL_WaitVBL(int vbls)
...
@@ -60,6 +60,8 @@ void VL_WaitVBL(int vbls)
void
VW_UpdateScreen
()
void
VW_UpdateScreen
()
{
{
SDL_Flip
(
surface
);
SDL_Flip
(
surface
);
gfxbuf
=
surface
->
pixels
;
}
}
/*
/*
...
@@ -341,6 +343,9 @@ void INL_Update()
...
@@ -341,6 +343,9 @@ void INL_Update()
case
SDL_KEYUP
:
case
SDL_KEYUP
:
keyboard_handler
(
XKeysymToScancode
(
event
.
key
.
keysym
.
sym
),
0
);
keyboard_handler
(
XKeysymToScancode
(
event
.
key
.
keysym
.
sym
),
0
);
break
;
break
;
case
SDL_QUIT
:
/* TODO do something here */
break
;
default:
default:
break
;
break
;
}
}
...
@@ -393,3 +398,60 @@ byte IN_MouseButtons()
...
@@ -393,3 +398,60 @@ byte IN_MouseButtons()
{
{
return
SDL_GetMouseState
(
NULL
,
NULL
);
return
SDL_GetMouseState
(
NULL
,
NULL
);
}
}
/*
===================
=
= IN_JoyButtons
=
===================
*/
byte
IN_JoyButtons
()
{
return
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// IN_GetJoyAbs() - Reads the absolute position of the specified joystick
//
///////////////////////////////////////////////////////////////////////////
void
IN_GetJoyAbs
(
word
joy
,
word
*
xp
,
word
*
yp
)
{
*
xp
=
0
;
*
yp
=
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// INL_GetJoyDelta() - Returns the relative movement of the specified
// joystick (from +/-127)
//
///////////////////////////////////////////////////////////////////////////
void
INL_GetJoyDelta
(
word
joy
,
int
*
dx
,
int
*
dy
)
{
*
dx
=
0
;
*
dy
=
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// INL_GetJoyButtons() - Returns the button status of the specified
// joystick
//
///////////////////////////////////////////////////////////////////////////
word
INL_GetJoyButtons
(
word
joy
)
{
return
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// IN_SetupJoy() - Sets up thresholding values and calls INL_SetJoyScale()
// to set up scaling values
//
///////////////////////////////////////////////////////////////////////////
void
IN_SetupJoy
(
word
joy
,
word
minx
,
word
maxx
,
word
miny
,
word
maxy
)
{
}
src/vi_svga.c
View file @
930c3b32
...
@@ -214,6 +214,63 @@ void IN_GetMouseDelta(int *dx, int *dy)
...
@@ -214,6 +214,63 @@ void IN_GetMouseDelta(int *dx, int *dy)
{
{
}
}
/*
===================
=
= IN_JoyButtons
=
===================
*/
byte
IN_JoyButtons
()
{
return
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// IN_GetJoyAbs() - Reads the absolute position of the specified joystick
//
///////////////////////////////////////////////////////////////////////////
void
IN_GetJoyAbs
(
word
joy
,
word
*
xp
,
word
*
yp
)
{
*
xp
=
0
;
*
yp
=
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// INL_GetJoyDelta() - Returns the relative movement of the specified
// joystick (from +/-127)
//
///////////////////////////////////////////////////////////////////////////
void
INL_GetJoyDelta
(
word
joy
,
int
*
dx
,
int
*
dy
)
{
*
dx
=
0
;
*
dy
=
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// INL_GetJoyButtons() - Returns the button status of the specified
// joystick
//
///////////////////////////////////////////////////////////////////////////
word
INL_GetJoyButtons
(
word
joy
)
{
return
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// IN_SetupJoy() - Sets up thresholding values and calls INL_SetJoyScale()
// to set up scaling values
//
///////////////////////////////////////////////////////////////////////////
void
IN_SetupJoy
(
word
joy
,
word
minx
,
word
maxx
,
word
miny
,
word
maxy
)
{
}
void
INL_Update
()
void
INL_Update
()
{
{
while
(
keyboard_update
())
;
/* get all events */
while
(
keyboard_update
())
;
/* get all events */
...
...
src/vi_xlib.c
View file @
930c3b32
...
@@ -636,6 +636,63 @@ void IN_GetMouseDelta(int *dx, int *dy)
...
@@ -636,6 +636,63 @@ void IN_GetMouseDelta(int *dx, int *dy)
{
{
}
}
/*
===================
=
= IN_JoyButtons
=
===================
*/
byte
IN_JoyButtons
()
{
return
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// IN_GetJoyAbs() - Reads the absolute position of the specified joystick
//
///////////////////////////////////////////////////////////////////////////
void
IN_GetJoyAbs
(
word
joy
,
word
*
xp
,
word
*
yp
)
{
*
xp
=
0
;
*
yp
=
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// INL_GetJoyDelta() - Returns the relative movement of the specified
// joystick (from +/-127)
//
///////////////////////////////////////////////////////////////////////////
void
INL_GetJoyDelta
(
word
joy
,
int
*
dx
,
int
*
dy
)
{
*
dx
=
0
;
*
dy
=
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// INL_GetJoyButtons() - Returns the button status of the specified
// joystick
//
///////////////////////////////////////////////////////////////////////////
word
INL_GetJoyButtons
(
word
joy
)
{
return
0
;
}
///////////////////////////////////////////////////////////////////////////
//
// IN_SetupJoy() - Sets up thresholding values and calls INL_SetJoyScale()
// to set up scaling values
//
///////////////////////////////////////////////////////////////////////////
void
IN_SetupJoy
(
word
joy
,
word
minx
,
word
maxx
,
word
miny
,
word
maxy
)
{
}
void
INL_Update
()
void
INL_Update
()
{
{
HandleXEvents
();
HandleXEvents
();
...
...
src/wl_act2.c
View file @
930c3b32
...
@@ -1336,7 +1336,7 @@ void SpawnGhosts (int which, int tilex, int tiley)
...
@@ -1336,7 +1336,7 @@ void SpawnGhosts (int which, int tilex, int tiley)
void
SpawnSchabbs
(
int
tilex
,
int
tiley
)
void
SpawnSchabbs
(
int
tilex
,
int
tiley
)
{
{
if
(
DigiMode
!=
sds_Off
)
/* TODO: what? */
if
(
DigiMode
!=
sds_Off
)
gamestates
[
s_schabbdie2
].
tictime
=
140
;
gamestates
[
s_schabbdie2
].
tictime
=
140
;
else
else
gamestates
[
s_schabbdie2
].
tictime
=
5
;
gamestates
[
s_schabbdie2
].
tictime
=
5
;
...
...
src/wl_main.c
View file @
930c3b32
...
@@ -1032,8 +1032,8 @@ void DoJukebox()
...
@@ -1032,8 +1032,8 @@ void DoJukebox()
unsigned
start
;
unsigned
start
;
IN_ClearKeysDown
();
IN_ClearKeysDown
();
//
if (!AdLibPresent && !SoundBlasterPresent)
if
(
!
AdLibPresent
&&
!
SoundBlasterPresent
)
//
return;
return
;
MenuFadeOut
();
MenuFadeOut
();
...
...
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