diff --git a/CMakeLists.txt b/CMakeLists.txt index 23f7390d30..c8fb78a18e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,10 +36,8 @@ link_directories(${CMAKE_CURRENT_BINARY_DIR}/libretro) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libretro) set(REZ_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libretro:${CMAKE_INSTALL_PREFIX}/RIncludes" ) -if(NOT (CMAKE_SYSTEM_NAME MATCHES RetroCarbon)) add_subdirectory(Console) add_subdirectory(Samples/HelloWorld) -endif() add_subdirectory(TestApps) add_subdirectory(Samples/Dialog) add_subdirectory(Samples/Raytracer) diff --git a/Console/Console.cc b/Console/Console.cc index dc309974d5..e6b9732890 100644 --- a/Console/Console.cc +++ b/Console/Console.cc @@ -202,7 +202,7 @@ std::string Console::ReadLine() { do { - while(!GetOSEvent(everyEvent, &event)) + while(!GetNextEvent(everyEvent, &event)) ; } while(event.what != keyDown && event.what != autoKey); @@ -230,4 +230,3 @@ std::string Console::ReadLine() } while(c != '\n'); return buffer; } - diff --git a/Console/InitConsole.cc b/Console/InitConsole.cc index 6f5112fe12..a3ff5e015b 100644 --- a/Console/InitConsole.cc +++ b/Console/InitConsole.cc @@ -44,19 +44,36 @@ void Retro::InitConsole() return; WindowPtr win; + GrafPtr port; + +#if !TARGET_API_MAC_CARBON InitGraf(&qd.thePort); InitFonts(); InitWindows(); InitMenus(); - Rect r; - SetRect(&r, qd.screenBits.bounds.left + 5, qd.screenBits.bounds.top + 45, qd.screenBits.bounds.right - 5, qd.screenBits.bounds.bottom -5); + Rect r = qd.screenBits.bounds; +#else + Rect r = (*GetMainDevice())->gdRect; +#endif + + r.top += 40; + InsetRect(&r, 5,5); win = NewWindow(NULL, &r, "\pRetro68 Console", true, 0, (WindowPtr)-1, false, 0); - SetPort(win); - EraseRect(&win->portRect); +#if !TARGET_API_MAC_CARBON + port = win; + Rect portRect = port->portRect; +#else + port = GetWindowPort(win); + Rect portRect; + GetPortBounds(port, &portRect); +#endif - Console *console = new Console(win, win->portRect); + SetPort(port); + EraseRect(&portRect); + + Console *console = new Console(port, portRect); } extern "C" ssize_t _consolewrite(int fd, const void *buf, size_t count) diff --git a/TestApps/CMakeLists.txt b/TestApps/CMakeLists.txt index 3e064b7138..f5efd02b03 100644 --- a/TestApps/CMakeLists.txt +++ b/TestApps/CMakeLists.txt @@ -20,11 +20,8 @@ set(CMAKE_CXX_FLAGS "-std=c++11") # -fomit-frame-pointer") add_application(EmptyTest EmptyTest.c) -if(CMAKE_SYSTEM_NAME MATCHES RetroCarbon) -else() add_application(ExceptionTest CONSOLE ExceptionTest.cc) add_application(InitTest CONSOLE InitTest.cc) -endif() if(CMAKE_SYSTEM_NAME MATCHES Retro68) enable_language(ASM)