+2013-12-16
+ * continued porting Rocks'n'Diamonds to Android (levels now playable)
+
2013-12-12
* added SDL2 renderer/texture based graphics frame handling to allow for
"desktop" style fullscreen mode and scaling of game screen/window
surface are the same (this bug also existed in versions of SDL 1.2.x)
2013-12-07
- * started porting Rocks'n'Diamonds to Android
+ * started porting Rocks'n'Diamonds to Android (already shows main menu)
2013-12-03
* ported Rocks'n'Diamonds to SDL2 (first simple version that works)
-#define COMPILE_DATE_STRING "2013-12-16 23:56"
+#define COMPILE_DATE_STRING "2013-12-17 18:30"
event->pressure);
#endif
+#if 0
int x = (int)(event->x * video.width);
int y = (int)(event->y * video.height);
int button = MB_LEFTBUTTON;
Error(ERR_DEBUG, "=> screen x/y %d/%d", x, y);
+#endif
#if 0
if (++num_events >= max_events)
#endif
#if 1
+#if 0
if (event->type == EVENT_FINGERPRESS ||
event->type == EVENT_FINGERMOTION)
button_status = button;
int max_x = SX + SXSIZE;
int max_y = SY + SYSIZE;
+#endif
+#if 1
+ if (game_status == GAME_MODE_PLAYING)
+#else
if (game_status == GAME_MODE_PLAYING &&
x < max_x)
+#endif
{
int key_status = (event->type == EVENT_FINGERRELEASE ? KEY_RELEASED :
KEY_PRESSED);
+#if 1
+ Key key = (event->y < 1.0 / 3.0 ? setup.input[0].key.up :
+ event->y > 2.0 / 3.0 ? setup.input[0].key.down :
+ event->x < 1.0 / 3.0 ? setup.input[0].key.left :
+ event->x > 2.0 / 3.0 ? setup.input[0].key.right :
+ setup.input[0].key.drop);
+#else
Key key = (y < max_y / 3 ? setup.input[0].key.up :
y > 2 * max_y / 3 ? setup.input[0].key.down :
x < max_x / 3 ? setup.input[0].key.left :
x > 2 * max_x / 3 ? setup.input[0].key.right :
setup.input[0].key.drop);
+#endif
Error(ERR_DEBUG, "=> key == %d, key_status == %d", key, key_status);
}
else
{
-#if 1
+#if 0
Error(ERR_DEBUG, "::: button_status == %d, button == %d\n",
button_status, button);
-#endif
-#if 1
HandleButton(x, y, button_status, button);
#endif
}
DrawMainMenu();
InitNetworkServer();
+
+#if 0
+ Error(ERR_DEBUG, "::: SDL_GetBasePath() == '%s'",
+ SDL_GetBasePath());
+ Error(ERR_DEBUG, "::: SDL_GetPrefPath() == '%s'",
+ SDL_GetPrefPath("artsoft", "rocksndiamonds"));
+#if defined(PLATFORM_ANDROID)
+ Error(ERR_DEBUG, "::: SDL_AndroidGetInternalStoragePath() == '%s'",
+ SDL_AndroidGetInternalStoragePath());
+ Error(ERR_DEBUG, "::: SDL_AndroidGetExternalStoragePath() == '%s'",
+ SDL_AndroidGetExternalStoragePath());
+ Error(ERR_DEBUG, "::: SDL_AndroidGetExternalStorageState() == '%s'",
+ (SDL_AndroidGetExternalStorageState() ==
+ SDL_ANDROID_EXTERNAL_STORAGE_READ ? "read" :
+ SDL_AndroidGetExternalStorageState() ==
+ SDL_ANDROID_EXTERNAL_STORAGE_WRITE ? "write" : "not available"));
+#endif
+#endif
}
void CloseAllAndExit(int exit_value)
Error(ERR_EXIT, "setting video mode failed");
#if 1
+ /* !!! SDL2 can only set the window icon if the window already exists !!! */
/* set window icon */
SDLSetWindowIcon(program.sdl_icon_filename);
#endif
{
static char *user_game_data_dir = NULL;
+#if defined(PLATFORM_ANDROID)
+ if (user_game_data_dir == NULL)
+ user_game_data_dir = SDL_AndroidGetInternalStoragePath();
+#else
if (user_game_data_dir == NULL)
user_game_data_dir = getPath2(getPersonalDataDir(),
program.userdata_subdir);
+#endif
return user_game_data_dir;
}