Commit Graph

126 Commits

Author SHA1 Message Date
jacob1
a40ab1e50d don't load invalid window positions, only load window pos on first run 2018-05-28 13:33:01 -04:00
jacob1
324602fe26 adjust for window border when loading window position too
fixes window moving up every time on windows, on linux the border size gets reported as 0 so nothing changes there
2018-05-26 17:38:01 -04:00
jacob1
743ec98e3f add resizable window and original fullscreen options 2018-05-25 21:19:44 -04:00
jacob1
58127f355b fix windows / renderer compile (renderer requires sdl for now) 2018-05-25 21:19:44 -04:00
jacob1
841022c907 recenter linux icon 2018-05-25 21:19:44 -04:00
jacob1
002ab799c5 whitespace fixes 2018-05-25 21:19:44 -04:00
jacob1
7ac7eec6cf more sdl2 fixes:
don't recreate window every scale / fullscreen change
better renderer handling, input scaling no longer needed even if window resizing is enabled
load/save window position (replaces old windows code to do this)
calculate initial mouse position on startup because sdl no longer does this for us
2018-05-25 21:19:44 -04:00
jacob1
802ec4d252 remove icon debug stuff 2018-05-25 21:19:44 -04:00
jacob1
bd8550c2d5 fix a few more sdl 2 bugs:
mouse movement captured outside the window when mouse is down
fullscreen now focuses the window (there is a bug where you have to click once to get mouse input, though)
add linux icon, will need to be redone properly because it's offcentered with a black border (mask isn't present)
allow typing ~ into the console + some other fixes
2018-05-25 21:19:44 -04:00
jacob1
e5230b5b9f upgrade to SDL 2
Still currently in process, there are some issues:
Windows version doesn't work, mac version might not work, opengl might not work
Icon doesn't work (on Linux at least)
Lua will need some changes, there are some sdl 1.2 hacks in there
When entering fullscreen, the window loses focus
When holding down mouse out of bounds, mouse move events stop being sent
When letting go of mouse out of bounds, mouseup event doesn't take into account double scale mode
Clicking on startup without moving mouse will draw at 0,0 for a frame
Renderer probably won't compile because USE_SDL doesn't entirely work

... and maybe others

Some nice things were done though:
no more blit2, sdl can do the scaling itself
3d effect removed, no reason to support this joke any longer
No need to support copy/paste ourselves, sdl does it now
text handling done much better now, separate events for key presses and text input
when a new window is shown, all events ignored until next tick (ignore textinput event if window shown from key press event like console)
2018-05-25 21:19:44 -04:00
mniip
d404f4a538 Fix some C++14-isms.
Apparently C++11 is more strict regarding default argument and return
value conversions. Also return brace-initializer construction has had
little support.
2018-05-08 05:48:32 +03:00
mniip
954086fb86 Fixx macos compilation 2018-05-08 03:10:19 +03:00
mniip
f8586ea3a2 Remove ByteString::Stream 2018-05-04 23:10:39 +03:00
mniip
6c9cb174fb Change some uses of String::Stream to StringBuilder 2018-05-02 22:11:41 +03:00
mniip
a121c62c3b Add some helper methods and rewrite some of the string manipulation code 2018-05-02 01:32:04 +03:00
mniip
ff27d69424 Switch from std::string to String/ByteString in most of the code
Also switch SimulationData from weird arrays to std::vector
2018-04-30 21:13:24 +03:00
mniip
c0c550e920 Add a new font editor 2018-04-29 18:49:40 +03:00
jacob1
f2ac8a951c add ctrl+q shortcut to exit the game from anywhere 2018-03-10 16:01:14 -05:00
LBPHacker
be29fad7e8 Add support for window scale modes other than 1 and 2
Window scale can now be anything between 1 and 10 (suggest something other than 10 for maximum scale?). This required a number of subtle changes:

 * made blit2 (PowderToySDL.cpp) handle scale modes correctly (it really only handled scale:2 correctly before)
 * replaced `bool scale` with `int scale` everywhere in the options view/model/controller
 * replaced the _large screen_ checkbox with a _window scale_ textbox in the options view

The new scale is only checked and applied when the options view is closed. There's no reason to not apply it live, I just chose not to.

This commit does *not* make TPT able to figure out an optimal scale mode at first run. It still suggests using scale:2 if it makes sense though.

I had doubts about using a second loop in blit2 but it doesn't seem to be an issue. If there's a more optimal way of going about what blit2 does, I haven't figured it out.

(Sublime seems to have eaten a few trailing spaces, hence there are a few seemingly identical pairs of lines in the diff.)
2017-11-23 12:24:34 -05:00
wolfy1339
87f3ada7b0 Remove stuff from Config.h that doesn't belong 2017-11-23 00:12:48 -05:00
jacob1
d5347b0906 Fix test error 2017-02-26 14:02:38 -05:00
jacob1
b01e7a6a36 put #ifdef around denormal functions, they only exist when using SSE/SSE3 2017-02-20 19:15:41 -05:00
jacob1
ac8c01ae57 ensure floating point denormals aren't used, they can massively lag the air sim 2017-02-19 19:29:41 -05:00
jacob1
c1fad5ebf9 linux compiling fix 2016-10-14 09:30:29 -04:00
jacob1
9e33906858 VS 2015 compiling fixes
note, wiki guide still doesn't work unless you also have vs2013 installed
2016-10-13 22:32:52 -04:00
Simon Robertshaw
86b83798f7 More graceful exit when X11 is not available on Linux 2016-08-07 13:17:17 +01:00
jacob1
f0f104097d finish / fix ecb08952e5
must have accidentally reverted Keys.h halfway through making it?
2016-07-23 19:15:07 -04:00
jacob1
ecb08952e5 Add SDL_keysym.h, Use official SDL constants 2016-07-19 22:42:10 -04:00
wolfy1339
b65e94900e Use C++ includes (#308)
Replaces stdio.h, stdlib.h, string.h, math.h, time.h, limits.h and othters with their C++ equivalents.
2016-07-17 23:37:24 -04:00
jacob1
bc1dd6748c Fix double screen mode fail 2016-07-13 00:15:57 -04:00
Simon Robertshaw
6cfaeb9c5c OpenGL UI fixes for on OS X/all platforms
- Reinitialise textures after SDL_SetVideoMode
 - Fix header includes and remove GLEW setup on OSX
2016-07-12 21:31:29 +01:00
Simon Robertshaw
b66ca770da Performance optimisation for blitting loops and depth3d 2016-07-12 19:48:58 +01:00
jacob1
8146598967 fix blank screen when hitting "Cancel" on double screen dialog 2016-07-10 17:38:19 -04:00
jacob1
ce55c8e58b Fix --opengl-render option. Please NEVER use this option though 2016-05-14 09:44:49 -04:00
jacob1
6b6bd67a9f extra debugging thing for visual studio
I think this prevents random "exited with code 3" errors, but I can't remember ...
2016-04-23 11:39:06 -04:00
jacob1
623d9ca4b9 save double scale mode setting on exit 2016-04-02 00:39:51 -04:00
jacob1
aa99258101 more cleanup so that 3D can stay a more permanent thing 2016-04-02 00:10:15 -04:00
jacob1
30e82851bc Fixes to 3D mode (mostly fixes it on OS X) 2016-04-01 22:06:21 -04:00
jacob1
4c066cd7a7 another blind compile fix 2016-03-31 22:50:03 -04:00
jacob1
46d096206f Further improvements to overall system stability and other minor adjustments have been made to enhance the user experience 2016-03-31 22:08:04 -04:00
jacob1
926f556bcc fix compile error 2016-01-31 22:59:29 -05:00
jacob1
36e8f6d900 show confirm dialog for double screen mode in case of false detections 2016-01-31 22:30:39 -05:00
jacob1
4e484ae2a4 compiler fixes, apparently using [] as intended is ambiguous ... 2016-01-26 00:24:14 -05:00
jacob1
b0ce2ee615 only automatically use scale 2 if there is a little more space than required (just in case) 2015-09-01 12:39:58 -04:00
jacob1
9f9fef6cad Add new function ParseServerReturn, try to properly display all http errors
Also fix crash with invalid ptsave link, and fix some cases where it wouldn't ever tell you it errored
2015-08-29 13:14:17 -04:00
jacob1
732e5b8730 fix some very minor memory leaks 2015-06-30 19:06:18 -04:00
Aditya Vaidya
13cc593d13 Fixed most spelling errors in code. 'originaly' is read as 'original Y', so not a typo 2015-05-18 15:16:01 -05:00
jacob1
cee08b2024 On first run, set scale to 2 if screen size is large enough 2015-05-14 23:22:20 -04:00
mniip
4fa02965bf Clean up the EngineProcess loop 2015-02-04 04:13:51 +03:00
jacob1
b7fe998252 fix mouse coords at startup being 0,0, fix glitch that could make background windows fade completely to black 2015-01-31 14:09:50 -05:00