Commit graph

227 commits

Author SHA1 Message Date
Christoph Oelckers
6bd76d6b5a - fixed compilation in debug mode.
- moved timer definitions into their own header/source files. d_main is not the right place for this.
- removed some leftover cruft from the old timer code.
2017-11-12 09:06:40 +01:00
Magnus Norddahl
307d8931d8 - Switch to C++11 steady clock
- Move the C++11 implementation to d_main
- Remove the platform specific timer implementations
2017-11-12 03:12:22 +01:00
Rachael Alexanderson
fc0ae896b2 - remove vid_tft and vid_nowidescreen and associated menu option. Their functionality was supersceded and extended by vid_aspect==3 (which has the same effect as setting both to true anyhow), and it was mostly just redundant. 2017-10-10 06:38:07 -04:00
Rachael Alexanderson
69abf095c9 - added vid_cropaspect. This cvar turns vid_aspect into a letterboxing function that will crop the unused sides of the screen away, instead of stretching it. Requires one of the non-legacy OpenGL framebuffers to work. 2017-10-07 20:18:37 -04:00
Rachael Alexanderson
10e1600faf - Replaced one more vid_scalemode check with a more versatile ViewportIsScaled43 check 2017-07-27 12:19:41 -04:00
Rachael Alexanderson
30087f7cd7 - cleaned up the video scale mode code a bit, in order to increase future flexibility. 2017-07-27 03:05:01 -04:00
Rachael Alexanderson
45a37211e4 - added special handling for vid_scalemode == [1||2] to force video aspect scaling off unless the user explicitly specified an aspect override. 2017-07-23 10:49:13 -04:00
Magnus Norddahl
370e53befe - Replace vid_max_width and vid_max_height with vid_scalemode for the GL software framebuffer backend
- Fix a crash if the window was resized before creating a game
- Fix main menu scaling being wrong if the video mode didn't match the unscaled screen size
2017-07-23 04:23:13 +02:00
alexey.lysiuk
a92f889e44 Fixed recently introduced compilation warnings
src\v_video.cpp(1771): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
src\v_video.cpp(1773): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
2017-05-16 16:39:07 +03:00
svdijk
b6ef9fae3e SDLGLFB: Implement mouse coordinate scaling for the menus. 2017-05-14 12:12:12 +03:00
Christoph Oelckers
96d328de9b - removed all Doom Source license and all default Raven copyright headers and replaced them with GPLv3. Also fixed the license in a few other files.
For some files that had the Doom Source license attached but saw heavy external contributions over the years I added a special note to license all original ZDoom code under BSD.
2017-04-17 13:33:19 +02: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
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
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
31ea33bfc4 - rewrote the condition nodes from SBARINFO in ZScript. This compiles but hasn't been tested yet. 2017-03-23 00:25:26 +01:00
Christoph Oelckers
9bffe4ee50 - scriptified the main statusbar interface and the Strife status bar.
Note that the Strife status bar does not draw the health bars yet. I tried to replace the hacky custom texture with a single fill operation but had to find out that all the coordinate mangling for the status bar is being done deep in the video code. This needs to be fixed before this can be made to work.

Currently this is not usable in mods because they cannot initialize custom status bars yet.
2017-03-22 00:32:52 +01:00
Christoph Oelckers
6b95371813 - made a few adjustments to the clean factor calculation so that on large screens the smaller factor gets preferred.
Without such tweaking the menu scale tends to get a bit too large on some screen sizes.
2017-03-19 18:38:16 +01:00
Christoph Oelckers
cd392e50e9 - added a dummy struct named '_' to define global variables. This can only be used internally.
This method was chosen because it avoids adding variable declarations to the global namespace which would have required a lot more work while polluting the grammar.
This way the global variables can be handled by a small bit of special coding in the struct generator.
2017-03-13 14:42:14 +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
Rachael Alexanderson
21a8964bea Merge remote-tracking branch 'gzdoom/master'
# Conflicts:
#	src/v_video.cpp
2017-03-03 16:29:33 -05:00
Rachael Alexanderson
4b63092c7a - disable size checking in windowed mode for vid_setmode, allowing it to set arbitrary sizes. 2017-03-03 22:19:58 +01:00
Magnus Norddahl
42a7dbe33a Merge remote-tracking branch 'gzdoom/master' into qzdoom
# Conflicts:
#	src/v_video.cpp
2017-02-19 03:49:13 +01:00
Christoph Oelckers
0c41a9dee7 - scriptified DTextEnterMenu::Drawer. 2017-02-18 20:12:06 +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
942f90a759 Merge remote-tracking branch 'gzdoom/master' 2017-02-05 16:07:48 -05:00
Christoph Oelckers
e55406bc23 - changed clean scaling factor calculation so that it doesn't prefer larger scales on high resolution displays.
This was a tweak that only makes sense when the scaling factors are low, i.e. 2 vs. 3, but for modern high resolutions it will enlarge things a bit too much.
2017-02-05 18:48:49 +01:00
Rachael Alexanderson
8231032f89 - fixed a crash
- tried to make MAKETRANSDOT algorithm more consistent with original
2016-12-24 19:22:31 -05:00
Rachael Alexanderson
564bfe482c Merge branch 'zdoom-rgb666-take3' of https://github.com/raa-eruanna/qzdoom into qzdoom-rgb666
# Conflicts:
#	src/r_draw.cpp
#	src/r_plane.cpp
#	src/r_things.h
#	src/v_draw.cpp
#	src/v_video.cpp
2016-12-24 19:00:28 -05:00
Rachael Alexanderson
80482e98a3 - renamed r_blendmode to r_blendmethod
- did another drawer
2016-12-24 10:15:02 -05:00
Rachael Alexanderson
9d2128a4f4 - Fixed compile errors. 2016-12-24 04:01:50 -05:00
Rachael Alexanderson
8de11ee81a - Begin reimplementing rgb555 again. 2016-12-24 03:52:18 -05:00
Rachael Alexanderson
821b10a254 - Implementing RGB666 colormatching to replace less precise RGB555 in some parts of the code. 2016-12-23 11:41:10 -05:00
Rachael Alexanderson
978152f483 Merge https://github.com/rheit/zdoom
# Conflicts:
#	wadsrc/static/compatibility.txt
2016-12-19 08:16:41 -05:00
Rachael Alexanderson
5d85990d5f - Implementing RGB666-to-Palette colormatching for textures. 2016-12-19 13:46:08 +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
Christoph Oelckers
66d28a24b8 - disabled the scripted virtual function module after finding out that it only works if each single class that may serve as a parent for scripting is explicitly declared.
Needless to say, this is simply too volatile and would require constant active maintenance, not to mention a huge amount of work up front to get going.
It also hid a nasty problem with the Destroy method. Due to the way the garbage collector works, Destroy cannot be exposed to scripts as-is. It may be called from scripts but it may not be overridden from scripts because the garbage collector can call this function after all data needed for calling a scripted override has already been destroyed because if that data is also being collected there is no guarantee that proper order of destruction is observed. So for now Destroy is just a normal native method to scripted classes
2016-11-25 00:25:26 +01:00
Christoph Oelckers
d1f5d916c2 Merge branch 'master' into zscript 2016-11-23 14:39:14 +01:00
Rachael Alexanderson
78db0a0d06 Merge branch 'master' of https://github.com/rheit/zdoom 2016-11-23 01:43:12 -05:00
Braden Obrzut
789315bb4a - Fixed build with MinGW-w64 (TDM-GCC 5.1). Note that the resulting binary will crash under -O3 until the alignment violation is taken care of in FRemapTable::Alloc.
- It appears that CMake added native support for building rc files with MinGW at some point so removed manual rc compiling code.
2016-11-22 22:41:32 -05:00
Rachael Alexanderson
f284a24ed9 Merge branch 'master' of https://github.com/rheit/zdoom 2016-11-12 10:17:56 -05:00
Christoph Oelckers
62a259bb36 Merge branch 'master' of https://github.com/rheit/zdoom into zscript 2016-11-12 09:46:09 +01:00
Marisa Heit
3926ca13b0 Fix console input not scrolling when you hit the side of the screen
- Also changed the console input buffer into a struct instead of a
  frankenstein buffer.
2016-11-12 00:34:07 -06:00
Leonard2
7dbc4710f1 Add the new argument to all uses of the implement macro 2016-11-09 17:45:55 +01:00
Leonard2
bb2d61de50 Replaced the many implement macros with a single one that takes arguments instead 2016-11-09 17:45:53 +01:00
raa-eruanna
08166473ca Merge branch 'truecolor' of http://github.com/dpjudas/dpdoom
# Conflicts:
#	src/v_video.cpp
2016-09-25 13:48:52 -04:00
Magnus Norddahl
77233f2f65 Merge remote-tracking branch 'upstream/master' into truecolor
# Conflicts:
#	src/v_video.cpp
2016-09-19 23:55:15 +02:00
raa-eruanna
a83477e549 Merge http://github.com/rheit/zdoom 2016-09-15 19:18:56 -04:00
Magnus Norddahl
48f491cfd1 Fix video mode selection bug 2016-09-15 07:52:53 +02:00
raa-eruanna
3ebf8c7e74 More code fixes - now it compiles. 2016-09-14 06:28:39 -04:00
raa-eruanna
81545d9b4e Merge http://github.com/rheit/zdoom
# Conflicts:
#	src/v_video.cpp
2016-09-14 02:24:59 -04:00
Magnus Norddahl
017d1cee29 Change canvas rendering to use the aspect ratio of the canvas and generalize 5:4 rendering as AspectTallerThanWide 2016-09-13 23:42:05 +02:00
Magnus Norddahl
172f58c165 Fix 5:4 aspect ratio gun and status bar 2016-09-13 23:42:05 +02:00
Magnus Norddahl
01b1efe9ee Switch from abs to fabs 2016-09-12 18:44:04 +02:00
Magnus Norddahl
5b438d220f Switch from ratio enum to float 2016-09-12 15:51:50 +02:00
Magnus Norddahl
6d4e4dad25 BaseRatioSizes replacement functions 2016-09-12 14:37:10 +02:00
Magnus Norddahl
5720634045 Add ActiveRatio to be used where CheckRatio is used today 2016-09-12 13:59:01 +02:00
Magnus Norddahl
b003c47e3e Improve CheckRatio to always return the closest ratio 2016-09-12 13:37:05 +02:00
Magnus Norddahl
d3d8180f57 Resize framebuffer in windowed mode to match the client area 2016-09-12 13:04:36 +02:00
raa-eruanna
32f758de41 Merge branch 'truecolor' of https://github.com/dpjudas/zdoom
# Conflicts:
#	src/v_video.cpp
2016-09-08 03:19:08 -04:00
Magnus Norddahl
e794e59cd2 Add con_scale for scaling just the console 2016-09-08 00:39:52 +02:00
Magnus Norddahl
d2f8fc63fc Scale the console itself as specified by con_scaletext 2016-09-08 00:39:51 +02:00
Christoph Oelckers
e04055dbb2 - added multiple message levels for 'developer' CVAR so that the important stuff won't get drowned in pointless notification spam that's of no use to anyone.
- made 'developer' CVAR persist across launches and added some menu entries for it.
- added checks for 'developer' to ACS's CheckInventory function.
2016-08-28 09:55:04 +02:00
Magnus Norddahl
35c078dc1e Screenshot fix 2016-06-17 11:24:21 +02:00
Magnus Norddahl
8ba6a4f175 Precache, Unload and FillSimplePoly bug fix 2016-06-13 21:39:55 +02:00
Magnus Norddahl
40b76dc9b0 Apply gamma when using true color output on Linux and Mac 2016-06-11 18:41:56 +02:00
Magnus Norddahl
05220a7133 Added IsBgra() to DCanvas
Changed SWRender output format to be decided by IsBgra()
2016-05-31 09:36:18 +02:00
Magnus Norddahl
045bad1b52 Removed the need for the pixel_canvas_t typedef 2016-05-31 05:31:32 +02:00
Magnus Norddahl
20b7743ec3 Added R_SetColorMapLight and R_SetDSColorMapLight 2016-05-31 01:49:39 +02:00
Magnus Norddahl
6e53c1bd12 Change render target output from PAL8 to BGRA8 2016-05-28 20:40:33 +02:00
Christoph Oelckers
65e1589543 - allow specifying actor classes whose graphics to precache through MAPINFO.
- some reorganization of texture precaching so that the renderer can decide what to do with actors.

Just marking the sprite textures loses too much info if more is needed than just loading the images into memory.
2016-05-01 22:47:36 +02:00
Randy Heit
3c2ed52442 Fix 21:9 base width and height values 2016-03-03 18:00:06 -06:00
Michael Labbe
3ac4968218 Slightly improve 21:9 ar 2016-03-03 17:31:12 -06:00
Michael Labbe
97821a3036 21:9 aspect ratio support
- vid_aspect 6 forces 21:9
2016-03-03 17:31:12 -06:00
Randy Heit
55142078d8 Normalize line endings 2016-03-01 09:47:10 -06:00
Christoph Oelckers
bf066763b7 - fixed: The FPS display should use the actual font info to calculate its size, not just assume that each character is 8*8 pixels. 2016-02-04 01:20:35 +01:00
Braden Obrzut
a34a7ace18 - Some resolutions between 320x200 and 640x400 had non-square clean scaling factors. Maybe there was a reason for this in the past, but I can't think of a case where it'd actually look better to have 1:2 scaling in the menus and someone reported it. 2016-01-29 23:37:38 -05:00
Christoph Oelckers
74f4ae86d8 - forgot to save this... 2015-04-01 11:57:10 +02:00
Christoph Oelckers
ad9e4413fa - made the texture precaching code a bit more self-descriptive after finding a discrepancy in handling between ZDoom and GZDoom's versions. 2015-04-01 11:48:47 +02:00
Randy Heit
e259087c19 Change RGB32k to a union of BYTE[32][32][32] and BYTE[32*32*32]
- Clang's optional runtime array bounds checking doesn't understand when we
  intentionally "overflow" by doing this:
    RGB32k[0][0][colorval]
  It will warn that it was accessed at an index will past the bounds
  of type 'BYTE [32]', which makes it less than useful for catching real
  array bounds overflows. So now do this:
    RGB32k.All[colorval]
  And if you want this:
    RGB32k[r][g][b]
  Now do this:
    RGB32k.RGB[r][g][b]
2015-03-08 18:05:02 -05:00
Braden Obrzut
d8ff4ec281 - Fixed: All clang 5.0 warnings.
- Renamed autostart/autozend since Xcode’s build process links in strictly alphabetical order.
2014-01-05 19:50:09 -05:00
Randy Heit
be0845acf1 - Moved all BorderNeedRefresh and SB_state updating code into separate functions that won't crash if screen is NULL.
SVN r4167 (trunk)
2013-02-27 03:10:25 +00:00
Randy Heit
a4312fb106 - Fix spelling errors spotted by Gez in a few comments.
SVN r3957 (trunk)
2012-11-09 23:13:50 +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
Randy Heit
6760a3bfe9 - Fixed: hud_scale is supposed use strictly integral scaling factors.
SVN r3776 (trunk)
2012-07-21 02:32:04 +00:00
Randy Heit
8673743139 - Do not set the mouse pointer if the display is 8 bit, since such displays don't support color cursors.
SVN r3734 (trunk)
2012-07-05 21:46:03 +00:00
Christoph Oelckers
75dc6cb0b2 - changed damage screen blending code so that the same version can be used by any renderer.
- added GZDoom's version of blending for Strife's hazard sectors as an option to the paletteflash CVAR.


SVN r3613 (trunk)
2012-05-01 11:27:54 +00:00
Randy Heit
23e88c88c9 - Add 17:10 aspect ratio, for 1024x600 screens.
SVN r3482 (trunk)
2012-03-25 02:57:28 +00:00
Randy Heit
0552f04e4c - Fixed: DCanvas::Dim() and DCanvas::Clear() did not clamp their coordinates to the screen.
SVN r3457 (trunk)
2012-03-20 02:20:06 +00:00
Randy Heit
c23b918596 - Fixed: restart ccmd did not reset the palette.
SVN r3307 (trunk)
2011-11-01 01:59:47 +00:00
Christoph Oelckers
5bfcaab25c - separation of software renderer from the rest of the code complete. All external access to the renderer is routed through the FRenderer interface class now, with two exceptions (2D texture drawing to a canvas and polymost testing code) that are handled by #defines.
SVN r3263 (trunk)
2011-07-07 15:37:47 +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
5c6fd66ed5 - rename src/resources to src/r_data.
SVN r3254 (trunk)
2011-07-06 07:35:36 +00:00
Christoph Oelckers
7308e05ed0 - separated all voxel related resource maintenance code from r_things.cpp and r_data.cpp into its own file.
SVN r3246 (trunk)
2011-07-04 20:22:55 +00:00