X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=src%2Fgacela_SDL.c;h=ba567b52434c3aa802153b600414e28bb22a579f;hb=ca3edcecf937f854c1b5d9eeac566d85dc749cd0;hp=79774444e00acb4caef88de9e842d4057e036b16;hpb=e82142f2231e5aacf47e3f0cf5e82679d4291af2;p=gacela.git diff --git a/src/gacela_SDL.c b/src/gacela_SDL.c index 7977444..ba567b5 100644 --- a/src/gacela_SDL.c +++ b/src/gacela_SDL.c @@ -199,7 +199,27 @@ gacela_SDL_GetTicks (void) SCM gacela_SDL_DisplayFormat (SCM surface) { - return scm_from_int ((int)SDL_DisplayFormat (get_surface_address (surface))); + SDL_Surface *new = SDL_DisplayFormat (get_surface_address (surface)); + + if (new) { + return make_surface (scm_from_locale_string (get_surface_filename (surface)), new); + } + else { + return SCM_BOOL_F; + } +} + +SCM +gacela_SDL_DisplayFormatAlpha (SCM surface) +{ + SDL_Surface *new = SDL_DisplayFormatAlpha (get_surface_address (surface)); + + if (new) { + return make_surface (scm_from_locale_string (get_surface_filename (surface)), new); + } + else { + return SCM_BOOL_F; + } } SCM @@ -214,6 +234,12 @@ gacela_SDL_SetColorKey (SCM surface, SCM flag, SCM key) return scm_from_int (SDL_SetColorKey (get_surface_address (surface), scm_to_int (flag), scm_to_int (key))); } +SCM +gacela_SDL_SetAlpha (SCM surface, SCM flag, SCM alpha) +{ + return scm_from_int (SDL_SetAlpha (get_surface_address (surface), scm_to_int (flag), scm_to_int (alpha))); +} + SCM gacela_SDL_LoadBMP (SCM file) { @@ -477,8 +503,10 @@ SDL_register_functions (void* data) scm_c_define_gsubr ("SDL_Delay", 1, 0, 0, gacela_SDL_Delay); scm_c_define_gsubr ("SDL_GetTicks", 0, 0, 0, gacela_SDL_GetTicks); scm_c_define_gsubr ("SDL_DisplayFormat", 1, 0, 0, gacela_SDL_DisplayFormat); + scm_c_define_gsubr ("SDL_DisplayFormatAlpha", 1, 0, 0, gacela_SDL_DisplayFormatAlpha); scm_c_define_gsubr ("SDL_MapRGB", 4, 0, 0, gacela_SDL_MapRGB); scm_c_define_gsubr ("SDL_SetColorKey", 3, 0, 0, gacela_SDL_SetColorKey); + scm_c_define_gsubr ("SDL_SetAlpha", 3, 0, 0, gacela_SDL_SetAlpha); scm_c_define_gsubr ("SDL_LoadBMP", 1, 0, 0, gacela_SDL_LoadBMP); scm_c_define_gsubr ("IMG_Load", 1, 0, 0, gacela_IMG_Load); scm_c_define_gsubr ("SDL_GetVideoInfo", 0, 0, 0, gacela_SDL_GetVideoInfo);