summaryrefslogtreecommitdiff
path: root/src/i_video.c
AgeCommit message (Collapse)Author
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
2010-11-21Add -8in32 command line parameter to make the game run in 32-bit colorSimon Howard
mode, scaling up into an intermediate 8-bit buffer first. This should help with the palette problems experienced by Windows Vista/7 users. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2164
2010-09-19+ SetVideoMode - center window on desktop when not in fullscreen modeSamuel Villareal
Subversion-branch: /branches/strife-branch Subversion-revision: 2117
2010-08-31Merge from trunk.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 1987
2010-08-20Remove debug printf().Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1960
2010-08-20Extend mouse code to support up to 8 buttons (allows mouse wheel to beSimon Howard
used). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1958
2010-08-03When in windowed mode, allow the screen size to be dynamically resizedSimon Howard
by dragging the window borders. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1949