Commit Graph

115 Commits

Author SHA1 Message Date
Christoph Oelckers 87f3c9c5b7 - fixed: The floor waggle code used FloatBobOffsets as sine table but this
only has 64 entries and is not precise enough. It now uses finesine instead.
- fixed: When compositing a multipatch texture any patch that is a multpatch
  texture itself and contains rotations may not be composited directly into
  the destination buffer. This must be done with an intermediate buffer.
- Fixed: Drawing a slider in the options menu did not scale the x-coordinate.
- Fixed: If the alt HUD had to draw negative numbers the minus sign was misplaced
  due to incorrect texture coordinate calculations.
- changed option menu scaling for widescreen modes so that it doesn't scale down
  so quickly. 
- made some error messages in DECORATE that don't affect the parsing non-fatal
  so that the parser can continue to find more problems.

SVN r2076 (trunk)
2010-01-02 11:38:27 +00:00
Christoph Oelckers ba106c28c4 - fixed: old-style DECORATE definitions with non-alphanumeric characters in
the name produced an error.


SVN r2025 (trunk)
2009-12-13 22:22:25 +00:00
Christoph Oelckers 6161702703 - fixed: The sky baseline position needs to take texture scaling into account.
SVN r1982 (trunk)
2009-11-15 08:11:14 +00:00
Christoph Oelckers e0734b3c2d - ported GZDoom's new 'skyoffset' ANIMDEFS option for compatibility purposes.
SVN r1977 (trunk)
2009-11-13 21:28:39 +00:00
Randy Heit 4ebfdac887 - Changed all coordinates for DrawTexture() to floating point so that the
player sprites will retain the same precision they had when they were
  rendered as part of the 3D view. (needed for propery alignment of flashes
  on top of weapon sprites) It worked just fine for D3D, but software
  rendering was another matter. I consequently did battle with imprecisions
  in the whole masked texture drawing routines that had previously been
  partially masked by only drawing on whole pixel boundaries. Particularly,
  the tops of posts are calculated by multiplying by spryscale, and the
  texture mapping coordinates are calculated by multiplying by dc_iscale
  (where dc_iscale = 1 / spryscale). Since these are both 16.16 fixed point
  values, there is a significant variance. For best results, the drawing
  routines should only use one of these values, but that would mean
  introducing division into the inner loop. If the division removed the
  necessity for the fudge code in R_DrawMaskedColumn(), would it be worth it?
  Or would the divide be slower than the fudging? Or would I be better off
  doing it like Build and using transparent pixel checks instead, not
  bothering with skipping transparent areas? For now, I chop off the
  fractional part of the top coordinate for software drawing, since it was
  the easiest thing to do (even if it wasn't the most correct thing to do).


SVN r1955 (trunk)
2009-11-01 01:27:33 +00:00
Christoph Oelckers 8390184839 - fixed: FMultiPatchTexture::MakeTexture was missing a range check for the
special colormap index.


SVN r1928 (trunk)
2009-10-18 14:08:32 +00:00
Christoph Oelckers 7e4504f9d6 - Fixed: Coordinate handling for multipatch texture compositing was not correct
for true color. Instead of using a clipping rectangle on the destination it
  tried to alter the source offsets which produced incorrect results for
  mirrored or rotated patches.


SVN r1889 (trunk)
2009-09-30 10:41:24 +00:00
Randy Heit ed8f1ec8db - Fixed: Alt+F4 no longer quit the program.
SVN r1888 (trunk)
2009-09-30 04:44:14 +00:00
Christoph Oelckers 23c0f24160 - Fixed: The multitexture composition code was missing a NULL pointer check.
SVN r1880 (trunk)
2009-09-26 22:28:55 +00:00
Christoph Oelckers 3ff95001f5 - fixed: The changes for new colormap handling in FMultipatchtexture were incomplete.
Some code was still checking Blend.r instead of the full variable for colormap indices.



SVN r1879 (trunk)
2009-09-26 22:15:56 +00:00
Randy Heit 6a5ab0edc0 - Fixed: FMultiPatchTexture::CopyTrueColorPixels() should clear the buffer
first before drawing into it if the copy op passed to it is OP_OVERWRITE.
  FTexture::FillBuffer() sets this to erase whatever texture might have been
  in the space it is going into.


SVN r1874 (trunk)
2009-09-25 02:27:48 +00:00
Christoph Oelckers 9cc67f565c - Added a check to Dehacked code which tries to set the blend color.
It must set it to 0 if the alpha is 0 to avoid problems with special
  colormap detection.
- Changed SPECIALCOLORMAP_MASK again so that it does not interfere with
  any valid setting. It must use a value with a 0-alpha because these
  are guaranteed not to be produced by the DECORATE code elsewhere.
- Fixed precision issues with AddFixedColormap's search for identical colormaps.
- Added custom colormap support to texture composition code.
- Fixed initialization of FSpecialColormap::GrayscaleToColor. This is not
  a mapping from the palette but from a [0,255] grayscale ramp and used to
  apply colormaps to true color images for texture composition.

SVN r1867 (trunk)
2009-09-22 08:06:52 +00:00
Christoph Oelckers c285f38a02 - Fixed: When drawing with a special colormap the quad's flags weren't cleared
which could cause crashes.
- Added custom special colormaps to DECORATE.
- Cleaned up special colormap code and removed lots of dependencies on the
  knowledge of the tables' contents.



SVN r1860 (trunk)
2009-09-21 13:15:36 +00:00
Randy Heit b8eb530a0d - Fixed: Wall drawing handled fixed light levels improperly (but did not
completely ignore them, either).
- Separated light level fixing out of player_t's fixedcolormap parameter.
  Using a fixed light level (e.g. PowerTorch) will no longer wipe out
  colored lighting.
- Moved the blending rectangle drawing into a separate discrete stage, since
  doing it while copying the 3D view window to the display now blends
  underneath the weapon instead of on top of it.
- Consolidated the special colormaps into a single 2D table.
- Tweaked the special colormaps slightly to make the true color results more
  closely match the paletted approximations.
- fb_d3d9_shaders.h was getting unwieldy, so I moved the shaders out of the
  executable and into zdoom.pk3. Shaders are still precompiled so I don't need
  to pull in a dependancy on D3DX.
- Added a few more shaders to accomodate drawing weapons with all the in-game
  lighting models. These are accessed with the new DrawTexture tags
  DTA_SpecialColormap and DTA_ColormapStyle.
- Player weapon sprites are now drawn using Direct3D and receive all the
  benefits thereof.


SVN r1858 (trunk)
2009-09-20 03:50:05 +00:00
Christoph Oelckers 5822729943 - Fixed: The deprecated flag handler for the old bounce flags needs to clear
BOUNCE_MBF and BOUNCE_UseSeeSound, too, when clearing one of these flags.
- Fixed: When adding the AVOIDMELEE code the code was accidentally changed so that
  friendly monsters could no longer acquire targets by themselves.
- Renamed WIF_BOT_MELEE to WIF_MELEEWEAPON because it's no longer a bot only flag.
- Added MBF's monster_backing feature as an actor flag: AVOIDMELEE.


SVN r1848 (trunk)
2009-09-16 21:03:09 +00:00
Christoph Oelckers 8e4ba47c98 - fixed: The PNG loader for true color textures overwrote the IDAT size with
the IDAT id when reading the image.


SVN r1805 (trunk)
2009-09-07 05:48:34 +00:00
Randy Heit 6214177f1f - Fixed: S_LoadSound() did not byte-swap the frequency and length it reads
from DMX sounds.



SVN r1792 (trunk)
2009-09-04 22:59:41 +00:00
Randy Heit 3f003e06db - Replaced the use of autoconf's WORDS_BIGENDIAN with __BIG_ENDIAN__, since
latter comes predefined by GCC.


SVN r1779 (trunk)
2009-08-31 21:47:29 +00:00
Christoph Oelckers fe96cab254 - Fixed: paletted texture composition with part translucent patches
did not work.


SVN r1771 (trunk)
2009-08-12 22:10:53 +00:00
Christoph Oelckers 74bdfe19c5 - Fixed: The true color texture compositing code did not clip the edges
of multipatch textures used as patches on other multipatch textures.


SVN r1766 (trunk)
2009-08-10 18:30:25 +00:00
Randy Heit 93202a5488 - Removed -fno-strict-aliasing from the GCC flags for ZDoom and fixed the
issues that caused its inclusion. Is an optimized GCC build any faster
  for being able to use strict aliasing rules? I dunno. It's still slower
  than a VC++ build.
  
  I did run into two cases where TAutoSegIterator caused intractable problems
  with breaking strict aliasing rules, so I removed the templating from it,
  and the caller is now responsible for casting the probe value from void *.
- Removed #include "autosegs.h" from several files that did not need it
  (in particular, dobject.h when not compiling with VC++).


SVN r1743 (trunk)
2009-08-02 03:38:57 +00:00
Christoph Oelckers d26aeb8939 - Fixed: The composer for complex multipatch textures did not clear the palette
buffer before filling it.


SVN r1737 (trunk)
2009-07-25 09:11:15 +00:00
Randy Heit 720747baef - Added a "BlueMap" for powerup colors.
- Add the missing CF_WEAPONREADYALT and CF_WEAPONSWITCHOK flags.

SVN r1723 (trunk)
2009-07-17 01:17:06 +00:00
Christoph Oelckers 3ab370b6ee - added a compatibility option to restore the original Heretic bug where
a Minotaur couldn't spawn floor flames when standing in water having its
  feet clipped.
- added vid_vsync to display options.
- fixed: Animations of type 'Range' must be disabled if the textures don't
  come from the same definition unit (i.e both containing file and use type
  are identical.)
- changed: Item pushing is now only done once per P_XYMovement call.
- Increased the push factor of Heretic's pod to 0.5 so that its behavior
  more closely matches the original which depended on several bugs in the engine.
- Removed damage thrust clamping in P_DamageMobj and changed the thrust calculation
  to use floats to prevent overflows. The prevention of the overflows was the
  only reason the clamping was done.
- Added Raven's dagger-like vector sprite for the player to the automap code.


SVN r1668 (trunk)
2009-06-14 13:47:38 +00:00
Christoph Oelckers 8034b0558e - Fixed: Textures with dimensions <= 0 are invalid and should be treated as NULL
textures. They also must be set to dimensions other than (0,0) to avoid division
  by zero errors.
- Fixed: Random spawners did not handle the MF_DROPPED flag.


SVN r1602 (trunk)
2009-05-24 07:58:57 +00:00
Christoph Oelckers 4d5692bf80 - Fixed: Doom's fullscreen HUD was limited to 6 keys.
- Made 'next endgame' work again for cases where it is supposed to be
  the same as 'next endgame4'.
- GCC nitpick fix: Classes being used as template parameters may not be
  defined locally in a function. Fixed FWadFile::SetNamespace for that.
- Improved error reporting for incorrect textures in maps.
- Fixed: When music was stopped this was not set in the global music state.
- Fixed: Friendly monsters did not target enemy players in deathmatch.

SVN r1567 (trunk)
2009-05-02 09:14:01 +00:00
Christoph Oelckers b37d0ba2ea - Fixed: Completely empty patches (8 0-bytes) could not be handled by the
texture manager. They now get assigned a new FEmptyTexture object
  that is just a 1x1 pixel transparent texture.
- Fixed: Multiple namespace markers of the same type were no longer detected.
- Fixed sprite renaming.


SVN r1566 (trunk)
2009-04-30 11:10:38 +00:00
Christoph Oelckers cc066bc409 - complete restructuring of resource file handling for more flexibility and future
extensions.
- Removed merging of special namespaces. For the texture manager this has
  become totally useless so there is no need to do this anymore. Not merging
  the namespaces also allows a much more reliable detection of lumps belonging
  to special namespaces so the ScanForFlatHack function is no longer needed.
  Instead, any lump up to F_END with a length of 4096 will be marked for 
  inclusion as a flat texture if no F_START marker is found.
- Made the counting of intermission stats in Doom a GAMEINFO option so that
  it can be activated in all games.


SVN r1555 (trunk)
2009-04-23 22:49:38 +00:00
Randy Heit bdbb72e43d - Crap.
SVN r1548 (trunk)
2009-04-16 02:05:13 +00:00
Randy Heit 659be956de - Fixed: When FMultiPatchTexture::MakeTexture() needed to work in RGB
colorspace, it didn't zero out the temporary buffer.


SVN r1547 (trunk)
2009-04-16 02:02:56 +00:00
Randy Heit 6a9acc2cf8 - Fixed: World panning was ignored for the X offset of masked midtextures.
SVN r1541 (trunk)
2009-04-11 04:28:06 +00:00
Christoph Oelckers bbda4622e7 - Added a CopyInfo function to FTexture that contains all code required to
clone a texture. Used for creating warping textures.
- Fixed: P_FindFloorCeiling should not be called before setting the actor's z-
  coordinate. For testing 3D Midtex lines and 3D floors the proper position
  needs to be set first.
- Fixed the autoaim fix from Jan 10.


SVN r1358 (trunk)
2009-01-18 09:31:49 +00:00
Christoph Oelckers bbdb2b10a8 - Made spawning of floor- and ceiling huggers a little more intelligent.
SVN r1348 (trunk)
2009-01-03 18:09:33 +00:00
Christoph Oelckers 081658d3d5 - Fixed: The save percentage for Doom's green armor was slightly too low
which caused roundoff errors that made it less than 1/3 effective.
- Added support for "RRGGBB" strings to V_GetColor.
- Fixed: Desaturation maps for the TEXTURES lump were calculated incorrectly.
- Changed GetSpriteIndex to cache the last used sprite name so that the code
  using this function doesn't have to do it itself.
- Moved some more code for the state parser into p_states.cpp.
- Fixed: TDeletingArray should not try to delete NULL pointers.

SVN r1312 (trunk)
2008-12-07 12:11:59 +00:00
Christoph Oelckers c3906850f7 - fixed: bucket in FTextureManager::AddTexture should be a signed int.
SVN r1301 (trunk)
2008-11-30 13:42:30 +00:00
Christoph Oelckers 3f2d5db348 - Changed: Textures without a name no longer get added to the texture manager's
hash chains.
- Fixed: specifying texture patches or font characters by full lump name instead
  of texture name didn't work. To do this properly the texture manager needs
  an option to look for a texture by lump number so that such textures can
  be maintained without interfering with regular operation.
- added 'skystretch' and 'autosequences' keywords for MAPINFO so that the effects
  of 'noautosequences' and 'forcenoskystretch' can be cancelled.
- Added a 'gamedefaults' section to MAPINFO after discovering that 'defaultmap'
  gets reset for each MAPINFO. A global section is needed to define a game's
  default setting in zdoom.pk3. The gamedefaults should normally not be changed 
  by PWADs but it can be done if some mod intends to change gameplay settings 
  but wants to allow custom add-ons on its own.


SVN r1300 (trunk)
2008-11-30 12:49:27 +00:00
Christoph Oelckers e56fef0a8e - Fixed: The TEXTURES parser didn't report an error for invalid keywords.
- Fixed: The DECORATE expression evaluator was too strict with missing jump labels.
  For compatibility it only may print a warning, not an error.


SVN r1284 (trunk)
2008-11-08 08:29:51 +00:00
Christoph Oelckers bca1fc5068 - Fixed: The TEXTURES parser could copy beyond the end of a string when parsing
a 'define' definition.


SVN r1263 (trunk)
2008-10-14 07:57:16 +00:00
Christoph Oelckers 8a79985f46 - did some code cleanup and reorganization in thingdef.cpp.
- Replaced the translation parser for TEXTURES with FRemapTable::AddToTranslation.


SVN r1241 (trunk)
2008-09-21 22:25:23 +00:00
Randy Heit 00b21e4b96 - Apparently, YASM is not a suitable substitute for NASM when doing Win32 builds.
- Removed extraneous printf parameter for Texman.Init startup message.
- Added newlines to the ends of a few headers that were missing them.
- Fixed more GCC errors/warnings.

SVN r1232 (trunk)
2008-09-17 20:24:08 +00:00
Christoph Oelckers 3637c878cd - Changed: Replaced weapons should not be given by generic cheats, only
when explicitly giving them.
- Changed 'give weapon' cheat so that in single player it only gives weapons
  belonging to the current game or are placed in a weapon slot to avoid
  giving the Chex Quest weapons in Doom and vice versa.
- Fixed: The texture manager must be the first thing to be initialized
  because MAPINFO and DECORATE both can reference textures and letting them
  create their own textures is not safe.


SVN r1230 (trunk)
2008-09-17 00:14:33 +00:00
Christoph Oelckers 760f70d3f1 - Changed compilation for g_doom, g_heretic, g_hexen and g_strife folders
so that all files are included by a central one instead of compiling 
  each one separately. This speeds up the compilation process by 25%
  when doing a complete rebuild in Visual C.
- Cleaned up more header dependencies.

SVN r1226 (trunk)
2008-09-15 14:11:05 +00:00
Christoph Oelckers db5723997c - Cleaned up some include dependencies.
SVN r1224 (trunk)
2008-09-14 23:54:38 +00:00
Christoph Oelckers 61cbb1d2e1 - Fixed: A_Jump used a wrong index into the jump address table.
- Fixed: The recent changes in the DECORATE parser require the special parameter
  to A_CallSpecial to be an expression, not a constant.
- Removed game filters from old style decorations. No WAD in existence ever 
  used them and removing them allows to make the parser more robust.


SVN r1170 (trunk)
2008-08-14 19:08:38 +00:00
Christoph Oelckers b1d36182c4 - Changed handling of AUTOPAGE texture so that it is properly inserted into
the texture manager even if it is from Raven's IWADs.
- Removed code related to internal ActorInfo definitions from dobjtype.cpp.
- removed unneeded file dehackedactions.h


SVN r1162 (trunk)
2008-08-12 09:57:59 +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
Christoph Oelckers 6d9b897681 - fixed: Textures marked as complex must not redirect to the base patch.
- fixed: Alpha for composite textures was not applied.
- fixed: The CentaurMash didn't inherit from the Centaur.
- added some NULL pointer checks to the sound code.


SVN r1075 (trunk)
2008-07-20 08:34:24 +00:00
Randy Heit a3e8a0cefd - Removed the S_Sound() variant that allows for pointing the origin at an
arbitrary point. It has been replaced with a variant that takes a polyobject
  as a source, since that was the only use that couldn't be rewritten with the
  other variants. This also fixes the bug that polyobject sounds were not
  successfully saved and caused a crash when reloading the game. Note that
  this is a significant change to how equality of sound sources is determined,
  so some things may not behave quite the same as before. (Which would be a
  bug, but hopefully everything still sounds the same.)


SVN r1059 (trunk)
2008-07-01 04:06:56 +00:00
Christoph Oelckers ac32bd72bb - Added A_ClearReFire code pointer for weapons. Preferably A_WeaponReady should
reset this counter but that can't be done due to unwanted side effects with
  existing weapons.
- Changed the 'scale' variable in CVAR(turbo) to double because the calculations
  depended on the current floating point precision setting and only worked properly
  when set to 'precise' in VC++.


SVN r1057 (trunk)
2008-06-30 23:30:06 +00:00
Randy Heit 1462e5efa4 - Fixed compilation issues with GCC.
- Removed special case for nobotnodes in MAPINFO.


SVN r1045 (trunk)
2008-06-24 02:56:27 +00:00