Commit Graph

817 Commits

Author SHA1 Message Date
Christoph Oelckers c333a8ab82 - fixed an uninitialized variable in v_font.cpp
SVN r907 (trunk)
2008-04-12 22:18:38 +00:00
Christoph Oelckers 96b72f2e33 - Changed the internal Timidity player so that it uses timidity_mastervolume
because it has the same sound volume issues as the external one.
- Replaced use of stdio in Timidity with FileReader and added the option to read
  from the lump directory. If the main config file is inside the lump directory
  it will assume that everything else is as well. If it is a real file it will be
  assumed that the rest is real files as well.
- Fixed: None of the error returns in Timidity::read_config_file closed the file being read.


SVN r906 (trunk)
2008-04-12 21:36:10 +00:00
Christoph Oelckers 6b2a7b8b03 - Added Martin Howe's morph system update.
- Added support for defining composite textures in HIRESTEX. It is not fully tested
  and right now can't do much more than the old TEXTUREx method.
- Added a few NULL pointer checks to the texture code.
- Made duplicate class names in DECORATE non-fatal. There is really no stability
  concern here and the worst that can happen is that the wrong actor is spawned.
  This was a constant hassle when testing with WADs that contain duplicate resources.


SVN r905 (trunk)
2008-04-12 15:31:18 +00:00
Randy Heit b340f9c762 - Removed some GCC warnings.
- Fixed: MinGW doesn't have _get_pgmptr(), so it couldn't compile i_main.cpp.
- Fixed: MOD_WAVETABLE and MOD_SWSYNTH are not defined by w32api, so MinGW
  failed compiling the new MIDI code.
- Fixed: LocalSndInfo and LocalSndSeq in S_Start() need to be const char
  pointers, since "" is a constant.
- Fixed: parsecontext.h was missing a newline at the end of the file.


SVN r904 (trunk)
2008-04-12 05:33:20 +00:00
Randy Heit 0d18580ff0 - Fixed: Timidity::Channel::mono, rpn, and nrpn were not initialized. In
particular, this meant that every channel was almost certainly in mono mode,
  which can sound pretty bad if the song isn't meant to be played that way.
- Added bank numbers to the MIDI precaching for Timidity, since I guess I do
  need to care about banks, if even the Duke MIDIs use various banks.
- Fixed: snd_midiprecache only exists in Win32 builds, so gameconfigfile.cpp
  shouldn't unconditionally link against it.
- Fixed: pre_resample() was still disabled, and it left two samples at the end
  of the new wave data uninitialized.


SVN r903 (trunk)
2008-04-12 05:04:37 +00:00
Randy Heit 1809870824 - Moved the xmap table from timidity/tables.cpp to playmidi.cpp. Now I can get
rid of timidity/tables.cpp, which conflicts in name with the main Doom
  tables.cpp. (And interestingly, VC++ automatically renamed the object file,
  so I wasn't aware of the problem with GCC.)


SVN r902 (trunk)
2008-04-12 00:32:26 +00:00
Christoph Oelckers 4cba91a936 - Added a Gets function to the FileReader class which I planned to use
to enable Timidity to read its config from Zips. 
  I put this on hold though after finding out that the sound quality 
  isn't even near that of Timidity++.
- GCC-Fixes (FString::GetChars() for Printf calls)
- Added a dummy Weapon.NOLMS flag so that Skulltag weapons using this flag
  can be loaded


SVN r901 (trunk)
2008-04-11 10:16:29 +00:00
Randy Heit 10c0d67b78 - Changed the MIDIStreamer to send the all notes off controller to each
channel when restarting the song, rather than emitting a single note off
  event which only has a 1 in 127 chance of being for a note that's playing
  on that channel. Then I decided it would probably be a good idea to reset
  all the controllers as well.
- Increasing the size of the internal Timidity stream buffer from 1/14 sec
  (copied from the OPL player) improved its sound dramatically, so apparently
  Timidity has issues with short stream buffers. It's now at 1/2 sec in
  length. However, there seems to be something weird going on with
  corazonazul_ff6boss.mid near the beginning where it stops and immediately
  restarts a guitar on the exact same note.
- Added a new sound debugging cvar: snd_drawoutput, which can show various
  oscilloscopes and spectrums.
- Internal TiMidity now plays music.
- Changed the progdir global variable into an FString.

SVN r900 (trunk)
2008-04-11 04:59:23 +00:00
Christoph Oelckers 3f497fe8e5 - Eliminated some more global variables (onmobj, DoRipping, LastRipped,
MissileActor, bulletpitch and linetarget.) 

SVN r899 (trunk)
2008-04-10 14:38:43 +00:00
Christoph Oelckers a390ea6a61 - Replaced P_PathTraverse with an FPathTraverse class, rewrote all code using
P_PathTraverse and got rid of a lot of global variables in the process. 

SVN r898 (trunk)
2008-04-09 18:35:21 +00:00
Christoph Oelckers a0356a45cd SBarInfo Update #17:
- Fixed: SBarInfo tried to calculate scaled offsets on unscaled status bars.
- Added: createpopup to SBarInfo.  No we don't have custom popups yet.  It only
  defines the transition effect.  Currently none or slideinbottom.
- Made the first argument of DrawMugShot optional (think of it as an overloaded
  function).  The use of the first argument is deprecated due to the event of
  per player class faces.
- More changes from DrawImage to screen->DrawTexture().  I guess I didn't get
  them all just yet.


SVN r897 (trunk)
2008-04-09 07:32:33 +00:00
Randy Heit 6535283ff1 - Added the FCriticalSection class in critsec.h to make it easier to
use critical sections in other places besides the OPL player.


SVN r896 (trunk)
2008-04-09 04:17:13 +00:00
Randy Heit 68e4b3d946 - Reimplemented snd_midiprecache, now for MIDI as well as MUS, and
defaulting to false.


SVN r895 (trunk)
2008-04-09 03:55:04 +00:00
Christoph Oelckers 894b663877 - Eliminated all use of global variables used as output for P_CheckPosition
and P_TryMove. Moved BlockingLine and BlockingMobj into AActor because 
  the global variables can be easily overwritten with certain DECORATE 
  constructs.


SVN r894 (trunk)
2008-04-08 20:52:49 +00:00
Christoph Oelckers f7a1fb3978 - Removed some unnecessary morphing code.
- Fixed some bugs in the HIRESTEX parser.
- Added floating point support and #include and #define tokens to 
  FParseContext  Not used yet.
- replaced the value scanning code in FParseContext::GetToken with
  calls to strtol.


SVN r893 (trunk)
2008-04-08 17:25:19 +00:00
Christoph Oelckers 3a14dab2e8 - Fixed: The check arrays for BlockThingsIterators were not properly
freed and each iterator allocated a new one as a result.
- Split the Xlat parser context class into a generic part that can be 
  used for other Lemon-based parsers in the future and a smaller
  Xlat-specific part. 


SVN r892 (trunk)
2008-04-08 15:07:09 +00:00
Christoph Oelckers 17816dcadd - Changed: P_TeleportMove now always sets BlockingLine to NULL and
P_FindFloorCeiling doesn't set it at all. The way it was set in 
  PIT_FindFloorCeiling didn't look correct.
- Changed P_FindFloorCeiling so that it doesn't need global variables 
  anymore. I also moved the code to set the calling actor's information
  into this function because that's all it is used for. This also fixes
  another bug:
- AInventory::BecomePickup called P_FindFloorCeiling to get
  proper position values for the item but never set the item's information
  to the return value of this call.


SVN r891 (trunk)
2008-04-08 10:47:28 +00:00
Christoph Oelckers 4dc1b9579e - Removed the check for Heretic when playing *evillaugh when using the
Chaos Device. This sound is not defined by the other games so it won't
  play by default.
- Added MORPH_UNDOBYTOMEOFPOWER and MORPH_UNDOBYCHAOSDEVICE flags
  for the morph style so that the special behavior of these two items
  can be switched on and off. 

SVN r890 (trunk)
2008-04-08 09:52:50 +00:00
Christoph Oelckers a424a2f2a9 - Added Martin Howe's morph system enhancement.
SVN r889 (trunk)
2008-04-08 08:53:42 +00:00
Christoph Oelckers 0b26377624 - Removed PT_EARLYOUT from P_PathTraverse because it wasn't used anywhere.
- Rewrote BlockThingsIterator code not to use callbacks anymore.


SVN r888 (trunk)
2008-04-07 21:14:28 +00:00
Christoph Oelckers ebd17de30a - Fixed: PIT_FindFloorCeiling required tmx and tmy to be set but
P_FindFloorCeiling never did that.
- Merged Check_Sides and PIT_CrossLine into A_PainShootSkull.
- Replaced P_BlockLinesIterator with FBlockLinesIterator in all places it was
  used. This also allowed to remove all the global variable saving in
  P_CreateSecNodeList.
- Added a new FBlockLinesIterator class that doesn't need a callback
  function because debugging the previous bug proved to be a bit annoying
  because it involved a P_BlockLinesIterator loop.
- Fixed: The MBF code to move monsters away from dropoffs did not work as 
  intended due to some random decisions in P_DoNewChaseDir. When in the
  avoiding dropoff mode these are ignored now. This should cure the problem
  that monsters hanging over a dropoff tended to drop down. 

SVN r887 (trunk)
2008-04-06 17:33:43 +00:00
Christoph Oelckers d938121378 - Added a NOTIMEFREEZE flag that excludes actors from being affected by
the time freezer powerup.
- Changed: Empty pickup messages are no longer printed. 

SVN r886 (trunk)
2008-04-06 09:24:41 +00:00
Christoph Oelckers c5333d4abb - Changed secret sector drawing in automap so that lines with the ML_SECRET
flag are only drawn as part of a secret sector if that secret has already
  been found, even if the option is set to always show secret sectors.
- Added a NULL pointer check to WI_LoadBackground.


SVN r885 (trunk)
2008-04-05 19:10:37 +00:00
Christoph Oelckers eff5a4dad9 - Added the option to use $ as a prefix to a string table name everywhere in
MAPINFO where 'lookup' could be specified so that there is one consistent
  way to do it. 
- Added a missing NULL pointer check to S_Start.


SVN r884 (trunk)
2008-04-05 16:45:39 +00:00
Randy Heit fd21005391 - Fixed: The top-level Makefile doesn't need to test for msys, since $OS is still
set by the msys shell.

SVN r883 (trunk)
2008-04-05 16:35:38 +00:00
Christoph Oelckers e105a29e99 - Externalized all default episode definitions. Added an 'optional' keyword
to handle M4 and 5 in Doom and Heretic.
- Added P_CheckMapData functions and replaced all calls to P_OpenMapData that
  only checked for a map's presence with it.
- Added Martin Howe's player statusbar face submission.
- Added an 'adddefaultmap' option for MAPINFO. This is the same as 'defaultmap'
  but keeps all existing information in the default and just adds to it. This
  is needed because Hexen and Strife set some information in their base
  MAPINFO and using 'defaultmap' in a PWAD would override that.
- Fixed: Using MAPINFO's f1 option could cause memory leaks.
- Added option to load lumps by full name to several places:
  * Finale texts loaded from a text lump
  * Demos
  * Local SNDINFOs
  * Local SNDSEQs
  * Image names in FONTDEFS
  * intermission script names
- Changed the STCFN121 handling. The character is not an 'I' but a '|' so
  instead of discarding it it should be inserted at position 124.
- Renamed indexfont.fon to indexfont so that I could remove a special case
  from V_GetFont that was just added for this one font.
- Added a 'dumpspawnedthings' CVAR that enables a listing of all things in 
  the map and the actor type they spawned.


SVN r882 (trunk)
2008-04-05 12:14:33 +00:00
Christoph Oelckers 7b23f6eb8b SBarInfo Update #16:
- Added: fillzeros flag for drawnumber.  When set the string will always have
  a length of the specified size and zeros will fill in for the missing places.
  If the number is negative the negative sign will take the place of the last
  digit.
- Added: globalarray type to drawnumber which will display the value in a
  global array with the index set to the player's number.  Untested.
- Added: isselected command to SBarInfo.
- Fixed: Bi and Tri colored numbers didn't work.
- Fixed: Crash when using nullimage as the last image in drawswitchableimage.
- Applied Graf suggestion to include the y coord when calulating heights to fix
  most of the gaps caused by round off errors.  At least for now anyways and it
  is only applied for drawimage.
- SBarInfo inventory bars have been converted to use screen->DrawTexture() 

SVN r881 (trunk)
2008-04-05 07:06:26 +00:00
Christoph Oelckers 69002580e6 - Forgot to bump min. savegame version for last revision.
- Increased limit for demon/melee to 4. 

SVN r880 (trunk)
2008-04-04 17:10:15 +00:00
Christoph Oelckers cb1bd7739e - Fixed: P_CheckSwitchRange accessed invalid memory when testing a one-sided
line.
- Fixed: P_SpawnPuff assumed that all melee attacks have the same range
  (MELEERANGE) and didn't set the puff to its melee state if the range
  was different. Even worse, it checked a global variable for this so
  the behavior was undefined when P_SpawnPuff was called from anywhere
  else but P_LineAttack. To reduce the amount of parameters I combined
  this information with the hitthing and temporary parameters into one
  flags parameter. Also changed P_LineAttack so that it gets passed
  an additional parameter that specifies whether the attack is a melee
  attack or not and set this to true in all calls that are to be considered
  melee attacks. I couldn't use the damage type because A_CustomPunch
  and A_CustomMeleeAttack allow passing any damage type they want.
- Added a sprite option as an alternative of particles for FX_ROCKET 
  and FX_GRENADE.


SVN r879 (trunk)
2008-04-04 14:31:20 +00:00
Randy Heit de485ec662 - Changed the Makefiles that are used by both Linux and MinGW so that msys
detection occurs only if $OS is Windows_NT. Otherwise, spurious nul files
  are created when compiling on Linux.


SVN r878 (trunk)
2008-04-03 23:16:07 +00:00
Christoph Oelckers 935764e8c1 - Added Jim's latest Linux patch
SVN r877 (trunk)
2008-04-03 22:34:52 +00:00
Christoph Oelckers d780c2e3a4 - Fixed: The minimum parameter count for ACS_Execute and ACS_ExecuteAlways for
DECORATE was wrong (2 instead of 1.)
- Changed: Hexen set every cluster to be a hub if it hadn't been defined before
  a level using this cluster. Now it will only do that if HexenHack is true, 
  i.e. when original Hexen format MAPINFOs are parsed. For ZDoom format 
  MAPINFOs it will now be the same as for the other games which means that 
  'hub' has to be declared explicitly.
- Added an Idle state that is entered in place of the spawn state if a monster
  has to return to its inactive state if it can't find any more targets.
- Added MF5_NOINTERACTION flag which completely disables all physics related
  code for any actor with this flag. Mostly useful for particle effects where
  the actors just move a certain distance and then disappear.
- Removed the last remains of the antialias precalculation code from
  am_map.cpp because it was no longer used.
- Fixed: Two-sided lines bordering a secret sector were not drawn in the
  proper color
- Fixed: The automap didn't check ACS_LockedExecuteDoor for its lock color.


SVN r876 (trunk)
2008-04-03 10:49:54 +00:00
Randy Heit 799a4ea1bb - Switched sounds local to the listener from head-relative 3D sounds to 2D
sounds so stereo sounds have full separation. I tried using set3DSpread,
  but that still caused some blending of the channels.


SVN r875 (trunk)
2008-04-03 03:43:41 +00:00
Randy Heit d2c275bbb3 - Changed FScanner so that opening a lump gives the complete wad+lump name
rather than a generic one, so identifying errors among files that all have
  the same lump name no longer involves any degree of guesswork in
  determining exactly which file the error occurred in.
- Added a check to S_ParseSndSeq() for SNDSEQ lumps with unterminated final
  sequences.
- Fixed: Parts of s_sndseq.cpp that scan the Sequences array need NULL
  pointer checks, in case an improper sequence was encountered during
  parsing but not early enough to avoid creating a slot for it in the array.


SVN r874 (trunk)
2008-04-03 03:19:21 +00:00
Randy Heit b430977adf - Rearranged MIDIStreamer constructors to remove GCC warnings.
SVN r873 (trunk)
2008-04-03 02:36:01 +00:00
Randy Heit 3a5afd1418 - Added support for dumping from RAW/DRO/IMF files, so now anything that
can be played as OPL can also be dumped.
- Removed the opl_enable cvar, since OPL playback is now selectable as just
  another MIDI device.
- Added support for DRO playback and dual-chip RAW playback.
- Removed MUS support from OPLMUSSong, since using the OPLMIDIDevice with
  MUSSong2 works just as well. There are still lots of leftover bits in
  the class that should probably be removed at some point, too.
- Added dual-chip dumping support for the RAW format.
- Added DosBox Raw OPL (.DRO) dumping support. For whatever reason,
  in_adlib calculates the song length for this format wrong, even though
  the exact length is stored right in the header. (But in_adlib seems buggy
  in general; too bad it's the only Windows version of Adplug that seems to
  exist.)
- Rewrote the OPL dumper to work with MIDI as well as MUS.


SVN r872 (trunk)
2008-04-03 02:31:39 +00:00
Christoph Oelckers 298e465e22 - NULLed screen in CreateFrameBuffer if it's the same as 'old' and gets deleted.
SVN r871 (trunk)
2008-03-30 09:30:34 +00:00
Christoph Oelckers 5e6f709dbf - Changed: When the screen is being deleted the 'screen' variable should be
set to NULL before performing the delete. Otherwise, in some abnormal
  situations, it could happen that the destroyed screen object is still
  being accessed.
- Fixed: V_Shutdown didn't set OF_YesReallyDelete before deleting screen.


SVN r870 (trunk)
2008-03-30 08:58:36 +00:00
Christoph Oelckers 868782a843 - Fixed: The HIRESTEX parser didn't check if a graphic specified in a remap
command actually existed.
- Fixed: My $Limit fix from yesterday didn't work because NearLimit was
  an unsigned byte and the comparisons with -1 didn't work. Made it a
  signed word instead.
- Made sfxinfo_t::Link an unsigned int because it limited the amount of 
  usable sounds to 65535. 

SVN r869 (trunk)
2008-03-30 08:32:44 +00:00
Randy Heit f23e9df084 - Fixed: OPLMIDIDevice sent the wrong pitch wheel value to the player code.
Missimp.mid sounds a lot better now, though still a little off.
- Fixed: MIDI files that had ticks with nothing but meta-events did not play
  properly. (fixes sonic3_finalboss.mid)


SVN r868 (trunk)
2008-03-30 02:51:34 +00:00
Randy Heit f72635ac69 - Fixed broken compiling on Windows introduced by previous commit.
SVN r867 (trunk)
2008-03-30 00:34:09 +00:00
Randy Heit 930de248fd - Applied Const's Makefile.linux changes.
- Made the OPL MIDI synth available from Linux.



SVN r866 (trunk)
2008-03-30 00:04:09 +00:00
Christoph Oelckers d5c3693fd9 - Added SnowKate709's A_DamageMaster/A_DamageChildren patch.
- Added a SFX_TRANSFERAMBUSHFLAG for A_SpawnItemEx.
- Added "Shaded" as a valid parameter for DECORATE's RenderStyle.
- Added Karate Chris's patch for a MAPINFO option making Strife conversations
  not halt the game.
- Extended the $limit fix that $alias and $random definitions can have their
  own $limit now.
- Fixed: When resolving a linked sound the limit of the current sound was
  ignored and the one of the referenced sound being used. This was particularly
  noticable when using the chaingun in a group of Zombiemen.
- Added a namespc parameter to FWadCollection::CheckNumForFullName which is
  used when a normal lump name has to be looked up and changed all
  CheckNumForFullName/CheckNumForName combinations in the source to use
  the extended version of CheckNumForFullName only to have consistent
  behavior for lump name lookup. 

SVN r865 (trunk)
2008-03-29 22:59:41 +00:00
Randy Heit cd70087ed5 - Moved sound sample rate, buffer size, and buffer count to the
advanced sound options menu. Removed opl_enable from the menu.
- Added OPL synth as MIDI device -3. Since this is based on the MUS player
  code, it only supports those events and controllers supported by MUS.
  Some of Duke's MIDIs sound awful, but I think that may be more because
  it's using different instruments... There's a thread in the MIDI streamer
  class that could be taken out for Linux, since it doesn't need to deal
  with the Windows Multimedia API, but for now, this is still Windows-only.


SVN r864 (trunk)
2008-03-29 05:01:38 +00:00
Randy Heit 8f49ea7f48 - Changed the output of the OPL emulator from 32-bit integers to 32-bit
floats, so I can write its output directly to the stream buffer. In
  addition, this lets me bring the OPL volume level much closer to the
  standard MIDI volume.


SVN r863 (trunk)
2008-03-29 01:30:37 +00:00
Randy Heit 938ae1767b - Did some restructuring of the OPL code in preparation for turning it
into a general MIDI player.
- Fixed: Passing false for a stream callback did not stop the stream.
- Removed opl_frequency, since the only time the emulation sounds good is
  when it plays at the exact frequency of a real chip.
- Music no longer plays at all when snd_musicvolume is 0.
- Bumped up snd_sfxvolume and snd_musicvolume default values.

SVN r862 (trunk)
2008-03-28 03:19:18 +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 643fc792bd - forgot to save i_main.cpp before comitting.
SVN r860 (trunk)
2008-03-27 23:00:44 +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 39940fe20a - Added FMOD_OPENONLY to the callback version of CreateStream() to prevent it
from doing prebuffering of the song. This was causing the Linux version to
  hang while waiting for input from the pipe, since Timidity hadn't been
  started yet. I tried using a select call in the FillStream() method, but it
  always seems to return the pipe as having nothing available. Unfortunately,
  the game still falls all over itself if Timidity isn't available. Instead
  of execvp failing nicely, X errors kill the game. I don't know why it's
  doing that. My advice for Linux music: Skip Timidity++ and get a DLS patch
  set (/WINDOWS/system32/drivers/gm.dls is probably the most common by far)
  and set the snd_midipatchset cvar to point to it. It's faster and also
  sounds a whole lot better than the crappy freepats Ubuntu wants to install
  with Timidity++.
- GCC fixes.



SVN r858 (trunk)
2008-03-27 04:25:52 +00:00