Commit 930c3b32 authored by Steven Fuller's avatar Steven Fuller

set gfxbuf pointer after a SDL_Flip.

preliminary changes for SDL joystick support.
parent ce67e229
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
......
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.
......
...@@ -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
......
...@@ -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);
......
...@@ -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;
......
...@@ -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)
{
}
...@@ -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 */
......
...@@ -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();
......
...@@ -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;
......
...@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment