formal Pocket C.H.I.P support

This commit is contained in:
Sebastian Krzyszkowiak 2019-05-13 23:51:07 +02:00
parent b0bf4f13be
commit c724a490fb
No known key found for this signature in database
GPG key ID: E8F235CF3BDBC3FF
3 changed files with 20 additions and 2 deletions

View file

@ -181,6 +181,14 @@ if (NOT LIBSUPERDERPY_CONFIG_INCLUDED)
add_definitions(-D_Noreturn=)
endif(MAEMO5)
if(POCKETCHIP)
add_definitions(-DPOCKETCHIP=1)
endif(POCKETCHIP)
if(MAEMO5 OR POCKETCHIP)
add_definitions(-DLIBSUPERDERPY_EMULATE_TOUCH=1)
endif(MAEMO5 OR POCKETCHIP)
set(GAMESTATE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
if(APPLE)

View file

@ -105,8 +105,8 @@ static inline void HandleEvent(struct Game* game, ALLEGRO_EVENT* ev) {
break;
}
#ifdef MAEMO5
// on Maemo we get mouse events instead of touch ones, so we'll rewrite them by ourselves
#ifdef LIBSUPERDERPY_EMULATE_TOUCH
// on some platforms (like Maemo or Pocket C.H.I.P) we get mouse events instead of touch ones, so we'll rewrite them by ourselves
if ((ev->type == ALLEGRO_EVENT_MOUSE_AXES) || (ev->type == ALLEGRO_EVENT_MOUSE_BUTTON_DOWN) || (ev->type == ALLEGRO_EVENT_MOUSE_BUTTON_UP)) {
switch (ev->type) {

View file

@ -394,6 +394,16 @@ SYMBOL_EXPORT const char* FindDataFilePath(struct Game* game, const char* filena
}
#endif
#ifdef POCKETCHIP
char origfn[255] = "pocketchip/";
strncat(origfn, filename, 243);
result = TestDataFilePath(game, origfn);
if (result) {
return AddGarbage(game, result);
}
#endif
#ifdef __EMSCRIPTEN__
char origfn[255] = "emscripten/";
strncat(origfn, filename, 243);