Commit Graph

87 Commits

Author SHA1 Message Date
Randy Heit 9839cbfc82 - Fixed: The mouse was being grabbed in windowed mode again.
- Modified M_DrawFrame() and R_DrawTopBorder() so that they call FlatFill() to
  draw the edges of the frames. This at least seems a bit faster for hardware
  2D.
- Implemented FlatFill() for D3DFB. It seems to be exactly as fast as the
  default implementation that just calls DrawTexture() to tile the pieces onto
  the screen, so I'm not sure it was worth the bother.


SVN r686 (trunk)
2008-01-09 23:04:49 +00:00
Randy Heit 0b4092e98e - Merged the separate line and quad vertex buffers in D3DFB back into a single
vertex buffer, made line batching automatic, and added an index buffer for
  use when batching quads. The index buffer actually offered more of a
  performance boost than simply batching the quads alone did.


SVN r685 (trunk)
2008-01-09 21:04:21 +00:00
Randy Heit 016ac67376 - Fixed: Thing_SetTranslation still used a 16-bit word to hold the translation.
- Bumped the maximum resolution up to 2560x1600.
- Fixed: DCanvas::DrawTexture() only expanded virtual screen sizes for widescreen
  resolutions but left 5:4 modes alone. This fix neccessitated the addition of
  DTA_Bottom320x200 for the status bar to use so that it could be flush with the
  bottom of the screen rather than sitting slightly above it.
- Fixed: FConfigFile::ReadConfig()'s definition of whitespace was too broad.
- Fixed: Defining custom translation ranges in descending order and/or with gaps
  made for crashes.


SVN r676 (trunk)
2008-01-08 01:08:27 +00:00
Randy Heit 5cbb2bd472 - Moved the pixel shaders' color information out of the constant registers
and into the vertex data.
- Added functions for doing line drawing with Direct3D, including a new pair
  of functions to do batched line drawing so that the map can actually be
  drawn faster in hardware than in software (instead of an order of magnitude
  slower).


SVN r663 (trunk)
2008-01-04 05:22:30 +00:00
Randy Heit 5d9d2a9088 - Tried adding bilinear filtering support for paletted textures, but the
shader seems to be producing crappy output, so it's disabled for now.
  Specifically, it produces distorted output at regular intervals for
  textures that aren't power-of-2-sized, and it's still doing visible
  filtering when the texture is rendered at its original size, so
  obviously it's not doing something right.
- Fixed the use of power-of-2-sized native textures for smaller game
  textures again.
- Fixed: D3DFB did not restore all the state it needed to after resetting
  the device.
- Fixed: R_DrawTopBorder() must clip itself around the 3D view, since it's
  now drawn later.
- With full software rendering, palette flashes once again effect the whole
  screen.

Changes I neglected to put in the previous commit log:

- Moved the view border drawing into the 2D mode part. When using Begin2D()
  now, the only part of the software buffer that gets updated to the screen
  is the part with the actual 3D scene and only if you tell it to.
- Fixed a D3D memory leak on every frame in windowed mode and the same thing
  for the screen wipes. Note to self: If it's an interface, be sure to
  Release it, because it will be AddRef'ed before being returned to you.
- Moved the BlendView() call out of FBaseStatusBar::Draw() so that it can be
  applied before copying the 3D scene to the screen underneath the 2D parts.
- Restored the console's darkening level to its old table-based amount.
- Fixed D3DFB::SetColorOverlay()'s incorrect calculations.
- Fixed the D3D screen wipes for letterboxed modes.

SVN r662 (trunk)
2008-01-03 05:39:36 +00:00
Randy Heit 59c8faa7df - The mouse is no longer grabbed at all unless you're actually in a level,
since I couldn't think of any reason why it should be grabbed at any other
  time. (This only applies to windowed mode, where it makes sense to let the
  OS have control of the pointer.)


SVN r661 (trunk)
2008-01-02 05:21:48 +00:00
Randy Heit db54c43175 - Started writing Direct3D-friendly wipe code. It's just a Q&D crossfade for
now. More to come later.
- What is it about updaterevision.vcproj that makes it keep changing?

SVN r658 (trunk)
2007-12-30 04:18:39 +00:00
Randy Heit 522e7fe07f - Removed DCanvas::Blit(), as it's no longer used.
- Added a function to create a texture from a stand-alone PNG file. The save/
  load menus now use this to get their thumbnails.


SVN r652 (trunk)
2007-12-28 01:54:14 +00:00
Randy Heit 834e4bef32 - Changed the way gamma works for D3DFB: In windowed mode, the display is
drawn to a texture, then that texture is copied to the real back buffer
  using a gamma-correcting pixel shader. In fullscreen mode, SetGammaRamp
  is used.
- Fixed flashing of vid_fps display when fps > 1000.
- Fixed loading of RGB textures for native 2D mode.
- Changed the first rotozoomer's data because it just became too obvious when
  the backdrop is drawn with a full 256 distinct colors available.
- Set the player backdrop to update no more frequently than 35 FPS, so opening
  the player setup menu before starting a game won't produce a very fast
  moving backdrop.
- Changed the player backdrop into a texture so that it can be drawn like
  anything else.


SVN r648 (trunk)
2007-12-27 04:30:12 +00:00
Christoph Oelckers 6804e66208 - Replaced 'C:\\ZDOOMDAT' with a #define in version.h.
- Moved screenshot code into DCanvas so that it can be overridden by
  subclasses with a different buffer.


SVN r643 (trunk)
2007-12-26 09:56:09 +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 d12ede252f - also replaced the AM crosshair drawer by a DCanvas::DrawPixel function.
- moved the AM line drawer into DCanvas as a virtual function. While testing
  this code I discovered that the antialias precalculation was never used
  except for the very first frame of AM drawing. However, since I couldn't
  detect even a marginal performance improvement using this code on 2 computers
  I just disabled it completely because it severely complicates a more generic
  implementation. I also disabled am_ovtrans in the process because I couldn't
  see any positive effects of using this cvar. All it does is adding some 
  ugly distortion to the lines it affects without any apparent benefits.
* Added fix by Karate Chris containing:
- Added a 'No team changing' DMFlag2 which prevents players from changing teams 
  unless they are not on a team.
- Added a 'No respawn' DMFlag2 which prevents a player from respawning after 
  they have died.
- Added a 'Keep frags gained' DMFlag2 which allows you to choose whether you 
  want to reset the frags of each player next level or not.
- Added a small visual enhancement to the cooperative scoreboard to show 
  if a player has died.
- Fixed: If the 'teamplay' console variable was set to 'true' in a cooperative 
  game, the scoreboard would show team play related items as opposed to 
  cooperative items.
- Fixed: The 'bot_observer' console variable should not work in network games.
- Fixed: Bots made intermission skip really fast.


SVN r634 (trunk)
2007-12-24 14:24:24 +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 eb2e40cde0 - Changed DTA_Translation parameter for DrawTexture to an integer to avoid
passing renderer specific data to the function. Also added DTA_Font so
  that the renderer can fetch font translations from the proper font.
  DIM_MAP/ConShade had to be made a regular translation table to make it
  work.
- Added Karate Chris's fix for scoreboard displaying team play related data
  in non teamplay games.
- Fixed: The team selection menu didn't work.
- Fixed: UpdateTeam passed an FString to Printf.


SVN r623 (trunk)
2007-12-23 14:13:29 +00:00
Randy Heit dddc781f18 - Added versions of Dim and Clear to D3DFB for use in 2D mode.
- Added a new color parameter to DCanvas::Clear() that specifies the
  ARGB value of the color. This is used if the old color parameter,
  which specifies a palette entry, is -1.


SVN r617 (trunk)
2007-12-22 04:52:51 +00:00
Randy Heit e84bece8eb - Fixed: TEAMINFO broke bot parsing for bots with invalid team names by
redefining TEAM_None from 255 to -1.


SVN r616 (trunk)
2007-12-22 04:00:25 +00:00
Christoph Oelckers 28db2d9f15 - Fixed: FTexture::~FTexture() must destroy the associated native texture
if present.
- Modified GZDoom's true color texture copy functions and added them
  to generate 32 bit D3D textures. Paletted TGAs and PCXs are also handled
  this way but I don't think these 2 formats are worth some more special
  handling.
  (Question: Is it worth it to implement special handling for paletted PNGs
   so that they are used as 8 bit textures internally?)


SVN r608 (trunk)
2007-12-20 18:53:35 +00:00
Christoph Oelckers 457976d88d - Fixed: DCanvas::Blit unlocked the destination twice instead of unlocking
both dest and src. Also changed this function so that it is owned by the
  destination canvas of the operation which is necessary if it needs to 
  be overridden by subclasses.


SVN r607 (trunk)
2007-12-20 14:05:08 +00:00
Randy Heit 111853e623 - Added a framework for drawing the 2D screen elements with Direct3D textures.
They are not actually drawn with it yet, nor is it complete, but it's
  something to start with.
- Split up DCanvas::DrawTexture() into more pieces to make it easier to
  virtualize.
- Removed support for non-32-bit palette textures from D3DFB. What kind of
  card supports pixel shaders but not 32-bit textures?


SVN r605 (trunk)
2007-12-20 04:36:43 +00:00
Randy Heit c087e4d411 - New: When using the D3D9 framebuffer, palette blending is now applied only
to the 3D area of the screen. This means the console and (the primary
  rectangular area of) the status bar are no longer blended.


SVN r601 (trunk)
2007-12-18 01:50:08 +00:00
Randy Heit 6a00173a12 - Fixed: SECSPAC_EyesSurface and SECSPAC_EyesDive did not trigger due to
crouching motion.
- Fixed: The keypress for nightmare mode verification appeared in the console
  if the fullscreen console was open while using the menu.
- Added support for scaling down large console fonts in the customize
  controls menu.
- Fixed: Joining a negative team was possible.


SVN r590 (trunk)
2007-12-09 03:40:02 +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
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
Randy Heit 93b18c3bfa SVN r383 (trunk) 2006-11-19 02:10:25 +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 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 e2179d5c2d Guess what. It's not 2005 anymore.
SVN r184 (trunk)
2006-06-11 01:37:00 +00:00
Randy Heit 90b5130db0 - Fixed: The C code in AltSoundRenderer::CopyAndClip() did not shift the sample
data enough (2 bits instead of 8), so it was super loud and aliased.
- Fixes for GCC 4.1: Several type-punned pointer warnings, but more
  importantly, declaring a friend function inside a class body is no longer
  enough to declare that function globally; you must declare it again outside
  the class.
- Upgraded FArchive::SerializePointer so that it can store 32-bit indices.
- ACS printing pcodes now build their string in an FSttring instead of a fixed
  sized buffer on the stack.


SVN r145 (trunk)
2006-05-26 04:38:22 +00:00
Randy Heit f50b284fda SVN r142 (trunk) 2006-05-24 15:31:21 +00:00
Christoph Oelckers 4a8ca6d134 Changed TAG_MORE parameter to a struct containing a va_list to ensure that no matter how va_list is defined the address can be taken.
SVN r119 (trunk)
2006-05-16 10:06:23 +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 201e17082c - Blends created with the ACS fade commands now degrade to transparent overlays
when the menu is visible, so they can no longer obscure the menu.


SVN r87 (trunk)
2006-05-09 00:28:01 +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