diff --git a/CMakeLists.txt b/CMakeLists.txt index b541a9c20..c67f73aee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,8 @@ if( CMAKE_COMPILER_IS_GNUCXX ) set( PROFILE 0 CACHE BOOL "Enable profiling with gprof for Debug and RelWithDebInfo build types." ) endif( CMAKE_COMPILER_IS_GNUCXX ) +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}") + find_package( BZip2 ) find_package( JPEG ) find_package( ZLIB ) diff --git a/bzip2/CMakeLists.txt b/bzip2/CMakeLists.txt index e819f4cde..5c1255604 100644 --- a/bzip2/CMakeLists.txt +++ b/bzip2/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required( VERSION 2.4 ) if( CMAKE_COMPILER_IS_GNUC ) - set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fomit-frame-pointer" ) + set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -fomit-frame-pointer" ) endif( CMAKE_COMPILER_IS_GNUC ) add_definitions( -DBZ_NO_STDIO ) diff --git a/dumb/include/dumb.h b/dumb/include/dumb.h index 7af4a1d71..09041ce3c 100644 --- a/dumb/include/dumb.h +++ b/dumb/include/dumb.h @@ -400,7 +400,7 @@ DUH *DUMBEXPORT dumb_load_it(const char *filename); DUH *DUMBEXPORT dumb_load_xm(const char *filename); DUH *DUMBEXPORT dumb_load_s3m(const char *filename); DUH *DUMBEXPORT dumb_load_stm(const char *filename); -DUH *DUMBEXPORT dumb_load_mod(const char *filename, int restrict); +DUH *DUMBEXPORT dumb_load_mod(const char *filename, int rstrict); DUH *DUMBEXPORT dumb_load_ptm(const char *filename); DUH *DUMBEXPORT dumb_load_669(const char *filename); DUH *DUMBEXPORT dumb_load_psm(const char *filename, int subsong); @@ -413,7 +413,7 @@ DUH *DUMBEXPORT dumb_read_it(DUMBFILE *f); DUH *DUMBEXPORT dumb_read_xm(DUMBFILE *f); DUH *DUMBEXPORT dumb_read_s3m(DUMBFILE *f); DUH *DUMBEXPORT dumb_read_stm(DUMBFILE *f); -DUH *DUMBEXPORT dumb_read_mod(DUMBFILE *f, int restrict); +DUH *DUMBEXPORT dumb_read_mod(DUMBFILE *f, int rstrict); DUH *DUMBEXPORT dumb_read_ptm(DUMBFILE *f); DUH *DUMBEXPORT dumb_read_669(DUMBFILE *f); DUH *DUMBEXPORT dumb_read_psm(DUMBFILE *f, int subsong); @@ -426,7 +426,7 @@ DUH *DUMBEXPORT dumb_load_it_quick(const char *filename); DUH *DUMBEXPORT dumb_load_xm_quick(const char *filename); DUH *DUMBEXPORT dumb_load_s3m_quick(const char *filename); DUH *DUMBEXPORT dumb_load_stm_quick(const char *filename); -DUH *DUMBEXPORT dumb_load_mod_quick(const char *filename, int restrict); +DUH *DUMBEXPORT dumb_load_mod_quick(const char *filename, int rstrict); DUH *DUMBEXPORT dumb_load_ptm_quick(const char *filename); DUH *DUMBEXPORT dumb_load_669_quick(const char *filename); DUH *DUMBEXPORT dumb_load_psm_quick(const char *filename, int subsong); @@ -439,7 +439,7 @@ DUH *DUMBEXPORT dumb_read_it_quick(DUMBFILE *f); DUH *DUMBEXPORT dumb_read_xm_quick(DUMBFILE *f); DUH *DUMBEXPORT dumb_read_s3m_quick(DUMBFILE *f); DUH *DUMBEXPORT dumb_read_stm_quick(DUMBFILE *f); -DUH *DUMBEXPORT dumb_read_mod_quick(DUMBFILE *f, int restrict); +DUH *DUMBEXPORT dumb_read_mod_quick(DUMBFILE *f, int rstrict); DUH *DUMBEXPORT dumb_read_ptm_quick(DUMBFILE *f); DUH *DUMBEXPORT dumb_read_669_quick(DUMBFILE *f); DUH *DUMBEXPORT dumb_read_psm_quick(DUMBFILE *f, int subsong); diff --git a/dumb/src/it/loadmod.c b/dumb/src/it/loadmod.c index 0a2d4019b..adb4c283a 100644 --- a/dumb/src/it/loadmod.c +++ b/dumb/src/it/loadmod.c @@ -26,7 +26,7 @@ * pointer to the DUH struct. When you have finished with it, you must * pass the pointer to unload_duh() so that the memory can be freed. */ -DUH *DUMBEXPORT dumb_load_mod_quick(const char *filename, int restrict) +DUH *DUMBEXPORT dumb_load_mod_quick(const char *filename, int rstrict) { DUH *duh; DUMBFILE *f = dumbfile_open(filename); @@ -34,7 +34,7 @@ DUH *DUMBEXPORT dumb_load_mod_quick(const char *filename, int restrict) if (!f) return NULL; - duh = dumb_read_mod_quick(f, restrict); + duh = dumb_read_mod_quick(f, rstrict); dumbfile_close(f); diff --git a/dumb/src/it/loadmod2.c b/dumb/src/it/loadmod2.c index d2aae8d0e..83a416947 100644 --- a/dumb/src/it/loadmod2.c +++ b/dumb/src/it/loadmod2.c @@ -21,9 +21,9 @@ -DUH *DUMBEXPORT dumb_load_mod(const char *filename, int restrict) +DUH *DUMBEXPORT dumb_load_mod(const char *filename, int rstrict) { - DUH *duh = dumb_load_mod_quick(filename, restrict); + DUH *duh = dumb_load_mod_quick(filename, rstrict); dumb_it_do_initial_runthrough(duh); return duh; } diff --git a/dumb/src/it/readmod.c b/dumb/src/it/readmod.c index c2cb4b7bf..05c1ba86e 100644 --- a/dumb/src/it/readmod.c +++ b/dumb/src/it/readmod.c @@ -441,7 +441,7 @@ static DUMBFILE *dumbfile_buffer_mod_2(DUMBFILE *f, int32 *remain) } -static DUMB_IT_SIGDATA *it_mod_load_sigdata(DUMBFILE *f, int restrict) +static DUMB_IT_SIGDATA *it_mod_load_sigdata(DUMBFILE *f, int rstrict) { DUMB_IT_SIGDATA *sigdata; int n_channels; @@ -550,7 +550,7 @@ static DUMB_IT_SIGDATA *it_mod_load_sigdata(DUMBFILE *f, int restrict) } // moo - if ( restrict && sigdata->n_samples == 15 ) + if ( rstrict && sigdata->n_samples == 15 ) { free(sigdata); dumbfile_close(f); @@ -758,13 +758,13 @@ static DUMB_IT_SIGDATA *it_mod_load_sigdata(DUMBFILE *f, int restrict) -DUH *DUMBEXPORT dumb_read_mod_quick(DUMBFILE *f, int restrict) +DUH *DUMBEXPORT dumb_read_mod_quick(DUMBFILE *f, int rstrict) { sigdata_t *sigdata; DUH_SIGTYPE_DESC *descptr = &_dumb_sigtype_it; - sigdata = it_mod_load_sigdata(f, restrict); + sigdata = it_mod_load_sigdata(f, rstrict); if (!sigdata) return NULL; diff --git a/dumb/src/it/readmod2.c b/dumb/src/it/readmod2.c index 34fadf235..a20ccd24e 100644 --- a/dumb/src/it/readmod2.c +++ b/dumb/src/it/readmod2.c @@ -21,9 +21,9 @@ -DUH *DUMBEXPORT dumb_read_mod(DUMBFILE *f, int restrict) +DUH *DUMBEXPORT dumb_read_mod(DUMBFILE *f, int rstrict) { - DUH *duh = dumb_read_mod_quick(f, restrict); + DUH *duh = dumb_read_mod_quick(f, rstrict); dumb_it_do_initial_runthrough(duh); return duh; } diff --git a/game-music-emu/CMakeLists.txt b/game-music-emu/CMakeLists.txt index 0f1355336..7905f847a 100644 --- a/game-music-emu/CMakeLists.txt +++ b/game-music-emu/CMakeLists.txt @@ -7,7 +7,7 @@ if( NOT CMAKE_BUILD_TYPE MATCHES "Release" ) endif( NOT CMAKE_BUILD_TYPE MATCHES "Release" ) if( CMAKE_COMPILER_IS_GNUCXX ) - set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall" ) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra" ) if( NOT PROFILE ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fomit-frame-pointer" ) endif( NOT PROFILE ) diff --git a/game-music-emu/gme/Dual_Resampler.cpp b/game-music-emu/gme/Dual_Resampler.cpp index 8644517ca..fe2085803 100644 --- a/game-music-emu/gme/Dual_Resampler.cpp +++ b/game-music-emu/gme/Dual_Resampler.cpp @@ -62,10 +62,10 @@ void Dual_Resampler::play_frame_( Blip_Buffer& blip_buf, dsample_t* out ) assert( blip_buf.samples_avail() == pair_count ); resampler.write( new_count ); - + long count = resampler.read( sample_buf.begin(), sample_buf_size ); assert( count == (long) sample_buf_size ); - + mix_samples( blip_buf, out ); blip_buf.remove_samples( pair_count ); } diff --git a/game-music-emu/gme/Gbs_Emu.cpp b/game-music-emu/gme/Gbs_Emu.cpp index a2b1d613f..83aefb424 100644 --- a/game-music-emu/gme/Gbs_Emu.cpp +++ b/game-music-emu/gme/Gbs_Emu.cpp @@ -18,8 +18,8 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "blargg_source.h" -Gbs_Emu::equalizer_t const Gbs_Emu::handheld_eq = { -47.0, 2000 }; -Gbs_Emu::equalizer_t const Gbs_Emu::headphones_eq = { 0.0, 300 }; +Gbs_Emu::equalizer_t const Gbs_Emu::handheld_eq = { -47.0, 2000, 0, 0, 0, 0, 0, 0, 0, 0 }; +Gbs_Emu::equalizer_t const Gbs_Emu::headphones_eq = { 0.0, 300, 0, 0, 0, 0, 0, 0, 0, 0 }; Gbs_Emu::Gbs_Emu() { @@ -39,7 +39,7 @@ Gbs_Emu::Gbs_Emu() set_max_initial_silence( 21 ); set_gain( 1.2 ); - static equalizer_t const eq = { -1.0, 120 }; + static equalizer_t const eq = { -1.0, 120, 0, 0, 0, 0, 0, 0, 0, 0 }; set_equalizer( eq ); } diff --git a/game-music-emu/gme/Gbs_Emu.h b/game-music-emu/gme/Gbs_Emu.h index 93fe691e5..6cc6b474b 100644 --- a/game-music-emu/gme/Gbs_Emu.h +++ b/game-music-emu/gme/Gbs_Emu.h @@ -41,7 +41,7 @@ public: public: // deprecated - Music_Emu::load; + using Music_Emu::load; blargg_err_t load( header_t const& h, Data_Reader& in ) // use Remaining_Reader { return load_remaining_( &h, sizeof h, in ); } diff --git a/game-music-emu/gme/Gym_Emu.h b/game-music-emu/gme/Gym_Emu.h index 05419ea20..0f7a0e39c 100644 --- a/game-music-emu/gme/Gym_Emu.h +++ b/game-music-emu/gme/Gym_Emu.h @@ -34,7 +34,7 @@ public: public: // deprecated - Music_Emu::load; + using Music_Emu::load; blargg_err_t load( header_t const& h, Data_Reader& in ) // use Remaining_Reader { return load_remaining_( &h, sizeof h, in ); } enum { gym_rate = 60 }; diff --git a/game-music-emu/gme/Music_Emu.cpp b/game-music-emu/gme/Music_Emu.cpp index f01024ce3..b0f3f71d5 100644 --- a/game-music-emu/gme/Music_Emu.cpp +++ b/game-music-emu/gme/Music_Emu.cpp @@ -24,7 +24,7 @@ int const silence_threshold = 0x10; long const fade_block_size = 512; int const fade_shift = 8; // fade ends with gain at 1.0 / (1 << fade_shift) -Music_Emu::equalizer_t const Music_Emu::tv_eq = { -8.0, 180 }; +Music_Emu::equalizer_t const Music_Emu::tv_eq = { -8.0, 180, 0, 0, 0, 0, 0, 0, 0, 0 }; void Music_Emu::clear_track_vars() { diff --git a/game-music-emu/gme/Music_Emu.h b/game-music-emu/gme/Music_Emu.h index 81e1e67cc..6a2eaa110 100644 --- a/game-music-emu/gme/Music_Emu.h +++ b/game-music-emu/gme/Music_Emu.h @@ -58,7 +58,7 @@ public: void ignore_silence( bool disable = true ); // Info for current track - Gme_File::track_info; + using Gme_File::track_info; blargg_err_t track_info( track_info_t* out ) const; // Sound customization diff --git a/game-music-emu/gme/Nsf_Emu.cpp b/game-music-emu/gme/Nsf_Emu.cpp index 15f9e0b46..59d9b98cf 100644 --- a/game-music-emu/gme/Nsf_Emu.cpp +++ b/game-music-emu/gme/Nsf_Emu.cpp @@ -31,8 +31,8 @@ int const fme7_flag = 0x20; long const clock_divisor = 12; -Nsf_Emu::equalizer_t const Nsf_Emu::nes_eq = { -1.0, 80 }; -Nsf_Emu::equalizer_t const Nsf_Emu::famicom_eq = { -15.0, 80 }; +Nsf_Emu::equalizer_t const Nsf_Emu::nes_eq = { -1.0, 80, 0, 0, 0, 0, 0, 0, 0, 0 }; +Nsf_Emu::equalizer_t const Nsf_Emu::famicom_eq = { -15.0, 80, 0, 0, 0, 0, 0, 0, 0, 0 }; int Nsf_Emu::pcm_read( void* emu, nes_addr_t addr ) { diff --git a/game-music-emu/gme/Nsf_Emu.h b/game-music-emu/gme/Nsf_Emu.h index e06b91727..fcce66a1e 100644 --- a/game-music-emu/gme/Nsf_Emu.h +++ b/game-music-emu/gme/Nsf_Emu.h @@ -44,7 +44,7 @@ public: public: // deprecated - Music_Emu::load; + using Music_Emu::load; blargg_err_t load( header_t const& h, Data_Reader& in ) // use Remaining_Reader { return load_remaining_( &h, sizeof h, in ); } diff --git a/game-music-emu/gme/Nsfe_Emu.h b/game-music-emu/gme/Nsfe_Emu.h index 561c3be0f..00ac40399 100644 --- a/game-music-emu/gme/Nsfe_Emu.h +++ b/game-music-emu/gme/Nsfe_Emu.h @@ -46,7 +46,7 @@ public: public: // deprecated struct header_t { char tag [4]; }; - Music_Emu::load; + using Music_Emu::load; blargg_err_t load( header_t const& h, Data_Reader& in ) // use Remaining_Reader { return load_remaining_( &h, sizeof h, in ); } void disable_playlist( bool = true ); // use clear_playlist() diff --git a/game-music-emu/gme/Spc_Emu.h b/game-music-emu/gme/Spc_Emu.h index 44b54c309..0c4a7fb27 100644 --- a/game-music-emu/gme/Spc_Emu.h +++ b/game-music-emu/gme/Spc_Emu.h @@ -47,7 +47,7 @@ public: public: // deprecated - Music_Emu::load; + using Music_Emu::load; blargg_err_t load( header_t const& h, Data_Reader& in ) // use Remaining_Reader { return load_remaining_( &h, sizeof h, in ); } byte const* trailer() const; // use track_info() diff --git a/game-music-emu/gme/Vgm_Emu.cpp b/game-music-emu/gme/Vgm_Emu.cpp index fc5394480..fe4be10a5 100644 --- a/game-music-emu/gme/Vgm_Emu.cpp +++ b/game-music-emu/gme/Vgm_Emu.cpp @@ -36,7 +36,7 @@ Vgm_Emu::Vgm_Emu() set_silence_lookahead( 1 ); // tracks should already be trimmed - static equalizer_t const eq = { -14.0, 80 }; + static equalizer_t const eq = { -14.0, 80, 0, 0, 0, 0, 0, 0, 0, 0 }; set_equalizer( eq ); } diff --git a/game-music-emu/gme/Vgm_Emu.h b/game-music-emu/gme/Vgm_Emu.h index bcb784d56..7a82fd109 100644 --- a/game-music-emu/gme/Vgm_Emu.h +++ b/game-music-emu/gme/Vgm_Emu.h @@ -51,7 +51,7 @@ public: public: // deprecated - Music_Emu::load; + using Music_Emu::load; blargg_err_t load( header_t const& h, Data_Reader& in ) // use Remaining_Reader { return load_remaining_( &h, sizeof h, in ); } byte const* gd3_data( int* size_out = 0 ) const; // use track_info() diff --git a/game-music-emu/gme/gme.cpp b/game-music-emu/gme/gme.cpp index 23e7198d3..c9154c7a4 100644 --- a/game-music-emu/gme/gme.cpp +++ b/game-music-emu/gme/gme.cpp @@ -337,7 +337,7 @@ void GMEAPI gme_set_equalizer ( Music_Emu* me, gme_equalizer_t const* eq ) void GMEAPI gme_equalizer( Music_Emu const* me, gme_equalizer_t* out ) { - gme_equalizer_t e = { }; + gme_equalizer_t e = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; e.treble = me->equalizer().treble; e.bass = me->equalizer().bass; *out = e; diff --git a/gdtoa/CMakeLists.txt b/gdtoa/CMakeLists.txt index 9ef4b9c3e..6fc394d8d 100644 --- a/gdtoa/CMakeLists.txt +++ b/gdtoa/CMakeLists.txt @@ -8,8 +8,8 @@ if( MSVC ) set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4554 /wd4102" ) endif( MSVC ) -if( CMAKE_COMPILER_IS_GNUCXX ) - set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall" ) +if( CMAKE_COMPILER_IS_GNUCXX ) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra" ) endif( CMAKE_COMPILER_IS_GNUCXX ) include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) diff --git a/jpeg-6b/CMakeLists.txt b/jpeg-6b/CMakeLists.txt index 665e99d4a..c3a5f458c 100644 --- a/jpeg-6b/CMakeLists.txt +++ b/jpeg-6b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required( VERSION 2.4 ) if( CMAKE_COMPILER_IS_GNUC ) - set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fomit-frame-pointer" ) + set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -fomit-frame-pointer" ) endif( CMAKE_COMPILER_IS_GNUC ) add_library( jpeg diff --git a/lzma/CMakeLists.txt b/lzma/CMakeLists.txt index b9b4bc047..6a2561c68 100644 --- a/lzma/CMakeLists.txt +++ b/lzma/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required( VERSION 2.4 ) if( CMAKE_COMPILER_IS_GNUC ) - set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fomit-frame-pointer" ) + set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -fomit-frame-pointer" ) endif( CMAKE_COMPILER_IS_GNUC ) set( LZMA_FILES diff --git a/specs/fmod_version.txt b/specs/fmod_version.txt index c285c50b9..1016b9388 100644 --- a/specs/fmod_version.txt +++ b/specs/fmod_version.txt @@ -1,3 +1,3 @@ -This version of ZDoom must be compiled with any version between 4.22 and 4.28 inclusive. +This version of ZDoom must be compiled with any version between 4.22 and 4.28 inclusive or 4.34. Use of the latest 4.26 is recommended though due to technical issues with 4.28. diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index fe6897d9f..9d7bb3caf 100644 --- a/specs/udmf_zdoom.txt +++ b/specs/udmf_zdoom.txt @@ -1,5 +1,5 @@ =============================================================================== -Universal Doom Map Format ZDoom extensions v1.10 - 25.04.2010 +Universal Doom Map Format ZDoom extensions v1.15 - 14.12.2010 Copyright (c) 2008 Christoph Oelckers. @@ -39,7 +39,7 @@ between the TEXTMAP and ENDMAP lumps: BEHAVIOR = contains compiled ACS code DIALOGUE = contains compiled Strife conversation scripts. ZNODES = Nodes (must be stored as extended GL nodes. Compression is allowed - but deprecated for portability reasons.) + but deprecated for portability reasons.) BLOCKMAP = blockmap. It is recommended not to include this lump in UDMF maps. REJECT = reject table. Recommended use is for special effects only. @@ -84,6 +84,12 @@ field to 'strifeally', even for the 'Doom' namespace. In addition to the standard fields, ZDoom defines the following: Note: All fields default to false unless mentioned otherwise. + vertex + { + zfloor = ; // Floor height at this vertex. Only applies to triangular sectors + zceiling = ; // Ceiling height at this vertex. Only applies to triangular sectors + } + linedef { alpha = ; // Translucency of this line, default is 1.0 @@ -105,10 +111,17 @@ Note: All fields default to false unless mentioned otherwise. midtex3d = ; // Actors can walk on mid texture. checkswitchrange = ;// Switches can only be activated when vertically reachable. blockprojectiles = ;// Line blocks all projectiles - blockuse = ; // Line blocks all use actions - + blockuse = ; // Line blocks all use actions + blocksight = ; // Line blocks monster line of sight + locknumber = ; // Line special is locked + arg0str = ; // Alternate string-based version of arg0 + + * Note about arg0str + + For lines with ACS specials (80-86 and 226), if arg0str is present and non-null, it + will be used as the name of the script to execute, and arg0 will be ignored. } - + sidedef { scalex_top = ; // X scale for upper texture, Default = 1.0. @@ -128,16 +141,16 @@ Note: All fields default to false unless mentioned otherwise. light = ; // This side's light level. Default is 0. lightabsolute = ; // true = 'light' is an absolute value. Default is // relative to the owning sector's light level. - nofakecontrast = ; // Disables use of fake contrast on this sidedef. - smoothlighting = ; // Use smooth fake contrast. + nofakecontrast = ; // Disables use of fake contrast on this sidedef. + smoothlighting = ; // Use smooth fake contrast. clipmidtex = ; // Side's mid textures are clipped to floor and ceiling. wrapmidtex = ; // Side's mid textures are wrapped. - nodecals = ; // Disables decals on the sidedef. + nodecals = ; // Disables decals on the sidedef. } - + sector { - xpanningfloor = ; // X texture offset of floor texture, Default = 0.0. + xpanningfloor = ; // X texture offset of floor texture, Default = 0.0. ypanningfloor = ; // Y texture offset of floor texture, Default = 0.0. xpanningceiling = ; // X texture offset of ceiling texture, Default = 0.0. ypanningceiling = ; // Y texture offset of ceiling texture, Default = 0.0. @@ -153,39 +166,48 @@ Note: All fields default to false unless mentioned otherwise. // relative to the owning sector's light level. lightceilingabsolute = ; // true = 'lightceiling' is an absolute value. Default is // relative to the owning sector's light level. + alphafloor = ; // translucency of floor plane (only has meaning with Sector_SetPortal) Default is 1.0. + alphaceiling = ; // translucency of ceiling plane (only has meaning with Sector_SetPortal) Default is 1.0. + renderstylefloor = ; // floor plane renderstyle (only has meaning with Sector_SetPortal); not implemented yet in software renderer + // can be "translucent" or "add", default is "translucent". + renderstyleceiling = ; // ceiling plane renderstyle (only has meaning with Sector_SetPortal); not implemented yet in software renderer + // can be "translucent" or "add", default is "translucent". gravity = ; // Sector's gravity. Default is 1.0. - lightcolor = ; // Sector'S light color as RRGGBB value, default = 0xffffff. - fadecolor = ; // Sector'S fog color as RRGGBB value, default = 0x000000. + lightcolor = ; // Sector's light color as RRGGBB value, default = 0xffffff. + fadecolor = ; // Sector's fog color as RRGGBB value, default = 0x000000. desaturation = ; // Color desaturation factor. 0 = none, 1 = full, default = 0. silent = ; // Actors in this sector make no sound, nofallingdamage = ; // Falling damage is disabled in this sector dropactors = ; // Actors drop with instantly moving floors (*) - norespawn = ; // Players can not respawn in this sector - soundsequence = ; // The sound sequence to play when this sector moves. Placing a - // sound sequence thing in the sector will override this property. - hidden = ; // if true this sector will not be drawn on the textured automap. + norespawn = ; // Players can not respawn in this sector + soundsequence = ; // The sound sequence to play when this sector moves. Placing a + // sound sequence thing in the sector will override this property. + hidden = ; // if true this sector will not be drawn on the textured automap. * Note about dropactors - The spec requires this to be false by default. Currently, however ZDoom assumes this to be true + The spec requires this to be false by default. Currently, however, ZDoom assumes this to be true for Doom format maps so any map converter converting to the ZDoomTranslated namespace should set this flag for each tagged sector. - + } - + thing { - skill# = // Unlike the base spec, # can range from 1-8. - // 8 is the maximum amount of skills the skill - // menu can display. - class# = // Unlike the base spec, # can range from 1-8. - // 8 is the maximum amount of classes the class - // menu can display. - conversation = // Assigns a conversation dialogue to this thing. - // Parameter is the conversation ID, 0 meaning none. + skill# = // Unlike the base spec, # can range from 1-16. + class# = // Unlike the base spec, # can range from 1-16. + conversation = // Assigns a conversation dialogue to this thing. + // Parameter is the conversation ID, 0 meaning none. + countsecret = ; // Picking up this actor counts as a secret. + arg0str = ; // Alternate string-based version of arg0 + + * Note about arg0str + + For things with ACS specials (80-86 and 226), if arg0str is present and non-null, it + will be used as the name of the script to execute, and arg0 will be ignored. } - - + + *** Special notes for map format conversions: @@ -194,7 +216,7 @@ Note: All fields default to false unless mentioned otherwise. Unless mentioned differently the arg being used to define the line ID should be set to 0. The following line specials are affected: - + 121: Line_SetIdentification, arg 0 208: TranslucentLine, arg0 (arg0 must be preserved) 1: Polyobj_StartLine, arg3 @@ -202,16 +224,17 @@ Note: All fields default to false unless mentioned otherwise. 181: Plane_Align, arg2 215: Teleport_Line, arg0 222: Scroll_Texture_Model, arg0 (arg0 must be preserved) - + 160: Sector_3DFloor, arg4 (both uses as high-byte of tag and line ID are not supported in UDMF and must be remapped) + Some specials also allow setting the extended flags. These must also be converted to explicitly setting the flags through the defined map fields. This affects the following specials: - + 121: Line_SetIdentification, arg1 208: TranslucentLine, arg3 - + These args are to be converted as follows to flags, bit by bit: - + Bit 0 (Value 1): zoneboundary Bit 1 (Value 2): jumpover Bit 2 (Value 4): blockfloaters @@ -220,13 +243,13 @@ Note: All fields default to false unless mentioned otherwise. Bit 5 (Value 32): midtex3d Bit 6 (Value 64): checkswitchrange Bit 7 (Value 128): firstsideonly - + When used in special 208 this arg should be cleared afterward. - + Special 121 is not being used by UDMF maps in ZDoom and should be completely deleted after conversion. - - + + ======================================= Changelog ======================================= @@ -269,7 +292,7 @@ Changed node specifications to deprecate compression of node lump. Added 'playeruseback' line trigger flag. 1.11 07.08.2010 -Added 'soundsequnce' sector property. +Added 'soundsequence' sector property. 1.12 22.08.2010 Added 'conversation' thing property. @@ -277,6 +300,31 @@ Added 'conversation' thing property. 1.13 29.08.2010 Added 'hidden' sector property. +1.14 19.09.2010 +Added 'countsecret' actor property. + +1.15 14.12.2010 +Added vertex floor and ceiling height properties + +1.16 23.01.2011 +Added alphaceiling and alphafloor sector properties +Added blocksight linedef flag +Removed remarks of 8 being the maximum number of player classes/skill levels the menu can handle so the spec now properly lists 16 as limit. + +1.17 12.02.2011 +Added renderstyleceiling and renderstylefloor sector properties +Added Sector_Set3DFloor to list of specials that need to be handled for line ID remapping + +1.18 17.02.2012 +Added arg0str linedef property. +Standardized whitespace. + +1.19 24.02.2012 +Added back locknumber property. + +1.20 25.02.2012 +Added arg0str thing property. + =============================================================================== EOF =============================================================================== diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 48f558fba..4465b32d0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -44,7 +44,7 @@ set( MINOR_VERSIONS "50" "49" "48" "47" "46" "45" "44" "43" "42" "41" "27" "26" "25" "24" "23" "22" "21" "20" "21" "19" "18" "17" "16" "15" "14" "13" "12" "11" "10" "09" "08" "07" "06" "05" "04" "03" "02" "01" "00" ) -set( MAJOR_VERSIONS "30" "28" "26" "24" "22" "20" ) +set( MAJOR_VERSIONS "34" "28" "26" "24" "22" "20" ) set( FMOD_DIR_VERSIONS ${FMOD_DIR_VERSIONS} "../fmod" ) foreach( majver ${MAJOR_VERSIONS} ) foreach( minver ${MINOR_VERSIONS} ) @@ -166,6 +166,19 @@ else( WIN32 ) set( NO_GTK ON ) endif( GTK2_FOUND ) endif( NOT NO_GTK ) + + # Check for Xcursor library and header files + find_library( XCURSOR_LIB Xcursor ) + if( XCURSOR_LIB ) + find_file( XCURSOR_HEADER "X11/Xcursor/Xcursor.h" ) + if( XCURSOR_HEADER ) + add_definitions( -DUSE_XCURSOR=1 ) + message( STATUS "Found Xcursor at ${XCURSOR_LIB}" ) + set( ZDOOM_LIBS ${ZDOOM_LIBS} ${XCURSOR_LIB} ) + else( XCURSOR_HEADER ) + unset( XCURSOR_LIB ) + endif( XCURSOR_HEADER ) + endif( XCURSOR_LIB ) endif( APPLE ) set( NASM_NAMES nasm ) @@ -244,7 +257,7 @@ endif( FMOD_LIBRARY ) # Search for FluidSynth -include( ../FindFluidSynth.cmake ) +find_package( FluidSynth ) # Search for NASM @@ -346,7 +359,7 @@ endif( NOT NO_ASM ) set( SSE_MATTERS NO ) # SSE only matters on 32-bit targets. We check compiler flags to know if we can do it. -if( CMAKE_SIZEOF_VOID_P MATCHES "4" ) +if( CMAKE_SIZEOF_VOID_P MATCHES "4" AND NOT CMAKE_OSX_ARCHITECTURES MATCHES ppc ) CHECK_CXX_COMPILER_FLAG( "-msse2 -mfpmath=sse" CAN_DO_MFPMATH ) CHECK_CXX_COMPILER_FLAG( -arch:SSE2 CAN_DO_ARCHSSE2 ) if( CAN_DO_MFPMATH ) @@ -358,7 +371,7 @@ if( CMAKE_SIZEOF_VOID_P MATCHES "4" ) set( SSE2_ENABLE -arch:SSE2 ) set( SSE_MATTERS YES ) endif( CAN_DO_MFPMATH ) -endif( CMAKE_SIZEOF_VOID_P MATCHES "4" ) +endif( CMAKE_SIZEOF_VOID_P MATCHES "4" AND NOT CMAKE_OSX_ARCHITECTURES MATCHES ppc ) if( SSE_MATTERS ) if( WIN32 ) @@ -380,8 +393,7 @@ endif( SSE_MATTERS ) if( CMAKE_COMPILER_IS_GNUCXX ) if( PROFILE ) - set( CMAKE_C_FLinclude( FindFluidSynth.cmake ) -AGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -pg" ) + set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -pg" ) set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg" ) set( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -pg" ) set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -pg" ) @@ -391,17 +403,17 @@ AGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -pg" ) if( NOT PROFILE ) set( REL_CXX_FLAGS "${REL_CXX_FLAGS} -fomit-frame-pointer" ) endif( NOT PROFILE ) - set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${REL_CXX_FLAGS}" ) - set( CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${REL_CXX_FLAGS}" ) - set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${REL_CXX_FLAGS}" ) + set( CMAKE_CXX_FLAGS_RELEASE "${REL_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}" ) + set( CMAKE_CXX_FLAGS_MINSIZEREL "${REL_CXX_FLAGS} ${CMAKE_CXX_FLAGS_MINSIZEREL}" ) + set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${REL_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" ) - set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused" ) + set( CMAKE_CXX_FLAGS "-Wall -Wno-unused -Wextra -Wno-missing-field-initializers ${CMAKE_CXX_FLAGS}" ) # Remove extra warnings when using the official DirectX headers. # Also, TDM-GCC 4.4.0 no longer accepts glibc-style printf formats as valid, # which is a royal pain. The previous version I had been using was fine with them. if( WIN32 ) - set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas -Wno-comment -Wno-format" ) + set( CMAKE_CXX_FLAGS "-Wno-unknown-pragmas -Wno-comment -Wno-format ${CMAKE_CXX_FLAGS}" ) endif( WIN32 ) if( NOT NO_STRIP ) @@ -432,13 +444,6 @@ if( NOT STRNICMP_EXISTS ) add_definitions( -Dstrnicmp=strncasecmp ) endif( NOT STRNICMP_EXISTS ) -if( NOT WIN32 ) - CHECK_FUNCTION_EXISTS( sigtimedwait SIGTIMEDWAIT_EXISTS ) - if( SIGTIMEDWAIT_EXISTS ) - add_definitions( -DHAVE_SIGTIMEDWAIT ) - endif( SIGTIMEDWAIT_EXISTS ) -endif( NOT WIN32) - if( NOT MSVC ) add_definitions( -D__forceinline=inline ) endif( NOT MSVC ) @@ -538,13 +543,14 @@ else( WIN32 ) sdl/hardware.cpp sdl/i_cd.cpp sdl/i_input.cpp + sdl/i_joystick.cpp sdl/i_main.cpp sdl/i_movie.cpp sdl/i_system.cpp sdl/sdlvideo.cpp sdl/st_start.cpp ) if( APPLE ) - set( SYSTEM_SOURCES ${SYSTEM_SOURCES} sdl/SDLMain.m sdl/iwadpicker_cocoa.mm ) + set( SYSTEM_SOURCES ${SYSTEM_SOURCES} sdl/SDLMain.m sdl/iwadpicker_cocoa.mm sdl/i_system_cocoa.mm ) endif( APPLE ) endif( WIN32 ) @@ -609,6 +615,7 @@ add_executable( zdoom WIN32 ${SYSTEM_SOURCES} ${X86_SOURCES} x86.cpp + actorptrselect.cpp am_map.cpp b_bot.cpp b_func.cpp @@ -641,7 +648,6 @@ add_executable( zdoom WIN32 doomstat.cpp dsectoreffect.cpp dthinker.cpp - f_finale.cpp f_wipe.cpp farchive.cpp files.cpp @@ -655,17 +661,17 @@ add_executable( zdoom WIN32 hu_scores.cpp i_net.cpp info.cpp + keysections.cpp lumpconfigfile.cpp m_alloc.cpp m_argv.cpp m_bbox.cpp m_cheat.cpp m_joy.cpp - m_menu.cpp m_misc.cpp - m_options.cpp m_png.cpp m_random.cpp + memarena.cpp md5.cpp name.cpp nodebuild.cpp @@ -715,19 +721,18 @@ add_executable( zdoom WIN32 p_xlat.cpp parsecontext.cpp po_man.cpp - r_anim.cpp + r_swrenderer.cpp + r_utility.cpp + r_3dfloors.cpp r_bsp.cpp - r_data.cpp r_draw.cpp r_drawt.cpp - r_interpolate.cpp r_main.cpp r_plane.cpp r_polymost.cpp r_segs.cpp r_sky.cpp r_things.cpp - r_translate.cpp s_advsound.cpp s_environment.cpp s_playlist.cpp @@ -735,11 +740,14 @@ add_executable( zdoom WIN32 s_sound.cpp sc_man.cpp st_stuff.cpp + statistics.cpp stats.cpp stringtable.cpp + strnatcmp.c tables.cpp teaminfo.cpp tempfiles.cpp + v_blend.cpp v_collection.cpp v_draw.cpp v_font.cpp @@ -794,6 +802,21 @@ add_executable( zdoom WIN32 g_shared/sbar_mugshot.cpp g_shared/shared_hud.cpp g_shared/shared_sbar.cpp + intermission/intermission.cpp + intermission/intermission_parse.cpp + menu/colorpickermenu.cpp + menu/joystickmenu.cpp + menu/listmenu.cpp + menu/loadsavemenu.cpp + menu/menu.cpp + menu/menudef.cpp + menu/menuinput.cpp + menu/messagebox.cpp + menu/optionmenu.cpp + menu/playerdisplay.cpp + menu/playermenu.cpp + menu/readthis.cpp + menu/videomenu.cpp oplsynth/fmopl.cpp oplsynth/mlopl.cpp oplsynth/mlopl_io.cpp @@ -820,6 +843,7 @@ add_executable( zdoom WIN32 sound/music_mus_midiout.cpp sound/music_smf_midiout.cpp sound/music_hmi_midiout.cpp + sound/music_xmi_midiout.cpp sound/music_midistream.cpp sound/music_midi_base.cpp sound/music_midi_timidity.cpp @@ -829,6 +853,9 @@ add_executable( zdoom WIN32 sound/music_softsynth_mididevice.cpp sound/music_timidity_mididevice.cpp sound/music_win_mididevice.cpp + sound/music_pseudo_mididevice.cpp + textures/animations.cpp + textures/anim_switches.cpp textures/automaptexture.cpp textures/bitmap.cpp textures/buildtexture.cpp @@ -853,6 +880,7 @@ add_executable( zdoom WIN32 thingdef/thingdef_data.cpp thingdef/thingdef_exp.cpp thingdef/thingdef_expression.cpp + thingdef/thingdef_function.cpp thingdef/thingdef_parse.cpp thingdef/thingdef_properties.cpp thingdef/thingdef_states.cpp @@ -866,12 +894,29 @@ add_executable( zdoom WIN32 timidity/resample.cpp timidity/timidity.cpp xlat/parse_xlat.cpp + fragglescript/t_fspic.cpp + fragglescript/t_func.cpp + fragglescript/t_load.cpp + fragglescript/t_oper.cpp + fragglescript/t_parse.cpp + fragglescript/t_prepro.cpp + fragglescript/t_script.cpp + fragglescript/t_spec.cpp + fragglescript/t_variable.cpp + fragglescript/t_cmd.cpp + r_data/colormaps.cpp + r_data/sprites.cpp + r_data/voxels.cpp + r_data/renderstyle.cpp + r_data/r_interpolate.cpp + r_data/r_translate.cpp zscript/vmbuilder.cpp zscript/vmdisasm.cpp zscript/vmexec.cpp zscript/vmframe.cpp zscript/zcc_parser.cpp - autozend.cpp ) + autozend.cpp +) set_source_files_properties( xlat/parse_xlat.cpp PROPERTIES OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/xlat_parser.c" ) set_source_files_properties( sc_man.cpp PROPERTIES OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/sc_man_scanner.h" ) diff --git a/src/actionspecials.h b/src/actionspecials.h index c735c7a9d..b894a453a 100644 --- a/src/actionspecials.h +++ b/src/actionspecials.h @@ -36,7 +36,7 @@ DEFINE_SPECIAL(ClearForceField, 34, 1, 1, 1) // [RH] Remove Strife's forcefie DEFINE_SPECIAL(Floor_RaiseByValueTimes8, 35, 3, 3, 3) DEFINE_SPECIAL(Floor_LowerByValueTimes8, 36, 3, 3, 3) DEFINE_SPECIAL(Floor_MoveToValue, 37, 3, 4, 4) -DEFINE_SPECIAL(Ceiling_Waggle, 38, 5, 5, 4) // [RH] Complement of Floor_Waggle +DEFINE_SPECIAL(Ceiling_Waggle, 38, 5, 5, 5) // [RH] Complement of Floor_Waggle DEFINE_SPECIAL(Teleport_ZombieChanger, 39, 2, 2, 2) // [RH] Needed for Strife DEFINE_SPECIAL(Ceiling_LowerByValue, 40, 3, 3, 3) DEFINE_SPECIAL(Ceiling_RaiseByValue, 41, 3, 3, 3) @@ -69,7 +69,7 @@ DEFINE_SPECIAL(Floor_RaiseInstant, 67, 3, 3, 3) DEFINE_SPECIAL(Floor_MoveToValueTimes8, 68, 4, 4, 4) DEFINE_SPECIAL(Ceiling_MoveToValueTimes8, 69, 4, 4, 4) DEFINE_SPECIAL(Teleport, 70, 1, 3, 3) -DEFINE_SPECIAL(Teleport_NoFog, 71, 1, 3, 3) +DEFINE_SPECIAL(Teleport_NoFog, 71, 1, 4, 4) DEFINE_SPECIAL(ThrustThing, 72, 2, 4, 4) DEFINE_SPECIAL(DamageThing, 73, 1, 2, 2) DEFINE_SPECIAL(Teleport_NewMap, 74, 2, 3, 3) @@ -82,7 +82,7 @@ DEFINE_SPECIAL(ACS_Execute, 80, 1, 5, 5) DEFINE_SPECIAL(ACS_Suspend, 81, 2, 2, 2) DEFINE_SPECIAL(ACS_Terminate, 82, 2, 2, 2) DEFINE_SPECIAL(ACS_LockedExecute, 83, 5, 5, 5) -DEFINE_SPECIAL(ACS_ExecuteWithResult, 84, 1, 4, 4) +DEFINE_SPECIAL(ACS_ExecuteWithResult, 84, 1, 5, 5) DEFINE_SPECIAL(ACS_LockedExecuteDoor, 85, 5, 5, 5) DEFINE_SPECIAL(Polyobj_MoveToSpot, 86, 3, 3, 3) DEFINE_SPECIAL(Polyobj_Stop, 87, 1, 1, 1) @@ -95,6 +95,8 @@ DEFINE_SPECIAL(Polyobj_OR_MoveTimes8, 93, 4, 4, 4) DEFINE_SPECIAL(Pillar_BuildAndCrush, 94, 4, 5, 5) DEFINE_SPECIAL(FloorAndCeiling_LowerByValue, 95, 3, 3, 3) DEFINE_SPECIAL(FloorAndCeiling_RaiseByValue, 96, 3, 3, 3) +DEFINE_SPECIAL(Ceiling_LowerAndCrushDist, 97, 3, 5, 5) +DEFINE_SPECIAL(Sector_SetTranslucent, 98, 3, 4, 4) DEFINE_SPECIAL(Scroll_Texture_Left, 100, -1, -1, 2) DEFINE_SPECIAL(Scroll_Texture_Right, 101, -1, -1, 2) @@ -123,7 +125,7 @@ DEFINE_SPECIAL(UsePuzzleItem, 129, 2, 5, 5) DEFINE_SPECIAL(Thing_Activate, 130, 1, 1, 1) DEFINE_SPECIAL(Thing_Deactivate, 131, 1, 1, 1) DEFINE_SPECIAL(Thing_Remove, 132, 1, 1, 1) -DEFINE_SPECIAL(Thing_Destroy, 133, 1, 2, 2) +DEFINE_SPECIAL(Thing_Destroy, 133, 1, 3, 3) DEFINE_SPECIAL(Thing_Projectile, 134, 5, 5, 5) DEFINE_SPECIAL(Thing_Spawn, 135, 3, 4, 4) DEFINE_SPECIAL(Thing_ProjectileGravity, 136, 5, 5, 5) @@ -144,6 +146,7 @@ DEFINE_SPECIAL(Sector_Set3DFloor, 160, -1, -1, 5) DEFINE_SPECIAL(Sector_SetContents, 161, -1, -1, 3) // [RH] Begin new specials for ZDoom +DEFINE_SPECIAL(Ceiling_CrushAndRaiseDist, 168, 3, 5, 5) DEFINE_SPECIAL(Generic_Crusher2, 169, 5, 5, 5) DEFINE_SPECIAL(Sector_SetCeilingScale2, 170, 3, 3, 3) DEFINE_SPECIAL(Sector_SetFloorScale2, 171, 3, 3, 3) @@ -203,7 +206,7 @@ DEFINE_SPECIAL(Scroll_Ceiling, 224, 4, 4, 5) DEFINE_SPECIAL(Scroll_Texture_Offsets, 225, -1, -1, 1) DEFINE_SPECIAL(ACS_ExecuteAlways, 226, 1, 5, 5) DEFINE_SPECIAL(PointPush_SetForce, 227, -1, -1, 4) -DEFINE_SPECIAL(Plat_RaiseAndStayTx0, 228, 2, 2, 2) +DEFINE_SPECIAL(Plat_RaiseAndStayTx0, 228, 2, 3, 3) DEFINE_SPECIAL(Thing_SetGoal, 229, 3, 4, 4) DEFINE_SPECIAL(Plat_UpByValueStayTx, 230, 3, 3, 3) DEFINE_SPECIAL(Plat_ToggleCeiling, 231, 1, 1, 1) @@ -217,7 +220,7 @@ DEFINE_SPECIAL(Floor_RaiseToLowestCeiling, 238, 2, 2, 2) DEFINE_SPECIAL(Floor_RaiseByValueTxTy, 239, 3, 3, 3) DEFINE_SPECIAL(Floor_RaiseByTexture, 240, 2, 2, 2) DEFINE_SPECIAL(Floor_LowerToLowestTxTy, 241, 2, 2, 2) -DEFINE_SPECIAL(Floor_LowerToHighest, 242, 3, 3, 3) +DEFINE_SPECIAL(Floor_LowerToHighest, 242, 3, 4, 4) DEFINE_SPECIAL(Exit_Normal, 243, 1, 1, 1) DEFINE_SPECIAL(Exit_Secret, 244, 1, 1, 1) DEFINE_SPECIAL(Elevator_RaiseToNearest, 245, 2, 2, 2) @@ -226,7 +229,7 @@ DEFINE_SPECIAL(Elevator_LowerToNearest, 247, 2, 2, 2) DEFINE_SPECIAL(HealThing, 248, 1, 2, 2) DEFINE_SPECIAL(Door_CloseWaitOpen, 249, 3, 4, 4) DEFINE_SPECIAL(Floor_Donut, 250, 3, 3, 3) -DEFINE_SPECIAL(FloorAndCeiling_LowerRaise, 251, 3, 3, 3) +DEFINE_SPECIAL(FloorAndCeiling_LowerRaise, 251, 3, 4, 4) DEFINE_SPECIAL(Ceiling_RaiseToNearest, 252, 2, 2, 2) DEFINE_SPECIAL(Ceiling_LowerToLowest, 253, 2, 2, 2) DEFINE_SPECIAL(Ceiling_LowerToFloor, 254, 2, 2, 2) diff --git a/src/actor.h b/src/actor.h index 79b503468..f5cf9e648 100644 --- a/src/actor.h +++ b/src/actor.h @@ -37,8 +37,9 @@ #include "doomdef.h" #include "textures/textures.h" -#include "r_blend.h" +#include "r_data/renderstyle.h" #include "s_sound.h" +#include "memarena.h" struct subsector_t; class PClassAmmo; @@ -267,11 +268,11 @@ enum // --- mobj.flags5 --- - MF5_FASTER = 0x00000001, // moves faster when DF_FAST_MONSTERS or nightmare is on. - MF5_FASTMELEE = 0x00000002, // has a faster melee attack when DF_FAST_MONSTERS or nightmare is on. + /* = 0x00000001, */ + /* = 0x00000002, */ MF5_NODROPOFF = 0x00000004, // cannot drop off under any circumstances. /* = 0x00000008, */ - /* = 0x00000010, */ + MF5_COUNTSECRET = 0x00000010, // From Doom 64: actor acts like a secret MF5_AVOIDINGDROPOFF = 0x00000020, // Used to move monsters away from dropoffs MF5_NODAMAGE = 0x00000040, // Actor can be shot and reacts to being shot but takes no damage MF5_CHASEGOAL = 0x00000080, // Walks to goal instead of target if a valid goal is set. @@ -291,7 +292,7 @@ enum MF5_NOINTERACTION = 0x00200000, // Thing is completely excluded from any gameplay related checks MF5_NOTIMEFREEZE = 0x00400000, // Actor is not affected by time freezer MF5_PUFFGETSOWNER = 0x00800000, // [BB] Sets the owner of the puff to the player who fired it - MF5_SPECIALFIREDAMAGE=0x01000000, // Special treatment of PhoenixFX1 turned into a flag to removr + MF5_SPECIALFIREDAMAGE=0x01000000, // Special treatment of PhoenixFX1 turned into a flag to remove // dependence of main engine code of specific actor types. MF5_SUMMONEDMONSTER = 0x02000000, // To mark the friendly Minotaur. Hopefully to be generalized later. MF5_NOVERTICALMELEERANGE=0x04000000,// Does not check vertical distance for melee range @@ -325,6 +326,14 @@ enum MF6_BLOCKEDBYSOLIDACTORS = 0x00080000, // Blocked by solid actors, even if not solid itself MF6_ADDITIVEPOISONDAMAGE = 0x00100000, MF6_ADDITIVEPOISONDURATION = 0x00200000, + MF6_NOMENU = 0x00400000, // Player class should not appear in the class selection menu. + MF6_BOSSCUBE = 0x00800000, // Actor spawned by A_BrainSpit, flagged for timefreeze reasons. + MF6_SEEINVISIBLE = 0x01000000, // Monsters can see invisible player. + MF6_DONTCORPSE = 0x02000000, // [RC] Don't autoset MF_CORPSE upon death and don't force Crash state change. + MF6_POISONALWAYS = 0x04000000, // Always apply poison, even when target can't take the damage. + MF6_DOHARMSPECIES = 0x08000000, // Do hurt one's own species with projectiles. + MF6_INTRYMOVE = 0x10000000, // Executing P_TryMove + MF6_NOTAUTOAIMED = 0x20000000, // Do not subject actor to player autoaim. // --- mobj.renderflags --- @@ -395,7 +404,7 @@ enum EBounceFlags BOUNCE_Ceilings = 1<<2, // bounces off of ceilings BOUNCE_Actors = 1<<3, // bounces off of some actors BOUNCE_AllActors = 1<<4, // bounces off of all actors (requires BOUNCE_Actors to be set, too) - BOUNCE_AutoOff = 1<<5, // when bouncing off a floor, if the new Z velocity is below 3.0, disable further bouncing + BOUNCE_AutoOff = 1<<5, // when bouncing off a sector plane, if the new Z velocity is below 3.0, disable further bouncing BOUNCE_HereticType = 1<<6, // goes into Death state when bouncing on floors or ceilings BOUNCE_UseSeeSound = 1<<7, // compatibility fallback. This will only be set by @@ -407,6 +416,7 @@ enum EBounceFlags // MBF bouncing is a bit different from other modes as Killough coded many special behavioral cases // for them that are not present in ZDoom, so it is necessary to identify it properly. BOUNCE_MBF = 1<<12, // This in itself is not a valid mode, but replaces MBF's MF_BOUNCE flag. + BOUNCE_AutoOffFloorOnly = 1<<13, // like BOUNCE_AutoOff, but only on floors BOUNCE_TypeMask = BOUNCE_Walls | BOUNCE_Floors | BOUNCE_Ceilings | BOUNCE_Actors | BOUNCE_AutoOff | BOUNCE_HereticType | BOUNCE_MBF, @@ -509,7 +519,6 @@ public: int Amount; }; - // Map Object definition. class AActor : public DThinker { @@ -557,11 +566,11 @@ public: virtual void Tick (); // Called when actor dies - virtual void Die (AActor *source, AActor *inflictor); + virtual void Die (AActor *source, AActor *inflictor, int dmgflags = 0); // Perform some special damage action. Returns the amount of damage to do. // Returning -1 signals the damage routine to exit immediately - virtual int DoSpecialDamage (AActor *target, int damage); + virtual int DoSpecialDamage (AActor *target, int damage, FName damagetype); // Like DoSpecialDamage, but called on the actor receiving the damage. virtual int TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype); @@ -616,6 +625,9 @@ public: // Tosses an item out of the inventory. virtual AInventory *DropInventory (AInventory *item); + // Removes all items from the inventory. + void ClearInventory(); + // Returns true if this view is considered "local" for the player. bool CheckLocalView (int playernum) const; @@ -647,7 +659,7 @@ public: void ConversationAnimation (int animnum); // Make this actor hate the same things as another actor - void CopyFriendliness (AActor *other, bool changeTarget); + void CopyFriendliness (AActor *other, bool changeTarget, bool resetHealth=true); // Moves the other actor's inventory to this one void ObtainInventory (AActor *other); @@ -675,11 +687,14 @@ public: // Return starting health adjusted by skill level int SpawnHealth() const; - int GetGibHealth() const; - fixed_t GetCameraHeight() const; + inline bool isMissile(bool precise=true) + { + return (flags&MF_MISSILE) || (precise && GetDefault()->flags&MF_MISSILE); + } + // Check for monsters that count as kill but excludes all friendlies. bool CountsAsKill() const { @@ -724,6 +739,10 @@ public: return bloodcls; } + inline void SetFriendPlayer(player_t *player); + + bool IsVisibleToPlayer() const; + // Calculate amount of missile damage virtual int GetMissileDamage(int mask, int add); @@ -732,7 +751,10 @@ public: fixed_t GetGravity() const; bool IsSentient() const; const char *GetTag(const char *def = NULL) const; + void SetTag(const char *def); + // Triggers SECSPAC_Exit/SECSPAC_Enter and related events if oldsec != current sector + void CheckSectorTransition(sector_t *oldsec); // info for drawing // NOTE: The first member variable *must* be x. @@ -767,12 +789,17 @@ public: SDWORD tics; // state tic counter FState *state; SDWORD Damage; // For missiles and monster railgun + int projectileKickback; DWORD flags; DWORD flags2; // Heretic flags DWORD flags3; // [RH] Hexen/Heretic actor-dependant behavior made flaggable DWORD flags4; // [RH] Even more flags! DWORD flags5; // OMG! We need another one. DWORD flags6; // Shit! Where did all the flags go? + + // [BB] If 0, everybody can see the actor, if > 0, only members of team (VisibleToTeam-1) can see it. + DWORD VisibleToTeam; + int special1; // Special info int special2; // Special info int health; @@ -804,6 +831,8 @@ public: int special; // special int args[5]; // special arguments + int accuracy, stamina; // [RH] Strife stats -- [XA] moved here for DECORATE/ACS access. + AActor *inext, **iprev;// Links to other mobjs in same bucket TObjPtr goal; // Monster's goal if not chasing anything int waterlevel; // 0=none, 1=feet, 2=waist, 3=eyes @@ -811,7 +840,7 @@ public: BYTE MinMissileChance;// [RH] If a random # is > than this, then missile attack. SBYTE LastLookPlayerNumber;// Player number last looked for (if TIDtoHate == 0) WORD BounceFlags; // which bouncing type? - WORD SpawnFlags; + DWORD SpawnFlags; // Increased to DWORD because of Doom 64 fixed_t meleerange; // specifies how far a melee attack reaches. fixed_t meleethreshold; // Distance below which a monster doesn't try to shoot missiles anynore // but instead tries to come closer for a melee attack. @@ -827,16 +856,19 @@ public: int activationtype; // How the thing behaves when activated with USESPECIAL or BUMPSPECIAL int lastbump; // Last time the actor was bumped, used to control BUMPSPECIAL int Score; // manipulated by score items, ACS or DECORATE. The engine doesn't use this itself for anything. - FNameNoInit Tag; // Strife's tag name. FIXME: should be case sensitive! + FString * Tag; // Strife's tag name. + int DesignatedTeam; // Allow for friendly fire cacluations to be done on non-players. AActor *BlockingMobj; // Actor that blocked the last move line_t *BlockingLine; // Line that blocked the last move int PoisonDamage; // Damage received per tic from poison. + FNameNoInit PoisonDamageType; // Damage type dealt by poison. int PoisonDuration; // Duration left for receiving poison damage. int PoisonPeriod; // How often poison damage is applied. (Every X tics.) int PoisonDamageReceived; // Damage received per tic from poison. + FNameNoInit PoisonDamageTypeReceived; // Damage type received by poison. int PoisonDurationReceived; // Duration left for receiving poison damage. int PoisonPeriodReceived; // How often poison damage is applied. (Every X tics.) TObjPtr Poisoner; // Last source of received poison damage. @@ -873,8 +905,12 @@ public: SWORD PainChance; int PainThreshold; FNameNoInit DamageType; + FNameNoInit DamageTypeReceived; fixed_t DamageFactor; + FNameNoInit PainType; + FNameNoInit DeathType; + FState *SpawnState; FState *SeeState; FState *MeleeState; @@ -899,6 +935,7 @@ public: private: static AActor *TIDHash[128]; static inline int TIDHASH (int key) { return key & 127; } + static FSharedStringArena mStringPropertyData; friend class FActorIterator; @@ -916,6 +953,7 @@ public: virtual bool UpdateWaterLevel (fixed_t oldz, bool splash=true); bool isFast(); void SetIdle(); + void ClearCounters(); FState *FindState (FName label) const { @@ -1007,6 +1045,7 @@ inline T *Spawn (fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement) return static_cast(AActor::StaticSpawn (RUNTIME_CLASS(T), x, y, z, allowreplacement)); } + void PrintMiscActorInfo(AActor * query); #define S_FREETARGMOBJ 1 diff --git a/src/actorptrselect.cpp b/src/actorptrselect.cpp new file mode 100644 index 000000000..f1f50eeb5 --- /dev/null +++ b/src/actorptrselect.cpp @@ -0,0 +1,179 @@ +#include "actorptrselect.h" +#include "actor.h" +#include "d_player.h" +#include "p_pspr.h" + +//========================================================================== +// +// Standard pointer acquisition functions +// +// Possible effective results at run-time +// assigntovariable = NULL (or a RETURN statement is issued) +// P_BulletSlope(pointer_owner, &temporary), assigntovariable = temporary +// assigntovariable = pointer_owner->target or ...->master or ...->tracer +// +//========================================================================== + + +/* + COPY_AAPTR + + Result overview in order of priority: + + 1. Caller is player and a player specific selector is specified: Player specific selector is used. + 2. Caller is non-null and a general actor selector is specified: General actor selector is used. + 3. A static actor selector is specified: Static actor selector is used. + 4. The origin actor is used. + + Only one selector of each type can be used. +*/ + +#define AAPTR_RESOLVE_PLAYERNUM(playernum) (playeringame[playernum] ? players[playernum].mo : NULL) + +AActor *COPY_AAPTR(AActor *origin, int selector) +{ + if (origin) + { + if (origin->player) + { + switch (selector & AAPTR_PLAYER_SELECTORS) + { + case AAPTR_PLAYER_GETTARGET: + { + AActor *gettarget = NULL; + P_BulletSlope(origin, &gettarget); + return gettarget; + } + case AAPTR_PLAYER_GETCONVERSATION: + return origin->player->ConversationNPC; + } + } + + switch (selector & AAPTR_GENERAL_SELECTORS) + { + case AAPTR_TARGET: return origin->target; + case AAPTR_MASTER: return origin->master; + case AAPTR_TRACER: return origin->tracer; + case AAPTR_FRIENDPLAYER: + return origin->FriendPlayer ? AAPTR_RESOLVE_PLAYERNUM(origin->FriendPlayer - 1) : NULL; + } + } + + switch (selector & AAPTR_STATIC_SELECTORS) + { + case AAPTR_PLAYER1: return AAPTR_RESOLVE_PLAYERNUM(0); + case AAPTR_PLAYER2: return AAPTR_RESOLVE_PLAYERNUM(1); + case AAPTR_PLAYER3: return AAPTR_RESOLVE_PLAYERNUM(2); + case AAPTR_PLAYER4: return AAPTR_RESOLVE_PLAYERNUM(3); + case AAPTR_PLAYER5: return AAPTR_RESOLVE_PLAYERNUM(4); + case AAPTR_PLAYER6: return AAPTR_RESOLVE_PLAYERNUM(5); + case AAPTR_PLAYER7: return AAPTR_RESOLVE_PLAYERNUM(6); + case AAPTR_PLAYER8: return AAPTR_RESOLVE_PLAYERNUM(7); + case AAPTR_NULL: return NULL; + } + + return origin; +} + + +// [FDARI] Exported logic for guarding against loops in Target (for missiles) and Master (for all) chains. +// It is called from multiple locations. +// The code may be in need of optimisation. + + +//========================================================================== +// +// Checks whether this actor is a missile +// Unfortunately this was buggy in older versions of the code and many +// released DECORATE monsters rely on this bug so it can only be fixed +// with an optional flag +// +//========================================================================== + +void VerifyTargetChain(AActor *self, bool preciseMissileCheck) +{ + if (!self || !self->isMissile(preciseMissileCheck)) return; + + AActor *origin = self; + AActor *next = origin->target; + + // origin: the most recent actor that has been verified as appearing only once + // next: the next actor to be verified; will be "origin" in the next iteration + + while (next && next->isMissile(preciseMissileCheck)) // we only care when there are missiles involved + { + AActor *compare = self; + // every new actor must prove not to be the first actor in the chain, or any subsequent actor + // any actor up to and including "origin" has only appeared once + for (;;) + { + if (compare == next) + { + // if any of the actors from self to (inclusive) origin match the next actor, + // self has reached/created a loop + self->target = NULL; + return; + } + if (compare == origin) break; // when "compare" = origin, we know that the next actor is, and should be "next" + compare = compare->target; + } + + origin = next; + next = next->target; + } +} + +void VerifyMasterChain(AActor *self) +{ + // See VerifyTargetChain for detailed comments. + + if (!self) return; + AActor *origin = self; + AActor *next = origin->master; + while (next) // We always care (See "VerifyTargetChain") + { + AActor *compare = self; + for (;;) + { + if (compare == next) + { + self->master = NULL; + return; + } + if (compare == origin) break; + compare = compare->master; + } + + origin = next; + next = next->master; + } +} + +//========================================================================== +// +// Checks whether this actor is a missile +// Unfortunately this was buggy in older versions of the code and many +// released DECORATE monsters rely on this bug so it can only be fixed +// with an optional flag +// +//========================================================================== + +void ASSIGN_AAPTR(AActor *toActor, int toSlot, AActor *ptr, int flags) +{ + switch (toSlot) + { + case AAPTR_TARGET: + toActor->target = ptr; + if (!(PTROP_UNSAFETARGET & (flags))) VerifyTargetChain(toActor); + break; + + case AAPTR_MASTER: + toActor->master = ptr; + if (!(PTROP_UNSAFEMASTER & (flags))) VerifyMasterChain(toActor); + break; + + case AAPTR_TRACER: + toActor->tracer = ptr; + break; + } +} \ No newline at end of file diff --git a/src/actorptrselect.h b/src/actorptrselect.h new file mode 100644 index 000000000..ef19b05e7 --- /dev/null +++ b/src/actorptrselect.h @@ -0,0 +1,93 @@ +#pragma once + +//========================================================================== +// +// Standard pointer acquisition functions +// +// Possible effective results at run-time +// assigntovariable = NULL (or a RETURN statement is issued) +// P_BulletSlope(pointer_owner, &temporary), assigntovariable = temporary +// assigntovariable = pointer_owner->target or ...->master or ...->tracer +// +//========================================================================== + +class AActor; + +// Pointer selectors (enum) + +enum AAPTR +{ + AAPTR_DEFAULT = 0, + AAPTR_NULL = 0x1, + AAPTR_TARGET = 0x2, + AAPTR_MASTER = 0x4, + AAPTR_TRACER = 0x8, + + AAPTR_PLAYER_GETTARGET = 0x10, + AAPTR_PLAYER_GETCONVERSATION = 0x20, + + AAPTR_PLAYER1 = 0x40, + AAPTR_PLAYER2 = 0x80, + AAPTR_PLAYER3 = 0x100, + AAPTR_PLAYER4 = 0x200, + AAPTR_PLAYER5 = 0x400, + AAPTR_PLAYER6 = 0x800, + AAPTR_PLAYER7 = 0x1000, + AAPTR_PLAYER8 = 0x2000, + + AAPTR_FRIENDPLAYER = 0x4000, + + AAPTR_PLAYER_SELECTORS = + AAPTR_PLAYER_GETTARGET|AAPTR_PLAYER_GETCONVERSATION, + + AAPTR_GENERAL_SELECTORS = + AAPTR_TARGET|AAPTR_MASTER|AAPTR_TRACER|AAPTR_FRIENDPLAYER, + + AAPTR_STATIC_SELECTORS = + AAPTR_PLAYER1|AAPTR_PLAYER2|AAPTR_PLAYER3|AAPTR_PLAYER4| + AAPTR_PLAYER5|AAPTR_PLAYER6|AAPTR_PLAYER7|AAPTR_PLAYER8| + AAPTR_NULL + +}; + +/* + COPY_AAPTR + + Result overview in order of priority: + + 1. Caller is player and a player specific selector is specified: Player specific selector is used. + 2. Caller is non-null and a general actor selector is specified: General actor selector is used. + 3. A static actor selector is specified: Static actor selector is used. + 4. The origin actor is used. + + Only one selector of each type can be used. +*/ + +AActor *COPY_AAPTR(AActor *origin, int selector); + +enum PTROP +{ + PTROP_UNSAFETARGET = 1, + PTROP_UNSAFEMASTER = 2, + PTROP_NOSAFEGUARDS = PTROP_UNSAFETARGET|PTROP_UNSAFEMASTER +}; + + +// [FDARI] Exported logic for guarding against loops in Target (for missiles) and Master (for all) chains. +// It is called from multiple locations. +// The code may be in need of optimisation. + + +//========================================================================== +// +// Checks whether this actor is a missile +// Unfortunately this was buggy in older versions of the code and many +// released DECORATE monsters rely on this bug so it can only be fixed +// with an optional flag +// +//========================================================================== + +void VerifyTargetChain(AActor *self, bool preciseMissileCheck=true); +void VerifyMasterChain(AActor *self); +void ASSIGN_AAPTR(AActor *toActor, int toSlot, AActor *ptr, int flags) ; + diff --git a/src/am_map.cpp b/src/am_map.cpp index 73a7f8c98..44b6da619 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -33,12 +33,13 @@ #include "w_wad.h" #include "a_sharedglobal.h" #include "statnums.h" -#include "r_translate.h" +#include "r_data/r_translate.h" #include "d_event.h" #include "gi.h" -#include "r_bsp.h" #include "p_setup.h" #include "c_bind.h" +#include "farchive.h" +#include "r_renderer.h" #include "m_cheat.h" #include "i_system.h" @@ -63,6 +64,13 @@ #include "a_artifacts.h" #include "po_man.h" #include "a_keys.h" +#include "r_data/colormaps.h" + +//============================================================================= +// +// Automap colors +// +//============================================================================= struct AMColor { @@ -83,9 +91,9 @@ struct AMColor }; static AMColor Background, YourColor, WallColor, TSWallColor, - FDWallColor, CDWallColor, ThingColor, + FDWallColor, CDWallColor, EFWallColor, ThingColor, ThingColor_Item, ThingColor_CountItem, ThingColor_Monster, ThingColor_Friend, - SecretWallColor, GridColor, XHairColor, + SpecialWallColor, SecretWallColor, GridColor, XHairColor, NotSeenColor, LockedColor, AlmostBackground, @@ -119,6 +127,12 @@ static BYTE RavenPaletteVals[11*3] = 0, 0, 0, 0, 0, 0, }; +//============================================================================= +// +// globals +// +//============================================================================= + #define MAPBITS 12 #define MapDiv SafeDivScale12 #define MapMul MulScale12 @@ -155,9 +169,11 @@ CVAR (Color, am_backcolor, 0x6c5440, CVAR_ARCHIVE); CVAR (Color, am_yourcolor, 0xfce8d8, CVAR_ARCHIVE); CVAR (Color, am_wallcolor, 0x2c1808, CVAR_ARCHIVE); CVAR (Color, am_secretwallcolor, 0x000000, CVAR_ARCHIVE); +CVAR (Color, am_specialwallcolor, 0xffffff, CVAR_ARCHIVE); CVAR (Color, am_tswallcolor, 0x888888, CVAR_ARCHIVE); CVAR (Color, am_fdwallcolor, 0x887058, CVAR_ARCHIVE); CVAR (Color, am_cdwallcolor, 0x4c3820, CVAR_ARCHIVE); +CVAR (Color, am_efwallcolor, 0x665555, CVAR_ARCHIVE); CVAR (Color, am_thingcolor, 0xfcfcfc, CVAR_ARCHIVE); CVAR (Color, am_gridcolor, 0x8b5a2b, CVAR_ARCHIVE); CVAR (Color, am_xhaircolor, 0x808080, CVAR_ARCHIVE); @@ -165,6 +181,7 @@ CVAR (Color, am_notseencolor, 0x6c6c6c, CVAR_ARCHIVE); CVAR (Color, am_lockedcolor, 0x007800, CVAR_ARCHIVE); CVAR (Color, am_ovyourcolor, 0xfce8d8, CVAR_ARCHIVE); CVAR (Color, am_ovwallcolor, 0x00ff00, CVAR_ARCHIVE); +CVAR (Color, am_ovspecialwallcolor, 0xffffff, CVAR_ARCHIVE); CVAR (Color, am_ovthingcolor, 0xe88800, CVAR_ARCHIVE); CVAR (Color, am_ovotherwallscolor, 0x008844, CVAR_ARCHIVE); CVAR (Color, am_ovunseencolor, 0x00226e, CVAR_ARCHIVE); @@ -176,6 +193,7 @@ CVAR (Color, am_ovsecretsectorcolor,0x00ffff, CVAR_ARCHIVE); CVAR (Int, am_map_secrets, 1, CVAR_ARCHIVE); CVAR (Bool, am_drawmapback, true, CVAR_ARCHIVE); CVAR (Bool, am_showkeys, true, CVAR_ARCHIVE); +CVAR (Bool, am_showtriggerlines, false, CVAR_ARCHIVE); CVAR (Color, am_thingcolor_friend, 0xfcfcfc, CVAR_ARCHIVE); CVAR (Color, am_thingcolor_monster, 0xfcfcfc, CVAR_ARCHIVE); CVAR (Color, am_thingcolor_item, 0xfcfcfc, CVAR_ARCHIVE); @@ -287,72 +305,29 @@ struct islope_t // A line drawing of the player pointing right, // starting from the middle. // -#define R ((8*PLAYERRADIUS)/7) -mline_t player_arrow[] = { - { { -R+R/8, 0 }, { R, 0 } }, // ----- - { { R, 0 }, { R-R/2, R/4 } }, // -----> - { { R, 0 }, { R-R/2, -R/4 } }, - { { -R+R/8, 0 }, { -R-R/8, R/4 } }, // >----> - { { -R+R/8, 0 }, { -R-R/8, -R/4 } }, - { { -R+3*R/8, 0 }, { -R+R/8, R/4 } }, // >>---> - { { -R+3*R/8, 0 }, { -R+R/8, -R/4 } } -}; -#define NUMPLYRLINES (sizeof(player_arrow)/sizeof(mline_t)) - -mline_t player_arrow_raven[] = { - { { -R+R/4, 0 }, { 0, 0} }, // center line. - { { -R+R/4, R/8 }, { R, 0} }, // blade - { { -R+R/4, -R/8 }, { R, 0 } }, - { { -R+R/4, -R/4 }, { -R+R/4, R/4 } }, // crosspiece - { { -R+R/8, -R/4 }, { -R+R/8, R/4 } }, - { { -R+R/8, -R/4 }, { -R+R/4, -R/4} }, //crosspiece connectors - { { -R+R/8, R/4 }, { -R+R/4, R/4} }, - { { -R-R/4, R/8 }, { -R-R/4, -R/8 } }, //pommel - { { -R-R/4, R/8 }, { -R+R/8, R/8 } }, - { { -R-R/4, -R/8}, { -R+R/8, -R/8 } } -}; -#define NUMPLYRLINES_RAVEN (sizeof(player_arrow_raven)/sizeof(mline_t)) - -mline_t cheat_player_arrow[] = { - { { -R+R/8, 0 }, { R, 0 } }, // ----- - { { R, 0 }, { R-R/2, R/6 } }, // -----> - { { R, 0 }, { R-R/2, -R/6 } }, - { { -R+R/8, 0 }, { -R-R/8, R/6 } }, // >-----> - { { -R+R/8, 0 }, { -R-R/8, -R/6 } }, - { { -R+3*R/8, 0 }, { -R+R/8, R/6 } }, // >>-----> - { { -R+3*R/8, 0 }, { -R+R/8, -R/6 } }, - { { -R/2, 0 }, { -R/2, -R/6 } }, // >>-d---> - { { -R/2, -R/6 }, { -R/2+R/6, -R/6 } }, - { { -R/2+R/6, -R/6 }, { -R/2+R/6, R/4 } }, - { { -R/6, 0 }, { -R/6, -R/6 } }, // >>-dd--> - { { -R/6, -R/6 }, { 0, -R/6 } }, - { { 0, -R/6 }, { 0, R/4 } }, - { { R/6, R/4 }, { R/6, -R/7 } }, // >>-ddt-> - { { R/6, -R/7 }, { R/6+R/32, -R/7-R/32 } }, - { { R/6+R/32, -R/7-R/32 }, { R/6+R/10, -R/7 } } -}; -#define NUMCHEATPLYRLINES (sizeof(cheat_player_arrow)/sizeof(mline_t)) - -#undef R +static TArray MapArrow; +static TArray CheatMapArrow; +static TArray CheatKey; +static TArray EasyKey; #define R (MAPUNIT) // [RH] Avoid lots of warnings without compiler-specific #pragmas #define L(a,b,c,d) { {(fixed_t)((a)*R),(fixed_t)((b)*R)}, {(fixed_t)((c)*R),(fixed_t)((d)*R)} } -mline_t triangle_guy[] = { +static mline_t triangle_guy[] = { L (-.867,-.5, .867,-.5), L (.867,-.5, 0,1), L (0,1, -.867,-.5) }; #define NUMTRIANGLEGUYLINES (sizeof(triangle_guy)/sizeof(mline_t)) -mline_t thintriangle_guy[] = { +static mline_t thintriangle_guy[] = { L (-.5,-.7, 1,0), L (1,0, -.5,.7), L (-.5,.7, -.5,-.7) }; #define NUMTHINTRIANGLEGUYLINES (sizeof(thintriangle_guy)/sizeof(mline_t)) -mline_t square_guy[] = { +static mline_t square_guy[] = { L (0,1,1,0), L (1,0,0,-1), L (0,-1,-1,0), @@ -361,26 +336,6 @@ mline_t square_guy[] = { #define NUMSQUAREGUYLINES (sizeof(square_guy)/sizeof(mline_t)) #undef R -#define R (MAPUNIT) - -mline_t key_guy[] = { - L (-2, 0, -1.7, -0.5), - L (-1.7, -0.5, -1.5, -0.7), - L (-1.5, -0.7, -0.8, -0.5), - L (-0.8, -0.5, -0.6, 0), - L (-0.6, 0, -0.8, 0.5), - L (-1.5, 0.7, -0.8, 0.5), - L (-1.7, 0.5, -1.5, 0.7), - L (-2, 0, -1.7, 0.5), - L (-0.6, 0, 2, 0), - L (1.7, 0, 1.7, -1), - L (1.5, 0, 1.5, -1), - L (1.3, 0, 1.3, -1) -}; -#define NUMKEYGUYLINES (sizeof(key_guy)/sizeof(mline_t)) - -#undef L -#undef R @@ -396,8 +351,6 @@ CUSTOM_CVAR (Int, am_cheat, 0, 0) static int grid = 0; -static int leveljuststarted = 1; // kluge until AM_LevelInit() is called - bool automapactive = false; // location of window on screen @@ -449,8 +402,6 @@ static FTextureID marknums[10]; // numbers used for marking by the automap static mpoint_t markpoints[AM_NUMMARKPOINTS]; // where the points are static int markpointnum = 0; // next point to be assigned -static int followplayer = 1; // specifies whether to follow the player around - static FTextureID mapback; // the automap background static fixed_t mapystart=0; // y-value for the start of the map bitmap...used in the parallax stuff. static fixed_t mapxstart=0; //x-value for the bitmap. @@ -476,11 +427,14 @@ void AM_restoreScaleAndLoc (); void AM_minOutWindowScale (); +CVAR(Bool, am_followplayer, true, CVAR_ARCHIVE) + + CCMD(am_togglefollow) { - followplayer = !followplayer; + am_followplayer = !am_followplayer; f_oldloc.x = FIXED_MAX; - Printf ("%s\n", GStrings(followplayer ? "AMSTR_FOLLOWON" : "AMSTR_FOLLOWOFF")); + Printf ("%s\n", GStrings(am_followplayer ? "AMSTR_FOLLOWON" : "AMSTR_FOLLOWOFF")); } CCMD(am_togglegrid) @@ -545,6 +499,78 @@ void AM_getIslope (mline_t *ml, islope_t *is) } */ + +void AM_ParseArrow(TArray &Arrow, const char *lumpname) +{ + const int R = ((8*PLAYERRADIUS)/7); + FScanner sc; + int lump = Wads.CheckNumForFullName(lumpname, true); + if (lump >= 0) + { + sc.OpenLumpNum(lump); + sc.SetCMode(true); + while (sc.GetToken()) + { + mline_t line; + sc.TokenMustBe('('); + sc.MustGetFloat(); + line.a.x = xs_RoundToInt(sc.Float*R); + sc.MustGetToken(','); + sc.MustGetFloat(); + line.a.y = xs_RoundToInt(sc.Float*R); + sc.MustGetToken(')'); + sc.MustGetToken(','); + sc.MustGetToken('('); + sc.MustGetFloat(); + line.b.x = xs_RoundToInt(sc.Float*R); + sc.MustGetToken(','); + sc.MustGetFloat(); + line.b.y = xs_RoundToInt(sc.Float*R); + sc.MustGetToken(')'); + Arrow.Push(line); + } + } +} + +void AM_StaticInit() +{ + MapArrow.Clear(); + CheatMapArrow.Clear(); + CheatKey.Clear(); + EasyKey.Clear(); + + if (gameinfo.mMapArrow.IsNotEmpty()) AM_ParseArrow(MapArrow, gameinfo.mMapArrow); + if (gameinfo.mCheatMapArrow.IsNotEmpty()) AM_ParseArrow(CheatMapArrow, gameinfo.mCheatMapArrow); + AM_ParseArrow(CheatKey, "maparrows/key.txt"); + AM_ParseArrow(EasyKey, "maparrows/ravenkey.txt"); + if (MapArrow.Size() == 0) I_FatalError("No automap arrow defined"); + + char namebuf[9]; + + for (int i = 0; i < 10; i++) + { + mysnprintf (namebuf, countof(namebuf), "AMMNUM%d", i); + marknums[i] = TexMan.CheckForTexture (namebuf, FTexture::TEX_MiscPatch); + } + markpointnum = 0; + mapback.SetInvalid(); + + static DWORD *lastpal = NULL; + //static int lastback = -1; + DWORD *palette; + + palette = (DWORD *)GPalette.BaseColors; + + int i, j; + + for (i = j = 0; i < 11; i++, j += 3) + { + DoomColors[i].FromRGB(DoomPaletteVals[j], DoomPaletteVals[j+1], DoomPaletteVals[j+2]); + StrifeColors[i].FromRGB(StrifePaletteVals[j], StrifePaletteVals[j+1], StrifePaletteVals[j+2]); + RavenColors[i].FromRGB(RavenPaletteVals[j], RavenPaletteVals[j+1], RavenPaletteVals[j+2]); + } +} + //============================================================================= // // called by the coordinate drawer @@ -599,7 +625,7 @@ void AM_restoreScaleAndLoc () { m_w = old_m_w; m_h = old_m_h; - if (!followplayer) + if (!am_followplayer) { m_x = old_m_x; m_y = old_m_y; @@ -796,7 +822,7 @@ void AM_changeWindowLoc () { if (0 != (m_paninc.x | m_paninc.y)) { - followplayer = 0; + am_followplayer = false; f_oldloc.x = FIXED_MAX; } @@ -868,18 +894,6 @@ void AM_initVariables () old_m_h = m_h; } -/* -static void GetComponents (int color, DWORD *palette, float &r, float &g, float &b) -{ - if (palette) - color = palette[color]; - - r = (float)RPART(color); - g = (float)GPART(color); - b = (float)BPART(color); -} -*/ - //============================================================================= // // @@ -888,28 +902,11 @@ static void GetComponents (int color, DWORD *palette, float &r, float &g, float static void AM_initColors (bool overlayed) { - static DWORD *lastpal = NULL; - //static int lastback = -1; - DWORD *palette; - - palette = (DWORD *)GPalette.BaseColors; - - if (lastpal != palette) - { - int i, j; - - for (i = j = 0; i < 11; i++, j += 3) - { - DoomColors[i].FromRGB(DoomPaletteVals[j], DoomPaletteVals[j+1], DoomPaletteVals[j+2]); - StrifeColors[i].FromRGB(StrifePaletteVals[j], StrifePaletteVals[j+1], StrifePaletteVals[j+2]); - RavenColors[i].FromRGB(RavenPaletteVals[j], RavenPaletteVals[j+1], RavenPaletteVals[j+2]); - } - } - if (overlayed) { YourColor.FromCVar (am_ovyourcolor); WallColor.FromCVar (am_ovwallcolor); + SpecialWallColor.FromCVar(am_ovspecialwallcolor); SecretWallColor = WallColor; SecretSectorColor.FromCVar (am_ovsecretsectorcolor); ThingColor_Item.FromCVar (am_ovthingcolor_item); @@ -918,7 +915,7 @@ static void AM_initColors (bool overlayed) ThingColor_Monster.FromCVar (am_ovthingcolor_monster); ThingColor.FromCVar (am_ovthingcolor); LockedColor.FromCVar (am_ovotherwallscolor); - FDWallColor = CDWallColor = LockedColor; + EFWallColor = FDWallColor = CDWallColor = LockedColor; TSWallColor.FromCVar (am_ovunseencolor); NotSeenColor = TSWallColor; InterTeleportColor.FromCVar (am_ovtelecolor); @@ -932,10 +929,12 @@ static void AM_initColors (bool overlayed) Background.FromCVar (am_backcolor); YourColor.FromCVar (am_yourcolor); SecretWallColor.FromCVar (am_secretwallcolor); + SpecialWallColor.FromCVar (am_specialwallcolor); WallColor.FromCVar (am_wallcolor); TSWallColor.FromCVar (am_tswallcolor); FDWallColor.FromCVar (am_fdwallcolor); CDWallColor.FromCVar (am_cdwallcolor); + EFWallColor.FromCVar (am_efwallcolor); ThingColor_Item.FromCVar (am_thingcolor_item); ThingColor_CountItem.FromCVar (am_thingcolor_citem); ThingColor_Friend.FromCVar (am_thingcolor_friend); @@ -973,9 +972,10 @@ static void AM_initColors (bool overlayed) AlmostBackground = DoomColors[2]; SecretSectorColor = SecretWallColor = + SpecialWallColor = WallColor = DoomColors[3]; TSWallColor = DoomColors[4]; - FDWallColor = DoomColors[5]; + EFWallColor = FDWallColor = DoomColors[5]; LockedColor = CDWallColor = DoomColors[6]; ThingColor_Item = @@ -994,9 +994,10 @@ static void AM_initColors (bool overlayed) AlmostBackground = DoomColors[2]; SecretSectorColor = SecretWallColor = + SpecialWallColor = WallColor = StrifeColors[3]; TSWallColor = StrifeColors[4]; - FDWallColor = StrifeColors[5]; + EFWallColor = FDWallColor = StrifeColors[5]; LockedColor = CDWallColor = StrifeColors[6]; ThingColor_Item = StrifeColors[10]; @@ -1015,9 +1016,10 @@ static void AM_initColors (bool overlayed) AlmostBackground = DoomColors[2]; SecretSectorColor = SecretWallColor = + SpecialWallColor = WallColor = RavenColors[3]; TSWallColor = RavenColors[4]; - FDWallColor = RavenColors[5]; + EFWallColor = FDWallColor = RavenColors[5]; LockedColor = CDWallColor = RavenColors[6]; ThingColor = @@ -1030,30 +1032,6 @@ static void AM_initColors (bool overlayed) break; } - - lastpal = palette; -} - -//============================================================================= -// -// -// -//============================================================================= - -void AM_loadPics () -{ - int i; - char namebuf[9]; - - for (i = 0; i < 10; i++) - { - mysnprintf (namebuf, countof(namebuf), "AMMNUM%d", i); - marknums[i] = TexMan.CheckForTexture (namebuf, FTexture::TEX_MiscPatch); - } - - const char *autopage = level.info->mapbg[0] == 0? "AUTOPAGE" : (const char*)&level.info->mapbg[0]; - - mapback = TexMan.CheckForTexture(autopage, FTexture::TEX_MiscPatch); } //============================================================================= @@ -1078,7 +1056,8 @@ bool AM_clearMarks () void AM_LevelInit () { - leveljuststarted = 0; + const char *autopage = level.info->mapbg[0] == 0? "AUTOPAGE" : (const char*)&level.info->mapbg[0]; + mapback = TexMan.CheckForTexture(autopage, FTexture::TEX_MiscPatch); AM_clearMarks(); @@ -1116,7 +1095,6 @@ void AM_Start () if (!stopped) AM_Stop(); stopped = false; AM_initVariables(); - AM_loadPics(); } @@ -1228,7 +1206,7 @@ bool AM_Responder (event_t *ev, bool last) { if (automapactive && (ev->type == EV_KeyDown || ev->type == EV_KeyUp)) { - if (followplayer) + if (am_followplayer) { // check for am_pan* and ignore in follow mode const char *defbind = AutomapBindings.GetBind(ev->data1); @@ -1275,6 +1253,10 @@ void AM_changeWindowScale () { mtof_zoommul = int(M_ZOOMOUT); } + else + { + mtof_zoommul = MAPUNIT; + } am_zoomdir = 0; // Change the scaling multipliers @@ -1341,7 +1323,7 @@ void AM_Ticker () amclock++; - if (followplayer) + if (am_followplayer) { AM_doFollowPlayer(); } @@ -1484,28 +1466,28 @@ bool AM_clipMline (mline_t *ml, fline_t *fl) { dy = fl->a.y - fl->b.y; dx = fl->b.x - fl->a.x; - tmp.x = fl->a.x + (dx*(fl->a.y))/dy; + tmp.x = fl->a.x + Scale(dx, fl->a.y, dy); tmp.y = 0; } else if (outside & BOTTOM) { dy = fl->a.y - fl->b.y; dx = fl->b.x - fl->a.x; - tmp.x = fl->a.x + (dx*(fl->a.y-f_h))/dy; + tmp.x = fl->a.x + Scale(dx, fl->a.y - f_h, dy); tmp.y = f_h-1; } else if (outside & RIGHT) { dy = fl->b.y - fl->a.y; dx = fl->b.x - fl->a.x; - tmp.y = fl->a.y + (dy*(f_w-1 - fl->a.x))/dx; + tmp.y = fl->a.y + Scale(dy, f_w-1 - fl->a.x, dx); tmp.x = f_w-1; } else if (outside & LEFT) { dy = fl->b.y - fl->a.y; dx = fl->b.x - fl->a.x; - tmp.y = fl->a.y + (dy*(-fl->a.x))/dx; + tmp.y = fl->a.y + Scale(dy, -fl->a.x, dx); tmp.x = 0; } @@ -1561,7 +1543,7 @@ void AM_drawGrid (const AMColor &color) // [RH] Calculate a minimum for how long the grid lines should be so that // they cover the screen at any rotation. - minlen = (fixed_t)sqrtf ((float)m_w*(float)m_w + (float)m_h*(float)m_h); + minlen = (fixed_t)sqrt ((double)m_w*(double)m_w + (double)m_h*(double)m_h); extx = (minlen - m_w) / 2; exty = (minlen - m_h) / 2; @@ -1655,8 +1637,7 @@ void AM_drawSubsectors() points[j].Y = f_y + (f_h - (pt.y - m_y) * scale / float(1 << 24)); } // For lighting and texture determination - sector_t *sec = R_FakeFlat (subsectors[i].render_sector, &tempsec, &floorlight, - &ceilinglight, false); + sector_t *sec = Renderer->FakeFlat (subsectors[i].render_sector, &tempsec, &floorlight, &ceilinglight, false); // Find texture origin. mpoint_t originpt = { -sec->GetXOffset(sector_t::floor) >> FRACTOMAPBITS, sec->GetYOffset(sector_t::floor) >> FRACTOMAPBITS }; @@ -1676,6 +1657,65 @@ void AM_drawSubsectors() originy = f_y + (f_h - (originpt.y - m_y) * scale / float(1 << 24)); // Coloring for the polygon colormap = sec->ColorMap; + + FTextureID maptex = sec->GetTexture(sector_t::floor); + +#ifdef _3DFLOORS + + if (sec->e->XFloor.ffloors.Size()) + { + secplane_t *floorplane = &sec->floorplane; + + // Look for the highest floor below the camera viewpoint. + // Check the center of the subsector's sector. Do not check each + // subsector separately because that might result in different planes for + // different subsectors of the same sector which is not wanted here. + // (Make the comparison in floating point to avoid overflows and improve performance.) + double secx; + double secy; + double seczb, seczt; + double cmpz = FIXED2DBL(viewz); + + if (players[consoleplayer].camera && sec == players[consoleplayer].camera->Sector) + { + // For the actual camera sector use the current viewpoint as reference. + secx = FIXED2DBL(viewx); + secy = FIXED2DBL(viewy); + } + else + { + secx = FIXED2DBL(sec->soundorg[0]); + secy = FIXED2DBL(sec->soundorg[1]); + } + seczb = floorplane->ZatPoint(secx, secy); + seczt = sec->ceilingplane.ZatPoint(secx, secy); + + for (unsigned int i = 0; i < sec->e->XFloor.ffloors.Size(); ++i) + { + F3DFloor *rover = sec->e->XFloor.ffloors[i]; + if (!(rover->flags & FF_EXISTS)) continue; + if (rover->flags & FF_FOG) continue; + if (rover->alpha == 0) continue; + double roverz = rover->top.plane->ZatPoint(secx, secy); + // Ignore 3D floors that are above or below the sector itself: + // they are hidden. Since 3D floors are sorted top to bottom, + // if we get below the sector floor, we can stop. + if (roverz > seczt) continue; + if (roverz < seczb) break; + if (roverz < cmpz) + { + maptex = *(rover->top.texture); + floorplane = rover->top.plane; + break; + } + } + + lightlist_t *light = P_GetPlaneLight(sec, floorplane, false); + floorlight = *light->p_lightlevel; + colormap = light->extra_colormap; + } +#endif + // If this subsector has not actually been seen yet (because you are cheating // to see it on the map), tint and desaturate it. if (!(subsectors[i].flags & SSECF_DRAWN)) @@ -1691,16 +1731,19 @@ void AM_drawSubsectors() } // Draw the polygon. - screen->FillSimplePoly( - TexMan(sec->GetTexture(sector_t::floor)), - &points[0], points.Size(), - originx, originy, - scale / (FIXED2FLOAT(sec->GetXScale(sector_t::floor)) * float(1 << MAPBITS)), - scale / (FIXED2FLOAT(sec->GetYScale(sector_t::floor)) * float(1 << MAPBITS)), - rotation, - colormap, - floorlight - ); + FTexture *pic = TexMan(maptex); + if (pic != NULL && pic->UseType != FTexture::TEX_Null) + { + screen->FillSimplePoly(TexMan(maptex), + &points[0], points.Size(), + originx, originy, + scale / (FIXED2FLOAT(sec->GetXScale(sector_t::floor)) * float(1 << MAPBITS)), + scale / (FIXED2FLOAT(sec->GetYScale(sector_t::floor)) * float(1 << MAPBITS)), + rotation, + colormap, + floorlight + ); + } } } @@ -1806,6 +1849,69 @@ void AM_showSS() } } +#ifdef _3DFLOORS + +//============================================================================= +// +// Determines if a 3D floor boundary should be drawn +// +//============================================================================= + +bool AM_Check3DFloors(line_t *line) +{ + TArray &ff_front = line->frontsector->e->XFloor.ffloors; + TArray &ff_back = line->backsector->e->XFloor.ffloors; + + // No 3D floors so there's no boundary + if (ff_back.Size() == 0 && ff_front.Size() == 0) return false; + + int realfrontcount = 0; + int realbackcount = 0; + + for(unsigned i=0;iflags & FF_EXISTS)) continue; + if (rover->alpha == 0) continue; + realfrontcount++; + } + + for(unsigned i=0;iflags & FF_EXISTS)) continue; + if (rover->alpha == 0) continue; + realbackcount++; + } + // if the amount of 3D floors does not match there is a boundary + if (realfrontcount != realbackcount) return true; + + for(unsigned i=0;iflags & FF_EXISTS)) continue; + if (rover->alpha == 0) continue; + + bool found = false; + for(unsigned j=0;jflags & FF_EXISTS)) continue; + if (rover2->alpha == 0) continue; + if (rover->model == rover2->model && rover->flags == rover2->flags) + { + found = true; + break; + } + } + // At least one 3D floor in the front sector didn't have a match in the back sector so there is a boundary. + if (!found) return true; + } + // All 3D floors could be matched so let's not draw a boundary. + return false; +} +#endif + //============================================================================= // // Determines visible lines, draws them. @@ -1817,6 +1923,7 @@ void AM_drawWalls (bool allmap) { int i; static mline_t l; + int lock, color; for (i = 0; i < numlines; i++) { @@ -1852,8 +1959,16 @@ void AM_drawWalls (bool allmap) AM_drawMline(&l, SecretWallColor); else AM_drawMline(&l, WallColor); - } - else if ((lines[i].special == Teleport || + } else if (lines[i].locknumber > 0) { // [Dusk] specials w/ locknumbers + lock = lines[i].locknumber; + color = P_GetMapColorForLock(lock); + + AMColor c; + if (color >= 0) c.FromRGB(RPART(color), GPART(color), BPART(color)); + else c = LockedColor; + + AM_drawMline (&l, c); + } else if ((lines[i].special == Teleport || lines[i].special == Teleport_NoFog || lines[i].special == Teleport_ZombieChanger || lines[i].special == Teleport_Line) && @@ -1873,17 +1988,18 @@ void AM_drawWalls (bool allmap) else if (lines[i].special == Door_LockedRaise || lines[i].special == ACS_LockedExecute || lines[i].special == ACS_LockedExecuteDoor || - (lines[i].special == Generic_Door && lines[i].args[4] !=0 )) + (lines[i].special == Door_Animated && lines[i].args[3] != 0) || + (lines[i].special == Generic_Door && lines[i].args[4] != 0)) { if (am_colorset == 0 || am_colorset == 3) // Raven games show door colors { int P_GetMapColorForLock(int lock); - int lock; - if (lines[i].special==Door_LockedRaise) lock=lines[i].args[3]; + if (lines[i].special==Door_LockedRaise || lines[i].special==Door_Animated) + lock=lines[i].args[3]; else lock=lines[i].args[4]; - int color = P_GetMapColorForLock(lock); + color = P_GetMapColorForLock(lock); AMColor c; @@ -1897,6 +2013,17 @@ void AM_drawWalls (bool allmap) AM_drawMline (&l, LockedColor); // locked special } } + else if (am_showtriggerlines && am_colorset == 0 && lines[i].special != 0 + && lines[i].special != Door_Open + && lines[i].special != Door_Close + && lines[i].special != Door_CloseWaitOpen + && lines[i].special != Door_Raise + && lines[i].special != Door_Animated + && lines[i].special != Generic_Door + && (lines[i].activation & SPAC_PlayerActivate)) + { + AM_drawMline(&l, SpecialWallColor); // wall with special non-door action the player can do + } else if (lines[i].backsector == NULL) { AM_drawMline(&l, WallColor); // one-sided wall @@ -1911,6 +2038,12 @@ void AM_drawWalls (bool allmap) { AM_drawMline(&l, CDWallColor); // ceiling level change } +#ifdef _3DFLOORS + else if (AM_Check3DFloors(&lines[i])) + { + AM_drawMline(&l, EFWallColor); // Extra floor border + } +#endif else if (am_cheat != 0) { AM_drawMline(&l, TSWallColor); @@ -2059,20 +2192,15 @@ void AM_drawPlayers () angle = players[consoleplayer].camera->angle; } - if (gameinfo.gametype & GAME_Raven) + if (am_cheat != 0 && CheatMapArrow.Size() > 0) { - arrow = player_arrow_raven; - numarrowlines = NUMPLYRLINES_RAVEN; - } - else if (am_cheat != 0) - { - arrow = cheat_player_arrow; - numarrowlines = NUMCHEATPLYRLINES; + arrow = &CheatMapArrow[0]; + numarrowlines = CheatMapArrow.Size(); } else { - arrow = player_arrow; - numarrowlines = NUMPLYRLINES; + arrow = &MapArrow[0]; + numarrowlines = MapArrow.Size(); } AM_drawLineCharacter(arrow, numarrowlines, 0, angle, YourColor, pt.x, pt.y); return; @@ -2125,9 +2253,7 @@ void AM_drawPlayers () angle -= players[consoleplayer].camera->angle - ANG90; } - AM_drawLineCharacter - (player_arrow, NUMPLYRLINES, 0, angle, - color, pt.x, pt.y); + AM_drawLineCharacter(&MapArrow[0], MapArrow.Size(), 0, angle, color, pt.x, pt.y); } } } @@ -2138,6 +2264,49 @@ void AM_drawPlayers () // //============================================================================= +void AM_drawKeys () +{ + AMColor color; + mpoint_t p; + angle_t angle; + + TThinkerIterator it; + AKey *key; + + while ((key = it.Next()) != NULL) + { + p.x = key->x >> FRACTOMAPBITS; + p.y = key->y >> FRACTOMAPBITS; + angle = key->angle; + + if (am_rotate == 1 || (am_rotate == 2 && viewactive)) + { + AM_rotatePoint (&p.x, &p.y); + angle += ANG90 - players[consoleplayer].camera->angle; + } + + color = ThingColor; + if (key->flags & MF_SPECIAL) + { + // Find the key's own color. + // Only works correctly if single-key locks have lower numbers than any-key locks. + // That is the case for all default keys, however. + int P_GetMapColorForKey (AInventory * key); + int c = P_GetMapColorForKey(key); + + if (c >= 0) color.FromRGB(RPART(c), GPART(c), BPART(c)); + else color = ThingColor_CountItem; + AM_drawLineCharacter(&EasyKey[0], EasyKey.Size(), 0, 0, color, p.x, p.y); + } + } +} + +//============================================================================= +// +// +// +//============================================================================= + void AM_drawThings () { AMColor color; @@ -2176,14 +2345,19 @@ void AM_drawThings () // That is the case for all default keys, however. if (t->IsKindOf(RUNTIME_CLASS(AKey))) { - if (am_showkeys) + if (G_SkillProperty(SKILLP_EasyKey)) + { + // Already drawn by AM_drawKeys(), so don't draw again + color.Index = -1; + } + else if (am_showkeys) { int P_GetMapColorForKey (AInventory * key); int c = P_GetMapColorForKey(static_cast(t)); if (c >= 0) color.FromRGB(RPART(c), GPART(c), BPART(c)); else color = ThingColor_CountItem; - AM_drawLineCharacter(key_guy, NUMKEYGUYLINES, 16<= 2 || allthings) AM_drawThings(); diff --git a/src/am_map.h b/src/am_map.h index 20da6b96b..e4fe50856 100644 --- a/src/am_map.h +++ b/src/am_map.h @@ -25,6 +25,9 @@ struct event_t; class FArchive; + +void AM_StaticInit(); + // Called by main loop. bool AM_Responder (event_t* ev, bool last); diff --git a/src/asm_ia32/a.asm b/src/asm_ia32/a.asm index d68fba116..b4bc529f6 100644 --- a/src/asm_ia32/a.asm +++ b/src/asm_ia32/a.asm @@ -28,6 +28,9 @@ %define setupmvlineasm _setupmvlineasm %define mvlineasm1 _mvlineasm1 %define mvlineasm4 _mvlineasm4 + +%define R_SetupDrawSlabA _R_SetupDrawSlabA +%define R_DrawSlabA _R_DrawSlabA %endif EXTERN ylookup ; near @@ -44,9 +47,6 @@ EXTERN dc_dest EXTERN dc_source EXTERN dc_texturefrac -mvlineasm4_counter: - dd 0 - SECTION .text ALIGN 16 @@ -59,8 +59,45 @@ setvlinebpl_: mov [fixchain2ma+2], eax mov [fixchain2mb+2], eax selfmod fixchain1a, fixchain2mb+6 + +setdrawslabbpl: + mov dword [voxbpl1+2], eax + mov dword [voxbpl2+2], eax + mov dword [voxbpl3+2], eax + mov dword [voxbpl4+2], eax + mov dword [voxbpl5+2], eax + mov dword [voxbpl6+2], eax + mov dword [voxbpl7+2], eax + mov dword [voxbpl8+2], eax + selfmod voxbpl1, voxpl8+6 ret + SECTION .data + +lastslabcolormap: + dd 4 + + SECTION .text + +GLOBAL R_SetupDrawSlabA +GLOBAL @R_SetupDrawSlabA@4 +R_SetupDrawSlabA: + mov ecx, [esp+4] +@R_SetupDrawSlabA@4: + cmp [lastslabcolormap], ecx + je .done + mov [lastslabcolormap], ecx + mov dword [voxpal1+2], ecx + mov dword [voxpal2+2], ecx + mov dword [voxpal3+2], ecx + mov dword [voxpal4+2], ecx + mov dword [voxpal5+2], ecx + mov dword [voxpal6+2], ecx + mov dword [voxpal7+2], ecx + mov dword [voxpal8+2], ecx +.done ret + + ; pass it log2(texheight) ALIGN 16 @@ -549,6 +586,226 @@ mvcase0: jmp beginmvlineasm4 align 16 + +;************************************************************************* +;***************************** Voxel Slabs ******************************* +;************************************************************************* + +GLOBAL R_DrawSlabA +R_DrawSlabA: + push ebx + push ebp + push esi + push edi + + mov eax, [esp+5*4+0] + mov ebx, [esp+5*4+4] + mov ecx, [esp+5*4+8] + mov edx, [esp+5*4+12] + mov esi, [esp+5*4+16] + mov edi, [esp+5*4+20] + + cmp eax, 2 + je voxbegdraw2 + ja voxskip2 + xor eax, eax +voxbegdraw1: + mov ebp, ebx + shr ebp, 16 + add ebx, edx + dec ecx + mov al, byte [esi+ebp] +voxpal1: mov al, byte [eax+88888888h] + mov byte [edi], al +voxbpl1: lea edi, [edi+88888888h] + jnz voxbegdraw1 + jmp voxskipslab5 + +voxbegdraw2: + mov ebp, ebx + shr ebp, 16 + add ebx, edx + xor eax, eax + dec ecx + mov al, byte [esi+ebp] +voxpal2: mov al, byte [eax+88888888h] + mov ah, al + mov word [edi], ax +voxbpl2: lea edi, [edi+88888888h] + jnz voxbegdraw2 + jmp voxskipslab5 + +voxskip2: + cmp eax, 4 + jne voxskip4 + xor eax, eax +voxbegdraw4: + mov ebp, ebx + add ebx, edx + shr ebp, 16 + xor eax, eax + mov al, byte [esi+ebp] +voxpal3: mov al, byte [eax+88888888h] + mov ah, al + shl eax, 8 + mov al, ah + shl eax, 8 + mov al, ah + mov dword [edi], eax +voxbpl3: add edi, 88888888h + dec ecx + jnz voxbegdraw4 + jmp voxskipslab5 + +voxskip4: + add eax, edi + + test edi, 1 + jz voxskipslab1 + cmp edi, eax + je voxskipslab1 + + push eax + push ebx + push ecx + push edi +voxbegslab1: + mov ebp, ebx + add ebx, edx + shr ebp, 16 + xor eax, eax + mov al, byte [esi+ebp] +voxpal4: mov al, byte [eax+88888888h] + mov byte [edi], al +voxbpl4: add edi, 88888888h + dec ecx + jnz voxbegslab1 + pop edi + pop ecx + pop ebx + pop eax + inc edi + +voxskipslab1: + push eax + test edi, 2 + jz voxskipslab2 + dec eax + cmp edi, eax + jge voxskipslab2 + + push ebx + push ecx + push edi +voxbegslab2: + mov ebp, ebx + add ebx, edx + shr ebp, 16 + xor eax, eax + mov al, byte [esi+ebp] +voxpal5: mov al, byte [eax+88888888h] + mov ah, al + mov word [edi], ax +voxbpl5: add edi, 88888888h + dec ecx + jnz voxbegslab2 + pop edi + pop ecx + pop ebx + add edi, 2 + +voxskipslab2: + mov eax, [esp] + + sub eax, 3 + cmp edi, eax + jge voxskipslab3 + +voxprebegslab3: + push ebx + push ecx + push edi +voxbegslab3: + mov ebp, ebx + add ebx, edx + shr ebp, 16 + xor eax, eax + mov al, byte [esi+ebp] +voxpal6: mov al, byte [eax+88888888h] + mov ah, al + shl eax, 8 + mov al, ah + shl eax, 8 + mov al, ah + mov dword [edi], eax +voxbpl6: add edi, 88888888h + dec ecx + jnz voxbegslab3 + pop edi + pop ecx + pop ebx + add edi, 4 + + mov eax, [esp] + + sub eax, 3 + cmp edi, eax + jl voxprebegslab3 + +voxskipslab3: + mov eax, [esp] + + dec eax + cmp edi, eax + jge voxskipslab4 + + push ebx + push ecx + push edi +voxbegslab4: + mov ebp, ebx + add ebx, edx + shr ebp, 16 + xor eax, eax + mov al, byte [esi+ebp] +voxpal7: mov al, byte [eax+88888888h] + mov ah, al + mov word [edi], ax +voxbpl7: add edi, 88888888h + dec ecx + jnz voxbegslab4 + pop edi + pop ecx + pop ebx + add edi, 2 + +voxskipslab4: + pop eax + + cmp edi, eax + je voxskipslab5 + +voxbegslab5: + mov ebp, ebx + add ebx, edx + shr ebp, 16 + xor eax, eax + mov al, byte [esi+ebp] +voxpal8: mov al, byte [eax+88888888h] + mov byte [edi], al +voxbpl8: add edi, 88888888h + dec ecx + jnz voxbegslab5 + +voxskipslab5: + pop edi + pop esi + pop ebp + pop ebx + ret + +align 16 + %ifdef M_TARGET_MACHO GLOBAL _rtext_a_end _rtext_a_end: diff --git a/src/asm_ia32/tmap.asm b/src/asm_ia32/tmap.asm index cbcd9f4f1..00e633354 100644 --- a/src/asm_ia32/tmap.asm +++ b/src/asm_ia32/tmap.asm @@ -342,13 +342,13 @@ dsy3: shr ebp,26 mov edx,[ds_ystep] mov ecx,[ds_xfrac] dsy4: shr ecx,26 -dsm8: and edx,0xffffffc0 +dsm8: and edx,strict dword 0xffffffc0 or ebp,edx mov [esp+4],ebp mov ebp,[ds_yfrac] mov edx,[ds_xfrac] dsy2: shl edx,6 -dsm9: and ebp,0xffffffc0 +dsm9: and ebp,strict dword 0xffffffc0 or ecx,ebp shr esi,1 jnc dseven1 @@ -485,13 +485,13 @@ dmsy3: shr ebp,26 mov edx,[ds_ystep] mov ecx,[ds_xfrac] dmsy4: shr ecx,26 -dmsm8: and edx,0xffffffc0 +dmsm8: and edx,strict dword 0xffffffc0 or ebp,edx mov [esp+4],ebp mov ebp,[ds_yfrac] mov edx,[ds_xfrac] dmsy2: shl edx,6 -dmsm9: and ebp,0xffffffc0 +dmsm9: and ebp,strict dword 0xffffffc0 or ecx,ebp shr esi,1 jnc dmseven1 @@ -850,8 +850,8 @@ GLOBAL R_DrawColumnHorizP_ASM align 16 @R_DrawColumnHorizP_ASM@0: -R_DrawColumnHorizP_ASM: _R_DrawColumnHorizP_ASM: +R_DrawColumnHorizP_ASM: ; count = dc_yh - dc_yl; @@ -870,8 +870,10 @@ _R_DrawColumnHorizP_ASM: inc eax ; make 0 count mean 0 pixels and edx,3 push eax - mov esi,[dc_ctspan+edx*4] - lea eax,[dc_temp+ecx*4+edx] ; eax = top of column in buffer + mov eax,[dc_temp] + mov esi,[dc_ctspan+edx*4] + add eax,edx + lea eax,[eax+ecx*4] ; eax = top of column in buffer mov ebp,[dc_yh] mov [esi],ecx mov [esi+4],ebp @@ -1102,8 +1104,9 @@ _rt_copy1col_asm: lea esi,[eax*4] inc ebx ; ebx = count mov eax,edx - lea ecx,[dc_temp+ecx+esi] ; ecx = source + add ecx,esi mov edi,[ylookup+esi] + add ecx,[dc_temp] ; ecx = source mov esi,[dc_pitch] ; esi = pitch add eax,edi ; eax = dest add eax,[dc_destorg] @@ -1169,10 +1172,11 @@ _rt_copy4cols_asm: inc ebx ; ebx = count mov eax,ecx mov esi,[ylookup+edx*4] - lea ecx,[dc_temp+edx*4] ; ecx = source - mov edx,[dc_pitch] ; edx = pitch + mov ecx,[dc_temp] add eax,esi ; eax = dest add eax,[dc_destorg] + lea ecx,[ecx+edx*4] ; ecx = source + mov edx,[dc_pitch] ; edx = pitch shr ebx,1 jnc .even @@ -1241,7 +1245,8 @@ _rt_map1col_asm: mov esi,[dc_colormap] ; esi = colormap inc ebx ; ebx = count mov eax,edx - lea ebp,[dc_temp+ecx+edi] ; ebp = source + lea ebp,[ecx+edi] ; ebp = source + add ebp,[dc_temp] mov ecx,[ylookup+edi] mov edi,[dc_pitch] ; edi = pitch add eax,ecx ; eax = dest @@ -1320,7 +1325,8 @@ _rt_map4cols_asm1: mov eax,ecx inc ebx ; ebx = count mov edi,[ylookup+edx] - lea ebp,[dc_temp+edx] ; ebp = source + mov ebp,[dc_temp] + add ebp,edx ; ebp = source add eax,edi ; eax = dest mov edi,[dc_pitch] ; edi = pitch add eax,[dc_destorg] @@ -1414,7 +1420,8 @@ _rt_map4cols_asm2: mov eax,ecx inc ebx ; ebx = count mov edi,[ylookup+edx] - lea ebp,[dc_temp+edx] ; ebp = source + mov ebp,[dc_temp] + add ebp,edx ; ebp = source add eax,edi ; eax = dest mov edi,[dc_pitch] ; edi = pitch add eax,[dc_destorg] @@ -1493,10 +1500,11 @@ _rt_shaded4cols_asm: add eax,[dc_destorg] ; eax = destination push ebx push esi + mov esi,[dc_temp] inc ebp ; ebp = count add eax,[esp+16] push edi - lea esi,[dc_temp+ecx*4] ; esi = source + lea esi,[esi+ecx*4] ; esi = source align 16 @@ -1580,10 +1588,11 @@ _rt_add4cols_asm: add eax,[dc_destorg] push ebx push esi + mov esi,[dc_temp] push ebp inc edi add eax,[esp+20] - lea esi,[dc_temp+ecx*4] + lea esi,[esi+ecx*4] align 16 a4loop: @@ -1659,10 +1668,11 @@ _rt_addclamp4cols_asm: add eax,[dc_destorg] push ebx push esi + mov esi,[dc_temp] push ebp inc edi add eax,[esp+20] - lea esi,[dc_temp+ecx*4] + lea esi,[esi+ecx*4] push edi align 16 diff --git a/src/b_bot.cpp b/src/b_bot.cpp index 8b3018b3f..5d18acea4 100644 --- a/src/b_bot.cpp +++ b/src/b_bot.cpp @@ -12,6 +12,7 @@ #include "cmdlib.h" #include "teaminfo.h" #include "d_net.h" +#include "farchive.h" CVAR (Int, bot_next_color, 11, 0) CVAR (Bool, bot_observer, false, 0) @@ -105,11 +106,6 @@ FArchive &operator<< (FArchive &arc, botskill_t &skill) // This is intentionally not in the weapon definition anymore. void InitBotStuff() { - static bool done = false; - - if (done) return; - done = true; - static struct BotInit { const char *type; diff --git a/src/b_func.cpp b/src/b_func.cpp index efc3f7f57..d79e5df11 100644 --- a/src/b_func.cpp +++ b/src/b_func.cpp @@ -15,7 +15,6 @@ #include "g_game.h" #include "m_random.h" #include "r_sky.h" -#include "r_main.h" #include "st_stuff.h" #include "stats.h" #include "i_system.h" diff --git a/src/b_game.cpp b/src/b_game.cpp index f517f27ee..e97253c53 100644 --- a/src/b_game.cpp +++ b/src/b_game.cpp @@ -48,7 +48,6 @@ Everything that is changed is marked (maybe commented) with "Added by MC" #include "b_bot.h" #include "g_game.h" #include "m_random.h" -#include "r_things.h" #include "doomstat.h" #include "cmdlib.h" #include "sc_man.h" @@ -63,8 +62,6 @@ Everything that is changed is marked (maybe commented) with "Added by MC" static FRandom pr_botspawn ("BotSpawn"); -void InitBotStuff(); - //Externs FCajunMaster bglobal; @@ -321,7 +318,6 @@ bool FCajunMaster::SpawnBot (const char *name, int color) waitingforspawn[playernumber] = true; - InitBotStuff(); Net_WriteByte (DEM_ADDBOT); Net_WriteByte (playernumber); { @@ -478,6 +474,7 @@ static void appendinfo (char *&front, const char *back) { size_t newlen = strlen (back) + 2; newstr = new char[newlen]; + newstr[0] = 0; } strcat (newstr, "\\"); strcat (newstr, back); diff --git a/src/b_move.cpp b/src/b_move.cpp index 332160f1a..b456c0c84 100644 --- a/src/b_move.cpp +++ b/src/b_move.cpp @@ -12,7 +12,6 @@ #include "g_game.h" #include "d_ticcmd.h" #include "m_random.h" -#include "r_main.h" #include "i_system.h" #include "p_lnspec.h" #include "gi.h" diff --git a/src/b_think.cpp b/src/b_think.cpp index 1b6157246..e00eea827 100644 --- a/src/b_think.cpp +++ b/src/b_think.cpp @@ -14,7 +14,6 @@ #include "b_bot.h" #include "g_game.h" #include "m_random.h" -#include "r_main.h" #include "stats.h" #include "a_pickups.h" #include "statnums.h" diff --git a/src/c_bind.cpp b/src/c_bind.cpp index b9489ca65..0744efeee 100644 --- a/src/c_bind.cpp +++ b/src/c_bind.cpp @@ -124,7 +124,7 @@ static const FBinding DefBindings[] = { "pad_start", "pause" }, { "pad_back", "menu_main" }, { "lthumb", "crouch" }, - { NULL } + { NULL, NULL } }; static const FBinding DefRavenBindings[] = @@ -135,13 +135,13 @@ static const FBinding DefRavenBindings[] = { "pgdn", "+lookup" }, { "del", "+lookdown" }, { "end", "centerview" }, - { NULL } + { NULL, NULL } }; static const FBinding DefHereticBindings[] = { { "backspace", "use ArtiTomeOfPower" }, - { NULL } + { NULL, NULL } }; static const FBinding DefHexenBindings[] = @@ -156,7 +156,7 @@ static const FBinding DefHexenBindings[] = { "6", "use ArtiPork" }, { "5", "use ArtiInvulnerability2" }, { "scroll", "+showscores" }, - { NULL } + { NULL, NULL } }; static const FBinding DefStrifeBindings[] = @@ -167,7 +167,7 @@ static const FBinding DefStrifeBindings[] = { "z", "showpop 3" }, { "k", "showpop 2" }, { "q", "invquery" }, - { NULL } + { NULL, NULL } // not done // h - use health }; @@ -190,7 +190,7 @@ static const FBinding DefAutomapBindings[] = { "kp+", "+am_zoomin" }, { "mwheelup", "am_zoom 1.2" }, { "mwheeldown", "am_zoom -1.2" }, - { NULL } + { NULL, NULL } }; @@ -583,7 +583,7 @@ void FKeyBindings::ArchiveBindings(FConfigFile *f, const char *matchcmd) // //============================================================================= -int FKeyBindings::GetKeysForCommand (char *cmd, int *first, int *second) +int FKeyBindings::GetKeysForCommand (const char *cmd, int *first, int *second) { int c, i; @@ -609,7 +609,7 @@ int FKeyBindings::GetKeysForCommand (char *cmd, int *first, int *second) // //============================================================================= -void FKeyBindings::UnbindACommand (char *str) +void FKeyBindings::UnbindACommand (const char *str) { int i; @@ -829,6 +829,7 @@ bool C_DoKey (event_t *ev, FKeyBindings *binds, FKeyBindings *doublebinds) bool dclick; int dclickspot; BYTE dclickmask; + unsigned int nowtime; if (ev->type != EV_KeyDown && ev->type != EV_KeyUp) return false; @@ -841,10 +842,11 @@ bool C_DoKey (event_t *ev, FKeyBindings *binds, FKeyBindings *doublebinds) dclick = false; // This used level.time which didn't work outside a level. - if (DClickTime[ev->data1] > I_MSTime() && ev->type == EV_KeyDown) + nowtime = I_MSTime(); + if (doublebinds != NULL && DClickTime[ev->data1] > nowtime && ev->type == EV_KeyDown) { // Key pressed for a double click - if (doublebinds != NULL) binding = doublebinds->GetBinding(ev->data1); + binding = doublebinds->GetBinding(ev->data1); DClicked[dclickspot] |= dclickmask; dclick = true; } @@ -853,11 +855,11 @@ bool C_DoKey (event_t *ev, FKeyBindings *binds, FKeyBindings *doublebinds) if (ev->type == EV_KeyDown) { // Key pressed for a normal press binding = binds->GetBinding(ev->data1); - DClickTime[ev->data1] = I_MSTime() + 571; + DClickTime[ev->data1] = nowtime + 571; } - else if (DClicked[dclickspot] & dclickmask) + else if (doublebinds != NULL && DClicked[dclickspot] & dclickmask) { // Key released from a double click - if (doublebinds != NULL) binding = doublebinds->GetBinding(ev->data1); + binding = doublebinds->GetBinding(ev->data1); DClicked[dclickspot] &= ~dclickmask; DClickTime[ev->data1] = 0; dclick = true; diff --git a/src/c_bind.h b/src/c_bind.h index 7d71b462a..4c9edb2bb 100644 --- a/src/c_bind.h +++ b/src/c_bind.h @@ -57,8 +57,8 @@ public: void SetBinds(const FBinding *binds); bool DoKey(event_t *ev); void ArchiveBindings(FConfigFile *F, const char *matchcmd = NULL); - int GetKeysForCommand (char *cmd, int *first, int *second); - void UnbindACommand (char *str); + int GetKeysForCommand (const char *cmd, int *first, int *second); + void UnbindACommand (const char *str); void UnbindAll (); void UnbindKey(const char *key); void DoBind (const char *key, const char *bind); @@ -85,6 +85,7 @@ public: extern FKeyBindings Bindings; extern FKeyBindings DoubleBindings; extern FKeyBindings AutomapBindings; +extern FKeyBindings MenuBindings; bool C_DoKey (event_t *ev, FKeyBindings *binds, FKeyBindings *doublebinds); @@ -95,4 +96,18 @@ void C_UnbindAll (); extern const char *KeyNames[]; +struct FKeyAction +{ + FString mTitle; + FString mAction; +}; + +struct FKeySection +{ + FString mTitle; + FString mSection; + TArray mActions; +}; +extern TArray KeySections; + #endif //__C_BINDINGS_H__ diff --git a/src/c_cmds.cpp b/src/c_cmds.cpp index 17a5125af..4f59f53c8 100644 --- a/src/c_cmds.cpp +++ b/src/c_cmds.cpp @@ -30,8 +30,6 @@ ** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. **--------------------------------------------------------------------------- ** -** It might be a good idea to move these into files that they are more -** closely related to, but right now, I am too lazy to do that. */ #include @@ -61,13 +59,15 @@ #include "gi.h" #include "r_defs.h" #include "d_player.h" -#include "r_main.h" #include "templates.h" #include "p_local.h" #include "r_sky.h" #include "p_setup.h" #include "cmdlib.h" #include "d_net.h" +#include "v_text.h" +#include "p_lnspec.h" +#include "v_video.h" extern FILE *Logfile; extern bool insave; @@ -449,9 +449,9 @@ CCMD (puke) { int argc = argv.argc(); - if (argc < 2 || argc > 5) + if (argc < 2 || argc > 6) { - Printf (" puke