mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'yet-another-next-merge' into 'master'
I merged srb2 next again because of a dumb compile warning See merge request KartKrew/Kart!410
This commit is contained in:
commit
69eb874a9e
64 changed files with 611 additions and 292 deletions
2
dep/.gitignore
vendored
Normal file
2
dep/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
#All folders
|
||||
*.d
|
||||
2
dep/FreeBSD/SDL/Debug/.gitignore
vendored
Normal file
2
dep/FreeBSD/SDL/Debug/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
2
dep/FreeBSD/SDL/Release/.gitignore
vendored
Normal file
2
dep/FreeBSD/SDL/Release/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
2
dep/Linux/SDL/Debug/.gitignore
vendored
Normal file
2
dep/Linux/SDL/Debug/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
2
dep/Linux/SDL/Release/.gitignore
vendored
Normal file
2
dep/Linux/SDL/Release/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
2
dep/Linux64/SDL/Debug/.gitignore
vendored
Normal file
2
dep/Linux64/SDL/Debug/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
2
dep/Linux64/SDL/Release/.gitignore
vendored
Normal file
2
dep/Linux64/SDL/Release/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
2
dep/MasterClient/.gitignore
vendored
Normal file
2
dep/MasterClient/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
2
dep/MasterServer/.gitignore
vendored
Normal file
2
dep/MasterServer/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
2
dep/Mingw/Debug/.gitignore
vendored
Normal file
2
dep/Mingw/Debug/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
2
dep/Mingw/Release/.gitignore
vendored
Normal file
2
dep/Mingw/Release/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
2
dep/Mingw/SDL/Debug/.gitignore
vendored
Normal file
2
dep/Mingw/SDL/Debug/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
2
dep/Mingw/SDL/Release/.gitignore
vendored
Normal file
2
dep/Mingw/SDL/Release/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
2
dep/Mingw64/Debug/.gitignore
vendored
Normal file
2
dep/Mingw64/Debug/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
2
dep/Mingw64/Release/.gitignore
vendored
Normal file
2
dep/Mingw64/Release/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
2
dep/Mingw64/SDL/Debug/.gitignore
vendored
Normal file
2
dep/Mingw64/SDL/Debug/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
2
dep/Mingw64/SDL/Release/.gitignore
vendored
Normal file
2
dep/Mingw64/SDL/Release/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
2
dep/SDL/Release/.gitignore
vendored
Normal file
2
dep/SDL/Release/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
2
dep/VC/.gitignore
vendored
Normal file
2
dep/VC/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
2
dep/VC9/.gitignore
vendored
Normal file
2
dep/VC9/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
2
dep/cygwin/Debug/.gitignore
vendored
Normal file
2
dep/cygwin/Debug/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
2
dep/cygwin/Release/.gitignore
vendored
Normal file
2
dep/cygwin/Release/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
2
dep/dummy/.gitignore
vendored
Normal file
2
dep/dummy/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
|
|
@ -3044,4 +3044,4 @@ waypoints
|
|||
type = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
109
src/Makefile
109
src/Makefile
|
|
@ -2,7 +2,7 @@
|
|||
# GNU Make makefile for SRB2
|
||||
#############################################################################
|
||||
# Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
# Copyright (C) 2003-2020 by Sonic Team Junior.
|
||||
# Copyright (C) 2003-2021 by Sonic Team Junior.
|
||||
#
|
||||
# This program is free software distributed under the
|
||||
# terms of the GNU General Public License, version 2.
|
||||
|
|
@ -24,7 +24,9 @@
|
|||
# clean
|
||||
# Remove all object files
|
||||
# cleandep
|
||||
# Remove depend.dep
|
||||
# Remove dependency files
|
||||
# distclean
|
||||
# Remove autogenerated files
|
||||
# dll
|
||||
# compile primary HW render DLL/SO
|
||||
# all_dll
|
||||
|
|
@ -80,6 +82,17 @@
|
|||
#
|
||||
#############################################################################
|
||||
|
||||
,=,
|
||||
|
||||
ifeq (,$(filter-out cleandep clean distclean,$(or $(MAKECMDGOALS),all)))
|
||||
CLEANONLY=1
|
||||
else ifndef SILENT
|
||||
echo=@echo "$(1)"
|
||||
ifndef MAKE_RESTARTS
|
||||
print=$(info $(1))
|
||||
endif
|
||||
endif
|
||||
|
||||
ALL_SYSTEMS=\
|
||||
PANDORA\
|
||||
LINUX64\
|
||||
|
|
@ -99,7 +112,7 @@ ALL_SYSTEMS=\
|
|||
ifeq (,$(filter $(ALL_SYSTEMS),$(.VARIABLES)))
|
||||
ifeq ($(OS),Windows_NT) # all windows are Windows_NT...
|
||||
|
||||
$(info Detected a Windows system, compiling for 32-bit MinGW SDL2...)
|
||||
$(call print,Detected a Windows system$(,) compiling for 32-bit MinGW SDL2...)
|
||||
|
||||
# go for a 32-bit sdl mingw exe by default
|
||||
MINGW=1
|
||||
|
|
@ -124,7 +137,7 @@ else # if you on the *nix
|
|||
new_system:=$(new_system)64
|
||||
endif
|
||||
|
||||
$(info Detected $(system) ($(new_system))...)
|
||||
$(call print,Detected $(system) ($(new_system))...)
|
||||
$(new_system)=1
|
||||
|
||||
endif
|
||||
|
|
@ -242,6 +255,12 @@ endif
|
|||
|
||||
MSGFMT?=msgfmt
|
||||
|
||||
ifdef WINDOWSHELL
|
||||
COMPTIME=-..\comptime.bat
|
||||
else
|
||||
COMPTIME=-../comptime.sh
|
||||
endif
|
||||
|
||||
ifndef ECHO
|
||||
NASM:=@$(NASM)
|
||||
REMOVE:=@$(REMOVE)
|
||||
|
|
@ -256,6 +275,7 @@ ifndef ECHO
|
|||
MSGFMT:=@$(MSGFMT)
|
||||
UPX:=@$(UPX)
|
||||
UPX_OPTS+=-q
|
||||
COMPTIME:=@$(COMPTIME)
|
||||
endif
|
||||
|
||||
ifdef NONET
|
||||
|
|
@ -475,7 +495,6 @@ DBGNAME?=$(EXENAME).debug
|
|||
# not too sophisticated dependency
|
||||
# SRB2kart kart.o on line 433 below
|
||||
OBJS:=$(i_main_o) \
|
||||
$(OBJDIR)/comptime.o \
|
||||
$(OBJDIR)/string.o \
|
||||
$(OBJDIR)/d_main.o \
|
||||
$(OBJDIR)/d_clisrv.o \
|
||||
|
|
@ -579,7 +598,10 @@ OBJS:=$(i_main_o) \
|
|||
$(i_sound_o) \
|
||||
$(OBJS)
|
||||
|
||||
DEPS:=$(patsubst $(OBJDIR)/%.o,$(DEPDIR)/%.d,$(filter %.o,$(OBJS)))
|
||||
OBJS+=$(OBJDIR)/comptime.o
|
||||
|
||||
ifndef SILENT
|
||||
ifndef ECHO
|
||||
ifndef NOECHOFILENAMES
|
||||
define echoName =
|
||||
|
|
@ -587,6 +609,7 @@ define echoName =
|
|||
endef
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# List of languages to compile.
|
||||
# For reference, this is the command I use to build a srb2.pot file from the source code.
|
||||
|
|
@ -599,12 +622,12 @@ OPTS+=-DGETTEXT
|
|||
endif
|
||||
|
||||
ifdef PANDORA
|
||||
all: pre-build $(BIN)/$(PNDNAME)
|
||||
all: $(BIN)/$(PNDNAME)
|
||||
endif
|
||||
|
||||
|
||||
ifdef SDL
|
||||
all: pre-build $(BIN)/$(EXENAME)
|
||||
all: $(BIN)/$(EXENAME)
|
||||
endif
|
||||
|
||||
ifdef DUMMY
|
||||
|
|
@ -612,20 +635,15 @@ all: $(BIN)/$(EXENAME)
|
|||
endif
|
||||
|
||||
cleandep:
|
||||
$(REMOVE) $(OBJDIR)/depend.dep
|
||||
$(REMOVE) $(DEPS)
|
||||
$(REMOVE) comptime.h
|
||||
|
||||
pre-build:
|
||||
ifdef WINDOWSHELL
|
||||
-..\comptime.bat .
|
||||
else
|
||||
-@../comptime.sh .
|
||||
endif
|
||||
|
||||
clean:
|
||||
$(REMOVE) *~ *.flc
|
||||
$(REMOVE) $(OBJDIR)/*.o
|
||||
|
||||
distclean: clean cleandep
|
||||
|
||||
ifdef MINGW
|
||||
$(REMOVE) $(OBJDIR)/*.res
|
||||
endif
|
||||
|
|
@ -645,11 +663,11 @@ asm:
|
|||
|
||||
$(BIN)/$(EXENAME): $(POS) $(OBJS)
|
||||
-$(MKDIR) $(BIN)
|
||||
@echo Linking $(EXENAME)...
|
||||
$(call echo,Linking $(EXENAME)...)
|
||||
$(LD) $(LDFLAGS) $(OBJS) -o $(BIN)/$(EXENAME) $(LIBS)
|
||||
ifndef VALGRIND
|
||||
ifndef NOOBJDUMP
|
||||
@echo Dumping debugging info
|
||||
$(call echo,Dumping debugging info)
|
||||
$(OBJDUMP) $(OBJDUMP_OPTS) $(BIN)/$(EXENAME) > $(BIN)/$(DBGNAME).txt
|
||||
ifdef WINDOWSHELL
|
||||
-$(GZIP) $(GZIP_OPTS) $(BIN)/$(DBGNAME).txt
|
||||
|
|
@ -668,10 +686,10 @@ ifndef NOUPX
|
|||
-$(UPX) $(UPX_OPTS) $(BIN)/$(EXENAME)
|
||||
endif
|
||||
endif
|
||||
@echo Build is done, please look for $(EXENAME) in $(BIN), \(checking for post steps\)
|
||||
$(call echo,Build is done$(,) please look for $(EXENAME) in $(BIN)$(,) (checking for post steps))
|
||||
|
||||
reobjdump:
|
||||
@echo Redumping debugging info
|
||||
$(call echo,Redumping debugging info)
|
||||
$(OBJDUMP) $(OBJDUMP_OPTS) $(BIN)/$(DBGNAME) > $(BIN)/$(DBGNAME).txt
|
||||
ifdef WINDOWSHELL
|
||||
-$(GZIP) $(GZIP_OPTS) $(BIN)/$(DBGNAME).txt
|
||||
|
|
@ -707,24 +725,40 @@ endif
|
|||
endif
|
||||
|
||||
#dependecy made by gcc itself !
|
||||
$(OBJS):
|
||||
ifndef DUMMY
|
||||
-include $(OBJDIR)/depend.dep
|
||||
ifndef CLEANONLY
|
||||
$(call print,Checking dependency files...)
|
||||
-include $(DEPS)
|
||||
endif
|
||||
endif
|
||||
|
||||
$(OBJDIR)/depend.dep:
|
||||
@echo "Creating dependency file, depend.dep"
|
||||
@echo > comptime.h
|
||||
-$(MKDIR) $(OBJDIR)
|
||||
$(CC) $(CFLAGS) -MM *.c > $(OBJDIR)/depend.ped
|
||||
$(CC) $(CFLAGS) -MM $(INTERFACE)/*.c >> $(OBJDIR)/depend.ped
|
||||
ifndef NOHW
|
||||
$(CC) $(CFLAGS) -MM hardware/*.c >> $(OBJDIR)/depend.ped
|
||||
undefine deps_rule
|
||||
|
||||
# windows makes it too hard !
|
||||
ifndef WINDOWSHELL
|
||||
ifdef echoName
|
||||
define deps_rule =
|
||||
@printf "%-20.20s\r" $<
|
||||
|
||||
endef
|
||||
endif
|
||||
$(CC) $(CFLAGS) -MM blua/*.c >> $(OBJDIR)/depend.ped
|
||||
@sed -e 's,\(.*\)\.o: ,$(subst /,\/,$(OBJDIR))\/&,g' < $(OBJDIR)/depend.ped > $(OBJDIR)/depend.dep
|
||||
$(REMOVE) $(OBJDIR)/depend.ped
|
||||
@echo "Created dependency file, depend.dep"
|
||||
endif
|
||||
|
||||
define deps_rule +=
|
||||
$(CC) $(CFLAGS) -M -MF $@ -MT $(OBJDIR)/$(<:.c=.o) $<
|
||||
endef
|
||||
|
||||
$(DEPDIR)/%.d: %.c
|
||||
$(deps_rule)
|
||||
|
||||
$(DEPDIR)/%.d: $(INTERFACE)/%.c
|
||||
$(deps_rule)
|
||||
|
||||
$(DEPDIR)/%.d: hardware/%.c
|
||||
$(deps_rule)
|
||||
|
||||
$(DEPDIR)/%.d: blua/%.c
|
||||
$(deps_rule)
|
||||
|
||||
ifdef VALGRIND
|
||||
$(OBJDIR)/z_zone.o: z_zone.c
|
||||
|
|
@ -732,9 +766,12 @@ $(OBJDIR)/z_zone.o: z_zone.c
|
|||
$(CC) $(CFLAGS) $(WFLAGS) -DHAVE_VALGRIND $(VALGRIND_CFLAGS) -c $< -o $@
|
||||
endif
|
||||
|
||||
$(OBJDIR)/comptime.o: comptime.c pre-build
|
||||
$(echoName)
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
|
||||
$(OBJDIR)/comptime.o::
|
||||
ifdef echoName
|
||||
@echo -- comptime.c ...
|
||||
endif
|
||||
$(COMPTIME) .
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c comptime.c -o $@
|
||||
|
||||
$(BIN)/%.mo: locale/%.po
|
||||
-$(MKDIR) $(BIN)
|
||||
|
|
|
|||
|
|
@ -47,7 +47,8 @@ ifdef MACOSX
|
|||
endif
|
||||
|
||||
# Automatically set version flag, but not if one was manually set
|
||||
ifeq (,$(filter GCC%,$(.VARIABLES)))
|
||||
# And don't bother if this is a clean only run
|
||||
ifeq (,$(filter GCC% CLEANONLY,$(.VARIABLES)))
|
||||
version:=$(shell $(CC) --version)
|
||||
# check if this is in fact GCC
|
||||
ifneq (,$(or $(findstring gcc,$(version)),$(findstring GCC,$(version))))
|
||||
|
|
@ -60,12 +61,14 @@ ifeq (,$(filter GCC%,$(.VARIABLES)))
|
|||
|
||||
# If this version is not in the list, default to the latest supported
|
||||
ifeq (,$(filter $(v),$(SUPPORTED_GCC_VERSIONS)))
|
||||
$(info\
|
||||
Your compiler version, GCC $(version), is not supported by the Makefile.\
|
||||
The Makefile will assume GCC $(LATEST_GCC_VERSION).)
|
||||
define line =
|
||||
Your compiler version, GCC $(version), is not supported by the Makefile.
|
||||
The Makefile will assume GCC $(LATEST_GCC_VERSION).))
|
||||
endef
|
||||
$(call print,$(line))
|
||||
GCC$(subst .,,$(LATEST_GCC_VERSION))=1
|
||||
else
|
||||
$(info Detected GCC $(version) (GCC$(v)))
|
||||
$(call print,Detected GCC $(version) (GCC$(v)))
|
||||
GCC$(v)=1
|
||||
endif
|
||||
endif
|
||||
|
|
@ -365,6 +368,7 @@ i_main_o=$(OBJDIR)/i_main.o
|
|||
#set OBJDIR and BIN's starting place
|
||||
OBJDIR=../objs
|
||||
BIN=../bin
|
||||
DEPDIR=../dep
|
||||
#Nasm ASM and rm
|
||||
ifdef YASM
|
||||
NASM?=yasm
|
||||
|
|
@ -387,6 +391,7 @@ ifdef DUMMY
|
|||
INTERFACE=dummy
|
||||
OBJDIR:=$(OBJDIR)/dummy
|
||||
BIN:=$(BIN)/dummy
|
||||
DEPDIR:=$(DEPDIR)/dummy
|
||||
else
|
||||
ifdef LINUX
|
||||
NASMFORMAT=elf -DLINUX
|
||||
|
|
@ -394,9 +399,11 @@ ifdef LINUX
|
|||
ifdef LINUX64
|
||||
OBJDIR:=$(OBJDIR)/Linux64
|
||||
BIN:=$(BIN)/Linux64
|
||||
DEPDIR:=$(DEPDIR)/Linux64
|
||||
else
|
||||
OBJDIR:=$(OBJDIR)/Linux
|
||||
BIN:=$(BIN)/Linux
|
||||
DEPDIR:=$(DEPDIR)/Linux
|
||||
endif
|
||||
else
|
||||
ifdef FREEBSD
|
||||
|
|
@ -406,6 +413,7 @@ ifdef FREEBSD
|
|||
|
||||
OBJDIR:=$(OBJDIR)/FreeBSD
|
||||
BIN:=$(BIN)/FreeBSD
|
||||
DEPDIR:=$(DEPDIR)/Linux
|
||||
else
|
||||
ifdef SOLARIS
|
||||
INTERFACE=sdl
|
||||
|
|
@ -414,6 +422,7 @@ ifdef SOLARIS
|
|||
|
||||
OBJDIR:=$(OBJDIR)/Solaris
|
||||
BIN:=$(BIN)/Solaris
|
||||
DEPDIR:=$(DEPDIR)/Solaris
|
||||
else
|
||||
ifdef CYGWIN32
|
||||
INTERFACE=sdl
|
||||
|
|
@ -422,18 +431,21 @@ ifdef CYGWIN32
|
|||
|
||||
OBJDIR:=$(OBJDIR)/cygwin
|
||||
BIN:=$(BIN)/Cygwin
|
||||
DEPDIR:=$(DEPDIR)/Cygwin
|
||||
else
|
||||
ifdef MINGW64
|
||||
#NASMFORMAT=win64
|
||||
SDL=1
|
||||
OBJDIR:=$(OBJDIR)/Mingw64
|
||||
BIN:=$(BIN)/Mingw64
|
||||
DEPDIR:=$(DEPDIR)/Mingw64
|
||||
else
|
||||
ifdef MINGW
|
||||
NASMFORMAT=win32
|
||||
SDL=1
|
||||
OBJDIR:=$(OBJDIR)/Mingw
|
||||
BIN:=$(BIN)/Mingw
|
||||
DEPDIR:=$(DEPDIR)/Mingw
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
|
@ -445,6 +457,7 @@ endif
|
|||
ifdef ARCHNAME
|
||||
OBJDIR:=$(OBJDIR)/$(ARCHNAME)
|
||||
BIN:=$(BIN)/$(ARCHNAME)
|
||||
DEPDIR:=$(DEPDIR)/$(ARCHNAME)
|
||||
endif
|
||||
|
||||
OBJDUMP_OPTS?=--wide --source --line-numbers
|
||||
|
|
@ -453,14 +466,17 @@ LD=$(CC)
|
|||
ifdef SDL
|
||||
INTERFACE=sdl
|
||||
OBJDIR:=$(OBJDIR)/SDL
|
||||
DEPDIR:=$(DEPDIR)/SDL
|
||||
endif
|
||||
|
||||
ifndef DUMMY
|
||||
ifdef DEBUGMODE
|
||||
OBJDIR:=$(OBJDIR)/Debug
|
||||
BIN:=$(BIN)/Debug
|
||||
DEPDIR:=$(DEPDIR)/Debug
|
||||
else
|
||||
OBJDIR:=$(OBJDIR)/Release
|
||||
BIN:=$(BIN)/Release
|
||||
DEPDIR:=$(DEPDIR)/Release
|
||||
endif
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -1332,10 +1332,6 @@ boolean CON_Responder(event_t *ev)
|
|||
if (key < 32 || key > 127)
|
||||
return true;
|
||||
|
||||
// add key to cmd line here
|
||||
if (key >= 'A' && key <= 'Z' && !(shiftdown ^ capslock)) //this is only really necessary for dedicated servers
|
||||
key = key + 'a' - 'A';
|
||||
|
||||
if (input_sel != input_cur)
|
||||
CON_InputDelSelection();
|
||||
CON_InputAddChar(key);
|
||||
|
|
|
|||
|
|
@ -624,7 +624,7 @@ static void SV_PrepareSendLuaFileToNextNode(void)
|
|||
|
||||
// Find a client to send the file to
|
||||
for (i = 1; i < MAXNETNODES; i++)
|
||||
if (nodeingame[i] && luafiletransfers->nodestatus[i] == LFTNS_WAITING) // Node waiting
|
||||
if (luafiletransfers->nodestatus[i] == LFTNS_WAITING) // Node waiting
|
||||
{
|
||||
// Tell the client we're about to send them the file
|
||||
netbuffer->packettype = PT_SENDINGLUAFILE;
|
||||
|
|
@ -632,6 +632,7 @@ static void SV_PrepareSendLuaFileToNextNode(void)
|
|||
I_Error("Failed to send a PT_SENDINGLUAFILE packet\n"); // !!! Todo: Handle failure a bit better lol
|
||||
|
||||
luafiletransfers->nodestatus[i] = LFTNS_ASKED;
|
||||
luafiletransfers->nodetimeouts[i] = I_GetTime() + 30 * TICRATE;
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -650,7 +651,7 @@ void SV_PrepareSendLuaFile(void)
|
|||
|
||||
// Set status to "waiting" for everyone
|
||||
for (i = 0; i < MAXNETNODES; i++)
|
||||
luafiletransfers->nodestatus[i] = LFTNS_WAITING;
|
||||
luafiletransfers->nodestatus[i] = (nodeingame[i] ? LFTNS_WAITING : LFTNS_NONE);
|
||||
|
||||
if (FIL_ReadFileOK(luafiletransfers->realfilename))
|
||||
{
|
||||
|
|
@ -711,12 +712,14 @@ void RemoveAllLuaFileTransfers(void)
|
|||
|
||||
void SV_AbortLuaFileTransfer(INT32 node)
|
||||
{
|
||||
if (luafiletransfers
|
||||
&& (luafiletransfers->nodestatus[node] == LFTNS_ASKED
|
||||
|| luafiletransfers->nodestatus[node] == LFTNS_SENDING))
|
||||
if (luafiletransfers)
|
||||
{
|
||||
luafiletransfers->nodestatus[node] = LFTNS_WAITING;
|
||||
SV_PrepareSendLuaFileToNextNode();
|
||||
if (luafiletransfers->nodestatus[node] == LFTNS_ASKED
|
||||
|| luafiletransfers->nodestatus[node] == LFTNS_SENDING)
|
||||
{
|
||||
SV_PrepareSendLuaFileToNextNode();
|
||||
}
|
||||
luafiletransfers->nodestatus[node] = LFTNS_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -990,6 +993,22 @@ void FileSendTicker(void)
|
|||
filetx_t *f;
|
||||
INT32 packetsent, ram, i, j;
|
||||
|
||||
// If someone is taking too long to download, kick them with a timeout
|
||||
// to prevent blocking the rest of the server...
|
||||
if (luafiletransfers)
|
||||
{
|
||||
for (i = 1; i < MAXNETNODES; i++)
|
||||
{
|
||||
luafiletransfernodestatus_t status = luafiletransfers->nodestatus[i];
|
||||
|
||||
if (status != LFTNS_NONE && status != LFTNS_WAITING && status != LFTNS_SENT
|
||||
&& I_GetTime() > luafiletransfers->nodetimeouts[i])
|
||||
{
|
||||
Net_ConnectionTimeout(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!filestosend) // No file to send
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -107,10 +107,11 @@ boolean PT_RequestFile(INT32 node);
|
|||
|
||||
typedef enum
|
||||
{
|
||||
LFTNS_NONE, // This node is not connected
|
||||
LFTNS_WAITING, // This node is waiting for the server to send the file
|
||||
LFTNS_ASKED, // The server has told the node they're ready to send the file
|
||||
LFTNS_ASKED, // The server has told the node they're ready to send the file
|
||||
LFTNS_SENDING, // The server is sending the file to this node
|
||||
LFTNS_SENT // The node already has the file
|
||||
LFTNS_SENT // The node already has the file
|
||||
} luafiletransfernodestatus_t;
|
||||
|
||||
typedef struct luafiletransfer_s
|
||||
|
|
@ -121,6 +122,7 @@ typedef struct luafiletransfer_s
|
|||
INT32 id; // Callback ID
|
||||
boolean ongoing;
|
||||
luafiletransfernodestatus_t nodestatus[MAXNETNODES];
|
||||
tic_t nodetimeouts[MAXNETNODES];
|
||||
struct luafiletransfer_s *next;
|
||||
} luafiletransfer_t;
|
||||
|
||||
|
|
|
|||
|
|
@ -499,6 +499,8 @@ typedef struct player_s
|
|||
fixed_t bob;
|
||||
|
||||
angle_t viewrollangle;
|
||||
// camera tilt
|
||||
// TODO: expose to lua
|
||||
angle_t tilt;
|
||||
|
||||
angle_t angleturn;
|
||||
|
|
@ -527,6 +529,8 @@ typedef struct player_s
|
|||
tic_t airtime; // Keep track of how long you've been in the air
|
||||
boolean driftInput; // Whenever or not try drifting.
|
||||
boolean airFailsafe; // Whenever or not try the air boost
|
||||
INT32 aizDriftTilt;
|
||||
INT32 aizDriftTurn;
|
||||
|
||||
UINT8 trickpanel; // Trick panel state
|
||||
boolean trickdelay; // Prevent tricks until control stick is neutral
|
||||
|
|
|
|||
|
|
@ -301,7 +301,6 @@ extern struct quake
|
|||
{
|
||||
// camera offsets and duration
|
||||
fixed_t x,y,z;
|
||||
angle_t roll;
|
||||
UINT16 time;
|
||||
|
||||
// location, radius, and intensity...
|
||||
|
|
|
|||
|
|
@ -335,18 +335,9 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
|||
|
||||
if (!(option & V_SCALEPATCHMASK))
|
||||
{
|
||||
// if it's meant to cover the whole screen, black out the rest (ONLY IF TOP LEFT ISN'T TRANSPARENT)
|
||||
// cx and cy are possibly *slightly* off from float maths
|
||||
// This is done before here compared to software because we directly alter cx and cy to centre
|
||||
if (cx >= -0.1f && cx <= 0.1f && gpatch->width == BASEVIDWIDTH && cy >= -0.1f && cy <= 0.1f && gpatch->height == BASEVIDHEIGHT)
|
||||
{
|
||||
const column_t *column = (const column_t *)((const UINT8 *)(gpatch->columns) + (gpatch->columnofs[0]));
|
||||
if (!column->topdelta)
|
||||
{
|
||||
const UINT8 *source = (const UINT8 *)(column) + 3;
|
||||
HWR_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (column->topdelta == 0xff ? 31 : source[0]));
|
||||
}
|
||||
}
|
||||
// if it's meant to cover the whole screen, black out the rest
|
||||
// no the patch is cropped do not do this ever
|
||||
|
||||
// centre screen
|
||||
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dupx) > 1.0E-36f)
|
||||
{
|
||||
|
|
@ -368,11 +359,11 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
|||
fwidth = w;
|
||||
fheight = h;
|
||||
|
||||
if (fwidth > gpatch->width)
|
||||
fwidth = gpatch->width;
|
||||
if (sx + w > gpatch->width)
|
||||
fwidth = gpatch->width - sx;
|
||||
|
||||
if (fheight > gpatch->height)
|
||||
fheight = gpatch->height;
|
||||
if (sy + h > gpatch->height)
|
||||
fheight = gpatch->height - sy;
|
||||
|
||||
if (pscale != FRACUNIT)
|
||||
{
|
||||
|
|
@ -404,13 +395,13 @@ void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
|||
|
||||
v[0].s = v[3].s = ((sx)/(float)(gpatch->width))*hwrPatch->max_s;
|
||||
if (sx + w > gpatch->width)
|
||||
v[2].s = v[1].s = hwrPatch->max_s - ((sx+w)/(float)(gpatch->width))*hwrPatch->max_s;
|
||||
v[2].s = v[1].s = hwrPatch->max_s;
|
||||
else
|
||||
v[2].s = v[1].s = ((sx+w)/(float)(gpatch->width))*hwrPatch->max_s;
|
||||
|
||||
v[0].t = v[1].t = ((sy)/(float)(gpatch->height))*hwrPatch->max_t;
|
||||
if (sy + h > gpatch->height)
|
||||
v[2].t = v[3].t = hwrPatch->max_t - ((sy+h)/(float)(gpatch->height))*hwrPatch->max_t;
|
||||
v[2].t = v[3].t = hwrPatch->max_t;
|
||||
else
|
||||
v[2].t = v[3].t = ((sy+h)/(float)(gpatch->height))*hwrPatch->max_t;
|
||||
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ static void HWR_ProjectSprite(mobj_t *thing);
|
|||
#ifdef HWPRECIP
|
||||
static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing);
|
||||
#endif
|
||||
static void HWR_RollTransform(FTransform *tr, angle_t roll);
|
||||
|
||||
void HWR_AddTransparentFloor(levelflat_t *levelflat, extrasubsector_t *xsub, boolean isceiling, fixed_t fixedheight, INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, boolean fogplane, extracolormap_t *planecolormap);
|
||||
void HWR_AddTransparentPolyobjectFloor(levelflat_t *levelflat, polyobj_t *polysector, boolean isceiling, fixed_t fixedheight,
|
||||
|
|
@ -3742,7 +3743,7 @@ static void HWR_DrawDropShadow(mobj_t *thing, fixed_t scale)
|
|||
static void HWR_RotateSpritePolyToAim(gl_vissprite_t *spr, FOutVector *wallVerts, const boolean precip)
|
||||
{
|
||||
if (cv_glspritebillboarding.value
|
||||
&& spr && spr->mobj && !(spr->mobj->frame & FF_PAPERSPRITE)
|
||||
&& spr && spr->mobj && !R_ThingIsPaperSprite(spr->mobj)
|
||||
&& wallVerts)
|
||||
{
|
||||
float basey = FIXED_TO_FLOAT(spr->mobj->z);
|
||||
|
|
@ -3784,7 +3785,6 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
|
|||
FBITFIELD blend = 0;
|
||||
FBITFIELD occlusion;
|
||||
boolean use_linkdraw_hack = false;
|
||||
boolean splat = R_ThingIsFloorSprite(spr->mobj);
|
||||
UINT8 alpha;
|
||||
|
||||
INT32 i;
|
||||
|
|
@ -3843,22 +3843,19 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
|
|||
baseWallVerts[0].t = baseWallVerts[1].t = ((GLPatch_t *)gpatch->hardware)->max_t;
|
||||
}
|
||||
|
||||
if (!splat)
|
||||
{
|
||||
// if it has a dispoffset, push it a little towards the camera
|
||||
if (spr->dispoffset) {
|
||||
float co = -gl_viewcos*(0.05f*spr->dispoffset);
|
||||
float si = -gl_viewsin*(0.05f*spr->dispoffset);
|
||||
baseWallVerts[0].z = baseWallVerts[3].z = baseWallVerts[0].z+si;
|
||||
baseWallVerts[1].z = baseWallVerts[2].z = baseWallVerts[1].z+si;
|
||||
baseWallVerts[0].x = baseWallVerts[3].x = baseWallVerts[0].x+co;
|
||||
baseWallVerts[1].x = baseWallVerts[2].x = baseWallVerts[1].x+co;
|
||||
}
|
||||
|
||||
// Let dispoffset work first since this adjust each vertex
|
||||
HWR_RotateSpritePolyToAim(spr, baseWallVerts, false);
|
||||
// if it has a dispoffset, push it a little towards the camera
|
||||
if (spr->dispoffset) {
|
||||
float co = -gl_viewcos*(0.05f*spr->dispoffset);
|
||||
float si = -gl_viewsin*(0.05f*spr->dispoffset);
|
||||
baseWallVerts[0].z = baseWallVerts[3].z = baseWallVerts[0].z+si;
|
||||
baseWallVerts[1].z = baseWallVerts[2].z = baseWallVerts[1].z+si;
|
||||
baseWallVerts[0].x = baseWallVerts[3].x = baseWallVerts[0].x+co;
|
||||
baseWallVerts[1].x = baseWallVerts[2].x = baseWallVerts[1].x+co;
|
||||
}
|
||||
|
||||
// Let dispoffset work first since this adjust each vertex
|
||||
HWR_RotateSpritePolyToAim(spr, baseWallVerts, false);
|
||||
|
||||
realtop = top = baseWallVerts[3].y;
|
||||
realbot = bot = baseWallVerts[0].y;
|
||||
ttop = baseWallVerts[3].t;
|
||||
|
|
@ -3994,7 +3991,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
|
|||
|
||||
// The x and y only need to be adjusted in the case that it's not a papersprite
|
||||
if (cv_glspritebillboarding.value
|
||||
&& spr->mobj && !(spr->mobj->frame & FF_PAPERSPRITE))
|
||||
&& spr->mobj && !R_ThingIsPaperSprite(spr->mobj))
|
||||
{
|
||||
// Get the x and z of the vertices so billboarding draws correctly
|
||||
realheight = realbot - realtop;
|
||||
|
|
@ -4063,7 +4060,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
|
|||
static void HWR_DrawSprite(gl_vissprite_t *spr)
|
||||
{
|
||||
FOutVector wallVerts[4];
|
||||
patch_t *gpatch; // sprite patch converted to hardware
|
||||
patch_t *gpatch;
|
||||
FSurfaceInfo Surf;
|
||||
const boolean splat = R_ThingIsFloorSprite(spr->mobj);
|
||||
|
||||
|
|
@ -4367,7 +4364,7 @@ static inline void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr)
|
|||
{
|
||||
FBITFIELD blend = 0;
|
||||
FOutVector wallVerts[4];
|
||||
patch_t *gpatch; // sprite patch converted to hardware
|
||||
patch_t *gpatch;
|
||||
FSurfaceInfo Surf;
|
||||
|
||||
if (!spr->mobj)
|
||||
|
|
@ -4420,14 +4417,16 @@ static inline void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr)
|
|||
// Always use the light at the top instead of whatever I was doing before
|
||||
INT32 light = R_GetPlaneLight(sector, spr->mobj->z + spr->mobj->height, false);
|
||||
|
||||
lightlevel = *sector->lightlist[light].lightlevel;
|
||||
if (!R_ThingIsFullBright(spr->mobj))
|
||||
lightlevel = *sector->lightlist[light].lightlevel > 255 ? 255 : *sector->lightlist[light].lightlevel;
|
||||
|
||||
if (*sector->lightlist[light].extra_colormap)
|
||||
colormap = *sector->lightlist[light].extra_colormap;
|
||||
}
|
||||
else
|
||||
{
|
||||
lightlevel = sector->lightlevel;
|
||||
if (!R_ThingIsFullBright(spr->mobj))
|
||||
lightlevel = sector->lightlevel > 255 ? 255 : sector->lightlevel;
|
||||
|
||||
if (sector->extra_colormap)
|
||||
colormap = sector->extra_colormap;
|
||||
|
|
@ -5044,8 +5043,8 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
|
||||
angle_t ang;
|
||||
INT32 heightsec, phs;
|
||||
const boolean papersprite = R_ThingIsPaperSprite(thing);
|
||||
const boolean splat = R_ThingIsFloorSprite(thing);
|
||||
const boolean papersprite = (R_ThingIsPaperSprite(thing) && !splat);
|
||||
angle_t mobjangle = (thing->player ? thing->player->drawangle : thing->angle);
|
||||
float z1, z2;
|
||||
|
||||
|
|
@ -5207,7 +5206,8 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
if (spriterotangle != 0
|
||||
&& !(splat && !(thing->renderflags & RF_NOSPLATROLLANGLE)))
|
||||
{
|
||||
rollangle = R_GetRollAngle(spriterotangle);
|
||||
rollangle = R_GetRollAngle(vflip
|
||||
? InvAngle(spriterotangle) : spriterotangle);
|
||||
rotsprite = Patch_GetRotatedSprite(sprframe, (thing->frame & FF_FRAMEMASK), rot, flip, false, sprinfo, rollangle);
|
||||
|
||||
if (rotsprite != NULL)
|
||||
|
|
@ -5745,14 +5745,8 @@ static void HWR_DrawSkyBackground(player_t *player)
|
|||
dometransform.scalez = 1;
|
||||
dometransform.fovxangle = fpov; // Tails
|
||||
dometransform.fovyangle = fpov; // Tails
|
||||
if (player->viewrollangle != 0)
|
||||
{
|
||||
fixed_t rol = AngleFixed(player->viewrollangle);
|
||||
dometransform.rollangle = FIXED_TO_FLOAT(rol);
|
||||
dometransform.roll = true;
|
||||
dometransform.rollx = 1.0f;
|
||||
dometransform.rollz = 0.0f;
|
||||
}
|
||||
HWR_RollTransform(&dometransform,
|
||||
R_ViewRollAngle(player));
|
||||
dometransform.splitscreen = r_splitscreen;
|
||||
|
||||
HWR_GetTexture(texturetranslation[skytexture]);
|
||||
|
|
@ -6044,14 +6038,7 @@ void HWR_RenderSkyboxView(player_t *player)
|
|||
|
||||
atransform.fovxangle = fpov; // Tails
|
||||
atransform.fovyangle = fpov; // Tails
|
||||
if (player->viewrollangle != 0)
|
||||
{
|
||||
fixed_t rol = AngleFixed(player->viewrollangle);
|
||||
atransform.rollangle = FIXED_TO_FLOAT(rol);
|
||||
atransform.roll = true;
|
||||
atransform.rollx = 1.0f;
|
||||
atransform.rollz = 0.0f;
|
||||
}
|
||||
HWR_RollTransform(&atransform, R_ViewRollAngle(player));
|
||||
atransform.splitscreen = r_splitscreen;
|
||||
|
||||
gl_fovlud = (float)(1.0l/tan((double)(fpov*M_PIl/360l)));
|
||||
|
|
@ -6162,6 +6149,18 @@ void HWR_RenderSkyboxView(player_t *player)
|
|||
// ==========================================================================
|
||||
//
|
||||
// ==========================================================================
|
||||
|
||||
static void HWR_RollTransform(FTransform *tr, angle_t roll)
|
||||
{
|
||||
if (roll != 0)
|
||||
{
|
||||
tr->rollangle = roll / (float)ANG1;
|
||||
tr->roll = true;
|
||||
tr->rollx = 1.0f;
|
||||
tr->rollz = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void HWR_RenderPlayerView(void)
|
||||
{
|
||||
player_t * player = &players[displayplayers[viewssnum]];
|
||||
|
|
@ -6251,14 +6250,7 @@ void HWR_RenderPlayerView(void)
|
|||
|
||||
atransform.fovxangle = fpov; // Tails
|
||||
atransform.fovyangle = fpov; // Tails
|
||||
if (player->viewrollangle != 0)
|
||||
{
|
||||
fixed_t rol = AngleFixed(player->viewrollangle);
|
||||
atransform.rollangle = FIXED_TO_FLOAT(rol);
|
||||
atransform.roll = true;
|
||||
atransform.rollx = 1.0f;
|
||||
atransform.rollz = 0.0f;
|
||||
}
|
||||
HWR_RollTransform(&atransform, R_ViewRollAngle(player));
|
||||
atransform.splitscreen = r_splitscreen;
|
||||
|
||||
gl_fovlud = (float)(1.0l/tan((double)(fpov*M_PIl/360l)));
|
||||
|
|
|
|||
|
|
@ -1326,14 +1326,16 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|
|||
|
||||
light = R_GetPlaneLight(sector, spr->mobj->z + spr->mobj->height, false); // Always use the light at the top instead of whatever I was doing before
|
||||
|
||||
lightlevel = *sector->lightlist[light].lightlevel;
|
||||
if (!R_ThingIsFullBright(spr->mobj))
|
||||
lightlevel = *sector->lightlist[light].lightlevel > 255 ? 255 : *sector->lightlist[light].lightlevel;
|
||||
|
||||
if (*sector->lightlist[light].extra_colormap)
|
||||
colormap = *sector->lightlist[light].extra_colormap;
|
||||
}
|
||||
else
|
||||
{
|
||||
lightlevel = sector->lightlevel;
|
||||
if (!R_ThingIsFullBright(spr->mobj))
|
||||
lightlevel = sector->lightlevel > 255 ? 255 : sector->lightlevel;
|
||||
|
||||
if (sector->extra_colormap)
|
||||
colormap = sector->extra_colormap;
|
||||
|
|
@ -1356,10 +1358,9 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|
|||
GLPatch_t *hwrPatch = NULL, *hwrBlendPatch = NULL;
|
||||
INT32 durs = spr->mobj->state->tics;
|
||||
INT32 tics = spr->mobj->tics;
|
||||
//mdlframe_t *next = NULL;
|
||||
const boolean papersprite = (spr->mobj->frame & FF_PAPERSPRITE);
|
||||
const UINT8 flip = (UINT8)(!(spr->mobj->eflags & MFE_VERTICALFLIP) != !(spr->mobj->frame & FF_VERTICALFLIP));
|
||||
const UINT8 hflip = (UINT8)(!(spr->mobj->mirrored) != !(spr->mobj->frame & FF_HORIZONTALFLIP));
|
||||
const boolean papersprite = (R_ThingIsPaperSprite(spr->mobj) && !R_ThingIsFloorSprite(spr->mobj));
|
||||
const UINT8 flip = (UINT8)(!(spr->mobj->eflags & MFE_VERTICALFLIP) != !R_ThingVerticallyFlipped(spr->mobj));
|
||||
const UINT8 hflip = (UINT8)(!(spr->mobj->mirrored) != !R_ThingHorizontallyFlipped(spr->mobj));
|
||||
spritedef_t *sprdef;
|
||||
spriteframe_t *sprframe;
|
||||
INT32 mod;
|
||||
|
|
@ -1444,6 +1445,11 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|
|||
|| ((!hwrBlendPatch->mipmap->format || !hwrBlendPatch->mipmap->downloaded) && !md2->noblendfile)))
|
||||
md2_loadBlendTexture(md2);
|
||||
|
||||
// Load it again, because it isn't being loaded into blendgpatch after md2_loadblendtexture...
|
||||
blendgpatch = md2->blendgrpatch;
|
||||
if (blendgpatch)
|
||||
hwrBlendPatch = ((GLPatch_t *)blendgpatch->hardware);
|
||||
|
||||
if (md2->error)
|
||||
return false; // we already failed loading this before :(
|
||||
if (!md2->model)
|
||||
|
|
|
|||
|
|
@ -993,8 +993,6 @@ EXPORT boolean HWRAPI(CompileShaders) (void)
|
|||
}
|
||||
}
|
||||
|
||||
SetShader(SHADER_DEFAULT);
|
||||
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
|
|
|
|||
42
src/k_kart.c
42
src/k_kart.c
|
|
@ -1920,6 +1920,15 @@ void K_KartMoveAnimation(player_t *player)
|
|||
turndir = 1;
|
||||
}
|
||||
|
||||
// Use drift frames when sliptiding
|
||||
if (player->aizDriftTurn)
|
||||
{
|
||||
drift = (player->kartstuff[k_aizdriftstrat]);
|
||||
|
||||
if (drift)
|
||||
turndir = 0;
|
||||
}
|
||||
|
||||
if (lookback == true && drift == 0)
|
||||
{
|
||||
// Prioritize looking back frames over turning
|
||||
|
|
@ -7351,8 +7360,35 @@ static void K_KartDrift(player_t *player, boolean onground)
|
|||
player->kartstuff[k_aizdriftstrat] = ((player->kartstuff[k_drift] > 0) ? 1 : -1);
|
||||
}
|
||||
else if (player->kartstuff[k_aizdriftstrat] && !player->kartstuff[k_drift])
|
||||
{
|
||||
K_SpawnAIZDust(player);
|
||||
|
||||
if (abs(player->aizDriftTilt) < ANGLE_22h)
|
||||
{
|
||||
player->aizDriftTilt =
|
||||
(abs(player->aizDriftTilt) + ANGLE_11hh / 4) *
|
||||
player->kartstuff[k_aizdriftstrat];
|
||||
}
|
||||
|
||||
if (abs(player->aizDriftTurn) < ANGLE_112h)
|
||||
{
|
||||
player->aizDriftTurn =
|
||||
(abs(player->aizDriftTurn) + ANGLE_11hh) *
|
||||
player->kartstuff[k_aizdriftstrat];
|
||||
}
|
||||
}
|
||||
|
||||
if (!K_Sliptiding(player))
|
||||
{
|
||||
player->aizDriftTilt -= player->aizDriftTilt / 4;
|
||||
player->aizDriftTurn -= player->aizDriftTurn / 4;
|
||||
|
||||
if (abs(player->aizDriftTilt) < ANGLE_11hh / 4)
|
||||
player->aizDriftTilt = 0;
|
||||
if (abs(player->aizDriftTurn) < ANGLE_11hh)
|
||||
player->aizDriftTurn = 0;
|
||||
}
|
||||
|
||||
if (player->kartstuff[k_drift]
|
||||
&& ((buttons & BT_BRAKE)
|
||||
|| !(buttons & BT_ACCELERATE))
|
||||
|
|
@ -7539,6 +7575,12 @@ boolean K_PlayerEBrake(player_t *player)
|
|||
&& player->powers[pw_nocontrol] == 0;
|
||||
}
|
||||
|
||||
SINT8 K_Sliptiding(player_t *player)
|
||||
{
|
||||
const INT32 *p = player->kartstuff;
|
||||
return p[k_drift] ? 0 : p[k_aizdriftstrat];
|
||||
}
|
||||
|
||||
static void K_KartSpindashDust(mobj_t *parent)
|
||||
{
|
||||
fixed_t rad = FixedDiv(FixedHypot(parent->radius, parent->radius), parent->scale);
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ UINT16 K_GetKartButtons(player_t *player);
|
|||
SINT8 K_GetForwardMove(player_t *player);
|
||||
fixed_t K_3dKartMovement(player_t *player);
|
||||
boolean K_PlayerEBrake(player_t *player);
|
||||
SINT8 K_Sliptiding(player_t *player);
|
||||
void K_AdjustPlayerFriction(player_t *player);
|
||||
void K_MoveKartPlayer(player_t *player, boolean onground);
|
||||
void K_CheckSpectateStatus(void);
|
||||
|
|
|
|||
|
|
@ -585,7 +585,7 @@ static int sector_get(lua_State *L)
|
|||
lua_pushinteger(L, sector->special);
|
||||
return 1;
|
||||
case sector_tag:
|
||||
lua_pushinteger(L, Tag_FGet(§or->tags));
|
||||
lua_pushinteger(L, (UINT16)Tag_FGet(§or->tags));
|
||||
return 1;
|
||||
case sector_taglist:
|
||||
LUA_PushUserdata(L, §or->tags, META_SECTORTAGLIST);
|
||||
|
|
@ -830,6 +830,17 @@ static int line_get(lua_State *L)
|
|||
lua_pushinteger(L, line->special);
|
||||
return 1;
|
||||
case line_tag:
|
||||
// HELLO
|
||||
// THIS IS LJ SONIC
|
||||
// HOW IS YOUR DAY?
|
||||
// BY THE WAY WHEN 2.3 OR 3.0 OR 4.0 OR SRB3 OR SRB4 OR WHATEVER IS OUT
|
||||
// YOU SHOULD REMEMBER TO CHANGE THIS SO IT ALWAYS RETURNS A UNSIGNED VALUE
|
||||
// HAVE A NICE DAY
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// you are ugly
|
||||
lua_pushinteger(L, Tag_FGet(&line->tags));
|
||||
return 1;
|
||||
case line_taglist:
|
||||
|
|
|
|||
|
|
@ -165,7 +165,9 @@ consvar_t cv_zlib_window_bitsa = CVAR_INIT ("apng_window_size", "32k", CV_SAVE,
|
|||
consvar_t cv_apng_delay = CVAR_INIT ("apng_speed", "1x", CV_SAVE, apng_delay_t, NULL);
|
||||
consvar_t cv_apng_downscale = CVAR_INIT ("apng_downscale", "On", CV_SAVE, CV_OnOff, NULL);
|
||||
|
||||
#ifdef USE_APNG
|
||||
static boolean apng_downscale = false; // So nobody can do something dumb like changing cvars mid output
|
||||
#endif
|
||||
|
||||
boolean takescreenshot = false; // Take a screenshot this tic
|
||||
|
||||
|
|
|
|||
|
|
@ -1659,7 +1659,7 @@ void A_SnailerThink(mobj_t *actor)
|
|||
fixed_t dist;
|
||||
fixed_t dx, dy;
|
||||
|
||||
dist = R_PointToDist2(0, 0, actor->x - actor->target->x, actor->y - actor->target->y);
|
||||
dist = P_AproxDistance(actor->x - actor->target->x, actor->y - actor->target->y);
|
||||
|
||||
if (an > ANGLE_45 && an <= ANGLE_90) // fire at 45 degrees to the left
|
||||
{
|
||||
|
|
@ -8903,22 +8903,23 @@ void A_Custom3DRotate(mobj_t *actor)
|
|||
if (LUA_CallAction(A_CUSTOM3DROTATE, actor))
|
||||
return;
|
||||
|
||||
if (!actor->target) // Ensure we actually have a target first.
|
||||
{
|
||||
CONS_Printf("Error: A_Custom3DRotate: Object has no target.\n");
|
||||
P_RemoveMobj(actor);
|
||||
return;
|
||||
}
|
||||
|
||||
if (actor->target->health == 0)
|
||||
{
|
||||
P_RemoveMobj(actor);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!actor->target) // This should NEVER happen.
|
||||
{
|
||||
if (cv_debug)
|
||||
CONS_Printf("Error: Object has no target\n");
|
||||
P_RemoveMobj(actor);
|
||||
return;
|
||||
}
|
||||
if (hspeed==0 && vspeed==0)
|
||||
{
|
||||
CONS_Printf("Error: A_Custom3DRotate: Object has no speed.\n");
|
||||
if (cv_debug)
|
||||
CONS_Printf("Error: A_Custom3DRotate: Object has no speed.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -523,6 +523,7 @@ void P_Thrust(mobj_t *mo, angle_t angle, fixed_t move);
|
|||
void P_ExplodeMissile(mobj_t *mo);
|
||||
void P_CheckGravity(mobj_t *mo, boolean affect);
|
||||
void P_SetPitchRollFromSlope(mobj_t *mo, pslope_t *slope);
|
||||
void P_SetPitchRoll(mobj_t *mo, angle_t pitch, angle_t yaw);
|
||||
fixed_t P_ScaleFromMap(fixed_t n, fixed_t scale);
|
||||
fixed_t P_GetMobjHead(const mobj_t *);
|
||||
fixed_t P_GetMobjFeet(const mobj_t *);
|
||||
|
|
|
|||
15
src/p_mobj.c
15
src/p_mobj.c
|
|
@ -1250,6 +1250,17 @@ void P_SetPitchRollFromSlope(mobj_t *mo, pslope_t *slope)
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// P_SetPitchRoll
|
||||
//
|
||||
void P_SetPitchRoll(mobj_t *mo, angle_t pitch, angle_t yaw)
|
||||
{
|
||||
pitch = InvAngle(pitch);
|
||||
yaw >>= ANGLETOFINESHIFT;
|
||||
mo->roll = FixedMul(pitch, FINESINE (yaw));
|
||||
mo->pitch = FixedMul(pitch, FINECOSINE (yaw));
|
||||
}
|
||||
|
||||
#define STOPSPEED (FRACUNIT)
|
||||
|
||||
//
|
||||
|
|
@ -1662,6 +1673,10 @@ void P_XYMovement(mobj_t *mo)
|
|||
{
|
||||
mo->momz = transfermomz;
|
||||
mo->standingslope = NULL;
|
||||
P_SetPitchRoll(mo, ANGLE_90,
|
||||
transferslope->xydirection
|
||||
+ (transferslope->zangle
|
||||
& ANGLE_180));
|
||||
if (player)
|
||||
{
|
||||
player->powers[pw_justlaunched] = 2;
|
||||
|
|
|
|||
|
|
@ -4030,7 +4030,7 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
|
|||
|
||||
#ifdef HWRENDER
|
||||
// Free GPU textures before freeing patches.
|
||||
if (vid.glstate == VID_GL_LIBRARY_LOADED)
|
||||
if (rendermode == render_opengl && (vid.glstate == VID_GL_LIBRARY_LOADED))
|
||||
HWR_ClearAllTextures();
|
||||
#endif
|
||||
|
||||
|
|
@ -4457,7 +4457,7 @@ boolean P_AddWadFile(const char *wadfilename)
|
|||
|
||||
#ifdef HWRENDER
|
||||
// Free GPU textures before freeing patches.
|
||||
if (vid.glstate == VID_GL_LIBRARY_LOADED)
|
||||
if (rendermode == render_opengl && (vid.glstate == VID_GL_LIBRARY_LOADED))
|
||||
HWR_ClearAllTextures();
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -657,17 +657,10 @@ void P_Ticker(boolean run)
|
|||
quake.z = M_RandomRange(-ir,ir);
|
||||
if (cv_windowquake.value)
|
||||
I_CursedWindowMovement(FixedInt(quake.x), FixedInt(quake.y));
|
||||
ir >>= 2;
|
||||
ir = M_RandomRange(-ir,ir);
|
||||
if (ir < 0)
|
||||
ir = ANGLE_MAX - FixedAngle(-ir);
|
||||
else
|
||||
ir = FixedAngle(ir);
|
||||
quake.roll = ir;
|
||||
--quake.time;
|
||||
}
|
||||
else
|
||||
quake.x = quake.y = quake.z = quake.roll = 0;
|
||||
quake.x = quake.y = quake.z = 0;
|
||||
|
||||
if (metalplayback)
|
||||
G_ReadMetalTic(metalplayback);
|
||||
|
|
|
|||
51
src/p_user.c
51
src/p_user.c
|
|
@ -2223,7 +2223,11 @@ void P_MovePlayer(player_t *player)
|
|||
{
|
||||
player->drawangle = player->mo->angle;
|
||||
|
||||
if (player->kartstuff[k_drift] != 0)
|
||||
if (player->aizDriftTurn)
|
||||
{
|
||||
player->drawangle += player->aizDriftTurn;
|
||||
}
|
||||
else if (player->kartstuff[k_drift] != 0)
|
||||
{
|
||||
INT32 a = (ANGLE_45 / 5) * player->kartstuff[k_drift];
|
||||
player->drawangle += a;
|
||||
|
|
@ -4251,11 +4255,7 @@ Quaketilt (player_t *player)
|
|||
INT32 delta = (INT32)( player->mo->angle - moma );
|
||||
fixed_t speed;
|
||||
|
||||
boolean sliptiding =
|
||||
(
|
||||
player->kartstuff[k_aizdriftstrat] != 0 &&
|
||||
player->kartstuff[k_drift] == 0
|
||||
);
|
||||
boolean sliptiding = K_Sliptiding(player);
|
||||
|
||||
if (delta == (INT32)ANGLE_180)/* FUCK YOU HAVE A HACK */
|
||||
{
|
||||
|
|
@ -4299,52 +4299,37 @@ DoABarrelRoll (player_t *player)
|
|||
angle_t slope;
|
||||
angle_t delta;
|
||||
|
||||
fixed_t smoothing;
|
||||
|
||||
if (player->exiting)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (player->mo->standingslope)
|
||||
{
|
||||
slope = player->mo->standingslope->zangle;
|
||||
}
|
||||
else
|
||||
slope = InvAngle(R_GetPitchRollAngle(player->mo));
|
||||
|
||||
if (AbsAngle(slope) < ANGLE_11hh)
|
||||
{
|
||||
slope = 0;
|
||||
}
|
||||
|
||||
if (abs((INT32)slope) > ANGLE_11hh)
|
||||
if (AbsAngle(slope) > ANGLE_45)
|
||||
{
|
||||
delta = ( player->mo->angle - player->mo->standingslope->xydirection );
|
||||
slope = -(FixedMul(FINESINE (delta>>ANGLETOFINESHIFT), slope));
|
||||
}
|
||||
else
|
||||
{
|
||||
slope = 0;
|
||||
slope = slope & ANGLE_180 ? InvAngle(ANGLE_45) : ANGLE_45;
|
||||
}
|
||||
|
||||
slope -= Quaketilt(player);
|
||||
|
||||
delta = (INT32)( slope - player->tilt )/ 32;
|
||||
delta = slope - player->tilt;
|
||||
smoothing = FixedDiv(AbsAngle(slope), ANGLE_45);
|
||||
|
||||
delta = FixedDiv(delta, 33 *
|
||||
FixedDiv(FRACUNIT, FRACUNIT + smoothing));
|
||||
|
||||
if (delta)
|
||||
player->tilt += delta;
|
||||
else
|
||||
player->tilt = slope;
|
||||
|
||||
if (cv_tilting.value)
|
||||
{
|
||||
player->viewrollangle = player->tilt;
|
||||
|
||||
if (cv_actionmovie.value)
|
||||
{
|
||||
player->viewrollangle += quake.roll;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player->viewrollangle = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2021 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
@ -30,10 +30,6 @@
|
|||
#include "byteptr.h"
|
||||
#include "dehacked.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <malloc.h> // alloca(sizeof)
|
||||
#endif
|
||||
|
||||
//
|
||||
// Graphics.
|
||||
// SRB2 graphics for walls and sprites
|
||||
|
|
|
|||
54
src/r_draw.c
54
src/r_draw.c
|
|
@ -146,9 +146,43 @@ UINT32 nflatxshift, nflatyshift, nflatshiftup, nflatmask;
|
|||
#define DEFAULT_STARTTRANSCOLOR 96
|
||||
#define NUM_PALETTE_ENTRIES 256
|
||||
|
||||
static UINT8** translationtablecache[TT_CACHE_SIZE] = {NULL};
|
||||
static UINT8 **translationtablecache[TT_CACHE_SIZE] = {NULL};
|
||||
UINT8 skincolor_modified[MAXSKINCOLORS];
|
||||
|
||||
static INT32 SkinToCacheIndex(INT32 skinnum)
|
||||
{
|
||||
switch (skinnum)
|
||||
{
|
||||
case TC_DEFAULT: return DEFAULT_TT_CACHE_INDEX;
|
||||
case TC_BOSS: return BOSS_TT_CACHE_INDEX;
|
||||
case TC_METALSONIC: return METALSONIC_TT_CACHE_INDEX;
|
||||
case TC_ALLWHITE: return ALLWHITE_TT_CACHE_INDEX;
|
||||
case TC_RAINBOW: return RAINBOW_TT_CACHE_INDEX;
|
||||
case TC_BLINK: return BLINK_TT_CACHE_INDEX;
|
||||
case TC_DASHMODE: return DASHMODE_TT_CACHE_INDEX;
|
||||
default: break;
|
||||
}
|
||||
|
||||
return skinnum;
|
||||
}
|
||||
|
||||
static INT32 CacheIndexToSkin(INT32 ttc)
|
||||
{
|
||||
switch (ttc)
|
||||
{
|
||||
case DEFAULT_TT_CACHE_INDEX: return TC_DEFAULT;
|
||||
case BOSS_TT_CACHE_INDEX: return TC_BOSS;
|
||||
case METALSONIC_TT_CACHE_INDEX: return TC_METALSONIC;
|
||||
case ALLWHITE_TT_CACHE_INDEX: return TC_ALLWHITE;
|
||||
case RAINBOW_TT_CACHE_INDEX: return TC_RAINBOW;
|
||||
case BLINK_TT_CACHE_INDEX: return TC_BLINK;
|
||||
case DASHMODE_TT_CACHE_INDEX: return TC_DASHMODE;
|
||||
default: break;
|
||||
}
|
||||
|
||||
return ttc;
|
||||
}
|
||||
|
||||
CV_PossibleValue_t Color_cons_t[MAXSKINCOLORS+1];
|
||||
CV_PossibleValue_t Followercolor_cons_t[MAXSKINCOLORS+3]; // +3 to account for "Match", "Opposite" & NULL
|
||||
|
||||
|
|
@ -273,25 +307,11 @@ UINT8 *R_GetBlendTable(int style, INT32 alphalevel)
|
|||
UINT8* R_GetTranslationColormap(INT32 skinnum, skincolornum_t color, UINT8 flags)
|
||||
{
|
||||
UINT8* ret;
|
||||
INT32 skintableindex;
|
||||
INT32 skintableindex = SkinToCacheIndex(skinnum); // Adjust if we want the default colormap
|
||||
INT32 i;
|
||||
|
||||
// Adjust if we want the default colormap
|
||||
switch (skinnum)
|
||||
{
|
||||
case TC_DEFAULT: skintableindex = DEFAULT_TT_CACHE_INDEX; break;
|
||||
case TC_BOSS: skintableindex = BOSS_TT_CACHE_INDEX; break;
|
||||
case TC_METALSONIC: skintableindex = METALSONIC_TT_CACHE_INDEX; break;
|
||||
case TC_ALLWHITE: skintableindex = ALLWHITE_TT_CACHE_INDEX; break;
|
||||
case TC_RAINBOW: skintableindex = RAINBOW_TT_CACHE_INDEX; break;
|
||||
case TC_BLINK: skintableindex = BLINK_TT_CACHE_INDEX; break;
|
||||
case TC_DASHMODE: skintableindex = DASHMODE_TT_CACHE_INDEX; break;
|
||||
default: skintableindex = skinnum; break;
|
||||
}
|
||||
|
||||
if (flags & GTC_CACHE)
|
||||
{
|
||||
|
||||
// Allocate table for skin if necessary
|
||||
if (!translationtablecache[skintableindex])
|
||||
translationtablecache[skintableindex] = Z_Calloc(MAXSKINCOLORS * sizeof(UINT8**), PU_STATIC, NULL);
|
||||
|
|
@ -304,7 +324,7 @@ UINT8* R_GetTranslationColormap(INT32 skinnum, skincolornum_t color, UINT8 flags
|
|||
{
|
||||
for (i = 0; i < (INT32)(sizeof(translationtablecache) / sizeof(translationtablecache[0])); i++)
|
||||
if (translationtablecache[i] && translationtablecache[i][color])
|
||||
K_GenerateKartColormap(translationtablecache[i][color], i>=MAXSKINS ? MAXSKINS-i-1 : i, color);
|
||||
K_GenerateKartColormap(translationtablecache[i][color], CacheIndexToSkin(i), color);
|
||||
skincolor_modified[color] = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2021 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
@ -1447,10 +1447,7 @@ void R_DrawFloorSprite_8 (void)
|
|||
// SoM: Why didn't I see this earlier? the spot variable is a waste now because we don't
|
||||
// have the uber complicated math to calculate it now, so that was a memory write we didn't
|
||||
// need!
|
||||
//
|
||||
// <Callum> 4194303 = (2048x2048)-1 (2048x2048 is maximum flat size)
|
||||
val = (((UINT32)yposition >> nflatyshift) & nflatmask) | ((UINT32)xposition >> nflatxshift);
|
||||
val &= 4194303;
|
||||
val = source[val];
|
||||
if (val & 0xFF00)
|
||||
dest[0] = colormap[translation[val & 0xFF]];
|
||||
|
|
@ -1458,7 +1455,6 @@ void R_DrawFloorSprite_8 (void)
|
|||
yposition += ystep;
|
||||
|
||||
val = (((UINT32)yposition >> nflatyshift) & nflatmask) | ((UINT32)xposition >> nflatxshift);
|
||||
val &= 4194303;
|
||||
val = source[val];
|
||||
if (val & 0xFF00)
|
||||
dest[1] = colormap[translation[val & 0xFF]];
|
||||
|
|
@ -1466,7 +1462,6 @@ void R_DrawFloorSprite_8 (void)
|
|||
yposition += ystep;
|
||||
|
||||
val = (((UINT32)yposition >> nflatyshift) & nflatmask) | ((UINT32)xposition >> nflatxshift);
|
||||
val &= 4194303;
|
||||
val = source[val];
|
||||
if (val & 0xFF00)
|
||||
dest[2] = colormap[translation[val & 0xFF]];
|
||||
|
|
@ -1474,7 +1469,6 @@ void R_DrawFloorSprite_8 (void)
|
|||
yposition += ystep;
|
||||
|
||||
val = (((UINT32)yposition >> nflatyshift) & nflatmask) | ((UINT32)xposition >> nflatxshift);
|
||||
val &= 4194303;
|
||||
val = source[val];
|
||||
if (val & 0xFF00)
|
||||
dest[3] = colormap[translation[val & 0xFF]];
|
||||
|
|
@ -1482,7 +1476,6 @@ void R_DrawFloorSprite_8 (void)
|
|||
yposition += ystep;
|
||||
|
||||
val = (((UINT32)yposition >> nflatyshift) & nflatmask) | ((UINT32)xposition >> nflatxshift);
|
||||
val &= 4194303;
|
||||
val = source[val];
|
||||
if (val & 0xFF00)
|
||||
dest[4] = colormap[translation[val & 0xFF]];
|
||||
|
|
@ -1490,7 +1483,6 @@ void R_DrawFloorSprite_8 (void)
|
|||
yposition += ystep;
|
||||
|
||||
val = (((UINT32)yposition >> nflatyshift) & nflatmask) | ((UINT32)xposition >> nflatxshift);
|
||||
val &= 4194303;
|
||||
val = source[val];
|
||||
if (val & 0xFF00)
|
||||
dest[5] = colormap[translation[val & 0xFF]];
|
||||
|
|
@ -1498,7 +1490,6 @@ void R_DrawFloorSprite_8 (void)
|
|||
yposition += ystep;
|
||||
|
||||
val = (((UINT32)yposition >> nflatyshift) & nflatmask) | ((UINT32)xposition >> nflatxshift);
|
||||
val &= 4194303;
|
||||
val = source[val];
|
||||
if (val & 0xFF00)
|
||||
dest[6] = colormap[translation[val & 0xFF]];
|
||||
|
|
@ -1506,7 +1497,6 @@ void R_DrawFloorSprite_8 (void)
|
|||
yposition += ystep;
|
||||
|
||||
val = (((UINT32)yposition >> nflatyshift) & nflatmask) | ((UINT32)xposition >> nflatxshift);
|
||||
val &= 4194303;
|
||||
val = source[val];
|
||||
if (val & 0xFF00)
|
||||
dest[7] = colormap[translation[val & 0xFF]];
|
||||
|
|
|
|||
43
src/r_main.c
43
src/r_main.c
|
|
@ -629,7 +629,7 @@ void R_CheckViewMorph(int s)
|
|||
float fisheyemap[MAXVIDWIDTH/2 + 1];
|
||||
#endif
|
||||
|
||||
angle_t rollangle = players[displayplayers[s]].viewrollangle;
|
||||
angle_t rollangle = R_ViewRollAngle(&players[displayplayers[s]]);
|
||||
#ifdef WOUGHMP_WOUGHMP
|
||||
fixed_t fisheye = cv_cam2_turnmultiplier.value; // temporary test value
|
||||
#endif
|
||||
|
|
@ -936,6 +936,30 @@ void R_ApplyViewMorph(int s)
|
|||
width*vid.bpp, height, width*vid.bpp, vid.width);
|
||||
}
|
||||
|
||||
static inline int intsign(int n) {
|
||||
return n < 0 ? -1 : n > 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
angle_t R_ViewRollAngle(const player_t *player)
|
||||
{
|
||||
angle_t roll = player->viewrollangle;
|
||||
|
||||
if (cv_tilting.value)
|
||||
{
|
||||
roll += player->tilt;
|
||||
|
||||
if (cv_actionmovie.value)
|
||||
{
|
||||
int xs = intsign(quake.x),
|
||||
ys = intsign(quake.y),
|
||||
zs = intsign(quake.z);
|
||||
roll += (xs ^ ys ^ zs) * ANG1;
|
||||
}
|
||||
}
|
||||
|
||||
return roll;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// R_SetViewSize
|
||||
|
|
@ -1158,8 +1182,6 @@ subsector_t *R_PointInSubsectorOrNull(fixed_t x, fixed_t y)
|
|||
// 18/08/18: (No it's actually 16*viewheight, thanks Jimita for finding this out)
|
||||
static void R_SetupFreelook(player_t *player, boolean skybox)
|
||||
{
|
||||
INT32 dy = 0;
|
||||
|
||||
#ifndef HWRENDER
|
||||
(void)player;
|
||||
(void)skybox;
|
||||
|
|
@ -1178,14 +1200,15 @@ static void R_SetupFreelook(player_t *player, boolean skybox)
|
|||
G_SoftwareClipAimingPitch((INT32 *)&aimingangle);
|
||||
}
|
||||
|
||||
if (rendermode == render_soft)
|
||||
{
|
||||
dy = (AIMINGTODY(aimingangle)>>FRACBITS) * viewwidth/BASEVIDWIDTH;
|
||||
yslope = &yslopetab[viewssnum][viewheight*8 - (viewheight/2 + dy)];
|
||||
}
|
||||
centeryfrac = (viewheight/2)<<FRACBITS;
|
||||
|
||||
centery = (viewheight/2) + dy;
|
||||
centeryfrac = centery<<FRACBITS;
|
||||
if (rendermode == render_soft)
|
||||
centeryfrac += FixedMul(AIMINGTODY(aimingangle), FixedDiv(viewwidth<<FRACBITS, BASEVIDWIDTH<<FRACBITS));
|
||||
|
||||
centery = FixedInt(FixedRound(centeryfrac));
|
||||
|
||||
if (rendermode == render_soft)
|
||||
yslope = &yslopetab[viewssnum][viewheight*8 - centery];
|
||||
}
|
||||
|
||||
void R_SetupFrame(player_t *player)
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ void R_Init(void);
|
|||
|
||||
void R_CheckViewMorph(int split);
|
||||
void R_ApplyViewMorph(int split);
|
||||
angle_t R_ViewRollAngle(const player_t *player);
|
||||
|
||||
// just sets setsizeneeded true
|
||||
extern boolean setsizeneeded;
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ patch_t *Patch_GetRotatedSprite(
|
|||
boolean flip, boolean adjustfeet,
|
||||
void *info, INT32 rotationangle);
|
||||
INT32 R_GetRollAngle(angle_t rollangle);
|
||||
angle_t R_GetPitchRollAngle(mobj_t *mobj);
|
||||
angle_t R_SpriteRotationAngle(mobj_t *mobj);
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -14,12 +14,13 @@
|
|||
#include "z_zone.h"
|
||||
#include "w_wad.h"
|
||||
#include "r_main.h" // R_PointToAngle
|
||||
#include "k_kart.h" // K_Sliptiding
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
fixed_t rollcosang[ROTANGLES];
|
||||
fixed_t rollsinang[ROTANGLES];
|
||||
|
||||
angle_t R_SpriteRotationAngle(mobj_t *mobj)
|
||||
angle_t R_GetPitchRollAngle(mobj_t *mobj)
|
||||
{
|
||||
angle_t viewingAngle = R_PointToAngle(mobj->x, mobj->y);
|
||||
|
||||
|
|
@ -28,7 +29,30 @@ angle_t R_SpriteRotationAngle(mobj_t *mobj)
|
|||
|
||||
angle_t rollOrPitch = FixedMul(mobj->pitch, pitchMul) + FixedMul(mobj->roll, rollMul);
|
||||
|
||||
return (rollOrPitch + mobj->rollangle);
|
||||
return rollOrPitch;
|
||||
}
|
||||
|
||||
angle_t R_SpriteRotationAngle(mobj_t *mobj)
|
||||
{
|
||||
angle_t viewingAngle = R_PointToAngle(mobj->x, mobj->y);
|
||||
angle_t angleDelta = (viewingAngle - mobj->angle);
|
||||
|
||||
angle_t sliptideLift = mobj->player
|
||||
? mobj->player->aizDriftTilt : 0;
|
||||
|
||||
angle_t rollOrPitch = R_GetPitchRollAngle(mobj);
|
||||
angle_t rollAngle = (rollOrPitch + mobj->rollangle);
|
||||
|
||||
if (sliptideLift)
|
||||
{
|
||||
/* (from side) tilt downward if turning
|
||||
toward camera, upward if away. */
|
||||
rollAngle +=
|
||||
FixedMul(sliptideLift, FINESINE(AbsAngle(angleDelta) >> ANGLETOFINESHIFT)) +
|
||||
FixedMul(sliptideLift, FINECOSINE(angleDelta >> ANGLETOFINESHIFT));
|
||||
}
|
||||
|
||||
return rollAngle;
|
||||
}
|
||||
|
||||
INT32 R_GetRollAngle(angle_t rollangle)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2021 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
@ -154,14 +154,10 @@ static void R_UpdatePlaneRipple(void)
|
|||
// R_MapPlane
|
||||
//
|
||||
// Uses global vars:
|
||||
// planeheight
|
||||
// basexscale
|
||||
// baseyscale
|
||||
// centerx
|
||||
// viewx
|
||||
// viewy
|
||||
// viewsin
|
||||
// viewcos
|
||||
// viewheight
|
||||
|
||||
void R_MapPlane(INT32 y, INT32 x1, INT32 x2)
|
||||
{
|
||||
|
|
@ -590,7 +586,7 @@ void R_ExpandPlane(visplane_t *pl, INT32 start, INT32 stop)
|
|||
//
|
||||
void R_MakeSpans(INT32 x, INT32 t1, INT32 b1, INT32 t2, INT32 b2)
|
||||
{
|
||||
// Alam: from r_splats's R_RenderFloorSplat
|
||||
// Alam: from r_splats's R_RasterizeFloorSplat
|
||||
if (t1 >= vid.height) t1 = vid.height-1;
|
||||
if (b1 >= vid.height) b1 = vid.height-1;
|
||||
if (t2 >= vid.height) t2 = vid.height-1;
|
||||
|
|
@ -617,7 +613,6 @@ void R_MakeSpans(INT32 x, INT32 t1, INT32 b1, INT32 t2, INT32 b2)
|
|||
void R_DrawPlanes(void)
|
||||
{
|
||||
visplane_t *pl;
|
||||
angle_t va = viewangle;
|
||||
INT32 i;
|
||||
|
||||
R_UpdatePlaneRipple();
|
||||
|
|
@ -632,8 +627,6 @@ void R_DrawPlanes(void)
|
|||
R_DrawSinglePlane(pl);
|
||||
}
|
||||
}
|
||||
|
||||
viewangle = va;
|
||||
}
|
||||
|
||||
// R_DrawSkyPlane
|
||||
|
|
|
|||
47
src/r_segs.c
47
src/r_segs.c
|
|
@ -1674,23 +1674,26 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
|||
// left
|
||||
temp = xtoviewangle[viewssnum][start]+viewangle;
|
||||
|
||||
#define FIXED_TO_DOUBLE(x) (((double)(x)) / ((double)FRACUNIT))
|
||||
#define DOUBLE_TO_FIXED(x) (fixed_t)((x) * ((double)FRACUNIT))
|
||||
|
||||
{
|
||||
// Both lines can be written in slope-intercept form, so figure out line intersection
|
||||
float a1, b1, c1, a2, b2, c2, det; // 1 is the seg, 2 is the view angle vector...
|
||||
///TODO: convert to FPU
|
||||
double a1, b1, c1, a2, b2, c2, det; // 1 is the seg, 2 is the view angle vector...
|
||||
///TODO: convert to fixed point
|
||||
|
||||
a1 = FIXED_TO_FLOAT(curline->v2->y-curline->v1->y);
|
||||
b1 = FIXED_TO_FLOAT(curline->v1->x-curline->v2->x);
|
||||
c1 = a1*FIXED_TO_FLOAT(curline->v1->x) + b1*FIXED_TO_FLOAT(curline->v1->y);
|
||||
a1 = FIXED_TO_DOUBLE(curline->v2->y-curline->v1->y);
|
||||
b1 = FIXED_TO_DOUBLE(curline->v1->x-curline->v2->x);
|
||||
c1 = a1*FIXED_TO_DOUBLE(curline->v1->x) + b1*FIXED_TO_DOUBLE(curline->v1->y);
|
||||
|
||||
a2 = -FIXED_TO_FLOAT(FINESINE(temp>>ANGLETOFINESHIFT));
|
||||
b2 = FIXED_TO_FLOAT(FINECOSINE(temp>>ANGLETOFINESHIFT));
|
||||
c2 = a2*FIXED_TO_FLOAT(viewx) + b2*FIXED_TO_FLOAT(viewy);
|
||||
a2 = -FIXED_TO_DOUBLE(FINESINE(temp>>ANGLETOFINESHIFT));
|
||||
b2 = FIXED_TO_DOUBLE(FINECOSINE(temp>>ANGLETOFINESHIFT));
|
||||
c2 = a2*FIXED_TO_DOUBLE(viewx) + b2*FIXED_TO_DOUBLE(viewy);
|
||||
|
||||
det = a1*b2 - a2*b1;
|
||||
|
||||
ds_p->leftpos.x = segleft.x = FLOAT_TO_FIXED((b2*c1 - b1*c2)/det);
|
||||
ds_p->leftpos.y = segleft.y = FLOAT_TO_FIXED((a1*c2 - a2*c1)/det);
|
||||
ds_p->leftpos.x = segleft.x = DOUBLE_TO_FIXED((b2*c1 - b1*c2)/det);
|
||||
ds_p->leftpos.y = segleft.y = DOUBLE_TO_FIXED((a1*c2 - a2*c1)/det);
|
||||
}
|
||||
|
||||
// right
|
||||
|
|
@ -1698,22 +1701,26 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
|||
|
||||
{
|
||||
// Both lines can be written in slope-intercept form, so figure out line intersection
|
||||
float a1, b1, c1, a2, b2, c2, det; // 1 is the seg, 2 is the view angle vector...
|
||||
///TODO: convert to FPU
|
||||
double a1, b1, c1, a2, b2, c2, det; // 1 is the seg, 2 is the view angle vector...
|
||||
///TODO: convert to fixed point
|
||||
|
||||
a1 = FIXED_TO_FLOAT(curline->v2->y-curline->v1->y);
|
||||
b1 = FIXED_TO_FLOAT(curline->v1->x-curline->v2->x);
|
||||
c1 = a1*FIXED_TO_FLOAT(curline->v1->x) + b1*FIXED_TO_FLOAT(curline->v1->y);
|
||||
a1 = FIXED_TO_DOUBLE(curline->v2->y-curline->v1->y);
|
||||
b1 = FIXED_TO_DOUBLE(curline->v1->x-curline->v2->x);
|
||||
c1 = a1*FIXED_TO_DOUBLE(curline->v1->x) + b1*FIXED_TO_DOUBLE(curline->v1->y);
|
||||
|
||||
a2 = -FIXED_TO_FLOAT(FINESINE(temp>>ANGLETOFINESHIFT));
|
||||
b2 = FIXED_TO_FLOAT(FINECOSINE(temp>>ANGLETOFINESHIFT));
|
||||
c2 = a2*FIXED_TO_FLOAT(viewx) + b2*FIXED_TO_FLOAT(viewy);
|
||||
a2 = -FIXED_TO_DOUBLE(FINESINE(temp>>ANGLETOFINESHIFT));
|
||||
b2 = FIXED_TO_DOUBLE(FINECOSINE(temp>>ANGLETOFINESHIFT));
|
||||
c2 = a2*FIXED_TO_DOUBLE(viewx) + b2*FIXED_TO_DOUBLE(viewy);
|
||||
|
||||
det = a1*b2 - a2*b1;
|
||||
|
||||
ds_p->rightpos.x = segright.x = FLOAT_TO_FIXED((b2*c1 - b1*c2)/det);
|
||||
ds_p->rightpos.y = segright.y = FLOAT_TO_FIXED((a1*c2 - a2*c1)/det);
|
||||
ds_p->rightpos.x = segright.x = DOUBLE_TO_FIXED((b2*c1 - b1*c2)/det);
|
||||
ds_p->rightpos.y = segright.y = DOUBLE_TO_FIXED((a1*c2 - a2*c1)/det);
|
||||
}
|
||||
|
||||
#undef FIXED_TO_DOUBLE
|
||||
#undef DOUBLE_TO_FIXED
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2021 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
@ -28,11 +28,12 @@ static void prepare_rastertab(void);
|
|||
// FLOOR SPLATS
|
||||
// ==========================================================================
|
||||
|
||||
static void R_RasterizeFloorSplat(floorsplat_t *pSplat, vector2_t *verts, vissprite_t *vis);
|
||||
|
||||
#ifdef USEASM
|
||||
void ASMCALL rasterize_segment_tex_asm(INT32 x1, INT32 y1, INT32 x2, INT32 y2, INT32 tv1, INT32 tv2, INT32 tc, INT32 dir);
|
||||
#endif
|
||||
|
||||
// Lactozilla
|
||||
static void rasterize_segment_tex(INT32 x1, INT32 y1, INT32 x2, INT32 y2, INT32 tv1, INT32 tv2, INT32 tc, INT32 dir)
|
||||
{
|
||||
#ifdef USEASM
|
||||
|
|
@ -137,7 +138,7 @@ static void rasterize_segment_tex(INT32 x1, INT32 y1, INT32 x2, INT32 y2, INT32
|
|||
}
|
||||
}
|
||||
|
||||
void R_DrawFloorSprite(vissprite_t *spr)
|
||||
void R_DrawFloorSplat(vissprite_t *spr)
|
||||
{
|
||||
floorsplat_t splat;
|
||||
mobj_t *mobj = spr->mobj;
|
||||
|
|
@ -187,7 +188,7 @@ void R_DrawFloorSprite(vissprite_t *spr)
|
|||
if (spr->rotateflags & SRF_3D || renderflags & RF_NOSPLATBILLBOARD)
|
||||
splatangle = mobj->angle;
|
||||
else
|
||||
splatangle = viewangle;
|
||||
splatangle = spr->viewangle;
|
||||
|
||||
if (!(spr->cut & SC_ISROTATED))
|
||||
splatangle += mobj->rollangle;
|
||||
|
|
@ -265,7 +266,6 @@ void R_DrawFloorSprite(vissprite_t *spr)
|
|||
|
||||
if (splat.tilted)
|
||||
{
|
||||
// Lactozilla: Just copy the entire slope LMFAOOOO
|
||||
pslope_t *s = &splat.slope;
|
||||
|
||||
s->o.x = slope->o.x;
|
||||
|
|
@ -330,7 +330,7 @@ void R_DrawFloorSprite(vissprite_t *spr)
|
|||
v2d[i].y = (centeryfrac + FixedMul(rot_z, yscale))>>FRACBITS;
|
||||
}
|
||||
|
||||
R_RenderFloorSplat(&splat, v2d, spr);
|
||||
R_RasterizeFloorSplat(&splat, v2d, spr);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
|
@ -338,7 +338,7 @@ void R_DrawFloorSprite(vissprite_t *spr)
|
|||
// fill the polygon with linear interpolation, call span drawer for each
|
||||
// scan line
|
||||
// --------------------------------------------------------------------------
|
||||
void R_RenderFloorSplat(floorsplat_t *pSplat, vector2_t *verts, vissprite_t *vis)
|
||||
static void R_RasterizeFloorSplat(floorsplat_t *pSplat, vector2_t *verts, vissprite_t *vis)
|
||||
{
|
||||
// rasterizing
|
||||
INT32 miny = viewheight + 1, maxy = 0;
|
||||
|
|
@ -416,11 +416,10 @@ void R_RenderFloorSplat(floorsplat_t *pSplat, vector2_t *verts, vissprite_t *vis
|
|||
if (R_CheckPowersOfTwo())
|
||||
R_CheckFlatLength(ds_flatwidth * ds_flatheight);
|
||||
|
||||
// Lactozilla: I don't know what I'm doing
|
||||
if (pSplat->tilted)
|
||||
{
|
||||
R_SetTiltedSpan(0);
|
||||
R_CalculateSlopeVectors(&pSplat->slope, viewx, viewy, viewz, pSplat->xscale, pSplat->yscale, -pSplat->verts[0].x, pSplat->verts[0].y, viewangle, pSplat->angle, 1.0f);
|
||||
R_CalculateSlopeVectors(&pSplat->slope, viewx, viewy, viewz, pSplat->xscale, pSplat->yscale, -pSplat->verts[0].x, pSplat->verts[0].y, vis->viewangle, pSplat->angle, 1.0f);
|
||||
spanfunctype = SPANDRAWFUNC_TILTEDSPRITE;
|
||||
}
|
||||
else
|
||||
|
|
@ -533,7 +532,7 @@ void R_RenderFloorSplat(floorsplat_t *pSplat, vector2_t *verts, vissprite_t *vis
|
|||
fixed_t xstep, ystep;
|
||||
fixed_t distance, span;
|
||||
|
||||
angle_t angle = (viewangle + pSplat->angle)>>ANGLETOFINESHIFT;
|
||||
angle_t angle = (vis->viewangle + pSplat->angle)>>ANGLETOFINESHIFT;
|
||||
angle_t planecos = FINECOSINE(angle);
|
||||
angle_t planesin = FINESINE(angle);
|
||||
|
||||
|
|
@ -543,17 +542,13 @@ void R_RenderFloorSplat(floorsplat_t *pSplat, vector2_t *verts, vissprite_t *vis
|
|||
distance = cacheddistance[y] = FixedMul(planeheight, yslope[y]);
|
||||
span = abs(centery - y);
|
||||
|
||||
if (span) // don't divide by zero
|
||||
if (span) // Don't divide by zero
|
||||
{
|
||||
xstep = FixedMul(planesin, planeheight) / span;
|
||||
ystep = FixedMul(planecos, planeheight) / span;
|
||||
}
|
||||
else
|
||||
{
|
||||
// ah
|
||||
xstep = FRACUNIT;
|
||||
ystep = FRACUNIT;
|
||||
}
|
||||
xstep = ystep = FRACUNIT;
|
||||
|
||||
cachedxstep[y] = xstep;
|
||||
cachedystep[y] = ystep;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ typedef struct floorsplat_s
|
|||
mobj_t *mobj; // Mobj it is tied to
|
||||
} floorsplat_t;
|
||||
|
||||
void R_DrawFloorSprite(vissprite_t *spr);
|
||||
void R_RenderFloorSplat(floorsplat_t *pSplat, vector2_t *verts, vissprite_t *vis);
|
||||
void R_DrawFloorSplat(vissprite_t *spr);
|
||||
|
||||
#endif /*__R_SPLATS_H__*/
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2021 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
@ -28,11 +28,6 @@
|
|||
#include "byteptr.h"
|
||||
#include "dehacked.h"
|
||||
|
||||
// I don't know what this is even for, but r_data.c had it.
|
||||
#ifdef _WIN32
|
||||
#include <malloc.h> // alloca(sizeof)
|
||||
#endif
|
||||
|
||||
#ifdef HWRENDER
|
||||
#include "hardware/hw_glob.h" // HWR_LoadMapTextures
|
||||
#endif
|
||||
|
|
@ -626,7 +621,7 @@ void *R_GetLevelFlat(levelflat_t *levelflat)
|
|||
//
|
||||
// R_CheckPowersOfTwo
|
||||
//
|
||||
// Self-explanatory?
|
||||
// Sets ds_powersoftwo true if the flat's dimensions are powers of two, and returns that.
|
||||
//
|
||||
boolean R_CheckPowersOfTwo(void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
||||
// Copyright (C) 1999-2021 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
|
|
@ -779,7 +779,7 @@ static void R_DrawVisSprite(vissprite_t *vis)
|
|||
INT32 pwidth;
|
||||
fixed_t frac;
|
||||
patch_t *patch = vis->patch;
|
||||
fixed_t this_scale = vis->mobj->scale;
|
||||
fixed_t this_scale = vis->thingscale;
|
||||
INT32 x1, x2;
|
||||
INT64 overflow_test;
|
||||
|
||||
|
|
@ -1304,6 +1304,7 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale,
|
|||
|
||||
shadow->xscale = FixedMul(xscale, shadowxscale); //SoM: 4/17/2000
|
||||
shadow->scale = FixedMul(yscale, shadowyscale);
|
||||
shadow->thingscale = thing->scale;
|
||||
shadow->sector = vis->sector;
|
||||
shadow->szt = (INT16)((centeryfrac - FixedMul(shadow->gzt - viewz, yscale))>>FRACBITS);
|
||||
shadow->sz = (INT16)((centeryfrac - FixedMul(shadow->gz - viewz, yscale))>>FRACBITS);
|
||||
|
|
@ -1405,7 +1406,6 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
|
||||
fixed_t sheartan = 0;
|
||||
fixed_t shadowscale = FRACUNIT;
|
||||
|
||||
fixed_t basetx, basetz; // drop shadows
|
||||
|
||||
boolean shadowdraw, shadoweffects, shadowskew;
|
||||
|
|
@ -1581,7 +1581,8 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
if (spriterotangle
|
||||
&& !(splat && !(thing->renderflags & RF_NOSPLATROLLANGLE)))
|
||||
{
|
||||
rollangle = R_GetRollAngle(spriterotangle);
|
||||
rollangle = R_GetRollAngle(vflip
|
||||
? InvAngle(spriterotangle) : spriterotangle);
|
||||
rotsprite = Patch_GetRotatedSprite(sprframe, (thing->frame & FF_FRAMEMASK), rot, flip, false, sprinfo, rollangle);
|
||||
|
||||
if (rotsprite != NULL)
|
||||
|
|
@ -1942,6 +1943,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
vis->paperoffset = paperoffset;
|
||||
vis->paperdistance = paperdistance;
|
||||
vis->centerangle = centerangle;
|
||||
vis->viewangle = viewangle;
|
||||
vis->shear.tan = sheartan;
|
||||
vis->shear.offset = 0;
|
||||
|
||||
|
|
@ -1962,6 +1964,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
|
||||
vis->xscale = FixedMul(spritexscale, xscale); //SoM: 4/17/2000
|
||||
vis->scale = FixedMul(spriteyscale, yscale); //<<detailshift;
|
||||
vis->thingscale = oldthing->scale;
|
||||
|
||||
vis->spritexscale = spritexscale;
|
||||
vis->spriteyscale = spriteyscale;
|
||||
|
|
@ -2767,7 +2770,7 @@ static void R_DrawSprite(vissprite_t *spr)
|
|||
mceilingclip = spr->cliptop;
|
||||
|
||||
if (spr->cut & SC_SPLAT)
|
||||
R_DrawFloorSprite(spr);
|
||||
R_DrawFloorSplat(spr);
|
||||
else
|
||||
R_DrawVisSprite(spr);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,7 +157,8 @@ typedef struct vissprite_s
|
|||
fixed_t pz, pzt; // physical bottom/top
|
||||
|
||||
fixed_t startfrac; // horizontal position of x1
|
||||
fixed_t scale;
|
||||
fixed_t xscale, scale; // projected horizontal and vertical scales
|
||||
fixed_t thingscale; // the object's scale
|
||||
fixed_t sortscale; // sortscale only differs from scale for paper sprites, floor sprites, and MF2_LINKDRAW
|
||||
fixed_t sortsplat; // the sortscale from behind the floor sprite
|
||||
fixed_t scalestep; // only for paper sprites, 0 otherwise
|
||||
|
|
@ -165,6 +166,7 @@ typedef struct vissprite_s
|
|||
fixed_t xiscale; // negative if flipped
|
||||
|
||||
angle_t centerangle; // for paper sprites
|
||||
angle_t viewangle; // for floor sprites, the viewpoint's current angle
|
||||
|
||||
struct {
|
||||
fixed_t tan; // The amount to shear the sprite vertically per row
|
||||
|
|
@ -185,8 +187,6 @@ typedef struct vissprite_s
|
|||
|
||||
extracolormap_t *extra_colormap; // global colormaps
|
||||
|
||||
fixed_t xscale;
|
||||
|
||||
// Precalculated top and bottom screen coords for the sprite.
|
||||
fixed_t thingheight; // The actual height of the thing
|
||||
sector_t *sector; // The sector containing the thing.
|
||||
|
|
|
|||
|
|
@ -33,6 +33,11 @@
|
|||
#include "s_sound.h" // ditto
|
||||
#include "g_game.h" // ditto
|
||||
#include "p_local.h" // P_AutoPause()
|
||||
#ifdef HWRENDER
|
||||
#include "hardware/hw_main.h"
|
||||
#include "hardware/hw_light.h"
|
||||
#include "hardware/hw_model.h"
|
||||
#endif
|
||||
|
||||
|
||||
#if defined (USEASM) && !defined (NORUSEASM)//&& (!defined (_MSC_VER) || (_MSC_VER <= 1200))
|
||||
|
|
@ -427,6 +432,10 @@ void SCR_ChangeRenderer(void)
|
|||
CONS_Alert(CONS_ERROR, "OpenGL never loaded\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (rendermode == render_opengl && (vid.glstate == VID_GL_LIBRARY_LOADED)) // Clear these out before switching to software
|
||||
HWR_ClearAllTextures();
|
||||
|
||||
#endif
|
||||
|
||||
// Set the new render mode
|
||||
|
|
|
|||
|
|
@ -137,6 +137,12 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
|
|||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
#include <execinfo.h>
|
||||
#include <time.h>
|
||||
#define UNIXBACKTRACE
|
||||
#endif
|
||||
|
||||
// Locations for searching for main.kart
|
||||
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
#define DEFAULTWADLOCATION1 "/usr/local/share/games/SRB2Kart"
|
||||
|
|
@ -220,6 +226,71 @@ SDL_bool framebuffer = SDL_FALSE;
|
|||
|
||||
UINT8 keyboard_started = false;
|
||||
|
||||
#ifdef UNIXBACKTRACE
|
||||
#define STDERR_WRITE(string) if (fd != -1) I_OutputMsg("%s", string)
|
||||
#define CRASHLOG_WRITE(string) if (fd != -1) write(fd, string, strlen(string))
|
||||
#define CRASHLOG_STDERR_WRITE(string) \
|
||||
if (fd != -1)\
|
||||
write(fd, string, strlen(string));\
|
||||
I_OutputMsg("%s", string)
|
||||
|
||||
static void write_backtrace(INT32 signal)
|
||||
{
|
||||
int fd = -1;
|
||||
size_t size;
|
||||
time_t rawtime;
|
||||
struct tm timeinfo;
|
||||
|
||||
enum { BT_SIZE = 1024, STR_SIZE = 32 };
|
||||
void *array[BT_SIZE];
|
||||
char timestr[STR_SIZE];
|
||||
|
||||
const char *error = "An error occurred within SRB2! Send this stack trace to someone who can help!\n";
|
||||
const char *error2 = "(Or find crash-log.txt in your SRB2 directory.)\n"; // Shown only to stderr.
|
||||
|
||||
fd = open(va("%s" PATHSEP "%s", srb2home, "crash-log.txt"), O_CREAT|O_APPEND|O_RDWR, S_IRUSR|S_IWUSR);
|
||||
|
||||
if (fd == -1)
|
||||
I_OutputMsg("\nWARNING: Couldn't open crash log for writing! Make sure your permissions are correct. Please save the below report!\n");
|
||||
|
||||
// Get the current time as a string.
|
||||
time(&rawtime);
|
||||
localtime_r(&rawtime, &timeinfo);
|
||||
strftime(timestr, STR_SIZE, "%a, %d %b %Y %T %z", &timeinfo);
|
||||
|
||||
CRASHLOG_WRITE("------------------------\n"); // Nice looking seperator
|
||||
|
||||
CRASHLOG_STDERR_WRITE("\n"); // Newline to look nice for both outputs.
|
||||
CRASHLOG_STDERR_WRITE(error); // "Oops, SRB2 crashed" message
|
||||
STDERR_WRITE(error2); // Tell the user where the crash log is.
|
||||
|
||||
// Tell the log when we crashed.
|
||||
CRASHLOG_WRITE("Time of crash: ");
|
||||
CRASHLOG_WRITE(timestr);
|
||||
CRASHLOG_WRITE("\n");
|
||||
|
||||
// Give the crash log the cause and a nice 'Backtrace:' thing
|
||||
// The signal is given to the user when the parent process sees we crashed.
|
||||
CRASHLOG_WRITE("Cause: ");
|
||||
CRASHLOG_WRITE(strsignal(signal));
|
||||
CRASHLOG_WRITE("\n"); // Newline for the signal name
|
||||
|
||||
CRASHLOG_STDERR_WRITE("\nBacktrace:\n");
|
||||
|
||||
// Flood the output and log with the backtrace
|
||||
size = backtrace(array, BT_SIZE);
|
||||
backtrace_symbols_fd(array, size, fd);
|
||||
backtrace_symbols_fd(array, size, STDERR_FILENO);
|
||||
|
||||
CRASHLOG_WRITE("\n"); // Write another newline to the log so it looks nice :)
|
||||
|
||||
close(fd);
|
||||
}
|
||||
#undef STDERR_WRITE
|
||||
#undef CRASHLOG_WRITE
|
||||
#undef CRASHLOG_STDERR_WRITE
|
||||
#endif // UNIXBACKTRACE
|
||||
|
||||
static void I_ReportSignal(int num, int coredumped)
|
||||
{
|
||||
//static char msg[] = "oh no! back to reality!\r\n";
|
||||
|
|
@ -279,6 +350,9 @@ FUNCNORETURN static ATTRNORETURN void signal_handler(INT32 num)
|
|||
{
|
||||
D_QuitNetGame(); // Fix server freezes
|
||||
CL_AbortDownloadResume();
|
||||
#ifdef UNIXBACKTRACE
|
||||
write_backtrace(num);
|
||||
#endif
|
||||
I_ReportSignal(num, 0);
|
||||
I_ShutdownSystem();
|
||||
signal(num, SIG_DFL); //default signal action
|
||||
|
|
@ -669,6 +743,28 @@ static void I_RegisterSignals (void)
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef NEWSIGNALHANDLER
|
||||
static void signal_handler_child(INT32 num)
|
||||
{
|
||||
#ifdef UNIXBACKTRACE
|
||||
write_backtrace(num);
|
||||
#endif
|
||||
|
||||
signal(num, SIG_DFL); //default signal action
|
||||
raise(num);
|
||||
}
|
||||
|
||||
static void I_RegisterChildSignals(void)
|
||||
{
|
||||
// If these defines don't exist,
|
||||
// then compilation would have failed above us...
|
||||
signal(SIGILL , signal_handler_child);
|
||||
signal(SIGSEGV , signal_handler_child);
|
||||
signal(SIGABRT , signal_handler_child);
|
||||
signal(SIGFPE , signal_handler_child);
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
//I_OutputMsg
|
||||
//
|
||||
|
|
@ -1620,6 +1716,7 @@ static void I_Fork(void)
|
|||
newsignalhandler_Warn("fork()");
|
||||
break;
|
||||
case 0:
|
||||
I_RegisterChildSignals();
|
||||
break;
|
||||
default:
|
||||
if (logstream)
|
||||
|
|
|
|||
|
|
@ -1271,7 +1271,7 @@ boolean I_PlaySong(boolean looping)
|
|||
if (gme)
|
||||
{
|
||||
gme_equalizer_t eq = {GME_TREBLE, GME_BASS, 0,0,0,0,0,0,0,0};
|
||||
#if GME_VERSION >= 0x000603
|
||||
#if defined (GME_VERSION) && GME_VERSION >= 0x000603
|
||||
if (looping)
|
||||
gme_set_autoload_playback_limit(gme, 0);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -93,6 +93,12 @@ FUNCMATH FUNCINLINE static ATTRINLINE angle_t InvAngle(angle_t a)
|
|||
{
|
||||
return (ANGLE_MAX-a)+1;
|
||||
}
|
||||
|
||||
// 315 = 45
|
||||
FUNCMATH FUNCINLINE static ATTRINLINE angle_t AbsAngle(angle_t a)
|
||||
{
|
||||
return a & ANGLE_180 ? InvAngle(a) : a;
|
||||
}
|
||||
// angle_t to fixed_t f(ANGLE_45) = 45*FRACUNIT
|
||||
FUNCMATH fixed_t AngleFixed(angle_t af);
|
||||
// fixed_t to angle_t f(45*FRACUNIT) = ANGLE_45
|
||||
|
|
|
|||
|
|
@ -802,7 +802,10 @@ UINT16 W_InitFile(const char *filename, boolean mainfile, boolean startup)
|
|||
}
|
||||
|
||||
if (important && !mainfile)
|
||||
G_SetGameModified(true, false);
|
||||
{
|
||||
//G_SetGameModified(true);
|
||||
modifiedgame = true; // avoid savemoddata being set to false
|
||||
}
|
||||
|
||||
//
|
||||
// link wad file to search files
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue