Merge remote-tracking branch 'kartpublic/next' into fortnite
This commit is contained in:
commit
6aa55bdbe2
113 changed files with 10946 additions and 9715 deletions
|
|
@ -36,12 +36,15 @@ jobs:
|
|||
- v1-SRB2-APT
|
||||
- run:
|
||||
name: Install SDK
|
||||
command: apt-get -qq -y install git build-essential nasm libpng12-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 gettext ccache wget gcc-multilib upx
|
||||
command: apt-get -qq -y --no-install-recommends install git build-essential nasm libpng12-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 gettext ccache wget gcc-multilib upx openssh-client
|
||||
- save_cache:
|
||||
key: v1-SRB2-APT
|
||||
paths:
|
||||
- /var/cache/apt/archives
|
||||
- checkout
|
||||
- run:
|
||||
name: Compile without network support
|
||||
command: make -C src LINUX=1 ERRORMODE=1 -k NONET=1
|
||||
- run:
|
||||
name: Clean build
|
||||
command: make -C src LINUX=1 clean
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ Oni: Sev, Sal, and toast were the most unexpected things to ever happen to this
|
|||
|
||||
[Oni wiping sweat off his brow] Things only got more drastically revamped… very very rapidly.
|
||||
|
||||
The Mario aesthetic was entirely tossed out, as Sal was willing to work with me night and day on redoing most of everything about items… and then sounds. My power level for sprites massively jumped during TD development, so I decided to take it upon myself to do almost everything. They’re such friendly and cooperative coders that I can’t help but push a little harder than I used to (I was WAY lazier before they got here) to keep up.
|
||||
The Mario aesthetic was entirely tossed out, as Sal was willing to work with me night and day on redoing most of everything about items… and then sounds. My power level for sprites massively jumped during TD development, so I decided to take it upon myself to do almost everything. They’re such friendly and cooperative coders that I can’t help but push a little harder than I used to (I was WAY lazier before they got here) to keep up.
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -4,7 +4,7 @@ project(libgme)
|
|||
include (CheckCXXCompilerFlag)
|
||||
|
||||
# When version is changed, also change the one in gme/gme.h to match
|
||||
set(GME_VERSION 0.6.0 CACHE INTERNAL "libgme Version")
|
||||
set(GME_VERSION 0.6.2 CACHE INTERNAL "libgme Version")
|
||||
|
||||
# 2.6+ always assumes FATAL_ERROR, but 2.4 and below don't.
|
||||
# Of course, 2.4 might work, in which case you're welcome to drop
|
||||
|
|
@ -57,6 +57,8 @@ if (USE_GME_NSFE AND NOT USE_GME_NSF)
|
|||
SET(USE_GME_NSF 1 CACHE BOOL "Enable NES NSF music emulation" FORCE)
|
||||
endif()
|
||||
|
||||
option(BUILD_SHARED_LIBS "Build shared library (set to OFF for static library)" ON)
|
||||
|
||||
# Check for GCC "visibility" support.
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
check_cxx_compiler_flag (-fvisibility=hidden __LIBGME_TEST_VISIBILITY)
|
||||
|
|
@ -79,10 +81,10 @@ if (CMAKE_COMPILER_IS_GNUCXX)
|
|||
endif()
|
||||
endif()
|
||||
endif() # test visibility
|
||||
endif (CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
# Cache this result
|
||||
set( LIBGME_HAVE_GCC_VISIBILITY ${ENABLE_VISIBILITY} CACHE BOOL "GCC support for hidden visibility")
|
||||
# Cache this result
|
||||
set( LIBGME_HAVE_GCC_VISIBILITY ${ENABLE_VISIBILITY} CACHE BOOL "GCC support for hidden visibility")
|
||||
endif (CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
# Shared library defined here
|
||||
add_subdirectory(gme)
|
||||
|
|
|
|||
|
|
@ -1,262 +1,5 @@
|
|||
Game_Music_Emu Change Log
|
||||
-------------------------
|
||||
|
||||
Game_Music_Emu 0.6.0
|
||||
--------------------
|
||||
|
||||
- Note: A 0.5.6 release was referenced but never tagged or packaged.
|
||||
|
||||
- SPC improvements:
|
||||
- Switched to newer snes_spc 0.9.0 for SPC emulation. Uses fast DSP.
|
||||
- Fixed Spc_Emu::gain().
|
||||
- Fixed support for files <0x10200 bytes.
|
||||
|
||||
- Other bugfixes:
|
||||
- Fixed a couple of GBS bugs, one involving access of memory after
|
||||
realloc.
|
||||
- Blip_Buffer works on systems where 'double' is a single-precision
|
||||
floating-point type.
|
||||
- Fix uninitialized buffer size in dual_resampler.
|
||||
- Compilation warnings squashed out as of clang 3.3-pre and gcc 4.7.2.
|
||||
|
||||
- API changes/additions:
|
||||
- Removed documentation of C++ interface, as the C interface in gme.h is
|
||||
the only supported one.
|
||||
- Added gme_enable_accuracy() for enabling more accurate sound emulation
|
||||
options (currently affects SPC only).
|
||||
|
||||
- Build system improvements:
|
||||
- Add pkg_config support.
|
||||
- Fix build on case-insensitive systems.
|
||||
- Allow for install on Cygwin.
|
||||
- Fix install on multilib systems, such as many 64-bit distros (CMake must
|
||||
be able to figure out your system's libsuffix, if any).
|
||||
- C++ implementation symbols are not leaked into the resultant library
|
||||
file (requires symbol visibility support).
|
||||
|
||||
- Sample player improvements:
|
||||
- Can toggle fast/accurate emulation (with the 'A' key).
|
||||
|
||||
Game_Music_Emu 0.5.5
|
||||
--------------------
|
||||
- CMake build support has been added. You can build Game_Music_Emu as
|
||||
a shared library and install it so that you do not have to include your
|
||||
own copy if you know libgme will be present on your target system.
|
||||
Requires CMake 2.6 or higher.
|
||||
|
||||
|
||||
Game_Music_Emu 0.5.2
|
||||
--------------------
|
||||
- *TONS* of changes and improvements. You should re-read the new header
|
||||
files and documentation as the changes will allow you to simplify your
|
||||
code a lot (it might even be simpler to just rewrite it). Existing code
|
||||
should continue to work without changes in most cases (see Deprecated
|
||||
features in gme.txt).
|
||||
|
||||
- New file formats: AY, HES, KSS, SAP, NSFE
|
||||
|
||||
- All-new comprehensive C interface (also usable from C++). Simplifies
|
||||
many things, especially file loading, and brings everything together in
|
||||
one header file (gme.h).
|
||||
|
||||
- Information tags and track names and times can be accessed for all
|
||||
game music formats
|
||||
|
||||
- New features supported by all emulators: end of track fading,
|
||||
automatic silence detection, adjustable song tempo, seek to new time in
|
||||
track
|
||||
|
||||
- Updated mini player example to support track names and times, echo,
|
||||
tempo, and channel muting, and added visual waveform display
|
||||
|
||||
- Improved configuration to use blargg_config.h, which you can modify
|
||||
and keep when you update to a newer libary version. Includes flag for
|
||||
library to automatically handle gzipped files using zlib (so you don't
|
||||
need to use Gzip_File_Reader anymore).
|
||||
|
||||
- GBS: Fixed wave channel to not reset waveform when APU is powered off
|
||||
(affected Garfield). Also improved invalid bank selection (affected Game
|
||||
& Watch and others).
|
||||
|
||||
- VGM: Added support for alternate noise shifter register
|
||||
configurations, used by other systems like the BBC Micro.
|
||||
|
||||
- SPC: Removed IPL ROM dump from emulator, as none of the SPC files I
|
||||
scanned needed it, and an SPC file can include a copy if necessary. Also
|
||||
re-enabled supposed clamping in gaussian interpolation between the third
|
||||
and fourth lookups, though I don't know whether it matters
|
||||
|
||||
- Added Music_Emu::load_mem() to use music data already in memory
|
||||
(without copying it)
|
||||
|
||||
- Added Music_Emu::warning(), which reports minor problems when loading
|
||||
and playing a music file
|
||||
|
||||
- Added Music_Emu::set_gain() for uniform adjustment of gain. Can only
|
||||
be set during initialization, so not useful as a general volume control.
|
||||
|
||||
- Added custom operator new to ensure that no exceptions are thrown in
|
||||
the library (I'd use std::nothrow if it were part of pre-ISO (ARM) C++)
|
||||
|
||||
- Added BLIP_BUFFER_FAST flag to blargg_config.h to use a lower quality
|
||||
bandlimited synthesis in "classic" emulators, which might help
|
||||
performance on ancient processors (measure first!). Don't use this
|
||||
unless absolutely necessary, as quality suffers.
|
||||
|
||||
- Improved performance a bit for x86 platforms
|
||||
|
||||
- Text files now in DOS newline format so they will open in Notepad
|
||||
properly
|
||||
|
||||
- Removed requirement that file header structures not have any padding
|
||||
added to the end
|
||||
|
||||
- Fixed common bug in all CPU emulators where negative program counter
|
||||
could crash emulator (occurred during a negative branch from the
|
||||
beginning of memory). Also fixed related bug in Z80 emulator for
|
||||
IX/IY+displacement mode.
|
||||
|
||||
- Eliminated all warnings when compiling on gcc 4.0. The following
|
||||
generates no diagnostics:
|
||||
|
||||
gcc -S gme/*.cpp -o /dev/null -ansi -fno-gnu-keywords
|
||||
-fno-nonansi-builtins -pedantic -W -Wabi -Wall -Wcast-align
|
||||
-Wcast-qual -Wchar-subscripts -Wdisabled-optimization -Werror
|
||||
-Winline -Wlong-long -Wmultichar -Winvalid-offsetof
|
||||
-Wnon-virtual-dtor -Woverloaded-virtual -Wparentheses
|
||||
-Wpointer-arith -Wredundant-decls -Wreorder -Wsign-compare
|
||||
-Wsign-promo -Wunknown-pragmas -Wwrite-strings
|
||||
|
||||
|
||||
Game_Music_Emu 0.3.0
|
||||
--------------------
|
||||
- Added more demos, including music player using the SDL multimedia
|
||||
library for sound, and improved documentation
|
||||
|
||||
- All: Improved interface to emulators to allow simpler setup and
|
||||
loading. Instead of various init() functions, all now support
|
||||
set_sample_rate( long rate ) and load( const char* file_path ).
|
||||
|
||||
- All: Removed error return from start_track() and play(), and added
|
||||
error_count() to get the total number of emulation errors since the
|
||||
track was last started. See demos for examples of new usage.
|
||||
|
||||
- All: Fixed mute_voices() muting to be preserved after loading files
|
||||
and starting tracks, instead of being cleared as it was whenever a track
|
||||
was started
|
||||
|
||||
- VGM: Rewrote Vgm_Emu to support Sega Genesis/Mega Drive FM sound at
|
||||
any sample rate with optional FM oversampling, support for alternate
|
||||
YM2612 sound cores, and support for optional YM2413
|
||||
|
||||
- VGM: Added tempo control, useful for slowing 60Hz NTSC Sega Genesis
|
||||
music to 50Hz PAL
|
||||
|
||||
- VGM: Removed Vgm_Emu::track_data(), since I realized that this
|
||||
information is already present in the VGM header (oops!)
|
||||
|
||||
- GYM: Changed Gym_Emu::track_length() operation (see Gym_Emu.h)
|
||||
|
||||
- NSF: Added support for Sunsoft FME-7 sound chip used by Gimmick
|
||||
soundtrack
|
||||
|
||||
- NSF: Fixed Namco 106 problems with Final Lap and others
|
||||
|
||||
- Moved library sources to gme/ directory to reduce clutter, and merged
|
||||
boost/ functionality into blargg_common.h
|
||||
|
||||
- Added Gzip_File_Reader for transparently using gzipped files
|
||||
|
||||
|
||||
Game_Music_Emu 0.2.4
|
||||
--------------------
|
||||
- Created a discussion forum for problems and feedback:
|
||||
http://groups-beta.google.com/group/blargg-sound-libs
|
||||
|
||||
- Changed error return value of Blip_Buffer::sample_rate() (also for
|
||||
Stereo_Buffer, Effects_Buffer, etc.) to blargg_err_t (defined in
|
||||
blargg_common.h), to make error reporting consistent with other
|
||||
functions. This means the "no error" return value is the opposite of
|
||||
what it was before, which will break current code which checks the error
|
||||
return value:
|
||||
|
||||
// current code (broken)
|
||||
if ( !buf.sample_rate( samples_per_sec ) )
|
||||
out_of_memory();
|
||||
|
||||
// quick-and-dirty fix (just remove the ! operation)
|
||||
if ( buf.sample_rate( samples_per_sec ) )
|
||||
out_of_memory();
|
||||
|
||||
// proper fix
|
||||
blargg_err_t error = buf.sample_rate( samples_per_sec );
|
||||
if ( error )
|
||||
report_error( error );
|
||||
|
||||
- Implemented workaround for MSVC++ 6 compiler limitations, allowing it
|
||||
to work on that compiler again
|
||||
|
||||
- Added sample clamping to avoid wrap-around at high volumes, allowing
|
||||
higher volume with little distortion
|
||||
|
||||
- Added to-do list and design notes
|
||||
|
||||
- Added Music_Emu::skip( long sample_count ) to skip ahead in current
|
||||
track
|
||||
|
||||
- Added Gym_Emu::track_length() and Vgm_Emu::track_length() for
|
||||
determining the length of non-looped GYM and VGM files
|
||||
|
||||
- Partially implemented DMC non-linearity when its value is directly set
|
||||
using $4011, which reduces previously over-emphasized "popping" of
|
||||
percussion on some games (TMNT II in particular)
|
||||
|
||||
- Fixed Fir_Resampler, used for SPC and GYM playback (was incorrectly
|
||||
using abs() instead of fabs()...argh)
|
||||
|
||||
- Fixed SPC emulation bugs: eliminated clicks in Plok! soundtrack and
|
||||
now stops sample slightly earlier than the end, as the SNES does. Fixed
|
||||
a totally broken CPU addressing mode.
|
||||
|
||||
- Fixed Konami VRC6 saw wave (was very broken before). Now VRC6 music
|
||||
sounds decent
|
||||
|
||||
- Fixed a minor GBS emulation bug
|
||||
|
||||
- Fixed GYM loop point bug when track was restarted before loop point
|
||||
had been reached
|
||||
|
||||
- Made default GBS frequency equalization less muffled
|
||||
|
||||
- Added pseudo-surround effect removal for SPC files
|
||||
|
||||
- Added Music_Emu::voice_names() which returns names for each voice.
|
||||
|
||||
- Added BLARGG_SOURCE_BEGIN which allows custom compiler options to be
|
||||
easily set for library sources
|
||||
|
||||
- Changed assignment of expansion sound chips in Nsf_Emu to be spread
|
||||
more evenly when using Effects_Buffer
|
||||
|
||||
- Changed 'size_t' values in Blip_Buffer interface to 'long'
|
||||
|
||||
- Changed demo to generate a WAVE sound file rather than an AIFF file
|
||||
|
||||
|
||||
Game_Music_Emu 0.2.0
|
||||
--------------------
|
||||
- Redid framework and rewrote/cleaned up emulators
|
||||
|
||||
- Changed licensing to GNU Lesser General Public License (LGPL)
|
||||
|
||||
- Added Sega Genesis GYM and Super Nintendo SPC emulators
|
||||
|
||||
- Added Namco-106 and Konami VRC6 sound chip support to NSF emulator
|
||||
|
||||
- Eliminated use of static mutable data in emulators, allowing
|
||||
multi-instance safety
|
||||
|
||||
|
||||
Game_Music_Emu 0.1.0
|
||||
--------------------
|
||||
- First release
|
||||
Please see the git version history (e.g. git shortlog tags/0.6.0..tags/0.6.1)
|
||||
for the accurate change log.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
/* C example that opens a game music file and records 10 seconds to "out.wav" */
|
||||
|
||||
static char filename [] = "test.nsf"; /* opens this file (can be any music type) */
|
||||
|
||||
#include "gme/gme.h"
|
||||
|
||||
#include "Wave_Writer.h" /* wave_ functions for writing sound file */
|
||||
|
|
@ -10,10 +8,15 @@ static char filename [] = "test.nsf"; /* opens this file (can be any music type)
|
|||
|
||||
void handle_error( const char* str );
|
||||
|
||||
int main()
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
const char *filename = "test.nsf"; /* Default file to open */
|
||||
if ( argc >= 2 )
|
||||
filename = argv[1];
|
||||
|
||||
long sample_rate = 44100; /* number of samples per second */
|
||||
int track = 0; /* index of track to play (0 = first) */
|
||||
/* index of track to play (0 = first) */
|
||||
int track = argc >= 3 ? atoi(argv[2]) : 0;
|
||||
|
||||
/* Open music file in new emulator */
|
||||
Music_Emu* emu;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
// C++ example that opens a game music file and records 10 seconds to "out.wav"
|
||||
|
||||
static char filename [] = "test.nsf"; /* opens this file (can be any music type) */
|
||||
|
||||
#include "gme/Music_Emu.h"
|
||||
|
||||
#include "Wave_Writer.h"
|
||||
|
|
@ -10,10 +8,15 @@ static char filename [] = "test.nsf"; /* opens this file (can be any music type)
|
|||
|
||||
void handle_error( const char* str );
|
||||
|
||||
int main()
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
const char *filename = "test.nsf"; /* Default file to open */
|
||||
if ( argc >= 2 )
|
||||
filename = argv[1];
|
||||
|
||||
long sample_rate = 44100; // number of samples per second
|
||||
int track = 0; // index of track to play (0 = first)
|
||||
// index of track to play (0 = first)
|
||||
int track = argc >= 3 ? atoi(argv[2]) : 0;
|
||||
|
||||
// Determine file type
|
||||
gme_type_t file_type;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
Game_Music_Emu 0.6.0
|
||||
Game_Music_Emu 0.6.2
|
||||
--------------------
|
||||
Author : Shay Green <gblargg@gmail.com>
|
||||
Website: http://www.slack.net/~ant/libs/
|
||||
Forum : http://groups.google.com/group/blargg-sound-libs
|
||||
Source : https://code.google.com/p/game-music-emu/
|
||||
License: GNU Lesser General Public License (LGPL)
|
||||
Author : Shay Green <gblargg@gmail.com>
|
||||
Maintainer : Michael Pyne <mpyne@purinchu.net>
|
||||
Website : https://bitbucket.org/mpyne/game-music-emu/
|
||||
Source : https://bitbucket.org/mpyne/game-music-emu/
|
||||
License : GNU Lesser General Public License (LGPL), see LICENSE.txt
|
||||
|
||||
Contents
|
||||
--------
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ add_definitions(-DBLARGG_BUILD_DLL)
|
|||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
# Add library to be compiled.
|
||||
add_library(gme SHARED ${libgme_SRCS})
|
||||
add_library(gme ${libgme_SRCS})
|
||||
|
||||
# The version is the release. The "soversion" is the API version. As long
|
||||
# as only build fixes are performed (i.e. no backwards-incompatible changes
|
||||
|
|
@ -159,4 +159,4 @@ install(TARGETS gme LIBRARY DESTINATION lib${LIB_SUFFIX}
|
|||
ARCHIVE DESTINATION lib) # DLL platforms
|
||||
|
||||
install(FILES ${EXPORTED_HEADERS} DESTINATION include/gme)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libgme.pc DESTINATION lib/pkgconfig)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libgme.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig)
|
||||
|
|
|
|||
|
|
@ -22,8 +22,13 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
|
|||
|
||||
const char Data_Reader::eof_error [] = "Unexpected end of file";
|
||||
|
||||
#define RETURN_VALIDITY_CHECK( cond ) \
|
||||
do { if ( unlikely( !(cond) ) ) return "Corrupt file"; } while(0)
|
||||
|
||||
blargg_err_t Data_Reader::read( void* p, long s )
|
||||
{
|
||||
RETURN_VALIDITY_CHECK( s > 0 );
|
||||
|
||||
long result = read_avail( p, s );
|
||||
if ( result != s )
|
||||
{
|
||||
|
|
@ -38,6 +43,8 @@ blargg_err_t Data_Reader::read( void* p, long s )
|
|||
|
||||
blargg_err_t Data_Reader::skip( long count )
|
||||
{
|
||||
RETURN_VALIDITY_CHECK( count >= 0 );
|
||||
|
||||
char buf [512];
|
||||
while ( count )
|
||||
{
|
||||
|
|
@ -54,7 +61,8 @@ long File_Reader::remain() const { return size() - tell(); }
|
|||
|
||||
blargg_err_t File_Reader::skip( long n )
|
||||
{
|
||||
assert( n >= 0 );
|
||||
RETURN_VALIDITY_CHECK( n >= 0 );
|
||||
|
||||
if ( !n )
|
||||
return 0;
|
||||
return seek( tell() + n );
|
||||
|
|
@ -67,13 +75,14 @@ Subset_Reader::Subset_Reader( Data_Reader* dr, long size )
|
|||
in = dr;
|
||||
remain_ = dr->remain();
|
||||
if ( remain_ > size )
|
||||
remain_ = size;
|
||||
remain_ = max( 0l, size );
|
||||
}
|
||||
|
||||
long Subset_Reader::remain() const { return remain_; }
|
||||
|
||||
long Subset_Reader::read_avail( void* p, long s )
|
||||
{
|
||||
s = max( 0l, s );
|
||||
if ( s > remain_ )
|
||||
s = remain_;
|
||||
remain_ -= s;
|
||||
|
|
@ -85,7 +94,7 @@ long Subset_Reader::read_avail( void* p, long s )
|
|||
Remaining_Reader::Remaining_Reader( void const* h, long size, Data_Reader* r )
|
||||
{
|
||||
header = (char const*) h;
|
||||
header_end = header + size;
|
||||
header_end = header + max( 0l, size );
|
||||
in = r;
|
||||
}
|
||||
|
||||
|
|
@ -93,6 +102,7 @@ long Remaining_Reader::remain() const { return header_end - header + in->remain(
|
|||
|
||||
long Remaining_Reader::read_first( void* out, long count )
|
||||
{
|
||||
count = max( 0l, count );
|
||||
long first = header_end - header;
|
||||
if ( first )
|
||||
{
|
||||
|
|
@ -107,8 +117,9 @@ long Remaining_Reader::read_first( void* out, long count )
|
|||
|
||||
long Remaining_Reader::read_avail( void* out, long count )
|
||||
{
|
||||
count = max( 0l, count );
|
||||
long first = read_first( out, count );
|
||||
long second = count - first;
|
||||
long second = max( 0l, count - first );
|
||||
if ( second )
|
||||
{
|
||||
second = in->read_avail( (char*) out + first, second );
|
||||
|
|
@ -120,8 +131,9 @@ long Remaining_Reader::read_avail( void* out, long count )
|
|||
|
||||
blargg_err_t Remaining_Reader::read( void* out, long count )
|
||||
{
|
||||
count = max( 0l, count );
|
||||
long first = read_first( out, count );
|
||||
long second = count - first;
|
||||
long second = max( 0l, count - first );
|
||||
if ( !second )
|
||||
return 0;
|
||||
return in->read( (char*) out + first, second );
|
||||
|
|
@ -131,7 +143,7 @@ blargg_err_t Remaining_Reader::read( void* out, long count )
|
|||
|
||||
Mem_File_Reader::Mem_File_Reader( const void* p, long s ) :
|
||||
begin( (const char*) p ),
|
||||
size_( s )
|
||||
size_( max( 0l, s ) )
|
||||
{
|
||||
pos = 0;
|
||||
}
|
||||
|
|
@ -141,6 +153,7 @@ long Mem_File_Reader::size() const { return size_; }
|
|||
long Mem_File_Reader::read_avail( void* p, long s )
|
||||
{
|
||||
long r = remain();
|
||||
s = max( 0l, s );
|
||||
if ( s > r )
|
||||
s = r;
|
||||
memcpy( p, begin + pos, s );
|
||||
|
|
@ -152,6 +165,7 @@ long Mem_File_Reader::tell() const { return pos; }
|
|||
|
||||
blargg_err_t Mem_File_Reader::seek( long n )
|
||||
{
|
||||
RETURN_VALIDITY_CHECK( n >= 0 );
|
||||
if ( n > size_ )
|
||||
return eof_error;
|
||||
pos = n;
|
||||
|
|
@ -164,7 +178,7 @@ Callback_Reader::Callback_Reader( callback_t c, long size, void* d ) :
|
|||
callback( c ),
|
||||
data( d )
|
||||
{
|
||||
remain_ = size;
|
||||
remain_ = max( 0l, size );
|
||||
}
|
||||
|
||||
long Callback_Reader::remain() const { return remain_; }
|
||||
|
|
@ -173,13 +187,14 @@ long Callback_Reader::read_avail( void* out, long count )
|
|||
{
|
||||
if ( count > remain_ )
|
||||
count = remain_;
|
||||
if ( Callback_Reader::read( out, count ) )
|
||||
if ( count < 0 || Callback_Reader::read( out, count ) )
|
||||
count = -1;
|
||||
return count;
|
||||
}
|
||||
|
||||
blargg_err_t Callback_Reader::read( void* out, long count )
|
||||
{
|
||||
RETURN_VALIDITY_CHECK( count >= 0 );
|
||||
if ( count > remain_ )
|
||||
return eof_error;
|
||||
return callback( data, out, count );
|
||||
|
|
@ -210,11 +225,12 @@ long Std_File_Reader::size() const
|
|||
|
||||
long Std_File_Reader::read_avail( void* p, long s )
|
||||
{
|
||||
return fread( p, 1, s, (FILE*) file_ );
|
||||
return fread( p, 1, max( 0l, s ), (FILE*) file_ );
|
||||
}
|
||||
|
||||
blargg_err_t Std_File_Reader::read( void* p, long s )
|
||||
{
|
||||
RETURN_VALIDITY_CHECK( s > 0 );
|
||||
if ( s == (long) fread( p, 1, s, (FILE*) file_ ) )
|
||||
return 0;
|
||||
if ( feof( (FILE*) file_ ) )
|
||||
|
|
|
|||
|
|
@ -129,6 +129,8 @@ private:
|
|||
};
|
||||
|
||||
#ifdef HAVE_ZLIB_H
|
||||
#include <zlib.h>
|
||||
|
||||
// Gzip compressed file reader
|
||||
class Gzip_File_Reader : public File_Reader {
|
||||
public:
|
||||
|
|
@ -143,7 +145,7 @@ public:
|
|||
long tell() const;
|
||||
blargg_err_t seek( long );
|
||||
private:
|
||||
void* file_;
|
||||
gzFile file_;
|
||||
long size_;
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -178,6 +178,11 @@ blargg_long Music_Emu::msec_to_samples( blargg_long msec ) const
|
|||
return (sec * sample_rate() + msec * sample_rate() / 1000) * stereo;
|
||||
}
|
||||
|
||||
long Music_Emu::tell_samples() const
|
||||
{
|
||||
return out_time;
|
||||
}
|
||||
|
||||
long Music_Emu::tell() const
|
||||
{
|
||||
blargg_long rate = sample_rate() * stereo;
|
||||
|
|
@ -185,14 +190,18 @@ long Music_Emu::tell() const
|
|||
return sec * 1000 + (out_time - sec * rate) * 1000 / rate;
|
||||
}
|
||||
|
||||
blargg_err_t Music_Emu::seek( long msec )
|
||||
blargg_err_t Music_Emu::seek_samples( long time )
|
||||
{
|
||||
blargg_long time = msec_to_samples( msec );
|
||||
if ( time < out_time )
|
||||
RETURN_ERR( start_track( current_track_ ) );
|
||||
return skip( time - out_time );
|
||||
}
|
||||
|
||||
blargg_err_t Music_Emu::seek( long msec )
|
||||
{
|
||||
return seek_samples( msec_to_samples( msec ) );
|
||||
}
|
||||
|
||||
blargg_err_t Music_Emu::skip( long count )
|
||||
{
|
||||
require( current_track() >= 0 ); // start_track() must have been called already
|
||||
|
|
|
|||
|
|
@ -41,9 +41,15 @@ public:
|
|||
// Number of milliseconds (1000 msec = 1 second) played since beginning of track
|
||||
long tell() const;
|
||||
|
||||
// Number of samples generated since beginning of track
|
||||
long tell_samples() const;
|
||||
|
||||
// Seek to new time in track. Seeking backwards or far forward can take a while.
|
||||
blargg_err_t seek( long msec );
|
||||
|
||||
// Equivalent to restarting track then skipping n samples
|
||||
blargg_err_t seek_samples( long n );
|
||||
|
||||
// Skip n samples
|
||||
blargg_err_t skip( long n );
|
||||
|
||||
|
|
|
|||
|
|
@ -134,6 +134,9 @@ blargg_err_t Nsfe_Info::load( Data_Reader& in, Nsf_Emu* nsf_emu )
|
|||
RETURN_ERR( in.read( block_header, sizeof block_header ) );
|
||||
blargg_long size = get_le32( block_header [0] );
|
||||
blargg_long tag = get_le32( block_header [1] );
|
||||
|
||||
if ( size <= 0 )
|
||||
return "Corrupt file";
|
||||
|
||||
//debug_printf( "tag: %c%c%c%c\n", char(tag), char(tag>>8), char(tag>>16), char(tag>>24) );
|
||||
|
||||
|
|
|
|||
|
|
@ -433,9 +433,7 @@ void Snes_Spc::cpu_write( int data, int addr, rel_time_t time )
|
|||
#endif
|
||||
|
||||
// Registers other than $F2 and $F4-$F7
|
||||
//if ( reg != 2 && reg != 4 && reg != 5 && reg != 6 && reg != 7 )
|
||||
// TODO: this is a bit on the fragile side
|
||||
if ( ((~0x2F00 << (bits_in_int - 16)) << reg) < 0 ) // 36%
|
||||
if ( reg != 2 && (reg < 4 || reg > 7) ) // 36%
|
||||
cpu_write_smp_reg( data, time, reg );
|
||||
}
|
||||
// High mem/address wrap-around
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
|
|||
// TODO: remove non-wrapping versions?
|
||||
#define SPC_NO_SP_WRAPAROUND 0
|
||||
|
||||
#define SET_SP( v ) (sp = ram + 0x101 + (v))
|
||||
#define GET_SP() (sp - 0x101 - ram)
|
||||
#define SET_SP( v ) (sp = ram + 0x101 + ((uint8_t) v))
|
||||
#define GET_SP() (uint8_t (sp - 0x101 - ram))
|
||||
|
||||
#if SPC_NO_SP_WRAPAROUND
|
||||
#define PUSH16( v ) (sp -= 2, SET_LE16( sp, v ))
|
||||
|
|
@ -485,7 +485,7 @@ loop:
|
|||
|
||||
case 0xAF: // MOV (X)+,A
|
||||
WRITE_DP( 0, x, a + no_read_before_write );
|
||||
x++;
|
||||
x = (uint8_t) (x + 1);
|
||||
goto loop;
|
||||
|
||||
// 5. 8-BIT LOGIC OPERATION COMMANDS
|
||||
|
|
@ -808,7 +808,7 @@ loop:
|
|||
unsigned temp = y * a;
|
||||
a = (uint8_t) temp;
|
||||
nz = ((temp >> 1) | temp) & 0x7F;
|
||||
y = temp >> 8;
|
||||
y = (uint8_t) (temp >> 8);
|
||||
nz |= y;
|
||||
goto loop;
|
||||
}
|
||||
|
|
@ -838,6 +838,7 @@ loop:
|
|||
|
||||
nz = (uint8_t) a;
|
||||
a = (uint8_t) a;
|
||||
y = (uint8_t) y;
|
||||
|
||||
goto loop;
|
||||
}
|
||||
|
|
@ -1004,7 +1005,7 @@ loop:
|
|||
case 0x7F: // RET1
|
||||
temp = *sp;
|
||||
SET_PC( GET_LE16( sp + 1 ) );
|
||||
sp += 3;
|
||||
SET_SP( GET_SP() + 3 );
|
||||
goto set_psw;
|
||||
case 0x8E: // POP PSW
|
||||
POP( temp );
|
||||
|
|
|
|||
|
|
@ -18,6 +18,19 @@ all other #include lines. */
|
|||
#undef require
|
||||
#define require( expr ) assert( expr )
|
||||
|
||||
// Use to provide hints to compiler for optimized code layout in situations where we
|
||||
// can almost always expect a conditional to go one way or the other. Should only be
|
||||
// used in situations where an unexpected branch is truly exceptional though!
|
||||
#undef likely
|
||||
#undef unlikely
|
||||
#ifdef __GNUC__
|
||||
#define likely( x ) __builtin_expect(x, 1)
|
||||
#define unlikely( x ) __builtin_expect(x, 0)
|
||||
#else
|
||||
#define likely( x ) (x)
|
||||
#define unlikely( x ) (x)
|
||||
#endif
|
||||
|
||||
// Like printf() except output goes to debug log file. Might be defined to do
|
||||
// nothing (not even evaluate its arguments).
|
||||
// void debug_printf( const char* format, ... );
|
||||
|
|
|
|||
|
|
@ -337,7 +337,9 @@ BLARGG_EXPORT gme_err_t gme_play ( Music_Emu* me, int n, short* p )
|
|||
BLARGG_EXPORT void gme_set_fade ( Music_Emu* me, int start_msec ) { me->set_fade( start_msec ); }
|
||||
BLARGG_EXPORT int gme_track_ended ( Music_Emu const* me ) { return me->track_ended(); }
|
||||
BLARGG_EXPORT int gme_tell ( Music_Emu const* me ) { return me->tell(); }
|
||||
BLARGG_EXPORT int gme_tell_samples ( Music_Emu const* me ) { return me->tell_samples(); }
|
||||
BLARGG_EXPORT gme_err_t gme_seek ( Music_Emu* me, int msec ) { return me->seek( msec ); }
|
||||
BLARGG_EXPORT gme_err_t gme_seek_samples ( Music_Emu* me, int n ) { return me->seek_samples( n ); }
|
||||
BLARGG_EXPORT int gme_voice_count ( Music_Emu const* me ) { return me->voice_count(); }
|
||||
BLARGG_EXPORT void gme_ignore_silence ( Music_Emu* me, int disable ) { me->ignore_silence( disable != 0 ); }
|
||||
BLARGG_EXPORT void gme_set_tempo ( Music_Emu* me, double t ) { me->set_tempo( t ); }
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* Game music emulator library C interface (also usable from C++) */
|
||||
|
||||
/* Game_Music_Emu 0.6.0 */
|
||||
/* Game_Music_Emu 0.6.1 */
|
||||
#ifndef GME_H
|
||||
#define GME_H
|
||||
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define GME_VERSION 0x000600 /* 1 byte major, 1 byte minor, 1 byte patch-level */
|
||||
#define GME_VERSION 0x000601 /* 1 byte major, 1 byte minor, 1 byte patch-level */
|
||||
|
||||
/* Error string returned by library functions, or NULL if no error (success) */
|
||||
typedef const char* gme_err_t;
|
||||
|
|
@ -47,9 +47,15 @@ int gme_track_ended( Music_Emu const* );
|
|||
/* Number of milliseconds (1000 = one second) played since beginning of track */
|
||||
int gme_tell( Music_Emu const* );
|
||||
|
||||
/* Number of samples generated since beginning of track */
|
||||
int gme_tell_samples( Music_Emu const* );
|
||||
|
||||
/* Seek to new time in track. Seeking backwards or far forward can take a while. */
|
||||
gme_err_t gme_seek( Music_Emu*, int msec );
|
||||
|
||||
/* Equivalent to restarting track then skipping n samples */
|
||||
gme_err_t gme_seek_samples( Music_Emu*, int n );
|
||||
|
||||
|
||||
/******** Informational ********/
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# later are used by pkg-config.
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
lib_suffix=
|
||||
lib_suffix=@LIB_SUFFIX@
|
||||
libdir=${exec_prefix}/lib${lib_suffix}
|
||||
includedir=${prefix}/include
|
||||
|
||||
|
|
@ -13,3 +13,4 @@ URL: http://code.google.com/p/game-music-emu/
|
|||
Version: @GME_VERSION@
|
||||
Cflags: -I${includedir}
|
||||
Libs: -L${libdir} -lgme
|
||||
Libs.private: -lstdc++
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* Game music emulator library C interface (also usable from C++) */
|
||||
|
||||
/* Game_Music_Emu 0.6.0 */
|
||||
/* Game_Music_Emu 0.6.1 */
|
||||
#ifndef GME_H
|
||||
#define GME_H
|
||||
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define GME_VERSION 0x000600 /* 1 byte major, 1 byte minor, 1 byte patch-level */
|
||||
#define GME_VERSION 0x000601 /* 1 byte major, 1 byte minor, 1 byte patch-level */
|
||||
|
||||
/* Error string returned by library functions, or NULL if no error (success) */
|
||||
typedef const char* gme_err_t;
|
||||
|
|
@ -47,9 +47,15 @@ int gme_track_ended( Music_Emu const* );
|
|||
/* Number of milliseconds (1000 = one second) played since beginning of track */
|
||||
int gme_tell( Music_Emu const* );
|
||||
|
||||
/* Number of samples generated since beginning of track */
|
||||
int gme_tell_samples( Music_Emu const* );
|
||||
|
||||
/* Seek to new time in track. Seeking backwards or far forward can take a while. */
|
||||
gme_err_t gme_seek( Music_Emu*, int msec );
|
||||
|
||||
/* Equivalent to restarting track then skipping n samples */
|
||||
gme_err_t gme_seek_samples( Music_Emu*, int n );
|
||||
|
||||
|
||||
/******** Informational ********/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
Game_Music_Emu 0.6.0: Game Music Emulators
|
||||
Game_Music_Emu 0.6.2: Game Music Emulators
|
||||
------------------------------------------
|
||||
Game_Music_Emu is a collection of video game music file emulators that
|
||||
support the following formats and systems:
|
||||
|
|
@ -34,30 +34,45 @@ several architectures, Mac OS, MorphOS, Xbox, PlayStation Portable,
|
|||
GP2X, and Nintendo DS.
|
||||
|
||||
Author : Shay Green <gblargg@gmail.com>
|
||||
Website: http://www.slack.net/~ant/
|
||||
Forum : http://groups.google.com/group/blargg-sound-libs
|
||||
Website: https://bitbucket.org/mpyne/game-music-emu/wiki/Home
|
||||
License: GNU Lesser General Public License (LGPL)
|
||||
|
||||
Current Maintainer: Michael Pyne <mpyne@purinchu.net>
|
||||
|
||||
Getting Started
|
||||
---------------
|
||||
Build a program consisting of demo/basics.c, demo/Wave_Writer.cpp, and
|
||||
all source files in gme/. If you have CMake 2.6 or later, execute
|
||||
all source files in gme/.
|
||||
|
||||
run cmake
|
||||
cd demo
|
||||
run make
|
||||
Or, if you have CMake 2.6 or later, execute at a command prompt (from the
|
||||
extracted source directory):
|
||||
|
||||
Be sure "test.nsf" is in the same directory as the program. Running it
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ../ # <-- Pass any needed CMake flags here
|
||||
make # To build the library
|
||||
cd demo
|
||||
make # To build the demo itself
|
||||
|
||||
Be sure "test.nsf" is in the same directory as the demo program. Running it
|
||||
should generate the recording "out.wav".
|
||||
|
||||
You can use "make install" to install the library. To choose where to install
|
||||
the library to, use the CMake argument "-DCMAKE_INSTALL_PREFIX=/usr/local"
|
||||
(and replace /usr/local with the base path you wish to use). Alternately, you
|
||||
can specify the base path to install to when you run "make install" by passing
|
||||
'DESTDIR=/usr/local' on the make install command line (again, replace
|
||||
/usr/local as appropriate).
|
||||
|
||||
To build a static library instead of shared (the default), pass
|
||||
-DBUILD_SHARED_LIBS=OFF to the cmake command when running cmake.
|
||||
|
||||
A slightly more extensive demo application is available in the player/
|
||||
directory. It requires SDL to build.
|
||||
|
||||
Read gme.txt for more information. Post to the discussion forum for
|
||||
assistance.
|
||||
|
||||
|
||||
Files
|
||||
-----
|
||||
gme.txt General notes about the library
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -379,6 +379,12 @@ if(${SRB2_CONFIG_HAVE_PNG} AND ${SRB2_CONFIG_HAVE_ZLIB})
|
|||
set(SRB2_HAVE_PNG ON)
|
||||
add_definitions(-DHAVE_PNG)
|
||||
add_definitions(-D_LARGEFILE64_SOURCE)
|
||||
set(SRB2_PNG_SOURCES apng.c)
|
||||
set(SRB2_PNG_HEADERS apng.h)
|
||||
prepend_sources(SRB2_PNG_SOURCES)
|
||||
prepend_sources(SRB2_PNG_HEADERS)
|
||||
source_group("Main" FILES ${SRB2_CORE_SOURCES} ${SRB2_CORE_HEADERS}
|
||||
${SRB2_PNG_SOURCES} ${SRB2_PNG_HEADERS})
|
||||
else()
|
||||
message(WARNING "You have specified that PNG is available but it was not found. SRB2Kart may not compile correctly.")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -341,6 +341,8 @@ endif
|
|||
|
||||
LIBS+=$(PNG_LDFLAGS)
|
||||
CFLAGS+=$(PNG_CFLAGS)
|
||||
|
||||
OBJS+=$(OBJDIR)/apng.o
|
||||
endif
|
||||
|
||||
ifdef HAVE_LIBGME
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ WFLAGS+=-Wfloat-equal
|
|||
#WFLAGS+=-Wtraditional
|
||||
ifdef VCHELP
|
||||
WFLAGS+=-Wdeclaration-after-statement
|
||||
WFLAGS+=-Wno-error=declaration-after-statement
|
||||
endif
|
||||
WFLAGS+=-Wundef
|
||||
ifndef GCC295
|
||||
|
|
@ -189,12 +190,6 @@ ifdef GCC46
|
|||
WFLAGS+=-Wno-suggest-attribute=noreturn
|
||||
endif
|
||||
|
||||
ifndef MINGW
|
||||
ifdef GCC45
|
||||
WFLAGS+=-Wunsuffixed-float-constants
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef NOLDWARNING
|
||||
LDFLAGS+=-Wl,--as-needed
|
||||
endif
|
||||
|
|
@ -208,6 +203,9 @@ WFLAGS+=$(OLDWFLAGS)
|
|||
ifdef GCC43
|
||||
#WFLAGS+=-Wno-error=clobbered
|
||||
endif
|
||||
ifdef GCC44
|
||||
WFLAGS+=-Wno-error=array-bounds
|
||||
endif
|
||||
ifdef GCC46
|
||||
WFLAGS+=-Wno-error=suggest-attribute=noreturn
|
||||
endif
|
||||
|
|
@ -228,6 +226,7 @@ ifdef GCC80
|
|||
WFLAGS+=-Wno-format-overflow
|
||||
WFLAGS+=-Wno-stringop-truncation
|
||||
WFLAGS+=-Wno-stringop-overflow
|
||||
WFLAGS+=-Wno-error=multistatement-macros
|
||||
endif
|
||||
|
||||
|
||||
|
|
|
|||
289
src/apng.c
Normal file
289
src/apng.c
Normal file
|
|
@ -0,0 +1,289 @@
|
|||
/*
|
||||
Copyright 2019, James R.
|
||||
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.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT OWNER OR CONTRIBUTORS 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 <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "apng.h"
|
||||
|
||||
#define APNG_INFO_acTL 0x20000U
|
||||
|
||||
#define APNG_WROTE_acTL 0x10000U
|
||||
|
||||
struct apng_info_def
|
||||
{
|
||||
png_uint_32 mode;
|
||||
png_uint_32 valid;
|
||||
|
||||
png_uint_32 num_frames;
|
||||
png_uint_32 num_plays;
|
||||
|
||||
long start_acTL;/* acTL is written here */
|
||||
|
||||
png_flush_ptr output_flush_fn;
|
||||
apng_seek_ptr output_seek_fn;
|
||||
apng_tell_ptr output_tell_fn;
|
||||
|
||||
apng_set_acTL_ptr set_acTL_fn;
|
||||
};
|
||||
|
||||
/* PROTOS (FUCK COMPILER) */
|
||||
void apng_seek (png_structp, apng_const_infop, size_t);
|
||||
size_t apng_tell (png_structp, apng_const_infop);
|
||||
#ifdef PNG_WRITE_FLUSH_SUPPORTED
|
||||
void apng_flush (png_structp, apng_infop);
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
void apng_default_flush (png_structp);
|
||||
#endif/* PNG_STDIO_SUPPORTED */
|
||||
#endif/* PNG_WRITE_FLUSH_SUPPORTED */
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
void apng_default_seek (png_structp, size_t);
|
||||
size_t apng_default_tell (png_structp);
|
||||
#endif/* PNG_STDIO_SUPPORTED */
|
||||
void apng_write_IEND (png_structp);
|
||||
void apng_write_acTL (png_structp, png_uint_32, png_uint_32);
|
||||
#ifndef PNG_WRITE_APNG_SUPPORTED
|
||||
png_uint_32 apng_set_acTL_dummy (png_structp, png_infop,
|
||||
png_uint_32, png_uint_32);
|
||||
#endif/* PNG_WRITE_APNG_SUPPORTED */
|
||||
|
||||
apng_infop
|
||||
apng_create_info_struct (png_structp pngp)
|
||||
{
|
||||
apng_infop ainfop;
|
||||
(void)pngp;
|
||||
if (( ainfop = calloc(sizeof (apng_info),1) ))
|
||||
{
|
||||
apng_set_write_fn(pngp, ainfop, 0, 0, 0, 0, 0);
|
||||
apng_set_set_acTL_fn(pngp, ainfop, 0);
|
||||
}
|
||||
return ainfop;
|
||||
}
|
||||
|
||||
void
|
||||
apng_destroy_info_struct (png_structp pngp, apng_infopp ainfopp)
|
||||
{
|
||||
(void)pngp;
|
||||
if (!( pngp && ainfopp ))
|
||||
return;
|
||||
|
||||
free((*ainfopp));
|
||||
}
|
||||
|
||||
void
|
||||
apng_seek (png_structp pngp, apng_const_infop ainfop, size_t l)
|
||||
{
|
||||
(*(ainfop->output_seek_fn))(pngp, l);
|
||||
}
|
||||
|
||||
size_t
|
||||
apng_tell (png_structp pngp, apng_const_infop ainfop)
|
||||
{
|
||||
return (*(ainfop->output_tell_fn))(pngp);
|
||||
}
|
||||
|
||||
#ifdef PNG_WRITE_FLUSH_SUPPORTED
|
||||
void
|
||||
apng_flush (png_structp pngp, apng_infop ainfop)
|
||||
{
|
||||
if (ainfop->output_flush_fn)
|
||||
(*(ainfop->output_flush_fn))(pngp);
|
||||
}
|
||||
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
void
|
||||
apng_default_flush (png_structp pngp)
|
||||
{
|
||||
if (!( pngp ))
|
||||
return;
|
||||
|
||||
fflush((png_FILE_p)png_get_io_ptr);
|
||||
}
|
||||
#endif/* PNG_STDIO_SUPPORTED */
|
||||
#endif/* PNG_WRITE_FLUSH_SUPPORTED */
|
||||
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
void
|
||||
apng_default_seek (png_structp pngp, size_t l)
|
||||
{
|
||||
if (!( pngp ))
|
||||
return;
|
||||
|
||||
if (fseek((png_FILE_p)png_get_io_ptr(pngp), (long)l, SEEK_SET) == -1)
|
||||
png_error(pngp, "Seek Error");
|
||||
}
|
||||
|
||||
size_t
|
||||
apng_default_tell (png_structp pngp)
|
||||
{
|
||||
long l;
|
||||
|
||||
if (!( pngp ))
|
||||
{
|
||||
png_error(pngp, "Call to apng_default_tell with NULL pngp failed");
|
||||
}
|
||||
|
||||
if (( l = ftell((png_FILE_p)png_get_io_ptr(pngp)) ) == -1)
|
||||
png_error(pngp, "Tell Error");
|
||||
|
||||
return (size_t)l;
|
||||
}
|
||||
#endif/* PNG_STDIO_SUPPORTED */
|
||||
|
||||
void
|
||||
apng_set_write_fn (png_structp pngp, apng_infop ainfop, png_voidp iop,
|
||||
png_rw_ptr write_f, png_flush_ptr flush_f,
|
||||
apng_seek_ptr seek_f, apng_tell_ptr tell_f)
|
||||
{
|
||||
if (!( pngp && ainfop ))
|
||||
return;
|
||||
|
||||
png_set_write_fn(pngp, iop, write_f, flush_f);
|
||||
|
||||
#ifdef PNG_WRITE_FLUSH_SUPPORTED
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
if (!flush_f)
|
||||
ainfop->output_flush_fn = &apng_default_flush;
|
||||
else
|
||||
#endif/* PNG_STDIO_SUPPORTED */
|
||||
ainfop->output_flush_fn = flush_f;
|
||||
#endif/* PNG_WRITE_FLUSH_SUPPORTED */
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
if (!seek_f)
|
||||
ainfop->output_seek_fn = &apng_default_seek;
|
||||
else
|
||||
#endif/* PNG_STDIO_SUPPORTED */
|
||||
ainfop->output_seek_fn = seek_f;
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
if (!seek_f)
|
||||
ainfop->output_tell_fn = apng_default_tell;
|
||||
else
|
||||
#endif/* PNG_STDIO_SUPPORTED */
|
||||
ainfop->output_tell_fn = tell_f;
|
||||
}
|
||||
|
||||
void
|
||||
apng_write_IEND (png_structp pngp)
|
||||
{
|
||||
png_byte chunkc[] = "IEND";
|
||||
png_write_chunk(pngp, chunkc, 0, 0);
|
||||
}
|
||||
|
||||
void
|
||||
apng_write_acTL (png_structp pngp, png_uint_32 frames, png_uint_32 plays)
|
||||
{
|
||||
png_byte chunkc[] = "acTL";
|
||||
png_byte buf[8];
|
||||
png_save_uint_32(buf, frames);
|
||||
png_save_uint_32(buf + 4, plays);
|
||||
png_write_chunk(pngp, chunkc, buf, 8);
|
||||
}
|
||||
|
||||
png_uint_32
|
||||
apng_set_acTL (png_structp pngp, png_infop infop, apng_infop ainfop,
|
||||
png_uint_32 frames, png_uint_32 plays)
|
||||
{
|
||||
(void)pngp;
|
||||
(void)infop;
|
||||
if (!( pngp && infop && ainfop ))
|
||||
return 0;
|
||||
|
||||
ainfop->num_frames = frames;
|
||||
ainfop->num_plays = plays;
|
||||
|
||||
ainfop->valid |= APNG_INFO_acTL;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
apng_write_info_before_PLTE (png_structp pngp, png_infop infop,
|
||||
apng_infop ainfop)
|
||||
{
|
||||
if (!( pngp && infop && ainfop ))
|
||||
return;
|
||||
|
||||
png_write_info_before_PLTE(pngp, infop);
|
||||
|
||||
if (( ainfop->valid & APNG_INFO_acTL )&&!( ainfop->mode & APNG_WROTE_acTL ))
|
||||
{
|
||||
ainfop->start_acTL = apng_tell(pngp, ainfop);
|
||||
|
||||
apng_write_acTL(pngp, 0, 0);
|
||||
/* modified for runtime dynamic linking */
|
||||
(*(ainfop->set_acTL_fn))(pngp, infop, PNG_UINT_31_MAX, 0);
|
||||
|
||||
ainfop->mode |= APNG_WROTE_acTL;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
apng_write_info (png_structp pngp, png_infop infop,
|
||||
apng_infop ainfop)
|
||||
{
|
||||
apng_write_info_before_PLTE(pngp, infop, ainfop);
|
||||
png_write_info(pngp, infop);
|
||||
}
|
||||
|
||||
void
|
||||
apng_write_end (png_structp pngp, png_infop infop, apng_infop ainfop)
|
||||
{
|
||||
(void)infop;
|
||||
apng_write_IEND(pngp);
|
||||
apng_seek(pngp, ainfop, ainfop->start_acTL);
|
||||
apng_write_acTL(pngp, ainfop->num_frames, ainfop->num_plays);
|
||||
|
||||
#ifdef PNG_WRITE_FLUSH_SUPPORTED
|
||||
#ifdef PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED
|
||||
apng_flush(pngp, infop);
|
||||
#endif/* PNG_WRITE_FLUSH_SUPPORTED */
|
||||
#endif/* PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED */
|
||||
}
|
||||
|
||||
#ifndef PNG_WRITE_APNG_SUPPORTED
|
||||
png_uint_32
|
||||
apng_set_acTL_dummy (png_structp pngp, png_infop infop,
|
||||
png_uint_32 frames, png_uint_32 plays)
|
||||
{
|
||||
(void)pngp;
|
||||
(void)infop;
|
||||
(void)frames;
|
||||
(void)plays;
|
||||
return 0;
|
||||
}
|
||||
#endif/* PNG_WRITE_APNG_SUPPORTED */
|
||||
|
||||
/* Dynamic runtime linking capable! (Hopefully.) */
|
||||
void
|
||||
apng_set_set_acTL_fn (png_structp pngp, apng_infop ainfop,
|
||||
apng_set_acTL_ptr set_acTL_f)
|
||||
{
|
||||
(void)pngp;
|
||||
if (!ainfop->set_acTL_fn)
|
||||
#ifndef PNG_WRITE_APNG_SUPPORTED
|
||||
ainfop->set_acTL_fn = &apng_set_acTL_dummy;
|
||||
#else
|
||||
ainfop->set_acTL_fn = &png_set_acTL;
|
||||
#endif/* PNG_WRITE_APNG_SUPPORTED */
|
||||
else
|
||||
ainfop->set_acTL_fn = set_acTL_f;
|
||||
}
|
||||
82
src/apng.h
Normal file
82
src/apng.h
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
Copyright 2019, James R.
|
||||
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.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT OWNER OR CONTRIBUTORS 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.
|
||||
*/
|
||||
|
||||
#ifndef APNG_H
|
||||
#define APNG_H
|
||||
|
||||
#ifndef _MSC_VER
|
||||
#ifndef _WII
|
||||
#ifndef _LARGEFILE64_SOURCE
|
||||
#define _LARGEFILE64_SOURCE
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _LFS64_LARGEFILE
|
||||
#define _LFS64_LARGEFILE
|
||||
#endif
|
||||
|
||||
#ifndef _FILE_OFFSET_BITS
|
||||
#define _FILE_OFFSET_BITS 0
|
||||
#endif
|
||||
|
||||
#include <png.h>
|
||||
|
||||
typedef struct apng_info_def apng_info;
|
||||
typedef apng_info * apng_infop;
|
||||
typedef const apng_info * apng_const_infop;
|
||||
typedef apng_info * * apng_infopp;
|
||||
|
||||
typedef void (*apng_seek_ptr)(png_structp, size_t);
|
||||
typedef size_t (*apng_tell_ptr)(png_structp);
|
||||
|
||||
typedef png_uint_32 (*apng_set_acTL_ptr)(png_structp, png_infop,
|
||||
png_uint_32, png_uint_32);
|
||||
|
||||
apng_infop apng_create_info_struct (png_structp png_ptr);
|
||||
|
||||
void apng_destroy_info_struct (png_structp png_ptr,
|
||||
apng_infopp info_ptr_ptr);
|
||||
|
||||
/* Call the following functions in place of the libpng counterparts. */
|
||||
|
||||
png_uint_32 apng_set_acTL (png_structp png_ptr, png_infop info_ptr,
|
||||
apng_infop ainfo_ptr,
|
||||
png_uint_32 num_frames, png_uint_32 num_plays);
|
||||
|
||||
void apng_write_info_before_PLTE (png_structp png_ptr, png_infop info_ptr,
|
||||
apng_infop ainfo_ptr);
|
||||
void apng_write_info (png_structp png_ptr, png_infop info_ptr,
|
||||
apng_infop ainfo_ptr);
|
||||
|
||||
void apng_write_end (png_structp png_ptr, png_infop info_ptr,
|
||||
apng_infop ainfo_ptr);
|
||||
|
||||
void apng_set_write_fn (png_structp png_ptr, apng_infop ainfo_ptr,
|
||||
png_voidp io_ptr,
|
||||
png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn,
|
||||
apng_seek_ptr output_seek_fn, apng_tell_ptr output_tell_fn);
|
||||
|
||||
void apng_set_set_acTL_fn (png_structp png_ptr, apng_infop ainfo_ptr,
|
||||
apng_set_acTL_ptr set_acTL_fn);
|
||||
|
||||
#endif/* APNG_H */
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
* Last updated 2015 / 05 / 03 - SRB2 v2.1.15 - srb2.srb
|
||||
* Last updated 2018 / 12 / 23 - SRB2 v2.1.22 - patch.dta
|
||||
* Last updated 2019 / 01 / 18 - Kart v1.0.2 - Main assets
|
||||
* Last updated 2019 / 01 / 15 - Kart v1.0.2 - patch.kart
|
||||
* Last updated 2019 / 02 / 04 - Kart v1.0.3 - patch.kart
|
||||
*/
|
||||
|
||||
// Base SRB2 hashes
|
||||
|
|
@ -52,7 +52,7 @@
|
|||
#define ASSET_HASH_CHARS_KART "e2c428347dde52858a3dacd29fc5b964"
|
||||
#define ASSET_HASH_MAPS_KART "1335cd064656aedca359cfbb5233ac4a"
|
||||
#ifdef USE_PATCH_KART
|
||||
#define ASSET_HASH_PATCH_KART "899aee1b63e731b7e2098406c85608b4"
|
||||
#define ASSET_HASH_PATCH_KART "e06c1c90e5645c886026311964f8e1f5"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
203
src/d_clisrv.c
203
src/d_clisrv.c
|
|
@ -93,6 +93,7 @@ static tic_t freezetimeout[MAXNETNODES]; // Until when can this node freeze the
|
|||
UINT16 pingmeasurecount = 1;
|
||||
UINT32 realpingtable[MAXPLAYERS]; //the base table of ping where an average will be sent to everyone.
|
||||
UINT32 playerpingtable[MAXPLAYERS]; //table of player latency values.
|
||||
tic_t servermaxping = 800; // server's max ping. Defaults to 800
|
||||
#endif
|
||||
SINT8 nodetoplayer[MAXNETNODES];
|
||||
SINT8 nodetoplayer2[MAXNETNODES]; // say the numplayer for this node if any (splitscreen)
|
||||
|
|
@ -648,6 +649,8 @@ static inline void resynch_write_player(resynch_pak *rsp, const size_t i)
|
|||
|
||||
rsp->jointime = (tic_t)LONG(players[i].jointime);
|
||||
|
||||
rsp->splitscreenindex = players[i].splitscreenindex;
|
||||
|
||||
rsp->hasmo = false;
|
||||
//Transfer important mo information if the player has a body.
|
||||
//This lets us resync players even if they are dead.
|
||||
|
|
@ -783,6 +786,8 @@ static void resynch_read_player(resynch_pak *rsp)
|
|||
|
||||
players[i].jointime = (tic_t)LONG(rsp->jointime);
|
||||
|
||||
players[i].splitscreenindex = rsp->splitscreenindex;
|
||||
|
||||
//We get a packet for each player in game.
|
||||
if (!playeringame[i])
|
||||
return;
|
||||
|
|
@ -2211,8 +2216,10 @@ static void CL_ConnectToServer(boolean viams)
|
|||
}
|
||||
while (!(cl_mode == CL_CONNECTED && (client || (server && nodewaited <= pnumnodes))));
|
||||
|
||||
#ifndef NONET
|
||||
if (netgame)
|
||||
F_StartWaitingPlayers();
|
||||
#endif
|
||||
DEBFILE(va("Synchronisation Finished\n"));
|
||||
|
||||
displayplayer = consoleplayer;
|
||||
|
|
@ -2540,6 +2547,8 @@ static void CL_RemovePlayer(INT32 playernum, INT32 reason)
|
|||
|
||||
#ifdef HAVE_BLUA
|
||||
LUAh_PlayerQuit(&players[playernum], reason); // Lua hook for player quitting
|
||||
#else
|
||||
(void)reason;
|
||||
#endif
|
||||
|
||||
// Reset player data
|
||||
|
|
@ -2723,7 +2732,10 @@ static void Command_Ban(void)
|
|||
else
|
||||
{
|
||||
if (server) // only the server is allowed to do this right now
|
||||
{
|
||||
Ban_Add(COM_Argv(2));
|
||||
D_SaveBan(); // save the ban list
|
||||
}
|
||||
|
||||
if (COM_Argc() == 2)
|
||||
{
|
||||
|
|
@ -2754,6 +2766,42 @@ static void Command_Ban(void)
|
|||
|
||||
}
|
||||
|
||||
static void Command_BanIP(void)
|
||||
{
|
||||
if (COM_Argc() < 2)
|
||||
{
|
||||
CONS_Printf(M_GetText("banip <ip> <reason>: ban an ip address\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (server) // Only the server can use this, otherwise does nothing.
|
||||
{
|
||||
const char *address = (COM_Argv(1));
|
||||
const char *reason;
|
||||
|
||||
if (COM_Argc() == 2)
|
||||
reason = NULL;
|
||||
else
|
||||
reason = COM_Argv(2);
|
||||
|
||||
|
||||
if (I_SetBanAddress && I_SetBanAddress(address, NULL))
|
||||
{
|
||||
if (reason)
|
||||
CONS_Printf("Banned IP address %s for: %s\n", address, reason);
|
||||
else
|
||||
CONS_Printf("Banned IP address %s\n", address);
|
||||
|
||||
Ban_Add(reason);
|
||||
D_SaveBan();
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void Command_Kick(void)
|
||||
{
|
||||
if (COM_Argc() < 2)
|
||||
|
|
@ -3060,6 +3108,7 @@ void D_ClientServerInit(void)
|
|||
COM_AddCommand("getplayernum", Command_GetPlayerNum);
|
||||
COM_AddCommand("kick", Command_Kick);
|
||||
COM_AddCommand("ban", Command_Ban);
|
||||
COM_AddCommand("banip", Command_BanIP);
|
||||
COM_AddCommand("clearbans", Command_ClearBans);
|
||||
COM_AddCommand("showbanlist", Command_ShowBan);
|
||||
COM_AddCommand("reloadbans", Command_ReloadBan);
|
||||
|
|
@ -3314,6 +3363,8 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
|
|||
addedtogame = true;
|
||||
}
|
||||
|
||||
players[newplayernum].splitscreenindex = splitscreenplayer;
|
||||
|
||||
if (netgame)
|
||||
{
|
||||
if (server && cv_showjoinaddress.value)
|
||||
|
|
@ -4083,6 +4134,21 @@ FILESTAMP
|
|||
else if (resynch_score[node])
|
||||
--resynch_score[node];
|
||||
break;
|
||||
case PT_BASICKEEPALIVE:
|
||||
if (client)
|
||||
break;
|
||||
|
||||
// This should probably still timeout though, as the node should always have a player 1 number
|
||||
if (netconsole == -1)
|
||||
break;
|
||||
|
||||
// If a client sends this it should mean they are done receiving the savegame
|
||||
sendingsavegame[node] = false;
|
||||
|
||||
// As long as clients send keep alives, the server can keep running, so reset the timeout
|
||||
/// \todo Use a separate cvar for that kind of timeout?
|
||||
freezetimeout[node] = I_GetTime() + connectiontimeout;
|
||||
break;
|
||||
case PT_TEXTCMD:
|
||||
case PT_TEXTCMD2:
|
||||
case PT_TEXTCMD3:
|
||||
|
|
@ -4336,10 +4402,12 @@ FILESTAMP
|
|||
//Update client ping table from the server.
|
||||
if (client)
|
||||
{
|
||||
INT32 i;
|
||||
UINT8 i;
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i])
|
||||
playerpingtable[i] = (tic_t)netbuffer->u.pingtable[i];
|
||||
|
||||
servermaxping = (tic_t)netbuffer->u.pingtable[MAXPLAYERS];
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
@ -4586,6 +4654,15 @@ static INT16 Consistancy(void)
|
|||
return (INT16)(ret & 0xFFFF);
|
||||
}
|
||||
|
||||
// confusing, but this DOESN'T send PT_NODEKEEPALIVE, it sends PT_BASICKEEPALIVE
|
||||
// used during wipes to tell the server that a node is still connected
|
||||
static void CL_SendClientKeepAlive(void)
|
||||
{
|
||||
netbuffer->packettype = PT_BASICKEEPALIVE;
|
||||
|
||||
HSendPacket(servernode, false, 0, 0);
|
||||
}
|
||||
|
||||
// send the client packet to the server
|
||||
static void CL_SendClientCmd(void)
|
||||
{
|
||||
|
|
@ -4973,6 +5050,18 @@ void TryRunTics(tic_t realtics)
|
|||
}
|
||||
|
||||
#ifdef NEWPING
|
||||
|
||||
/* Ping Update except better:
|
||||
We call this once per second and check for people's pings. If their ping happens to be too high, we increment some timer and kick them out.
|
||||
If they're not lagging, decrement the timer by 1. Of course, reset all of this if they leave.
|
||||
|
||||
Why do we do that? Well, I'm a person with unfortunately sometimes unstable internet and happen to keep getting kicked very unconveniently for very short high spikes. (700+ ms)
|
||||
Because my spikes are so high, the average ping is exponentially higher too (700s really add up...!) which leads me to getting kicked for a short burst of spiking.
|
||||
With this change here, this doesn't happen anymore as it checks if my ping has been CONSISTENTLY bad for long enough before killing me.
|
||||
*/
|
||||
|
||||
static INT32 pingtimeout[MAXPLAYERS];
|
||||
|
||||
static inline void PingUpdate(void)
|
||||
{
|
||||
INT32 i;
|
||||
|
|
@ -4993,6 +5082,9 @@ static inline void PingUpdate(void)
|
|||
laggers[i] = true;
|
||||
numlaggers++;
|
||||
}
|
||||
else
|
||||
pingtimeout[i] = 0;
|
||||
|
||||
}
|
||||
|
||||
//kick lagging players... unless everyone but the server's ping sucks.
|
||||
|
|
@ -5003,12 +5095,20 @@ static inline void PingUpdate(void)
|
|||
{
|
||||
if (playeringame[i] && laggers[i])
|
||||
{
|
||||
XBOXSTATIC char buf[2];
|
||||
pingtimeout[i]++;
|
||||
if (pingtimeout[i] > cv_pingtimeout.value) // ok your net has been bad for too long, you deserve to die.
|
||||
{
|
||||
XBOXSTATIC char buf[2];
|
||||
|
||||
buf[0] = (char)i;
|
||||
buf[1] = KICK_MSG_PING_HIGH;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
pingtimeout[i] = 0;
|
||||
|
||||
buf[0] = (char)i;
|
||||
buf[1] = KICK_MSG_PING_HIGH;
|
||||
SendNetXCmd(XD_KICK, &buf, 2);
|
||||
}
|
||||
}
|
||||
else // you aren't lagging, but you aren't free yet. In case you'll keep spiking, we just make the timer go back down. (Very unstable net must still get kicked).
|
||||
pingtimeout[i] = (pingtimeout[i] == 0 ? 0 : pingtimeout[i]-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5023,18 +5123,89 @@ static inline void PingUpdate(void)
|
|||
realpingtable[i] = 0; //Reset each as we go.
|
||||
}
|
||||
|
||||
// send the server's maxping as last element of our ping table. This is useful to let us know when we're about to get kicked.
|
||||
netbuffer->u.pingtable[MAXPLAYERS] = cv_maxping.value;
|
||||
|
||||
//send out our ping packets
|
||||
for (i = 0; i < MAXNETNODES; i++)
|
||||
if (nodeingame[i])
|
||||
HSendPacket(i, true, 0, sizeof(INT32) * MAXPLAYERS);
|
||||
HSendPacket(i, true, 0, sizeof(INT32) * (MAXPLAYERS+1));
|
||||
|
||||
pingmeasurecount = 1; //Reset count
|
||||
}
|
||||
#endif
|
||||
|
||||
static tic_t gametime = 0;
|
||||
|
||||
#ifdef NEWPING
|
||||
static void UpdatePingTable(void)
|
||||
{
|
||||
INT32 i;
|
||||
if (server)
|
||||
{
|
||||
if (netgame && !(gametime % 35)) // update once per second.
|
||||
PingUpdate();
|
||||
// update node latency values so we can take an average later.
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i])
|
||||
realpingtable[i] += G_TicsToMilliseconds(GetLag(playernode[i]));
|
||||
pingmeasurecount++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Handle timeouts to prevent definitive freezes from happenning
|
||||
static void HandleNodeTimeouts(void)
|
||||
{
|
||||
INT32 i;
|
||||
if (server)
|
||||
for (i = 1; i < MAXNETNODES; i++)
|
||||
if (nodeingame[i] && freezetimeout[i] < I_GetTime())
|
||||
Net_ConnectionTimeout(i);
|
||||
}
|
||||
|
||||
// Keep the network alive while not advancing tics!
|
||||
void NetKeepAlive(void)
|
||||
{
|
||||
tic_t nowtime;
|
||||
INT32 realtics;
|
||||
|
||||
nowtime = I_GetTime();
|
||||
realtics = nowtime - gametime;
|
||||
|
||||
// return if there's no time passed since the last call
|
||||
if (realtics <= 0) // nothing new to update
|
||||
return;
|
||||
|
||||
#ifdef NEWPING
|
||||
UpdatePingTable();
|
||||
#endif
|
||||
|
||||
if (server)
|
||||
CL_SendClientKeepAlive();
|
||||
|
||||
// Sryder: What is FILESTAMP???
|
||||
FILESTAMP
|
||||
GetPackets();
|
||||
FILESTAMP
|
||||
|
||||
MasterClient_Ticker();
|
||||
|
||||
if (client)
|
||||
{
|
||||
// send keep alive
|
||||
CL_SendClientKeepAlive();
|
||||
// No need to check for resynch because we aren't running any tics
|
||||
}
|
||||
// No else because no tics are being run and we can't resynch during this
|
||||
|
||||
Net_AckTicker();
|
||||
HandleNodeTimeouts();
|
||||
SV_FileSendTicker();
|
||||
}
|
||||
|
||||
void NetUpdate(void)
|
||||
{
|
||||
static tic_t gametime = 0;
|
||||
static tic_t resptime = 0;
|
||||
tic_t nowtime;
|
||||
INT32 i;
|
||||
|
|
@ -5056,16 +5227,7 @@ void NetUpdate(void)
|
|||
gametime = nowtime;
|
||||
|
||||
#ifdef NEWPING
|
||||
if (server)
|
||||
{
|
||||
if (netgame && !(gametime % 255))
|
||||
PingUpdate();
|
||||
// update node latency values so we can take an average later.
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i])
|
||||
realpingtable[i] += G_TicsToMilliseconds(GetLag(playernode[i]));
|
||||
pingmeasurecount++;
|
||||
}
|
||||
UpdatePingTable();
|
||||
#endif
|
||||
|
||||
if (client)
|
||||
|
|
@ -5133,12 +5295,7 @@ FILESTAMP
|
|||
}
|
||||
}
|
||||
Net_AckTicker();
|
||||
// Handle timeouts to prevent definitive freezes from happenning
|
||||
if (server)
|
||||
for (i = 1; i < MAXNETNODES; i++)
|
||||
if (nodeingame[i] && freezetimeout[i] < I_GetTime())
|
||||
Net_ConnectionTimeout(i);
|
||||
nowtime /= NEWTICRATERATIO;
|
||||
HandleNodeTimeouts();
|
||||
if (nowtime > resptime)
|
||||
{
|
||||
resptime = nowtime;
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ typedef enum
|
|||
PT_CLIENT3MIS,
|
||||
PT_CLIENT4CMD, // 4P
|
||||
PT_CLIENT4MIS,
|
||||
PT_BASICKEEPALIVE,// Keep the network alive during wipes, as tics aren't advanced and NetUpdate isn't called
|
||||
|
||||
PT_CANFAIL, // This is kind of a priority. Anything bigger than CANFAIL
|
||||
// allows HSendPacket(*, true, *, *) to return false.
|
||||
|
|
@ -282,6 +283,8 @@ typedef struct
|
|||
|
||||
tic_t jointime;
|
||||
|
||||
UINT8 splitscreenindex;
|
||||
|
||||
//player->mo stuff
|
||||
UINT8 hasmo; // Boolean
|
||||
|
||||
|
|
@ -449,10 +452,10 @@ typedef struct
|
|||
serverrefuse_pak serverrefuse; // 65025 bytes (somehow I feel like those values are garbage...)
|
||||
askinfo_pak askinfo; // 61 bytes
|
||||
msaskinfo_pak msaskinfo; // 22 bytes
|
||||
plrinfo playerinfo[MAXPLAYERS]; // 1152 bytes (I'd say 36~38)
|
||||
plrconfig playerconfig[MAXPLAYERS]; // (up to) 896 bytes (welp they ARE)
|
||||
plrinfo playerinfo[MAXPLAYERS]; // 576 bytes(?)
|
||||
plrconfig playerconfig[MAXPLAYERS]; // (up to) 528 bytes(?)
|
||||
#ifdef NEWPING
|
||||
UINT32 pingtable[MAXPLAYERS]; // 128 bytes
|
||||
UINT32 pingtable[MAXPLAYERS+1]; // 68 bytes
|
||||
#endif
|
||||
} u; // This is needed to pack diff packet types data together
|
||||
} ATTRPACK doomdata_t;
|
||||
|
|
@ -518,6 +521,7 @@ extern tic_t jointimeout;
|
|||
extern UINT16 pingmeasurecount;
|
||||
extern UINT32 realpingtable[MAXPLAYERS];
|
||||
extern UINT32 playerpingtable[MAXPLAYERS];
|
||||
extern tic_t servermaxping;
|
||||
#endif
|
||||
|
||||
extern consvar_t
|
||||
|
|
@ -538,6 +542,7 @@ void SendNetXCmd3(netxcmd_t id, const void *param, size_t nparam); // splitsreen
|
|||
void SendNetXCmd4(netxcmd_t id, const void *param, size_t nparam); // splitsreen4 player
|
||||
|
||||
// Create any new ticcmds and broadcast to other players.
|
||||
void NetKeepAlive(void);
|
||||
void NetUpdate(void);
|
||||
|
||||
void SV_StartSinglePlayerServer(void);
|
||||
|
|
|
|||
24
src/d_main.c
24
src/d_main.c
|
|
@ -1162,7 +1162,7 @@ void D_SRB2Main(void)
|
|||
if (s) // Check for NULL?
|
||||
{
|
||||
if (!W_VerifyNMUSlumps(s))
|
||||
G_SetGameModified(true);
|
||||
G_SetGameModified(true, false);
|
||||
D_AddFile(s);
|
||||
}
|
||||
}
|
||||
|
|
@ -1189,7 +1189,7 @@ void D_SRB2Main(void)
|
|||
else
|
||||
{
|
||||
if (!M_CheckParm("-server"))
|
||||
G_SetGameModified(true);
|
||||
G_SetGameModified(true, true);
|
||||
autostart = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1325,10 +1325,6 @@ void D_SRB2Main(void)
|
|||
midi_disabled = true;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
CONS_Printf("S_InitSfxChannels(): Setting up sound channels.\n");
|
||||
}
|
||||
if (M_CheckParm("-nosound"))
|
||||
sound_disabled = true;
|
||||
if (M_CheckParm("-nomusic")) // combines -nomidimusic and -nodigmusic
|
||||
|
|
@ -1347,10 +1343,18 @@ void D_SRB2Main(void)
|
|||
if (M_CheckParm("-nodigmusic"))
|
||||
digital_disabled = true; // WARNING: DOS version initmusic in I_StartupSound
|
||||
}
|
||||
I_StartupSound();
|
||||
I_InitMusic();
|
||||
S_InitSfxChannels(cv_soundvolume.value);
|
||||
S_InitMusicDefs();
|
||||
if (!( sound_disabled && digital_disabled
|
||||
#ifndef NO_MIDI
|
||||
&& midi_disabled
|
||||
#endif
|
||||
))
|
||||
{
|
||||
CONS_Printf("S_InitSfxChannels(): Setting up sound channels.\n");
|
||||
I_StartupSound();
|
||||
I_InitMusic();
|
||||
S_InitSfxChannels(cv_soundvolume.value);
|
||||
S_InitMusicDefs();
|
||||
}
|
||||
|
||||
CONS_Printf("ST_Init(): Init status bar.\n");
|
||||
ST_Init();
|
||||
|
|
|
|||
|
|
@ -903,6 +903,9 @@ static void DebugPrintpacket(const char *header)
|
|||
(UINT32)ExpandTics(netbuffer->u.clientpak.client_tic),
|
||||
(UINT32)ExpandTics (netbuffer->u.clientpak.resendfrom));
|
||||
break;
|
||||
case PT_BASICKEEPALIVE:
|
||||
fprintf(debugfile, " keep alive\n");
|
||||
break;
|
||||
case PT_TEXTCMD:
|
||||
case PT_TEXTCMD2:
|
||||
case PT_TEXTCMD3:
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
#define __D_NET__
|
||||
|
||||
// Max computers in a game
|
||||
#define MAXNETNODES 16
|
||||
#define MAXNETNODES (MAXPLAYERS+4)
|
||||
#define BROADCASTADDR MAXNETNODES
|
||||
#define MAXSPLITSCREENPLAYERS 4 // Max number of players on a single computer
|
||||
#define NETSPLITSCREEN // Kart's splitscreen netgame feature
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ static CV_PossibleValue_t autobalance_cons_t[] = {{0, "MIN"}, {4, "MAX"}, {0, NU
|
|||
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 sleeping_cons_t[] = {{0, "MIN"}, {1000/TICRATE, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t competitionboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, {2, "Teleports"},
|
||||
{3, "None"}, {0, NULL}};
|
||||
|
||||
|
|
@ -236,6 +236,9 @@ static consvar_t cv_dummyconsvar = {"dummyconsvar", "Off", CV_CALL|CV_NOSHOWHELP
|
|||
consvar_t cv_restrictskinchange = {"restrictskinchange", "No", CV_NETVAR|CV_CHEAT, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_allowteamchange = {"allowteamchange", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t ingamecap_cons_t[] = {{0, "MIN"}, {MAXPLAYERS-1, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_ingamecap = {"ingamecap", "0", CV_NETVAR, ingamecap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_startinglives = {"startinglives", "3", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, startingliveslimit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t respawntime_cons_t[] = {{0, "MIN"}, {30, "MAX"}, {0, NULL}};
|
||||
|
|
@ -375,6 +378,7 @@ consvar_t cv_kartdebughuddrop = {"kartdebughuddrop", "Off", CV_NETVAR|CV_CHEAT|C
|
|||
|
||||
consvar_t cv_kartdebugcheckpoint = {"kartdebugcheckpoint", "Off", CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_kartdebugnodes = {"kartdebugnodes", "Off", CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_kartdebugcolorize = {"kartdebugcolorize", "Off", CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t votetime_cons_t[] = {{10, "MIN"}, {3600, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_votetime = {"votetime", "20", CV_NETVAR, votetime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
|
@ -433,6 +437,14 @@ consvar_t cv_jointimeout = {"jointimeout", "105", CV_CALL|CV_SAVE, nettimeout_co
|
|||
#ifdef NEWPING
|
||||
static CV_PossibleValue_t maxping_cons_t[] = {{0, "MIN"}, {1000, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_maxping = {"maxping", "800", CV_SAVE, maxping_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t pingtimeout_cons_t[] = {{8, "MIN"}, {120, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_pingtimeout = {"pingtimeout", "10", CV_SAVE, pingtimeout_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// show your ping on the HUD next to framerate. Defaults to warning only (shows up if your ping is > maxping)
|
||||
static CV_PossibleValue_t showping_cons_t[] = {{0, "Off"}, {1, "Always"}, {2, "Warning"}, {0, NULL}};
|
||||
consvar_t cv_showping = {"showping", "Warning", CV_SAVE, showping_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
#endif
|
||||
// Intermission time Tails 04-19-2002
|
||||
static CV_PossibleValue_t inttime_cons_t[] = {{0, "MIN"}, {3600, "MAX"}, {0, NULL}};
|
||||
|
|
@ -448,7 +460,7 @@ consvar_t cv_runscripts = {"runscripts", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL
|
|||
consvar_t cv_pause = {"pausepermission", "Server", CV_NETVAR, pause_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_mute = {"mute", "Off", CV_NETVAR|CV_CALL, CV_OnOff, Mute_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_sleep = {"cpusleep", "-1", CV_SAVE, sleeping_cons_t, NULL, -1, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_sleep = {"cpusleep", "1", CV_SAVE, sleeping_cons_t, NULL, -1, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
INT16 gametype = GT_RACE; // SRB2kart
|
||||
boolean forceresetplayers = false;
|
||||
|
|
@ -643,6 +655,7 @@ void D_RegisterServerCommands(void)
|
|||
CV_RegisterVar(&cv_allowexitlevel);
|
||||
CV_RegisterVar(&cv_restrictskinchange);
|
||||
CV_RegisterVar(&cv_allowteamchange);
|
||||
CV_RegisterVar(&cv_ingamecap);
|
||||
CV_RegisterVar(&cv_respawntime);
|
||||
CV_RegisterVar(&cv_killingdead);
|
||||
|
||||
|
|
@ -661,6 +674,8 @@ void D_RegisterServerCommands(void)
|
|||
CV_RegisterVar(&cv_sleep);
|
||||
#ifdef NEWPING
|
||||
CV_RegisterVar(&cv_maxping);
|
||||
CV_RegisterVar(&cv_pingtimeout);
|
||||
CV_RegisterVar(&cv_showping);
|
||||
#endif
|
||||
|
||||
#ifdef SEENAMES
|
||||
|
|
@ -2210,10 +2225,12 @@ static void Command_Map_f(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!(netgame || multiplayer) && (!modifiedgame || savemoddata))
|
||||
if (!(netgame || multiplayer) && !majormods)
|
||||
{
|
||||
if (COM_CheckParm("-force"))
|
||||
G_SetGameModified(false);
|
||||
{
|
||||
G_SetGameModified(false, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
CONS_Printf(M_GetText("Sorry, level change disabled in single player.\n"));
|
||||
|
|
@ -3792,7 +3809,7 @@ static void Command_RunSOC(void)
|
|||
if (!P_RunSOC(fn))
|
||||
CONS_Printf(M_GetText("Could not find SOC.\n"));
|
||||
else
|
||||
G_SetGameModified(multiplayer);
|
||||
G_SetGameModified(multiplayer, false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3846,7 +3863,7 @@ static void Got_RunSOCcmd(UINT8 **cp, INT32 playernum)
|
|||
}
|
||||
|
||||
P_RunSOC(filename);
|
||||
G_SetGameModified(true);
|
||||
G_SetGameModified(true, false);
|
||||
}
|
||||
|
||||
/** Adds a pwad at runtime.
|
||||
|
|
@ -3883,7 +3900,7 @@ static void Command_Addfile(void)
|
|||
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
|
||||
return;
|
||||
}
|
||||
G_SetGameModified(multiplayer);
|
||||
G_SetGameModified(multiplayer, false);
|
||||
}
|
||||
|
||||
// Add file on your client directly if it is trivial, or you aren't in a netgame.
|
||||
|
|
@ -4129,7 +4146,7 @@ static void Got_Addfilecmd(UINT8 **cp, INT32 playernum)
|
|||
return;
|
||||
}
|
||||
|
||||
G_SetGameModified(true);
|
||||
G_SetGameModified(true, false);
|
||||
}
|
||||
|
||||
static void Command_ListWADS_f(void)
|
||||
|
|
@ -4486,7 +4503,7 @@ static void Ringslinger_OnChange(void)
|
|||
}
|
||||
|
||||
if (cv_ringslinger.value) // Only if it's been turned on
|
||||
G_SetGameModified(multiplayer);
|
||||
G_SetGameModified(multiplayer, true);
|
||||
}
|
||||
|
||||
static void Gravity_OnChange(void)
|
||||
|
|
@ -4507,7 +4524,7 @@ static void Gravity_OnChange(void)
|
|||
#endif
|
||||
|
||||
if (!CV_IsSetToDefault(&cv_gravity))
|
||||
G_SetGameModified(multiplayer);
|
||||
G_SetGameModified(multiplayer, true);
|
||||
gravity = cv_gravity.value;
|
||||
}
|
||||
|
||||
|
|
@ -4903,7 +4920,7 @@ static void Fishcake_OnChange(void)
|
|||
// so don't make modifiedgame always on!
|
||||
if (cv_debug)
|
||||
{
|
||||
G_SetGameModified(multiplayer);
|
||||
G_SetGameModified(multiplayer, true);
|
||||
}
|
||||
|
||||
else if (cv_debug != cv_fishcake.value)
|
||||
|
|
@ -4919,12 +4936,14 @@ static void Fishcake_OnChange(void)
|
|||
*/
|
||||
static void Command_Isgamemodified_f(void)
|
||||
{
|
||||
if (savemoddata)
|
||||
CONS_Printf(M_GetText("modifiedgame is true, but you can save medal and record data in this mod.\n"));
|
||||
if (majormods)
|
||||
CONS_Printf("The game has been modified with major add-ons, so you cannot play Record Attack.\n");
|
||||
else if (savemoddata)
|
||||
CONS_Printf("The game has been modified with an add-on with its own save data, so you can play Record Attack and earn medals.\n");
|
||||
else if (modifiedgame)
|
||||
CONS_Printf(M_GetText("modifiedgame is true, extras will not be unlocked\n"));
|
||||
CONS_Printf("The game has been modified with only minor add-ons. You can play Record Attack, earn medals and unlock extras.\n");
|
||||
else
|
||||
CONS_Printf(M_GetText("modifiedgame is false, you can unlock extras\n"));
|
||||
CONS_Printf("The game has not been modified. You can play Record Attack, earn medals and unlock extras.\n");
|
||||
}
|
||||
|
||||
static void Command_Cheats_f(void)
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ extern consvar_t cv_mute;
|
|||
extern consvar_t cv_killingdead;
|
||||
extern consvar_t cv_pause;
|
||||
|
||||
extern consvar_t cv_restrictskinchange, cv_allowteamchange, cv_respawntime;
|
||||
extern consvar_t cv_restrictskinchange, cv_allowteamchange, cv_ingamecap, cv_respawntime;
|
||||
|
||||
/*extern consvar_t cv_teleporters, cv_superring, cv_supersneakers, cv_invincibility;
|
||||
extern consvar_t cv_jumpshield, cv_watershield, cv_ringshield, cv_forceshield, cv_bombshield;
|
||||
|
|
@ -126,7 +126,7 @@ extern consvar_t cv_karteliminatelast;
|
|||
extern consvar_t cv_votetime;
|
||||
|
||||
extern consvar_t cv_kartdebugitem, cv_kartdebugamount, cv_kartdebugshrink, cv_kartdebugdistribution, cv_kartdebughuddrop;
|
||||
extern consvar_t cv_kartdebugcheckpoint, cv_kartdebugnodes;
|
||||
extern consvar_t cv_kartdebugcheckpoint, cv_kartdebugnodes, cv_kartdebugcolorize;
|
||||
|
||||
extern consvar_t cv_itemfinder;
|
||||
|
||||
|
|
@ -145,6 +145,8 @@ extern consvar_t cv_specialrings, cv_powerstones, cv_matchboxes, cv_competitionb
|
|||
|
||||
#ifdef NEWPING
|
||||
extern consvar_t cv_maxping;
|
||||
extern consvar_t cv_pingtimeout;
|
||||
extern consvar_t cv_showping;
|
||||
#endif
|
||||
|
||||
extern consvar_t cv_skipmapcheck;
|
||||
|
|
|
|||
|
|
@ -426,7 +426,7 @@ void CL_LoadServerFiles(void)
|
|||
else if (fileneeded[i].status == FS_FOUND)
|
||||
{
|
||||
P_AddWadFile(fileneeded[i].filename);
|
||||
G_SetGameModified(true);
|
||||
G_SetGameModified(true, false);
|
||||
fileneeded[i].status = FS_OPEN;
|
||||
}
|
||||
else if (fileneeded[i].status == FS_MD5SUMBAD)
|
||||
|
|
|
|||
|
|
@ -348,10 +348,13 @@ typedef enum
|
|||
k_wanted, // Timer for determining WANTED status, lowers when hitting people, prevents the game turning into Camp Lazlo
|
||||
k_yougotem, // "You Got Em" gfx when hitting someone as a karma player via a method that gets you back in the game instantly
|
||||
|
||||
// v1.0.2 vars
|
||||
// v1.0.2+ vars
|
||||
k_itemblink, // Item flashing after roulette, prevents Hyudoro stealing AND serves as a mashing indicator
|
||||
k_itemblinkmode, // Type of flashing: 0 = white (normal), 1 = red (mashing), 2 = rainbow (enhanced items)
|
||||
k_getsparks, // Disable drift sparks at low speed, JUST enough to give acceleration the actual headstart above speed
|
||||
k_jawztargetdelay, // Delay for Jawz target switching, to make it less twitchy
|
||||
k_spectatewait, // How long have you been waiting as a spectator
|
||||
k_growcancel, // Hold the item button down to cancel Grow
|
||||
k_killfield, // How long have you been in the kill field, stay in too long and lose a bumper
|
||||
|
||||
NUMKARTSTUFF
|
||||
|
|
@ -570,6 +573,8 @@ typedef struct player_s
|
|||
UINT8 bot;
|
||||
|
||||
tic_t jointime; // Timer when player joins game to change skin/color
|
||||
|
||||
UINT8 splitscreenindex;
|
||||
#ifdef HWRENDER
|
||||
fixed_t fovadd; // adjust FOV for hw rendering
|
||||
#endif
|
||||
|
|
|
|||
319
src/dehacked.c
319
src/dehacked.c
|
|
@ -21,6 +21,7 @@
|
|||
#include "w_wad.h"
|
||||
#include "m_menu.h"
|
||||
#include "m_misc.h"
|
||||
#include "filesrch.h" // for refreshdirmenu
|
||||
#include "f_finale.h"
|
||||
#include "dehacked.h"
|
||||
#include "st_stuff.h"
|
||||
|
|
@ -79,8 +80,6 @@ static powertype_t get_power(const char *word);
|
|||
boolean deh_loaded = false;
|
||||
static int dbg_line;
|
||||
|
||||
static boolean gamedataadded = false;
|
||||
|
||||
#ifdef DELFILE
|
||||
typedef struct undehacked_s
|
||||
{
|
||||
|
|
@ -602,6 +601,14 @@ done:
|
|||
Z_Free(s);
|
||||
}
|
||||
|
||||
static int freeslotusage[2][2] = {{0, 0}, {0, 0}}; // [S_, MT_][max, previous .wad's max]
|
||||
|
||||
void DEH_UpdateMaxFreeslots(void)
|
||||
{
|
||||
freeslotusage[0][1] = freeslotusage[0][0];
|
||||
freeslotusage[1][1] = freeslotusage[1][0];
|
||||
}
|
||||
|
||||
// TODO: Figure out how to do undolines for this....
|
||||
// TODO: Warnings for running out of freeslots
|
||||
static void readfreeslots(MYFILE *f)
|
||||
|
|
@ -664,6 +671,7 @@ static void readfreeslots(MYFILE *f)
|
|||
if (!FREE_STATES[i]) {
|
||||
FREE_STATES[i] = Z_Malloc(strlen(word)+1, PU_STATIC, NULL);
|
||||
strcpy(FREE_STATES[i],word);
|
||||
freeslotusage[0][0]++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -673,6 +681,7 @@ static void readfreeslots(MYFILE *f)
|
|||
if (!FREE_MOBJS[i]) {
|
||||
FREE_MOBJS[i] = Z_Malloc(strlen(word)+1, PU_STATIC, NULL);
|
||||
strcpy(FREE_MOBJS[i],word);
|
||||
freeslotusage[1][0]++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -3139,6 +3148,7 @@ static void readmaincfg(MYFILE *f)
|
|||
strlcpy(gamedatafilename, word2, sizeof (gamedatafilename));
|
||||
strlwr(gamedatafilename);
|
||||
savemoddata = true;
|
||||
majormods = false;
|
||||
|
||||
// Also save a time attack folder
|
||||
filenamelen = strlen(gamedatafilename)-4; // Strip off the extension
|
||||
|
|
@ -3151,7 +3161,7 @@ static void readmaincfg(MYFILE *f)
|
|||
// can't use sprintf since there is %u in savegamename
|
||||
strcatbf(savegamename, srb2home, PATHSEP);
|
||||
|
||||
gamedataadded = true;
|
||||
refreshdirmenu |= REFRESHDIR_GAMEDATA;
|
||||
}
|
||||
else if (fastcmp(word, "RESETDATA"))
|
||||
{
|
||||
|
|
@ -3382,8 +3392,6 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
for (i = 0; i < NUMSFX; i++)
|
||||
savesfxnames[i] = S_sfx[i].name;
|
||||
|
||||
gamedataadded = false;
|
||||
|
||||
// it doesn't test the version of SRB2 and version of dehacked file
|
||||
dbg_line = -1; // start at -1 so the first line is 0.
|
||||
while (!myfeof(f))
|
||||
|
|
@ -3417,10 +3425,12 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
if (fastcmp(word, "FREESLOT"))
|
||||
{
|
||||
readfreeslots(f);
|
||||
// This is not a major mod.
|
||||
continue;
|
||||
}
|
||||
else if (fastcmp(word, "MAINCFG"))
|
||||
{
|
||||
G_SetGameModified(multiplayer, true);
|
||||
readmaincfg(f);
|
||||
DEH_WriteUndoline(word, "", UNDO_HEADER);
|
||||
continue;
|
||||
|
|
@ -3429,6 +3439,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
{
|
||||
readwipes(f);
|
||||
DEH_WriteUndoline(word, "", UNDO_HEADER);
|
||||
// This is not a major mod.
|
||||
continue;
|
||||
}
|
||||
word2 = strtok(NULL, " ");
|
||||
|
|
@ -3449,6 +3460,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
ignorelines(f);
|
||||
}
|
||||
DEH_WriteUndoline(word, word2, UNDO_HEADER);
|
||||
// This is not a major mod.
|
||||
continue;
|
||||
}
|
||||
if (word2)
|
||||
|
|
@ -3462,19 +3474,25 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
// Read texture from spec file.
|
||||
readtexture(f, word2);
|
||||
DEH_WriteUndoline(word, word2, UNDO_HEADER);
|
||||
// This is not a major mod.
|
||||
}
|
||||
else if (fastcmp(word, "PATCH"))
|
||||
{
|
||||
// Read patch from spec file.
|
||||
readpatch(f, word2, wad);
|
||||
DEH_WriteUndoline(word, word2, UNDO_HEADER);
|
||||
// This is not a major mod.
|
||||
}
|
||||
else if (fastcmp(word, "THING") || fastcmp(word, "MOBJ") || fastcmp(word, "OBJECT"))
|
||||
{
|
||||
if (i == 0 && word2[0] != '0') // If word2 isn't a number
|
||||
i = get_mobjtype(word2); // find a thing by name
|
||||
if (i < NUMMOBJTYPES && i >= 0)
|
||||
{
|
||||
if (i < (MT_FIRSTFREESLOT+freeslotusage[1][1]))
|
||||
G_SetGameModified(multiplayer, true); // affecting something earlier than the first freeslot allocated in this .wad? DENIED
|
||||
readthing(f, i);
|
||||
}
|
||||
else
|
||||
{
|
||||
deh_warning("Thing %d out of range (0 - %d)", i, NUMMOBJTYPES-1);
|
||||
|
|
@ -3485,6 +3503,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
/* else if (fastcmp(word, "ANIMTEX"))
|
||||
{
|
||||
readAnimTex(f, i);
|
||||
// This is not a major mod.
|
||||
}*/
|
||||
else if (fastcmp(word, "LIGHT"))
|
||||
{
|
||||
|
|
@ -3498,6 +3517,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
ignorelines(f);
|
||||
}
|
||||
DEH_WriteUndoline(word, word2, UNDO_HEADER);
|
||||
// This is not a major mod.
|
||||
#endif
|
||||
}
|
||||
else if (fastcmp(word, "SPRITE"))
|
||||
|
|
@ -3513,6 +3533,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
ignorelines(f);
|
||||
}
|
||||
DEH_WriteUndoline(word, word2, UNDO_HEADER);
|
||||
// This is not a major mod.
|
||||
#endif
|
||||
}
|
||||
else if (fastcmp(word, "LEVEL"))
|
||||
|
|
@ -3525,7 +3546,11 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
i = M_MapNumber(word2[0], word2[1]);
|
||||
|
||||
if (i > 0 && i <= NUMMAPS)
|
||||
{
|
||||
if (mapheaderinfo[i])
|
||||
G_SetGameModified(multiplayer, true); // only mark as a major mod if it replaces an already-existing mapheaderinfo
|
||||
readlevelheader(f, i);
|
||||
}
|
||||
else
|
||||
{
|
||||
deh_warning("Level number %d out of range (1 - %d)", i, NUMMAPS);
|
||||
|
|
@ -3543,13 +3568,18 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
ignorelines(f);
|
||||
}
|
||||
DEH_WriteUndoline(word, word2, UNDO_HEADER);
|
||||
//G_SetGameModified(multiplayer, true); -- might have to reconsider in a future update
|
||||
}
|
||||
else if (fastcmp(word, "FRAME") || fastcmp(word, "STATE"))
|
||||
{
|
||||
if (i == 0 && word2[0] != '0') // If word2 isn't a number
|
||||
i = get_state(word2); // find a state by name
|
||||
if (i < NUMSTATES && i >= 0)
|
||||
{
|
||||
if (i < (S_FIRSTFREESLOT+freeslotusage[0][1]))
|
||||
G_SetGameModified(multiplayer, true); // affecting something earlier than the first freeslot allocated in this .wad? DENIED
|
||||
readframe(f, i);
|
||||
}
|
||||
else
|
||||
{
|
||||
deh_warning("Frame %d out of range (0 - %d)", i, NUMSTATES-1);
|
||||
|
|
@ -3578,6 +3608,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
}
|
||||
else
|
||||
deh_warning("pointer (Frame %d) : missing ')'", i);
|
||||
G_SetGameModified(multiplayer, true);
|
||||
}*/
|
||||
else if (fastcmp(word, "SOUND"))
|
||||
{
|
||||
|
|
@ -3591,6 +3622,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
ignorelines(f);
|
||||
}
|
||||
DEH_WriteUndoline(word, word2, UNDO_HEADER);
|
||||
// This is not a major mod.
|
||||
}
|
||||
/* else if (fastcmp(word, "SPRITE"))
|
||||
{
|
||||
|
|
@ -3611,6 +3643,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
}
|
||||
else
|
||||
deh_warning("Sprite %d doesn't exist",i);
|
||||
// This is not a major mod.
|
||||
}*/
|
||||
else if (fastcmp(word, "HUDITEM"))
|
||||
{
|
||||
|
|
@ -3624,10 +3657,11 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
ignorelines(f);
|
||||
}
|
||||
DEH_WriteUndoline(word, word2, UNDO_HEADER);
|
||||
// This is not a major mod.
|
||||
}
|
||||
else if (fastcmp(word, "EMBLEM"))
|
||||
{
|
||||
if (!gamedataadded)
|
||||
if (!(refreshdirmenu & REFRESHDIR_GAMEDATA))
|
||||
{
|
||||
deh_warning("You must define a custom gamedata to use \"%s\"", word);
|
||||
ignorelines(f);
|
||||
|
|
@ -3647,7 +3681,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
}
|
||||
else if (fastcmp(word, "EXTRAEMBLEM"))
|
||||
{
|
||||
if (!gamedataadded)
|
||||
if (!(refreshdirmenu & REFRESHDIR_GAMEDATA))
|
||||
{
|
||||
deh_warning("You must define a custom gamedata to use \"%s\"", word);
|
||||
ignorelines(f);
|
||||
|
|
@ -3667,7 +3701,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
}
|
||||
else if (fastcmp(word, "UNLOCKABLE"))
|
||||
{
|
||||
if (!gamedataadded)
|
||||
if (!(refreshdirmenu & REFRESHDIR_GAMEDATA))
|
||||
{
|
||||
deh_warning("You must define a custom gamedata to use \"%s\"", word);
|
||||
ignorelines(f);
|
||||
|
|
@ -3683,7 +3717,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
}
|
||||
else if (fastcmp(word, "CONDITIONSET"))
|
||||
{
|
||||
if (!gamedataadded)
|
||||
if (!(refreshdirmenu & REFRESHDIR_GAMEDATA))
|
||||
{
|
||||
deh_warning("You must define a custom gamedata to use \"%s\"", word);
|
||||
ignorelines(f);
|
||||
|
|
@ -3718,7 +3752,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
{
|
||||
boolean clearall = (fastcmp(word2, "ALL"));
|
||||
|
||||
if (!gamedataadded)
|
||||
if (!(refreshdirmenu & REFRESHDIR_GAMEDATA))
|
||||
{
|
||||
deh_warning("You must define a custom gamedata to use \"%s\"", word);
|
||||
continue;
|
||||
|
|
@ -3755,8 +3789,8 @@ static void DEH_LoadDehackedFile(MYFILE *f, UINT16 wad)
|
|||
deh_warning("No word in this line: %s", s);
|
||||
} // end while
|
||||
|
||||
if (gamedataadded)
|
||||
G_LoadGameData();
|
||||
/*if (gamedataadded) -- REFRESHDIR_GAMEDATA murdered this
|
||||
G_LoadGameData();*/
|
||||
|
||||
dbg_line = -1;
|
||||
if (deh_num_warning)
|
||||
|
|
@ -7116,6 +7150,13 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_KARMAFIREWORK4",
|
||||
"S_KARMAFIREWORKTRAIL",
|
||||
|
||||
// Opaque smoke version, to prevent lag
|
||||
"S_OPAQUESMOKE1",
|
||||
"S_OPAQUESMOKE2",
|
||||
"S_OPAQUESMOKE3",
|
||||
"S_OPAQUESMOKE4",
|
||||
"S_OPAQUESMOKE5",
|
||||
|
||||
"S_OVERTIMEFOG",
|
||||
"S_OVERTIMEORB",
|
||||
"S_OVERTIMEBEAM",
|
||||
|
|
@ -8108,89 +8149,152 @@ static const char *const ML_LIST[16] = {
|
|||
// This DOES differ from r_draw's Color_Names, unfortunately.
|
||||
// Also includes Super colors
|
||||
static const char *COLOR_ENUMS[] = { // Rejigged for Kart.
|
||||
"NONE", // 00 // SKINCOLOR_NONE
|
||||
"WHITE", // 01 // SKINCOLOR_WHITE
|
||||
"SILVER", // 02 // SKINCOLOR_SILVER
|
||||
"GREY", // 03 // SKINCOLOR_GREY
|
||||
"NICKEL", // 04 // SKINCOLOR_NICKEL
|
||||
"BLACK", // 05 // SKINCOLOR_BLACK
|
||||
"SEPIA", // 06 // SKINCOLOR_SEPIA
|
||||
"BEIGE", // 07 // SKINCOLOR_BEIGE
|
||||
"BROWN", // 08 // SKINCOLOR_BROWN
|
||||
"LEATHER", // 09 // SKINCOLOR_LEATHER
|
||||
"SALMON", // 10 // SKINCOLOR_SALMON
|
||||
"PINK", // 11 // SKINCOLOR_PINK
|
||||
"ROSE", // 12 // SKINCOLOR_ROSE
|
||||
"RUBY", // 13 // SKINCOLOR_RUBY
|
||||
"RASPBERRY", // 14 // SKINCOLOR_RASPBERRY
|
||||
"RED", // 15 // SKINCOLOR_RED
|
||||
"CRIMSON", // 16 // SKINCOLOR_CRIMSON
|
||||
"KETCHUP", // 17 // SKINCOLOR_KETCHUP
|
||||
"DAWN", // 18 // SKINCOLOR_DAWN
|
||||
"CREAMSICLE", // 19 // SKINCOLOR_CREAMSICLE
|
||||
"ORANGE", // 20 // SKINCOLOR_ORANGE
|
||||
"PUMPKIN", // 21 // SKINCOLOR_PUMPKIN
|
||||
"ROSEWOOD", // 22 // SKINCOLOR_ROSEWOOD
|
||||
"BURGUNDY", // 23 // SKINCOLOR_BURGUNDY
|
||||
"TANGERINE", // 24 // SKINCOLOR_TANGERINE
|
||||
"PEACH", // 25 // SKINCOLOR_PEACH
|
||||
"CARAMEL", // 26 // SKINCOLOR_CARAMEL
|
||||
"GOLD", // 27 // SKINCOLOR_GOLD
|
||||
"BRONZE", // 28 // SKINCOLOR_BRONZE
|
||||
"YELLOW", // 29 // SKINCOLOR_YELLOW
|
||||
"MUSTARD", // 30 // SKINCOLOR_MUSTARD
|
||||
"OLIVE", // 31 // SKINCOLOR_OLIVE
|
||||
"VOMIT", // 32 // SKINCOLOR_VOMIT
|
||||
"GARDEN", // 33 // SKINCOLOR_GARDEN
|
||||
"LIME", // 34 // SKINCOLOR_LIME
|
||||
"TEA", // 35 // SKINCOLOR_TEA
|
||||
"PISTACHIO", // 36 // SKINCOLOR_PISTACHIO
|
||||
"ROBOHOOD", // 37 // SKINCOLOR_ROBOHOOD
|
||||
"MOSS", // 38 // SKINCOLOR_MOSS
|
||||
"MINT", // 39 // SKINCOLOR_MINT
|
||||
"GREEN", // 40 // SKINCOLOR_GREEN
|
||||
"PINETREE", // 41 // SKINCOLOR_PINETREE
|
||||
"EMERALD", // 42 // SKINCOLOR_EMERALD
|
||||
"SWAMP", // 43 // SKINCOLOR_SWAMP
|
||||
"DREAM", // 44 // SKINCOLOR_DREAM
|
||||
"AQUA", // 45 // SKINCOLOR_AQUA
|
||||
"TEAL", // 46 // SKINCOLOR_TEAL
|
||||
"CYAN", // 47 // SKINCOLOR_CYAN
|
||||
"JAWZ", // 48 // SKINCOLOR_JAWZ
|
||||
"CERULEAN", // 49 // SKINCOLOR_CERULEAN
|
||||
"NAVY", // 50 // SKINCOLOR_NAVY
|
||||
"SLATE", // 51 // SKINCOLOR_SLATE
|
||||
"STEEL", // 52 // SKINCOLOR_STEEL
|
||||
"JET", // 53 // SKINCOLOR_JET
|
||||
"SAPPHIRE", // 54 // SKINCOLOR_SAPPHIRE
|
||||
"PERIWINKLE", // 55 // SKINCOLOR_PERIWINKLE
|
||||
"BLUE", // 56 // SKINCOLOR_BLUE
|
||||
"BLUEBERRY", // 57 // SKINCOLOR_BLUEBERRY
|
||||
"DUSK", // 58 // SKINCOLOR_DUSK
|
||||
"PURPLE", // 59 // SKINCOLOR_PURPLE
|
||||
"LAVENDER", // 60 // SKINCOLOR_LAVENDER
|
||||
"BYZANTIUM", // 61 // SKINCOLOR_BYZANTIUM
|
||||
"POMEGRANATE", // 62 // SKINCOLOR_POMEGRANATE
|
||||
"LILAC", // 63 // SKINCOLOR_LILAC
|
||||
"NONE", // SKINCOLOR_NONE
|
||||
"WHITE", // SKINCOLOR_WHITE
|
||||
"SILVER", // SKINCOLOR_SILVER
|
||||
"GREY", // SKINCOLOR_GREY
|
||||
"NICKEL", // SKINCOLOR_NICKEL
|
||||
"BLACK", // SKINCOLOR_BLACK
|
||||
"FAIRY", // SKINCOLOR_FAIRY
|
||||
"POPCORN", // SKINCOLOR_POPCORN
|
||||
"SEPIA", // SKINCOLOR_SEPIA
|
||||
"BEIGE", // SKINCOLOR_BEIGE
|
||||
"BROWN", // SKINCOLOR_BROWN
|
||||
"LEATHER", // SKINCOLOR_LEATHER
|
||||
"SALMON", // SKINCOLOR_SALMON
|
||||
"PINK", // SKINCOLOR_PINK
|
||||
"ROSE", // SKINCOLOR_ROSE
|
||||
"BRICK", // SKINCOLOR_BRICK
|
||||
"RUBY", // SKINCOLOR_RUBY
|
||||
"RASPBERRY", // SKINCOLOR_RASPBERRY
|
||||
"CHERRY", // SKINCOLOR_CHERRY
|
||||
"RED", // SKINCOLOR_RED
|
||||
"CRIMSON", // SKINCOLOR_CRIMSON
|
||||
"MAROON", // SKINCOLOR_MAROON
|
||||
"FLAME", // SKINCOLOR_FLAME
|
||||
"SCARLET", // SKINCOLOR_SCARLET
|
||||
"KETCHUP", // SKINCOLOR_KETCHUP
|
||||
"DAWN", // SKINCOLOR_DAWN
|
||||
"SUNSET", // SKINCOLOR_SUNSET
|
||||
"CREAMSICLE", // SKINCOLOR_CREAMSICLE
|
||||
"ORANGE", // SKINCOLOR_ORANGE
|
||||
"PUMPKIN", // SKINCOLOR_PUMPKIN
|
||||
"ROSEWOOD", // SKINCOLOR_ROSEWOOD
|
||||
"BURGUNDY", // SKINCOLOR_BURGUNDY
|
||||
"TANGERINE", // SKINCOLOR_TANGERINE
|
||||
"PEACH", // SKINCOLOR_PEACH
|
||||
"CARAMEL", // SKINCOLOR_CARAMEL
|
||||
"CREAM", // SKINCOLOR_CREAM
|
||||
"GOLD", // SKINCOLOR_GOLD
|
||||
"ROYAL", // SKINCOLOR_ROYAL
|
||||
"BRONZE", // SKINCOLOR_BRONZE
|
||||
"COPPER", // SKINCOLOR_COPPER
|
||||
"YELLOW", // SKINCOLOR_YELLOW
|
||||
"MUSTARD", // SKINCOLOR_MUSTARD
|
||||
"OLIVE", // SKINCOLOR_OLIVE
|
||||
"VOMIT", // SKINCOLOR_VOMIT
|
||||
"GARDEN", // SKINCOLOR_GARDEN
|
||||
"LIME", // SKINCOLOR_LIME
|
||||
"HANDHELD", // SKINCOLOR_HANDHELD
|
||||
"TEA", // SKINCOLOR_TEA
|
||||
"PISTACHIO", // SKINCOLOR_PISTACHIO
|
||||
"MOSS", // SKINCOLOR_MOSS
|
||||
"CAMOUFLAGE", // SKINCOLOR_CAMOUFLAGE
|
||||
"ROBOHOOD", // SKINCOLOR_ROBOHOOD
|
||||
"MINT", // SKINCOLOR_MINT
|
||||
"GREEN", // SKINCOLOR_GREEN
|
||||
"PINETREE", // SKINCOLOR_PINETREE
|
||||
"EMERALD", // SKINCOLOR_EMERALD
|
||||
"SWAMP", // SKINCOLOR_SWAMP
|
||||
"DREAM", // SKINCOLOR_DREAM
|
||||
"PLAGUE", // SKINCOLOR_PLAGUE
|
||||
"ALGAE", // SKINCOLOR_ALGAE
|
||||
"CARIBBEAN", // SKINCOLOR_CARIBBEAN
|
||||
"AQUA", // SKINCOLOR_AQUA
|
||||
"TEAL", // SKINCOLOR_TEAL
|
||||
"CYAN", // SKINCOLOR_CYAN
|
||||
"JAWZ", // SKINCOLOR_JAWZ
|
||||
"CERULEAN", // SKINCOLOR_CERULEAN
|
||||
"NAVY", // SKINCOLOR_NAVY
|
||||
"PLATINUM", // SKINCOLOR_PLATINUM
|
||||
"SLATE", // SKINCOLOR_SLATE
|
||||
"STEEL", // SKINCOLOR_STEEL
|
||||
"RUST", // SKINCOLOR_RUST
|
||||
"JET", // SKINCOLOR_JET
|
||||
"SAPPHIRE", // SKINCOLOR_SAPPHIRE
|
||||
"PERIWINKLE", // SKINCOLOR_PERIWINKLE
|
||||
"BLUE", // SKINCOLOR_BLUE
|
||||
"BLUEBERRY", // SKINCOLOR_BLUEBERRY
|
||||
"NOVA", // SKINCOLOR_NOVA
|
||||
"PASTEL", // SKINCOLOR_PASTEL
|
||||
"MOONSLAM", // SKINCOLOR_MOONSLAM
|
||||
"ULTRAVIOLET", // SKINCOLOR_ULTRAVIOLET
|
||||
"DUSK", // SKINCOLOR_DUSK
|
||||
"BUBBLEGUM", // SKINCOLOR_BUBBLEGUM
|
||||
"PURPLE", // SKINCOLOR_PURPLE
|
||||
"FUCHSIA", // SKINCOLOR_FUCHSIA
|
||||
"TOXIC", // SKINCOLOR_TOXIC
|
||||
"LAVENDER", // SKINCOLOR_LAVENDER
|
||||
"BYZANTIUM", // SKINCOLOR_BYZANTIUM
|
||||
"MAUVE", // SKINCOLOR_MAUVE
|
||||
"POMEGRANATE", // SKINCOLOR_POMEGRANATE
|
||||
"LILAC", // SKINCOLOR_LILAC
|
||||
|
||||
// Super special awesome Super flashing colors!
|
||||
"SUPER1", // SKINCOLOR_SUPER1
|
||||
"SUPER2", // SKINCOLOR_SUPER2,
|
||||
"SUPER3", // SKINCOLOR_SUPER3,
|
||||
"SUPER4", // SKINCOLOR_SUPER4,
|
||||
"SUPER5", // SKINCOLOR_SUPER5,
|
||||
// Super Tails
|
||||
"TSUPER1", // SKINCOLOR_TSUPER1,
|
||||
"TSUPER2", // SKINCOLOR_TSUPER2,
|
||||
"TSUPER3", // SKINCOLOR_TSUPER3,
|
||||
"TSUPER4", // SKINCOLOR_TSUPER4,
|
||||
"TSUPER5", // SKINCOLOR_TSUPER5,
|
||||
// Super Knuckles
|
||||
"KSUPER1", // SKINCOLOR_KSUPER1,
|
||||
"KSUPER2", // SKINCOLOR_KSUPER2,
|
||||
"KSUPER3", // SKINCOLOR_KSUPER3,
|
||||
"KSUPER4", // SKINCOLOR_KSUPER4,
|
||||
"KSUPER5" // SKINCOLOR_KSUPER5,
|
||||
// Special super colors
|
||||
// Super Sonic Yellow
|
||||
"SUPER1", // SKINCOLOR_SUPER1
|
||||
"SUPER2", // SKINCOLOR_SUPER2,
|
||||
"SUPER3", // SKINCOLOR_SUPER3,
|
||||
"SUPER4", // SKINCOLOR_SUPER4,
|
||||
"SUPER5", // SKINCOLOR_SUPER5,
|
||||
// Super Tails Orange
|
||||
"TSUPER1", // SKINCOLOR_TSUPER1,
|
||||
"TSUPER2", // SKINCOLOR_TSUPER2,
|
||||
"TSUPER3", // SKINCOLOR_TSUPER3,
|
||||
"TSUPER4", // SKINCOLOR_TSUPER4,
|
||||
"TSUPER5", // SKINCOLOR_TSUPER5,
|
||||
// Super Knuckles Red
|
||||
"KSUPER1", // SKINCOLOR_KSUPER1,
|
||||
"KSUPER2", // SKINCOLOR_KSUPER2,
|
||||
"KSUPER3", // SKINCOLOR_KSUPER3,
|
||||
"KSUPER4", // SKINCOLOR_KSUPER4,
|
||||
"KSUPER5", // SKINCOLOR_KSUPER5,
|
||||
// Hyper Sonic Pink
|
||||
"PSUPER1", // SKINCOLOR_PSUPER1,
|
||||
"PSUPER2", // SKINCOLOR_PSUPER2,
|
||||
"PSUPER3", // SKINCOLOR_PSUPER3,
|
||||
"PSUPER4", // SKINCOLOR_PSUPER4,
|
||||
"PSUPER5", // SKINCOLOR_PSUPER5,
|
||||
// Hyper Sonic Blue
|
||||
"BSUPER1", // SKINCOLOR_BSUPER1,
|
||||
"BSUPER2", // SKINCOLOR_BSUPER2,
|
||||
"BSUPER3", // SKINCOLOR_BSUPER3,
|
||||
"BSUPER4", // SKINCOLOR_BSUPER4,
|
||||
"BSUPER5" // SKINCOLOR_BSUPER5,
|
||||
// Aqua Super
|
||||
"ASUPER1", // SKINCOLOR_ASUPER1,
|
||||
"ASUPER2", // SKINCOLOR_ASUPER2,
|
||||
"ASUPER3", // SKINCOLOR_ASUPER3,
|
||||
"ASUPER4", // SKINCOLOR_ASUPER4,
|
||||
"ASUPER5", // SKINCOLOR_ASUPER5,
|
||||
// Hyper Sonic Green
|
||||
"GSUPER1", // SKINCOLOR_GSUPER1,
|
||||
"GSUPER2", // SKINCOLOR_GSUPER2,
|
||||
"GSUPER3", // SKINCOLOR_GSUPER3,
|
||||
"GSUPER4", // SKINCOLOR_GSUPER4,
|
||||
"GSUPER5", // SKINCOLOR_GSUPER5,
|
||||
// Hyper Sonic White
|
||||
"WSUPER1", // SKINCOLOR_WSUPER1,
|
||||
"WSUPER2", // SKINCOLOR_WSUPER2,
|
||||
"WSUPER3", // SKINCOLOR_WSUPER3,
|
||||
"WSUPER4", // SKINCOLOR_WSUPER4,
|
||||
"WSUPER5", // SKINCOLOR_WSUPER5,
|
||||
// Creamy Super (Shadow?)
|
||||
"CSUPER1", // SKINCOLOR_CSUPER1,
|
||||
"CSUPER2", // SKINCOLOR_CSUPER2,
|
||||
"CSUPER3", // SKINCOLOR_CSUPER3,
|
||||
"CSUPER4", // SKINCOLOR_CSUPER4,
|
||||
"CSUPER5" // SKINCOLOR_CSUPER5,
|
||||
};
|
||||
|
||||
static const char *const POWERS_LIST[] = {
|
||||
|
|
@ -8228,6 +8332,7 @@ static const char *const POWERS_LIST[] = {
|
|||
"INGOOP" // In goop
|
||||
};
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
static const char *const KARTSTUFF_LIST[] = {
|
||||
"POSITION",
|
||||
"OLDPOSITION",
|
||||
|
|
@ -8308,8 +8413,12 @@ static const char *const KARTSTUFF_LIST[] = {
|
|||
"ITEMBLINK",
|
||||
"ITEMBLINKMODE",
|
||||
"GETSPARKS",
|
||||
"JAWZTARGETDELAY",
|
||||
"SPECTATEWAIT",
|
||||
"GROWCANCEL",
|
||||
"KILLFIELD"
|
||||
};
|
||||
#endif
|
||||
|
||||
static const char *const HUDITEMS_LIST[] = {
|
||||
"LIVESNAME",
|
||||
|
|
@ -9015,20 +9124,6 @@ static powertype_t get_power(const char *word)
|
|||
return pw_invulnerability;
|
||||
}
|
||||
|
||||
static kartstufftype_t get_kartstuff(const char *word)
|
||||
{ // Returns the vlaue of k_ enumerations
|
||||
kartstufftype_t i;
|
||||
if (*word >= '0' && *word <= '9')
|
||||
return atoi(word);
|
||||
if (fastncmp("K_",word,2))
|
||||
word += 2; // take off the k_
|
||||
for (i = 0; i < NUMKARTSTUFF; i++)
|
||||
if (fastcmp(word, KARTSTUFF_LIST[i]))
|
||||
return i;
|
||||
deh_warning("Couldn't find power named 'k_%s'",word);
|
||||
return k_position;
|
||||
}
|
||||
|
||||
/// \todo Make ANY of this completely over-the-top math craziness obey the order of operations.
|
||||
static fixed_t op_mul(fixed_t a, fixed_t b) { return a*b; }
|
||||
static fixed_t op_div(fixed_t a, fixed_t b) { return a/b; }
|
||||
|
|
@ -9365,6 +9460,7 @@ static inline int lib_freeslot(lua_State *L)
|
|||
CONS_Printf("State S_%s allocated.\n",word);
|
||||
FREE_STATES[i] = Z_Malloc(strlen(word)+1, PU_STATIC, NULL);
|
||||
strcpy(FREE_STATES[i],word);
|
||||
freeslotusage[0][0]++;
|
||||
lua_pushinteger(L, i);
|
||||
r++;
|
||||
break;
|
||||
|
|
@ -9380,6 +9476,7 @@ static inline int lib_freeslot(lua_State *L)
|
|||
CONS_Printf("MobjType MT_%s allocated.\n",word);
|
||||
FREE_MOBJS[i] = Z_Malloc(strlen(word)+1, PU_STATIC, NULL);
|
||||
strcpy(FREE_MOBJS[i],word);
|
||||
freeslotusage[1][0]++;
|
||||
lua_pushinteger(L, i);
|
||||
r++;
|
||||
break;
|
||||
|
|
@ -9749,6 +9846,9 @@ static inline int lib_getenum(lua_State *L)
|
|||
} else if (fastcmp(word,"modifiedgame")) {
|
||||
lua_pushboolean(L, modifiedgame && !savemoddata);
|
||||
return 1;
|
||||
} else if (fastcmp(word,"majormods")) {
|
||||
lua_pushboolean(L, majormods);
|
||||
return 1;
|
||||
} else if (fastcmp(word,"menuactive")) {
|
||||
lua_pushboolean(L, menuactive);
|
||||
return 1;
|
||||
|
|
@ -9820,6 +9920,9 @@ static inline int lib_getenum(lua_State *L)
|
|||
} else if (fastcmp(word,"indirectitemcooldown")) {
|
||||
lua_pushinteger(L, indirectitemcooldown);
|
||||
return 1;
|
||||
} else if (fastcmp(word,"hyubgone")) {
|
||||
lua_pushinteger(L, hyubgone);
|
||||
return 1;
|
||||
} else if (fastcmp(word,"thwompsactive")) {
|
||||
lua_pushboolean(L, thwompsactive);
|
||||
return 1;
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ void DEH_UnloadDehackedWad(UINT16 wad);
|
|||
void DEH_LoadDehackedLump(lumpnum_t lumpnum);
|
||||
void DEH_LoadDehackedLumpPwad(UINT16 wad, UINT16 lump);
|
||||
|
||||
void DEH_UpdateMaxFreeslots(void);
|
||||
|
||||
void DEH_Check(void);
|
||||
|
||||
fixed_t get_number(const char *word);
|
||||
|
|
|
|||
|
|
@ -94,6 +94,9 @@ void I_FinishUpdate (void)
|
|||
if (cv_ticrate.value)
|
||||
SCR_DisplayTicRate();
|
||||
|
||||
if (cv_showping.value && netgame && consoleplayer != serverplayer)
|
||||
SCR_DisplayLocalPing();
|
||||
|
||||
//blast it to the screen
|
||||
// this code sucks
|
||||
//memcpy(dascreen,screens[0],screenwidth*screenheight);
|
||||
|
|
|
|||
|
|
@ -150,9 +150,9 @@ extern FILE *logstream;
|
|||
// we use comprevision and compbranch instead.
|
||||
#else
|
||||
#define VERSION 100 // Game version
|
||||
#define SUBVERSION 2 // more precise version number
|
||||
#define VERSIONSTRING "v1.0.2"
|
||||
#define VERSIONSTRINGW L"v1.0.2"
|
||||
#define SUBVERSION 3 // more precise version number
|
||||
#define VERSIONSTRING "v1.0.3"
|
||||
#define VERSIONSTRINGW L"v1.0.3"
|
||||
// Hey! If you change this, add 1 to the MODVERSION below!
|
||||
// Otherwise we can't force updates!
|
||||
#endif
|
||||
|
|
@ -221,7 +221,7 @@ extern FILE *logstream;
|
|||
// it's only for detection of the version the player is using so the MS can alert them of an update.
|
||||
// Only set it higher, not lower, obviously.
|
||||
// Note that we use this to help keep internal testing in check; this is why v2.1.0 is not version "1".
|
||||
#define MODVERSION 2
|
||||
#define MODVERSION 3
|
||||
|
||||
// Filter consvars by version
|
||||
// To version config.cfg, MAJOREXECVERSION is set equal to MODVERSION automatically.
|
||||
|
|
@ -256,6 +256,8 @@ typedef enum
|
|||
SKINCOLOR_GREY,
|
||||
SKINCOLOR_NICKEL,
|
||||
SKINCOLOR_BLACK,
|
||||
SKINCOLOR_POPCORN,
|
||||
SKINCOLOR_FAIRY,
|
||||
SKINCOLOR_SEPIA,
|
||||
SKINCOLOR_BEIGE,
|
||||
SKINCOLOR_BROWN,
|
||||
|
|
@ -263,12 +265,18 @@ typedef enum
|
|||
SKINCOLOR_SALMON,
|
||||
SKINCOLOR_PINK,
|
||||
SKINCOLOR_ROSE,
|
||||
SKINCOLOR_BRICK,
|
||||
SKINCOLOR_RUBY,
|
||||
SKINCOLOR_RASPBERRY,
|
||||
SKINCOLOR_CHERRY,
|
||||
SKINCOLOR_RED,
|
||||
SKINCOLOR_CRIMSON,
|
||||
SKINCOLOR_MAROON,
|
||||
SKINCOLOR_FLAME,
|
||||
SKINCOLOR_SCARLET,
|
||||
SKINCOLOR_KETCHUP,
|
||||
SKINCOLOR_DAWN,
|
||||
SKINCOLOR_SUNSET,
|
||||
SKINCOLOR_CREAMSICLE,
|
||||
SKINCOLOR_ORANGE,
|
||||
SKINCOLOR_PUMPKIN,
|
||||
|
|
@ -277,68 +285,130 @@ typedef enum
|
|||
SKINCOLOR_TANGERINE,
|
||||
SKINCOLOR_PEACH,
|
||||
SKINCOLOR_CARAMEL,
|
||||
SKINCOLOR_CREAM,
|
||||
SKINCOLOR_GOLD,
|
||||
SKINCOLOR_ROYAL,
|
||||
SKINCOLOR_BRONZE,
|
||||
SKINCOLOR_COPPER,
|
||||
SKINCOLOR_YELLOW,
|
||||
SKINCOLOR_MUSTARD,
|
||||
SKINCOLOR_OLIVE,
|
||||
SKINCOLOR_VOMIT,
|
||||
SKINCOLOR_GARDEN,
|
||||
SKINCOLOR_LIME,
|
||||
SKINCOLOR_HANDHELD,
|
||||
SKINCOLOR_TEA,
|
||||
SKINCOLOR_PISTACHIO,
|
||||
SKINCOLOR_ROBOHOOD,
|
||||
SKINCOLOR_MOSS,
|
||||
SKINCOLOR_CAMOUFLAGE,
|
||||
SKINCOLOR_ROBOHOOD,
|
||||
SKINCOLOR_MINT,
|
||||
SKINCOLOR_GREEN,
|
||||
SKINCOLOR_PINETREE,
|
||||
SKINCOLOR_EMERALD,
|
||||
SKINCOLOR_SWAMP,
|
||||
SKINCOLOR_DREAM,
|
||||
SKINCOLOR_PLAGUE,
|
||||
SKINCOLOR_ALGAE,
|
||||
SKINCOLOR_CARIBBEAN,
|
||||
SKINCOLOR_AQUA,
|
||||
SKINCOLOR_TEAL,
|
||||
SKINCOLOR_CYAN,
|
||||
SKINCOLOR_JAWZ, // Oni's torment
|
||||
SKINCOLOR_CERULEAN,
|
||||
SKINCOLOR_NAVY,
|
||||
SKINCOLOR_PLATINUM,
|
||||
SKINCOLOR_SLATE,
|
||||
SKINCOLOR_STEEL,
|
||||
SKINCOLOR_RUST,
|
||||
SKINCOLOR_JET,
|
||||
SKINCOLOR_SAPPHIRE, // sweet mother, i cannot weave - slender aphrodite has overcome me with longing for a girl
|
||||
SKINCOLOR_PERIWINKLE,
|
||||
SKINCOLOR_BLUE,
|
||||
SKINCOLOR_BLUEBERRY,
|
||||
SKINCOLOR_NOVA,
|
||||
SKINCOLOR_PASTEL,
|
||||
SKINCOLOR_MOONSLAM,
|
||||
SKINCOLOR_ULTRAVIOLET,
|
||||
SKINCOLOR_DUSK,
|
||||
SKINCOLOR_BUBBLEGUM,
|
||||
SKINCOLOR_PURPLE,
|
||||
SKINCOLOR_FUCHSIA,
|
||||
SKINCOLOR_TOXIC,
|
||||
SKINCOLOR_MAUVE,
|
||||
SKINCOLOR_LAVENDER,
|
||||
SKINCOLOR_BYZANTIUM,
|
||||
SKINCOLOR_POMEGRANATE,
|
||||
SKINCOLOR_LILAC,
|
||||
|
||||
// Careful! MAXSKINCOLORS cannot be greater than 0x40 -- Which it is now.
|
||||
// "Careful! MAXSKINCOLORS cannot be greater than 0x40 -- Which it is now."
|
||||
// (This comment is a dirty liar! This is only limited by the integer type, so 255 for UINT8.)
|
||||
MAXSKINCOLORS,
|
||||
|
||||
// Super special awesome Super flashing colors!
|
||||
// Super Sonic Yellow
|
||||
SKINCOLOR_SUPER1 = MAXSKINCOLORS,
|
||||
SKINCOLOR_SUPER2,
|
||||
SKINCOLOR_SUPER3,
|
||||
SKINCOLOR_SUPER4,
|
||||
SKINCOLOR_SUPER5,
|
||||
|
||||
// Super Tails
|
||||
// Super Tails Orange
|
||||
SKINCOLOR_TSUPER1,
|
||||
SKINCOLOR_TSUPER2,
|
||||
SKINCOLOR_TSUPER3,
|
||||
SKINCOLOR_TSUPER4,
|
||||
SKINCOLOR_TSUPER5,
|
||||
|
||||
// Super Knuckles
|
||||
// Super Knuckles Red
|
||||
SKINCOLOR_KSUPER1,
|
||||
SKINCOLOR_KSUPER2,
|
||||
SKINCOLOR_KSUPER3,
|
||||
SKINCOLOR_KSUPER4,
|
||||
SKINCOLOR_KSUPER5,
|
||||
|
||||
// Hyper Sonic Pink
|
||||
SKINCOLOR_PSUPER1,
|
||||
SKINCOLOR_PSUPER2,
|
||||
SKINCOLOR_PSUPER3,
|
||||
SKINCOLOR_PSUPER4,
|
||||
SKINCOLOR_PSUPER5,
|
||||
|
||||
// Hyper Sonic Blue
|
||||
SKINCOLOR_BSUPER1,
|
||||
SKINCOLOR_BSUPER2,
|
||||
SKINCOLOR_BSUPER3,
|
||||
SKINCOLOR_BSUPER4,
|
||||
SKINCOLOR_BSUPER5,
|
||||
|
||||
// Aqua Super
|
||||
SKINCOLOR_ASUPER1,
|
||||
SKINCOLOR_ASUPER2,
|
||||
SKINCOLOR_ASUPER3,
|
||||
SKINCOLOR_ASUPER4,
|
||||
SKINCOLOR_ASUPER5,
|
||||
|
||||
// Hyper Sonic Green
|
||||
SKINCOLOR_GSUPER1,
|
||||
SKINCOLOR_GSUPER2,
|
||||
SKINCOLOR_GSUPER3,
|
||||
SKINCOLOR_GSUPER4,
|
||||
SKINCOLOR_GSUPER5,
|
||||
|
||||
// Hyper Sonic White
|
||||
SKINCOLOR_WSUPER1,
|
||||
SKINCOLOR_WSUPER2,
|
||||
SKINCOLOR_WSUPER3,
|
||||
SKINCOLOR_WSUPER4,
|
||||
SKINCOLOR_WSUPER5,
|
||||
|
||||
// Creamy Super (Shadow?)
|
||||
SKINCOLOR_CSUPER1,
|
||||
SKINCOLOR_CSUPER2,
|
||||
SKINCOLOR_CSUPER3,
|
||||
SKINCOLOR_CSUPER4,
|
||||
SKINCOLOR_CSUPER5,
|
||||
|
||||
MAXTRANSLATIONS
|
||||
} skincolors_t;
|
||||
|
||||
|
|
@ -471,13 +541,17 @@ INT32 I_GetKey(void);
|
|||
#define max(x, y) (((x) > (y)) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
#ifndef M_PIl
|
||||
#define M_PIl 3.1415926535897932384626433832795029L
|
||||
#endif
|
||||
|
||||
// Floating point comparison epsilons from float.h
|
||||
#ifndef FLT_EPSILON
|
||||
#define FLT_EPSILON 1.1920928955078125e-7f
|
||||
#endif
|
||||
|
||||
#ifndef DBL_EPSILON
|
||||
#define DBL_EPSILON 2.2204460492503131e-16
|
||||
#define DBL_EPSILON 2.2204460492503131e-16l
|
||||
#endif
|
||||
|
||||
// An assert-type mechanism.
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ extern boolean gamecomplete;
|
|||
|
||||
// Set if homebrew PWAD stuff has been added.
|
||||
extern boolean modifiedgame;
|
||||
extern boolean majormods;
|
||||
extern UINT16 mainwads;
|
||||
extern boolean savemoddata; // This mod saves time/emblem data.
|
||||
extern boolean disableSpeedAdjust; // Don't alter the duration of player states if true
|
||||
|
|
@ -280,6 +281,8 @@ typedef struct
|
|||
#define LF2_NIGHTSATTACK 8 ///< Show this map in NiGHTS mode menu
|
||||
#define LF2_NOVISITNEEDED 16 ///< Available in time attack/nights mode without visiting the level
|
||||
|
||||
#define LF2_EXISTSHACK 128 ///< Map lump exists; as noted, a single-bit hack that can be freely movable to other variables without concern.
|
||||
|
||||
// Save override
|
||||
#define SAVE_NEVER -1
|
||||
#define SAVE_DEFAULT 0
|
||||
|
|
@ -465,6 +468,7 @@ extern boolean comeback;
|
|||
extern SINT8 battlewanted[4];
|
||||
extern tic_t wantedcalcdelay;
|
||||
extern tic_t indirectitemcooldown;
|
||||
extern tic_t hyubgone;
|
||||
extern tic_t mapreset;
|
||||
extern UINT8 nospectategrief;
|
||||
extern boolean thwompsactive;
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ static void F_SkyScroll(INT32 scrollspeed)
|
|||
{
|
||||
V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, FRACUNIT, V_SNAPTOTOP|V_SNAPTOLEFT, pat, NULL);
|
||||
x += SHORT(pat->width);
|
||||
}
|
||||
}
|
||||
|
||||
x = -anim2;
|
||||
y = BASEVIDHEIGHT - SHORT(pat2->height);
|
||||
|
|
|
|||
14
src/f_wipe.c
14
src/f_wipe.c
|
|
@ -26,6 +26,7 @@
|
|||
#include "console.h"
|
||||
#include "d_main.h"
|
||||
#include "m_misc.h" // movie mode
|
||||
#include "d_clisrv.h" // So the network state can be updated during the wipe
|
||||
|
||||
#ifdef HWRENDER
|
||||
#include "hardware/hw_main.h"
|
||||
|
|
@ -96,7 +97,7 @@ static fixed_t paldiv;
|
|||
* \return fademask_t for lump
|
||||
*/
|
||||
static fademask_t *F_GetFadeMask(UINT8 masknum, UINT8 scrnnum) {
|
||||
static char lumpname[10] = "FADEmmss";
|
||||
static char lumpname[9] = "FADEmmss";
|
||||
static fademask_t fm = {NULL,0,0,0,0,0};
|
||||
lumpnum_t lumpnum;
|
||||
UINT8 *lump, *mask;
|
||||
|
|
@ -106,7 +107,14 @@ static fademask_t *F_GetFadeMask(UINT8 masknum, UINT8 scrnnum) {
|
|||
if (masknum > 99 || scrnnum > 99)
|
||||
goto freemask;
|
||||
|
||||
sprintf(&lumpname[4], "%.2hu%.2hu", (UINT16)masknum, (UINT16)scrnnum);
|
||||
// SRB2Kart: This suddenly triggers ERRORMODE now
|
||||
//sprintf(&lumpname[4], "%.2hu%.2hu", (UINT16)masknum, (UINT16)scrnnum);
|
||||
|
||||
lumpname[4] = '0'+(masknum/10);
|
||||
lumpname[5] = '0'+(masknum%10);
|
||||
|
||||
lumpname[6] = '0'+(scrnnum/10);
|
||||
lumpname[7] = '0'+(scrnnum%10);
|
||||
|
||||
lumpnum = W_CheckNumForName(lumpname);
|
||||
if (lumpnum == LUMPERROR)
|
||||
|
|
@ -375,6 +383,8 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu)
|
|||
|
||||
if (moviemode)
|
||||
M_SaveFrame();
|
||||
|
||||
NetKeepAlive(); // Update the network so we don't cause timeouts
|
||||
}
|
||||
WipeInAction = false;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -88,7 +88,8 @@ typedef enum
|
|||
REFRESHDIR_WARNING = 4,
|
||||
REFRESHDIR_ERROR = 8,
|
||||
REFRESHDIR_NOTLOADED = 16,
|
||||
REFRESHDIR_MAX = 32
|
||||
REFRESHDIR_MAX = 32,
|
||||
REFRESHDIR_GAMEDATA = 64
|
||||
} refreshdir_enum;
|
||||
|
||||
void closefilemenu(boolean validsize);
|
||||
|
|
|
|||
123
src/g_game.c
123
src/g_game.c
|
|
@ -16,6 +16,7 @@
|
|||
#include "d_main.h"
|
||||
#include "d_player.h"
|
||||
#include "f_finale.h"
|
||||
#include "filesrch.h" // for refreshdirmenu
|
||||
#include "p_setup.h"
|
||||
#include "p_saveg.h"
|
||||
#include "i_system.h"
|
||||
|
|
@ -86,7 +87,8 @@ INT16 lastmapsaved = 0; // Last map we auto-saved at
|
|||
boolean gamecomplete = false;
|
||||
|
||||
UINT16 mainwads = 0;
|
||||
boolean modifiedgame; // Set if homebrew PWAD stuff has been added.
|
||||
boolean modifiedgame = false; // Set if homebrew PWAD stuff has been added.
|
||||
boolean majormods = false; // Set if Lua/Gameplay SOC/replacement map has been added.
|
||||
boolean savemoddata = false;
|
||||
UINT8 paused;
|
||||
UINT8 modeattacking = ATTACKING_NONE;
|
||||
|
|
@ -268,6 +270,7 @@ struct battleovertime battleovertime;
|
|||
SINT8 battlewanted[4]; // WANTED players in battle, worth x2 points
|
||||
tic_t wantedcalcdelay; // Time before it recalculates WANTED
|
||||
tic_t indirectitemcooldown; // Cooldown before any more Shrink, SPB, or any other item that works indirectly is awarded
|
||||
tic_t hyubgone; // Cooldown before hyudoro is allowed to be rerolled
|
||||
tic_t mapreset; // Map reset delay when enough players have joined an empty game
|
||||
UINT8 nospectategrief; // How many players need to be in-game to eliminate last; for preventing spectate griefing
|
||||
boolean thwompsactive; // Thwomps activate on lap 2
|
||||
|
|
@ -755,16 +758,21 @@ void G_SetNightsRecords(void)
|
|||
}*/
|
||||
|
||||
// for consistency among messages: this modifies the game and removes savemoddata.
|
||||
void G_SetGameModified(boolean silent)
|
||||
void G_SetGameModified(boolean silent, boolean major)
|
||||
{
|
||||
if (modifiedgame && !savemoddata)
|
||||
if ((majormods && modifiedgame) || !mainwads || (refreshdirmenu & REFRESHDIR_GAMEDATA)) // new gamedata amnesty?
|
||||
return;
|
||||
|
||||
modifiedgame = true;
|
||||
savemoddata = false;
|
||||
|
||||
if (!major)
|
||||
return;
|
||||
|
||||
//savemoddata = false; -- there is literally no reason to do this anymore.
|
||||
majormods = true;
|
||||
|
||||
if (!silent)
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("Game must be restarted to record statistics.\n"));
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("Game must be restarted to play record attack.\n"));
|
||||
|
||||
// If in record attack recording, cancel it.
|
||||
if (modeattacking)
|
||||
|
|
@ -2158,7 +2166,7 @@ void G_Ticker(boolean run)
|
|||
G_CopyTiccmd(cmd, &netcmds[buf][i], 1);
|
||||
|
||||
// Use the leveltime sent in the player's ticcmd to determine control lag
|
||||
cmd->latency = modeattacking ? 0 : min((leveltime & 0xFF) - cmd->latency, MAXPREDICTTICS-1); //@TODO add a cvar to allow setting this max
|
||||
cmd->latency = modeattacking ? 0 : min(((leveltime & 0xFF) - cmd->latency) & 0xFF, MAXPREDICTTICS-1); //@TODO add a cvar to allow setting this max
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2353,6 +2361,7 @@ void G_PlayerReborn(INT32 player)
|
|||
UINT8 skincolor;
|
||||
INT32 skin;
|
||||
tic_t jointime;
|
||||
UINT8 splitscreenindex;
|
||||
boolean spectator;
|
||||
INT16 bot;
|
||||
SINT8 pity;
|
||||
|
|
@ -2376,6 +2385,7 @@ void G_PlayerReborn(INT32 player)
|
|||
ctfteam = players[player].ctfteam;
|
||||
exiting = players[player].exiting;
|
||||
jointime = players[player].jointime;
|
||||
splitscreenindex = players[player].splitscreenindex;
|
||||
spectator = players[player].spectator;
|
||||
pflags = (players[player].pflags & (PF_TIMEOVER|PF_FLIPCAM|PF_TAGIT|PF_TAGGED|PF_ANALOGMODE|PF_WANTSTOJOIN));
|
||||
|
||||
|
|
@ -2472,6 +2482,7 @@ void G_PlayerReborn(INT32 player)
|
|||
p->pflags = pflags;
|
||||
p->ctfteam = ctfteam;
|
||||
p->jointime = jointime;
|
||||
p->splitscreenindex = splitscreenindex;
|
||||
p->spectator = spectator;
|
||||
|
||||
// save player config truth reborn
|
||||
|
|
@ -3945,7 +3956,6 @@ void G_LoadGameData(void)
|
|||
// Saves the main data file, which stores information such as emblems found, etc.
|
||||
void G_SaveGameData(boolean force)
|
||||
{
|
||||
const boolean wasmodified = modifiedgame;
|
||||
size_t length;
|
||||
INT32 i, j;
|
||||
UINT8 btemp;
|
||||
|
|
@ -3962,9 +3972,7 @@ void G_SaveGameData(boolean force)
|
|||
return;
|
||||
}
|
||||
|
||||
if (force) // SRB2Kart: for enabling unlocks online, even if the game is modified
|
||||
modifiedgame = savemoddata; // L-let's just sort of... hack around the cheat protection, because I'm too worried about just removing it @@;
|
||||
else if (modifiedgame && !savemoddata)
|
||||
if (majormods && !force)
|
||||
{
|
||||
free(savebuffer);
|
||||
save_p = savebuffer = NULL;
|
||||
|
|
@ -3977,7 +3985,7 @@ void G_SaveGameData(boolean force)
|
|||
WRITEUINT32(save_p, totalplaytime);
|
||||
WRITEUINT32(save_p, matchesplayed);
|
||||
|
||||
btemp = (UINT8)(savemoddata || modifiedgame);
|
||||
btemp = (UINT8)(savemoddata); // what used to be here was profoundly dunderheaded
|
||||
WRITEUINT8(save_p, btemp);
|
||||
|
||||
// TODO put another cipher on these things? meh, I don't care...
|
||||
|
|
@ -4063,9 +4071,6 @@ void G_SaveGameData(boolean force)
|
|||
FIL_WriteFile(va(pandf, srb2home, gamedatafilename), savebuffer, length);
|
||||
free(savebuffer);
|
||||
save_p = savebuffer = NULL;
|
||||
|
||||
if (force) // Eeeek, I'm sorry for my sins!
|
||||
modifiedgame = wasmodified;
|
||||
}
|
||||
|
||||
#define VERSIONSIZE 16
|
||||
|
|
@ -4765,7 +4770,8 @@ void G_WriteGhostTic(mobj_t *ghost)
|
|||
// GZT_XYZ is only useful if you've moved 256 FRACUNITS or more in a single tic.
|
||||
if (abs(ghost->x-oldghost.x) > MAXMOM
|
||||
|| abs(ghost->y-oldghost.y) > MAXMOM
|
||||
|| abs(ghost->z-oldghost.z) > MAXMOM)
|
||||
|| abs(ghost->z-oldghost.z) > MAXMOM
|
||||
|| (leveltime & 255) == 1) // Hack to enable slightly nicer resyncing
|
||||
{
|
||||
oldghost.x = ghost->x;
|
||||
oldghost.y = ghost->y;
|
||||
|
|
@ -4779,8 +4785,8 @@ void G_WriteGhostTic(mobj_t *ghost)
|
|||
{
|
||||
// For moving normally:
|
||||
// Store one full byte of movement, plus one byte of fractional movement.
|
||||
INT16 momx = (INT16)((ghost->x-oldghost.x)>>8);
|
||||
INT16 momy = (INT16)((ghost->y-oldghost.y)>>8);
|
||||
INT16 momx = (INT16)((ghost->x-oldghost.x + (1<<4))>>8);
|
||||
INT16 momy = (INT16)((ghost->y-oldghost.y + (1<<4))>>8);
|
||||
if (momx != oldghost.momx
|
||||
|| momy != oldghost.momy)
|
||||
{
|
||||
|
|
@ -4790,7 +4796,7 @@ void G_WriteGhostTic(mobj_t *ghost)
|
|||
WRITEINT16(demo_p,momx);
|
||||
WRITEINT16(demo_p,momy);
|
||||
}
|
||||
momx = (INT16)((ghost->z-oldghost.z)>>8);
|
||||
momx = (INT16)((ghost->z-oldghost.z + (1<<4))>>8);
|
||||
if (momx != oldghost.momz)
|
||||
{
|
||||
oldghost.momz = momx;
|
||||
|
|
@ -4894,8 +4900,9 @@ void G_WriteGhostTic(mobj_t *ghost)
|
|||
void G_ConsGhostTic(void)
|
||||
{
|
||||
UINT8 ziptic;
|
||||
UINT16 px,py,pz,gx,gy,gz;
|
||||
fixed_t px,py,pz,gx,gy,gz;
|
||||
mobj_t *testmo;
|
||||
fixed_t syncleeway;
|
||||
boolean nightsfail = false;
|
||||
|
||||
if (!demo_p || !demo_start)
|
||||
|
|
@ -4912,6 +4919,7 @@ void G_ConsGhostTic(void)
|
|||
oldghost.x = READFIXED(demo_p);
|
||||
oldghost.y = READFIXED(demo_p);
|
||||
oldghost.z = READFIXED(demo_p);
|
||||
syncleeway = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -4925,6 +4933,7 @@ void G_ConsGhostTic(void)
|
|||
oldghost.x += oldghost.momx;
|
||||
oldghost.y += oldghost.momy;
|
||||
oldghost.z += oldghost.momz;
|
||||
syncleeway = FRACUNIT;
|
||||
}
|
||||
if (ziptic & GZT_ANGLE)
|
||||
demo_p++;
|
||||
|
|
@ -4990,14 +4999,14 @@ void G_ConsGhostTic(void)
|
|||
}
|
||||
|
||||
// Re-synchronise
|
||||
px = testmo->x>>FRACBITS;
|
||||
py = testmo->y>>FRACBITS;
|
||||
pz = testmo->z>>FRACBITS;
|
||||
gx = oldghost.x>>FRACBITS;
|
||||
gy = oldghost.y>>FRACBITS;
|
||||
gz = oldghost.z>>FRACBITS;
|
||||
px = testmo->x;
|
||||
py = testmo->y;
|
||||
pz = testmo->z;
|
||||
gx = oldghost.x;
|
||||
gy = oldghost.y;
|
||||
gz = oldghost.z;
|
||||
|
||||
if (nightsfail || px != gx || py != gy || pz != gz)
|
||||
if (nightsfail || abs(px-gx) > syncleeway || abs(py-gy) > syncleeway || abs(pz-gz) > syncleeway)
|
||||
{
|
||||
if (demosynced)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n"));
|
||||
|
|
@ -5153,22 +5162,20 @@ void G_GhostTicker(void)
|
|||
if (ziptic & EZT_HIT)
|
||||
{ // Spawn hit poofs for killing things!
|
||||
UINT16 i, count = READUINT16(g->p), health;
|
||||
UINT32 type;
|
||||
//UINT32 type;
|
||||
fixed_t x,y,z;
|
||||
angle_t angle;
|
||||
mobj_t *poof;
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
g->p += 4; // reserved
|
||||
type = READUINT32(g->p);
|
||||
g->p += 4; // backwards compat., type used to be here
|
||||
health = READUINT16(g->p);
|
||||
x = READFIXED(g->p);
|
||||
y = READFIXED(g->p);
|
||||
z = READFIXED(g->p);
|
||||
angle = READANGLE(g->p);
|
||||
if (!(mobjinfo[type].flags & MF_SHOOTABLE)
|
||||
|| !(mobjinfo[type].flags & (MF_ENEMY|MF_MONITOR))
|
||||
|| health != 0 || i >= 4) // only spawn for the first 4 hits per frame, to prevent ghosts from splode-spamming too bad.
|
||||
if (health != 0 || i >= 4) // only spawn for the first 4 hits per frame, to prevent ghosts from splode-spamming too bad.
|
||||
continue;
|
||||
poof = P_SpawnMobj(x, y, z, MT_GHOST);
|
||||
poof->angle = angle;
|
||||
|
|
@ -5924,6 +5931,32 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
return;
|
||||
}
|
||||
|
||||
// Skin not loaded?
|
||||
if (!SetPlayerSkin(0, skin))
|
||||
{
|
||||
snprintf(msg, 1024, M_GetText("%s features a character that is not currently loaded.\n"), pdemoname);
|
||||
CONS_Alert(CONS_ERROR, "%s", msg);
|
||||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
Z_Free(pdemoname);
|
||||
Z_Free(demobuffer);
|
||||
demoplayback = false;
|
||||
titledemo = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// ...*map* not loaded?
|
||||
if (!gamemap || (gamemap > NUMMAPS) || !mapheaderinfo[gamemap-1] || !(mapheaderinfo[gamemap-1]->menuflags & LF2_EXISTSHACK))
|
||||
{
|
||||
snprintf(msg, 1024, M_GetText("%s features a course that is not currently loaded.\n"), pdemoname);
|
||||
CONS_Alert(CONS_ERROR, "%s", msg);
|
||||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
Z_Free(pdemoname);
|
||||
Z_Free(demobuffer);
|
||||
demoplayback = false;
|
||||
titledemo = false;
|
||||
return;
|
||||
}
|
||||
|
||||
Z_Free(pdemoname);
|
||||
|
||||
memset(&oldcmd,0,sizeof(oldcmd));
|
||||
|
|
@ -5955,9 +5988,6 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
P_SetRandSeed(randseed);
|
||||
G_InitNew(false, G_BuildMapName(gamemap), true, true); // Doesn't matter whether you reset or not here, given changes to resetplayer.
|
||||
|
||||
// Set skin
|
||||
SetPlayerSkin(0, skin);
|
||||
|
||||
// Set color
|
||||
for (i = 0; i < MAXSKINCOLORS; i++)
|
||||
if (!stricmp(KartColor_Names[i],color)) // SRB2kart
|
||||
|
|
@ -6007,6 +6037,7 @@ void G_AddGhost(char *defdemoname)
|
|||
UINT8 *buffer,*p;
|
||||
mapthing_t *mthing;
|
||||
UINT16 count, ghostversion;
|
||||
skin_t *ghskin = &skins[0];
|
||||
|
||||
name[16] = '\0';
|
||||
skin[16] = '\0';
|
||||
|
|
@ -6152,6 +6183,21 @@ void G_AddGhost(char *defdemoname)
|
|||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < numskins; i++)
|
||||
if (!stricmp(skins[i].name,skin))
|
||||
{
|
||||
ghskin = &skins[i];
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == numskins)
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("Failed to add ghost %s: Invalid character.\n"), pdemoname);
|
||||
Z_Free(pdemoname);
|
||||
Z_Free(buffer);
|
||||
return;
|
||||
}
|
||||
|
||||
gh = Z_Calloc(sizeof(demoghost), PU_LEVEL, NULL);
|
||||
gh->next = ghosts;
|
||||
gh->buffer = buffer;
|
||||
|
|
@ -6197,14 +6243,7 @@ void G_AddGhost(char *defdemoname)
|
|||
gh->oldmo.z = gh->mo->z;
|
||||
|
||||
// Set skin
|
||||
gh->mo->skin = &skins[0];
|
||||
for (i = 0; i < numskins; i++)
|
||||
if (!stricmp(skins[i].name,skin))
|
||||
{
|
||||
gh->mo->skin = &skins[i];
|
||||
break;
|
||||
}
|
||||
gh->oldmo.skin = gh->mo->skin;
|
||||
gh->mo->skin = gh->oldmo.skin = ghskin;
|
||||
|
||||
// Set color
|
||||
gh->mo->color = ((skin_t*)gh->mo->skin)->prefcolor;
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ boolean G_GetRetryFlag(void);
|
|||
void G_LoadGameData(void);
|
||||
void G_LoadGameSettings(void);
|
||||
|
||||
void G_SetGameModified(boolean silent);
|
||||
void G_SetGameModified(boolean silent, boolean major);
|
||||
|
||||
void G_SetGamestate(gamestate_t newstate);
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ INT32 mlooky; // like mousey but with a custom sensitivity for mlook
|
|||
INT32 mouse2x, mouse2y, mlook2y;
|
||||
|
||||
// joystick values are repeated
|
||||
INT32 joyxmove[JOYAXISSET], joyymove[JOYAXISSET], joy2xmove[JOYAXISSET], joy2ymove[JOYAXISSET],
|
||||
INT32 joyxmove[JOYAXISSET], joyymove[JOYAXISSET], joy2xmove[JOYAXISSET], joy2ymove[JOYAXISSET],
|
||||
joy3xmove[JOYAXISSET], joy3ymove[JOYAXISSET], joy4xmove[JOYAXISSET], joy4ymove[JOYAXISSET];
|
||||
|
||||
// current state of the keys: true if pushed
|
||||
|
|
@ -1308,7 +1308,7 @@ void G_Controldefault(UINT8 player)
|
|||
gamecontrol[gc_brake ][1] = KEY_JOY1+1; // B
|
||||
gamecontrol[gc_fire ][1] = KEY_JOY1+4; // LB
|
||||
gamecontrol[gc_drift ][1] = KEY_JOY1+5; // RB
|
||||
|
||||
|
||||
// Extra controls
|
||||
gamecontrol[gc_pause ][0] = KEY_PAUSE;
|
||||
gamecontrol[gc_console ][0] = KEY_CONSOLE;
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ static polyvertex_t *fracdivline(fdivline_t *bsp, polyvertex_t *v1,
|
|||
// (do not accept hit with the extensions)
|
||||
num = (v2x - v1x)*v2dy + (v1y - v2y)*v2dx;
|
||||
frac = num / den;
|
||||
if (frac < 0.0 || frac > 1.0)
|
||||
if (frac < 0.0l || frac > 1.0l)
|
||||
return NULL;
|
||||
|
||||
// now get the frac along the BSP line
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@
|
|||
#include "../v_video.h"
|
||||
#include "hw_clip.h"
|
||||
#include "hw_glob.h"
|
||||
#include "../r_main.h"
|
||||
#include "../r_state.h"
|
||||
#include "../tables.h"
|
||||
#include "r_opengl/r_opengl.h"
|
||||
|
|
@ -328,7 +329,7 @@ angle_t gld_FrustumAngle(void)
|
|||
|
||||
// NEWCLIP TODO: SRB2CBTODO: make a global render_fov for this function
|
||||
|
||||
float render_fov = FIXED_TO_FLOAT(cv_grfov.value);
|
||||
float render_fov = FIXED_TO_FLOAT(cv_fov.value);
|
||||
float render_fovratio = (float)BASEVIDWIDTH / (float)BASEVIDHEIGHT; // SRB2CBTODO: NEWCLIPTODO: Is this right?
|
||||
float render_multiplier = 64.0f / render_fovratio / RMUL;
|
||||
|
||||
|
|
|
|||
|
|
@ -61,9 +61,6 @@ typedef void (*I_Error_t) (const char *error, ...) FUNCIERROR;
|
|||
// ==========================================================================
|
||||
|
||||
// Constants
|
||||
#ifndef M_PIl
|
||||
#define M_PIl 3.1415926535897932384626433832795029L
|
||||
#endif
|
||||
#define DEGREE (0.017453292519943295769236907684883l) // 2*PI/360
|
||||
|
||||
void DBG_Printf(const char *lpFmt, ...) /*FUNCPRINTF*/;
|
||||
|
|
|
|||
|
|
@ -86,12 +86,10 @@ static UINT32 atohex(const char *s);
|
|||
static void CV_filtermode_ONChange(void);
|
||||
static void CV_anisotropic_ONChange(void);
|
||||
static void CV_FogDensity_ONChange(void);
|
||||
static void CV_grFov_OnChange(void);
|
||||
// ==========================================================================
|
||||
// 3D ENGINE COMMANDS & CONSOLE VARS
|
||||
// ==========================================================================
|
||||
|
||||
static CV_PossibleValue_t grfov_cons_t[] = {{0, "MIN"}, {179*FRACUNIT, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t grfiltermode_cons_t[]= {{HWD_SET_TEXTUREFILTER_POINTSAMPLED, "Nearest"},
|
||||
{HWD_SET_TEXTUREFILTER_BILINEAR, "Bilinear"}, {HWD_SET_TEXTUREFILTER_TRILINEAR, "Trilinear"},
|
||||
{HWD_SET_TEXTUREFILTER_MIXED1, "Linear_Nearest"},
|
||||
|
|
@ -112,7 +110,6 @@ static consvar_t cv_grbeta = {"gr_beta", "0", 0, CV_Unsigned, NULL, 0, NULL, NUL
|
|||
|
||||
static float HWRWipeCounter = 1.0f;
|
||||
consvar_t cv_grrounddown = {"gr_rounddown", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_grfov = {"gr_fov", "90", CV_FLOAT|CV_CALL, grfov_cons_t, CV_grFov_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_grfogdensity = {"gr_fogdensity", "150", CV_CALL|CV_NOINIT, CV_Unsigned,
|
||||
CV_FogDensity_ONChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
|
|
@ -5907,7 +5904,7 @@ void HWR_SetViewSize(void)
|
|||
// ==========================================================================
|
||||
void HWR_RenderSkyboxView(INT32 viewnumber, player_t *player)
|
||||
{
|
||||
const float fpov = FIXED_TO_FLOAT(cv_grfov.value+player->fovadd);
|
||||
const float fpov = FIXED_TO_FLOAT(cv_fov.value+player->fovadd);
|
||||
postimg_t *type;
|
||||
UINT8 ssplayer = 0;
|
||||
|
||||
|
|
@ -6073,7 +6070,7 @@ if (0)
|
|||
viewangle = localaiming4;
|
||||
|
||||
// Handle stuff when you are looking farther up or down.
|
||||
if ((aimingangle || cv_grfov.value+player->fovadd > 90*FRACUNIT))
|
||||
if ((aimingangle || cv_fov.value+player->fovadd > 90*FRACUNIT))
|
||||
{
|
||||
dup_viewangle += ANGLE_90;
|
||||
HWR_ClearClipSegs();
|
||||
|
|
@ -6151,7 +6148,7 @@ if (0)
|
|||
// ==========================================================================
|
||||
void HWR_RenderPlayerView(INT32 viewnumber, player_t *player)
|
||||
{
|
||||
const float fpov = FIXED_TO_FLOAT(cv_grfov.value+player->fovadd);
|
||||
const float fpov = FIXED_TO_FLOAT(cv_fov.value+player->fovadd);
|
||||
postimg_t *type;
|
||||
UINT8 ssplayer = 0;
|
||||
|
||||
|
|
@ -6332,7 +6329,7 @@ if (0)
|
|||
viewangle = localaiming4;
|
||||
|
||||
// Handle stuff when you are looking farther up or down.
|
||||
if ((aimingangle || cv_grfov.value+player->fovadd > 90*FRACUNIT))
|
||||
if ((aimingangle || cv_fov.value+player->fovadd > 90*FRACUNIT))
|
||||
{
|
||||
dup_viewangle += ANGLE_90;
|
||||
HWR_ClearClipSegs();
|
||||
|
|
@ -6455,11 +6452,6 @@ static void HWR_FoggingOn(void)
|
|||
// ==========================================================================
|
||||
|
||||
|
||||
static void CV_grFov_OnChange(void)
|
||||
{
|
||||
if ((netgame || multiplayer) && !cv_debug && cv_grfov.value != 90*FRACUNIT)
|
||||
CV_Set(&cv_grfov, cv_grfov.defaultvalue);
|
||||
}
|
||||
|
||||
static void Command_GrStats_f(void)
|
||||
{
|
||||
|
|
@ -6482,7 +6474,6 @@ static void Command_GrStats_f(void)
|
|||
void HWR_AddCommands(void)
|
||||
{
|
||||
CV_RegisterVar(&cv_grrounddown);
|
||||
CV_RegisterVar(&cv_grfov);
|
||||
CV_RegisterVar(&cv_grfogdensity);
|
||||
CV_RegisterVar(&cv_grfiltermode);
|
||||
CV_RegisterVar(&cv_granisotropicmode);
|
||||
|
|
|
|||
|
|
@ -80,7 +80,6 @@ extern consvar_t cv_grstaticlighting;
|
|||
extern consvar_t cv_grcoronas;
|
||||
extern consvar_t cv_grcoronasize;
|
||||
#endif
|
||||
extern consvar_t cv_grfov;
|
||||
extern consvar_t cv_grmd2;
|
||||
extern consvar_t cv_grfog;
|
||||
extern consvar_t cv_grfogcolor;
|
||||
|
|
|
|||
|
|
@ -2056,10 +2056,11 @@ EXPORT void HWRAPI(DrawMD2) (INT32 *gl_cmd_buffer, md2_frame_t *frame, FTransfor
|
|||
EXPORT void HWRAPI(SetTransform) (FTransform *stransform)
|
||||
{
|
||||
static boolean special_splitscreen;
|
||||
double used_fov;
|
||||
pglLoadIdentity();
|
||||
if (stransform)
|
||||
{
|
||||
boolean fovx90;
|
||||
used_fov = stransform->fovxangle;
|
||||
// keep a trace of the transformation for md2
|
||||
memcpy(&md2_transform, stransform, sizeof (md2_transform));
|
||||
|
||||
|
|
@ -2074,36 +2075,29 @@ EXPORT void HWRAPI(SetTransform) (FTransform *stransform)
|
|||
pglRotatef(stransform->angley+270.0f, 0.0f, 1.0f, 0.0f);
|
||||
pglTranslatef(-stransform->x, -stransform->z, -stransform->y);
|
||||
|
||||
pglMatrixMode(GL_PROJECTION);
|
||||
pglLoadIdentity();
|
||||
fovx90 = stransform->fovxangle > 0.0f && fabsf(stransform->fovxangle - 90.0f) < 0.5f;
|
||||
special_splitscreen = (stransform->splitscreen == 1 && fovx90);
|
||||
if (special_splitscreen)
|
||||
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);
|
||||
special_splitscreen = (stransform->splitscreen == 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Hurdler: is "fov" correct?
|
||||
used_fov = fov;
|
||||
pglScalef(1.0f, 1.0f, -1.0f);
|
||||
|
||||
pglMatrixMode(GL_PROJECTION);
|
||||
pglLoadIdentity();
|
||||
if (special_splitscreen)
|
||||
GLPerspective(53.13l, 2*ASPECT_RATIO); // 53.13 = 2*atan(0.5)
|
||||
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);
|
||||
}
|
||||
|
||||
pglMatrixMode(GL_PROJECTION);
|
||||
pglLoadIdentity();
|
||||
if (special_splitscreen)
|
||||
{
|
||||
used_fov = atan(tan(used_fov*M_PIl/360.0l)*0.8l)*360/M_PIl;
|
||||
GLPerspective(used_fov, 2*ASPECT_RATIO);
|
||||
}
|
||||
else
|
||||
GLPerspective(used_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
|
||||
|
|
|
|||
234
src/hu_stuff.c
234
src/hu_stuff.c
|
|
@ -74,6 +74,14 @@ patch_t *nightsnum[10]; // 0-9
|
|||
patch_t *lt_font[LT_FONTSIZE];
|
||||
patch_t *cred_font[CRED_FONTSIZE];
|
||||
|
||||
// ping font
|
||||
// Note: I'd like to adress that at this point we might *REALLY* want to work towards a common drawString function that can take any font we want because this is really turning into a MESS. :V -Lat'
|
||||
patch_t *pingnum[10];
|
||||
patch_t *pinggfx[5]; // small ping graphic
|
||||
|
||||
patch_t *framecounter;
|
||||
patch_t *frameslash; // framerate stuff. Used in screen.c
|
||||
|
||||
static player_t *plr;
|
||||
boolean chat_on; // entering a chat message?
|
||||
static char w_chat[HU_MAXMSGLEN];
|
||||
|
|
@ -263,6 +271,8 @@ void HU_LoadGraphics(void)
|
|||
tallnum[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX);
|
||||
sprintf(buffer, "NGTNUM%d", i);
|
||||
nightsnum[i] = (patch_t *) W_CachePatchName(buffer, PU_HUDGFX);
|
||||
sprintf(buffer, "PINGN%d", i);
|
||||
pingnum[i] = (patch_t *) W_CachePatchName(buffer, PU_HUDGFX);
|
||||
}
|
||||
|
||||
// minus for negative tallnums
|
||||
|
|
@ -295,6 +305,17 @@ void HU_LoadGraphics(void)
|
|||
tinyemeraldpics[6] = W_CachePatchName("TEMER7", PU_HUDGFX);
|
||||
|
||||
songcreditbg = W_CachePatchName("K_SONGCR", PU_HUDGFX);
|
||||
|
||||
// cache ping gfx:
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
sprintf(buffer, "PINGGFX%d", i+1);
|
||||
pinggfx[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX);
|
||||
}
|
||||
|
||||
// fps stuff
|
||||
framecounter = W_CachePatchName("FRAMER", PU_HUDGFX);
|
||||
frameslash = W_CachePatchName("FRAMESL", PU_HUDGFX);;
|
||||
}
|
||||
|
||||
// Initialise Heads up
|
||||
|
|
@ -757,44 +778,139 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
const UINT8 color = players[playernum].skincolor;
|
||||
|
||||
cstart = "\x83";
|
||||
|
||||
if (color <= SKINCOLOR_SILVER || color == SKINCOLOR_SLATE)
|
||||
cstart = "\x80"; // white
|
||||
else if (color <= SKINCOLOR_BLACK || color == SKINCOLOR_JET)
|
||||
cstart = "\x86"; // V_GRAYMAP
|
||||
else if (color <= SKINCOLOR_LEATHER)
|
||||
cstart = "\x8e"; // V_BROWNMAP
|
||||
else if (color <= SKINCOLOR_ROSE || color == SKINCOLOR_LILAC)
|
||||
cstart = "\x8d"; // V_PINKMAP
|
||||
else if (color <= SKINCOLOR_KETCHUP)
|
||||
cstart = "\x85"; // V_REDMAP
|
||||
else if (color <= SKINCOLOR_TANGERINE)
|
||||
cstart = "\x87"; // V_ORANGEMAP
|
||||
else if (color <= SKINCOLOR_CARAMEL)
|
||||
cstart = "\x8f"; // V_PEACHMAP
|
||||
else if (color <= SKINCOLOR_BRONZE)
|
||||
cstart = "\x8A"; // V_GOLDMAP
|
||||
else if (color <= SKINCOLOR_OLIVE)
|
||||
cstart = "\x82"; // V_YELLOWMAP
|
||||
else if (color <= SKINCOLOR_PISTACHIO)
|
||||
cstart = "\x8b"; // V_TEAMAP
|
||||
else if (color <= SKINCOLOR_DREAM || color == SKINCOLOR_LIME)
|
||||
cstart = "\x83"; // V_GREENMAP
|
||||
else if (color <= SKINCOLOR_NAVY || color == SKINCOLOR_SAPPHIRE)
|
||||
cstart = "\x88"; // V_SKYMAP
|
||||
else if (color <= SKINCOLOR_STEEL)
|
||||
cstart = "\x8c"; // V_STEELMAP
|
||||
else if (color <= SKINCOLOR_BLUEBERRY)
|
||||
cstart = "\x84"; // V_BLUEMAP
|
||||
else if (color == SKINCOLOR_PURPLE)
|
||||
cstart = "\x81"; // V_PURPLEMAP
|
||||
else //if (color <= SKINCOLOR_POMEGRANATE)
|
||||
cstart = "\x89"; // V_LAVENDERMAP
|
||||
}
|
||||
switch (color)
|
||||
{
|
||||
case SKINCOLOR_WHITE:
|
||||
case SKINCOLOR_SILVER:
|
||||
case SKINCOLOR_SLATE:
|
||||
cstart = "\x80"; // White
|
||||
break;
|
||||
case SKINCOLOR_GREY:
|
||||
case SKINCOLOR_NICKEL:
|
||||
case SKINCOLOR_BLACK:
|
||||
case SKINCOLOR_JET:
|
||||
cstart = "\x86"; // V_GRAYMAP
|
||||
break;
|
||||
case SKINCOLOR_SEPIA:
|
||||
case SKINCOLOR_BEIGE:
|
||||
case SKINCOLOR_BROWN:
|
||||
case SKINCOLOR_LEATHER:
|
||||
case SKINCOLOR_RUST:
|
||||
cstart = "\x8e"; // V_BROWNMAP
|
||||
break;
|
||||
case SKINCOLOR_FAIRY:
|
||||
case SKINCOLOR_SALMON:
|
||||
case SKINCOLOR_PINK:
|
||||
case SKINCOLOR_ROSE:
|
||||
case SKINCOLOR_BRICK:
|
||||
case SKINCOLOR_BUBBLEGUM:
|
||||
case SKINCOLOR_LILAC:
|
||||
cstart = "\x8d"; // V_PINKMAP
|
||||
break;
|
||||
case SKINCOLOR_RUBY:
|
||||
case SKINCOLOR_RASPBERRY:
|
||||
case SKINCOLOR_CHERRY:
|
||||
case SKINCOLOR_RED:
|
||||
case SKINCOLOR_CRIMSON:
|
||||
case SKINCOLOR_MAROON:
|
||||
case SKINCOLOR_FLAME:
|
||||
case SKINCOLOR_SCARLET:
|
||||
case SKINCOLOR_KETCHUP:
|
||||
cstart = "\x85"; // V_REDMAP
|
||||
break;
|
||||
case SKINCOLOR_DAWN:
|
||||
case SKINCOLOR_SUNSET:
|
||||
case SKINCOLOR_CREAMSICLE:
|
||||
case SKINCOLOR_ORANGE:
|
||||
case SKINCOLOR_PUMPKIN:
|
||||
case SKINCOLOR_ROSEWOOD:
|
||||
case SKINCOLOR_BURGUNDY:
|
||||
case SKINCOLOR_TANGERINE:
|
||||
cstart = "\x87"; // V_ORANGEMAP
|
||||
break;
|
||||
case SKINCOLOR_PEACH:
|
||||
case SKINCOLOR_CARAMEL:
|
||||
case SKINCOLOR_CREAM:
|
||||
cstart = "\x8f"; // V_PEACHMAP
|
||||
break;
|
||||
case SKINCOLOR_GOLD:
|
||||
case SKINCOLOR_ROYAL:
|
||||
case SKINCOLOR_BRONZE:
|
||||
case SKINCOLOR_COPPER:
|
||||
cstart = "\x8A"; // V_GOLDMAP
|
||||
break;
|
||||
case SKINCOLOR_POPCORN:
|
||||
case SKINCOLOR_YELLOW:
|
||||
case SKINCOLOR_MUSTARD:
|
||||
case SKINCOLOR_OLIVE:
|
||||
cstart = "\x82"; // V_YELLOWMAP
|
||||
break;
|
||||
case SKINCOLOR_VOMIT:
|
||||
case SKINCOLOR_GARDEN:
|
||||
case SKINCOLOR_TEA:
|
||||
case SKINCOLOR_PISTACHIO:
|
||||
cstart = "\x8b"; // V_TEAMAP
|
||||
break;
|
||||
case SKINCOLOR_LIME:
|
||||
case SKINCOLOR_HANDHELD:
|
||||
case SKINCOLOR_MOSS:
|
||||
case SKINCOLOR_CAMOUFLAGE:
|
||||
case SKINCOLOR_ROBOHOOD:
|
||||
case SKINCOLOR_MINT:
|
||||
case SKINCOLOR_GREEN:
|
||||
case SKINCOLOR_PINETREE:
|
||||
case SKINCOLOR_EMERALD:
|
||||
case SKINCOLOR_SWAMP:
|
||||
case SKINCOLOR_DREAM:
|
||||
case SKINCOLOR_PLAGUE:
|
||||
case SKINCOLOR_ALGAE:
|
||||
cstart = "\x83"; // V_GREENMAP
|
||||
break;
|
||||
case SKINCOLOR_CARIBBEAN:
|
||||
case SKINCOLOR_AQUA:
|
||||
case SKINCOLOR_TEAL:
|
||||
case SKINCOLOR_CYAN:
|
||||
case SKINCOLOR_JAWZ:
|
||||
case SKINCOLOR_CERULEAN:
|
||||
case SKINCOLOR_NAVY:
|
||||
case SKINCOLOR_SAPPHIRE:
|
||||
cstart = "\x88"; // V_SKYMAP
|
||||
break;
|
||||
case SKINCOLOR_PLATINUM:
|
||||
case SKINCOLOR_STEEL:
|
||||
cstart = "\x8c"; // V_STEELMAP
|
||||
break;
|
||||
case SKINCOLOR_PERIWINKLE:
|
||||
case SKINCOLOR_BLUE:
|
||||
case SKINCOLOR_BLUEBERRY:
|
||||
case SKINCOLOR_NOVA:
|
||||
cstart = "\x84"; // V_BLUEMAP
|
||||
break;
|
||||
case SKINCOLOR_ULTRAVIOLET:
|
||||
case SKINCOLOR_PURPLE:
|
||||
case SKINCOLOR_FUCHSIA:
|
||||
cstart = "\x81"; // V_PURPLEMAP
|
||||
break;
|
||||
case SKINCOLOR_PASTEL:
|
||||
case SKINCOLOR_MOONSLAM:
|
||||
case SKINCOLOR_DUSK:
|
||||
case SKINCOLOR_TOXIC:
|
||||
case SKINCOLOR_MAUVE:
|
||||
case SKINCOLOR_LAVENDER:
|
||||
case SKINCOLOR_BYZANTIUM:
|
||||
case SKINCOLOR_POMEGRANATE:
|
||||
cstart = "\x89"; // V_LAVENDERMAP
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
prefix = cstart;
|
||||
|
||||
// Give admins and remote admins their symbols.
|
||||
|
|
@ -1185,8 +1301,8 @@ boolean HU_Responder(event_t *ev)
|
|||
return true;
|
||||
|
||||
// Ignore non-keyboard keys, except when the talk key is bound
|
||||
if (ev->data1 >= KEY_MOUSE1
|
||||
&& (ev->data1 != gamecontrol[gc_talkkey][0]
|
||||
if (ev->data1 >= KEY_MOUSE1
|
||||
&& (ev->data1 != gamecontrol[gc_talkkey][0]
|
||||
&& ev->data1 != gamecontrol[gc_talkkey][1]))
|
||||
return false;
|
||||
|
||||
|
|
@ -1612,9 +1728,9 @@ static void HU_drawChatLog(INT32 offset)
|
|||
|
||||
// draw arrows to indicate that we can (or not) scroll.
|
||||
if (chat_scroll > 0)
|
||||
V_DrawThinString(chatx-9, ((justscrolledup) ? (chat_topy-1) : (chat_topy)), V_SNAPTOBOTTOM | V_SNAPTOLEFT | highlight, "\x1A"); // up arrow
|
||||
V_DrawCharacter(chatx-9, ((justscrolledup) ? (chat_topy-1) : (chat_topy)), V_SNAPTOBOTTOM | V_SNAPTOLEFT | highlight | '\x1A', false); // up arrow
|
||||
if (chat_scroll < chat_maxscroll)
|
||||
V_DrawThinString(chatx-9, chat_bottomy-((justscrolleddown) ? 5 : 6), V_SNAPTOBOTTOM | V_SNAPTOLEFT | highlight, "\x1B"); // down arrow
|
||||
V_DrawCharacter(chatx-9, chat_bottomy-((justscrolleddown) ? 5 : 6), V_SNAPTOBOTTOM | V_SNAPTOLEFT | highlight | '\x1B', false); // down arrow
|
||||
|
||||
justscrolleddown = false;
|
||||
justscrolledup = false;
|
||||
|
|
@ -2178,6 +2294,7 @@ static void HU_DrawSongCredits(void)
|
|||
V_DrawRightAlignedThinString(cursongcredit.x, y, V_ALLOWLOWERCASE|V_6WIDTHSPACE|V_SNAPTOLEFT|(cursongcredit.trans<<V_ALPHASHIFT), str);
|
||||
}
|
||||
|
||||
|
||||
// Heads up displays drawer, call each frame
|
||||
//
|
||||
void HU_Drawer(void)
|
||||
|
|
@ -2369,36 +2486,25 @@ void HU_Erase(void)
|
|||
//
|
||||
// HU_drawPing
|
||||
//
|
||||
void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext)
|
||||
void HU_drawPing(INT32 x, INT32 y, UINT32 ping, INT32 flags)
|
||||
{
|
||||
UINT8 numbars = 1; // how many ping bars do we draw?
|
||||
UINT8 barcolor = 128; // color we use for the bars (green, yellow or red)
|
||||
SINT8 i = 0;
|
||||
SINT8 yoffset = 6;
|
||||
INT32 dx = x+1 - (V_SmallStringWidth(va("%dms", ping), V_ALLOWLOWERCASE)/2);
|
||||
INT32 gfxnum = 4; // gfx to draw
|
||||
UINT8 const *colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_SALMON, GTC_CACHE);
|
||||
|
||||
if (ping < 128)
|
||||
{
|
||||
numbars = 3;
|
||||
barcolor = 184;
|
||||
}
|
||||
if (ping < 76)
|
||||
gfxnum = 0;
|
||||
else if (ping < 137)
|
||||
gfxnum = 1;
|
||||
else if (ping < 256)
|
||||
{
|
||||
numbars = 2; // Apparently ternaries w/ multiple statements don't look good in C so I decided against it.
|
||||
barcolor = 103;
|
||||
}
|
||||
gfxnum = 2;
|
||||
else if (ping < 500)
|
||||
gfxnum = 3;
|
||||
|
||||
if (!notext || vid.width >= 640) // how sad, we're using a shit resolution.
|
||||
V_DrawSmallString(dx, y+4, V_ALLOWLOWERCASE, va("%dms", ping));
|
||||
|
||||
for (i=0; (i<3); i++) // Draw the ping bar
|
||||
{
|
||||
V_DrawFill(x+2 *(i-1), y+yoffset-4, 2, 8-yoffset, 31);
|
||||
if (i < numbars)
|
||||
V_DrawFill(x+2 *(i-1), y+yoffset-3, 1, 8-yoffset-1, barcolor);
|
||||
|
||||
yoffset -= 2;
|
||||
}
|
||||
V_DrawScaledPatch(x, y, flags, pinggfx[gfxnum]);
|
||||
if (servermaxping && ping > servermaxping && hu_tick < 4) // flash ping red if too high
|
||||
V_DrawPingNum(x, y+9, flags, ping, colormap);
|
||||
else
|
||||
V_DrawPingNum(x, y+9, flags, ping, NULL);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -80,7 +80,11 @@ extern boolean chat_on;
|
|||
|
||||
extern patch_t *hu_font[HU_FONTSIZE], *kart_font[KART_FONTSIZE], *tny_font[HU_FONTSIZE]; // SRB2kart
|
||||
extern patch_t *tallnum[10];
|
||||
extern patch_t *pingnum[10];
|
||||
extern patch_t *pinggfx[5];
|
||||
extern patch_t *nightsnum[10];
|
||||
extern patch_t *framecounter;
|
||||
extern patch_t *frameslash;
|
||||
extern patch_t *lt_font[LT_FONTSIZE];
|
||||
extern patch_t *cred_font[CRED_FONTSIZE];
|
||||
extern patch_t *emeraldpics[7];
|
||||
|
|
@ -109,7 +113,7 @@ void HU_Drawer(void);
|
|||
char HU_dequeueChatChar(void);
|
||||
void HU_Erase(void);
|
||||
void HU_clearChatChars(void);
|
||||
void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext); // Lat': Ping drawer for scoreboard.
|
||||
void HU_drawPing(INT32 x, INT32 y, UINT32 ping, INT32 flags); // Lat': Ping drawer for scoreboard.
|
||||
//void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer);
|
||||
//void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer);
|
||||
void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer, INT32 hilicol);
|
||||
|
|
|
|||
53
src/info.c
53
src/info.c
|
|
@ -3140,11 +3140,11 @@ state_t states[NUMSTATES] =
|
|||
{SPR_NULL, 0, 1, {A_FZBoomSmoke}, 1, 0, S_FZEROBOOM12}, // S_FZEROBOOM11
|
||||
{SPR_NULL, 0, 1, {A_FZBoomSmoke}, 0, 0, S_NULL}, // S_FZEROBOOM12
|
||||
|
||||
{SPR_SMOK, FF_TRANS30, 30, {NULL}, 0, 0, S_FZSLOWSMOKE2}, // S_FZSLOWSMOKE1
|
||||
{SPR_SMOK, FF_TRANS30|1, 30, {NULL}, 0, 0, S_FZSLOWSMOKE3}, // S_FZSLOWSMOKE2
|
||||
{SPR_SMOK, FF_TRANS30|2, 30, {NULL}, 0, 0, S_FZSLOWSMOKE4}, // S_FZSLOWSMOKE3
|
||||
{SPR_SMOK, FF_TRANS30|3, 30, {NULL}, 0, 0, S_FZSLOWSMOKE5}, // S_FZSLOWSMOKE4
|
||||
{SPR_SMOK, FF_TRANS30|4, 30, {NULL}, 0, 0, S_NULL}, // S_FZSLOWSMOKE5
|
||||
{SPR_SMOK, 0, 30, {NULL}, 0, 0, S_FZSLOWSMOKE2}, // S_FZSLOWSMOKE1
|
||||
{SPR_SMOK, 1, 30, {NULL}, 0, 0, S_FZSLOWSMOKE3}, // S_FZSLOWSMOKE2
|
||||
{SPR_SMOK, 2, 30, {NULL}, 0, 0, S_FZSLOWSMOKE4}, // S_FZSLOWSMOKE3
|
||||
{SPR_SMOK, 3, 30, {NULL}, 0, 0, S_FZSLOWSMOKE5}, // S_FZSLOWSMOKE4
|
||||
{SPR_SMOK, 4, 30, {NULL}, 0, 0, S_NULL}, // S_FZSLOWSMOKE5
|
||||
|
||||
// Various plants
|
||||
{SPR_SBUS, 0, -1, {NULL}, 0, 0, S_NULL}, // S_SONICBUSH
|
||||
|
|
@ -3297,39 +3297,39 @@ state_t states[NUMSTATES] =
|
|||
{SPR_CNDL, 1|FF_FULLBRIGHT|FF_TRANS50, 3, {NULL}, 0, 0, S_BLUEFIRE3}, // S_BLUEFIRE2
|
||||
{SPR_CNDL, 2|FF_FULLBRIGHT|FF_TRANS50, 3, {NULL}, 0, 0, S_BLUEFIRE4}, // S_BLUEFIRE3
|
||||
{SPR_CNDL, 3|FF_FULLBRIGHT|FF_TRANS50, 3, {NULL}, 0, 0, S_BLUEFIRE1}, // S_BLUEFIRE4
|
||||
|
||||
|
||||
{SPR_CNDL, 4|FF_FULLBRIGHT|FF_TRANS50, 3, {NULL}, 0, 0, S_GREENFIRE2}, // S_GREENFIRE1
|
||||
{SPR_CNDL, 5|FF_FULLBRIGHT|FF_TRANS50, 3, {NULL}, 0, 0, S_GREENFIRE3}, // S_GREENFIRE2
|
||||
{SPR_CNDL, 6|FF_FULLBRIGHT|FF_TRANS50, 3, {NULL}, 0, 0, S_GREENFIRE4}, // S_GREENFIRE3
|
||||
{SPR_CNDL, 7|FF_FULLBRIGHT|FF_TRANS50, 3, {NULL}, 0, 0, S_GREENFIRE1}, // S_GREENFIRE4
|
||||
|
||||
|
||||
{SPR_CHES, 0, -1, {NULL}, 0, 0, S_NULL}, // S_REGALCHEST
|
||||
{SPR_CHIM, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_CHIMERASTATUE
|
||||
{SPR_DRGN, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_DRAGONSTATUE
|
||||
{SPR_LZMN, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_LIZARDMANSTATUE
|
||||
{SPR_PGSS, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_PEGASUSSTATUE
|
||||
|
||||
|
||||
{SPR_ZTCH, FF_FULLBRIGHT|FF_TRANS50, 3, {NULL}, 0, 0, S_ZELDAFIRE2}, // S_ZELDAFIRE1
|
||||
{SPR_ZTCH, 1|FF_FULLBRIGHT|FF_TRANS50, 3, {NULL}, 0, 0, S_ZELDAFIRE3}, // S_ZELDAFIRE2
|
||||
{SPR_ZTCH, 2|FF_FULLBRIGHT|FF_TRANS50, 3, {NULL}, 0, 0, S_ZELDAFIRE4}, // S_ZELDAFIRE3
|
||||
{SPR_ZTCH, 3|FF_FULLBRIGHT|FF_TRANS50, 3, {NULL}, 0, 0, S_ZELDAFIRE1}, // S_ZELDAFIRE4
|
||||
|
||||
|
||||
{SPR_DOCH, 0, -1, {NULL}, 0, 0, S_NULL}, // S_GANBARETHING
|
||||
{SPR_DUCK, 0, -1, {NULL}, 0, 0, S_NULL}, // S_GANBAREDUCK
|
||||
{SPR_GTRE, 0, -1, {NULL}, 0, 0, S_NULL}, // S_GANBARETREE
|
||||
|
||||
|
||||
{SPR_MKMA, 1, 2, {A_Look}, (256<<16)|1, 0, S_MONOIDLE}, // S_MONOIDLE
|
||||
{SPR_MKMA, 0, 3, {A_Chase}, 3, 0, S_MONOCHASE2}, // S_MONOCHASE1
|
||||
{SPR_MKMA, 1, 3, {A_Chase}, 3, 0, S_MONOCHASE3}, // S_MONOCHASE2
|
||||
{SPR_MKMA, 2, 3, {A_Chase}, 3, 0, S_MONOCHASE4}, // S_MONOCHASE3
|
||||
{SPR_MKMA, 3, 3, {A_Chase}, 3, 0, S_MONOCHASE1}, // S_MONOCHASE4
|
||||
{SPR_MKMP, 0, 24, {A_Pain}, 3, 0, S_MONOIDLE}, // S_MONOPAIN
|
||||
|
||||
|
||||
{SPR_RTCH, FF_FULLBRIGHT|FF_TRANS50, 3, {NULL}, 0, 0, S_REDZELDAFIRE2}, // S_REDZELDAFIRE1
|
||||
{SPR_RTCH, 1|FF_FULLBRIGHT|FF_TRANS50, 3, {NULL}, 0, 0, S_REDZELDAFIRE3}, // S_REDZELDAFIRE2
|
||||
{SPR_RTCH, 2|FF_FULLBRIGHT|FF_TRANS50, 3, {NULL}, 0, 0, S_REDZELDAFIRE4}, // S_REDZELDAFIRE3
|
||||
{SPR_RTCH, 3|FF_FULLBRIGHT|FF_TRANS50, 3, {NULL}, 0, 0, S_REDZELDAFIRE1}, // S_REDZELDAFIRE4
|
||||
|
||||
|
||||
{SPR_BOWL, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BOWLINGPIN
|
||||
{SPR_BOWH, 0, 4, {A_BunnyHop}, 5, 20, S_BOWLINGHIT2}, // S_BOWLINGHIT1
|
||||
{SPR_BOWH, 1, 2, {NULL}, 0, 0, S_BOWLINGHIT3}, // S_BOWLINGHIT2
|
||||
|
|
@ -3341,7 +3341,7 @@ state_t states[NUMSTATES] =
|
|||
{SPR_TOAH, 1, 3, {NULL}, 0, 0, S_TOADHIT3}, // S_TOADHIT2
|
||||
{SPR_TOAH, 2, 3, {NULL}, 0, 0, S_TOADHIT4}, // S_TOADHIT3
|
||||
{SPR_TOAH, 3, 3, {NULL}, 0, 0, S_EBARREL18}, // S_TOADHIT4
|
||||
|
||||
|
||||
{SPR_BRRL, 0, 1, {A_Look}, (96<<16)|1, 0, S_EBARRELIDLE}, // S_EBARRELIDLE
|
||||
{SPR_BRRR, 0, 4, {NULL}, 0, 0, S_EBARREL2}, // S_EBARREL1
|
||||
{SPR_BRRR, 1, 4, {NULL}, 0, 0, S_EBARREL3}, // S_EBARREL2
|
||||
|
|
@ -3361,30 +3361,30 @@ state_t states[NUMSTATES] =
|
|||
{SPR_BRRR, 15, 4, {NULL}, 0, 0, S_EBARREL17}, // S_EBARREL16
|
||||
{SPR_BRRR, 16, 4, {NULL}, 0, 0, S_EBARREL18}, // S_EBARREL17
|
||||
{SPR_BRRR, 16, 0, {A_MineExplode}, MT_MINEEXPLOSION, 0, S_NULL}, // S_EBARREL18
|
||||
|
||||
|
||||
{SPR_HRSE, 0, 230, {A_PlaySeeSound}, 0, 0, S_MERRYHORSE}, // S_MERRYHORSE
|
||||
|
||||
|
||||
{SPR_BFRT, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BLUEFRUIT
|
||||
{SPR_OFRT, 0, -1, {NULL}, 0, 0, S_NULL}, // S_ORANGEFRUIT
|
||||
{SPR_RFRT, 0, -1, {NULL}, 0, 0, S_NULL}, // S_REDFRUIT
|
||||
{SPR_PFRT, 0, -1, {NULL}, 0, 0, S_NULL}, // S_PINKFRUIT
|
||||
|
||||
|
||||
{SPR_ASPK, 0, 50, {A_PlayAttackSound}, 0, 0, S_ADVENTURESPIKEA2}, // S_ADVENTURESPIKEA1
|
||||
{SPR_ASPK, 0, 50, {A_BunnyHop}, 20, 0, S_ADVENTURESPIKEA1}, // S_ADVENTURESPIKEA2
|
||||
{SPR_ASPK, 0, 50, {A_PlayAttackSound}, 0, 0, S_ADVENTURESPIKEB2}, // S_ADVENTURESPIKEB1
|
||||
{SPR_ASPK, 0, 35, {A_BunnyHop}, 15, 0, S_ADVENTURESPIKEB1}, // S_ADVENTURESPIKEB2
|
||||
{SPR_ASPK, 0, 50, {A_PlayAttackSound}, 0, 0, S_ADVENTURESPIKEC2}, // S_ADVENTURESPIKEC1
|
||||
{SPR_ASPK, 0, 65, {A_BunnyHop}, 25, 0, S_ADVENTURESPIKEC1}, // S_ADVENTURESPIKEC1
|
||||
|
||||
|
||||
{SPR_HBST, FF_FULLBRIGHT, 5, {NULL}, 0, 0, S_BOOSTPROMPT2}, // S_BOOSTPROMPT1
|
||||
{SPR_HBST, 1|FF_FULLBRIGHT, 5, {NULL}, 0, 0, S_BOOSTPROMPT1}, // S_BOOSTPROMPT2
|
||||
|
||||
|
||||
{SPR_HBSF, FF_FULLBRIGHT, 5, {NULL}, 0, 0, S_BOOSTOFF2}, // S_BOOSTOFF1
|
||||
{SPR_HBSF, 1|FF_FULLBRIGHT, 5, {NULL}, 0, 0, S_BOOSTOFF1}, // S_BOOSTOFF2
|
||||
|
||||
|
||||
{SPR_HBSO, FF_FULLBRIGHT, 5, {NULL}, 0, 0, S_BOOSTON2}, // S_BOOSTON1
|
||||
{SPR_HBSO, 1|FF_FULLBRIGHT, 5, {NULL}, 0, 0, S_BOOSTON1}, // S_BOOSTON2
|
||||
|
||||
|
||||
{SPR_WBLZ, 0, -1, {NULL}, 0, 0, S_NULL}, // S_LIZARDMAN
|
||||
{SPR_WBLN, 0, -1, {NULL}, 0, 0, S_NULL}, // S_LIONMAN
|
||||
|
||||
|
|
@ -3394,6 +3394,13 @@ state_t states[NUMSTATES] =
|
|||
{SPR_FWRK, 3|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_KARMAFIREWORK1}, // S_KARMAFIREWORK4
|
||||
{SPR_FWRK, 4|FF_FULLBRIGHT, TICRATE, {NULL}, 0, 0, S_NULL}, // S_KARMAFIREWORKTRAIL
|
||||
|
||||
// Opaque smoke
|
||||
{SPR_SMOK, 0, 4, {NULL}, 0, 0, S_OPAQUESMOKE2}, // S_OPAQUESMOKE1
|
||||
{SPR_SMOK, 1, 5, {NULL}, 0, 0, S_OPAQUESMOKE3}, // S_OPAQUESMOKE2
|
||||
{SPR_SMOK, 2, 6, {NULL}, 0, 0, S_OPAQUESMOKE4}, // S_OPAQUESMOKE3
|
||||
{SPR_SMOK, 3, 7, {NULL}, 0, 0, S_OPAQUESMOKE5}, // S_OPAQUESMOKE4
|
||||
{SPR_SMOK, 4, 8, {NULL}, 0, 0, S_NULL}, // S_OPAQUESMOKE5
|
||||
|
||||
{SPR_OTFG, FF_FULLBRIGHT|FF_TRANS50, TICRATE, {NULL}, 0, 0, S_NULL}, // S_OVERTIMEFOG
|
||||
{SPR_OTFG, 2|FF_FULLBRIGHT|FF_PAPERSPRITE, 1, {NULL}, 0, 0, S_NULL}, // S_OVERTIMEORB
|
||||
{SPR_OTFG, 1|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_NULL}, // S_OVERTIMEBEAM
|
||||
|
|
@ -15453,7 +15460,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
S_ORBINAUT_SHIELDDEAD, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
10*FRACUNIT, // speed
|
||||
4*FRACUNIT, // speed
|
||||
16*FRACUNIT, // radius
|
||||
32*FRACUNIT, // height
|
||||
0, // display offset
|
||||
|
|
@ -15534,7 +15541,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
S_JAWZ_DEAD1, // deathstate
|
||||
S_JAWZ_DEAD2, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
10*FRACUNIT, // speed
|
||||
4*FRACUNIT, // speed
|
||||
16*FRACUNIT, // radius
|
||||
32*FRACUNIT, // height
|
||||
0, // display offset
|
||||
|
|
@ -15578,7 +15585,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
1, // spawnhealth
|
||||
S_NULL, // seestate
|
||||
sfx_tossed, // seesound
|
||||
6*TICRATE, // reactiontime
|
||||
0, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
S_NULL, // painstate
|
||||
192*FRACUNIT, // painchance
|
||||
|
|
|
|||
14
src/info.h
14
src/info.h
|
|
@ -608,7 +608,7 @@ typedef enum sprite
|
|||
// Kart Items
|
||||
SPR_RSHE, // Rocket sneaker
|
||||
SPR_FITM, // Eggman Monitor
|
||||
SPR_BANA, // Banana Peel
|
||||
SPR_BANA, // Banana Peel
|
||||
SPR_ORBN, // Orbinaut
|
||||
SPR_JAWZ, // Jawz
|
||||
SPR_SSMN, // SS Mine
|
||||
|
|
@ -3873,7 +3873,7 @@ typedef enum state
|
|||
S_GARU1,
|
||||
S_GARU2,
|
||||
S_GARU3,
|
||||
S_TGARU0,
|
||||
S_TGARU0,
|
||||
S_TGARU1,
|
||||
S_TGARU2,
|
||||
S_TGARU3, // Wind attack used by Roaming Shadows on Players.
|
||||
|
|
@ -4054,6 +4054,12 @@ typedef enum state
|
|||
S_KARMAFIREWORK4,
|
||||
S_KARMAFIREWORKTRAIL,
|
||||
|
||||
S_OPAQUESMOKE1,
|
||||
S_OPAQUESMOKE2,
|
||||
S_OPAQUESMOKE3,
|
||||
S_OPAQUESMOKE4,
|
||||
S_OPAQUESMOKE5,
|
||||
|
||||
S_OVERTIMEFOG,
|
||||
S_OVERTIMEORB,
|
||||
S_OVERTIMEBEAM,
|
||||
|
|
@ -4618,14 +4624,14 @@ typedef enum mobj_type
|
|||
MT_EGGMANITEM_SHIELD,
|
||||
|
||||
MT_BANANA, // Banana Stuff
|
||||
MT_BANANA_SHIELD,
|
||||
MT_BANANA_SHIELD,
|
||||
|
||||
MT_ORBINAUT, // Orbinaut stuff
|
||||
MT_ORBINAUT_SHIELD,
|
||||
|
||||
MT_JAWZ, // Jawz stuff
|
||||
MT_JAWZ_DUD,
|
||||
MT_JAWZ_SHIELD,
|
||||
MT_JAWZ_SHIELD,
|
||||
|
||||
MT_PLAYERRETICULE, // Jawz reticule
|
||||
|
||||
|
|
|
|||
16969
src/k_kart.c
16969
src/k_kart.c
File diff suppressed because it is too large
Load diff
167
src/k_kart.h
167
src/k_kart.h
|
|
@ -1,83 +1,84 @@
|
|||
// SONIC ROBO BLAST 2 KART ~ ZarroTsu
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file k_kart.h
|
||||
/// \brief SRB2kart stuff.
|
||||
|
||||
#ifndef __K_KART__
|
||||
#define __K_KART__
|
||||
|
||||
#include "doomdef.h"
|
||||
#include "d_player.h" // Need for player_t
|
||||
|
||||
#define KART_FULLTURN 800
|
||||
|
||||
UINT8 colortranslations[MAXSKINCOLORS][16];
|
||||
extern const char *KartColor_Names[MAXSKINCOLORS];
|
||||
extern const UINT8 KartColor_Opposite[MAXSKINCOLORS*2];
|
||||
void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor);
|
||||
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color);
|
||||
UINT8 K_GetKartColorByName(const char *name);
|
||||
|
||||
void K_RegisterKartStuff(void);
|
||||
|
||||
boolean K_IsPlayerLosing(player_t *player);
|
||||
boolean K_IsPlayerWanted(player_t *player);
|
||||
void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid);
|
||||
void K_MatchGenericExtraFlags(mobj_t *mo, mobj_t *master);
|
||||
void K_RespawnChecker(player_t *player);
|
||||
void K_KartMoveAnimation(player_t *player);
|
||||
void K_KartPlayerHUDUpdate(player_t *player);
|
||||
void K_KartPlayerThink(player_t *player, ticcmd_t *cmd);
|
||||
void K_KartPlayerAfterThink(player_t *player);
|
||||
void K_DoInstashield(player_t *player);
|
||||
void K_SpawnBattlePoints(player_t *source, player_t *victim, UINT8 amount);
|
||||
void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, mobj_t *inflictor, boolean trapitem);
|
||||
void K_SquishPlayer(player_t *player, mobj_t *source, mobj_t *inflictor);
|
||||
void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor);
|
||||
void K_StealBumper(player_t *player, player_t *victim, boolean force);
|
||||
void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 number, mobjtype_t type, angle_t rotangle, boolean spawncenter, boolean ghostit, mobj_t *source);
|
||||
void K_SpawnMineExplosion(mobj_t *source, UINT8 color);
|
||||
void K_SpawnBoostTrail(player_t *player);
|
||||
void K_SpawnSparkleTrail(mobj_t *mo);
|
||||
void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent);
|
||||
void K_DriftDustHandling(mobj_t *spawner);
|
||||
void K_DoSneaker(player_t *player, INT32 type);
|
||||
void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound);
|
||||
void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source);
|
||||
void K_UpdateHnextList(player_t *player, boolean clean);
|
||||
void K_DropHnextList(player_t *player);
|
||||
void K_RepairOrbitChain(mobj_t *orbit);
|
||||
player_t *K_FindJawzTarget(mobj_t *actor, player_t *source);
|
||||
boolean K_CheckPlayersRespawnColliding(INT32 playernum, fixed_t x, fixed_t y);
|
||||
INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue);
|
||||
INT32 K_GetKartDriftSparkValue(player_t *player);
|
||||
void K_KartUpdatePosition(player_t *player);
|
||||
void K_DropItems(player_t *player);
|
||||
void K_StripItems(player_t *player);
|
||||
void K_StripOther(player_t *player);
|
||||
void K_MomentumToFacing(player_t *player);
|
||||
fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower);
|
||||
fixed_t K_GetKartAccel(player_t *player);
|
||||
UINT16 K_GetKartFlashing(player_t *player);
|
||||
fixed_t K_3dKartMovement(player_t *player, boolean onground, fixed_t forwardmove);
|
||||
void K_MoveKartPlayer(player_t *player, boolean onground);
|
||||
void K_CalculateBattleWanted(void);
|
||||
void K_CheckBumpers(void);
|
||||
void K_CheckSpectateStatus(void);
|
||||
|
||||
// sound stuff for lua
|
||||
void K_PlayAttackTaunt(mobj_t *source);
|
||||
void K_PlayBoostTaunt(mobj_t *source);
|
||||
void K_PlayOvertakeSound(mobj_t *source);
|
||||
void K_PlayHitEmSound(mobj_t *source);
|
||||
void K_PlayPowerGloatSound(mobj_t *source);
|
||||
|
||||
const char *K_GetItemPatch(UINT8 item, boolean tiny);
|
||||
INT32 K_calcSplitFlags(INT32 snapflags);
|
||||
void K_LoadKartHUDGraphics(void);
|
||||
void K_drawKartHUD(void);
|
||||
void K_drawKartFreePlay(UINT32 flashtime);
|
||||
void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, UINT8 mode);
|
||||
|
||||
// =========================================================================
|
||||
#endif // __K_KART__
|
||||
// SONIC ROBO BLAST 2 KART ~ ZarroTsu
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file k_kart.h
|
||||
/// \brief SRB2kart stuff.
|
||||
|
||||
#ifndef __K_KART__
|
||||
#define __K_KART__
|
||||
|
||||
#include "doomdef.h"
|
||||
#include "d_player.h" // Need for player_t
|
||||
|
||||
#define KART_FULLTURN 800
|
||||
|
||||
UINT8 colortranslations[MAXTRANSLATIONS][16];
|
||||
extern const char *KartColor_Names[MAXSKINCOLORS];
|
||||
extern const UINT8 KartColor_Opposite[MAXSKINCOLORS*2];
|
||||
void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor);
|
||||
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color);
|
||||
UINT8 K_GetKartColorByName(const char *name);
|
||||
|
||||
void K_RegisterKartStuff(void);
|
||||
|
||||
boolean K_IsPlayerLosing(player_t *player);
|
||||
boolean K_IsPlayerWanted(player_t *player);
|
||||
void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid);
|
||||
void K_MatchGenericExtraFlags(mobj_t *mo, mobj_t *master);
|
||||
void K_RespawnChecker(player_t *player);
|
||||
void K_KartMoveAnimation(player_t *player);
|
||||
void K_KartPlayerHUDUpdate(player_t *player);
|
||||
void K_KartPlayerThink(player_t *player, ticcmd_t *cmd);
|
||||
void K_KartPlayerAfterThink(player_t *player);
|
||||
void K_DoInstashield(player_t *player);
|
||||
void K_SpawnBattlePoints(player_t *source, player_t *victim, UINT8 amount);
|
||||
void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, mobj_t *inflictor, boolean trapitem);
|
||||
void K_SquishPlayer(player_t *player, mobj_t *source, mobj_t *inflictor);
|
||||
void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor);
|
||||
void K_StealBumper(player_t *player, player_t *victim, boolean force);
|
||||
void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 number, mobjtype_t type, angle_t rotangle, boolean spawncenter, boolean ghostit, mobj_t *source);
|
||||
void K_SpawnMineExplosion(mobj_t *source, UINT8 color);
|
||||
void K_SpawnBoostTrail(player_t *player);
|
||||
void K_SpawnSparkleTrail(mobj_t *mo);
|
||||
void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent);
|
||||
void K_DriftDustHandling(mobj_t *spawner);
|
||||
void K_PuntMine(mobj_t *mine, mobj_t *punter);
|
||||
void K_DoSneaker(player_t *player, INT32 type);
|
||||
void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound);
|
||||
void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source);
|
||||
void K_UpdateHnextList(player_t *player, boolean clean);
|
||||
void K_DropHnextList(player_t *player);
|
||||
void K_RepairOrbitChain(mobj_t *orbit);
|
||||
player_t *K_FindJawzTarget(mobj_t *actor, player_t *source);
|
||||
boolean K_CheckPlayersRespawnColliding(INT32 playernum, fixed_t x, fixed_t y);
|
||||
INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue);
|
||||
INT32 K_GetKartDriftSparkValue(player_t *player);
|
||||
void K_KartUpdatePosition(player_t *player);
|
||||
void K_DropItems(player_t *player);
|
||||
void K_StripItems(player_t *player);
|
||||
void K_StripOther(player_t *player);
|
||||
void K_MomentumToFacing(player_t *player);
|
||||
fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower);
|
||||
fixed_t K_GetKartAccel(player_t *player);
|
||||
UINT16 K_GetKartFlashing(player_t *player);
|
||||
fixed_t K_3dKartMovement(player_t *player, boolean onground, fixed_t forwardmove);
|
||||
void K_MoveKartPlayer(player_t *player, boolean onground);
|
||||
void K_CalculateBattleWanted(void);
|
||||
void K_CheckBumpers(void);
|
||||
void K_CheckSpectateStatus(void);
|
||||
|
||||
// sound stuff for lua
|
||||
void K_PlayAttackTaunt(mobj_t *source);
|
||||
void K_PlayBoostTaunt(mobj_t *source);
|
||||
void K_PlayOvertakeSound(mobj_t *source);
|
||||
void K_PlayHitEmSound(mobj_t *source);
|
||||
void K_PlayPowerGloatSound(mobj_t *source);
|
||||
|
||||
const char *K_GetItemPatch(UINT8 item, boolean tiny);
|
||||
INT32 K_calcSplitFlags(INT32 snapflags);
|
||||
void K_LoadKartHUDGraphics(void);
|
||||
void K_drawKartHUD(void);
|
||||
void K_drawKartFreePlay(UINT32 flashtime);
|
||||
void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, UINT8 mode);
|
||||
|
||||
// =========================================================================
|
||||
#endif // __K_KART__
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ static UINT8 hud_enabled[(hud_MAX/8)+1];
|
|||
|
||||
static UINT8 hudAvailable; // hud hooks field
|
||||
|
||||
static UINT8 camnum = 1;
|
||||
|
||||
// must match enum hud in lua_hud.h
|
||||
static const char *const hud_disable_options[] = {
|
||||
"stagetitle",
|
||||
|
|
@ -134,7 +136,8 @@ enum cameraf {
|
|||
camera_height,
|
||||
camera_momx,
|
||||
camera_momy,
|
||||
camera_momz
|
||||
camera_momz,
|
||||
camera_pnum
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -153,6 +156,7 @@ static const char *const camera_opt[] = {
|
|||
"momx",
|
||||
"momy",
|
||||
"momz",
|
||||
"pnum",
|
||||
NULL};
|
||||
|
||||
static int lib_getHudInfo(lua_State *L)
|
||||
|
|
@ -308,6 +312,9 @@ static int camera_get(lua_State *L)
|
|||
case camera_momz:
|
||||
lua_pushinteger(L, cam->momz);
|
||||
break;
|
||||
case camera_pnum:
|
||||
lua_pushinteger(L, camnum);
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -403,6 +410,24 @@ static int libd_drawPaddedNum(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int libd_drawPingNum(lua_State *L)
|
||||
{
|
||||
INT32 x, y, flags, num;
|
||||
const UINT8 *colormap = NULL;
|
||||
HUDONLY
|
||||
x = luaL_checkinteger(L, 1);
|
||||
y = luaL_checkinteger(L, 2);
|
||||
num = luaL_checkinteger(L, 3);
|
||||
flags = luaL_optinteger(L, 4, 0);
|
||||
flags &= ~V_PARAMMASK; // Don't let crashes happen.
|
||||
if (!lua_isnoneornil(L, 5))
|
||||
colormap = *((UINT8 **)luaL_checkudata(L, 5, META_COLORMAP));
|
||||
|
||||
V_DrawPingNum(x, y, flags, num, colormap);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int libd_drawFill(lua_State *L)
|
||||
{
|
||||
INT32 x = luaL_optinteger(L, 1, 0);
|
||||
|
|
@ -606,6 +631,7 @@ static luaL_Reg lib_draw[] = {
|
|||
{"drawScaled", libd_drawScaled},
|
||||
{"drawNum", libd_drawNum},
|
||||
{"drawPaddedNum", libd_drawPaddedNum},
|
||||
{"drawPingNum", libd_drawPingNum},
|
||||
{"drawFill", libd_drawFill},
|
||||
{"fadeScreen", libd_fadeScreen},
|
||||
{"drawString", libd_drawString},
|
||||
|
|
@ -772,13 +798,25 @@ void LUAh_GameHUD(player_t *stplayr)
|
|||
LUA_PushUserdata(gL, stplayr, META_PLAYER);
|
||||
|
||||
if (splitscreen > 2 && stplayr == &players[fourthdisplayplayer])
|
||||
{
|
||||
LUA_PushUserdata(gL, &camera4, META_CAMERA);
|
||||
camnum = 4;
|
||||
}
|
||||
else if (splitscreen > 1 && stplayr == &players[thirddisplayplayer])
|
||||
{
|
||||
LUA_PushUserdata(gL, &camera3, META_CAMERA);
|
||||
camnum = 3;
|
||||
}
|
||||
else if (splitscreen && stplayr == &players[secondarydisplayplayer])
|
||||
{
|
||||
LUA_PushUserdata(gL, &camera2, META_CAMERA);
|
||||
camnum = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
LUA_PushUserdata(gL, &camera, META_CAMERA);
|
||||
camnum = 1;
|
||||
}
|
||||
|
||||
lua_pushnil(gL);
|
||||
while (lua_next(gL, -5) != 0) {
|
||||
|
|
|
|||
|
|
@ -325,6 +325,8 @@ static int player_get(lua_State *L)
|
|||
lua_pushinteger(L, plr->bot);
|
||||
else if (fastcmp(field,"jointime"))
|
||||
lua_pushinteger(L, plr->jointime);
|
||||
else if (fastcmp(field,"splitscreenindex"))
|
||||
lua_pushinteger(L, plr->splitscreenindex);
|
||||
#ifdef HWRENDER
|
||||
else if (fastcmp(field,"fovadd"))
|
||||
lua_pushfixed(L, plr->fovadd);
|
||||
|
|
@ -613,6 +615,8 @@ static int player_set(lua_State *L)
|
|||
return NOSET;
|
||||
else if (fastcmp(field,"jointime"))
|
||||
plr->jointime = (tic_t)luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"splitscreenindex"))
|
||||
return NOSET;
|
||||
#ifdef HWRENDER
|
||||
else if (fastcmp(field,"fovadd"))
|
||||
plr->fovadd = luaL_checkfixed(L, 3);
|
||||
|
|
|
|||
|
|
@ -212,6 +212,9 @@ void LUA_LoadLump(UINT16 wad, UINT16 lump)
|
|||
|
||||
LUA_LoadFile(&f, name); // actually load file!
|
||||
|
||||
// Okay, we've modified the game beyond the point of no return.
|
||||
G_SetGameModified(multiplayer, true);
|
||||
|
||||
free(name);
|
||||
Z_Free(f.data);
|
||||
}
|
||||
|
|
@ -1017,7 +1020,7 @@ void LUA_Archive(void)
|
|||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
if (!playeringame[i] && i > 0) // NEVER skip player 0, this is for dedi servs.
|
||||
continue;
|
||||
// all players in game will be archived, even if they just add a 0.
|
||||
ArchiveExtVars(&players[i], "player");
|
||||
|
|
@ -1053,7 +1056,7 @@ void LUA_UnArchive(void)
|
|||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
if (!playeringame[i] && i > 0) // same here, this is to synch dediservs properly.
|
||||
continue;
|
||||
UnArchiveExtVars(&players[i]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ static UINT8 cheatf_devmode(void)
|
|||
S_StartSound(0, sfx_itemup);
|
||||
|
||||
// Just unlock all the things and turn on -debug and console devmode.
|
||||
G_SetGameModified(false);
|
||||
G_SetGameModified(false, false); // might need to revist the latter later
|
||||
for (i = 0; i < MAXUNLOCKABLES; i++)
|
||||
unlockables[i].unlocked = true;
|
||||
devparm = true;
|
||||
|
|
@ -295,7 +295,7 @@ void Command_CheatNoClip_f(void)
|
|||
plyr->pflags ^= PF_NOCLIP;
|
||||
CONS_Printf(M_GetText("No Clipping %s\n"), plyr->pflags & PF_NOCLIP ? M_GetText("On") : M_GetText("Off"));
|
||||
|
||||
G_SetGameModified(multiplayer);
|
||||
G_SetGameModified(multiplayer, true);
|
||||
}
|
||||
|
||||
void Command_CheatGod_f(void)
|
||||
|
|
@ -310,7 +310,7 @@ void Command_CheatGod_f(void)
|
|||
plyr->pflags ^= PF_GODMODE;
|
||||
CONS_Printf(M_GetText("Sissy Mode %s\n"), plyr->pflags & PF_GODMODE ? M_GetText("On") : M_GetText("Off"));
|
||||
|
||||
G_SetGameModified(multiplayer);
|
||||
G_SetGameModified(multiplayer, true);
|
||||
}
|
||||
|
||||
void Command_CheatNoTarget_f(void)
|
||||
|
|
@ -325,7 +325,7 @@ void Command_CheatNoTarget_f(void)
|
|||
plyr->pflags ^= PF_INVIS;
|
||||
CONS_Printf(M_GetText("SEP Field %s\n"), plyr->pflags & PF_INVIS ? M_GetText("On") : M_GetText("Off"));
|
||||
|
||||
G_SetGameModified(multiplayer);
|
||||
G_SetGameModified(multiplayer, true);
|
||||
}
|
||||
|
||||
void Command_Scale_f(void)
|
||||
|
|
@ -727,7 +727,7 @@ void Command_Devmode_f(void)
|
|||
return;
|
||||
}
|
||||
|
||||
G_SetGameModified(multiplayer);
|
||||
G_SetGameModified(multiplayer, true);
|
||||
}
|
||||
|
||||
/*void Command_Setrings_f(void)
|
||||
|
|
@ -1267,7 +1267,7 @@ void Command_ObjectPlace_f(void)
|
|||
REQUIRE_SINGLEPLAYER;
|
||||
REQUIRE_NOULTIMATE;
|
||||
|
||||
G_SetGameModified(multiplayer);
|
||||
G_SetGameModified(multiplayer, true);
|
||||
|
||||
// Entering objectplace?
|
||||
if (!objectplacing)
|
||||
|
|
|
|||
|
|
@ -385,8 +385,7 @@ UINT8 M_UpdateUnlockablesAndExtraEmblems(boolean force)
|
|||
char cechoText[992] = "";
|
||||
UINT8 cechoLines = 0;
|
||||
|
||||
if (modifiedgame && !savemoddata
|
||||
&& !force) // SRB2Kart: for enabling unlocks online in modified servers
|
||||
if (majormods && !force) // SRB2Kart: for enabling unlocks online in modified servers
|
||||
return false;
|
||||
|
||||
M_CheckUnlockConditions();
|
||||
|
|
|
|||
104
src/m_menu.c
104
src/m_menu.c
|
|
@ -274,14 +274,13 @@ static menu_t SP_TimeAttackDef, SP_ReplayDef, SP_GuestReplayDef, SP_GhostDef;
|
|||
#ifndef NONET
|
||||
static void M_StartServerMenu(INT32 choice);
|
||||
static void M_ConnectMenu(INT32 choice);
|
||||
#endif
|
||||
static void M_StartOfflineServerMenu(INT32 choice);
|
||||
static void M_StartServer(INT32 choice);
|
||||
#ifndef NONET
|
||||
static void M_ConnectMenuModChecks(INT32 choice);
|
||||
static void M_Refresh(INT32 choice);
|
||||
static void M_Connect(INT32 choice);
|
||||
static void M_ChooseRoom(INT32 choice);
|
||||
#endif
|
||||
static void M_StartOfflineServerMenu(INT32 choice);
|
||||
static void M_StartServer(INT32 choice);
|
||||
static void M_SetupMultiPlayer(INT32 choice);
|
||||
static void M_SetupMultiPlayer2(INT32 choice);
|
||||
static void M_SetupMultiPlayer3(INT32 choice);
|
||||
|
|
@ -439,11 +438,11 @@ static CV_PossibleValue_t serversort_cons_t[] = {
|
|||
{1,"Modified State"},
|
||||
{2,"Most Players"},
|
||||
{3,"Least Players"},
|
||||
{4,"Max Players"},
|
||||
{4,"Max Player Slots"},
|
||||
{5,"Gametype"},
|
||||
{0,NULL}
|
||||
};
|
||||
consvar_t cv_serversort = {"serversort", "Ping", CV_HIDEN | CV_CALL, serversort_cons_t, M_SortServerList, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_serversort = {"serversort", "Ping", CV_CALL, serversort_cons_t, M_SortServerList, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// autorecord demos for time attack
|
||||
static consvar_t cv_autorecord = {"autorecord", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
|
@ -935,11 +934,11 @@ static menuitem_t MP_MainMenu[] =
|
|||
|
||||
{IT_HEADER, NULL, "Join a game", NULL, 132-24},
|
||||
#ifndef NONET
|
||||
{IT_STRING|IT_CALL, NULL, "Internet server browser...",M_ConnectMenu, 142-24},
|
||||
{IT_STRING|IT_CALL, NULL, "Internet server browser...",M_ConnectMenuModChecks, 142-24},
|
||||
{IT_STRING|IT_KEYHANDLER, NULL, "Specify IPv4 address:", M_HandleConnectIP, 150-24},
|
||||
#else
|
||||
{IT_GRAYEDOUT, NULL, "Internet server browser...",M_ConnectMenu, 142-24},
|
||||
{IT_GRAYEDOUT, NULL, "Specify IPv4 address:", M_HandleConnectIP, 150-24},
|
||||
{IT_GRAYEDOUT, NULL, "Internet server browser...",NULL, 142-24},
|
||||
{IT_GRAYEDOUT, NULL, "Specify IPv4 address:", NULL, 150-24},
|
||||
#endif
|
||||
//{IT_HEADER, NULL, "Player setup", NULL, 80},
|
||||
//{IT_STRING|IT_CALL, NULL, "Name, character, color...", M_SetupMultiPlayer, 90},
|
||||
|
|
@ -1250,7 +1249,7 @@ static menuitem_t OP_OpenGLOptionsMenu[] =
|
|||
{IT_SUBMENU|IT_STRING, NULL, "Fog...", &OP_OpenGLFogDef, 10},
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Gamma...", &OP_OpenGLColorDef, 20},
|
||||
|
||||
{IT_STRING|IT_CVAR, NULL, "Field of View", &cv_grfov, 35},
|
||||
{IT_STRING|IT_CVAR, NULL, "Field of View", &cv_fov, 35},
|
||||
{IT_STRING|IT_CVAR, NULL, "Quality", &cv_scr_depth, 45},
|
||||
{IT_STRING|IT_CVAR, NULL, "Texture Filter", &cv_grfiltermode, 55},
|
||||
{IT_STRING|IT_CVAR, NULL, "Anisotropic", &cv_granisotropicmode, 65},
|
||||
|
|
@ -1391,7 +1390,7 @@ static menuitem_t OP_HUDOptionsMenu[] =
|
|||
{IT_STRING | IT_CVAR | IT_CV_SLIDER,
|
||||
NULL, "HUD Visibility", &cv_translucenthud, 20},
|
||||
|
||||
{IT_STRING | IT_SUBMENU, NULL, "Online chat options...",&OP_ChatOptionsDef, 35},
|
||||
{IT_STRING | IT_SUBMENU, NULL, "Online HUD options...",&OP_ChatOptionsDef, 35},
|
||||
{IT_STRING | IT_CVAR, NULL, "Background Glass", &cons_backcolor, 45},
|
||||
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER,
|
||||
|
|
@ -1405,6 +1404,7 @@ static menuitem_t OP_HUDOptionsMenu[] =
|
|||
{IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize, 120},
|
||||
};
|
||||
|
||||
// Ok it's still called chatoptions but we'll put ping display in here to be clean
|
||||
static menuitem_t OP_ChatOptionsMenu[] =
|
||||
{
|
||||
// will ANYONE who doesn't know how to use the console want to touch this one?
|
||||
|
|
@ -1418,6 +1418,8 @@ static menuitem_t OP_ChatOptionsMenu[] =
|
|||
{IT_STRING | IT_CVAR, NULL, "Chat Background Tint", &cv_chatbacktint, 50},
|
||||
{IT_STRING | IT_CVAR, NULL, "Message Fadeout Time", &cv_chattime, 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "Spam Protection", &cv_chatspamprotection, 70},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Local ping display", &cv_showping, 90}, // shows ping next to framerate if we want to.
|
||||
};
|
||||
|
||||
static menuitem_t OP_GameOptionsMenu[] =
|
||||
|
|
@ -1470,15 +1472,16 @@ static menuitem_t OP_AdvServerOptionsMenu[] =
|
|||
|
||||
{IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 40},
|
||||
{IT_STRING | IT_CVAR, NULL, "Ping limit (ms)", &cv_maxping, 50},
|
||||
{IT_STRING | IT_CVAR, NULL, "Connection timeout (tics)", &cv_nettimeout, 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "Join timeout (tics)", &cv_jointimeout, 70},
|
||||
{IT_STRING | IT_CVAR, NULL, "Ping timeout (s)", &cv_pingtimeout, 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "Connection timeout (tics)", &cv_nettimeout, 70},
|
||||
{IT_STRING | IT_CVAR, NULL, "Join timeout (tics)", &cv_jointimeout, 80},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Max. file transfer send (KB)", &cv_maxsend, 90},
|
||||
{IT_STRING | IT_CVAR, NULL, "File transfer packet rate", &cv_downloadspeed, 100},
|
||||
{IT_STRING | IT_CVAR, NULL, "Max. file transfer send (KB)", &cv_maxsend, 100},
|
||||
{IT_STRING | IT_CVAR, NULL, "File transfer packet rate", &cv_downloadspeed, 110},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Log join addresses", &cv_showjoinaddress, 120},
|
||||
{IT_STRING | IT_CVAR, NULL, "Log resyncs", &cv_blamecfail, 130},
|
||||
{IT_STRING | IT_CVAR, NULL, "Log file transfers", &cv_noticedownload, 140},
|
||||
{IT_STRING | IT_CVAR, NULL, "Log join addresses", &cv_showjoinaddress, 130},
|
||||
{IT_STRING | IT_CVAR, NULL, "Log resyncs", &cv_blamecfail, 140},
|
||||
{IT_STRING | IT_CVAR, NULL, "Log file transfers", &cv_noticedownload, 150},
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
@ -1831,7 +1834,6 @@ static menu_t SP_NightsGhostDef =
|
|||
NULL
|
||||
};*/
|
||||
|
||||
#ifndef NONET
|
||||
// Multiplayer
|
||||
menu_t MP_MainDef =
|
||||
{
|
||||
|
|
@ -1842,12 +1844,18 @@ menu_t MP_MainDef =
|
|||
M_DrawMPMainMenu,
|
||||
42, 30,
|
||||
0,
|
||||
M_CancelConnect
|
||||
};
|
||||
menu_t MP_ServerDef = MAPICONMENUSTYLE("M_MULTI", MP_ServerMenu, &MP_MainDef);
|
||||
#endif
|
||||
menu_t MP_OfflineServerDef = MAPICONMENUSTYLE("M_MULTI", MP_OfflineServerMenu, &MP_MainDef);
|
||||
#ifndef NONET
|
||||
M_CancelConnect
|
||||
#else
|
||||
NULL
|
||||
#endif
|
||||
};
|
||||
|
||||
menu_t MP_OfflineServerDef = MAPICONMENUSTYLE("M_MULTI", MP_OfflineServerMenu, &MP_MainDef);
|
||||
|
||||
#ifndef NONET
|
||||
menu_t MP_ServerDef = MAPICONMENUSTYLE("M_MULTI", MP_ServerMenu, &MP_MainDef);
|
||||
|
||||
menu_t MP_ConnectDef =
|
||||
{
|
||||
"M_MULTI",
|
||||
|
|
@ -2739,10 +2747,10 @@ boolean M_Responder(event_t *ev)
|
|||
|| (currentMenu->menuitems[itemOn].status & IT_TYPE)==IT_SUBMENU)
|
||||
&& (currentMenu->menuitems[itemOn].status & IT_CALLTYPE))
|
||||
{
|
||||
if (((currentMenu->menuitems[itemOn].status & IT_CALLTYPE) & IT_CALL_NOTMODIFIED) && modifiedgame && !savemoddata)
|
||||
if (((currentMenu->menuitems[itemOn].status & IT_CALLTYPE) & IT_CALL_NOTMODIFIED) && majormods)
|
||||
{
|
||||
S_StartSound(NULL, sfx_menu1);
|
||||
M_StartMessage(M_GetText("This cannot be done with add-ons\nor in a cheated game.\n\n(Press a key)\n"), NULL, MM_NOTHING);
|
||||
M_StartMessage(M_GetText("This cannot be done with complex add-ons\nor in a cheated game.\n\n(Press a key)\n"), NULL, MM_NOTHING);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -4527,9 +4535,14 @@ static char *M_AddonsHeaderPath(void)
|
|||
#define CLEARNAME Z_Free(refreshdirname);\
|
||||
refreshdirname = NULL
|
||||
|
||||
static boolean prevmajormods = false;
|
||||
|
||||
static void M_AddonsClearName(INT32 choice)
|
||||
{
|
||||
CLEARNAME;
|
||||
if (!majormods || prevmajormods)
|
||||
{
|
||||
CLEARNAME;
|
||||
}
|
||||
M_StopMessage(choice);
|
||||
}
|
||||
|
||||
|
|
@ -4539,10 +4552,17 @@ static boolean M_AddonsRefresh(void)
|
|||
if ((refreshdirmenu & REFRESHDIR_NORMAL) && !preparefilemenu(true))
|
||||
{
|
||||
UNEXIST;
|
||||
if (refreshdirname)
|
||||
{
|
||||
CLEARNAME;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (refreshdirmenu & REFRESHDIR_ADDFILE)
|
||||
if (!majormods && prevmajormods)
|
||||
prevmajormods = false;
|
||||
|
||||
if ((refreshdirmenu & REFRESHDIR_ADDFILE) || (majormods && !prevmajormods))
|
||||
{
|
||||
char *message = NULL;
|
||||
|
||||
|
|
@ -4550,7 +4570,7 @@ static boolean M_AddonsRefresh(void)
|
|||
{
|
||||
S_StartSound(NULL, sfx_s26d);
|
||||
if (refreshdirmenu & REFRESHDIR_MAX)
|
||||
message = va("%c%s\x80\nMaximum number of add-ons reached.\nA file could not be loaded.\nIf you want to play with this add-on, restart the game to clear existing ones.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), refreshdirname);
|
||||
message = va("%c%s\x80\nMaximum number of add-ons reached.\nA file could not be loaded.\nIf you wish to play with this add-on, restart the game to clear existing ones.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), refreshdirname);
|
||||
else
|
||||
message = va("%c%s\x80\nA file was not loaded.\nCheck the console log for more information.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), refreshdirname);
|
||||
}
|
||||
|
|
@ -4559,6 +4579,12 @@ static boolean M_AddonsRefresh(void)
|
|||
S_StartSound(NULL, sfx_s224);
|
||||
message = va("%c%s\x80\nA file was loaded with %s.\nCheck the console log for more information.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), refreshdirname, ((refreshdirmenu & REFRESHDIR_ERROR) ? "errors" : "warnings"));
|
||||
}
|
||||
else if (majormods && !prevmajormods)
|
||||
{
|
||||
S_StartSound(NULL, sfx_s221);
|
||||
message = va("%c%s\x80\nGameplay has now been modified.\nIf you wish to play Record Attack mode, restart the game to clear existing add-ons.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), refreshdirname);
|
||||
prevmajormods = majormods;
|
||||
}
|
||||
|
||||
if (message)
|
||||
{
|
||||
|
|
@ -4709,7 +4735,7 @@ static void M_DrawAddons(void)
|
|||
V_DrawSmallScaledPatch(x, y + 4, (menusearch[0] ? 0 : V_TRANSLUCENT), addonsp[NUM_EXT+3]);
|
||||
|
||||
x = BASEVIDWIDTH - x - 16;
|
||||
V_DrawSmallScaledPatch(x, y + 4, ((!modifiedgame || savemoddata) ? 0 : V_TRANSLUCENT), addonsp[NUM_EXT+4]);
|
||||
V_DrawSmallScaledPatch(x, y + 4, ((!majormods) ? 0 : V_TRANSLUCENT), addonsp[NUM_EXT+4]);
|
||||
|
||||
if (modifiedgame)
|
||||
V_DrawSmallScaledPatch(x, y + 4, 0, addonsp[NUM_EXT+2]);
|
||||
|
|
@ -5106,7 +5132,7 @@ static void M_GetAllEmeralds(INT32 choice)
|
|||
emeralds = ((EMERALD7)*2)-1;
|
||||
M_StartMessage(M_GetText("You now have all 7 emeralds.\nUse them wisely.\nWith great power comes great ring drain.\n"),NULL,MM_NOTHING);
|
||||
|
||||
G_SetGameModified(multiplayer);
|
||||
G_SetGameModified(multiplayer, true);
|
||||
}
|
||||
|
||||
static void M_DestroyRobotsResponse(INT32 ch)
|
||||
|
|
@ -5117,7 +5143,7 @@ static void M_DestroyRobotsResponse(INT32 ch)
|
|||
// Destroy all robots
|
||||
P_DestroyRobots();
|
||||
|
||||
G_SetGameModified(multiplayer);
|
||||
G_SetGameModified(multiplayer, true);
|
||||
}
|
||||
|
||||
static void M_DestroyRobots(INT32 choice)
|
||||
|
|
@ -7384,6 +7410,20 @@ static void M_ConnectMenu(INT32 choice)
|
|||
M_Refresh(0);
|
||||
}
|
||||
|
||||
static void M_ConnectMenuModChecks(INT32 choice)
|
||||
{
|
||||
(void)choice;
|
||||
// okay never mind we want to COMMUNICATE to the player pre-emptively instead of letting them try and then get confused when it doesn't work
|
||||
|
||||
if (modifiedgame)
|
||||
{
|
||||
M_StartMessage(M_GetText("Add-ons are currently loaded.\n\nYou will only be able to join a server if\nit has the same ones loaded in the same order, which may be unlikely.\n\nIf you wish to play on other servers,\nrestart the game to clear existing add-ons.\n\n(Press a key)\n"),M_ConnectMenu,MM_EVENTHANDLER);
|
||||
return;
|
||||
}
|
||||
|
||||
M_ConnectMenu(-1);
|
||||
}
|
||||
|
||||
static UINT32 roomIds[NUM_LIST_ROOMS];
|
||||
|
||||
static void M_RoomMenu(INT32 choice)
|
||||
|
|
|
|||
123
src/m_misc.c
123
src/m_misc.c
|
|
@ -93,9 +93,8 @@ typedef off_t off64_t;
|
|||
#ifdef PNG_WRITE_SUPPORTED
|
||||
#define USE_PNG // Only actually use PNG if write is supported.
|
||||
#if defined (PNG_WRITE_APNG_SUPPORTED) //|| !defined(PNG_STATIC)
|
||||
#if (PNG_LIBPNG_VER_MAJOR) == 1 && (PNG_LIBPNG_VER_MINOR <= 4) // Supposedly, the current APNG code can't work on newer versions as is
|
||||
#include "apng.h"
|
||||
#define USE_APNG
|
||||
#endif
|
||||
#endif
|
||||
// See hardware/hw_draw.c for a similar check to this one.
|
||||
#endif
|
||||
|
|
@ -795,13 +794,13 @@ static inline void M_PNGImage(png_structp png_ptr, png_infop png_info_ptr, PNG_C
|
|||
#ifdef USE_APNG
|
||||
static png_structp apng_ptr = NULL;
|
||||
static png_infop apng_info_ptr = NULL;
|
||||
static apng_infop apng_ainfo_ptr = NULL;
|
||||
static png_FILE_p apng_FILE = NULL;
|
||||
static png_uint_32 apng_frames = 0;
|
||||
static png_byte acTL_cn[5] = { 97, 99, 84, 76, '\0'};
|
||||
#ifdef PNG_STATIC // Win32 build have static libpng
|
||||
#define apng_set_acTL png_set_acTL
|
||||
#define apng_write_frame_head png_write_frame_head
|
||||
#define apng_write_frame_tail png_write_frame_tail
|
||||
#define aPNG_set_acTL png_set_acTL
|
||||
#define aPNG_write_frame_head png_write_frame_head
|
||||
#define aPNG_write_frame_tail png_write_frame_tail
|
||||
#else // outside libpng may not have apng support
|
||||
|
||||
#ifndef PNG_WRITE_APNG_SUPPORTED // libpng header may not have apng patch
|
||||
|
|
@ -838,20 +837,20 @@ static png_byte acTL_cn[5] = { 97, 99, 84, 76, '\0'};
|
|||
#endif
|
||||
|
||||
#endif
|
||||
typedef PNG_EXPORT(png_uint_32, (*P_png_set_acTL)) PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr, png_uint_32 num_frames, png_uint_32 num_plays));
|
||||
typedef PNG_EXPORT (void, (*P_png_write_frame_head)) PNGARG((png_structp png_ptr,
|
||||
typedef png_uint_32 (*P_png_set_acTL) (png_structp png_ptr,
|
||||
png_infop info_ptr, png_uint_32 num_frames, png_uint_32 num_plays);
|
||||
typedef void (*P_png_write_frame_head) (png_structp png_ptr,
|
||||
png_infop info_ptr, png_bytepp row_pointers,
|
||||
png_uint_32 width, png_uint_32 height,
|
||||
png_uint_32 x_offset, png_uint_32 y_offset,
|
||||
png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op,
|
||||
png_byte blend_op));
|
||||
png_byte blend_op);
|
||||
|
||||
typedef PNG_EXPORT (void, (*P_png_write_frame_tail)) PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr));
|
||||
static P_png_set_acTL apng_set_acTL = NULL;
|
||||
static P_png_write_frame_head apng_write_frame_head = NULL;
|
||||
static P_png_write_frame_tail apng_write_frame_tail = NULL;
|
||||
typedef void (*P_png_write_frame_tail) (png_structp png_ptr,
|
||||
png_infop info_ptr);
|
||||
static P_png_set_acTL aPNG_set_acTL = NULL;
|
||||
static P_png_write_frame_head aPNG_write_frame_head = NULL;
|
||||
static P_png_write_frame_tail aPNG_write_frame_tail = NULL;
|
||||
#endif
|
||||
|
||||
static inline boolean M_PNGLib(void)
|
||||
|
|
@ -860,7 +859,7 @@ static inline boolean M_PNGLib(void)
|
|||
return true;
|
||||
#else
|
||||
static void *pnglib = NULL;
|
||||
if (apng_set_acTL && apng_write_frame_head && apng_write_frame_tail)
|
||||
if (aPNG_set_acTL && aPNG_write_frame_head && aPNG_write_frame_tail)
|
||||
return true;
|
||||
if (pnglib)
|
||||
return false;
|
||||
|
|
@ -880,16 +879,16 @@ static inline boolean M_PNGLib(void)
|
|||
if (!pnglib)
|
||||
return false;
|
||||
#ifdef HAVE_SDL
|
||||
apng_set_acTL = hwSym("png_set_acTL", pnglib);
|
||||
apng_write_frame_head = hwSym("png_write_frame_head", pnglib);
|
||||
apng_write_frame_tail = hwSym("png_write_frame_tail", pnglib);
|
||||
aPNG_set_acTL = hwSym("png_set_acTL", pnglib);
|
||||
aPNG_write_frame_head = hwSym("png_write_frame_head", pnglib);
|
||||
aPNG_write_frame_tail = hwSym("png_write_frame_tail", pnglib);
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
apng_set_acTL = GetProcAddress("png_set_acTL", pnglib);
|
||||
apng_write_frame_head = GetProcAddress("png_write_frame_head", pnglib);
|
||||
apng_write_frame_tail = GetProcAddress("png_write_frame_tail", pnglib);
|
||||
aPNG_set_acTL = GetProcAddress("png_set_acTL", pnglib);
|
||||
aPNG_write_frame_head = GetProcAddress("png_write_frame_head", pnglib);
|
||||
aPNG_write_frame_tail = GetProcAddress("png_write_frame_tail", pnglib);
|
||||
#endif
|
||||
return (apng_set_acTL && apng_write_frame_head && apng_write_frame_tail);
|
||||
return (aPNG_set_acTL && aPNG_write_frame_head && aPNG_write_frame_tail);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -903,11 +902,6 @@ static void M_PNGFrame(png_structp png_ptr, png_infop png_info_ptr, png_bytep pn
|
|||
|
||||
apng_frames++;
|
||||
|
||||
#ifndef PNG_STATIC
|
||||
if (apng_set_acTL)
|
||||
#endif
|
||||
apng_set_acTL(apng_ptr, apng_info_ptr, apng_frames, 0);
|
||||
|
||||
for (y = 0; y < height; y++)
|
||||
{
|
||||
row_pointers[y] = png_buf;
|
||||
|
|
@ -915,9 +909,9 @@ static void M_PNGFrame(png_structp png_ptr, png_infop png_info_ptr, png_bytep pn
|
|||
}
|
||||
|
||||
#ifndef PNG_STATIC
|
||||
if (apng_write_frame_head)
|
||||
if (aPNG_write_frame_head)
|
||||
#endif
|
||||
apng_write_frame_head(apng_ptr, apng_info_ptr, row_pointers,
|
||||
aPNG_write_frame_head(apng_ptr, apng_info_ptr, row_pointers,
|
||||
vid.width, /* width */
|
||||
height, /* height */
|
||||
0, /* x offset */
|
||||
|
|
@ -930,57 +924,21 @@ static void M_PNGFrame(png_structp png_ptr, png_infop png_info_ptr, png_bytep pn
|
|||
png_write_image(png_ptr, row_pointers);
|
||||
|
||||
#ifndef PNG_STATIC
|
||||
if (apng_write_frame_tail)
|
||||
if (aPNG_write_frame_tail)
|
||||
#endif
|
||||
apng_write_frame_tail(apng_ptr, apng_info_ptr);
|
||||
aPNG_write_frame_tail(apng_ptr, apng_info_ptr);
|
||||
|
||||
png_free(png_ptr, (png_voidp)row_pointers);
|
||||
}
|
||||
|
||||
static inline boolean M_PNGfind_acTL(void)
|
||||
static void M_PNGfix_acTL(png_structp png_ptr, png_infop png_info_ptr,
|
||||
apng_infop png_ainfo_ptr)
|
||||
{
|
||||
png_byte cn[8]; // 4 bytes for len then 4 byes for name
|
||||
long endpos = ftell(apng_FILE); // not the real end of file, just what of libpng wrote
|
||||
for (fseek(apng_FILE, 0, SEEK_SET); // let go to the start of the file
|
||||
ftell(apng_FILE)+12 < endpos; // let not go over the file bound
|
||||
fseek(apng_FILE, 1, SEEK_CUR) // we went 8 steps back and now we go 1 step forward
|
||||
)
|
||||
{
|
||||
if (fread(cn, sizeof(cn), 1, apng_FILE) != 1) // read 8 bytes
|
||||
return false; // failed to read data
|
||||
if (fseek(apng_FILE, -8, SEEK_CUR) != 0) //rewind 8 bytes
|
||||
return false; // failed to rewird
|
||||
if (!png_memcmp(cn+4, acTL_cn, 4)) //cmp for chuck header
|
||||
return true; // found it
|
||||
}
|
||||
return false; // acTL chuck not found
|
||||
}
|
||||
|
||||
static void M_PNGfix_acTL(png_structp png_ptr, png_infop png_info_ptr)
|
||||
{
|
||||
png_byte data[16];
|
||||
long oldpos;
|
||||
|
||||
#ifndef PNG_STATIC
|
||||
if (apng_set_acTL)
|
||||
#endif
|
||||
apng_set_acTL(png_ptr, png_info_ptr, apng_frames, 0);
|
||||
apng_set_acTL(png_ptr, png_info_ptr, png_ainfo_ptr, apng_frames, 0);
|
||||
|
||||
#ifndef NO_PNG_DEBUG
|
||||
png_debug(1, "in png_write_acTL\n");
|
||||
#endif
|
||||
|
||||
png_ptr->num_frames_to_write = apng_frames;
|
||||
|
||||
png_save_uint_32(data, apng_frames);
|
||||
png_save_uint_32(data + 4, 0);
|
||||
|
||||
oldpos = ftell(apng_FILE);
|
||||
|
||||
if (M_PNGfind_acTL())
|
||||
png_write_chunk(png_ptr, (png_bytep)acTL_cn, data, (png_size_t)8);
|
||||
|
||||
fseek(apng_FILE, oldpos, SEEK_SET);
|
||||
}
|
||||
|
||||
static boolean M_SetupaPNG(png_const_charp filename, png_bytep pal)
|
||||
|
|
@ -1012,6 +970,16 @@ static boolean M_SetupaPNG(png_const_charp filename, png_bytep pal)
|
|||
return false;
|
||||
}
|
||||
|
||||
apng_ainfo_ptr = apng_create_info_struct(apng_ptr);
|
||||
if (!apng_ainfo_ptr)
|
||||
{
|
||||
CONS_Debug(DBG_RENDER, "M_StartMovie: Error on allocate for apng\n");
|
||||
png_destroy_write_struct(&apng_ptr, &apng_info_ptr);
|
||||
fclose(apng_FILE);
|
||||
remove(filename);
|
||||
return false;
|
||||
}
|
||||
|
||||
png_init_io(apng_ptr, apng_FILE);
|
||||
|
||||
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||
|
|
@ -1029,12 +997,11 @@ static boolean M_SetupaPNG(png_const_charp filename, png_bytep pal)
|
|||
|
||||
M_PNGText(apng_ptr, apng_info_ptr, true);
|
||||
|
||||
#ifndef PNG_STATIC
|
||||
if (apng_set_acTL)
|
||||
#endif
|
||||
apng_set_acTL(apng_ptr, apng_info_ptr, PNG_UINT_31_MAX, 0);
|
||||
apng_set_set_acTL_fn(apng_ptr, apng_ainfo_ptr, aPNG_set_acTL);
|
||||
|
||||
png_write_info(apng_ptr, apng_info_ptr);
|
||||
apng_set_acTL(apng_ptr, apng_info_ptr, apng_ainfo_ptr, PNG_UINT_31_MAX, 0);
|
||||
|
||||
apng_write_info(apng_ptr, apng_info_ptr, apng_ainfo_ptr);
|
||||
|
||||
apng_frames = 0;
|
||||
|
||||
|
|
@ -1237,8 +1204,8 @@ void M_StopMovie(void)
|
|||
|
||||
if (apng_frames)
|
||||
{
|
||||
M_PNGfix_acTL(apng_ptr, apng_info_ptr);
|
||||
png_write_end(apng_ptr, apng_info_ptr);
|
||||
M_PNGfix_acTL(apng_ptr, apng_info_ptr, apng_ainfo_ptr);
|
||||
apng_write_end(apng_ptr, apng_info_ptr, apng_ainfo_ptr);
|
||||
}
|
||||
|
||||
png_destroy_write_struct(&apng_ptr, &apng_info_ptr);
|
||||
|
|
|
|||
|
|
@ -8264,8 +8264,8 @@ void A_JawzChase(mobj_t *actor)
|
|||
|
||||
if (actor->tracer)
|
||||
{
|
||||
if (G_RaceGametype()) // Stop looking after first target in race
|
||||
actor->extravalue1 = 1;
|
||||
/*if (G_RaceGametype()) // Stop looking after first target in race
|
||||
actor->extravalue1 = 1;*/
|
||||
|
||||
if (actor->tracer->health)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -411,6 +411,12 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
player->kartstuff[k_roulettetype] = 2;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Eggbox snipe!
|
||||
if (special->type == MT_EGGMANITEM && special->health > 1)
|
||||
S_StartSound(toucher, sfx_bsnipe);
|
||||
#endif
|
||||
|
||||
{
|
||||
mobj_t *poof = P_SpawnMobj(special->x, special->y, special->z, MT_EXPLODE);
|
||||
S_StartSound(poof, special->info->deathsound);
|
||||
|
|
|
|||
273
src/p_map.c
273
src/p_map.c
|
|
@ -747,14 +747,15 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
&& !(tmthing->type == MT_ORBINAUT || tmthing->type == MT_JAWZ || tmthing->type == MT_JAWZ_DUD))
|
||||
return true;
|
||||
|
||||
if (thing->player && thing->player->kartstuff[k_hyudorotimer])
|
||||
return true; // no interaction
|
||||
|
||||
if (thing->type == MT_PLAYER)
|
||||
{
|
||||
// Player Damage
|
||||
P_DamageMobj(thing, tmthing, tmthing->target, 1);
|
||||
K_KartBouncing(thing, tmthing, false, false);
|
||||
|
||||
if (tmthing->type == MT_ORBINAUT || tmthing->type == MT_JAWZ || tmthing->type == MT_JAWZ_DUD)
|
||||
S_StartSound(thing, sfx_s3k7b);
|
||||
S_StartSound(thing, sfx_s3k7b);
|
||||
|
||||
// This Item Damage
|
||||
if (tmthing->eflags & MFE_VERTICALFLIP)
|
||||
|
|
@ -852,7 +853,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
|
||||
if (thing->type == MT_PLAYER)
|
||||
{
|
||||
S_StartSound(NULL, sfx_cgot); //let all players hear it.
|
||||
S_StartSound(NULL, sfx_bsnipe); //let all players hear it.
|
||||
HU_SetCEchoFlags(0);
|
||||
HU_SetCEchoDuration(5);
|
||||
HU_DoCEcho(va("%s\\was hit by a kitchen sink.\\\\\\\\", player_names[thing->player-players]));
|
||||
|
|
@ -914,6 +915,10 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
|
||||
if (thing->type == MT_PLAYER)
|
||||
{
|
||||
// Banana snipe!
|
||||
if (tmthing->type == MT_BANANA && tmthing->health > 1)
|
||||
S_StartSound(thing, sfx_bsnipe);
|
||||
|
||||
// Player Damage
|
||||
K_SpinPlayer(thing->player, tmthing->target, 0, tmthing, (tmthing->type == MT_BANANA || tmthing->type == MT_BANANA_SHIELD));
|
||||
|
||||
|
|
@ -982,7 +987,12 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
|
||||
if (thing->type == MT_PLAYER)
|
||||
{
|
||||
P_KillMobj(tmthing, thing, thing);
|
||||
// Bomb punting
|
||||
if ((tmthing->state >= &states[S_SSMINE1] && tmthing->state <= &states[S_SSMINE4])
|
||||
|| (tmthing->state >= &states[S_SSMINE_DEPLOY8] && tmthing->state <= &states[S_SSMINE_DEPLOY13]))
|
||||
P_KillMobj(tmthing, thing, thing);
|
||||
else
|
||||
K_PuntMine(tmthing, thing);
|
||||
}
|
||||
else if (thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD
|
||||
|| thing->type == MT_ORBINAUT_SHIELD || thing->type == MT_JAWZ_SHIELD)
|
||||
|
|
@ -1023,6 +1033,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
&& !(thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD))
|
||||
return true;
|
||||
|
||||
if (tmthing->player && tmthing->player->kartstuff[k_hyudorotimer]) // I thought about doing this for just the objects below but figured it should apply to everything.
|
||||
return true; // no interaction
|
||||
|
||||
if (thing->type == MT_ORBINAUT_SHIELD || thing->type == MT_JAWZ_SHIELD
|
||||
|| thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD)
|
||||
{
|
||||
|
|
@ -1035,9 +1048,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
// Player Damage
|
||||
P_DamageMobj(tmthing, thing, thing->target, 1);
|
||||
K_KartBouncing(tmthing, thing, false, false);
|
||||
|
||||
if (thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD)
|
||||
S_StartSound(tmthing, sfx_s3k7b);
|
||||
S_StartSound(tmthing, sfx_s3k7b);
|
||||
|
||||
// Other Item Damage
|
||||
if (thing->eflags & MFE_VERTICALFLIP)
|
||||
|
|
@ -1060,6 +1071,10 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
if (tmthing->health <= 0 || thing->health <= 0)
|
||||
return true;
|
||||
|
||||
// Banana snipe!
|
||||
if (thing->type == MT_BANANA && thing->health > 1)
|
||||
S_StartSound(tmthing, sfx_bsnipe);
|
||||
|
||||
// Player Damage
|
||||
K_SpinPlayer(tmthing->player, thing->target, 0, tmthing, (thing->type == MT_BANANA || thing->type == MT_BANANA_SHIELD));
|
||||
|
||||
|
|
@ -1083,7 +1098,12 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
if (tmthing->health <= 0 || thing->health <= 0)
|
||||
return true;
|
||||
|
||||
P_KillMobj(thing, tmthing, tmthing);
|
||||
// Bomb punting
|
||||
if ((thing->state >= &states[S_SSMINE1] && thing->state <= &states[S_SSMINE4])
|
||||
|| (thing->state >= &states[S_SSMINE_DEPLOY8] && thing->state <= &states[S_SSMINE_DEPLOY13]))
|
||||
P_KillMobj(thing, tmthing, tmthing);
|
||||
else
|
||||
K_PuntMine(thing, tmthing);
|
||||
}
|
||||
else if (thing->type == MT_MINEEXPLOSION && tmthing->player)
|
||||
{
|
||||
|
|
@ -3231,129 +3251,6 @@ isblocking:
|
|||
return false; // stop
|
||||
}
|
||||
|
||||
//
|
||||
// P_IsClimbingValid
|
||||
//
|
||||
// Unlike P_DoClimbing, don't use when up against a one-sided linedef.
|
||||
//
|
||||
static boolean P_IsClimbingValid(player_t *player, angle_t angle)
|
||||
{
|
||||
fixed_t platx, platy;
|
||||
subsector_t *glidesector;
|
||||
fixed_t floorz, ceilingz;
|
||||
|
||||
platx = P_ReturnThrustX(player->mo, angle, player->mo->radius + FixedMul(8*FRACUNIT, player->mo->scale));
|
||||
platy = P_ReturnThrustY(player->mo, angle, player->mo->radius + FixedMul(8*FRACUNIT, player->mo->scale));
|
||||
|
||||
glidesector = R_PointInSubsector(player->mo->x + platx, player->mo->y + platy);
|
||||
|
||||
#ifdef ESLOPE
|
||||
floorz = glidesector->sector->f_slope ? P_GetZAt(glidesector->sector->f_slope, player->mo->x, player->mo->y) : glidesector->sector->floorheight;
|
||||
ceilingz = glidesector->sector->c_slope ? P_GetZAt(glidesector->sector->c_slope, player->mo->x, player->mo->y) : glidesector->sector->ceilingheight;
|
||||
#else
|
||||
floorz = glidesector->sector->floorheight;
|
||||
ceilingz = glidesector->sector->ceilingheight;
|
||||
#endif
|
||||
|
||||
if (glidesector->sector != player->mo->subsector->sector)
|
||||
{
|
||||
boolean floorclimb = false;
|
||||
fixed_t topheight, bottomheight;
|
||||
|
||||
if (glidesector->sector->ffloors)
|
||||
{
|
||||
ffloor_t *rover;
|
||||
for (rover = glidesector->sector->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER))
|
||||
continue;
|
||||
|
||||
topheight = *rover->topheight;
|
||||
bottomheight = *rover->bottomheight;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (*rover->t_slope)
|
||||
topheight = P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y);
|
||||
if (*rover->b_slope)
|
||||
bottomheight = P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y);
|
||||
#endif
|
||||
|
||||
floorclimb = true;
|
||||
|
||||
if (player->mo->eflags & MFE_VERTICALFLIP)
|
||||
{
|
||||
if ((topheight < player->mo->z + player->mo->height) && ((player->mo->z + player->mo->height + player->mo->momz) < topheight))
|
||||
{
|
||||
floorclimb = true;
|
||||
}
|
||||
if (topheight < player->mo->z) // Waaaay below the ledge.
|
||||
{
|
||||
floorclimb = false;
|
||||
}
|
||||
if (bottomheight > player->mo->z + player->mo->height - FixedMul(16*FRACUNIT,player->mo->scale))
|
||||
{
|
||||
floorclimb = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((bottomheight > player->mo->z) && ((player->mo->z - player->mo->momz) > bottomheight))
|
||||
{
|
||||
floorclimb = true;
|
||||
}
|
||||
if (bottomheight > player->mo->z + player->mo->height) // Waaaay below the ledge.
|
||||
{
|
||||
floorclimb = false;
|
||||
}
|
||||
if (topheight < player->mo->z + FixedMul(16*FRACUNIT,player->mo->scale))
|
||||
{
|
||||
floorclimb = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (floorclimb)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (player->mo->eflags & MFE_VERTICALFLIP)
|
||||
{
|
||||
if ((floorz <= player->mo->z + player->mo->height)
|
||||
&& ((player->mo->z + player->mo->height - player->mo->momz) <= floorz))
|
||||
floorclimb = true;
|
||||
|
||||
if ((floorz > player->mo->z)
|
||||
&& glidesector->sector->floorpic == skyflatnum)
|
||||
return false;
|
||||
|
||||
if ((player->mo->z + player->mo->height - FixedMul(16*FRACUNIT,player->mo->scale) > ceilingz)
|
||||
|| (player->mo->z + player->mo->height <= floorz))
|
||||
floorclimb = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((ceilingz >= player->mo->z)
|
||||
&& ((player->mo->z - player->mo->momz) >= ceilingz))
|
||||
floorclimb = true;
|
||||
|
||||
if ((ceilingz < player->mo->z+player->mo->height)
|
||||
&& glidesector->sector->ceilingpic == skyflatnum)
|
||||
return false;
|
||||
|
||||
if ((player->mo->z + FixedMul(16*FRACUNIT,player->mo->scale) < ceilingz)
|
||||
|| (player->mo->z >= ceilingz))
|
||||
floorclimb = true;
|
||||
}
|
||||
|
||||
if (!floorclimb)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// PTR_SlideTraverse
|
||||
//
|
||||
|
|
@ -3407,117 +3304,7 @@ isblocking:
|
|||
P_ProcessSpecialSector(slidemo->player, slidemo->subsector->sector, li->polyobj->lines[0]->backsector);
|
||||
}
|
||||
|
||||
if (slidemo->player && (slidemo->player->pflags & PF_GLIDING || slidemo->player->climbing)
|
||||
&& slidemo->player->charability == CA_GLIDEANDCLIMB)
|
||||
{
|
||||
line_t *checkline = li;
|
||||
sector_t *checksector;
|
||||
ffloor_t *rover;
|
||||
fixed_t topheight, bottomheight;
|
||||
boolean fofline = false;
|
||||
INT32 side = P_PointOnLineSide(slidemo->x, slidemo->y, li);
|
||||
|
||||
if (!side && li->backsector)
|
||||
checksector = li->backsector;
|
||||
else
|
||||
checksector = li->frontsector;
|
||||
|
||||
if (checksector->ffloors)
|
||||
{
|
||||
for (rover = checksector->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER) || (rover->flags & FF_BUSTUP))
|
||||
continue;
|
||||
|
||||
topheight = *rover->topheight;
|
||||
bottomheight = *rover->bottomheight;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (*rover->t_slope)
|
||||
topheight = P_GetZAt(*rover->t_slope, slidemo->x, slidemo->y);
|
||||
if (*rover->b_slope)
|
||||
bottomheight = P_GetZAt(*rover->b_slope, slidemo->x, slidemo->y);
|
||||
#endif
|
||||
|
||||
if (topheight < slidemo->z)
|
||||
continue;
|
||||
|
||||
if (bottomheight > slidemo->z + slidemo->height)
|
||||
continue;
|
||||
|
||||
// Got this far, so I guess it's climbable. // TODO: Climbing check, also, better method to do this?
|
||||
if (rover->master->flags & ML_TFERLINE)
|
||||
{
|
||||
size_t linenum = li-checksector->lines[0];
|
||||
checkline = rover->master->frontsector->lines[0] + linenum;
|
||||
fofline = true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// see about climbing on the wall
|
||||
if (!(checkline->flags & ML_NOCLIMB))
|
||||
{
|
||||
boolean canclimb;
|
||||
angle_t climbangle, climbline;
|
||||
INT32 whichside = P_PointOnLineSide(slidemo->x, slidemo->y, li);
|
||||
|
||||
climbangle = climbline = R_PointToAngle2(li->v1->x, li->v1->y, li->v2->x, li->v2->y);
|
||||
|
||||
if (whichside) // on second side?
|
||||
climbline += ANGLE_180;
|
||||
|
||||
climbangle += (ANGLE_90 * (whichside ? -1 : 1));
|
||||
|
||||
canclimb = (li->backsector ? P_IsClimbingValid(slidemo->player, climbangle) : true);
|
||||
|
||||
if (((!slidemo->player->climbing && abs((signed)(slidemo->angle - ANGLE_90 - climbline)) < ANGLE_45)
|
||||
|| (slidemo->player->climbing == 1 && abs((signed)(slidemo->angle - climbline)) < ANGLE_135))
|
||||
&& canclimb)
|
||||
{
|
||||
slidemo->angle = climbangle;
|
||||
if (!demoplayback || P_AnalogMove(slidemo->player))
|
||||
{
|
||||
if (slidemo->player == &players[consoleplayer])
|
||||
localangle = slidemo->angle;
|
||||
else if (slidemo->player == &players[secondarydisplayplayer])
|
||||
localangle2 = slidemo->angle;
|
||||
else if (slidemo->player == &players[thirddisplayplayer])
|
||||
localangle3 = slidemo->angle;
|
||||
else if (slidemo->player == &players[fourthdisplayplayer])
|
||||
localangle4 = slidemo->angle;
|
||||
}
|
||||
|
||||
if (!slidemo->player->climbing)
|
||||
{
|
||||
S_StartSound(slidemo->player->mo, sfx_s3k4a);
|
||||
slidemo->player->climbing = 5;
|
||||
}
|
||||
|
||||
slidemo->player->pflags &= ~(PF_GLIDING|PF_SPINNING|PF_JUMPED|PF_THOKKED);
|
||||
slidemo->player->glidetime = 0;
|
||||
slidemo->player->secondjump = 0;
|
||||
|
||||
if (slidemo->player->climbing > 1)
|
||||
slidemo->momz = slidemo->momx = slidemo->momy = 0;
|
||||
|
||||
if (fofline)
|
||||
whichside = 0;
|
||||
|
||||
if (!whichside)
|
||||
{
|
||||
slidemo->player->lastsidehit = checkline->sidenum[whichside];
|
||||
slidemo->player->lastlinehit = (INT16)(checkline - lines);
|
||||
}
|
||||
|
||||
P_Thrust(slidemo, slidemo->angle, FixedMul(5*FRACUNIT, slidemo->scale));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (in->frac < bestslidefrac && (!slidemo->player || !slidemo->player->climbing))
|
||||
if (in->frac < bestslidefrac)
|
||||
{
|
||||
secondslidefrac = bestslidefrac;
|
||||
secondslideline = bestslideline;
|
||||
|
|
|
|||
41
src/p_mobj.c
41
src/p_mobj.c
|
|
@ -1354,7 +1354,7 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
|
|||
if (wasflip == !(mo->eflags & MFE_VERTICALFLIP)) // note!! == ! is not equivalent to != here - turns numeric into bool this way
|
||||
P_PlayerFlip(mo);
|
||||
if (mo->player->kartstuff[k_pogospring])
|
||||
gravityadd = FixedMul(gravityadd, 5*FRACUNIT/2);
|
||||
gravityadd = (5*gravityadd)/2;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1405,10 +1405,14 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
|
|||
case MT_BANANA:
|
||||
case MT_EGGMANITEM:
|
||||
case MT_SSMINE:
|
||||
gravityadd = FixedMul(gravityadd, 5*FRACUNIT/2);
|
||||
break;
|
||||
case MT_SINK:
|
||||
gravityadd = FixedMul(gravityadd, 5*FRACUNIT); // Double gravity
|
||||
if (mo->extravalue2 > 0)
|
||||
gravityadd *= mo->extravalue2;
|
||||
/* FALLTHRU */
|
||||
case MT_ORBINAUT:
|
||||
case MT_JAWZ:
|
||||
case MT_JAWZ_DUD:
|
||||
gravityadd = (5*gravityadd)/2;
|
||||
break;
|
||||
case MT_SIGN:
|
||||
gravityadd /= 8;
|
||||
|
|
@ -3233,8 +3237,7 @@ boolean P_CanRunOnWater(player_t *player, ffloor_t *rover)
|
|||
#endif
|
||||
*rover->topheight;
|
||||
|
||||
if (!(player->pflags & PF_NIGHTSMODE) && !player->homing
|
||||
&& (((player->charability == CA_SWIM) || player->powers[pw_super] || player->charflags & SF_RUNONWATER) && player->mo->ceilingz-topheight >= player->mo->height)
|
||||
if (((player->charflags & SF_RUNONWATER) && player->mo->ceilingz-topheight >= player->mo->height)
|
||||
&& (rover->flags & FF_SWIMMABLE) && !(player->pflags & PF_SPINNING) && player->speed > FixedMul(player->runspeed, player->mo->scale)
|
||||
&& !(player->pflags & PF_SLIDING)
|
||||
&& abs(player->mo->z - topheight) < FixedMul(30*FRACUNIT, player->mo->scale))
|
||||
|
|
@ -3399,8 +3402,8 @@ void P_MobjCheckWater(mobj_t *mobj)
|
|||
|
||||
// skipping stone!
|
||||
if (p && p->kartstuff[k_waterskip] < 2
|
||||
&& ((p->speed/2 > abs(mobj->momz)) // Going more forward than horizontal, so you can skip across the water.
|
||||
|| (p->speed > K_GetKartSpeed(p,false)/4 && p->kartstuff[k_waterskip])) // Already skipped once, so you can skip once more!
|
||||
&& ((p->speed/3 > abs(mobj->momz)) // Going more forward than horizontal, so you can skip across the water.
|
||||
|| (p->speed > K_GetKartSpeed(p,false)/3 && p->kartstuff[k_waterskip])) // Already skipped once, so you can skip once more!
|
||||
&& ((!(mobj->eflags & MFE_VERTICALFLIP) && thingtop - mobj->momz > mobj->watertop)
|
||||
|| ((mobj->eflags & MFE_VERTICALFLIP) && mobj->z - mobj->momz < mobj->waterbottom)))
|
||||
{
|
||||
|
|
@ -6860,6 +6863,7 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
fixed_t y = P_RandomRange(-35, 35)*mobj->scale;
|
||||
fixed_t z = P_RandomRange(0, 70)*mobj->scale;
|
||||
mobj_t *smoke = P_SpawnMobj(mobj->x + x, mobj->y + y, mobj->z + z, MT_SMOKE);
|
||||
P_SetMobjState(smoke, S_OPAQUESMOKE1);
|
||||
smoke->scale = mobj->scale * 2;
|
||||
smoke->destscale = mobj->scale * 6;
|
||||
smoke->momz = P_RandomRange(4, 9)*FRACUNIT;
|
||||
|
|
@ -6881,6 +6885,7 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
else
|
||||
{
|
||||
mobj_t *smoke = P_SpawnMobj(mobj->x + x, mobj->y + y, mobj->z + z, MT_SMOKE);
|
||||
P_SetMobjState(smoke, S_OPAQUESMOKE1);
|
||||
smoke->scale = mobj->scale;
|
||||
smoke->destscale = mobj->scale*2;
|
||||
}
|
||||
|
|
@ -8399,28 +8404,26 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
mobj->color = mobj->target->player->skincolor;
|
||||
else
|
||||
mobj->color = SKINCOLOR_KETCHUP;
|
||||
|
||||
if (mobj->momx || mobj->momy)
|
||||
P_SpawnGhostMobj(mobj);
|
||||
if (P_IsObjectOnGround(mobj))
|
||||
|
||||
if (P_IsObjectOnGround(mobj) && (mobj->state == &states[S_SSMINE_AIR1] || mobj->state == &states[S_SSMINE_AIR2]))
|
||||
{
|
||||
if (mobj->state == &states[S_SSMINE_AIR1] || mobj->state == &states[S_SSMINE_AIR2])
|
||||
P_SetMobjState(mobj, S_SSMINE_DEPLOY1);
|
||||
if (mobj->reactiontime >= mobj->info->reactiontime)
|
||||
if (mobj->extravalue1 > 0)
|
||||
mobj->extravalue1--;
|
||||
else
|
||||
{
|
||||
mobj->momx = mobj->momy = 0;
|
||||
S_StartSound(mobj, mobj->info->activesound);
|
||||
mobj->reactiontime--;
|
||||
P_SetMobjState(mobj, S_SSMINE_DEPLOY1);
|
||||
}
|
||||
}
|
||||
if (mobj->reactiontime && mobj->reactiontime < mobj->info->reactiontime)
|
||||
{
|
||||
mobj->reactiontime--;
|
||||
if (!mobj->reactiontime)
|
||||
P_KillMobj(mobj, NULL, NULL);
|
||||
}
|
||||
|
||||
if ((mobj->state >= &states[S_SSMINE1] && mobj->state <= &states[S_SSMINE4])
|
||||
|| (mobj->state >= &states[S_SSMINE_DEPLOY8] && mobj->state <= &states[S_SSMINE_DEPLOY13]))
|
||||
A_GrenadeRing(mobj);
|
||||
|
||||
if (mobj->threshold > 0)
|
||||
mobj->threshold--;
|
||||
break;
|
||||
|
|
|
|||
155
src/p_saveg.c
155
src/p_saveg.c
|
|
@ -249,6 +249,8 @@ static void P_NetArchivePlayers(void)
|
|||
|
||||
WRITEUINT32(save_p, players[i].jointime);
|
||||
|
||||
WRITEUINT8(save_p, players[i].splitscreenindex);
|
||||
|
||||
WRITEUINT16(save_p, flags);
|
||||
|
||||
if (flags & CAPSULE)
|
||||
|
|
@ -426,6 +428,8 @@ static void P_NetUnArchivePlayers(void)
|
|||
|
||||
players[i].jointime = READUINT32(save_p);
|
||||
|
||||
players[i].splitscreenindex = READUINT8(save_p);
|
||||
|
||||
flags = READUINT16(save_p);
|
||||
|
||||
if (flags & CAPSULE)
|
||||
|
|
@ -677,84 +681,87 @@ static void P_NetArchiveWorld(void)
|
|||
|
||||
mld = W_CacheLumpNum(lastloadedmaplumpnum+ML_LINEDEFS, PU_CACHE);
|
||||
msd = W_CacheLumpNum(lastloadedmaplumpnum+ML_SIDEDEFS, PU_CACHE);
|
||||
// do lines
|
||||
for (i = 0; i < numlines; i++, mld++, li++)
|
||||
if (mld && msd)
|
||||
{
|
||||
diff = diff2 = 0;
|
||||
|
||||
if (li->special != SHORT(mld->special))
|
||||
diff |= LD_SPECIAL;
|
||||
|
||||
if (SHORT(mld->special) == 321 || SHORT(mld->special) == 322) // only reason li->callcount would be non-zero is if either of these are involved
|
||||
diff |= LD_CLLCOUNT;
|
||||
|
||||
if (li->sidenum[0] != 0xffff)
|
||||
// do lines
|
||||
for (i = 0; i < numlines; i++, mld++, li++)
|
||||
{
|
||||
si = &sides[li->sidenum[0]];
|
||||
if (si->textureoffset != SHORT(msd[li->sidenum[0]].textureoffset)<<FRACBITS)
|
||||
diff |= LD_S1TEXOFF;
|
||||
//SoM: 4/1/2000: Some textures are colormaps. Don't worry about invalid textures.
|
||||
if (R_CheckTextureNumForName(msd[li->sidenum[0]].toptexture) != -1
|
||||
&& si->toptexture != R_TextureNumForName(msd[li->sidenum[0]].toptexture))
|
||||
diff |= LD_S1TOPTEX;
|
||||
if (R_CheckTextureNumForName(msd[li->sidenum[0]].bottomtexture) != -1
|
||||
&& si->bottomtexture != R_TextureNumForName(msd[li->sidenum[0]].bottomtexture))
|
||||
diff |= LD_S1BOTTEX;
|
||||
if (R_CheckTextureNumForName(msd[li->sidenum[0]].midtexture) != -1
|
||||
&& si->midtexture != R_TextureNumForName(msd[li->sidenum[0]].midtexture))
|
||||
diff |= LD_S1MIDTEX;
|
||||
}
|
||||
if (li->sidenum[1] != 0xffff)
|
||||
{
|
||||
si = &sides[li->sidenum[1]];
|
||||
if (si->textureoffset != SHORT(msd[li->sidenum[1]].textureoffset)<<FRACBITS)
|
||||
diff2 |= LD_S2TEXOFF;
|
||||
if (R_CheckTextureNumForName(msd[li->sidenum[1]].toptexture) != -1
|
||||
&& si->toptexture != R_TextureNumForName(msd[li->sidenum[1]].toptexture))
|
||||
diff2 |= LD_S2TOPTEX;
|
||||
if (R_CheckTextureNumForName(msd[li->sidenum[1]].bottomtexture) != -1
|
||||
&& si->bottomtexture != R_TextureNumForName(msd[li->sidenum[1]].bottomtexture))
|
||||
diff2 |= LD_S2BOTTEX;
|
||||
if (R_CheckTextureNumForName(msd[li->sidenum[1]].midtexture) != -1
|
||||
&& si->midtexture != R_TextureNumForName(msd[li->sidenum[1]].midtexture))
|
||||
diff2 |= LD_S2MIDTEX;
|
||||
if (diff2)
|
||||
diff |= LD_DIFF2;
|
||||
}
|
||||
diff = diff2 = 0;
|
||||
|
||||
if (diff)
|
||||
{
|
||||
statline++;
|
||||
WRITEINT16(put, i);
|
||||
WRITEUINT8(put, diff);
|
||||
if (diff & LD_DIFF2)
|
||||
WRITEUINT8(put, diff2);
|
||||
if (diff & LD_FLAG)
|
||||
WRITEINT16(put, li->flags);
|
||||
if (diff & LD_SPECIAL)
|
||||
WRITEINT16(put, li->special);
|
||||
if (diff & LD_CLLCOUNT)
|
||||
WRITEINT16(put, li->callcount);
|
||||
if (li->special != SHORT(mld->special))
|
||||
diff |= LD_SPECIAL;
|
||||
|
||||
si = &sides[li->sidenum[0]];
|
||||
if (diff & LD_S1TEXOFF)
|
||||
WRITEFIXED(put, si->textureoffset);
|
||||
if (diff & LD_S1TOPTEX)
|
||||
WRITEINT32(put, si->toptexture);
|
||||
if (diff & LD_S1BOTTEX)
|
||||
WRITEINT32(put, si->bottomtexture);
|
||||
if (diff & LD_S1MIDTEX)
|
||||
WRITEINT32(put, si->midtexture);
|
||||
if (SHORT(mld->special) == 321 || SHORT(mld->special) == 322) // only reason li->callcount would be non-zero is if either of these are involved
|
||||
diff |= LD_CLLCOUNT;
|
||||
|
||||
si = &sides[li->sidenum[1]];
|
||||
if (diff2 & LD_S2TEXOFF)
|
||||
WRITEFIXED(put, si->textureoffset);
|
||||
if (diff2 & LD_S2TOPTEX)
|
||||
WRITEINT32(put, si->toptexture);
|
||||
if (diff2 & LD_S2BOTTEX)
|
||||
WRITEINT32(put, si->bottomtexture);
|
||||
if (diff2 & LD_S2MIDTEX)
|
||||
WRITEINT32(put, si->midtexture);
|
||||
if (li->sidenum[0] != 0xffff)
|
||||
{
|
||||
si = &sides[li->sidenum[0]];
|
||||
if (si->textureoffset != SHORT(msd[li->sidenum[0]].textureoffset)<<FRACBITS)
|
||||
diff |= LD_S1TEXOFF;
|
||||
//SoM: 4/1/2000: Some textures are colormaps. Don't worry about invalid textures.
|
||||
if (R_CheckTextureNumForName(msd[li->sidenum[0]].toptexture) != -1
|
||||
&& si->toptexture != R_TextureNumForName(msd[li->sidenum[0]].toptexture))
|
||||
diff |= LD_S1TOPTEX;
|
||||
if (R_CheckTextureNumForName(msd[li->sidenum[0]].bottomtexture) != -1
|
||||
&& si->bottomtexture != R_TextureNumForName(msd[li->sidenum[0]].bottomtexture))
|
||||
diff |= LD_S1BOTTEX;
|
||||
if (R_CheckTextureNumForName(msd[li->sidenum[0]].midtexture) != -1
|
||||
&& si->midtexture != R_TextureNumForName(msd[li->sidenum[0]].midtexture))
|
||||
diff |= LD_S1MIDTEX;
|
||||
}
|
||||
if (li->sidenum[1] != 0xffff)
|
||||
{
|
||||
si = &sides[li->sidenum[1]];
|
||||
if (si->textureoffset != SHORT(msd[li->sidenum[1]].textureoffset)<<FRACBITS)
|
||||
diff2 |= LD_S2TEXOFF;
|
||||
if (R_CheckTextureNumForName(msd[li->sidenum[1]].toptexture) != -1
|
||||
&& si->toptexture != R_TextureNumForName(msd[li->sidenum[1]].toptexture))
|
||||
diff2 |= LD_S2TOPTEX;
|
||||
if (R_CheckTextureNumForName(msd[li->sidenum[1]].bottomtexture) != -1
|
||||
&& si->bottomtexture != R_TextureNumForName(msd[li->sidenum[1]].bottomtexture))
|
||||
diff2 |= LD_S2BOTTEX;
|
||||
if (R_CheckTextureNumForName(msd[li->sidenum[1]].midtexture) != -1
|
||||
&& si->midtexture != R_TextureNumForName(msd[li->sidenum[1]].midtexture))
|
||||
diff2 |= LD_S2MIDTEX;
|
||||
if (diff2)
|
||||
diff |= LD_DIFF2;
|
||||
}
|
||||
|
||||
if (diff)
|
||||
{
|
||||
statline++;
|
||||
WRITEINT16(put, i);
|
||||
WRITEUINT8(put, diff);
|
||||
if (diff & LD_DIFF2)
|
||||
WRITEUINT8(put, diff2);
|
||||
if (diff & LD_FLAG)
|
||||
WRITEINT16(put, li->flags);
|
||||
if (diff & LD_SPECIAL)
|
||||
WRITEINT16(put, li->special);
|
||||
if (diff & LD_CLLCOUNT)
|
||||
WRITEINT16(put, li->callcount);
|
||||
|
||||
si = &sides[li->sidenum[0]];
|
||||
if (diff & LD_S1TEXOFF)
|
||||
WRITEFIXED(put, si->textureoffset);
|
||||
if (diff & LD_S1TOPTEX)
|
||||
WRITEINT32(put, si->toptexture);
|
||||
if (diff & LD_S1BOTTEX)
|
||||
WRITEINT32(put, si->bottomtexture);
|
||||
if (diff & LD_S1MIDTEX)
|
||||
WRITEINT32(put, si->midtexture);
|
||||
|
||||
si = &sides[li->sidenum[1]];
|
||||
if (diff2 & LD_S2TEXOFF)
|
||||
WRITEFIXED(put, si->textureoffset);
|
||||
if (diff2 & LD_S2TOPTEX)
|
||||
WRITEINT32(put, si->toptexture);
|
||||
if (diff2 & LD_S2BOTTEX)
|
||||
WRITEINT32(put, si->bottomtexture);
|
||||
if (diff2 & LD_S2MIDTEX)
|
||||
WRITEINT32(put, si->midtexture);
|
||||
}
|
||||
}
|
||||
}
|
||||
WRITEUINT16(put, 0xffff);
|
||||
|
|
@ -3321,6 +3328,7 @@ static void P_NetArchiveMisc(void)
|
|||
|
||||
WRITEUINT32(save_p, wantedcalcdelay);
|
||||
WRITEUINT32(save_p, indirectitemcooldown);
|
||||
WRITEUINT32(save_p, hyubgone);
|
||||
WRITEUINT32(save_p, mapreset);
|
||||
WRITEUINT8(save_p, nospectategrief);
|
||||
WRITEUINT8(save_p, thwompsactive);
|
||||
|
|
@ -3437,6 +3445,7 @@ static inline boolean P_NetUnArchiveMisc(void)
|
|||
|
||||
wantedcalcdelay = READUINT32(save_p);
|
||||
indirectitemcooldown = READUINT32(save_p);
|
||||
hyubgone = READUINT32(save_p);
|
||||
mapreset = READUINT32(save_p);
|
||||
nospectategrief = READUINT8(save_p);
|
||||
thwompsactive = (boolean)READUINT8(save_p);
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ static void P_ClearSingleMapHeaderInfo(INT16 i)
|
|||
DEH_WriteUndoline("LEVELFLAGS", va("%d", mapheaderinfo[num]->levelflags), UNDO_NONE);
|
||||
mapheaderinfo[num]->levelflags = 0;
|
||||
DEH_WriteUndoline("MENUFLAGS", va("%d", mapheaderinfo[num]->menuflags), UNDO_NONE);
|
||||
mapheaderinfo[num]->menuflags = 0;
|
||||
mapheaderinfo[num]->menuflags = (mainwads ? 0 : LF2_EXISTSHACK); // see p_setup.c - prevents replacing maps in addons with easier versions
|
||||
// TODO grades support for delfile (pfft yeah right)
|
||||
P_DeleteGrades(num);
|
||||
// SRB2Kart
|
||||
|
|
@ -1120,7 +1120,7 @@ static inline void P_SpawnEmblems(void)
|
|||
static void P_SpawnSecretItems(boolean loademblems)
|
||||
{
|
||||
// Now let's spawn those funky emblem things! Tails 12-08-2002
|
||||
if (netgame || multiplayer || (modifiedgame && !savemoddata)) // No cheating!!
|
||||
if (netgame || multiplayer || majormods) // No cheating!!
|
||||
return;
|
||||
|
||||
if (loademblems)
|
||||
|
|
@ -2859,6 +2859,9 @@ boolean P_SetupLevel(boolean skipprecip)
|
|||
lastwipetic = nowtime;
|
||||
if (moviemode) // make sure we save frames for the white hold too
|
||||
M_SaveFrame();
|
||||
|
||||
// Keep the network alive
|
||||
NetKeepAlive();
|
||||
}
|
||||
|
||||
ranspecialwipe = 1;
|
||||
|
|
@ -3213,10 +3216,9 @@ boolean P_SetupLevel(boolean skipprecip)
|
|||
if (!cv_analog4.changed)
|
||||
CV_SetValue(&cv_analog4, 0);*/
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode != render_soft && rendermode != render_none)
|
||||
CV_Set(&cv_grfov, cv_grfov.defaultvalue);
|
||||
#endif
|
||||
// Shouldn't be necessary with render parity?
|
||||
/*if (rendermode != render_none)
|
||||
CV_Set(&cv_fov, cv_fov.defaultvalue);*/
|
||||
|
||||
displayplayer = consoleplayer; // Start with your OWN view, please!
|
||||
}
|
||||
|
|
@ -3243,6 +3245,7 @@ boolean P_SetupLevel(boolean skipprecip)
|
|||
|
||||
wantedcalcdelay = wantedfrequency*2;
|
||||
indirectitemcooldown = 0;
|
||||
hyubgone = 0;
|
||||
mapreset = 0;
|
||||
nospectategrief = 0;
|
||||
thwompsactive = false;
|
||||
|
|
@ -3274,7 +3277,7 @@ boolean P_SetupLevel(boolean skipprecip)
|
|||
nextmapoverride = 0;
|
||||
skipstats = false;
|
||||
|
||||
if (!(netgame || multiplayer) && (!modifiedgame || savemoddata))
|
||||
if (!(netgame || multiplayer) && !majormods)
|
||||
mapvisited[gamemap-1] |= MV_VISITED;
|
||||
|
||||
levelloading = false;
|
||||
|
|
@ -3437,7 +3440,7 @@ boolean P_AddWadFile(const char *wadfilename)
|
|||
//
|
||||
R_AddSkins(wadnum); // faB: wadfile index in wadfiles[]
|
||||
|
||||
//
|
||||
//
|
||||
// edit music defs
|
||||
//
|
||||
S_LoadMusicDefs(wadnum);
|
||||
|
|
@ -3457,6 +3460,14 @@ boolean P_AddWadFile(const char *wadfilename)
|
|||
continue;
|
||||
num = (INT16)M_MapNumber(name[3], name[4]);
|
||||
|
||||
// we want to record whether this map exists. if it doesn't have a header, we can assume it's not relephant
|
||||
if (num <= NUMMAPS && mapheaderinfo[num-1])
|
||||
{
|
||||
if (mapheaderinfo[num-1]->menuflags & LF2_EXISTSHACK)
|
||||
G_SetGameModified(multiplayer, true); // oops, double-defined - no record attack privileges for you
|
||||
mapheaderinfo[num-1]->menuflags |= LF2_EXISTSHACK;
|
||||
}
|
||||
|
||||
//If you replaced the map you're on, end the level when done.
|
||||
if (num == gamemap)
|
||||
replacedcurrentmap = true;
|
||||
|
|
@ -3483,6 +3494,8 @@ boolean P_AddWadFile(const char *wadfilename)
|
|||
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
|
||||
}
|
||||
|
||||
refreshdirmenu &= ~REFRESHDIR_GAMEDATA; // Under usual circumstances we'd wait for REFRESHDIR_GAMEDATA to disappear the next frame, but it's a bit too dangerous for that...
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
19
src/p_spec.c
19
src/p_spec.c
|
|
@ -1758,12 +1758,12 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
|
|||
|
||||
switch (specialtype)
|
||||
{
|
||||
case 305: // continuous
|
||||
/*case 305: // continuous
|
||||
case 306: // each time
|
||||
case 307: // once
|
||||
if (!(actor && actor->player && actor->player->charability == dist/10))
|
||||
return false;
|
||||
break;
|
||||
break;*/
|
||||
case 309: // continuous
|
||||
case 310: // each time
|
||||
// Only red team members can activate this.
|
||||
|
|
@ -3864,14 +3864,6 @@ DoneSection2:
|
|||
|
||||
P_InstaThrust(player->mo, player->mo->angle, linespeed);
|
||||
|
||||
/*if (GETSECSPECIAL(sector->special, 3) == 6 && (player->charability2 == CA2_SPINDASH)) // SRB2kart
|
||||
{
|
||||
if (!(player->pflags & PF_SPINNING))
|
||||
player->pflags |= PF_SPINNING;
|
||||
|
||||
//P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
|
||||
}*/
|
||||
|
||||
player->kartstuff[k_dashpadcooldown] = TICRATE/3;
|
||||
player->kartstuff[k_drift] = 0;
|
||||
player->kartstuff[k_driftcharge] = 0;
|
||||
|
|
@ -5781,7 +5773,7 @@ void P_SpawnSpecials(INT32 fromnetsave)
|
|||
lines[i].special = 0;
|
||||
continue;
|
||||
}
|
||||
/*else -- commented out because irrelevant to kart
|
||||
/*else -- commented out because irrelevant to kart. keeping here because we can use these flags for something else now
|
||||
{
|
||||
if ((players[consoleplayer].charability == CA_THOK && (lines[i].flags & ML_NOSONIC))
|
||||
|| (players[consoleplayer].charability == CA_FLY && (lines[i].flags & ML_NOTAILS))
|
||||
|
|
@ -7997,12 +7989,13 @@ static void P_SearchForDisableLinedefs(void)
|
|||
}
|
||||
else if ((lines[i].flags & ML_NETONLY) == ML_NETONLY)
|
||||
continue; // Net-only never triggers in single player
|
||||
else if (players[consoleplayer].charability == CA_THOK && (lines[i].flags & ML_NOSONIC))
|
||||
// commented out because irrelevant to kart. keeping here because we can use these flags for something else now
|
||||
/*else if (players[consoleplayer].charability == CA_THOK && (lines[i].flags & ML_NOSONIC))
|
||||
continue;
|
||||
else if (players[consoleplayer].charability == CA_FLY && (lines[i].flags & ML_NOTAILS))
|
||||
continue;
|
||||
else if (players[consoleplayer].charability == CA_GLIDEANDCLIMB && (lines[i].flags & ML_NOKNUX))
|
||||
continue;
|
||||
continue;*/
|
||||
|
||||
// Disable any linedef specials with our tag.
|
||||
for (j = -1; (j = P_FindLineFromLineTag(&lines[i], j)) >= 0;)
|
||||
|
|
|
|||
|
|
@ -682,6 +682,8 @@ void P_Ticker(boolean run)
|
|||
|
||||
if (indirectitemcooldown)
|
||||
indirectitemcooldown--;
|
||||
if (hyubgone)
|
||||
hyubgone--;
|
||||
|
||||
if (G_BattleGametype())
|
||||
{
|
||||
|
|
|
|||
151
src/p_user.c
151
src/p_user.c
|
|
@ -6662,7 +6662,7 @@ static void P_MovePlayer(player_t *player)
|
|||
//CONS_Printf("leftover turn (%s): %5d or %4d%%\n",
|
||||
// player_names[player-players],
|
||||
// (INT16) (cmd->angleturn - (player->mo->angle>>16)),
|
||||
// (INT16) (cmd->angleturn - (player->mo->angle>>16)) * 100 / (angle_diff ?: 1));
|
||||
// (INT16) (cmd->angleturn - (player->mo->angle>>16)) * 100 / (angle_diff ? angle_diff : 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -7323,74 +7323,6 @@ static void P_MovePlayer(player_t *player)
|
|||
if (CheckForBustableBlocks)
|
||||
P_CheckBustableBlocks(player);
|
||||
|
||||
// Special handling for
|
||||
// gliding in 2D mode
|
||||
if ((twodlevel || player->mo->flags2 & MF2_TWOD) && player->pflags & PF_GLIDING && player->charability == CA_GLIDEANDCLIMB
|
||||
&& !(player->mo->flags & MF_NOCLIP))
|
||||
{
|
||||
msecnode_t *node; // only place it's being used in P_MovePlayer now
|
||||
fixed_t oldx;
|
||||
fixed_t oldy;
|
||||
fixed_t floorz, ceilingz;
|
||||
|
||||
oldx = player->mo->x;
|
||||
oldy = player->mo->y;
|
||||
|
||||
P_UnsetThingPosition(player->mo);
|
||||
player->mo->x += player->mo->momx;
|
||||
player->mo->y += player->mo->momy;
|
||||
P_SetThingPosition(player->mo);
|
||||
|
||||
for (node = player->mo->touching_sectorlist; node; node = node->m_sectorlist_next)
|
||||
{
|
||||
if (!node->m_sector)
|
||||
break;
|
||||
|
||||
if (node->m_sector->ffloors)
|
||||
{
|
||||
ffloor_t *rover;
|
||||
fixed_t topheight, bottomheight;
|
||||
|
||||
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER))
|
||||
continue;
|
||||
|
||||
topheight = P_GetFOFTopZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL);
|
||||
bottomheight = P_GetFOFBottomZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL);
|
||||
if (topheight > player->mo->z && bottomheight < player->mo->z)
|
||||
{
|
||||
P_ResetPlayer(player);
|
||||
S_StartSound(player->mo, sfx_s3k4a);
|
||||
player->climbing = 5;
|
||||
player->mo->momx = player->mo->momy = player->mo->momz = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
floorz = P_GetFloorZ(player->mo, node->m_sector, player->mo->x, player->mo->y, NULL);
|
||||
ceilingz = P_GetCeilingZ(player->mo, node->m_sector, player->mo->x, player->mo->y, NULL);
|
||||
|
||||
if (player->mo->z+player->mo->height > ceilingz
|
||||
&& node->m_sector->ceilingpic == skyflatnum)
|
||||
continue;
|
||||
|
||||
if (floorz > player->mo->z || ceilingz < player->mo->z)
|
||||
{
|
||||
P_ResetPlayer(player);
|
||||
S_StartSound(player->mo, sfx_s3k4a);
|
||||
player->climbing = 5;
|
||||
player->mo->momx = player->mo->momy = player->mo->momz = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
P_UnsetThingPosition(player->mo);
|
||||
player->mo->x = oldx;
|
||||
player->mo->y = oldy;
|
||||
P_SetThingPosition(player->mo);
|
||||
}
|
||||
|
||||
// Check for a BOUNCY sector!
|
||||
if (CheckForBouncySector)
|
||||
P_CheckBouncySectors(player);
|
||||
|
|
@ -8165,6 +8097,8 @@ void P_ResetCamera(player_t *player, camera_t *thiscam)
|
|||
|
||||
boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcalled)
|
||||
{
|
||||
static UINT8 lookbackdelay[4] = {0,0,0,0};
|
||||
UINT8 num;
|
||||
angle_t angle = 0, focusangle = 0, focusaiming = 0;
|
||||
fixed_t x, y, z, dist, height, viewpointx, viewpointy, camspeed, camdist, camheight, pviewheight;
|
||||
fixed_t pan, xpan, ypan;
|
||||
|
|
@ -8293,6 +8227,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
|
||||
if (thiscam == &camera)
|
||||
{
|
||||
num = 0;
|
||||
camspeed = cv_cam_speed.value;
|
||||
camstill = cv_cam_still.value;
|
||||
camrotate = cv_cam_rotate.value;
|
||||
|
|
@ -8302,6 +8237,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
}
|
||||
else if (thiscam == &camera2) // Camera 2
|
||||
{
|
||||
num = 1;
|
||||
camspeed = cv_cam2_speed.value;
|
||||
camstill = cv_cam2_still.value;
|
||||
camrotate = cv_cam2_rotate.value;
|
||||
|
|
@ -8311,6 +8247,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
}
|
||||
else if (thiscam == &camera3) // Camera 3
|
||||
{
|
||||
num = 2;
|
||||
camspeed = cv_cam3_speed.value;
|
||||
camstill = cv_cam3_still.value;
|
||||
camrotate = cv_cam3_rotate.value;
|
||||
|
|
@ -8320,6 +8257,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
}
|
||||
else // Camera 4
|
||||
{
|
||||
num = 3;
|
||||
camspeed = cv_cam4_speed.value;
|
||||
camstill = cv_cam4_still.value;
|
||||
camrotate = cv_cam4_rotate.value;
|
||||
|
|
@ -8342,19 +8280,23 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
}
|
||||
else if (player->exiting) // SRB2Kart: Leave the camera behind while exiting, for dramatic effect!
|
||||
camstill = true;
|
||||
else if (lookback) // SRB2kart - Camera flipper
|
||||
else if (lookback || lookbackdelay[num]) // SRB2kart - Camera flipper
|
||||
{
|
||||
camrotate += 180;
|
||||
camspeed *= 2;
|
||||
if (camspeed > FRACUNIT)
|
||||
camspeed = FRACUNIT;
|
||||
camspeed = FRACUNIT;
|
||||
if (lookback)
|
||||
{
|
||||
camrotate += 180;
|
||||
lookbackdelay[num] = 2;
|
||||
}
|
||||
else
|
||||
lookbackdelay[num]--;
|
||||
}
|
||||
|
||||
if (mo->eflags & MFE_VERTICALFLIP)
|
||||
camheight += thiscam->height;
|
||||
|
||||
if (splitscreen == 1)
|
||||
camspeed = (3*camspeed)/4;
|
||||
if (camspeed > FRACUNIT)
|
||||
camspeed = FRACUNIT;
|
||||
|
||||
if (timeover)
|
||||
angle = mo->angle + FixedAngle(camrotate*FRACUNIT);
|
||||
|
|
@ -8364,16 +8306,21 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
angle = thiscam->angle;
|
||||
else
|
||||
{
|
||||
angle_t input = focusangle + FixedAngle(camrotate<<FRACBITS) - thiscam->angle;
|
||||
boolean invert = (input > ANGLE_180);
|
||||
if (invert)
|
||||
input = InvAngle(input);
|
||||
if (camspeed == FRACUNIT)
|
||||
angle = focusangle + FixedAngle(camrotate<<FRACBITS);
|
||||
else
|
||||
{
|
||||
angle_t input = focusangle + FixedAngle(camrotate<<FRACBITS) - thiscam->angle;
|
||||
boolean invert = (input > ANGLE_180);
|
||||
if (invert)
|
||||
input = InvAngle(input);
|
||||
|
||||
input = FixedAngle(FixedMul(AngleFixed(input), camspeed));
|
||||
if (invert)
|
||||
input = InvAngle(input);
|
||||
input = FixedAngle(FixedMul(AngleFixed(input), camspeed));
|
||||
if (invert)
|
||||
input = InvAngle(input);
|
||||
|
||||
angle = thiscam->angle + input;
|
||||
angle = thiscam->angle + input;
|
||||
}
|
||||
}
|
||||
|
||||
if (!resetcalled && (leveltime > starttime && timeover != 2)
|
||||
|
|
@ -8401,13 +8348,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
height -= FixedMul(height, player->kartstuff[k_boostcam]);
|
||||
}
|
||||
|
||||
// in splitscreen modes, mess with the camera distances to make it feel proportional to how it feels normally
|
||||
if (splitscreen == 1) // widescreen splits should get x1.5 distance
|
||||
{
|
||||
dist = FixedMul(dist, 3*FRACUNIT/2);
|
||||
height = FixedMul(height, 3*FRACUNIT/2);
|
||||
}
|
||||
|
||||
x = mo->x - FixedMul(FINECOSINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist);
|
||||
y = mo->y - FixedMul(FINESINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist);
|
||||
|
||||
|
|
@ -8673,10 +8613,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
{
|
||||
thiscam->momx = x - thiscam->x;
|
||||
thiscam->momy = y - thiscam->y;
|
||||
if (splitscreen == 1) // Wide-screen needs to follow faster, due to a smaller vertical:horizontal ratio of screen space
|
||||
thiscam->momz = FixedMul(z - thiscam->z, (3*camspeed)/4);
|
||||
else
|
||||
thiscam->momz = FixedMul(z - thiscam->z, camspeed/2);
|
||||
thiscam->momz = FixedMul(z - thiscam->z, camspeed/2);
|
||||
}
|
||||
|
||||
thiscam->pan = pan;
|
||||
|
|
@ -8697,8 +8634,25 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
if (twodlevel || (mo->flags2 & MF2_TWOD) || (!camstill && !timeover)) // Keep the view still...
|
||||
{
|
||||
G_ClipAimingPitch((INT32 *)&angle);
|
||||
dist = thiscam->aiming - angle;
|
||||
thiscam->aiming -= (dist>>3);
|
||||
|
||||
if (camspeed == FRACUNIT)
|
||||
thiscam->aiming = angle;
|
||||
else
|
||||
{
|
||||
angle_t input;
|
||||
boolean invert;
|
||||
|
||||
input = thiscam->aiming - angle;
|
||||
invert = (input > ANGLE_180);
|
||||
if (invert)
|
||||
input = InvAngle(input);
|
||||
|
||||
input = FixedAngle(FixedMul(AngleFixed(input), (5*camspeed)/16));
|
||||
if (invert)
|
||||
input = InvAngle(input);
|
||||
|
||||
thiscam->aiming -= input;
|
||||
}
|
||||
}
|
||||
|
||||
if (!resetcalled && (player->playerstate == PST_DEAD || player->playerstate == PST_REBORN))
|
||||
|
|
@ -8763,6 +8717,7 @@ boolean P_SpectatorJoinGame(player_t *player)
|
|||
}
|
||||
player->spectator = false;
|
||||
player->pflags &= ~PF_WANTSTOJOIN;
|
||||
player->kartstuff[k_spectatewait] = 0;
|
||||
player->ctfteam = changeto;
|
||||
player->playerstate = PST_REBORN;
|
||||
|
||||
|
|
@ -8787,6 +8742,7 @@ boolean P_SpectatorJoinGame(player_t *player)
|
|||
}
|
||||
player->spectator = false;
|
||||
player->pflags &= ~PF_WANTSTOJOIN;
|
||||
player->kartstuff[k_spectatewait] = 0;
|
||||
player->playerstate = PST_REBORN;
|
||||
|
||||
//Reset away view
|
||||
|
|
@ -9876,4 +9832,3 @@ void P_PlayerAfterThink(player_t *player)
|
|||
|
||||
K_KartPlayerAfterThink(player);
|
||||
}
|
||||
|
||||
|
|
|
|||
30
src/r_main.c
30
src/r_main.c
|
|
@ -56,6 +56,7 @@ INT32 centerx, centery;
|
|||
fixed_t centerxfrac, centeryfrac;
|
||||
fixed_t projection;
|
||||
fixed_t projectiony; // aspect ratio
|
||||
fixed_t fovtan; // field of view
|
||||
|
||||
// just for profiling purposes
|
||||
size_t framecount;
|
||||
|
|
@ -134,11 +135,14 @@ static CV_PossibleValue_t drawdist_precip_cons_t[] = {
|
|||
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
|
||||
{0, "None"}, {0, NULL}};
|
||||
|
||||
static CV_PossibleValue_t fov_cons_t[] = {{0, "MIN"}, {179*FRACUNIT, "MAX"}, {0, NULL}};
|
||||
|
||||
//static CV_PossibleValue_t precipdensity_cons_t[] = {{0, "None"}, {1, "Light"}, {2, "Moderate"}, {4, "Heavy"}, {6, "Thick"}, {8, "V.Thick"}, {0, NULL}};
|
||||
static CV_PossibleValue_t translucenthud_cons_t[] = {{0, "MIN"}, {10, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t maxportals_cons_t[] = {{0, "MIN"}, {12, "MAX"}, {0, NULL}}; // lmao rendering 32 portals, you're a card
|
||||
static CV_PossibleValue_t homremoval_cons_t[] = {{0, "No"}, {1, "Yes"}, {2, "Flash"}, {0, NULL}};
|
||||
|
||||
static void Fov_OnChange(void);
|
||||
static void ChaseCam_OnChange(void);
|
||||
static void ChaseCam2_OnChange(void);
|
||||
static void ChaseCam3_OnChange(void);
|
||||
|
|
@ -175,6 +179,7 @@ consvar_t cv_drawdist = {"drawdist", "Infinite", CV_SAVE, drawdist_cons_t, NULL,
|
|||
//consvar_t cv_drawdist_nights = {"drawdist_nights", "2048", CV_SAVE, drawdist_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_drawdist_precip = {"drawdist_precip", "1024", CV_SAVE, drawdist_precip_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
//consvar_t cv_precipdensity = {"precipdensity", "Moderate", CV_SAVE, precipdensity_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_fov = {"fov", "90", CV_FLOAT|CV_CALL, fov_cons_t, Fov_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// Okay, whoever said homremoval causes a performance hit should be shot.
|
||||
consvar_t cv_homremoval = {"homremoval", "Yes", CV_SAVE, homremoval_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
|
@ -227,6 +232,14 @@ void SplitScreen_OnChange(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
static void Fov_OnChange(void)
|
||||
{
|
||||
// Shouldn't be needed with render parity?
|
||||
//if ((netgame || multiplayer) && !cv_debug && cv_fov.value != 90*FRACUNIT)
|
||||
// CV_Set(&cv_fov, cv_fov.defaultvalue);
|
||||
|
||||
R_SetViewSize();
|
||||
}
|
||||
|
||||
static void ChaseCam_OnChange(void)
|
||||
{
|
||||
|
|
@ -517,7 +530,7 @@ static void R_InitTextureMapping(void)
|
|||
//
|
||||
// Calc focallength
|
||||
// so FIELDOFVIEW angles covers SCREENWIDTH.
|
||||
focallength = FixedDiv(centerxfrac,
|
||||
focallength = FixedDiv(projection,
|
||||
FINETANGENT(FINEANGLES/4+/*cv_fov.value*/ FIELDOFVIEW/2));
|
||||
|
||||
#ifdef ESLOPE
|
||||
|
|
@ -632,6 +645,7 @@ void R_ExecuteSetViewSize(void)
|
|||
INT32 j;
|
||||
INT32 level;
|
||||
INT32 startmapl;
|
||||
angle_t fov;
|
||||
|
||||
setsizeneeded = false;
|
||||
|
||||
|
|
@ -660,9 +674,12 @@ void R_ExecuteSetViewSize(void)
|
|||
centerxfrac = centerx<<FRACBITS;
|
||||
centeryfrac = centery<<FRACBITS;
|
||||
|
||||
projection = centerxfrac;
|
||||
//projectiony = (((vid.height*centerx*BASEVIDWIDTH)/BASEVIDHEIGHT)/vid.width)<<FRACBITS;
|
||||
projectiony = centerxfrac;
|
||||
fov = FixedAngle(cv_fov.value/2) + ANGLE_90;
|
||||
fovtan = FINETANGENT(fov >> ANGLETOFINESHIFT);
|
||||
if (splitscreen == 1) // Splitscreen FOV should be adjusted to maintain expected vertical view
|
||||
fovtan = 17*fovtan/10;
|
||||
|
||||
projection = projectiony = FixedDiv(centerxfrac, fovtan);
|
||||
|
||||
R_InitViewBuffer(scaledviewwidth, viewheight);
|
||||
|
||||
|
|
@ -688,7 +705,7 @@ void R_ExecuteSetViewSize(void)
|
|||
for (i = 0; i < j; i++)
|
||||
{
|
||||
dy = ((i - viewheight*8)<<FRACBITS) + FRACUNIT/2;
|
||||
dy = abs(dy);
|
||||
dy = FixedMul(abs(dy), fovtan);
|
||||
yslopetab[i] = FixedDiv(centerx*FRACUNIT, dy);
|
||||
}
|
||||
}
|
||||
|
|
@ -803,7 +820,7 @@ subsector_t *R_IsPointInSubsector(fixed_t x, fixed_t y)
|
|||
static mobj_t *viewmobj;
|
||||
|
||||
// WARNING: a should be unsigned but to add with 2048, it isn't!
|
||||
#define AIMINGTODY(a) ((FINETANGENT((2048+(((INT32)a)>>ANGLETOFINESHIFT)) & FINEMASK)*160)>>FRACBITS)
|
||||
#define AIMINGTODY(a) FixedDiv((FINETANGENT((2048+(((INT32)a)>>ANGLETOFINESHIFT)) & FINEMASK)*160)>>FRACBITS, fovtan)
|
||||
|
||||
// recalc necessary stuff for mouseaiming
|
||||
// slopes are already calculated for the full possible view (which is 4*viewheight).
|
||||
|
|
@ -1490,6 +1507,7 @@ void R_RegisterEngineStuff(void)
|
|||
CV_RegisterVar(&cv_drawdist);
|
||||
//CV_RegisterVar(&cv_drawdist_nights);
|
||||
CV_RegisterVar(&cv_drawdist_precip);
|
||||
CV_RegisterVar(&cv_fov);
|
||||
|
||||
CV_RegisterVar(&cv_chasecam);
|
||||
CV_RegisterVar(&cv_chasecam2);
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ extern consvar_t cv_flipcam, cv_flipcam2, cv_flipcam3, cv_flipcam4;
|
|||
extern consvar_t cv_shadow, cv_shadowoffs;
|
||||
extern consvar_t cv_translucency;
|
||||
extern consvar_t /*cv_precipdensity,*/ cv_drawdist, /*cv_drawdist_nights,*/ cv_drawdist_precip;
|
||||
extern consvar_t cv_fov;
|
||||
extern consvar_t cv_skybox;
|
||||
extern consvar_t cv_tailspickup;
|
||||
|
||||
|
|
|
|||
|
|
@ -1051,7 +1051,7 @@ void R_DrawSinglePlane(visplane_t *pl)
|
|||
temp = P_GetZAt(pl->slope, pl->viewx, pl->viewy);
|
||||
zeroheight = FIXED_TO_FLOAT(temp);
|
||||
|
||||
#define ANG2RAD(angle) ((float)((angle)*M_PI)/ANGLE_180)
|
||||
#define ANG2RAD(angle) ((float)((angle)*M_PIl)/ANGLE_180)
|
||||
|
||||
// p is the texture origin in view space
|
||||
// Don't add in the offsets at this stage, because doing so can result in
|
||||
|
|
|
|||
|
|
@ -1315,6 +1315,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
return;
|
||||
|
||||
scalestep = (yscale2 - yscale)/(x2 - x1);
|
||||
scalestep = scalestep ? scalestep : 1;
|
||||
|
||||
// The following two are alternate sorting methods which might be more applicable in some circumstances. TODO - maybe enable via MF2?
|
||||
// sortscale = max(yscale, yscale2);
|
||||
|
|
@ -2635,7 +2636,7 @@ INT32 R_SkinAvailable(const char *name)
|
|||
}
|
||||
|
||||
// network code calls this when a 'skin change' is received
|
||||
void SetPlayerSkin(INT32 playernum, const char *skinname)
|
||||
boolean SetPlayerSkin(INT32 playernum, const char *skinname)
|
||||
{
|
||||
INT32 i;
|
||||
player_t *player = &players[playernum];
|
||||
|
|
@ -2646,7 +2647,7 @@ void SetPlayerSkin(INT32 playernum, const char *skinname)
|
|||
if (stricmp(skins[i].name, skinname) == 0)
|
||||
{
|
||||
SetPlayerSkinByNum(playernum, i);
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2656,6 +2657,7 @@ void SetPlayerSkin(INT32 playernum, const char *skinname)
|
|||
CONS_Alert(CONS_WARNING, M_GetText("Player %d (%s) skin '%s' not found\n"), playernum, player_names[playernum], skinname);
|
||||
|
||||
SetPlayerSkinByNum(playernum, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Same as SetPlayerSkin, but uses the skin #.
|
||||
|
|
@ -2894,27 +2896,27 @@ void R_AddSkins(UINT16 wadnum)
|
|||
#define FULLPROCESS(field) else if (!stricmp(stoken, #field)) skin->field = get_number(value);
|
||||
// character type identification
|
||||
FULLPROCESS(flags)
|
||||
FULLPROCESS(ability)
|
||||
FULLPROCESS(ability2)
|
||||
//FULLPROCESS(ability)
|
||||
//FULLPROCESS(ability2)
|
||||
|
||||
FULLPROCESS(thokitem)
|
||||
FULLPROCESS(spinitem)
|
||||
FULLPROCESS(revitem)
|
||||
//FULLPROCESS(thokitem)
|
||||
//FULLPROCESS(spinitem)
|
||||
//FULLPROCESS(revitem)
|
||||
#undef FULLPROCESS
|
||||
|
||||
#define GETSPEED(field) else if (!stricmp(stoken, #field)) skin->field = atoi(value)<<FRACBITS;
|
||||
GETSPEED(normalspeed)
|
||||
//GETSPEED(normalspeed)
|
||||
GETSPEED(runspeed)
|
||||
GETSPEED(mindash)
|
||||
GETSPEED(maxdash)
|
||||
GETSPEED(actionspd)
|
||||
//GETSPEED(mindash)
|
||||
//GETSPEED(maxdash)
|
||||
//GETSPEED(actionspd)
|
||||
#undef GETSPEED
|
||||
|
||||
#define GETINT(field) else if (!stricmp(stoken, #field)) skin->field = atoi(value);
|
||||
/*#define GETINT(field) else if (!stricmp(stoken, #field)) skin->field = atoi(value);
|
||||
GETINT(thrustfactor)
|
||||
GETINT(accelstart)
|
||||
GETINT(acceleration)
|
||||
#undef GETINT
|
||||
#undef GETINT*/
|
||||
|
||||
#define GETKARTSTAT(field) \
|
||||
else if (!stricmp(stoken, #field)) \
|
||||
|
|
@ -2933,8 +2935,8 @@ void R_AddSkins(UINT16 wadnum)
|
|||
|
||||
else if (!stricmp(stoken, "prefcolor"))
|
||||
skin->prefcolor = K_GetKartColorByName(value);
|
||||
else if (!stricmp(stoken, "jumpfactor"))
|
||||
skin->jumpfactor = FLOAT_TO_FIXED(atof(value));
|
||||
//else if (!stricmp(stoken, "jumpfactor"))
|
||||
//skin->jumpfactor = FLOAT_TO_FIXED(atof(value));
|
||||
else if (!stricmp(stoken, "highresscale"))
|
||||
skin->highresscale = FLOAT_TO_FIXED(atof(value));
|
||||
else
|
||||
|
|
@ -3044,6 +3046,9 @@ next_token:
|
|||
HWR_AddPlayerMD2(numskins);
|
||||
#endif
|
||||
|
||||
if (skin->flags & SF_RUNONWATER) // this is literally the only way a skin can be a major mod... this might be a bit heavy handed
|
||||
G_SetGameModified(multiplayer, true);
|
||||
|
||||
numskins++;
|
||||
}
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ typedef struct drawnode_s
|
|||
extern INT32 numskins;
|
||||
extern skin_t skins[MAXSKINS];
|
||||
|
||||
void SetPlayerSkin(INT32 playernum,const char *skinname);
|
||||
boolean SetPlayerSkin(INT32 playernum,const char *skinname);
|
||||
void SetPlayerSkinByNum(INT32 playernum,INT32 skinnum); // Tails 03-16-2002
|
||||
INT32 R_SkinAvailable(const char *name);
|
||||
void R_AddSkins(UINT16 wadnum);
|
||||
|
|
|
|||
33
src/screen.c
33
src/screen.c
|
|
@ -403,7 +403,7 @@ void SCR_DisplayTicRate(void)
|
|||
tic_t i;
|
||||
tic_t ontic = I_GetTime();
|
||||
tic_t totaltics = 0;
|
||||
INT32 ticcntcolor = 0;
|
||||
const UINT8 *ticcntcolor = NULL;
|
||||
|
||||
for (i = lasttic + 1; i < TICRATE+lasttic && i < ontic; ++i)
|
||||
fpsgraph[i % TICRATE] = false;
|
||||
|
|
@ -414,13 +414,36 @@ void SCR_DisplayTicRate(void)
|
|||
if (fpsgraph[i])
|
||||
++totaltics;
|
||||
|
||||
if (totaltics <= TICRATE/2) ticcntcolor = V_REDMAP;
|
||||
else if (totaltics == TICRATE) ticcntcolor = V_GREENMAP;
|
||||
if (totaltics <= TICRATE/2) ticcntcolor = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_SALMON, GTC_CACHE);
|
||||
else if (totaltics == TICRATE) ticcntcolor = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_MINT, GTC_CACHE);
|
||||
|
||||
V_DrawString(vid.width-(24*vid.dupx), vid.height-(16*vid.dupy),
|
||||
/*V_DrawString(vid.width-(24*vid.dupx), vid.height-(16*vid.dupy),
|
||||
V_YELLOWMAP|V_NOSCALESTART, "FPS");
|
||||
V_DrawString(vid.width-(40*vid.dupx), vid.height-( 8*vid.dupy),
|
||||
ticcntcolor|V_NOSCALESTART, va("%02d/%02u", totaltics, TICRATE));
|
||||
ticcntcolor|V_NOSCALESTART, va("%02d/%02u", totaltics, TICRATE));*/
|
||||
|
||||
// draw "FPS"
|
||||
V_DrawFixedPatch(306<<FRACBITS, 183<<FRACBITS, FRACUNIT, V_SNAPTOBOTTOM|V_SNAPTORIGHT, framecounter, R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_YELLOW, GTC_CACHE));
|
||||
// draw total frame:
|
||||
V_DrawPingNum(318, 190, V_SNAPTOBOTTOM|V_SNAPTORIGHT, TICRATE, ticcntcolor);
|
||||
// draw "/"
|
||||
V_DrawFixedPatch(306<<FRACBITS, 190<<FRACBITS, FRACUNIT, V_SNAPTOBOTTOM|V_SNAPTORIGHT, frameslash, ticcntcolor);
|
||||
// draw our actual framerate
|
||||
V_DrawPingNum(306, 190, V_SNAPTOBOTTOM|V_SNAPTORIGHT, totaltics, ticcntcolor);
|
||||
|
||||
|
||||
lasttic = ontic;
|
||||
}
|
||||
|
||||
// SCR_DisplayLocalPing
|
||||
// Used to draw the user's local ping next to the framerate for a quick check without having to hold TAB for instance. By default, it only shows up if your ping is too high and risks getting you kicked.
|
||||
|
||||
void SCR_DisplayLocalPing(void)
|
||||
{
|
||||
UINT32 ping = playerpingtable[consoleplayer]; // consoleplayer's ping is everyone's ping in a splitnetgame :P
|
||||
if (cv_showping.value == 1 || (cv_showping.value == 2 && ping > servermaxping)) // only show 2 (warning) if our ping is at a bad level
|
||||
{
|
||||
INT32 dispy = cv_ticrate.value ? 160 : 181;
|
||||
HU_drawPing(307, dispy, ping, V_SNAPTORIGHT | V_SNAPTOBOTTOM);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,5 +180,6 @@ FUNCMATH boolean SCR_IsAspectCorrect(INT32 width, INT32 height);
|
|||
|
||||
// move out to main code for consistency
|
||||
void SCR_DisplayTicRate(void);
|
||||
void SCR_DisplayLocalPing(void);
|
||||
#undef DNWH
|
||||
#endif //__SCREEN_H__
|
||||
|
|
|
|||
|
|
@ -70,6 +70,8 @@ if(${SDL2_FOUND})
|
|||
set(SRB2_SDL2_TOTAL_SOURCES
|
||||
${SRB2_CORE_SOURCES}
|
||||
${SRB2_CORE_HEADERS}
|
||||
${SRB2_PNG_SOURCES}
|
||||
${SRB2_PNG_HEADERS}
|
||||
${SRB2_CORE_RENDER_SOURCES}
|
||||
${SRB2_CORE_GAME_SOURCES}
|
||||
${SRB2_LUA_SOURCES}
|
||||
|
|
@ -80,7 +82,8 @@ if(${SDL2_FOUND})
|
|||
${SRB2_SDL2_HEADERS}
|
||||
)
|
||||
|
||||
source_group("Main" FILES ${SRB2_CORE_SOURCES} ${SRB2_CORE_HEADERS})
|
||||
source_group("Main" FILES ${SRB2_CORE_SOURCES} ${SRB2_CORE_HEADERS}
|
||||
${SRB2_PNG_SOURCES} ${SRB2_PNG_HEADERS})
|
||||
source_group("Renderer" FILES ${SRB2_CORE_RENDER_SOURCES})
|
||||
source_group("Game" FILES ${SRB2_CORE_GAME_SOURCES})
|
||||
source_group("Assembly" FILES ${SRB2_ASM_SOURCES} ${SRB2_NASM_SOURCES})
|
||||
|
|
|
|||
|
|
@ -164,6 +164,7 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\am_map.h" />
|
||||
<ClInclude Include="..\apng.h" />
|
||||
<ClInclude Include="..\blua\lapi.h" />
|
||||
<ClInclude Include="..\blua\lauxlib.h" />
|
||||
<ClInclude Include="..\blua\lcode.h" />
|
||||
|
|
@ -317,6 +318,7 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\am_map.c" />
|
||||
<ClCompile Include="..\apng.c" />
|
||||
<ClCompile Include="..\blua\lapi.c" />
|
||||
<ClCompile Include="..\blua\lauxlib.c" />
|
||||
<ClCompile Include="..\blua\lbaselib.c" />
|
||||
|
|
|
|||
|
|
@ -294,6 +294,9 @@
|
|||
<ClInclude Include="..\lua_script.h">
|
||||
<Filter>LUA</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\apng.h">
|
||||
<Filter>M_Misc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\md5.h">
|
||||
<Filter>M_Misc</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
|||
|
|
@ -2834,6 +2834,50 @@
|
|||
RelativePath="..\m_argv.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\apng.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\apng.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\m_bbox.c"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -2974,8 +2974,8 @@ static void I_ShutdownTimer(void)
|
|||
//
|
||||
tic_t I_GetTime (void)
|
||||
{
|
||||
static Uint32 basetime = 0;
|
||||
Uint32 ticks = SDL_GetTicks();
|
||||
static Uint64 basetime = 0;
|
||||
Uint64 ticks = SDL_GetTicks();
|
||||
|
||||
if (!basetime)
|
||||
basetime = ticks;
|
||||
|
|
@ -3018,7 +3018,7 @@ void I_StartupTimer(void)
|
|||
|
||||
void I_Sleep(void)
|
||||
{
|
||||
if (cv_sleep.value != -1)
|
||||
if (cv_sleep.value > 0)
|
||||
SDL_Delay(cv_sleep.value);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
#include "../m_menu.h"
|
||||
#include "../d_main.h"
|
||||
#include "../s_sound.h"
|
||||
#include "../i_sound.h" // midi pause/unpause
|
||||
#include "../i_sound.h" // midi pause/unpause
|
||||
#include "../i_joy.h"
|
||||
#include "../st_stuff.h"
|
||||
#include "../g_game.h"
|
||||
|
|
@ -1229,7 +1229,7 @@ void I_GetEvent(void)
|
|||
// update the menu
|
||||
if (currentMenu == &OP_JoystickSetDef)
|
||||
M_SetupJoystickMenu(0);
|
||||
break;
|
||||
break;
|
||||
case SDL_QUIT:
|
||||
I_Quit();
|
||||
M_QuitResponse('y');
|
||||
|
|
@ -1361,6 +1361,9 @@ void I_FinishUpdate(void)
|
|||
if (cv_ticrate.value)
|
||||
SCR_DisplayTicRate();
|
||||
|
||||
if (cv_showping.value && netgame && consoleplayer != serverplayer)
|
||||
SCR_DisplayLocalPing();
|
||||
|
||||
if (rendermode == render_soft && screens[0])
|
||||
{
|
||||
SDL_Rect rect;
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@
|
|||
1E44AF0D0B67CDE900BAD059 /* m_fixed.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AEFE0B67CDE900BAD059 /* m_fixed.c */; };
|
||||
1E44AF0F0B67CDE900BAD059 /* m_menu.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF000B67CDE900BAD059 /* m_menu.c */; };
|
||||
1E44AF110B67CDE900BAD059 /* m_misc.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF020B67CDE900BAD059 /* m_misc.c */; };
|
||||
1E44AF110B67CDE900BAD059 /* apng.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF020B67CDE900BAD059 /* apng.c */; };
|
||||
1E44AF130B67CDE900BAD059 /* m_random.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF040B67CDE900BAD059 /* m_random.c */; };
|
||||
1E44AF1A0B67CE2A00BAD059 /* info.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF180B67CE2A00BAD059 /* info.c */; };
|
||||
1E44AF1E0B67CE3600BAD059 /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF1C0B67CE3600BAD059 /* md5.c */; };
|
||||
|
|
@ -253,7 +254,9 @@
|
|||
1E44AF000B67CDE900BAD059 /* m_menu.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = m_menu.c; path = ../../m_menu.c; sourceTree = SOURCE_ROOT; };
|
||||
1E44AF010B67CDE900BAD059 /* m_menu.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = m_menu.h; path = ../../m_menu.h; sourceTree = SOURCE_ROOT; };
|
||||
1E44AF020B67CDE900BAD059 /* m_misc.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = m_misc.c; path = ../../m_misc.c; sourceTree = SOURCE_ROOT; };
|
||||
1E44AF020B67CDE900BAD059 /* apng.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = apng.c; path = ../../m_misc.c; sourceTree = SOURCE_ROOT; };
|
||||
1E44AF030B67CDE900BAD059 /* m_misc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = m_misc.h; path = ../../m_misc.h; sourceTree = SOURCE_ROOT; };
|
||||
1E44AF020B67CDE900BAD059 /* apng.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = apng.h; path = ../../m_misc.c; sourceTree = SOURCE_ROOT; };
|
||||
1E44AF040B67CDE900BAD059 /* m_random.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = m_random.c; path = ../../m_random.c; sourceTree = SOURCE_ROOT; };
|
||||
1E44AF050B67CDE900BAD059 /* m_random.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = m_random.h; path = ../../m_random.h; sourceTree = SOURCE_ROOT; };
|
||||
1E44AF060B67CDE900BAD059 /* m_swap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = m_swap.h; path = ../../m_swap.h; sourceTree = SOURCE_ROOT; };
|
||||
|
|
@ -679,6 +682,8 @@
|
|||
1E44AEFF0B67CDE900BAD059 /* m_fixed.h */,
|
||||
1E44AF020B67CDE900BAD059 /* m_misc.c */,
|
||||
1E44AF030B67CDE900BAD059 /* m_misc.h */,
|
||||
1E44AF020B67CDE900BAD059 /* apng.c */,
|
||||
1E44AF030B67CDE900BAD059 /* apng.h */,
|
||||
676BB51C0E0DE06100C95963 /* m_queue.c */,
|
||||
676BB51D0E0DE06100C95963 /* m_queue.h */,
|
||||
1E44AF040B67CDE900BAD059 /* m_random.c */,
|
||||
|
|
|
|||
BIN
src/sdl/srb2icon.png
Normal file
BIN
src/sdl/srb2icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3 KiB |
|
|
@ -835,6 +835,16 @@
|
|||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\apng.c">
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\m_misc.c">
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
|
|
@ -1293,6 +1303,7 @@
|
|||
<ClInclude Include="filter\interp.h" />
|
||||
<ClInclude Include="filter\lq2x.h" />
|
||||
<ClInclude Include="..\p5prof.h" />
|
||||
<ClInclude Include="..\apng.h" />
|
||||
<ClInclude Include="..\d_clisrv.h" />
|
||||
<ClInclude Include="..\d_event.h" />
|
||||
<ClInclude Include="..\d_main.h" />
|
||||
|
|
|
|||
|
|
@ -2790,6 +2790,50 @@
|
|||
<Filter
|
||||
Name="M_Misc"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\apng.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\apng.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\m_argv.c"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -2914,7 +2914,7 @@ void I_StartupTimer(void)
|
|||
void I_Sleep(void)
|
||||
{
|
||||
#if !(defined (_arch_dreamcast) || defined (_XBOX))
|
||||
if (cv_sleep.value != -1)
|
||||
if (cv_sleep.value > 0)
|
||||
SDL_Delay(cv_sleep.value);
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1343,6 +1343,9 @@ void I_FinishUpdate(void)
|
|||
if (cv_ticrate.value)
|
||||
SCR_DisplayTicRate();
|
||||
|
||||
if (cv_showping.value && netgame && consoleplayer != serverplayer)
|
||||
SCR_DisplayLocalPing();
|
||||
|
||||
if (render_soft == rendermode && screens[0])
|
||||
{
|
||||
SDL_Rect *dstrect = NULL;
|
||||
|
|
|
|||
|
|
@ -1365,6 +1365,20 @@
|
|||
path = ../../m_misc.h;
|
||||
refType = 2;
|
||||
};
|
||||
84177764085A10EB000C01D8 = {
|
||||
fileEncoding = 30;
|
||||
isa = PBXFileReference;
|
||||
name = apng.c;
|
||||
path = ../../apng.c;
|
||||
refType = 2;
|
||||
};
|
||||
84177765085A10EB000C01D8 = {
|
||||
fileEncoding = 30;
|
||||
isa = PBXFileReference;
|
||||
name = m_misc.h;
|
||||
path = ../../apng.h;
|
||||
refType = 2;
|
||||
};
|
||||
84177766085A10EB000C01D8 = {
|
||||
fileEncoding = 30;
|
||||
isa = PBXFileReference;
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@
|
|||
1E44AF0D0B67CDE900BAD059 /* m_fixed.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AEFE0B67CDE900BAD059 /* m_fixed.c */; };
|
||||
1E44AF0F0B67CDE900BAD059 /* m_menu.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF000B67CDE900BAD059 /* m_menu.c */; };
|
||||
1E44AF110B67CDE900BAD059 /* m_misc.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF020B67CDE900BAD059 /* m_misc.c */; };
|
||||
1E44AF110B67CDE900BAD059 /* apng.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF020B67CDE900BAD059 /* apng.c */; };
|
||||
1E44AF130B67CDE900BAD059 /* m_random.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF040B67CDE900BAD059 /* m_random.c */; };
|
||||
1E44AF1A0B67CE2A00BAD059 /* info.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF180B67CE2A00BAD059 /* info.c */; };
|
||||
1E44AF1E0B67CE3600BAD059 /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = 1E44AF1C0B67CE3600BAD059 /* md5.c */; };
|
||||
|
|
@ -254,6 +255,8 @@
|
|||
1E44AF010B67CDE900BAD059 /* m_menu.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = m_menu.h; path = ../../m_menu.h; sourceTree = SOURCE_ROOT; };
|
||||
1E44AF020B67CDE900BAD059 /* m_misc.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = m_misc.c; path = ../../m_misc.c; sourceTree = SOURCE_ROOT; };
|
||||
1E44AF030B67CDE900BAD059 /* m_misc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = m_misc.h; path = ../../m_misc.h; sourceTree = SOURCE_ROOT; };
|
||||
1E44AF020B67CDE900BAD059 /* apng.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = apng.c; path = ../../m_misc.c; sourceTree = SOURCE_ROOT; };
|
||||
1E44AF030B67CDE900BAD059 /* apng.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = apng.h; path = ../../m_misc.h; sourceTree = SOURCE_ROOT; };
|
||||
1E44AF040B67CDE900BAD059 /* m_random.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = m_random.c; path = ../../m_random.c; sourceTree = SOURCE_ROOT; };
|
||||
1E44AF050B67CDE900BAD059 /* m_random.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = m_random.h; path = ../../m_random.h; sourceTree = SOURCE_ROOT; };
|
||||
1E44AF060B67CDE900BAD059 /* m_swap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = m_swap.h; path = ../../m_swap.h; sourceTree = SOURCE_ROOT; };
|
||||
|
|
@ -679,6 +682,8 @@
|
|||
1E44AEFF0B67CDE900BAD059 /* m_fixed.h */,
|
||||
1E44AF020B67CDE900BAD059 /* m_misc.c */,
|
||||
1E44AF030B67CDE900BAD059 /* m_misc.h */,
|
||||
1E44AF020B67CDE900BAD059 /* apng.c */,
|
||||
1E44AF030B67CDE900BAD059 /* apng.h */,
|
||||
676BB51C0E0DE06100C95963 /* m_queue.c */,
|
||||
676BB51D0E0DE06100C95963 /* m_queue.h */,
|
||||
1E44AF040B67CDE900BAD059 /* m_random.c */,
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue