Commit Graph

150 Commits

Author SHA1 Message Date
Christoph Oelckers d8a1ce88b0 - a few more exports from FFont. 2017-02-05 13:55:38 +01:00
Christoph Oelckers b570d0819b - streamlined font handling for scripts a bit.
- moved the two 'you raised the alarm' messages for Strife to the string table
2017-02-05 13:14:22 +01:00
Rachael Alexanderson 59f32d497d Merge https://github.com/coelckers/gzdoom
# Conflicts:
#	src/r_things.cpp
#	src/v_draw.cpp
2017-02-05 00:08:01 -05:00
Christoph Oelckers abac756289 - exported some stuff for fonts and screen size that will be needed for the menus. 2017-02-04 00:46:22 +01:00
Rachael Alexanderson a78b713f4b Merge https://github.com/coelckers/gzdoom
# Conflicts:
#	src/v_video.cpp
2016-12-06 18:19:08 -05:00
Christoph Oelckers 21e3aba1c7 - optionally allow passing a script position object to V_GetColor and subfunctions for better error output. Implemented this for all occurences where this info was available. 2016-12-03 16:27:53 +01:00
Magnus Norddahl 5ef46d1730 Merge remote-tracking branch 'gzdoom/master' into qzdoom 2016-09-24 09:37:18 +02:00
Christoph Oelckers f93e4813d1 - removed farchive.cpp and .h 2016-09-22 00:48:22 +02:00
Christoph Oelckers ab43e0c8cb - all thinker serializers done. 2016-09-20 00:41:22 +02:00
Magnus Norddahl 8ba6a4f175 Precache, Unload and FillSimplePoly bug fix 2016-06-13 21:39:55 +02:00
Christoph Oelckers db86385cf6 - removed STACK_ARGS.
The only reason this even existed was that ZDoom's original VC projects used __fastcall. The CMake generated project do not, they stick to __cdecl.
Since no performance gain can be seen by using __fastcall the best course of action is to just remove all traces of it from the source and forget that it ever existed.
2016-04-11 10:46:30 +02:00
Randy Heit 55142078d8 Normalize line endings 2016-03-01 09:47:10 -06:00
Braden Obrzut 88a616da75 - Removed what appears to be a debug breakpoint.
- Cleared some GCC and Clang warnings. Mostly static analysis false positives, but one of them generated a pretty massive warning in a release build.
- Use -Wno-unused-result since I doubt we're going to address those unless they actually prove to be a problem (and they only appear in release builds).
2016-01-23 19:36:13 -05:00
Christoph Oelckers ca4179caa3 - allow texture lookup by full path names. Due to technical limitations this may result in double textures if the same graphics lump is also referenced by its short texture name. 2014-05-13 20:51:16 +02:00
Edoardo Prezioso 1fb757f6f1 - Fixed useless 'array != NULL' check.
- 'notranslate != NULL' is completely useless, because 'notranslate' is an array, hence removed.
- I interpreted 'SbarInfoScript != NULL' as a typo, since 1)in the next expression inside the condition there's a dereference to 'SBarInfoScript[SCRIPT_CUSTOM]' and 2)'SBarInfoScript[SCRIPT_CUSTOM]' is checked against 'NULL', in line 352, and then dereferenced when introducing 'cstype'.
2014-03-01 22:27:40 +01:00
Randy Heit 8565484e29 - Heretic and Hexen can now have their big fonts overridden by a font named "HBIGFONT". In
addition, a font named "BIGFONT" will override the big font for every game.

SVN r4302 (trunk)
2013-06-01 02:04:44 +00:00
Braden Obrzut dabd48ab81 - Fixed: 4, 2, and 1 bit grayscale images weren't properly supported.
- Fixed: Valgrind uninitialized memory error and a signed/unsigned warning.

SVN r4288 (trunk)
2013-05-26 04:03:47 +00:00
Randy Heit ce28c9c991 - Added parentheses for clarity.
SVN r4286 (trunk)
2013-05-26 00:53:48 +00:00
Randy Heit 6ada6158ef - Added a fallback for accented characters to use unaccented ones.
- Updated Portuguese strings with the version here: http://forum.zdoom.org/viewtopic.php?p=672839#p672839

SVN r4271 (trunk)
2013-05-17 02:35:35 +00:00
Randy Heit cc5110575f - Fixed: The constructor for single-lump fonts did not initialize the Cursor field.
SVN r4239 (trunk)
2013-04-30 03:14:49 +00:00
Braden Obrzut c845675b9b - Fixed: When using PALVERS on the sky, it used the scaling from the true color version. (Side Note: I changed a line that scales the sky position according to the y scaling factor. This is because a 2x high resolution sky at 2048x256 wasn't positioned the same as a 1024x128 unscaled version. I moved the expression to the > 200 height path only, but I'm not sure if it's even still needed.)
- Fixed: PALVERS crashed with unknown textures since a value was never given for %s.
- Fixed: FON2 loader didn't set ActiveColors correctly.

SVN r3973 (trunk)
2012-11-30 23:36:02 +00:00
Braden Obrzut cb296a6660 - Fixed: Valgrind error when copying the FON2 palettes.
SVN r3812 (trunk)
2012-08-07 20:09:07 +00:00
Braden Obrzut 5f4889d99e - Backported SPACEWIDTH for fontdefs from ECWolf.
SVN r3811 (trunk)
2012-08-07 08:11:56 +00:00
Braden Obrzut 6af0744f75 - Removed unused variable in v_font.cpp.
SVN r3810 (trunk)
2012-08-06 20:59:52 +00:00
Braden Obrzut 70d8daa341 - Merged some ECWolf's font code changes. In particular support for retranslating the fonts should the palette change at run time. (This required storing what lump the font was generated from for FON1. This information is stored in FFont since ECWolf also uses the information to allow FONTDEF fonts to be overriden with single lump fonts consistently, but I didn't merge that part as it might break something.)
SVN r3808 (trunk)
2012-08-06 10:25:51 +00:00
Braden Obrzut cb413c600e - Fixed: Memory error when loading BMF palettes.
- Fixed: When locating WhiteIndex and BlackIndex in the palette index 0 was skipped.
- Fixed: When filling an area black for vid_fps or pillarbox/letterbox use GPalette.BlackIndex instead of assuming palette index 0 is black.

SVN r3807 (trunk)
2012-08-06 09:49:15 +00:00
Christoph Oelckers 1529c91b80 - fixed: FFont::GetChar was unable to handle 8 bit signed chars.
SVN r3556 (trunk)
2012-04-12 17:33:55 +00:00
Christoph Oelckers 03177090c0 - removed some unnecessary r_ header #includes.
SVN r3257 (trunk)
2011-07-06 10:55:04 +00:00
Christoph Oelckers fbff5ca932 - moved r_interpolate.cpp and r_translate.cpp to r_data.
- merged r_jpeg.h into jpegtexture.cpp because that's the only place where it's ever used.


SVN r3255 (trunk)
2011-07-06 08:50:15 +00:00
Christoph Oelckers 17ed7aaabd - moved the code from r_data.cpp to some better fitting places and deleted this file and r_data.h because the remaining parts of it were just a random collection of unrelated functions.
SVN r3248 (trunk)
2011-07-05 10:02:38 +00:00
Christoph Oelckers 9fc5539ae7 - fixed case of damage type variables.
- fixed loading of BMF fonts' palettes. Index 0 is always transparent and the stored palette data starts at index 1.


SVN r3240 (trunk)
2011-06-17 22:46:34 +00:00
Randy Heit d3b44a4172 - Fix errors/warnings from MinGW 4.5.0 (tdm-1).
- Disable the missing field initializers warnings that -Wextra produces from GCC.

SVN r3173 (trunk)
2011-03-29 05:20:33 +00:00
Christoph Oelckers 1993e969b7 - GCC warning fixes (GCC stupidity for the most part.)
SVN r3154 (trunk)
2011-02-19 08:59:43 +00:00
Christoph Oelckers 770a879f6a - fixed: The TouchedActors array in the Dehacked parser was not freed after parsing was done.
- Initialize the alt HUD explicitly in D_DoomMain.
- don't let S_UnloadReverbDef leave a broken list of sound environments behind.
- Added more code to explicitly delete data before initializing it.

SVN r3039 (trunk)
2010-12-15 00:09:31 +00:00
Christoph Oelckers 7e362819e4 - made the different cursor characters for Raven's and the other small fonts a property of the font instead deciding based on the game.
SVN r2935 (trunk)
2010-10-12 08:43:15 +00:00
Christoph Oelckers 579502ab74 - merged menu branch back into trunk.
SVN r2768 (trunk)
2010-09-14 17:28:18 +00:00
Randy Heit fad9f251ec - Fixed: FSinglePicFont should set the character size by the scaled size of the texture.
SVN r2189 (trunk)
2010-03-05 03:31:20 +00:00
Randy Heit 54b792a97f - V_GetFont() needs to check the font header.
SVN r2181 (trunk)
2010-02-26 20:19:43 +00:00
Randy Heit d530fd7f90 - Added BMF (ByteMap Font) support. This was complicated somewhat by the fact that BMF can
specify a character advance separately from the glyph width. GetChar and GetCharWidth now
  return this value in place of the glyph width. (For non-BMF fonts, these should still
  return the same values as before.)

SVN r2180 (trunk)
2010-02-26 05:34:30 +00:00
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 a732687548 - Changed APlayerPawn::DamageFade to a PalEntry from 3 floats.
- Removed #pragma warnings from cmdlib.h and fixed the places where they were 
  still triggered.
  These #pragmas were responsible for >90% of the GCC warnings that were not
  listed in VC++.
- Fixed one bug in the process: DSeqNode::m_Atten was never adjusted when the
  parameter handling of the sound functions for attenuation was changed.
  Changed m_Atten to a float and fixed the SNDSEQ parser to set proper values. 
  Also added the option to specify attenuation with direct values in addition 
  to the predefined names.

SVN r1583 (trunk)
2009-05-15 10:39:40 +00:00
Christoph Oelckers b94b832a9e - Fixed: Untranslated colors in fonts had an alpha value of 0 but need 255.
SVN r1433 (trunk)
2009-02-21 11:30:42 +00:00
Randy Heit a7e40b56f6 - Fixed: Player names and chat macros that end with incomplete \c escapes now
have those escapes stripped before printing so that they do not merge with
  subsequent text.
- Moved default weapon slot assignments into the player classes.
  Weapon.SlotNumber is now used solely for mods that want to add new weapons
  without completely redoing the player's arsenal. Restored some config-based
  weapon slot customization, though slots are no longer automatically saved
  to the config and section names have changed slightly. However, unlike
  before, config slots are now the definitive word on slot assignments and
  cannot be overridden by any other files loaded.
- Fixed: Several weapons were missing a game filter from their definitions.
- Removed storage of weapon slots in the config so that weapon slots can
  be setup in the weapons themselves. Slots are still configurable, since
  they need to be for KEYCONF to work; any changes simply won't be saved
  when you quit.
- Removed limit on weapon slot sizes.


SVN r1428 (trunk)
2009-02-20 00:53:25 +00:00
Randy Heit 0acc6a4ee3 - Moved the V_InitFontColors() call earlier in the startup sequence so that
colored error messages appear colored in the startup window. Also lightened
  up the "Flat" red to contrast better with the startup background.


SVN r1424 (trunk)
2009-02-11 00:16:05 +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
Randy Heit 927c9532bf - It is now possible to replace the game's SmallFont with a single lump font
called SMALLFNT.
- Reduced the width of the second column in wi_percents false mode from 3 to
  2 characters.
- Added a WISLASH graphic for Doom's intermission screen when wi_percents is
  false.


SVN r1298 (trunk)
2008-11-30 01:37:11 +00:00
Randy Heit 6e83d231fe - The co-op summary screen now has a totals row at the bottom (if it fits).
- Changed WI_drawPercent() when wi_percents is false so that the total
  display is optional, and it formats it like Heretic's intermission, with
  a slash and a fixed-width right column.
- Font is no longer a property of the screen object. Pass the font to
  DrawText and DrawChar directly instead.
- Doom's intermission characters are now collected together as a font
  so they can be colorized.


SVN r1294 (trunk)
2008-11-27 17:43:36 +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 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 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 49565ccb84 - Fixed: Red blood particles used too dark colors.
- Fixed: The smoothlighting code in side_t::GetLightLevel relied on 
  the global 'linedef' variable for automatic fake contrast although
  this issue had already been fixed for the original code here.
- Replaced static string buffers with FString in FONTDEFS parser.

SVN r1194 (trunk)
2008-09-04 14:09:32 +00:00
Christoph Oelckers dbcc246cf3 - Added Blzut3's patch for a real Chex Quest game mode.
SVN r1188 (trunk)
2008-08-30 19:44:19 +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 8ca7c05e9d - Changed FImageCollection to return translated texture indices so
that animated icons can be done with it.
- Changed FImageCollection to use a TArray to hold its data.
- Fixed: SetChanHeadSettings did an assignment instead of comparing
  the channel ID witg CHAN_CEILING.
- Changed sound sequence names for animated doors to FNames.
- Automatically fixed: DCeiling didn't properly serialize its texture id.
- Replaced integers as texture ID representation with a specific new type
  to track down all potentially incorrect uses and remaining WORDs used
  for texture IDs so that more than 32767 or 65535 textures can be defined.


SVN r1036 (trunk)
2008-06-15 18:36:26 +00:00
Christoph Oelckers b54b9bad7a - Fixed: A_VileAttack positioned the fire on the wrong side of the target.
- Reorganized the HackHack code so that the image creation was moved into
  MakeTexture. This was necessary because Unload deleted the pixel data
  and broke the whole thing.
- Fixed: FPatchTexture::HackHack and FDoomStatusbarTexture::DrawToBar used the
  obsolete and uninitialized variable Near255. 
- Removed the span creation code specific to FPatchTexture. It only has an
  advantage when the lump has already been loaded in memory but since that
  is no longer the case now the generic version in FTexture is actually better.
- Changed: FTexture::CopyToBlock no longer uses the spans but the pixel buffer
  directly. Since most patches in multipatch textures are non transparent
  the added overhead from creating the spans far outweighs any savings they
  might provide. It is also simpler to handle for mirrored or rotated patches now.
- Changed: Textures only create the spans when really needed. Flats and native
  textures, for example, do not and it only created needless overhead that they
  were always created along with the pixel buffer.
- Made use of player and actor variables consistent in a_hereticweaps.cpp.
- Fixed: A few calls to P_SpawnPlayerMissile passed 0 as angle



SVN r911 (trunk)
2008-04-14 12:10:45 +00:00
Christoph Oelckers c333a8ab82 - fixed an uninitialized variable in v_font.cpp
SVN r907 (trunk)
2008-04-12 22:18:38 +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
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
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
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 499fefec07 - Added preloading of fonts to reduce the chance that characters from a single
font will require more than one hardware texture to display.


SVN r717 (trunk)
2008-01-27 05:23:10 +00:00
Christoph Oelckers 1b28557341 - Got rid of most TexMan.AddPatch calls because they are no longer needed.
- Got rid of R_InitPatches because the new texture init code needs to preload
  everything to work correctly.
- Rewrote texture manager initialization to order textures primarily by WAD 
  rather than by type. This way later textures will always override earlier 
  ones. The only exception is that TEX_MiscPatch are only used as a fallback
  if nothing else can be found.
- Optimized the tryany case of FTextureManager::CheckForTexture. It is not
  necessary to scan the hash chain twice. The required information can be
  retrieved during the first pass as easily and even offers a little more
  control.
- Made FFont destructor virtual.
- Added 'Ice' translation to DECORATE.

(Caution: Not fully tested yet!)

SVN r715 (trunk)
2008-01-26 23:20:34 +00:00
Christoph Oelckers d134deda95 - Fixed: ACS used incompatible values for APROP_RenderStyle. It needs to use
the exact same values as previous ZDoom versions
- Added a DECORATE 'stencilcolor' property so that the stencil render style
  can be used.
- Added some NULL pointer checks to the font loading code.

SVN r713 (trunk)
2008-01-26 15:50:52 +00:00
Randy Heit e5572a1c4e - Updated lempar.c to v1.31.
- Added .txt files to the list of types (wad, zip, and pk3) that can be
  loaded without listing them after -file.
- Fonts that are created by the ACS setfont command to wrap a texture now
  support animated textures.
- FON2 fonts can now use their full palette for CR_UNTRANSLATED when drawn
  with the hardware 2D path instead of being restricted to the game palette.
- Fixed: Toggling vid_vsync would reset the displayed fullscreen gamma to 1
  on a Radeon 9000.
- Added back the off-by-one palette handling, but in a much more limited
  scope than before. The skipped entry is assumed to always be at 248, and
  it is assumed that all Shader Model 1.4 cards suffer from this. That's
  because all SM1.4 cards are based on variants of the ATI R200 core, and the
  RV250 in a Radeon 9000 craps up like this. I see no reason to assume that
  other flavors of the R200 are any different. (Interesting note: With the
  Radeon 9000, D3DTADDRESS_CLAMP is an invalid address mode when using the
  debug Direct3D 9 runtime, but it works perfectly fine with the retail
  Direct3D 9 runtime.) (Insight: The R200 probably uses bytes for all its
  math inside pixel shaders. That would explain perfectly why I can't use
  constants greater than 1 with PS1.4 and why it can't do an exact mapping to
  every entry in the color palette.
- Fixed: The software shaded drawer did not work for 2D, because its selected
  "color"map was replaced with the identitymap before being used.
- Fixed: I cannot use Printf to output messages before the framebuffer was
  completely setup, meaning that Shader Model 1.4 cards could not change
  resolution.
- I have decided to let remap palettes specify variable alpha values for
  their colors. D3DFB no longer forces them to 255.
- Updated re2c to version 0.12.3.
- Fixed: A_Wander used threshold as a timer, when it should have used
  reactiontime.
- Fixed: A_CustomRailgun would not fire at all for actors without a target
  when the aim parameter was disabled.
- Made the warp command work in multiplayer, again courtesy of Karate Chris.
- Fixed: Trying to spawn a bot while not in a game made for a crashing time.
  (Patch courtesy of Karate Chris.)
- Removed some floating point math from hu_scores.cpp that somebody's GCC
  gave warnings for (not mine, though).
- Fixed: The SBarInfo drawbar command crashed if the sprite image was
  unavailable.
- Fixed: FString::operator=(const char *) did not release its old buffer when
  being assigned to the null string.
- The scanner no longer has an upper limit on the length of strings it
  accepts, though short strings will be faster than long ones.
- Moved all the text scanning functions into a class. Mainly, this means that
  multiple script scanner states can be stored without being forced to do so
  recursively. I think I might be taking advantage of that in the near
  future. Possibly. Maybe.
- Removed some potential buffer overflows from the decal parser.
- Applied Blzut3's SBARINFO update #9:
  * Fixed: When using even length values in drawnumber it would cap to a 98
    value instead of a 99 as intended.
  * The SBarInfo parser can now accept negatives for coordinates. This
    doesn't allow much right now, but later I plan to add better fullscreen
    hud support in which the negatives will be more useful. This also cleans
    up the source a bit since all calls for (x, y) coordinates are with the
    function getCoordinates().
- Added support for stencilling actors.
- Added support for non-black colors specified with DTA_ColorOverlay to the
  software renderer.
- Fixed: The inverse, gold, red, and green fixed colormaps each allocated
  space for 32 different colormaps, even though each only used the first one.
- Added two new blending flags to make reverse subtract blending more useful:
  STYLEF_InvertSource and STYLEF_InvertOverlay. These invert the color that
  gets blended with the background, since that seems like a good idea for
  reverse subtraction. They also work with the other two blending operations.
- Added subtract and reverse subtract blending operations to the renderer.
  Since the ERenderStyle enumeration was getting rather unwieldy, I converted
  it into a new FRenderStyle structure that lets each parameter of the
  blending equation be set separately. This simplified the set up for the
  blend quite a bit, and it means a number of new combinations are available
  by setting the parameters properly.


SVN r710 (trunk)
2008-01-25 23:57:44 +00:00
Christoph Oelckers 5a0009cbab - Fixed: The FSpecialFont constructor copied the untranslated colors directly
from the source palette instead of the font's identity map.


SVN r646 (trunk)
2007-12-26 21:37:00 +00:00
Christoph Oelckers 0535d15df3 - Split off the entire translation code from r_draw.cpp into r_translate.cpp.
- Moved the common code of ACS and DECORATE translation generation into the
  FRemapTable class.
- Fixed: The DECORATE translation code was not changed for the new data structures.
- Expanded range of ACS and DECORATE translations to 65535. 
- Fixed: R_CopyTranslation was not altered for the new functionality.
  I removed the function and replaced the one use with a simple assignment.


SVN r644 (trunk)
2007-12-26 16:06:03 +00:00
Randy Heit 1acc3d00c4 - Discovered that Shader Model 1.4 clamps my constants, so I can't use
palettes smaller than 256 entries with the shader I wrote for it. Is there
  a list of gotchas like this listed some where? I'd really like to see it.
  
  Well, when compiled with SM2.0, the PalTex shader seems to be every-so-
  slightly faster on my GF7950GT than the SM1.4 version, so I guess it's a
  minor win for cards that support it.
- Fixed: ST_Endoom() failed to free the bitmap it used.
- Added the DTA_ColorOverlay attribute to blend a color with the texture
  being drawn. For software, this (currently) only works with black. For
  hardware, it works with any color. The motiviation for this was so I could
  rewrite the status bar calls that passed DIM_MAP to DTA_Translation to
  draw darker icons into something that didn't require making a whole new
  remap table.
- After having an "OMG! How could I have been so stupid?" moment, I have
  removed the off-by-one check from D3DFB. I had thought the off-by-one error
  was caused by rounding errors by the shader hardware. Not so. Rather, I
  wasn't sampling what I thought I was sampling. A texture that uses palette
  index 255 passes the value 1.0 to the shader. The shader needs to adjust the
  range of its palette indexes, or it will end up trying to read color 256
  from the palette texture when it should be reading color 255. Doh!
- The TranslationToTable() function has been added to map from translation
  numbers used by actors to the tables those numbers represent. This function
  performs validation for the input and returns NULL if the input value
  is invalid.
- Major changes to the way translation tables work: No longer are they each a
  256-byte array. Instead, the FRemapTable structure is used to represent each
  one. It includes a remap array for the software renderer, a palette array
  for a hardware renderer, and a native texture pointer for D3DFB. The
  translationtables array itself is now an array of TArrays that point to the
  real tables. The DTA_Translation attribute must also be passed a pointer
  to a FRemapTable, not a byte array as previously.
- Modified DFrameBuffer::DrawRateStuff() so that it can do its thing properly
  for D3DFB's 2D mode. Before, any fullscreen graphics (like help images)
  covered it up.


SVN r640 (trunk)
2007-12-26 04:42:15 +00:00
Christoph Oelckers 3eb741e391 - added some functionality to FDynamicColormap to allow not creating
the colormap data if it isn't needed by the renderer.


SVN r635 (trunk)
2007-12-24 21:56:49 +00:00
Christoph Oelckers 8a433d6f12 - Fixed a few font related problems.
- Fixed: ASkyViewpoint::Destroy was missing the super call.
- Added SnowKate709's A_LookEx update.
- Moved M_DrawPlayerBackdrop into DCanvas as a virtual function. Since this
  directly accesses the frame buffer it must be overridable for renderers
  that work differently.


SVN r632 (trunk)
2007-12-23 21:56:46 +00:00
Christoph Oelckers 9c89381400 - Added Blzut3's third SBARINFO update:
* Added drawshader to draw Heretic style transparency gradients.
 * Added artiflash flag to drawselectedinventory.
 * Fixed: Drawgem used the wrong operator when determining the chain size.
 * Fixed: ZDoom would crash if an undefined font was used.
 * I also started cleaning up the source a little.  I have been informed that
 when checking for flags the "== flagname" is redundant.
- Added indexfont anf hudfont from GZDoom to zdoom.pk3 so that they are always 
  available when defining custom status bars.


SVN r629 (trunk)
2007-12-23 20:59:06 +00:00
Christoph Oelckers 154e21d9e7 - Backported GZDoom's true color font mappings for use with native textures
when the time comes.


SVN r626 (trunk)
2007-12-23 16:53:39 +00:00
Christoph Oelckers 87383a32c6 - Fixed: Resurrecting a player must set mo->special1 to 0 because it is used
as a counter by the Hexen fighter's fist weapon.
- Fixed: The Wraithwerge's spirits shouldn't attack friends.
- Fixed: The Heresiarch's balls must not adjust their z-position after the
  Heresiarch dies.
- Added damage type specific pain chances and an MF5_NOPAIN flag that can be used
  to suppress entering the pain state altogether.
- Changed font initialization so that you can define replacements for the default
  fonts in FONTDEFS.
- Removed the 'add a bot' menu option since bots are beyond repair and therefore
  mostly useless.
- Fixed: Hitscan attacks must always spawn a puff so that it and its properties
  can be used as damage inflictor.


SVN r534 (trunk)
2007-05-26 10:50:32 +00:00
Christoph Oelckers e08da03a3d - Increased precision of texture scaling factors to full fixed point. In the process
I got rid of the old tx and ty CVARs because they made the texture scaling
  much more complicated than it was actually needed (and besides, they were completely
  useless except for testing purposes anyway.)


SVN r522 (trunk)
2007-04-29 12:07:27 +00:00
Randy Heit c196880ee5 - Added a GTK+ version of the IWAD selection dialog box. That brings the
Linux port one step closer to feature parity with the Windows version.



SVN r451 (trunk)
2007-01-16 01:53:43 +00:00
Randy Heit 82ba0fb189 SVN r446 (trunk) 2007-01-09 04:40:58 +00:00
Randy Heit e1bd63e876 - Turned on warning level 4 just to see what it would produce: a lot of
warnings. At first, I was going to try and clean them all up. Then I decided
  that was a worthless cause and went about just acting on the ones that
  might actually be helpful:
   C4189 (local variable is initialized but not referenced)
   C4702 (unreachable code)
   C4512 (assignment operator could not be generated)


SVN r420 (trunk)
2006-12-21 04:34:43 +00:00
Christoph Oelckers 43ddce519c - Fixed: Inventory.Icon printed error message for all the missing icons in
Strife's teaser.
- Fixed: st_start.cpp needed a 
  #define _WIN32_WINNT 0x0501.
- Fixed a few uninitialized variables warnings for GCC.


SVN r418 (trunk)
2006-12-19 16:08:48 +00:00
Randy Heit 83373fba88 Note: I have not tried compiling these recent changes under Linux. I wouldn't
be surprised if it doesn't work.

- Reorganized the network startup loops so now they are event driven. There is
  a single function that gets called to drive it, and it uses callbacks to
  perform the different stages of the synchronization. This lets me have a nice,
  responsive abort button instead of the previous unannounced hit-escape-to-
  abort behavior, and I think the rearranged code is slightly easier to
  understand too.
- Increased the number of bytes for version info during D_ArbitrateNetStart(),
  in preparation for the day when NETGAMEVERSION requires more than one byte.
- I noticed an issue with Vista RC1 and the new fatal error setup. Even after
  releasing a DirectDraw or Direct3D interface, the DWM can still use the
  last image drawn using them when it composites the window. It doesn't always
  do it but it does often enough that it is a real problem. At this point, I
  don't know if it's a problem with the release version of Vista or not.
  After messing around, I discovered the problem was caused by ~Win32Video()
  hiding the window and then having it immediately shown soon after. The DWM
  kept an image of the window to do the transition effect with, and then when
  it didn't get a chance to do the transition, it didn't properly forget about
  its saved image and kept plastering it on top of everything else
  underneath.
- Added a network synchronization panel to the window during netgame startup.
- Fixed: PClass::CreateDerivedClass() must initialize StateList to NULL.
  Otherwise, classic DECORATE definitions generate a big, fat crash.
- Resurrected the R_Init progress bar, now as a standard Windows control.
- Removed the sound failure dialog. The FMOD setup already defaulted to no
  sound if initialization failed, so this only applies when snd_output is set
  to "alternate" which now also falls back to no sound. In addition, it wasn't
  working right, and I didn't feel like fixing it for the probably 0% of users
  it affected.
- Fixed: The edit control used for logging output added text in reverse order
  on Win9x.
- Went back to the roots and made graphics initialization one of the last
  things to happen during setup. Now the startup text is visible again. More
  importantly, the main window is no longer created invisible, which seems
  to cause trouble with it not always appearing in the taskbar. The fatal
  error dialog is now also embedded in the main window instead of being a
  separate modal dialog, so you can play with the log window to see any
  problems that might be reported there.
  
  Rather than completely restoring the original startup order, I tried to
  keep things as close to the way they were with early graphics startup. In
  particular, V_Init() now creates a dummy screen so that things that need
  screen dimensions can get them. It gets replaced by the real screen later
  in I_InitGraphics(). Will need to check this under Linux to make sure it
  didn't cause any problems there.
- Removed the following stubs that just called functions in Video:
    - I_StartModeIterator()
    - I_NextMode()
    - I_DisplayType()
  I_FullscreenChanged() was also removed, and a new fullscreen parameter
  was added to IVideo::StartModeIterator(), since that's all it controlled.
- Renamed I_InitHardware() back to I_InitGraphics(), since that's all it's
  initialized post-1.22.


SVN r416 (trunk)
2006-12-19 04:09:10 +00:00
Christoph Oelckers fb5f4a132b - Fixed: The yellow color range contained gaps in its definition which
resulted in incorrect colors.
- Fixed: FFont::BuildTranslations didn't clamp the RGB color values. This
  can happen if some font colors overflow or underflow due to incomplete
  range specifications.


SVN r358 (trunk)
2006-10-21 09:01:45 +00:00
Christoph Oelckers 3dabd38359 - Fixed: Hires texture replacements must call AddPatch if the texture
isn't defined yet in order to replace lumps that are not in the
  list of preinitialized graphics.
- Changed font initialization to occur after textures have been completely
  initialized. This is necessary so that the font characters can be
  replaced with hires versions.


SVN r351 (trunk)
2006-10-06 21:07:58 +00:00
Christoph Oelckers 782b8a3b92 - Fixed: The sky scrolling calculations caused an integer multiplication overflow.
- Fixed: Voodoo dolls should not start ENTER scripts.
- Fixed: ActorDamage must not parse the enclosing parentheses as part of the 
  expression. That will produce an error if a flag set or clear command immediately
  follows.
- Fixed: P_DamageMobj ignored MF2_NODMGTHRUST if the damaging object had no
  owner.
- Added a 'font' parameter to A_Print.
- Changed A_CustomMeleeAttack to take one damage parameter only. Since expressions
  can be used this value is not used as a factor for a random value but as
  a direct damage value instead.
- Fixed: AActor::SetState must check whether a called action function resulted
  in the actor's destruction. A_Jump constructs to a 0-length terminating
  state will hang if this isn't checked.



SVN r329 (trunk)
2006-09-17 10:43:51 +00:00
Randy Heit c412b42703 - Fixed: cycle_t was still a DWORD and not a QWORD under GCC.
- The stat meters now return an FString instead of sprintfing into a fixed
  output buffer.
- NOASM is now automatically defined when compiling for a non-x86 target.
- Some changes have been made to the integral types in doomtype.h:
  - For consistancy with the other integral types, byte is no longer a
    synonym for BYTE.
  - Most uses of BOOL have been change to the standard C++ bool type. Those
    that weren't were changed to INTBOOL to indicate they may contain values
    other than 0 or 1 but are still used as a boolean.
  - Compiler-provided types with explicit bit sizes are now used. In
    particular, DWORD is no longer a long so it will work with both 64-bit
    Windows and Linux.
  - Since some files need to include Windows headers, uint32 is a synonym
    for the non-Windows version of DWORD.
- Removed d_textur.h. The pic_t struct it defined was used nowhere, and that
  was all it contained.


SVN r326 (trunk)
2006-09-14 00:02:31 +00:00
Randy Heit a2fbb8c880 GCC fixes for recent code changes.
SVN r316 (trunk)
2006-08-31 01:30:22 +00:00
Randy Heit 603e905c42 SVN r314 (trunk) 2006-08-31 00:16:12 +00:00
Randy Heit 2fb55622e7 - Moved the text color definitions out of the executable and into an external
data file.
- Removed the setcolor CCMD. It's been obsolete for years, ever since color-
  aware cvars were added.
- Changed V_GetColorStringByName() to return an FString, because it did a
  copystring() call.
- Extended V_GetColorFromString() so that it accepts HTML-style #RRGGBB and
  #RGB color strings.


SVN r313 (trunk)
2006-08-30 02:38:39 +00:00
Randy Heit 1a7253e53c - Added support for casting color names in ACS print-type statements. What that
means is that instead of writing this:
    print (s:"\cDSome text");
  You can write this:
    print (r:CR_GREEN, s:"Some text");
- Added some new colors, based on the ones jimmy91 posted in the forum: cream,
  light blue, black, olive, dark green, dark red, dark brown, purple, and dark
  gray.
- Simplified FFont::BuildTranslations() and BuildTranslations2() to make adding
  new colors easier.


SVN r306 (trunk)
2006-08-22 21:58:24 +00:00
Christoph Oelckers cf7d8ab43b - Removed the unused sfx_ variables for the chainsaw sounds.
- Fixed map name checks in idclev, hxvisit, for +map and the titlemap.
- Changed handling of Zips so that the patches/, graphics/, sounds/ and
  music/ subdirectories no longer are placed in the global namespace. Instead
  new namespaces are defined. These namespaces aren't merged, however and 
  searching in them either returns a lump inside it or one from the global
  namespace when it doesn't come from a Zip file. Proper order of files is
  still observed though. As a result proper use of the directories inside Zips 
  is strictly enforced now so that for example anything used as a patch must be 
  in the patches/ directory and won't be found anywhere else.


SVN r199 (trunk)
2006-06-19 15:31:10 +00:00
Randy Heit e2179d5c2d Guess what. It's not 2005 anymore.
SVN r184 (trunk)
2006-06-11 01:37:00 +00:00
Randy Heit 93c5753270 - Added a NULL sector check to P_CheckFakeFloorTrigger() because there was
a crash report indicating that an actor being pushed up by a moving floor
  had a NULL sector. Since this field should be valid for every actor, the
  debug build gets an assert here, and the release build just returns without
  doing anything.
- Fixed: Camera textures were not rendered properly when the underlying
  canvas's pitch and width were different (which, really, only happens if
  you use ridiculously large camera textures).
- Fixed: FCanvasTextureInfo's were never freed.
- Fixed: MAPINFO special action structures were not freed.
- Fixed: FSingleLumpFont::LoadFON2() never freed its widths2 array.


SVN r129 (trunk)
2006-05-19 05:14:37 +00:00
Randy Heit 8fcf93d65a - Merged a lot of these static destructor-only structs into regular
functions added to the exit chain with atterm so that they can be called
  in a deterministic order and not whatever order the linker decides to put
  them in.
- Fixed: DCajunMaster did not free its getspawned.
- Fixed: P_FreeLevelData() did not free ACS scripts.
- Fixed: Level snapshots were not freed at exit.
- Fixed: The save/load menu list was not freed at exit.
- Fixed: FCompressedMemFile needs a destructor to free the m_ImplodedBuffer.
- Fixed: G_DoLoadGame() did not free the engine string.
- Fixed: M_ReadSaveStrings() did not free the engine string.
- Fixed: Processing DEM_SAVEGAME did not free the pathname string.
- Added a check for truncated flats to FFlatTexture::MakeTexture() because
  Heretic's F_SKY1 is only four bytes long.
- Added a dump of the offending state to the "Cannot find state..." diagnostic.
- Fixed: FCompressedFile did not initialize m_Mode in its default constructor.
- Fixed: Heretic and Hexen status bars did not initialize ArtiRefresh.
- Fixed: PNGHandle destructor should use delete[] to free TextChunks.


SVN r111 (trunk)
2006-05-12 03:14:40 +00:00
Christoph Oelckers 7ed597fcbe - Fixed: The FSpecialFont constructor created the name string twice.
- Fixed: The animated door parser was still leaking memory when it encountered
  an invalid animation due to missing textures.
- Fixed: The music volume list wasn't freed.
- Fixed: The image for WADs that were loaded from inside Zips was never freed.


SVN r92 (trunk)
2006-05-09 21:21:57 +00:00
Randy Heit df17a60f5d - Fixed: The names in the Depths array in m_options.cpp were never freed.
- Fixed: FDoomEdMap needed a destructor.
- Fixed: Decal animators were never freed.
- Fixed: Colormaps were never freed.
- Fixed: Memory allocated in R_InitTranslationTables() was never freed.
- Fixed: R_InitParticles() allocated way more memory than it needed to. (And the
  particle memory was never freed, either.)
- Fixed: FMetaTable::FreeMeta() should use delete[] to free string metadata.
- Fixed: FConfigFile::ClearCurrentSection() must cast the entry to a char *
  before deleting it, because that's the way it was allocated.
- Fixed definitions of DeadZombieMan and DeadShotgunGuy in doom/deadthings.txt.
  Skip_super resets the dropitem list, so having it after "DropItem None" is
  pointless.
- Fixed: Decorate DropItem information was never freed.
- Fixed: FinishStates() allocated even 0-entry state arrays.
- Fixed: Default actor instances were never freed.
- Fixed: FRandomSoundList never freed its sound list.
- Fixed: Level and cluster strings read from MAPINFO were never freed.
- Fixed: Episode names were never freed.
- Fixed: InverseColormap and GoldColormap were never freed. Since they're always
  allocated, they can just be arrays rather than pointers.
- Fixed: FFont destructor never freed any of the character data or the font's name.
- Fixed: Fonts were not freed at exit.
- Fixed: FStringTable::LoadLanguage() did not call SC_Close().
- Fixed: When using the -iwad parameter, IdentifyVersion() did not release the
  buffer it created to hold the parameter's path.


SVN r88 (trunk)
2006-05-09 03:40:15 +00:00
Randy Heit fd0c5a6db6 - Changed TAG_MORE to pass a va_list pointer instead of a va_list because it's a
non-POD type when targeting several non-ix86 targets with GCC. Hopefully this works.


SVN r80 (trunk)
2006-05-06 00:54:41 +00:00
Randy Heit e78385f807 - Rewrote FName to use only POD types for its static data so that it can be used
without any explicit constructors being called.
- Fixed: ZTwinedTorchUnlit, ZWallTorchUnlit, ZFireBullUnlit, and ZCauldronUnlit
  were missing game filters.


SVN r79 (trunk)
2006-05-05 04:37:10 +00:00
Christoph Oelckers d06793ad7e - Converted A_Puzzleitems.cpp and parts of A_HexenSpecialdecs.cpp to DECORATE and fixed a few broken Hexen items.
SVN r78 (trunk)
2006-05-04 19:36:12 +00:00
Randy Heit fe84b6077e - Fixed: Conversion of c_bind.cpp to FString was incomplete.
- Fixed some functions that were declared as taking size_t's but defined as taking
  unsigned ints.
- Added a dummy object to delete sound environments on exit.
- Fixed: FWarpTexture did not delete its Spans when destroyed.
- Changed wadclusterinfos and wadlevelinfos arrays into TArrays.
- Added the TypeInfo::AutoTypeInfoPtr for TypeInfo::m_RuntimeActors so they can
  be automatically deleted.
- Changed TypeInfo::m_Types into a TArray so it will be automatically deleted
  on exit.
- Fixed: TArray::Resize() did not deconstruct entries when shrinking the array.
- Changed TArray::Push() so that it calls Grow() instead of duplicating the growth
  calculations itself.
- Calling TArray::Grow() for a small amount when the array is short should grow it
  a bit more than it was doing.

SVN r76 (trunk)
2006-05-04 06:14:52 +00:00
Christoph Oelckers b229d07500 SVN r65 (trunk) 2006-04-23 09:02:19 +00:00
Christoph Oelckers 25f90d6221 SVN r27 (trunk) 2006-04-11 16:27:41 +00:00
Randy Heit cf11cbdb30 Directory restructuring to make it easier to version projects that don't build zdoom.exe.
SVN r4 (trunk)
2006-02-24 04:48:15 +00:00