Commit Graph

55 Commits

Author SHA1 Message Date
Nathan Fulton
dfc9e088f8 Remove old palette code 2017-10-21 20:39:57 -04:00
Nathan Fulton
dfd1d63d1a gszPrefsFilename prefs.bin -> prefs.json 2017-10-21 20:39:13 -04:00
Nathan Fulton
71dd4eb5b5 Save preferences as json
Preferences have keys as defined in ht.h. These keys can be used to read/write preferences. Preferences are saved in a .json on the disk.
This is much easier to work with than the old presences binary structures as it doesn’t require preference versioning.
2017-10-21 20:36:37 -04:00
Nathan Fulton
fd31d33274 Android gszMainDataDir = NULL
Using NULL as the main data dir will tell the SDL API (the current host file I/O) to fallthough and read from the .apk assets. This is currently desirable in every existing case.
2017-10-21 20:29:54 -04:00
Nathan Fulton
84b4e0f6ba Implement Android HostHelper code for SdlPackFileReader
Needed for changes SdlPackFileReader changes in commit 61e081be5690202cae1e03d6e6cc89a3e94257b7
2017-10-21 20:28:33 -04:00
Nathan Fulton
6b9241fbc5 Add Android jni method for obtaining the AssetManager 2017-10-21 20:28:33 -04:00
Nathan Fulton
5d7e0ddf3c Update SdlPackFile I/O
SdlPackFile can now push and pop directories using host file I/O. This allows for reading from directories as though they were .pdbs (like the htdata2432 dir) while maintaining the pushed hierarchy. pdbs can still be used.
2017-10-21 20:28:32 -04:00
Nathan Fulton
2ef0ab5ae8 Implement host file I/O
Host file I/O API to read files from disk
2017-10-21 20:28:31 -04:00
Nathan Fulton
e402ca76b5 Remove prebuilt SDL2 libraries 2017-10-21 19:56:12 -04:00
Nathan Fulton
875dd884ec Remove Android -fexceptions cpp flag 2017-10-21 02:55:34 -04:00
Nathan Fulton
8800cca7cc Set appropriate GL attributes 2017-10-21 02:55:10 -04:00
Nathan Fulton
31ca038021 Fix bug with simulation pause state and backgrounding 2017-10-21 02:54:14 -04:00
Nathan Fulton
b06b3db1d4 Process SDL_KEYUP for SDLK_AC_BACK
This prevents SDLK_AC_BACK from getting processed multiple times if an
Android user holds their finger on the hardware back button.
2017-10-21 02:54:09 -04:00
Nathan Fulton
830dc6a0d3 Correct use of Android system UI flags
Removed the use of SYSTEM_UI_FLAG_HIDE_NAVIGATION and
SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION for API 14 through API 18.
2017-10-21 02:54:09 -04:00
Nathan Fulton
1226f3ec50 Implement SDL HostGetCurrentKeyState() 2017-10-21 02:49:38 -04:00
Nathan Fulton
8de4b24252 Remove SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH
OTG mouse events don’t get processed correctly. With this hint removed,
SDL mouse events will be handled as touch events and touch will raise
fake mouse events.
2017-10-21 02:49:37 -04:00
Nathan Fulton
22077a7328 Human readable sdlhttprequest error messages 2017-10-21 02:49:36 -04:00
Scott Ludwig
dc42d310d6 Add bit about running with asan_symbolize 2016-08-31 23:55:30 -04:00
Scott Ludwig
7fe6d72942 Use gcc's address sanitizer feature on debug builds
Update to gcc-5 / g++-5 first. Instructions in the makefile.
2016-08-31 23:55:30 -04:00
Scott Ludwig
e2e2283583 Use free for malloc-ed objects 2016-08-31 23:55:30 -04:00
Scott Ludwig
6750cc3cad Silence directory creation 2016-08-31 23:55:30 -04:00
Scott Ludwig
a4896472b6 Install libcurl4-openssl-dev which provides libcurl3-dev 2016-08-31 23:55:30 -04:00
Scott Ludwig
d5b4006193 A few minor enhancements to install.sh 2016-08-31 23:55:30 -04:00
Nathan Fulton
c488c6222a Set pevt->ff when sdl host processes messages 2016-08-31 23:54:49 -04:00
Nathan Fulton
bec7aea014 Initial SDL-Linux port 2016-08-31 23:54:48 -04:00
Nathan Fulton
5b5917fbab Implement SdlAnimSprite 2016-08-31 23:54:48 -04:00
Nathan Fulton
fc00f91f25 Added processing for vchrBack
Android’s system back button will be processed as vchrBack which will
select kidcCancel on most forms. This causes the user to feel that the
game is more integrated with the OS.
2016-08-31 23:54:48 -04:00
Nathan Fulton
d6b301c3e7 Track client platform version
Client platform version can be retrieved live with /ids and is also
recorded in the playerdetail module.
2016-08-31 23:54:48 -04:00
Nathan Fulton
4f2a0de55c SDL display improvements 2016-08-31 22:43:36 -04:00
Nathan Fulton
00345c52cd Expand size of titlescreenbkgd to fill larger displays
Due to the repetition, this 1422x913 version of the title screen
background doesn’t look overly great. However, it’s better than using a
small image that can’t fill larger screens.
2016-08-31 22:43:35 -04:00
Nathan Fulton
bdbe1647dd Improvements for SdlHttpRequest
- When “Downloaded X of Y bytes…” Y is no longer -1.
- HTTP posting now works (e.g. uploading sync errors).
2016-08-31 22:43:35 -04:00
Nathan Fulton
31adbf1da0 Save reinitialize game on SDL-iOS when app is terminated 2016-08-31 22:43:35 -04:00
Nathan Fulton
93d484864e NSURLConnection -> NSURLSession for SDL-iOS
Code for this commit is based off of the network code in game/iphone
2016-08-31 22:43:35 -04:00
Nathan Fulton
8ba3738d0f NSURLConnection -> NSURLSession for SDL-OSX
Code for this commit is based off of the network code in game/iphone
2016-08-31 22:43:35 -04:00
Nathan Fulton
27f07f70f9 Improve backgrounding on SDL-iOS and SDL-Android
If the client is connected to multiplayer when the app is backgrounded,
that connection will be closed. If the app is reopened, a message will
be presented with the user informing them of the disconnection. Single
player games will be paused when entering background and resumed when
entering foreground.
2016-08-31 22:43:34 -04:00
Nathan Fulton
b1cf23f64d Implement SDLHttpRequest with curl
Credit goes to emileb for the curl implementation of sdlttprequest.
2016-08-31 22:43:34 -04:00
Nathan Fulton
4900cd1ae6 Add curl headers and static libraries for Android
Curl with OpenSSL static libraries obtained from
gcesarmza/curl-android-ios
2016-08-31 22:43:33 -04:00
Nathan Fulton
8b7657f643 Initial SDL-Android port 2016-08-31 22:43:27 -04:00
Nathan Fulton
4aadbf87cb strings.h -> wistrings.h
Change strings.h to wistrings.h to prevent SDL.h from including it
while trying to include the CRT strings.h
2016-08-24 21:40:38 -04:00
Nathan Fulton
573c8aafd3 Update preprocessor checks to support SDL 2016-08-24 21:34:48 -04:00
Nathan Fulton
19d74d3da6 SDL host timestamp events when processed if necessary 2016-08-24 21:34:45 -04:00
Nathan Fulton
94e319e1ee Implement multitouch for SDL 2016-08-24 21:34:34 -04:00
Nathan Fulton
2930ad1705 Initial SDL-iOS port 2016-08-24 16:42:47 -04:00
Nathan Fulton
d926ef0bbe Prevent SDL from rendering when app is backgrounded
On some platforms, the game will crash if SDL attempts to render to the
screen/window while the game is backgrounded. To prevent this, stop
rendering when the game enters a background state and resume rendering
when the game enters a foreground state.
2016-08-24 16:20:31 -04:00
Nathan Fulton
8f0e81a3f5 Create main thread via host
Create the main thread via host rather than being a global variable in
base; this way, no base threads are created before the host runs main()
because that can cause issues on some platforms.
2016-08-24 16:20:31 -04:00
Nathan Fulton
b9f189beb9 Fix NullEvent and TransportEvent processing bug in SDL port
- Fix kidmNullEvent / base::kidmNullEvent issue
- Fix kidmTransportEvent / base::kidmTransportEvent issue
2016-08-24 16:20:09 -04:00
Nathan Fulton
fff71efc11 SDL-OSX port improvements
- Add chatroom
- Add string input
- Update main() to support SDL2
- Change game files location to
~/Library/ApplicationSupport/HostileTakeover
- Open URLs with OS’s default browser
- Use Xcode default C/C++Objective-C compiler
- Remove game/sdl/mac/SDL.framework
- Use game/sdl/SDL2/osx/SDL2.framework
2016-08-24 16:19:45 -04:00
Nathan Fulton
017ff13af6 Implement sdl selection sprite 2016-08-24 15:43:51 -04:00
Nathan Fulton
b3827e22e4 Update sdlsoundev to support SDL2 2016-08-24 15:40:40 -04:00
Nathan Fulton
86207a0b94 Fix sdleventserver wait bug Update wait_ appropriately after calling SocketServer::Wait from derived class 2016-08-24 15:40:37 -04:00