Commit 9fe175e9 authored by Steven Fuller's avatar Steven Fuller

vi_sdl.c, Makefile: Added vi_sdl.c (SDL target) from Dan Olson

parent 250feebc
...@@ -13,6 +13,7 @@ OBJS = objs.o misc.o id_ca.o id_vh.o id_us.o \ ...@@ -13,6 +13,7 @@ OBJS = objs.o misc.o id_ca.o id_vh.o id_us.o \
ROBJS = wl_draw.o ROBJS = wl_draw.o
SOBJS = $(OBJS) $(ROBJS) vi_svga.o SOBJS = $(OBJS) $(ROBJS) vi_svga.o
XOBJS = $(OBJS) $(ROBJS) vi_xlib.o XOBJS = $(OBJS) $(ROBJS) vi_xlib.o
DOBJS = $(OBJS) $(ROBJS) vi_sdl.o
LFLAGS = -lm LFLAGS = -lm
...@@ -22,17 +23,21 @@ OBJS += sd_null.o ...@@ -22,17 +23,21 @@ OBJS += sd_null.o
#LFLAGS += -lpthread #LFLAGS += -lpthread
CFLAGS += `sdl-config --cflags`
SLFLAGS = $(LFLAGS) -lvga SLFLAGS = $(LFLAGS) -lvga
XLFLAGS = $(LFLAGS) -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lXxf86dga XLFLAGS = $(LFLAGS) -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lXxf86dga
DLFLAGS = $(LFLAGS) `sdl-config --libs` -L/usr/X11R6/lib -lX11 -lXext
NASM = nasm NASM = nasm
.SUFFIXES: .asm .SUFFIXES: .asm
all: swolf3d xwolf3d all: swolf3d xwolf3d sdlwolf3d
$(SOBJS): version.h id_heads.h wl_def.h $(SOBJS): version.h id_heads.h wl_def.h
$(XOBJS): version.h id_heads.h wl_def.h $(XOBJS): version.h id_heads.h wl_def.h
$(DOBJS): version.h id_heads.h wl_def.h
.asm.o: .asm.o:
$(NASM) -f elf -o $@ $< $(NASM) -f elf -o $@ $<
...@@ -43,6 +48,9 @@ swolf3d: $(SOBJS) ...@@ -43,6 +48,9 @@ swolf3d: $(SOBJS)
xwolf3d: $(XOBJS) xwolf3d: $(XOBJS)
gcc -o xwolf3d $(XOBJS) $(XLFLAGS) gcc -o xwolf3d $(XOBJS) $(XLFLAGS)
sdlwolf3d: $(DOBJS)
gcc -o sdlwolf3d $(DOBJS) $(DLFLAGS)
clean: clean:
rm -rf swolf3d xwolf3d *.o rm -rf swolf3d xwolf3d *.o
......
...@@ -65,6 +65,7 @@ SD_StartMusic((MusicGroup *)audiosegs[STARTMUSIC + chunk]); ...@@ -65,6 +65,7 @@ SD_StartMusic((MusicGroup *)audiosegs[STARTMUSIC + chunk]);
=> =>
SD_StartMusic(chunk); SD_StartMusic(chunk);
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
* remove farmapylookup?
* would be nice if Quit() used vsnprintf, etc * would be nice if Quit() used vsnprintf, etc
* actor walking through door is drawn in front of door: near end of E1M1 for * actor walking through door is drawn in front of door: near end of E1M1 for
example example
......
This diff is collapsed.
#include "wl_def.h" #include "wl_def.h"
//==========================================================================
/* /*
================== ==================
= =
......
...@@ -69,10 +69,9 @@ char **_argv; ...@@ -69,10 +69,9 @@ char **_argv;
/* /*
======================== ========================
= =
= FixedByFrac = FixedByFrac (FixedMul)
= =
= multiply a 16/16 bit, 2's complement fixed point number by a 16 bit = multiply two 16/16 bit, 2's complement fixed point numbers
= fraction
= =
======================== ========================
*/ */
...@@ -280,19 +279,19 @@ void NewGame(int difficulty, int episode) ...@@ -280,19 +279,19 @@ void NewGame(int difficulty, int episode)
gamestate.ammo = STARTAMMO; gamestate.ammo = STARTAMMO;
gamestate.lives = 3; gamestate.lives = 3;
gamestate.nextextra = EXTRAPOINTS; gamestate.nextextra = EXTRAPOINTS;
gamestate.episode=episode; gamestate.episode = episode;
startgame = true; startgame = true;
} }
void DiskFlopAnim(int x, int y) void DiskFlopAnim(int x, int y)
{ {
static char which=0; static char which = 0;
if (!x && !y) if (!x && !y)
return; return;
VWB_DrawPic(x,y,C_DISKLOADING1PIC+which); VWB_DrawPic(x, y, C_DISKLOADING1PIC+which);
VW_UpdateScreen(); VW_UpdateScreen();
which ^= 1; which ^= 1;
...@@ -427,14 +426,14 @@ boolean LoadTheGame(int file,int x,int y) ...@@ -427,14 +426,14 @@ boolean LoadTheGame(int file,int x,int y)
CA_FarRead (file,(void *)tilemap,sizeof(tilemap)); CA_FarRead (file,(void *)tilemap,sizeof(tilemap));
checksum = DoChecksum((byte *)tilemap,sizeof(tilemap),checksum); checksum = DoChecksum((byte *)tilemap,sizeof(tilemap),checksum);
DiskFlopAnim(x,y); DiskFlopAnim(x,y);
CA_FarRead (file,(void *)actorat,sizeof(actorat)); CA_FarRead(file,(void *)actorat,sizeof(actorat));
checksum = DoChecksum((byte *)actorat,sizeof(actorat),checksum); checksum = DoChecksum((byte *)actorat,sizeof(actorat),checksum);
CA_FarRead (file,(void *)areaconnect,sizeof(areaconnect)); CA_FarRead(file,(void *)areaconnect,sizeof(areaconnect));
CA_FarRead (file,(void *)areabyplayer,sizeof(areabyplayer)); CA_FarRead(file,(void *)areabyplayer,sizeof(areabyplayer));
InitActorList (); InitActorList();
DiskFlopAnim(x,y); DiskFlopAnim(x,y);
CA_FarRead (file,(void *)player,sizeof(*player)); CA_FarRead (file,(void *)player,sizeof(*player));
...@@ -540,7 +539,7 @@ void ShutdownId() ...@@ -540,7 +539,7 @@ void ShutdownId()
================== ==================
*/ */
const float radtoint = (float)FINEANGLES/2.0f/PI; static const float radtoint = (float)FINEANGLES/2.0f/PI;
void BuildTables() void BuildTables()
{ {
...@@ -564,9 +563,6 @@ void BuildTables() ...@@ -564,9 +563,6 @@ void BuildTables()
// //
// costable overlays sintable with a quarter phase shift // costable overlays sintable with a quarter phase shift
// ANGLES is assumed to be divisable by four // ANGLES is assumed to be divisable by four
//
// The low word of the value is the fraction, the high bit is the sign bit,
// bits 16-30 should be 0
// //
angle = 0; angle = 0;
...@@ -584,9 +580,6 @@ void BuildTables() ...@@ -584,9 +580,6 @@ void BuildTables()
} }
//===========================================================================
/* /*
==================== ====================
= =
...@@ -637,10 +630,6 @@ void CalcProjection(long focal) ...@@ -637,10 +630,6 @@ void CalcProjection(long focal)
} }
} }
//===========================================================================
/* /*
=================== ===================
= =
...@@ -964,7 +953,7 @@ void DoJukebox() ...@@ -964,7 +953,7 @@ void DoJukebox()
MenuFadeOut(); MenuFadeOut();
#if !defined(SPEAR) || !defined(UPLOAD) #if !defined(SPEAR) || !defined(UPLOAD)
start = (rand() % 3) * 6; start = (US_RndT() % 3) * 6;
#else #else
start = 0; start = 0;
#endif #endif
...@@ -1287,8 +1276,6 @@ int WolfMain(int argc, char *argv[]) ...@@ -1287,8 +1276,6 @@ int WolfMain(int argc, char *argv[])
printf("Now Loading %s\n", GAMENAME); printf("Now Loading %s\n", GAMENAME);
srand(time(NULL));
CheckForEpisodes(); CheckForEpisodes();
InitGame(); InitGame();
......
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