From fcf5d062568c97de2ea3acda9560fa50a99e03d2 Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Mon, 25 Jan 2010 13:23:14 +0000 Subject: [PATCH] Activate the Gui (basic stuff works!) --- Src/C64_SDL.h | 2 ++ Src/Display_SDL.h | 5 ++++- Src/main_x.h | 3 +-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Src/C64_SDL.h b/Src/C64_SDL.h index 0704308..a1d3ba9 100644 --- a/Src/C64_SDL.h +++ b/Src/C64_SDL.h @@ -338,6 +338,8 @@ void C64::VBlank(bool draw_frame) } this->network_vblank(); + Gui::gui->runLogic(); + #if defined(GEKKO) if (this->quit_thyself && Network::networking_started == true) SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); diff --git a/Src/Display_SDL.h b/Src/Display_SDL.h index 17ea3a8..135e464 100644 --- a/Src/Display_SDL.h +++ b/Src/Display_SDL.h @@ -327,6 +327,7 @@ void C64Display::Update(uint8 *src_pixels) this->Update_32((Uint8*)screen); break; } } + Gui::gui->draw(real_screen); if (this->TheC64->network_connection_type != NONE) draw_string(real_screen, 0, 0, networktraffic_string, black, fill_gray); @@ -669,6 +670,8 @@ void C64Display::PollKeyboard(uint8 *key_matrix, uint8 *rev_matrix, uint8 *joyst { SDL_Event event; while (SDL_PollEvent(&event)) { + Gui::gui->pushEvent(&event); + switch (event.type) { // Key pressed @@ -691,7 +694,7 @@ void C64Display::PollKeyboard(uint8 *key_matrix, uint8 *rev_matrix, uint8 *joyst break; case SDLK_HOME: // Home: Pause and enter menu - TheC64->enter_menu(); + Gui::gui->activate(); break; case SDLK_KP_PLUS: // '+' on keypad: Increase SkipFrames diff --git a/Src/main_x.h b/Src/main_x.h index 06bc703..97751a1 100644 --- a/Src/main_x.h +++ b/Src/main_x.h @@ -75,8 +75,6 @@ int main(int argc, char **argv) fprintf(stderr, "Unable to init TTF: %s\n", TTF_GetError() ); return 1; } - Gui::gui = new Gui(); - Gui::gui->setTheme("default"); #endif if (!init_graphics()) return 1; @@ -141,6 +139,7 @@ void Frodo::ReadyToRun(void) // Create and start C64 TheC64 = new C64; + Gui::init(); load_rom_files(); TheC64->Run(); delete TheC64;