From 4e8c2e364492469efeeb09bdeeb74553675e7fd8 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Wed, 3 Nov 2021 09:54:21 +0000 Subject: [PATCH] Fix line endings in a few files --- CMake/ctr/modules/FindZLIB.cmake | 112 +++++++++++++------------- Source/DiabloUI/extrasmenu.cpp | 132 +++++++++++++++---------------- Source/DiabloUI/extrasmenu.h | 18 ++--- 3 files changed, 131 insertions(+), 131 deletions(-) diff --git a/CMake/ctr/modules/FindZLIB.cmake b/CMake/ctr/modules/FindZLIB.cmake index ae9d6c31e..49fb4fe1f 100644 --- a/CMake/ctr/modules/FindZLIB.cmake +++ b/CMake/ctr/modules/FindZLIB.cmake @@ -1,56 +1,56 @@ -# - Try to find zlib -# You can set ZLIB_ROOT to specify a certain directory to look in first. -# Once done this will define -# ZLIB_FOUND - System has zlib -# ZLIB_INCLUDE_DIRS - The zlib include directories -# ZLIB_LIBRARIES - The libraries needed to use zlib -# It also adds an imported target named `3ds::zlib`, Linking against it is -# equivalent to: -# target_link_libraries(mytarget ${ZLIB_LIBRARY}) -# target_include_directories(mytarget PRIVATE ${ZLIB_INCLUDE_DIRS}) - -if(NOT NINTENDO_3DS) - message(FATAL_ERROR "This module can only be used if you are using the 3DS toolchain file. Please erase this build directory or create another one, and then use -DCMAKE_TOOLCHAIN_FILE=DevkitArm3DS.cmake when calling cmake for the 1st time. For more information, see the Readme.md for more information.") -endif() - -if(ZLIB_INCLUDE_DIR) - # Already in cache, be silent - set(ZLIB_FIND_QUIETLY TRUE) -endif(ZLIB_INCLUDE_DIR) - -include(LibFindMacros) -include(try_add_imported_target) - -set(_ZLIB_SEARCHES) - -# Search ZLIB_ROOT first if it is set. -if(ZLIB_ROOT) - set(_ZLIB_SEARCH_ROOT - PATHS ${ZLIB_ROOT} - NO_DEFAULT_PATH - NO_CMAKE_FIND_ROOT_PATH) - list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT) -endif() - -# Search below ${DEVKITPRO}, ${DEVKITARM}, portlibs (if enabled) etc. -set(_ZLIB_SEARCH_NORMAL - PATHS / - NO_DEFAULT_PATH - ONLY_CMAKE_FIND_ROOT_PATH) -list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL) - -foreach(search ${_ZLIB_SEARCHES}) - find_path(ZLIB_INCLUDE_DIR NAMES zlib.h - ${${search}} - PATH_SUFFIXES include) - find_library(ZLIB_LIBRARY NAMES z libz.a - ${${search}} - PATH_SUFFIXES lib) -endforeach() - -set(ZLIB_PROCESS_INCLUDES ZLIB_INCLUDE_DIR) -set(ZLIB_PROCESS_LIBS ZLIB_LIBRARY) - -libfind_process(ZLIB) - -try_add_imported_target(ZLIB) +# - Try to find zlib +# You can set ZLIB_ROOT to specify a certain directory to look in first. +# Once done this will define +# ZLIB_FOUND - System has zlib +# ZLIB_INCLUDE_DIRS - The zlib include directories +# ZLIB_LIBRARIES - The libraries needed to use zlib +# It also adds an imported target named `3ds::zlib`, Linking against it is +# equivalent to: +# target_link_libraries(mytarget ${ZLIB_LIBRARY}) +# target_include_directories(mytarget PRIVATE ${ZLIB_INCLUDE_DIRS}) + +if(NOT NINTENDO_3DS) + message(FATAL_ERROR "This module can only be used if you are using the 3DS toolchain file. Please erase this build directory or create another one, and then use -DCMAKE_TOOLCHAIN_FILE=DevkitArm3DS.cmake when calling cmake for the 1st time. For more information, see the Readme.md for more information.") +endif() + +if(ZLIB_INCLUDE_DIR) + # Already in cache, be silent + set(ZLIB_FIND_QUIETLY TRUE) +endif(ZLIB_INCLUDE_DIR) + +include(LibFindMacros) +include(try_add_imported_target) + +set(_ZLIB_SEARCHES) + +# Search ZLIB_ROOT first if it is set. +if(ZLIB_ROOT) + set(_ZLIB_SEARCH_ROOT + PATHS ${ZLIB_ROOT} + NO_DEFAULT_PATH + NO_CMAKE_FIND_ROOT_PATH) + list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT) +endif() + +# Search below ${DEVKITPRO}, ${DEVKITARM}, portlibs (if enabled) etc. +set(_ZLIB_SEARCH_NORMAL + PATHS / + NO_DEFAULT_PATH + ONLY_CMAKE_FIND_ROOT_PATH) +list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL) + +foreach(search ${_ZLIB_SEARCHES}) + find_path(ZLIB_INCLUDE_DIR NAMES zlib.h + ${${search}} + PATH_SUFFIXES include) + find_library(ZLIB_LIBRARY NAMES z libz.a + ${${search}} + PATH_SUFFIXES lib) +endforeach() + +set(ZLIB_PROCESS_INCLUDES ZLIB_INCLUDE_DIR) +set(ZLIB_PROCESS_LIBS ZLIB_LIBRARY) + +libfind_process(ZLIB) + +try_add_imported_target(ZLIB) diff --git a/Source/DiabloUI/extrasmenu.cpp b/Source/DiabloUI/extrasmenu.cpp index a7d275510..a5c2d88b8 100644 --- a/Source/DiabloUI/extrasmenu.cpp +++ b/Source/DiabloUI/extrasmenu.cpp @@ -1,66 +1,66 @@ -#include "selstart.h" - -#include "control.h" -#include "DiabloUI/diabloui.h" -#include "options.h" -#include "utils/language.h" - -namespace devilution { -namespace { - -bool endMenu; - -std::vector> vecDialogItems; -std::vector> vecDialog; - -Art artLogo; - -_mainmenu_selections selectionExtrasMenu; - -void ItemSelected(int value) -{ - selectionExtrasMenu = static_cast<_mainmenu_selections>(vecDialogItems[value]->m_value); - endMenu = true; -} - -void EscPressed() -{ - selectionExtrasMenu = MAINMENU_NONE; - endMenu = true; -} - -} // namespace - -_mainmenu_selections UiExtrasMenu() -{ - LoadBackgroundArt("ui_art\\black.pcx"); - UiAddBackground(&vecDialog); - UiAddLogo(&vecDialog); - - if (diabdat_mpq != nullptr && hellfire_mpq != nullptr) - vecDialogItems.push_back(std::make_unique(gbIsHellfire ? _("Switch to Diablo") : _("Switch to Hellfire"), MAINMENU_SWITCHGAME)); - if (diabdat_mpq != nullptr) - vecDialogItems.push_back(std::make_unique(gbIsSpawn ? _("Switch to Fullgame") : _("Switch to Shareware"), MAINMENU_TOGGLESPAWN)); - vecDialogItems.push_back(std::make_unique(_("Replay Intro"), MAINMENU_REPLAY_INTRO)); - vecDialogItems.push_back(std::make_unique(_("Support"), MAINMENU_SHOW_SUPPORT)); - vecDialogItems.push_back(std::make_unique(_("Previous Menu"), MAINMENU_NONE)); - vecDialog.push_back(std::make_unique(vecDialogItems, PANEL_LEFT + 34, (UI_OFFSET_Y + 240), 570, 43, UiFlags::AlignCenter | UiFlags::FontSize42 | UiFlags::ColorUiGold, 5)); - - UiInitList(vecDialogItems.size(), nullptr, ItemSelected, EscPressed, vecDialog, true); - - endMenu = false; - while (!endMenu) { - UiClearScreen(); - UiRenderItems(vecDialog); - UiPollAndRender(); - } - - ArtBackground.Unload(); - ArtBackgroundWidescreen.Unload(); - vecDialogItems.clear(); - vecDialog.clear(); - - return selectionExtrasMenu; -} - -} // namespace devilution +#include "selstart.h" + +#include "control.h" +#include "DiabloUI/diabloui.h" +#include "options.h" +#include "utils/language.h" + +namespace devilution { +namespace { + +bool endMenu; + +std::vector> vecDialogItems; +std::vector> vecDialog; + +Art artLogo; + +_mainmenu_selections selectionExtrasMenu; + +void ItemSelected(int value) +{ + selectionExtrasMenu = static_cast<_mainmenu_selections>(vecDialogItems[value]->m_value); + endMenu = true; +} + +void EscPressed() +{ + selectionExtrasMenu = MAINMENU_NONE; + endMenu = true; +} + +} // namespace + +_mainmenu_selections UiExtrasMenu() +{ + LoadBackgroundArt("ui_art\\black.pcx"); + UiAddBackground(&vecDialog); + UiAddLogo(&vecDialog); + + if (diabdat_mpq != nullptr && hellfire_mpq != nullptr) + vecDialogItems.push_back(std::make_unique(gbIsHellfire ? _("Switch to Diablo") : _("Switch to Hellfire"), MAINMENU_SWITCHGAME)); + if (diabdat_mpq != nullptr) + vecDialogItems.push_back(std::make_unique(gbIsSpawn ? _("Switch to Fullgame") : _("Switch to Shareware"), MAINMENU_TOGGLESPAWN)); + vecDialogItems.push_back(std::make_unique(_("Replay Intro"), MAINMENU_REPLAY_INTRO)); + vecDialogItems.push_back(std::make_unique(_("Support"), MAINMENU_SHOW_SUPPORT)); + vecDialogItems.push_back(std::make_unique(_("Previous Menu"), MAINMENU_NONE)); + vecDialog.push_back(std::make_unique(vecDialogItems, PANEL_LEFT + 34, (UI_OFFSET_Y + 240), 570, 43, UiFlags::AlignCenter | UiFlags::FontSize42 | UiFlags::ColorUiGold, 5)); + + UiInitList(vecDialogItems.size(), nullptr, ItemSelected, EscPressed, vecDialog, true); + + endMenu = false; + while (!endMenu) { + UiClearScreen(); + UiRenderItems(vecDialog); + UiPollAndRender(); + } + + ArtBackground.Unload(); + ArtBackgroundWidescreen.Unload(); + vecDialogItems.clear(); + vecDialog.clear(); + + return selectionExtrasMenu; +} + +} // namespace devilution diff --git a/Source/DiabloUI/extrasmenu.h b/Source/DiabloUI/extrasmenu.h index ea57ff6af..b5bf2adc5 100644 --- a/Source/DiabloUI/extrasmenu.h +++ b/Source/DiabloUI/extrasmenu.h @@ -1,9 +1,9 @@ -#pragma once - -#include "DiabloUI/diabloui.h" - -namespace devilution { - -_mainmenu_selections UiExtrasMenu(); - -} // namespace devilution +#pragma once + +#include "DiabloUI/diabloui.h" + +namespace devilution { + +_mainmenu_selections UiExtrasMenu(); + +} // namespace devilution