Commit Graph

66 Commits

Author SHA1 Message Date
Christoph Oelckers 259ae41774 - sanitized the 'frozen level' code.
This had two different flags that were checked totally inconsistently, and one was not even saved.
Moved everything into a few subfunctions so that these checks do not have to be scattered all over the code.
2019-01-28 20:15:48 +01:00
Christoph Oelckers 66695ac6a0 - made most of the player spawn spot handliing functions members of FLevelLocals. 2019-01-28 02:44:05 +01:00
Christoph Oelckers 8323524014 - give thinkers a 'level' member and change linking to the chain to happen outside the constructor. 2019-01-27 01:49:20 +01:00
alexey.lysiuk 11958b713e - fixed many compilation errors with GCC and Clang 2019-01-23 20:45:01 +01:00
Christoph Oelckers 7b235ea13e - moved the per-level ACS state into FLevelLocals. 2019-01-05 18:19:35 +01:00
alexey.lysiuk 2ae8d39441 Removed all superfluous #include's
Automatically optimized by CLion IDE with manual corrections
2018-04-24 14:30:35 +03:00
alexey.lysiuk 31d1018b9a Fixed compilation warnings reported by GCC/Clang
b_game.cpp:537:27: warning: more '%' conversions than data arguments [-Wformat]
g_game.cpp:2982:40: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'long' [-Wsign-compare]
2017-12-03 14:57:34 +02:00
Christoph Oelckers 838e52001c - got rid of M_ReadFile(Malloc) which werew each used only once in the entire code. These were still using the low level POSIX-style file interface which shouldn't really be used anymore.
- let FScanner::OpenFile return an error instead of throwing an exception. The exception was never used anyway aside from being caught right away to be ignored.
2017-12-02 13:09:59 +01:00
Christoph Oelckers 96d328de9b - removed all Doom Source license and all default Raven copyright headers and replaced them with GPLv3. Also fixed the license in a few other files.
For some files that had the Doom Source license attached but saw heavy external contributions over the years I added a special note to license all original ZDoom code under BSD.
2017-04-17 13:33:19 +02:00
Christoph Oelckers cd180d29c7 - block direct use of 'new' for DObjects.
This is to ensure that the Class pointer can be set right on creation. ZDoom had always depended on handling this lazily which poses some problems for the VM.
So now there is a variadic Create<classtype> function taking care of that, but to ensure that it gets used, direct access to the new operator has been blocked.

This also neccessitated making DArgs a regular object because they get created before the type system is up. Since the few uses of DArgs are easily controllable this wasn't a big issue.

- did a bit of optimization on the bots' decision making whether to pick up a health item or not.
2017-04-14 13:31:58 +02:00
Christoph Oelckers 6599e2c425 - moved the VM types into their own file and only include it where really needed. 2017-04-13 01:12:04 +02:00
Christoph Oelckers 1423d5f42a - scriptified the SBARINFO wrapper.
This serves no purpose in itself but it removes a native side class from the status bar class hierarchy which allows for better editing options later.
2017-03-22 17:29:13 +01:00
Christoph Oelckers 9bffe4ee50 - scriptified the main statusbar interface and the Strife status bar.
Note that the Strife status bar does not draw the health bars yet. I tried to replace the hacky custom texture with a single fill operation but had to find out that all the coordinate mangling for the status bar is being done deep in the video code. This needs to be fixed before this can be made to work.

Currently this is not usable in mods because they cannot initialize custom status bars yet.
2017-03-22 00:32:52 +01:00
Christoph Oelckers 745b96beec - made the status screen a class and scriptified a few more functions. 2017-03-18 15:45:36 +01:00
Christoph Oelckers 8ab562ef13 - the fourth. 2017-03-08 18:55:54 +01:00
ZZYZX 39355cf45d Implemented player scripts. 2017-02-02 21:25:07 +02:00
Christoph Oelckers 04ff4282ef - removed the global 'sector_list' variable.
If the calling code wants to recycle this it will have to pass a container variable to AActor::UnlinkFromWorld and AActor::LinkToWorld.
This was changed because keeping such data in a global variable is dangerous for a set of functions that can be called from a script.
Note that the scripted versions do not yet support saving of the touching_sectorlist.
2016-12-25 22:40:26 +01:00
Christoph Oelckers e04055dbb2 - added multiple message levels for 'developer' CVAR so that the important stuff won't get drowned in pointless notification spam that's of no use to anyone.
- made 'developer' CVAR persist across launches and added some menu entries for it.
- added checks for 'developer' to ACS's CheckInventory function.
2016-08-28 09:55:04 +02:00
Christoph Oelckers ede07f93b2 - fixed: Failure to open bots.cfg would throw an exception that prevented the level from starting. Catch it in FCajunMaster::LoadBots instead and handle it non-disruptively. 2016-03-03 11:11:25 +01:00
Randy Heit 55142078d8 Normalize line endings 2016-03-01 09:47:10 -06:00
Christoph Oelckers 6adb069506 - rewrote p_local.h so that it doesn't pull in the entire bunch of headers.
This was to resolve some circular dependencies with the portal code.
The most notable changees:

 * FTextureID was moved from textures.h to doomtype.h because it is frequently needed in files that don't want to do anything with actual textures.
 * split off the parts from p_maputl into a separate header.
 * consolidated all blockmap related data into p_blockmap.h
 * split off the polyobject parts into po_man.h
2016-02-15 02:14:34 +01:00
Edward Richardson c1e362ee83 Added level transition spawning for missing starts
- Additional player bodies are spawned for any absent starts in co-op.
- Removed now-redundant bot start limitation
2016-01-30 22:02:27 +13:00
Randy Heit 786caaf36b Execute disconnect scripts immediately before the player is destroyed.
- Disconnect scripts were previously run at some point after the player
  left. Now they are run immediately before destroying the player. Since
  the player hasn't actually been destroyed yet, the player also gets to
  be the script's activator. This gives you a chance to scrape whatever data
  you want from the player before they're history. Note that if you do
  anything to make the script wait, the script's activator will become the
  world, as it was before.
2016-01-08 22:41:23 -06:00
ChillyDoom 7d628a8c03 - Fixed: FCajunMaster::End() was missing a bot check. 2014-12-24 19:41:49 +00:00
ChillyDoom aebf0e7526 - Fixed: Adding multiple bots at the same time could cause the game to crash if there were too few bots defined.
- The 'loaded_bots' variable no longer needs to be stored.
2014-12-21 19:21:51 +00:00
ChillyDoom e38aee070c - Changed TThinkerIterator loops back to MAXPLAYERS loops.
- Added STAT_BOT.
2014-11-15 08:58:29 +00:00
ChillyDoom ee977f94d7 - Moved bot thinking logic into DBot. 2014-11-14 16:54:56 +00:00
ChillyDoom a613da43dd - Bot movement is now calculated locally. 2014-11-08 17:38:09 +00:00
ChillyDoom 1b7c07df65 - Fixed: Bots added by different setting controllers could be assigned the same player number. 2014-10-25 14:58:10 +01:00
ChillyDoom acd4a71de2 - Fixed: New DBot instances were missing write barriers. 2014-10-21 19:33:48 +01:00
ChillyDoom c400dcf736 - Made DBot inherit from DObject. 2014-10-15 17:54:12 +01:00
ChillyDoom db323643f8 - Renamed FBot to DBot and made it inherit from DThinker.
- Fixed: Bots added by players other than the net arbitrator did not have their skill set.
2014-10-14 19:57:11 +01:00
ChillyDoom 83d84eaae9 - Moved bot related variables from player_t into a new FBot class. 2014-10-13 18:40:25 +01:00
Randy Heit da02a44126 Consolidate special path functions into m_specialpaths.cpp
- Also remove CDROM_DIR while I'm at it.
2013-09-14 21:04:00 -05:00
Edoardo Prezioso 4ce0574b3f - Use a more conformant C++ preprocessor macro identifier for Unix systems.
The 'unix' identifier isn't defined when '-std' is passed to the compiler (tested with gcc and clang), so use '__unix__' which is well enough documented.
2013-07-30 11:46:14 +02:00
Randy Heit 2668988870 - Switched to a genericly extensible representation for userinfo.
- Fixed: The playerinfo CCMD did not range check the player number.

SVN r4253 (trunk)
2013-05-12 18:27:03 +00:00
Christoph Oelckers f8bc459a21 - fix uninitialized string buffer in bot code.
SVN r3287 (trunk)
2011-08-31 22:49:24 +00:00
Christoph Oelckers 03177090c0 - removed some unnecessary r_ header #includes.
SVN r3257 (trunk)
2011-07-06 10:55:04 +00:00
Christoph Oelckers ececec1c65 - init bot specific actor properties righr after parsing DECORATE, not when spawning the first bot (which is too late.)
SVN r3032 (trunk)
2010-12-12 21:09:16 +00:00
Randy Heit b387752f2f - Applied latest TEAMINFO patch.
SVN r1400 (trunk)
2009-02-04 23:14:28 +00:00
Christoph Oelckers b07542ddd6 More header cleanup.
SVN r1225 (trunk)
2008-09-15 00:47:31 +00:00
Christoph Oelckers db5723997c - Cleaned up some include dependencies.
SVN r1224 (trunk)
2008-09-14 23:54:38 +00:00
Christoph Oelckers 5ea4b37373 - Added an Active and Inactive state for monsters.
- Made the speed a parameter to A_RaiseMobj and A_SinkMobj and deleted
  GetRaiseSpeed and GetSinkSpeed.
- Added some remaining DECORATE conversions for Hexen by Karate Chris.


SVN r1144 (trunk)
2008-08-10 11:29:19 +00:00
Randy Heit ad96225213 - Changed Linux to use clock_gettime for profiling instead of rdtsc. This
avoids potential erroneous results on multicore and variable speed
  processors. Windows will need to be updated accordingly.



SVN r1142 (trunk)
2008-08-10 03:25:08 +00:00
Christoph Oelckers ae54e13428 IMPORTANT NOTE: I uncommented some code depending on the missing x86.cpp file to allow this to compile, These changes must be reverted as soon as this file is added (see v_palette.cpp and win32/i_system.cpp.)
- Removed AT_GAME_SET because it's no longer used anywhere.
- Converted the last remaining global classes to DECORATE.
- Fixed: Inventory.PickupFlash requires an class name as parameter not an
  integer. Some Hexen definitions got it wrong.
- Converted Hexen's Pig to DECORATE.
- Replaced the ActorInfo definitions of all internal inventory classes with 
  DECORATE definitions.
- Added option to specify a powerup's duration in second by using a negative
  number.


SVN r1137 (trunk)
2008-08-09 11:35:42 +00:00
Randy Heit fb50df2c63 About a week's worth of changes here. As a heads-up, I wouldn't be
surprised if this doesn't build in Linux right now. The CMakeLists.txt
were checked with MinGW and NMake, but how they fair under Linux is an
unknown to me at this time.

- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
  FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
  This is so that I can use a series of mysnprintf() calls and advance the
  pointer for each one. Once the pointer goes beyond the end of the buffer,
  the count will go negative, but since it's an unsigned type it will be
  seen as excessively huge instead. This should not be a problem, as there's
  no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
  buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
  FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
  name when given a Hexen map number. This was fine with the old scanner
  code, but only a happy coincidence prevents it from crashing with the new
  code
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
  binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
  is probably broken until I get around to booting into Linux again. Niceties
  provided over the existing Makefiles they're replacing:
  * All command-line builds can use the same build system, rather than having
    a separate one for MinGW and another for Linux.
  * Microsoft's NMake tool is supported as a target.
  * Progress meters.
  * Parallel makes work from a fresh checkout without needing to be primed
    first with a single-threaded make.
  * Porting to other architectures should be simplified, whenever that day
    comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
  itself instead of generating an external makefile to do it, since I couldn't
  figure out how to generate a makefile with an external tool and include it
  with a CMake-generated makefile. Where makewad used a master list of files
  to generate the package file, zipdir just zips the entire contents of one or
  more directories.
- Added the gdtoa package from netlib's fp library so that ZDoom's printf-style
  formatting can be entirely independant of the CRT.

SVN r1082 (trunk)
2008-07-23 04:57:26 +00:00
Randy Heit 776d89428d - Changed D3DFB to explicitly request double buffering instead of assuming
that the drivers will treat a BackBufferCount of 0 as a request for
  double buffering.
- Fixed: Unsetting a cvar did not remove it from the list of tab
  completions.
- Added "" as a synonym for "nullimage" in SBARINFO.
- Fixed: MAKESAVESIG's stringifier in version.h did not work as expected.
  It stringified the passed macro name, not the value of the macro.
- Moved DCajunMaster off the DObject hierarchy.
- Changed DCajunMaster::getspawned into a TArray of FStrings. It was
  mysteriously being left pointing to uninitialized memory during the
  final GC at exit and crashing.
- Fixed: The code that removed hexdd.wad from the list of IWADs when
  hexen.wad was not present did not work.


SVN r861 (trunk)
2008-03-28 00:38:17 +00:00
Christoph Oelckers 997533e0c8 - Fixed: DCajunMaster::End was missing a write barrier for getspawned. The
same problem in D_DoomMain.
- Made bglobal a pointer because it was causing problems with the garbage 
  collector.


SVN r859 (trunk)
2008-03-27 22:37:13 +00:00
Randy Heit 8d0c48bf81 - The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other
  options to give the MIDI device name more room to display itself.
- Moved the midi device selection into the main sound menu.
- Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the
  default device. By default, it uses exactly the same DLS instruments as the
  Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set
  you want to use, set the snd_midipatchfile cvar to specify where it should
  load the instruments from.
- Changed the ProduceMIDI function to store its output into a TArray<BYTE>.
  An overloaded version wraps around it to continue to supply file-writing
  support for external Timidity++ usage.
- Added an FMOD credits banner to comply with their non-commercial license.
- Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather
  than a time in ms, this is now the length in samples of the DSP buffer.
  Also added the snd_buffercount cvar to offer complete control over the
  call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate
  below about 44kHz, you will need to set snd_buffersize to avoid long
  latencies.
- Reimplemented the snd_output cvar for the FMOD Ex sound system.
- Changed snd_samplerate default to 0. This now means to use the default
  sample rate.
- Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and
  snd_hrtf available through the menu.
- Split the HRTF effect selection into its own cvar: snd_hrtf.
- Removed 96000 Hz option from the menu. It's still available through the
  cvar, if desired.
- Fixed: If Windows sound init failed, retry with DirectSound. (Apparently,
  WASAPI doesn't work with more than two speakers and PCM-Float output at the
  same time.)
- Fixed: Area sounds only played from the front speakers once you got within
  the 2D panning area.


SVN r854 (trunk)
2008-03-26 04:27:07 +00:00
Randy Heit f2660dc336 - Merged the GC branch back into the trunk, so now it can receive more
testing from the people who download SVN trunk builds.

SVN r795 (trunk)
2008-03-12 02:56:11 +00:00