mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 15:32:33 +00:00
Merge branch 'master' into gametype-strings
This commit is contained in:
commit
bfca420f47
280 changed files with 9249 additions and 56812 deletions
|
@ -58,6 +58,3 @@ jobs:
|
|||
key: v1-SRB2-{{ .Branch }}-{{ checksum "objs/Linux/SDL/Release/depend.dep" }}
|
||||
paths:
|
||||
- /root/.ccache
|
||||
|
||||
|
||||
|
||||
|
|
67
.travis.yml
67
.travis.yml
|
@ -100,6 +100,21 @@ matrix:
|
|||
compiler: gcc-6
|
||||
env: WFLAGS="-Wno-tautological-compare"
|
||||
#gcc-6 (Ubuntu 6.1.1-3ubuntu11~14.04.1) 6.1.1 20160511
|
||||
- os: linux
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- libsdl2-mixer-dev
|
||||
- libpng-dev
|
||||
- libgl1-mesa-dev
|
||||
- libgme-dev
|
||||
- p7zip-full
|
||||
- gcc-7
|
||||
compiler: gcc-7
|
||||
env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3"
|
||||
#gcc-7 (Ubuntu 7.2.0-1ubuntu1~14.04) 7.2.0 20170802
|
||||
- os: linux
|
||||
compiler: clang
|
||||
#clang version 3.5.0 (tags/RELEASE_350/final)
|
||||
|
@ -162,6 +177,51 @@ matrix:
|
|||
- clang-3.8
|
||||
compiler: clang-3.8
|
||||
#clang version 3.8.1-svn271127-1~exp1 (branches/release_38)
|
||||
- os: linux
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- llvm-toolchain-precise-3.9
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- libsdl2-mixer-dev
|
||||
- libpng-dev
|
||||
- libgl1-mesa-dev
|
||||
- libgme-dev
|
||||
- p7zip-full
|
||||
- clang-3.9
|
||||
compiler: clang-3.9
|
||||
#clang version 3.9.X
|
||||
# - os: linux
|
||||
# addons:
|
||||
# apt:
|
||||
# sources:
|
||||
# - llvm-toolchain-precise-4.0
|
||||
# - ubuntu-toolchain-r-test
|
||||
# packages:
|
||||
# - libsdl2-mixer-dev
|
||||
# - libpng-dev
|
||||
# - libgl1-mesa-dev
|
||||
# - libgme-dev
|
||||
# - p7zip-full
|
||||
# - clang-4.0
|
||||
# compiler: clang-4.0
|
||||
# #clang version 4.0.X
|
||||
# - os: linux
|
||||
# addons:
|
||||
# apt:
|
||||
# sources:
|
||||
# - llvm-toolchain-precise-5.0
|
||||
# - ubuntu-toolchain-r-test
|
||||
# packages:
|
||||
# - libsdl2-mixer-dev
|
||||
# - libpng-dev
|
||||
# - libgl1-mesa-dev
|
||||
# - libgme-dev
|
||||
# - p7zip-full
|
||||
# - clang-5.0
|
||||
# compiler: clang-5.0
|
||||
# #clang version 5.0.X
|
||||
# - os: osx
|
||||
# osx_image: beta-xcode6.1
|
||||
# #Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
|
||||
|
@ -192,6 +252,9 @@ matrix:
|
|||
- compiler: clang-3.6
|
||||
- compiler: clang-3.7
|
||||
- compiler: clang-3.8
|
||||
- compiler: clang-3.9
|
||||
- compiler: clang-4.0
|
||||
- compiler: clang-5.0
|
||||
|
||||
cache:
|
||||
apt: true
|
||||
|
@ -219,9 +282,9 @@ before_script:
|
|||
|
||||
before_install:
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer game-music-emu p7zip; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2 sdl2_mixer game-music-emu p7zip; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install cmake||true; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/release/SDL2-2.0.4.dmg; hdiutil attach SDL2-2.0.4.dmg; sudo cp -a /Volumes/SDL2/SDL2.framework /Library/Frameworks/; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/release/SDL2-2.0.6.dmg; hdiutil attach SDL2-2.0.6.dmg; sudo cp -a /Volumes/SDL2/SDL2.framework /Library/Frameworks/; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.dmg; hdiutil attach SDL2_mixer-2.0.1.dmg; sudo cp -a /Volumes/SDL2_mixer/SDL2_mixer.framework /Library/Frameworks/; fi
|
||||
- mkdir -p $HOME/srb2_cache
|
||||
|
||||
|
|
33
SRB2.cbp
33
SRB2.cbp
|
@ -1174,6 +1174,39 @@ HW3SOUND for 3D hardware sound support
|
|||
<Option target="Debug Mingw64/DirectX" />
|
||||
<Option target="Release Mingw64/DirectX" />
|
||||
</Unit>
|
||||
<Unit filename="src/hardware/hw_clip.c">
|
||||
<Option compilerVar="CC" />
|
||||
<Option target="Debug Native/SDL" />
|
||||
<Option target="Release Native/SDL" />
|
||||
<Option target="Debug Mingw/SDL" />
|
||||
<Option target="Release Mingw/SDL" />
|
||||
<Option target="Debug Mingw/DirectX" />
|
||||
<Option target="Release Mingw/DirectX" />
|
||||
<Option target="Debug Any/Dummy" />
|
||||
<Option target="Release Any/Dummy" />
|
||||
<Option target="Debug Linux/SDL" />
|
||||
<Option target="Release Linux/SDL" />
|
||||
<Option target="Debug Mingw64/SDL" />
|
||||
<Option target="Release Mingw64/SDL" />
|
||||
<Option target="Debug Mingw64/DirectX" />
|
||||
<Option target="Release Mingw64/DirectX" />
|
||||
</Unit>
|
||||
<Unit filename="src/hardware/hw_clip.h">
|
||||
<Option target="Debug Native/SDL" />
|
||||
<Option target="Release Native/SDL" />
|
||||
<Option target="Debug Mingw/SDL" />
|
||||
<Option target="Release Mingw/SDL" />
|
||||
<Option target="Debug Mingw/DirectX" />
|
||||
<Option target="Release Mingw/DirectX" />
|
||||
<Option target="Debug Any/Dummy" />
|
||||
<Option target="Release Any/Dummy" />
|
||||
<Option target="Debug Linux/SDL" />
|
||||
<Option target="Release Linux/SDL" />
|
||||
<Option target="Debug Mingw64/SDL" />
|
||||
<Option target="Release Mingw64/SDL" />
|
||||
<Option target="Debug Mingw64/DirectX" />
|
||||
<Option target="Release Mingw64/DirectX" />
|
||||
</Unit>
|
||||
<Unit filename="src/hardware/hw_data.h">
|
||||
<Option target="Debug Native/SDL" />
|
||||
<Option target="Release Native/SDL" />
|
||||
|
|
5
bin/PS3/Debug/.gitignore
vendored
5
bin/PS3/Debug/.gitignore
vendored
|
@ -1,5 +0,0 @@
|
|||
/*.elf
|
||||
/*.self
|
||||
/*.pkg
|
||||
/*.BIN
|
||||
/pkg
|
5
bin/PS3/Release/.gitignore
vendored
5
bin/PS3/Release/.gitignore
vendored
|
@ -1,5 +0,0 @@
|
|||
/*.elf
|
||||
/*.self
|
||||
/*.pkg
|
||||
/*.BIN
|
||||
/pkg
|
4
bin/PSP/Release/.gitignore
vendored
4
bin/PSP/Release/.gitignore
vendored
|
@ -1,4 +0,0 @@
|
|||
/EBOOT.PBP
|
||||
/PARAM.SFO
|
||||
/SRB2PSP.PBP
|
||||
/SRB2PSP.elf
|
3
bin/Wii/Debug/.gitignore
vendored
3
bin/Wii/Debug/.gitignore
vendored
|
@ -1,3 +0,0 @@
|
|||
/*.elf
|
||||
/*.dol
|
||||
/apps
|
3
bin/Wii/Release/.gitignore
vendored
3
bin/Wii/Release/.gitignore
vendored
|
@ -1,3 +0,0 @@
|
|||
/*.elf
|
||||
/*.dol
|
||||
/apps
|
3
bin/nds/Debug/.gitignore
vendored
3
bin/nds/Debug/.gitignore
vendored
|
@ -1,3 +0,0 @@
|
|||
*.arm9
|
||||
*.elf*
|
||||
*.nds
|
3
bin/nds/Release/.gitignore
vendored
3
bin/nds/Release/.gitignore
vendored
|
@ -1,3 +0,0 @@
|
|||
*.arm9
|
||||
*.elf*
|
||||
*.nds
|
2
objs/MasterServer/.gitignore
vendored
Normal file
2
objs/MasterServer/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
objs/cygwin/Debug/.gitignore
vendored
Normal file
2
objs/cygwin/Debug/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
objs/cygwin/Release/.gitignore
vendored
Normal file
2
objs/cygwin/Release/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
2
objs/dummy/.gitignore
vendored
Normal file
2
objs/dummy/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
|
@ -351,6 +351,7 @@ if(${SRB2_CONFIG_HWRENDER})
|
|||
set(SRB2_HWRENDER_SOURCES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_bsp.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_cache.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_clip.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_draw.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_light.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_main.c
|
||||
|
@ -359,6 +360,7 @@ if(${SRB2_CONFIG_HWRENDER})
|
|||
)
|
||||
|
||||
set (SRB2_HWRENDER_HEADERS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_clip.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_data.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_defs.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_dll.h
|
||||
|
|
208
src/Makefile
208
src/Makefile
|
@ -33,8 +33,6 @@
|
|||
# compile all HW render and 3D sound DLLs for the set
|
||||
# opengl_dll
|
||||
# Pure Mingw only, compile OpenGL HW render DLL
|
||||
# minigl_dll
|
||||
# Pure Mingw only, compile MiniGL HW render DLL
|
||||
# ds3d_dll
|
||||
# Pure Mingw only, compile DirectX DirectSound HW sound DLL
|
||||
# fmod_dll
|
||||
|
@ -91,10 +89,6 @@ D_FILES=$(D_DIR)/srb2.srb \
|
|||
|
||||
PKG_CONFIG?=pkg-config
|
||||
|
||||
ifdef WIILINUX
|
||||
LINUX=1
|
||||
endif
|
||||
|
||||
ifdef PANDORA
|
||||
LINUX=1
|
||||
endif
|
||||
|
@ -108,12 +102,6 @@ ifdef HAIKU
|
|||
SDL=1
|
||||
endif
|
||||
|
||||
ifdef NDS
|
||||
# Include this before the main Makefile.cfg
|
||||
EXENAME?=srb2.elf
|
||||
include nds/Makefile.cfg
|
||||
endif
|
||||
|
||||
include Makefile.cfg
|
||||
|
||||
ifdef DUMMY
|
||||
|
@ -139,32 +127,12 @@ PNG_CFLAGS?=
|
|||
PNG_LDFLAGS?=-lpng
|
||||
endif
|
||||
|
||||
ifdef WIILINUX
|
||||
NONX86=1
|
||||
NOTERMIOS=1
|
||||
NOHW=1
|
||||
CFLAGS+=-DWMINPUT
|
||||
NOTERMIOS=1
|
||||
NOPOSTPROCESSING=1
|
||||
endif
|
||||
|
||||
ifdef PANDORA
|
||||
NONX86=1
|
||||
NOHW=1
|
||||
NOHS=1
|
||||
endif
|
||||
|
||||
ifdef WII
|
||||
NONX86=1
|
||||
NOHW=1
|
||||
NOPOSTPROCESSING=1
|
||||
endif
|
||||
|
||||
ifdef PS3N
|
||||
NONX86=1
|
||||
NOHW=1
|
||||
endif
|
||||
|
||||
ifdef DJGPPDOS
|
||||
include djgppdos/Makefile.cfg
|
||||
endif
|
||||
|
@ -196,18 +164,6 @@ ifdef MACOSX
|
|||
UNIXCOMMON=1
|
||||
endif
|
||||
|
||||
ifdef NDS
|
||||
NOPNG=1
|
||||
NONET=1
|
||||
#NOHW=1
|
||||
NOHS=1
|
||||
NOASM=1
|
||||
NOIPX=1
|
||||
NONX86=1
|
||||
OBJS+=$(OBJDIR)/i_video.o
|
||||
LIBS+=-lm
|
||||
endif
|
||||
|
||||
ifdef SDL
|
||||
include sdl/Makefile.cfg
|
||||
endif #ifdef SDL
|
||||
|
@ -231,11 +187,7 @@ ifndef ECHO
|
|||
OBJDUMP:=@$(OBJDUMP)
|
||||
STRIP:=@$(STRIP)
|
||||
WINDRES:=@$(WINDRES)
|
||||
CP:=@$(CP)
|
||||
MKDIR:=@$(MKDIR)
|
||||
MKISOFS:=@$(MKISOFS)
|
||||
DD:=@$(DD)
|
||||
NDSTOOL:=@$(NDSTOOL)
|
||||
GZIP:=@$(GZIP)
|
||||
MSGFMT:=@$(MSGFMT)
|
||||
UPX:=@$(UPX)
|
||||
|
@ -253,13 +205,11 @@ endif
|
|||
ifdef NOHW
|
||||
OPTS+=-DNOHW
|
||||
else
|
||||
ifndef DC
|
||||
#Hurdler: not really supported and not tested recently
|
||||
#OPTS+=-DUSE_PALETTED_TEXTURE
|
||||
endif
|
||||
OPTS+=-DHWRENDER
|
||||
OBJS+=$(OBJDIR)/hw_bsp.o $(OBJDIR)/hw_draw.o $(OBJDIR)/hw_light.o \
|
||||
$(OBJDIR)/hw_main.o $(OBJDIR)/hw_md2.o $(OBJDIR)/hw_cache.o $(OBJDIR)/hw_trick.o
|
||||
$(OBJDIR)/hw_main.o $(OBJDIR)/hw_clip.o $(OBJDIR)/hw_md2.o $(OBJDIR)/hw_cache.o $(OBJDIR)/hw_trick.o
|
||||
endif
|
||||
|
||||
ifdef NOHS
|
||||
|
@ -362,14 +312,6 @@ else
|
|||
OBJS:=$(OBJDIR)/md5.o $(OBJS)
|
||||
endif
|
||||
|
||||
ifdef FAKEDC
|
||||
OPTS+=-DDC
|
||||
endif
|
||||
|
||||
ifdef FAKEPSP
|
||||
OPTS+=-DPSP
|
||||
endif
|
||||
|
||||
ifdef NOPOSTPROCESSING
|
||||
OPTS+=-DNOPOSTPROCESSING
|
||||
endif
|
||||
|
@ -521,49 +463,20 @@ ifdef DJGPPDOS
|
|||
all: pre-build $(BIN)/$(EXENAME)
|
||||
endif
|
||||
|
||||
ifdef XBOX
|
||||
all: pre-build $(BIN)/$(BINNAME)
|
||||
endif
|
||||
|
||||
ifdef PS3N
|
||||
all: pre-build $(BIN)/$(PKGNAME)
|
||||
endif
|
||||
|
||||
ifdef WII
|
||||
all: pre-build $(BIN)/$(DOLNAME)
|
||||
endif
|
||||
|
||||
ifdef PANDORA
|
||||
all: pre-build $(BIN)/$(PNDNAME)
|
||||
endif
|
||||
|
||||
ifdef PSP
|
||||
all: pre-build $(BIN)/$(BINNAME) post-build
|
||||
endif
|
||||
|
||||
ifdef DC
|
||||
all: pre-build $(BIN)/$(BINNAME) post-build
|
||||
endif
|
||||
|
||||
ifndef DC
|
||||
ifndef PSP
|
||||
ifndef XBOX
|
||||
ifdef MINGW
|
||||
ifndef SDL
|
||||
all: pre-build $(BIN)/$(EXENAME) dll
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef SDL
|
||||
all: pre-build $(BIN)/$(EXENAME)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef NDS
|
||||
all: $(BIN)/$(EXENAME:.elf=.nds)
|
||||
endif
|
||||
|
||||
ifdef DUMMY
|
||||
all: $(BIN)/$(EXENAME)
|
||||
|
@ -617,12 +530,10 @@ endif
|
|||
|
||||
# mac os x lsdlsrb2 does not like objcopy
|
||||
ifndef MACOSX
|
||||
ifndef PSP
|
||||
$(OBJCOPY) $(BIN)/$(EXENAME) $(BIN)/$(DBGNAME)
|
||||
$(OBJCOPY) --strip-debug $(BIN)/$(EXENAME)
|
||||
-$(OBJCOPY) --add-gnu-debuglink=$(BIN)/$(DBGNAME) $(BIN)/$(EXENAME)
|
||||
endif
|
||||
endif
|
||||
ifndef NOUPX
|
||||
-$(UPX) $(UPX_OPTS) $(BIN)/$(EXENAME)
|
||||
endif
|
||||
|
@ -647,7 +558,7 @@ else
|
|||
dll : opengl_dll
|
||||
endif
|
||||
ifdef MINGW
|
||||
all_dll: opengl_dll minigl_dll ds3d_dll fmod_dll openal_dll
|
||||
all_dll: opengl_dll ds3d_dll fmod_dll openal_dll
|
||||
|
||||
opengl_dll: $(BIN)/r_opengl.dll
|
||||
$(BIN)/r_opengl.dll: $(OBJDIR)/ogl_win.o $(OBJDIR)/r_opengl.o
|
||||
|
@ -658,12 +569,6 @@ ifndef NOUPX
|
|||
-$(UPX) $(UPX_OPTS) $@
|
||||
endif
|
||||
|
||||
minigl_dll: $(BIN)/r_minigl.dll
|
||||
$(BIN)/r_minigl.dll: $(OBJDIR)/r_minigl.o
|
||||
-$(MKDIR) $(BIN)
|
||||
@echo Linking R_MiniGL.dll...
|
||||
$(CC) --shared $^ -o $@ -g -Wl,--add-stdcall-alias -lgdi32
|
||||
|
||||
ds3d_dll: $(BIN)/s_ds3d.dll
|
||||
$(BIN)/s_ds3d.dll: $(OBJDIR)/s_ds3d.o
|
||||
@echo Linking S_DS3d.dll...
|
||||
|
@ -703,7 +608,7 @@ ifdef MINGW
|
|||
$(OBJDIR)/r_opengl.o: hardware/r_opengl/r_opengl.c hardware/r_opengl/r_opengl.h \
|
||||
doomdef.h doomtype.h g_state.h m_swap.h hardware/hw_drv.h screen.h \
|
||||
command.h hardware/hw_data.h hardware/hw_glide.h hardware/hw_defs.h \
|
||||
hardware/hw_md2.h hardware/hw_glob.h hardware/hw_main.h am_map.h \
|
||||
hardware/hw_md2.h hardware/hw_glob.h hardware/hw_main.h hardware/hw_clip.h am_map.h \
|
||||
d_event.h d_player.h p_pspr.h m_fixed.h tables.h info.h d_think.h \
|
||||
p_mobj.h doomdata.h d_ticcmd.h r_defs.h hardware/hw_dll.h
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
|
||||
|
@ -711,7 +616,7 @@ else
|
|||
$(OBJDIR)/r_opengl.o: hardware/r_opengl/r_opengl.c hardware/r_opengl/r_opengl.h \
|
||||
doomdef.h doomtype.h g_state.h m_swap.h hardware/hw_drv.h screen.h \
|
||||
command.h hardware/hw_data.h hardware/hw_glide.h hardware/hw_defs.h \
|
||||
hardware/hw_md2.h hardware/hw_glob.h hardware/hw_main.h am_map.h \
|
||||
hardware/hw_md2.h hardware/hw_glob.h hardware/hw_main.h hardware/hw_clip.h am_map.h \
|
||||
d_event.h d_player.h p_pspr.h m_fixed.h tables.h info.h d_think.h \
|
||||
p_mobj.h doomdata.h d_ticcmd.h r_defs.h hardware/hw_dll.h
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -I/usr/X11R6/include -c $< -o $@
|
||||
|
@ -742,16 +647,6 @@ endif
|
|||
$(REMOVE) $(OBJDIR)/depend.ped
|
||||
@echo "Created dependency file, depend.dep"
|
||||
|
||||
ifdef DC
|
||||
$(OBJDIR)/v_video.o: v_video.c doomdef.h doomtype.h g_state.h m_swap.h r_local.h \
|
||||
tables.h m_fixed.h screen.h command.h m_bbox.h r_main.h d_player.h \
|
||||
p_pspr.h info.h d_think.h sounds.h p_mobj.h doomdata.h d_ticcmd.h \
|
||||
r_data.h r_defs.h r_state.h r_bsp.h r_segs.h r_plane.h r_sky.h \
|
||||
r_things.h r_draw.h v_video.h hu_stuff.h d_event.h w_wad.h console.h \
|
||||
i_video.h z_zone.h doomstat.h d_clisrv.h d_netcmd.h
|
||||
$(CC) $(CFLAGS) -fno-omit-frame-pointer $(WFLAGS) -c $< -o $@
|
||||
endif
|
||||
|
||||
ifdef VALGRIND
|
||||
$(OBJDIR)/z_zone.o: z_zone.c
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -DHAVE_VALGRIND $(VALGRIND_CFLAGS) -c $< -o $@
|
||||
|
@ -793,70 +688,6 @@ $(OBJDIR)/%.o: %.s
|
|||
$(OBJDIR)/SRB2.res: win32/Srb2win.rc win32/afxres.h win32/resource.h
|
||||
$(WINDRES) -i $< -O rc $(WINDRESFLAGS) --include-dir=win32 -o $@ -O coff
|
||||
|
||||
ifdef DC
|
||||
$(OBJDIR)/romdisk.img:
|
||||
$(KOS_GENROMFS) -f romdisk.img -d ../data -v
|
||||
|
||||
$(OBJDIR)/romdisk.o: romdisk.img
|
||||
$(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o
|
||||
|
||||
$(OBJDIR)/dchelp.o: $(INTERFACE)/SRB2DC/dchelp.c
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/i_udp.o: $(INTERFACE)/SRB2DC/i_udp.c
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
|
||||
|
||||
$(BIN)/IP.BIN: $(INTERFACE)/SRB2DC/IP.BIN
|
||||
$(CP) $< $@
|
||||
|
||||
$(BIN)/SRB2DC.cdi.pass1: $(INTERFACE)/SRB2DC/SELFBOOT.BIN
|
||||
$(CP) $< $@
|
||||
|
||||
$(BIN)/$(BINNAME): $(BIN)/$(EXENAME)
|
||||
$(KOS_OBJCOPY) -R .stack -O binary $< $@
|
||||
|
||||
$(BIN)/1ST_READ.BIN: $(BIN)/$(BINNAME) $(BIN)/scramble
|
||||
$(BIN)/scramble $< $@
|
||||
|
||||
$(BIN)/scramble: $(INTERFACE)/SRB2DC/scramble.c
|
||||
-$(MKDIR) $(BIN)
|
||||
$(HOSTCC) $< -o $@
|
||||
|
||||
iso: $(BIN)/SRB2DC.iso
|
||||
cdi: $(BIN)/SRB2DC.cdi
|
||||
|
||||
$(BIN)/SRB2DC.iso.pass1: $(BIN)/1ST_READ.BIN $(BIN)/IP.BIN
|
||||
-$(MKDIR) $(BIN)/cdrom
|
||||
$(CP) $(BIN)/1ST_READ.BIN $(D_FILES) $(BIN)/cdrom
|
||||
$(MKISOFS) -l -r -o $@ $(BIN)/cdrom
|
||||
|
||||
$(BIN)/SRB2DC.iso.pass2: $(BIN)/SRB2DC.iso.pass1
|
||||
$(DD) if=$< of=$@ bs=2048 skip=16 status=noxfer
|
||||
|
||||
$(BIN)/SRB2DC.iso: $(BIN)/SRB2DC.iso.pass2 $(BIN)/IP.BIN
|
||||
@cat $(BIN)/IP.BIN $(BIN)/SRB2DC.iso.pass2 > $@
|
||||
|
||||
$(BIN)/SRB2DC.cdi: $(BIN)/SRB2DC.iso.pass2 $(BIN)/SRB2DC.cdi.pass1 $(BIN)/IP.BIN
|
||||
@cat $(BIN)/SRB2DC.cdi.pass1 $(BIN)/IP.BIN $(BIN)/SRB2DC.iso.pass2 > $@
|
||||
|
||||
post-build: $(BIN)/1ST_READ.BIN
|
||||
endif
|
||||
|
||||
ifdef XBOX
|
||||
$(OBJDIR)/xboxhelp.o: $(INTERFACE)/SRB2XBOX/xboxhelp.c
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
|
||||
|
||||
$(BIN)/$(BINNAME): $(BIN)/$(EXENAME)
|
||||
$(CXBE) -OUT:"$@" -DUMPINFO:"$(BIN)/SRB2XBOX.cxbe" -TITLE:"Sonic Robo Blast 2" $<
|
||||
endif
|
||||
|
||||
ifdef NDS
|
||||
$(BIN)/$(EXENAME:.elf=.nds): $(BIN)/$(EXENAME:.elf=.arm9)
|
||||
$(NDSTOOL) -c $@ -9 $(BIN)/$(EXENAME:.elf=.arm9)
|
||||
|
||||
%.arm9: %.elf
|
||||
$(OBJCOPY) -O binary $< $@
|
||||
endif
|
||||
|
||||
ifdef MINGW
|
||||
ifndef SDL
|
||||
|
@ -864,7 +695,7 @@ ifndef NOHW
|
|||
$(OBJDIR)/r_opengl.o: hardware/r_opengl/r_opengl.c hardware/r_opengl/r_opengl.h \
|
||||
doomdef.h doomtype.h g_state.h m_swap.h hardware/hw_drv.h screen.h \
|
||||
command.h hardware/hw_data.h hardware/hw_glide.h hardware/hw_defs.h \
|
||||
hardware/hw_md2.h hardware/hw_glob.h hardware/hw_main.h am_map.h \
|
||||
hardware/hw_md2.h hardware/hw_glob.h hardware/hw_main.h hardware/hw_clip.h am_map.h \
|
||||
d_event.h d_player.h p_pspr.h m_fixed.h tables.h info.h d_think.h \
|
||||
p_mobj.h doomdata.h d_ticcmd.h r_defs.h hardware/hw_dll.h
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -D_WINDOWS -mwindows -c $< -o $@
|
||||
|
@ -872,15 +703,7 @@ $(OBJDIR)/r_opengl.o: hardware/r_opengl/r_opengl.c hardware/r_opengl/r_opengl.h
|
|||
$(OBJDIR)/ogl_win.o: hardware/r_opengl/ogl_win.c hardware/r_opengl/r_opengl.h \
|
||||
doomdef.h doomtype.h g_state.h m_swap.h hardware/hw_drv.h screen.h \
|
||||
command.h hardware/hw_data.h hardware/hw_glide.h hardware/hw_defs.h \
|
||||
hardware/hw_md2.h hardware/hw_glob.h hardware/hw_main.h am_map.h \
|
||||
d_event.h d_player.h p_pspr.h m_fixed.h tables.h info.h d_think.h \
|
||||
p_mobj.h doomdata.h d_ticcmd.h r_defs.h hardware/hw_dll.h
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -D_WINDOWS -mwindows -c $< -o $@
|
||||
|
||||
$(OBJDIR)/r_minigl.o: hardware/r_minigl/r_minigl.c hardware/r_opengl/r_opengl.h \
|
||||
doomdef.h doomtype.h g_state.h m_swap.h hardware/hw_drv.h screen.h \
|
||||
command.h hardware/hw_data.h hardware/hw_glide.h hardware/hw_defs.h \
|
||||
hardware/hw_md2.h hardware/hw_glob.h hardware/hw_main.h am_map.h \
|
||||
hardware/hw_md2.h hardware/hw_glob.h hardware/hw_main.h hardware/hw_clip.h am_map.h \
|
||||
d_event.h d_player.h p_pspr.h m_fixed.h tables.h info.h d_think.h \
|
||||
p_mobj.h doomdata.h d_ticcmd.h r_defs.h hardware/hw_dll.h
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -D_WINDOWS -mwindows -c $< -o $@
|
||||
|
@ -933,25 +756,6 @@ $(OBJDIR)/s_openal.o: hardware/s_openal/s_openal.c hardware/hw3dsdrv.h \
|
|||
hardware/hw_dll.h
|
||||
$(CC) $(M5) -Os -o $(OBJDIR)/s_openal.o -DHW3SOUND -DUNIXCOMMON -shared -nostartfiles -c hardware/s_openal/s_openal.c
|
||||
endif
|
||||
|
||||
ifdef FILTERS
|
||||
$(OBJDIR)/%.o: $(INTERFACE)/filter/%.c
|
||||
@echo $< needs deps
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/filters.o: $(INTERFACE)/filter/filters.c $(INTERFACE)/filter/filters.c \
|
||||
$(INTERFACE)/filter/filters.h
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/hq2x.o: $(INTERFACE)/filter/hq2x.c $(INTERFACE)/filter/hq2x.c \
|
||||
$(INTERFACE)/filter/filters.h
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/lq2x.o: $(INTERFACE)/filter/lq2x.c $(INTERFACE)/filter/lq2x.c \
|
||||
$(INTERFACE)/filter/filters.h $(INTERFACE)/filter/interp.h \
|
||||
$(INTERFACE)/filter/hq2x.h $(INTERFACE)/filter/lq2x.h
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
|
||||
endif
|
||||
endif
|
||||
|
||||
#############################################################
|
||||
|
|
109
src/Makefile.cfg
109
src/Makefile.cfg
|
@ -7,6 +7,21 @@
|
|||
# and other things
|
||||
#
|
||||
|
||||
ifdef GCC80
|
||||
GCC72=1
|
||||
endif
|
||||
|
||||
ifdef GCC72
|
||||
GCC71=1
|
||||
endif
|
||||
|
||||
ifdef GCC71
|
||||
GCC64=1
|
||||
endif
|
||||
|
||||
ifdef GCC64
|
||||
GCC64=1
|
||||
endif
|
||||
|
||||
ifdef GCC63
|
||||
GCC62=1
|
||||
|
@ -77,10 +92,6 @@ ifdef GCC295
|
|||
GCC29=1
|
||||
endif
|
||||
|
||||
ifdef DC
|
||||
NOCASTALIGNWARN=1
|
||||
endif
|
||||
|
||||
OLDWFLAGS:=$(WFLAGS)
|
||||
# -W -Wno-unused
|
||||
WFLAGS=-Wall
|
||||
|
@ -141,15 +152,11 @@ endif
|
|||
ifdef GCC40
|
||||
WFLAGS+=-Wold-style-definition
|
||||
endif
|
||||
ifndef XBOX
|
||||
WFLAGS+=-Wmissing-prototypes -Wmissing-declarations
|
||||
endif
|
||||
ifdef GCC40
|
||||
WFLAGS+=-Wmissing-field-initializers
|
||||
endif
|
||||
ifndef XBOX
|
||||
WFLAGS+=-Wmissing-noreturn
|
||||
endif
|
||||
#WFLAGS+=-Wmissing-format-attribute
|
||||
#WFLAGS+=-Wno-multichar
|
||||
#WFLAGS+=-Wno-deprecated-declarations
|
||||
|
@ -207,18 +214,11 @@ endif
|
|||
|
||||
|
||||
#indicate platform and what interface use with
|
||||
ifndef WINCE
|
||||
ifndef XBOX
|
||||
ifndef PSP
|
||||
ifndef DC
|
||||
ifndef WII
|
||||
ifndef PS3N
|
||||
ifndef LINUX
|
||||
ifndef FREEBSD
|
||||
ifndef CYGWIN32
|
||||
ifndef MINGW
|
||||
ifndef SDL
|
||||
ifndef NDS
|
||||
ifndef DUMMY
|
||||
DJGPPDOS=1
|
||||
endif
|
||||
|
@ -227,13 +227,6 @@ endif
|
|||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
#determine the interface directory (where you put all i_*.c)
|
||||
i_cdmus_o=$(OBJDIR)/i_cdmus.o
|
||||
|
@ -251,10 +244,7 @@ else
|
|||
NASM?=nasm
|
||||
endif
|
||||
REMOVE?=rm -f
|
||||
CP?=cp
|
||||
MKDIR?=mkdir -p
|
||||
MKISOFS?=mkisofs
|
||||
DD?=dd
|
||||
GZIP?=gzip
|
||||
GZIP_OPTS?=-9 -f -n
|
||||
GZIP_OPT2=$(GZIP_OPTS) --rsyncable
|
||||
|
@ -321,80 +311,11 @@ ifdef MINGW64
|
|||
OBJDIR:=$(OBJDIR)/Mingw64
|
||||
BIN:=$(BIN)/Mingw64
|
||||
else
|
||||
ifdef WII
|
||||
INTERFACE=sdl
|
||||
NONX86=1
|
||||
STATIC=1
|
||||
PREFIX?=powerpc-eabi
|
||||
SDL=1
|
||||
SDLMAIN=1
|
||||
OBJDIR:=$(OBJDIR)/Wii
|
||||
BIN:=$(BIN)/Wii
|
||||
NOUPX=1
|
||||
else
|
||||
ifdef PS3N
|
||||
INTERFACE=sdl
|
||||
NONX86=1
|
||||
STATIC=1
|
||||
PREFIX?=ppu
|
||||
SDL=1
|
||||
# unsure?
|
||||
#SDLMAIN=1
|
||||
# can't compile SDL_mixer for ps3...
|
||||
NOMIXER=1
|
||||
OBJDIR:=$(OBJDIR)/PS3
|
||||
BIN:=$(BIN)/PS3
|
||||
else
|
||||
ifdef MINGW
|
||||
INTERFACE=win32
|
||||
NASMFORMAT=win32
|
||||
OBJDIR:=$(OBJDIR)/Mingw
|
||||
BIN:=$(BIN)/Mingw
|
||||
else
|
||||
ifdef XBOX
|
||||
INTERFACE=sdl
|
||||
NASMFORMAT=win32
|
||||
PREFIX?=/usr/local/openxdk/bin/i386-pc-xbox
|
||||
SDL=1
|
||||
OBJDIR:=$(OBJDIR)/XBOX
|
||||
BIN:=$(BIN)/XBOX
|
||||
else
|
||||
ifdef PSP
|
||||
INTERFACE=sdl
|
||||
NONX86=1
|
||||
SDL=1
|
||||
OBJDIR:=$(OBJDIR)/PSP
|
||||
BIN:=$(BIN)/PSP
|
||||
NOUPX=1
|
||||
else
|
||||
ifdef DC
|
||||
INTERFACE=sdl
|
||||
NONX86=1
|
||||
SDL=1
|
||||
OBJDIR:=$(OBJDIR)/DC
|
||||
BIN:=$(BIN)/DC
|
||||
NOUPX=1
|
||||
else
|
||||
ifdef WINCE
|
||||
INTERFACE=sdl
|
||||
NONX86=1
|
||||
PREFIX?=arm-wince-pe
|
||||
SDL=1
|
||||
OBJDIR:=$(OBJDIR)/WinCE
|
||||
BIN:=$(BIN)/WinCE
|
||||
else
|
||||
ifdef NDS
|
||||
INTERFACE=nds
|
||||
OBJDIR:=$(OBJDIR)/nds
|
||||
BIN:=$(BIN)/nds
|
||||
NOUPX=1
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
|
|
@ -44,10 +44,6 @@ static const UINT8 NOCLIMBBROWNS = (2*16);
|
|||
static const UINT8 NOCLIMBYELLOWS = (11*16);
|
||||
|
||||
|
||||
#ifdef _NDS
|
||||
#undef BACKGROUND
|
||||
#endif
|
||||
|
||||
// Automap colors
|
||||
#define BACKGROUND DBLACK
|
||||
#define YOURCOLORS DWHITE
|
||||
|
|
|
@ -271,6 +271,12 @@ void B_RespawnBot(INT32 playernum)
|
|||
player->powers[pw_spacetime] = sonic->player->powers[pw_spacetime];
|
||||
player->powers[pw_gravityboots] = sonic->player->powers[pw_gravityboots];
|
||||
player->powers[pw_nocontrol] = sonic->player->powers[pw_nocontrol];
|
||||
player->acceleration = sonic->player->acceleration;
|
||||
player->accelstart = sonic->player->accelstart;
|
||||
player->thrustfactor = sonic->player->thrustfactor;
|
||||
player->normalspeed = sonic->player->normalspeed;
|
||||
player->pflags |= PF_AUTOBRAKE;
|
||||
player->pflags &= ~PF_DIRECTIONCHAR;
|
||||
|
||||
P_TeleportMove(tails, x, y, z);
|
||||
if (player->charability == CA_FLY)
|
||||
|
|
|
@ -412,7 +412,7 @@ static Instruction symbexec (const Proto *pt, int lastpc, int reg) {
|
|||
case OP_FORLOOP:
|
||||
case OP_FORPREP:
|
||||
checkreg(pt, a+3);
|
||||
/* go through */
|
||||
/* FALLTHRU */
|
||||
case OP_JMP: {
|
||||
int dest = pc+1+b;
|
||||
/* not full check and jump is forward and do not skip `lastpc'? */
|
||||
|
|
|
@ -311,6 +311,7 @@ static void read_string (LexState *ls, int del, SemInfo *seminfo) {
|
|||
ls->lookahead.token = TK_CONCAT;
|
||||
return;
|
||||
}
|
||||
/* FALLTHRU */
|
||||
default: {
|
||||
if (!isdigit(ls->current))
|
||||
save_and_next(ls); /* handles \\, \", \', and \? */
|
||||
|
@ -340,7 +341,8 @@ static void read_string (LexState *ls, int del, SemInfo *seminfo) {
|
|||
};
|
||||
|
||||
switch (i) {
|
||||
case 4: save( ls, (c>>8) & 0xff ); // pass-through..
|
||||
case 4: save( ls, (c>>8) & 0xff );
|
||||
/* FALLTHRU */
|
||||
case 2: save( ls, c&0xff );
|
||||
break;
|
||||
case 5:
|
||||
|
@ -482,11 +484,13 @@ static int llex (LexState *ls, SemInfo *seminfo) {
|
|||
else if (sep == -1) return '[';
|
||||
else luaX_lexerror(ls, "invalid long string delimiter", TK_STRING);
|
||||
}
|
||||
/* FALLTHRU */
|
||||
case '=': {
|
||||
next(ls);
|
||||
if (ls->current != '=') return '=';
|
||||
else { next(ls); return TK_EQ; }
|
||||
}
|
||||
/* FALLTHRU */
|
||||
case '<': {
|
||||
next(ls);
|
||||
if (ls->current == '<') { next(ls); return TK_SHL; }
|
||||
|
@ -550,6 +554,7 @@ static int llex (LexState *ls, SemInfo *seminfo) {
|
|||
ls->current = '"'; /* whacky! */
|
||||
return TK_CONCAT;
|
||||
}
|
||||
/* FALLTHRU */
|
||||
default: {
|
||||
if (isspace(ls->current)) {
|
||||
lua_assert(!currIsNewline(ls));
|
||||
|
|
|
@ -478,6 +478,7 @@ static TValue *newkey (lua_State *L, Table *t, const TValue *key) {
|
|||
return luaH_getnum(t, k); /* use specialized version */
|
||||
/* else go through */
|
||||
}
|
||||
/* FALLTHRU */
|
||||
default: {
|
||||
Node *n = mainposition(t, key);
|
||||
do { /* check whether `key' is somewhere in the chain */
|
||||
|
|
|
@ -1189,7 +1189,10 @@ finish:
|
|||
CONS_Printf(M_GetText("%s set to %s\n"), var->name, var->string);
|
||||
var->flags &= ~CV_SHOWMODIFONETIME;
|
||||
}
|
||||
else // display message in debug file only
|
||||
{
|
||||
DEBFILE(va("%s set to %s\n", var->name, var->string));
|
||||
}
|
||||
var->flags |= CV_MODIFIED;
|
||||
// raise 'on change' code
|
||||
#ifdef HAVE_BLUA
|
||||
|
@ -1233,7 +1236,7 @@ static void Got_NetVar(UINT8 **p, INT32 playernum)
|
|||
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
|
@ -1252,9 +1255,6 @@ static void Got_NetVar(UINT8 **p, INT32 playernum)
|
|||
CONS_Alert(CONS_WARNING, "Netvar not found with netid %hu\n", netid);
|
||||
return;
|
||||
}
|
||||
#if 0 //defined (GP2X) || defined (PSP)
|
||||
CONS_Printf("Netvar received: %s [netid=%d] value %s\n", cvar->name, netid, svalue);
|
||||
#endif
|
||||
DEBFILE(va("Netvar received: %s [netid=%d] value %s\n", cvar->name, netid, svalue));
|
||||
|
||||
Setvalue(cvar, svalue, stealth);
|
||||
|
@ -1353,7 +1353,7 @@ static void CV_SetCVar(consvar_t *var, const char *value, boolean stealth)
|
|||
if (var->flags & CV_NETVAR)
|
||||
{
|
||||
// send the value of the variable
|
||||
XBOXSTATIC UINT8 buf[128];
|
||||
UINT8 buf[128];
|
||||
UINT8 *p = buf;
|
||||
if (!(server || (adminplayer == consoleplayer)))
|
||||
{
|
||||
|
|
|
@ -12,9 +12,6 @@
|
|||
|
||||
#ifdef __GNUC__
|
||||
#include <unistd.h>
|
||||
#ifdef _XBOX
|
||||
#include <openxdk/debug.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "doomdef.h"
|
||||
|
@ -33,6 +30,7 @@
|
|||
#include "i_system.h"
|
||||
#include "d_main.h"
|
||||
#include "m_menu.h"
|
||||
#include "filesrch.h"
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#include "win32/win_main.h"
|
||||
|
@ -328,12 +326,7 @@ static void CON_SetupColormaps(void)
|
|||
|
||||
// Setup the console text buffer
|
||||
//
|
||||
// for WII, libogc already has a CON_Init function, we must rename it here
|
||||
#ifdef _WII
|
||||
void CON_InitWii(void)
|
||||
#else
|
||||
void CON_Init(void)
|
||||
#endif
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
|
@ -1031,7 +1024,7 @@ boolean CON_Responder(event_t *ev)
|
|||
// allow people to use keypad in console (good for typing IP addresses) - Calum
|
||||
if (key >= KEY_KEYPAD7 && key <= KEY_KPADDEL)
|
||||
{
|
||||
XBOXSTATIC char keypad_translation[] = {'7','8','9','-',
|
||||
char keypad_translation[] = {'7','8','9','-',
|
||||
'4','5','6','+',
|
||||
'1','2','3',
|
||||
'0','.'};
|
||||
|
@ -1170,7 +1163,7 @@ static void CON_Print(char *msg)
|
|||
|
||||
void CON_LogMessage(const char *msg)
|
||||
{
|
||||
XBOXSTATIC char txt[8192], *t;
|
||||
char txt[8192], *t;
|
||||
const char *p = msg, *e = txt+sizeof (txt)-2;
|
||||
|
||||
for (t = txt; *p != '\0'; p++)
|
||||
|
@ -1206,15 +1199,10 @@ void CONS_Printf(const char *fmt, ...)
|
|||
va_end(argptr);
|
||||
|
||||
// echo console prints to log file
|
||||
#ifndef _arch_dreamcast
|
||||
DEBFILE(txt);
|
||||
#endif
|
||||
|
||||
if (!con_started)
|
||||
{
|
||||
#if defined (_XBOX) && defined (__GNUC__)
|
||||
if (!keyboard_started) debugPrint(txt);
|
||||
#endif
|
||||
#ifdef PC_DOS
|
||||
CON_LogMessage(txt);
|
||||
free(txt);
|
||||
|
@ -1235,7 +1223,7 @@ void CONS_Printf(const char *fmt, ...)
|
|||
// if not in display loop, force screen update
|
||||
if (con_startup)
|
||||
{
|
||||
#if (defined (_WINDOWS)) || (defined (__OS2__) && !defined (HAVE_SDL))
|
||||
#ifdef _WINDOWS
|
||||
static lumpnum_t con_backpic_lumpnum = UINT32_MAX;
|
||||
patch_t *con_backpic;
|
||||
|
||||
|
@ -1275,12 +1263,15 @@ void CONS_Alert(alerttype_t level, const char *fmt, ...)
|
|||
switch (level)
|
||||
{
|
||||
case CONS_NOTICE:
|
||||
// no notice for notices, hehe
|
||||
CONS_Printf("\x83" "%s" "\x80 ", M_GetText("NOTICE:"));
|
||||
break;
|
||||
case CONS_WARNING:
|
||||
refreshdirmenu |= REFRESHDIR_WARNING;
|
||||
CONS_Printf("\x82" "%s" "\x80 ", M_GetText("WARNING:"));
|
||||
break;
|
||||
case CONS_ERROR:
|
||||
refreshdirmenu |= REFRESHDIR_ERROR;
|
||||
CONS_Printf("\x85" "%s" "\x80 ", M_GetText("ERROR:"));
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -13,11 +13,7 @@
|
|||
#include "d_event.h"
|
||||
#include "command.h"
|
||||
|
||||
#ifdef _WII
|
||||
void CON_InitWii(void);
|
||||
#else
|
||||
void CON_Init(void);
|
||||
#endif
|
||||
|
||||
boolean CON_Responder(event_t *ev);
|
||||
|
||||
|
|
116
src/d_clisrv.c
116
src/d_clisrv.c
|
@ -10,9 +10,7 @@
|
|||
/// \file d_clisrv.c
|
||||
/// \brief SRB2 Network game communication and protocol, all OS independent parts.
|
||||
|
||||
#if !defined (UNDER_CE)
|
||||
#include <time.h>
|
||||
#endif
|
||||
#ifdef __GNUC__
|
||||
#include <unistd.h> //for unlink
|
||||
#endif
|
||||
|
@ -50,10 +48,6 @@
|
|||
#include "f_finale.h"
|
||||
#endif
|
||||
|
||||
#ifdef _XBOX
|
||||
#include "sdl/SRB2XBOX/xboxhelp.h"
|
||||
#endif
|
||||
|
||||
//
|
||||
// NETWORKING
|
||||
//
|
||||
|
@ -393,7 +387,7 @@ static void ExtraDataTicker(void)
|
|||
{
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[3];
|
||||
UINT8 buf[3];
|
||||
|
||||
buf[0] = (UINT8)i;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
|
@ -544,6 +538,7 @@ static inline void resynch_write_player(resynch_pak *rsp, const size_t i)
|
|||
rsp->thokitem = (UINT32)LONG(players[i].thokitem); //mobjtype_t
|
||||
rsp->spinitem = (UINT32)LONG(players[i].spinitem); //mobjtype_t
|
||||
rsp->revitem = (UINT32)LONG(players[i].revitem); //mobjtype_t
|
||||
rsp->followitem = (UINT32)LONG(players[i].followitem); //mobjtype_t
|
||||
rsp->actionspd = (fixed_t)LONG(players[i].actionspd);
|
||||
rsp->mindash = (fixed_t)LONG(players[i].mindash);
|
||||
rsp->maxdash = (fixed_t)LONG(players[i].maxdash);
|
||||
|
@ -673,6 +668,7 @@ static void resynch_read_player(resynch_pak *rsp)
|
|||
players[i].thokitem = (UINT32)LONG(rsp->thokitem); //mobjtype_t
|
||||
players[i].spinitem = (UINT32)LONG(rsp->spinitem); //mobjtype_t
|
||||
players[i].revitem = (UINT32)LONG(rsp->revitem); //mobjtype_t
|
||||
players[i].followitem = (UINT32)LONG(rsp->followitem); //mobjtype_t
|
||||
players[i].actionspd = (fixed_t)LONG(rsp->actionspd);
|
||||
players[i].mindash = (fixed_t)LONG(rsp->mindash);
|
||||
players[i].maxdash = (fixed_t)LONG(rsp->maxdash);
|
||||
|
@ -768,8 +764,16 @@ static void resynch_read_player(resynch_pak *rsp)
|
|||
players[i].mo->scalespeed = LONG(rsp->scalespeed);
|
||||
|
||||
// And finally, SET THE MOBJ SKIN damn it.
|
||||
if ((players[i].powers[pw_carry] == CR_NIGHTSMODE) && (skins[players[i].skin].sprites[SPR2_NGT0].numframes == 0))
|
||||
{
|
||||
players[i].mo->skin = &skins[DEFAULTNIGHTSSKIN];
|
||||
players[i].mo->color = skins[DEFAULTNIGHTSSKIN].prefcolor; // this will be corrected by thinker to super flash
|
||||
}
|
||||
else
|
||||
{
|
||||
players[i].mo->skin = &skins[players[i].skin];
|
||||
players[i].mo->color = players[i].skincolor;
|
||||
players[i].mo->color = players[i].skincolor; // this will be corrected by thinker to super flash/mario star
|
||||
}
|
||||
|
||||
P_SetThingPosition(players[i].mo);
|
||||
}
|
||||
|
@ -883,6 +887,7 @@ static inline void resynch_write_others(resynchend_pak *rst)
|
|||
UINT8 i;
|
||||
|
||||
rst->ingame = 0;
|
||||
rst->outofcoop = 0;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; ++i)
|
||||
{
|
||||
|
@ -899,6 +904,8 @@ static inline void resynch_write_others(resynchend_pak *rst)
|
|||
|
||||
if (!players[i].spectator)
|
||||
rst->ingame |= (1<<i);
|
||||
if (players[i].outofcoop)
|
||||
rst->outofcoop |= (1<<i);
|
||||
rst->ctfteam[i] = (INT32)LONG(players[i].ctfteam);
|
||||
rst->score[i] = (UINT32)LONG(players[i].score);
|
||||
rst->numboxes[i] = SHORT(players[i].numboxes);
|
||||
|
@ -915,11 +922,13 @@ static inline void resynch_read_others(resynchend_pak *p)
|
|||
{
|
||||
UINT8 i;
|
||||
UINT32 loc_ingame = (UINT32)LONG(p->ingame);
|
||||
UINT32 loc_outofcoop = (UINT32)LONG(p->outofcoop);
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; ++i)
|
||||
{
|
||||
// We don't care if they're in the game or not, just write all the data.
|
||||
players[i].spectator = !(loc_ingame & (1<<i));
|
||||
players[i].outofcoop = (loc_outofcoop & (1<<i));
|
||||
players[i].ctfteam = (INT32)LONG(p->ctfteam[i]); // no, 0 does not mean spectator, at least not in Match
|
||||
players[i].score = (UINT32)LONG(p->score[i]);
|
||||
players[i].numboxes = SHORT(p->numboxes[i]);
|
||||
|
@ -1014,7 +1023,7 @@ static void SV_SendResynch(INT32 node)
|
|||
|
||||
if (resynch_score[node] > (unsigned)cv_resynchattempts.value*250)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
buf[0] = (UINT8)nodetoplayer[node];
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
|
@ -1319,7 +1328,7 @@ static void SV_SendPlayerInfo(INT32 node)
|
|||
netbuffer->u.playerinfo[i].skin = (UINT8)players[i].skin;
|
||||
|
||||
// Extra data
|
||||
netbuffer->u.playerinfo[i].data = players[i].skincolor;
|
||||
netbuffer->u.playerinfo[i].data = 0; //players[i].skincolor;
|
||||
|
||||
if (players[i].pflags & PF_TAGIT)
|
||||
netbuffer->u.playerinfo[i].data |= 0x20;
|
||||
|
@ -1490,7 +1499,7 @@ static void SV_SavedGame(void)
|
|||
{
|
||||
size_t length;
|
||||
UINT8 *savebuffer;
|
||||
XBOXSTATIC char tmpsave[256];
|
||||
char tmpsave[256];
|
||||
|
||||
if (!cv_dumpconsistency.value)
|
||||
return;
|
||||
|
@ -1532,7 +1541,7 @@ static void CL_LoadReceivedSavegame(void)
|
|||
{
|
||||
UINT8 *savebuffer = NULL;
|
||||
size_t length, decompressedlen;
|
||||
XBOXSTATIC char tmpsave[256];
|
||||
char tmpsave[256];
|
||||
|
||||
sprintf(tmpsave, "%s" PATHSEP TMPSAVENAME, srb2home);
|
||||
|
||||
|
@ -1890,6 +1899,7 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic
|
|||
break; // exit the case
|
||||
|
||||
cl_mode = CL_ASKJOIN; // don't break case continue to cljoin request now
|
||||
/* FALLTHRU */
|
||||
|
||||
case CL_ASKJOIN:
|
||||
CL_LoadServerFiles();
|
||||
|
@ -1989,7 +1999,7 @@ static void CL_ConnectToServer(boolean viams)
|
|||
tic_t asksent;
|
||||
#endif
|
||||
#ifdef JOININGAME
|
||||
XBOXSTATIC char tmpsave[256];
|
||||
char tmpsave[256];
|
||||
|
||||
sprintf(tmpsave, "%s" PATHSEP TMPSAVENAME, srb2home);
|
||||
#endif
|
||||
|
@ -2234,7 +2244,8 @@ static void Command_connect(void)
|
|||
CONS_Printf(M_GetText(
|
||||
"Connect <serveraddress> (port): connect to a server\n"
|
||||
"Connect ANY: connect to the first lan server found\n"
|
||||
"Connect SELF: connect to your own server.\n"));
|
||||
//"Connect SELF: connect to your own server.\n"
|
||||
));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2248,7 +2259,7 @@ static void Command_connect(void)
|
|||
// we don't request a restart unless the filelist differs
|
||||
|
||||
server = false;
|
||||
|
||||
/*
|
||||
if (!stricmp(COM_Argv(1), "self"))
|
||||
{
|
||||
servernode = 0;
|
||||
|
@ -2257,6 +2268,7 @@ static void Command_connect(void)
|
|||
//SV_SpawnServer();
|
||||
}
|
||||
else
|
||||
*/
|
||||
{
|
||||
// used in menu to connect to a server in the list
|
||||
if (netgame && !stricmp(COM_Argv(1), "node"))
|
||||
|
@ -2280,10 +2292,13 @@ static void Command_connect(void)
|
|||
|
||||
if (!stricmp(COM_Argv(1), "any"))
|
||||
servernode = BROADCASTADDR;
|
||||
else if (I_NetMakeNodewPort && COM_Argc() >= 3)
|
||||
servernode = I_NetMakeNodewPort(COM_Argv(1), COM_Argv(2));
|
||||
else if (I_NetMakeNodewPort)
|
||||
{
|
||||
if (COM_Argc() >= 3) // address AND port
|
||||
servernode = I_NetMakeNodewPort(COM_Argv(1), COM_Argv(2));
|
||||
else // address only, or address:port
|
||||
servernode = I_NetMakeNode(COM_Argv(1));
|
||||
}
|
||||
else
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, M_GetText("There is no server identification with this network driver\n"));
|
||||
|
@ -2535,7 +2550,7 @@ static void Command_Ban(void)
|
|||
|
||||
if (server || adminplayer == consoleplayer)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH];
|
||||
UINT8 buf[3 + MAX_REASONLENGTH];
|
||||
UINT8 *p = buf;
|
||||
const SINT8 pn = nametonum(COM_Argv(1));
|
||||
const INT32 node = playernode[(INT32)pn];
|
||||
|
@ -2601,7 +2616,7 @@ static void Command_Kick(void)
|
|||
|
||||
if (server || adminplayer == consoleplayer)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH];
|
||||
UINT8 buf[3 + MAX_REASONLENGTH];
|
||||
UINT8 *p = buf;
|
||||
const SINT8 pn = nametonum(COM_Argv(1));
|
||||
|
||||
|
@ -2650,7 +2665,7 @@ static void Command_Kick(void)
|
|||
static void Got_KickCmd(UINT8 **p, INT32 playernum)
|
||||
{
|
||||
INT32 pnum, msg;
|
||||
XBOXSTATIC char buf[3 + MAX_REASONLENGTH];
|
||||
char buf[3 + MAX_REASONLENGTH];
|
||||
char *reason = buf;
|
||||
|
||||
pnum = READUINT8(*p);
|
||||
|
@ -3041,7 +3056,7 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
|
|||
CONS_Alert(CONS_WARNING, M_GetText("Illegal add player command received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
|
@ -3078,11 +3093,15 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
|
|||
secondarydisplayplayer = newplayernum;
|
||||
DEBFILE("spawning me\n");
|
||||
// Apply player flags as soon as possible!
|
||||
players[newplayernum].pflags &= ~(PF_FLIPCAM|PF_ANALOGMODE);
|
||||
players[newplayernum].pflags &= ~(PF_FLIPCAM|PF_ANALOGMODE|PF_DIRECTIONCHAR|PF_AUTOBRAKE);
|
||||
if (cv_flipcam.value)
|
||||
players[newplayernum].pflags |= PF_FLIPCAM;
|
||||
if (cv_analog.value)
|
||||
players[newplayernum].pflags |= PF_ANALOGMODE;
|
||||
if (cv_directionchar.value)
|
||||
players[newplayernum].pflags |= PF_DIRECTIONCHAR;
|
||||
if (cv_autobrake.value)
|
||||
players[newplayernum].pflags |= PF_AUTOBRAKE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3091,11 +3110,15 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
|
|||
if (botingame)
|
||||
players[newplayernum].bot = 1;
|
||||
// Same goes for player 2 when relevant
|
||||
players[newplayernum].pflags &= ~(PF_FLIPCAM|PF_ANALOGMODE);
|
||||
players[newplayernum].pflags &= ~(PF_FLIPCAM|PF_ANALOGMODE|PF_DIRECTIONCHAR|PF_AUTOBRAKE);
|
||||
if (cv_flipcam2.value)
|
||||
players[newplayernum].pflags |= PF_FLIPCAM;
|
||||
if (cv_analog2.value)
|
||||
players[newplayernum].pflags |= PF_ANALOGMODE;
|
||||
if (cv_directionchar2.value)
|
||||
players[newplayernum].pflags |= PF_DIRECTIONCHAR;
|
||||
if (cv_autobrake2.value)
|
||||
players[newplayernum].pflags |= PF_AUTOBRAKE;
|
||||
}
|
||||
D_SendPlayerConfig();
|
||||
addedtogame = true;
|
||||
|
@ -3118,7 +3141,7 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
|
|||
static boolean SV_AddWaitingPlayers(void)
|
||||
{
|
||||
INT32 node, n, newplayer = false;
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
UINT8 newplayernum = 0;
|
||||
|
||||
// What is the reason for this? Why can't newplayernum always be 0?
|
||||
|
@ -3179,7 +3202,7 @@ void CL_AddSplitscreenPlayer(void)
|
|||
|
||||
void CL_RemoveSplitscreenPlayer(void)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
|
||||
if (cl_mode != CL_CONNECTED)
|
||||
return;
|
||||
|
@ -3603,6 +3626,7 @@ static void HandlePacketFromAwayNode(SINT8 node)
|
|||
// Do not remove my own server (we have just get a out of order packet)
|
||||
if (node == servernode)
|
||||
break;
|
||||
/* FALLTHRU */
|
||||
|
||||
default:
|
||||
DEBFILE(va("unknown packet received (%d) from unknown host\n",netbuffer->packettype));
|
||||
|
@ -3622,11 +3646,10 @@ static void HandlePacketFromAwayNode(SINT8 node)
|
|||
*
|
||||
*/
|
||||
static void HandlePacketFromPlayer(SINT8 node)
|
||||
{FILESTAMP
|
||||
XBOXSTATIC INT32 netconsole;
|
||||
XBOXSTATIC tic_t realend, realstart;
|
||||
XBOXSTATIC UINT8 *pak, *txtpak, numtxtpak;
|
||||
FILESTAMP
|
||||
{
|
||||
INT32 netconsole;
|
||||
tic_t realend, realstart;
|
||||
UINT8 *pak, *txtpak, numtxtpak;
|
||||
|
||||
txtpak = NULL;
|
||||
|
||||
|
@ -3700,7 +3723,7 @@ FILESTAMP
|
|||
if (netcmds[maketic%BACKUPTICS][netconsole].forwardmove > MAXPLMOVE || netcmds[maketic%BACKUPTICS][netconsole].forwardmove < -MAXPLMOVE
|
||||
|| netcmds[maketic%BACKUPTICS][netconsole].sidemove > MAXPLMOVE || netcmds[maketic%BACKUPTICS][netconsole].sidemove < -MAXPLMOVE)
|
||||
{
|
||||
XBOXSTATIC char buf[2];
|
||||
char buf[2];
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal movement value received from node %d\n"), netconsole);
|
||||
//D_Clearticcmd(k);
|
||||
|
||||
|
@ -3743,7 +3766,7 @@ FILESTAMP
|
|||
}
|
||||
else
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[3];
|
||||
UINT8 buf[3];
|
||||
|
||||
buf[0] = (UINT8)netconsole;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
|
@ -3759,6 +3782,7 @@ FILESTAMP
|
|||
break;
|
||||
case PT_TEXTCMD2: // splitscreen special
|
||||
netconsole = nodetoplayer2[node];
|
||||
/* FALLTHRU */
|
||||
case PT_TEXTCMD:
|
||||
if (client)
|
||||
break;
|
||||
|
@ -3833,7 +3857,7 @@ FILESTAMP
|
|||
nodewaiting[node] = 0;
|
||||
if (netconsole != -1 && playeringame[netconsole])
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
buf[0] = (UINT8)netconsole;
|
||||
if (netbuffer->packettype == PT_NODETIMEOUT)
|
||||
buf[1] = KICK_MSG_TIMEOUT;
|
||||
|
@ -3861,7 +3885,7 @@ FILESTAMP
|
|||
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
buf[0] = (UINT8)node;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
|
@ -3886,7 +3910,7 @@ FILESTAMP
|
|||
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
buf[0] = (UINT8)node;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
|
@ -3952,7 +3976,7 @@ FILESTAMP
|
|||
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC char buf[2];
|
||||
char buf[2];
|
||||
buf[0] = (char)node;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
|
@ -3972,7 +3996,7 @@ FILESTAMP
|
|||
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC char buf[2];
|
||||
char buf[2];
|
||||
buf[0] = (char)node;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
|
@ -4002,7 +4026,7 @@ FILESTAMP
|
|||
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
buf[0] = (UINT8)node;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
|
@ -4025,9 +4049,8 @@ FILESTAMP
|
|||
*
|
||||
*/
|
||||
static void GetPackets(void)
|
||||
{FILESTAMP
|
||||
XBOXSTATIC SINT8 node; // The packet sender
|
||||
FILESTAMP
|
||||
{
|
||||
SINT8 node; // The packet sender
|
||||
|
||||
player_joining = false;
|
||||
|
||||
|
@ -4113,7 +4136,10 @@ static INT16 Consistancy(void)
|
|||
|
||||
#ifdef MOBJCONSISTANCY
|
||||
if (!thinkercap.next)
|
||||
{
|
||||
DEBFILE(va("Consistancy = %u\n", ret));
|
||||
return ret;
|
||||
}
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
|
||||
|
@ -4182,6 +4208,8 @@ static INT16 Consistancy(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
DEBFILE(va("Consistancy = %u\n", (ret & 0xFFFF)));
|
||||
|
||||
return (INT16)(ret & 0xFFFF);
|
||||
}
|
||||
|
||||
|
@ -4522,7 +4550,7 @@ static inline void PingUpdate(void)
|
|||
{
|
||||
if (playeringame[i] && laggers[i])
|
||||
{
|
||||
XBOXSTATIC char buf[2];
|
||||
char buf[2];
|
||||
|
||||
buf[0] = (char)i;
|
||||
buf[1] = KICK_MSG_PING_HIGH;
|
||||
|
@ -4594,9 +4622,9 @@ void NetUpdate(void)
|
|||
|
||||
if (server)
|
||||
CL_SendClientCmd(); // send it
|
||||
FILESTAMP
|
||||
|
||||
GetPackets(); // get packet from client or from server
|
||||
FILESTAMP
|
||||
|
||||
// client send the command after a receive of the server
|
||||
// the server send before because in single player is beter
|
||||
|
||||
|
|
|
@ -136,6 +136,7 @@ typedef struct
|
|||
fixed_t flagz[2];
|
||||
|
||||
UINT32 ingame; // Spectator bit for each player
|
||||
UINT32 outofcoop; // outofcoop bit for each player
|
||||
INT32 ctfteam[MAXPLAYERS]; // Which team? (can't be 1 bit, since in regular Match there are no teams)
|
||||
|
||||
// Resynch game scores and the like all at once
|
||||
|
@ -188,6 +189,7 @@ typedef struct
|
|||
UINT32 thokitem; // mobjtype_t
|
||||
UINT32 spinitem; // mobjtype_t
|
||||
UINT32 revitem; // mobjtype_t
|
||||
UINT32 followitem; // mobjtype_t
|
||||
fixed_t actionspd;
|
||||
fixed_t mindash;
|
||||
fixed_t maxdash;
|
||||
|
@ -315,6 +317,7 @@ typedef struct
|
|||
} ATTRPACK clientconfig_pak;
|
||||
|
||||
#define MAXSERVERNAME 32
|
||||
#define MAXFILENEEDED 915
|
||||
// This packet is too large
|
||||
typedef struct
|
||||
{
|
||||
|
@ -336,7 +339,7 @@ typedef struct
|
|||
unsigned char mapmd5[16];
|
||||
UINT8 actnum;
|
||||
UINT8 iszone;
|
||||
UINT8 fileneeded[915]; // is filled with writexxx (byteptr.h)
|
||||
UINT8 fileneeded[MAXFILENEEDED]; // is filled with writexxx (byteptr.h)
|
||||
} ATTRPACK serverinfo_pak;
|
||||
|
||||
typedef struct
|
||||
|
|
122
src/d_main.c
122
src/d_main.c
|
@ -30,16 +30,12 @@ int snprintf(char *str, size_t n, const char *fmt, ...);
|
|||
//int vsnprintf(char *str, size_t n, const char *fmt, va_list ap);
|
||||
#endif
|
||||
|
||||
#if (defined (_WIN32) && !defined (_WIN32_WCE)) && !defined (_XBOX)
|
||||
#ifdef _WIN32
|
||||
#include <direct.h>
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#if !defined (UNDER_CE)
|
||||
#include <time.h>
|
||||
#elif defined (_XBOX)
|
||||
#define NO_TIME
|
||||
#endif
|
||||
|
||||
#include "doomdef.h"
|
||||
#include "am_map.h"
|
||||
|
@ -74,6 +70,7 @@ int snprintf(char *str, size_t n, const char *fmt, ...);
|
|||
#include "m_cond.h" // condition initialization
|
||||
#include "fastcmp.h"
|
||||
#include "keys.h"
|
||||
#include "filesrch.h" // refreshdirmenu, mainwadstally
|
||||
|
||||
#ifdef CMAKECONFIG
|
||||
#include "config.h"
|
||||
|
@ -81,10 +78,6 @@ int snprintf(char *str, size_t n, const char *fmt, ...);
|
|||
#include "config.h.in"
|
||||
#endif
|
||||
|
||||
#ifdef _XBOX
|
||||
#include "sdl/SRB2XBOX/xboxhelp.h"
|
||||
#endif
|
||||
|
||||
#ifdef HWRENDER
|
||||
#include "hardware/hw_main.h" // 3D View Rendering
|
||||
#endif
|
||||
|
@ -119,13 +112,8 @@ INT32 postimgparam;
|
|||
postimg_t postimgtype2 = postimg_none;
|
||||
INT32 postimgparam2;
|
||||
|
||||
#ifdef _XBOX
|
||||
boolean nomidimusic = true, nosound = true;
|
||||
boolean nodigimusic = true;
|
||||
#else
|
||||
boolean nomidimusic = false, nosound = false;
|
||||
boolean nodigimusic = false; // No fmod-based music
|
||||
#endif
|
||||
|
||||
// These variables are only true if
|
||||
// the respective sound system is initialized
|
||||
|
@ -139,13 +127,8 @@ boolean advancedemo;
|
|||
INT32 debugload = 0;
|
||||
#endif
|
||||
|
||||
#ifdef _arch_dreamcast
|
||||
char srb2home[256] = "/cd";
|
||||
char srb2path[256] = "/cd";
|
||||
#else
|
||||
char srb2home[256] = ".";
|
||||
char srb2path[256] = ".";
|
||||
#endif
|
||||
boolean usehome = true;
|
||||
const char *pandf = "%s" PATHSEP "%s";
|
||||
|
||||
|
@ -300,7 +283,7 @@ static void D_Display(void)
|
|||
if (rendermode != render_none)
|
||||
{
|
||||
// Fade to black first
|
||||
if (gamestate != GS_LEVEL // fades to black on its own timing, always
|
||||
if (!(gamestate == GS_LEVEL || (gamestate == GS_TITLESCREEN && titlemapinaction)) // fades to black on its own timing, always
|
||||
&& wipedefs[wipedefindex] != UINT8_MAX)
|
||||
{
|
||||
F_WipeStartScreen();
|
||||
|
@ -316,6 +299,12 @@ static void D_Display(void)
|
|||
// do buffered drawing
|
||||
switch (gamestate)
|
||||
{
|
||||
case GS_TITLESCREEN:
|
||||
if (!titlemapinaction) {
|
||||
F_TitleScreenDrawer();
|
||||
break;
|
||||
}
|
||||
// Intentional fall-through
|
||||
case GS_LEVEL:
|
||||
if (!gametic)
|
||||
break;
|
||||
|
@ -364,10 +353,6 @@ static void D_Display(void)
|
|||
HU_Drawer();
|
||||
break;
|
||||
|
||||
case GS_TITLESCREEN:
|
||||
F_TitleScreenDrawer();
|
||||
break;
|
||||
|
||||
case GS_WAITINGPLAYERS:
|
||||
// The clientconnect drawer is independent...
|
||||
case GS_DEDICATEDSERVER:
|
||||
|
@ -377,9 +362,10 @@ static void D_Display(void)
|
|||
|
||||
// clean up border stuff
|
||||
// see if the border needs to be initially drawn
|
||||
if (gamestate == GS_LEVEL)
|
||||
if (gamestate == GS_LEVEL || (gamestate == GS_TITLESCREEN && titlemapinaction))
|
||||
{
|
||||
// draw the view directly
|
||||
|
||||
if (!automapactive && !dedicated && cv_renderview.value)
|
||||
{
|
||||
if (players[displayplayer].mo || players[displayplayer].playerstate == PST_DEAD)
|
||||
|
@ -418,11 +404,14 @@ static void D_Display(void)
|
|||
}
|
||||
|
||||
// Image postprocessing effect
|
||||
if (rendermode == render_soft)
|
||||
{
|
||||
if (postimgtype)
|
||||
V_DoPostProcessor(0, postimgtype, postimgparam);
|
||||
if (postimgtype2)
|
||||
V_DoPostProcessor(1, postimgtype2, postimgparam2);
|
||||
}
|
||||
}
|
||||
|
||||
if (lastdraw)
|
||||
{
|
||||
|
@ -434,10 +423,14 @@ static void D_Display(void)
|
|||
lastdraw = false;
|
||||
}
|
||||
|
||||
if (gamestate == GS_LEVEL)
|
||||
{
|
||||
ST_Drawer();
|
||||
|
||||
HU_Drawer();
|
||||
}
|
||||
else
|
||||
F_TitleScreenDrawer();
|
||||
}
|
||||
|
||||
// change gamma if needed
|
||||
// (GS_LEVEL handles this already due to level-specific palettes)
|
||||
|
@ -584,6 +577,8 @@ void D_SRB2Loop(void)
|
|||
realtics = entertic - oldentertics;
|
||||
oldentertics = entertic;
|
||||
|
||||
refreshdirmenu = 0; // not sure where to put this, here as good as any?
|
||||
|
||||
#ifdef DEBUGFILE
|
||||
if (!realtics)
|
||||
if (debugload)
|
||||
|
@ -674,6 +669,9 @@ void D_AdvanceDemo(void)
|
|||
void D_StartTitle(void)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
S_StopMusic();
|
||||
|
||||
if (netgame)
|
||||
{
|
||||
if (gametype == GT_COOP)
|
||||
|
@ -709,6 +707,7 @@ void D_StartTitle(void)
|
|||
botskin = 0;
|
||||
cv_debug = 0;
|
||||
emeralds = 0;
|
||||
lastmaploaded = 0;
|
||||
|
||||
// In case someone exits out at the same time they start a time attack run,
|
||||
// reset modeattacking
|
||||
|
@ -717,6 +716,14 @@ void D_StartTitle(void)
|
|||
// empty maptol so mario/etc sounds don't play in sound test when they shouldn't
|
||||
maptol = 0;
|
||||
|
||||
// reset to default player stuff
|
||||
COM_BufAddText (va("%s \"%s\"\n",cv_playername.name,cv_defaultplayername.string));
|
||||
COM_BufAddText (va("%s \"%s\"\n",cv_skin.name,cv_defaultskin.string));
|
||||
COM_BufAddText (va("%s \"%s\"\n",cv_playercolor.name,cv_defaultplayercolor.string));
|
||||
COM_BufAddText (va("%s \"%s\"\n",cv_playername2.name,cv_defaultplayername2.string));
|
||||
COM_BufAddText (va("%s \"%s\"\n",cv_skin2.name,cv_defaultskin2.string));
|
||||
COM_BufAddText (va("%s \"%s\"\n",cv_playercolor2.name,cv_defaultplayercolor2.string));
|
||||
|
||||
gameaction = ga_nothing;
|
||||
displayplayer = consoleplayer = 0;
|
||||
gametype = GT_COOP;
|
||||
|
@ -791,17 +798,11 @@ static void IdentifyVersion(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
#if !defined(_WIN32_WCE) && !defined(_PS3)
|
||||
if (getcwd(srb2path, 256) != NULL)
|
||||
srb2waddir = srb2path;
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#ifdef _arch_dreamcast
|
||||
srb2waddir = "/cd";
|
||||
#else
|
||||
srb2waddir = ".";
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -856,11 +857,7 @@ static void IdentifyVersion(void)
|
|||
|
||||
#if !defined (HAVE_SDL) || defined (HAVE_MIXER)
|
||||
{
|
||||
#if defined (DC) && 0
|
||||
const char *musicfile = "music_dc.dta";
|
||||
#else
|
||||
const char *musicfile = "music.dta";
|
||||
#endif
|
||||
const char *musicpath = va(pandf,srb2waddir,musicfile);
|
||||
int ms = W_VerifyNMUSlumps(musicpath); // Don't forget the music!
|
||||
if (ms == 1)
|
||||
|
@ -870,7 +867,7 @@ static void IdentifyVersion(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if 1 // This section can be deleted when music_new is merged with music.dta
|
||||
#ifdef DEVELOP // This section can be deleted when music_new is merged with music.dta
|
||||
{
|
||||
const char *musicfile = "music_new.dta";
|
||||
const char *musicpath = va(pandf,srb2waddir,musicfile);
|
||||
|
@ -952,7 +949,7 @@ void D_SRB2Main(void)
|
|||
boolean autostart = false;
|
||||
|
||||
// keep error messages until the final flush(stderr)
|
||||
#if !defined (PC_DOS) && !defined (_WIN32_WCE) && !defined(NOTERMIOS)
|
||||
#if !defined (PC_DOS) && !defined(NOTERMIOS)
|
||||
if (setvbuf(stderr, NULL, _IOFBF, 1000))
|
||||
I_OutputMsg("setvbuf didnt work\n");
|
||||
#endif
|
||||
|
@ -974,11 +971,11 @@ void D_SRB2Main(void)
|
|||
// identify the main IWAD file to use
|
||||
IdentifyVersion();
|
||||
|
||||
#if !defined (_WIN32_WCE) && !defined(NOTERMIOS)
|
||||
#if !defined(NOTERMIOS)
|
||||
setbuf(stdout, NULL); // non-buffered output
|
||||
#endif
|
||||
|
||||
#if defined (_WIN32_WCE) //|| defined (_DEBUG) || defined (GP2X)
|
||||
#if 0 //defined (_DEBUG)
|
||||
devparm = M_CheckParm("-nodebug") == 0;
|
||||
#else
|
||||
devparm = M_CheckParm("-debug") != 0;
|
||||
|
@ -1004,13 +1001,8 @@ void D_SRB2Main(void)
|
|||
|
||||
if (!userhome)
|
||||
{
|
||||
#if ((defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)) && !defined (__CYGWIN__) && !defined (DC) && !defined (PSP) && !defined(GP2X)
|
||||
#if ((defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)) && !defined (__CYGWIN__)
|
||||
I_Error("Please set $HOME to your home directory\n");
|
||||
#elif defined (_WIN32_WCE) && 0
|
||||
if (dedicated)
|
||||
snprintf(configfile, sizeof configfile, "/Storage Card/SRB2DEMO/d"CONFIGFILENAME);
|
||||
else
|
||||
snprintf(configfile, sizeof configfile, "/Storage Card/SRB2DEMO/"CONFIGFILENAME);
|
||||
#else
|
||||
if (dedicated)
|
||||
snprintf(configfile, sizeof configfile, "d"CONFIGFILENAME);
|
||||
|
@ -1047,10 +1039,6 @@ void D_SRB2Main(void)
|
|||
}
|
||||
|
||||
configfile[sizeof configfile - 1] = '\0';
|
||||
|
||||
#ifdef _arch_dreamcast
|
||||
strcpy(downloaddir, "/ram"); // the dreamcast's TMP
|
||||
#endif
|
||||
}
|
||||
|
||||
// rand() needs seeded regardless of password
|
||||
|
@ -1162,6 +1150,11 @@ void D_SRB2Main(void)
|
|||
#ifdef USE_PATCH_DTA
|
||||
++mainwads; // patch.dta adds one more
|
||||
#endif
|
||||
#ifdef DEVELOP
|
||||
++mainwads; // music_new, too
|
||||
#endif
|
||||
|
||||
mainwadstally = packetsizetally;
|
||||
|
||||
cht_Init();
|
||||
|
||||
|
@ -1180,12 +1173,7 @@ void D_SRB2Main(void)
|
|||
HU_Init();
|
||||
|
||||
COM_Init();
|
||||
// libogc has a CON_Init function, we must rename SRB2's CON_Init in WII/libogc
|
||||
#ifndef _WII
|
||||
CON_Init();
|
||||
#else
|
||||
CON_InitWii();
|
||||
#endif
|
||||
|
||||
D_RegisterServerCommands();
|
||||
D_RegisterClientCommands(); // be sure that this is called before D_CheckNetGame
|
||||
|
@ -1325,6 +1313,19 @@ void D_SRB2Main(void)
|
|||
ultimatemode = true;
|
||||
}
|
||||
|
||||
// rei/miru: bootmap (Idea: starts the game on a predefined map)
|
||||
if (bootmap && !(M_CheckParm("-warp") && M_IsNextParm()))
|
||||
{
|
||||
pstartmap = bootmap;
|
||||
|
||||
if (pstartmap < 1 || pstartmap > NUMMAPS)
|
||||
I_Error("Cannot warp to map %d (out of range)\n", pstartmap);
|
||||
else
|
||||
{
|
||||
autostart = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (autostart || netgame || M_CheckParm("+connect") || M_CheckParm("-connect"))
|
||||
{
|
||||
gameaction = ga_nothing;
|
||||
|
@ -1400,26 +1401,19 @@ const char *D_Home(void)
|
|||
#ifdef ANDROID
|
||||
return "/data/data/org.srb2/";
|
||||
#endif
|
||||
#ifdef _arch_dreamcast
|
||||
char VMUHOME[] = "HOME=/vmu/a1";
|
||||
putenv(VMUHOME); //don't use I_PutEnv
|
||||
#endif
|
||||
|
||||
if (M_CheckParm("-home") && M_IsNextParm())
|
||||
userhome = M_GetNextParm();
|
||||
else
|
||||
{
|
||||
#if defined (GP2X)
|
||||
usehome = false; //let use the CWD
|
||||
return NULL;
|
||||
#elif !((defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)) && !defined (__APPLE__) && !defined(_WIN32_WCE)
|
||||
#if !((defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)) && !defined (__APPLE__)
|
||||
if (FIL_FileOK(CONFIGFILENAME))
|
||||
usehome = false; // Let's NOT use home
|
||||
else
|
||||
#endif
|
||||
userhome = I_GetEnv("HOME"); //Alam: my new HOME for srb2
|
||||
}
|
||||
#if defined (_WIN32) && !defined(_WIN32_WCE) //Alam: only Win32 have APPDATA and USERPROFILE
|
||||
#ifdef _WIN32 //Alam: only Win32 have APPDATA and USERPROFILE
|
||||
if (!userhome && usehome) //Alam: Still not?
|
||||
{
|
||||
char *testhome = NULL;
|
||||
|
|
|
@ -1030,6 +1030,7 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen
|
|||
#endif
|
||||
return false;
|
||||
}
|
||||
netbuffer->ack = netbuffer->ackreturn = 0; // don't hold over values from last packet sent/received
|
||||
M_Memcpy(&reboundstore[rebound_head], netbuffer,
|
||||
doomcom->datalength);
|
||||
reboundsize[rebound_head] = doomcom->datalength;
|
||||
|
@ -1358,14 +1359,9 @@ boolean D_CheckNetGame(void)
|
|||
netbuffer = (doomdata_t *)(void *)&doomcom->data;
|
||||
|
||||
#ifdef DEBUGFILE
|
||||
#ifdef _arch_dreamcast
|
||||
//debugfile = stderr;
|
||||
if (debugfile)
|
||||
CONS_Printf(M_GetText("debug output to: %s\n"), "STDERR");
|
||||
#else
|
||||
if (M_CheckParm("-debugfile"))
|
||||
{
|
||||
char filename[20];
|
||||
char filename[21];
|
||||
INT32 k = doomcom->consoleplayer - 1;
|
||||
if (M_IsNextParm())
|
||||
k = atoi(M_GetNextParm()) - 1;
|
||||
|
@ -1380,7 +1376,6 @@ boolean D_CheckNetGame(void)
|
|||
else
|
||||
CONS_Alert(CONS_WARNING, M_GetText("cannot debug output to file %s!\n"), filename);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
D_ClientServerInit();
|
||||
|
|
335
src/d_netcmd.c
335
src/d_netcmd.c
|
@ -37,6 +37,7 @@
|
|||
#include "d_main.h"
|
||||
#include "m_random.h"
|
||||
#include "f_finale.h"
|
||||
#include "filesrch.h"
|
||||
#include "mserv.h"
|
||||
#include "md5.h"
|
||||
#include "z_zone.h"
|
||||
|
@ -60,9 +61,6 @@ static void Got_WeaponPref(UINT8 **cp, INT32 playernum);
|
|||
static void Got_Mapcmd(UINT8 **cp, INT32 playernum);
|
||||
static void Got_ExitLevelcmd(UINT8 **cp, INT32 playernum);
|
||||
static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum);
|
||||
#ifdef DELFILE
|
||||
static void Got_Delfilecmd(UINT8 **cp, INT32 playernum);
|
||||
#endif
|
||||
static void Got_Addfilecmd(UINT8 **cp, INT32 playernum);
|
||||
static void Got_Pause(UINT8 **cp, INT32 playernum);
|
||||
static void Got_Suicide(UINT8 **cp, INT32 playernum);
|
||||
|
@ -84,6 +82,9 @@ static void TeamScramble_OnChange(void);
|
|||
static void NetTimeout_OnChange(void);
|
||||
static void JoinTimeout_OnChange(void);
|
||||
|
||||
static void CoopStarposts_OnChange(void);
|
||||
static void CoopLives_OnChange(void);
|
||||
|
||||
static void Ringslinger_OnChange(void);
|
||||
static void Gravity_OnChange(void);
|
||||
static void ForceSkin_OnChange(void);
|
||||
|
@ -111,9 +112,6 @@ static void Command_ResetCamera_f(void);
|
|||
|
||||
static void Command_Addfile(void);
|
||||
static void Command_ListWADS_f(void);
|
||||
#ifdef DELFILE
|
||||
static void Command_Delfile(void);
|
||||
#endif
|
||||
static void Command_RunSOC(void);
|
||||
static void Command_Pause(void);
|
||||
static void Command_Suicide(void);
|
||||
|
@ -184,15 +182,14 @@ static CV_PossibleValue_t joyport_cons_t[] = {{1, "/dev/js0"}, {2, "/dev/js1"},
|
|||
#define usejoystick_cons_t NULL
|
||||
#endif
|
||||
|
||||
static CV_PossibleValue_t autobalance_cons_t[] = {{0, "MIN"}, {4, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t teamscramble_cons_t[] = {{0, "Off"}, {1, "Random"}, {2, "Points"}, {0, NULL}};
|
||||
|
||||
static CV_PossibleValue_t startingliveslimit_cons_t[] = {{1, "MIN"}, {99, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t sleeping_cons_t[] = {{-1, "MIN"}, {1000/TICRATE, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t competitionboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, //{2, "Teleports"},
|
||||
static CV_PossibleValue_t competitionboxes_cons_t[] = {{0, "Normal"}, {1, "Mystery"}, //{2, "Teleport"},
|
||||
{3, "None"}, {0, NULL}};
|
||||
|
||||
static CV_PossibleValue_t matchboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, {2, "Non-Random"},
|
||||
static CV_PossibleValue_t matchboxes_cons_t[] = {{0, "Normal"}, {1, "Mystery"}, {2, "Unchanging"},
|
||||
{3, "None"}, {0, NULL}};
|
||||
|
||||
static CV_PossibleValue_t chances_cons_t[] = {{0, "MIN"}, {9, "MAX"}, {0, NULL}};
|
||||
|
@ -214,7 +211,7 @@ consvar_t cv_startinglives = {"startinglives", "3", CV_NETVAR|CV_CHEAT, starting
|
|||
static CV_PossibleValue_t respawntime_cons_t[] = {{0, "MIN"}, {30, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_respawntime = {"respawndelay", "3", CV_NETVAR|CV_CHEAT, respawntime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_competitionboxes = {"competitionboxes", "Random", CV_NETVAR|CV_CHEAT, competitionboxes_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_competitionboxes = {"competitionboxes", "Mystery", CV_NETVAR|CV_CHEAT, competitionboxes_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
#ifdef SEENAMES
|
||||
static CV_PossibleValue_t seenames_cons_t[] = {{0, "Off"}, {1, "Colorless"}, {2, "Team"}, {3, "Ally/Foe"}, {0, NULL}};
|
||||
|
@ -222,9 +219,9 @@ consvar_t cv_seenames = {"seenames", "Ally/Foe", CV_SAVE, seenames_cons_t, 0, 0,
|
|||
consvar_t cv_allowseenames = {"allowseenames", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#endif
|
||||
|
||||
// these are just meant to be saved to the config
|
||||
consvar_t cv_playername = {"name", "Sonic", CV_SAVE|CV_CALL|CV_NOINIT, NULL, Name_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_playername2 = {"name2", "Tails", CV_SAVE|CV_CALL|CV_NOINIT, NULL, Name2_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
// names
|
||||
consvar_t cv_playername = {"name", "Sonic", CV_CALL|CV_NOINIT, NULL, Name_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_playername2 = {"name2", "Tails", CV_CALL|CV_NOINIT, NULL, Name2_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
// player colors
|
||||
consvar_t cv_playercolor = {"color", "Blue", CV_CALL|CV_NOINIT, Color_cons_t, Color_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_playercolor2 = {"color2", "Orange", CV_CALL|CV_NOINIT, Color_cons_t, Color2_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
@ -232,6 +229,14 @@ consvar_t cv_playercolor2 = {"color2", "Orange", CV_CALL|CV_NOINIT, Color_cons_t
|
|||
consvar_t cv_skin = {"skin", DEFAULTSKIN, CV_CALL|CV_NOINIT, NULL, Skin_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_skin2 = {"skin2", DEFAULTSKIN2, CV_CALL|CV_NOINIT, NULL, Skin2_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// saved versions of the above six
|
||||
consvar_t cv_defaultplayername = {"defaultname", "Sonic", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_defaultplayername2 = {"defaultname2", "Tails", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_defaultplayercolor = {"defaultcolor", "Blue", CV_SAVE, Color_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_defaultplayercolor2 = {"defaultcolor2", "Orange", CV_SAVE, Color_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_defaultskin = {"defaultskin", DEFAULTSKIN, CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_defaultskin2 = {"defaultskin2", DEFAULTSKIN2, CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_skipmapcheck = {"skipmapcheck", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
INT32 cv_debug;
|
||||
|
@ -239,22 +244,10 @@ INT32 cv_debug;
|
|||
consvar_t cv_usemouse = {"use_mouse", "On", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_usemouse2 = {"use_mouse2", "Off", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse2, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
#if defined (DC) || defined (_XBOX) || defined (WMINPUT) || defined (_WII) //joystick 1 and 2
|
||||
consvar_t cv_usejoystick = {"use_joystick", "1", CV_SAVE|CV_CALL, usejoystick_cons_t,
|
||||
I_InitJoystick, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_usejoystick2 = {"use_joystick2", "2", CV_SAVE|CV_CALL, usejoystick_cons_t,
|
||||
I_InitJoystick2, 0, NULL, NULL, 0, 0, NULL};
|
||||
#elif defined (PSP) || defined (GP2X) || defined (_NDS) //only one joystick
|
||||
consvar_t cv_usejoystick = {"use_joystick", "1", CV_SAVE|CV_CALL, usejoystick_cons_t,
|
||||
I_InitJoystick, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_usejoystick2 = {"use_joystick2", "0", CV_SAVE|CV_CALL, usejoystick_cons_t,
|
||||
I_InitJoystick2, 0, NULL, NULL, 0, 0, NULL};
|
||||
#else //all esle, no joystick
|
||||
consvar_t cv_usejoystick = {"use_joystick", "0", CV_SAVE|CV_CALL, usejoystick_cons_t,
|
||||
I_InitJoystick, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_usejoystick2 = {"use_joystick2", "0", CV_SAVE|CV_CALL, usejoystick_cons_t,
|
||||
I_InitJoystick2, 0, NULL, NULL, 0, 0, NULL};
|
||||
#endif
|
||||
#if (defined (LJOYSTICK) || defined (HAVE_SDL))
|
||||
#ifdef LJOYSTICK
|
||||
consvar_t cv_joyport = {"joyport", "/dev/js0", CV_SAVE, joyport_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
@ -302,7 +295,7 @@ consvar_t cv_countdowntime = {"countdowntime", "60", CV_NETVAR|CV_CHEAT, minitim
|
|||
consvar_t cv_touchtag = {"touchtag", "Off", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_hidetime = {"hidetime", "30", CV_NETVAR|CV_CALL, minitimelimit_cons_t, Hidetime_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_autobalance = {"autobalance", "0", CV_NETVAR|CV_CALL, autobalance_cons_t, AutoBalance_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_autobalance = {"autobalance", "Off", CV_NETVAR|CV_CALL, CV_OnOff, AutoBalance_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_teamscramble = {"teamscramble", "Off", CV_NETVAR|CV_CALL|CV_NOINIT, teamscramble_cons_t, TeamScramble_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_scrambleonchange = {"scrambleonchange", "Off", CV_NETVAR, teamscramble_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
|
@ -347,12 +340,18 @@ consvar_t cv_maxping = {"maxping", "0", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NUL
|
|||
#endif
|
||||
// Intermission time Tails 04-19-2002
|
||||
static CV_PossibleValue_t inttime_cons_t[] = {{0, "MIN"}, {3600, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_inttime = {"inttime", "20", CV_NETVAR, inttime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_inttime = {"inttime", "10", CV_NETVAR, inttime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t coopstarposts_cons_t[] = {{0, "Per-player"}, {1, "Shared"}, {2, "Teamwork"}, {0, NULL}};
|
||||
consvar_t cv_coopstarposts = {"coopstarposts", "Teamwork", CV_NETVAR|CV_CALL|CV_CHEAT, coopstarposts_cons_t, CoopStarposts_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t cooplives_cons_t[] = {{0, "Infinite"}, {1, "Per-player"}, {2, "Avoid Game Over"}, {3, "Single pool"}, {0, NULL}};
|
||||
consvar_t cv_cooplives = {"cooplives", "Avoid Game Over", CV_NETVAR|CV_CALL|CV_CHEAT, cooplives_cons_t, CoopLives_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t advancemap_cons_t[] = {{0, "Off"}, {1, "Next"}, {2, "Random"}, {0, NULL}};
|
||||
consvar_t cv_advancemap = {"advancemap", "Next", CV_NETVAR, advancemap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
static CV_PossibleValue_t playersforexit_cons_t[] = {{0, "One"}, {1, "All"}, {0, NULL}};
|
||||
consvar_t cv_playersforexit = {"playersforexit", "One", CV_NETVAR, playersforexit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
static CV_PossibleValue_t playersforexit_cons_t[] = {{0, "One"}, {1, "1/4"}, {2, "Half"}, {3, "3/4"}, {4, "All"}, {0, NULL}};
|
||||
consvar_t cv_playersforexit = {"playersforexit", "All", CV_NETVAR, playersforexit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_runscripts = {"runscripts", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
|
@ -386,7 +385,7 @@ const char *netxcmdnames[MAXNETXCMD - 1] =
|
|||
"RANDOMSEED",
|
||||
"RUNSOC",
|
||||
"REQADDFILE",
|
||||
"DELFILE",
|
||||
"DELFILE", // replace next time we add an XD
|
||||
"SETMOTD",
|
||||
"SUICIDE",
|
||||
#ifdef HAVE_BLUA
|
||||
|
@ -422,9 +421,6 @@ void D_RegisterServerCommands(void)
|
|||
RegisterNetXCmd(XD_EXITLEVEL, Got_ExitLevelcmd);
|
||||
RegisterNetXCmd(XD_ADDFILE, Got_Addfilecmd);
|
||||
RegisterNetXCmd(XD_REQADDFILE, Got_RequestAddfilecmd);
|
||||
#ifdef DELFILE
|
||||
RegisterNetXCmd(XD_DELFILE, Got_Delfilecmd);
|
||||
#endif
|
||||
RegisterNetXCmd(XD_PAUSE, Got_Pause);
|
||||
RegisterNetXCmd(XD_SUICIDE, Got_Suicide);
|
||||
RegisterNetXCmd(XD_RUNSOC, Got_RunSOCcmd);
|
||||
|
@ -458,9 +454,6 @@ void D_RegisterServerCommands(void)
|
|||
COM_AddCommand("addfile", Command_Addfile);
|
||||
COM_AddCommand("listwad", Command_ListWADS_f);
|
||||
|
||||
#ifdef DELFILE
|
||||
COM_AddCommand("delfile", Command_Delfile);
|
||||
#endif
|
||||
COM_AddCommand("runsoc", Command_RunSOC);
|
||||
COM_AddCommand("pause", Command_Pause);
|
||||
COM_AddCommand("suicide", Command_Suicide);
|
||||
|
@ -517,6 +510,9 @@ void D_RegisterServerCommands(void)
|
|||
CV_RegisterVar(&cv_forceskin);
|
||||
CV_RegisterVar(&cv_downloading);
|
||||
|
||||
CV_RegisterVar(&cv_coopstarposts);
|
||||
CV_RegisterVar(&cv_cooplives);
|
||||
|
||||
CV_RegisterVar(&cv_specialrings);
|
||||
CV_RegisterVar(&cv_powerstones);
|
||||
CV_RegisterVar(&cv_competitionboxes);
|
||||
|
@ -645,7 +641,7 @@ void D_RegisterClientCommands(void)
|
|||
|
||||
// register these so it is saved to config
|
||||
if ((username = I_GetUserName()))
|
||||
cv_playername.defaultvalue = username;
|
||||
cv_playername.defaultvalue = cv_defaultplayername.defaultvalue = username;
|
||||
CV_RegisterVar(&cv_playername);
|
||||
CV_RegisterVar(&cv_playercolor);
|
||||
CV_RegisterVar(&cv_skin); // r_things.c (skin NAME)
|
||||
|
@ -653,6 +649,13 @@ void D_RegisterClientCommands(void)
|
|||
CV_RegisterVar(&cv_playername2);
|
||||
CV_RegisterVar(&cv_playercolor2);
|
||||
CV_RegisterVar(&cv_skin2);
|
||||
// saved versions of the above six
|
||||
CV_RegisterVar(&cv_defaultplayername);
|
||||
CV_RegisterVar(&cv_defaultplayercolor);
|
||||
CV_RegisterVar(&cv_defaultskin);
|
||||
CV_RegisterVar(&cv_defaultplayername2);
|
||||
CV_RegisterVar(&cv_defaultplayercolor2);
|
||||
CV_RegisterVar(&cv_defaultskin2);
|
||||
|
||||
#ifdef SEENAMES
|
||||
CV_RegisterVar(&cv_seenames);
|
||||
|
@ -724,6 +727,14 @@ void D_RegisterClientCommands(void)
|
|||
CV_RegisterVar(&cv_firenaxis);
|
||||
CV_RegisterVar(&cv_firenaxis2);
|
||||
|
||||
// filesrch.c
|
||||
CV_RegisterVar(&cv_addons_option);
|
||||
CV_RegisterVar(&cv_addons_folder);
|
||||
CV_RegisterVar(&cv_addons_md5);
|
||||
CV_RegisterVar(&cv_addons_showall);
|
||||
CV_RegisterVar(&cv_addons_search_type);
|
||||
CV_RegisterVar(&cv_addons_search_case);
|
||||
|
||||
// WARNING: the order is important when initialising mouse2
|
||||
// we need the mouse2port
|
||||
CV_RegisterVar(&cv_mouse2port);
|
||||
|
@ -758,6 +769,12 @@ void D_RegisterClientCommands(void)
|
|||
CV_RegisterVar(&cv_useranalog);
|
||||
CV_RegisterVar(&cv_useranalog2);
|
||||
|
||||
// deez New User eXperiences
|
||||
CV_RegisterVar(&cv_directionchar);
|
||||
CV_RegisterVar(&cv_directionchar2);
|
||||
CV_RegisterVar(&cv_autobrake);
|
||||
CV_RegisterVar(&cv_autobrake2);
|
||||
|
||||
// s_sound.c
|
||||
CV_RegisterVar(&cv_soundvolume);
|
||||
CV_RegisterVar(&cv_closedcaptioning);
|
||||
|
@ -1025,7 +1042,7 @@ static void SetPlayerName(INT32 playernum, char *newname)
|
|||
CONS_Printf(M_GetText("Player %d sent a bad name change\n"), playernum+1);
|
||||
if (server && netgame)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
|
@ -1105,7 +1122,7 @@ static INT32 snacpending = 0, snac2pending = 0, chmappending = 0;
|
|||
//
|
||||
static void SendNameAndColor(void)
|
||||
{
|
||||
XBOXSTATIC char buf[MAXPLAYERNAME+2];
|
||||
char buf[MAXPLAYERNAME+2];
|
||||
char *p;
|
||||
|
||||
p = buf;
|
||||
|
@ -1174,7 +1191,7 @@ static void SendNameAndColor(void)
|
|||
{
|
||||
CV_StealthSetValue(&cv_playercolor, skins[cv_skin.value].prefcolor);
|
||||
|
||||
players[consoleplayer].skincolor = (cv_playercolor.value&0x1F) % MAXSKINCOLORS;
|
||||
players[consoleplayer].skincolor = cv_playercolor.value % MAXSKINCOLORS;
|
||||
|
||||
if (players[consoleplayer].mo)
|
||||
players[consoleplayer].mo->color = (UINT8)players[consoleplayer].skincolor;
|
||||
|
@ -1301,7 +1318,7 @@ static void SendNameAndColor2(void)
|
|||
{
|
||||
CV_StealthSetValue(&cv_playercolor2, skins[players[secondplaya].skin].prefcolor);
|
||||
|
||||
players[secondplaya].skincolor = (cv_playercolor2.value&0x1F) % MAXSKINCOLORS;
|
||||
players[secondplaya].skincolor = cv_playercolor2.value % MAXSKINCOLORS;
|
||||
|
||||
if (players[secondplaya].mo)
|
||||
players[secondplaya].mo->color = players[secondplaya].skincolor;
|
||||
|
@ -1386,7 +1403,7 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
|
|||
|
||||
if (kick)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal color change received from %s (team: %d), color: %d)\n"), player_names[playernum], p->ctfteam, p->skincolor);
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
|
@ -1413,25 +1430,33 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
|
|||
|
||||
void SendWeaponPref(void)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[1];
|
||||
UINT8 buf[1];
|
||||
|
||||
buf[0] = 0;
|
||||
if (players[consoleplayer].pflags & PF_FLIPCAM)
|
||||
buf[0] |= 1;
|
||||
if (players[consoleplayer].pflags & PF_ANALOGMODE)
|
||||
buf[0] |= 2;
|
||||
if (players[consoleplayer].pflags & PF_DIRECTIONCHAR)
|
||||
buf[0] |= 4;
|
||||
if (players[consoleplayer].pflags & PF_AUTOBRAKE)
|
||||
buf[0] |= 8;
|
||||
SendNetXCmd(XD_WEAPONPREF, buf, 1);
|
||||
}
|
||||
|
||||
void SendWeaponPref2(void)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[1];
|
||||
UINT8 buf[1];
|
||||
|
||||
buf[0] = 0;
|
||||
if (players[secondarydisplayplayer].pflags & PF_FLIPCAM)
|
||||
buf[0] |= 1;
|
||||
if (players[secondarydisplayplayer].pflags & PF_ANALOGMODE)
|
||||
buf[0] |= 2;
|
||||
if (players[secondarydisplayplayer].pflags & PF_DIRECTIONCHAR)
|
||||
buf[0] |= 4;
|
||||
if (players[secondarydisplayplayer].pflags & PF_AUTOBRAKE)
|
||||
buf[0] |= 8;
|
||||
SendNetXCmd2(XD_WEAPONPREF, buf, 1);
|
||||
}
|
||||
|
||||
|
@ -1439,11 +1464,15 @@ static void Got_WeaponPref(UINT8 **cp,INT32 playernum)
|
|||
{
|
||||
UINT8 prefs = READUINT8(*cp);
|
||||
|
||||
players[playernum].pflags &= ~(PF_FLIPCAM|PF_ANALOGMODE);
|
||||
players[playernum].pflags &= ~(PF_FLIPCAM|PF_ANALOGMODE|PF_DIRECTIONCHAR|PF_AUTOBRAKE);
|
||||
if (prefs & 1)
|
||||
players[playernum].pflags |= PF_FLIPCAM;
|
||||
if (prefs & 2)
|
||||
players[playernum].pflags |= PF_ANALOGMODE;
|
||||
if (prefs & 4)
|
||||
players[playernum].pflags |= PF_DIRECTIONCHAR;
|
||||
if (prefs & 8)
|
||||
players[playernum].pflags |= PF_AUTOBRAKE;
|
||||
}
|
||||
|
||||
void D_SendPlayerConfig(void)
|
||||
|
@ -1797,7 +1826,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
|
|||
CONS_Alert(CONS_WARNING, M_GetText("Illegal map change received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
|
@ -1874,7 +1903,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
|
|||
|
||||
static void Command_Pause(void)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
UINT8 *cp = buf;
|
||||
|
||||
if (COM_Argc() > 1)
|
||||
|
@ -1910,7 +1939,7 @@ static void Got_Pause(UINT8 **cp, INT32 playernum)
|
|||
CONS_Alert(CONS_WARNING, M_GetText("Illegal pause command received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
|
@ -1953,7 +1982,7 @@ static void Got_Pause(UINT8 **cp, INT32 playernum)
|
|||
// Command for stuck characters in netgames, griefing, etc.
|
||||
static void Command_Suicide(void)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[4];
|
||||
UINT8 buf[4];
|
||||
UINT8 *cp = buf;
|
||||
|
||||
WRITEINT32(cp, consoleplayer);
|
||||
|
@ -1990,7 +2019,7 @@ static void Got_Suicide(UINT8 **cp, INT32 playernum)
|
|||
CONS_Alert(CONS_WARNING, M_GetText("Illegal suicide command received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
|
@ -2059,7 +2088,7 @@ static void Got_Clearscores(UINT8 **cp, INT32 playernum)
|
|||
CONS_Alert(CONS_WARNING, M_GetText("Illegal clear scores command received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
|
@ -2412,7 +2441,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
|||
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
|
@ -2427,7 +2456,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
|||
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
|
@ -2466,7 +2495,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
|||
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
|
@ -2486,7 +2515,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
|||
error = true;
|
||||
break;
|
||||
}
|
||||
//fall down
|
||||
/* FALLTHRU */
|
||||
case GT_TAG:
|
||||
switch (NetPacket.packet.newteam)
|
||||
{
|
||||
|
@ -2519,7 +2548,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
|||
|
||||
if (server && ((NetPacket.packet.newteam < 0 || NetPacket.packet.newteam > 3) || error))
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
|
@ -2550,12 +2579,12 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
|||
{
|
||||
players[playernum].spectator = true;
|
||||
players[playernum].pflags &= ~PF_TAGIT;
|
||||
players[playernum].pflags &= ~PF_TAGGED;
|
||||
players[playernum].pflags &= ~PF_GAMETYPEOVER;
|
||||
}
|
||||
else if (NetPacket.packet.newteam != 3) // .newteam == 1 or 2.
|
||||
{
|
||||
players[playernum].spectator = false;
|
||||
players[playernum].pflags &= ~PF_TAGGED;//Just in case.
|
||||
players[playernum].pflags &= ~PF_GAMETYPEOVER; //Just in case.
|
||||
|
||||
if (NetPacket.packet.newteam == 1) //Make the player IT.
|
||||
players[playernum].pflags |= PF_TAGIT;
|
||||
|
@ -2670,7 +2699,7 @@ static void D_MD5PasswordPass(const UINT8 *buffer, size_t len, const char *salt,
|
|||
(void)salt;
|
||||
memset(dest, 0, 16);
|
||||
#else
|
||||
XBOXSTATIC char tmpbuf[256];
|
||||
char tmpbuf[256];
|
||||
const size_t sl = strlen(salt);
|
||||
|
||||
if (len > 256-sl)
|
||||
|
@ -2725,7 +2754,7 @@ static void Command_Login_f(void)
|
|||
// If we have no MD5 support then completely disable XD_LOGIN responses for security.
|
||||
CONS_Alert(CONS_NOTICE, "Remote administration commands are not supported in this build.\n");
|
||||
#else
|
||||
XBOXSTATIC UINT8 finalmd5[16];
|
||||
UINT8 finalmd5[16];
|
||||
const char *pw;
|
||||
|
||||
// If the server uses login, it will effectively just remove admin privileges
|
||||
|
@ -2779,7 +2808,7 @@ static void Got_Login(UINT8 **cp, INT32 playernum)
|
|||
|
||||
static void Command_Verify_f(void)
|
||||
{
|
||||
XBOXSTATIC char buf[8]; // Should be plenty
|
||||
char buf[8]; // Should be plenty
|
||||
char *temp;
|
||||
INT32 playernum;
|
||||
|
||||
|
@ -2816,7 +2845,7 @@ static void Got_Verification(UINT8 **cp, INT32 playernum)
|
|||
CONS_Alert(CONS_WARNING, M_GetText("Illegal verification received from %s (serverplayer is %s)\n"), player_names[playernum], player_names[serverplayer]);
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
|
@ -2896,7 +2925,7 @@ static void Got_MotD_f(UINT8 **cp, INT32 playernum)
|
|||
CONS_Alert(CONS_WARNING, M_GetText("Illegal motd change received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
|
@ -2917,7 +2946,7 @@ static void Got_MotD_f(UINT8 **cp, INT32 playernum)
|
|||
static void Command_RunSOC(void)
|
||||
{
|
||||
const char *fn;
|
||||
XBOXSTATIC char buf[255];
|
||||
char buf[255];
|
||||
size_t length = 0;
|
||||
|
||||
if (COM_Argc() != 2)
|
||||
|
@ -2959,7 +2988,7 @@ static void Got_RunSOCcmd(UINT8 **cp, INT32 playernum)
|
|||
CONS_Alert(CONS_WARNING, M_GetText("Illegal runsoc command received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
|
@ -3002,7 +3031,7 @@ static void Got_RunSOCcmd(UINT8 **cp, INT32 playernum)
|
|||
static void Command_Addfile(void)
|
||||
{
|
||||
const char *fn, *p;
|
||||
XBOXSTATIC char buf[256];
|
||||
char buf[256];
|
||||
char *buf_p = buf;
|
||||
INT32 i;
|
||||
int musiconly; // W_VerifyNMUSlumps isn't boolean
|
||||
|
@ -3074,42 +3103,6 @@ static void Command_Addfile(void)
|
|||
SendNetXCmd(XD_ADDFILE, buf, buf_p - buf);
|
||||
}
|
||||
|
||||
#ifdef DELFILE
|
||||
/** removes the last added pwad at runtime.
|
||||
* Searches for sounds, maps, music and images to remove
|
||||
*/
|
||||
static void Command_Delfile(void)
|
||||
{
|
||||
if (gamestate == GS_LEVEL)
|
||||
{
|
||||
CONS_Printf(M_GetText("You must NOT be in a level to use this.\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (netgame && !(server || adminplayer == consoleplayer))
|
||||
{
|
||||
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (numwadfiles <= mainwads)
|
||||
{
|
||||
CONS_Printf(M_GetText("No additional WADs are loaded.\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(netgame || multiplayer))
|
||||
{
|
||||
P_DelWadFile();
|
||||
if (mainwads == numwadfiles && modifiedgame)
|
||||
modifiedgame = false;
|
||||
return;
|
||||
}
|
||||
|
||||
SendNetXCmd(XD_DELFILE, NULL, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
|
||||
{
|
||||
char filename[241];
|
||||
|
@ -3138,7 +3131,7 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
|
|||
|
||||
if ((playernum != serverplayer && playernum != adminplayer) || kick)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal addfile command received from %s\n"), player_names[playernum]);
|
||||
|
||||
|
@ -3184,33 +3177,6 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
|
|||
COM_BufAddText(va("addfile %s\n", filename));
|
||||
}
|
||||
|
||||
#ifdef DELFILE
|
||||
static void Got_Delfilecmd(UINT8 **cp, INT32 playernum)
|
||||
{
|
||||
if (playernum != serverplayer && playernum != adminplayer)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal delfile command received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
}
|
||||
return;
|
||||
}
|
||||
(void)cp;
|
||||
|
||||
if (numwadfiles <= mainwads) //sanity
|
||||
return;
|
||||
|
||||
P_DelWadFile();
|
||||
if (mainwads == numwadfiles && modifiedgame)
|
||||
modifiedgame = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void Got_Addfilecmd(UINT8 **cp, INT32 playernum)
|
||||
{
|
||||
char filename[241];
|
||||
|
@ -3225,7 +3191,7 @@ static void Got_Addfilecmd(UINT8 **cp, INT32 playernum)
|
|||
CONS_Alert(CONS_WARNING, M_GetText("Illegal addfile command received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
|
@ -3411,6 +3377,102 @@ static void JoinTimeout_OnChange(void)
|
|||
jointimeout = (tic_t)cv_jointimeout.value;
|
||||
}
|
||||
|
||||
static void CoopStarposts_OnChange(void)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
if (!(netgame || multiplayer) || gametype != GT_COOP)
|
||||
return;
|
||||
|
||||
switch (cv_coopstarposts.value)
|
||||
{
|
||||
case 0:
|
||||
CONS_Printf(M_GetText("Starposts are now per-player.\n"));
|
||||
break;
|
||||
case 1:
|
||||
CONS_Printf(M_GetText("Starposts are now shared between players.\n"));
|
||||
break;
|
||||
case 2:
|
||||
CONS_Printf(M_GetText("Players now only spawn when starposts are hit.\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (G_IsSpecialStage(gamemap))
|
||||
return;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
|
||||
if (!players[i].spectator)
|
||||
continue;
|
||||
|
||||
if (players[i].lives <= 0)
|
||||
continue;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == MAXPLAYERS)
|
||||
return;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
|
||||
if (!players[i].spectator)
|
||||
continue;
|
||||
|
||||
if (players[i].lives <= 0 && (cv_cooplives.value == 1))
|
||||
continue;
|
||||
|
||||
P_SpectatorJoinGame(&players[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static void CoopLives_OnChange(void)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
if (!(netgame || multiplayer) || gametype != GT_COOP)
|
||||
return;
|
||||
|
||||
switch (cv_cooplives.value)
|
||||
{
|
||||
case 0:
|
||||
CONS_Printf(M_GetText("Players can now respawn indefinitely.\n"));
|
||||
return;
|
||||
case 1:
|
||||
CONS_Printf(M_GetText("Lives are now per-player.\n"));
|
||||
return;
|
||||
case 2:
|
||||
CONS_Printf(M_GetText("Players can now steal lives to avoid game over.\n"));
|
||||
break;
|
||||
case 3:
|
||||
CONS_Printf(M_GetText("Lives are now shared between players.\n"));
|
||||
break;
|
||||
}
|
||||
|
||||
if (cv_coopstarposts.value == 2)
|
||||
return;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
|
||||
if (!players[i].spectator)
|
||||
continue;
|
||||
|
||||
if (players[i].lives > 0)
|
||||
continue;
|
||||
|
||||
P_SpectatorJoinGame(&players[i]);
|
||||
}
|
||||
}
|
||||
|
||||
UINT32 timelimitintics = 0;
|
||||
|
||||
/** Deals with a timelimit change by printing the change to the console.
|
||||
|
@ -3699,7 +3761,7 @@ retryscramble:
|
|||
{
|
||||
if (red == maxcomposition)
|
||||
newteam = 2;
|
||||
else if (blue == maxcomposition)
|
||||
else //if (blue == maxcomposition)
|
||||
newteam = 1;
|
||||
|
||||
repick = false;
|
||||
|
@ -3740,14 +3802,11 @@ retryscramble:
|
|||
newteam = (INT16)((M_RandomByte() % 2) + 1);
|
||||
repick = false;
|
||||
}
|
||||
else
|
||||
else if (i != 2) // Mystic's secret sauce - ABBA is better than ABAB, so team B doesn't get worse players all around
|
||||
{
|
||||
// We will only randomly pick the team for the first guy.
|
||||
// Otherwise, just alternate back and forth, distributing players.
|
||||
if (newteam == 1)
|
||||
newteam = 2;
|
||||
else
|
||||
newteam = 1;
|
||||
newteam = 3 - newteam;
|
||||
}
|
||||
|
||||
scrambleteams[i] = newteam;
|
||||
|
@ -3846,7 +3905,7 @@ static void Got_ExitLevelcmd(UINT8 **cp, INT32 playernum)
|
|||
CONS_Alert(CONS_WARNING, M_GetText("Illegal exitlevel command received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
|
|
|
@ -25,6 +25,13 @@ extern consvar_t cv_skin;
|
|||
extern consvar_t cv_playername2;
|
||||
extern consvar_t cv_playercolor2;
|
||||
extern consvar_t cv_skin2;
|
||||
// saved versions of the above six
|
||||
extern consvar_t cv_defaultplayername;
|
||||
extern consvar_t cv_defaultplayercolor;
|
||||
extern consvar_t cv_defaultskin;
|
||||
extern consvar_t cv_defaultplayername2;
|
||||
extern consvar_t cv_defaultplayercolor2;
|
||||
extern consvar_t cv_defaultskin2;
|
||||
|
||||
#ifdef SEENAMES
|
||||
extern consvar_t cv_seenames, cv_allowseenames;
|
||||
|
@ -89,7 +96,7 @@ extern consvar_t cv_recycler;
|
|||
|
||||
extern consvar_t cv_itemfinder;
|
||||
|
||||
extern consvar_t cv_inttime, cv_advancemap, cv_playersforexit;
|
||||
extern consvar_t cv_inttime, cv_coopstarposts, cv_cooplives, cv_advancemap, cv_playersforexit;
|
||||
extern consvar_t cv_overtime;
|
||||
extern consvar_t cv_startinglives;
|
||||
|
||||
|
@ -129,7 +136,7 @@ typedef enum
|
|||
XD_RANDOMSEED, // 15
|
||||
XD_RUNSOC, // 16
|
||||
XD_REQADDFILE, // 17
|
||||
XD_DELFILE, // 18
|
||||
XD_DELFILE, // 18 - replace next time we add an XD
|
||||
XD_SETMOTD, // 19
|
||||
XD_SUICIDE, // 20
|
||||
#ifdef HAVE_BLUA
|
||||
|
|
|
@ -11,21 +11,14 @@
|
|||
/// \brief Transfer a file using HSendPacket.
|
||||
|
||||
#include <stdio.h>
|
||||
#ifndef _WIN32_WCE
|
||||
#ifdef __OS2__
|
||||
#include <sys/types.h>
|
||||
#endif // __OS2__
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#if !defined (UNDER_CE)
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#if ((defined (_WIN32) && !defined (_WIN32_WCE)) || defined (__DJGPP__)) && !defined (_XBOX)
|
||||
#if defined (_WIN32) || defined (__DJGPP__)
|
||||
#include <io.h>
|
||||
#include <direct.h>
|
||||
#elif !defined (_WIN32_WCE) && !(defined (_XBOX) && !defined (__GNUC__))
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
#include <utime.h>
|
||||
|
@ -34,7 +27,7 @@
|
|||
#ifdef __GNUC__
|
||||
#include <unistd.h>
|
||||
#include <limits.h>
|
||||
#elif defined (_WIN32) && !defined (_WIN32_WCE)
|
||||
#elif defined (_WIN32)
|
||||
#include <sys/utime.h>
|
||||
#endif
|
||||
#ifdef __DJGPP__
|
||||
|
@ -104,6 +97,7 @@ INT32 lastfilenum = -1;
|
|||
/** Fills a serverinfo packet with information about wad files loaded.
|
||||
*
|
||||
* \todo Give this function a better name since it is in global scope.
|
||||
* Used to have size limiting built in - now handled via W_LoadWadFile in w_wad.c
|
||||
*
|
||||
*/
|
||||
UINT8 *PutFileNeeded(void)
|
||||
|
@ -112,29 +106,22 @@ UINT8 *PutFileNeeded(void)
|
|||
UINT8 *p = netbuffer->u.serverinfo.fileneeded;
|
||||
char wadfilename[MAX_WADPATH] = "";
|
||||
UINT8 filestatus;
|
||||
size_t bytesused = 0;
|
||||
|
||||
for (i = 0; i < numwadfiles; i++)
|
||||
{
|
||||
// If it has only music/sound lumps, mark it as unimportant
|
||||
if (W_VerifyNMUSlumps(wadfiles[i]->filename))
|
||||
filestatus = 0;
|
||||
else
|
||||
filestatus = 1; // Important
|
||||
// If it has only music/sound lumps, don't put it in the list
|
||||
if (!wadfiles[i]->important)
|
||||
continue;
|
||||
|
||||
filestatus = 1; // Importance - not really used any more, holds 1 by default for backwards compat with MS
|
||||
|
||||
// Store in the upper four bits
|
||||
if (!cv_downloading.value)
|
||||
filestatus += (2 << 4); // Won't send
|
||||
else if ((wadfiles[i]->filesize > (UINT32)cv_maxsend.value * 1024))
|
||||
filestatus += (0 << 4); // Won't send
|
||||
else
|
||||
else if ((wadfiles[i]->filesize <= (UINT32)cv_maxsend.value * 1024))
|
||||
filestatus += (1 << 4); // Will send if requested
|
||||
|
||||
bytesused += (nameonlylength(wadfilename) + 22);
|
||||
|
||||
// Don't write too far...
|
||||
if (bytesused > sizeof(netbuffer->u.serverinfo.fileneeded))
|
||||
I_Error("Too many wad files added to host a game. (%s, stopped on %s)\n", sizeu1(bytesused), wadfilename);
|
||||
// else
|
||||
// filestatus += (0 << 4); -- Won't send, too big
|
||||
|
||||
WRITEUINT8(p, filestatus);
|
||||
|
||||
|
@ -167,7 +154,6 @@ void D_ParseFileneeded(INT32 fileneedednum_parm, UINT8 *fileneededstr)
|
|||
{
|
||||
fileneeded[i].status = FS_NOTFOUND; // We haven't even started looking for the file yet
|
||||
filestatus = READUINT8(p); // The first byte is the file status
|
||||
fileneeded[i].important = (UINT8)(filestatus & 3);
|
||||
fileneeded[i].willsend = (UINT8)(filestatus >> 4);
|
||||
fileneeded[i].totalsize = READUINT32(p); // The four next bytes are the file size
|
||||
fileneeded[i].file = NULL; // The file isn't open yet
|
||||
|
@ -197,7 +183,7 @@ boolean CL_CheckDownloadable(void)
|
|||
UINT8 i,dlstatus = 0;
|
||||
|
||||
for (i = 0; i < fileneedednum; i++)
|
||||
if (fileneeded[i].status != FS_FOUND && fileneeded[i].status != FS_OPEN && fileneeded[i].important)
|
||||
if (fileneeded[i].status != FS_FOUND && fileneeded[i].status != FS_OPEN)
|
||||
{
|
||||
if (fileneeded[i].willsend == 1)
|
||||
continue;
|
||||
|
@ -218,7 +204,7 @@ boolean CL_CheckDownloadable(void)
|
|||
// not downloadable, put reason in console
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("You need additional files to connect to this server:\n"));
|
||||
for (i = 0; i < fileneedednum; i++)
|
||||
if (fileneeded[i].status != FS_FOUND && fileneeded[i].status != FS_OPEN && fileneeded[i].important)
|
||||
if (fileneeded[i].status != FS_FOUND && fileneeded[i].status != FS_OPEN)
|
||||
{
|
||||
CONS_Printf(" * \"%s\" (%dK)", fileneeded[i].filename, fileneeded[i].totalsize >> 10);
|
||||
|
||||
|
@ -271,7 +257,7 @@ boolean CL_SendRequestFile(void)
|
|||
|
||||
for (i = 0; i < fileneedednum; i++)
|
||||
if (fileneeded[i].status != FS_FOUND && fileneeded[i].status != FS_OPEN
|
||||
&& fileneeded[i].important && (fileneeded[i].willsend == 0 || fileneeded[i].willsend == 2))
|
||||
&& (fileneeded[i].willsend == 0 || fileneeded[i].willsend == 2))
|
||||
{
|
||||
I_Error("Attempted to download files that were not sendable");
|
||||
}
|
||||
|
@ -280,8 +266,7 @@ boolean CL_SendRequestFile(void)
|
|||
netbuffer->packettype = PT_REQUESTFILE;
|
||||
p = (char *)netbuffer->u.textcmd;
|
||||
for (i = 0; i < fileneedednum; i++)
|
||||
if ((fileneeded[i].status == FS_NOTFOUND || fileneeded[i].status == FS_MD5SUMBAD)
|
||||
&& fileneeded[i].important)
|
||||
if ((fileneeded[i].status == FS_NOTFOUND || fileneeded[i].status == FS_MD5SUMBAD))
|
||||
{
|
||||
totalfreespaceneeded += fileneeded[i].totalsize;
|
||||
nameonly(fileneeded[i].filename);
|
||||
|
@ -360,15 +345,9 @@ INT32 CL_CheckFiles(void)
|
|||
CONS_Debug(DBG_NETPLAY, "game is modified; only doing basic checks\n");
|
||||
for (i = 1, j = 1; i < fileneedednum || j < numwadfiles;)
|
||||
{
|
||||
if (i < fileneedednum && !fileneeded[i].important)
|
||||
if (j < numwadfiles && !wadfiles[j]->important)
|
||||
{
|
||||
// Eh whatever, don't care
|
||||
++i;
|
||||
continue;
|
||||
}
|
||||
if (j < numwadfiles && W_VerifyNMUSlumps(wadfiles[j]->filename))
|
||||
{
|
||||
// Unimportant on our side. still don't care.
|
||||
// Unimportant on our side.
|
||||
++j;
|
||||
continue;
|
||||
}
|
||||
|
@ -411,7 +390,7 @@ INT32 CL_CheckFiles(void)
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (fileneeded[i].status != FS_NOTFOUND || !fileneeded[i].important)
|
||||
if (fileneeded[i].status != FS_NOTFOUND)
|
||||
continue;
|
||||
|
||||
packetsize += nameonlylength(fileneeded[i].filename) + 22;
|
||||
|
@ -449,27 +428,8 @@ void CL_LoadServerFiles(void)
|
|||
fileneeded[i].status = FS_OPEN;
|
||||
}
|
||||
else if (fileneeded[i].status == FS_MD5SUMBAD)
|
||||
{
|
||||
// If the file is marked important, don't even bother proceeding.
|
||||
if (fileneeded[i].important)
|
||||
I_Error("Wrong version of important file %s", fileneeded[i].filename);
|
||||
|
||||
// If it isn't, no need to worry the user with a console message,
|
||||
// although it can't hurt to put something in the debug file.
|
||||
|
||||
// ...but wait a second. What if the local version is "important"?
|
||||
if (!W_VerifyNMUSlumps(fileneeded[i].filename))
|
||||
I_Error("File %s should only contain music and sound effects!",
|
||||
fileneeded[i].filename);
|
||||
|
||||
// Okay, NOW we know it's safe. Whew.
|
||||
P_AddWadFile(fileneeded[i].filename, NULL);
|
||||
if (fileneeded[i].important)
|
||||
G_SetGameModified(true);
|
||||
fileneeded[i].status = FS_OPEN;
|
||||
DEBFILE(va("File %s found but with different md5sum\n", fileneeded[i].filename));
|
||||
}
|
||||
else if (fileneeded[i].important)
|
||||
I_Error("Wrong version of file %s", fileneeded[i].filename);
|
||||
else
|
||||
{
|
||||
const char *s;
|
||||
switch(fileneeded[i].status)
|
||||
|
@ -965,7 +925,7 @@ size_t nameonlylength(const char *s)
|
|||
|
||||
filestatus_t checkfilemd5(char *filename, const UINT8 *wantedmd5sum)
|
||||
{
|
||||
#if defined (NOMD5) || defined (_arch_dreamcast)
|
||||
#if defined (NOMD5)
|
||||
(void)wantedmd5sum;
|
||||
(void)filename;
|
||||
#else
|
||||
|
@ -1000,9 +960,5 @@ filestatus_t findfile(char *filename, const UINT8 *wantedmd5sum, boolean complet
|
|||
if (homecheck == FS_FOUND)
|
||||
return filesearch(filename, srb2path, wantedmd5sum, completepath, 10);
|
||||
|
||||
#ifdef _arch_dreamcast
|
||||
return filesearch(filename, "/cd", wantedmd5sum, completepath, 10);
|
||||
#else
|
||||
return filesearch(filename, ".", wantedmd5sum, completepath, 10);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -35,7 +35,6 @@ typedef enum
|
|||
|
||||
typedef struct
|
||||
{
|
||||
UINT8 important;
|
||||
UINT8 willsend; // Is the server willing to send it?
|
||||
char filename[MAX_WADPATH];
|
||||
UINT8 md5sum[16];
|
||||
|
|
106
src/d_player.h
106
src/d_player.h
|
@ -98,66 +98,58 @@ typedef enum
|
|||
//
|
||||
typedef enum
|
||||
{
|
||||
// Flip camera angle with gravity flip prefrence.
|
||||
PF_FLIPCAM = 1,
|
||||
// Cvars
|
||||
PF_FLIPCAM = 1, // Flip camera angle with gravity flip prefrence.
|
||||
PF_ANALOGMODE = 1<<1, // Analog mode?
|
||||
PF_DIRECTIONCHAR = 1<<2, // Directional character sprites?
|
||||
PF_AUTOBRAKE = 1<<3, // Autobrake?
|
||||
|
||||
// Cheats
|
||||
PF_GODMODE = 1<<1,
|
||||
PF_NOCLIP = 1<<2,
|
||||
PF_INVIS = 1<<3,
|
||||
PF_GODMODE = 1<<4,
|
||||
PF_NOCLIP = 1<<5,
|
||||
PF_INVIS = 1<<6,
|
||||
|
||||
// True if button down last tic.
|
||||
PF_ATTACKDOWN = 1<<4,
|
||||
PF_USEDOWN = 1<<5,
|
||||
PF_JUMPDOWN = 1<<6,
|
||||
PF_WPNDOWN = 1<<7,
|
||||
PF_ATTACKDOWN = 1<<7,
|
||||
PF_USEDOWN = 1<<8,
|
||||
PF_JUMPDOWN = 1<<9,
|
||||
PF_WPNDOWN = 1<<10,
|
||||
|
||||
// Unmoving states
|
||||
PF_STASIS = 1<<8, // Player is not allowed to move
|
||||
PF_JUMPSTASIS = 1<<9, // and that includes jumping.
|
||||
PF_STASIS = 1<<11, // Player is not allowed to move
|
||||
PF_JUMPSTASIS = 1<<12, // and that includes jumping.
|
||||
PF_FULLSTASIS = PF_STASIS|PF_JUMPSTASIS,
|
||||
|
||||
// Did you get a time-over?
|
||||
PF_TIMEOVER = 1<<10,
|
||||
// Applying autobrake?
|
||||
PF_APPLYAUTOBRAKE = 1<<13,
|
||||
|
||||
// Character action status
|
||||
PF_STARTJUMP = 1<<11,
|
||||
PF_JUMPED = 1<<12,
|
||||
PF_SPINNING = 1<<13,
|
||||
PF_STARTDASH = 1<<14,
|
||||
PF_THOKKED = 1<<15,
|
||||
PF_STARTJUMP = 1<<14,
|
||||
PF_JUMPED = 1<<15,
|
||||
PF_NOJUMPDAMAGE = 1<<16,
|
||||
|
||||
// Are you gliding?
|
||||
PF_GLIDING = 1<<16,
|
||||
PF_SPINNING = 1<<17,
|
||||
PF_STARTDASH = 1<<18,
|
||||
|
||||
PF_THOKKED = 1<<19,
|
||||
PF_SHIELDABILITY = 1<<20,
|
||||
PF_GLIDING = 1<<21,
|
||||
PF_BOUNCING = 1<<22,
|
||||
|
||||
// Sliding (usually in water) like Labyrinth/Oil Ocean
|
||||
PF_SLIDING = 1<<17,
|
||||
PF_SLIDING = 1<<23,
|
||||
|
||||
// Bouncing
|
||||
PF_BOUNCING = 1<<18,
|
||||
// NiGHTS stuff
|
||||
PF_TRANSFERTOCLOSEST = 1<<24,
|
||||
PF_DRILLING = 1<<25,
|
||||
|
||||
/*** NIGHTS STUFF ***/
|
||||
PF_TRANSFERTOCLOSEST = 1<<19,
|
||||
PF_NIGHTSFALL = 1<<20,
|
||||
PF_DRILLING = 1<<21,
|
||||
PF_SKIDDOWN = 1<<22,
|
||||
|
||||
/*** TAG STUFF ***/
|
||||
PF_TAGGED = 1<<23, // Player has been tagged and awaits the next round in hide and seek.
|
||||
PF_TAGIT = 1<<24, // The player is it! For Tag Mode
|
||||
// Gametype-specific stuff
|
||||
PF_GAMETYPEOVER = 1<<26, // Race time over, or H&S out-of-game
|
||||
PF_TAGIT = 1<<27, // The player is it! For Tag Mode
|
||||
|
||||
/*** misc ***/
|
||||
PF_FORCESTRAFE = 1<<25, // Turning inputs are translated into strafing inputs
|
||||
PF_ANALOGMODE = 1<<26, // Analog mode?
|
||||
|
||||
// Can carry another player?
|
||||
PF_CANCARRY = 1<<27,
|
||||
|
||||
// Used shield ability
|
||||
PF_SHIELDABILITY = 1<<28,
|
||||
|
||||
// Jump damage?
|
||||
PF_NOJUMPDAMAGE = 1<<29,
|
||||
PF_FORCESTRAFE = 1<<28, // Turning inputs are translated into strafing inputs
|
||||
PF_CANCARRY = 1<<29, // Can carry another player?
|
||||
|
||||
// up to 1<<31 is free
|
||||
} pflags_t;
|
||||
|
@ -181,6 +173,14 @@ typedef enum
|
|||
PA_RIDE
|
||||
} panim_t;
|
||||
|
||||
//
|
||||
// All of the base srb2 shields are either a single constant,
|
||||
// or use damagetype-protecting flags applied to a constant,
|
||||
// or are the force shield (which does everything weirdly).
|
||||
//
|
||||
// Base flags by themselves aren't used so modders can make
|
||||
// abstract, ability-less shields should they so choose.
|
||||
//
|
||||
typedef enum
|
||||
{
|
||||
SH_NONE = 0,
|
||||
|
@ -189,19 +189,21 @@ typedef enum
|
|||
SH_PROTECTFIRE = 0x400,
|
||||
SH_PROTECTWATER = 0x800,
|
||||
SH_PROTECTELECTRIC = 0x1000,
|
||||
SH_PROTECTSPIKE = 0x2000, // cactus shield one day? thanks, subarashii
|
||||
//SH_PROTECTNUKE = 0x4000, // intentionally no hardcoded defense against nukes
|
||||
|
||||
// Indivisible shields
|
||||
SH_PITY = 1, // the world's most basic shield ever, given to players who suck at Match
|
||||
SH_WHIRLWIND,
|
||||
SH_ARMAGEDDON,
|
||||
|
||||
// normal shields that use flags
|
||||
SH_ATTRACT = SH_PROTECTELECTRIC,
|
||||
SH_ELEMENTAL = SH_PROTECTFIRE|SH_PROTECTWATER,
|
||||
// Normal shields that use flags
|
||||
SH_ATTRACT = SH_PITY|SH_PROTECTELECTRIC,
|
||||
SH_ELEMENTAL = SH_PITY|SH_PROTECTFIRE|SH_PROTECTWATER,
|
||||
|
||||
// Sonic 3 shields
|
||||
SH_FLAMEAURA = SH_PROTECTFIRE,
|
||||
SH_BUBBLEWRAP = SH_PROTECTWATER,
|
||||
SH_FLAMEAURA = SH_PITY|SH_PROTECTFIRE,
|
||||
SH_BUBBLEWRAP = SH_PITY|SH_PROTECTWATER,
|
||||
SH_THUNDERCOIN = SH_WHIRLWIND|SH_PROTECTELECTRIC,
|
||||
|
||||
// The force shield uses the lower 8 bits to count how many extra hits are left.
|
||||
|
@ -224,6 +226,7 @@ typedef enum
|
|||
CR_PLAYER,
|
||||
// NiGHTS mode. Not technically a CARRYING, but doesn't stack with any of the others, so might as well go here.
|
||||
CR_NIGHTSMODE,
|
||||
CR_NIGHTSFALL,
|
||||
// Old Brak sucks hard, but this gimmick could be used for something better, so we might as well continue supporting it.
|
||||
CR_BRAKGOOP,
|
||||
// Specific level gimmicks.
|
||||
|
@ -244,6 +247,7 @@ typedef enum
|
|||
pw_underwater, // underwater timer
|
||||
pw_spacetime, // In space, no one can hear you spin!
|
||||
pw_extralife, // Extra Life timer
|
||||
pw_pushing,
|
||||
|
||||
pw_super, // Are you super?
|
||||
pw_gravityboots, // gravity boots
|
||||
|
@ -316,6 +320,9 @@ typedef struct player_s
|
|||
// It is updated with cmd->aiming.
|
||||
angle_t aiming;
|
||||
|
||||
// fun thing for player sprite
|
||||
angle_t drawangle;
|
||||
|
||||
// player's ring count
|
||||
INT32 rings;
|
||||
|
||||
|
@ -362,6 +369,8 @@ typedef struct player_s
|
|||
mobjtype_t thokitem; // Object # to spawn for the thok
|
||||
mobjtype_t spinitem; // Object # to spawn for spindash/spinning
|
||||
mobjtype_t revitem; // Object # to spawn for spindash/spinning
|
||||
mobjtype_t followitem; // Object # to spawn for Smiles
|
||||
mobj_t *followmobj; // Smiles all around
|
||||
|
||||
fixed_t actionspd; // Speed of thok/glide/fly
|
||||
fixed_t mindash; // Minimum spindash speed
|
||||
|
@ -471,6 +480,7 @@ typedef struct player_s
|
|||
angle_t awayviewaiming; // Used for cut-away view
|
||||
|
||||
boolean spectator;
|
||||
boolean outofcoop;
|
||||
UINT8 bot;
|
||||
|
||||
tic_t jointime; // Timer when player joins game to change skin/color
|
||||
|
|
769
src/dehacked.c
769
src/dehacked.c
File diff suppressed because it is too large
Load diff
|
@ -27,13 +27,6 @@ typedef enum
|
|||
UNDO_DONE = 0,
|
||||
} undotype_f;
|
||||
|
||||
#ifdef DELFILE
|
||||
void DEH_WriteUndoline(const char *value, const char *data, undotype_f flags);
|
||||
void DEH_UnloadDehackedWad(UINT16 wad);
|
||||
#else // null the undo lines
|
||||
#define DEH_WriteUndoline(a,b,c)
|
||||
#endif
|
||||
|
||||
void DEH_LoadDehackedLump(lumpnum_t lumpnum);
|
||||
void DEH_LoadDehackedLumpPwad(UINT16 wad, UINT16 lump);
|
||||
|
||||
|
|
|
@ -207,8 +207,9 @@ typedef struct
|
|||
|
||||
#define ZSHIFT 4
|
||||
|
||||
extern const UINT8 Color_Index[MAXTRANSLATIONS-1][16];
|
||||
extern const char *Color_Names[MAXSKINCOLORS + NUMSUPERCOLORS];
|
||||
extern const UINT8 Color_Opposite[MAXSKINCOLORS*2];
|
||||
extern const UINT8 Color_Opposite[(MAXSKINCOLORS - 1)*2];
|
||||
|
||||
#define NUMMAPS 1035
|
||||
|
||||
|
|
102
src/doomdef.h
102
src/doomdef.h
|
@ -28,13 +28,11 @@
|
|||
|
||||
// Use Mixer interface?
|
||||
#ifdef HAVE_MIXER
|
||||
//#if !defined(DC) && !defined(_WIN32_WCE) && !defined(_XBOX) && !defined(GP2X)
|
||||
#define SOUND SOUND_MIXER
|
||||
#define NOHS // No HW3SOUND
|
||||
#ifdef HW3SOUND
|
||||
#undef HW3SOUND
|
||||
#endif
|
||||
//#endif
|
||||
#endif
|
||||
|
||||
// Use generic SDL interface.
|
||||
|
@ -70,7 +68,7 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (_WIN32) || defined (_WIN32_WCE)
|
||||
#ifdef _WIN32
|
||||
#define ASMCALL __cdecl
|
||||
#else
|
||||
#define ASMCALL
|
||||
|
@ -87,13 +85,6 @@
|
|||
// warning C4152: nonstandard extension, function/data pointer conversion in expression
|
||||
// warning C4213: nonstandard extension used : cast on l-value
|
||||
|
||||
#if defined (_WIN32_WCE) && defined (DEBUG) && defined (ARM)
|
||||
#if defined (ARMV4) || defined (ARMV4I)
|
||||
//#pragma warning(disable : 1166)
|
||||
// warning LNK1166: cannot adjust code at offset=
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#include "doomtype.h"
|
||||
|
||||
|
@ -110,13 +101,11 @@
|
|||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
#if !defined (_WIN32_WCE)
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
|
||||
#if ((defined (_WIN32) && !defined (_WIN32_WCE)) || defined (__DJGPP__)) && !defined (_XBOX)
|
||||
#if defined (_WIN32) || defined (__DJGPP__)
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
|
@ -229,39 +218,77 @@ extern FILE *logstream;
|
|||
typedef enum
|
||||
{
|
||||
SKINCOLOR_NONE = 0,
|
||||
|
||||
// Greyscale ranges
|
||||
SKINCOLOR_WHITE,
|
||||
SKINCOLOR_SILVER,
|
||||
SKINCOLOR_BONE,
|
||||
SKINCOLOR_CLOUDY,
|
||||
SKINCOLOR_GREY,
|
||||
SKINCOLOR_SILVER,
|
||||
SKINCOLOR_CARBON,
|
||||
SKINCOLOR_JET,
|
||||
SKINCOLOR_BLACK,
|
||||
SKINCOLOR_BEIGE,
|
||||
SKINCOLOR_PEACH,
|
||||
|
||||
// Desaturated
|
||||
SKINCOLOR_AETHER,
|
||||
SKINCOLOR_SLATE,
|
||||
SKINCOLOR_PINK,
|
||||
SKINCOLOR_YOGURT,
|
||||
SKINCOLOR_BROWN,
|
||||
SKINCOLOR_TAN,
|
||||
SKINCOLOR_BEIGE,
|
||||
SKINCOLOR_MOSS,
|
||||
SKINCOLOR_AZURE,
|
||||
SKINCOLOR_LAVENDER,
|
||||
|
||||
// Viv's vivid colours (toast 21/07/17)
|
||||
SKINCOLOR_RUBY,
|
||||
SKINCOLOR_SALMON,
|
||||
SKINCOLOR_RED,
|
||||
SKINCOLOR_CRIMSON,
|
||||
SKINCOLOR_FLAME,
|
||||
SKINCOLOR_PEACHY,
|
||||
SKINCOLOR_QUAIL,
|
||||
SKINCOLOR_SUNSET,
|
||||
SKINCOLOR_APRICOT,
|
||||
SKINCOLOR_ORANGE,
|
||||
SKINCOLOR_RUST,
|
||||
SKINCOLOR_GOLD,
|
||||
SKINCOLOR_SANDY,
|
||||
SKINCOLOR_YELLOW,
|
||||
SKINCOLOR_TAN,
|
||||
SKINCOLOR_MOSS,
|
||||
SKINCOLOR_OLIVE,
|
||||
SKINCOLOR_LIME,
|
||||
SKINCOLOR_PERIDOT,
|
||||
SKINCOLOR_GREEN,
|
||||
SKINCOLOR_FOREST,
|
||||
SKINCOLOR_EMERALD,
|
||||
SKINCOLOR_MINT,
|
||||
SKINCOLOR_SEAFOAM,
|
||||
SKINCOLOR_AQUA,
|
||||
SKINCOLOR_TEAL,
|
||||
SKINCOLOR_WAVE,
|
||||
SKINCOLOR_CYAN,
|
||||
SKINCOLOR_SKY,
|
||||
SKINCOLOR_CERULEAN,
|
||||
SKINCOLOR_ICY,
|
||||
SKINCOLOR_SAPPHIRE, // sweet mother, i cannot weave – slender aphrodite has overcome me with longing for a girl
|
||||
SKINCOLOR_CORNFLOWER,
|
||||
SKINCOLOR_BLUE,
|
||||
SKINCOLOR_AZURE,
|
||||
SKINCOLOR_COBALT,
|
||||
SKINCOLOR_VAPOR,
|
||||
SKINCOLOR_DUSK,
|
||||
SKINCOLOR_PASTEL,
|
||||
SKINCOLOR_PURPLE,
|
||||
SKINCOLOR_LAVENDER,
|
||||
SKINCOLOR_BUBBLEGUM,
|
||||
SKINCOLOR_MAGENTA,
|
||||
SKINCOLOR_PINK,
|
||||
SKINCOLOR_NEON,
|
||||
SKINCOLOR_VIOLET,
|
||||
SKINCOLOR_LILAC,
|
||||
SKINCOLOR_PLUM,
|
||||
SKINCOLOR_ROSY,
|
||||
//SKINCOLOR_?
|
||||
//SKINCOLOR_?
|
||||
|
||||
// Careful! MAXSKINCOLORS cannot be greater than 0x20! Two slots left...
|
||||
// SKINCOLOR_? - one left before we bump up against 0x39, which isn't a HARD limit anymore but would be excessive
|
||||
|
||||
MAXSKINCOLORS,
|
||||
|
||||
// Super special awesome Super flashing colors!
|
||||
|
@ -295,11 +322,11 @@ typedef enum
|
|||
SKINCOLOR_SUPERPERIDOT4,
|
||||
SKINCOLOR_SUPERPERIDOT5,
|
||||
|
||||
SKINCOLOR_SUPERCYAN1,
|
||||
SKINCOLOR_SUPERCYAN2,
|
||||
SKINCOLOR_SUPERCYAN3,
|
||||
SKINCOLOR_SUPERCYAN4,
|
||||
SKINCOLOR_SUPERCYAN5,
|
||||
SKINCOLOR_SUPERSKY1,
|
||||
SKINCOLOR_SUPERSKY2,
|
||||
SKINCOLOR_SUPERSKY3,
|
||||
SKINCOLOR_SUPERSKY4,
|
||||
SKINCOLOR_SUPERSKY5,
|
||||
|
||||
SKINCOLOR_SUPERPURPLE1,
|
||||
SKINCOLOR_SUPERPURPLE2,
|
||||
|
@ -343,13 +370,11 @@ enum {
|
|||
};
|
||||
|
||||
// Name of local directory for config files and savegames
|
||||
#if !defined(_arch_dreamcast) && !defined(_WIN32_WCE) && !defined(GP2X) && !defined(_WII) && !defined(_PS3)
|
||||
#if (((defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON)) && !defined (__CYGWIN__)) && !defined (__APPLE__)
|
||||
#define DEFAULTDIR ".srb2"
|
||||
#else
|
||||
#define DEFAULTDIR "srb2"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "g_state.h"
|
||||
|
||||
|
@ -483,10 +508,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
|||
#define ESLOPE_TYPESHIM
|
||||
#endif
|
||||
|
||||
/// Delete file while the game is running.
|
||||
/// \note EXTREMELY buggy, tends to crash game.
|
||||
//#define DELFILE
|
||||
|
||||
/// Allows the use of devmode in multiplayer. AKA "fishcake"
|
||||
//#define NETGAME_DEVMODE
|
||||
|
||||
|
@ -514,19 +535,15 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
|||
/// Most modifications should probably enable this.
|
||||
//#define SAVEGAME_OTHERVERSIONS
|
||||
|
||||
#if !defined (_NDS) && !defined (_PSP)
|
||||
/// Shuffle's incomplete OpenGL sorting code.
|
||||
#define SHUFFLE // This has nothing to do with sorting, why was it disabled?
|
||||
#endif
|
||||
|
||||
#if !defined (_NDS) && !defined (_PSP)
|
||||
/// Allow the use of the SOC RESETINFO command.
|
||||
/// \note Builds that are tight on memory should disable this.
|
||||
/// This stops the game from storing backups of the states, sprites, and mobjinfo tables.
|
||||
/// Though this info is compressed under normal circumstances, it's still a lot of extra
|
||||
/// memory that never gets touched.
|
||||
#define ALLOW_RESETDATA
|
||||
#endif
|
||||
|
||||
#ifndef NONET
|
||||
/// Display a connection screen on join attempts.
|
||||
|
@ -546,6 +563,13 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
|||
/// Hudname padding.
|
||||
#define SKINNAMEPADDING
|
||||
|
||||
/// FINALLY some real clipping that doesn't make walls dissappear AND speeds the game up
|
||||
/// (that was the original comment from SRB2CB, sadly it is a lie and actually slows game down)
|
||||
/// on the bright side it fixes some weird issues with translucent walls
|
||||
/// \note SRB2CB port.
|
||||
/// SRB2CB itself ported this from PrBoom+
|
||||
#define NEWCLIP
|
||||
|
||||
/// Handle touching sector specials in P_PlayerAfterThink instead of P_PlayerThink.
|
||||
/// \note Required for proper collision with moving sloped surfaces that have sector specials on them.
|
||||
//#define SECTORSPECIALSAFTERTHINK
|
||||
|
|
|
@ -41,9 +41,14 @@ extern INT16 maptol;
|
|||
extern UINT8 globalweather;
|
||||
extern INT32 curWeather;
|
||||
extern INT32 cursaveslot;
|
||||
extern INT16 lastmapsaved;
|
||||
//extern INT16 lastmapsaved;
|
||||
extern INT16 lastmaploaded;
|
||||
extern boolean gamecomplete;
|
||||
|
||||
#define maxgameovers 13
|
||||
extern UINT8 numgameovers;
|
||||
extern SINT8 startinglivesbalance[maxgameovers+1];
|
||||
|
||||
#define PRECIP_NONE 0
|
||||
#define PRECIP_STORM 1
|
||||
#define PRECIP_SNOW 2
|
||||
|
@ -124,6 +129,10 @@ extern INT16 spstage_start;
|
|||
extern INT16 sstage_start;
|
||||
extern INT16 sstage_end;
|
||||
|
||||
extern INT16 titlemap;
|
||||
extern boolean hidetitlepics;
|
||||
extern INT16 bootmap; //bootmap for loading a map on startup
|
||||
|
||||
extern boolean looptitle;
|
||||
extern boolean useNightsSS;
|
||||
|
||||
|
@ -263,6 +272,7 @@ typedef struct
|
|||
#define LF_NOSSMUSIC 4 ///< Disable Super Sonic music
|
||||
#define LF_NORELOAD 8 ///< Don't reload level on death
|
||||
#define LF_NOZONE 16 ///< Don't include "ZONE" on level title
|
||||
#define LF_SAVEGAME 32 ///< Save the game upon loading this level
|
||||
|
||||
#define LF2_HIDEINMENU 1 ///< Hide in the multiplayer menu
|
||||
#define LF2_HIDEINSTATS 2 ///< Hide in the statistics screen
|
||||
|
|
|
@ -17,16 +17,12 @@
|
|||
#ifndef __DOOMTYPE__
|
||||
#define __DOOMTYPE__
|
||||
|
||||
#if (defined (_WIN32) && !defined (_XBOX)) || (defined (_WIN32_WCE) && !defined (__GNUC__))
|
||||
#ifdef _WIN32
|
||||
//#define WIN32_LEAN_AND_MEAN
|
||||
#define RPC_NO_WINDOWS_H
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifdef _NDS
|
||||
#include <nds.h>
|
||||
#endif
|
||||
|
||||
/* 7.18.1.1 Exact-width integer types */
|
||||
#ifdef _MSC_VER
|
||||
#define UINT8 unsigned __int8
|
||||
|
@ -51,19 +47,6 @@ typedef long ssize_t;
|
|||
#if ((_MSC_VER <= 1200) && (!defined(PDWORD_PTR)))
|
||||
#define PDWORD_PTR PDWORD
|
||||
#endif
|
||||
#elif defined (_arch_dreamcast) // KOS Dreamcast
|
||||
#include <arch/types.h>
|
||||
|
||||
#define UINT8 unsigned char
|
||||
#define SINT8 signed char
|
||||
|
||||
#define UINT16 uint16
|
||||
#define INT16 int16
|
||||
|
||||
#define INT32 int
|
||||
#define UINT32 unsigned int
|
||||
#define INT64 int64
|
||||
#define UINT64 uint64
|
||||
#elif defined (__DJGPP__)
|
||||
#define UINT8 unsigned char
|
||||
#define SINT8 signed char
|
||||
|
@ -97,15 +80,13 @@ typedef long ssize_t;
|
|||
#define NOIPX
|
||||
#endif
|
||||
|
||||
#if defined (_MSC_VER) || defined (__OS2__)
|
||||
// Microsoft VisualC++
|
||||
#ifdef _MSC_VER
|
||||
// Microsoft VisualC++
|
||||
#if (_MSC_VER <= 1800) // MSVC 2013 and back
|
||||
#define snprintf _snprintf
|
||||
#if (_MSC_VER <= 1200) // MSVC 2012 and back
|
||||
#define vsnprintf _vsnprintf
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#define strncasecmp strnicmp
|
||||
#define strcasecmp stricmp
|
||||
|
@ -118,23 +99,12 @@ typedef long ssize_t;
|
|||
#define strncasecmp strnicmp
|
||||
#define strcasecmp strcmpi
|
||||
#endif
|
||||
#ifdef _PSP
|
||||
#include <malloc.h>
|
||||
#elif (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
#if (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
#undef stricmp
|
||||
#define stricmp(x,y) strcasecmp(x,y)
|
||||
#undef strnicmp
|
||||
#define strnicmp(x,y,n) strncasecmp(x,y,n)
|
||||
#endif
|
||||
#ifdef _WIN32_WCE
|
||||
#ifndef __GNUC__
|
||||
#define stricmp(x,y) _stricmp(x,y)
|
||||
#define strnicmp _strnicmp
|
||||
#endif
|
||||
#define strdup _strdup
|
||||
#define strupr _strupr
|
||||
#define strlwr _strlwr
|
||||
#endif
|
||||
|
||||
#if defined (macintosh) //|| defined (__APPLE__) //skip all boolean/Boolean crap
|
||||
#define true 1
|
||||
|
@ -154,7 +124,7 @@ typedef long ssize_t;
|
|||
#endif
|
||||
#endif //macintosh
|
||||
|
||||
#if defined (PC_DOS) || defined (_WIN32) || defined (_WII) || defined (_PSP) || defined (_arch_dreamcast) || defined (__HAIKU__) || defined(_NDS) || defined(_PS3)
|
||||
#if defined (PC_DOS) || defined (_WIN32) || defined (__HAIKU__)
|
||||
#define HAVE_DOSSTR_FUNCS
|
||||
#endif
|
||||
|
||||
|
@ -186,15 +156,10 @@ size_t strlcpy(char *dst, const char *src, size_t siz);
|
|||
//faB: clean that up !!
|
||||
#if defined( _MSC_VER) && (_MSC_VER >= 1800) // MSVC 2013 and forward
|
||||
#include "stdbool.h"
|
||||
#elif (defined (_WIN32) || (defined (_WIN32_WCE) && !defined (__GNUC__))) && !defined (_XBOX)
|
||||
#elif defined (_WIN32)
|
||||
#define false FALSE // use windows types
|
||||
#define true TRUE
|
||||
#define boolean BOOL
|
||||
#elif defined(_NDS)
|
||||
#define boolean bool
|
||||
#elif defined(_PS3) // defined(__GNUC__)?
|
||||
#include <stdbool.h> //_bool_true_false_are_defined?
|
||||
#define boolean bool
|
||||
#else
|
||||
typedef enum {false, true} boolean;
|
||||
#endif
|
||||
|
@ -317,10 +282,6 @@ typedef UINT32 tic_t;
|
|||
#define ATTRPACK __attribute__((packed))
|
||||
#endif
|
||||
#define ATTRUNUSED __attribute__((unused))
|
||||
#ifdef _XBOX
|
||||
#define FILESTAMP I_OutputMsg("%s:%d\n",__FILE__,__LINE__);
|
||||
#define XBOXSTATIC static
|
||||
#endif
|
||||
#elif defined (_MSC_VER)
|
||||
#define ATTRNORETURN __declspec(noreturn)
|
||||
#define ATTRINLINE __forceinline
|
||||
|
@ -374,10 +335,4 @@ typedef UINT32 tic_t;
|
|||
#ifndef ATTRNOINLINE
|
||||
#define ATTRNOINLINE
|
||||
#endif
|
||||
#ifndef XBOXSTATIC
|
||||
#define XBOXSTATIC
|
||||
#endif
|
||||
#ifndef FILESTAMP
|
||||
#define FILESTAMP
|
||||
#endif
|
||||
#endif //__DOOMTYPE__
|
||||
|
|
144
src/f_finale.c
144
src/f_finale.c
|
@ -31,11 +31,18 @@
|
|||
#include "m_random.h"
|
||||
#include "y_inter.h"
|
||||
#include "m_cond.h"
|
||||
#include "p_local.h"
|
||||
#include "p_setup.h"
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
#include "lua_hud.h"
|
||||
#endif
|
||||
|
||||
// Stage of animation:
|
||||
// 0 = text, 1 = art screen
|
||||
static INT32 finalecount;
|
||||
INT32 titlescrollspeed = 80;
|
||||
UINT8 titlemapinaction = TITLEMAP_OFF;
|
||||
|
||||
static INT32 timetonext; // Delay between screen changes
|
||||
static INT32 continuetime; // Short delay when continuing
|
||||
|
@ -217,17 +224,19 @@ static void F_SkyScroll(INT32 scrollspeed)
|
|||
{
|
||||
INT32 scrolled, x, mx, fakedwidth;
|
||||
patch_t *pat;
|
||||
INT16 patwidth;
|
||||
|
||||
pat = W_CachePatchName("TITLESKY", PU_CACHE);
|
||||
|
||||
animtimer = ((finalecount*scrollspeed)/16) % SHORT(pat->width);
|
||||
patwidth = SHORT(pat->width);
|
||||
animtimer = ((finalecount*scrollspeed)/16 + patwidth) % patwidth;
|
||||
|
||||
fakedwidth = vid.width / vid.dupx;
|
||||
|
||||
if (rendermode == render_soft)
|
||||
{ // if only hardware rendering could be this elegant and complete
|
||||
scrolled = (SHORT(pat->width) - animtimer) - 1;
|
||||
for (x = 0, mx = scrolled; x < fakedwidth; x++, mx = (mx+1)%SHORT(pat->width))
|
||||
scrolled = (patwidth - animtimer) - 1;
|
||||
for (x = 0, mx = scrolled; x < fakedwidth; x++, mx = (mx+1)%patwidth)
|
||||
F_DrawPatchCol(x, pat, mx);
|
||||
}
|
||||
#ifdef HWRENDER
|
||||
|
@ -235,8 +244,8 @@ static void F_SkyScroll(INT32 scrollspeed)
|
|||
{ // if only software rendering could be this simple and retarded
|
||||
scrolled = animtimer;
|
||||
if (scrolled > 0)
|
||||
V_DrawScaledPatch(scrolled - SHORT(pat->width), 0, 0, pat);
|
||||
for (x = 0; x < fakedwidth; x += SHORT(pat->width))
|
||||
V_DrawScaledPatch(scrolled - patwidth, 0, 0, pat);
|
||||
for (x = 0; x < fakedwidth; x += patwidth)
|
||||
V_DrawScaledPatch(x + scrolled, 0, 0, pat);
|
||||
}
|
||||
#endif
|
||||
|
@ -278,6 +287,8 @@ void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean reset
|
|||
|
||||
void F_StartIntro(void)
|
||||
{
|
||||
S_StopMusic();
|
||||
|
||||
if (introtoplay)
|
||||
{
|
||||
if (!cutscenes[introtoplay - 1])
|
||||
|
@ -998,7 +1009,7 @@ static const char *credits[] = {
|
|||
"",
|
||||
"\1Sprite Artists",
|
||||
"Odi \"Iceman404\" Atunzu",
|
||||
"Victor \"VAdaPEGA\" Ara\x1Fjo", // Araújo -- sorry for our limited font! D:
|
||||
"Victor \"VAdaPEGA\" Ara\x1Fjo", // Araújo -- sorry for our limited font! D:
|
||||
"Jim \"MotorRoach\" DeMello",
|
||||
"Desmond \"Blade\" DesJardins",
|
||||
"Sherman \"CoatRack\" DesJardins",
|
||||
|
@ -1114,7 +1125,7 @@ void F_StartCredits(void)
|
|||
M_ClearMenus(true);
|
||||
|
||||
// Save the second we enter the credits
|
||||
if ((!modifiedgame || savemoddata) && !(netgame || multiplayer) && cursaveslot >= 0)
|
||||
if ((!modifiedgame || savemoddata) && !(netgame || multiplayer) && cursaveslot > 0)
|
||||
G_SaveGame((UINT32)cursaveslot);
|
||||
|
||||
if (creditscutscene)
|
||||
|
@ -1252,7 +1263,7 @@ static boolean drawemblem = false, drawchaosemblem = false;
|
|||
void F_StartGameEvaluation(void)
|
||||
{
|
||||
// Credits option in secrets menu
|
||||
if (cursaveslot == -2)
|
||||
if (cursaveslot == -1)
|
||||
{
|
||||
F_StartGameEnd();
|
||||
return;
|
||||
|
@ -1266,7 +1277,7 @@ void F_StartGameEvaluation(void)
|
|||
// Save the second we enter the evaluation
|
||||
// We need to do this again! Remember, it's possible a mod designed skipped
|
||||
// the credits sequence!
|
||||
if ((!modifiedgame || savemoddata) && !(netgame || multiplayer) && cursaveslot >= 0)
|
||||
if ((!modifiedgame || savemoddata) && !(netgame || multiplayer) && cursaveslot > 0)
|
||||
G_SaveGame((UINT32)cursaveslot);
|
||||
|
||||
gameaction = ga_nothing;
|
||||
|
@ -1415,17 +1426,72 @@ void F_GameEndTicker(void)
|
|||
// ==============
|
||||
void F_StartTitleScreen(void)
|
||||
{
|
||||
S_ChangeMusicInternal("_title", looptitle);
|
||||
|
||||
if (gamestate != GS_TITLESCREEN && gamestate != GS_WAITINGPLAYERS)
|
||||
finalecount = 0;
|
||||
else
|
||||
wipegamestate = GS_TITLESCREEN;
|
||||
G_SetGamestate(GS_TITLESCREEN);
|
||||
|
||||
if (titlemap)
|
||||
{
|
||||
mapthing_t *startpos;
|
||||
|
||||
gamestate_t prevwipegamestate = wipegamestate;
|
||||
titlemapinaction = TITLEMAP_LOADING;
|
||||
gamemap = titlemap;
|
||||
|
||||
if (!mapheaderinfo[gamemap-1])
|
||||
P_AllocMapHeader(gamemap-1);
|
||||
|
||||
maptol = mapheaderinfo[gamemap-1]->typeoflevel;
|
||||
globalweather = mapheaderinfo[gamemap-1]->weather;
|
||||
|
||||
G_DoLoadLevel(true);
|
||||
if (!titlemap)
|
||||
return;
|
||||
|
||||
players[displayplayer].playerstate = PST_DEAD; // Don't spawn the player in dummy (I'm still a filthy cheater)
|
||||
|
||||
// Set Default Position
|
||||
if (playerstarts[0])
|
||||
startpos = playerstarts[0];
|
||||
else if (deathmatchstarts[0])
|
||||
startpos = deathmatchstarts[0];
|
||||
else
|
||||
startpos = NULL;
|
||||
|
||||
if (startpos)
|
||||
{
|
||||
camera.x = startpos->x << FRACBITS;
|
||||
camera.y = startpos->y << FRACBITS;
|
||||
camera.subsector = R_PointInSubsector(camera.x, camera.y);
|
||||
camera.z = camera.subsector->sector->floorheight + ((startpos->options >> ZSHIFT) << FRACBITS);
|
||||
camera.angle = (startpos->angle % 360)*ANG1;
|
||||
camera.aiming = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
camera.x = camera.y = camera.z = camera.angle = camera.aiming = 0;
|
||||
camera.subsector = NULL; // toast is filthy too
|
||||
}
|
||||
|
||||
camera.chase = true;
|
||||
camera.height = 0;
|
||||
|
||||
wipegamestate = prevwipegamestate;
|
||||
}
|
||||
else
|
||||
{
|
||||
titlemapinaction = TITLEMAP_OFF;
|
||||
gamemap = 1; // g_game.c
|
||||
CON_ClearHUD();
|
||||
}
|
||||
|
||||
G_SetGamestate(GS_TITLESCREEN);
|
||||
|
||||
// IWAD dependent stuff.
|
||||
|
||||
S_ChangeMusicInternal("_title", looptitle);
|
||||
|
||||
animtimer = 0;
|
||||
|
||||
demoDelayLeft = demoDelayTime;
|
||||
|
@ -1455,12 +1521,21 @@ void F_TitleScreenDrawer(void)
|
|||
return; // We likely came here from retrying. Don't do a damn thing.
|
||||
|
||||
// Draw that sky!
|
||||
if (!titlemapinaction)
|
||||
F_SkyScroll(titlescrollspeed);
|
||||
|
||||
// Don't draw outside of the title screewn, or if the patch isn't there.
|
||||
if (!ttwing || (gamestate != GS_TITLESCREEN && gamestate != GS_WAITINGPLAYERS))
|
||||
return;
|
||||
|
||||
// rei|miru: use title pics?
|
||||
if (hidetitlepics)
|
||||
#ifdef HAVE_BLUA
|
||||
goto luahook;
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
|
||||
V_DrawScaledPatch(30, 14, 0, ttwing);
|
||||
|
||||
if (finalecount < 57)
|
||||
|
@ -1497,6 +1572,11 @@ void F_TitleScreenDrawer(void)
|
|||
}
|
||||
|
||||
V_DrawScaledPatch(48, 142, 0,ttbanner);
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
luahook:
|
||||
LUAh_TitleHUD();
|
||||
#endif
|
||||
}
|
||||
|
||||
// (no longer) De-Demo'd Title Screen
|
||||
|
@ -1509,6 +1589,46 @@ void F_TitleScreenTicker(boolean run)
|
|||
if (gameaction != ga_nothing || gamestate != GS_TITLESCREEN)
|
||||
return;
|
||||
|
||||
// Execute the titlemap camera settings
|
||||
if (titlemapinaction)
|
||||
{
|
||||
thinker_t *th;
|
||||
mobj_t *mo2;
|
||||
mobj_t *cameraref = NULL;
|
||||
|
||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)th;
|
||||
|
||||
if (!mo2)
|
||||
continue;
|
||||
|
||||
if (mo2->type != MT_ALTVIEWMAN)
|
||||
continue;
|
||||
|
||||
cameraref = mo2;
|
||||
break;
|
||||
}
|
||||
|
||||
if (cameraref)
|
||||
{
|
||||
camera.x = cameraref->x;
|
||||
camera.y = cameraref->y;
|
||||
camera.z = cameraref->z;
|
||||
camera.angle = cameraref->angle;
|
||||
camera.aiming = cameraref->cusval;
|
||||
camera.subsector = cameraref->subsector;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Default behavior: Do a lil' camera spin if a title map is loaded;
|
||||
camera.angle += titlescrollspeed*ANG1/64;
|
||||
}
|
||||
}
|
||||
|
||||
// no demos to play? or, are they disabled?
|
||||
if (!cv_rollingdemos.value || !numDemos)
|
||||
return;
|
||||
|
|
|
@ -62,6 +62,15 @@ void F_ContinueDrawer(void);
|
|||
|
||||
extern INT32 titlescrollspeed;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
TITLEMAP_OFF = 0,
|
||||
TITLEMAP_LOADING,
|
||||
TITLEMAP_RUNNING
|
||||
} titlemap_enum;
|
||||
|
||||
extern UINT8 titlemapinaction;
|
||||
|
||||
//
|
||||
// WIPE
|
||||
//
|
||||
|
|
|
@ -94,7 +94,7 @@ static fixed_t paldiv = 0;
|
|||
* \return fademask_t for lump
|
||||
*/
|
||||
static fademask_t *F_GetFadeMask(UINT8 masknum, UINT8 scrnnum) {
|
||||
static char lumpname[9] = "FADEmmss";
|
||||
static char lumpname[10] = "FADEmmss";
|
||||
static fademask_t fm = {NULL,0,0,0,0,0};
|
||||
lumpnum_t lumpnum;
|
||||
UINT8 *lump, *mask;
|
||||
|
|
391
src/filesrch.c
391
src/filesrch.c
|
@ -16,23 +16,21 @@
|
|||
#ifdef __GNUC__
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
#if defined (_WIN32) && !defined (_XBOX)
|
||||
#ifdef _WIN32
|
||||
//#define WIN32_LEAN_AND_MEAN
|
||||
#define RPC_NO_WINDOWS_H
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#ifdef _WIN32_WCE
|
||||
#include "sdl/SRB2CE/cehelp.h"
|
||||
#else
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
|
||||
#include "filesrch.h"
|
||||
#include "d_netfil.h"
|
||||
#include "m_misc.h"
|
||||
#include "z_zone.h"
|
||||
#include "m_menu.h" // Addons_option_Onchange
|
||||
|
||||
#if (defined (_WIN32) && !defined (_WIN32_WCE)) && defined (_MSC_VER) && !defined (_XBOX)
|
||||
#if defined (_WIN32) && defined (_MSC_VER)
|
||||
|
||||
#include <errno.h>
|
||||
#include <io.h>
|
||||
|
@ -255,6 +253,28 @@ readdir (DIR * dirp)
|
|||
return (struct dirent *) 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* rewinddir
|
||||
*
|
||||
* Makes the next readdir start from the beginning.
|
||||
*/
|
||||
int
|
||||
rewinddir (DIR * dirp)
|
||||
{
|
||||
errno = 0;
|
||||
|
||||
/* Check for valid DIR struct. */
|
||||
if (!dirp)
|
||||
{
|
||||
errno = EFAULT;
|
||||
return -1;
|
||||
}
|
||||
|
||||
dirp->dd_stat = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* closedir
|
||||
*
|
||||
|
@ -285,68 +305,35 @@ closedir (DIR * dirp)
|
|||
return rc;
|
||||
}
|
||||
#endif
|
||||
#if defined (_XBOX) && defined (_MSC_VER)
|
||||
filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *wantedmd5sum,
|
||||
boolean completepath, int maxsearchdepth)
|
||||
{
|
||||
//NONE?
|
||||
startpath = filename = NULL;
|
||||
wantedmd5sum = NULL;
|
||||
maxsearchdepth = 0;
|
||||
completepath = false;
|
||||
return FS_NOTFOUND;
|
||||
}
|
||||
#elif defined (_WIN32_WCE)
|
||||
filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *wantedmd5sum,
|
||||
boolean completepath, int maxsearchdepth)
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
//NONE?
|
||||
startpath = filename = NULL;
|
||||
wantedmd5sum = NULL;
|
||||
maxsearchdepth = 0;
|
||||
completepath = false;
|
||||
#else
|
||||
WIN32_FIND_DATA dta;
|
||||
HANDLE searchhandle = INVALID_HANDLE_VALUE;
|
||||
const wchar_t wm[4] = L"*.*";
|
||||
|
||||
//if (startpath) SetCurrentDirectory(startpath);
|
||||
if (FIL_ReadFileOK(filename))
|
||||
{
|
||||
// checkfilemd5 returns an FS_* value, either FS_FOUND or FS_MD5SUMBAD
|
||||
return checkfilemd5(filename, wantedmd5sum);
|
||||
}
|
||||
ZeroMemory(&dta,sizeof (dta));
|
||||
if (maxsearchdepth)
|
||||
searchhandle = FindFirstFile(wm,&dta);
|
||||
if (searchhandle != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
do
|
||||
{
|
||||
if ((dta.cFileName[0]!='.') && (dta.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
//if (SetCurrentDirectory(dta.cFileName))
|
||||
{ // can fail if we haven't the right
|
||||
filestatus_t found;
|
||||
found = filesearch(filename,NULL,wantedmd5sum,completepath,maxsearchdepth-1);
|
||||
//SetCurrentDirectory("..");
|
||||
if (found == FS_FOUND || found == FS_MD5SUMBAD)
|
||||
{
|
||||
if (completepath)
|
||||
strcatbf(filename,(char *)dta.cFileName,"\\");
|
||||
FindClose(searchhandle);
|
||||
return found;
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (FindNextFile(searchhandle,&dta)==0);
|
||||
FindClose(searchhandle);
|
||||
}
|
||||
#endif
|
||||
return FS_NOTFOUND;
|
||||
}
|
||||
#else
|
||||
static CV_PossibleValue_t addons_cons_t[] = {{0, "SRB2 Folder"}, /*{1, "HOME"}, {2, "SRB2 Folder"},*/ {3, "CUSTOM"}, {0, NULL}};
|
||||
consvar_t cv_addons_option = {"addons_option", "SRB2 Folder", CV_SAVE|CV_CALL, addons_cons_t, Addons_option_Onchange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_addons_folder = {"addons_folder", "./", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t addons_md5_cons_t[] = {{0, "Name"}, {1, "Contents"}, {0, NULL}};
|
||||
consvar_t cv_addons_md5 = {"addons_md5", "Name", CV_SAVE, addons_md5_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_addons_showall = {"addons_showall", "No", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_addons_search_case = {"addons_search_case", "No", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t addons_search_type_cons_t[] = {{0, "Start"}, {1, "Anywhere"}, {0, NULL}};
|
||||
consvar_t cv_addons_search_type = {"addons_search_type", "Anywhere", CV_SAVE, addons_search_type_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
char menupath[1024];
|
||||
size_t menupathindex[menudepth];
|
||||
size_t menudepthleft = menudepth;
|
||||
|
||||
char menusearch[MAXSTRINGLENGTH+1];
|
||||
|
||||
char **dirmenu;
|
||||
size_t sizedirmenu;
|
||||
size_t dir_on[menudepth];
|
||||
UINT8 refreshdirmenu = 0;
|
||||
|
||||
size_t packetsizetally = 0;
|
||||
size_t mainwadstally = 0;
|
||||
|
||||
filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *wantedmd5sum, boolean completepath, int maxsearchdepth)
|
||||
{
|
||||
filestatus_t retval = FS_NOTFOUND;
|
||||
|
@ -387,25 +374,29 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want
|
|||
{
|
||||
searchpath[searchpathindex[depthleft]]=0;
|
||||
dent = readdir(dirhandle[depthleft]);
|
||||
if (dent)
|
||||
strcpy(&searchpath[searchpathindex[depthleft]],dent->d_name);
|
||||
|
||||
if (!dent)
|
||||
{
|
||||
closedir(dirhandle[depthleft++]);
|
||||
else if (dent->d_name[0]=='.' &&
|
||||
continue;
|
||||
}
|
||||
|
||||
if (dent->d_name[0]=='.' &&
|
||||
(dent->d_name[1]=='\0' ||
|
||||
(dent->d_name[1]=='.' &&
|
||||
dent->d_name[2]=='\0')))
|
||||
{
|
||||
// we don't want to scan uptree
|
||||
continue;
|
||||
}
|
||||
else if (stat(searchpath,&fsstat) < 0) // do we want to follow symlinks? if not: change it to lstat
|
||||
{
|
||||
// was the file (re)moved? can't stat it
|
||||
}
|
||||
|
||||
// okay, now we actually want searchpath to incorporate d_name
|
||||
strcpy(&searchpath[searchpathindex[depthleft]],dent->d_name);
|
||||
|
||||
if (stat(searchpath,&fsstat) < 0) // do we want to follow symlinks? if not: change it to lstat
|
||||
; // was the file (re)moved? can't stat it
|
||||
else if (S_ISDIR(fsstat.st_mode) && depthleft)
|
||||
{
|
||||
strcpy(&searchpath[searchpathindex[depthleft]],dent->d_name);
|
||||
searchpathindex[--depthleft] = strlen(searchpath) + 1;
|
||||
dirhandle[depthleft] = opendir(searchpath);
|
||||
if (!dirhandle[depthleft])
|
||||
|
@ -444,6 +435,254 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want
|
|||
free(searchname);
|
||||
free(searchpathindex);
|
||||
free(dirhandle);
|
||||
|
||||
return retval;
|
||||
}
|
||||
#endif
|
||||
|
||||
char exttable[NUM_EXT_TABLE][5] = {
|
||||
".txt", ".cfg", // exec
|
||||
".wad", ".soc", ".lua"}; // addfile
|
||||
|
||||
char filenamebuf[MAX_WADFILES][MAX_WADPATH];
|
||||
|
||||
|
||||
static boolean filemenusearch(char *haystack, char *needle)
|
||||
{
|
||||
static char localhaystack[128];
|
||||
strlcpy(localhaystack, haystack, 128);
|
||||
if (!cv_addons_search_case.value)
|
||||
strupr(localhaystack);
|
||||
return ((cv_addons_search_type.value)
|
||||
? (strstr(localhaystack, needle) != 0)
|
||||
: (!strncmp(localhaystack, needle, menusearch[0])));
|
||||
}
|
||||
|
||||
#define searchdir if (menusearch[0] && !filemenusearch(dent->d_name, localmenusearch))\
|
||||
{\
|
||||
rejected++;\
|
||||
continue;\
|
||||
}\
|
||||
|
||||
boolean preparefilemenu(boolean samedepth)
|
||||
{
|
||||
DIR *dirhandle;
|
||||
struct dirent *dent;
|
||||
struct stat fsstat;
|
||||
size_t pos = 0, folderpos = 0, numfolders = 0, rejected = 0;
|
||||
char *tempname = NULL;
|
||||
boolean noresults = false;
|
||||
char localmenusearch[MAXSTRINGLENGTH] = "";
|
||||
|
||||
if (samedepth)
|
||||
{
|
||||
if (dirmenu && dirmenu[dir_on[menudepthleft]])
|
||||
tempname = Z_StrDup(dirmenu[dir_on[menudepthleft]]+DIR_STRING); // don't need to I_Error if can't make - not important, just QoL
|
||||
}
|
||||
else
|
||||
menusearch[0] = menusearch[1] = 0; // clear search
|
||||
|
||||
for (; sizedirmenu > 0; sizedirmenu--) // clear out existing items
|
||||
{
|
||||
Z_Free(dirmenu[sizedirmenu-1]);
|
||||
dirmenu[sizedirmenu-1] = NULL;
|
||||
}
|
||||
|
||||
if (!(dirhandle = opendir(menupath))) // get directory
|
||||
return false;
|
||||
|
||||
if (menusearch[0])
|
||||
{
|
||||
strcpy(localmenusearch, menusearch+1);
|
||||
if (!cv_addons_search_case.value)
|
||||
strupr(localmenusearch);
|
||||
}
|
||||
|
||||
while (true)
|
||||
{
|
||||
menupath[menupathindex[menudepthleft]] = 0;
|
||||
dent = readdir(dirhandle);
|
||||
|
||||
if (!dent)
|
||||
break;
|
||||
else if (dent->d_name[0]=='.' &&
|
||||
(dent->d_name[1]=='\0' ||
|
||||
(dent->d_name[1]=='.' &&
|
||||
dent->d_name[2]=='\0')))
|
||||
continue; // we don't want to scan uptree
|
||||
|
||||
strcpy(&menupath[menupathindex[menudepthleft]],dent->d_name);
|
||||
|
||||
if (stat(menupath,&fsstat) < 0) // do we want to follow symlinks? if not: change it to lstat
|
||||
; // was the file (re)moved? can't stat it
|
||||
else // is a file or directory
|
||||
{
|
||||
if (!S_ISDIR(fsstat.st_mode)) // file
|
||||
{
|
||||
if (!cv_addons_showall.value)
|
||||
{
|
||||
size_t len = strlen(dent->d_name)+1;
|
||||
UINT8 ext;
|
||||
for (ext = 0; ext < NUM_EXT_TABLE; ext++)
|
||||
if (!strcasecmp(exttable[ext], dent->d_name+len-5)) break; // extension comparison
|
||||
if (ext == NUM_EXT_TABLE) continue; // not an addfile-able (or exec-able) file
|
||||
}
|
||||
searchdir;
|
||||
}
|
||||
else // directory
|
||||
{
|
||||
searchdir;
|
||||
numfolders++;
|
||||
}
|
||||
sizedirmenu++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!rejected && !sizedirmenu)
|
||||
{
|
||||
if (tempname)
|
||||
Z_Free(tempname);
|
||||
closedir(dirhandle);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (((noresults = (menusearch[0] && !sizedirmenu)))
|
||||
|| (!menusearch[0] && menudepthleft != menudepth-1)) // Make room for UP... or search entry
|
||||
{
|
||||
sizedirmenu++;
|
||||
numfolders++;
|
||||
folderpos++;
|
||||
}
|
||||
|
||||
if (!(dirmenu = Z_Realloc(dirmenu, sizedirmenu*sizeof(char *), PU_STATIC, NULL)))
|
||||
{
|
||||
closedir(dirhandle); // just in case
|
||||
I_Error("Ran out of memory whilst preparing add-ons menu");
|
||||
}
|
||||
|
||||
rejected = 0;
|
||||
rewinddir(dirhandle);
|
||||
|
||||
while ((pos+folderpos) < sizedirmenu)
|
||||
{
|
||||
menupath[menupathindex[menudepthleft]] = 0;
|
||||
dent = readdir(dirhandle);
|
||||
|
||||
if (!dent)
|
||||
break;
|
||||
else if (dent->d_name[0]=='.' &&
|
||||
(dent->d_name[1]=='\0' ||
|
||||
(dent->d_name[1]=='.' &&
|
||||
dent->d_name[2]=='\0')))
|
||||
continue; // we don't want to scan uptree
|
||||
|
||||
strcpy(&menupath[menupathindex[menudepthleft]],dent->d_name);
|
||||
|
||||
if (stat(menupath,&fsstat) < 0) // do we want to follow symlinks? if not: change it to lstat
|
||||
; // was the file (re)moved? can't stat it
|
||||
else // is a file or directory
|
||||
{
|
||||
char *temp;
|
||||
size_t len = strlen(dent->d_name)+1;
|
||||
UINT8 ext = EXT_FOLDER;
|
||||
UINT8 folder;
|
||||
|
||||
if (!S_ISDIR(fsstat.st_mode)) // file
|
||||
{
|
||||
if (!((numfolders+pos) < sizedirmenu)) continue; // crash prevention
|
||||
for (; ext < NUM_EXT_TABLE; ext++)
|
||||
if (!strcasecmp(exttable[ext], dent->d_name+len-5)) break; // extension comparison
|
||||
if (ext == NUM_EXT_TABLE && !cv_addons_showall.value) continue; // not an addfile-able (or exec-able) file
|
||||
ext += EXT_START; // moving to be appropriate position
|
||||
|
||||
searchdir;
|
||||
|
||||
if (ext >= EXT_LOADSTART)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < numwadfiles; i++)
|
||||
{
|
||||
if (!filenamebuf[i][0])
|
||||
{
|
||||
strncpy(filenamebuf[i], wadfiles[i]->filename, MAX_WADPATH);
|
||||
filenamebuf[i][MAX_WADPATH - 1] = '\0';
|
||||
nameonly(filenamebuf[i]);
|
||||
}
|
||||
|
||||
if (strcmp(dent->d_name, filenamebuf[i]))
|
||||
continue;
|
||||
if (cv_addons_md5.value && !checkfilemd5(menupath, wadfiles[i]->md5sum))
|
||||
continue;
|
||||
|
||||
ext |= EXT_LOADED;
|
||||
}
|
||||
}
|
||||
else if (ext == EXT_TXT)
|
||||
{
|
||||
if (!strcmp(dent->d_name, "log.txt") || !strcmp(dent->d_name, "errorlog.txt"))
|
||||
ext |= EXT_LOADED;
|
||||
}
|
||||
|
||||
if (!strcmp(dent->d_name, configfile))
|
||||
ext |= EXT_LOADED;
|
||||
|
||||
folder = 0;
|
||||
}
|
||||
else // directory
|
||||
{
|
||||
searchdir;
|
||||
len += (folder = 1);
|
||||
}
|
||||
|
||||
if (len > 255)
|
||||
len = 255;
|
||||
|
||||
if (!(temp = Z_Malloc((len+DIR_STRING+folder) * sizeof (char), PU_STATIC, NULL)))
|
||||
I_Error("Ran out of memory whilst preparing add-ons menu");
|
||||
temp[DIR_TYPE] = ext;
|
||||
temp[DIR_LEN] = (UINT8)(len);
|
||||
strlcpy(temp+DIR_STRING, dent->d_name, len);
|
||||
if (folder)
|
||||
{
|
||||
strcpy(temp+len, "/");
|
||||
dirmenu[folderpos++] = temp;
|
||||
}
|
||||
else
|
||||
dirmenu[numfolders + pos++] = temp;
|
||||
}
|
||||
}
|
||||
|
||||
closedir(dirhandle);
|
||||
|
||||
if (noresults) // no results
|
||||
dirmenu[0] = Z_StrDup(va("%c\13No results...", EXT_NORESULTS));
|
||||
else if (!menusearch[0] &&menudepthleft != menudepth-1) // now for UP... entry
|
||||
dirmenu[0] = Z_StrDup(va("%c\5UP...", EXT_UP));
|
||||
|
||||
menupath[menupathindex[menudepthleft]] = 0;
|
||||
sizedirmenu = (numfolders+pos); // just in case things shrink between opening and rewind
|
||||
|
||||
if (tempname)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < sizedirmenu; i++)
|
||||
{
|
||||
if (!strcmp(dirmenu[i]+DIR_STRING, tempname))
|
||||
{
|
||||
dir_on[menudepthleft] = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
Z_Free(tempname);
|
||||
}
|
||||
|
||||
if (!sizedirmenu)
|
||||
{
|
||||
dir_on[menudepthleft] = 0;
|
||||
Z_Free(dirmenu);
|
||||
return false;
|
||||
}
|
||||
else if (dir_on[menudepthleft] >= sizedirmenu)
|
||||
dir_on[menudepthleft] = sizedirmenu-1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
|
||||
#include "doomdef.h"
|
||||
#include "d_netfil.h"
|
||||
#include "m_menu.h" // MAXSTRINGLENGTH
|
||||
|
||||
extern consvar_t cv_addons_option, cv_addons_folder, cv_addons_md5, cv_addons_showall, cv_addons_search_case, cv_addons_search_type;
|
||||
|
||||
/** \brief The filesearch function
|
||||
|
||||
|
@ -25,4 +28,64 @@
|
|||
filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *wantedmd5sum,
|
||||
boolean completepath, int maxsearchdepth);
|
||||
|
||||
#define menudepth 20
|
||||
|
||||
extern char menupath[1024];
|
||||
extern size_t menupathindex[menudepth];
|
||||
extern size_t menudepthleft;
|
||||
|
||||
extern char menusearch[MAXSTRINGLENGTH+1];
|
||||
|
||||
extern char **dirmenu;
|
||||
extern size_t sizedirmenu;
|
||||
extern size_t dir_on[menudepth];
|
||||
extern UINT8 refreshdirmenu;
|
||||
|
||||
extern size_t packetsizetally;
|
||||
extern size_t mainwadstally;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
EXT_FOLDER = 0,
|
||||
EXT_UP,
|
||||
EXT_NORESULTS,
|
||||
EXT_START,
|
||||
EXT_TXT = EXT_START,
|
||||
EXT_CFG,
|
||||
EXT_LOADSTART,
|
||||
EXT_WAD = EXT_LOADSTART,
|
||||
EXT_SOC,
|
||||
EXT_LUA, // allowed even if not HAVE_BLUA so that we can yell on load attempt
|
||||
NUM_EXT,
|
||||
NUM_EXT_TABLE = NUM_EXT-EXT_START,
|
||||
EXT_LOADED = 0x80
|
||||
/*
|
||||
obviously there can only be 0x7F supported extensions in
|
||||
addons menu because we're cramming this into a char out of
|
||||
laziness/easy memory allocation (what's the difference?)
|
||||
and have stolen a bit to show whether it's loaded or not
|
||||
in practice the size of the data type is probably overkill
|
||||
toast 02/05/17
|
||||
*/
|
||||
} ext_enum;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
DIR_TYPE = 0,
|
||||
DIR_LEN,
|
||||
DIR_STRING
|
||||
} dirname_enum;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
REFRESHDIR_NORMAL = 1,
|
||||
REFRESHDIR_ADDFILE = 2,
|
||||
REFRESHDIR_WARNING = 4,
|
||||
REFRESHDIR_ERROR = 8,
|
||||
REFRESHDIR_NOTLOADED = 16,
|
||||
REFRESHDIR_MAX = 32
|
||||
} refreshdir_enum;
|
||||
|
||||
boolean preparefilemenu(boolean samedepth);
|
||||
|
||||
#endif // __FILESRCH_H__
|
||||
|
|
563
src/g_game.c
563
src/g_game.c
|
@ -76,10 +76,14 @@ INT16 gamemap = 1;
|
|||
INT16 maptol;
|
||||
UINT8 globalweather = 0;
|
||||
INT32 curWeather = PRECIP_NONE;
|
||||
INT32 cursaveslot = -1; // Auto-save 1p savegame slot
|
||||
INT16 lastmapsaved = 0; // Last map we auto-saved at
|
||||
INT32 cursaveslot = 0; // Auto-save 1p savegame slot
|
||||
//INT16 lastmapsaved = 0; // Last map we auto-saved at
|
||||
INT16 lastmaploaded = 0; // Last map the game loaded
|
||||
boolean gamecomplete = false;
|
||||
|
||||
UINT8 numgameovers = 0; // for startinglives balance
|
||||
SINT8 startinglivesbalance[maxgameovers+1] = {3, 5, 7, 9, 12, 15, 20, 25, 30, 40, 50, 75, 99, 0x7F};
|
||||
|
||||
UINT16 mainwads = 0;
|
||||
boolean modifiedgame; // Set if homebrew PWAD stuff has been added.
|
||||
boolean savemoddata = false;
|
||||
|
@ -120,6 +124,10 @@ INT16 spstage_start;
|
|||
INT16 sstage_start;
|
||||
INT16 sstage_end;
|
||||
|
||||
INT16 titlemap = 0;
|
||||
boolean hidetitlepics = false;
|
||||
INT16 bootmap; //bootmap for loading a map on startup
|
||||
|
||||
boolean looptitle = false;
|
||||
boolean useNightsSS = false;
|
||||
|
||||
|
@ -285,48 +293,16 @@ static void UserAnalog_OnChange(void);
|
|||
static void UserAnalog2_OnChange(void);
|
||||
static void Analog_OnChange(void);
|
||||
static void Analog2_OnChange(void);
|
||||
static void DirectionChar_OnChange(void);
|
||||
static void DirectionChar2_OnChange(void);
|
||||
static void AutoBrake_OnChange(void);
|
||||
static void AutoBrake2_OnChange(void);
|
||||
void SendWeaponPref(void);
|
||||
void SendWeaponPref2(void);
|
||||
|
||||
static CV_PossibleValue_t crosshair_cons_t[] = {{0, "Off"}, {1, "Cross"}, {2, "Angle"}, {3, "Point"}, {0, NULL}};
|
||||
static CV_PossibleValue_t joyaxis_cons_t[] = {{0, "None"},
|
||||
#ifdef _WII
|
||||
{1, "LStick.X"}, {2, "LStick.Y"}, {-1, "LStick.X-"}, {-2, "LStick.Y-"},
|
||||
#if JOYAXISSET > 1
|
||||
{3, "RStick.X"}, {4, "RStick.Y"}, {-3, "RStick.X-"}, {-4, "RStick.Y-"},
|
||||
#endif
|
||||
#if JOYAXISSET > 2
|
||||
{5, "RTrigger"}, {6, "LTrigger"}, {-5, "RTrigger-"}, {-6, "LTrigger-"},
|
||||
#endif
|
||||
#if JOYAXISSET > 3
|
||||
{7, "Pitch"}, {8, "Roll"}, {-7, "Pitch-"}, {-8, "Roll-"},
|
||||
#endif
|
||||
#if JOYAXISSET > 4
|
||||
{7, "Yaw"}, {8, "Dummy"}, {-7, "Yaw-"}, {-8, "Dummy-"},
|
||||
#endif
|
||||
#if JOYAXISSET > 4
|
||||
{9, "LAnalog"}, {10, "RAnalog"}, {-9, "LAnalog-"}, {-10, "RAnalog-"},
|
||||
#endif
|
||||
#elif defined (WMINPUT)
|
||||
{1, "LStick.X"}, {2, "LStick.Y"}, {-1, "LStick.X-"}, {-2, "LStick.Y-"},
|
||||
#if JOYAXISSET > 1
|
||||
{3, "RStick.X"}, {4, "RStick.Y"}, {-3, "RStick.X-"}, {-4, "RStick.Y-"},
|
||||
#endif
|
||||
#if JOYAXISSET > 2
|
||||
{5, "NStick.X"}, {6, "NStick.Y"}, {-5, "NStick.X-"}, {-6, "NStick.Y-"},
|
||||
#endif
|
||||
#if JOYAXISSET > 3
|
||||
{7, "LAnalog"}, {8, "RAnalog"}, {-7, "LAnalog-"}, {-8, "RAnalog-"},
|
||||
#endif
|
||||
#else
|
||||
{1, "X-Axis"}, {2, "Y-Axis"}, {-1, "X-Axis-"}, {-2, "Y-Axis-"},
|
||||
#ifdef _arch_dreamcast
|
||||
{3, "R-Trig"}, {4, "L-Trig"}, {-3, "R-Trig-"}, {-4, "L-Trig-"},
|
||||
{5, "Alt X-Axis"}, {6, "Alt Y-Axis"}, {-5, "Alt X-Axis-"}, {-6, "Alt Y-Axis-"},
|
||||
{7, "Triggers"}, {-7,"Triggers-"},
|
||||
#elif defined (_XBOX)
|
||||
{3, "Alt X-Axis"}, {4, "Alt Y-Axis"}, {-3, "Alt X-Axis-"}, {-4, "Alt Y-Axis-"},
|
||||
#else
|
||||
#if JOYAXISSET > 1
|
||||
{3, "Z-Axis"}, {4, "X-Rudder"}, {-3, "Z-Axis-"}, {-4, "X-Rudder-"},
|
||||
#endif
|
||||
|
@ -335,19 +311,11 @@ static CV_PossibleValue_t joyaxis_cons_t[] = {{0, "None"},
|
|||
#endif
|
||||
#if JOYAXISSET > 3
|
||||
{7, "U-Axis"}, {8, "V-Axis"}, {-7, "U-Axis-"}, {-8, "V-Axis-"},
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
{0, NULL}};
|
||||
#ifdef _WII
|
||||
#if JOYAXISSET > 5
|
||||
"More Axis Sets"
|
||||
#endif
|
||||
#else
|
||||
#if JOYAXISSET > 4
|
||||
"More Axis Sets"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
consvar_t cv_crosshair = {"crosshair", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_crosshair2 = {"crosshair2", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
@ -359,13 +327,16 @@ consvar_t cv_mousemove = {"mousemove", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, N
|
|||
consvar_t cv_mousemove2 = {"mousemove2", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_analog = {"analog", "Off", CV_CALL, CV_OnOff, Analog_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_analog2 = {"analog2", "Off", CV_CALL, CV_OnOff, Analog2_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
#ifdef DC
|
||||
consvar_t cv_useranalog = {"useranalog", "On", CV_SAVE|CV_CALL, CV_OnOff, UserAnalog_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_useranalog2 = {"useranalog2", "On", CV_SAVE|CV_CALL, CV_OnOff, UserAnalog2_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
#else
|
||||
consvar_t cv_useranalog = {"useranalog", "Off", CV_SAVE|CV_CALL, CV_OnOff, UserAnalog_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_useranalog2 = {"useranalog2", "Off", CV_SAVE|CV_CALL, CV_OnOff, UserAnalog2_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
#endif
|
||||
|
||||
static CV_PossibleValue_t directionchar_cons_t[] = {{0, "Camera"}, {1, "Movement"}, {0, NULL}};
|
||||
|
||||
// deez New User eXperiences
|
||||
consvar_t cv_directionchar = {"directionchar", "Movement", CV_SAVE|CV_CALL, directionchar_cons_t, DirectionChar_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_directionchar2 = {"directionchar2", "Movement", CV_SAVE|CV_CALL, directionchar_cons_t, DirectionChar2_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_autobrake = {"autobrake", "On", CV_SAVE|CV_CALL, CV_OnOff, AutoBrake_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_autobrake2 = {"autobrake2", "On", CV_SAVE|CV_CALL, CV_OnOff, AutoBrake2_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
@ -379,68 +350,19 @@ typedef enum
|
|||
AXISFIRENORMAL,
|
||||
} axis_input_e;
|
||||
|
||||
#if defined (_WII) || defined (WMINPUT)
|
||||
consvar_t cv_turnaxis = {"joyaxis_turn", "LStick.X", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_moveaxis = {"joyaxis_move", "LStick.Y", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_sideaxis = {"joyaxis_side", "RStick.X", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_lookaxis = {"joyaxis_look", "RStick.Y", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_fireaxis = {"joyaxis_fire", "LAnalog", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_firenaxis = {"joyaxis_firenormal", "RAnalog", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#else
|
||||
consvar_t cv_turnaxis = {"joyaxis_turn", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#ifdef PSP
|
||||
consvar_t cv_moveaxis = {"joyaxis_move", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#else
|
||||
consvar_t cv_moveaxis = {"joyaxis_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#endif
|
||||
#ifdef _arch_dreamcast
|
||||
consvar_t cv_sideaxis = {"joyaxis_side", "Triggers", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#elif defined (_XBOX)
|
||||
consvar_t cv_sideaxis = {"joyaxis_side", "Alt X-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_lookaxis = {"joyaxis_look", "Alt Y-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#elif defined (PSP)
|
||||
consvar_t cv_sideaxis = {"joyaxis_side", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#else
|
||||
consvar_t cv_sideaxis = {"joyaxis_side", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#endif
|
||||
#ifndef _XBOX
|
||||
#ifdef PSP
|
||||
consvar_t cv_lookaxis = {"joyaxis_look", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#else
|
||||
consvar_t cv_lookaxis = {"joyaxis_look", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#endif
|
||||
#endif
|
||||
consvar_t cv_fireaxis = {"joyaxis_fire", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_firenaxis = {"joyaxis_firenormal", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#endif
|
||||
|
||||
#if defined (_WII) || defined (WMINPUT)
|
||||
consvar_t cv_turnaxis2 = {"joyaxis2_turn", "LStick.X", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_moveaxis2 = {"joyaxis2_move", "LStick.Y", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_sideaxis2 = {"joyaxis2_side", "RStick.X", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_lookaxis2 = {"joyaxis2_look", "RStick.Y", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_fireaxis2 = {"joyaxis2_fire", "LAnalog", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_firenaxis2 = {"joyaxis2_firenormal", "RAnalog", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#else
|
||||
consvar_t cv_turnaxis2 = {"joyaxis2_turn", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_moveaxis2 = {"joyaxis2_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#ifdef _arch_dreamcast
|
||||
consvar_t cv_sideaxis2 = {"joyaxis2_side", "Triggers", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#elif defined (_XBOX)
|
||||
consvar_t cv_sideaxis2 = {"joyaxis2_side", "Alt X-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_lookaxis2 = {"joyaxis2_look", "Alt Y-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#elif defined (_PSP)
|
||||
consvar_t cv_sideaxis2 = {"joyaxis2_side", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#else
|
||||
consvar_t cv_sideaxis2 = {"joyaxis2_side", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#endif
|
||||
#ifndef _XBOX
|
||||
consvar_t cv_lookaxis2 = {"joyaxis2_look", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#endif
|
||||
consvar_t cv_fireaxis2 = {"joyaxis2_fire", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_firenaxis2 = {"joyaxis2_firenormal", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#endif
|
||||
|
||||
|
||||
#if MAXPLAYERS > 32
|
||||
#error "please update player_name table using the new value for MAXPLAYERS"
|
||||
|
@ -727,7 +649,7 @@ void G_SetGameModified(boolean silent)
|
|||
*/
|
||||
const char *G_BuildMapName(INT32 map)
|
||||
{
|
||||
static char mapname[9] = "MAPXX"; // internal map name (wad resource name)
|
||||
static char mapname[10] = "MAPXX"; // internal map name (wad resource name)
|
||||
|
||||
I_Assert(map > 0);
|
||||
I_Assert(map <= NUMMAPS);
|
||||
|
@ -818,14 +740,6 @@ static INT32 JoyAxis(axis_input_e axissel)
|
|||
axisval = -axisval;
|
||||
flp = true;
|
||||
}
|
||||
#ifdef _arch_dreamcast
|
||||
if (axisval == 7) // special case
|
||||
{
|
||||
retaxis = joyxmove[1] - joyymove[1];
|
||||
goto skipDC;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (axisval > JOYAXISSET*2 || axisval == 0) //not there in array or None
|
||||
return 0;
|
||||
|
||||
|
@ -841,10 +755,6 @@ static INT32 JoyAxis(axis_input_e axissel)
|
|||
retaxis = joyymove[axisval];
|
||||
}
|
||||
|
||||
#ifdef _arch_dreamcast
|
||||
skipDC:
|
||||
#endif
|
||||
|
||||
if (retaxis < (-JOYAXISRANGE))
|
||||
retaxis = -JOYAXISRANGE;
|
||||
if (retaxis > (+JOYAXISRANGE))
|
||||
|
@ -896,14 +806,7 @@ static INT32 Joy2Axis(axis_input_e axissel)
|
|||
axisval = -axisval;
|
||||
flp = true;
|
||||
}
|
||||
#ifdef _arch_dreamcast
|
||||
if (axisval == 7) // special case
|
||||
{
|
||||
retaxis = joy2xmove[1] - joy2ymove[1];
|
||||
goto skipDC;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
if (axisval > JOYAXISSET*2 || axisval == 0) //not there in array or None
|
||||
return 0;
|
||||
|
||||
|
@ -919,10 +822,6 @@ static INT32 Joy2Axis(axis_input_e axissel)
|
|||
retaxis = joy2ymove[axisval];
|
||||
}
|
||||
|
||||
#ifdef _arch_dreamcast
|
||||
skipDC:
|
||||
#endif
|
||||
|
||||
if (retaxis < (-JOYAXISRANGE))
|
||||
retaxis = -JOYAXISRANGE;
|
||||
if (retaxis > (+JOYAXISRANGE))
|
||||
|
@ -1614,6 +1513,46 @@ static void Analog2_OnChange(void)
|
|||
SendWeaponPref2();
|
||||
}
|
||||
|
||||
static void DirectionChar_OnChange(void)
|
||||
{
|
||||
if (cv_directionchar.value)
|
||||
players[consoleplayer].pflags |= PF_DIRECTIONCHAR;
|
||||
else
|
||||
players[consoleplayer].pflags &= ~PF_DIRECTIONCHAR;
|
||||
|
||||
SendWeaponPref();
|
||||
}
|
||||
|
||||
static void DirectionChar2_OnChange(void)
|
||||
{
|
||||
if (cv_directionchar2.value)
|
||||
players[secondarydisplayplayer].pflags |= PF_DIRECTIONCHAR;
|
||||
else
|
||||
players[secondarydisplayplayer].pflags &= ~PF_DIRECTIONCHAR;
|
||||
|
||||
SendWeaponPref2();
|
||||
}
|
||||
|
||||
static void AutoBrake_OnChange(void)
|
||||
{
|
||||
if (cv_autobrake.value)
|
||||
players[consoleplayer].pflags |= PF_AUTOBRAKE;
|
||||
else
|
||||
players[consoleplayer].pflags &= ~PF_AUTOBRAKE;
|
||||
|
||||
SendWeaponPref();
|
||||
}
|
||||
|
||||
static void AutoBrake2_OnChange(void)
|
||||
{
|
||||
if (cv_autobrake2.value)
|
||||
players[secondarydisplayplayer].pflags |= PF_AUTOBRAKE;
|
||||
else
|
||||
players[secondarydisplayplayer].pflags &= ~PF_AUTOBRAKE;
|
||||
|
||||
SendWeaponPref2();
|
||||
}
|
||||
|
||||
//
|
||||
// G_DoLoadLevel
|
||||
//
|
||||
|
@ -1632,6 +1571,21 @@ void G_DoLoadLevel(boolean resetplayer)
|
|||
if (gamestate == GS_INTERMISSION)
|
||||
Y_EndIntermission();
|
||||
|
||||
// cleanup
|
||||
if (titlemapinaction == TITLEMAP_LOADING)
|
||||
{
|
||||
if (W_CheckNumForName(G_BuildMapName(gamemap)) == LUMPERROR)
|
||||
{
|
||||
titlemap = 0; // let's not infinite recursion ok
|
||||
Command_ExitGame_f();
|
||||
return;
|
||||
}
|
||||
|
||||
titlemapinaction = TITLEMAP_RUNNING;
|
||||
}
|
||||
else
|
||||
titlemapinaction = TITLEMAP_OFF;
|
||||
|
||||
G_SetGamestate(GS_LEVEL);
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
|
@ -1641,7 +1595,7 @@ void G_DoLoadLevel(boolean resetplayer)
|
|||
}
|
||||
|
||||
// Setup the level.
|
||||
if (!P_SetupLevel(false))
|
||||
if (!P_SetupLevel(false)) // this never returns false?
|
||||
{
|
||||
// fail so reset game stuff
|
||||
Command_ExitGame_f();
|
||||
|
@ -1990,6 +1944,8 @@ void G_Ticker(boolean run)
|
|||
break;
|
||||
|
||||
case GS_TITLESCREEN:
|
||||
if (titlemapinaction) P_Ticker(run); // then intentionally fall through
|
||||
/* FALLTHRU */
|
||||
case GS_WAITINGPLAYERS:
|
||||
F_TitleScreenTicker(run);
|
||||
break;
|
||||
|
@ -2067,6 +2023,7 @@ void G_PlayerReborn(INT32 player)
|
|||
UINT32 thokitem;
|
||||
UINT32 spinitem;
|
||||
UINT32 revitem;
|
||||
UINT32 followitem;
|
||||
fixed_t actionspd;
|
||||
fixed_t mindash;
|
||||
fixed_t maxdash;
|
||||
|
@ -2090,6 +2047,7 @@ void G_PlayerReborn(INT32 player)
|
|||
UINT32 availabilities;
|
||||
tic_t jointime;
|
||||
boolean spectator;
|
||||
boolean outofcoop;
|
||||
INT16 bot;
|
||||
SINT8 pity;
|
||||
|
||||
|
@ -2100,7 +2058,8 @@ void G_PlayerReborn(INT32 player)
|
|||
exiting = players[player].exiting;
|
||||
jointime = players[player].jointime;
|
||||
spectator = players[player].spectator;
|
||||
pflags = (players[player].pflags & (PF_TIMEOVER|PF_FLIPCAM|PF_TAGIT|PF_TAGGED|PF_ANALOGMODE));
|
||||
outofcoop = players[player].outofcoop;
|
||||
pflags = (players[player].pflags & (PF_FLIPCAM|PF_ANALOGMODE|PF_DIRECTIONCHAR|PF_AUTOBRAKE|PF_TAGIT|PF_GAMETYPEOVER));
|
||||
|
||||
// As long as we're not in multiplayer, carry over cheatcodes from map to map
|
||||
if (!(netgame || multiplayer))
|
||||
|
@ -2136,6 +2095,7 @@ void G_PlayerReborn(INT32 player)
|
|||
thokitem = players[player].thokitem;
|
||||
spinitem = players[player].spinitem;
|
||||
revitem = players[player].revitem;
|
||||
followitem = players[player].followitem;
|
||||
actionspd = players[player].actionspd;
|
||||
mindash = players[player].mindash;
|
||||
maxdash = players[player].maxdash;
|
||||
|
@ -2154,6 +2114,7 @@ void G_PlayerReborn(INT32 player)
|
|||
p->ctfteam = ctfteam;
|
||||
p->jointime = jointime;
|
||||
p->spectator = spectator;
|
||||
p->outofcoop = outofcoop;
|
||||
|
||||
// save player config truth reborn
|
||||
p->skincolor = skincolor;
|
||||
|
@ -2172,6 +2133,7 @@ void G_PlayerReborn(INT32 player)
|
|||
p->thokitem = thokitem;
|
||||
p->spinitem = spinitem;
|
||||
p->revitem = revitem;
|
||||
p->followitem = followitem;
|
||||
p->actionspd = actionspd;
|
||||
p->mindash = mindash;
|
||||
p->maxdash = maxdash;
|
||||
|
@ -2205,8 +2167,8 @@ void G_PlayerReborn(INT32 player)
|
|||
p->rings = 0; // 0 rings
|
||||
p->panim = PA_IDLE; // standing animation
|
||||
|
||||
if ((netgame || multiplayer) && !p->spectator)
|
||||
p->powers[pw_flashing] = flashingtics-1; // Babysitting deterrent
|
||||
//if ((netgame || multiplayer) && !p->spectator) -- moved into P_SpawnPlayer to account for forced changes there
|
||||
//p->powers[pw_flashing] = flashingtics-1; // Babysitting deterrent
|
||||
|
||||
if (p-players == consoleplayer)
|
||||
{
|
||||
|
@ -2495,7 +2457,8 @@ void G_ChangePlayerReferences(mobj_t *oldmo, mobj_t *newmo)
|
|||
void G_DoReborn(INT32 playernum)
|
||||
{
|
||||
player_t *player = &players[playernum];
|
||||
boolean starpost = false;
|
||||
boolean resetlevel = false;
|
||||
INT32 i;
|
||||
|
||||
if (modeattacking)
|
||||
{
|
||||
|
@ -2521,35 +2484,98 @@ void G_DoReborn(INT32 playernum)
|
|||
B_RespawnBot(playernum);
|
||||
if (oldmo)
|
||||
G_ChangePlayerReferences(oldmo, players[playernum].mo);
|
||||
|
||||
return;
|
||||
}
|
||||
else if (countdowntimeup || (!multiplayer && gametype == GT_COOP))
|
||||
|
||||
if (countdowntimeup || (!(netgame || multiplayer) && gametype == GT_COOP))
|
||||
resetlevel = true;
|
||||
else if (gametype == GT_COOP && (netgame || multiplayer))
|
||||
{
|
||||
boolean notgameover = true;
|
||||
|
||||
if (cv_cooplives.value != 0 && player->lives <= 0) // consider game over first
|
||||
{
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
if (players[i].exiting || players[i].lives > 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == MAXPLAYERS)
|
||||
{
|
||||
notgameover = false;
|
||||
if (!countdown2)
|
||||
{
|
||||
// They're dead, Jim.
|
||||
//nextmapoverride = spstage_start;
|
||||
nextmapoverride = gamemap;
|
||||
countdown2 = TICRATE;
|
||||
skipstats = true;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (playeringame[i])
|
||||
players[i].score = 0;
|
||||
}
|
||||
|
||||
//emeralds = 0;
|
||||
tokenbits = 0;
|
||||
tokenlist = 0;
|
||||
token = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (notgameover && cv_coopstarposts.value == 2)
|
||||
{
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
|
||||
if (players[i].playerstate != PST_DEAD && !players[i].spectator && players[i].mo && players[i].mo->health)
|
||||
break;
|
||||
}
|
||||
if (i == MAXPLAYERS)
|
||||
resetlevel = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (resetlevel)
|
||||
{
|
||||
// reload the level from scratch
|
||||
if (countdowntimeup)
|
||||
{
|
||||
player->starpostangle = 0;
|
||||
player->starposttime = 0;
|
||||
player->starpostx = 0;
|
||||
player->starposty = 0;
|
||||
player->starpostz = 0;
|
||||
player->starpostnum = 0;
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
players[i].starpostangle = 0;
|
||||
players[i].starposttime = 0;
|
||||
players[i].starpostx = 0;
|
||||
players[i].starposty = 0;
|
||||
players[i].starpostz = 0;
|
||||
players[i].starpostnum = 0;
|
||||
}
|
||||
}
|
||||
if (!countdowntimeup && (mapheaderinfo[gamemap-1]->levelflags & LF_NORELOAD))
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
player->playerstate = PST_REBORN;
|
||||
|
||||
P_LoadThingsOnly();
|
||||
|
||||
P_ClearStarPost(player->starpostnum);
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
players[i].playerstate = PST_REBORN;
|
||||
P_ClearStarPost(players[i].starpostnum);
|
||||
}
|
||||
|
||||
// Do a wipe
|
||||
wipegamestate = -1;
|
||||
|
||||
if (player->starposttime)
|
||||
starpost = true;
|
||||
|
||||
if (camera.chase)
|
||||
P_ResetCamera(&players[displayplayer], &camera);
|
||||
if (camera2.chase && splitscreen)
|
||||
|
@ -2569,31 +2595,45 @@ void G_DoReborn(INT32 playernum)
|
|||
CON_ClearHUD();
|
||||
|
||||
// Starpost support
|
||||
G_SpawnPlayer(playernum, starpost);
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
G_SpawnPlayer(i, (players[i].starposttime));
|
||||
}
|
||||
|
||||
if (botingame)
|
||||
{ // Bots respawn next to their master.
|
||||
players[secondarydisplayplayer].playerstate = PST_REBORN;
|
||||
G_SpawnPlayer(secondarydisplayplayer, false);
|
||||
// restore time in netgame (see also p_setup.c)
|
||||
if ((netgame || multiplayer) && gametype == GT_COOP && cv_coopstarposts.value == 2)
|
||||
{
|
||||
// is this a hack? maybe
|
||||
tic_t maxstarposttime = 0;
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (playeringame[i] && players[i].starposttime > maxstarposttime)
|
||||
maxstarposttime = players[i].starposttime;
|
||||
}
|
||||
leveltime = maxstarposttime;
|
||||
}
|
||||
}
|
||||
else
|
||||
#ifdef HAVE_BLUA
|
||||
{
|
||||
#ifdef HAVE_BLUA
|
||||
LUAh_MapChange();
|
||||
#endif
|
||||
G_DoLoadLevel(true);
|
||||
#ifdef HAVE_BLUA
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
// respawn at the start
|
||||
mobj_t *oldmo = NULL;
|
||||
|
||||
if (player->starposttime)
|
||||
starpost = true;
|
||||
// Not resetting map, so return to level music
|
||||
if (!countdown2
|
||||
&& player->lives <= 0
|
||||
&& cv_cooplives.value == 1) // not allowed for life steal because no way to come back from zero group lives without addons, which should call this anyways
|
||||
P_RestoreMultiMusic(player);
|
||||
|
||||
// first dissasociate the corpse
|
||||
if (player->mo)
|
||||
|
@ -2603,7 +2643,7 @@ void G_DoReborn(INT32 playernum)
|
|||
P_RemoveMobj(player->mo);
|
||||
}
|
||||
|
||||
G_SpawnPlayer(playernum, starpost);
|
||||
G_SpawnPlayer(playernum, (player->starposttime));
|
||||
if (oldmo)
|
||||
G_ChangePlayerReferences(oldmo, players[playernum].mo);
|
||||
}
|
||||
|
@ -2611,10 +2651,49 @@ void G_DoReborn(INT32 playernum)
|
|||
|
||||
void G_AddPlayer(INT32 playernum)
|
||||
{
|
||||
INT32 countplayers = 0, notexiting = 0;
|
||||
|
||||
player_t *p = &players[playernum];
|
||||
|
||||
// Go through the current players and make sure you have the latest starpost set
|
||||
if (G_PlatformGametype() && (netgame || multiplayer))
|
||||
{
|
||||
INT32 i;
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
|
||||
if (players[i].bot) // ignore dumb, stupid tails
|
||||
continue;
|
||||
|
||||
countplayers++;
|
||||
|
||||
if (!players->exiting)
|
||||
notexiting++;
|
||||
|
||||
if (!(cv_coopstarposts.value && (gametype == GT_COOP) && (p->starpostnum < players[i].starpostnum)))
|
||||
continue;
|
||||
|
||||
p->starposttime = players[i].starposttime;
|
||||
p->starpostx = players[i].starpostx;
|
||||
p->starposty = players[i].starposty;
|
||||
p->starpostz = players[i].starpostz;
|
||||
p->starpostangle = players[i].starpostangle;
|
||||
p->starpostnum = players[i].starpostnum;
|
||||
}
|
||||
}
|
||||
|
||||
p->jointime = 0;
|
||||
p->playerstate = PST_REBORN;
|
||||
|
||||
p->height = mobjinfo[MT_PLAYER].height;
|
||||
|
||||
if (G_GametypeUsesLives() || ((netgame || multiplayer) && gametype == GT_COOP))
|
||||
p->lives = cv_startinglives.value;
|
||||
|
||||
if (countplayers && !notexiting)
|
||||
P_DoPlayerExit(p);
|
||||
}
|
||||
|
||||
void G_ExitLevel(void)
|
||||
|
@ -3040,8 +3119,11 @@ static void G_DoContinued(void)
|
|||
tokenlist = 0;
|
||||
token = 0;
|
||||
|
||||
if (!(netgame || multiplayer || demoplayback || demorecording || metalrecording || modeattacking) && (!modifiedgame || savemoddata) && cursaveslot > 0)
|
||||
G_SaveGameOver((UINT32)cursaveslot, true);
|
||||
|
||||
// Reset # of lives
|
||||
pl->lives = (ultimatemode) ? 1 : 3;
|
||||
pl->lives = (ultimatemode) ? 1 : startinglivesbalance[numgameovers];
|
||||
|
||||
D_MapChange(gamemap, gametype, ultimatemode, false, 0, false, false);
|
||||
|
||||
|
@ -3380,59 +3462,6 @@ void G_SaveGameData(void)
|
|||
|
||||
#define VERSIONSIZE 16
|
||||
|
||||
#ifdef SAVEGAMES_OTHERVERSIONS
|
||||
static INT16 startonmapnum = 0;
|
||||
|
||||
//
|
||||
// User wants to load a savegame from a different version?
|
||||
//
|
||||
static void M_ForceLoadGameResponse(INT32 ch)
|
||||
{
|
||||
if (ch != 'y' && ch != KEY_ENTER)
|
||||
{
|
||||
//refused
|
||||
Z_Free(savebuffer);
|
||||
save_p = savebuffer = NULL;
|
||||
startonmapnum = 0;
|
||||
M_SetupNextMenu(&SP_LoadDef);
|
||||
return;
|
||||
}
|
||||
|
||||
// pick up where we left off.
|
||||
save_p += VERSIONSIZE;
|
||||
if (!P_LoadGame(startonmapnum))
|
||||
{
|
||||
M_ClearMenus(true); // so ESC backs out to title
|
||||
M_StartMessage(M_GetText("Savegame file corrupted\n\nPress ESC\n"), NULL, MM_NOTHING);
|
||||
Command_ExitGame_f();
|
||||
Z_Free(savebuffer);
|
||||
save_p = savebuffer = NULL;
|
||||
startonmapnum = 0;
|
||||
|
||||
// no cheating!
|
||||
memset(&savedata, 0, sizeof(savedata));
|
||||
return;
|
||||
}
|
||||
|
||||
// done
|
||||
Z_Free(savebuffer);
|
||||
save_p = savebuffer = NULL;
|
||||
startonmapnum = 0;
|
||||
|
||||
//set cursaveslot to -1 so nothing gets saved.
|
||||
cursaveslot = -1;
|
||||
|
||||
displayplayer = consoleplayer;
|
||||
multiplayer = splitscreen = false;
|
||||
|
||||
if (setsizeneeded)
|
||||
R_ExecuteSetViewSize();
|
||||
|
||||
M_ClearMenus(true);
|
||||
CON_ToggleOff();
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// G_InitFromSavegame
|
||||
// Can be called by the startup code or the menu task.
|
||||
|
@ -3525,13 +3554,13 @@ void G_LoadGame(UINT32 slot, INT16 mapoverride)
|
|||
// G_SaveGame
|
||||
// Saves your game.
|
||||
//
|
||||
void G_SaveGame(UINT32 savegameslot)
|
||||
void G_SaveGame(UINT32 slot)
|
||||
{
|
||||
boolean saved;
|
||||
char savename[256] = "";
|
||||
const char *backup;
|
||||
|
||||
sprintf(savename, savegamename, savegameslot);
|
||||
sprintf(savename, savegamename, slot);
|
||||
backup = va("%s",savename);
|
||||
|
||||
// save during evaluation or credits? game's over, folks!
|
||||
|
@ -3567,9 +3596,91 @@ void G_SaveGame(UINT32 savegameslot)
|
|||
if (cv_debug && saved)
|
||||
CONS_Printf(M_GetText("Game saved.\n"));
|
||||
else if (!saved)
|
||||
CONS_Alert(CONS_ERROR, M_GetText("Error while writing to %s for save slot %u, base: %s\n"), backup, savegameslot, savegamename);
|
||||
CONS_Alert(CONS_ERROR, M_GetText("Error while writing to %s for save slot %u, base: %s\n"), backup, slot, savegamename);
|
||||
}
|
||||
|
||||
#define BADSAVE goto cleanup;
|
||||
#define CHECKPOS if (save_p >= end_p) BADSAVE
|
||||
void G_SaveGameOver(UINT32 slot, boolean modifylives)
|
||||
{
|
||||
boolean saved = false;
|
||||
size_t length;
|
||||
char vcheck[VERSIONSIZE];
|
||||
char savename[255];
|
||||
const char *backup;
|
||||
|
||||
sprintf(savename, savegamename, slot);
|
||||
backup = va("%s",savename);
|
||||
|
||||
length = FIL_ReadFile(savename, &savebuffer);
|
||||
if (!length)
|
||||
{
|
||||
CONS_Printf(M_GetText("Couldn't read file %s\n"), savename);
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
char temp[sizeof(timeattackfolder)];
|
||||
UINT8 *end_p = savebuffer + length;
|
||||
UINT8 *lives_p;
|
||||
SINT8 pllives;
|
||||
|
||||
save_p = savebuffer;
|
||||
// Version check
|
||||
memset(vcheck, 0, sizeof (vcheck));
|
||||
sprintf(vcheck, "version %d", VERSION);
|
||||
if (strcmp((const char *)save_p, (const char *)vcheck)) BADSAVE
|
||||
save_p += VERSIONSIZE;
|
||||
|
||||
// P_UnArchiveMisc()
|
||||
(void)READINT16(save_p);
|
||||
CHECKPOS
|
||||
(void)READUINT16(save_p); // emeralds
|
||||
CHECKPOS
|
||||
READSTRINGN(save_p, temp, sizeof(temp)); // mod it belongs to
|
||||
if (strcmp(temp, timeattackfolder)) BADSAVE
|
||||
|
||||
// P_UnArchivePlayer()
|
||||
CHECKPOS
|
||||
(void)READUINT16(save_p);
|
||||
CHECKPOS
|
||||
|
||||
WRITEUINT8(save_p, numgameovers);
|
||||
CHECKPOS
|
||||
|
||||
lives_p = save_p;
|
||||
pllives = READSINT8(save_p); // lives
|
||||
CHECKPOS
|
||||
if (modifylives && pllives < startinglivesbalance[numgameovers])
|
||||
{
|
||||
pllives = startinglivesbalance[numgameovers];
|
||||
WRITESINT8(lives_p, pllives);
|
||||
}
|
||||
|
||||
(void)READINT32(save_p); // Score
|
||||
CHECKPOS
|
||||
(void)READINT32(save_p); // continues
|
||||
|
||||
// File end marker check
|
||||
CHECKPOS
|
||||
if (READUINT8(save_p) != 0x1d) BADSAVE;
|
||||
|
||||
// done
|
||||
saved = FIL_WriteFile(backup, savebuffer, length);
|
||||
}
|
||||
|
||||
cleanup:
|
||||
if (cv_debug && saved)
|
||||
CONS_Printf(M_GetText("Game saved.\n"));
|
||||
else if (!saved)
|
||||
CONS_Alert(CONS_ERROR, M_GetText("Error while writing to %s for save slot %u, base: %s\n"), backup, slot, savegamename);
|
||||
Z_Free(savebuffer);
|
||||
save_p = savebuffer = NULL;
|
||||
|
||||
}
|
||||
#undef CHECKPOS
|
||||
#undef BADSAVE
|
||||
|
||||
//
|
||||
// G_DeferedInitNew
|
||||
// Can be called by the startup code or the menu task,
|
||||
|
@ -3577,7 +3688,7 @@ void G_SaveGame(UINT32 savegameslot)
|
|||
//
|
||||
void G_DeferedInitNew(boolean pultmode, const char *mapname, INT32 pickedchar, boolean SSSG, boolean FLS)
|
||||
{
|
||||
UINT8 color = 0;
|
||||
UINT8 color = skins[pickedchar].prefcolor;
|
||||
paused = false;
|
||||
|
||||
if (demoplayback)
|
||||
|
@ -3589,10 +3700,8 @@ void G_DeferedInitNew(boolean pultmode, const char *mapname, INT32 pickedchar, b
|
|||
|
||||
if (savedata.lives > 0)
|
||||
{
|
||||
color = savedata.skincolor;
|
||||
botskin = savedata.botskin;
|
||||
botcolor = savedata.botcolor;
|
||||
botingame = (botskin != 0);
|
||||
if ((botingame = ((botskin = savedata.botskin) != 0)))
|
||||
botcolor = skins[botskin-1].prefcolor;
|
||||
}
|
||||
else if (splitscreen != SSSG)
|
||||
{
|
||||
|
@ -3600,7 +3709,6 @@ void G_DeferedInitNew(boolean pultmode, const char *mapname, INT32 pickedchar, b
|
|||
SplitScreen_OnChange();
|
||||
}
|
||||
|
||||
if (!color)
|
||||
color = skins[pickedchar].prefcolor;
|
||||
SetPlayerSkinByNum(consoleplayer, pickedchar);
|
||||
CV_StealthSet(&cv_skin, skins[pickedchar].name);
|
||||
|
@ -3633,7 +3741,7 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean
|
|||
if (resetplayer)
|
||||
{
|
||||
// Clear a bunch of variables
|
||||
tokenlist = token = sstimer = redscore = bluescore = lastmap = 0;
|
||||
numgameovers = tokenlist = token = sstimer = redscore = bluescore = lastmap = 0;
|
||||
countdown = countdown2 = 0;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
|
@ -3644,26 +3752,21 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean
|
|||
|
||||
if (netgame || multiplayer)
|
||||
{
|
||||
if (!FLS || (players[i].lives < cv_startinglives.value))
|
||||
if (!FLS || (players[i].lives < 1))
|
||||
players[i].lives = cv_startinglives.value;
|
||||
players[i].continues = 0;
|
||||
}
|
||||
else if (pultmode)
|
||||
{
|
||||
players[i].lives = 1;
|
||||
players[i].continues = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
players[i].lives = 3;
|
||||
players[i].continues = 1;
|
||||
players[i].lives = (pultmode) ? 1 : startinglivesbalance[0];
|
||||
players[i].continues = (pultmode) ? 0 : 1;
|
||||
}
|
||||
|
||||
if (!((netgame || multiplayer) && (FLS)))
|
||||
players[i].score = 0;
|
||||
|
||||
// The latter two should clear by themselves, but just in case
|
||||
players[i].pflags &= ~(PF_TAGIT|PF_TAGGED|PF_FULLSTASIS);
|
||||
players[i].pflags &= ~(PF_TAGIT|PF_GAMETYPEOVER|PF_FULLSTASIS);
|
||||
|
||||
// Clear cheatcodes too, just in case.
|
||||
players[i].pflags &= ~(PF_GODMODE|PF_NOCLIP|PF_INVIS);
|
||||
|
@ -4446,7 +4549,7 @@ void G_GhostTicker(void)
|
|||
g->mo->color += abs( ( (signed)( (unsigned)leveltime >> 1 ) % 9) - 4);
|
||||
break;
|
||||
case GHC_INVINCIBLE: // Mario invincibility (P_CheckInvincibilityTimer)
|
||||
g->mo->color = (UINT8)(SKINCOLOR_RED + (leveltime % (MAXSKINCOLORS - SKINCOLOR_RED))); // Passes through all saturated colours
|
||||
g->mo->color = (UINT8)(SKINCOLOR_RUBY + (leveltime % (MAXSKINCOLORS - SKINCOLOR_RUBY))); // Passes through all saturated colours
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -59,6 +59,8 @@ extern consvar_t cv_invertmouse, cv_alwaysfreelook, cv_mousemove;
|
|||
extern consvar_t cv_invertmouse2, cv_alwaysfreelook2, cv_mousemove2;
|
||||
extern consvar_t cv_useranalog, cv_useranalog2;
|
||||
extern consvar_t cv_analog, cv_analog2;
|
||||
extern consvar_t cv_directionchar, cv_directionchar2;
|
||||
extern consvar_t cv_autobrake, cv_autobrake2;
|
||||
extern consvar_t cv_sideaxis,cv_turnaxis,cv_moveaxis,cv_lookaxis,cv_fireaxis,cv_firenaxis;
|
||||
extern consvar_t cv_sideaxis2,cv_turnaxis2,cv_moveaxis2,cv_lookaxis2,cv_fireaxis2,cv_firenaxis2;
|
||||
extern consvar_t cv_ghost_bestscore, cv_ghost_besttime, cv_ghost_bestrings, cv_ghost_last, cv_ghost_guest;
|
||||
|
@ -116,6 +118,8 @@ void G_SaveGameData(void);
|
|||
|
||||
void G_SaveGame(UINT32 slot);
|
||||
|
||||
void G_SaveGameOver(UINT32 slot, boolean modifylives);
|
||||
|
||||
// Only called by startup code.
|
||||
void G_RecordDemo(const char *name);
|
||||
void G_RecordMetal(void);
|
||||
|
|
618
src/g_input.c
618
src/g_input.c
|
@ -204,11 +204,9 @@ static keyname_t keynames[] =
|
|||
{KEY_SCROLLLOCK, "SCROLLLOCK"},
|
||||
|
||||
// bill gates keys
|
||||
#ifndef _arch_dreamcast
|
||||
{KEY_LEFTWIN, "LEFTWIN"},
|
||||
{KEY_RIGHTWIN, "RIGHTWIN"},
|
||||
{KEY_MENU, "MENU"},
|
||||
#endif
|
||||
|
||||
{KEY_LSHIFT, "LSHIFT"},
|
||||
{KEY_RSHIFT, "RSHIFT"},
|
||||
|
@ -270,140 +268,24 @@ static keyname_t keynames[] =
|
|||
{KEY_MOUSE1+0,"MOUSE1"},
|
||||
{KEY_MOUSE1+1,"MOUSE2"},
|
||||
{KEY_MOUSE1+2,"MOUSE3"},
|
||||
#if !defined (_arch_dreamcast) && !defined (_XBOX) && !defined (_PSP) && !defined (_WII)
|
||||
{KEY_MOUSE1+3,"MOUSE4"},
|
||||
{KEY_MOUSE1+4,"MOUSE5"},
|
||||
{KEY_MOUSE1+5,"MOUSE6"},
|
||||
{KEY_MOUSE1+6,"MOUSE7"},
|
||||
{KEY_MOUSE1+7,"MOUSE8"},
|
||||
#endif
|
||||
{KEY_2MOUSE1+0,"SEC_MOUSE2"}, // BP: sorry my mouse handler swap button 1 and 2
|
||||
{KEY_2MOUSE1+1,"SEC_MOUSE1"},
|
||||
{KEY_2MOUSE1+2,"SEC_MOUSE3"},
|
||||
#if !defined (_arch_dreamcast) && !defined (_XBOX) && !defined (_PSP) && !defined (_WII)
|
||||
{KEY_2MOUSE1+3,"SEC_MOUSE4"},
|
||||
{KEY_2MOUSE1+4,"SEC_MOUSE5"},
|
||||
{KEY_2MOUSE1+5,"SEC_MOUSE6"},
|
||||
{KEY_2MOUSE1+6,"SEC_MOUSE7"},
|
||||
{KEY_2MOUSE1+7,"SEC_MOUSE8"},
|
||||
#endif
|
||||
{KEY_MOUSEWHEELUP, "Wheel 1 UP"},
|
||||
{KEY_MOUSEWHEELDOWN, "Wheel 1 Down"},
|
||||
{KEY_2MOUSEWHEELUP, "Wheel 2 UP"},
|
||||
{KEY_2MOUSEWHEELDOWN, "Wheel 2 Down"},
|
||||
|
||||
#ifdef DC
|
||||
{KEY_JOY1+0, "JOYC"},
|
||||
{KEY_JOY1+1, "JOYB"},
|
||||
{KEY_JOY1+2, "JOYA"},
|
||||
{KEY_JOY1+3, "JOYS"},
|
||||
{KEY_JOY1+4, "JOYZ"},
|
||||
{KEY_JOY1+5, "JOYY"},
|
||||
{KEY_JOY1+6, "JOYX"},
|
||||
{KEY_JOY1+7, "JOYD"},
|
||||
#elif defined (_XBOX)
|
||||
{KEY_JOY1+0, "JOYA"},
|
||||
{KEY_JOY1+1, "JOYB"},
|
||||
{KEY_JOY1+2, "JOYX"},
|
||||
{KEY_JOY1+3, "JOYY"},
|
||||
{KEY_JOY1+4, "JOYG"},
|
||||
{KEY_JOY1+5, "JOYW"},
|
||||
{KEY_JOY1+6, "JOYL"},
|
||||
{KEY_JOY1+7, "JOYR"},
|
||||
{KEY_JOY1+8, "JOYS"},
|
||||
{KEY_JOY1+9, "JOYN"},
|
||||
{KEY_JOY1+10,"JOYW"},
|
||||
{KEY_JOY1+11,"JOYE"},
|
||||
#define NOMOREJOYBTN_1S
|
||||
#elif defined (_PSP)
|
||||
{KEY_JOY1+0, "TRIANGLE"},
|
||||
{KEY_JOY1+1, "CIRCLE" },
|
||||
{KEY_JOY1+2, "CROSS" },
|
||||
{KEY_JOY1+3, "SQUARE" },
|
||||
{KEY_JOY1+4, "LTRIGGER"},
|
||||
{KEY_JOY1+5, "RTRIGGER"},
|
||||
{KEY_JOY1+6, "SELECT" },
|
||||
{KEY_JOY1+7, "START" },
|
||||
{KEY_JOY1+8, "HOME" },
|
||||
{KEY_JOY1+9, "HOLD" },
|
||||
#define NOMOREJOYBTN_1S
|
||||
#elif defined (GP2X)
|
||||
{KEY_JOY1+0, "JOYA"},
|
||||
{KEY_JOY1+1, "JOYY"},
|
||||
{KEY_JOY1+2, "JOYB"},
|
||||
{KEY_JOY1+3, "JOYX"},
|
||||
{KEY_JOY1+4, "JOYL"},
|
||||
{KEY_JOY1+5, "JOYR"},
|
||||
{KEY_JOY1+6, "JOYVOLUP"},
|
||||
{KEY_JOY1+7, "JOYVOLDOWN"},
|
||||
{KEY_JOY1+8, "JOYSELECT"},
|
||||
#elif defined (_NDS)
|
||||
{KEY_JOY1+0, "JOYA"},
|
||||
{KEY_JOY1+1, "JOYB"},
|
||||
{KEY_JOY1+2, "JOYX"},
|
||||
{KEY_JOY1+3, "JOYY"},
|
||||
{KEY_JOY1+4, "JOYL"},
|
||||
{KEY_JOY1+5, "JOYR"},
|
||||
{KEY_JOY1+6, "JOYSTART"},
|
||||
{KEY_JOY1+7, "JOYSELECT"},
|
||||
#define NOMOREJOYBTN_1S
|
||||
#elif defined (WMINPUT)
|
||||
{KEY_JOY1+0, "JOYB"},
|
||||
{KEY_JOY1+1, "JOYA"},
|
||||
{KEY_JOY1+2, "JOYUP"},
|
||||
{KEY_JOY1+3, "JOYDOWN"},
|
||||
{KEY_JOY1+4, "JOYLEFT"},
|
||||
{KEY_JOY1+5, "JOYRIGHT"},
|
||||
{KEY_JOY1+6, "JOYAA"},
|
||||
{KEY_JOY1+7, "JOYBB"},
|
||||
{KEY_JOY1+8, "JOYCC"},
|
||||
{KEY_JOY1+9, "JOYXX"},
|
||||
{KEY_JOY1+10, "JOYYY"},
|
||||
{KEY_JOY1+11, "JOYZZ"},
|
||||
{KEY_JOY1+12, "JOYL"},
|
||||
{KEY_JOY1+13, "JOYR"},
|
||||
{KEY_JOY1+14, "JOYZL"},
|
||||
{KEY_JOY1+15, "JOYZR"},
|
||||
{KEY_JOY1+16, "JOYSELECT"},
|
||||
{KEY_JOY1+17, "JOYSTART"},
|
||||
{KEY_JOY1+18, "JOYHOME"},
|
||||
{KEY_JOY1+19, "JOYMINUS"},
|
||||
{KEY_JOY1+20, "JOYPLUS"},
|
||||
{KEY_JOY1+21, "JOY_1"},
|
||||
{KEY_JOY1+22, "JOY_2"},
|
||||
{KEY_JOY1+23, "JOY24"},
|
||||
{KEY_JOY1+24, "JOY25"},
|
||||
{KEY_JOY1+25, "JOY26"},
|
||||
{KEY_JOY1+26, "JOY27"},
|
||||
{KEY_JOY1+27, "JOY28"},
|
||||
{KEY_JOY1+28, "JOY29"},
|
||||
{KEY_JOY1+29, "JOY30"},
|
||||
{KEY_JOY1+30, "JOY31"},
|
||||
{KEY_JOY1+31, "JOY32"},
|
||||
#define NOMOREJOYBTN_1S
|
||||
#elif defined (_WII)
|
||||
{KEY_JOY1+0, "JOYA"},
|
||||
{KEY_JOY1+1, "JOYB"},
|
||||
{KEY_JOY1+2, "JOY1"},
|
||||
{KEY_JOY1+3, "JOY2"},
|
||||
{KEY_JOY1+4, "JOYMINUS"},
|
||||
{KEY_JOY1+5, "JOYPLUS"},
|
||||
{KEY_JOY1+6, "JOYHOME"},
|
||||
{KEY_JOY1+7, "JOYZ"},
|
||||
{KEY_JOY1+8, "JOYC"},
|
||||
{KEY_JOY1+9, "JOYA_CC"},
|
||||
{KEY_JOY1+10, "JOYB_CC"},
|
||||
{KEY_JOY1+11, "JOYX"},
|
||||
{KEY_JOY1+12, "JOYY"},
|
||||
{KEY_JOY1+13, "JOYL"},
|
||||
{KEY_JOY1+14, "JOYR"},
|
||||
{KEY_JOY1+15, "JOYZL"},
|
||||
{KEY_JOY1+16, "JOYZR"},
|
||||
{KEY_JOY1+17, "JOYMINUS_CC"},
|
||||
{KEY_JOY1+18, "JOYHPLUS_CC"},
|
||||
{KEY_JOY1+19, "JOYMHOME_CC"},
|
||||
#define NOMOREJOYBTN_1S
|
||||
#else
|
||||
{KEY_JOY1+0, "JOY1"},
|
||||
{KEY_JOY1+1, "JOY2"},
|
||||
{KEY_JOY1+2, "JOY3"},
|
||||
|
@ -413,8 +295,7 @@ static keyname_t keynames[] =
|
|||
{KEY_JOY1+6, "JOY7"},
|
||||
{KEY_JOY1+7, "JOY8"},
|
||||
{KEY_JOY1+8, "JOY9"},
|
||||
#endif
|
||||
#if !defined (_arch_dreamcast) && !defined (NOMOREJOYBTN_1S)
|
||||
#if !defined (NOMOREJOYBTN_1S)
|
||||
// we use up to 32 buttons in DirectInput
|
||||
{KEY_JOY1+9, "JOY10"},
|
||||
{KEY_JOY1+10, "JOY11"},
|
||||
|
@ -445,12 +326,10 @@ static keyname_t keynames[] =
|
|||
{KEY_HAT1+1, "HATDOWN"},
|
||||
{KEY_HAT1+2, "HATLEFT"},
|
||||
{KEY_HAT1+3, "HATRIGHT"},
|
||||
#if !defined (_XBOX) && !defined (_PSP) && !defined (_WII)
|
||||
{KEY_HAT1+4, "HATUP2"},
|
||||
{KEY_HAT1+5, "HATDOWN2"},
|
||||
{KEY_HAT1+6, "HATLEFT2"},
|
||||
{KEY_HAT1+7, "HATRIGHT2"},
|
||||
#ifndef _arch_dreamcast
|
||||
{KEY_HAT1+8, "HATUP3"},
|
||||
{KEY_HAT1+9, "HATDOWN3"},
|
||||
{KEY_HAT1+10, "HATLEFT3"},
|
||||
|
@ -459,142 +338,24 @@ static keyname_t keynames[] =
|
|||
{KEY_HAT1+13, "HATDOWN4"},
|
||||
{KEY_HAT1+14, "HATLEFT4"},
|
||||
{KEY_HAT1+15, "HATRIGHT4"},
|
||||
#endif
|
||||
#endif
|
||||
|
||||
{KEY_DBLMOUSE1+0, "DBLMOUSE1"},
|
||||
{KEY_DBLMOUSE1+1, "DBLMOUSE2"},
|
||||
{KEY_DBLMOUSE1+2, "DBLMOUSE3"},
|
||||
#if !defined (_arch_dreamcast) && !defined (_XBOX) && !defined (_PSP) && !defined (_WII)
|
||||
{KEY_DBLMOUSE1+3, "DBLMOUSE4"},
|
||||
{KEY_DBLMOUSE1+4, "DBLMOUSE5"},
|
||||
{KEY_DBLMOUSE1+5, "DBLMOUSE6"},
|
||||
{KEY_DBLMOUSE1+6, "DBLMOUSE7"},
|
||||
{KEY_DBLMOUSE1+7, "DBLMOUSE8"},
|
||||
#endif
|
||||
{KEY_DBL2MOUSE1+0, "DBLSEC_MOUSE2"}, // BP: sorry my mouse handler swap button 1 and 2
|
||||
{KEY_DBL2MOUSE1+1, "DBLSEC_MOUSE1"},
|
||||
{KEY_DBL2MOUSE1+2, "DBLSEC_MOUSE3"},
|
||||
#if !defined (_arch_dreamcast) && !defined (_XBOX) && !defined (_PSP) && !defined (_WII)
|
||||
{KEY_DBL2MOUSE1+3, "DBLSEC_MOUSE4"},
|
||||
{KEY_DBL2MOUSE1+4, "DBLSEC_MOUSE5"},
|
||||
{KEY_DBL2MOUSE1+5, "DBLSEC_MOUSE6"},
|
||||
{KEY_DBL2MOUSE1+6, "DBLSEC_MOUSE7"},
|
||||
{KEY_DBL2MOUSE1+7, "DBLSEC_MOUSE8"},
|
||||
#endif
|
||||
|
||||
#ifdef DC
|
||||
{KEY_DBLJOY1+0, "DBLJOYC"},
|
||||
{KEY_DBLJOY1+1, "DBLJOYB"},
|
||||
{KEY_DBLJOY1+2, "DBLJOYA"},
|
||||
{KEY_DBLJOY1+3, "DBLJOYS"},
|
||||
{KEY_DBLJOY1+4, "DBLJOYZ"},
|
||||
{KEY_DBLJOY1+5, "DBLJOYY"},
|
||||
{KEY_DBLJOY1+6, "DBLJOYX"},
|
||||
{KEY_DBLJOY1+7, "DBLJOYD"},
|
||||
#elif defined (_XBOX)
|
||||
{KEY_DBLJOY1+0, "DBLJOYA"},
|
||||
{KEY_DBLJOY1+1, "DBLJOYB"},
|
||||
{KEY_DBLJOY1+2, "DBLJOYX"},
|
||||
{KEY_DBLJOY1+3, "DBLJOYY"},
|
||||
{KEY_DBLJOY1+4, "DBLJOYG"},
|
||||
{KEY_DBLJOY1+5, "DBLJOYW"},
|
||||
{KEY_DBLJOY1+6, "DBLJOYL"},
|
||||
{KEY_DBLJOY1+7, "DBLJOYR"},
|
||||
{KEY_DBLJOY1+8, "DBLJOYS"},
|
||||
{KEY_DBLJOY1+9, "DBLJOYN"},
|
||||
{KEY_DBLJOY1+10,"DBLJOYW"},
|
||||
{KEY_DBLJOY1+11,"DBLJOYE"},
|
||||
#define NOMOREJOYBTN_1DBL
|
||||
#elif defined (_PSP)
|
||||
{KEY_DBLJOY1+0, "DBLTRIANGLE"},
|
||||
{KEY_DBLJOY1+1, "DBLCIRCLE" },
|
||||
{KEY_DBLJOY1+2, "DBLCROSS" },
|
||||
{KEY_DBLJOY1+3, "DBLSQUARE" },
|
||||
{KEY_DBLJOY1+4, "DBLLTRIGGER"},
|
||||
{KEY_DBLJOY1+5, "DBLRTRIGGER"},
|
||||
{KEY_DBLJOY1+6, "DBLSELECT" },
|
||||
{KEY_DBLJOY1+7, "DBLSTART" },
|
||||
{KEY_DBLJOY1+8, "DBLHOME" },
|
||||
{KEY_DBLJOY1+9, "DBLHOLD" },
|
||||
#elif defined (GP2X)
|
||||
{KEY_DBLJOY1+0, "DBLJOYA"},
|
||||
{KEY_DBLJOY1+1, "DBLJOYY"},
|
||||
{KEY_DBLJOY1+2, "DBLJOYB"},
|
||||
{KEY_DBLJOY1+3, "DBLJOYX"},
|
||||
{KEY_DBLJOY1+4, "DBLJOYL"},
|
||||
{KEY_DBLJOY1+5, "DBLJOYR"},
|
||||
{KEY_DBLJOY1+6, "DBLJOYVOLUP"},
|
||||
{KEY_DBLJOY1+7, "DBLJOYVOLDOWN"},
|
||||
{KEY_DBLJOY1+8, "DBLJOYSELECT"},
|
||||
#define NOMOREJOYBTN_1DBL
|
||||
#elif defined (_NDS)
|
||||
{KEY_DBLJOY1+0, "DBLJOYA"},
|
||||
{KEY_DBLJOY1+1, "DBLJOYB"},
|
||||
{KEY_DBLJOY1+2, "DBLJOYX"},
|
||||
{KEY_DBLJOY1+3, "DBLJOYY"},
|
||||
{KEY_DBLJOY1+4, "DBLJOYL"},
|
||||
{KEY_DBLJOY1+5, "DBLJOYR"},
|
||||
{KEY_DBLJOY1+6, "DBLJOYSTART"},
|
||||
{KEY_DBLJOY1+7, "DBLJOYSELECT"},
|
||||
#define NOMOREJOYBTN_1DBL
|
||||
#elif defined (WMINPUT)
|
||||
{KEY_DBLJOY1+0, "DBLJOYB"},
|
||||
{KEY_DBLJOY1+1, "DBLJOYA"},
|
||||
{KEY_DBLJOY1+2, "DBLJOYUP"},
|
||||
{KEY_DBLJOY1+3, "DBLJOYDOWN"},
|
||||
{KEY_DBLJOY1+4, "DBLJOYLEFT"},
|
||||
{KEY_DBLJOY1+5, "DBLJOYRIGHT"},
|
||||
{KEY_DBLJOY1+6, "DBLJOYAA"},
|
||||
{KEY_DBLJOY1+7, "DBLJOYBB"},
|
||||
{KEY_DBLJOY1+8, "DBLJOYCC"},
|
||||
{KEY_DBLJOY1+9, "DBLJOYXX"},
|
||||
{KEY_DBLJOY1+10, "DBLJOYYY"},
|
||||
{KEY_DBLJOY1+11, "DBLJOYZZ"},
|
||||
{KEY_DBLJOY1+12, "DBLJOYL"},
|
||||
{KEY_DBLJOY1+13, "DBLJOYR"},
|
||||
{KEY_DBLJOY1+14, "DBLJOYZL"},
|
||||
{KEY_DBLJOY1+15, "DBLJOYZR"},
|
||||
{KEY_DBLJOY1+16, "DBLJOYSELECT"},
|
||||
{KEY_DBLJOY1+17, "DBLJOYSTART"},
|
||||
{KEY_DBLJOY1+18, "DBLJOYHOME"},
|
||||
{KEY_DBLJOY1+19, "DBLJOYMINUS"},
|
||||
{KEY_DBLJOY1+20, "DBLJOYPLUS"},
|
||||
{KEY_DBLJOY1+21, "DBLJOY_1"},
|
||||
{KEY_DBLJOY1+22, "DBLJOY_2"},
|
||||
{KEY_DBLJOY1+23, "DBLJOY24"},
|
||||
{KEY_DBLJOY1+24, "DBLJOY25"},
|
||||
{KEY_DBLJOY1+25, "DBLJOY26"},
|
||||
{KEY_DBLJOY1+26, "DBLJOY27"},
|
||||
{KEY_DBLJOY1+27, "DBLJOY28"},
|
||||
{KEY_DBLJOY1+28, "DBLJOY29"},
|
||||
{KEY_DBLJOY1+29, "DBLJOY30"},
|
||||
{KEY_DBLJOY1+30, "DBLJOY31"},
|
||||
{KEY_DBLJOY1+31, "DBLJOY32"},
|
||||
#define NOMOREJOYBTN_1DBL
|
||||
#elif defined (_WII)
|
||||
{KEY_DBLJOY1+0, "DBLJOYA"},
|
||||
{KEY_DBLJOY1+1, "DBLJOYB"},
|
||||
{KEY_DBLJOY1+2, "DBLJOY1"},
|
||||
{KEY_DBLJOY1+3, "DBLJOY2"},
|
||||
{KEY_DBLJOY1+4, "DBLJOYMINUS"},
|
||||
{KEY_DBLJOY1+5, "DBLJOYPLUS"},
|
||||
{KEY_DBLJOY1+6, "DBLJOYHOME"},
|
||||
{KEY_DBLJOY1+7, "DBLJOYZ"},
|
||||
{KEY_DBLJOY1+8, "DBLJOYC"},
|
||||
{KEY_DBLJOY1+9, "DBLJOYA_CC"},
|
||||
{KEY_DBLJOY1+10, "DBLJOYB_CC"},
|
||||
{KEY_DBLJOY1+11, "DBLJOYX"},
|
||||
{KEY_DBLJOY1+12, "DBLJOYY"},
|
||||
{KEY_DBLJOY1+13, "DBLJOYL"},
|
||||
{KEY_DBLJOY1+14, "DBLJOYR"},
|
||||
{KEY_DBLJOY1+15, "DBLJOYZL"},
|
||||
{KEY_DBLJOY1+16, "DBLJOYZR"},
|
||||
{KEY_DBLJOY1+17, "DBLJOYMINUS_CC"},
|
||||
{KEY_DBLJOY1+18, "DBLJOYHPLUS_CC"},
|
||||
{KEY_DBLJOY1+19, "DBLJOYMHOME_CC"},
|
||||
#define NOMOREJOYBTN_1DBL
|
||||
#else
|
||||
{KEY_DBLJOY1+0, "DBLJOY1"},
|
||||
{KEY_DBLJOY1+1, "DBLJOY2"},
|
||||
{KEY_DBLJOY1+2, "DBLJOY3"},
|
||||
|
@ -603,8 +364,7 @@ static keyname_t keynames[] =
|
|||
{KEY_DBLJOY1+5, "DBLJOY6"},
|
||||
{KEY_DBLJOY1+6, "DBLJOY7"},
|
||||
{KEY_DBLJOY1+7, "DBLJOY8"},
|
||||
#endif
|
||||
#if !defined (_arch_dreamcast) && !defined (NOMOREJOYBTN_1DBL)
|
||||
#if !defined (NOMOREJOYBTN_1DBL)
|
||||
{KEY_DBLJOY1+8, "DBLJOY9"},
|
||||
{KEY_DBLJOY1+9, "DBLJOY10"},
|
||||
{KEY_DBLJOY1+10, "DBLJOY11"},
|
||||
|
@ -634,12 +394,10 @@ static keyname_t keynames[] =
|
|||
{KEY_DBLHAT1+1, "DBLHATDOWN"},
|
||||
{KEY_DBLHAT1+2, "DBLHATLEFT"},
|
||||
{KEY_DBLHAT1+3, "DBLHATRIGHT"},
|
||||
#if !defined (_XBOX) && !defined (_PSP) && !defined (_WII)
|
||||
{KEY_DBLHAT1+4, "DBLHATUP2"},
|
||||
{KEY_DBLHAT1+5, "DBLHATDOWN2"},
|
||||
{KEY_DBLHAT1+6, "DBLHATLEFT2"},
|
||||
{KEY_DBLHAT1+7, "DBLHATRIGHT2"},
|
||||
#ifndef _arch_dreamcast
|
||||
{KEY_DBLHAT1+8, "DBLHATUP3"},
|
||||
{KEY_DBLHAT1+9, "DBLHATDOWN3"},
|
||||
{KEY_DBLHAT1+10, "DBLHATLEFT3"},
|
||||
|
@ -648,101 +406,7 @@ static keyname_t keynames[] =
|
|||
{KEY_DBLHAT1+13, "DBLHATDOWN4"},
|
||||
{KEY_DBLHAT1+14, "DBLHATLEFT4"},
|
||||
{KEY_DBLHAT1+15, "DBLHATRIGHT4"},
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef DC
|
||||
{KEY_2JOY1+0, "SEC_JOYC"},
|
||||
{KEY_2JOY1+1, "SEC_JOYB"},
|
||||
{KEY_2JOY1+2, "SEC_JOYA"},
|
||||
{KEY_2JOY1+3, "SEC_JOYS"},
|
||||
{KEY_2JOY1+4, "SEC_JOYZ"},
|
||||
{KEY_2JOY1+5, "SEC_JOYY"},
|
||||
{KEY_2JOY1+6, "SEC_JOYX"},
|
||||
{KEY_2JOY1+7, "SEC_JOYD"},
|
||||
#elif defined (_XBOX)
|
||||
{KEY_2JOY1+0, "SEC_JOYA"},
|
||||
{KEY_2JOY1+1, "SEC_JOYB"},
|
||||
{KEY_2JOY1+2, "SEC_JOYX"},
|
||||
{KEY_2JOY1+3, "SEC_JOYY"},
|
||||
{KEY_2JOY1+4, "SEC_JOYG"},
|
||||
{KEY_2JOY1+5, "SEC_JOYW"},
|
||||
{KEY_2JOY1+6, "SEC_JOYL"},
|
||||
{KEY_2JOY1+7, "SEC_JOYR"},
|
||||
{KEY_2JOY1+8, "SEC_JOYS"},
|
||||
{KEY_2JOY1+9, "SEC_JOYN"},
|
||||
{KEY_2JOY1+10,"SEC_JOYW"},
|
||||
{KEY_2JOY1+11,"SEC_JOYE"},
|
||||
#define NOMOREJOYBTN_2S
|
||||
#elif defined (_PSP)
|
||||
{KEY_2JOY1+0, "SEC_TRIANGLE"},
|
||||
{KEY_2JOY1+1, "SEC_CIRCLE" },
|
||||
{KEY_2JOY1+2, "SEC_CROSS" },
|
||||
{KEY_2JOY1+3, "SEC_SQUARE" },
|
||||
{KEY_2JOY1+4, "SEC_LTRIGGER"},
|
||||
{KEY_2JOY1+5, "SEC_RTRIGGER"},
|
||||
{KEY_2JOY1+6, "SEC_SELECT" },
|
||||
{KEY_2JOY1+7, "SEC_START" },
|
||||
{KEY_2JOY1+8, "SEC_HOME" },
|
||||
{KEY_2JOY1+9, "SEC_HOLD" },
|
||||
#define NOMOREJOYBTN_2S
|
||||
#elif defined (WMINPUT)
|
||||
{KEY_2JOY1+0, "SEC_JOYB"},
|
||||
{KEY_2JOY1+1, "SEC_JOYA"},
|
||||
{KEY_2JOY1+2, "SEC_JOYUP"},
|
||||
{KEY_2JOY1+3, "SEC_JOYDOWN"},
|
||||
{KEY_2JOY1+4, "SEC_JOYLEFT"},
|
||||
{KEY_2JOY1+5, "SEC_JOYRIGHT"},
|
||||
{KEY_2JOY1+6, "SEC_JOYAA"},
|
||||
{KEY_2JOY1+7, "SEC_JOYBB"},
|
||||
{KEY_2JOY1+8, "SEC_JOYCC"},
|
||||
{KEY_2JOY1+9, "SEC_JOYXX"},
|
||||
{KEY_2JOY1+10, "SEC_JOYYY"},
|
||||
{KEY_2JOY1+11, "SEC_JOYZZ"},
|
||||
{KEY_2JOY1+12, "SEC_JOYL"},
|
||||
{KEY_2JOY1+13, "SEC_JOYR"},
|
||||
{KEY_2JOY1+14, "SEC_JOYZL"},
|
||||
{KEY_2JOY1+15, "SEC_JOYZR"},
|
||||
{KEY_2JOY1+16, "SEC_JOYSELECT"},
|
||||
{KEY_2JOY1+17, "SEC_JOYSTART"},
|
||||
{KEY_2JOY1+18, "SEC_JOYHOME"},
|
||||
{KEY_2JOY1+19, "SEC_JOYMINUS"},
|
||||
{KEY_2JOY1+20, "SEC_JOYPLUS"},
|
||||
{KEY_2JOY1+21, "SEC_JOY_1"},
|
||||
{KEY_2JOY1+22, "SEC_JOY_2"},
|
||||
{KEY_2JOY1+23, "SEC_JOY24"},
|
||||
{KEY_2JOY1+24, "SEC_JOY25"},
|
||||
{KEY_2JOY1+25, "SEC_JOY26"},
|
||||
{KEY_2JOY1+26, "SEC_JOY27"},
|
||||
{KEY_2JOY1+27, "SEC_JOY28"},
|
||||
{KEY_2JOY1+28, "SEC_JOY29"},
|
||||
{KEY_2JOY1+29, "SEC_JOY30"},
|
||||
{KEY_2JOY1+30, "SEC_JOY31"},
|
||||
{KEY_2JOY1+31, "SEC_JOY32"},
|
||||
#define NOMOREJOYBTN_2S
|
||||
#elif defined (_WII)
|
||||
{KEY_2JOY1+0, "SEC_JOYA"},
|
||||
{KEY_2JOY1+1, "SEC_JOYB"},
|
||||
{KEY_2JOY1+2, "SEC_JOY1"},
|
||||
{KEY_2JOY1+3, "SEC_JOY2"},
|
||||
{KEY_2JOY1+4, "SEC_JOYMINUS"},
|
||||
{KEY_2JOY1+5, "SEC_JOYPLUS"},
|
||||
{KEY_2JOY1+6, "SEC_JOYHOME"},
|
||||
{KEY_2JOY1+7, "SEC_JOYZ"},
|
||||
{KEY_2JOY1+8, "SEC_JOYC"},
|
||||
{KEY_2JOY1+9, "SEC_JOYA_CC"},
|
||||
{KEY_2JOY1+10, "SEC_JOYB_CC"},
|
||||
{KEY_2JOY1+11, "SEC_JOYX"},
|
||||
{KEY_2JOY1+12, "SEC_JOYY"},
|
||||
{KEY_2JOY1+13, "SEC_JOYL"},
|
||||
{KEY_2JOY1+14, "SEC_JOYR"},
|
||||
{KEY_2JOY1+15, "SEC_JOYZL"},
|
||||
{KEY_2JOY1+16, "SEC_JOYZR"},
|
||||
{KEY_2JOY1+17, "SEC_JOYMINUS_CC"},
|
||||
{KEY_2JOY1+18, "SEC_JOYHPLUS_CC"},
|
||||
{KEY_2JOY1+19, "SEC_JOYMHOME_CC"},
|
||||
#define NOMOREJOYBTN_2S
|
||||
#else
|
||||
{KEY_2JOY1+0, "SEC_JOY1"},
|
||||
{KEY_2JOY1+1, "SEC_JOY2"},
|
||||
{KEY_2JOY1+2, "SEC_JOY3"},
|
||||
|
@ -751,8 +415,7 @@ static keyname_t keynames[] =
|
|||
{KEY_2JOY1+5, "SEC_JOY6"},
|
||||
{KEY_2JOY1+6, "SEC_JOY7"},
|
||||
{KEY_2JOY1+7, "SEC_JOY8"},
|
||||
#endif
|
||||
#if !defined (_arch_dreamcast) && !defined (NOMOREJOYBTN_2S)
|
||||
#if !defined (NOMOREJOYBTN_2S)
|
||||
// we use up to 32 buttons in DirectInput
|
||||
{KEY_2JOY1+8, "SEC_JOY9"},
|
||||
{KEY_2JOY1+9, "SEC_JOY10"},
|
||||
|
@ -784,12 +447,10 @@ static keyname_t keynames[] =
|
|||
{KEY_2HAT1+1, "SEC_HATDOWN"},
|
||||
{KEY_2HAT1+2, "SEC_HATLEFT"},
|
||||
{KEY_2HAT1+3, "SEC_HATRIGHT"},
|
||||
#if !defined (_XBOX) && !defined (_PSP) && !defined (_WII)
|
||||
{KEY_2HAT1+4, "SEC_HATUP2"},
|
||||
{KEY_2HAT1+5, "SEC_HATDOWN2"},
|
||||
{KEY_2HAT1+6, "SEC_HATLEFT2"},
|
||||
{KEY_2HAT1+7, "SEC_HATRIGHT2"},
|
||||
#ifndef _arch_dreamcast
|
||||
{KEY_2HAT1+8, "SEC_HATUP3"},
|
||||
{KEY_2HAT1+9, "SEC_HATDOWN3"},
|
||||
{KEY_2HAT1+10, "SEC_HATLEFT3"},
|
||||
|
@ -798,101 +459,7 @@ static keyname_t keynames[] =
|
|||
{KEY_2HAT1+13, "SEC_HATDOWN4"},
|
||||
{KEY_2HAT1+14, "SEC_HATLEFT4"},
|
||||
{KEY_2HAT1+15, "SEC_HATRIGHT4"},
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef DC
|
||||
{KEY_DBL2JOY1+0, "DBLSEC_JOYC"},
|
||||
{KEY_DBL2JOY1+1, "DBLSEC_JOYB"},
|
||||
{KEY_DBL2JOY1+2, "DBLSEC_JOYA"},
|
||||
{KEY_DBL2JOY1+3, "DBLSEC_JOYS"},
|
||||
{KEY_DBL2JOY1+4, "DBLSEC_JOYZ"},
|
||||
{KEY_DBL2JOY1+5, "DBLSEC_JOYY"},
|
||||
{KEY_DBL2JOY1+6, "DBLSEC_JOYX"},
|
||||
{KEY_DBL2JOY1+7, "DBLSEC_JOYD"},
|
||||
#elif defined (_XBOX)
|
||||
{KEY_DBL2JOY1+0, "DBLSEC_JOYA"},
|
||||
{KEY_DBL2JOY1+1, "DBLSEC_JOYB"},
|
||||
{KEY_DBL2JOY1+2, "DBLSEC_JOYX"},
|
||||
{KEY_DBL2JOY1+3, "DBLSEC_JOYY"},
|
||||
{KEY_DBL2JOY1+4, "DBLSEC_JOYG"},
|
||||
{KEY_DBL2JOY1+5, "DBLSEC_JOYW"},
|
||||
{KEY_DBL2JOY1+6, "DBLSEC_JOYL"},
|
||||
{KEY_DBL2JOY1+7, "DBLSEC_JOYR"},
|
||||
{KEY_DBL2JOY1+8, "DBLSEC_JOYS"},
|
||||
{KEY_DBL2JOY1+9, "DBLSEC_JOYN"},
|
||||
{KEY_DBL2JOY1+10,"DBLSEC_JOYW"},
|
||||
{KEY_DBL2JOY1+11,"DBLSEC_JOYE"},
|
||||
#define NOMOREJOYBTN_2DBL
|
||||
#elif defined (_PSP)
|
||||
{KEY_DBL2JOY1+0, "DBLSEC_TRIANGLE"},
|
||||
{KEY_DBL2JOY1+1, "DBLSEC_CIRCLE" },
|
||||
{KEY_DBL2JOY1+2, "DBLSEC_CROSS" },
|
||||
{KEY_DBL2JOY1+3, "DBLSEC_SQUARE" },
|
||||
{KEY_DBL2JOY1+4, "DBLSEC_LTRIGGER"},
|
||||
{KEY_DBL2JOY1+5, "DBLSEC_RTRIGGER"},
|
||||
{KEY_DBL2JOY1+6, "DBLSEC_SELECT" },
|
||||
{KEY_DBL2JOY1+7, "DBLSEC_START" },
|
||||
{KEY_DBL2JOY1+8, "DBLSEC_HOME" },
|
||||
{KEY_DBL2JOY1+9, "DBLSEC_HOLD" },
|
||||
#define NOMOREJOYBTN_2DBL
|
||||
#elif defined (WMINPUT)
|
||||
{KEY_DBL2JOY1+0, "DBLSEC_JOYB"},
|
||||
{KEY_DBL2JOY1+1, "DBLSEC_JOYA"},
|
||||
{KEY_DBL2JOY1+2, "DBLSEC_JOYUP"},
|
||||
{KEY_DBL2JOY1+3, "DBLSEC_JOYDOWN"},
|
||||
{KEY_DBL2JOY1+4, "DBLSEC_JOYLEFT"},
|
||||
{KEY_DBL2JOY1+5, "DBLSEC_JOYRIGHT"},
|
||||
{KEY_DBL2JOY1+6, "DBLSEC_JOYAA"},
|
||||
{KEY_DBL2JOY1+7, "DBLSEC_JOYBB"},
|
||||
{KEY_DBL2JOY1+8, "DBLSEC_JOYCC"},
|
||||
{KEY_DBL2JOY1+9, "DBLSEC_JOYXX"},
|
||||
{KEY_DBL2JOY1+10, "DBLSEC_JOYYY"},
|
||||
{KEY_DBL2JOY1+11, "DBLSEC_JOYZZ"},
|
||||
{KEY_DBL2JOY1+12, "DBLSEC_JOYL"},
|
||||
{KEY_DBL2JOY1+13, "DBLSEC_JOYR"},
|
||||
{KEY_DBL2JOY1+14, "DBLSEC_JOYZL"},
|
||||
{KEY_DBL2JOY1+15, "DBLSEC_JOYZR"},
|
||||
{KEY_DBL2JOY1+16, "DBLSEC_JOYSELECT"},
|
||||
{KEY_DBL2JOY1+17, "DBLSEC_JOYSTART"},
|
||||
{KEY_DBL2JOY1+18, "DBLSEC_JOYHOME"},
|
||||
{KEY_DBL2JOY1+19, "DBLSEC_JOYMINUS"},
|
||||
{KEY_DBL2JOY1+20, "DBLSEC_JOYPLUS"},
|
||||
{KEY_DBL2JOY1+21, "DBLSEC_JOY_1"},
|
||||
{KEY_DBL2JOY1+22, "DBLSEC_JOY_2"},
|
||||
{KEY_DBL2JOY1+23, "DBLSEC_JOY24"},
|
||||
{KEY_DBL2JOY1+24, "DBLSEC_JOY25"},
|
||||
{KEY_DBL2JOY1+25, "DBLSEC_JOY26"},
|
||||
{KEY_DBL2JOY1+26, "DBLSEC_JOY27"},
|
||||
{KEY_DBL2JOY1+27, "DBLSEC_JOY28"},
|
||||
{KEY_DBL2JOY1+28, "DBLSEC_JOY29"},
|
||||
{KEY_DBL2JOY1+29, "DBLSEC_JOY30"},
|
||||
{KEY_DBL2JOY1+30, "DBLSEC_JOY31"},
|
||||
{KEY_DBL2JOY1+31, "DBLSEC_JOY32"},
|
||||
#define NOMOREJOYBTN_2SDBL
|
||||
#elif defined (_WII)
|
||||
{KEY_DBL2JOY1+0, "DBLSEC_JOYA"},
|
||||
{KEY_DBL2JOY1+1, "DBLSEC_JOYB"},
|
||||
{KEY_DBL2JOY1+2, "DBLSEC_JOY1"},
|
||||
{KEY_DBL2JOY1+3, "DBLSEC_JOY2"},
|
||||
{KEY_DBL2JOY1+4, "DBLSEC_JOYMINUS"},
|
||||
{KEY_DBL2JOY1+5, "DBLSEC_JOYPLUS"},
|
||||
{KEY_DBL2JOY1+6, "DBLSEC_JOYHOME"},
|
||||
{KEY_DBL2JOY1+7, "DBLSEC_JOYZ"},
|
||||
{KEY_DBL2JOY1+8, "DBLSEC_JOYC"},
|
||||
{KEY_DBL2JOY1+9, "DBLSEC_JOYA_CC"},
|
||||
{KEY_DBL2JOY1+10, "DBLSEC_JOYB_CC"},
|
||||
{KEY_DBL2JOY1+11, "DBLSEC_JOYX"},
|
||||
{KEY_DBL2JOY1+12, "DBLSEC_JOYY"},
|
||||
{KEY_DBL2JOY1+13, "DBLSEC_JOYL"},
|
||||
{KEY_DBL2JOY1+14, "DBLSEC_JOYR"},
|
||||
{KEY_DBL2JOY1+15, "DBLSEC_JOYZL"},
|
||||
{KEY_DBL2JOY1+16, "DBLSEC_JOYZR"},
|
||||
{KEY_DBL2JOY1+17, "DBLSEC_JOYMINUS_CC"},
|
||||
{KEY_DBL2JOY1+18, "DBLSEC_JOYHPLUS_CC"},
|
||||
{KEY_DBL2JOY1+19, "DBLSEC_JOYMHOME_CC"},
|
||||
#define NOMOREJOYBTN_2DBL
|
||||
#else
|
||||
{KEY_DBL2JOY1+0, "DBLSEC_JOY1"},
|
||||
{KEY_DBL2JOY1+1, "DBLSEC_JOY2"},
|
||||
{KEY_DBL2JOY1+2, "DBLSEC_JOY3"},
|
||||
|
@ -901,8 +468,7 @@ static keyname_t keynames[] =
|
|||
{KEY_DBL2JOY1+5, "DBLSEC_JOY6"},
|
||||
{KEY_DBL2JOY1+6, "DBLSEC_JOY7"},
|
||||
{KEY_DBL2JOY1+7, "DBLSEC_JOY8"},
|
||||
#endif
|
||||
#if !defined (_arch_dreamcast) && !defined (NOMOREJOYBTN_2DBL)
|
||||
#if !defined (NOMOREJOYBTN_2DBL)
|
||||
{KEY_DBL2JOY1+8, "DBLSEC_JOY9"},
|
||||
{KEY_DBL2JOY1+9, "DBLSEC_JOY10"},
|
||||
{KEY_DBL2JOY1+10, "DBLSEC_JOY11"},
|
||||
|
@ -932,12 +498,10 @@ static keyname_t keynames[] =
|
|||
{KEY_DBL2HAT1+1, "DBLSEC_HATDOWN"},
|
||||
{KEY_DBL2HAT1+2, "DBLSEC_HATLEFT"},
|
||||
{KEY_DBL2HAT1+3, "DBLSEC_HATRIGHT"},
|
||||
#if !defined (_XBOX) && !defined (_PSP) && !defined (_WII)
|
||||
{KEY_DBL2HAT1+4, "DBLSEC_HATUP2"},
|
||||
{KEY_DBL2HAT1+5, "DBLSEC_HATDOWN2"},
|
||||
{KEY_DBL2HAT1+6, "DBLSEC_HATLEFT2"},
|
||||
{KEY_DBL2HAT1+7, "DBLSEC_HATRIGHT2"},
|
||||
#ifndef _arch_dreamcast
|
||||
{KEY_DBL2HAT1+8, "DBLSEC_HATUP3"},
|
||||
{KEY_DBL2HAT1+9, "DBLSEC_HATDOWN3"},
|
||||
{KEY_DBL2HAT1+10, "DBLSEC_HATLEFT3"},
|
||||
|
@ -946,8 +510,6 @@ static keyname_t keynames[] =
|
|||
{KEY_DBL2HAT1+13, "DBLSEC_HATDOWN4"},
|
||||
{KEY_DBL2HAT1+14, "DBLSEC_HATLEFT4"},
|
||||
{KEY_DBL2HAT1+15, "DBLSEC_HATRIGHT4"},
|
||||
#endif
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
@ -1049,105 +611,6 @@ INT32 G_KeyStringtoNum(const char *keystr)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef DC
|
||||
void G_Controldefault(void)
|
||||
{
|
||||
gamecontrol[gc_forward ][0] = KEY_HAT1+0; //Up
|
||||
gamecontrol[gc_forward ][1] = KEY_UPARROW;
|
||||
gamecontrol[gc_backward ][0] = KEY_HAT1+1; //Down
|
||||
gamecontrol[gc_backward ][1] = KEY_DOWNARROW;
|
||||
//gamecontrol[gc_straferight][0] = '[';
|
||||
//gamecontrol[gc_strafeleft ][0] = ']';
|
||||
gamecontrol[gc_turnleft ][0] = KEY_HAT1+2; //Left
|
||||
gamecontrol[gc_turnleft ][1] = KEY_LEFTARROW;
|
||||
gamecontrol[gc_turnright ][0] = KEY_HAT1+3; //Right
|
||||
gamecontrol[gc_turnright ][1] = KEY_RIGHTARROW;
|
||||
gamecontrol[gc_weaponnext ][0] = ']';
|
||||
gamecontrol[gc_weaponprev ][0] = '[';
|
||||
gamecontrol[gc_fire ][0] = KEY_JOY1+6; //X
|
||||
gamecontrol[gc_fire ][1] = KEY_RCTRL;
|
||||
gamecontrol[gc_firenormal ][0] = KEY_JOY1+5; //Y
|
||||
gamecontrol[gc_firenormal ][1] = ';';
|
||||
gamecontrol[gc_tossflag ][0] = '\'';
|
||||
gamecontrol[gc_use ][0] = KEY_JOY1+1; //B
|
||||
gamecontrol[gc_use ][1] = '.';
|
||||
gamecontrol[gc_camtoggle ][1] = ',';
|
||||
gamecontrol[gc_camreset ][0] = 'c';
|
||||
gamecontrol[gc_lookup ][0] = KEY_PGUP;
|
||||
gamecontrol[gc_lookdown ][0] = KEY_PGDN;
|
||||
gamecontrol[gc_centerview ][0] = KEY_END;
|
||||
gamecontrol[gc_mouseaiming][0] = 's';
|
||||
gamecontrol[gc_talkkey ][0] = 't';
|
||||
gamecontrol[gc_teamkey ][0] = 'y';
|
||||
gamecontrol[gc_scores ][0] = KEY_TAB;
|
||||
gamecontrol[gc_jump ][0] = KEY_JOY1+2; //A
|
||||
gamecontrol[gc_jump ][1] = '/';
|
||||
gamecontrol[gc_console ][0] = KEY_CONSOLE;
|
||||
gamecontrol[gc_console ][1] = KEY_F5;
|
||||
//gamecontrolbis
|
||||
gamecontrolbis[gc_forward ][0] = KEY_2HAT1+0;
|
||||
gamecontrolbis[gc_forward ][1] = 'w';
|
||||
gamecontrolbis[gc_backward ][0] = KEY_2HAT1+1;
|
||||
gamecontrolbis[gc_backward ][1] = 's';
|
||||
gamecontrolbis[gc_turnleft ][0] = KEY_2HAT1+2;
|
||||
gamecontrolbis[gc_turnleft ][1] = 'a';
|
||||
gamecontrolbis[gc_turnright ][0] = KEY_2HAT1+3;
|
||||
gamecontrolbis[gc_turnright ][1] = 'd';
|
||||
gamecontrolbis[gc_weaponnext][0] = 't';
|
||||
gamecontrolbis[gc_weaponprev][0] = 'r';
|
||||
gamecontrolbis[gc_fire ][0] = KEY_2JOY1+6; //X
|
||||
gamecontrolbis[gc_firenormal][0] = KEY_2JOY1+5; //Y
|
||||
gamecontrolbis[gc_use ][0] = KEY_2JOY1+1; //B
|
||||
gamecontrolbis[gc_jump ][0] = KEY_2JOY1+2; //A
|
||||
//gamecontrolbis[gc_straferight][0] = 'x';
|
||||
//gamecontrolbis[gc_strafeleft ][0] = 'z';
|
||||
}
|
||||
#elif defined (_PSP)
|
||||
void G_Controldefault(void)
|
||||
{
|
||||
gamecontrol[gc_forward ][0] = KEY_HAT1+0; // Up
|
||||
gamecontrol[gc_backward ][0] = KEY_HAT1+1; // Down
|
||||
gamecontrol[gc_turnleft ][0] = KEY_HAT1+2; // Left
|
||||
gamecontrol[gc_turnright ][0] = KEY_HAT1+3; // Right
|
||||
gamecontrol[gc_strafeleft ][0] = KEY_JOY1+4; // L
|
||||
gamecontrol[gc_straferight][0] = KEY_JOY1+5; // R
|
||||
gamecontrol[gc_tossflag ][0] = KEY_JOY1+0; // Triangle
|
||||
gamecontrol[gc_use ][0] = KEY_JOY1+1; // Circle
|
||||
gamecontrol[gc_camtoggle ][0] = KEY_JOY1+6; // Select
|
||||
gamecontrol[gc_camreset ][0] = KEY_JOY1+3; // Square
|
||||
gamecontrol[gc_centerview ][0] = KEY_JOY1+9; // Hold
|
||||
gamecontrol[gc_pause ][0] = KEY_JOY1+8; // Start
|
||||
gamecontrol[gc_jump ][0] = KEY_JOY1+2; // Cross
|
||||
}
|
||||
#elif defined (GP2X)
|
||||
void G_Controldefault(void)
|
||||
{
|
||||
gamecontrol[gc_fire ][0] = KEY_JOY1+0; //A
|
||||
gamecontrol[gc_forward ][0] = KEY_JOY1+1; //Y
|
||||
gamecontrol[gc_jump ][0] = KEY_JOY1+2; //B
|
||||
gamecontrol[gc_use ][0] = KEY_JOY1+3; //X
|
||||
gamecontrol[gc_strafeleft ][0] = KEY_JOY1+4; //L
|
||||
gamecontrol[gc_straferight][0] = KEY_JOY1+5; //R
|
||||
gamecontrol[gc_lookup ][0] = KEY_JOY1+6; //U
|
||||
gamecontrol[gc_lookdown ][0] = KEY_JOY1+7; //D
|
||||
gamecontrol[gc_pause ][0] = KEY_JOY1+8; //S
|
||||
}
|
||||
#elif defined (_NDS)
|
||||
void G_Controldefault(void)
|
||||
{
|
||||
gamecontrol[gc_fire ][0] = KEY_JOY1+2; //X
|
||||
gamecontrol[gc_forward ][0] = KEY_UPARROW;
|
||||
gamecontrol[gc_backward ][0] = KEY_DOWNARROW;
|
||||
gamecontrol[gc_jump ][0] = KEY_JOY1+0; //A
|
||||
gamecontrol[gc_use ][0] = KEY_JOY1+3; //Y
|
||||
gamecontrol[gc_strafeleft ][0] = KEY_JOY1+4; //L
|
||||
gamecontrol[gc_straferight][0] = KEY_JOY1+5; //R
|
||||
gamecontrol[gc_turnleft ][0] = KEY_LEFTARROW;
|
||||
gamecontrol[gc_turnright ][0] = KEY_RIGHTARROW;
|
||||
gamecontrol[gc_pause ][0] = KEY_JOY1+6; //Start
|
||||
gamecontrol[gc_weaponnext ][0] = KEY_JOY1+7; //Select
|
||||
}
|
||||
#else
|
||||
void G_Controldefault(void)
|
||||
{
|
||||
gamecontrol[gc_forward ][0] = 'w';
|
||||
|
@ -1184,80 +647,7 @@ void G_Controldefault(void)
|
|||
gamecontrol[gc_jump ][0] = KEY_SPACE;
|
||||
gamecontrol[gc_console ][0] = KEY_CONSOLE;
|
||||
gamecontrol[gc_pause ][0] = KEY_PAUSE;
|
||||
#ifdef WMINPUT
|
||||
gamecontrol[gc_forward ][0] = KEY_JOY1+02; //UP
|
||||
gamecontrol[gc_backward ][0] = KEY_JOY1+03; //DOWN
|
||||
gamecontrol[gc_turnleft ][0] = KEY_JOY1+04; //LEFT
|
||||
gamecontrol[gc_turnright ][0] = KEY_JOY1+05; //RIGHT
|
||||
gamecontrol[gc_weaponnext ][0] = KEY_JOY1+10; //y
|
||||
gamecontrol[gc_weaponprev ][0] = KEY_JOY1+9; //x
|
||||
gamecontrol[gc_fire ][0] = KEY_JOY1+12; //L
|
||||
gamecontrol[gc_firenormal ][0] = KEY_JOY1+13; //R
|
||||
gamecontrol[gc_use ][0] = KEY_JOY1+00; //B
|
||||
gamecontrol[gc_use ][1] = KEY_JOY1+07; //b
|
||||
gamecontrol[gc_jump ][0] = KEY_JOY1+01; //A
|
||||
gamecontrol[gc_jump ][1] = KEY_JOY1+06; //a
|
||||
gamecontrol[gc_pause ][0] = KEY_JOY1+18; //Home
|
||||
gamecontrolbis[gc_forward ][0] = KEY_2JOY1+02; //UP
|
||||
gamecontrolbis[gc_backward ][0] = KEY_2JOY1+03; //DOWN
|
||||
gamecontrolbis[gc_turnleft ][0] = KEY_2JOY1+04; //LEFT
|
||||
gamecontrolbis[gc_turnright ][0] = KEY_2JOY1+05; //RIGHT
|
||||
gamecontrolbis[gc_weaponnext ][0] = KEY_2JOY1+10; //y
|
||||
gamecontrolbis[gc_weaponprev ][0] = KEY_2JOY1+9; //x
|
||||
gamecontrolbis[gc_fire ][0] = KEY_2JOY1+12; //L
|
||||
gamecontrolbis[gc_firenormal ][0] = KEY_2JOY1+13; //R
|
||||
gamecontrolbis[gc_use ][0] = KEY_2JOY1+00; //B
|
||||
gamecontrolbis[gc_use ][1] = KEY_2JOY1+07; //b
|
||||
gamecontrolbis[gc_jump ][0] = KEY_2JOY1+01; //A
|
||||
gamecontrolbis[gc_jump ][1] = KEY_2JOY1+06; //a
|
||||
gamecontrolbis[gc_pause ][0] = KEY_2JOY1+18; //Home
|
||||
#endif
|
||||
#ifdef _WII
|
||||
gamecontrol[gc_forward ][1] = KEY_HAT1+00; //UP
|
||||
gamecontrol[gc_backward ][1] = KEY_HAT1+01; //DOWN
|
||||
gamecontrol[gc_straferight][1] = KEY_JOY1+16; //ZR
|
||||
gamecontrol[gc_strafeleft ][1] = KEY_JOY1+15; //ZL
|
||||
gamecontrol[gc_turnleft ][1] = KEY_HAT1+02; //LEFT
|
||||
gamecontrol[gc_turnright ][1] = KEY_HAT1+03; //RIGHT
|
||||
gamecontrol[gc_weaponnext ][1] = KEY_JOY1+11; //x
|
||||
gamecontrol[gc_fire ][0] = KEY_JOY1+12; //y
|
||||
gamecontrol[gc_fire ][1] = KEY_JOY1+01; //B
|
||||
gamecontrol[gc_firenormal ][0] = KEY_JOY1+13; //L
|
||||
gamecontrol[gc_firenormal ][1] = KEY_JOY1+00; //A
|
||||
gamecontrol[gc_tossflag ][1] = KEY_JOY1+17; //Plus CC
|
||||
gamecontrol[gc_use ][0] = KEY_JOY1+9; //a
|
||||
gamecontrol[gc_use ][1] = KEY_JOY1+02; //1
|
||||
gamecontrol[gc_centerview ][1] = KEY_JOY1+14; //R
|
||||
gamecontrol[gc_scores ][0] = KEY_JOY1+04; //Minus
|
||||
gamecontrol[gc_scores ][1] = KEY_JOY1+18; //Minus
|
||||
gamecontrol[gc_jump ][0] = KEY_JOY1+10; //b
|
||||
gamecontrol[gc_jump ][1] = KEY_JOY1+3; //2
|
||||
gamecontrol[gc_pause ][0] = KEY_JOY1+06; //Home
|
||||
gamecontrol[gc_pause ][1] = KEY_JOY1+19; //Home
|
||||
gamecontrolbis[gc_forward ][1] = KEY_2HAT1+00; //UP
|
||||
gamecontrolbis[gc_backward ][1] = KEY_2HAT1+01; //DOWN
|
||||
gamecontrolbis[gc_straferight][1] = KEY_2JOY1+16; //ZR
|
||||
gamecontrolbis[gc_strafeleft ][1] = KEY_2JOY1+15; //ZL
|
||||
gamecontrolbis[gc_turnleft ][1] = KEY_2HAT1+02; //LEFT
|
||||
gamecontrolbis[gc_turnright ][1] = KEY_2HAT1+03; //RIGHT
|
||||
gamecontrolbis[gc_weaponnext ][1] = KEY_2JOY1+11; //x
|
||||
gamecontrolbis[gc_fire ][0] = KEY_2JOY1+12; //y
|
||||
gamecontrolbis[gc_fire ][1] = KEY_2JOY1+01; //B
|
||||
gamecontrolbis[gc_firenormal ][0] = KEY_2JOY1+13; //L
|
||||
gamecontrolbis[gc_firenormal ][1] = KEY_2JOY1+00; //A
|
||||
gamecontrolbis[gc_tossflag ][1] = KEY_2JOY1+17; //Plus CC
|
||||
gamecontrolbis[gc_use ][0] = KEY_2JOY1+9; //a
|
||||
gamecontrolbis[gc_use ][1] = KEY_2JOY1+02; //1
|
||||
gamecontrolbis[gc_centerview ][1] = KEY_2JOY1+14; //R
|
||||
gamecontrolbis[gc_scores ][0] = KEY_2JOY1+04; //Minus
|
||||
gamecontrolbis[gc_scores ][1] = KEY_2JOY1+18; //Minus
|
||||
gamecontrolbis[gc_jump ][0] = KEY_2JOY1+10; //b
|
||||
gamecontrolbis[gc_jump ][1] = KEY_2JOY1+3; //2
|
||||
gamecontrolbis[gc_pause ][0] = KEY_2JOY1+06; //Home
|
||||
gamecontrolbis[gc_pause ][1] = KEY_2JOY1+19; //Home
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void G_SaveKeySetting(FILE *f)
|
||||
{
|
||||
|
|
|
@ -22,33 +22,10 @@
|
|||
// keys (mousebuttons and joybuttons becomes keys)
|
||||
#define NUMKEYS 256
|
||||
|
||||
|
||||
#ifdef _arch_dreamcast
|
||||
#define MOUSEBUTTONS 5
|
||||
#define JOYBUTTONS 8 // 8 buttons
|
||||
#define JOYHATS 2 // 2 hats
|
||||
#define JOYAXISSET 3 // 3 Sets of 2 axises
|
||||
#elif defined (_XBOX)
|
||||
#define MOUSEBUTTONS 5
|
||||
#define JOYBUTTONS 12 // 12 buttons
|
||||
#define JOYHATS 1 // 1 hat
|
||||
#define JOYAXISSET 2 // 2 Sets of 2 axises
|
||||
#elif defined (_PSP)
|
||||
#define MOUSEBUTTONS 3
|
||||
#define JOYBUTTONS 14 // 10 buttons
|
||||
#define JOYHATS 1 // 1 hat
|
||||
#define JOYAXISSET 1 // 1 Set of 2 axises
|
||||
#elif defined (_WII)
|
||||
#define MOUSEBUTTONS 3
|
||||
#define JOYBUTTONS 20 // 20 buttons
|
||||
#define JOYHATS 1 // 1 hat
|
||||
#define JOYAXISSET 5 // 5 Sets of 2 axises
|
||||
#else
|
||||
#define MOUSEBUTTONS 8
|
||||
#define JOYBUTTONS 32 // 32 buttons
|
||||
#define JOYHATS 4 // 4 hats
|
||||
#define JOYAXISSET 4 // 4 Sets of 2 axises
|
||||
#endif
|
||||
|
||||
//
|
||||
// mouse and joystick buttons are handled as 'virtual' keys
|
||||
|
|
|
@ -878,8 +878,8 @@ static void AdjustSegs(void)
|
|||
count = subsectors[i].numlines;
|
||||
lseg = &segs[subsectors[i].firstline];
|
||||
p = extrasubsectors[i].planepoly;
|
||||
if (!p)
|
||||
continue;
|
||||
//if (!p)
|
||||
//continue;
|
||||
for (; count--; lseg++)
|
||||
{
|
||||
float distv1,distv2,tmp;
|
||||
|
@ -892,6 +892,7 @@ static void AdjustSegs(void)
|
|||
continue;
|
||||
#endif
|
||||
|
||||
if (p) {
|
||||
for (j = 0; j < p->numpts; j++)
|
||||
{
|
||||
distv1 = p->pts[j].x - FIXED_TO_FLOAT(lseg->v1->x);
|
||||
|
@ -912,9 +913,10 @@ static void AdjustSegs(void)
|
|||
nearv2 = distv2;
|
||||
}
|
||||
}
|
||||
if (nearv1 <= NEARDIST*NEARDIST)
|
||||
}
|
||||
if (p && nearv1 <= NEARDIST*NEARDIST)
|
||||
// share vertice with segs
|
||||
lseg->v1 = (vertex_t *)&(p->pts[v1found]);
|
||||
lseg->pv1 = &(p->pts[v1found]);
|
||||
else
|
||||
{
|
||||
// BP: here we can do better, using PointInSeg and compute
|
||||
|
@ -925,24 +927,24 @@ static void AdjustSegs(void)
|
|||
polyvertex_t *pv = HWR_AllocVertex();
|
||||
pv->x = FIXED_TO_FLOAT(lseg->v1->x);
|
||||
pv->y = FIXED_TO_FLOAT(lseg->v1->y);
|
||||
lseg->v1 = (vertex_t *)pv;
|
||||
lseg->pv1 = pv;
|
||||
}
|
||||
if (nearv2 <= NEARDIST*NEARDIST)
|
||||
lseg->v2 = (vertex_t *)&(p->pts[v2found]);
|
||||
if (p && nearv2 <= NEARDIST*NEARDIST)
|
||||
lseg->pv2 = &(p->pts[v2found]);
|
||||
else
|
||||
{
|
||||
polyvertex_t *pv = HWR_AllocVertex();
|
||||
pv->x = FIXED_TO_FLOAT(lseg->v2->x);
|
||||
pv->y = FIXED_TO_FLOAT(lseg->v2->y);
|
||||
lseg->v2 = (vertex_t *)pv;
|
||||
lseg->pv2 = pv;
|
||||
}
|
||||
|
||||
// recompute length
|
||||
{
|
||||
float x,y;
|
||||
x = ((polyvertex_t *)lseg->v2)->x - ((polyvertex_t *)lseg->v1)->x
|
||||
x = ((polyvertex_t *)lseg->pv2)->x - ((polyvertex_t *)lseg->pv1)->x
|
||||
+ FIXED_TO_FLOAT(FRACUNIT/2);
|
||||
y = ((polyvertex_t *)lseg->v2)->y - ((polyvertex_t *)lseg->v1)->y
|
||||
y = ((polyvertex_t *)lseg->pv2)->y - ((polyvertex_t *)lseg->pv1)->y
|
||||
+ FIXED_TO_FLOAT(FRACUNIT/2);
|
||||
lseg->flength = (float)hypot(x, y);
|
||||
// BP: debug see this kind of segs
|
||||
|
|
465
src/hardware/hw_clip.c
Normal file
465
src/hardware/hw_clip.c
Normal file
|
@ -0,0 +1,465 @@
|
|||
/* Emacs style mode select -*- C++ -*-
|
||||
*-----------------------------------------------------------------------------
|
||||
*
|
||||
*
|
||||
* PrBoom: a Doom port merged with LxDoom and LSDLDoom
|
||||
* based on BOOM, a modified and improved DOOM engine
|
||||
* Copyright (C) 1999 by
|
||||
* id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
|
||||
* Copyright (C) 1999-2000 by
|
||||
* Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
|
||||
* Copyright 2005, 2006 by
|
||||
* Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
*---------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
** gl_clipper.cpp
|
||||
**
|
||||
** Handles visibility checks.
|
||||
** Loosely based on the JDoom clipper.
|
||||
**
|
||||
**---------------------------------------------------------------------------
|
||||
** Copyright 2003 Tim Stump
|
||||
** All rights reserved.
|
||||
**
|
||||
** Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions
|
||||
** are met:
|
||||
**
|
||||
** 1. Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** 2. Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in the
|
||||
** documentation and/or other materials provided with the distribution.
|
||||
** 3. The name of the author may not be used to endorse or promote products
|
||||
** derived from this software without specific prior written permission.
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
**---------------------------------------------------------------------------
|
||||
**
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include "../v_video.h"
|
||||
#include "hw_clip.h"
|
||||
#include "hw_glob.h"
|
||||
#include "../r_state.h"
|
||||
#include "../tables.h"
|
||||
#include "r_opengl/r_opengl.h"
|
||||
|
||||
#ifdef HAVE_SPHEREFRUSTRUM
|
||||
static GLdouble viewMatrix[16];
|
||||
static GLdouble projMatrix[16];
|
||||
float frustum[6][4];
|
||||
#endif
|
||||
|
||||
typedef struct clipnode_s
|
||||
{
|
||||
struct clipnode_s *prev, *next;
|
||||
angle_t start, end;
|
||||
} clipnode_t;
|
||||
|
||||
clipnode_t *freelist;
|
||||
clipnode_t *clipnodes;
|
||||
clipnode_t *cliphead;
|
||||
|
||||
static clipnode_t * gld_clipnode_GetNew(void);
|
||||
static clipnode_t * gld_clipnode_NewRange(angle_t start, angle_t end);
|
||||
static boolean gld_clipper_IsRangeVisible(angle_t startAngle, angle_t endAngle);
|
||||
static void gld_clipper_AddClipRange(angle_t start, angle_t end);
|
||||
static void gld_clipper_RemoveRange(clipnode_t * range);
|
||||
static void gld_clipnode_Free(clipnode_t *node);
|
||||
|
||||
static clipnode_t * gld_clipnode_GetNew(void)
|
||||
{
|
||||
if (freelist)
|
||||
{
|
||||
clipnode_t * p = freelist;
|
||||
freelist = p->next;
|
||||
return p;
|
||||
}
|
||||
else
|
||||
{
|
||||
return (clipnode_t*)malloc(sizeof(clipnode_t));
|
||||
}
|
||||
}
|
||||
|
||||
static clipnode_t * gld_clipnode_NewRange(angle_t start, angle_t end)
|
||||
{
|
||||
clipnode_t * c = gld_clipnode_GetNew();
|
||||
c->start = start;
|
||||
c->end = end;
|
||||
c->next = c->prev=NULL;
|
||||
return c;
|
||||
}
|
||||
|
||||
boolean gld_clipper_SafeCheckRange(angle_t startAngle, angle_t endAngle)
|
||||
{
|
||||
if(startAngle > endAngle)
|
||||
{
|
||||
return (gld_clipper_IsRangeVisible(startAngle, ANGLE_MAX) || gld_clipper_IsRangeVisible(0, endAngle));
|
||||
}
|
||||
|
||||
return gld_clipper_IsRangeVisible(startAngle, endAngle);
|
||||
}
|
||||
|
||||
static boolean gld_clipper_IsRangeVisible(angle_t startAngle, angle_t endAngle)
|
||||
{
|
||||
clipnode_t *ci;
|
||||
ci = cliphead;
|
||||
|
||||
if (endAngle == 0 && ci && ci->start == 0)
|
||||
return false;
|
||||
|
||||
while (ci != NULL && ci->start < endAngle)
|
||||
{
|
||||
if (startAngle >= ci->start && endAngle <= ci->end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
ci = ci->next;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void gld_clipnode_Free(clipnode_t *node)
|
||||
{
|
||||
node->next = freelist;
|
||||
freelist = node;
|
||||
}
|
||||
|
||||
static void gld_clipper_RemoveRange(clipnode_t *range)
|
||||
{
|
||||
if (range == cliphead)
|
||||
{
|
||||
cliphead = cliphead->next;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (range->prev)
|
||||
{
|
||||
range->prev->next = range->next;
|
||||
}
|
||||
if (range->next)
|
||||
{
|
||||
range->next->prev = range->prev;
|
||||
}
|
||||
}
|
||||
|
||||
gld_clipnode_Free(range);
|
||||
}
|
||||
|
||||
void gld_clipper_SafeAddClipRange(angle_t startangle, angle_t endangle)
|
||||
{
|
||||
if(startangle > endangle)
|
||||
{
|
||||
// The range has to added in two parts.
|
||||
gld_clipper_AddClipRange(startangle, ANGLE_MAX);
|
||||
gld_clipper_AddClipRange(0, endangle);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Add the range as usual.
|
||||
gld_clipper_AddClipRange(startangle, endangle);
|
||||
}
|
||||
}
|
||||
|
||||
static void gld_clipper_AddClipRange(angle_t start, angle_t end)
|
||||
{
|
||||
clipnode_t *node, *temp, *prevNode, *node2, *delnode;
|
||||
|
||||
if (cliphead)
|
||||
{
|
||||
//check to see if range contains any old ranges
|
||||
node = cliphead;
|
||||
while (node != NULL && node->start < end)
|
||||
{
|
||||
if (node->start >= start && node->end <= end)
|
||||
{
|
||||
temp = node;
|
||||
node = node->next;
|
||||
gld_clipper_RemoveRange(temp);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (node->start <= start && node->end >= end)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
node = node->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//check to see if range overlaps a range (or possibly 2)
|
||||
node = cliphead;
|
||||
while (node != NULL && node->start <= end)
|
||||
{
|
||||
if (node->end >= start)
|
||||
{
|
||||
// we found the first overlapping node
|
||||
if (node->start > start)
|
||||
{
|
||||
// the new range overlaps with this node's start point
|
||||
node->start = start;
|
||||
}
|
||||
if (node->end < end)
|
||||
{
|
||||
node->end = end;
|
||||
}
|
||||
|
||||
node2 = node->next;
|
||||
while (node2 && node2->start <= node->end)
|
||||
{
|
||||
if (node2->end > node->end)
|
||||
{
|
||||
node->end = node2->end;
|
||||
}
|
||||
|
||||
delnode = node2;
|
||||
node2 = node2->next;
|
||||
gld_clipper_RemoveRange(delnode);
|
||||
}
|
||||
return;
|
||||
}
|
||||
node = node->next;
|
||||
}
|
||||
|
||||
//just add range
|
||||
node = cliphead;
|
||||
prevNode = NULL;
|
||||
temp = gld_clipnode_NewRange(start, end);
|
||||
while (node != NULL && node->start < end)
|
||||
{
|
||||
prevNode = node;
|
||||
node = node->next;
|
||||
}
|
||||
temp->next = node;
|
||||
if (node == NULL)
|
||||
{
|
||||
temp->prev = prevNode;
|
||||
if (prevNode)
|
||||
{
|
||||
prevNode->next = temp;
|
||||
}
|
||||
if (!cliphead)
|
||||
{
|
||||
cliphead = temp;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (node == cliphead)
|
||||
{
|
||||
cliphead->prev = temp;
|
||||
cliphead = temp;
|
||||
}
|
||||
else
|
||||
{
|
||||
temp->prev = prevNode;
|
||||
prevNode->next = temp;
|
||||
node->prev = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
temp = gld_clipnode_NewRange(start, end);
|
||||
cliphead = temp;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void gld_clipper_Clear(void)
|
||||
{
|
||||
clipnode_t *node = cliphead;
|
||||
clipnode_t *temp;
|
||||
|
||||
while (node != NULL)
|
||||
{
|
||||
temp = node;
|
||||
node = node->next;
|
||||
gld_clipnode_Free(temp);
|
||||
}
|
||||
|
||||
cliphead = NULL;
|
||||
}
|
||||
|
||||
#define RMUL (1.6f/1.333333f)
|
||||
|
||||
angle_t gld_FrustumAngle(void)
|
||||
{
|
||||
double floatangle;
|
||||
angle_t a1;
|
||||
|
||||
float tilt = (float)fabs(((double)(int)aimingangle) / ANG1);
|
||||
|
||||
// NEWCLIP TODO: SRB2CBTODO: make a global render_fov for this function
|
||||
|
||||
float render_fov = FIXED_TO_FLOAT(cv_grfov.value);
|
||||
float render_fovratio = (float)BASEVIDWIDTH / (float)BASEVIDHEIGHT; // SRB2CBTODO: NEWCLIPTODO: Is this right?
|
||||
float render_multiplier = 64.0f / render_fovratio / RMUL;
|
||||
|
||||
if (tilt > 90.0f)
|
||||
{
|
||||
tilt = 90.0f;
|
||||
}
|
||||
|
||||
// If the pitch is larger than this you can look all around at a FOV of 90
|
||||
if (aimingangle > (ANGLE_45+ANG1) && (ANGLE_315-ANG1) > aimingangle)
|
||||
return 0xffffffff;
|
||||
|
||||
// ok, this is a gross hack that barely works...
|
||||
// but at least it doesn't overestimate too much...
|
||||
floatangle = 2.0f + (45.0f + (tilt / 1.9f)) * (float)render_fov * 48.0f / render_multiplier / 90.0f;
|
||||
a1 = ANG1 * (int)floatangle;
|
||||
if (a1 >= ANGLE_180)
|
||||
return 0xffffffff;
|
||||
return a1;
|
||||
}
|
||||
|
||||
// SRB2CB I don't think used any of this stuff, let's disable for now since SRB2 probably doesn't want it either
|
||||
// compiler complains about (p)glGetDoublev anyway, in case anyone wants this
|
||||
// only r_opengl.c can use the base gl funcs as it turns out, that's a problem for whoever wants sphere frustum checks
|
||||
// btw to renable define HAVE_SPHEREFRUSTRUM in hw_clip.h
|
||||
#ifdef HAVE_SPHEREFRUSTRUM
|
||||
//
|
||||
// gld_FrustrumSetup
|
||||
//
|
||||
|
||||
#define CALCMATRIX(a, b, c, d, e, f, g, h)\
|
||||
(float)(viewMatrix[a] * projMatrix[b] + \
|
||||
viewMatrix[c] * projMatrix[d] + \
|
||||
viewMatrix[e] * projMatrix[f] + \
|
||||
viewMatrix[g] * projMatrix[h])
|
||||
|
||||
#define NORMALIZE_PLANE(i)\
|
||||
t = (float)sqrt(\
|
||||
frustum[i][0] * frustum[i][0] + \
|
||||
frustum[i][1] * frustum[i][1] + \
|
||||
frustum[i][2] * frustum[i][2]); \
|
||||
frustum[i][0] /= t; \
|
||||
frustum[i][1] /= t; \
|
||||
frustum[i][2] /= t; \
|
||||
frustum[i][3] /= t
|
||||
|
||||
void gld_FrustrumSetup(void)
|
||||
{
|
||||
float t;
|
||||
float clip[16];
|
||||
|
||||
pglGetDoublev(GL_PROJECTION_MATRIX, projMatrix);
|
||||
pglGetDoublev(GL_MODELVIEW_MATRIX, viewMatrix);
|
||||
|
||||
clip[0] = CALCMATRIX(0, 0, 1, 4, 2, 8, 3, 12);
|
||||
clip[1] = CALCMATRIX(0, 1, 1, 5, 2, 9, 3, 13);
|
||||
clip[2] = CALCMATRIX(0, 2, 1, 6, 2, 10, 3, 14);
|
||||
clip[3] = CALCMATRIX(0, 3, 1, 7, 2, 11, 3, 15);
|
||||
|
||||
clip[4] = CALCMATRIX(4, 0, 5, 4, 6, 8, 7, 12);
|
||||
clip[5] = CALCMATRIX(4, 1, 5, 5, 6, 9, 7, 13);
|
||||
clip[6] = CALCMATRIX(4, 2, 5, 6, 6, 10, 7, 14);
|
||||
clip[7] = CALCMATRIX(4, 3, 5, 7, 6, 11, 7, 15);
|
||||
|
||||
clip[8] = CALCMATRIX(8, 0, 9, 4, 10, 8, 11, 12);
|
||||
clip[9] = CALCMATRIX(8, 1, 9, 5, 10, 9, 11, 13);
|
||||
clip[10] = CALCMATRIX(8, 2, 9, 6, 10, 10, 11, 14);
|
||||
clip[11] = CALCMATRIX(8, 3, 9, 7, 10, 11, 11, 15);
|
||||
|
||||
clip[12] = CALCMATRIX(12, 0, 13, 4, 14, 8, 15, 12);
|
||||
clip[13] = CALCMATRIX(12, 1, 13, 5, 14, 9, 15, 13);
|
||||
clip[14] = CALCMATRIX(12, 2, 13, 6, 14, 10, 15, 14);
|
||||
clip[15] = CALCMATRIX(12, 3, 13, 7, 14, 11, 15, 15);
|
||||
|
||||
// Right plane
|
||||
frustum[0][0] = clip[ 3] - clip[ 0];
|
||||
frustum[0][1] = clip[ 7] - clip[ 4];
|
||||
frustum[0][2] = clip[11] - clip[ 8];
|
||||
frustum[0][3] = clip[15] - clip[12];
|
||||
NORMALIZE_PLANE(0);
|
||||
|
||||
// Left plane
|
||||
frustum[1][0] = clip[ 3] + clip[ 0];
|
||||
frustum[1][1] = clip[ 7] + clip[ 4];
|
||||
frustum[1][2] = clip[11] + clip[ 8];
|
||||
frustum[1][3] = clip[15] + clip[12];
|
||||
NORMALIZE_PLANE(1);
|
||||
|
||||
// Bottom plane
|
||||
frustum[2][0] = clip[ 3] + clip[ 1];
|
||||
frustum[2][1] = clip[ 7] + clip[ 5];
|
||||
frustum[2][2] = clip[11] + clip[ 9];
|
||||
frustum[2][3] = clip[15] + clip[13];
|
||||
NORMALIZE_PLANE(2);
|
||||
|
||||
// Top plane
|
||||
frustum[3][0] = clip[ 3] - clip[ 1];
|
||||
frustum[3][1] = clip[ 7] - clip[ 5];
|
||||
frustum[3][2] = clip[11] - clip[ 9];
|
||||
frustum[3][3] = clip[15] - clip[13];
|
||||
NORMALIZE_PLANE(3);
|
||||
|
||||
// Far plane
|
||||
frustum[4][0] = clip[ 3] - clip[ 2];
|
||||
frustum[4][1] = clip[ 7] - clip[ 6];
|
||||
frustum[4][2] = clip[11] - clip[10];
|
||||
frustum[4][3] = clip[15] - clip[14];
|
||||
NORMALIZE_PLANE(4);
|
||||
|
||||
// Near plane
|
||||
frustum[5][0] = clip[ 3] + clip[ 2];
|
||||
frustum[5][1] = clip[ 7] + clip[ 6];
|
||||
frustum[5][2] = clip[11] + clip[10];
|
||||
frustum[5][3] = clip[15] + clip[14];
|
||||
NORMALIZE_PLANE(5);
|
||||
}
|
||||
|
||||
boolean gld_SphereInFrustum(float x, float y, float z, float radius)
|
||||
{
|
||||
int p;
|
||||
|
||||
for (p = 0; p < 4; p++)
|
||||
{
|
||||
if (frustum[p][0] * x +
|
||||
frustum[p][1] * y +
|
||||
frustum[p][2] * z +
|
||||
frustum[p][3] <= -radius)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
24
src/hardware/hw_clip.h
Normal file
24
src/hardware/hw_clip.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* hw_clip.h
|
||||
* SRB2CB
|
||||
*
|
||||
* PrBoom's OpenGL clipping
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
// OpenGL BSP clipping
|
||||
#include "../doomdef.h"
|
||||
#include "../tables.h"
|
||||
#include "../doomtype.h"
|
||||
|
||||
//#define HAVE_SPHEREFRUSTRUM // enable if you want gld_SphereInFrustum and related code
|
||||
|
||||
boolean gld_clipper_SafeCheckRange(angle_t startAngle, angle_t endAngle);
|
||||
void gld_clipper_SafeAddClipRange(angle_t startangle, angle_t endangle);
|
||||
void gld_clipper_Clear(void);
|
||||
angle_t gld_FrustumAngle(void);
|
||||
#ifdef HAVE_SPHEREFRUSTRUM
|
||||
void gld_FrustrumSetup(void);
|
||||
boolean gld_SphereInFrustum(float x, float y, float z, float radius);
|
||||
#endif
|
|
@ -20,7 +20,7 @@
|
|||
#ifndef _HWR_DATA_
|
||||
#define _HWR_DATA_
|
||||
|
||||
#if defined (_WIN32) && !defined (__CYGWIN__) && !defined (_XBOX)
|
||||
#if defined (_WIN32) && !defined (__CYGWIN__)
|
||||
//#define WIN32_LEAN_AND_MEAN
|
||||
#define RPC_NO_WINDOWS_H
|
||||
#include <windows.h>
|
||||
|
@ -88,7 +88,7 @@ struct GLPatch_s
|
|||
UINT16 wadnum; // the software patch lump num for when the hardware patch
|
||||
UINT16 lumpnum; // was flushed, and we need to re-create it
|
||||
GLMipmap_t mipmap;
|
||||
} ATTRPACK;
|
||||
};
|
||||
typedef struct GLPatch_s GLPatch_t;
|
||||
|
||||
#endif //_HWR_DATA_
|
||||
|
|
|
@ -41,14 +41,8 @@ typedef unsigned char FBOOLEAN;
|
|||
// ==========================================================================
|
||||
|
||||
// byte value for paletted graphics, which represent the transparent color
|
||||
#ifdef _NDS
|
||||
// NDS is hardwired to use zero as transparent color
|
||||
#define HWR_PATCHES_CHROMAKEY_COLORINDEX 0
|
||||
#define HWR_CHROMAKEY_EQUIVALENTCOLORINDEX 1
|
||||
#else
|
||||
#define HWR_PATCHES_CHROMAKEY_COLORINDEX 255
|
||||
#define HWR_CHROMAKEY_EQUIVALENTCOLORINDEX 130
|
||||
#endif
|
||||
|
||||
// the chroma key color shows on border sprites, set it to black
|
||||
#define HWR_PATCHES_CHROMAKEY_COLORVALUE (0x00000000) //RGBA format as in grSstWinOpen()
|
||||
|
|
|
@ -40,14 +40,14 @@
|
|||
#define EXPORT
|
||||
#endif
|
||||
#endif
|
||||
#if defined (_WIN32) && !defined (_XBOX)
|
||||
#ifdef _WIN32
|
||||
#define HWRAPI(fn) WINAPI fn
|
||||
#else
|
||||
#define HWRAPI(fn) fn
|
||||
#endif
|
||||
#else // _CREATE_DLL_
|
||||
#define EXPORT typedef
|
||||
#if defined (_WIN32) && !defined (_XBOX)
|
||||
#ifdef _WIN32
|
||||
#define HWRAPI(fn) (WINAPI *fn)
|
||||
#else
|
||||
#define HWRAPI(fn) (*fn)
|
||||
|
|
|
@ -323,6 +323,10 @@ light_t *t_lspr[NUMSPRITES] =
|
|||
&lspr[NOLIGHT], // SPR_BMCH
|
||||
&lspr[NOLIGHT], // SPR_SMCE
|
||||
&lspr[NOLIGHT], // SPR_BMCE
|
||||
&lspr[NOLIGHT], // SPR_YSPB
|
||||
&lspr[NOLIGHT], // SPR_RSPB
|
||||
&lspr[REDBALL_L], // SPR_SFBR
|
||||
&lspr[REDBALL_L], // SPR_BFBR
|
||||
|
||||
// Arid Canyon Scenery
|
||||
&lspr[NOLIGHT], // SPR_BTBL
|
||||
|
|
|
@ -44,6 +44,10 @@
|
|||
#endif
|
||||
#include "hw_md2.h"
|
||||
|
||||
#ifdef NEWCLIP
|
||||
#include "hw_clip.h"
|
||||
#endif
|
||||
|
||||
#define R_FAKEFLOORS
|
||||
#define HWPRECIP
|
||||
#define SORTING
|
||||
|
@ -99,8 +103,9 @@ CV_PossibleValue_t granisotropicmode_cons_t[] = {{1, "MIN"}, {16, "MAX"}, {0, NU
|
|||
boolean drawsky = true;
|
||||
|
||||
// needs fix: walls are incorrectly clipped one column less
|
||||
#ifndef NEWCLIP
|
||||
static consvar_t cv_grclipwalls = {"gr_clipwalls", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
#endif
|
||||
//development variables for diverse uses
|
||||
static consvar_t cv_gralpha = {"gr_alpha", "160", 0, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
static consvar_t cv_grbeta = {"gr_beta", "0", 0, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
@ -323,9 +328,6 @@ static angle_t gr_xtoviewangle[MAXVIDWIDTH+1];
|
|||
// test change fov when looking up/down but bsp projection messup :(
|
||||
//#define NOCRAPPYMLOOK
|
||||
|
||||
/// \note crappy
|
||||
#define drawtextured true
|
||||
|
||||
// base values set at SetViewSize
|
||||
static float gr_basecentery;
|
||||
|
||||
|
@ -641,13 +643,13 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
|
|||
{
|
||||
scrollx = FIXED_TO_FLOAT(FOFsector->floor_xoffs)/fflatsize;
|
||||
scrolly = FIXED_TO_FLOAT(FOFsector->floor_yoffs)/fflatsize;
|
||||
angle = FOFsector->floorpic_angle>>ANGLETOFINESHIFT;
|
||||
angle = FOFsector->floorpic_angle;
|
||||
}
|
||||
else // it's a ceiling
|
||||
{
|
||||
scrollx = FIXED_TO_FLOAT(FOFsector->ceiling_xoffs)/fflatsize;
|
||||
scrolly = FIXED_TO_FLOAT(FOFsector->ceiling_yoffs)/fflatsize;
|
||||
angle = FOFsector->ceilingpic_angle>>ANGLETOFINESHIFT;
|
||||
angle = FOFsector->ceilingpic_angle;
|
||||
}
|
||||
}
|
||||
else if (gr_frontsector)
|
||||
|
@ -656,25 +658,19 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
|
|||
{
|
||||
scrollx = FIXED_TO_FLOAT(gr_frontsector->floor_xoffs)/fflatsize;
|
||||
scrolly = FIXED_TO_FLOAT(gr_frontsector->floor_yoffs)/fflatsize;
|
||||
angle = gr_frontsector->floorpic_angle>>ANGLETOFINESHIFT;
|
||||
angle = gr_frontsector->floorpic_angle;
|
||||
}
|
||||
else // it's a ceiling
|
||||
{
|
||||
scrollx = FIXED_TO_FLOAT(gr_frontsector->ceiling_xoffs)/fflatsize;
|
||||
scrolly = FIXED_TO_FLOAT(gr_frontsector->ceiling_yoffs)/fflatsize;
|
||||
angle = gr_frontsector->ceilingpic_angle>>ANGLETOFINESHIFT;
|
||||
angle = gr_frontsector->ceilingpic_angle;
|
||||
}
|
||||
}
|
||||
|
||||
if (angle) // Only needs to be done if there's an altered angle
|
||||
{
|
||||
|
||||
// This needs to be done so that it scrolls in a different direction after rotation like software
|
||||
tempxsow = FLOAT_TO_FIXED(scrollx);
|
||||
tempytow = FLOAT_TO_FIXED(scrolly);
|
||||
scrollx = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINECOSINE(angle)) - FixedMul(tempytow, FINESINE(angle))));
|
||||
scrolly = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINESINE(angle)) + FixedMul(tempytow, FINECOSINE(angle))));
|
||||
|
||||
angle = InvAngle(angle)>>ANGLETOFINESHIFT;
|
||||
// This needs to be done so everything aligns after rotation
|
||||
// It would be done so that rotation is done, THEN the translation, but I couldn't get it to rotate AND scroll like software does
|
||||
tempxsow = FLOAT_TO_FIXED(flatxref);
|
||||
|
@ -687,7 +683,7 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
|
|||
{
|
||||
// Hurdler: add scrolling texture on floor/ceiling
|
||||
v3d->sow = (float)((pv->x / fflatsize) - flatxref + scrollx);
|
||||
v3d->tow = (float)(flatyref - (pv->y / fflatsize) + scrolly);
|
||||
v3d->tow = (float)(-(pv->y / fflatsize) + flatyref + scrolly);
|
||||
|
||||
//v3d->sow = (float)(pv->x / fflatsize);
|
||||
//v3d->tow = (float)(pv->y / fflatsize);
|
||||
|
@ -698,7 +694,7 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
|
|||
tempxsow = FLOAT_TO_FIXED(v3d->sow);
|
||||
tempytow = FLOAT_TO_FIXED(v3d->tow);
|
||||
v3d->sow = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINECOSINE(angle)) - FixedMul(tempytow, FINESINE(angle))));
|
||||
v3d->tow = (FIXED_TO_FLOAT(-FixedMul(tempxsow, FINESINE(angle)) - FixedMul(tempytow, FINECOSINE(angle))));
|
||||
v3d->tow = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINESINE(angle)) + FixedMul(tempytow, FINECOSINE(angle))));
|
||||
}
|
||||
|
||||
//v3d->sow = (float)(v3d->sow - flatxref + scrollx);
|
||||
|
@ -858,11 +854,11 @@ static void HWR_DrawSegsSplats(FSurfaceInfo * pSurf)
|
|||
|
||||
M_ClearBox(segbbox);
|
||||
M_AddToBox(segbbox,
|
||||
FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->v1)->x),
|
||||
FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->v1)->y));
|
||||
FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->pv1)->x),
|
||||
FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->pv1)->y));
|
||||
M_AddToBox(segbbox,
|
||||
FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->v2)->x),
|
||||
FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->v2)->y));
|
||||
FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->pv2)->x),
|
||||
FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->pv2)->y));
|
||||
|
||||
splat = (wallsplat_t *)gr_curline->linedef->splats;
|
||||
for (; splat; splat = splat->next)
|
||||
|
@ -1035,6 +1031,7 @@ static void HWR_ProjectWall(wallVert3D * wallVerts,
|
|||
// (in fact a clipping plane that has a constant, so can clip with simple 2d)
|
||||
// with the wall segment
|
||||
//
|
||||
#ifndef NEWCLIP
|
||||
static float HWR_ClipViewSegment(INT32 x, polyvertex_t *v1, polyvertex_t *v2)
|
||||
{
|
||||
float num, den;
|
||||
|
@ -1063,6 +1060,7 @@ static float HWR_ClipViewSegment(INT32 x, polyvertex_t *v1, polyvertex_t *v2)
|
|||
|
||||
return num / den;
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// HWR_SplitWall
|
||||
|
@ -1437,7 +1435,11 @@ static void HWR_DrawSkyWall(wallVert3D *wallVerts, FSurfaceInfo *Surf, fixed_t b
|
|||
// Anything between means the wall segment has been clipped with solidsegs,
|
||||
// reducing wall overdraw to a minimum
|
||||
//
|
||||
#ifdef NEWCLIP
|
||||
static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
#else
|
||||
static void HWR_StoreWallRange(double startfrac, double endfrac)
|
||||
#endif
|
||||
{
|
||||
wallVert3D wallVerts[4];
|
||||
v2d_t vs, ve; // start, end vertices of 2d line (view from above)
|
||||
|
@ -1462,16 +1464,18 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
extracolormap_t *colormap;
|
||||
FSurfaceInfo Surf;
|
||||
|
||||
#ifndef NEWCLIP
|
||||
if (startfrac > endfrac)
|
||||
return;
|
||||
#endif
|
||||
|
||||
gr_sidedef = gr_curline->sidedef;
|
||||
gr_linedef = gr_curline->linedef;
|
||||
|
||||
vs.x = ((polyvertex_t *)gr_curline->v1)->x;
|
||||
vs.y = ((polyvertex_t *)gr_curline->v1)->y;
|
||||
ve.x = ((polyvertex_t *)gr_curline->v2)->x;
|
||||
ve.y = ((polyvertex_t *)gr_curline->v2)->y;
|
||||
vs.x = ((polyvertex_t *)gr_curline->pv1)->x;
|
||||
vs.y = ((polyvertex_t *)gr_curline->pv1)->y;
|
||||
ve.x = ((polyvertex_t *)gr_curline->pv2)->x;
|
||||
ve.y = ((polyvertex_t *)gr_curline->pv2)->y;
|
||||
|
||||
#ifdef ESLOPE
|
||||
v1x = FLOAT_TO_FIXED(vs.x);
|
||||
|
@ -1479,44 +1483,21 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
v2x = FLOAT_TO_FIXED(ve.x);
|
||||
v2y = FLOAT_TO_FIXED(ve.y);
|
||||
#endif
|
||||
|
||||
if (gr_frontsector->heightsec != -1)
|
||||
{
|
||||
#ifdef ESLOPE
|
||||
worldtop = worldtopslope = sectors[gr_frontsector->heightsec].ceilingheight;
|
||||
worldbottom = worldbottomslope = sectors[gr_frontsector->heightsec].floorheight;
|
||||
#else
|
||||
worldtop = sectors[gr_frontsector->heightsec].ceilingheight;
|
||||
worldbottom = sectors[gr_frontsector->heightsec].floorheight;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef ESLOPE
|
||||
if (gr_frontsector->c_slope)
|
||||
{
|
||||
worldtop = P_GetZAt(gr_frontsector->c_slope, v1x, v1y);
|
||||
worldtopslope = P_GetZAt(gr_frontsector->c_slope, v2x, v2y);
|
||||
}
|
||||
else
|
||||
{
|
||||
worldtop = worldtopslope = gr_frontsector->ceilingheight;
|
||||
}
|
||||
|
||||
if (gr_frontsector->f_slope)
|
||||
{
|
||||
worldbottom = P_GetZAt(gr_frontsector->f_slope, v1x, v1y);
|
||||
worldbottomslope = P_GetZAt(gr_frontsector->f_slope, v2x, v2y);
|
||||
}
|
||||
else
|
||||
{
|
||||
worldbottom = worldbottomslope = gr_frontsector->floorheight;
|
||||
}
|
||||
#define SLOPEPARAMS(slope, end1, end2, normalheight) \
|
||||
if (slope) { \
|
||||
end1 = P_GetZAt(slope, v1x, v1y); \
|
||||
end2 = P_GetZAt(slope, v2x, v2y); \
|
||||
} else \
|
||||
end1 = end2 = normalheight;
|
||||
|
||||
SLOPEPARAMS(gr_frontsector->c_slope, worldtop, worldtopslope, gr_frontsector->ceilingheight)
|
||||
SLOPEPARAMS(gr_frontsector->f_slope, worldbottom, worldbottomslope, gr_frontsector->floorheight)
|
||||
#else
|
||||
worldtop = gr_frontsector->ceilingheight;
|
||||
worldbottom = gr_frontsector->floorheight;
|
||||
#endif
|
||||
}
|
||||
|
||||
// remember vertices ordering
|
||||
// 3--2
|
||||
|
@ -1531,20 +1512,23 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
wallVerts[2].z = wallVerts[1].z = ve.y;
|
||||
wallVerts[0].w = wallVerts[1].w = wallVerts[2].w = wallVerts[3].w = 1.0f;
|
||||
|
||||
if (drawtextured)
|
||||
{
|
||||
// x offset the texture
|
||||
fixed_t texturehpeg = gr_sidedef->textureoffset + gr_curline->offset;
|
||||
|
||||
#ifndef NEWCLIP
|
||||
// clip texture s start/end coords with solidsegs
|
||||
if (startfrac > 0.0f && startfrac < 1.0f)
|
||||
cliplow = (float)(texturehpeg + (gr_curline->flength*FRACUNIT) * startfrac);
|
||||
else
|
||||
#endif
|
||||
cliplow = (float)texturehpeg;
|
||||
|
||||
#ifndef NEWCLIP
|
||||
if (endfrac > 0.0f && endfrac < 1.0f)
|
||||
cliphigh = (float)(texturehpeg + (gr_curline->flength*FRACUNIT) * endfrac);
|
||||
else
|
||||
#endif
|
||||
cliphigh = (float)(texturehpeg + (gr_curline->flength*FRACUNIT));
|
||||
}
|
||||
|
||||
|
@ -1560,43 +1544,15 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
{
|
||||
INT32 gr_toptexture, gr_bottomtexture;
|
||||
// two sided line
|
||||
if (gr_backsector->heightsec != -1)
|
||||
{
|
||||
#ifdef ESLOPE
|
||||
worldhigh = worldhighslope = sectors[gr_backsector->heightsec].ceilingheight;
|
||||
worldlow = worldlowslope = sectors[gr_backsector->heightsec].floorheight;
|
||||
#else
|
||||
worldhigh = sectors[gr_backsector->heightsec].ceilingheight;
|
||||
worldlow = sectors[gr_backsector->heightsec].floorheight;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef ESLOPE
|
||||
if (gr_backsector->c_slope)
|
||||
{
|
||||
worldhigh = P_GetZAt(gr_backsector->c_slope, v1x, v1y);
|
||||
worldhighslope = P_GetZAt(gr_backsector->c_slope, v2x, v2y);
|
||||
}
|
||||
else
|
||||
{
|
||||
worldhigh = worldhighslope = gr_backsector->ceilingheight;
|
||||
}
|
||||
|
||||
if (gr_backsector->f_slope)
|
||||
{
|
||||
worldlow = P_GetZAt(gr_backsector->f_slope, v1x, v1y);
|
||||
worldlowslope = P_GetZAt(gr_backsector->f_slope, v2x, v2y);
|
||||
}
|
||||
else
|
||||
{
|
||||
worldlow = worldlowslope = gr_backsector->floorheight;
|
||||
}
|
||||
#ifdef ESLOPE
|
||||
SLOPEPARAMS(gr_backsector->c_slope, worldhigh, worldhighslope, gr_backsector->ceilingheight)
|
||||
SLOPEPARAMS(gr_backsector->f_slope, worldlow, worldlowslope, gr_backsector->floorheight)
|
||||
#undef SLOPEPARAMS
|
||||
#else
|
||||
worldhigh = gr_backsector->ceilingheight;
|
||||
worldlow = gr_backsector->floorheight;
|
||||
#endif
|
||||
}
|
||||
|
||||
// hack to allow height changes in outdoor areas
|
||||
// This is what gets rid of the upper textures if there should be sky
|
||||
|
@ -1620,7 +1576,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
worldhigh < worldtop
|
||||
) && gr_toptexture)
|
||||
{
|
||||
if (drawtextured)
|
||||
{
|
||||
fixed_t texturevpegtop; // top
|
||||
|
||||
|
@ -1701,7 +1656,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
#endif
|
||||
worldlow > worldbottom) && gr_bottomtexture) //only if VISIBLE!!!
|
||||
{
|
||||
if (drawtextured)
|
||||
{
|
||||
fixed_t texturevpegbottom = 0; // bottom
|
||||
|
||||
|
@ -1893,7 +1847,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
h = min(highcut, polytop);
|
||||
l = max(polybottom, lowcut);
|
||||
|
||||
if (drawtextured)
|
||||
{
|
||||
// PEGGING
|
||||
#ifdef ESLOPE
|
||||
|
@ -1949,7 +1902,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
h = min(highcut, polytop);
|
||||
l = max(polybottom, lowcut);
|
||||
|
||||
if (drawtextured)
|
||||
{
|
||||
// PEGGING
|
||||
if (!!(gr_linedef->flags & ML_DONTPEGBOTTOM) ^ !!(gr_linedef->flags & ML_EFFECT3))
|
||||
|
@ -2141,7 +2093,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
gr_midtexture = R_GetTextureNum(gr_sidedef->midtexture);
|
||||
if (gr_midtexture)
|
||||
{
|
||||
if (drawtextured)
|
||||
{
|
||||
fixed_t texturevpeg;
|
||||
// PEGGING
|
||||
|
@ -2282,7 +2233,7 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
wallVerts[0].s = wallVerts[3].s = 0;
|
||||
wallVerts[2].s = wallVerts[1].s = 0;
|
||||
}
|
||||
else if (drawtextured)
|
||||
else
|
||||
{
|
||||
#ifdef ESLOPE // P.S. this is better-organized than the old version
|
||||
fixed_t offs = sides[(newline ? newline : rover->master)->sidenum[0]].rowoffset;
|
||||
|
@ -2415,7 +2366,7 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
wallVerts[0].s = wallVerts[3].s = 0;
|
||||
wallVerts[2].s = wallVerts[1].s = 0;
|
||||
}
|
||||
else if (drawtextured)
|
||||
else
|
||||
{
|
||||
grTex = HWR_GetTexture(texnum);
|
||||
|
||||
|
@ -2488,6 +2439,110 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
//Hurdler: end of 3d-floors test
|
||||
}
|
||||
|
||||
// From PrBoom:
|
||||
//
|
||||
// e6y: Check whether the player can look beyond this line
|
||||
//
|
||||
#ifdef NEWCLIP
|
||||
boolean checkforemptylines = true;
|
||||
// Don't modify anything here, just check
|
||||
// Kalaron: Modified for sloped linedefs
|
||||
static boolean CheckClip(seg_t * seg, sector_t * afrontsector, sector_t * abacksector)
|
||||
{
|
||||
fixed_t frontf1,frontf2, frontc1, frontc2; // front floor/ceiling ends
|
||||
fixed_t backf1, backf2, backc1, backc2; // back floor ceiling ends
|
||||
|
||||
// GZDoom method of sloped line clipping
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (afrontsector->f_slope || afrontsector->c_slope || abacksector->f_slope || abacksector->c_slope)
|
||||
{
|
||||
fixed_t v1x, v1y, v2x, v2y; // the seg's vertexes as fixed_t
|
||||
v1x = FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->pv1)->x);
|
||||
v1y = FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->pv1)->y);
|
||||
v2x = FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->pv2)->x);
|
||||
v2y = FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->pv2)->y);
|
||||
#define SLOPEPARAMS(slope, end1, end2, normalheight) \
|
||||
if (slope) { \
|
||||
end1 = P_GetZAt(slope, v1x, v1y); \
|
||||
end2 = P_GetZAt(slope, v2x, v2y); \
|
||||
} else \
|
||||
end1 = end2 = normalheight;
|
||||
|
||||
SLOPEPARAMS(afrontsector->f_slope, frontf1, frontf2, afrontsector->floorheight)
|
||||
SLOPEPARAMS(afrontsector->c_slope, frontc1, frontc2, afrontsector->ceilingheight)
|
||||
SLOPEPARAMS( abacksector->f_slope, backf1, backf2, abacksector->floorheight)
|
||||
SLOPEPARAMS( abacksector->c_slope, backc1, backc2, abacksector->ceilingheight)
|
||||
#undef SLOPEPARAMS
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
frontf1 = frontf2 = afrontsector->floorheight;
|
||||
frontc1 = frontc2 = afrontsector->ceilingheight;
|
||||
backf1 = backf2 = abacksector->floorheight;
|
||||
backc1 = backc2 = abacksector->ceilingheight;
|
||||
}
|
||||
|
||||
// now check for closed sectors!
|
||||
if (backc1 <= frontf1 && backc2 <= frontf2)
|
||||
{
|
||||
checkforemptylines = false;
|
||||
if (!seg->sidedef->toptexture)
|
||||
return false;
|
||||
|
||||
if (abacksector->ceilingpic == skyflatnum && afrontsector->ceilingpic == skyflatnum)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (backf1 >= frontc1 && backf2 >= frontc2)
|
||||
{
|
||||
checkforemptylines = false;
|
||||
if (!seg->sidedef->bottomtexture)
|
||||
return false;
|
||||
|
||||
// properly render skies (consider door "open" if both floors are sky):
|
||||
if (abacksector->ceilingpic == skyflatnum && afrontsector->ceilingpic == skyflatnum)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (backc1 <= backf1 && backc2 <= backf2)
|
||||
{
|
||||
checkforemptylines = false;
|
||||
// preserve a kind of transparent door/lift special effect:
|
||||
if (backc1 < frontc1 || backc2 < frontc2)
|
||||
{
|
||||
if (!seg->sidedef->toptexture)
|
||||
return false;
|
||||
}
|
||||
if (backf1 > frontf1 || backf2 > frontf2)
|
||||
{
|
||||
if (!seg->sidedef->bottomtexture)
|
||||
return false;
|
||||
}
|
||||
if (abacksector->ceilingpic == skyflatnum && afrontsector->ceilingpic == skyflatnum)
|
||||
return false;
|
||||
|
||||
if (abacksector->floorpic == skyflatnum && afrontsector->floorpic == skyflatnum)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (backc1 != frontc1 || backc2 != frontc2
|
||||
|| backf1 != frontf1 || backf2 != frontf2)
|
||||
{
|
||||
checkforemptylines = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
//Hurdler: just like in r_bsp.c
|
||||
#if 1
|
||||
#define MAXSEGS MAXVIDWIDTH/2+1
|
||||
|
@ -2559,7 +2614,7 @@ static void HWR_ClipSolidWallSegment(INT32 first, INT32 last)
|
|||
}
|
||||
else
|
||||
{
|
||||
highfrac = HWR_ClipViewSegment(start->first+1, (polyvertex_t *)gr_curline->v1, (polyvertex_t *)gr_curline->v2);
|
||||
highfrac = HWR_ClipViewSegment(start->first+1, (polyvertex_t *)gr_curline->pv1, (polyvertex_t *)gr_curline->pv2);
|
||||
HWR_StoreWallRange(0, highfrac);
|
||||
}
|
||||
// Now adjust the clip size.
|
||||
|
@ -2583,8 +2638,8 @@ static void HWR_ClipSolidWallSegment(INT32 first, INT32 last)
|
|||
}
|
||||
else
|
||||
{
|
||||
lowfrac = HWR_ClipViewSegment(next->last-1, (polyvertex_t *)gr_curline->v1, (polyvertex_t *)gr_curline->v2);
|
||||
highfrac = HWR_ClipViewSegment((next+1)->first+1, (polyvertex_t *)gr_curline->v1, (polyvertex_t *)gr_curline->v2);
|
||||
lowfrac = HWR_ClipViewSegment(next->last-1, (polyvertex_t *)gr_curline->pv1, (polyvertex_t *)gr_curline->pv2);
|
||||
highfrac = HWR_ClipViewSegment((next+1)->first+1, (polyvertex_t *)gr_curline->pv1, (polyvertex_t *)gr_curline->pv2);
|
||||
HWR_StoreWallRange(lowfrac, highfrac);
|
||||
}
|
||||
next++;
|
||||
|
@ -2618,7 +2673,7 @@ static void HWR_ClipSolidWallSegment(INT32 first, INT32 last)
|
|||
}
|
||||
else
|
||||
{
|
||||
lowfrac = HWR_ClipViewSegment(next->last-1, (polyvertex_t *)gr_curline->v1, (polyvertex_t *)gr_curline->v2);
|
||||
lowfrac = HWR_ClipViewSegment(next->last-1, (polyvertex_t *)gr_curline->pv1, (polyvertex_t *)gr_curline->pv2);
|
||||
HWR_StoreWallRange(lowfrac, 1);
|
||||
}
|
||||
}
|
||||
|
@ -2681,8 +2736,8 @@ static void HWR_ClipPassWallSegment(INT32 first, INT32 last)
|
|||
else
|
||||
{
|
||||
highfrac = HWR_ClipViewSegment(min(start->first + 1,
|
||||
start->last), (polyvertex_t *)gr_curline->v1,
|
||||
(polyvertex_t *)gr_curline->v2);
|
||||
start->last), (polyvertex_t *)gr_curline->pv1,
|
||||
(polyvertex_t *)gr_curline->pv2);
|
||||
HWR_StoreWallRange(0, highfrac);
|
||||
}
|
||||
}
|
||||
|
@ -2701,8 +2756,8 @@ static void HWR_ClipPassWallSegment(INT32 first, INT32 last)
|
|||
}
|
||||
else
|
||||
{
|
||||
lowfrac = HWR_ClipViewSegment(max(start->last-1,start->first), (polyvertex_t *)gr_curline->v1, (polyvertex_t *)gr_curline->v2);
|
||||
highfrac = HWR_ClipViewSegment(min((start+1)->first+1,(start+1)->last), (polyvertex_t *)gr_curline->v1, (polyvertex_t *)gr_curline->v2);
|
||||
lowfrac = HWR_ClipViewSegment(max(start->last-1,start->first), (polyvertex_t *)gr_curline->pv1, (polyvertex_t *)gr_curline->pv2);
|
||||
highfrac = HWR_ClipViewSegment(min((start+1)->first+1,(start+1)->last), (polyvertex_t *)gr_curline->pv1, (polyvertex_t *)gr_curline->pv2);
|
||||
HWR_StoreWallRange(lowfrac, highfrac);
|
||||
}
|
||||
start++;
|
||||
|
@ -2732,8 +2787,8 @@ static void HWR_ClipPassWallSegment(INT32 first, INT32 last)
|
|||
else
|
||||
{
|
||||
lowfrac = HWR_ClipViewSegment(max(start->last - 1,
|
||||
start->first), (polyvertex_t *)gr_curline->v1,
|
||||
(polyvertex_t *)gr_curline->v2);
|
||||
start->first), (polyvertex_t *)gr_curline->pv1,
|
||||
(polyvertex_t *)gr_curline->pv2);
|
||||
HWR_StoreWallRange(lowfrac, 1);
|
||||
}
|
||||
}
|
||||
|
@ -2773,6 +2828,7 @@ static void HWR_ClearClipSegs(void)
|
|||
gr_solidsegs[1].last = 0x7fffffff;
|
||||
hw_newend = gr_solidsegs+2;
|
||||
}
|
||||
#endif // NEWCLIP
|
||||
|
||||
// -----------------+
|
||||
// HWR_AddLine : Clips the given segment and adds any visible pieces to the line list.
|
||||
|
@ -2781,24 +2837,46 @@ static void HWR_ClearClipSegs(void)
|
|||
// -----------------+
|
||||
static void HWR_AddLine(seg_t * line)
|
||||
{
|
||||
INT32 x1, x2;
|
||||
angle_t angle1, angle2;
|
||||
#ifndef NEWCLIP
|
||||
INT32 x1, x2;
|
||||
angle_t span, tspan;
|
||||
#endif
|
||||
|
||||
// SoM: Backsector needs to be run through R_FakeFlat
|
||||
sector_t tempsec;
|
||||
|
||||
fixed_t v1x, v1y, v2x, v2y; // the seg's vertexes as fixed_t
|
||||
#ifdef POLYOBJECTS
|
||||
if (line->polyseg && !(line->polyseg->flags & POF_RENDERSIDES))
|
||||
return;
|
||||
#endif
|
||||
|
||||
gr_curline = line;
|
||||
|
||||
// OPTIMIZE: quickly reject orthogonal back sides.
|
||||
angle1 = R_PointToAngle(FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->v1)->x),
|
||||
FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->v1)->y));
|
||||
angle2 = R_PointToAngle(FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->v2)->x),
|
||||
FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->v2)->y));
|
||||
v1x = FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->pv1)->x);
|
||||
v1y = FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->pv1)->y);
|
||||
v2x = FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->pv2)->x);
|
||||
v2y = FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->pv2)->y);
|
||||
|
||||
// OPTIMIZE: quickly reject orthogonal back sides.
|
||||
angle1 = R_PointToAngle(v1x, v1y);
|
||||
angle2 = R_PointToAngle(v2x, v2y);
|
||||
|
||||
#ifdef NEWCLIP
|
||||
// PrBoom: Back side, i.e. backface culling - read: endAngle >= startAngle!
|
||||
if (angle2 - angle1 < ANGLE_180)
|
||||
return;
|
||||
|
||||
// PrBoom: use REAL clipping math YAYYYYYYY!!!
|
||||
|
||||
if (!gld_clipper_SafeCheckRange(angle2, angle1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
checkforemptylines = true;
|
||||
#else
|
||||
// Clip to view edges.
|
||||
span = angle1 - angle2;
|
||||
|
||||
|
@ -2839,8 +2917,8 @@ static void HWR_AddLine(seg_t * line)
|
|||
float fx1,fx2,fy1,fy2;
|
||||
//BP: test with a better projection than viewangletox[R_PointToAngle(angle)]
|
||||
// do not enable this at release 4 mul and 2 div
|
||||
fx1 = ((polyvertex_t *)(line->v1))->x-gr_viewx;
|
||||
fy1 = ((polyvertex_t *)(line->v1))->y-gr_viewy;
|
||||
fx1 = ((polyvertex_t *)(line->pv1))->x-gr_viewx;
|
||||
fy1 = ((polyvertex_t *)(line->pv1))->y-gr_viewy;
|
||||
fy2 = (fx1 * gr_viewcos + fy1 * gr_viewsin);
|
||||
if (fy2 < 0)
|
||||
// the point is back
|
||||
|
@ -2848,8 +2926,8 @@ static void HWR_AddLine(seg_t * line)
|
|||
else
|
||||
fx1 = gr_windowcenterx + (fx1 * gr_viewsin - fy1 * gr_viewcos) * gr_centerx / fy2;
|
||||
|
||||
fx2 = ((polyvertex_t *)(line->v2))->x-gr_viewx;
|
||||
fy2 = ((polyvertex_t *)(line->v2))->y-gr_viewy;
|
||||
fx2 = ((polyvertex_t *)(line->pv2))->x-gr_viewx;
|
||||
fy2 = ((polyvertex_t *)(line->pv2))->y-gr_viewy;
|
||||
fy1 = (fx2 * gr_viewcos + fy2 * gr_viewsin);
|
||||
if (fy1 < 0)
|
||||
// the point is back
|
||||
|
@ -2877,8 +2955,34 @@ static void HWR_AddLine(seg_t * line)
|
|||
return;
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
|
||||
gr_backsector = line->backsector;
|
||||
|
||||
#ifdef NEWCLIP
|
||||
if (!line->backsector)
|
||||
{
|
||||
gld_clipper_SafeAddClipRange(angle2, angle1);
|
||||
}
|
||||
else
|
||||
{
|
||||
gr_backsector = R_FakeFlat(gr_backsector, &tempsec, NULL, NULL, true);
|
||||
if (CheckClip(line, gr_frontsector, gr_backsector))
|
||||
{
|
||||
gld_clipper_SafeAddClipRange(angle2, angle1);
|
||||
checkforemptylines = false;
|
||||
}
|
||||
// Reject empty lines used for triggers and special events.
|
||||
// Identical floor and ceiling on both sides,
|
||||
// identical light levels on both sides,
|
||||
// and no middle texture.
|
||||
if (checkforemptylines && R_IsEmptyLine(line, gr_frontsector, gr_backsector))
|
||||
return;
|
||||
}
|
||||
|
||||
HWR_ProcessSeg(); // Doesn't need arguments because they're defined globally :D
|
||||
return;
|
||||
#else
|
||||
// Single sided line?
|
||||
if (!gr_backsector)
|
||||
goto clipsolid;
|
||||
|
@ -2888,14 +2992,9 @@ static void HWR_AddLine(seg_t * line)
|
|||
#ifdef ESLOPE
|
||||
if (gr_frontsector->f_slope || gr_frontsector->c_slope || gr_backsector->f_slope || gr_backsector->c_slope)
|
||||
{
|
||||
fixed_t v1x, v1y, v2x, v2y; // the seg's vertexes as fixed_t
|
||||
fixed_t frontf1,frontf2, frontc1, frontc2; // front floor/ceiling ends
|
||||
fixed_t backf1, backf2, backc1, backc2; // back floor ceiling ends
|
||||
|
||||
v1x = FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->v1)->x);
|
||||
v1y = FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->v1)->y);
|
||||
v2x = FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->v2)->x);
|
||||
v2y = FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->v2)->y);
|
||||
#define SLOPEPARAMS(slope, end1, end2, normalheight) \
|
||||
if (slope) { \
|
||||
end1 = P_GetZAt(slope, v1x, v1y); \
|
||||
|
@ -2916,6 +3015,13 @@ static void HWR_AddLine(seg_t * line)
|
|||
goto clipsolid;
|
||||
}
|
||||
|
||||
// Check for automap fix.
|
||||
if (backc1 <= backf1 && backc2 <= backf2
|
||||
&& ((backc1 >= frontc1 && backc2 >= frontc2) || gr_curline->sidedef->toptexture)
|
||||
&& ((backf1 <= frontf1 && backf2 >= frontf2) || gr_curline->sidedef->bottomtexture)
|
||||
&& (gr_backsector->ceilingpic != skyflatnum || gr_frontsector->ceilingpic != skyflatnum))
|
||||
goto clipsolid;
|
||||
|
||||
// Window.
|
||||
if (backc1 != frontc1 || backc2 != frontc2
|
||||
|| backf1 != frontf1 || backf2 != frontf2)
|
||||
|
@ -2931,6 +3037,13 @@ static void HWR_AddLine(seg_t * line)
|
|||
gr_backsector->floorheight >= gr_frontsector->ceilingheight)
|
||||
goto clipsolid;
|
||||
|
||||
// Check for automap fix.
|
||||
if (gr_backsector->ceilingheight <= gr_backsector->floorheight
|
||||
&& ((gr_backsector->ceilingheight >= gr_frontsector->ceilingheight) || gr_curline->sidedef->toptexture)
|
||||
&& ((gr_backsector->floorheight <= gr_backsector->floorheight) || gr_curline->sidedef->bottomtexture)
|
||||
&& (gr_backsector->ceilingpic != skyflatnum || gr_frontsector->ceilingpic != skyflatnum))
|
||||
goto clipsolid;
|
||||
|
||||
// Window.
|
||||
if (gr_backsector->ceilingheight != gr_frontsector->ceilingheight ||
|
||||
gr_backsector->floorheight != gr_frontsector->floorheight)
|
||||
|
@ -2941,25 +3054,8 @@ static void HWR_AddLine(seg_t * line)
|
|||
// Identical floor and ceiling on both sides,
|
||||
// identical light levels on both sides,
|
||||
// and no middle texture.
|
||||
if (
|
||||
#ifdef POLYOBJECTS
|
||||
!line->polyseg &&
|
||||
#endif
|
||||
gr_backsector->ceilingpic == gr_frontsector->ceilingpic
|
||||
&& gr_backsector->floorpic == gr_frontsector->floorpic
|
||||
#ifdef ESLOPE
|
||||
&& gr_backsector->f_slope == gr_frontsector->f_slope
|
||||
&& gr_backsector->c_slope == gr_frontsector->c_slope
|
||||
#endif
|
||||
&& gr_backsector->lightlevel == gr_frontsector->lightlevel
|
||||
&& gr_curline->sidedef->midtexture == 0
|
||||
&& !gr_backsector->ffloors && !gr_frontsector->ffloors)
|
||||
// SoM: For 3D sides... Boris, would you like to take a
|
||||
// crack at rendering 3D sides? You would need to add the
|
||||
// above check and add code to HWR_StoreWallRange...
|
||||
{
|
||||
if (R_IsEmptyLine(gr_curline, gr_frontsector, gr_backsector))
|
||||
return;
|
||||
}
|
||||
|
||||
clippass:
|
||||
if (x1 == x2)
|
||||
|
@ -2971,6 +3067,7 @@ clipsolid:
|
|||
if (x1 == x2)
|
||||
goto clippass;
|
||||
HWR_ClipSolidWallSegment(x1, x2-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
// HWR_CheckBBox
|
||||
|
@ -2982,9 +3079,13 @@ clipsolid:
|
|||
|
||||
static boolean HWR_CheckBBox(fixed_t *bspcoord)
|
||||
{
|
||||
INT32 boxpos, sx1, sx2;
|
||||
INT32 boxpos;
|
||||
fixed_t px1, py1, px2, py2;
|
||||
angle_t angle1, angle2, span, tspan;
|
||||
angle_t angle1, angle2;
|
||||
#ifndef NEWCLIP
|
||||
INT32 sx1, sx2;
|
||||
angle_t span, tspan;
|
||||
#endif
|
||||
|
||||
// Find the corners of the box
|
||||
// that define the edges from current viewpoint.
|
||||
|
@ -3010,6 +3111,11 @@ static boolean HWR_CheckBBox(fixed_t *bspcoord)
|
|||
px2 = bspcoord[checkcoord[boxpos][2]];
|
||||
py2 = bspcoord[checkcoord[boxpos][3]];
|
||||
|
||||
#ifdef NEWCLIP
|
||||
angle1 = R_PointToAngle(px1, py1);
|
||||
angle2 = R_PointToAngle(px2, py2);
|
||||
return gld_clipper_SafeCheckRange(angle2, angle1);
|
||||
#else
|
||||
// check clip list for an open space
|
||||
angle1 = R_PointToAngle(px1, py1) - dup_viewangle;
|
||||
angle2 = R_PointToAngle(px2, py2) - dup_viewangle;
|
||||
|
@ -3057,6 +3163,7 @@ static boolean HWR_CheckBBox(fixed_t *bspcoord)
|
|||
return false;
|
||||
|
||||
return HWR_ClipToSolidSegs(sx1, sx2 - 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
|
@ -3090,8 +3197,8 @@ static inline void HWR_AddPolyObjectSegs(void)
|
|||
pv2->x = FIXED_TO_FLOAT(gr_fakeline->v2->x);
|
||||
pv2->y = FIXED_TO_FLOAT(gr_fakeline->v2->y);
|
||||
|
||||
gr_fakeline->v1 = (vertex_t *)pv1;
|
||||
gr_fakeline->v2 = (vertex_t *)pv2;
|
||||
gr_fakeline->pv1 = pv1;
|
||||
gr_fakeline->pv2 = pv2;
|
||||
|
||||
HWR_AddLine(gr_fakeline);
|
||||
}
|
||||
|
@ -4646,8 +4753,6 @@ static polyplaneinfo_t *polyplaneinfo = NULL;
|
|||
#ifndef SORTING
|
||||
size_t numfloors = 0;
|
||||
#else
|
||||
//static floorinfo_t *floorinfo = NULL;
|
||||
//static size_t numfloors = 0;
|
||||
//Hurdler: 3D water sutffs
|
||||
typedef struct gr_drawnode_s
|
||||
{
|
||||
|
@ -5134,7 +5239,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
// Note: DO NOT do this in software mode version, it actually
|
||||
// makes papersprites look WORSE there (I know, I've tried)
|
||||
// Monster Iestyn - 13/05/17
|
||||
ang = dup_viewangle - thing->angle;
|
||||
ang = dup_viewangle - (thing->player ? thing->player->drawangle : thing->angle);
|
||||
ang_scale = FIXED_TO_FLOAT(FINESINE(ang>>ANGLETOFINESHIFT));
|
||||
ang_scalez = FIXED_TO_FLOAT(FINECOSINE(ang>>ANGLETOFINESHIFT));
|
||||
|
||||
|
@ -5145,7 +5250,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
}
|
||||
}
|
||||
else if (sprframe->rotate != SRF_SINGLE)
|
||||
ang = R_PointToAngle (thing->x, thing->y) - thing->angle;
|
||||
ang = R_PointToAngle (thing->x, thing->y) - (thing->player ? thing->player->drawangle : thing->angle);
|
||||
|
||||
if (sprframe->rotate == SRF_SINGLE)
|
||||
{
|
||||
|
@ -5621,12 +5726,8 @@ if (0)
|
|||
HWD.pfnSetSpecialState(HWD_SET_FOG_MODE, 0); // Turn it off
|
||||
}
|
||||
|
||||
#ifndef _NDS
|
||||
if (drawsky)
|
||||
HWR_DrawSkyBackground(player);
|
||||
#else
|
||||
(void)HWR_DrawSkyBackground;
|
||||
#endif
|
||||
|
||||
//Hurdler: it doesn't work in splitscreen mode
|
||||
drawsky = splitscreen;
|
||||
|
@ -5636,7 +5737,19 @@ if (0)
|
|||
#ifdef SORTING
|
||||
drawcount = 0;
|
||||
#endif
|
||||
#ifdef NEWCLIP
|
||||
if (rendermode == render_opengl)
|
||||
{
|
||||
angle_t a1 = gld_FrustumAngle();
|
||||
gld_clipper_Clear();
|
||||
gld_clipper_SafeAddClipRange(viewangle + a1, viewangle - a1);
|
||||
#ifdef HAVE_SPHEREFRUSTRUM
|
||||
gld_FrustrumSetup();
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
HWR_ClearClipSegs();
|
||||
#endif
|
||||
|
||||
//04/01/2000: Hurdler: added for T&L
|
||||
// Actually it only works on Walls and Planes
|
||||
|
@ -5646,6 +5759,7 @@ if (0)
|
|||
|
||||
HWR_RenderBSPNode((INT32)numnodes-1);
|
||||
|
||||
#ifndef NEWCLIP
|
||||
// Make a viewangle int so we can render things based on mouselook
|
||||
if (player == &players[consoleplayer])
|
||||
viewangle = localaiming;
|
||||
|
@ -5672,6 +5786,7 @@ if (0)
|
|||
|
||||
dup_viewangle += ANGLE_90;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Check for new console commands.
|
||||
NetUpdate();
|
||||
|
@ -5851,12 +5966,8 @@ if (0)
|
|||
HWD.pfnSetSpecialState(HWD_SET_FOG_MODE, 0); // Turn it off
|
||||
}
|
||||
|
||||
#ifndef _NDS
|
||||
if (!skybox && drawsky) // Don't draw the regular sky if there's a skybox
|
||||
HWR_DrawSkyBackground(player);
|
||||
#else
|
||||
(void)HWR_DrawSkyBackground;
|
||||
#endif
|
||||
|
||||
//Hurdler: it doesn't work in splitscreen mode
|
||||
drawsky = splitscreen;
|
||||
|
@ -5866,7 +5977,19 @@ if (0)
|
|||
#ifdef SORTING
|
||||
drawcount = 0;
|
||||
#endif
|
||||
#ifdef NEWCLIP
|
||||
if (rendermode == render_opengl)
|
||||
{
|
||||
angle_t a1 = gld_FrustumAngle();
|
||||
gld_clipper_Clear();
|
||||
gld_clipper_SafeAddClipRange(viewangle + a1, viewangle - a1);
|
||||
#ifdef HAVE_SPHEREFRUSTRUM
|
||||
gld_FrustrumSetup();
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
HWR_ClearClipSegs();
|
||||
#endif
|
||||
|
||||
//04/01/2000: Hurdler: added for T&L
|
||||
// Actually it only works on Walls and Planes
|
||||
|
@ -5876,6 +5999,7 @@ if (0)
|
|||
|
||||
HWR_RenderBSPNode((INT32)numnodes-1);
|
||||
|
||||
#ifndef NEWCLIP
|
||||
// Make a viewangle int so we can render things based on mouselook
|
||||
if (player == &players[consoleplayer])
|
||||
viewangle = localaiming;
|
||||
|
@ -5902,6 +6026,7 @@ if (0)
|
|||
|
||||
dup_viewangle += ANGLE_90;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Check for new console commands.
|
||||
NetUpdate();
|
||||
|
@ -6047,7 +6172,9 @@ static inline void HWR_AddEngineCommands(void)
|
|||
{
|
||||
// engine state variables
|
||||
//CV_RegisterVar(&cv_grzbuffer);
|
||||
#ifndef NEWCLIP
|
||||
CV_RegisterVar(&cv_grclipwalls);
|
||||
#endif
|
||||
|
||||
// engine development mode variables
|
||||
// - usage may vary from version to version..
|
||||
|
@ -6090,12 +6217,7 @@ void HWR_Startup(void)
|
|||
}
|
||||
|
||||
if (rendermode == render_opengl)
|
||||
textureformat = patchformat =
|
||||
#ifdef _NDS
|
||||
GR_TEXFMT_P_8;
|
||||
#else
|
||||
GR_RGBA;
|
||||
#endif
|
||||
textureformat = patchformat = GR_RGBA;
|
||||
|
||||
startupdone = true;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,6 @@ void HWR_SetViewSize(void);
|
|||
void HWR_DrawPatch(GLPatch_t *gpatch, INT32 x, INT32 y, INT32 option);
|
||||
void HWR_DrawFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t scale, INT32 option, const UINT8 *colormap);
|
||||
void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t scale, INT32 option, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h);
|
||||
void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, INT32 option, fixed_t scale, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h);
|
||||
void HWR_MakePatch(const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipmap, boolean makebitmap);
|
||||
void HWR_CreatePlanePolygons(INT32 bspnum);
|
||||
void HWR_CreateStaticLightmaps(INT32 bspnum);
|
||||
|
@ -104,13 +103,4 @@ extern float gr_viewwindowx, gr_basewindowcentery;
|
|||
extern fixed_t *hwbbox;
|
||||
extern FTransform atransform;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
wallVert3D floorVerts[4];
|
||||
FSurfaceInfo Surf;
|
||||
INT32 texnum;
|
||||
INT32 blend;
|
||||
INT32 drawcount;
|
||||
} floorinfo_t;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "../doomdef.h"
|
||||
#include "../doomstat.h"
|
||||
#include "../fastcmp.h"
|
||||
|
||||
#ifdef HWRENDER
|
||||
#include "hw_drv.h"
|
||||
|
@ -265,6 +266,9 @@ static void md2_freeModel (md2_model_t *model)
|
|||
free(model->frames);
|
||||
}
|
||||
|
||||
if (model->spr2frames)
|
||||
free(model->spr2frames);
|
||||
|
||||
if (model->glCommandBuffer)
|
||||
free(model->glCommandBuffer);
|
||||
|
||||
|
@ -298,8 +302,8 @@ static md2_model_t *md2_readModel(const char *filename)
|
|||
// initialize model and read header
|
||||
|
||||
if (fread(&model->header, sizeof (model->header), 1, file) != 1
|
||||
|| model->header.magic !=
|
||||
(INT32)(('2' << 24) + ('P' << 16) + ('D' << 8) + 'I'))
|
||||
|| model->header.magic != MD2_IDENT
|
||||
|| model->header.version != MD2_VERSION)
|
||||
{
|
||||
fclose(file);
|
||||
free(model);
|
||||
|
@ -313,6 +317,7 @@ static md2_model_t *md2_readModel(const char *filename)
|
|||
{ \
|
||||
CONS_Alert(CONS_ERROR, "md2_readModel: %s has too many " msgname " (# found: %d, maximum: %d)\n", filename, field, max); \
|
||||
md2_freeModel (model); \
|
||||
fclose(file); \
|
||||
return 0; \
|
||||
}
|
||||
|
||||
|
@ -334,6 +339,7 @@ static md2_model_t *md2_readModel(const char *filename)
|
|||
fread(model->skins, sizeof (md2_skin_t), model->header.numSkins, file))
|
||||
{
|
||||
md2_freeModel (model);
|
||||
fclose(file);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -347,6 +353,7 @@ static md2_model_t *md2_readModel(const char *filename)
|
|||
fread(model->texCoords, sizeof (md2_textureCoordinate_t), model->header.numTexCoords, file))
|
||||
{
|
||||
md2_freeModel (model);
|
||||
fclose(file);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -360,6 +367,7 @@ static md2_model_t *md2_readModel(const char *filename)
|
|||
fread(model->triangles, sizeof (md2_triangle_t), model->header.numTriangles, file))
|
||||
{
|
||||
md2_freeModel (model);
|
||||
fclose(file);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -372,6 +380,7 @@ static md2_model_t *md2_readModel(const char *filename)
|
|||
if (!model->frames)
|
||||
{
|
||||
md2_freeModel (model);
|
||||
fclose(file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -385,10 +394,44 @@ static md2_model_t *md2_readModel(const char *filename)
|
|||
fread(frame, 1, model->header.frameSize, file))
|
||||
{
|
||||
md2_freeModel (model);
|
||||
fclose(file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
strcpy(model->frames[i].name, frame->name);
|
||||
if (frame->name[0] == 'S')
|
||||
{
|
||||
boolean super;
|
||||
if ((super = (fastncmp("UPER", frame->name+1, 4))) // SUPER
|
||||
|| fastncmp("PR2_", frame->name+1, 4)) // SPR2_
|
||||
{
|
||||
UINT8 spr2;
|
||||
for (spr2 = 0; spr2 < free_spr2; spr2++)
|
||||
if (fastncmp(frame->name+5,spr2names[spr2],3)
|
||||
&& ((frame->name[8] == spr2names[spr2][3])
|
||||
|| (frame->name[8] == '.' && spr2names[spr2][3] == '_')))
|
||||
break;
|
||||
|
||||
if (spr2 < free_spr2)
|
||||
{
|
||||
if (!model->spr2frames)
|
||||
{
|
||||
model->spr2frames = calloc(sizeof (size_t), 2*NUMPLAYERSPRITES*2);
|
||||
if (!model->spr2frames)
|
||||
{
|
||||
md2_freeModel (model);
|
||||
fclose(file);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (super)
|
||||
spr2 |= FF_SPR2SUPER;
|
||||
if (model->spr2frames[spr2*2 + 1]++ == 0) // numspr2frames
|
||||
model->spr2frames[spr2*2] = i; // starting frame
|
||||
CONS_Debug(DBG_RENDER, "frame %s, sprite2 %s - starting frame %s, number of frames %s\n", frame->name, spr2names[spr2 & ~FF_SPR2SUPER], sizeu1(model->spr2frames[spr2*2]), sizeu2(model->spr2frames[spr2*2 + 1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
for (j = 0; j < model->header.numVertices; j++)
|
||||
{
|
||||
model->frames[i].vertices[j].vertex[0] = (float) ((INT32) frame->alias_vertices[j].vertex[0]) * frame->scale[0] + frame->translate[0];
|
||||
|
@ -410,6 +453,7 @@ static md2_model_t *md2_readModel(const char *filename)
|
|||
fread(model->glCommandBuffer, sizeof (INT32), model->header.numGlCommands, file))
|
||||
{
|
||||
md2_freeModel (model);
|
||||
fclose(file);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -961,244 +1005,10 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
|
|||
image = gpatch->mipmap.grInfo.data;
|
||||
blendimage = blendgpatch->mipmap.grInfo.data;
|
||||
|
||||
switch (color)
|
||||
{
|
||||
case SKINCOLOR_WHITE:
|
||||
blendcolor = V_GetColor(3);
|
||||
break;
|
||||
case SKINCOLOR_SILVER:
|
||||
blendcolor = V_GetColor(10);
|
||||
break;
|
||||
case SKINCOLOR_GREY:
|
||||
blendcolor = V_GetColor(15);
|
||||
break;
|
||||
case SKINCOLOR_BLACK:
|
||||
blendcolor = V_GetColor(27);
|
||||
break;
|
||||
case SKINCOLOR_BEIGE:
|
||||
blendcolor = V_GetColor(247);
|
||||
break;
|
||||
case SKINCOLOR_PEACH:
|
||||
blendcolor = V_GetColor(218);
|
||||
break;
|
||||
case SKINCOLOR_BROWN:
|
||||
blendcolor = V_GetColor(234);
|
||||
break;
|
||||
case SKINCOLOR_RED:
|
||||
blendcolor = V_GetColor(38);
|
||||
break;
|
||||
case SKINCOLOR_CRIMSON:
|
||||
blendcolor = V_GetColor(45);
|
||||
break;
|
||||
case SKINCOLOR_ORANGE:
|
||||
blendcolor = V_GetColor(54);
|
||||
break;
|
||||
case SKINCOLOR_RUST:
|
||||
blendcolor = V_GetColor(60);
|
||||
break;
|
||||
case SKINCOLOR_GOLD:
|
||||
blendcolor = V_GetColor(67);
|
||||
break;
|
||||
case SKINCOLOR_YELLOW:
|
||||
blendcolor = V_GetColor(73);
|
||||
break;
|
||||
case SKINCOLOR_TAN:
|
||||
blendcolor = V_GetColor(85);
|
||||
break;
|
||||
case SKINCOLOR_MOSS:
|
||||
blendcolor = V_GetColor(92);
|
||||
break;
|
||||
case SKINCOLOR_PERIDOT:
|
||||
blendcolor = V_GetColor(188);
|
||||
break;
|
||||
case SKINCOLOR_GREEN:
|
||||
blendcolor = V_GetColor(101);
|
||||
break;
|
||||
case SKINCOLOR_EMERALD:
|
||||
blendcolor = V_GetColor(112);
|
||||
break;
|
||||
case SKINCOLOR_AQUA:
|
||||
blendcolor = V_GetColor(122);
|
||||
break;
|
||||
case SKINCOLOR_TEAL:
|
||||
blendcolor = V_GetColor(141);
|
||||
break;
|
||||
case SKINCOLOR_CYAN:
|
||||
blendcolor = V_GetColor(131);
|
||||
break;
|
||||
case SKINCOLOR_BLUE:
|
||||
blendcolor = V_GetColor(152);
|
||||
break;
|
||||
case SKINCOLOR_AZURE:
|
||||
blendcolor = V_GetColor(171);
|
||||
break;
|
||||
case SKINCOLOR_PASTEL:
|
||||
blendcolor = V_GetColor(161);
|
||||
break;
|
||||
case SKINCOLOR_PURPLE:
|
||||
blendcolor = V_GetColor(165);
|
||||
break;
|
||||
case SKINCOLOR_LAVENDER:
|
||||
blendcolor = V_GetColor(195);
|
||||
break;
|
||||
case SKINCOLOR_MAGENTA:
|
||||
blendcolor = V_GetColor(183);
|
||||
break;
|
||||
case SKINCOLOR_PINK:
|
||||
blendcolor = V_GetColor(211);
|
||||
break;
|
||||
case SKINCOLOR_ROSY:
|
||||
blendcolor = V_GetColor(202);
|
||||
break;
|
||||
|
||||
case SKINCOLOR_SUPERSILVER1: // Super silver
|
||||
blendcolor = V_GetColor(0);
|
||||
break;
|
||||
case SKINCOLOR_SUPERSILVER2:
|
||||
blendcolor = V_GetColor(2);
|
||||
break;
|
||||
case SKINCOLOR_SUPERSILVER3:
|
||||
blendcolor = V_GetColor(4);
|
||||
break;
|
||||
case SKINCOLOR_SUPERSILVER4:
|
||||
blendcolor = V_GetColor(7);
|
||||
break;
|
||||
case SKINCOLOR_SUPERSILVER5:
|
||||
blendcolor = V_GetColor(10);
|
||||
break;
|
||||
|
||||
case SKINCOLOR_SUPERRED1: // Super red
|
||||
blendcolor = V_GetColor(208);
|
||||
break;
|
||||
case SKINCOLOR_SUPERRED2:
|
||||
blendcolor = V_GetColor(210);
|
||||
break;
|
||||
case SKINCOLOR_SUPERRED3:
|
||||
blendcolor = V_GetColor(32);
|
||||
break;
|
||||
case SKINCOLOR_SUPERRED4:
|
||||
blendcolor = V_GetColor(33);
|
||||
break;
|
||||
case SKINCOLOR_SUPERRED5:
|
||||
blendcolor = V_GetColor(35);
|
||||
break;
|
||||
|
||||
case SKINCOLOR_SUPERORANGE1: // Super orange
|
||||
blendcolor = V_GetColor(208);
|
||||
break;
|
||||
case SKINCOLOR_SUPERORANGE2:
|
||||
blendcolor = V_GetColor(48);
|
||||
break;
|
||||
case SKINCOLOR_SUPERORANGE3:
|
||||
blendcolor = V_GetColor(50);
|
||||
break;
|
||||
case SKINCOLOR_SUPERORANGE4:
|
||||
blendcolor = V_GetColor(54);
|
||||
break;
|
||||
case SKINCOLOR_SUPERORANGE5:
|
||||
blendcolor = V_GetColor(58);
|
||||
break;
|
||||
|
||||
case SKINCOLOR_SUPERGOLD1: // Super gold
|
||||
blendcolor = V_GetColor(80);
|
||||
break;
|
||||
case SKINCOLOR_SUPERGOLD2:
|
||||
blendcolor = V_GetColor(83);
|
||||
break;
|
||||
case SKINCOLOR_SUPERGOLD3:
|
||||
blendcolor = V_GetColor(73);
|
||||
break;
|
||||
case SKINCOLOR_SUPERGOLD4:
|
||||
blendcolor = V_GetColor(64);
|
||||
break;
|
||||
case SKINCOLOR_SUPERGOLD5:
|
||||
blendcolor = V_GetColor(67);
|
||||
break;
|
||||
|
||||
case SKINCOLOR_SUPERPERIDOT1: // Super peridot
|
||||
blendcolor = V_GetColor(88);
|
||||
break;
|
||||
case SKINCOLOR_SUPERPERIDOT2:
|
||||
blendcolor = V_GetColor(188);
|
||||
break;
|
||||
case SKINCOLOR_SUPERPERIDOT3:
|
||||
blendcolor = V_GetColor(189);
|
||||
break;
|
||||
case SKINCOLOR_SUPERPERIDOT4:
|
||||
blendcolor = V_GetColor(190);
|
||||
break;
|
||||
case SKINCOLOR_SUPERPERIDOT5:
|
||||
blendcolor = V_GetColor(191);
|
||||
break;
|
||||
|
||||
case SKINCOLOR_SUPERCYAN1: // Super cyan
|
||||
blendcolor = V_GetColor(128);
|
||||
break;
|
||||
case SKINCOLOR_SUPERCYAN2:
|
||||
blendcolor = V_GetColor(131);
|
||||
break;
|
||||
case SKINCOLOR_SUPERCYAN3:
|
||||
blendcolor = V_GetColor(133);
|
||||
break;
|
||||
case SKINCOLOR_SUPERCYAN4:
|
||||
blendcolor = V_GetColor(134);
|
||||
break;
|
||||
case SKINCOLOR_SUPERCYAN5:
|
||||
blendcolor = V_GetColor(136);
|
||||
break;
|
||||
|
||||
case SKINCOLOR_SUPERPURPLE1: // Super purple
|
||||
blendcolor = V_GetColor(144);
|
||||
break;
|
||||
case SKINCOLOR_SUPERPURPLE2:
|
||||
blendcolor = V_GetColor(162);
|
||||
break;
|
||||
case SKINCOLOR_SUPERPURPLE3:
|
||||
blendcolor = V_GetColor(164);
|
||||
break;
|
||||
case SKINCOLOR_SUPERPURPLE4:
|
||||
blendcolor = V_GetColor(166);
|
||||
break;
|
||||
case SKINCOLOR_SUPERPURPLE5:
|
||||
blendcolor = V_GetColor(168);
|
||||
break;
|
||||
|
||||
case SKINCOLOR_SUPERRUST1: // Super rust
|
||||
blendcolor = V_GetColor(51);
|
||||
break;
|
||||
case SKINCOLOR_SUPERRUST2:
|
||||
blendcolor = V_GetColor(54);
|
||||
break;
|
||||
case SKINCOLOR_SUPERRUST3:
|
||||
blendcolor = V_GetColor(68);
|
||||
break;
|
||||
case SKINCOLOR_SUPERRUST4:
|
||||
blendcolor = V_GetColor(70);
|
||||
break;
|
||||
case SKINCOLOR_SUPERRUST5:
|
||||
blendcolor = V_GetColor(234);
|
||||
break;
|
||||
|
||||
case SKINCOLOR_SUPERTAN1: // Super tan
|
||||
blendcolor = V_GetColor(80);
|
||||
break;
|
||||
case SKINCOLOR_SUPERTAN2:
|
||||
blendcolor = V_GetColor(82);
|
||||
break;
|
||||
case SKINCOLOR_SUPERTAN3:
|
||||
blendcolor = V_GetColor(84);
|
||||
break;
|
||||
case SKINCOLOR_SUPERTAN4:
|
||||
blendcolor = V_GetColor(87);
|
||||
break;
|
||||
case SKINCOLOR_SUPERTAN5:
|
||||
blendcolor = V_GetColor(247);
|
||||
break;
|
||||
|
||||
default:
|
||||
blendcolor = V_GetColor(255);
|
||||
break;
|
||||
}
|
||||
if (color == SKINCOLOR_NONE || color >= MAXTRANSLATIONS)
|
||||
blendcolor = V_GetColor(0xff);
|
||||
else
|
||||
blendcolor = V_GetColor(Color_Index[color-1][4]);
|
||||
|
||||
while (size--)
|
||||
{
|
||||
|
@ -1305,6 +1115,51 @@ static void HWR_GetBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, con
|
|||
res?
|
||||
run?
|
||||
*/
|
||||
|
||||
static UINT8 P_GetModelSprite2(md2_t *md2, skin_t *skin, UINT8 spr2, player_t *player)
|
||||
{
|
||||
UINT8 super = 0, i = 0;
|
||||
|
||||
if (!md2 || !skin)
|
||||
return 0;
|
||||
|
||||
while (!(md2->model->spr2frames[spr2*2 + 1])
|
||||
&& spr2 != SPR2_STND
|
||||
&& ++i != 32) // recursion limiter
|
||||
{
|
||||
if (spr2 & FF_SPR2SUPER)
|
||||
{
|
||||
super = FF_SPR2SUPER;
|
||||
spr2 &= ~FF_SPR2SUPER;
|
||||
continue;
|
||||
}
|
||||
|
||||
switch(spr2)
|
||||
{
|
||||
|
||||
// Normal special cases.
|
||||
case SPR2_JUMP:
|
||||
spr2 = ((player
|
||||
? player->charflags
|
||||
: skin->flags)
|
||||
& SF_NOJUMPSPIN) ? SPR2_SPNG : SPR2_ROLL;
|
||||
break;
|
||||
case SPR2_TIRE:
|
||||
spr2 = (player && player->charability == CA_SWIM) ? SPR2_SWIM : SPR2_FLY;
|
||||
break;
|
||||
|
||||
// Use the handy list, that's what it's there for!
|
||||
default:
|
||||
spr2 = spr2defaults[spr2];
|
||||
break;
|
||||
}
|
||||
|
||||
spr2 |= super;
|
||||
}
|
||||
|
||||
return spr2;
|
||||
}
|
||||
|
||||
#define NORMALFOG 0x00000000
|
||||
#define FADEFOG 0x19000000
|
||||
void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||
|
@ -1452,12 +1307,48 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
|||
tics = spr->mobj->anim_duration;
|
||||
}
|
||||
|
||||
#define INTERPOLERATION_LIMIT TICRATE/4
|
||||
|
||||
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY && md2->model->spr2frames)
|
||||
{
|
||||
UINT8 spr2 = P_GetModelSprite2(md2, spr->mobj->skin, spr->mobj->sprite2, spr->mobj->player);
|
||||
UINT8 mod = md2->model->spr2frames[spr2*2 + 1] ? md2->model->spr2frames[spr2*2 + 1] : md2->model->header.numFrames;
|
||||
if (mod > ((skin_t *)spr->mobj->skin)->sprites[spr2].numframes)
|
||||
mod = ((skin_t *)spr->mobj->skin)->sprites[spr2].numframes;
|
||||
//FIXME: this is not yet correct
|
||||
frame = (spr->mobj->frame & FF_FRAMEMASK);
|
||||
if (frame >= mod)
|
||||
frame = 0;
|
||||
buff = md2->model->glCommandBuffer;
|
||||
curr = &md2->model->frames[md2->model->spr2frames[spr2*2] + frame];
|
||||
if (cv_grmd2.value == 1 && tics <= INTERPOLERATION_LIMIT)
|
||||
{
|
||||
if (durs > INTERPOLERATION_LIMIT)
|
||||
durs = INTERPOLERATION_LIMIT;
|
||||
|
||||
if (spr->mobj->frame & FF_ANIMATE
|
||||
|| (spr->mobj->state->nextstate != S_NULL
|
||||
&& states[spr->mobj->state->nextstate].sprite == spr->mobj->sprite
|
||||
&& (states[spr->mobj->state->nextstate].frame & FF_FRAMEMASK) == spr->mobj->sprite2))
|
||||
{
|
||||
if (++frame >= mod)
|
||||
frame = 0;
|
||||
if (frame || !(spr->mobj->state->frame & FF_SPR2ENDSTATE))
|
||||
next = &md2->model->frames[md2->model->spr2frames[spr2*2] + frame];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//FIXME: this is not yet correct
|
||||
frame = (spr->mobj->frame & FF_FRAMEMASK) % md2->model->header.numFrames;
|
||||
buff = md2->model->glCommandBuffer;
|
||||
curr = &md2->model->frames[frame];
|
||||
if (cv_grmd2.value == 1)
|
||||
if (cv_grmd2.value == 1 && tics <= INTERPOLERATION_LIMIT)
|
||||
{
|
||||
if (durs > INTERPOLERATION_LIMIT)
|
||||
durs = INTERPOLERATION_LIMIT;
|
||||
|
||||
// frames are handled differently for states with FF_ANIMATE, so get the next frame differently for the interpolation
|
||||
if (spr->mobj->frame & FF_ANIMATE)
|
||||
{
|
||||
|
@ -1469,14 +1360,17 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (spr->mobj->state->nextstate != S_NULL && states[spr->mobj->state->nextstate].sprite != SPR_NULL
|
||||
&& !(spr->mobj->player && spr->mobj->state->nextstate == S_PLAY_WAIT && spr->mobj->state == &states[S_PLAY_STND]))
|
||||
if (spr->mobj->state->nextstate != S_NULL
|
||||
&& states[spr->mobj->state->nextstate].sprite == spr->mobj->sprite)
|
||||
{
|
||||
const UINT32 nextframe = (states[spr->mobj->state->nextstate].frame & FF_FRAMEMASK) % md2->model->header.numFrames;
|
||||
next = &md2->model->frames[nextframe];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#undef INTERPOLERATION_LIMIT
|
||||
|
||||
//Hurdler: it seems there is still a small problem with mobj angle
|
||||
p.x = FIXED_TO_FLOAT(spr->mobj->x);
|
||||
|
@ -1496,7 +1390,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
|||
|
||||
if (sprframe->rotate)
|
||||
{
|
||||
const fixed_t anglef = AngleFixed(spr->mobj->angle);
|
||||
const fixed_t anglef = AngleFixed((spr->mobj->player ? spr->mobj->player->drawangle : spr->mobj->angle));
|
||||
p.angley = FIXED_TO_FLOAT(anglef);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -22,6 +22,12 @@
|
|||
#define _HW_MD2_H_
|
||||
|
||||
#include "hw_glob.h"
|
||||
#include "../info.h"
|
||||
|
||||
// magic number "IDP2" or 844121161
|
||||
#define MD2_IDENT (INT32)(('2' << 24) + ('P' << 16) + ('D' << 8) + 'I')
|
||||
// model version
|
||||
#define MD2_VERSION 8
|
||||
|
||||
#define MD2_MAX_TRIANGLES 8192
|
||||
#define MD2_MAX_VERTICES 4096
|
||||
|
@ -106,6 +112,7 @@ typedef struct
|
|||
md2_textureCoordinate_t *texCoords;
|
||||
md2_triangle_t *triangles;
|
||||
md2_frame_t *frames;
|
||||
size_t *spr2frames; // size_t spr2frames[2*NUMPLAYERSPRITES][2];
|
||||
INT32 *glCommandBuffer;
|
||||
} ATTRPACK md2_model_t;
|
||||
|
||||
|
|
|
@ -397,7 +397,7 @@ static void sortStacklist(sector_t *sector)
|
|||
i = 0;
|
||||
finished = true;
|
||||
|
||||
while (NULL != *(list+i+1))
|
||||
while (*(list+i+1))
|
||||
{
|
||||
sec1 = *(list+i);
|
||||
sec2 = *(list+i+1);
|
||||
|
@ -438,7 +438,7 @@ static double calcLineoutLength(sector_t *sector)
|
|||
double length = 0.0L;
|
||||
chain = sector->sectorLines;
|
||||
|
||||
while (NULL != chain) // sum up lengths of all lines
|
||||
while (chain) // sum up lengths of all lines
|
||||
{
|
||||
length += lineLength(chain->line);
|
||||
chain = chain->next;
|
||||
|
@ -454,7 +454,7 @@ static void calcLineouts(sector_t *sector)
|
|||
size_t secCount = 0;
|
||||
sector_t *encSector = *(sector->stackList);
|
||||
|
||||
while (NULL != encSector)
|
||||
while (encSector)
|
||||
{
|
||||
if (encSector->lineoutLength < 0.0L) // if length has not yet been calculated
|
||||
{
|
||||
|
@ -552,7 +552,7 @@ static boolean areBottomtexturesMissing(sector_t *thisSector)
|
|||
if (frontSector == backSector) // skip damn renderer tricks here
|
||||
continue;
|
||||
|
||||
if (frontSector == NULL || backSector == NULL)
|
||||
if (!frontSector || !backSector)
|
||||
continue;
|
||||
|
||||
sider = &sides[thisElem->line->sidenum[0]];
|
||||
|
@ -587,67 +587,6 @@ static boolean areBottomtexturesMissing(sector_t *thisSector)
|
|||
static boolean isCeilingFloating(sector_t *thisSector)
|
||||
{
|
||||
sector_t *adjSector, *refSector = NULL, *frontSector, *backSector;
|
||||
boolean floating = true;
|
||||
linechain_t *thisElem, *nextElem;
|
||||
|
||||
if (!thisSector)
|
||||
return false;
|
||||
|
||||
nextElem = thisSector->sectorLines;
|
||||
|
||||
while (NULL != nextElem) // walk through chain
|
||||
{
|
||||
thisElem = nextElem;
|
||||
nextElem = thisElem->next;
|
||||
|
||||
frontSector = thisElem->line->frontsector;
|
||||
backSector = thisElem->line->backsector;
|
||||
|
||||
if (frontSector == thisSector)
|
||||
adjSector = backSector;
|
||||
else
|
||||
adjSector = frontSector;
|
||||
|
||||
if (!adjSector) // assume floating sectors have surrounding sectors
|
||||
{
|
||||
floating = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!refSector)
|
||||
{
|
||||
refSector = adjSector;
|
||||
continue;
|
||||
}
|
||||
|
||||
// if adjacent sector has same height or more than one adjacent sector exists -> stop
|
||||
if (thisSector->ceilingheight == adjSector->ceilingheight ||
|
||||
refSector != adjSector)
|
||||
{
|
||||
floating = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// now check for walltextures
|
||||
if (floating)
|
||||
{
|
||||
if (!areToptexturesMissing(thisSector))
|
||||
{
|
||||
floating = false;
|
||||
}
|
||||
}
|
||||
return floating;
|
||||
}
|
||||
|
||||
//
|
||||
// check if no adjacent sector has same ceiling height
|
||||
// FIXME: throw that together with isCeilingFloating??
|
||||
//
|
||||
static boolean isFloorFloating(sector_t *thisSector)
|
||||
{
|
||||
sector_t *adjSector, *refSector = NULL, *frontSector, *backSector;
|
||||
boolean floating = true;
|
||||
linechain_t *thisElem, *nextElem;
|
||||
|
||||
if (!thisSector)
|
||||
|
@ -668,36 +607,83 @@ static boolean isFloorFloating(sector_t *thisSector)
|
|||
else
|
||||
adjSector = frontSector;
|
||||
|
||||
if (NULL == adjSector) // assume floating sectors have surrounding sectors
|
||||
{
|
||||
floating = false;
|
||||
break;
|
||||
}
|
||||
if (!adjSector) // assume floating sectors have surrounding sectors
|
||||
return false;
|
||||
|
||||
if (NULL == refSector)
|
||||
#ifdef ESLOPE
|
||||
if (adjSector->c_slope) // Don't bother with slopes
|
||||
return false;
|
||||
#endif
|
||||
|
||||
if (!refSector)
|
||||
{
|
||||
refSector = adjSector;
|
||||
continue;
|
||||
}
|
||||
|
||||
// if adjacent sector has same height or more than one adjacent sector exists -> stop
|
||||
if (thisSector->floorheight == adjSector->floorheight ||
|
||||
refSector != adjSector)
|
||||
{
|
||||
floating = false;
|
||||
break;
|
||||
}
|
||||
if (thisSector->ceilingheight == adjSector->ceilingheight || refSector != adjSector)
|
||||
return false;
|
||||
}
|
||||
|
||||
// now check for walltextures
|
||||
if (floating)
|
||||
if (!areToptexturesMissing(thisSector))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// check if no adjacent sector has same ceiling height
|
||||
// FIXME: throw that together with isCeilingFloating??
|
||||
//
|
||||
static boolean isFloorFloating(sector_t *thisSector)
|
||||
{
|
||||
sector_t *adjSector, *refSector = NULL, *frontSector, *backSector;
|
||||
linechain_t *thisElem, *nextElem;
|
||||
|
||||
if (!thisSector)
|
||||
return false;
|
||||
|
||||
nextElem = thisSector->sectorLines;
|
||||
|
||||
while (nextElem) // walk through chain
|
||||
{
|
||||
thisElem = nextElem;
|
||||
nextElem = thisElem->next;
|
||||
|
||||
frontSector = thisElem->line->frontsector;
|
||||
backSector = thisElem->line->backsector;
|
||||
|
||||
if (frontSector == thisSector)
|
||||
adjSector = backSector;
|
||||
else
|
||||
adjSector = frontSector;
|
||||
|
||||
if (!adjSector) // assume floating sectors have surrounding sectors
|
||||
return false;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (adjSector->f_slope) // Don't bother with slopes
|
||||
return false;
|
||||
#endif
|
||||
|
||||
if (!refSector)
|
||||
{
|
||||
refSector = adjSector;
|
||||
continue;
|
||||
}
|
||||
|
||||
// if adjacent sector has same height or more than one adjacent sector exists -> stop
|
||||
if (thisSector->floorheight == adjSector->floorheight || refSector != adjSector)
|
||||
return false;
|
||||
}
|
||||
|
||||
// now check for walltextures
|
||||
if (!areBottomtexturesMissing(thisSector))
|
||||
{
|
||||
floating = false;
|
||||
}
|
||||
}
|
||||
return floating;
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -707,9 +693,7 @@ static fixed_t estimateCeilHeight(sector_t *thisSector)
|
|||
{
|
||||
sector_t *adjSector;
|
||||
|
||||
if (!thisSector ||
|
||||
!thisSector->sectorLines ||
|
||||
!thisSector->sectorLines->line)
|
||||
if (!thisSector || !thisSector->sectorLines || !thisSector->sectorLines->line)
|
||||
return 0;
|
||||
|
||||
adjSector = thisSector->sectorLines->line->frontsector;
|
||||
|
@ -729,16 +713,14 @@ static fixed_t estimateFloorHeight(sector_t *thisSector)
|
|||
{
|
||||
sector_t *adjSector;
|
||||
|
||||
if (!thisSector ||
|
||||
!thisSector->sectorLines ||
|
||||
!thisSector->sectorLines->line)
|
||||
if (!thisSector || !thisSector->sectorLines || !thisSector->sectorLines->line)
|
||||
return 0;
|
||||
|
||||
adjSector = thisSector->sectorLines->line->frontsector;
|
||||
if (adjSector == thisSector)
|
||||
adjSector = thisSector->sectorLines->line->backsector;
|
||||
|
||||
if (NULL == adjSector)
|
||||
if (!adjSector)
|
||||
return 0;
|
||||
|
||||
return adjSector->floorheight;
|
||||
|
@ -845,18 +827,12 @@ void HWR_CorrectSWTricks(void)
|
|||
// correct height of floating sectors
|
||||
if (isCeilingFloating(floatSector))
|
||||
{
|
||||
fixed_t corrheight;
|
||||
|
||||
corrheight = estimateCeilHeight(floatSector);
|
||||
floatSector->virtualCeilingheight = corrheight;
|
||||
floatSector->virtualCeilingheight = estimateCeilHeight(floatSector);
|
||||
floatSector->virtualCeiling = true;
|
||||
}
|
||||
if (isFloorFloating(floatSector))
|
||||
{
|
||||
fixed_t corrheight;
|
||||
|
||||
corrheight = estimateFloorHeight(floatSector);
|
||||
floatSector->virtualFloorheight = corrheight;
|
||||
floatSector->virtualFloorheight = estimateFloorHeight(floatSector);
|
||||
floatSector->virtualFloor = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ typedef struct snddev_s
|
|||
size_t numsfxs;
|
||||
|
||||
// Windows specific data
|
||||
#if defined (_WIN32) && !defined (_XBOX)
|
||||
#ifdef _WIN32
|
||||
UINT32 cooplevel;
|
||||
HWND hWnd;
|
||||
#endif
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
// Emacs style mode select -*- C++ -*-
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file
|
||||
/// \brief MiniGL API for Doom Legacy
|
||||
|
||||
|
||||
// tell r_opengl.cpp to compile for MiniGL Drivers
|
||||
#define MINI_GL_COMPATIBILITY
|
||||
|
||||
// tell r_opengl.cpp to compile for ATI Rage Pro OpenGL driver
|
||||
//#define ATI_RAGE_PRO_COMPATIBILITY
|
||||
|
||||
#define DRIVER_STRING "HWRAPI Init(): SRB2 MiniGL renderer"
|
||||
|
||||
// Include this at end
|
||||
#include "../r_opengl/r_opengl.c"
|
||||
#include "../r_opengl/ogl_win.c"
|
||||
|
||||
// That's all ;-)
|
||||
// Just, be sure to do the right changes in r_opengl.cpp
|
|
@ -1,89 +0,0 @@
|
|||
[Project]
|
||||
FileName=r_minigl.dev
|
||||
Name=r_minigl
|
||||
Ver=1
|
||||
IsCpp=1
|
||||
Type=3
|
||||
Compiler=-D_M_IX86=500_@@_-Wall_@@_-D_WINDOWS_@@_-DUSE_WGL_SWAP_@@_-Os_@@_-fomit-frame-pointer_@@_
|
||||
CppCompiler=
|
||||
Includes=
|
||||
Linker=--def ../r_mingw.def_@@_-lgdi32_@@_
|
||||
Libs=
|
||||
UnitCount=4
|
||||
Folders=
|
||||
ObjFiles=
|
||||
PrivateResource=
|
||||
ResourceIncludes=
|
||||
MakeIncludes=
|
||||
Icon=
|
||||
ExeOutput=C:\srb2demo2
|
||||
ObjectOutput=..\..\..\objs\Mingw\r_minigl
|
||||
OverrideOutput=1
|
||||
OverrideOutputName=r_minigl.dll
|
||||
HostApplication=
|
||||
CommandLine=
|
||||
IncludeVersionInfo=0
|
||||
SupportXPThemes=0
|
||||
CompilerSet=0
|
||||
CompilerSettings=00000000000000000111d0
|
||||
UseCustomMakefile=0
|
||||
CustomMakefile=
|
||||
|
||||
[Unit1]
|
||||
FileName=..\r_opengl\ogl_win.c
|
||||
Folder=
|
||||
Compile=0
|
||||
CompileCpp=0
|
||||
Link=0
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=$(CC) -c ogl_win.c -o ../../../objs/Mingw/r_minigl/ogl_win.o $(CFLAGS)
|
||||
|
||||
[Unit2]
|
||||
FileName=..\r_opengl\r_opengl.c
|
||||
Folder=
|
||||
Compile=0
|
||||
CompileCpp=0
|
||||
Link=0
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=$(CC) -c r_opengl.c -o ../../../objs/Mingw/r_minigl/r_opengl.o $(CFLAGS)
|
||||
|
||||
[Unit3]
|
||||
FileName=..\r_opengl\r_opengl.h
|
||||
Folder=
|
||||
Compile=1
|
||||
CompileCpp=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[VersionInfo]
|
||||
Major=0
|
||||
Minor=1
|
||||
Release=1
|
||||
Build=1
|
||||
LanguageID=1033
|
||||
CharsetID=1252
|
||||
CompanyName=
|
||||
FileVersion=0.1
|
||||
FileDescription=Developed using the Dev-C++ IDE
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=r_opengl.exe
|
||||
ProductName=r_opengl
|
||||
ProductVersion=0.1
|
||||
AutoIncBuildNr=0
|
||||
|
||||
[Unit4]
|
||||
FileName=r_minigl.c
|
||||
CompileCpp=0
|
||||
Folder=r_minigl
|
||||
Compile=1
|
||||
Link=1
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=$(CC) -c r_minigl.c -o ../../../objs/Mingw/r_minigl/r_minigl.o $(CFLAGS)
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
# Microsoft Developer Studio Project File - Name="r_minigl" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=r_minigl - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "r_minigl.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "r_minigl.mak" CFG="r_minigl - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "r_minigl - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "r_minigl - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "r_minigl - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "..\..\..\objs\Release"
|
||||
# PROP BASE Intermediate_Dir "..\..\..\objs\Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "..\..\..\bin\VC\Release\r_minigl"
|
||||
# PROP Intermediate_Dir "..\..\..\objs\VC\Release\r_minigl"
|
||||
# PROP Ignore_Export_Lib 1
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "R_MINIGL_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /G5 /MT /W3 /GX /Zi /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "__WIN32__" /D "__MSC__" /FR /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x80c /d "NDEBUG"
|
||||
# ADD RSC /l 0x40c /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 user32.lib gdi32.lib /nologo /dll /pdb:"..\..\..\bin\VC\Release\r_minigl.pdb" /machine:I386 /out:"..\..\..\bin\VC\Release\r_minigl.dll"
|
||||
# SUBTRACT LINK32 /pdb:none /debug
|
||||
|
||||
!ELSEIF "$(CFG)" == "r_minigl - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "..\..\..\objs\Debug"
|
||||
# PROP BASE Intermediate_Dir "..\..\..\objs\Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "..\..\..\bin\VC\Debug\r_minigl"
|
||||
# PROP Intermediate_Dir "..\..\..\objs\VC\Debug\r_minigl"
|
||||
# PROP Ignore_Export_Lib 1
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "R_MINIGL_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WIN32__" /D "__MSC__" /D "_MBCS" /D "_USRDLL" /D "R_MINIGL_EXPORTS" /FR /FD /GZ /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x80c /d "_DEBUG"
|
||||
# ADD RSC /l 0x40c /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 ouser32.lib gdi32.lib /nologo /dll /pdb:"..\..\..\bin\VC\Debug\r_minigl.pdb" /debug /machine:I386 /out:"..\..\..\bin\VC\Debug\r_minigl.dll" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "r_minigl - Win32 Release"
|
||||
# Name "r_minigl - Win32 Debug"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\r_minigl.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\r_opengl\r_opengl.h
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
|
@ -30,10 +30,8 @@
|
|||
#include <stdarg.h>
|
||||
#include <math.h>
|
||||
#ifndef SHUFFLE
|
||||
#ifndef KOS_GL_COMPATIBILITY
|
||||
#define SHUFFLE
|
||||
#endif
|
||||
#endif
|
||||
#include "r_opengl.h"
|
||||
|
||||
#if defined (HWRENDER) && !defined (NOROPENGL)
|
||||
|
@ -83,9 +81,7 @@ GLint screen_height = 0;
|
|||
GLbyte screen_depth = 0;
|
||||
GLint textureformatGL = 0;
|
||||
GLint maximumAnisotropy = 0;
|
||||
#ifndef KOS_GL_COMPATIBILITY
|
||||
static GLboolean MipMap = GL_FALSE;
|
||||
#endif
|
||||
static GLint min_filter = GL_LINEAR;
|
||||
static GLint mag_filter = GL_LINEAR;
|
||||
static GLint anisotropic_filter = 0;
|
||||
|
@ -94,11 +90,9 @@ static FTransform md2_transform;
|
|||
const GLubyte *gl_extensions = NULL;
|
||||
|
||||
//Hurdler: 04/10/2000: added for the kick ass coronas as Boris wanted;-)
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
static GLdouble modelMatrix[16];
|
||||
static GLdouble projMatrix[16];
|
||||
static GLint viewport[4];
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef USE_PALETTED_TEXTURE
|
||||
|
@ -158,9 +152,7 @@ float byteasfloat(UINT8 fbyte)
|
|||
|
||||
static I_Error_t I_Error_GL = NULL;
|
||||
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
static boolean gl13 = false; // whether we can use opengl 1.3 functions
|
||||
#endif
|
||||
|
||||
|
||||
// -----------------+
|
||||
|
@ -198,14 +190,9 @@ FUNCPRINTF void DBG_Printf(const char *lpFmt, ...)
|
|||
#define pglScissor glScissor
|
||||
#define pglEnable glEnable
|
||||
#define pglDisable glDisable
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
#define pglGetDoublev glGetDoublev
|
||||
#endif
|
||||
//glGetIntegerv
|
||||
//glGetString
|
||||
#ifdef KOS_GL_COMPATIBILITY
|
||||
#define pglHint glHint
|
||||
#endif
|
||||
|
||||
/* Depth Buffer */
|
||||
#define pglClearDepth glClearDepth
|
||||
|
@ -219,11 +206,7 @@ FUNCPRINTF void DBG_Printf(const char *lpFmt, ...)
|
|||
#define pglPushMatrix glPushMatrix
|
||||
#define pglPopMatrix glPopMatrix
|
||||
#define pglLoadIdentity glLoadIdentity
|
||||
#ifdef MINI_GL_COMPATIBILITY
|
||||
#define pglMultMatrixf glMultMatrixf
|
||||
#else
|
||||
#define pglMultMatrixd glMultMatrixd
|
||||
#endif
|
||||
#define pglRotatef glRotatef
|
||||
#define pglScalef glScalef
|
||||
#define pglTranslatef glTranslatef
|
||||
|
@ -261,9 +244,7 @@ FUNCPRINTF void DBG_Printf(const char *lpFmt, ...)
|
|||
#define pglDeleteTextures glDeleteTextures
|
||||
#define pglBindTexture glBindTexture
|
||||
/* texture mapping */ //GL_EXT_copy_texture
|
||||
#ifndef KOS_GL_COMPATIBILITY
|
||||
#define pglCopyTexImage2D glCopyTexImage2D
|
||||
#endif
|
||||
|
||||
#else //!STATIC_OPENGL
|
||||
|
||||
|
@ -290,10 +271,8 @@ typedef void (APIENTRY * PFNglEnable) (GLenum cap);
|
|||
static PFNglEnable pglEnable;
|
||||
typedef void (APIENTRY * PFNglDisable) (GLenum cap);
|
||||
static PFNglDisable pglDisable;
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
typedef void (APIENTRY * PFNglGetDoublev) (GLenum pname, GLdouble *params);
|
||||
static PFNglGetDoublev pglGetDoublev;
|
||||
#endif
|
||||
//glGetIntegerv
|
||||
//glGetString
|
||||
|
||||
|
@ -318,13 +297,8 @@ typedef void (APIENTRY * PFNglPopMatrix) (void);
|
|||
static PFNglPopMatrix pglPopMatrix;
|
||||
typedef void (APIENTRY * PFNglLoadIdentity) (void);
|
||||
static PFNglLoadIdentity pglLoadIdentity;
|
||||
#ifdef MINI_GL_COMPATIBILITY
|
||||
typedef void (APIENTRY * PFNglMultMatrixf) (const GLfloat *m);
|
||||
static PFNglMultMatrixf pglMultMatrixf;
|
||||
#else
|
||||
typedef void (APIENTRY * PFNglMultMatrixd) (const GLdouble *m);
|
||||
static PFNglMultMatrixd pglMultMatrixd;
|
||||
#endif
|
||||
typedef void (APIENTRY * PFNglRotatef) (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
|
||||
static PFNglRotatef pglRotatef;
|
||||
typedef void (APIENTRY * PFNglScalef) (GLfloat x, GLfloat y, GLfloat z);
|
||||
|
@ -392,15 +366,12 @@ static PFNglCopyTexImage2D pglCopyTexImage2D;
|
|||
typedef GLint (APIENTRY * PFNgluBuild2DMipmaps) (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
|
||||
static PFNgluBuild2DMipmaps pgluBuild2DMipmaps;
|
||||
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
/* 1.3 functions for multitexturing */
|
||||
typedef void (APIENTRY *PFNglActiveTexture) (GLenum);
|
||||
static PFNglActiveTexture pglActiveTexture;
|
||||
typedef void (APIENTRY *PFNglMultiTexCoord2f) (GLenum, GLfloat, GLfloat);
|
||||
static PFNglMultiTexCoord2f pglMultiTexCoord2f;
|
||||
#endif
|
||||
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
/* 1.2 Parms */
|
||||
/* GL_CLAMP_TO_EDGE_EXT */
|
||||
#ifndef GL_CLAMP_TO_EDGE
|
||||
|
@ -421,14 +392,6 @@ static PFNglMultiTexCoord2f pglMultiTexCoord2f;
|
|||
#define GL_TEXTURE1 0x84C1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef MINI_GL_COMPATIBILITY
|
||||
#undef GL_CLAMP_TO_EDGE
|
||||
#undef GL_TEXTURE_MIN_LOD
|
||||
#undef GL_TEXTURE_MAX_LOD
|
||||
#endif
|
||||
|
||||
boolean SetupGLfunc(void)
|
||||
{
|
||||
#ifndef STATIC_OPENGL
|
||||
|
@ -451,9 +414,7 @@ boolean SetupGLfunc(void)
|
|||
GETOPENGLFUNC(pglScissor , glScissor)
|
||||
GETOPENGLFUNC(pglEnable , glEnable)
|
||||
GETOPENGLFUNC(pglDisable , glDisable)
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
GETOPENGLFUNC(pglGetDoublev , glGetDoublev)
|
||||
#endif
|
||||
GETOPENGLFUNC(pglGetIntegerv , glGetIntegerv)
|
||||
GETOPENGLFUNC(pglGetString , glGetString)
|
||||
|
||||
|
@ -467,11 +428,7 @@ boolean SetupGLfunc(void)
|
|||
GETOPENGLFUNC(pglPushMatrix , glPushMatrix)
|
||||
GETOPENGLFUNC(pglPopMatrix , glPopMatrix)
|
||||
GETOPENGLFUNC(pglLoadIdentity , glLoadIdentity)
|
||||
#ifdef MINI_GL_COMPATIBILITY
|
||||
GETOPENGLFUNC(pglMultMatrixf , glMultMatrixf)
|
||||
#else
|
||||
GETOPENGLFUNC(pglMultMatrixd , glMultMatrixd)
|
||||
#endif
|
||||
GETOPENGLFUNC(pglRotatef , glRotatef)
|
||||
GETOPENGLFUNC(pglScalef , glScalef)
|
||||
GETOPENGLFUNC(pglTranslatef , glTranslatef)
|
||||
|
@ -515,9 +472,6 @@ boolean SetupGLfunc(void)
|
|||
// This has to be done after the context is created so the version number can be obtained
|
||||
boolean SetupGLFunc13(void)
|
||||
{
|
||||
#ifdef MINI_GL_COMPATIBILITY
|
||||
return false;
|
||||
#else
|
||||
const GLubyte *version = pglGetString(GL_VERSION);
|
||||
int glmajor, glminor;
|
||||
|
||||
|
@ -553,7 +507,6 @@ boolean SetupGLFunc13(void)
|
|||
else
|
||||
DBG_Printf("GL_ARB_multitexture support: disabled\n");
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
// -----------------+
|
||||
|
@ -571,11 +524,7 @@ static void SetNoTexture(void)
|
|||
|
||||
static void GLPerspective(GLdouble fovy, GLdouble aspect)
|
||||
{
|
||||
#ifdef MINI_GL_COMPATIBILITY
|
||||
GLfloat m[4][4] =
|
||||
#else
|
||||
GLdouble m[4][4] =
|
||||
#endif
|
||||
{
|
||||
{ 1.0f, 0.0f, 0.0f, 0.0f},
|
||||
{ 0.0f, 1.0f, 0.0f, 0.0f},
|
||||
|
@ -598,14 +547,9 @@ static void GLPerspective(GLdouble fovy, GLdouble aspect)
|
|||
m[1][1] = cotangent;
|
||||
m[2][2] = -(zFar + zNear) / deltaZ;
|
||||
m[3][2] = -2.0f * zNear * zFar / deltaZ;
|
||||
#ifdef MINI_GL_COMPATIBILITY
|
||||
pglMultMatrixf(&m[0][0]);
|
||||
#else
|
||||
pglMultMatrixd(&m[0][0]);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
static void GLProject(GLdouble objX, GLdouble objY, GLdouble objZ,
|
||||
GLdouble* winX, GLdouble* winY, GLdouble* winZ)
|
||||
{
|
||||
|
@ -645,7 +589,6 @@ static void GLProject(GLdouble objX, GLdouble objY, GLdouble objZ,
|
|||
*winY=in[1];
|
||||
*winZ=in[2];
|
||||
}
|
||||
#endif
|
||||
|
||||
// -----------------+
|
||||
// SetModelView :
|
||||
|
@ -672,10 +615,8 @@ void SetModelView(GLint w, GLint h)
|
|||
//pglScalef(1.0f, 320.0f/200.0f, 1.0f); // gr_scalefrustum (ORIGINAL_ASPECT)
|
||||
|
||||
// added for new coronas' code (without depth buffer)
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
pglGetIntegerv(GL_VIEWPORT, viewport);
|
||||
pglGetDoublev(GL_PROJECTION_MATRIX, projMatrix);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -700,17 +641,13 @@ void SetStates(void)
|
|||
//pglShadeModel(GL_FLAT);
|
||||
|
||||
pglEnable(GL_TEXTURE_2D); // two-dimensional texturing
|
||||
#ifndef KOS_GL_COMPATIBILITY
|
||||
pglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
pglAlphaFunc(GL_NOTEQUAL, 0.0f);
|
||||
#endif
|
||||
//pglBlendFunc(GL_ONE, GL_ZERO); // copy pixel to frame buffer (opaque)
|
||||
pglEnable(GL_BLEND); // enable color blending
|
||||
|
||||
#ifndef KOS_GL_COMPATIBILITY
|
||||
pglColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
#endif
|
||||
|
||||
//pglDisable(GL_DITHER); // faB: ??? (undocumented in OpenGL 1.1)
|
||||
// Hurdler: yes, it is!
|
||||
|
@ -735,9 +672,7 @@ void SetStates(void)
|
|||
//tex_downloaded = NOTEXTURE_NUM;
|
||||
//pglTexImage2D(GL_TEXTURE_2D, 0, 4, 8, 8, 0, GL_RGBA, GL_UNSIGNED_BYTE, Data);
|
||||
|
||||
#ifndef KOS_GL_COMPATIBILITY
|
||||
pglPolygonOffset(-1.0f, -1.0f);
|
||||
#endif
|
||||
|
||||
//pglEnable(GL_CULL_FACE);
|
||||
//pglCullFace(GL_FRONT);
|
||||
|
@ -758,9 +693,7 @@ void SetStates(void)
|
|||
// bp : when no t&l :)
|
||||
pglLoadIdentity();
|
||||
pglScalef(1.0f, 1.0f, -1.0f);
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
pglGetDoublev(GL_MODELVIEW_MATRIX, modelMatrix); // added for new coronas' code (without depth buffer)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -863,14 +796,6 @@ EXPORT void HWRAPI(ClearMipMapCache) (void)
|
|||
EXPORT void HWRAPI(ReadRect) (INT32 x, INT32 y, INT32 width, INT32 height,
|
||||
INT32 dst_stride, UINT16 * dst_data)
|
||||
{
|
||||
#ifdef KOS_GL_COMPATIBILITY
|
||||
(void)x;
|
||||
(void)y;
|
||||
(void)width;
|
||||
(void)height;
|
||||
(void)dst_stride;
|
||||
(void)dst_data;
|
||||
#else
|
||||
INT32 i;
|
||||
// DBG_Printf ("ReadRect()\n");
|
||||
if (dst_stride == width*3)
|
||||
|
@ -912,7 +837,6 @@ EXPORT void HWRAPI(ReadRect) (INT32 x, INT32 y, INT32 width, INT32 height,
|
|||
}
|
||||
free(image);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -933,10 +857,8 @@ EXPORT void HWRAPI(GClipRect) (INT32 minx, INT32 miny, INT32 maxx, INT32 maxy, f
|
|||
pglMatrixMode(GL_MODELVIEW);
|
||||
|
||||
// added for new coronas' code (without depth buffer)
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
pglGetIntegerv(GL_VIEWPORT, viewport);
|
||||
pglGetDoublev(GL_PROJECTION_MATRIX, projMatrix);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -983,12 +905,6 @@ EXPORT void HWRAPI(Draw2DLine) (F2DCoord * v1,
|
|||
GLRGBAFloat c;
|
||||
|
||||
// DBG_Printf ("DrawLine() (%f %f %f) %d\n", v1->x, -v1->y, -v1->z, v1->argb);
|
||||
#ifdef MINI_GL_COMPATIBILITY
|
||||
GLfloat px1, px2, px3, px4;
|
||||
GLfloat py1, py2, py3, py4;
|
||||
GLfloat dx, dy;
|
||||
GLfloat angle;
|
||||
#endif
|
||||
|
||||
// BP: we should reflect the new state in our variable
|
||||
//SetBlend(PF_Modulated|PF_NoTexture);
|
||||
|
@ -1000,33 +916,11 @@ EXPORT void HWRAPI(Draw2DLine) (F2DCoord * v1,
|
|||
c.blue = byte2float[Color.s.blue];
|
||||
c.alpha = byte2float[Color.s.alpha];
|
||||
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
pglColor4fv(&c.red); // is in RGBA float format
|
||||
pglBegin(GL_LINES);
|
||||
pglVertex3f(v1->x, -v1->y, 1.0f);
|
||||
pglVertex3f(v2->x, -v2->y, 1.0f);
|
||||
pglEnd();
|
||||
#else
|
||||
if (v2->x != v1->x)
|
||||
angle = (float)atan((v2->y-v1->y)/(v2->x-v1->x));
|
||||
else
|
||||
angle = N_PI_DEMI;
|
||||
dx = (float)sin(angle) / (float)screen_width;
|
||||
dy = (float)cos(angle) / (float)screen_height;
|
||||
|
||||
px1 = v1->x - dx; py1 = v1->y + dy;
|
||||
px2 = v2->x - dx; py2 = v2->y + dy;
|
||||
px3 = v2->x + dx; py3 = v2->y - dy;
|
||||
px4 = v1->x + dx; py4 = v1->y - dy;
|
||||
|
||||
pglColor4f(c.red, c.green, c.blue, c.alpha);
|
||||
pglBegin(GL_TRIANGLE_FAN);
|
||||
pglVertex3f(px1, -py1, 1);
|
||||
pglVertex3f(px2, -py2, 1);
|
||||
pglVertex3f(px3, -py3, 1);
|
||||
pglVertex3f(px4, -py4, 1);
|
||||
pglEnd();
|
||||
#endif
|
||||
|
||||
pglEnable(GL_TEXTURE_2D);
|
||||
}
|
||||
|
@ -1034,9 +928,7 @@ EXPORT void HWRAPI(Draw2DLine) (F2DCoord * v1,
|
|||
static void Clamp2D(GLenum pname)
|
||||
{
|
||||
pglTexParameteri(GL_TEXTURE_2D, pname, GL_CLAMP); // fallback clamp
|
||||
#ifdef GL_CLAMP_TO_EDGE
|
||||
pglTexParameteri(GL_TEXTURE_2D, pname, GL_CLAMP_TO_EDGE);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -1063,11 +955,7 @@ EXPORT void HWRAPI(SetBlend) (FBITFIELD PolyFlags)
|
|||
pglBlendFunc(GL_SRC_ALPHA, GL_ZERO); // 0 alpha = holes in texture
|
||||
break;
|
||||
case PF_Additive & PF_Blending:
|
||||
#ifdef ATI_RAGE_PRO_COMPATIBILITY
|
||||
pglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // alpha = level of transparency
|
||||
#else
|
||||
pglBlendFunc(GL_SRC_ALPHA, GL_ONE); // src * alpha + dest
|
||||
#endif
|
||||
break;
|
||||
case PF_Environment & PF_Blending:
|
||||
pglBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
@ -1083,7 +971,6 @@ EXPORT void HWRAPI(SetBlend) (FBITFIELD PolyFlags)
|
|||
break;
|
||||
}
|
||||
}
|
||||
#ifndef KOS_GL_COMPATIBILITY
|
||||
if (Xor & PF_NoAlphaTest)
|
||||
{
|
||||
if (PolyFlags & PF_NoAlphaTest)
|
||||
|
@ -1099,7 +986,7 @@ EXPORT void HWRAPI(SetBlend) (FBITFIELD PolyFlags)
|
|||
else
|
||||
pglDisable(GL_POLYGON_OFFSET_FILL);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (Xor&PF_NoDepthTest)
|
||||
{
|
||||
if (PolyFlags & PF_NoDepthTest)
|
||||
|
@ -1126,10 +1013,6 @@ EXPORT void HWRAPI(SetBlend) (FBITFIELD PolyFlags)
|
|||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
}
|
||||
|
||||
#ifdef KOS_GL_COMPATIBILITY
|
||||
if (Xor&PF_Modulated && !(PolyFlags & PF_Modulated))
|
||||
pglColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
#else
|
||||
if (Xor&PF_Modulated)
|
||||
{
|
||||
#if defined (__unix__) || defined (UNIXCOMMON)
|
||||
|
@ -1149,7 +1032,6 @@ EXPORT void HWRAPI(SetBlend) (FBITFIELD PolyFlags)
|
|||
pglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (Xor & PF_Occlude) // depth test but (no) depth write
|
||||
{
|
||||
|
@ -1203,11 +1085,7 @@ EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo)
|
|||
else
|
||||
{
|
||||
// Download a mipmap
|
||||
#ifdef KOS_GL_COMPATIBILITY
|
||||
static GLushort tex[2048*2048];
|
||||
#else
|
||||
static RGBA_t tex[2048*2048];
|
||||
#endif
|
||||
const GLvoid *ptex = tex;
|
||||
INT32 w, h;
|
||||
|
||||
|
@ -1222,106 +1100,9 @@ EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo)
|
|||
!(pTexInfo->flags & TF_CHROMAKEYED))
|
||||
{
|
||||
// do nothing here.
|
||||
// Not a problem with MiniGL since we don't use paletted texture
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef KOS_GL_COMPATIBILITY
|
||||
if ((pTexInfo->grInfo.format == GR_TEXFMT_P_8) ||
|
||||
(pTexInfo->grInfo.format == GR_TEXFMT_AP_88))
|
||||
{
|
||||
const GLubyte *pImgData = (const GLubyte *)pTexInfo->grInfo.data;
|
||||
INT32 i, j;
|
||||
|
||||
for (j = 0; j < h; j++)
|
||||
{
|
||||
for (i = 0; i < w; i++)
|
||||
{
|
||||
if ((*pImgData == HWR_PATCHES_CHROMAKEY_COLORINDEX) &&
|
||||
(pTexInfo->flags & TF_CHROMAKEYED))
|
||||
{
|
||||
tex[w*j+i] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pTexInfo->grInfo.format == GR_TEXFMT_AP_88 && !(pTexInfo->flags & TF_CHROMAKEYED))
|
||||
tex[w*j+i] = 0;
|
||||
else
|
||||
tex[w*j+i] = (myPaletteData[*pImgData].s.alpha>>4)<<12;
|
||||
|
||||
tex[w*j+i] |= (myPaletteData[*pImgData].s.red >>4)<<8;
|
||||
tex[w*j+i] |= (myPaletteData[*pImgData].s.green>>4)<<4;
|
||||
tex[w*j+i] |= (myPaletteData[*pImgData].s.blue >>4);
|
||||
}
|
||||
|
||||
pImgData++;
|
||||
|
||||
if (pTexInfo->grInfo.format == GR_TEXFMT_AP_88)
|
||||
{
|
||||
if (!(pTexInfo->flags & TF_CHROMAKEYED))
|
||||
tex[w*j+i] |= ((*pImgData)>>4)<<12;
|
||||
pImgData++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (pTexInfo->grInfo.format == GR_RGBA)
|
||||
{
|
||||
// corona test : passed as ARGB 8888, which is not in glide formats
|
||||
// Hurdler: not used for coronas anymore, just for dynamic lighting
|
||||
const RGBA_t *pImgData = (const RGBA_t *)pTexInfo->grInfo.data;
|
||||
INT32 i, j;
|
||||
|
||||
for (j = 0; j < h; j++)
|
||||
{
|
||||
for (i = 0; i < w; i++)
|
||||
{
|
||||
tex[w*j+i] = (pImgData->s.alpha>>4)<<12;
|
||||
tex[w*j+i] |= (pImgData->s.red >>4)<<8;
|
||||
tex[w*j+i] |= (pImgData->s.green>>4)<<4;
|
||||
tex[w*j+i] |= (pImgData->s.blue >>4);
|
||||
pImgData++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (pTexInfo->grInfo.format == GR_TEXFMT_ALPHA_INTENSITY_88)
|
||||
{
|
||||
const GLubyte *pImgData = (const GLubyte *)pTexInfo->grInfo.data;
|
||||
INT32 i, j;
|
||||
|
||||
for (j = 0; j < h; j++)
|
||||
{
|
||||
for (i = 0; i < w; i++)
|
||||
{
|
||||
const GLubyte sID = (*pImgData)>>4;
|
||||
tex[w*j+i] = sID<<8 | sID<<4 | sID;
|
||||
pImgData++;
|
||||
tex[w*j+i] |= ((*pImgData)>>4)<<12;
|
||||
pImgData++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (pTexInfo->grInfo.format == GR_TEXFMT_ALPHA_8) // Used for fade masks
|
||||
{
|
||||
const GLubyte *pImgData = (const GLubyte *)pTexInfo->grInfo.data;
|
||||
INT32 i, j;
|
||||
|
||||
for (j = 0; j < h; j++)
|
||||
{
|
||||
for (i = 0; i < w; i++)
|
||||
{
|
||||
tex[w*j+i] = (pImgData>>4)<<12;
|
||||
tex[w*j+i] |= (255>>4)<<8;
|
||||
tex[w*j+i] |= (255>>4)<<4;
|
||||
tex[w*j+i] |= (255>>4);
|
||||
pImgData++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
DBG_Printf ("SetTexture(bad format) %ld\n", pTexInfo->grInfo.format);
|
||||
#else
|
||||
if ((pTexInfo->grInfo.format == GR_TEXFMT_P_8) ||
|
||||
(pTexInfo->grInfo.format == GR_TEXFMT_AP_88))
|
||||
{
|
||||
|
@ -1403,7 +1184,6 @@ EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo)
|
|||
}
|
||||
else
|
||||
DBG_Printf ("SetTexture(bad format) %ld\n", pTexInfo->grInfo.format);
|
||||
#endif
|
||||
|
||||
pTexInfo->downloaded = NextTexAvail++;
|
||||
tex_downloaded = pTexInfo->downloaded;
|
||||
|
@ -1412,18 +1192,6 @@ EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo)
|
|||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, mag_filter);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, min_filter);
|
||||
|
||||
#ifdef KOS_GL_COMPATIBILITY
|
||||
pglTexImage2D(GL_TEXTURE_2D, 0, GL_ARGB4444, w, h, 0, GL_ARGB4444, GL_UNSIGNED_BYTE, ptex);
|
||||
#else
|
||||
#ifdef MINI_GL_COMPATIBILITY
|
||||
//if (pTexInfo->grInfo.format == GR_TEXFMT_ALPHA_INTENSITY_88)
|
||||
//pglTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
|
||||
//else
|
||||
if (MipMap)
|
||||
pgluBuild2DMipmaps(GL_TEXTURE_2D, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
|
||||
else
|
||||
pglTexImage2D(GL_TEXTURE_2D, 0, 4, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
|
||||
#else
|
||||
#ifdef USE_PALETTED_TEXTURE
|
||||
//Hurdler: not really supported and not tested recently
|
||||
if (glColorTableEXT &&
|
||||
|
@ -1441,15 +1209,11 @@ EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo)
|
|||
if (MipMap)
|
||||
{
|
||||
pgluBuild2DMipmaps(GL_TEXTURE_2D, GL_LUMINANCE_ALPHA, w, h, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
|
||||
#ifdef GL_TEXTURE_MIN_LOD
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, 0);
|
||||
#endif
|
||||
#ifdef GL_TEXTURE_MAX_LOD
|
||||
if (pTexInfo->flags & TF_TRANSPARENT)
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 0); // No mippmaps on transparent stuff
|
||||
else
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 4);
|
||||
#endif
|
||||
//pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_LINEAR_MIPMAP_LINEAR);
|
||||
}
|
||||
else
|
||||
|
@ -1461,15 +1225,11 @@ EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo)
|
|||
if (MipMap)
|
||||
{
|
||||
pgluBuild2DMipmaps(GL_TEXTURE_2D, GL_ALPHA, w, h, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
|
||||
#ifdef GL_TEXTURE_MIN_LOD
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, 0);
|
||||
#endif
|
||||
#ifdef GL_TEXTURE_MAX_LOD
|
||||
if (pTexInfo->flags & TF_TRANSPARENT)
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 0); // No mippmaps on transparent stuff
|
||||
else
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 4);
|
||||
#endif
|
||||
//pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_LINEAR_MIPMAP_LINEAR);
|
||||
}
|
||||
else
|
||||
|
@ -1481,21 +1241,15 @@ EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo)
|
|||
{
|
||||
pgluBuild2DMipmaps(GL_TEXTURE_2D, textureformatGL, w, h, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
|
||||
// Control the mipmap level of detail
|
||||
#ifdef GL_TEXTURE_MIN_LOD
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, 0); // the lower the number, the higer the detail
|
||||
#endif
|
||||
#ifdef GL_TEXTURE_MAX_LOD
|
||||
if (pTexInfo->flags & TF_TRANSPARENT)
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 0); // No mippmaps on transparent stuff
|
||||
else
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 5);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
pglTexImage2D(GL_TEXTURE_2D, 0, textureformatGL, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (pTexInfo->flags & TF_WRAPX)
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
|
@ -1519,19 +1273,6 @@ EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo)
|
|||
else // initialisation de la liste
|
||||
gr_cachetail = gr_cachehead = pTexInfo;
|
||||
}
|
||||
#ifdef MINI_GL_COMPATIBILITY
|
||||
switch (pTexInfo->flags)
|
||||
{
|
||||
case 0 :
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
|
||||
break;
|
||||
default:
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -1545,18 +1286,11 @@ EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf,
|
|||
FBITFIELD PolyFlags)
|
||||
{
|
||||
FUINT i;
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
FUINT j;
|
||||
#endif
|
||||
GLRGBAFloat c = {0,0,0,0};
|
||||
|
||||
#ifdef MINI_GL_COMPATIBILITY
|
||||
if (PolyFlags & PF_Corona)
|
||||
PolyFlags &= ~PF_NoDepthTest;
|
||||
#else
|
||||
if ((PolyFlags & PF_Corona) && (oglflags & GLF_NOZBUFREAD))
|
||||
PolyFlags &= ~(PF_NoDepthTest|PF_Corona);
|
||||
#endif
|
||||
|
||||
SetBlend(PolyFlags); //TODO: inline (#pragma..)
|
||||
|
||||
|
@ -1578,16 +1312,11 @@ EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf,
|
|||
c.alpha = byte2float[pSurf->FlatColor.s.alpha];
|
||||
}
|
||||
|
||||
#ifdef MINI_GL_COMPATIBILITY
|
||||
pglColor4f(c.red, c.green, c.blue, c.alpha);
|
||||
#else
|
||||
pglColor4fv(&c.red); // is in RGBA float format
|
||||
#endif
|
||||
}
|
||||
|
||||
// this test is added for new coronas' code (without depth buffer)
|
||||
// I think I should do a separate function for drawing coronas, so it will be a little faster
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
if (PolyFlags & PF_Corona) // check to see if we need to draw the corona
|
||||
{
|
||||
//rem: all 8 (or 8.0f) values are hard coded: it can be changed to a higher value
|
||||
|
@ -1634,7 +1363,6 @@ EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf,
|
|||
c.alpha *= scalef; // change the alpha value (it seems better than changing the size of the corona)
|
||||
pglColor4fv(&c.red);
|
||||
}
|
||||
#endif
|
||||
if (PolyFlags & PF_MD2)
|
||||
return;
|
||||
|
||||
|
@ -1728,41 +1456,15 @@ EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value)
|
|||
break;
|
||||
|
||||
case HWD_SET_POLYGON_SMOOTH:
|
||||
#ifdef KOS_GL_COMPATIBILITY // GL_POLYGON_SMOOTH_HINT
|
||||
if (Value)
|
||||
pglHint(GL_POLYGON_SMOOTH_HINT,GL_NICEST);
|
||||
else
|
||||
pglHint(GL_POLYGON_SMOOTH_HINT,GL_FASTEST);
|
||||
#else
|
||||
if (Value)
|
||||
pglEnable(GL_POLYGON_SMOOTH);
|
||||
else
|
||||
pglDisable(GL_POLYGON_SMOOTH);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case HWD_SET_TEXTUREFILTERMODE:
|
||||
switch (Value)
|
||||
{
|
||||
#ifdef KOS_GL_COMPATIBILITY
|
||||
case HWD_SET_TEXTUREFILTER_TRILINEAR:
|
||||
case HWD_SET_TEXTUREFILTER_BILINEAR:
|
||||
min_filter = mag_filter = GL_FILTER_BILINEAR;
|
||||
break;
|
||||
case HWD_SET_TEXTUREFILTER_POINTSAMPLED:
|
||||
min_filter = mag_filter = GL_FILTER_NONE;
|
||||
case HWD_SET_TEXTUREFILTER_MIXED1:
|
||||
min_filter = GL_FILTER_NONE;
|
||||
mag_filter = GL_LINEAR;
|
||||
case HWD_SET_TEXTUREFILTER_MIXED2:
|
||||
min_filter = GL_LINEAR;
|
||||
mag_filter = GL_FILTER_NONE;
|
||||
break;
|
||||
case HWD_SET_TEXTUREFILTER_MIXED3:
|
||||
min_filter = GL_FILTER_BILINEAR;
|
||||
mag_filter = GL_FILTER_NONE;
|
||||
break;
|
||||
#elif !defined (MINI_GL_COMPATIBILITY)
|
||||
case HWD_SET_TEXTUREFILTER_TRILINEAR:
|
||||
min_filter = GL_LINEAR_MIPMAP_LINEAR;
|
||||
mag_filter = GL_LINEAR;
|
||||
|
@ -1791,14 +1493,9 @@ EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value)
|
|||
mag_filter = GL_NEAREST;
|
||||
MipMap = GL_TRUE;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
#ifdef KOS_GL_COMPATIBILITY
|
||||
min_filter = mag_filter = GL_FILTER_NONE;
|
||||
#else
|
||||
mag_filter = GL_LINEAR;
|
||||
min_filter = GL_NEAREST;
|
||||
#endif
|
||||
}
|
||||
if (!pgluBuild2DMipmaps)
|
||||
{
|
||||
|
@ -1831,9 +1528,7 @@ static void DrawMD2Ex(INT32 *gl_cmd_buffer, md2_frame_t *frame, UINT32 duration
|
|||
float scalex = scale, scaley = scale, scalez = scale;
|
||||
|
||||
// Because Otherwise, scaling the screen negatively vertically breaks the lighting
|
||||
#ifndef KOS_GL_COMPATIBILITY
|
||||
GLfloat LightPos[] = {0.0f, 1.0f, 0.0f, 0.0f};
|
||||
#endif
|
||||
|
||||
if (duration == 0)
|
||||
duration = 1;
|
||||
|
@ -1885,9 +1580,7 @@ static void DrawMD2Ex(INT32 *gl_cmd_buffer, md2_frame_t *frame, UINT32 duration
|
|||
pglCullFace(GL_BACK);
|
||||
}
|
||||
|
||||
#ifndef KOS_GL_COMPATIBILITY
|
||||
pglLightfv(GL_LIGHT0, GL_POSITION, LightPos);
|
||||
#endif
|
||||
|
||||
pglShadeModel(GL_SMOOTH);
|
||||
if (color)
|
||||
|
@ -2029,9 +1722,7 @@ EXPORT void HWRAPI(SetTransform) (FTransform *stransform)
|
|||
GLPerspective(53.13l, 2*ASPECT_RATIO); // 53.13 = 2*atan(0.5)
|
||||
else
|
||||
GLPerspective(stransform->fovxangle, ASPECT_RATIO);
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
pglGetDoublev(GL_PROJECTION_MATRIX, projMatrix); // added for new coronas' code (without depth buffer)
|
||||
#endif
|
||||
pglMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
else
|
||||
|
@ -2045,15 +1736,11 @@ EXPORT void HWRAPI(SetTransform) (FTransform *stransform)
|
|||
else
|
||||
//Hurdler: is "fov" correct?
|
||||
GLPerspective(fov, ASPECT_RATIO);
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
pglGetDoublev(GL_PROJECTION_MATRIX, projMatrix); // added for new coronas' code (without depth buffer)
|
||||
#endif
|
||||
pglMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
pglGetDoublev(GL_MODELVIEW_MATRIX, modelMatrix); // added for new coronas' code (without depth buffer)
|
||||
#endif
|
||||
}
|
||||
|
||||
EXPORT INT32 HWRAPI(GetTextureUsed) (void)
|
||||
|
@ -2149,18 +1836,11 @@ EXPORT void HWRAPI(StartScreenWipe) (void)
|
|||
|
||||
// Create screen texture
|
||||
pglBindTexture(GL_TEXTURE_2D, startScreenWipe);
|
||||
#ifdef KOS_GL_COMPATIBILITY
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_FILTER_NONE);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_FILTER_NONE);
|
||||
#else
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
#endif
|
||||
Clamp2D(GL_TEXTURE_WRAP_S);
|
||||
Clamp2D(GL_TEXTURE_WRAP_T);
|
||||
#ifndef KOS_GL_COMPATIBILITY
|
||||
pglCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, texsize, texsize, 0);
|
||||
#endif
|
||||
|
||||
tex_downloaded = 0; // 0 so it knows it doesn't have any of the cached patches downloaded right now
|
||||
}
|
||||
|
@ -2178,18 +1858,11 @@ EXPORT void HWRAPI(EndScreenWipe)(void)
|
|||
|
||||
// Create screen texture
|
||||
pglBindTexture(GL_TEXTURE_2D, endScreenWipe);
|
||||
#ifdef KOS_GL_COMPATIBILITY
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_FILTER_NONE);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_FILTER_NONE);
|
||||
#else
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
#endif
|
||||
Clamp2D(GL_TEXTURE_WRAP_S);
|
||||
Clamp2D(GL_TEXTURE_WRAP_T);
|
||||
#ifndef KOS_GL_COMPATIBILITY
|
||||
pglCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, texsize, texsize, 0);
|
||||
#endif
|
||||
|
||||
tex_downloaded = 0; // 0 so it knows it doesn't have any of the cached patches downloaded right now
|
||||
}
|
||||
|
@ -2242,9 +1915,7 @@ EXPORT void HWRAPI(DoScreenWipe)(float alpha)
|
|||
INT32 texsize = 2048;
|
||||
float xfix, yfix;
|
||||
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
INT32 fademaskdownloaded = tex_downloaded; // the fade mask that has been set
|
||||
#endif
|
||||
|
||||
// Use a power of two texture, dammit
|
||||
if(screen_width <= 1024)
|
||||
|
@ -2284,7 +1955,6 @@ EXPORT void HWRAPI(DoScreenWipe)(float alpha)
|
|||
|
||||
SetBlend(PF_Modulated|PF_Translucent|PF_NoDepthTest|PF_Clip|PF_NoZClip);
|
||||
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
if (gl13)
|
||||
{
|
||||
// Draw the end screen that fades in
|
||||
|
@ -2327,7 +1997,6 @@ EXPORT void HWRAPI(DoScreenWipe)(float alpha)
|
|||
}
|
||||
else
|
||||
{
|
||||
#endif
|
||||
// Draw the end screen that fades in
|
||||
pglBindTexture(GL_TEXTURE_2D, endScreenWipe);
|
||||
pglBegin(GL_QUADS);
|
||||
|
@ -2349,9 +2018,7 @@ EXPORT void HWRAPI(DoScreenWipe)(float alpha)
|
|||
pglTexCoord2f(xfix, 0.0f);
|
||||
pglVertex3f(1.0f, -1.0f, 1.0f);
|
||||
pglEnd();
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
}
|
||||
#endif
|
||||
|
||||
tex_downloaded = 0; // 0 so it knows it doesn't have any of the cached patches downloaded right now
|
||||
}
|
||||
|
@ -2370,18 +2037,11 @@ EXPORT void HWRAPI(MakeScreenTexture) (void)
|
|||
|
||||
// Create screen texture
|
||||
pglBindTexture(GL_TEXTURE_2D, screentexture);
|
||||
#ifdef KOS_GL_COMPATIBILITY
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_FILTER_NONE);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_FILTER_NONE);
|
||||
#else
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
#endif
|
||||
Clamp2D(GL_TEXTURE_WRAP_S);
|
||||
Clamp2D(GL_TEXTURE_WRAP_T);
|
||||
#ifndef KOS_GL_COMPATIBILITY
|
||||
pglCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, texsize, texsize, 0);
|
||||
#endif
|
||||
|
||||
tex_downloaded = 0; // 0 so it knows it doesn't have any of the cached patches downloaded right now
|
||||
}
|
||||
|
@ -2398,18 +2058,11 @@ EXPORT void HWRAPI(MakeScreenFinalTexture) (void)
|
|||
|
||||
// Create screen texture
|
||||
pglBindTexture(GL_TEXTURE_2D, finalScreenTexture);
|
||||
#ifdef KOS_GL_COMPATIBILITY
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_FILTER_NONE);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_FILTER_NONE);
|
||||
#else
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
#endif
|
||||
Clamp2D(GL_TEXTURE_WRAP_S);
|
||||
Clamp2D(GL_TEXTURE_WRAP_T);
|
||||
#ifndef KOS_GL_COMPATIBILITY
|
||||
pglCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, texsize, texsize, 0);
|
||||
#endif
|
||||
|
||||
tex_downloaded = 0; // 0 so it knows it doesn't have any of the cached patches downloaded right now
|
||||
|
||||
|
|
|
@ -37,13 +37,11 @@
|
|||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
|
||||
#ifndef MINI_GL_COMPATIBILITY
|
||||
#ifdef STATIC_OPENGL // Because of the 1.3 functions, you'll need GLext to compile it if static
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glext.h>
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define _CREATE_DLL_ // necessary for Unix AND Windows
|
||||
#include "../../doomdef.h"
|
||||
|
|
105
src/hu_stuff.c
105
src/hu_stuff.c
|
@ -83,6 +83,7 @@ patch_t *rmatcico;
|
|||
patch_t *bmatcico;
|
||||
patch_t *tagico;
|
||||
patch_t *tallminus;
|
||||
patch_t *tallinfin;
|
||||
|
||||
//-------------------------------------------
|
||||
// coop hud
|
||||
|
@ -92,6 +93,7 @@ patch_t *emeraldpics[7];
|
|||
patch_t *tinyemeraldpics[7];
|
||||
static patch_t *emblemicon;
|
||||
patch_t *tokenicon;
|
||||
static patch_t *exiticon;
|
||||
|
||||
//-------------------------------------------
|
||||
// misc vars
|
||||
|
@ -234,6 +236,7 @@ void HU_LoadGraphics(void)
|
|||
|
||||
// minus for negative tallnums
|
||||
tallminus = (patch_t *)W_CachePatchName("STTMINUS", PU_HUDGFX);
|
||||
tallinfin = (patch_t *)W_CachePatchName("STTINFIN", PU_HUDGFX);
|
||||
|
||||
// cache the crosshairs, don't bother to know which one is being used,
|
||||
// just cache all 3, they're so small anyway.
|
||||
|
@ -245,6 +248,7 @@ void HU_LoadGraphics(void)
|
|||
|
||||
emblemicon = W_CachePatchName("EMBLICON", PU_HUDGFX);
|
||||
tokenicon = W_CachePatchName("TOKNICON", PU_HUDGFX);
|
||||
exiticon = W_CachePatchName("EXITICON", PU_HUDGFX);
|
||||
|
||||
emeraldpics[0] = W_CachePatchName("CHAOS1", PU_HUDGFX);
|
||||
emeraldpics[1] = W_CachePatchName("CHAOS2", PU_HUDGFX);
|
||||
|
@ -324,7 +328,7 @@ void HU_Start(void)
|
|||
*/
|
||||
static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags)
|
||||
{
|
||||
XBOXSTATIC char buf[254];
|
||||
char buf[254];
|
||||
size_t numwords, ix;
|
||||
char *msg = &buf[2];
|
||||
const size_t msgspace = sizeof buf - 2;
|
||||
|
@ -469,7 +473,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
|||
player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 buf[2];
|
||||
UINT8 buf[2];
|
||||
|
||||
buf[0] = (UINT8)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
|
@ -489,7 +493,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
|||
CONS_Alert(CONS_WARNING, M_GetText("Illegal say command received from %s containing invalid characters\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC char buf[2];
|
||||
char buf[2];
|
||||
|
||||
buf[0] = (char)playernum;
|
||||
buf[1] = KICK_MSG_CON_FAIL;
|
||||
|
@ -1174,6 +1178,9 @@ void HU_Erase(void)
|
|||
// IN-LEVEL MULTIPLAYER RANKINGS
|
||||
//======================================================================
|
||||
|
||||
#define supercheckdef ((players[tab[i].num].powers[pw_super] && players[tab[i].num].mo && (players[tab[i].num].mo->state < &states[S_PLAY_SUPER_TRANS1] || players[tab[i].num].mo->state >= &states[S_PLAY_SUPER_TRANS6])) || (players[tab[i].num].powers[pw_carry] == CR_NIGHTSMODE && skins[players[tab[i].num].skin].flags & SF_SUPER))
|
||||
#define greycheckdef ((players[tab[i].num].mo && players[tab[i].num].mo->health <= 0) || players[tab[i].num].spectator)
|
||||
|
||||
//
|
||||
// HU_DrawTabRankings
|
||||
//
|
||||
|
@ -1181,6 +1188,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
|
|||
{
|
||||
INT32 i;
|
||||
const UINT8 *colormap;
|
||||
boolean greycheck, supercheck;
|
||||
|
||||
//this function is designed for 9 or less score lines only
|
||||
I_Assert(scorelines <= 9);
|
||||
|
@ -1189,12 +1197,15 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
|
|||
|
||||
for (i = 0; i < scorelines; i++)
|
||||
{
|
||||
if (players[tab[i].num].spectator)
|
||||
if (players[tab[i].num].spectator && gametype != GT_COOP)
|
||||
continue; //ignore them.
|
||||
|
||||
greycheck = greycheckdef;
|
||||
supercheck = supercheckdef;
|
||||
|
||||
V_DrawString(x + 20, y,
|
||||
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
|
||||
| ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_60TRANS)
|
||||
| (greycheck ? V_60TRANS : 0)
|
||||
| V_ALLOWLOWERCASE, tab[i].name);
|
||||
|
||||
// Draw emeralds
|
||||
|
@ -1204,7 +1215,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
|
|||
HU_DrawEmeralds(x-12,y+2,tab[i].emeralds);
|
||||
}
|
||||
|
||||
if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0)
|
||||
if (greycheck)
|
||||
V_DrawSmallTranslucentPatch (x, y-4, V_80TRANS, livesback);
|
||||
else
|
||||
V_DrawSmallScaledPatch (x, y-4, 0, livesback);
|
||||
|
@ -1212,11 +1223,11 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
|
|||
if (tab[i].color == 0)
|
||||
{
|
||||
colormap = colormaps;
|
||||
if (players[tab[i].num].powers[pw_super])
|
||||
if (supercheck)
|
||||
V_DrawSmallScaledPatch(x, y-4, 0, superprefix[players[tab[i].num].skin]);
|
||||
else
|
||||
{
|
||||
if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0)
|
||||
if (greycheck)
|
||||
V_DrawSmallTranslucentPatch(x, y-4, V_80TRANS, faceprefix[players[tab[i].num].skin]);
|
||||
else
|
||||
V_DrawSmallScaledPatch(x, y-4, 0, faceprefix[players[tab[i].num].skin]);
|
||||
|
@ -1224,7 +1235,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
|
|||
}
|
||||
else
|
||||
{
|
||||
if (players[tab[i].num].powers[pw_super] && players[tab[i].num].mo && (players[tab[i].num].mo->state < &states[S_PLAY_SUPER_TRANS] || players[tab[i].num].mo->state > &states[S_PLAY_SUPER_TRANS9]))
|
||||
if (supercheck)
|
||||
{
|
||||
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo->color, GTC_CACHE);
|
||||
V_DrawSmallMappedPatch (x, y-4, 0, superprefix[players[tab[i].num].skin], colormap);
|
||||
|
@ -1232,23 +1243,26 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
|
|||
else
|
||||
{
|
||||
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
|
||||
if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0)
|
||||
if (greycheck)
|
||||
V_DrawSmallTranslucentMappedPatch (x, y-4, V_80TRANS, faceprefix[players[tab[i].num].skin], colormap);
|
||||
else
|
||||
V_DrawSmallMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
|
||||
}
|
||||
}
|
||||
|
||||
if (G_GametypeUsesLives()) //show lives
|
||||
V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE|((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_60TRANS), va("%dx", players[tab[i].num].lives));
|
||||
if (G_GametypeUsesLives() && !(gametype == GT_COOP && (cv_cooplives.value == 0 || cv_cooplives.value == 3)) && (players[tab[i].num].lives != 0x7f)) //show lives
|
||||
V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE|(greycheck ? V_60TRANS : 0), va("%dx", players[tab[i].num].lives));
|
||||
else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT)
|
||||
{
|
||||
if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0)
|
||||
if (greycheck)
|
||||
V_DrawSmallTranslucentPatch(x-32, y-4, V_60TRANS, tagico);
|
||||
else
|
||||
V_DrawSmallScaledPatch(x-32, y-4, 0, tagico);
|
||||
}
|
||||
|
||||
if (players[tab[i].num].exiting)
|
||||
V_DrawSmallScaledPatch(x - SHORT(exiticon->width)/2 - 1, y-3, 0, exiticon);
|
||||
|
||||
if (gametype == GT_RACE)
|
||||
{
|
||||
if (circuitmap)
|
||||
|
@ -1256,13 +1270,13 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
|
|||
if (players[tab[i].num].exiting)
|
||||
V_DrawRightAlignedString(x+240, y, 0, va("%i:%02i.%02i", G_TicsToMinutes(players[tab[i].num].realtime,true), G_TicsToSeconds(players[tab[i].num].realtime), G_TicsToCentiseconds(players[tab[i].num].realtime)));
|
||||
else
|
||||
V_DrawRightAlignedString(x+240, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_60TRANS), va("%u", tab[i].count));
|
||||
V_DrawRightAlignedString(x+240, y, (greycheck ? V_60TRANS : 0), va("%u", tab[i].count));
|
||||
}
|
||||
else
|
||||
V_DrawRightAlignedString(x+240, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_60TRANS), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count)));
|
||||
V_DrawRightAlignedString(x+240, y, (greycheck ? V_60TRANS : 0), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count)));
|
||||
}
|
||||
else
|
||||
V_DrawRightAlignedString(x+240, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_60TRANS), va("%u", tab[i].count));
|
||||
V_DrawRightAlignedString(x+240, y, (greycheck ? V_60TRANS : 0), va("%u", tab[i].count));
|
||||
|
||||
y += 16;
|
||||
}
|
||||
|
@ -1277,6 +1291,7 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer)
|
|||
INT32 redplayers = 0, blueplayers = 0;
|
||||
const UINT8 *colormap;
|
||||
char name[MAXPLAYERNAME+1];
|
||||
boolean greycheck, supercheck;
|
||||
|
||||
V_DrawFill(160, 26, 1, 154, 0); //Draw a vertical line to separate the two teams.
|
||||
V_DrawFill(1, 26, 318, 1, 0); //And a horizontal line to make a T.
|
||||
|
@ -1304,10 +1319,13 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer)
|
|||
else //er? not on red or blue, so ignore them
|
||||
continue;
|
||||
|
||||
greycheck = greycheckdef;
|
||||
supercheck = supercheckdef;
|
||||
|
||||
strlcpy(name, tab[i].name, 9);
|
||||
V_DrawString(x + 20, y,
|
||||
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
|
||||
| ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT)
|
||||
| (greycheck ? V_TRANSLUCENT : 0)
|
||||
| V_ALLOWLOWERCASE, name);
|
||||
|
||||
if (gametype == GT_CTF)
|
||||
|
@ -1325,7 +1343,7 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer)
|
|||
HU_DrawEmeralds(x-12,y+2,tab[i].emeralds);
|
||||
}
|
||||
|
||||
if (players[tab[i].num].powers[pw_super])
|
||||
if (supercheck)
|
||||
{
|
||||
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
|
||||
V_DrawSmallMappedPatch (x, y-4, 0, superprefix[players[tab[i].num].skin], colormap);
|
||||
|
@ -1333,12 +1351,12 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer)
|
|||
else
|
||||
{
|
||||
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
|
||||
if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0)
|
||||
V_DrawSmallTranslucentMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
|
||||
if (greycheck)
|
||||
V_DrawSmallTranslucentMappedPatch (x, y-4, V_80TRANS, faceprefix[players[tab[i].num].skin], colormap);
|
||||
else
|
||||
V_DrawSmallMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
|
||||
}
|
||||
V_DrawRightAlignedThinString(x+120, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count));
|
||||
V_DrawRightAlignedThinString(x+120, y, (greycheck ? V_TRANSLUCENT : 0), va("%u", tab[i].count));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1350,6 +1368,7 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
|
|||
INT32 i;
|
||||
const UINT8 *colormap;
|
||||
char name[MAXPLAYERNAME+1];
|
||||
boolean greycheck, supercheck;
|
||||
|
||||
V_DrawFill(160, 26, 1, 154, 0); //Draw a vertical line to separate the two sides.
|
||||
V_DrawFill(1, 26, 318, 1, 0); //And a horizontal line to make a T.
|
||||
|
@ -1357,20 +1376,26 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
|
|||
|
||||
for (i = 0; i < scorelines; i++)
|
||||
{
|
||||
if (players[tab[i].num].spectator)
|
||||
if (players[tab[i].num].spectator && gametype != GT_COOP)
|
||||
continue; //ignore them.
|
||||
|
||||
greycheck = greycheckdef;
|
||||
supercheck = supercheckdef;
|
||||
|
||||
strlcpy(name, tab[i].name, 9);
|
||||
V_DrawString(x + 20, y,
|
||||
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
|
||||
| ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT)
|
||||
| (greycheck ? V_TRANSLUCENT : 0)
|
||||
| V_ALLOWLOWERCASE, name);
|
||||
|
||||
if (G_GametypeUsesLives()) //show lives
|
||||
if (G_GametypeUsesLives() && !(gametype == GT_COOP && (cv_cooplives.value == 0 || cv_cooplives.value == 3)) && (players[tab[i].num].lives != 0x7f)) //show lives
|
||||
V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE, va("%dx", players[tab[i].num].lives));
|
||||
else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT)
|
||||
V_DrawSmallScaledPatch(x-28, y-4, 0, tagico);
|
||||
|
||||
if (players[tab[i].num].exiting)
|
||||
V_DrawSmallScaledPatch(x - SHORT(exiticon->width)/2 - 1, y-3, 0, exiticon);
|
||||
|
||||
// Draw emeralds
|
||||
if (!players[tab[i].num].powers[pw_super]
|
||||
|| ((leveltime/7) & 1))
|
||||
|
@ -1382,19 +1407,19 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
|
|||
if (tab[i].color == 0)
|
||||
{
|
||||
colormap = colormaps;
|
||||
if (players[tab[i].num].powers[pw_super])
|
||||
if (supercheck)
|
||||
V_DrawSmallScaledPatch (x, y-4, 0, superprefix[players[tab[i].num].skin]);
|
||||
else
|
||||
{
|
||||
if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0)
|
||||
V_DrawSmallTranslucentPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin]);
|
||||
if (greycheck)
|
||||
V_DrawSmallTranslucentPatch (x, y-4, V_80TRANS, faceprefix[players[tab[i].num].skin]);
|
||||
else
|
||||
V_DrawSmallScaledPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (players[tab[i].num].powers[pw_super])
|
||||
if (supercheck)
|
||||
{
|
||||
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
|
||||
V_DrawSmallMappedPatch (x, y-4, 0, superprefix[players[tab[i].num].skin], colormap);
|
||||
|
@ -1402,8 +1427,8 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
|
|||
else
|
||||
{
|
||||
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
|
||||
if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0)
|
||||
V_DrawSmallTranslucentMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
|
||||
if (greycheck)
|
||||
V_DrawSmallTranslucentMappedPatch (x, y-4, V_80TRANS, faceprefix[players[tab[i].num].skin], colormap);
|
||||
else
|
||||
V_DrawSmallMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
|
||||
}
|
||||
|
@ -1417,13 +1442,13 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
|
|||
if (players[tab[i].num].exiting)
|
||||
V_DrawRightAlignedThinString(x+156, y, 0, va("%i:%02i.%02i", G_TicsToMinutes(players[tab[i].num].realtime,true), G_TicsToSeconds(players[tab[i].num].realtime), G_TicsToCentiseconds(players[tab[i].num].realtime)));
|
||||
else
|
||||
V_DrawRightAlignedThinString(x+156, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count));
|
||||
V_DrawRightAlignedThinString(x+156, y, (greycheck ? V_TRANSLUCENT : 0), va("%u", tab[i].count));
|
||||
}
|
||||
else
|
||||
V_DrawRightAlignedThinString(x+156, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count)));
|
||||
V_DrawRightAlignedThinString(x+156, y, (greycheck ? V_TRANSLUCENT : 0), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count)));
|
||||
}
|
||||
else
|
||||
V_DrawRightAlignedThinString(x+120, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count));
|
||||
V_DrawRightAlignedThinString(x+120, y, (greycheck ? V_TRANSLUCENT : 0), va("%u", tab[i].count));
|
||||
|
||||
y += 16;
|
||||
if (y > 160)
|
||||
|
@ -1620,13 +1645,20 @@ static void HU_DrawRankings(void)
|
|||
|
||||
for (j = 0; j < MAXPLAYERS; j++)
|
||||
{
|
||||
if (!playeringame[j] || players[j].spectator)
|
||||
if (!playeringame[j])
|
||||
continue;
|
||||
|
||||
if (gametype != GT_COOP && players[j].spectator)
|
||||
continue;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (playeringame[i] && !players[i].spectator)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
|
||||
if (gametype != GT_COOP && players[i].spectator)
|
||||
continue;
|
||||
|
||||
if (gametype == GT_RACE)
|
||||
{
|
||||
if (circuitmap)
|
||||
|
@ -1675,7 +1707,6 @@ static void HU_DrawRankings(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
completed[tab[scorelines].num] = true;
|
||||
scorelines++;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
//------------------------------------
|
||||
// heads up font
|
||||
//------------------------------------
|
||||
#define HU_FONTSTART '\x19' // the first font character
|
||||
#define HU_FONTSTART '\x16' // the first font character
|
||||
#define HU_FONTEND '~'
|
||||
|
||||
#define HU_FONTSIZE (HU_FONTEND - HU_FONTSTART + 1)
|
||||
|
@ -71,6 +71,7 @@ extern patch_t *rmatcico;
|
|||
extern patch_t *bmatcico;
|
||||
extern patch_t *tagico;
|
||||
extern patch_t *tallminus;
|
||||
extern patch_t *tallinfin;
|
||||
extern patch_t *tokenicon;
|
||||
|
||||
// set true when entering a chat message
|
||||
|
|
|
@ -20,17 +20,11 @@
|
|||
#else
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
#elif !defined (__DJGPP__) && !defined(_WII)
|
||||
#elif !defined (__DJGPP__)
|
||||
#include <sys/socket.h>
|
||||
#ifndef _NDS
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef _PS3
|
||||
#include <net/netdb.h>
|
||||
#elif ! defined (_arch_dreamcast)
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "i_addrinfo.h"
|
||||
|
||||
|
@ -262,9 +256,6 @@ int I_getaddrinfo(const char *node, const char *service,
|
|||
for (i = 0, j = 0; i < ailen; i++, j++)
|
||||
{
|
||||
ai = *res+i;
|
||||
#ifdef _PS3
|
||||
addr[i].sin_len = famsize;
|
||||
#endif
|
||||
addr[i].sin_port = htons((UINT16)sockport);
|
||||
if (nodename)
|
||||
{
|
||||
|
|
|
@ -39,17 +39,7 @@
|
|||
#define EAI_NONAME -2
|
||||
#endif
|
||||
|
||||
#ifdef _PS3 // PSL1GHT v2
|
||||
struct my_addrinfo {
|
||||
int ai_flags;
|
||||
int ai_family;
|
||||
int ai_socktype;
|
||||
int ai_protocol;
|
||||
size_t ai_addrlen;
|
||||
struct sockaddr *ai_addr;
|
||||
struct my_addrinfo *ai_next;
|
||||
};
|
||||
#elif defined (_WIN32) // already use the stub for Win32
|
||||
#ifdef _WIN32 // already use the stub for Win32
|
||||
// w32api, ws2tcpip.h, r1.12
|
||||
struct my_addrinfo {
|
||||
int ai_flags;
|
||||
|
|
68
src/i_tcp.c
68
src/i_tcp.c
|
@ -18,20 +18,12 @@
|
|||
#ifdef __GNUC__
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef __OS2__
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#endif // __OS2__
|
||||
|
||||
#ifdef _PS3
|
||||
#define NO_IPV6 // PSL1GHT v2 do not have IPv6 support
|
||||
#endif
|
||||
|
||||
#ifndef NO_IPV6
|
||||
#define HAVE_IPV6
|
||||
#endif
|
||||
|
||||
#if defined (_WIN32) || defined (_WIN32_WCE)
|
||||
#ifdef _WIN32
|
||||
#define USE_WINSOCK
|
||||
#if defined (_WIN64) || defined (HAVE_IPV6)
|
||||
#define USE_WINSOCK2
|
||||
|
@ -40,12 +32,6 @@
|
|||
#endif
|
||||
#endif //WIN32 OS
|
||||
|
||||
#ifdef _XBOX // XBox have on WinSock API?
|
||||
#undef USE_WINSOCK
|
||||
#undef USE_WINSOCK1
|
||||
#undef USE_WINSOCK2
|
||||
#endif
|
||||
|
||||
#ifdef USE_WINSOCK2
|
||||
#include <ws2tcpip.h>
|
||||
#endif
|
||||
|
@ -61,17 +47,12 @@
|
|||
#else
|
||||
#ifdef USE_WINSOCK1
|
||||
#include <winsock.h>
|
||||
#elif !defined (SCOUW2) && !defined (SCOUW7) && !defined (__OS2__)
|
||||
#ifdef HAVE_LWIP
|
||||
#include <lwip/inet.h>
|
||||
#elif !defined (USE_WINSOCK)
|
||||
#elif !defined (SCOUW2) && !defined (SCOUW7)
|
||||
#ifndef USE_WINSOCK
|
||||
#include <arpa/inet.h>
|
||||
#endif //normal BSD API
|
||||
|
||||
#ifdef HAVE_LWIP
|
||||
#include <lwip/sockets.h>
|
||||
#define ioctl lwip_ioctl
|
||||
#elif !defined (USE_WINSOCK) //!HAVE_LWIP
|
||||
#ifndef USE_WINSOCK
|
||||
#ifdef __APPLE_CC__
|
||||
#ifndef _BSD_SOCKLEN_T_
|
||||
#define _BSD_SOCKLEN_T_
|
||||
|
@ -81,14 +62,7 @@
|
|||
#include <netinet/in.h>
|
||||
#endif //normal BSD API
|
||||
|
||||
#if defined(_arch_dreamcast) && !defined(HAVE_LWIP)
|
||||
#include <kos/net.h>
|
||||
#elif defined(HAVE_LWIP)
|
||||
#include <lwip/lwip.h>
|
||||
#elif defined (_PS3)
|
||||
#include <net/select.h>
|
||||
#include <net/net.h>
|
||||
#elif !defined(USE_WINSOCK) //!HAVE_LWIP
|
||||
#ifndef USE_WINSOCK
|
||||
#include <netdb.h>
|
||||
#include <sys/ioctl.h>
|
||||
#endif //normal BSD API
|
||||
|
@ -96,10 +70,6 @@
|
|||
#include <errno.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifdef _arch_dreamcast
|
||||
#include "sdl/SRB2DC/dchelp.h"
|
||||
#endif
|
||||
|
||||
#if (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
#include <sys/time.h>
|
||||
#endif // UNIXCOMMON
|
||||
|
@ -190,11 +160,6 @@ static UINT8 UPNP_support = TRUE;
|
|||
// winsock stuff (in winsock a socket is not a file)
|
||||
#define ioctl ioctlsocket
|
||||
#define close closesocket
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
#include "sdl/SRB2CE/cehelp.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include "i_addrinfo.h"
|
||||
|
@ -205,9 +170,7 @@ static UINT8 UPNP_support = TRUE;
|
|||
#define SELECTTEST
|
||||
#endif
|
||||
|
||||
#elif defined(HAVE_LWIP)
|
||||
#define SELECTTEST
|
||||
#elif !defined( _arch_dreamcast)
|
||||
#else
|
||||
#define SELECTTEST
|
||||
#endif
|
||||
|
||||
|
@ -218,7 +181,7 @@ typedef SOCKET SOCKET_TYPE;
|
|||
#define BADSOCKET INVALID_SOCKET
|
||||
#define ERRSOCKET (SOCKET_ERROR)
|
||||
#else
|
||||
#if (defined (__unix__) && !defined (MSDOS)) || defined (__APPLE__) || defined (__HAIKU__) || defined(_PS3)
|
||||
#if (defined (__unix__) && !defined (MSDOS)) || defined (__APPLE__) || defined (__HAIKU__)
|
||||
typedef int SOCKET_TYPE;
|
||||
#else
|
||||
typedef unsigned long SOCKET_TYPE;
|
||||
|
@ -1165,12 +1128,6 @@ boolean I_InitTcpDriver(void)
|
|||
CONS_Debug(DBG_NETPLAY, "WinSock description: %s\n",WSAData.szDescription);
|
||||
CONS_Debug(DBG_NETPLAY, "WinSock System Status: %s\n",WSAData.szSystemStatus);
|
||||
#endif
|
||||
#ifdef HAVE_LWIP
|
||||
lwip_kos_init();
|
||||
#elif defined(_arch_dreamcast)
|
||||
//return;
|
||||
net_init();
|
||||
#endif
|
||||
#ifdef __DJGPP__
|
||||
#ifdef WATTCP // Alam_GBC: survive bootp, dhcp, rarp and wattcp/pktdrv from failing to load
|
||||
survive_eth = 1; // would be needed to not exit if pkt_eth_init() fails
|
||||
|
@ -1223,9 +1180,6 @@ boolean I_InitTcpDriver(void)
|
|||
CONS_Debug(DBG_NETPLAY, "No TCP/IP driver detected\n");
|
||||
#endif // libsocket
|
||||
#endif // __DJGPP__
|
||||
#ifdef _PS3
|
||||
netInitialize();
|
||||
#endif
|
||||
#ifndef __DJGPP__
|
||||
init_tcp_driver = true;
|
||||
#endif
|
||||
|
@ -1274,11 +1228,6 @@ void I_ShutdownTcpDriver(void)
|
|||
WS_addrinfocleanup();
|
||||
WSACleanup();
|
||||
#endif
|
||||
#ifdef HAVE_LWIP
|
||||
lwip_kos_shutdown();
|
||||
#elif defined(_arch_dreamcast)
|
||||
net_shutdown();
|
||||
#endif
|
||||
#ifdef __DJGPP__
|
||||
#ifdef WATTCP // wattcp
|
||||
//_outch = NULL;
|
||||
|
@ -1287,9 +1236,6 @@ void I_ShutdownTcpDriver(void)
|
|||
__lsck_uninit();
|
||||
#endif // libsocket
|
||||
#endif // __DJGPP__
|
||||
#ifdef _PS3
|
||||
netDeinitialize();
|
||||
#endif
|
||||
CONS_Printf("shut down\n");
|
||||
init_tcp_driver = false;
|
||||
#endif
|
||||
|
|
532
src/info.c
532
src/info.c
|
@ -211,6 +211,10 @@ char sprnames[NUMSPRITES + 1][5] =
|
|||
"BMCH", // Big Mace Chain
|
||||
"SMCE", // Small Mace
|
||||
"BMCE", // Big Mace
|
||||
"YSPB", // Yellow spring on a ball
|
||||
"RSPB", // Red spring on a ball
|
||||
"SFBR", // Small Firebar
|
||||
"BFBR", // Big Firebar
|
||||
|
||||
// Arid Canyon Scenery
|
||||
"BTBL", // Big tumbleweed
|
||||
|
@ -401,6 +405,7 @@ char spr2names[NUMPLAYERSPRITES][5] =
|
|||
"STND",
|
||||
"WAIT",
|
||||
"WALK",
|
||||
"SKID",
|
||||
"RUN_",
|
||||
"DASH",
|
||||
"PAIN",
|
||||
|
@ -474,10 +479,118 @@ char spr2names[NUMPLAYERSPRITES][5] =
|
|||
"DRLB",
|
||||
"DRLC",
|
||||
|
||||
"TAL0",
|
||||
"TAL1",
|
||||
"TAL2",
|
||||
"TAL3",
|
||||
"TAL4",
|
||||
"TAL5",
|
||||
"TAL6",
|
||||
"TAL7",
|
||||
"TAL8",
|
||||
"TAL9",
|
||||
"TALA",
|
||||
"TALB",
|
||||
|
||||
"SIGN",
|
||||
"LIFE"
|
||||
};
|
||||
enum playersprite free_spr2 = SPR2_FIRSTFREESLOT;
|
||||
playersprite_t free_spr2 = SPR2_FIRSTFREESLOT;
|
||||
|
||||
playersprite_t spr2defaults[NUMPLAYERSPRITES] = {
|
||||
0, // SPR2_STND,
|
||||
0, // SPR2_WAIT,
|
||||
0, // SPR2_WALK,
|
||||
SPR2_WALK, // SPR2_SKID,
|
||||
SPR2_WALK, // SPR2_RUN ,
|
||||
SPR2_FRUN, // SPR2_DASH,
|
||||
0, // SPR2_PAIN,
|
||||
SPR2_PAIN, // SPR2_STUN,
|
||||
SPR2_PAIN, // SPR2_DEAD,
|
||||
SPR2_DEAD, // SPR2_DRWN,
|
||||
0, // SPR2_ROLL,
|
||||
SPR2_SPNG, // SPR2_GASP,
|
||||
0, // SPR2_JUMP, (conditional)
|
||||
SPR2_FALL, // SPR2_SPNG,
|
||||
SPR2_WALK, // SPR2_FALL,
|
||||
0, // SPR2_EDGE,
|
||||
SPR2_FALL, // SPR2_RIDE,
|
||||
|
||||
SPR2_ROLL, // SPR2_SPIN,
|
||||
|
||||
SPR2_SPNG, // SPR2_FLY ,
|
||||
SPR2_FLY , // SPR2_SWIM,
|
||||
0, // SPR2_TIRE, (conditional)
|
||||
|
||||
SPR2_FLY , // SPR2_GLID,
|
||||
SPR2_CLMB, // SPR2_CLNG,
|
||||
SPR2_ROLL, // SPR2_CLMB,
|
||||
|
||||
SPR2_WALK, // SPR2_FLT ,
|
||||
SPR2_RUN , // SPR2_FRUN,
|
||||
|
||||
SPR2_FALL, // SPR2_BNCE,
|
||||
SPR2_ROLL, // SPR2_BLND,
|
||||
|
||||
0, // SPR2_FIRE,
|
||||
|
||||
SPR2_ROLL, // SPR2_TWIN,
|
||||
|
||||
SPR2_TWIN, // SPR2_MLEE,
|
||||
0, // SPR2_MLEL,
|
||||
|
||||
0, // SPR2_TRNS,
|
||||
|
||||
FF_SPR2SUPER|SPR2_STND, // SPR2_NSTD,
|
||||
FF_SPR2SUPER|SPR2_FLT , // SPR2_NFLT,
|
||||
FF_SPR2SUPER|SPR2_STUN, // SPR2_NSTN,
|
||||
SPR2_NSTN, // SPR2_NPUL,
|
||||
FF_SPR2SUPER|SPR2_ROLL, // SPR2_NATK,
|
||||
|
||||
0, // SPR2_NGT0, (should never be referenced)
|
||||
SPR2_NGT0, // SPR2_NGT1,
|
||||
SPR2_NGT1, // SPR2_NGT2,
|
||||
SPR2_NGT2, // SPR2_NGT3,
|
||||
SPR2_NGT3, // SPR2_NGT4,
|
||||
SPR2_NGT4, // SPR2_NGT5,
|
||||
SPR2_NGT5, // SPR2_NGT6,
|
||||
SPR2_NGT0, // SPR2_NGT7,
|
||||
SPR2_NGT7, // SPR2_NGT8,
|
||||
SPR2_NGT8, // SPR2_NGT9,
|
||||
SPR2_NGT9, // SPR2_NGTA,
|
||||
SPR2_NGTA, // SPR2_NGTB,
|
||||
SPR2_NGTB, // SPR2_NGTC,
|
||||
|
||||
SPR2_NGT0, // SPR2_DRL0,
|
||||
SPR2_NGT1, // SPR2_DRL1,
|
||||
SPR2_NGT2, // SPR2_DRL2,
|
||||
SPR2_NGT3, // SPR2_DRL3,
|
||||
SPR2_NGT4, // SPR2_DRL4,
|
||||
SPR2_NGT5, // SPR2_DRL5,
|
||||
SPR2_NGT6, // SPR2_DRL6,
|
||||
SPR2_NGT7, // SPR2_DRL7,
|
||||
SPR2_NGT8, // SPR2_DRL8,
|
||||
SPR2_NGT9, // SPR2_DRL9,
|
||||
SPR2_NGTA, // SPR2_DRLA,
|
||||
SPR2_NGTB, // SPR2_DRLB,
|
||||
SPR2_NGTC, // SPR2_DRLC,
|
||||
|
||||
0, // SPR2_TAL0,
|
||||
SPR2_TAL0, // SPR2_TAL1,
|
||||
SPR2_TAL1, // SPR2_TAL2,
|
||||
SPR2_TAL2, // SPR2_TAL3,
|
||||
SPR2_TAL1, // SPR2_TAL4,
|
||||
SPR2_TAL4, // SPR2_TAL5,
|
||||
SPR2_TAL0, // SPR2_TAL6,
|
||||
SPR2_TAL3, // SPR2_TAL7,
|
||||
SPR2_TAL7, // SPR2_TAL8,
|
||||
SPR2_TAL0, // SPR2_TAL9,
|
||||
SPR2_TAL9, // SPR2_TALA,
|
||||
SPR2_TAL0, // SPR2_TALB,
|
||||
|
||||
0, // SPR2_SIGN,
|
||||
0, // SPR2_LIFE,
|
||||
};
|
||||
|
||||
// Doesn't work with g++, needs actionf_p1 (don't modify this comment)
|
||||
state_t states[NUMSTATES] =
|
||||
|
@ -508,6 +621,7 @@ state_t states[NUMSTATES] =
|
|||
{SPR_PLAY, SPR2_STND|FF_ANIMATE, 105, {NULL}, 0, 7, S_PLAY_WAIT}, // S_PLAY_STND
|
||||
{SPR_PLAY, SPR2_WAIT|FF_ANIMATE, -1, {NULL}, 0, 16, S_NULL}, // S_PLAY_WAIT
|
||||
{SPR_PLAY, SPR2_WALK, 4, {NULL}, 0, 0, S_PLAY_WALK}, // S_PLAY_WALK
|
||||
{SPR_PLAY, SPR2_SKID, 1, {NULL}, 0, 0, S_PLAY_WALK}, // S_PLAY_SKID
|
||||
{SPR_PLAY, SPR2_RUN , 2, {NULL}, 0, 0, S_PLAY_RUN}, // S_PLAY_RUN
|
||||
{SPR_PLAY, SPR2_DASH, 2, {NULL}, 0, 0, S_PLAY_DASH}, // S_PLAY_DASH
|
||||
{SPR_PLAY, SPR2_PAIN|FF_ANIMATE, 350, {NULL}, 0, 4, S_PLAY_FALL}, // S_PLAY_PAIN
|
||||
|
@ -556,15 +670,12 @@ state_t states[NUMSTATES] =
|
|||
{SPR_PLAY, SPR2_MLEL, 35, {NULL}, 0, 0, S_PLAY_WALK}, // S_PLAY_MELEE_LANDING
|
||||
|
||||
// SF_SUPER
|
||||
{SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER, 4, {NULL}, 0, 0, S_PLAY_SUPER_TRANS2}, // S_PLAY_SUPER_TRANS
|
||||
{SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER, 4, {NULL}, 0, 0, S_PLAY_SUPER_TRANS3}, // S_PLAY_SUPER_TRANS2
|
||||
{SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER|FF_FULLBRIGHT, 4, {NULL}, 0, 0, S_PLAY_SUPER_TRANS4}, // S_PLAY_SUPER_TRANS3
|
||||
{SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_PLAY_SUPER_TRANS5}, // S_PLAY_SUPER_TRANS4
|
||||
{SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_PLAY_SUPER_TRANS6}, // S_PLAY_SUPER_TRANS5
|
||||
{SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_PLAY_SUPER_TRANS7}, // S_PLAY_SUPER_TRANS6
|
||||
{SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_PLAY_SUPER_TRANS8}, // S_PLAY_SUPER_TRANS7
|
||||
{SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_PLAY_SUPER_TRANS9}, // S_PLAY_SUPER_TRANS8
|
||||
{SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER|FF_FULLBRIGHT, 16, {NULL}, 0, 0, S_PLAY_WALK}, // S_PLAY_SUPER_TRANS9
|
||||
{SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER, 3, {NULL}, 0, 0, S_PLAY_SUPER_TRANS2}, // S_PLAY_SUPER_TRANS1
|
||||
{SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER, 3, {NULL}, 0, 0, S_PLAY_SUPER_TRANS3}, // S_PLAY_SUPER_TRANS2
|
||||
{SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_PLAY_SUPER_TRANS4}, // S_PLAY_SUPER_TRANS3
|
||||
{SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_PLAY_SUPER_TRANS5}, // S_PLAY_SUPER_TRANS4
|
||||
{SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_PLAY_SUPER_TRANS6}, // S_PLAY_SUPER_TRANS5
|
||||
{SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER|FF_FULLBRIGHT, 20, {A_FadeOverlay}, 0, 0, S_PLAY_FALL}, // S_PLAY_SUPER_TRANS6
|
||||
|
||||
{SPR_NULL, 0, -1, {NULL}, 0, 0, S_OBJPLACE_DUMMY}, //S_OBJPLACE_DUMMY
|
||||
|
||||
|
@ -579,15 +690,12 @@ state_t states[NUMSTATES] =
|
|||
{SPR_PLAY, SPR2_SIGN, 1, {NULL}, 0, 24, S_PLAY_SIGN}, // S_PLAY_SIGN
|
||||
|
||||
// NiGHTS Player, transforming
|
||||
{SPR_PLAY, SPR2_TRNS, 4, {A_Scream}, 0, 0, S_PLAY_NIGHTS_TRANS2}, // S_PLAY_NIGHTS_TRANS
|
||||
{SPR_PLAY, SPR2_TRNS, 4, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS3}, // S_PLAY_NIGHTS_TRANS2
|
||||
{SPR_PLAY, SPR2_TRNS|FF_FULLBRIGHT, 4, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS4}, // S_PLAY_NIGHTS_TRANS3
|
||||
{SPR_PLAY, SPR2_TRNS, 3, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS5}, // S_PLAY_NIGHTS_TRANS4
|
||||
{SPR_PLAY, SPR2_TRNS, 3, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS6}, // S_PLAY_NIGHTS_TRANS5
|
||||
{SPR_PLAY, SPR2_TRNS, 3, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS7}, // S_PLAY_NIGHTS_TRANS6
|
||||
{SPR_PLAY, SPR2_TRNS, 3, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS8}, // S_PLAY_NIGHTS_TRANS7
|
||||
{SPR_PLAY, SPR2_TRNS, 3, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS9}, // S_PLAY_NIGHTS_TRANS8
|
||||
{SPR_PLAY, SPR2_TRNS, 16, {NULL}, 0, 0, S_PLAY_NIGHTS_FLOAT}, // S_PLAY_NIGHTS_TRANS9
|
||||
{SPR_PLAY, SPR2_TRNS, 3, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS2}, // S_PLAY_NIGHTS_TRANS1
|
||||
{SPR_PLAY, SPR2_TRNS, 3, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS3}, // S_PLAY_NIGHTS_TRANS2
|
||||
{SPR_PLAY, SPR2_TRNS|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS4}, // S_PLAY_NIGHTS_TRANS3
|
||||
{SPR_PLAY, SPR2_TRNS|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS5}, // S_PLAY_NIGHTS_TRANS4
|
||||
{SPR_PLAY, SPR2_TRNS|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS6}, // S_PLAY_NIGHTS_TRANS5
|
||||
{SPR_PLAY, SPR2_TRNS|FF_FULLBRIGHT, 25, {A_FadeOverlay}, 4, 0, S_PLAY_NIGHTS_FLOAT}, // S_PLAY_NIGHTS_TRANS5
|
||||
|
||||
// NiGHTS Player, stand, float, pain, pull and attack
|
||||
{SPR_PLAY, SPR2_NSTD, 7, {NULL}, 0, 0, S_PLAY_NIGHTS_STAND}, // S_PLAY_NIGHTS_STAND
|
||||
|
@ -624,6 +732,20 @@ state_t states[NUMSTATES] =
|
|||
{SPR_PLAY, SPR2_NGTC, 2, {NULL}, 0, 0, S_PLAY_NIGHTS_FLYC}, // S_PLAY_NIGHTS_FLYC
|
||||
{SPR_PLAY, SPR2_DRLC, 2, {NULL}, 0, 0, S_PLAY_NIGHTS_DRILLC}, // S_PLAY_NIGHTS_DRILLC
|
||||
|
||||
// c:
|
||||
{SPR_PLAY, SPR2_TAL0|FF_SPR2MIDSTART, 5, {NULL}, 0, 0, S_TAILSOVERLAY_STAND}, // S_TAILSOVERLAY_STAND
|
||||
{SPR_PLAY, SPR2_TAL1|FF_SPR2MIDSTART, 35, {NULL}, 0, 0, S_TAILSOVERLAY_0DEGREES}, // S_TAILSOVERLAY_0DEGREES
|
||||
{SPR_PLAY, SPR2_TAL2|FF_SPR2MIDSTART, 35, {NULL}, 0, 0, S_TAILSOVERLAY_PLUS30DEGREES}, // S_TAILSOVERLAY_PLUS30DEGREES
|
||||
{SPR_PLAY, SPR2_TAL3|FF_SPR2MIDSTART, 35, {NULL}, 0, 0, S_TAILSOVERLAY_PLUS60DEGREES}, // S_TAILSOVERLAY_PLUS60DEGREES
|
||||
{SPR_PLAY, SPR2_TAL4|FF_SPR2MIDSTART, 35, {NULL}, 0, 0, S_TAILSOVERLAY_MINUS30DEGREES}, // S_TAILSOVERLAY_MINUS30DEGREES
|
||||
{SPR_PLAY, SPR2_TAL5|FF_SPR2MIDSTART, 35, {NULL}, 0, 0, S_TAILSOVERLAY_MINUS60DEGREES}, // S_TAILSOVERLAY_MINUS60DEGREES
|
||||
{SPR_PLAY, SPR2_TAL6|FF_SPR2MIDSTART, 35, {NULL}, 0, 0, S_TAILSOVERLAY_RUN}, // S_TAILSOVERLAY_RUN
|
||||
{SPR_PLAY, SPR2_TAL7|FF_SPR2MIDSTART, 4, {NULL}, 0, 0, S_TAILSOVERLAY_FLY}, // S_TAILSOVERLAY_FLY
|
||||
{SPR_PLAY, SPR2_TAL8|FF_SPR2MIDSTART, 4, {NULL}, 0, 0, S_TAILSOVERLAY_TIRE}, // S_TAILSOVERLAY_TIRE
|
||||
{SPR_PLAY, SPR2_TAL9|FF_SPR2MIDSTART, 35, {NULL}, 0, 0, S_TAILSOVERLAY_PAIN}, // S_TAILSOVERLAY_PAIN
|
||||
{SPR_PLAY, SPR2_TALA|FF_SPR2MIDSTART, 35, {NULL}, 0, 0, S_TAILSOVERLAY_GASP}, // S_TAILSOVERLAY_GASP
|
||||
{SPR_PLAY, SPR2_TALB , 35, {NULL}, 0, 0, S_TAILSOVERLAY_EDGE}, // S_TAILSOVERLAY_EDGE
|
||||
|
||||
// Blue Crawla
|
||||
{SPR_POSS, 0, 5, {A_Look}, 0, 0, S_POSS_STND}, // S_POSS_STND
|
||||
{SPR_POSS, 0, 3, {A_Chase}, 0, 0, S_POSS_RUN2}, // S_POSS_RUN1
|
||||
|
@ -1563,13 +1685,13 @@ state_t states[NUMSTATES] =
|
|||
|
||||
// Floor Spike
|
||||
{SPR_USPK, 0,-1, {A_SpikeRetract}, 1, 0, S_SPIKE2}, // S_SPIKE1 -- Fully extended
|
||||
{SPR_USPK, 5, 2, {A_Pain}, 0, 0, S_SPIKE3}, // S_SPIKE2
|
||||
{SPR_USPK, 4, 2, {NULL}, 0, 0, S_SPIKE4}, // S_SPIKE3
|
||||
{SPR_USPK, 1, 2, {A_Pain}, 0, 0, S_SPIKE3}, // S_SPIKE2
|
||||
{SPR_USPK, 2, 2, {NULL}, 0, 0, S_SPIKE4}, // S_SPIKE3
|
||||
{SPR_USPK, 3,-1, {A_SpikeRetract}, 0, 0, S_SPIKE5}, // S_SPIKE4 -- Fully retracted
|
||||
{SPR_USPK, 4, 2, {A_Pain}, 0, 0, S_SPIKE6}, // S_SPIKE5
|
||||
{SPR_USPK, 5, 2, {NULL}, 0, 0, S_SPIKE1}, // S_SPIKE6
|
||||
{SPR_USPK, 1,-1, {NULL}, 0, 0, S_NULL}, // S_SPIKED1 -- Busted spike particles
|
||||
{SPR_USPK, 2,-1, {NULL}, 0, 0, S_NULL}, // S_SPIKED2
|
||||
{SPR_USPK, 2, 2, {A_Pain}, 0, 0, S_SPIKE6}, // S_SPIKE5
|
||||
{SPR_USPK, 1, 2, {NULL}, 0, 0, S_SPIKE1}, // S_SPIKE6
|
||||
{SPR_USPK, 4,-1, {NULL}, 0, 0, S_NULL}, // S_SPIKED1 -- Busted spike particles
|
||||
{SPR_USPK, 5,-1, {NULL}, 0, 0, S_NULL}, // S_SPIKED2
|
||||
|
||||
// Wall Spike
|
||||
{SPR_WSPK, 0|FF_PAPERSPRITE,-1, {A_SpikeRetract}, 1, 0, S_WALLSPIKE2}, // S_WALLSPIKE1 -- Fully extended
|
||||
|
@ -1579,6 +1701,8 @@ state_t states[NUMSTATES] =
|
|||
{SPR_WSPK, 2|FF_PAPERSPRITE, 2, {A_Pain}, 0, 0, S_WALLSPIKE6}, // S_WALLSPIKE5
|
||||
{SPR_WSPK, 1|FF_PAPERSPRITE, 2, {NULL}, 0, 0, S_WALLSPIKE1}, // S_WALLSPIKE6
|
||||
{SPR_WSPB, 0|FF_PAPERSPRITE,-1, {NULL}, 0, 0, S_NULL}, // S_WALLSPIKEBASE -- Base
|
||||
{SPR_WSPK, 4,-1, {NULL}, 0, 0, S_NULL}, // S_WALLSPIKED1 -- Busted spike particles
|
||||
{SPR_WSPK, 5,-1, {NULL}, 0, 0, S_NULL}, // S_WALLSPIKED2
|
||||
|
||||
// Starpost
|
||||
{SPR_STPT, 0 , -1, {NULL}, 0, 0, S_NULL}, // S_STARPOST_IDLE
|
||||
|
@ -1673,22 +1797,22 @@ state_t states[NUMSTATES] =
|
|||
{SPR_TVRI, 2, 18, {A_RingBox}, 0, 0, S_NULL}, // S_RING_ICON2
|
||||
|
||||
{SPR_TVPI, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_PITY_ICON2}, // S_PITY_ICON1
|
||||
{SPR_TVPI, 2, 18, {A_PityShield}, 0, 0, S_NULL}, // S_PITY_ICON2
|
||||
{SPR_TVPI, 2, 18, {A_GiveShield}, SH_PITY, 0, S_NULL}, // S_PITY_ICON2
|
||||
|
||||
{SPR_TVAT, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_ATTRACT_ICON2}, // S_ATTRACT_ICON1
|
||||
{SPR_TVAT, 2, 18, {A_RingShield},0, 0, S_NULL}, // S_ATTRACT_ICON2
|
||||
{SPR_TVAT, 2, 18, {A_GiveShield}, SH_ATTRACT, 0, S_NULL}, // S_ATTRACT_ICON2
|
||||
|
||||
{SPR_TVFO, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_FORCE_ICON2}, // S_FORCE_ICON1
|
||||
{SPR_TVFO, 2, 18, {A_ForceShield}, 1, 0, S_NULL}, // S_FORCE_ICON2
|
||||
{SPR_TVFO, 2, 18, {A_GiveShield}, SH_FORCE|1, 0, S_NULL}, // S_FORCE_ICON2
|
||||
|
||||
{SPR_TVAR, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_ARMAGEDDON_ICON2}, // S_ARMAGEDDON_ICON1
|
||||
{SPR_TVAR, 2, 18, {A_BombShield}, 0, 0, S_NULL}, // S_ARMAGEDDON_ICON2
|
||||
{SPR_TVAR, 2, 18, {A_GiveShield}, SH_ARMAGEDDON, 0, S_NULL}, // S_ARMAGEDDON_ICON2
|
||||
|
||||
{SPR_TVWW, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_WHIRLWIND_ICON2}, // S_WHIRLWIND_ICON1
|
||||
{SPR_TVWW, 2, 18, {A_JumpShield}, 0, 0, S_NULL}, // S_WHIRLWIND_ICON2
|
||||
{SPR_TVWW, 2, 18, {A_GiveShield}, SH_WHIRLWIND, 0, S_NULL}, // S_WHIRLWIND_ICON2
|
||||
|
||||
{SPR_TVEL, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_ELEMENTAL_ICON2}, // S_ELEMENTAL_ICON1
|
||||
{SPR_TVEL, 2, 18, {A_WaterShield}, 0, 0, S_NULL}, // S_ELEMENTAL_ICON2
|
||||
{SPR_TVEL, 2, 18, {A_GiveShield}, SH_ELEMENTAL, 0, S_NULL}, // S_ELEMENTAL_ICON2
|
||||
|
||||
{SPR_TVSS, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_SNEAKERS_ICON2}, // S_SNEAKERS_ICON1
|
||||
{SPR_TVSS, 2, 18, {A_SuperSneakers}, 0, 0, S_NULL}, // S_SNEAKERS_ICON2
|
||||
|
@ -1718,13 +1842,13 @@ state_t states[NUMSTATES] =
|
|||
{SPR_TVTK, 2, 18, {A_AwardScore}, 0, 0, S_NULL}, // S_SCORE10K_ICON2
|
||||
|
||||
{SPR_TVFL, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_FLAMEAURA_ICON2}, // S_FLAMEAURA_ICON1
|
||||
{SPR_TVFL, 2, 18, {A_FlameShield}, 0, 0, S_NULL}, // S_FLAMEAURA_ICON2
|
||||
{SPR_TVFL, 2, 18, {A_GiveShield}, SH_FLAMEAURA, 0, S_NULL}, // S_FLAMEAURA_ICON2
|
||||
|
||||
{SPR_TVBB, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_BUBBLEWRAP_ICON2}, // S_BUBBLEWRAP_ICON1
|
||||
{SPR_TVBB, 2, 18, {A_BubbleShield}, 0, 0, S_NULL}, // S_BUBBLERWAP_ICON2
|
||||
{SPR_TVBB, 2, 18, {A_GiveShield}, SH_BUBBLEWRAP, 0, S_NULL}, // S_BUBBLERWAP_ICON2
|
||||
|
||||
{SPR_TVZP, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_THUNDERCOIN_ICON2}, // S_THUNDERCOIN_ICON1
|
||||
{SPR_TVZP, 2, 18, {A_ThunderShield}, 0, 0, S_NULL}, // S_THUNDERCOIN_ICON2
|
||||
{SPR_TVZP, 2, 18, {A_GiveShield}, SH_THUNDERCOIN, 0, S_NULL}, // S_THUNDERCOIN_ICON2
|
||||
|
||||
// ---
|
||||
|
||||
|
@ -1828,11 +1952,11 @@ state_t states[NUMSTATES] =
|
|||
{SPR_CHAN, 0, -1, {NULL}, 0, 0, S_NULL}, // S_CEZCHAIN
|
||||
|
||||
// Flame
|
||||
{SPR_FLAM, FF_FULLBRIGHT|FF_TRANS20, 3, {A_FlameParticle}, 3, 0, S_FLAME2}, // S_FLAME1
|
||||
{SPR_FLAM, FF_FULLBRIGHT|FF_TRANS20, 3, {A_FlameParticle}, 3, FRACUNIT/2, S_FLAME2}, // S_FLAME1
|
||||
{SPR_FLAM, FF_FULLBRIGHT|FF_TRANS20|1, 3, {NULL}, 0, 0 , S_FLAME3}, // S_FLAME2
|
||||
{SPR_FLAM, FF_FULLBRIGHT|FF_TRANS20|2, 3, {A_FlameParticle}, 3, 0, S_FLAME4}, // S_FLAME3
|
||||
{SPR_FLAM, FF_FULLBRIGHT|FF_TRANS20|2, 3, {A_FlameParticle}, 3, FRACUNIT/2, S_FLAME4}, // S_FLAME3
|
||||
{SPR_FLAM, FF_FULLBRIGHT|FF_TRANS20|3, 3, {NULL}, 0, 0 , S_FLAME5}, // S_FLAME4
|
||||
{SPR_FLAM, FF_FULLBRIGHT|FF_TRANS20|4, 3, {A_FlameParticle}, 3, 0, S_FLAME6}, // S_FLAME5
|
||||
{SPR_FLAM, FF_FULLBRIGHT|FF_TRANS20|4, 3, {A_FlameParticle}, 3, FRACUNIT/2, S_FLAME6}, // S_FLAME5
|
||||
{SPR_FLAM, FF_FULLBRIGHT|FF_TRANS20|5, 3, {NULL}, 0, 0 , S_FLAME1}, // S_FLAME6
|
||||
{SPR_FLAM, FF_FULLBRIGHT|FF_TRANS10|6, 24, {NULL}, 0, 0 , S_NULL}, // S_FLAMEPARTICLE
|
||||
|
||||
|
@ -1845,17 +1969,61 @@ state_t states[NUMSTATES] =
|
|||
{SPR_NULL, 0, -1, {NULL}, 0, 0, S_SLING2}, // S_SLING1
|
||||
{SPR_NULL, 0, -1, {A_SlingAppear}, 0, 0, S_NULL}, // S_SLING2
|
||||
|
||||
// Small Mace Chain
|
||||
{SPR_SMCH, 0, 1, {A_MaceRotate}, 0, 0, S_SMALLMACECHAIN}, // S_SMALLMACECHAIN
|
||||
// CEZ maces and chains
|
||||
{SPR_SMCH, 0, -1, {NULL}, 0, 0, S_SMALLMACECHAIN}, // S_SMALLMACECHAIN
|
||||
{SPR_BMCH, 0, -1, {NULL}, 0, 0, S_BIGMACECHAIN}, // S_BIGMACECHAIN
|
||||
{SPR_SMCE, 0, -1, {NULL}, 0, 0, S_SMALLMACE}, // S_SMALLMACE
|
||||
{SPR_BMCE, 0, -1, {NULL}, 0, 0, S_BIGMACE}, // S_BIGMACE
|
||||
|
||||
// Big Mace Chain
|
||||
{SPR_BMCH, 0, 1, {A_MaceRotate}, 0, 0, S_BIGMACECHAIN}, // S_BIGMACECHAIN
|
||||
// Yellow spring on a ball
|
||||
{SPR_YSPB, 0, -1, {NULL}, 0, 0, S_NULL}, // S_YELLOWSPRINGBALL
|
||||
{SPR_YSPB, 4, 4, {A_Pain}, 0, 0, S_YELLOWSPRINGBALL3}, // S_YELLOWSPRINGBALL2
|
||||
{SPR_YSPB, 3, 1, {NULL}, 0, 0, S_YELLOWSPRINGBALL4}, // S_YELLOWSPRINGBALL3
|
||||
{SPR_YSPB, 2, 1, {NULL}, 0, 0, S_YELLOWSPRINGBALL5}, // S_YELLOWSPRINGBALL4
|
||||
{SPR_YSPB, 1, 1, {NULL}, 0, 0, S_YELLOWSPRINGBALL}, // S_YELLOWSPRINGBALL5
|
||||
|
||||
// Small Mace
|
||||
{SPR_SMCE, 0, 1, {A_MaceRotate}, 0, 0, S_SMALLMACE}, // S_SMALLMACE
|
||||
// Red spring on a ball
|
||||
{SPR_RSPB, 0, -1, {NULL}, 0, 0, S_NULL}, // S_REDSPRINGBALL
|
||||
{SPR_RSPB, 4, 4, {A_Pain}, 0, 0, S_REDSPRINGBALL3}, // S_REDSPRINGBALL2
|
||||
{SPR_RSPB, 3, 1, {NULL}, 0, 0, S_REDSPRINGBALL4}, // S_REDSPRINGBALL3
|
||||
{SPR_RSPB, 2, 1, {NULL}, 0, 0, S_REDSPRINGBALL5}, // S_REDSPRINGBALL4
|
||||
{SPR_RSPB, 1, 1, {NULL}, 0, 0, S_REDSPRINGBALL}, // S_REDSPRINGBALL5
|
||||
|
||||
// Big Mace
|
||||
{SPR_BMCE, 0, 1, {A_MaceRotate}, 0, 0, S_BIGMACE}, // S_BIGMACE
|
||||
// Small Firebar
|
||||
{SPR_SFBR, FF_FULLBRIGHT|FF_TRANS20, 1, {A_FlameParticle}, 3, FRACUNIT/3, S_SMALLFIREBAR2}, // S_SMALLFIREBAR1
|
||||
{SPR_SFBR, FF_FULLBRIGHT|FF_TRANS20| 1, 1, {NULL}, 0, 0, S_SMALLFIREBAR3}, // S_SMALLFIREBAR2
|
||||
{SPR_SFBR, FF_FULLBRIGHT|FF_TRANS20| 2, 1, {A_FlameParticle}, 3, FRACUNIT/3, S_SMALLFIREBAR4}, // S_SMALLFIREBAR3
|
||||
{SPR_SFBR, FF_FULLBRIGHT|FF_TRANS20| 3, 1, {NULL}, 0, 0, S_SMALLFIREBAR5}, // S_SMALLFIREBAR4
|
||||
{SPR_SFBR, FF_FULLBRIGHT|FF_TRANS20| 4, 1, {A_FlameParticle}, 3, FRACUNIT/3, S_SMALLFIREBAR6}, // S_SMALLFIREBAR5
|
||||
{SPR_SFBR, FF_FULLBRIGHT|FF_TRANS20| 5, 1, {NULL}, 0, 0, S_SMALLFIREBAR7}, // S_SMALLFIREBAR6
|
||||
{SPR_SFBR, FF_FULLBRIGHT|FF_TRANS20| 6, 1, {A_FlameParticle}, 3, FRACUNIT/3, S_SMALLFIREBAR8}, // S_SMALLFIREBAR7
|
||||
{SPR_SFBR, FF_FULLBRIGHT|FF_TRANS20| 7, 1, {NULL}, 0, 0, S_SMALLFIREBAR9}, // S_SMALLFIREBAR8
|
||||
{SPR_SFBR, FF_FULLBRIGHT|FF_TRANS20| 8, 1, {A_FlameParticle}, 3, FRACUNIT/3, S_SMALLFIREBAR10}, // S_SMALLFIREBAR9
|
||||
{SPR_SFBR, FF_FULLBRIGHT|FF_TRANS20| 9, 1, {NULL}, 0, 0, S_SMALLFIREBAR11}, // S_SMALLFIREBAR10
|
||||
{SPR_SFBR, FF_FULLBRIGHT|FF_TRANS20|10, 1, {A_FlameParticle}, 3, FRACUNIT/3, S_SMALLFIREBAR12}, // S_SMALLFIREBAR11
|
||||
{SPR_SFBR, FF_FULLBRIGHT|FF_TRANS20|11, 1, {NULL}, 0, 0, S_SMALLFIREBAR13}, // S_SMALLFIREBAR12
|
||||
{SPR_SFBR, FF_FULLBRIGHT|FF_TRANS20|12, 1, {A_FlameParticle}, 3, FRACUNIT/3, S_SMALLFIREBAR14}, // S_SMALLFIREBAR13
|
||||
{SPR_SFBR, FF_FULLBRIGHT|FF_TRANS20|13, 1, {NULL}, 0, 0, S_SMALLFIREBAR15}, // S_SMALLFIREBAR14
|
||||
{SPR_SFBR, FF_FULLBRIGHT|FF_TRANS20|14, 1, {A_FlameParticle}, 3, FRACUNIT/3, S_SMALLFIREBAR16}, // S_SMALLFIREBAR15
|
||||
{SPR_SFBR, FF_FULLBRIGHT|FF_TRANS20|15, 1, {NULL}, 0, 0, S_SMALLFIREBAR1}, // S_SMALLFIREBAR16
|
||||
|
||||
// Big Firebar
|
||||
{SPR_BFBR, FF_FULLBRIGHT|FF_TRANS20, 1, {A_FlameParticle}, 3, FRACUNIT/2, S_BIGFIREBAR2}, // S_BIGFIREBAR1
|
||||
{SPR_BFBR, FF_FULLBRIGHT|FF_TRANS20| 1, 1, {NULL}, 0, 0, S_BIGFIREBAR3}, // S_BIGFIREBAR2
|
||||
{SPR_BFBR, FF_FULLBRIGHT|FF_TRANS20| 2, 1, {A_FlameParticle}, 3, FRACUNIT/2, S_BIGFIREBAR4}, // S_BIGFIREBAR3
|
||||
{SPR_BFBR, FF_FULLBRIGHT|FF_TRANS20| 3, 1, {NULL}, 0, 0, S_BIGFIREBAR5}, // S_BIGFIREBAR4
|
||||
{SPR_BFBR, FF_FULLBRIGHT|FF_TRANS20| 4, 1, {A_FlameParticle}, 3, FRACUNIT/2, S_BIGFIREBAR6}, // S_BIGFIREBAR5
|
||||
{SPR_BFBR, FF_FULLBRIGHT|FF_TRANS20| 5, 1, {NULL}, 0, 0, S_BIGFIREBAR7}, // S_BIGFIREBAR6
|
||||
{SPR_BFBR, FF_FULLBRIGHT|FF_TRANS20| 6, 1, {A_FlameParticle}, 3, FRACUNIT/2, S_BIGFIREBAR8}, // S_BIGFIREBAR7
|
||||
{SPR_BFBR, FF_FULLBRIGHT|FF_TRANS20| 7, 1, {NULL}, 0, 0, S_BIGFIREBAR9}, // S_BIGFIREBAR8
|
||||
{SPR_BFBR, FF_FULLBRIGHT|FF_TRANS20| 8, 1, {A_FlameParticle}, 3, FRACUNIT/2, S_BIGFIREBAR10}, // S_BIGFIREBAR9
|
||||
{SPR_BFBR, FF_FULLBRIGHT|FF_TRANS20| 9, 1, {NULL}, 0, 0, S_BIGFIREBAR11}, // S_BIGFIREBAR10
|
||||
{SPR_BFBR, FF_FULLBRIGHT|FF_TRANS20|10, 1, {A_FlameParticle}, 3, FRACUNIT/2, S_BIGFIREBAR12}, // S_BIGFIREBAR11
|
||||
{SPR_BFBR, FF_FULLBRIGHT|FF_TRANS20|11, 1, {NULL}, 0, 0, S_BIGFIREBAR13}, // S_BIGFIREBAR12
|
||||
{SPR_BFBR, FF_FULLBRIGHT|FF_TRANS20|12, 1, {A_FlameParticle}, 3, FRACUNIT/2, S_BIGFIREBAR14}, // S_BIGFIREBAR13
|
||||
{SPR_BFBR, FF_FULLBRIGHT|FF_TRANS20|13, 1, {NULL}, 0, 0, S_BIGFIREBAR15}, // S_BIGFIREBAR14
|
||||
{SPR_BFBR, FF_FULLBRIGHT|FF_TRANS20|14, 1, {A_FlameParticle}, 3, FRACUNIT/2, S_BIGFIREBAR16}, // S_BIGFIREBAR15
|
||||
{SPR_BFBR, FF_FULLBRIGHT|FF_TRANS20|15, 1, {NULL}, 0, 0, S_BIGFIREBAR1}, // S_BIGFIREBAR16
|
||||
|
||||
// CEZ Flower
|
||||
{SPR_FWR4, 0, -1, {NULL}, 0, 0, S_NULL}, // S_CEZFLOWER1
|
||||
|
@ -2531,7 +2699,7 @@ state_t states[NUMSTATES] =
|
|||
|
||||
// Particle sprite
|
||||
{SPR_PRTL, FF_FULLBRIGHT|FF_TRANS70, 2*TICRATE, {NULL}, 0, 0, S_NULL}, // S_PARTICLE
|
||||
{SPR_NULL, 0, 1, {A_ParticleSpawn}, 0, 0, S_PARTICLEGEN}, // S_PARTICLEGEN
|
||||
{SPR_NULL, 0, 3, {A_ParticleSpawn}, 0, 0, S_PARTICLEGEN}, // S_PARTICLEGEN
|
||||
|
||||
{SPR_SCOR, 0, 32, {A_ScoreRise}, 0, 0, S_NULL}, // S_SCRA - 100
|
||||
{SPR_SCOR, 1, 32, {A_ScoreRise}, 0, 0, S_NULL}, // S_SCRB - 200
|
||||
|
@ -2894,16 +3062,11 @@ state_t states[NUMSTATES] =
|
|||
{SPR_NWNG, 1, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSWING_XMAS
|
||||
|
||||
// NiGHTS Paraloop Powerups
|
||||
{SPR_NULL, 0, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSPOWERUP1
|
||||
{SPR_NPRU, 0, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSPOWERUP2
|
||||
{SPR_NULL, 0, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSPOWERUP3
|
||||
{SPR_NPRU, 1, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSPOWERUP4
|
||||
{SPR_NULL, 0, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSPOWERUP5
|
||||
{SPR_NPRU, 2, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSPOWERUP6
|
||||
{SPR_NULL, 0, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSPOWERUP7
|
||||
{SPR_NPRU, 3, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSPOWERUP8
|
||||
{SPR_NULL, 0, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSPOWERUP9
|
||||
{SPR_NPRU, 4, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSPOWERUP10
|
||||
{SPR_NPRU, 0, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSSUPERLOOP
|
||||
{SPR_NPRU, 1, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSDRILLREFILL
|
||||
{SPR_NPRU, 2, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSHELPER
|
||||
{SPR_NPRU, 3, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSEXTRATIME
|
||||
{SPR_NPRU, 4, -1, {NULL}, 0, 0, S_NULL}, // S_NIGHTSLINKFREEZE
|
||||
|
||||
{SPR_CAPS, 0, -1, {NULL}, 0, 0, S_NULL}, // S_EGGCAPSULE
|
||||
|
||||
|
@ -3106,6 +3269,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
(statenum_t)MT_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_TAILSOVERLAY
|
||||
-1, // doomednum
|
||||
S_INVISIBLE, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
8, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
S_NULL, // painstate
|
||||
0, // painchance
|
||||
sfx_None, // painsound
|
||||
S_NULL, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
8, // speed
|
||||
16*FRACUNIT, // radius
|
||||
48*FRACUNIT, // height
|
||||
2, // display offset
|
||||
16, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_BLUECRAWLA
|
||||
100, // doomednum
|
||||
S_POSS_STND, // spawnstate
|
||||
|
@ -6003,11 +6193,11 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
sfx_s3k64, // painsound
|
||||
S_NULL, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
S_WALLSPIKED1, // deathstate
|
||||
S_WALLSPIKED2, // xdeathstate
|
||||
sfx_mspogo, // deathsound
|
||||
2*TICRATE, // speed
|
||||
32*FRACUNIT, // radius
|
||||
16*FRACUNIT, // radius
|
||||
14*FRACUNIT, // height
|
||||
0, // display offset
|
||||
4, // mass
|
||||
|
@ -8825,7 +9015,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_SWINGMACEPOINT
|
||||
{ // MT_CHAINMACEPOINT
|
||||
1105, // doomednum
|
||||
S_INVISIBLE, // spawnstate
|
||||
1000, // spawnhealth
|
||||
|
@ -8852,7 +9042,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_HANGMACEPOINT
|
||||
{ // MT_SPRINGBALLPOINT
|
||||
1106, // doomednum
|
||||
S_INVISIBLE, // spawnstate
|
||||
1000, // spawnhealth
|
||||
|
@ -8879,7 +9069,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_SPINMACEPOINT
|
||||
{ // MT_CHAINPOINT
|
||||
1107, // doomednum
|
||||
S_INVISIBLE, // spawnstate
|
||||
1000, // spawnhealth
|
||||
|
@ -8899,7 +9089,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
128*FRACUNIT, // radius
|
||||
1*FRACUNIT, // height
|
||||
0, // display offset
|
||||
200, // mass
|
||||
10000, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOCLIP|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
|
||||
|
@ -8933,6 +9123,60 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_FIREBARPOINT
|
||||
1109, // doomednum
|
||||
S_INVISIBLE, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
0, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
S_NULL, // painstate
|
||||
0, // painchance
|
||||
sfx_None, // painsound
|
||||
S_NULL, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
10*FRACUNIT, // speed
|
||||
128*FRACUNIT, // radius
|
||||
1*FRACUNIT, // height
|
||||
0, // display offset
|
||||
200, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOCLIP|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_CUSTOMMACEPOINT
|
||||
1111, // doomednum
|
||||
S_INVISIBLE, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
0, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
S_NULL, // painstate
|
||||
0, // painchance
|
||||
sfx_None, // painsound
|
||||
S_NULL, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
10*FRACUNIT, // speed
|
||||
128*FRACUNIT, // radius
|
||||
1*FRACUNIT, // height
|
||||
0, // display offset
|
||||
200, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOCLIP|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_SMALLMACECHAIN
|
||||
-1, // doomednum
|
||||
S_SMALLMACECHAIN, // spawnstate
|
||||
|
@ -8956,7 +9200,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
100, // mass
|
||||
1, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOGRAVITY|MF_SPECIAL|MF_NOCLIPHEIGHT, // flags
|
||||
MF_SCENERY|MF_SPECIAL|MF_NOGRAVITY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
@ -8983,7 +9227,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
100, // mass
|
||||
1, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOGRAVITY|MF_SPECIAL|MF_NOCLIPHEIGHT, // flags
|
||||
MF_SCENERY|MF_SPECIAL|MF_NOGRAVITY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
@ -9006,11 +9250,11 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
24*FRACUNIT, // speed
|
||||
17*FRACUNIT, // radius
|
||||
34*FRACUNIT, // height
|
||||
0, // display offset
|
||||
1, // display offset
|
||||
100, // mass
|
||||
1, // damage
|
||||
sfx_mswing, // activesound
|
||||
MF_PAIN|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
|
||||
MF_SCENERY|MF_PAIN|MF_NOGRAVITY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
@ -9033,11 +9277,119 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
48*FRACUNIT, // speed
|
||||
34*FRACUNIT, // radius
|
||||
68*FRACUNIT, // height
|
||||
0, // display offset
|
||||
1, // display offset
|
||||
100, // mass
|
||||
1, // damage
|
||||
sfx_mswing, // activesound
|
||||
MF_PAIN|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
|
||||
MF_SCENERY|MF_PAIN|MF_NOGRAVITY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_YELLOWSPRINGBALL
|
||||
-1, // doomednum
|
||||
S_YELLOWSPRINGBALL, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_YELLOWSPRINGBALL2, // seestate
|
||||
sfx_None, // seesound
|
||||
8, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
S_NULL, // painstate
|
||||
0, // painchance
|
||||
sfx_spring, // painsound
|
||||
S_NULL, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
24*FRACUNIT, // speed
|
||||
17*FRACUNIT, // radius
|
||||
34*FRACUNIT, // height
|
||||
1, // display offset
|
||||
20*FRACUNIT, // mass
|
||||
0, // damage
|
||||
sfx_mswing, // activesound
|
||||
MF_SCENERY|MF_SOLID|MF_SPRING|MF_NOGRAVITY, // flags
|
||||
S_YELLOWSPRINGBALL2 // raisestate
|
||||
},
|
||||
|
||||
{ // MT_REDSPRINGBALL
|
||||
-1, // doomednum
|
||||
S_REDSPRINGBALL, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_REDSPRINGBALL2, // seestate
|
||||
sfx_None, // seesound
|
||||
8, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
S_NULL, // painstate
|
||||
0, // painchance
|
||||
sfx_spring, // painsound
|
||||
S_NULL, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
24*FRACUNIT, // speed
|
||||
17*FRACUNIT, // radius
|
||||
34*FRACUNIT, // height
|
||||
1, // display offset
|
||||
32*FRACUNIT, // mass
|
||||
0, // damage
|
||||
sfx_mswing, // activesound
|
||||
MF_SCENERY|MF_SOLID|MF_SPRING|MF_NOGRAVITY, // flags
|
||||
S_REDSPRINGBALL2 // raisestate
|
||||
},
|
||||
|
||||
{ // MT_SMALLFIREBAR
|
||||
-1, // doomednum
|
||||
S_SMALLFIREBAR1, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
8, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
S_NULL, // painstate
|
||||
MT_FLAMEPARTICLE, // painchance
|
||||
sfx_None, // painsound
|
||||
S_NULL, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
24*FRACUNIT, // speed
|
||||
17*FRACUNIT, // radius
|
||||
34*FRACUNIT, // height
|
||||
0, // display offset
|
||||
100, // mass
|
||||
1, // damage
|
||||
sfx_None, // activesound
|
||||
MF_SCENERY|MF_PAIN|MF_FIRE|MF_NOGRAVITY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_BIGFIREBAR
|
||||
-1, // doomednum
|
||||
S_BIGFIREBAR1, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
8, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
S_NULL, // painstate
|
||||
MT_FLAMEPARTICLE, // painchance
|
||||
sfx_None, // painsound
|
||||
S_NULL, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
48*FRACUNIT, // speed
|
||||
34*FRACUNIT, // radius
|
||||
68*FRACUNIT, // height
|
||||
1, // display offset
|
||||
100, // mass
|
||||
1, // damage
|
||||
sfx_None, // activesound
|
||||
MF_SCENERY|MF_PAIN|MF_FIRE|MF_NOGRAVITY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
@ -11412,7 +11764,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
SH_ELEMENTAL, // speed
|
||||
64*FRACUNIT, // radius
|
||||
64*FRACUNIT, // height
|
||||
2, // display offset
|
||||
4, // display offset
|
||||
16, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
|
@ -11439,7 +11791,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
SH_ATTRACT, // speed
|
||||
64*FRACUNIT, // radius
|
||||
64*FRACUNIT, // height
|
||||
2, // display offset
|
||||
4, // display offset
|
||||
16, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
|
@ -11466,7 +11818,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
SH_FORCE, // speed
|
||||
64*FRACUNIT, // radius
|
||||
64*FRACUNIT, // height
|
||||
2, // display offset
|
||||
4, // display offset
|
||||
16, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
|
@ -11493,7 +11845,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
SH_ARMAGEDDON, // speed
|
||||
64*FRACUNIT, // radius
|
||||
64*FRACUNIT, // height
|
||||
2, // display offset
|
||||
4, // display offset
|
||||
16, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
|
@ -11520,7 +11872,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
SH_WHIRLWIND, // speed
|
||||
64*FRACUNIT, // radius
|
||||
64*FRACUNIT, // height
|
||||
2, // display offset
|
||||
4, // display offset
|
||||
16, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
|
@ -11547,7 +11899,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
SH_PITY, // speed
|
||||
64*FRACUNIT, // radius
|
||||
64*FRACUNIT, // height
|
||||
2, // display offset
|
||||
4, // display offset
|
||||
16, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
|
@ -11574,7 +11926,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
SH_FLAMEAURA, // speed
|
||||
64*FRACUNIT, // radius
|
||||
64*FRACUNIT, // height
|
||||
-2, // display offset
|
||||
-4, // display offset
|
||||
16, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
|
@ -11601,7 +11953,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
SH_BUBBLEWRAP, // speed
|
||||
64*FRACUNIT, // radius
|
||||
64*FRACUNIT, // height
|
||||
2, // display offset
|
||||
4, // display offset
|
||||
16, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
|
@ -11628,7 +11980,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
SH_THUNDERCOIN, // speed
|
||||
64*FRACUNIT, // radius
|
||||
64*FRACUNIT, // height
|
||||
-2, // display offset
|
||||
-4, // display offset
|
||||
16, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
|
@ -14294,9 +14646,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
|
||||
{ // MT_NIGHTSSUPERLOOP
|
||||
1707, // doomednum
|
||||
S_NIGHTSPOWERUP1, // spawnstate
|
||||
S_NIGHTSSUPERLOOP, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NIGHTSPOWERUP2, // seestate
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
0, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
|
@ -14321,9 +14673,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
|
||||
{ // MT_NIGHTSDRILLREFILL
|
||||
1708, // doomednum
|
||||
S_NIGHTSPOWERUP3, // spawnstate
|
||||
S_NIGHTSDRILLREFILL, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NIGHTSPOWERUP4, // seestate
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
0, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
|
@ -14348,9 +14700,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
|
||||
{ // MT_NIGHTSHELPER
|
||||
1709, // doomednum
|
||||
S_NIGHTSPOWERUP5, // spawnstate
|
||||
S_NIGHTSHELPER, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NIGHTSPOWERUP6, // seestate
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
0, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
|
@ -14375,9 +14727,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
|
||||
{ // MT_NIGHTSEXTRATIME
|
||||
1711, // doomednum
|
||||
S_NIGHTSPOWERUP7, // spawnstate
|
||||
S_NIGHTSEXTRATIME, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NIGHTSPOWERUP8, // seestate
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
0, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
|
@ -14402,9 +14754,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
|
||||
{ // MT_NIGHTSLINKFREEZE
|
||||
1712, // doomednum
|
||||
S_NIGHTSPOWERUP9, // spawnstate
|
||||
S_NIGHTSLINKFREEZE, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NIGHTSPOWERUP10, // seestate
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
0, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
|
@ -14666,7 +15018,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
0, // speed
|
||||
16*FRACUNIT, // radius
|
||||
48*FRACUNIT, // height
|
||||
0, // display offset
|
||||
1, // display offset
|
||||
1000, // mass
|
||||
8, // damage
|
||||
sfx_None, // activesound
|
||||
|
|
151
src/info.h
151
src/info.h
|
@ -40,8 +40,6 @@ void A_Scream();
|
|||
void A_BossDeath();
|
||||
void A_CustomPower(); // Use this for a custom power
|
||||
void A_GiveWeapon(); // Gives the player weapon(s)
|
||||
void A_JumpShield(); // Obtained Jump Shield
|
||||
void A_RingShield(); // Obtained Ring Shield
|
||||
void A_RingBox(); // Obtained Ring Box Tails
|
||||
void A_Invincibility(); // Obtained Invincibility Box
|
||||
void A_SuperSneakers(); // Obtained Super Sneakers Box
|
||||
|
@ -52,13 +50,7 @@ void A_BubbleRise(); // Bubbles float to surface
|
|||
void A_BubbleCheck(); // Don't draw if not underwater
|
||||
void A_AwardScore();
|
||||
void A_ExtraLife(); // Extra Life
|
||||
void A_BombShield(); // Obtained Bomb Shield
|
||||
void A_WaterShield(); // Obtained Water Shield
|
||||
void A_ForceShield(); // Obtained Force Shield
|
||||
void A_PityShield(); // Obtained Pity Shield. We're... sorry.
|
||||
void A_FlameShield(); // Obtained Flame Shield
|
||||
void A_BubbleShield(); // Obtained Bubble Shield
|
||||
void A_ThunderShield(); // Obtained Thunder Shield
|
||||
void A_GiveShield(); // Obtained Shield
|
||||
void A_GravityBox();
|
||||
void A_ScoreRise(); // Rise the score logo
|
||||
void A_ParticleSpawn();
|
||||
|
@ -84,7 +76,6 @@ void A_DetonChase(); // Deton Chaser
|
|||
void A_CapeChase(); // Fake little Super Sonic cape
|
||||
void A_RotateSpikeBall(); // Spike ball rotation
|
||||
void A_SlingAppear();
|
||||
void A_MaceRotate();
|
||||
void A_UnidusBall();
|
||||
void A_RockSpawn();
|
||||
void A_SetFuse();
|
||||
|
@ -225,6 +216,7 @@ void A_FlickyCheck();
|
|||
void A_FlickyHeightCheck();
|
||||
void A_FlickyFlutter();
|
||||
void A_FlameParticle();
|
||||
void A_FadeOverlay();
|
||||
|
||||
// ratio of states to sprites to mobj types is roughly 6 : 1 : 1
|
||||
#define NUMMOBJFREESLOTS 256
|
||||
|
@ -417,6 +409,10 @@ typedef enum sprite
|
|||
SPR_BMCH, // Big Mace Chain
|
||||
SPR_SMCE, // Small Mace
|
||||
SPR_BMCE, // Big Mace
|
||||
SPR_YSPB, // Yellow spring on a ball
|
||||
SPR_RSPB, // Red spring on a ball
|
||||
SPR_SFBR, // Small Firebar
|
||||
SPR_BFBR, // Big Firebar
|
||||
|
||||
// Arid Canyon Scenery
|
||||
SPR_BTBL, // Big tumbleweed
|
||||
|
@ -609,11 +605,12 @@ typedef enum sprite
|
|||
// Make sure to be conscious of FF_FRAMEMASK and the fact sprite2 is stored as a UINT8 whenever you change this table.
|
||||
// Currently, FF_FRAMEMASK is 0xff, or 255 - but the second half is used by FF_SPR2SUPER, so the limitation is 0x7f.
|
||||
// Since this is zero-based, there can be at most 128 different SPR2_'s without changing that.
|
||||
enum playersprite
|
||||
typedef enum playersprite
|
||||
{
|
||||
SPR2_STND = 0,
|
||||
SPR2_WAIT,
|
||||
SPR2_WALK,
|
||||
SPR2_SKID,
|
||||
SPR2_RUN ,
|
||||
SPR2_DASH,
|
||||
SPR2_PAIN,
|
||||
|
@ -689,13 +686,27 @@ enum playersprite
|
|||
SPR2_DRLB,
|
||||
SPR2_DRLC,
|
||||
|
||||
// c:
|
||||
SPR2_TAL0,
|
||||
SPR2_TAL1,
|
||||
SPR2_TAL2,
|
||||
SPR2_TAL3,
|
||||
SPR2_TAL4,
|
||||
SPR2_TAL5,
|
||||
SPR2_TAL6,
|
||||
SPR2_TAL7,
|
||||
SPR2_TAL8,
|
||||
SPR2_TAL9,
|
||||
SPR2_TALA,
|
||||
SPR2_TALB,
|
||||
|
||||
SPR2_SIGN, // end sign head
|
||||
SPR2_LIFE, // life monitor icon
|
||||
|
||||
SPR2_FIRSTFREESLOT,
|
||||
SPR2_LASTFREESLOT = 0x7f,
|
||||
NUMPLAYERSPRITES
|
||||
};
|
||||
} playersprite_t;
|
||||
|
||||
typedef enum state
|
||||
{
|
||||
|
@ -718,6 +729,7 @@ typedef enum state
|
|||
S_PLAY_STND,
|
||||
S_PLAY_WAIT,
|
||||
S_PLAY_WALK,
|
||||
S_PLAY_SKID,
|
||||
S_PLAY_RUN,
|
||||
S_PLAY_DASH,
|
||||
S_PLAY_PAIN,
|
||||
|
@ -766,15 +778,12 @@ typedef enum state
|
|||
S_PLAY_MELEE_LANDING,
|
||||
|
||||
// SF_SUPER
|
||||
S_PLAY_SUPER_TRANS,
|
||||
S_PLAY_SUPER_TRANS1,
|
||||
S_PLAY_SUPER_TRANS2,
|
||||
S_PLAY_SUPER_TRANS3,
|
||||
S_PLAY_SUPER_TRANS4,
|
||||
S_PLAY_SUPER_TRANS5,
|
||||
S_PLAY_SUPER_TRANS6,
|
||||
S_PLAY_SUPER_TRANS7,
|
||||
S_PLAY_SUPER_TRANS8,
|
||||
S_PLAY_SUPER_TRANS9,
|
||||
|
||||
// technically the player goes here but it's an infinite tic state
|
||||
S_OBJPLACE_DUMMY,
|
||||
|
@ -790,15 +799,12 @@ typedef enum state
|
|||
S_PLAY_SIGN,
|
||||
|
||||
// NiGHTS character (uses player sprite)
|
||||
S_PLAY_NIGHTS_TRANS,
|
||||
S_PLAY_NIGHTS_TRANS1,
|
||||
S_PLAY_NIGHTS_TRANS2,
|
||||
S_PLAY_NIGHTS_TRANS3,
|
||||
S_PLAY_NIGHTS_TRANS4,
|
||||
S_PLAY_NIGHTS_TRANS5,
|
||||
S_PLAY_NIGHTS_TRANS6,
|
||||
S_PLAY_NIGHTS_TRANS7,
|
||||
S_PLAY_NIGHTS_TRANS8,
|
||||
S_PLAY_NIGHTS_TRANS9,
|
||||
|
||||
S_PLAY_NIGHTS_STAND,
|
||||
S_PLAY_NIGHTS_FLOAT,
|
||||
|
@ -833,6 +839,20 @@ typedef enum state
|
|||
S_PLAY_NIGHTS_FLYC,
|
||||
S_PLAY_NIGHTS_DRILLC,
|
||||
|
||||
// c:
|
||||
S_TAILSOVERLAY_STAND,
|
||||
S_TAILSOVERLAY_0DEGREES,
|
||||
S_TAILSOVERLAY_PLUS30DEGREES,
|
||||
S_TAILSOVERLAY_PLUS60DEGREES,
|
||||
S_TAILSOVERLAY_MINUS30DEGREES,
|
||||
S_TAILSOVERLAY_MINUS60DEGREES,
|
||||
S_TAILSOVERLAY_RUN,
|
||||
S_TAILSOVERLAY_FLY,
|
||||
S_TAILSOVERLAY_TIRE,
|
||||
S_TAILSOVERLAY_PAIN,
|
||||
S_TAILSOVERLAY_GASP,
|
||||
S_TAILSOVERLAY_EDGE,
|
||||
|
||||
// Blue Crawla
|
||||
S_POSS_STND,
|
||||
S_POSS_RUN1,
|
||||
|
@ -1784,6 +1804,8 @@ typedef enum state
|
|||
S_WALLSPIKE5,
|
||||
S_WALLSPIKE6,
|
||||
S_WALLSPIKEBASE,
|
||||
S_WALLSPIKED1,
|
||||
S_WALLSPIKED2,
|
||||
|
||||
// Starpost
|
||||
S_STARPOST_IDLE,
|
||||
|
@ -2054,18 +2076,62 @@ typedef enum state
|
|||
S_SLING1,
|
||||
S_SLING2,
|
||||
|
||||
// CEZ Small Mace Chain
|
||||
// CEZ maces and chains
|
||||
S_SMALLMACECHAIN,
|
||||
|
||||
// CEZ Big Mace Chain
|
||||
S_BIGMACECHAIN,
|
||||
|
||||
// CEZ Small Mace
|
||||
S_SMALLMACE,
|
||||
|
||||
// CEZ Big Mace
|
||||
S_BIGMACE,
|
||||
|
||||
// Yellow spring on a ball
|
||||
S_YELLOWSPRINGBALL,
|
||||
S_YELLOWSPRINGBALL2,
|
||||
S_YELLOWSPRINGBALL3,
|
||||
S_YELLOWSPRINGBALL4,
|
||||
S_YELLOWSPRINGBALL5,
|
||||
|
||||
// Red spring on a ball
|
||||
S_REDSPRINGBALL,
|
||||
S_REDSPRINGBALL2,
|
||||
S_REDSPRINGBALL3,
|
||||
S_REDSPRINGBALL4,
|
||||
S_REDSPRINGBALL5,
|
||||
|
||||
// Small Firebar
|
||||
S_SMALLFIREBAR1,
|
||||
S_SMALLFIREBAR2,
|
||||
S_SMALLFIREBAR3,
|
||||
S_SMALLFIREBAR4,
|
||||
S_SMALLFIREBAR5,
|
||||
S_SMALLFIREBAR6,
|
||||
S_SMALLFIREBAR7,
|
||||
S_SMALLFIREBAR8,
|
||||
S_SMALLFIREBAR9,
|
||||
S_SMALLFIREBAR10,
|
||||
S_SMALLFIREBAR11,
|
||||
S_SMALLFIREBAR12,
|
||||
S_SMALLFIREBAR13,
|
||||
S_SMALLFIREBAR14,
|
||||
S_SMALLFIREBAR15,
|
||||
S_SMALLFIREBAR16,
|
||||
|
||||
// Big Firebar
|
||||
S_BIGFIREBAR1,
|
||||
S_BIGFIREBAR2,
|
||||
S_BIGFIREBAR3,
|
||||
S_BIGFIREBAR4,
|
||||
S_BIGFIREBAR5,
|
||||
S_BIGFIREBAR6,
|
||||
S_BIGFIREBAR7,
|
||||
S_BIGFIREBAR8,
|
||||
S_BIGFIREBAR9,
|
||||
S_BIGFIREBAR10,
|
||||
S_BIGFIREBAR11,
|
||||
S_BIGFIREBAR12,
|
||||
S_BIGFIREBAR13,
|
||||
S_BIGFIREBAR14,
|
||||
S_BIGFIREBAR15,
|
||||
S_BIGFIREBAR16,
|
||||
|
||||
S_CEZFLOWER1,
|
||||
|
||||
// Big Tumbleweed
|
||||
|
@ -3039,16 +3105,11 @@ typedef enum state
|
|||
S_NIGHTSWING_XMAS,
|
||||
|
||||
// NiGHTS Paraloop Powerups
|
||||
S_NIGHTSPOWERUP1,
|
||||
S_NIGHTSPOWERUP2,
|
||||
S_NIGHTSPOWERUP3,
|
||||
S_NIGHTSPOWERUP4,
|
||||
S_NIGHTSPOWERUP5,
|
||||
S_NIGHTSPOWERUP6,
|
||||
S_NIGHTSPOWERUP7,
|
||||
S_NIGHTSPOWERUP8,
|
||||
S_NIGHTSPOWERUP9,
|
||||
S_NIGHTSPOWERUP10,
|
||||
S_NIGHTSSUPERLOOP,
|
||||
S_NIGHTSDRILLREFILL,
|
||||
S_NIGHTSHELPER,
|
||||
S_NIGHTSEXTRATIME,
|
||||
S_NIGHTSLINKFREEZE,
|
||||
S_EGGCAPSULE,
|
||||
|
||||
// Orbiting Chaos Emeralds
|
||||
|
@ -3157,8 +3218,9 @@ typedef struct
|
|||
extern state_t states[NUMSTATES];
|
||||
extern char sprnames[NUMSPRITES + 1][5];
|
||||
extern char spr2names[NUMPLAYERSPRITES][5];
|
||||
extern playersprite_t spr2defaults[NUMPLAYERSPRITES];
|
||||
extern state_t *astate;
|
||||
extern enum playersprite free_spr2;
|
||||
extern playersprite_t free_spr2;
|
||||
|
||||
typedef enum mobj_type
|
||||
{
|
||||
|
@ -3167,6 +3229,7 @@ typedef enum mobj_type
|
|||
|
||||
MT_THOK, // Thok! mobj
|
||||
MT_PLAYER,
|
||||
MT_TAILSOVERLAY, // c:
|
||||
|
||||
// Enemies
|
||||
MT_BLUECRAWLA,
|
||||
|
@ -3424,14 +3487,20 @@ typedef enum mobj_type
|
|||
MT_FLAMEPARTICLE,
|
||||
MT_EGGSTATUE, // Eggman Statue
|
||||
MT_MACEPOINT, // Mace rotation point
|
||||
MT_SWINGMACEPOINT, // Mace swinging point
|
||||
MT_HANGMACEPOINT, // Hangable mace chain
|
||||
MT_SPINMACEPOINT, // Spin/Controllable mace chain
|
||||
MT_CHAINMACEPOINT, // Combination of chains and maces point
|
||||
MT_SPRINGBALLPOINT, // Spring ball point
|
||||
MT_CHAINPOINT, // Mace chain
|
||||
MT_HIDDEN_SLING, // Spin mace chain (activatable)
|
||||
MT_FIREBARPOINT, // Firebar
|
||||
MT_CUSTOMMACEPOINT, // Custom mace
|
||||
MT_SMALLMACECHAIN, // Small Mace Chain
|
||||
MT_BIGMACECHAIN, // Big Mace Chain
|
||||
MT_SMALLMACE, // Small Mace
|
||||
MT_BIGMACE, // Big Mace
|
||||
MT_YELLOWSPRINGBALL, // Yellow spring on a ball
|
||||
MT_REDSPRINGBALL, // Red spring on a ball
|
||||
MT_SMALLFIREBAR, // Small Firebar
|
||||
MT_BIGFIREBAR, // Big Firebar
|
||||
MT_CEZFLOWER,
|
||||
|
||||
// Arid Canyon Scenery
|
||||
|
|
|
@ -462,6 +462,8 @@ static int lib_pSpawnLockOn(lua_State *L)
|
|||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
if (!player)
|
||||
return LUA_ErrInvalid(L, "player_t");
|
||||
if (state >= NUMSTATES)
|
||||
return luaL_error(L, "state %d out of range (0 - %d)", state, NUMSTATES-1);
|
||||
if (P_IsLocalPlayer(player)) // Only display it on your own view.
|
||||
{
|
||||
mobj_t *visual = P_SpawnMobj(lockon->x, lockon->y, lockon->z, MT_LOCKON); // positioning, flip handled in P_SceneryThinker
|
||||
|
@ -978,6 +980,19 @@ static int lib_pGivePlayerLives(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int lib_pGiveCoopLives(lua_State *L)
|
||||
{
|
||||
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||
INT32 numlives = (INT32)luaL_checkinteger(L, 2);
|
||||
boolean sound = (boolean)lua_opttrueboolean(L, 3);
|
||||
NOHUD
|
||||
INLEVEL
|
||||
if (!player)
|
||||
return LUA_ErrInvalid(L, "player_t");
|
||||
P_GiveCoopLives(player, numlives, sound);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_pResetScore(lua_State *L)
|
||||
{
|
||||
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||
|
@ -1183,6 +1198,18 @@ static int lib_pTelekinesis(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int lib_pSwitchShield(lua_State *L)
|
||||
{
|
||||
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||
UINT16 shield = luaL_checkinteger(L, 2);
|
||||
NOHUD
|
||||
INLEVEL
|
||||
if (!player)
|
||||
return LUA_ErrInvalid(L, "player_t");
|
||||
P_SwitchShield(player, shield);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// P_MAP
|
||||
///////////
|
||||
|
||||
|
@ -2428,6 +2455,7 @@ static luaL_Reg lib[] = {
|
|||
{"P_SpawnGhostMobj",lib_pSpawnGhostMobj},
|
||||
{"P_GivePlayerRings",lib_pGivePlayerRings},
|
||||
{"P_GivePlayerLives",lib_pGivePlayerLives},
|
||||
{"P_GiveCoopLives",lib_pGiveCoopLives},
|
||||
{"P_ResetScore",lib_pResetScore},
|
||||
{"P_DoJumpShield",lib_pDoJumpShield},
|
||||
{"P_DoBubbleBounce",lib_pDoBubbleBounce},
|
||||
|
@ -2445,6 +2473,7 @@ static luaL_Reg lib[] = {
|
|||
{"P_SpawnThokMobj",lib_pSpawnThokMobj},
|
||||
{"P_SpawnSpinMobj",lib_pSpawnSpinMobj},
|
||||
{"P_Telekinesis",lib_pTelekinesis},
|
||||
{"P_SwitchShield",lib_pSwitchShield},
|
||||
|
||||
// p_map
|
||||
{"P_CheckPosition",lib_pCheckPosition},
|
||||
|
|
|
@ -22,8 +22,13 @@
|
|||
#include "lua_libs.h"
|
||||
#include "lua_hud.h" // hud_running errors
|
||||
|
||||
// for functions not allowed in hud.add hooks
|
||||
#define NOHUD if (hud_running)\
|
||||
return luaL_error(L, "HUD rendering code should not call this function!");
|
||||
// for functions not allowed in hooks or coroutines (supercedes above)
|
||||
#define NOHOOK if (!lua_lumploading)\
|
||||
return luaL_error(L, "This function cannot be called from within a hook or coroutine!");
|
||||
// for functions only allowed within a level
|
||||
#define INLEVEL if (gamestate != GS_LEVEL)\
|
||||
return luaL_error(L, "This function can only be used in a level!");
|
||||
|
||||
|
@ -84,7 +89,7 @@ deny:
|
|||
CONS_Alert(CONS_WARNING, M_GetText("Illegal lua command received from %s\n"), player_names[playernum]);
|
||||
if (server)
|
||||
{
|
||||
XBOXSTATIC UINT8 bufn[2];
|
||||
UINT8 bufn[2];
|
||||
|
||||
bufn[0] = (UINT8)playernum;
|
||||
bufn[1] = KICK_MSG_CON_FAIL;
|
||||
|
@ -184,7 +189,7 @@ static int lib_comAddCommand(lua_State *L)
|
|||
strlwr(name);
|
||||
|
||||
luaL_checktype(L, 2, LUA_TFUNCTION);
|
||||
NOHUD
|
||||
NOHOOK
|
||||
if (lua_gettop(L) >= 3)
|
||||
{ // For the third argument, only take a boolean or a number.
|
||||
lua_settop(L, 3);
|
||||
|
@ -296,7 +301,7 @@ static int lib_cvRegisterVar(lua_State *L)
|
|||
consvar_t *cvar;
|
||||
luaL_checktype(L, 1, LUA_TTABLE);
|
||||
lua_settop(L, 1); // Clear out all other possible arguments, leaving only the first one.
|
||||
NOHUD
|
||||
NOHOOK
|
||||
cvar = lua_newuserdata(L, sizeof(consvar_t));
|
||||
luaL_getmetatable(L, META_CVAR);
|
||||
lua_setmetatable(L, -2);
|
||||
|
@ -394,12 +399,21 @@ static int lib_cvRegisterVar(lua_State *L)
|
|||
// stack: cvar table, cvar userdata
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, "CV_Vars");
|
||||
I_Assert(lua_istable(L, 3));
|
||||
|
||||
lua_getfield(L, 3, cvar->name);
|
||||
if (lua_type(L, -1) != LUA_TNIL)
|
||||
return luaL_error(L, M_GetText("Variable %s is already defined\n"), cvar->name);
|
||||
lua_pop(L, 1);
|
||||
|
||||
lua_pushvalue(L, 2);
|
||||
lua_setfield(L, 3, cvar->name);
|
||||
lua_pop(L, 1);
|
||||
|
||||
// actually time to register it to the console now! Finally!
|
||||
cvar->flags |= CV_MODIFIED;
|
||||
CV_RegisterVar(cvar);
|
||||
if (cvar->flags & CV_MODIFIED)
|
||||
return luaL_error(L, "failed to register cvar (probable conflict with internal variable/command names)");
|
||||
|
||||
// return cvar userdata
|
||||
return 1;
|
||||
|
|
|
@ -47,6 +47,7 @@ enum hook {
|
|||
hook_ShieldSpecial,
|
||||
hook_MobjMoveBlocked,
|
||||
hook_MapThingSpawn,
|
||||
hook_FollowMobj,
|
||||
|
||||
hook_MAX // last hook
|
||||
};
|
||||
|
@ -85,5 +86,6 @@ boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source, UINT8
|
|||
#define LUAh_ShieldSpecial(player) LUAh_PlayerHook(player, hook_ShieldSpecial) // Hook for shield abilities
|
||||
#define LUAh_MobjMoveBlocked(mo) LUAh_MobjHook(mo, hook_MobjMoveBlocked) // Hook for P_XYMovement (when movement is blocked)
|
||||
boolean LUAh_MapThingSpawn(mobj_t *mo, mapthing_t *mthing); // Hook for P_SpawnMapThing by mobj type
|
||||
boolean LUAh_FollowMobj(player_t *player, mobj_t *mo); // Hook for P_PlayerAfterThink Smiles mobj-following
|
||||
|
||||
#endif
|
||||
|
|
|
@ -58,6 +58,7 @@ const char *const hookNames[hook_MAX+1] = {
|
|||
"ShieldSpecial",
|
||||
"MobjMoveBlocked",
|
||||
"MapThingSpawn",
|
||||
"FollowMobj",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -109,8 +110,8 @@ static int lib_addHook(lua_State *L)
|
|||
|
||||
luaL_checktype(L, 1, LUA_TFUNCTION);
|
||||
|
||||
if (hud_running)
|
||||
return luaL_error(L, "HUD rendering code should not call this function!");
|
||||
if (!lua_lumploading)
|
||||
return luaL_error(L, "This function cannot be called from within a hook or coroutine!");
|
||||
|
||||
switch(hook.type)
|
||||
{
|
||||
|
@ -197,6 +198,7 @@ static int lib_addHook(lua_State *L)
|
|||
case hook_SpinSpecial:
|
||||
case hook_JumpSpinSpecial:
|
||||
case hook_PlayerSpawn:
|
||||
case hook_FollowMobj:
|
||||
lastp = &playerhooks;
|
||||
break;
|
||||
case hook_LinedefExecute:
|
||||
|
@ -1138,4 +1140,42 @@ boolean LUAh_MapThingSpawn(mobj_t *mo, mapthing_t *mthing)
|
|||
return hooked;
|
||||
}
|
||||
|
||||
// Hook for P_PlayerAfterThink Smiles mobj-following
|
||||
boolean LUAh_FollowMobj(player_t *player, mobj_t *mobj)
|
||||
{
|
||||
hook_p hookp;
|
||||
boolean hooked = false;
|
||||
if (!gL || !(hooksAvailable[hook_FollowMobj/8] & (1<<(hook_FollowMobj%8))))
|
||||
return 0;
|
||||
|
||||
lua_settop(gL, 0);
|
||||
|
||||
for (hookp = playerhooks; hookp; hookp = hookp->next)
|
||||
if (hookp->type == hook_FollowMobj)
|
||||
{
|
||||
if (lua_gettop(gL) == 0)
|
||||
{
|
||||
LUA_PushUserdata(gL, player, META_PLAYER);
|
||||
LUA_PushUserdata(gL, mobj, META_MOBJ);
|
||||
}
|
||||
lua_pushfstring(gL, FMT_HOOKID, hookp->id);
|
||||
lua_gettable(gL, LUA_REGISTRYINDEX);
|
||||
lua_pushvalue(gL, -3);
|
||||
lua_pushvalue(gL, -3);
|
||||
if (lua_pcall(gL, 2, 1, 0)) {
|
||||
if (!hookp->error || cv_debug & DBG_LUA)
|
||||
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
|
||||
lua_pop(gL, 1);
|
||||
hookp->error = true;
|
||||
continue;
|
||||
}
|
||||
if (lua_toboolean(gL, -1))
|
||||
hooked = true;
|
||||
lua_pop(gL, 1);
|
||||
}
|
||||
|
||||
lua_settop(gL, 0);
|
||||
return hooked;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -42,3 +42,4 @@ boolean LUA_HudEnabled(enum hud option);
|
|||
|
||||
void LUAh_GameHUD(player_t *stplyr);
|
||||
void LUAh_ScoresHUD(void);
|
||||
void LUAh_TitleHUD(void);
|
||||
|
|
190
src/lua_hudlib.c
190
src/lua_hudlib.c
|
@ -12,6 +12,7 @@
|
|||
|
||||
#include "doomdef.h"
|
||||
#ifdef HAVE_BLUA
|
||||
#include "fastcmp.h"
|
||||
#include "r_defs.h"
|
||||
#include "r_local.h"
|
||||
#include "st_stuff.h" // hudinfo[]
|
||||
|
@ -87,11 +88,13 @@ static const char *const patch_opt[] = {
|
|||
|
||||
enum hudhook {
|
||||
hudhook_game = 0,
|
||||
hudhook_scores
|
||||
hudhook_scores,
|
||||
hudhook_title
|
||||
};
|
||||
static const char *const hudhook_opt[] = {
|
||||
"game",
|
||||
"scores",
|
||||
"title",
|
||||
NULL};
|
||||
|
||||
// alignment types for v.drawString
|
||||
|
@ -343,6 +346,158 @@ static int libd_cachePatch(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
|
||||
// v.getSpritePatch(sprite, [frame, [angle]])
|
||||
static int libd_getSpritePatch(lua_State *L)
|
||||
{
|
||||
UINT32 i; // sprite prefix
|
||||
UINT32 frame = 0; // 'A'
|
||||
UINT8 angle = 0;
|
||||
spritedef_t *sprdef;
|
||||
spriteframe_t *sprframe;
|
||||
HUDONLY
|
||||
|
||||
if (lua_isnumber(L, 1)) // sprite number given, e.g. SPR_THOK
|
||||
{
|
||||
i = lua_tonumber(L, 1);
|
||||
if (i >= NUMSPRITES)
|
||||
return 0;
|
||||
}
|
||||
else if (lua_isstring(L, 1)) // sprite prefix name given, e.g. "THOK"
|
||||
{
|
||||
const char *name = lua_tostring(L, 1);
|
||||
for (i = 0; i < NUMSPRITES; i++)
|
||||
if (fastcmp(name, sprnames[i]))
|
||||
break;
|
||||
if (i >= NUMSPRITES)
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
|
||||
if (i == SPR_PLAY) // Use getSprite2Patch instead!
|
||||
return 0;
|
||||
|
||||
sprdef = &sprites[i];
|
||||
|
||||
// set frame number
|
||||
frame = luaL_optinteger(L, 2, 0);
|
||||
frame &= FF_FRAMEMASK; // ignore any bits that are not the actual frame, just in case
|
||||
if (frame >= sprdef->numframes)
|
||||
return 0;
|
||||
// set angle number
|
||||
sprframe = &sprdef->spriteframes[frame];
|
||||
angle = luaL_optinteger(L, 3, 1);
|
||||
|
||||
// convert WAD editor angle numbers (1-8) to internal angle numbers (0-7)
|
||||
// keep 0 the same since we'll make it default to angle 1 (which is internally 0)
|
||||
// in case somebody didn't know that angle 0 really just maps all 8 angles to the same patch
|
||||
if (angle != 0)
|
||||
angle--;
|
||||
|
||||
if (angle >= 8) // out of range?
|
||||
return 0;
|
||||
|
||||
// push both the patch and it's "flip" value
|
||||
LUA_PushUserdata(L, W_CachePatchNum(sprframe->lumppat[angle], PU_STATIC), META_PATCH);
|
||||
lua_pushboolean(L, (sprframe->flip & (1<<angle)) != 0);
|
||||
return 2;
|
||||
}
|
||||
|
||||
// v.getSprite2Patch(skin, sprite, [super?,] [frame, [angle]])
|
||||
static int libd_getSprite2Patch(lua_State *L)
|
||||
{
|
||||
INT32 i; // skin number
|
||||
UINT32 j; // sprite2 prefix
|
||||
UINT32 frame = 0; // 'A'
|
||||
UINT8 angle = 0;
|
||||
spritedef_t *sprdef;
|
||||
spriteframe_t *sprframe;
|
||||
boolean super = false; // add FF_SPR2SUPER to sprite2 if true
|
||||
HUDONLY
|
||||
|
||||
// get skin first!
|
||||
if (lua_isnumber(L, 1)) // find skin by number
|
||||
{
|
||||
i = lua_tonumber(L, 1);
|
||||
if (i < 0 || i >= MAXSKINS)
|
||||
return luaL_error(L, "skin number %d out of range (0 - %d)", i, MAXSKINS-1);
|
||||
if (i >= numskins)
|
||||
return 0;
|
||||
}
|
||||
else // find skin by name
|
||||
{
|
||||
const char *name = luaL_checkstring(L, 1);
|
||||
for (i = 0; i < numskins; i++)
|
||||
if (fastcmp(skins[i].name, name))
|
||||
break;
|
||||
if (i >= numskins)
|
||||
return 0;
|
||||
}
|
||||
|
||||
lua_remove(L, 1); // remove skin now
|
||||
|
||||
if (lua_isnumber(L, 1)) // sprite number given, e.g. SPR2_STND
|
||||
{
|
||||
j = lua_tonumber(L, 1);
|
||||
if (j & FF_SPR2SUPER) // e.g. SPR2_STND|FF_SPR2SUPER
|
||||
{
|
||||
super = true;
|
||||
j &= ~FF_SPR2SUPER; // remove flag so the next check doesn't fail
|
||||
}
|
||||
if (j >= free_spr2)
|
||||
return 0;
|
||||
}
|
||||
else if (lua_isstring(L, 1)) // sprite prefix name given, e.g. "STND"
|
||||
{
|
||||
const char *name = lua_tostring(L, 1);
|
||||
for (j = 0; j < free_spr2; j++)
|
||||
if (fastcmp(name, spr2names[j]))
|
||||
break;
|
||||
// if you want super flags you'll have to use the optional boolean following this
|
||||
if (j >= free_spr2)
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
|
||||
if (lua_isboolean(L, 2)) // optional boolean for superness
|
||||
{
|
||||
super = lua_toboolean(L, 2); // note: this can override FF_SPR2SUPER from sprite number
|
||||
lua_remove(L, 2); // remove
|
||||
}
|
||||
// if it's not boolean then just assume it's the frame number
|
||||
|
||||
if (super)
|
||||
j |= FF_SPR2SUPER;
|
||||
|
||||
j = P_GetSkinSprite2(&skins[i], j, NULL); // feed skin and current sprite2 through to change sprite2 used if necessary
|
||||
|
||||
sprdef = &skins[i].sprites[j];
|
||||
|
||||
// set frame number
|
||||
frame = luaL_optinteger(L, 2, 0);
|
||||
frame &= FF_FRAMEMASK; // ignore any bits that are not the actual frame, just in case
|
||||
if (frame >= sprdef->numframes)
|
||||
return 0;
|
||||
// set angle number
|
||||
sprframe = &sprdef->spriteframes[frame];
|
||||
angle = luaL_optinteger(L, 3, 1);
|
||||
|
||||
// convert WAD editor angle numbers (1-8) to internal angle numbers (0-7)
|
||||
// keep 0 the same since we'll make it default to angle 1 (which is internally 0)
|
||||
// in case somebody didn't know that angle 0 really just maps all 8 angles to the same patch
|
||||
if (angle != 0)
|
||||
angle--;
|
||||
|
||||
if (angle >= 8) // out of range?
|
||||
return 0;
|
||||
|
||||
// push both the patch and it's "flip" value
|
||||
LUA_PushUserdata(L, W_CachePatchNum(sprframe->lumppat[angle], PU_STATIC), META_PATCH);
|
||||
lua_pushboolean(L, (sprframe->flip & (1<<angle)) != 0);
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int libd_draw(lua_State *L)
|
||||
{
|
||||
INT32 x, y, flags;
|
||||
|
@ -568,6 +723,8 @@ static int libd_renderer(lua_State *L)
|
|||
static luaL_Reg lib_draw[] = {
|
||||
{"patchExists", libd_patchExists},
|
||||
{"cachePatch", libd_cachePatch},
|
||||
{"getSpritePatch", libd_getSpritePatch},
|
||||
{"getSprite2Patch", libd_getSprite2Patch},
|
||||
{"draw", libd_draw},
|
||||
{"drawScaled", libd_drawScaled},
|
||||
{"drawNum", libd_drawNum},
|
||||
|
@ -612,6 +769,9 @@ static int lib_hudadd(lua_State *L)
|
|||
luaL_checktype(L, 1, LUA_TFUNCTION);
|
||||
field = luaL_checkoption(L, 2, "game", hudhook_opt);
|
||||
|
||||
if (!lua_lumploading)
|
||||
return luaL_error(L, "This function cannot be called from within a hook or coroutine!");
|
||||
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, "HUD");
|
||||
I_Assert(lua_istable(L, -1));
|
||||
lua_rawgeti(L, -1, field+2); // HUD[2+]
|
||||
|
@ -650,6 +810,9 @@ int LUA_HudLib(lua_State *L)
|
|||
|
||||
lua_newtable(L);
|
||||
lua_rawseti(L, -2, 3); // HUD[2] = scores rendering functions array
|
||||
|
||||
lua_newtable(L);
|
||||
lua_rawseti(L, -2, 4); // HUD[3] = title rendering functions array
|
||||
lua_setfield(L, LUA_REGISTRYINDEX, "HUD");
|
||||
|
||||
luaL_newmetatable(L, META_HUDINFO);
|
||||
|
@ -762,4 +925,29 @@ void LUAh_ScoresHUD(void)
|
|||
hud_running = false;
|
||||
}
|
||||
|
||||
void LUAh_TitleHUD(void)
|
||||
{
|
||||
if (!gL || !(hudAvailable & (1<<hudhook_title)))
|
||||
return;
|
||||
|
||||
hud_running = true;
|
||||
lua_pop(gL, -1);
|
||||
|
||||
lua_getfield(gL, LUA_REGISTRYINDEX, "HUD");
|
||||
I_Assert(lua_istable(gL, -1));
|
||||
lua_rawgeti(gL, -1, 4); // HUD[4] = rendering funcs
|
||||
I_Assert(lua_istable(gL, -1));
|
||||
|
||||
lua_rawgeti(gL, -2, 1); // HUD[1] = lib_draw
|
||||
I_Assert(lua_istable(gL, -1));
|
||||
lua_remove(gL, -3); // pop HUD
|
||||
lua_pushnil(gL);
|
||||
while (lua_next(gL, -3) != 0) {
|
||||
lua_pushvalue(gL, -3); // graphics library (HUD[1])
|
||||
LUA_Call(gL, 1);
|
||||
}
|
||||
lua_pop(gL, -1);
|
||||
hud_running = false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -127,6 +127,78 @@ static int lib_getSpr2name(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int lib_getSpr2default(lua_State *L)
|
||||
{
|
||||
UINT32 i;
|
||||
|
||||
lua_remove(L, 1); // don't care about spr2defaults[] dummy userdata.
|
||||
|
||||
if (lua_isnumber(L, 1))
|
||||
i = lua_tonumber(L, 1);
|
||||
else if (lua_isstring(L, 1))
|
||||
{
|
||||
const char *name = lua_tostring(L, 1);
|
||||
for (i = 0; i < free_spr2; i++)
|
||||
if (fastcmp(name, spr2names[i]))
|
||||
break;
|
||||
}
|
||||
else
|
||||
return luaL_error(L, "spr2defaults[] invalid index");
|
||||
|
||||
if (i >= free_spr2)
|
||||
return 0;
|
||||
|
||||
lua_pushinteger(L, spr2defaults[i]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_setSpr2default(lua_State *L)
|
||||
{
|
||||
UINT32 i;
|
||||
UINT8 j = 0;
|
||||
|
||||
lua_remove(L, 1); // don't care about spr2defaults[] dummy userdata.
|
||||
|
||||
if (lua_isnumber(L, 1))
|
||||
i = lua_tonumber(L, 1);
|
||||
else if (lua_isstring(L, 1))
|
||||
{
|
||||
const char *name = lua_tostring(L, 1);
|
||||
for (i = 0; i < free_spr2; i++)
|
||||
{
|
||||
if (fastcmp(name, spr2names[i]))
|
||||
break;
|
||||
}
|
||||
if (i == free_spr2)
|
||||
return luaL_error(L, "spr2defaults[] invalid index");
|
||||
}
|
||||
else
|
||||
return luaL_error(L, "spr2defaults[] invalid index");
|
||||
|
||||
if (i < SPR2_FIRSTFREESLOT || i >= free_spr2)
|
||||
return luaL_error(L, "spr2defaults[] index %d out of range (%d - %d)", i, SPR2_FIRSTFREESLOT, free_spr2-1);
|
||||
|
||||
if (lua_isnumber(L, 2))
|
||||
j = lua_tonumber(L, 2);
|
||||
else if (lua_isstring(L, 2))
|
||||
{
|
||||
const char *name = lua_tostring(L, 2);
|
||||
for (j = 0; j < free_spr2; j++)
|
||||
{
|
||||
if (fastcmp(name, spr2names[j]))
|
||||
break;
|
||||
}
|
||||
if (j == free_spr2)
|
||||
return luaL_error(L, "spr2defaults[] invalid index");
|
||||
}
|
||||
|
||||
if (j >= free_spr2)
|
||||
j = 0; // return luaL_error(L, "spr2defaults[] set %d out of range (%d - %d)", j, 0, free_spr2-1);
|
||||
|
||||
spr2defaults[i] = j;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_spr2namelen(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, free_spr2);
|
||||
|
@ -984,6 +1056,19 @@ int LUA_InfoLib(lua_State *L)
|
|||
lua_setmetatable(L, -2);
|
||||
lua_setglobal(L, "spr2names");
|
||||
|
||||
lua_newuserdata(L, 0);
|
||||
lua_createtable(L, 0, 2);
|
||||
lua_pushcfunction(L, lib_getSpr2default);
|
||||
lua_setfield(L, -2, "__index");
|
||||
|
||||
lua_pushcfunction(L, lib_setSpr2default);
|
||||
lua_setfield(L, -2, "__newindex");
|
||||
|
||||
lua_pushcfunction(L, lib_spr2namelen);
|
||||
lua_setfield(L, -2, "__len");
|
||||
lua_setmetatable(L, -2);
|
||||
lua_setglobal(L, "spr2defaults");
|
||||
|
||||
lua_newuserdata(L, 0);
|
||||
lua_createtable(L, 0, 2);
|
||||
lua_pushcfunction(L, lib_getState);
|
||||
|
|
|
@ -417,7 +417,7 @@ static int mobj_set(lua_State *L)
|
|||
mo->frame = (UINT32)luaL_checkinteger(L, 3);
|
||||
break;
|
||||
case mobj_sprite2:
|
||||
mo->sprite2 = P_GetMobjSprite2(mo, (UINT8)luaL_checkinteger(L, 3));
|
||||
mo->sprite2 = P_GetSkinSprite2(((skin_t *)mo->skin), (UINT8)luaL_checkinteger(L, 3), mo->player);
|
||||
break;
|
||||
case mobj_anim_duration:
|
||||
mo->anim_duration = (UINT16)luaL_checkinteger(L, 3);
|
||||
|
|
|
@ -126,6 +126,8 @@ static int player_get(lua_State *L)
|
|||
lua_pushfixed(L, plr->bob);
|
||||
else if (fastcmp(field,"aiming"))
|
||||
lua_pushangle(L, plr->aiming);
|
||||
else if (fastcmp(field,"drawangle"))
|
||||
lua_pushangle(L, plr->drawangle);
|
||||
else if (fastcmp(field,"rings"))
|
||||
lua_pushinteger(L, plr->rings);
|
||||
else if (fastcmp(field,"pity"))
|
||||
|
@ -172,6 +174,10 @@ static int player_get(lua_State *L)
|
|||
lua_pushinteger(L, plr->spinitem);
|
||||
else if (fastcmp(field,"revitem"))
|
||||
lua_pushinteger(L, plr->revitem);
|
||||
else if (fastcmp(field,"followitem"))
|
||||
lua_pushinteger(L, plr->followitem);
|
||||
else if (fastcmp(field,"followmobj"))
|
||||
LUA_PushUserdata(L, plr->followmobj, META_MOBJ);
|
||||
else if (fastcmp(field,"actionspd"))
|
||||
lua_pushfixed(L, plr->actionspd);
|
||||
else if (fastcmp(field,"mindash"))
|
||||
|
@ -320,6 +326,8 @@ static int player_get(lua_State *L)
|
|||
lua_pushangle(L, plr->awayviewaiming);
|
||||
else if (fastcmp(field,"spectator"))
|
||||
lua_pushboolean(L, plr->spectator);
|
||||
else if (fastcmp(field,"outofcoop"))
|
||||
lua_pushboolean(L, plr->outofcoop);
|
||||
else if (fastcmp(field,"bot"))
|
||||
lua_pushinteger(L, plr->bot);
|
||||
else if (fastcmp(field,"jointime"))
|
||||
|
@ -384,6 +392,8 @@ static int player_set(lua_State *L)
|
|||
else if (plr == &players[secondarydisplayplayer])
|
||||
localaiming2 = plr->aiming;
|
||||
}
|
||||
else if (fastcmp(field,"drawangle"))
|
||||
plr->drawangle = luaL_checkangle(L, 3);
|
||||
else if (fastcmp(field,"rings"))
|
||||
plr->rings = (INT32)luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"pity"))
|
||||
|
@ -435,6 +445,10 @@ static int player_set(lua_State *L)
|
|||
plr->spinitem = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"revitem"))
|
||||
plr->revitem = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"followitem"))
|
||||
plr->followitem = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"followmobj"))
|
||||
plr->followmobj = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ));
|
||||
else if (fastcmp(field,"actionspd"))
|
||||
plr->actionspd = (INT32)luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"mindash"))
|
||||
|
@ -597,6 +611,8 @@ static int player_set(lua_State *L)
|
|||
plr->awayviewaiming = luaL_checkangle(L, 3);
|
||||
else if (fastcmp(field,"spectator"))
|
||||
plr->spectator = lua_toboolean(L, 3);
|
||||
else if (fastcmp(field,"outofcoop"))
|
||||
plr->outofcoop = lua_toboolean(L, 3);
|
||||
else if (fastcmp(field,"bot"))
|
||||
return NOSET;
|
||||
else if (fastcmp(field,"jointime"))
|
||||
|
|
|
@ -161,6 +161,11 @@ void LUA_ClearExtVars(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
// Use this variable to prevent certain functions from running
|
||||
// if they were not called on lump load
|
||||
// (i.e. they were called in hooks or coroutines etc)
|
||||
boolean lua_lumploading = false;
|
||||
|
||||
// Load a script from a MYFILE
|
||||
static inline void LUA_LoadFile(MYFILE *f, char *name)
|
||||
{
|
||||
|
@ -198,7 +203,9 @@ void LUA_LoadLump(UINT16 wad, UINT16 lump)
|
|||
name[strlen(wadfiles[wad]->filename)+9] = '\0';
|
||||
}
|
||||
|
||||
LUA_LoadFile(&f, name);
|
||||
lua_lumploading = true; // turn on loading flag
|
||||
LUA_LoadFile(&f, name); // actually load file!
|
||||
lua_lumploading = false; // turn off again
|
||||
|
||||
free(name);
|
||||
Z_Free(f.data);
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
void LUA_ClearExtVars(void);
|
||||
#endif
|
||||
|
||||
extern boolean lua_lumploading; // is LUA_LoadLump being called?
|
||||
|
||||
void LUA_LoadLump(UINT16 wad, UINT16 lump);
|
||||
#ifdef LUA_ALLOW_BYTECODE
|
||||
void LUA_DumpFile(const char *filename);
|
||||
|
|
|
@ -35,6 +35,7 @@ enum skin {
|
|||
skin_thokitem,
|
||||
skin_spinitem,
|
||||
skin_revitem,
|
||||
skin_followitem,
|
||||
skin_actionspd,
|
||||
skin_mindash,
|
||||
skin_maxdash,
|
||||
|
@ -73,6 +74,7 @@ static const char *const skin_opt[] = {
|
|||
"thokitem",
|
||||
"spinitem",
|
||||
"revitem",
|
||||
"followitem",
|
||||
"actionspd",
|
||||
"mindash",
|
||||
"maxdash",
|
||||
|
@ -162,6 +164,9 @@ static int skin_get(lua_State *L)
|
|||
case skin_revitem:
|
||||
lua_pushinteger(L, skin->revitem);
|
||||
break;
|
||||
case skin_followitem:
|
||||
lua_pushinteger(L, skin->followitem);
|
||||
break;
|
||||
case skin_actionspd:
|
||||
lua_pushfixed(L, skin->actionspd);
|
||||
break;
|
||||
|
|
|
@ -119,9 +119,7 @@
|
|||
/*****************************************************************************/
|
||||
/* nothing should be changed below */
|
||||
|
||||
#ifndef _NDS
|
||||
typedef unsigned char u8;
|
||||
#endif
|
||||
|
||||
typedef const u8 *LZF_STATE[1 << (HLOG)];
|
||||
|
||||
|
@ -159,7 +157,7 @@ typedef const u8 *LZF_STATE[1 << (HLOG)];
|
|||
* lzfP.h ends here. lzf_d.c follows.
|
||||
*/
|
||||
|
||||
#if AVOID_ERRNO || defined(_WIN32_WCE)
|
||||
#if AVOID_ERRNO
|
||||
# define SET_ERRNO(n)
|
||||
#else
|
||||
# include <errno.h>
|
||||
|
|
|
@ -123,12 +123,7 @@ void M_PushSpecialParameters(void)
|
|||
}
|
||||
|
||||
/// \brief max args
|
||||
|
||||
#if defined (_arch_dreamcast) || defined (_XBOX) || defined (_WII)
|
||||
#define MAXARGVS 1
|
||||
#else
|
||||
#define MAXARGVS 256
|
||||
#endif
|
||||
|
||||
/** \brief the M_FindResponseFile function
|
||||
Find a response file
|
||||
|
|
|
@ -61,7 +61,7 @@ static UINT8 cheatf_ultimate(void)
|
|||
if (menuactive && (currentMenu != &MainDef && currentMenu != &SP_LoadDef))
|
||||
return 0; // Only on the main menu, or the save select!
|
||||
|
||||
S_StartSound(0, sfx_itemup);
|
||||
BwehHehHe();
|
||||
ultimate_selectable = (!ultimate_selectable);
|
||||
|
||||
// If on the save select, move to what is now Ultimate Mode!
|
||||
|
@ -1093,7 +1093,7 @@ void OP_ObjectplaceMovement(player_t *player)
|
|||
ticcmd_t *cmd = &player->cmd;
|
||||
|
||||
if (!player->climbing && (netgame || !cv_analog.value || (player->pflags & PF_SPINNING)))
|
||||
player->mo->angle = (cmd->angleturn<<16 /* not FRACBITS */);
|
||||
player->drawangle = player->mo->angle = (cmd->angleturn<<16 /* not FRACBITS */);
|
||||
|
||||
ticruned++;
|
||||
if (!(cmd->angleturn & TICCMD_RECEIVED))
|
||||
|
@ -1255,7 +1255,7 @@ void Command_ObjectPlace_f(void)
|
|||
{
|
||||
objectplacing = true;
|
||||
|
||||
if ((players[0].powers[pw_carry] == CR_NIGHTSMODE))
|
||||
if (players[0].powers[pw_carry] == CR_NIGHTSMODE)
|
||||
return;
|
||||
|
||||
if (!COM_CheckParm("-silent"))
|
||||
|
|
20
src/m_cond.c
20
src/m_cond.c
|
@ -499,63 +499,63 @@ emblem_t emblemlocations[MAXEMBLEMS] =
|
|||
// FLORAL FIELD
|
||||
// ---
|
||||
{0, 5394, -996, 160, 50, 'N', SKINCOLOR_RUST, 0, "", 0},
|
||||
{ET_NGRADE, 0,0,0, 50, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0},
|
||||
{ET_NGRADE, 0,0,0, 50, 'Q', SKINCOLOR_CYAN, GRADE_A, "", 0},
|
||||
{ET_NTIME, 0,0,0, 50, 'T', SKINCOLOR_GREY, 40*TICRATE, "", 0},
|
||||
|
||||
|
||||
// TOXIC PLATEAU
|
||||
// ---
|
||||
{0, 780, -1664, 32, 51, 'N', SKINCOLOR_RUST, 0, "", 0},
|
||||
{ET_NGRADE, 0,0,0, 51, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0},
|
||||
{ET_NGRADE, 0,0,0, 51, 'Q', SKINCOLOR_CYAN, GRADE_A, "", 0},
|
||||
{ET_NTIME, 0,0,0, 51, 'T', SKINCOLOR_GREY, 50*TICRATE, "", 0},
|
||||
|
||||
|
||||
// FLOODED COVE
|
||||
// ---
|
||||
{0, 1824, -1888, 2448, 52, 'N', SKINCOLOR_RUST, 0, "", 0},
|
||||
{ET_NGRADE, 0,0,0, 52, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0},
|
||||
{ET_NGRADE, 0,0,0, 52, 'Q', SKINCOLOR_CYAN, GRADE_A, "", 0},
|
||||
{ET_NTIME, 0,0,0, 52, 'T', SKINCOLOR_GREY, 90*TICRATE, "", 0},
|
||||
|
||||
|
||||
// CAVERN FORTRESS
|
||||
// ---
|
||||
{0, -3089, -431, 1328, 53, 'N', SKINCOLOR_RUST, 0, "", 0},
|
||||
{ET_NGRADE, 0,0,0, 53, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0},
|
||||
{ET_NGRADE, 0,0,0, 53, 'Q', SKINCOLOR_CYAN, GRADE_A, "", 0},
|
||||
{ET_NTIME, 0,0,0, 53, 'T', SKINCOLOR_GREY, 75*TICRATE, "", 0},
|
||||
|
||||
|
||||
// DUSTY WASTELAND
|
||||
// ---
|
||||
{0, 957, 924, 2956, 54, 'N', SKINCOLOR_RUST, 0, "", 0},
|
||||
{ET_NGRADE, 0,0,0, 54, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0},
|
||||
{ET_NGRADE, 0,0,0, 54, 'Q', SKINCOLOR_CYAN, GRADE_A, "", 0},
|
||||
{ET_NTIME, 0,0,0, 54, 'T', SKINCOLOR_GREY, 65*TICRATE, "", 0},
|
||||
|
||||
|
||||
// MAGMA CAVES
|
||||
// ---
|
||||
{0, -2752, 3104, 1800, 55, 'N', SKINCOLOR_RUST, 0, "", 0},
|
||||
{ET_NGRADE, 0,0,0, 55, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0},
|
||||
{ET_NGRADE, 0,0,0, 55, 'Q', SKINCOLOR_CYAN, GRADE_A, "", 0},
|
||||
{ET_NTIME, 0,0,0, 55, 'T', SKINCOLOR_GREY, 80*TICRATE, "", 0},
|
||||
|
||||
|
||||
// EGG SATELLITE
|
||||
// ---
|
||||
{0, 5334, -609, 3426, 56, 'N', SKINCOLOR_RUST, 0, "", 0},
|
||||
{ET_NGRADE, 0,0,0, 56, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0},
|
||||
{ET_NGRADE, 0,0,0, 56, 'Q', SKINCOLOR_CYAN, GRADE_A, "", 0},
|
||||
{ET_NTIME, 0,0,0, 56, 'T', SKINCOLOR_GREY, 120*TICRATE, "", 0},
|
||||
|
||||
|
||||
// BLACK HOLE
|
||||
// ---
|
||||
{0, 2108, 3776, 32, 57, 'N', SKINCOLOR_RUST, 0, "", 0},
|
||||
{ET_NGRADE, 0,0,0, 57, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0},
|
||||
{ET_NGRADE, 0,0,0, 57, 'Q', SKINCOLOR_CYAN, GRADE_A, "", 0},
|
||||
{ET_NTIME, 0,0,0, 57, 'T', SKINCOLOR_GREY, 150*TICRATE, "", 0},
|
||||
|
||||
|
||||
// SPRING HILL
|
||||
// ---
|
||||
{0, -1840, -1024, 1644, 58, 'N', SKINCOLOR_RUST, 0, "", 0},
|
||||
{ET_NGRADE, 0,0,0, 58, 'Q', SKINCOLOR_TEAL, GRADE_A, "", 0},
|
||||
{ET_NGRADE, 0,0,0, 58, 'Q', SKINCOLOR_CYAN, GRADE_A, "", 0},
|
||||
{ET_NTIME, 0,0,0, 58, 'T', SKINCOLOR_GREY, 60*TICRATE, "", 0},
|
||||
};
|
||||
|
||||
|
@ -566,7 +566,7 @@ extraemblem_t extraemblems[MAXEXTRAEMBLEMS] =
|
|||
{"All Emeralds", "Complete 1P Mode with all Emeralds", 11, 'V', SKINCOLOR_GREY, 0},
|
||||
{"Perfect Bonus", "Perfect Bonus on a non-secret stage", 30, 'P', SKINCOLOR_GOLD, 0},
|
||||
{"PLACEHOLDER", "PLACEHOLDER", 0, 'O', SKINCOLOR_RUST, 0},
|
||||
{"NiGHTS Mastery", "Show your mastery of NiGHTS!", 22, 'W', SKINCOLOR_TEAL, 0},
|
||||
{"NiGHTS Mastery", "Show your mastery of NiGHTS!", 22, 'W', SKINCOLOR_CYAN, 0},
|
||||
};
|
||||
|
||||
// Default Unlockables
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue