Commit graph

170 commits

Author SHA1 Message Date
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
svdijk
b6ef9fae3e SDLGLFB: Implement mouse coordinate scaling for the menus. 2017-05-14 12:12:12 +03:00
Christoph Oelckers
dc5a5419fc - took DCanvas and all its subtypes out of the DObject tree.
I have no idea why they were even in there, as they intentionally circumvented all GC related features - they declared themselves fixed if prone to getting collected, they all used OF_YesReallyDelete when destroying themselves and they never used any of the object creation or RTTI features, aside from a single assert in V_Init2.

Essentially they were a drag on the system and OF_YesReallyDelete was effectively added just to deal with the canvases which were DObjects but not supposed to behave like them in the first place.
2017-04-14 10:48:18 +02:00
Christoph Oelckers
6599e2c425 - moved the VM types into their own file and only include it where really needed. 2017-04-13 01:12:04 +02:00
Christoph Oelckers
54764c136d - changed the 2D draw abort check to use a dedicated variable, that gets set in Begin2D and unset at the end of D_Display.
This is really all the extent where 2D draw operations may be allowed. Trying to detect this from other variables is not reliable.
2017-04-01 12:59:58 +02:00
Christoph Oelckers
f95c29ad28 cleaned up the scaling options.
- all 5 settings affected by uiscale have been changed to have the exact same semantics: -1, if supported means special scaling, this is available for HUD and status bar, 0 means to use uiscale, any larger value is a direct scaling factor.
- scaling is cut off when the factor is larger than screenwidth/320 or screenheight/200 because anything larger will definitely not fit.
- a lot of code has been cleaned up and consolidated. Especially the message code had an incredible amount of redundancy.
- all scaling options have been moved into a submenu. This menu is not complete, though - it still requires a special menu widget to convey the intended information without confusing the user.
2017-03-30 02:16:23 +02:00
Christoph Oelckers
01b095c911 - added colorization for untranslated fonts. This uses the light color of the vertices. The software rendered 2D code will ignore this infomation.
- added a virtual OnRetrun method to menus.
2017-03-29 21:22:05 +02:00
Christoph Oelckers
1d4ab0cc2a - implemented proper scaling for the status bar itself.
This allows using the UI scale or its own value, like all other scaling values.
In addition there is a choice between preserving equal pixel size or aspect ratio because the squashed non-corrected versions tend to look odd, but since proper scaling requires ununiform pixel sizes it is an option.

- changed how status bar sizes are being handled.

This has to recalculate all scaling and positioning factors, which can cause problems if the drawer leaves with some temporary values that do not reflect the status bar as a whole.
Changed it so that the status bar stores the base values and restores them after drawing is complete.
2017-03-29 19:23:40 +02:00
Magnus Norddahl
d160424aea - added DFrameBuffer::HasBegun2D to allow scripting to test if 2D drawing is active (instead of using IsLocked, which may return false when vid_hw2d is active) 2017-03-29 00:45:53 +02:00
Christoph Oelckers
f3db5f3803 - added a clipping rectangle to DCanvas that can be used independently of DrawTexture calls.
Currently this is only being used for draw operations that are not automap related, i.e. DrawLine, DrawPixel and FillSimplePoly are not subjected to it.
2017-03-28 13:06:24 +02:00
Christoph Oelckers
9a24771a7d - refactored FDynamicColormap out of sector_t.
This has increasingly become an obstacle with the hardware renderer, so now the values are being stored as plain data in the sector, with the software renderer getting the actual color tables when needed. While this is a bit slower than storing the pregenerated colormap, in realistic situations the added time is mostly negligible in the microseconds range.
2017-03-15 22:04:59 +01:00
Christoph Oelckers
72da1fed7e - removed many 'extern "C"' declarations, now that assembly is no longer a concern.
- some concepts about building a RenderViewpoint struct. No actual work yet.
2017-03-11 11:31:09 +01:00
Christoph Oelckers
9b87a167d7 - replaced a large batch of DWORDs.
Most of those which still rely on ZDoom's own definition should be gone, unfortunately the code in files that include Windows headers is a gigantic mess with DWORDs being longs there intead of ints, so this needs to be done with care. DWORD should only remain where the Windows type is actually wanted.
2017-03-09 20:19:55 +01:00
Christoph Oelckers
d2beacfc5f - except for DWORD, all homegrown integer types are gone - a handful were left where they represent genuine Windows types. 2017-03-09 19:54:41 +01:00
Christoph Oelckers
c008ddaf66 - replaced homegrown SWORD, SBYTE and uint32_t types. 2017-03-09 19:31:45 +01:00
Rachael Alexanderson
404b326812 Merge https://github.com/coelckers/gzdoom 2017-02-25 18:32:06 -05:00
Christoph Oelckers
8dac678200 - added DAMAGE_NO_ARMOR flag for ACS's SectorDamage function. 2017-02-25 19:10:49 +01:00
Magnus Norddahl
9159e3b1f0 Move software canvas drawing to its own file in the software renderer 2017-02-13 17:32:52 +01:00
Rachael Alexanderson
a52f79055d Merge https://github.com/coelckers/gzdoom
# Conflicts:
#	src/menu/playerdisplay.cpp
2017-02-11 05:05:24 -05:00
Christoph Oelckers
8c780ab7ff - exported the drawer function of the colorpicker menu. 2017-02-10 13:21:35 +01:00
Rachael Alexanderson
942f90a759 Merge remote-tracking branch 'gzdoom/master' 2017-02-05 16:07:48 -05:00
Christoph Oelckers
d90f2ba1fa - wrap the va_list that gets passed around by the Draw functions into a struct so that the templates can use reliable, identical semantics for both this and the VM's arg list. 2017-02-05 21:54:09 +01:00
Christoph Oelckers
9e038b75fa - exported DrawChar and DrawText. 2017-02-05 16:47:33 +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
470dc138c6 - got rid of all DTA_Translation uses. 2017-02-05 00:17:29 +01:00
Christoph Oelckers
dadc8e2ec2 - removed all uses of DTA_Translation except for the single one that passes a custom built table.
This means that with the exception of 3 pointers the DrawTexture interface only accepts numeric values now.
Still need to get rid of the last 3 to have this ready for scripting.
2017-02-04 23:26:28 +01:00
Christoph Oelckers
6dea3eef8e - exported DrawTexture to scripting.
This uses templates to avoid source duplication of ParseDrawTextureTags. Not tested yet.
2017-02-04 22:09:49 +01:00
alexey.lysiuk
e8c2444ddd Fixed compilation with GCC/Clang
error: use of undeclared identifier 'op'
error: no matching function for call to 'ListEnd'
error: no matching function for call to 'ListGetInt'
error: no matching function for call to 'ListGetDouble'
...
2017-02-04 18:10:30 +02:00
Christoph Oelckers
d3ed83942f - did some preparations to ParseDrawTextureTags to allow using the same code for parsing tag lists generated by the VM.
- removed the fixed point alpha tag from DrawTexture and replaced all uses with the floating point version.
2017-02-04 13:11:12 +01:00
Rachael Alexanderson
0c101102dc Merge https://github.com/coelckers/gzdoom
# Conflicts:
#	src/r_bsp.cpp
#	src/r_main.cpp
#	src/r_segs.cpp
#	src/r_things.cpp
#	wadsrc/static/language.enu
#	wadsrc/static/menudef.txt
2017-01-28 17:39:55 -05:00
Christoph Oelckers
ee22a9371b - use Doom64 colors on sectors and linedefs. 2017-01-28 20:44:46 +01:00
Rachael Alexanderson
978152f483 Merge https://github.com/rheit/zdoom
# Conflicts:
#	wadsrc/static/compatibility.txt
2016-12-19 08:16:41 -05:00