summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d6a1a6c)
* fixed graphical bugs when using renderer/texture based graphics
* fixed playing certain sounds (menu navigation sound and counting
score sound after solving a level) when "normal sounds" are disabled
+2013-12-28
+ * fixed graphical bugs when using renderer/texture based graphics
+
+2013-12-23
+ * fixed playing certain sounds (menu navigation sound and counting
+ score sound after solving a level) when "normal sounds" are disabled
+
2013-12-16
* continued porting Rocks'n'Diamonds to Android (levels now playable)
2013-12-16
* continued porting Rocks'n'Diamonds to Android (levels now playable)
@$(MAKE_CMD) dist-clean
dist-build-unix:
@$(MAKE_CMD) dist-clean
dist-build-unix:
- @BUILD_DIST=TRUE $(MAKE) x11
+ @BUILD_DIST=TRUE $(MAKE)
dist-build-msdos:
@BUILD_DIST=TRUE $(MAKE) cross-msdos
dist-build-msdos:
@BUILD_DIST=TRUE $(MAKE) cross-msdos
-#define COMPILE_DATE_STRING "2013-12-17 18:30"
+#define COMPILE_DATE_STRING "2013-12-28 23:17"
{ KSYM_Page_Up, "XK_Page_Up", "page up" },
{ KSYM_Page_Down, "XK_Page_Down", "page down" },
{ KSYM_Page_Up, "XK_Page_Up", "page up" },
{ KSYM_Page_Down, "XK_Page_Down", "page down" },
+#if defined(TARGET_SDL2)
{ KSYM_Menu, "XK_Menu", "menu" }, /* menu key */
{ KSYM_Back, "XK_Back", "back" }, /* back key */
{ KSYM_Menu, "XK_Menu", "menu" }, /* menu key */
{ KSYM_Back, "XK_Back", "back" }, /* back key */
/* ASCII 0x20 to 0x40 keys (except numbers) */
{ KSYM_space, "XK_space", "space" },
/* ASCII 0x20 to 0x40 keys (except numbers) */
{ KSYM_space, "XK_space", "space" },
if (file == NULL)
return -1;
if (file == NULL)
return -1;
#if defined(PLATFORM_ANDROID)
if (file->asset_file)
#if defined(PLATFORM_ANDROID)
if (file->asset_file)
if (dir == NULL)
return -1;
if (dir == NULL)
return -1;
#if defined(PLATFORM_ANDROID)
if (dir->asset_toc_file)
#if defined(PLATFORM_ANDROID)
if (dir->asset_toc_file)
void print_timestamp_ext(char *message, char *mode)
{
#if DEBUG_PRINT_INIT_TIMESTAMPS
void print_timestamp_ext(char *message, char *mode)
{
#if DEBUG_PRINT_INIT_TIMESTAMPS
{
print_timestamp_ext(message, "DONE");
}
{
print_timestamp_ext(message, "DONE");
}
#if DEBUG
void debug_print_timestamp(int, char *);
#if DEBUG
void debug_print_timestamp(int, char *);
void print_timestamp_init(char *);
void print_timestamp_time(char *);
void print_timestamp_done(char *);
void print_timestamp_init(char *);
void print_timestamp_time(char *);
void print_timestamp_done(char *);
static SDL_Window *sdl_window = NULL;
static SDL_Renderer *sdl_renderer = NULL;
static SDL_Texture *sdl_texture = NULL;
static SDL_Window *sdl_window = NULL;
static SDL_Renderer *sdl_renderer = NULL;
static SDL_Texture *sdl_texture = NULL;
+
+#define USE_RENDERER 1
#endif
/* stuff needed to work around SDL/Windows fullscreen drawing bug */
#endif
/* stuff needed to work around SDL/Windows fullscreen drawing bug */
/* functions from SGE library */
void sge_Line(SDL_Surface *, Sint16, Sint16, Sint16, Sint16, Uint32);
/* functions from SGE library */
void sge_Line(SDL_Surface *, Sint16, Sint16, Sint16, Sint16, Uint32);
+#if defined(TARGET_SDL2)
static void UpdateScreen(SDL_Rect *rect)
{
static void UpdateScreen(SDL_Rect *rect)
{
SDL_Surface *screen = backbuffer->surface;
SDL_Surface *screen = backbuffer->surface;
+#if 1
+ if (rect)
+ {
+ int bytes_x = screen->pitch / video.width;
+ int bytes_y = screen->pitch;
+
+ SDL_UpdateTexture(sdl_texture, rect,
+ screen->pixels + rect->x * bytes_x + rect->y * bytes_y,
+ screen->pitch);
+ }
+ else
+ {
+ SDL_UpdateTexture(sdl_texture, NULL, screen->pixels, screen->pitch);
+ }
+#else
SDL_UpdateTexture(sdl_texture, NULL, screen->pixels, screen->pitch);
SDL_UpdateTexture(sdl_texture, NULL, screen->pixels, screen->pitch);
SDL_RenderClear(sdl_renderer);
SDL_RenderCopy(sdl_renderer, sdl_texture, NULL, NULL);
SDL_RenderPresent(sdl_renderer);
SDL_RenderClear(sdl_renderer);
SDL_RenderCopy(sdl_renderer, sdl_texture, NULL, NULL);
SDL_RenderPresent(sdl_renderer);
SDL_UpdateWindowSurface(sdl_window);
#endif
}
SDL_UpdateWindowSurface(sdl_window);
#endif
}
static void setFullscreenParameters(char *fullscreen_mode_string)
{
static void setFullscreenParameters(char *fullscreen_mode_string)
{
new_surface = SDL_GetWindowSurface(sdl_window);
// SDL_UpdateWindowSurface(sdl_window); // immediately map window
new_surface = SDL_GetWindowSurface(sdl_window);
// SDL_UpdateWindowSurface(sdl_window); // immediately map window
- UpdateScreen(NULL); // immediately map window
+ // UpdateScreen(NULL); // immediately map window
}
#else
new_surface = SDL_SetVideoMode(fullscreen_width, fullscreen_height,
}
#else
new_surface = SDL_SetVideoMode(fullscreen_width, fullscreen_height,
/* switch display to window mode */
#if defined(TARGET_SDL2)
/* switch display to window mode */
#if defined(TARGET_SDL2)
-#if 1
- float scale_factor = 1;
+#if USE_RENDERER
+ float scale_factor = 1.2;
int test_fullscreen = 0;
int surface_flags = (test_fullscreen ? surface_flags_fullscreen :
surface_flags_window);
int test_fullscreen = 0;
int surface_flags = (test_fullscreen ? surface_flags_fullscreen :
surface_flags_window);
if (sdl_texture != NULL)
{
if (sdl_texture != NULL)
{
+#if 1
+ // (do not use alpha channel)
+ new_surface = SDL_CreateRGBSurface(0, video.width, video.height, 32,
+ 0x00FF0000,
+ 0x0000FF00,
+ 0x000000FF,
+ 0x00000000);
+#else
+ // (this uses an alpha channel, which we don't want here)
new_surface = SDL_CreateRGBSurface(0, video.width, video.height, 32,
0x00FF0000,
0x0000FF00,
0x000000FF,
0xFF000000);
new_surface = SDL_CreateRGBSurface(0, video.width, video.height, 32,
0x00FF0000,
0x0000FF00,
0x000000FF,
0xFF000000);
+#endif
+
+ printf("::: pitch == %d\n", new_surface->pitch);
if (new_surface == NULL)
Error(ERR_WARN, "SDL_CreateRGBSurface() failed: %s",
if (new_surface == NULL)
Error(ERR_WARN, "SDL_CreateRGBSurface() failed: %s",
new_surface = SDL_GetWindowSurface(sdl_window);
// SDL_UpdateWindowSurface(sdl_window); // immediately map window
new_surface = SDL_GetWindowSurface(sdl_window);
// SDL_UpdateWindowSurface(sdl_window); // immediately map window
- UpdateScreen(NULL); // immediately map window
+ // UpdateScreen(NULL); // immediately map window
+#if defined(TARGET_SDL2)
+ UpdateScreen(NULL); // map window
+#endif
+
#if 1
SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE);
#if 1
SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE);
dst_rect.w = width;
dst_rect.h = height;
dst_rect.w = width;
dst_rect.h = height;
- if (src_bitmap != backbuffer || dst_bitmap != window)
+ // if (src_bitmap != backbuffer || dst_bitmap != window)
+ if (!(src_bitmap == backbuffer && dst_bitmap == window))
SDL_BlitSurface((mask_mode == BLIT_MASKED ?
src_bitmap->surface_masked : src_bitmap->surface),
&src_rect, real_dst_bitmap->surface, &dst_rect);
SDL_BlitSurface((mask_mode == BLIT_MASKED ?
src_bitmap->surface_masked : src_bitmap->surface),
&src_rect, real_dst_bitmap->surface, &dst_rect);
+ if (!setup.sound_simple)
+ return;
+
PlaySoundExt(nr, SOUND_MAX_VOLUME, SOUND_MIDDLE, SND_CTRL_PLAY_SOUND);
}
void PlaySoundStereo(int nr, int stereo_position)
{
PlaySoundExt(nr, SOUND_MAX_VOLUME, SOUND_MIDDLE, SND_CTRL_PLAY_SOUND);
}
void PlaySoundStereo(int nr, int stereo_position)
{
+ if (!setup.sound_simple)
+ return;
+
PlaySoundExt(nr, SOUND_MAX_VOLUME, stereo_position, SND_CTRL_PLAY_SOUND);
}
void PlaySoundLoop(int nr)
{
PlaySoundExt(nr, SOUND_MAX_VOLUME, stereo_position, SND_CTRL_PLAY_SOUND);
}
void PlaySoundLoop(int nr)
{
+ if (!setup.sound_loops)
+ return;
+
PlaySoundExt(nr, SOUND_MAX_VOLUME, SOUND_MIDDLE, SND_CTRL_PLAY_LOOP);
}
void PlaySoundMusic(int nr)
{
PlaySoundExt(nr, SOUND_MAX_VOLUME, SOUND_MIDDLE, SND_CTRL_PLAY_LOOP);
}
void PlaySoundMusic(int nr)
{
+ if (!setup.sound_music)
+ return;
+
PlaySoundExt(nr, SOUND_MAX_VOLUME, SOUND_MIDDLE, SND_CTRL_PLAY_MUSIC);
}
PlaySoundExt(nr, SOUND_MAX_VOLUME, SOUND_MIDDLE, SND_CTRL_PLAY_MUSIC);
}
+#if defined(TARGET_SDL2)