summaryrefslogtreecommitdiff
path: root/src/i_video.c
AgeCommit message (Collapse)Author
2015-04-10Strip out SDL_VERSION_ATLEAST #ifdef conditionals.Simon Howard
These were added ages ago as hacks to make the code compile with SDL2, back when SDL2 was still in development. They aren't relevant any more and aren't useful - the actual SDL2 port is proceeding on sdl2-branch.
2015-02-20Refactor config file API.Simon Howard
The config file API previously relied on binding config variables using M_BindVariable() which took a void pointer. It occurred to me that if used on a boolean variable, this would be erroneous, but the void pointer would make it impossible to tell. Split this into separate M_Bind{Foo}Variable() functions based on type, which allows for proper type checking on the pointers that are passed. Vaguely related to #509.
2014-10-25Remove 1280x1000 scaling.Simon Howard
We already have 1280x960, which is the correct aspect ratio. This means that when running at 1080p the windowboxing borders will be slightly thicker, but if we're already showing borders anyway, it's better to at least use the correct aspect ratio. This fixes #460. Thanks to Doom_user for asking about this on Doomworld: http://www.doomworld.com/vb/post/1316735
2014-10-19i_video: fix an if condition in my previous commitMike Swanson
`else if (f == 'w')` doesn't really secure itself against uninitialized memory, it still needs to test that `s == 3`.
2014-10-19allow -geometry to specify fullscreen or windowed modes, like PrBoomMike Swanson
This allows strings like "640x480w" to cause the engine to run in a window, while strings like "1280x800f" cause the engine to run in fullscreen mode. This is inspired by the behavior of the PrBoom -geometry parameter.
2014-05-05Clean up file headers.Simon Howard
This change rewrites and simplifies the copyright headers at the top of all source files: * Remove "Emacs style mode select" line; this line was included in the headers for the originally released source files and appears to be to set the file type for old versions of Emacs. I'm not sure entirely why it was required but I don't think it is any more. * Remove "You should have received a copy of..." text from copyright header. This refers to the old 59 Temple Place address where the FSF headquarters used to be located and is no longer correct. Rather than change to the new address, just remove the paragraph as it is superfluous anyway. This fixes #311. * Remove ---- separator lines so that the file headers are barer and more simplified.
2014-04-12video: Change default for screen_bpp to 0.Simon Howard
Some machines don't work well with 8-bit screen depths any more. It's better to default to just using the machine's native color depth instead. Change the default to 0 (for SDL_SetVideoMode this means "use native color depth"), auto-adjust to native color depth on startup if screen_bpp=0 (so that debug messages at least make sense) and document for the config file value that a value of zero means "use native".
2014-04-01Replace all snprintf() calls with M_snprintf().Simon Howard
The Windows API has an _snprintf function that is not the same as Unix's snprintf(): if the string is truncated then no trailing NUL character is appended. This makes the function unsafe. Define a replacement/wrapper called M_snprintf that works the same but always appends a trailing NUL, for safety on Windows and other OSes that behave like this. Do the same thing for vsnprintf(), and update HACKING to list snprintf/vsnprintf as forbidden functions. This fixes #375; thanks to Quasar for pointing out the different behavior of these functions.
2014-03-30Eliminate some uses of sprintf() from common code.Simon Howard
As part of this, add DIR_SEPARATOR_S as a string version of the DIR_SEPARATOR macro. Change M_TempFile() to return a string allocated on the C heap rather than the zone heap. This is a first step towards fixing #371.
2014-03-28video: Fix calculation of -devparm ticker.Simon Howard
The released linuxdoom source had the devparm ticker dots at a spacing of two pixels rather than four pixels (as used in Vanilla Doom). In commit 4a31ec8fcee20e.. I changed this back to four pixel spacing, but forgot to multiply the number of tics to adjust as appropriate. Fix this so that the dots are calculated just like Vanilla Doom is. Thanks to _bruce_ for pointing this out on Doomworld, and to Alexandre-Xavier for questioning my reasoning when I wasn't convinced that the current behavior was wrong. This fixes #360.
2014-03-27video: Fix crash when running fullscreen with -2.Simon Howard
Remove special logic for setting a scale factor (2x, 3x, etc.) when running fullscreen instead of windowed. This fixes a crash due to the fact that I_GraphicsCheckCommandLine() is called before SDL's video subsystem is initialized. This makes -2 identical to -geometry 640x480, which is arguably a better (more easily comprehensible) behavior. Thanks to Fabian Greffrath for reporting the bug. This fixes #338.
2014-03-27Define a keyboard scan code for PrintScreen.Simon Howard
There is no real scan code for the PrintScreen key under DOS, but it is convenient to be able to bind it as a screenshot key. Define a "fake" scancode (126) to represent PrintScreen so that it can be represented as a key binding in configuration files. Also add some comments/notes to the scantokey[] lookup table. This fixes #369.
2014-03-17Allow for PNG screenshots.Fabian Greffrath
2014-03-16video: Center mouse when grabbing cursor.Simon Howard
When releasing mouse grab (activating menu etc.) we move the mouse cursor to a non-distracting location at the bottom-right of the screen. But this was causing abrupt jerks in mouse movement when re-grabbing the mouse again. Center the mouse when turning on grab so that this doesn't happen. This fixes #283.
2013-11-17Initialize data2 to zero for ev_keyup events, rather than just lettingSimon Howard
them have junk values. Subversion-branch: /branches/v2-branch Subversion-revision: 2749
2013-11-06Clear relative mouse state after moving mouse cursor to corner toSimon Howard
prevent "jumps" of the mouse when activating the menu. Subversion-branch: /branches/v2-branch Subversion-revision: 2743
2013-10-26Default to windowed mode in OS X, as there is an SDL bug that can causeSimon Howard
crashing in fullscreen mode (thanks Ryan Peel). Subversion-branch: /branches/v2-branch Subversion-revision: 2721
2013-10-15Rip out special casing on Windows that defaults to the SDL directxSimon Howard
driver over the Windows GDI one. This causes far too many problems. Subversion-branch: /branches/v2-branch Subversion-revision: 2710
2013-10-12Tweak mouse grab behavior: don't arbitrarily warp the mouse at gameSimon Howard
startup. Subversion-branch: /branches/v2-branch Subversion-revision: 2699
2013-10-08Set window title and icon on ENDOOM window to match main game window.Simon Howard
Subversion-branch: /branches/v2-branch Subversion-revision: 2695
2013-09-20Place the mouse cursor in a less distracting location when releasingSimon Howard
mouse grab. Subversion-branch: /branches/v2-branch Subversion-revision: 2667
2013-09-04Extend "emulation" of menu pause key behavior to caps/num/scroll lockSimon Howard
keys, which cause the same behavior. Subversion-branch: /branches/v2-branch Subversion-revision: 2632
2013-08-11Remove Windows CE support.Simon Howard
What support exists is for obsolete devices I no longer possess; I've never been contacted about the port and it's been several years since I even bothered to build a new version. All the extra overrides are clutter that can just be removed. Subversion-branch: /branches/v2-branch Subversion-revision: 2615
2012-12-24Merge from trunk.Simon Howard
Subversion-branch: /branches/v2-branch Subversion-revision: 2553
2012-12-23Fix compiler warnings caused by unused variables.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2552
2012-12-14Merge from trunk.Simon Howard
Subversion-branch: /branches/v2-branch Subversion-revision: 2546
2012-12-14Rename function, as ShowCursor is a Windows function and this conflictsSimon Howard
with it (thanks exp(x)). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2545
2012-10-28Merge from trunk.Simon Howard
Subversion-branch: /branches/v2-branch Subversion-revision: 2537
2012-02-02Only use the SDL mouse lag workaround on Windows - not all systems allowSimon Howard
the cursor to be changed. This fixes Chocolate Doom on AmigaOS (thanks Timo Sievänen). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2483
2011-10-23Remove hack that forces the window to always be centered within theSimon Howard
screen. Add a configuration file variable to control where the game window should appear. Subversion-branch: /branches/v2-branch Subversion-revision: 2467
2011-10-22Merge from trunk.Simon Howard
Subversion-branch: /branches/v2-branch Subversion-revision: 2458
2011-10-17Always show the Strife intro splash screen in windowed mode, and finishSimon Howard
the splash screen before network startup. Subversion-branch: /branches/v2-branch Subversion-revision: 2435
2011-10-16Zero out bottom two bits of palette data, to more accurately emulate theSimon Howard
PC hardware that only supports 6 bits per channel (thanks GhostlyDeath). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2433
2011-09-24Rework mouse speed box drawing code and move to common code, so that itSimon Howard
can be added to other games. Subversion-branch: /branches/v2-branch Subversion-revision: 2395
2011-09-11Merge from raven-branch.Simon Howard
Subversion-branch: /branches/strife-branch Subversion-revision: 2367
2011-06-13Merge from trunk.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 2347
2011-04-17Fix libtextscreen window hotkeys to work when shift is held down /Simon Howard
capslock turned on. Fix a similar problem in-game when typing cheat codes or using menu hotkeys (thanks Alexandre Xavier). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2327
2011-02-12Merge from raven-branch. FEATURE_MULTIPLAYER has been disabledSimon Howard
temporarily until the netgame changes on raven-branch are finished. Subversion-branch: /branches/strife-branch Subversion-revision: 2259
2011-02-12Merge from trunk.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 2258
2011-01-02Turn off dynamic window resizing feature on OS X, as it adds an uglySimon Howard
resize handle to the corner of the window that overlaps the view of the game. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2231
2010-12-18Add a M_CheckParmWithArgs function, that behaves like M_CheckParm butSimon Howard
also checks that extra options were provided on the command line (thanks Sander van Dijk). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2223
2010-12-14Add missing windows.h #include for Windows build (thanks Blondie andSimon Howard
exp(x)). Subversion-branch: /branches/raven-branch Subversion-revision: 2222
2010-12-11Bind new screen_bpp variable to configuration file.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 2217
2010-12-10Fix memory leak when dynamically resizing window in true color videoSimon Howard
modes. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2215
2010-12-10Fix crash introduced by merge.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 2213
2010-12-10Merge from trunk. This is slightly out of date as I did the mergeSimon Howard
several days ago. Subversion-branch: /branches/raven-branch Subversion-revision: 2212
2010-11-29Auto-adjust the screen color depth if the configured color depth is notSimon Howard
supported by the hardware. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2174
2010-11-26In non-palettized boxed screen modes, don't update the border areas ofSimon Howard
the screen. This is more CPU and memory efficient, and also fixes the "flashing border" bug when palette flashes occur. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2170
2010-11-26Turn double buffering on for non-palettized screen modes, as this may beSimon Howard
the cause of screen tearing reports. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2169
2010-11-24Add configuration file parameter and command line option to specify theSimon Howard
screen pixel depth. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2166