diff --git a/.circleci/config.yml b/.circleci/config.yml index ca910568..c3674a9e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 diff --git a/libs/dll-binaries/i686/libgme.dll b/libs/dll-binaries/i686/libgme.dll index ddf8b0d8..9a31bc4d 100644 Binary files a/libs/dll-binaries/i686/libgme.dll and b/libs/dll-binaries/i686/libgme.dll differ diff --git a/libs/dll-binaries/x86_64/libgme.dll b/libs/dll-binaries/x86_64/libgme.dll index 2ba99450..598c2d71 100644 Binary files a/libs/dll-binaries/x86_64/libgme.dll and b/libs/dll-binaries/x86_64/libgme.dll differ diff --git a/libs/gme/CMakeLists.txt b/libs/gme/CMakeLists.txt index 8beee872..392b0185 100644 --- a/libs/gme/CMakeLists.txt +++ b/libs/gme/CMakeLists.txt @@ -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) diff --git a/libs/gme/changes.txt b/libs/gme/changes.txt index 62391ebb..034ba482 100644 --- a/libs/gme/changes.txt +++ b/libs/gme/changes.txt @@ -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. diff --git a/libs/gme/demo/basics.c b/libs/gme/demo/basics.c index 55178251..741574af 100644 --- a/libs/gme/demo/basics.c +++ b/libs/gme/demo/basics.c @@ -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; diff --git a/libs/gme/demo/cpp_basics.cpp b/libs/gme/demo/cpp_basics.cpp index 53fab418..5222fe27 100644 --- a/libs/gme/demo/cpp_basics.cpp +++ b/libs/gme/demo/cpp_basics.cpp @@ -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; diff --git a/libs/gme/gme.txt b/libs/gme/gme.txt index d9a2452c..5a7d2f56 100644 --- a/libs/gme/gme.txt +++ b/libs/gme/gme.txt @@ -1,10 +1,10 @@ -Game_Music_Emu 0.6.0 +Game_Music_Emu 0.6.2 -------------------- -Author : Shay Green -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 +Maintainer : Michael Pyne +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 -------- diff --git a/libs/gme/gme/CMakeLists.txt b/libs/gme/gme/CMakeLists.txt index 3c6464fc..534be8a8 100644 --- a/libs/gme/gme/CMakeLists.txt +++ b/libs/gme/gme/CMakeLists.txt @@ -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) diff --git a/libs/gme/gme/Data_Reader.cpp b/libs/gme/gme/Data_Reader.cpp index 5bbfbf55..f18928f4 100644 --- a/libs/gme/gme/Data_Reader.cpp +++ b/libs/gme/gme/Data_Reader.cpp @@ -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_ ) ) diff --git a/libs/gme/gme/Data_Reader.h b/libs/gme/gme/Data_Reader.h index acf571f6..6c22b678 100644 --- a/libs/gme/gme/Data_Reader.h +++ b/libs/gme/gme/Data_Reader.h @@ -129,6 +129,8 @@ private: }; #ifdef HAVE_ZLIB_H +#include + // 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 diff --git a/libs/gme/gme/Music_Emu.cpp b/libs/gme/gme/Music_Emu.cpp index 30b25dcf..942e86e2 100644 --- a/libs/gme/gme/Music_Emu.cpp +++ b/libs/gme/gme/Music_Emu.cpp @@ -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 diff --git a/libs/gme/gme/Music_Emu.h b/libs/gme/gme/Music_Emu.h index b96f4b61..d98f7ce7 100644 --- a/libs/gme/gme/Music_Emu.h +++ b/libs/gme/gme/Music_Emu.h @@ -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 ); diff --git a/libs/gme/gme/Nsfe_Emu.cpp b/libs/gme/gme/Nsfe_Emu.cpp index 824a1a24..55ac4688 100644 --- a/libs/gme/gme/Nsfe_Emu.cpp +++ b/libs/gme/gme/Nsfe_Emu.cpp @@ -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) ); diff --git a/libs/gme/gme/Spc_Cpu.cpp b/libs/gme/gme/Spc_Cpu.cpp index 90f60ed2..19aae113 100644 --- a/libs/gme/gme/Spc_Cpu.cpp +++ b/libs/gme/gme/Spc_Cpu.cpp @@ -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 diff --git a/libs/gme/gme/Spc_Cpu.h b/libs/gme/gme/Spc_Cpu.h index 4742e099..10c24509 100644 --- a/libs/gme/gme/Spc_Cpu.h +++ b/libs/gme/gme/Spc_Cpu.h @@ -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 ); diff --git a/libs/gme/gme/blargg_source.h b/libs/gme/gme/blargg_source.h index b011777a..b65afd30 100644 --- a/libs/gme/gme/blargg_source.h +++ b/libs/gme/gme/blargg_source.h @@ -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, ... ); diff --git a/libs/gme/gme/gme.cpp b/libs/gme/gme/gme.cpp index c05f25eb..47709840 100644 --- a/libs/gme/gme/gme.cpp +++ b/libs/gme/gme/gme.cpp @@ -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 ); } diff --git a/libs/gme/gme/gme.h b/libs/gme/gme/gme.h index 1f2a2d15..cb07061b 100644 --- a/libs/gme/gme/gme.h +++ b/libs/gme/gme/gme.h @@ -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 ********/ diff --git a/libs/gme/gme/libgme.pc.in b/libs/gme/gme/libgme.pc.in index 4f420d9e..49fd5b1d 100644 --- a/libs/gme/gme/libgme.pc.in +++ b/libs/gme/gme/libgme.pc.in @@ -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++ diff --git a/libs/gme/include/gme/gme.h b/libs/gme/include/gme/gme.h index 1f2a2d15..cb07061b 100644 --- a/libs/gme/include/gme/gme.h +++ b/libs/gme/include/gme/gme.h @@ -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 ********/ diff --git a/libs/gme/readme.txt b/libs/gme/readme.txt index 82a501db..4cfe5e7a 100644 --- a/libs/gme/readme.txt +++ b/libs/gme/readme.txt @@ -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 -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 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 diff --git a/libs/gme/win32/libgme.dll.a b/libs/gme/win32/libgme.dll.a index d56d8739..2c5e9585 100644 Binary files a/libs/gme/win32/libgme.dll.a and b/libs/gme/win32/libgme.dll.a differ diff --git a/libs/gme/win64/libgme.dll.a b/libs/gme/win64/libgme.dll.a index 38079dc2..8348f12d 100644 Binary files a/libs/gme/win64/libgme.dll.a and b/libs/gme/win64/libgme.dll.a differ diff --git a/src/Makefile.cfg b/src/Makefile.cfg index 1238050b..236d7ae2 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -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 diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 7516df2e..8e2a42de 100644 --- a/src/d_clisrv.c +++ b/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; @@ -2542,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 @@ -2725,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) { @@ -2756,6 +2766,42 @@ static void Command_Ban(void) } +static void Command_BanIP(void) +{ + if (COM_Argc() < 2) + { + CONS_Printf(M_GetText("banip : 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) @@ -3062,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); @@ -3316,6 +3363,8 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum) addedtogame = true; } + players[newplayernum].splitscreenindex = splitscreenplayer; + if (netgame) { if (server && cv_showjoinaddress.value) @@ -4353,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; @@ -4999,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; @@ -5019,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. @@ -5029,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); } } } @@ -5049,10 +5123,13 @@ 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 } @@ -5066,7 +5143,7 @@ static void UpdatePingTable(void) INT32 i; if (server) { - if (netgame && !(gametime % 255)) + 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++) diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 62bd8bc1..6615d67d 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -283,6 +283,8 @@ typedef struct tic_t jointime; + UINT8 splitscreenindex; + //player->mo stuff UINT8 hasmo; // Boolean @@ -450,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; @@ -519,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 diff --git a/src/d_net.h b/src/d_net.h index 9cc1bbd2..8e518e40 100644 --- a/src/d_net.h +++ b/src/d_net.h @@ -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 diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 438cdcd5..a8efd306 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -378,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}; @@ -435,6 +436,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}}; @@ -664,6 +673,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 diff --git a/src/d_netcmd.h b/src/d_netcmd.h index c590eee6..e0827013 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -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; diff --git a/src/d_player.h b/src/d_player.h index b430f20a..a5d73ec7 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -571,6 +571,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 diff --git a/src/dehacked.c b/src/dehacked.c index 11aed24d..e3db120f 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8134,89 +8134,136 @@ 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 + "SEPIA", // SKINCOLOR_SEPIA + "BEIGE", // SKINCOLOR_BEIGE + "BROWN", // SKINCOLOR_BROWN + "LEATHER", // SKINCOLOR_LEATHER + "SALMON", // SKINCOLOR_SALMON + "PINK", // SKINCOLOR_PINK + "ROSE", // SKINCOLOR_ROSE + "RUBY", // SKINCOLOR_RUBY + "RASPBERRY", // SKINCOLOR_RASPBERRY + "CHERRY", // SKINCOLOR_CHERRY + "RED", // SKINCOLOR_RED + "SCARLET", // SKINCOLOR_SCARLET + "CRIMSON", // SKINCOLOR_CRIMSON + "NOVA", // SKINCOLOR_NOVA + "KETCHUP", // SKINCOLOR_KETCHUP + "DAWN", // SKINCOLOR_DAWN + "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 + "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 + "ROBOHOOD", // SKINCOLOR_ROBOHOOD + "MOSS", // SKINCOLOR_MOSS + "MINT", // SKINCOLOR_MINT + "GREEN", // SKINCOLOR_GREEN + "PINETREE", // SKINCOLOR_PINETREE + "EMERALD", // SKINCOLOR_EMERALD + "SWAMP", // SKINCOLOR_SWAMP + "DREAM", // SKINCOLOR_DREAM + "ALGAE", // SKINCOLOR_ALGAE + "AQUA", // SKINCOLOR_AQUA + "TEAL", // SKINCOLOR_TEAL + "CYAN", // SKINCOLOR_CYAN + "JAWZ", // SKINCOLOR_JAWZ + "CERULEAN", // SKINCOLOR_CERULEAN + "NAVY", // SKINCOLOR_NAVY + "SLATE", // SKINCOLOR_SLATE + "STEEL", // SKINCOLOR_STEEL + "JET", // SKINCOLOR_JET + "SAPPHIRE", // SKINCOLOR_SAPPHIRE + "PERIWINKLE", // SKINCOLOR_PERIWINKLE + "BLUE", // SKINCOLOR_BLUE + "BLUEBERRY", // SKINCOLOR_BLUEBERRY + "PASTEL", // SKINCOLOR_PASTEL + "DUSK", // SKINCOLOR_DUSK + "PURPLE", // SKINCOLOR_PURPLE + "FUCHSIA", // SKINCOLOR_FUCHSIA + "TOXIC", // SKINCOLOR_TOXIC + "LAVENDER", // SKINCOLOR_LAVENDER + "BYZANTIUM", // SKINCOLOR_BYZANTIUM + "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, + // 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, + // Aqua Super + "ASUPER1", // SKINCOLOR_ASUPER1, + "ASUPER2", // SKINCOLOR_ASUPER2, + "ASUPER3", // SKINCOLOR_ASUPER3, + "ASUPER4", // SKINCOLOR_ASUPER4, + "ASUPER5" // SKINCOLOR_ASUPER5, }; static const char *const POWERS_LIST[] = { @@ -8254,6 +8301,7 @@ static const char *const POWERS_LIST[] = { "INGOOP" // In goop }; +#ifdef HAVE_BLUA static const char *const KARTSTUFF_LIST[] = { "POSITION", "OLDPOSITION", @@ -8337,6 +8385,7 @@ static const char *const KARTSTUFF_LIST[] = { "JAWZTARGETDELAY", "SPECTATEWAIT" }; +#endif static const char *const HUDITEMS_LIST[] = { "LIVESNAME", @@ -9042,20 +9091,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; } diff --git a/src/djgppdos/i_video.c b/src/djgppdos/i_video.c index 612c7221..7829acbb 100644 --- a/src/djgppdos/i_video.c +++ b/src/djgppdos/i_video.c @@ -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); diff --git a/src/doomdef.h b/src/doomdef.h index d538618e..b8e3174a 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -265,8 +265,11 @@ typedef enum SKINCOLOR_ROSE, SKINCOLOR_RUBY, SKINCOLOR_RASPBERRY, + SKINCOLOR_CHERRY, SKINCOLOR_RED, + SKINCOLOR_SCARLET, SKINCOLOR_CRIMSON, + SKINCOLOR_NOVA, SKINCOLOR_KETCHUP, SKINCOLOR_DAWN, SKINCOLOR_CREAMSICLE, @@ -277,14 +280,17 @@ typedef enum SKINCOLOR_TANGERINE, SKINCOLOR_PEACH, SKINCOLOR_CARAMEL, + SKINCOLOR_CREAM, SKINCOLOR_GOLD, SKINCOLOR_BRONZE, + SKINCOLOR_COPPER, SKINCOLOR_YELLOW, SKINCOLOR_MUSTARD, SKINCOLOR_OLIVE, SKINCOLOR_VOMIT, SKINCOLOR_GARDEN, SKINCOLOR_LIME, + SKINCOLOR_HANDHELD, SKINCOLOR_TEA, SKINCOLOR_PISTACHIO, SKINCOLOR_ROBOHOOD, @@ -295,6 +301,7 @@ typedef enum SKINCOLOR_EMERALD, SKINCOLOR_SWAMP, SKINCOLOR_DREAM, + SKINCOLOR_ALGAE, SKINCOLOR_AQUA, SKINCOLOR_TEAL, SKINCOLOR_CYAN, @@ -308,8 +315,11 @@ typedef enum SKINCOLOR_PERIWINKLE, SKINCOLOR_BLUE, SKINCOLOR_BLUEBERRY, + SKINCOLOR_PASTEL, SKINCOLOR_DUSK, SKINCOLOR_PURPLE, + SKINCOLOR_FUCHSIA, + SKINCOLOR_TOXIC, SKINCOLOR_LAVENDER, SKINCOLOR_BYZANTIUM, SKINCOLOR_POMEGRANATE, @@ -319,26 +329,69 @@ typedef enum 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, + + // 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, + + // Aqua Super + SKINCOLOR_ASUPER1, + SKINCOLOR_ASUPER2, + SKINCOLOR_ASUPER3, + SKINCOLOR_ASUPER4, + SKINCOLOR_ASUPER5, + MAXTRANSLATIONS } skincolors_t; diff --git a/src/g_game.c b/src/g_game.c index 3944c02a..003c11e9 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2357,6 +2357,7 @@ void G_PlayerReborn(INT32 player) UINT8 skincolor; INT32 skin; tic_t jointime; + UINT8 splitscreenindex; boolean spectator; INT16 bot; SINT8 pity; @@ -2380,6 +2381,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)); @@ -2476,6 +2478,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 @@ -4763,7 +4766,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; @@ -4777,8 +4781,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) { @@ -4788,7 +4792,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; @@ -4892,8 +4896,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) @@ -4910,6 +4915,7 @@ void G_ConsGhostTic(void) oldghost.x = READFIXED(demo_p); oldghost.y = READFIXED(demo_p); oldghost.z = READFIXED(demo_p); + syncleeway = 0; } else { @@ -4923,6 +4929,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++; @@ -4988,14 +4995,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")); diff --git a/src/hardware/hw_clip.c b/src/hardware/hw_clip.c index 6d120efe..2397ce08 100644 --- a/src/hardware/hw_clip.c +++ b/src/hardware/hw_clip.c @@ -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; diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index c45814bb..4fcef218 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -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); diff --git a/src/hardware/hw_main.h b/src/hardware/hw_main.h index 198780f9..6978856e 100644 --- a/src/hardware/hw_main.h +++ b/src/hardware/hw_main.h @@ -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; diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 84835389..0c4dfdce 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -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)*0.8)*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 diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 3d8f2383..94cca970 100644 --- a/src/hu_stuff.c +++ b/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 @@ -774,15 +795,15 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) cstart = "\x85"; // V_REDMAP else if (color <= SKINCOLOR_TANGERINE) cstart = "\x87"; // V_ORANGEMAP - else if (color <= SKINCOLOR_CARAMEL) + else if (color <= SKINCOLOR_CREAM) cstart = "\x8f"; // V_PEACHMAP - else if (color <= SKINCOLOR_BRONZE) + else if (color <= SKINCOLOR_COPPER) 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) + else if (color <= SKINCOLOR_ALGAE || color == SKINCOLOR_LIME || color == SKINCOLOR_HANDHELD) cstart = "\x83"; // V_GREENMAP else if (color <= SKINCOLOR_NAVY || color == SKINCOLOR_SAPPHIRE) cstart = "\x88"; // V_SKYMAP @@ -1612,9 +1633,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 +2199,7 @@ static void HU_DrawSongCredits(void) V_DrawRightAlignedThinString(cursongcredit.x, y, V_ALLOWLOWERCASE|V_6WIDTHSPACE|V_SNAPTOLEFT|(cursongcredit.trans<= 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); } // diff --git a/src/hu_stuff.h b/src/hu_stuff.h index f1ecb2ff..0f316bc7 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -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); diff --git a/src/k_kart.c b/src/k_kart.c index 468f5438..f5fe06bc 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -43,187 +43,214 @@ // These should be within 14 characters to fit on the character select screen const char *KartColor_Names[MAXSKINCOLORS] = { - "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 - "Robo-Hood", // 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 + "Sepia", // SKINCOLOR_SEPIA + "Beige", // SKINCOLOR_BEIGE + "Brown", // SKINCOLOR_BROWN + "Leather", // SKINCOLOR_LEATHER + "Salmon", // SKINCOLOR_SALMON + "Pink", // SKINCOLOR_PINK + "Rose", // SKINCOLOR_ROSE + "Ruby", // SKINCOLOR_RUBY + "Raspberry", // SKINCOLOR_RASPBERRY + "Cherry", // SKINCOLOR_CHERRY + "Red", // SKINCOLOR_RED + "Scarlet", // SKINCOLOR_SCARLET + "Crimson", // SKINCOLOR_CRIMSON + "Nova", // SKINCOLOR_NOVA + "Ketchup", // SKINCOLOR_KETCHUP + "Dawn", // SKINCOLOR_DAWN + "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 + "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 + "Robo-Hood", // SKINCOLOR_ROBOHOOD + "Moss", // SKINCOLOR_MOSS + "Mint", // SKINCOLOR_MINT + "Green", // SKINCOLOR_GREEN + "Pinetree", // SKINCOLOR_PINETREE + "Emerald", // SKINCOLOR_EMERALD + "Swamp", // SKINCOLOR_SWAMP + "Dream", // SKINCOLOR_DREAM + "Algae", // SKINCOLOR_ALGAE + "Aqua", // SKINCOLOR_AQUA + "Teal", // SKINCOLOR_TEAL + "Cyan", // SKINCOLOR_CYAN + "Jawz", // SKINCOLOR_JAWZ + "Cerulean", // SKINCOLOR_CERULEAN + "Navy", // SKINCOLOR_NAVY + "Slate", // SKINCOLOR_SLATE + "Steel", // SKINCOLOR_STEEL + "Jet", // SKINCOLOR_JET + "Sapphire", // SKINCOLOR_SAPPHIRE + "Periwinkle", // SKINCOLOR_PERIWINKLE + "Blue", // SKINCOLOR_BLUE + "Blueberry", // SKINCOLOR_BLUEBERRY + "Pastel", // SKINCOLOR_PASTEL + "Dusk", // SKINCOLOR_DUSK + "Purple", // SKINCOLOR_PURPLE + "Fuchsia", // SKINCOLOR_FUCHSIA + "Toxic", // SKINCOLOR_TOXIC + "Lavender", // SKINCOLOR_LAVENDER + "Byzantium", // SKINCOLOR_BYZANTIUM + "Pomegranate", // SKINCOLOR_POMEGRANATE + "Lilac" // SKINCOLOR_LILAC }; // Color_Opposite replacement; frame setting has not been changed from 8 for most, should be done later const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] = { - SKINCOLOR_NONE,8, // 00 // SKINCOLOR_NONE - SKINCOLOR_BLACK,8, // 01 // SKINCOLOR_WHITE - SKINCOLOR_NICKEL,8, // 02 // SKINCOLOR_SILVER - SKINCOLOR_GREY,8, // 03 // SKINCOLOR_GREY - SKINCOLOR_SILVER,8, // 04 // SKINCOLOR_NICKEL - SKINCOLOR_WHITE,8, // 05 // SKINCOLOR_BLACK - SKINCOLOR_LEATHER,6, // 06 // SKINCOLOR_SEPIA - SKINCOLOR_BROWN,2, // 07 // SKINCOLOR_BEIGE - SKINCOLOR_BEIGE,8, // 08 // SKINCOLOR_BROWN - SKINCOLOR_SEPIA,8, // 09 // SKINCOLOR_LEATHER - SKINCOLOR_TEA,8, // 10 // SKINCOLOR_SALMON - SKINCOLOR_PISTACHIO,8, // 11 // SKINCOLOR_PINK - SKINCOLOR_MOSS,8, // 12 // SKINCOLOR_ROSE - SKINCOLOR_SAPPHIRE,8, // 13 // SKINCOLOR_RUBY - SKINCOLOR_MINT,8, // 14 // SKINCOLOR_RASPBERRY - SKINCOLOR_GREEN,6, // 15 // SKINCOLOR_RED - SKINCOLOR_PINETREE,6, // 16 // SKINCOLOR_CRIMSON - SKINCOLOR_MUSTARD,10, // 17 // SKINCOLOR_KETCHUP - SKINCOLOR_DUSK,8, // 18 // SKINCOLOR_DAWN - SKINCOLOR_PERIWINKLE,8, // 19 // SKINCOLOR_CREAMSICLE - SKINCOLOR_BLUE,8, // 20 // SKINCOLOR_ORANGE - SKINCOLOR_BLUEBERRY,8, // 21 // SKINCOLOR_PUMPKIN - SKINCOLOR_NAVY,6, // 22 // SKINCOLOR_ROSEWOOD - SKINCOLOR_JET,8, // 23 // SKINCOLOR_BURGUNDY - SKINCOLOR_LIME,8, // 24 // SKINCOLOR_TANGERINE - SKINCOLOR_CYAN,8, // 25 // SKINCOLOR_PEACH - SKINCOLOR_CERULEAN,8, // 26 // SKINCOLOR_CARAMEL - SKINCOLOR_SLATE,8, // 27 // SKINCOLOR_GOLD - SKINCOLOR_STEEL,8, // 28 // SKINCOLOR_BRONZE - SKINCOLOR_AQUA,8, // 29 // SKINCOLOR_YELLOW - SKINCOLOR_KETCHUP,8, // 30 // SKINCOLOR_MUSTARD - SKINCOLOR_TEAL,8, // 31 // SKINCOLOR_OLIVE - SKINCOLOR_ROBOHOOD,8, // 32 // SKINCOLOR_VOMIT - SKINCOLOR_LAVENDER,6, // 33 // SKINCOLOR_GARDEN - SKINCOLOR_TANGERINE,8, // 34 // SKINCOLOR_LIME - SKINCOLOR_SALMON,8, // 35 // SKINCOLOR_TEA - SKINCOLOR_PINK,6, // 36 // SKINCOLOR_PISTACHIO - SKINCOLOR_VOMIT,8, // 37 // SKINCOLOR_ROBOHOOD - SKINCOLOR_ROSE,8, // 38 // SKINCOLOR_MOSS - SKINCOLOR_RASPBERRY,8, // 39 // SKINCOLOR_MINT - SKINCOLOR_RED,8, // 40 // SKINCOLOR_GREEN - SKINCOLOR_CRIMSON,8, // 41 // SKINCOLOR_PINETREE - SKINCOLOR_PURPLE,8, // 42 // SKINCOLOR_EMERALD - SKINCOLOR_BYZANTIUM,8, // 43 // SKINCOLOR_SWAMP - SKINCOLOR_POMEGRANATE,8, // 44 // SKINCOLOR_DREAM - SKINCOLOR_YELLOW,8, // 45 // SKINCOLOR_AQUA - SKINCOLOR_OLIVE,8, // 46 // SKINCOLOR_TEAL - SKINCOLOR_PEACH,8, // 47 // SKINCOLOR_CYAN - SKINCOLOR_LILAC,10, // 48 // SKINCOLOR_JAWZ - SKINCOLOR_CARAMEL,8, // 49 // SKINCOLOR_CERULEAN - SKINCOLOR_ROSEWOOD,8, // 50 // SKINCOLOR_NAVY - SKINCOLOR_GOLD,10, // 51 // SKINCOLOR_SLATE - SKINCOLOR_BRONZE,10, // 52 // SKINCOLOR_STEEL - SKINCOLOR_BURGUNDY,8, // 53 // SKINCOLOR_JET - SKINCOLOR_RUBY,6, // 54 // SKINCOLOR_SAPPHIRE - SKINCOLOR_CREAMSICLE,8, // 55 // SKINCOLOR_PERIWINKLE - SKINCOLOR_ORANGE,8, // 56 // SKINCOLOR_BLUE - SKINCOLOR_PUMPKIN,8, // 57 // SKINCOLOR_BLUEBERRY - SKINCOLOR_DAWN,6, // 58 // SKINCOLOR_DUSK - SKINCOLOR_EMERALD,8, // 59 // SKINCOLOR_PURPLE - SKINCOLOR_GARDEN,6, // 60 // SKINCOLOR_LAVENDER - SKINCOLOR_SWAMP,8, // 61 // SKINCOLOR_BYZANTIUM - SKINCOLOR_DREAM,8, // 62 // SKINCOLOR_POMEGRANATE - SKINCOLOR_JAWZ,6 // 63 // SKINCOLOR_LILAC + SKINCOLOR_NONE,8, // SKINCOLOR_NONE + SKINCOLOR_BLACK,8, // SKINCOLOR_WHITE + SKINCOLOR_NICKEL,8, // SKINCOLOR_SILVER + SKINCOLOR_GREY,8, // SKINCOLOR_GREY + SKINCOLOR_SILVER,8, // SKINCOLOR_NICKEL + SKINCOLOR_WHITE,8, // SKINCOLOR_BLACK + SKINCOLOR_LEATHER,6, // SKINCOLOR_SEPIA + SKINCOLOR_BROWN,2, // SKINCOLOR_BEIGE + SKINCOLOR_BEIGE,8, // SKINCOLOR_BROWN + SKINCOLOR_SEPIA,8, // SKINCOLOR_LEATHER + SKINCOLOR_TEA,8, // SKINCOLOR_SALMON + SKINCOLOR_PISTACHIO,8, // SKINCOLOR_PINK + SKINCOLOR_MOSS,8, // SKINCOLOR_ROSE + SKINCOLOR_SAPPHIRE,8, // SKINCOLOR_RUBY + SKINCOLOR_MINT,8, // SKINCOLOR_RASPBERRY + SKINCOLOR_HANDHELD,10, // SKINCOLOR_CHERRY + SKINCOLOR_GREEN,6, // SKINCOLOR_RED + SKINCOLOR_PINETREE,6, // SKINCOLOR_SCARLET + SKINCOLOR_TOXIC,8, // SKINCOLOR_CRIMSON + SKINCOLOR_ALGAE,10, // SKINCOLOR_NOVA + SKINCOLOR_MUSTARD,10, // SKINCOLOR_KETCHUP + SKINCOLOR_DUSK,8, // SKINCOLOR_DAWN + SKINCOLOR_PERIWINKLE,8, // SKINCOLOR_CREAMSICLE + SKINCOLOR_BLUE,8, // SKINCOLOR_ORANGE + SKINCOLOR_BLUEBERRY,8, // SKINCOLOR_PUMPKIN + SKINCOLOR_NAVY,6, // SKINCOLOR_ROSEWOOD + SKINCOLOR_JET,8, // SKINCOLOR_BURGUNDY + SKINCOLOR_LIME,8, // SKINCOLOR_TANGERINE + SKINCOLOR_CYAN,8, // SKINCOLOR_PEACH + SKINCOLOR_CERULEAN,8, // SKINCOLOR_CARAMEL + SKINCOLOR_COPPER,10, // SKINCOLOR_CREAM + SKINCOLOR_SLATE,8, // SKINCOLOR_GOLD + SKINCOLOR_STEEL,8, // SKINCOLOR_BRONZE + SKINCOLOR_CREAM,6, // SKINCOLOR_COPPER + SKINCOLOR_AQUA,8, // SKINCOLOR_YELLOW + SKINCOLOR_KETCHUP,8, // SKINCOLOR_MUSTARD + SKINCOLOR_TEAL,8, // SKINCOLOR_OLIVE + SKINCOLOR_ROBOHOOD,8, // SKINCOLOR_VOMIT + SKINCOLOR_LAVENDER,6, // SKINCOLOR_GARDEN + SKINCOLOR_TANGERINE,8, // SKINCOLOR_LIME + SKINCOLOR_CHERRY,8, // SKINCOLOR_HANDHELD + SKINCOLOR_SALMON,8, // SKINCOLOR_TEA + SKINCOLOR_PINK,6, // SKINCOLOR_PISTACHIO + SKINCOLOR_VOMIT,8, // SKINCOLOR_ROBOHOOD + SKINCOLOR_ROSE,8, // SKINCOLOR_MOSS + SKINCOLOR_RASPBERRY,8, // SKINCOLOR_MINT + SKINCOLOR_RED,8, // SKINCOLOR_GREEN + SKINCOLOR_SCARLET,8, // SKINCOLOR_PINETREE + SKINCOLOR_PURPLE,8, // SKINCOLOR_EMERALD + SKINCOLOR_BYZANTIUM,8, // SKINCOLOR_SWAMP + SKINCOLOR_POMEGRANATE,8, // SKINCOLOR_DREAM + SKINCOLOR_NOVA,10, // SKINCOLOR_ALGAE + SKINCOLOR_YELLOW,8, // SKINCOLOR_AQUA + SKINCOLOR_OLIVE,8, // SKINCOLOR_TEAL + SKINCOLOR_PEACH,8, // SKINCOLOR_CYAN + SKINCOLOR_LILAC,10, // SKINCOLOR_JAWZ + SKINCOLOR_CARAMEL,8, // SKINCOLOR_CERULEAN + SKINCOLOR_ROSEWOOD,8, // SKINCOLOR_NAVY + SKINCOLOR_GOLD,10, // SKINCOLOR_SLATE + SKINCOLOR_BRONZE,10, // SKINCOLOR_STEEL + SKINCOLOR_BURGUNDY,8, // SKINCOLOR_JET + SKINCOLOR_RUBY,6, // SKINCOLOR_SAPPHIRE + SKINCOLOR_CREAMSICLE,8, // SKINCOLOR_PERIWINKLE + SKINCOLOR_ORANGE,8, // SKINCOLOR_BLUE + SKINCOLOR_PUMPKIN,8, // SKINCOLOR_BLUEBERRY + SKINCOLOR_FUCHSIA,11, // SKINCOLOR_PASTEL + SKINCOLOR_DAWN,6, // SKINCOLOR_DUSK + SKINCOLOR_EMERALD,8, // SKINCOLOR_PURPLE + SKINCOLOR_PASTEL,11, // SKINCOLOR_FUCHSIA + SKINCOLOR_CRIMSON,8, // SKINCOLOR_TOXIC + SKINCOLOR_GARDEN,6, // SKINCOLOR_LAVENDER + SKINCOLOR_SWAMP,8, // SKINCOLOR_BYZANTIUM + SKINCOLOR_DREAM,8, // SKINCOLOR_POMEGRANATE + SKINCOLOR_JAWZ,6 // SKINCOLOR_LILAC }; -UINT8 colortranslations[MAXSKINCOLORS][16] = { +UINT8 colortranslations[MAXTRANSLATIONS][16] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // SKINCOLOR_NONE - {120, 120, 120, 120, 0, 1, 3, 4, 6, 7, 10, 14, 18, 22, 25, 28}, // SKINCOLOR_WHITE - { 0, 1, 2, 4, 5, 7, 8, 10, 13, 15, 18, 20, 23, 25, 28, 30}, // SKINCOLOR_SILVER + {120, 120, 120, 120, 0, 2, 5, 8, 9, 11, 14, 17, 20, 22, 25, 28}, // SKINCOLOR_WHITE + { 0, 1, 2, 3, 5, 7, 9, 12, 13, 15, 18, 20, 23, 25, 27, 30}, // SKINCOLOR_SILVER { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31}, // SKINCOLOR_GREY - { 12, 14, 16, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}, // SKINCOLOR_NICKEL - { 16, 17, 19, 21, 22, 24, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31}, // SKINCOLOR_BLACK + { 3, 5, 8, 11, 15, 17, 19, 21, 23, 24, 25, 26, 27, 29, 30, 31}, // SKINCOLOR_NICKEL + { 4, 7, 11, 15, 20, 22, 24, 27, 28, 28, 28, 29, 29, 30, 30, 31}, // SKINCOLOR_BLACK { 0, 1, 3, 5, 7, 9, 34, 36, 38, 40, 42, 44, 60, 61, 62, 63}, // SKINCOLOR_SEPIA - { 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}, // SKINCOLOR_BEIGE - { 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}, // SKINCOLOR_BROWN - { 51, 52, 53, 55, 56, 57, 58, 60, 61, 63, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_LEATHER - {120, 120, 120, 121, 121, 122, 122, 123, 124, 125, 126, 128, 129, 131, 133, 135}, // SKINCOLOR_SALMON + {120, 65, 67, 69, 32, 34, 36, 38, 40, 42, 44, 45, 46, 47, 62, 63}, // SKINCOLOR_BEIGE + { 67, 70, 73, 76, 48, 49, 51, 53, 54, 56, 58, 59, 61, 63, 29, 30}, // SKINCOLOR_BROWN + { 72, 76, 48, 51, 53, 55, 57, 59, 61, 63, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_LEATHER + {120, 120, 120, 121, 121, 122, 123, 124, 126, 127, 129, 131, 133, 135, 137, 139}, // SKINCOLOR_SALMON {120, 121, 121, 122, 144, 145, 146, 147, 148, 149, 150, 151, 134, 136, 138, 140}, // SKINCOLOR_PINK {144, 145, 146, 147, 148, 149, 150, 151, 134, 135, 136, 137, 138, 139, 140, 141}, // SKINCOLOR_ROSE - {121, 122, 145, 146, 147, 149, 131, 132, 133, 134, 135, 197, 197, 198, 199, 255}, // SKINCOLOR_RUBY - {120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 133, 134, 136, 137, 139}, // SKINCOLOR_RASPBERRY - {125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140}, // SKINCOLOR_RED - {130, 131, 132, 133, 134, 136, 137, 138, 139, 139, 140, 140, 141, 141, 142, 143}, // SKINCOLOR_CRIMSON + {120, 121, 144, 145, 147, 149, 132, 133, 134, 136, 198, 198, 199, 255, 30, 31}, // SKINCOLOR_RUBY + {120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 134, 136, 137, 139, 140}, // SKINCOLOR_RASPBERRY + {120, 65, 67, 69, 71, 124, 125, 127, 132, 133, 135, 136, 138, 139, 140, 141}, // SKINCOLOR_CHERRY + {122, 123, 124, 126, 129, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142}, // SKINCOLOR_RED + {123, 125, 128, 131, 133, 135, 136, 138, 140, 140, 141, 141, 142, 142, 143, 31}, // SKINCOLOR_SCARLET + {123, 124, 126, 128, 132, 135, 137, 63, 28, 28, 28, 29, 29, 30, 30, 31}, // SKINCOLOR_CRIMSON + { 99, 113, 113, 84, 85, 87, 126, 128, 130, 196, 197, 198, 199, 240, 243, 246}, // SKINCOLOR_NOVA {104, 113, 113, 85, 86, 88, 128, 129, 131, 133, 134, 136, 138, 139, 141, 143}, // SKINCOLOR_KETCHUP {120, 121, 122, 123, 124, 147, 147, 148, 90, 91, 92, 93, 94, 95, 152, 154}, // SKINCOLOR_DAWN {120, 120, 80, 80, 81, 82, 83, 83, 84, 85, 86, 88, 89, 91, 93, 95}, // SKINCOLOR_CREAMSICLE { 80, 81, 82, 83, 84, 85, 86, 88, 89, 91, 94, 95, 154, 156, 158, 159}, // SKINCOLOR_ORANGE - { 84, 85, 86, 87, 88, 90, 92, 93, 94, 95, 152, 153, 154, 156, 157, 159}, // SKINCOLOR_PUMPKIN - { 90, 91, 92, 93, 94, 152, 153, 154, 155, 156, 157, 158, 159, 139, 141, 143}, // SKINCOLOR_ROSEWOOD - { 94, 95, 152, 153, 154, 156, 157, 159, 141, 141, 141, 142, 142, 143, 143, 31}, // SKINCOLOR_BURGUNDY + { 82, 83, 84, 85, 87, 89, 90, 92, 94, 152, 153, 155, 157, 159, 141, 142}, // SKINCOLOR_PUMPKIN + { 83, 85, 88, 90, 92, 94, 152, 153, 154, 156, 157, 159, 140, 141, 142, 143}, // SKINCOLOR_ROSEWOOD + { 84, 86, 89, 91, 152, 154, 155, 157, 158, 159, 140, 141, 142, 143, 31, 31}, // SKINCOLOR_BURGUNDY { 98, 98, 112, 112, 113, 113, 84, 85, 87, 89, 91, 93, 95, 153, 156, 159}, // SKINCOLOR_TANGERINE - { 64, 65, 67, 68, 70, 71, 73, 74, 76, 77, 79, 48, 50, 53, 56, 59}, // SKINCOLOR_PEACH + {120, 80, 66, 70, 72, 76, 148, 149, 150, 151, 153, 154, 156, 61, 62, 63}, // SKINCOLOR_PEACH { 64, 66, 68, 70, 72, 74, 76, 78, 48, 50, 52, 54, 56, 58, 60, 62}, // SKINCOLOR_CARAMEL + {120, 120, 96, 96, 97, 82, 84, 77, 50, 54, 57, 59, 61, 63, 29, 31}, // SKINCOLOR_CREAM {112, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119}, // SKINCOLOR_GOLD {112, 113, 114, 115, 116, 117, 118, 119, 156, 157, 158, 159, 141, 141, 142, 143}, // SKINCOLOR_BRONZE + {120, 99, 113, 114, 116, 117, 119, 61, 63, 28, 28, 29, 29, 30, 30, 31}, // SKINCOLOR_COPPER { 96, 97, 98, 100, 101, 102, 104, 113, 114, 115, 116, 117, 118, 119, 156, 159}, // SKINCOLOR_YELLOW { 96, 98, 99, 112, 113, 114, 114, 106, 106, 107, 107, 108, 108, 109, 110, 111}, // SKINCOLOR_MUSTARD {105, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 31}, // SKINCOLOR_OLIVE {121, 144, 145, 72, 73, 84, 114, 115, 107, 108, 109, 183, 223, 207, 30, 246}, // SKINCOLOR_VOMIT { 98, 99, 112, 101, 113, 114, 106, 179, 180, 180, 181, 182, 183, 173, 174, 175}, // SKINCOLOR_GARDEN { 96, 97, 99, 100, 102, 104, 160, 162, 164, 166, 168, 171, 223, 223, 207, 31}, // SKINCOLOR_LIME + { 98, 104, 105, 105, 106, 167, 168, 169, 170, 171, 172, 173, 174, 175, 30, 31}, // SKINCOLOR_HANDHELD {120, 120, 176, 176, 176, 177, 177, 178, 178, 179, 179, 180, 180, 181, 182, 183}, // SKINCOLOR_TEA {120, 120, 176, 176, 177, 177, 178, 179, 165, 166, 167, 168, 169, 170, 171, 172}, // SKINCOLOR_PISTACHIO - {176, 176, 177, 178, 165, 166, 167, 167, 168, 169, 182, 182, 182, 183, 183, 183}, // SKINCOLOR_ROBOHOOD + {120, 176, 178, 165, 167, 168, 169, 182, 182, 171, 171, 172, 173, 174, 175, 30}, // SKINCOLOR_ROBOHOOD {178, 178, 178, 179, 179, 180, 181, 182, 183, 172, 172, 173, 173, 174, 174, 175}, // SKINCOLOR_MOSS {120, 176, 176, 176, 177, 163, 164, 165, 167, 221, 221, 222, 223, 207, 207, 31}, // SKINCOLOR_MINT {160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175}, // SKINCOLOR_GREEN - {160, 161, 162, 164, 165, 167, 169, 170, 171, 171, 172, 173, 174, 175, 30, 31}, // SKINCOLOR_PINETREE + {161, 163, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 30, 30, 31}, // SKINCOLOR_PINETREE {160, 184, 184, 185, 185, 186, 186, 187, 187, 188, 188, 189, 189, 190, 191, 175}, // SKINCOLOR_EMERALD - {186, 187, 188, 188, 188, 189, 189, 190, 190, 191, 175, 175, 30, 30, 31, 31}, // SKINCOLOR_SWAMP + {160, 184, 185, 186, 187, 188, 189, 190, 191, 191, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_SWAMP {120, 120, 80, 80, 81, 177, 162, 164, 228, 228, 204, 204, 205, 205, 206, 207}, // SKINCOLOR_DREAM + {208, 209, 210, 211, 213, 220, 216, 167, 168, 188, 188, 189, 190, 191, 30, 31}, // SKINCOLOR_ALGAE {120, 208, 208, 210, 212, 214, 220, 220, 220, 221, 221, 222, 222, 223, 223, 191}, // SKINCOLOR_AQUA {210, 213, 220, 220, 220, 216, 216, 221, 221, 221, 222, 222, 223, 223, 191, 31}, // SKINCOLOR_TEAL {120, 120, 208, 208, 209, 210, 211, 212, 213, 215, 216, 217, 218, 219, 222, 223}, // SKINCOLOR_CYAN @@ -234,27 +261,65 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = { {120, 200, 200, 201, 201, 202, 202, 203, 203, 204, 204, 205, 205, 206, 207, 31}, // SKINCOLOR_STEEL {225, 226, 227, 228, 229, 205, 205, 206, 207, 207, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_JET {208, 209, 211, 213, 215, 217, 229, 230, 232, 234, 236, 238, 240, 242, 244, 246}, // SKINCOLOR_SAPPHIRE - {120, 224, 225, 226, 226, 227, 228, 228, 229, 230, 231, 234, 235, 237, 239, 241}, // SKINCOLOR_PERIWINKLE - {224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239}, // SKINCOLOR_BLUE - {228, 229, 230, 231, 232, 233, 234, 235, 237, 238, 239, 240, 242, 243, 244, 245}, // SKINCOLOR_BLUEBERRY - {192, 192, 248, 249, 250, 251, 204, 204, 205, 205, 206, 206, 207, 29, 30, 31}, // SKINCOLOR_DUSK - {192, 192, 192, 193, 193, 194, 194, 195, 195, 196, 196, 197, 197, 198, 198, 199}, // SKINCOLOR_PURPLE - {248, 248, 248, 249, 249, 250, 250, 251, 251, 252, 252, 253, 253, 254, 254, 255}, // SKINCOLOR_LAVENDER - {192, 248, 249, 250, 251, 252, 253, 254, 255, 255, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_BYZANTIUM + {120, 120, 224, 225, 226, 202, 227, 228, 229, 230, 231, 233, 235, 237, 239, 241}, // SKINCOLOR_PERIWINKLE + {224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 235, 236, 238, 242, 244, 246}, // SKINCOLOR_BLUE + {226, 228, 229, 230, 232, 233, 235, 237, 239, 240, 242, 244, 246, 31, 31, 31}, // SKINCOLOR_BLUEBERRY + {120, 208, 209, 210, 211, 226, 202, 249, 194, 195, 196, 197, 198, 199, 255, 30}, // SKINCOLOR_PASTEL + {121, 145, 192, 249, 250, 251, 204, 204, 205, 205, 206, 206, 207, 29, 30, 31}, // SKINCOLOR_DUSK + {121, 145, 192, 192, 193, 194, 195, 196, 196, 197, 197, 198, 198, 199, 30, 31}, // SKINCOLOR_PURPLE + {120, 122, 124, 125, 126, 150, 196, 197, 198, 198, 199, 199, 240, 242, 244, 246}, // SKINCOLOR_FUCHSIA + {120, 120, 176, 176, 177, 6, 8, 10, 249, 250, 196, 197, 198, 199, 143, 31}, // SKINCOLOR_TOXIC + {121, 145, 192, 248, 249, 250, 251, 252, 252, 253, 253, 254, 254, 255, 30, 31}, // SKINCOLOR_LAVENDER + {144, 248, 249, 250, 251, 252, 253, 254, 255, 255, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_BYZANTIUM {144, 145, 146, 147, 148, 149, 150, 251, 251, 252, 252, 253, 254, 255, 29, 30}, // SKINCOLOR_POMEGRANATE {120, 120, 120, 121, 121, 122, 122, 123, 192, 248, 249, 250, 251, 252, 253, 254}, // SKINCOLOR_LILAC - /* Removed Colours - {120, 121, 123, 124, 126, 127, 129, 130, 132, 133, 135, 136, 138, 139, 141, 143}, // old SKINCOLOR_RUBY, removed for other colors - {224, 225, 226, 228, 229, 231, 232, 234, 235, 237, 238, 240, 241, 243, 244, 246}, // old SKINCOLOR_SAPPHIRE, removed for other colors - { 72, 73, 74, 75, 76, 77, 78, 79, 48, 49, 50, 51, 52, 53, 54, 55}, // old SKINCOLOR_CARAMEL, new Caramel was previously Shiny Caramel - {215, 216, 217, 218, 204, 205, 206, 237, 238, 239, 240, 241, 242, 243, 244, 245}, // old SKINCOLOR_NAVY, too similar to Jet - { 80, 81, 83, 85, 86, 88, 90, 91, 93, 95, 152, 153, 154, 156, 157, 159}, // SKINCOLOR_AMBER, removed for other colors - {160, 160, 160, 184, 184, 184, 185, 185, 185, 186, 187, 187, 188, 188, 189, 190}, // SKINCOLOR_JADE, removed for other colors - {224, 225, 226, 212, 213, 213, 214, 215, 220, 221, 172, 222, 173, 223, 174, 175}, // SKINCOLOR_FROST, merged into Aqua - { 96, 97, 99, 100, 102, 104, 105, 105, 106, 107, 107, 108, 109, 109, 110, 111}, // SKINCOLOR_CANARY, replaced with Mustard - {192, 193, 194, 195, 196, 197, 198, 199, 255, 255, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_INDIGO, too similar to Byzantium - { 1, 145, 125, 73, 83, 114, 106, 180, 187, 168, 219, 205, 236, 206, 199, 255}, // SKINCOLOR_RAINBOW, is Vomit 2.0 - */ + // MAXSKINCOLORS + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 96, 100, 104, 113, 116, 119}, // SKINCOLOR_SUPER1 + {120, 120, 120, 120, 120, 120, 120, 120, 96, 98, 101, 104, 113, 115, 117, 119}, // SKINCOLOR_SUPER2 + {120, 120, 120, 120, 120, 120, 96, 98, 100, 102, 104, 113, 114, 116, 117, 119}, // SKINCOLOR_SUPER3 + {120, 120, 120, 120, 96, 97, 99, 100, 102, 104, 113, 114, 115, 116, 117, 119}, // SKINCOLOR_SUPER4 + {120, 120, 96, 120, 120, 120, 120, 120, 104, 113, 114, 115, 116, 117, 118, 119}, // SKINCOLOR_SUPER5 + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 80, 82, 85, 115, 117, 119}, // SKINCOLOR_TSUPER1 + {120, 120, 120, 120, 120, 120, 120, 120, 80, 81, 83, 85, 115, 116, 117, 119}, // SKINCOLOR_TSUPER2 + {120, 120, 120, 120, 120, 120, 80, 81, 82, 83, 85, 115, 116, 117, 118, 119}, // SKINCOLOR_TSUPER3 + {120, 120, 120, 120, 80, 81, 82, 83, 84, 85, 115, 115, 116, 117, 118, 119}, // SKINCOLOR_TSUPER4 + {120, 120, 80, 80, 81, 82, 83, 84, 85, 115, 115, 116, 117, 117, 118, 119}, // SKINCOLOR_TSUPER5 + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 121, 123, 125, 127, 129, 132}, // SKINCOLOR_KSUPER1 + {120, 120, 120, 120, 120, 120, 120, 120, 121, 122, 124, 125, 127, 128, 130, 132}, // SKINCOLOR_KSUPER2 + {120, 120, 120, 120, 120, 120, 121, 122, 123, 124, 125, 127, 128, 129, 130, 132}, // SKINCOLOR_KSUPER3 + {120, 120, 120, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132}, // SKINCOLOR_KSUPER4 + {120, 120, 121, 121, 122, 123, 124, 125, 126, 126, 127, 128, 129, 130, 131, 132}, // SKINCOLOR_KSUPER5 + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 0, 122, 124, 248, 251, 255}, // SKINCOLOR_PSUPER1 + {120, 120, 120, 120, 120, 120, 120, 120, 0, 121, 122, 124, 248, 250, 252, 255}, // SKINCOLOR_PSUPER2 + {120, 120, 120, 120, 120, 120, 0, 121, 122, 123, 124, 248, 249, 251, 253, 255}, // SKINCOLOR_PSUPER3 + {120, 120, 120, 120, 0, 121, 122, 123, 124, 248, 249, 250, 251, 252, 253, 255}, // SKINCOLOR_PSUPER4 + {120, 120, 0, 121, 122, 123, 124, 248, 248, 249, 250, 251, 252, 253, 254, 255}, // SKINCOLOR_PSUPER5 + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 224, 225, 227, 228, 230, 232}, // SKINCOLOR_BSUPER1 + {120, 120, 120, 120, 120, 120, 120, 120, 224, 225, 226, 227, 228, 229, 230, 232}, // SKINCOLOR_BSUPER2 + {120, 120, 120, 120, 120, 120, 224, 224, 225, 226, 227, 228, 229, 230, 231, 232}, // SKINCOLOR_BSUPER3 + {120, 120, 120, 120, 224, 224, 225, 226, 226, 227, 228, 229, 229, 230, 231, 232}, // SKINCOLOR_BSUPER4 + {120, 120, 224, 224, 225, 225, 226, 227, 227, 228, 228, 229, 230, 230, 231, 232}, // SKINCOLOR_BSUPER5 + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 176, 160, 163, 167, 171, 175}, // SKINCOLOR_GSUPER1 + {120, 120, 120, 120, 120, 120, 120, 120, 176, 176, 160, 163, 166, 169, 172, 175}, // SKINCOLOR_GSUPER2 + {120, 120, 120, 120, 120, 120, 176, 176, 160, 162, 164, 166, 168, 170, 172, 175}, // SKINCOLOR_GSUPER3 + {120, 120, 120, 120, 176, 176, 176, 160, 161, 163, 165, 167, 169, 171, 173, 175}, // SKINCOLOR_GSUPER4 + {120, 120, 176, 176, 176, 160, 161, 163, 164, 166, 167, 169, 170, 172, 173, 175}, // SKINCOLOR_GSUPER5 + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120}, // SKINCOLOR_WSUPER1 + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 0, 4, 9}, // SKINCOLOR_WSUPER2 + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 0, 2, 4, 6, 8, 11}, // SKINCOLOR_WSUPER3 + {120, 120, 120, 120, 120, 120, 120, 0, 1, 3, 4, 6, 8, 9, 11, 13}, // SKINCOLOR_WSUPER4 + {120, 120, 120, 120, 0, 1, 2, 4, 5, 6, 8, 9, 10, 12, 13, 15}, // SKINCOLOR_WSUPER5 + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 96, 98, 99, 81, 73, 79}, // SKINCOLOR_CSUPER1 + {120, 120, 120, 120, 120, 120, 120, 120, 96, 97, 98, 81, 81, 71, 75, 79}, // SKINCOLOR_CSUPER2 + {120, 120, 120, 120, 120, 120, 96, 97, 98, 99, 81, 81, 70, 73, 76, 79}, // SKINCOLOR_CSUPER3 + {120, 120, 120, 120, 96, 96, 97, 98, 99, 81, 81, 70, 72, 74, 76, 79}, // SKINCOLOR_CSUPER4 + {120, 120, 96, 96, 97, 98, 98, 99, 81, 81, 69, 71, 73, 75, 77, 79}, // SKINCOLOR_CSUPER5 + {120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 208, 210, 212, 215, 220, 222}, // SKINCOLOR_ASUPER1 + {120, 120, 120, 120, 120, 120, 120, 120, 208, 209, 211, 213, 215, 220, 221, 223}, // SKINCOLOR_ASUPER2 + {120, 120, 120, 120, 120, 120, 208, 209, 210, 211, 212, 213, 215, 220, 221, 223}, // SKINCOLOR_ASUPER3 + {120, 120, 120, 120, 208, 209, 210, 211, 212, 213, 214, 215, 220, 221, 222, 223}, // SKINCOLOR_ASUPER4 + {120, 120, 208, 208, 209, 210, 211, 211, 212, 213, 214, 215, 220, 221, 222, 223}, // SKINCOLOR_ASUPER5 + // MAXTRANSLATIONS }; // Define for getting accurate color brightness readings according to how the human eye sees them. @@ -443,6 +508,7 @@ void K_RegisterKartStuff(void) CV_RegisterVar(&cv_kartdebugcheckpoint); CV_RegisterVar(&cv_kartdebugnodes); + CV_RegisterVar(&cv_kartdebugcolorize); } //} @@ -496,17 +562,17 @@ boolean K_IsPlayerWanted(player_t *player) static INT32 K_KartItemOddsRace[NUMKARTRESULTS][10] = { //P-Odds 0 1 2 3 4 5 6 7 8 9 - /*Sneaker*/ {20, 0, 0, 4, 6, 6, 0, 0, 0, 0 }, // Sneaker - /*Rocket Sneaker*/ { 0, 0, 0, 0, 0, 1, 3, 5, 3, 0 }, // Rocket Sneaker - /*Invincibility*/ { 0, 0, 0, 0, 0, 1, 4, 6,14, 0 }, // Invincibility - /*Banana*/ { 0,10, 4, 2, 1, 0, 0, 0, 0, 0 }, // Banana + /*Sneaker*/ {20, 0, 0, 4, 6, 7, 0, 0, 0, 0 }, // Sneaker + /*Rocket Sneaker*/ { 0, 0, 0, 0, 0, 1, 4, 5, 3, 0 }, // Rocket Sneaker + /*Invincibility*/ { 0, 0, 0, 0, 0, 1, 4, 6,10, 0 }, // Invincibility + /*Banana*/ { 0, 9, 4, 2, 1, 0, 0, 0, 0, 0 }, // Banana /*Eggman Monitor*/ { 0, 3, 2, 1, 0, 0, 0, 0, 0, 0 }, // Eggman Monitor - /*Orbinaut*/ { 0, 8, 6, 4, 2, 0, 0, 0, 0, 0 }, // Orbinaut + /*Orbinaut*/ { 0, 7, 6, 4, 2, 0, 0, 0, 0, 0 }, // Orbinaut /*Jawz*/ { 0, 0, 3, 2, 1, 1, 0, 0, 0, 0 }, // Jawz /*Mine*/ { 0, 0, 2, 2, 1, 0, 0, 0, 0, 0 }, // Mine /*Ballhog*/ { 0, 0, 0, 2, 1, 0, 0, 0, 0, 0 }, // Ballhog /*Self-Propelled Bomb*/ { 0, 0, 1, 2, 3, 4, 2, 2, 0,20 }, // Self-Propelled Bomb - /*Grow*/ { 0, 0, 0, 0, 0, 1, 3, 5, 3, 0 }, // Grow + /*Grow*/ { 0, 0, 0, 0, 0, 0, 2, 5, 7, 0 }, // Grow /*Shrink*/ { 0, 0, 0, 0, 0, 0, 0, 2, 0, 0 }, // Shrink /*Thunder Shield*/ { 0, 1, 2, 0, 0, 0, 0, 0, 0, 0 }, // Thunder Shield /*Hyudoro*/ { 0, 0, 0, 0, 1, 2, 1, 0, 0, 0 }, // Hyudoro @@ -651,6 +717,9 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) else newodds = K_KartItemOddsRace[item-1][pos]; + // Base multiplication to ALL item odds to simulate fractional precision + newodds *= 4; + for (i = 0; i < MAXPLAYERS; i++) { if (!playeringame[i] || players[i].spectator) @@ -867,8 +936,8 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) UINT8 pingame = 0; UINT8 roulettestop; INT32 useodds = 0; - INT32 spawnchance[NUMKARTRESULTS * NUMKARTODDS]; - INT32 chance = 0, numchoices = 0; + INT32 spawnchance[NUMKARTRESULTS]; + INT32 totalspawnchance = 0; INT32 bestbumper = 0; fixed_t mashed = 0; boolean dontforcespb = false; @@ -965,24 +1034,23 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) } // Initializes existing spawnchance values - for (i = 0; i < (NUMKARTRESULTS * NUMKARTODDS); i++) + for (i = 0; i < NUMKARTRESULTS; i++) spawnchance[i] = 0; // Split into another function for a debug function below useodds = K_FindUseodds(player, mashed, pingame, bestbumper, (spbplace != -1 && player->kartstuff[k_position] == spbplace+1), dontforcespb); -#define SETITEMRESULT(itemnum) \ - for (chance = 0; chance < K_KartGetItemOdds(useodds, itemnum, mashed); chance++) \ - spawnchance[numchoices++] = itemnum - for (i = 1; i < NUMKARTRESULTS; i++) - SETITEMRESULT(i); - -#undef SETITEMRESULT + spawnchance[i] = (totalspawnchance += K_KartGetItemOdds(useodds, i, mashed)); // Award the player whatever power is rolled - if (numchoices > 0) - K_KartGetItemResult(player, spawnchance[P_RandomKey(numchoices)]); + if (totalspawnchance > 0) + { + totalspawnchance = P_RandomKey(totalspawnchance); + for (i = 0; i < NUMKARTRESULTS && spawnchance[i] <= totalspawnchance; i++); + + K_KartGetItemResult(player, i); + } else { player->kartstuff[k_itemtype] = KITEM_SAD; @@ -1123,10 +1191,11 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid) return; { // Normalize distance to the sum of the two objects' radii, since in a perfect world that would be the distance at the point of collision... - fixed_t dist = P_AproxDistance(distx, disty) ?: 1; + fixed_t dist = P_AproxDistance(distx, disty); fixed_t nx = FixedDiv(distx, dist); fixed_t ny = FixedDiv(disty, dist); + dist = dist ? dist : 1; distx = FixedMul(mobj1->radius+mobj2->radius, nx); disty = FixedMul(mobj1->radius+mobj2->radius, ny); @@ -1399,7 +1468,7 @@ void K_RespawnChecker(player_t *player) mo->eflags |= MFE_VERTICALFLIP; P_SetTarget(&mo->target, player->mo); mo->angle = newangle+ANGLE_90; - mo->momz = (8*FRACUNIT)*P_MobjFlip(player->mo); + mo->momz = (8<mo); P_SetScale(mo, (mo->destscale = FRACUNIT)); } } @@ -2212,6 +2281,9 @@ void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor) // A b player->mo->momz *= 2; } + if (player->mo->eflags & MFE_UNDERWATER) + player->mo->momz = (117 * player->mo->momz) / 200; + if (player->mo->state != &states[S_KART_SPIN]) P_SetPlayerMobjState(player->mo, S_KART_SPIN); @@ -2421,6 +2493,8 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color) truc->momy = P_RandomRange(-speed, speed)*FRACUNIT; speed = FixedMul(20*FRACUNIT, source->scale)>>FRACBITS; truc->momz = P_RandomRange(-speed, speed)*FRACUNIT; + if (truc->eflags & MFE_UNDERWATER) + truc->momz = (117 * truc->momz) / 200; truc->color = color; } @@ -2449,6 +2523,8 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color) truc->momz = P_RandomRange(speed, speed2)*FRACUNIT; if (P_RandomChance(FRACUNIT/2)) truc->momz = -truc->momz; + if (truc->eflags & MFE_UNDERWATER) + truc->momz = (117 * truc->momz) / 200; truc->tics = TICRATE*2; truc->color = color; } @@ -2771,11 +2847,24 @@ void K_SpawnSparkleTrail(mobj_t *mo) void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent) { mobj_t *dust; + angle_t aoff; I_Assert(mo != NULL); I_Assert(!P_MobjWasRemoved(mo)); - dust = P_SpawnMobj(mo->x + (P_RandomRange(-25,25) * mo->scale), mo->y + (P_RandomRange(-25,25) * mo->scale), mo->z, MT_WIPEOUTTRAIL); + if (mo->player) + aoff = (mo->player->frameangle + ANGLE_180); + else + aoff = (mo->angle + ANGLE_180); + + if ((leveltime / 2) & 1) + aoff -= ANGLE_45; + else + aoff += ANGLE_45; + + dust = P_SpawnMobj(mo->x + FixedMul(24*mo->scale, FINECOSINE(aoff>>ANGLETOFINESHIFT)) + (P_RandomRange(-8,8) << FRACBITS), + mo->y + FixedMul(24*mo->scale, FINESINE(aoff>>ANGLETOFINESHIFT)) + (P_RandomRange(-8,8) << FRACBITS), + mo->z, MT_WIPEOUTTRAIL); P_SetTarget(&dust->target, mo); dust->angle = R_PointToAngle2(0,0,mo->momx,mo->momy); @@ -3006,6 +3095,9 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map mo->momy = player->mo->momy + FixedMul(FINESINE(fa), (altthrow == 2 ? 2*PROJSPEED/3 : PROJSPEED)); mo->momz = P_MobjFlip(player->mo) * HEIGHT; + if (mo->eflags & MFE_UNDERWATER) + mo->momz = (117 * mo->momz) / 200; + if (player->mo->eflags & MFE_VERTICALFLIP) mo->eflags |= MFE_VERTICALFLIP; } @@ -3364,6 +3456,9 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound) else mo->momz = FixedMul(vertispeed, vscale); + if (mo->eflags & MFE_UNDERWATER) + mo->momz = (117 * mo->momz) / 200; + if (sound) S_StartSound(mo, (sound == 1 ? sfx_kc2f : sfx_kpogos)); } @@ -3513,6 +3608,8 @@ void K_DropHnextList(player_t *player) dropwork->momx = player->mo->momx>>1; dropwork->momy = player->mo->momy>>1; dropwork->momz = 3*flip*mapobjectscale; + if (dropwork->eflags & MFE_UNDERWATER) + dropwork->momz = (117 * dropwork->momz) / 200; P_Thrust(dropwork, work->angle - ANGLE_90, 6*mapobjectscale); dropwork->movecount = 2; dropwork->movedir = work->angle - ANGLE_90; @@ -3571,6 +3668,8 @@ void K_DropItems(player_t *player) FixedAngle(P_RandomFixed()*180) + player->mo->angle + ANGLE_90, 16*mapobjectscale); drop->momz = P_MobjFlip(player->mo)*3*mapobjectscale; + if (drop->eflags & MFE_UNDERWATER) + drop->momz = (117 * drop->momz) / 200; drop->threshold = (thunderhack ? KITEM_THUNDERSHIELD : player->kartstuff[k_itemtype]); drop->movecount = player->kartstuff[k_itemamount]; @@ -4219,7 +4318,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) else { player->mo->colorized = true; - player->mo->color = SKINCOLOR_CRIMSON; + player->mo->color = SKINCOLOR_SCARLET; } } else if (player->kartstuff[k_invincibilitytimer]) // setting players to use the star colormap and spawning afterimages @@ -4693,6 +4792,7 @@ static void K_KartDrift(player_t *player, boolean onground) player->kartstuff[k_driftend] = 0; } + // Incease/decrease the drift value to continue drifting in that direction if (player->kartstuff[k_spinouttimer] == 0 && player->kartstuff[k_jmp] == 1 && onground && player->kartstuff[k_drift] != 0) { @@ -7182,7 +7282,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I if (netgame // don't draw it offline && tab[i].num != serverplayer) - HU_drawPing(x + ((i < 8) ? -19 : rightoffset + 13), y+2, playerpingtable[tab[i].num], false); + HU_drawPing(x + ((i < 8) ? -17 : rightoffset + 11), y-4, playerpingtable[tab[i].num], 0); STRBUFCPY(strtime, tab[i].name); @@ -8590,6 +8690,25 @@ void K_drawKartHUD(void) for (p = 0; p < MAXPLAYERS; p++) V_DrawString(8, 64+(8*p), V_YELLOWMAP, va("%d - %d (%dl)", p, playernode[p], players[p].cmd.latency)); } + + if (cv_kartdebugcolorize.value && stplyr->mo && stplyr->mo->skin) + { + INT32 x = 0, y = 0; + UINT8 c; + + for (c = 1; c < MAXSKINCOLORS; c++) + { + UINT8 *cm = R_GetTranslationColormap(TC_RAINBOW, c, 0); + V_DrawFixedPatch(x<skin], cm); + + x += 30; + if (x > BASEVIDWIDTH-30) + { + x = 0; + y += 30; + } + } + } } //} diff --git a/src/k_kart.h b/src/k_kart.h index dc37956a..e193b662 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -11,7 +11,7 @@ #define KART_FULLTURN 800 -UINT8 colortranslations[MAXSKINCOLORS][16]; +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); diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index cd8e0392..fb6814b2 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -410,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); @@ -613,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}, diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 5f136fc1..1c37f4c4 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -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); diff --git a/src/m_menu.c b/src/m_menu.c index 615b8c89..57a73c14 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1249,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}, @@ -1390,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, @@ -1404,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? @@ -1417,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[] = @@ -1469,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 diff --git a/src/p_map.c b/src/p_map.c index 41e5a455..ccb66676 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -747,6 +747,9 @@ 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 @@ -1021,6 +1024,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) { diff --git a/src/p_mobj.c b/src/p_mobj.c index 746fc1af..fd42a1d7 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3399,8 +3399,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))) { diff --git a/src/p_saveg.c b/src/p_saveg.c index 975a4a5d..5a43745b 100644 --- a/src/p_saveg.c +++ b/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) diff --git a/src/p_setup.c b/src/p_setup.c index 58e13c2e..1acfb7a3 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3214,10 +3214,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! } diff --git a/src/p_user.c b/src/p_user.c index 76f57a9b..7350b921 100644 --- a/src/p_user.c +++ b/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)); } } @@ -8295,9 +8295,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall if (mo->eflags & MFE_VERTICALFLIP) camheight += thiscam->height; - if (splitscreen == 1) - camspeed = (3*camspeed)/4; - if (camspeed > FRACUNIT) camspeed = FRACUNIT; @@ -8351,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); @@ -8623,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; diff --git a/src/r_main.c b/src/r_main.c index 8b070e9e..36182d0e 100644 --- a/src/r_main.c +++ b/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<> 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)<>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); diff --git a/src/r_main.h b/src/r_main.h index 7d3e26a8..38a58968 100644 --- a/src/r_main.h +++ b/src/r_main.h @@ -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; diff --git a/src/r_things.c b/src/r_things.c index 135ae6a2..59a904cb 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -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); diff --git a/src/screen.c b/src/screen.c index af6aed03..4de2abd0 100644 --- a/src/screen.c +++ b/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< 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); + } +} diff --git a/src/screen.h b/src/screen.h index 9ad254d3..5b4a8e58 100644 --- a/src/screen.h +++ b/src/screen.h @@ -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__ diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index f360072a..f92f1f14 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.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; diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 2a77604d..39a2c5ef 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -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" @@ -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; diff --git a/src/sdl/srb2icon.png b/src/sdl/srb2icon.png new file mode 100644 index 00000000..2aca4b20 Binary files /dev/null and b/src/sdl/srb2icon.png differ diff --git a/src/sdl12/i_video.c b/src/sdl12/i_video.c index 69cf5ca9..a2a20c61 100644 --- a/src/sdl12/i_video.c +++ b/src/sdl12/i_video.c @@ -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; diff --git a/src/v_video.c b/src/v_video.c index 115e081e..473adeed 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -1342,8 +1342,8 @@ void V_DrawCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed) V_DrawScaledPatch(x, y, flags, hu_font[c]); } -// Writes a single character for the chat. (draw WHITE if bit 7 set) -// Essentially the same as the above but it's small or big depending on what resolution you've chosen to huge.. +// Writes a single character for the chat (half scaled). (draw WHITE if bit 7 set) +// 16/02/19: Scratch the scaling thing, chat doesn't work anymore under 2x res -Lat' // void V_DrawChatCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed, UINT8 *colormap) { @@ -1359,13 +1359,11 @@ void V_DrawChatCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed, UI if (c < 0 || c >= HU_FONTSIZE || !hu_font[c]) return; - w = (vid.width < 640 ) ? (SHORT(hu_font[c]->width)/2) : (SHORT(hu_font[c]->width)); // use normal sized characters if we're using a terribly low resolution. + w = SHORT(hu_font[c]->width)/2; if (x + w > vid.width) return; - V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, (vid.width < 640) ? (FRACUNIT) : (FRACUNIT/2), flags, hu_font[c], colormap); - - + V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, FRACUNIT/2, flags, hu_font[c], colormap); } // Precompile a wordwrapped string to any given width. @@ -2015,6 +2013,28 @@ void V_DrawPaddedTallNum(INT32 x, INT32 y, INT32 flags, INT32 num, INT32 digits) } while (--digits); } +// Draws a number using the PING font thingy. +// TODO: Merge number drawing functions into one with "font name" selection. + +void V_DrawPingNum(INT32 x, INT32 y, INT32 flags, INT32 num, const UINT8 *colormap) +{ + INT32 w = SHORT(pingnum[0]->width); // this SHOULD always be 5 but I guess custom graphics exist. + + if (flags & V_NOSCALESTART) + w *= vid.dupx; + + if (num < 0) + num = -num; + + // draw the number + do + { + x -= (w-1); // Oni wanted their outline to intersect. + V_DrawFixedPatch(x<filename); DEH_LoadDehackedLumpPwad(numwadfiles - 1, 0); break; - case RET_LUA: #ifdef HAVE_BLUA + case RET_LUA: LUA_LoadLump(numwadfiles - 1, 0); -#endif break; +#endif default: break; } diff --git a/src/win32/win_sys.c b/src/win32/win_sys.c index fa9d6d64..47250334 100644 --- a/src/win32/win_sys.c +++ b/src/win32/win_sys.c @@ -639,9 +639,6 @@ void I_Error(const char *error, ...) if (!errorcount) { M_SaveConfig(NULL); // save game config, cvars.. -#ifndef NONET - D_SaveBan(); // save the ban list -#endif G_SaveGameData(); } diff --git a/src/win32/win_vid.c b/src/win32/win_vid.c index 9f3d13f8..45f96e9d 100644 --- a/src/win32/win_vid.c +++ b/src/win32/win_vid.c @@ -366,6 +366,9 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); + if (cv_showping.value && netgame && consoleplayer != serverplayer) + SCR_DisplayLocalPing(); + // if (bDIBMode) { diff --git a/src/win32ce/win_vid.c b/src/win32ce/win_vid.c index 5e8e7e1f..244dfaf3 100644 --- a/src/win32ce/win_vid.c +++ b/src/win32ce/win_vid.c @@ -198,6 +198,9 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); + if (cv_showping.value && netgame && consoleplayer != serverplayer) + SCR_DisplayLocalPing(); + // if (bDIBMode) {