diff --git a/CMakeLists.txt b/CMakeLists.txt index 096e56bb..26cfbf2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,6 @@ install(DIRECTORY ${CMAKE_SOURCE_DIR}/plugins/stonesense/configs/ SET(PROJECT_SRCS TrackingModes.cpp - #Overlay.cpp Tile.cpp TileCondition.cpp TileTree.cpp @@ -64,7 +63,6 @@ SET(PROJECT_HDRS MapLoading.h MaterialMatcher.h OcclusionTest.h - #Overlay.h SegmentProcessing.h SpriteColors.h SpriteMaps.h diff --git a/GUI.cpp b/GUI.cpp index 66b717d4..46b3f454 100644 --- a/GUI.cpp +++ b/GUI.cpp @@ -965,10 +965,10 @@ void paintboard() if(ssConfig.config.debug_mode) { auto& contentLoader = stonesenseState.contentLoader; + draw_textf_border(font, uiColor(dfColors::white), 10, 3*fontHeight, 0, "Map Read Time: %.2fms", clockToMs(stonesenseState.stoneSenseTimers.read_time)); draw_textf_border(font, uiColor(dfColors::white), 10, 4*fontHeight, 0, "Map Beautification Time: %.2fms", clockToMs(stonesenseState.stoneSenseTimers.beautify_time)); draw_textf_border(font, uiColor(dfColors::white), 10, 5*fontHeight, 0, "Tile Sprite Assembly Time: %.2fms", clockToMs(stonesenseState.stoneSenseTimers.assembly_time)); - draw_textf_border(font, uiColor(dfColors::white), 10, 6*fontHeight, 0, "DF Renderer Overlay Time: %.2fms", clockToMs(stonesenseState.stoneSenseTimers.overlay_time)); draw_textf_border(font, uiColor(dfColors::white), 10, 2*fontHeight, 0, "FPS: %.2f", 1000.0/clockToMs(stonesenseState.stoneSenseTimers.frame_total)); draw_textf_border(font, uiColor(dfColors::white), 10, 7*fontHeight, 0, "Draw: %.2fms", clockToMs(stonesenseState.stoneSenseTimers.draw_time)); draw_textf_border(font, uiColor(dfColors::white), 10, 9*fontHeight, 0, "%i/%i/%i, %i:%i", contentLoader->currentDay+1, contentLoader->currentMonth+1, contentLoader->currentYear, contentLoader->currentHour, (contentLoader->currentTickRel*60)/50); diff --git a/GameConfiguration.h b/GameConfiguration.h index 64f1c633..f60ede1b 100644 --- a/GameConfiguration.h +++ b/GameConfiguration.h @@ -13,7 +13,6 @@ struct GameConfiguration { Config config; // items not configurable via the config file - bool overlay_mode; bool show_designations = true; bool show_announcements = false; bool show_keybinds = false; diff --git a/commonTypes.h b/commonTypes.h index 8156d1df..7971bea0 100644 --- a/commonTypes.h +++ b/commonTypes.h @@ -214,7 +214,6 @@ struct FrameTimers{ RollingAverage beautify_time; RollingAverage assembly_time; RollingAverage draw_time; - RollingAverage overlay_time; RollingAverage frame_total; clock_t prev_frame_time{ clock() }; diff --git a/main.cpp b/main.cpp index c5d1802c..25dbd154 100644 --- a/main.cpp +++ b/main.cpp @@ -6,7 +6,6 @@ #include "commonTypes.h" #include "Config.h" -//#include "Overlay.h" #include "Tile.h" #include "GUI.h" //#include "SpriteMaps.h" @@ -46,9 +45,6 @@ int keyoffset=0; std::vector v_stonetypes; -/*FIXME: Find a new replacement for the overlay mode. -std::unique_ptr overlay; -*/ ALLEGRO_DISPLAY * display; ALLEGRO_EVENT event; @@ -226,36 +222,6 @@ static void main_loop(ALLEGRO_DISPLAY * display, ALLEGRO_EVENT_QUEUE *queue, ALL al_rest(0); - /*FIXME: Find a new replacement for the overlay mode. - if (ssConfig.overlay_mode) - { - bool goodoverlay = ovrlay->GoodViewscreen(); - if (!goodoverlay) { - //do nothing; this isn't a view we can overlay - }if (ssConfig.spriteIndexOverlay) { - DrawSpriteIndexOverlay(ssConfig.currentSpriteOverlay); - ovrlay->Flip(); - } - else if (!Maps::IsValid()) { - drawcredits(); - ovrlay->Flip(); - } - else if (timeToReloadSegment) { - reloadPosition(); - al_clear_to_color(ssConfig.config.backcol); - paintboard(); - ovrlay->Flip(); - timeToReloadSegment = false; - animationFrameShown = true; - } - else if (animationFrameShown == false) { - al_clear_to_color(ssConfig.config.backcol); - paintboard(); - ovrlay->Flip(); - animationFrameShown = true; - } - } - else */ { if (ssConfig.spriteIndexOverlay) { DrawSpriteIndexOverlay(ssConfig.currentSpriteOverlay); @@ -281,10 +247,8 @@ static void main_loop(ALLEGRO_DISPLAY * display, ALLEGRO_EVENT_QUEUE *queue, ALL } } - if (!ssConfig.overlay_mode) { - doMouse(); - doRepeatActions(); - } + doMouse(); + doRepeatActions(); redraw = false; } /* Take the next event out of the event queue, and store it in `event'. */ @@ -303,9 +267,6 @@ static void main_loop(ALLEGRO_DISPLAY * display, ALLEGRO_EVENT_QUEUE *queue, ALL if(in_time) { switch (event.type) { case ALLEGRO_EVENT_DISPLAY_RESIZE: - if (ssConfig.overlay_mode) { - break; - } stonesenseState.timeToReloadSegment = true; redraw = true; stonesenseState.ssState.ScreenH = event.display.height; @@ -318,9 +279,6 @@ static void main_loop(ALLEGRO_DISPLAY * display, ALLEGRO_EVENT_QUEUE *queue, ALL /* ALLEGRO_EVENT_KEY_DOWN - a keyboard key was pressed. */ case ALLEGRO_EVENT_KEY_CHAR: - if (ssConfig.overlay_mode) { - break; - } if(event.keyboard.display != display) { break; } @@ -395,9 +353,8 @@ static void* stonesense_thread(ALLEGRO_THREAD* main_thread, void* parms) auto& ssConfig = stonesenseState.ssConfig; al_set_new_display_flags( - (ssConfig.config.Fullscreen && !ssConfig.overlay_mode ? ALLEGRO_FULLSCREEN : ALLEGRO_WINDOWED) - |(ssConfig.overlay_mode ? 0 : ALLEGRO_RESIZABLE) - |(ssConfig.overlay_mode ? ALLEGRO_MINIMIZED : 0) + (ssConfig.config.Fullscreen ? ALLEGRO_FULLSCREEN : ALLEGRO_WINDOWED) + | ALLEGRO_RESIZABLE |(ssConfig.config.opengl ? ALLEGRO_OPENGL : 0) |(ssConfig.config.directX ? ALLEGRO_DIRECT3D_INTERNAL : 0)); @@ -438,12 +395,6 @@ static void* stonesense_thread(ALLEGRO_THREAD* main_thread, void* parms) SetTitle("Stonesense"); drawcredits(); - /*FIXME: Find a new replacement for the overlay mode. - if(ssConfig.overlay_mode){ - overlay = std::make_unique(df::global::enabler->renderer); - df::global::enabler->renderer = overlay.get(); - } - */ std::filesystem::path p = std::filesystem::path{} / "stonesense" / "stonesense.png"; IMGIcon = load_bitmap_withWarning(p); @@ -503,9 +454,6 @@ static void* stonesense_thread(ALLEGRO_THREAD* main_thread, void* parms) // window is destroyed. al_destroy_display(display); display = 0; - /*FIXME: Find a new replacement for the overlay mode. - overlay.reset(); - */ if(ssConfig.threadmade) { al_broadcast_cond(ssConfig.readCond); @@ -557,35 +505,13 @@ DFhackCExport command_result plugin_shutdown ( color_ostream &out ) //and the actual stonesense command. Maybe. DFhackCExport command_result stonesense_command(color_ostream &out, std::vector & params) { -/* - if (!init->display.flag.is_set(init_display_flags::RENDER_2D) && - !params.empty() && params[0] == "overlay") - { - out.printerr("'stonesense overlay' is not supported in this print mode.\n" - "Try changing PRINT_MODE to 2D or a similar choice in init.txt.\n"); - return CR_FAILURE; - } -#ifdef _DARWIN - if (!init->display.flag.is_set(init_display_flags::RENDER_2D)) - { - out.printerr("The current print mode is not suported\n" - "Change PRINT_MODE in init.txt to 2D or a similar choice\n"); - return CR_FAILURE; - } -#endif -*/ if(stonesense_started) { out.print("Stonesense already running.\n"); return CR_OK; } - stonesenseState.ssConfig.overlay_mode = false; if(params.size() > 0 ) { - if(params[0] == "overlay"){ - //ssConfig.overlay_mode = true; - } else { - DumpInfo(out, params); - return CR_OK; - } + DumpInfo(out, params); + return CR_OK; } if(!al_is_system_installed()) {