Commit Graph

55 Commits

Author SHA1 Message Date
Randy Heit bf0856aef5 Remove DepthScale and DepthOrg from FWallTmapVals 2014-08-07 22:58:11 -05:00
Randy Heit 891b3da103 Remove extra magnitude from magic texture mapping values
- These used to be fixed point, but now they're floating point, so the
  excess magnitude is unneeded.
2014-08-07 22:43:23 -05:00
Randy Heit e1ee80661e Make FWallCoords' members lowercase
because they're kind of a pain to type when all uppercase.
- Also, make its sx1 and sx2 members shorts, so it takes less space, since
  it's getting crammed into a vissprite now.
2014-08-07 17:12:04 -05:00
Randy Heit a600a816c3 Consolidate some common code for texture mapping setup
- R_AddLine() and R_RenderDecal() had nearly identical code for setting up
  texture mapping. These have now been spun off into methods of
  FWallCoords and FWallTmapVals.
2014-07-31 21:02:22 -05:00
Randy Heit fc63e9db3c Pass WallC as a parameter to (O)WallMost instead of referencing it globally 2014-07-31 20:23:04 -05:00
Randy Heit bc450808b2 Consolidate wall texturing vars into two structs
- All transformation and clipping values go into FWallCoords.
- All texture mapping values go into FWallTMapVals.
2014-07-31 20:17:23 -05:00
Randy Heit 92d54ca0fc - Instead of setting the default skybox in every sector without an explicit skybox set, set it
once in the level struct and then use that for sectors with a NULL skybox. This fixes zpack's
  E2M3 so that when it removes its sector stacks, you will get the default skybox in their
  place, since stacked sectors and skyboxes use the same pointers in a sector.

SVN r4224 (trunk)
2013-04-21 02:22:37 +00:00
Randy Heit a50e670c0c - Use tests less prone to overflow on very steep slopes when detecting which side of a plane
the camera is on. Mostly, this means testing the distance of the camera to the plane rather
  than computing the plane's Z at the camera and comparing that with the camera's Z.

SVN r4220 (trunk)
2013-04-17 01:32:40 +00:00
Randy Heit 34b2d0b21a - Fixed: Putting a lightlist in a sector caused that sector's floorlight and ceilinglight to be ignored.
SVN r4193 (trunk)
2013-03-21 02:28:07 +00:00
Randy Heit 2a9a1fb240 - Fixed: All 3D floors were additive due to a typo.
SVN r3819 (trunk)
2012-08-12 03:23:35 +00:00
Randy Heit e2a018227f - Added additive blending for floors and ceilings.
SVN r3813 (trunk)
2012-08-09 04:31:31 +00:00
Christoph Oelckers 463c276014 - removed more r_ header dependencies from the rest of the code.
SVN r3260 (trunk)
2011-07-06 15:31:05 +00:00
Christoph Oelckers 5c6fd66ed5 - rename src/resources to src/r_data.
SVN r3254 (trunk)
2011-07-06 07:35:36 +00:00
Christoph Oelckers 06d280f00a - moved all code not specific to the software renderer out of r_bsp.cpp.
SVN r3250 (trunk)
2011-07-05 19:50:01 +00:00
Christoph Oelckers 4626492f50 - separated all colormap related code from v_palette.cpp and r_data.cpp into its own file.
SVN r3245 (trunk)
2011-07-03 10:47:35 +00:00
Randy Heit ee8ca0de87 Fixed: Light levels outside the range [0,255] really do matter.
SVN r3223 (trunk)
2011-06-11 23:58:33 +00:00
Christoph Oelckers 0991d45838 - added kgsws's 3D floor textute rotation fix.
SVN r3221 (trunk)
2011-06-07 06:41:49 +00:00
Randy Heit 6ce9228150 - Fix brokenness of preceding commit.
SVN r3179 (trunk)
2011-04-14 04:24:07 +00:00
Randy Heit 0d39257eaf - Apply kgsws-CZ's fixes:
* Added new cvar, r_3dfloors for testing, so for example, you can see the FPS difference.
  * ds_p->bkup is not always allocated.
  * Fixed particles visible through 3D floors.
  * Fixed FAKE3D flag names.



SVN r3178 (trunk)
2011-04-13 02:34:48 +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 1806e47e43 - fixed: Sector_SetLink did incorrect checks for the returned control sector
- added Sector_SetTranslucent special so set translucency of portal planes at run time.
- added 'additive' information for portal planes. This is no-op at the moment because the flat drawers can't handle additive translucency yet though.


SVN r3149 (trunk)
2011-02-12 09:53:40 +00:00
Christoph Oelckers 16878f6bb4 - fixed compile warnings in savegame menu code.
- fixed: plane specific lighting values were no longer used when generating the visplanes.


SVN r3133 (trunk)
2011-02-05 09:17:33 +00:00
Christoph Oelckers fae8ed444c - merged 3dfloors2 branch into trunk.
SVN r3124 (trunk)
2011-01-29 11:09:38 +00:00
Christoph Oelckers 492bead360 - add alpha property to sector_t::splane. Not used yet.
SVN r2992 (trunk)
2010-11-07 16:17:14 +00:00
Christoph Oelckers c31c4755fa - add an alpha parameter to R_FindPlane.
- fixed: R_FindPlane must do a full visplane comparison for stacked sectors with a non-0 alpha for the sector plane.


SVN r2991 (trunk)
2010-11-07 16:11:42 +00:00
Christoph Oelckers 9a4abe0915 - merged automap branch into trunk.
SVN r2609 (trunk)
2010-08-27 15:20:05 +00:00
Christoph Oelckers 79ff9ae3ae - fixed: FNodeBuilder::ExtractMini needs to check for segs that were created from minisegs.
- made polyobject node building code more update friendly for GZDoom by making R_BuildPolyBSP public.


SVN r2500 (trunk)
2010-08-10 08:13:23 +00:00
Randy Heit 677d07f837 - Merge BSP-able polyobjects back into the trunk.
SVN r2480 (trunk)
2010-08-01 02:41:56 +00:00
Christoph Oelckers 545a892faa - added Firebrand's patch to rename 'swap' due to naming conflicts in newer MSVC compilers.
SVN r2449 (trunk)
2010-07-23 21:19:59 +00:00
Christoph Oelckers 4ac64b6df7 - merged polyobject branch into trunk and made some adjustments for savegame compatibility.
SVN r2448 (trunk)
2010-07-23 05:56:25 +00:00
Randy Heit 56ab0e681d - Revert revision 2071.
SVN r2092 (trunk)
2010-01-03 00:54:34 +00:00
Christoph Oelckers bf7ed6258b - fixed: The node builder did not check if all segs could be split properly.
Also removed some fudging that tried to work around this case but produced
  a broken BSP tree on other maps.



SVN r2071 (trunk)
2010-01-01 11:00:58 +00:00
Christoph Oelckers f3f209160e - Renamed plane flags from SECF_* to PLANEF_*.
- Changed Heretic's plat raise type to use a flag to block further sector movement
  instead of keeping the dead thinker around.


SVN r1853 (trunk)
2009-09-17 10:40:38 +00:00
Christoph Oelckers 14a42bbada - changed line_t's sidenum into sidedef pointers.
SVN r1801 (trunk)
2009-09-06 20:45:56 +00:00
Christoph Oelckers 273758344f - Fixed: When setting up a deep water sector with Transfer_Heights the floorclip
information of all actors in the sector needs to be updated.


SVN r1600 (trunk)
2009-05-23 10:21:33 +00:00
Christoph Oelckers bf4e17703d - Fixed: Dehacked string replacement did not check the clusters' finaleflats.
- Changed the definition of several typedef'd structs so that they are
  properly named.
- Limited DEHSUPP lump lookup to search zdoom.pk3 only. It will no longer
  be possible to load DEHSUPP lumps from user WADs.
- Brought back the text-based DEHSUPP parser and changed it to be able to 
  reference states by label. Also changed label names of 
  DoomUnusedStates and added proper labels to all states that were
  previously forced to be the first state of an actor so that the old
  (limited) method could access them. This was done to address the following
  bug:
- Fixed: The player's death states calling A_PlayerSkinCheck should not be
  part of the state set that is accessible by Dehacked. These will produce
  error messages when mapped to non-players.

SVN r1512 (trunk)
2009-03-28 11:49:44 +00:00
Christoph Oelckers db5723997c - Cleaned up some include dependencies.
SVN r1224 (trunk)
2008-09-14 23:54:38 +00:00
Christoph Oelckers bc5d0c882b - Put more floor/ceiling properties in sector_t into a substructure and
added wrapper functions.


SVN r1174 (trunk)
2008-08-16 20:19:35 +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 0e6e1da970 - Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t.
- Grouped the sector plane texture transformation options into a separate
  structure and replaced all access to them with wrapper functions.


SVN r1033 (trunk)
2008-06-14 15:26:16 +00:00
Randy Heit a0d5463b49 - Added the C99 printf size specifiers 't' (ptrdiff_t) and 'z' (size_t) to
FString::Format() so that I can fix all the problem printf strings that a
  64-bit GCC compile finds.



SVN r968 (trunk)
2008-05-14 03:39:30 +00:00
Christoph Oelckers e77f83fbf6 - Added new Scroll_Wall special to allow more control over wall scrolling.
Since it uses fixed point parameters it can only be used in scripts though.
- Added flags parameters to all wall scroller specials that didn't use
  all 5 args.
- Separated scrolling of the 3 different texture parts of a sidedef.
  While doing this I did some more restructuring of the sidedef structure
  and changed it so that all state changes to sidedefs that affect rendering 
  have to be made with access functions. This is not of much use to the
  software renderer but it allows far easier caching of rendering data
  for OpenGL because the only place I need to check is in the access functions.


SVN r832 (trunk)
2008-03-21 17:35:49 +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
Randy Heit ef1a5a115f - Added a new MapMarker actor. Instead of appearing in the 3D view, it appears
on the automap instead. If its first argument is zero, the map marker itself
  appears on the automap, otherwise it is drawn on top of any actor with a TID
  matching that argument. If the second argument is one, then the map marker
  will only be appear if the player has previously seen the sector it is one.
  You can use Thing_Activate and Thing_Deactivate on markers to turn them on
  and off. And if you subclass MapMarker with DECORATE, you can easily make
  your own custom markers.
- Fixed: Map markers could not be drawn partially off the map. They were
  drawn either fully or not at all.
- Fixed: Map markers appeared in the wrong place on a rotated overlay map if
  screenblocks < 10.


SVN r356 (trunk)
2006-10-20 04:04:04 +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 0b3730392c - Fixed closed doors between the front sector's floor and ceiling the right way.
I was just missing a non-null texture check.
- Removed references to texturewidthmask. What was that?


SVN r244 (trunk)
2006-07-11 04:48:10 +00:00
Randy Heit d027aafb4c - Fixed: If the sector behind a seg was closed, but it was closed between the
ceiling and floor of the front sector, the renderer did not add it to the
  solid clip list.
- Blends created with the ACS fade commands now degrade to transparent overlays
  when the console is visible, just as they do for the menu.


SVN r240 (trunk)
2006-07-09 20:04:05 +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
Randy Heit a0c88a9b31 - Yay! We now seem to be free of memory leaks! The next step will be to
merge 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. (Interestingly, the amount of memory used when repeatedly
  executing the same map command at the console varies up and down, but it
  now stays relatively stable rather than increasing unbounded.)
- Fixed: The list of resolutions in the video modes menu was not freed
  at exit.
- Fixed: mus_playing.name was not freed at exit.
- Fixed: SN_StopAllSequences() should be called at the start of
  P_FreeLevelData(), not just before the call to P_SetupLevel() in
  G_DoLoadLevel(), so it can run even at exit. And C_FullConsole() can
  call P_FreeLevelData() to free more memory too.
- Fixed: StatusBar was not freed at exit.
- Fixed: spritesorter was not freed at exit.
- Fixed: Bad things happened if FString's data pool was destroyed before
  all C_RemoveTabCommand() calls were made.
- Added an overload for FArchive << FString.
- Fixed: The players' log text was not freed at exit.
- Fixed: Bot information was not freed at exit.
- Fixed: doomcom was not freed at exit. But since it's always created,
  there's no reason why it needs to be allocated from the heap. My guess
  is that in the DOS days, the external packet driver was responsible for
  allocating doomcom and passed its location with the -net parameter.
- Fixed: FBlockNodes were not freed at exit.
- Fixed: Openings were not freed at exit.
- Fixed: Drawsegs were not freed at exit.
- Fixed: Vissprites were not freed at exit.
- Fixed: Console command history was not freed at exit.
- Fixed: Visplanes were not freed at exit.
- Fixed: Call P_FreeLevelData() at exit.
- Fixed: Channel, SoundCurve, and PlayList in s_sound.cpp were not freed at
  exit.
- Fixed: Sound sequences were not freed at exit.
- Fixed: DSeqNode::Serialize() did not resize the m_SequenceChoices array
  when loading.


SVN r106 (trunk)
2006-05-11 04:00:58 +00:00
Randy Heit 3c9b55d1db SVN r81 (trunk) 2006-05-06 03:25:12 +00:00