Commit Graph

216 Commits

Author SHA1 Message Date
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
jacob1
b1a3c404b6 fix platform / sconscript flag specific warnings, --no-warnings no longer defaults to true 2015-01-16 23:39:42 -05:00
jacob1
dce874484a fix all the gcc warnings in the element files (except one in PSTN) + all the unused variable warnings 2015-01-10 22:43:33 -05:00
jacob1
6eedc7a7a6 new linux icon: 48x48 (really displayed at 44x36) instead of 16x16
really it's the same icon, it's also not the best, but the best I could make it look
2015-01-09 22:40:48 -05:00
jacksonmj
236ff08da9 Fix some problems noted in http://www.viva64.com/en/b/0298/
I've left some of the less important items, like SearchView.cpp "'then' statement is equivalent to the 'else' statement", and RequestBroker::Request::~Request, because I don't feel like spending a few days entirely rewriting those files at the moment (which is what I'd end up doing if I started fixing minor problems and refactoring...)

GameSave::readOPS - not changed. At some point we may have to move to a larger type for element IDs (probably two or four bytes), but PT_NUM isn't likely to be raised to the maximum value of that type immediately, so this check will be needed then. There should be an elements[partsData[i]].Enabled check in there too, but it might be a bit difficult - I'm not sure how to access a Simulation object from GameSave::readOPS...

Notes on changes:

Graphics::textsize, Element_FRZW::Element_FRZW - typos

Button::Draw - the extra case was originally used to invert the icon (draw it in black instead of in white) when the button was clicked. However, the icon colour is now automatically set depending on the background colour. (Note similar conditions "if(Enabled) { if(isButtonDown || (isTogglable && toggle)) " near the start of the function - same logic but in a different place, setting icon colour indirectly).

Simulation::transform_save - unused redundant function, everything uses GameSave::Transform which does much the same thing.

PreviewView::NotifySaveChanged - should be height==YRES/2, it's checking whether the preview image is the correct size, and resizing it if it isn't.

Element_FWRK::update - no idea why that line was there, even though it was my commit that originally added it...
2014-12-25 17:09:35 +00:00
jacob1
6463d04f6c fix a few of the most spammy warnings (there are still hundreds of warnings though)
TODO: actually fix all the warnings
2014-10-23 00:42:13 -04:00
jacob1
89eb6bbd03 fix small ClipboardPush error that shouldn't ever happen 2014-07-04 19:16:38 -04:00
jacob1
6749c2547f New SConscript (hopefully better)
Fixes a lot of bugs, also almost all options are no longer needed and are just auto-detected
2014-06-08 19:33:58 -04:00
Simon Robertshaw
197a70c2e6 Fix Clipboard for renderer build, ensure MacOS and Windows clipboard funcs return std::string 2014-03-16 11:35:53 +00:00
jacksonmj
c6d6011337 An ugly fix for numpad, since it seems event.key.keysym.mod isn't entirely reliable for some unknown reason
Partial revert of 7ce9907f82
2014-03-12 15:05:54 +00:00
jacksonmj
1ca63b3813 Add more key definitions 2014-03-12 15:04:16 +00:00
jacksonmj
a1515b3d5e Shift key for numpad 2014-03-12 00:54:52 +00:00
jacob1
7ce9907f82 fix textbox key repeat issue, fix numpad issue (in two ways) 2014-03-11 12:53:42 -04:00
mniip
43bff37279 fix numpad behavior: movement keys are no longer triggered with numlock on 2014-02-27 20:39:16 +04:00
mniip
55284e6313 Fix most of clipboard-related memory leaks and potential crashes; Fixes jacob#23 2014-02-25 18:44:44 +04:00
mniip
fdfaa3a29b add defines for window resolution
--amend
2013-12-29 20:12:50 +04:00
jacob1
138cb4d757 exception bluescreens print what the exception was, some (probably unnecessary) fixes to fusion that were never merged in, and probably a compiling fix 2013-12-03 22:05:35 -05:00
Simon Robertshaw
a32af1679a Fix Mac OSX readUserPreferences missing off last char of pref data, add clipboard implementations for Mac OS X 2013-11-19 21:23:04 +00:00
mniip
9183fa1755 apparently Ximon hates const; a lot;
added a bunch of const everywhere, had to modify a few functions to be const-compliant
2013-10-30 04:38:13 +04:00
mniip
5d3520d18c fix copy and paste in the same tpt window on SDL/Linux/X11 2013-10-25 00:46:41 +04:00
jacob1
332aa25bf6 save pavg[] in saves, for VIRS, PIPE, and STOR 2013-09-11 20:41:43 -04:00
mniip
8a27363c76 implement X11 clipboard pull 2013-08-29 00:57:08 +04:00
jacob1
5518a6bcd6 fix right modifier keys 2013-07-27 11:21:42 -04:00
jacob1
cc887995c0 fix openGL compiling (most likely), fixes #146 2013-07-17 18:20:50 -04:00
jacob1
3203e597b9 fix piston bugs, fix crashes, don't use bluescreens when compiled with debug mode in visual studio 2013-07-10 16:59:10 -04:00
jacob1
60b1bf5066 forgot to push this commit, SDL should only be included in 1 type of way 2013-06-22 09:36:50 -04:00
jacob1
1588226120 move frameStart to right after the fps is limited (counts everything, including mouse/key functions now) 2013-05-21 23:23:57 -04:00
cracker64
4e9ee3a3a3 Fix incorrect FPS counter, need to count blit too.
2x scale gets a massive *real* fps boost, the fps lied before.
2013-05-21 23:05:27 -04:00
mniip
3979395e65 reenable sighandlers for winderp 2013-05-19 10:02:42 +04:00
mniip
3a640fee3f some more compiling fixes 2013-05-17 18:32:41 +04:00
mniip
9f33cbf79e well, fuck you too, simon 2013-05-05 08:49:36 +04:00
Simon Robertshaw
8ef266c08e Fix compiling with new BSOD in debug mode 2013-05-04 22:41:08 +01:00
Simon Robertshaw
2d8c5a7747 TPT Blue screen of death - try its best to catch some signals (SIGSEGV) and unhandled exception in the game loop 2013-05-04 21:39:43 +01:00
Simon Robertshaw
1575d93d48 Fix compilation issues on Windows with Window Position Loader 2013-05-04 15:00:45 +01:00
jacob1
d4391cc19e set window position before displaying it 2013-05-03 19:11:44 -04:00
mmbob
df14a77124 LoadWindowPosition has a better default position
LoadWindowPosition now positions the window on the nearest monitor if
the window is not inside a monitor.
2013-05-02 13:00:13 -04:00
mmbob
63050715ee Replace __ImageBase. Save + load window position.
Instead of using the __ImageBase global variable, use the
GetModuleHandle(NULL) function to get the exe's HMODULE/HINSTANCE.
Save the window position when the game is closed and restore it when it
is opened.  Defaults to being centered on the desktop.
2013-04-22 13:04:43 -04:00
Simon Robertshaw
9abe51526c Move all GUI source files into gui/ 2013-03-22 14:14:17 +00:00
jacob1
01cd146ee9 fix mac compiling, fix renderer, fix other minor compiling issues 2013-02-14 23:31:31 -05:00
jacob1
b493788b26 fix missing #ifdef statement breaking compiling when not on linux 2013-01-19 11:46:21 -05:00
jacob1
ded94b475d move clipboard functions out of misc.cpp without creating errors 2013-01-18 14:37:24 -05:00
jacob1
73fdfd411c copy support in linux 2013-01-13 15:24:52 -05:00
jacob1
6b846c6339 add (slightly updated) README from tpt
added new contributers, description from main page, and removed key combos and arguments that don't work
2012-11-16 18:20:48 -05:00
Bryan Hoyle
fec50a2a8e Opengl fix 2012-11-16 16:50:02 -05:00
jacob1
97cea273e5 Fast quit option (disable to make "X" act like in tpt) 2012-10-05 16:31:04 +01:00
Simon Robertshaw
4bb402f4fd Fix stuttering issue with FPS cap 2012-10-05 14:21:38 +01:00
jacob1
5a91b83875 revert changing the lua/sdl includes and min/max changes 2012-09-07 00:53:29 +01:00
jacob1
f8f70a3f77 Visual studio compatibility
This removes some inlines when using visual studio to compile, uisng TPT_NO_INLINE. It also fixes many other problems visual studio has with the code
2012-09-07 00:52:56 +01:00
Simon Robertshaw
d61690bc09 Prevent setting double scale on smaller screens. Fixes #166 2012-09-05 17:31:49 +01:00
Simon Robertshaw
4c63a6f593 Fix the Lua EngineProcess bug, not sure how either (needs further investigation) I suspect that stacking Lua calls upon each other (which will happen in engine->Tick()/engine->Draw()) is causing some unusual behaviour, checking for an engine break just before this fixes it. fixes #129 2012-08-19 12:16:51 +01:00
Simon Robertshaw
93afe0a1ea More robust EngineProcess (still doesn't fix lua bug) 2012-08-19 00:40:20 +01:00
Simon Robertshaw
740f0d30c3 Blocking Confirm/Error/Input prompts (EngineProcess creates a new event loop which can be broken out of with Engine::Break()) 2012-08-18 22:08:20 +01:00
Simon Robertshaw
706bd0fa97 Tick client more frequently and remove *pyc files from git 2012-08-17 17:20:09 +01:00
Simon Robertshaw
614a90cfc6 RichText label (used for MOTD), fixes #123 2012-08-17 16:08:03 +01:00
Simon Robertshaw
074dcd0b42 Precompile some headers. Fix sconscript to prevent recompiling everything 2012-08-13 15:43:57 +01:00
Simon Robertshaw
8ca27520a4 Use forward declarations more to avoid excessive includes 2012-08-12 22:32:57 +01:00
Bryan Hoyle
530e093d8b now opengl and opengl renderer run and compile, but renderer has a segfault, will fix 2012-08-12 14:29:27 -04:00
Bryan Hoyle
e7b653a0c7 more fixes 2012-08-12 11:55:59 -04:00
Simon Robertshaw
0e67fe028b Use Left modifier keys 2012-08-10 12:43:21 +01:00
Simon Robertshaw
d352a10d80 PTsave opening 2012-08-08 21:32:10 +01:00
Simon Robertshaw
435c680f01 Command line "open" 2012-08-08 20:24:23 +01:00
Simon Robertshaw
346e9d2168 Proxy from command line arg 2012-08-08 18:34:37 +01:00
Simon Robertshaw
73a18998f6 Scale and fullscreen loaded/saved to config and commandline 2012-08-08 17:42:04 +01:00
Simon Robertshaw
10e82df543 Fullscreen and scale setting from sim options 2012-08-08 14:35:27 +01:00
ntoskrnl
f94fabd999 Rename WIN32 preprocessor definition to WIN 2012-08-02 15:21:16 +01:00
ntoskrnl
87dfc47c97 Separate operating system and architecture preprocessor definitions
Conflicts:

	SConscript
2012-08-02 15:20:14 +01:00
Simon Robertshaw
5befe5c25f Local file browser + some more interesting things like Progress bar UI component 2012-07-27 20:06:17 +01:00
Simon Robertshaw
72d98036a5 Parsing commandline arguments 2012-07-06 16:53:59 +01:00
Simon Robertshaw
adc9cc0816 Move graphics into seperate folder 2012-07-06 16:06:26 +01:00
Simon Robertshaw
44e41a3b28 Fix Line scaling for OpenGL inetrgsdfkjdslkfjs 2012-06-25 17:52:04 +01:00
Simon Robertshaw
dacb774ae0 Resizable window when using OpenGL interface 2012-06-25 16:10:40 +01:00
Simon Robertshaw
f5547f267b Option to use OpenGL JUST for the interface 2012-06-23 14:59:07 +01:00
Simon Robertshaw
3c91e526bb Client now provides methods for reading and saving preferences - less powerful than raw access to Cajun, (no mixed type arrays, for example) but allows other save formats to be used, such as property lists on OS X 2012-06-22 01:04:55 +01:00
Bryan Hoyle
c9f837f21d Opengl can open saves now, just need to get it to render accurately later 2012-06-20 14:23:22 -04:00
Simon Robertshaw
2be9c92508 OpenGL canvas for Windows, Notifications for main Game, Update checker in Client (+ other client triggered events) 2012-06-20 13:40:18 +01:00
Simon Robertshaw
ab82847cd6 Fix minor syntax error, move all OpenGL includes into a new file that can detect the OS X version. 2012-05-30 13:17:40 +01:00
Simon Robertshaw
86746f38b0 Separate SDL from graphics code
Also remove OS X specific project files and update Makefile to ensure
the Element class generator only runs when necessary
2012-05-30 12:32:58 +01:00