Commit graph

201 commits

Author SHA1 Message Date
Magnus Norddahl
f03c02df43 - fix gamepic render buffer issues 2018-06-03 13:59:40 +02:00
Christoph Oelckers
1656bbf9ec - route the BlurScene call in the menu through DFrameBuffer.
Game code should never ever call the renderer directly. This must be done through the video interface so that it can also work with other framebuffers later.
2018-05-18 00:22:57 +02:00
Christoph Oelckers
b197bfc964 - avoid checking for vr_enable_quadbuffered directly.
This option only exists on Windows, so on the other platforms it should not be in the menu and not affect the setup of the VR mode.
2018-05-18 00:12:45 +02:00
Christoph Oelckers
44dd48c7fa - moved the palette stuff and some remaining scaling code from OpenGLFrameBuffer to DFrameBuffer and fixed GetFlashedPalette 2018-05-16 22:10:24 +02:00
Christoph Oelckers
c2a7a4bf30 - moved viewport code to DFrameBuffer. 2018-05-12 17:23:56 +02:00
Christoph Oelckers
de15b589c0 - moved the screen blending code out of the renderer.
This is better be made part of the 2D interface.
That would have been done long ago if it hadn't been for the totally incompatible way this was handled by the purely paletted software renderer.
Now with that out of the way there is no point keeping this code this deeply embedded in the renderer.
2018-05-05 11:20:37 +02:00
Christoph Oelckers
67cb6e63b5 - cleanup of the 2D interface.
Lots of this was still laid out for DirectDraw. This removes most of Begin2D so that it can be done more cleanlz.
Note that this commit renders weapon sprites and screen blends incorrectly. Those will be fixed in an upcoming commit.
2018-04-29 20:15:19 +02:00
Christoph Oelckers
06d20e13b8 - cleaned up the gamma correction code.
This had accumulated quite a bit of cruft by now and parts of it should be in non OpenGL code.
2018-04-29 13:45:53 +02:00
Christoph Oelckers
cc926dec1e - removed gl dependencies from gl_sky.cpp by moving some data into other places. 2018-04-28 00:18:49 +02:00
Christoph Oelckers
bbea6e7e3c Begin2D doesn't need a return type anymore
This was to tell the caller that software 2D was in use, but that doesn't exist anymore
2018-04-27 09:58:19 +02:00
Christoph Oelckers
dd524b046e - GLWall is mostly clean, except some smaller things in gl_sky.cpp 2018-04-27 00:22:00 +02:00
Christoph Oelckers
306b630de2 - merged the remains of gl_texture.cpp into hw_cvars.cpp.
- eliminated hqresize.cpp's dependency on GL headers.
- cleaned up the logic for CreateTexBuffer so that hqresize.cpp does not need to check for software warped textures anymore.
2018-04-25 21:02:50 +02:00
Christoph Oelckers
bc8f47444f - texture precaching also moved to hwrenderer/. 2018-04-25 00:07:46 +02:00
Christoph Oelckers
0675315b41 - made FHardwareTexture inherit from an abstract interface to remove all GL dependencies from gl_material.cpp. 2018-04-24 23:06:34 +02:00
Christoph Oelckers
c37ff22a05 - removed the intermediate FGLTexture class.
This wasn't serving any real purpose anymore, and all its remaining functionality could be moved to FHardwareTexture
2018-04-24 20:41:52 +02:00
Magnus Norddahl
c4768441b4 - Fix playersprite offset being wrong in softpoly
- Remove DFrameBuffer::GetCanvas as it always returned null
2018-04-08 15:49:06 +02:00
alexey.lysiuk
018f5b8d05 Removed deleted virtual functions
They led to link errors with the current Apple's toolchain
2018-04-08 13:55:46 +03:00
Christoph Oelckers
b12a6fded9 - added the code for legacy shaders.
- force texture filtering for 2D to off when in software rendering.
2018-04-08 12:11:51 +02:00
Christoph Oelckers
1897073b60 -fixed: When performing a restart the SW scene drawer's resources should be reset because they are outside the control of higher level containers. 2018-04-08 08:03:46 +02:00
Christoph Oelckers
df4f435952 - merged vid_renderer, swtruecolor and r_polyrender into one CVAR to reduce menu clutter.
- with renderers freely switchable, some shortcuts in the 3D floor code had to be removed, because now the hardware renderer can get FF_THISINSIDE-flagged 3D floors.
- changed handling of attenuated lights in the legacy renderer to be adjusted when being rendered instead of when being spawned. For the software renderer the light needs to retain its original values.
2018-04-07 23:30:28 +02:00
Magnus Norddahl
fde87c40d2 - fix crash when in software truecolor mode - the pitch is in pixels, not bytes 2018-04-07 19:56:54 +02:00
Christoph Oelckers
211a7f2569 - made the screen blend work for the software renderer.
It may use the same calculations as the hardware renderer but must use the 2D drawer for display.
It should be investigated if the hardware renderer can do this as well.
2018-04-07 10:53:20 +02:00
Christoph Oelckers
b34d7f9e08 - added a software scene drawer to the GL renderer.
It still looks like shit and only works on the modern render path but at least the basics are working.
2018-04-07 10:20:59 +02:00
Christoph Oelckers
d474b849a5 - removed the remaining calls from the FRenderer interface from the main game code.
This does not work with a setup where the same backend is driving both renderers.
Most of this is now routed through 'screen', and the decision between renderers has to be made inside the actual render functions.
The software renderer is still driven by a thin opaque interface to keep it mostly an isolated module.
2018-04-04 00:21:25 +02:00
Christoph Oelckers
fcc33f0a09 - moved around more stuff from the FRenderer interface. 2018-04-03 22:50:47 +02:00
Christoph Oelckers
853903bb7e - removed the border refresh counter.
This was just a relic of DirectDraw as main backend and is no longer needed.
2018-04-03 00:50:40 +02:00
Christoph Oelckers
a9d5533603 - integrated GL parts of translation handling into the main module.
Now that this doesn't have to share assets with HW2D it could be simplified a lot.
2018-04-01 00:59:49 +02:00
Christoph Oelckers
a001a5304d - removed the old software renderer framebuffers for Windows
This cannot be refactored with the old code still present and done properly both renderers should share what they can.
2018-03-30 23:18:25 +02:00
Christoph Oelckers
ec8804cfd8 - added missing virtual destructor to DFrameBuffer.
Previously it inherited this from DCanvas but now both classes are no longer related.
2018-03-30 22:03:50 +02:00
Christoph Oelckers
811d96e07e D3D 2D code refactored but not tested yet. 2018-03-29 23:21:25 +02:00
Christoph Oelckers
a40e085a46 - 2D drawer implementation complete for hardware renderer.
This also replaces DTA_ColormapStyle with proper implementations of its components. As implemented it was a very awkward mixture of various effects that already existed in a separate form. As a result of its implementation it required additional but completely redundant shader support which could be removed now. As a side effect of this change a new DTA_Desaturate option was added.
2018-03-29 16:21:21 +02:00
Christoph Oelckers
70b6754299 - implemented the 2D drawer for the hardware renderer. Not tested yet. 2018-03-28 21:38:00 +02:00
Christoph Oelckers
16480a3f4b - it compiles again.
This won't work, though, because no backend for the new 2D code exists yet.
2018-03-28 16:40:09 +02:00
Christoph Oelckers
2ed744963c - Changed frame buffer locking mechanism so that the only place where a lock is needed is when the software renderer wants to access the render buffer, which is precisely for the duration of the RenderView function.
No more locking insanity! :)
There are no locking counters or other saveguards here that would complicate the implementation because there's precisely two places where this buffer must be locked - the RenderView functions of the regular and poly SW renderer which cannot be called recursively.
2018-03-27 20:02:44 +02:00
Christoph Oelckers
62f073ef60 - removed Accel2D variable and a little bit of locking cruft. 2018-03-27 17:13:10 +02:00
Christoph Oelckers
cff5f0e3c7 - removed DFrameBuffer's locking mechanism.
In its current form this is quite useless. What's really needed is to require a lock on the RenderBuffer for the 3D scene, but since this is not needed for the 2D stuff anymore it can be done far simpler.
2018-03-27 16:48:33 +02:00
Christoph Oelckers
c06ad5c59c - separated DFrameBuffer from DCanvas.
This was a bad idea from the start and really only made sense with DirectDraw.
These days a FrameBuffer represents an abstract hardware canvas that shares nothing with a software canvas so having these classes linked together makes things needlessly complicated.
The software render buffer is now a canvas object owned by the FrameBuffer.

Note that this commit deactivates a few things in the software renderer, but from the looks of it none of those will be needed anymore if we set OpenGL 2 as minimum target.
2018-03-27 14:14:46 +02:00
Christoph Oelckers
bb9283a9af - work on separating DFrameBuffer from DCanvas.
2D works in D3D backend, but 3D crashes because not all pointers have been rerouted yet.
2018-03-27 13:50:31 +02:00
Christoph Oelckers
1a28644d83 - cleaned out unused stuff from DCanvas.
- removed CocoaFrameBuffer because it is a software fallback which is no longer supported.
2018-03-27 11:25:06 +02:00
Christoph Oelckers
ba799aebbd - moved locking logic from DCanvas to DFrameBuffer.
The software canvases used for rendering camera textures and save pictures in the software renderer do not need this.
2018-03-27 11:12:13 +02:00
Christoph Oelckers
dd491d6558 - removed support for paletted Windows display modes.
This was only relevant for DirectDraw which has been removed.
2018-03-27 10:41:38 +02:00
Christoph Oelckers
ded21cba8e - moved more code from DCanvas to DFrameBuffer. 2018-03-27 10:34:21 +02:00
Christoph Oelckers
d650e37497 - stripped out the entire software 2D renderer and moved all 2D drawing functions to DFrameBuffer so that they cannot be used with software DSimpleCanvas anymore. 2018-03-26 23:16:27 +02:00
alexey.lysiuk
2951476ce0 Fixed compilation with GCC and Clang
src/v_video.h:56:6: error: ISO C++ forbids forward references to 'enum' types
src/v_video.h:342:17: error: field has incomplete type 'FTextureFormat'
src/v_video.h:344:47: error: variable has incomplete type 'FTextureFormat'
2018-03-24 09:53:55 +02:00
Christoph Oelckers
7301001a3f - made the necessary adjustments to the HW2D interfaces to handle alpha textures properly.
These cannot be done with the regular textures so there needs to be an option to create more than one native texture per FTexture. For completeness' sake there is also the option now to create a paletted version of a texture if the regular one is true color. This fixes a long standing problem that translations were not applied to non-paletted textures.
2018-03-23 23:04:30 +01:00
Christoph Oelckers
d2fa4d0ff9 - most stat stuff done. 2018-03-12 19:33:48 +01:00
alexey.lysiuk
5162e7162e Fixed overbright screenshots with hardware gamma off
When render buffers are used to apply gamma/brightness/contrast screenshots should not use PNG gamma correction
2017-12-06 11:24:10 +02:00
Rachael Alexanderson
909daadd75 - update more millisecond-storing data structures to u/int64_t to fix possible rollover bugs 2017-11-15 20:33:08 -05:00
Rachael Alexanderson
763222b571 - fixed: high uptime was causing overloads in uint32_t and float structures (float losing loss of precision) - this caused any computer online for more than a few days to experience jankiness with internal animations such as rotations and shader timers. Unfortunately, this sounds the death knell for 32-bit platforms, since uint64_t is now required in time-critical structures, which will hurt performance tremendeously, but 64-bit systems will be unaffected. 2017-11-14 16:15:25 -05:00
Christoph Oelckers
2c65f08011 - more timer cleanup
* store the frame time in the current screen buffer from where all render code can access it.
* replace some uses of I_MSTime with I_FPSTime, because they should not use a per-frame timer. The only one left is the wipe code but even this doesn't look like it needs either a per-frame timer or a timer counting from the start of the playsim.
2017-11-13 00:28:43 +01:00