More aestethically pleasing effect.

This commit is contained in:
Themaister 2012-01-08 01:32:45 +01:00
parent b4248038fb
commit 08aaa1021c
2 changed files with 17 additions and 13 deletions

View File

@ -116,13 +116,19 @@ void sgui_free(sgui_handle_t *sgui)
static uint16_t gray_filler(unsigned x, unsigned y)
{
uint16_t col = ((x + y) & 1) + 2;
x >>= 1;
y >>= 1;
uint16_t col = ((x + y) & 1) + 1;
col <<= 1;
return (col << 0) | (col << 5) | (col << 10);
}
static uint16_t green_filler(unsigned x, unsigned y)
{
uint16_t col = ((x + y) & 1) + 2;
x >>= 1;
y >>= 1;
uint16_t col = ((x + y) & 1) + 1;
col <<= 1;
return (col << 0) | (col << 6) | (col << 10);
}

View File

@ -44,12 +44,6 @@ static bool folder_cb(const char *directory, sgui_file_enum_cb_t file_cb,
{
(void)userdata;
//if (!*directory)
//{
// file_cb(ctx, "sd:/", SGUI_FILE_DIRECTORY);
// return true;
//}
DIR *dir = opendir(directory);
if (!dir)
return false;
@ -78,6 +72,7 @@ static bool folder_cb(const char *directory, sgui_file_enum_cb_t file_cb,
static const char *get_rom_path(sgui_handle_t *sgui)
{
uint16_t old_input_state = 0;
bool can_quit = false;
sgui_iterate(sgui, SGUI_ACTION_REFRESH);
@ -87,7 +82,12 @@ static const char *get_rom_path(sgui_handle_t *sgui)
input_wii.poll(NULL);
if (input_wii.key_pressed(NULL, SSNES_QUIT_KEY))
return NULL;
{
if (can_quit)
return NULL;
}
else
can_quit = true;
for (unsigned i = 0; i < SSNES_FIRST_META_KEY; i++)
{
@ -135,10 +135,9 @@ int main(void)
menu_framebuf, SGUI_WIDTH * sizeof(uint16_t),
_binary_console_font_bmp_start, folder_cb, NULL);
const char *rom_path = get_rom_path(sgui);
const char *rom_path;
int ret = 0;
if (rom_path)
while ((rom_path = get_rom_path(sgui)) && ret == 0)
{
char *argv[] = { strdup("ssnes"), strdup(rom_path), NULL };
ret = ssnes_main(sizeof(argv) / sizeof(argv[0]) - 1, argv);
@ -150,7 +149,6 @@ int main(void)
wii_video_deinit();
sgui_free(sgui);
return ret;
}