diff --git a/Makefile b/Makefile index fc3ad2f..d47a1a2 100644 --- a/Makefile +++ b/Makefile @@ -39,10 +39,10 @@ include $(DEVKITPRO)/libnx/switch_rules #--------------------------------------------------------------------------------- TARGET := $(notdir $(CURDIR)) BUILD := build -SOURCES := source +SOURCES := source source/menus/book source/menus/book-chooser DATA := data -INCLUDES := include include/menus/book include/menus/book-chooser -ROMFS := RomFS +INCLUDES := include include/menus/book include/menus/book-chooser +ROMFS := romfs VERSION_MAJOR := 0 VERSION_MINOR := 1 @@ -57,7 +57,7 @@ APP_VERSION := ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO} #--------------------------------------------------------------------------------- ARCH := -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE -CFLAGS := -g -Wall -O2 -ffunction-sections \ +CFLAGS := -g -std=c++17 -Wall -O2 -ffunction-sections \ $(ARCH) $(DEFINES) CFLAGS += -D__SWITCH__ $(INCLUDE) `sdl2-config --cflags` @@ -67,11 +67,11 @@ CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions ASFLAGS := -g $(ARCH) LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) -#LIBS := `sdl2-config --libs` -lSDL2_ttf -lSDL2_image -#LIBS := `aarch64-none-elf-pkg-config --libs sdl2 SDL2_ttf SDL2_mixer` +#LIBS := `sdl2-config --libs` -lSDL2_ttf -lSDL2_image +#LIBS := `aarch64-none-elf-pkg-config --libs sdl2 SDL2_ttf SDL2_mixer` #LIBS := `sdl2-config --libs` -lSDL2_ttf -lSDL2_image -lfreetype -lz -lnx -LIBS := `sdl2-config --libs` -lSDL2_ttf -lSDL2_image -lfreetype -lpng -ljpeg -lwebp -lz -lbz2 -ltwili -lnx -lmupdf -lmupdf-third -#LIBS := `aarch64-none-elf-pkg-config --libs sdl2` -lSDL2_ttf #-lSDL2_image -lmupdf -lmupdf-third +LIBS := -lstdc++fs `sdl2-config --libs` -lSDL2_ttf -lSDL2_image -lfreetype -lpng -ljpeg -lwebp -lz -lbz2 -ltwili -lnx -lmupdf -lmupdf-third +#LIBS := `aarch64-none-elf-pkg-config --libs sdl2` -lSDL2_ttf #-lSDL2_image -lmupdf -lmupdf-third #--------------------------------------------------------------------------------- # list of directories containing libraries, this must be the top level containing diff --git a/include/SDL_helper.h b/include/SDL_helper.h index 4198a9c..a831844 100644 --- a/include/SDL_helper.h +++ b/include/SDL_helper.h @@ -1,6 +1,9 @@ #ifndef EBOOK_READER_SDL_HELPER_H #define EBOOK_READER_SDL_HELPER_H +#include +#include + static inline SDL_Color SDL_MakeColour(Uint8 r, Uint8 g, Uint8 b, Uint8 a) { SDL_Color colour = {r, g, b, a}; @@ -8,6 +11,9 @@ static inline SDL_Color SDL_MakeColour(Uint8 r, Uint8 g, Uint8 b, Uint8 a) } #define WHITE SDL_MakeColour(255, 255, 255, 255) +#define VERY_LIGHT_GRAY SDL_MakeColour(222, 222, 222, 255) +#define LIGHT_GRAY SDL_MakeColour(181, 181, 181, 255) +#define DARK_GRAY SDL_MakeColour(148, 148, 148, 255) #define BLACK_BG SDL_MakeColour(48, 48, 48, 255) #define STATUS_BAR_LIGHT SDL_MakeColour(37, 79, 174, 255) #define STATUS_BAR_DARK SDL_MakeColour(38, 50, 56, 255) diff --git a/include/common.h b/include/common.h index 98e202e..a93be0d 100644 --- a/include/common.h +++ b/include/common.h @@ -8,6 +8,6 @@ extern SDL_Window *WINDOW; extern SDL_Surface *WINDOW_SURFACE; extern SDL_Renderer *RENDERER; -extern TTF_Font *ARIAL_UNICODE; +extern TTF_Font *ARIAL; #endif \ No newline at end of file diff --git a/include/textures.h b/include/textures.h index 6ce0215..90f4206 100644 --- a/include/textures.h +++ b/include/textures.h @@ -1,6 +1,7 @@ #ifndef NX_SHELL_TEXTURES_H #define NX_SHELL_TEXTURES_H +#include SDL_Texture *battery_20, *battery_20_charging, *battery_30, *battery_30_charging, *battery_50, *battery_50_charging, \ *battery_60, *battery_60_charging, *battery_80, *battery_80_charging, *battery_90, *battery_90_charging, \ diff --git a/RomFs/res/font/arial.ttf b/romfs/arial.ttf similarity index 100% rename from RomFs/res/font/arial.ttf rename to romfs/arial.ttf diff --git a/RomFs/res/images/battery_20.png b/romfs/battery_20.png similarity index 100% rename from RomFs/res/images/battery_20.png rename to romfs/battery_20.png diff --git a/RomFs/res/images/battery_20_charging.png b/romfs/battery_20_charging.png similarity index 100% rename from RomFs/res/images/battery_20_charging.png rename to romfs/battery_20_charging.png diff --git a/RomFs/res/images/battery_30.png b/romfs/battery_30.png similarity index 100% rename from RomFs/res/images/battery_30.png rename to romfs/battery_30.png diff --git a/RomFs/res/images/battery_30_charging.png b/romfs/battery_30_charging.png similarity index 100% rename from RomFs/res/images/battery_30_charging.png rename to romfs/battery_30_charging.png diff --git a/RomFs/res/images/battery_50.png b/romfs/battery_50.png similarity index 100% rename from RomFs/res/images/battery_50.png rename to romfs/battery_50.png diff --git a/RomFs/res/images/battery_50_charging.png b/romfs/battery_50_charging.png similarity index 100% rename from RomFs/res/images/battery_50_charging.png rename to romfs/battery_50_charging.png diff --git a/RomFs/res/images/battery_60.png b/romfs/battery_60.png similarity index 100% rename from RomFs/res/images/battery_60.png rename to romfs/battery_60.png diff --git a/RomFs/res/images/battery_60_charging.png b/romfs/battery_60_charging.png similarity index 100% rename from RomFs/res/images/battery_60_charging.png rename to romfs/battery_60_charging.png diff --git a/RomFs/res/images/battery_80.png b/romfs/battery_80.png similarity index 100% rename from RomFs/res/images/battery_80.png rename to romfs/battery_80.png diff --git a/RomFs/res/images/battery_80_charging.png b/romfs/battery_80_charging.png similarity index 100% rename from RomFs/res/images/battery_80_charging.png rename to romfs/battery_80_charging.png diff --git a/RomFs/res/images/battery_90.png b/romfs/battery_90.png similarity index 100% rename from RomFs/res/images/battery_90.png rename to romfs/battery_90.png diff --git a/RomFs/res/images/battery_90_charging.png b/romfs/battery_90_charging.png similarity index 100% rename from RomFs/res/images/battery_90_charging.png rename to romfs/battery_90_charging.png diff --git a/RomFs/res/images/battery_full.png b/romfs/battery_full.png similarity index 100% rename from RomFs/res/images/battery_full.png rename to romfs/battery_full.png diff --git a/RomFs/res/images/battery_full_charging.png b/romfs/battery_full_charging.png similarity index 100% rename from RomFs/res/images/battery_full_charging.png rename to romfs/battery_full_charging.png diff --git a/RomFs/res/images/battery_low.png b/romfs/battery_low.png similarity index 100% rename from RomFs/res/images/battery_low.png rename to romfs/battery_low.png diff --git a/RomFs/res/images/battery_unknown.png b/romfs/battery_unknown.png similarity index 100% rename from RomFs/res/images/battery_unknown.png rename to romfs/battery_unknown.png diff --git a/source/SDL_helper.c b/source/SDL_helper.c index a16a984..ba847da 100644 --- a/source/SDL_helper.c +++ b/source/SDL_helper.c @@ -1,5 +1,5 @@ -#include "common.h" #include "SDL_helper.h" +#include "common.h" void SDL_ClearScreen(SDL_Renderer *renderer, SDL_Color colour) { SDL_SetRenderDrawColor(renderer, colour.r, colour.g, colour.b, colour.a); diff --git a/source/main.cpp b/source/main.cpp index 417c3fb..a5cacfe 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -11,7 +11,7 @@ extern "C" { #include "common.h" - #include "SDL_helper.h" + //#include "SDL_helper.h" #include "textures.h" #include "MenuChooser.h" } @@ -19,7 +19,7 @@ extern "C" { SDL_Renderer* RENDERER; SDL_Window* WINDOW; SDL_Surface* WINDOW_SURFACE; -TTF_Font* ARIAL_UNICODE; +TTF_Font* ARIAL; SDL_Event EVENT; bool run = true; @@ -27,7 +27,8 @@ bool run = true; void Term_Services() { std::cout << "Terminate Serices" << std::endl; - TTF_CloseFont(ARIAL_UNICODE); + timeExit(); + TTF_CloseFont(ARIAL); TTF_Quit(); Textures_Free(); @@ -43,6 +44,7 @@ void Term_Services() { } void Init_Services() { + timeInitialize(); twiliInitialize(); std::cout << "Initalize Serices" << std::endl; @@ -50,29 +52,43 @@ void Init_Services() { SDL_Log("SDL_Init: %s\n", SDL_GetError()); Term_Services(); } + std::cout << "Initalized SDL" << std::endl; - TTF_Init(); + if(TTF_Init()==-1) { + printf("TTF_Init: %s\n", TTF_GetError()); + Term_Services(); + } + std::cout << "Initalized TTF" << std::endl; WINDOW = SDL_CreateWindow("sdl2_gles2", 0, 0, 1280, 720, 0); if (!WINDOW) { SDL_Log("SDL_CreateWindow: %s\n", SDL_GetError()); Term_Services(); } + std::cout << "Initalized Window" << std::endl; RENDERER = SDL_CreateRenderer(WINDOW, 0, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC); if (!RENDERER) { SDL_Log("SDL_CreateRenderer: %s\n", SDL_GetError()); Term_Services(); } + std::cout << "Initalized Renderer" << std::endl; WINDOW_SURFACE = SDL_GetWindowSurface(WINDOW); + std::cout << "Retrevied Window Surface" << std::endl; romfsInit(); + std::cout << "Initalized RomFs" << std::endl; + + /*std::cout << "Loading Textures" << std::endl; Textures_Load(); - ARIAL_UNICODE = TTF_OpenFont("romfs:/res/font/arial.ttf", 35); - if (!ARIAL_UNICODE) { + std::cout << "Loaded Textures" << std::endl;*/ + + ARIAL = TTF_OpenFont("romfs:/arial.ttf", 35); + if (!ARIAL) { Term_Services(); } + std::cout << "Gotten Fonts" << std::endl; for (int i = 0; i < 2; i++) { if (SDL_JoystickOpen(i) == NULL) { @@ -80,6 +96,7 @@ void Init_Services() { Term_Services(); } } + std::cout << "Initalized Input" << std::endl; } int main(int argc, char *argv[]) { @@ -90,6 +107,7 @@ int main(int argc, char *argv[]) { //Menu_OpenBook("/switch/eBookReader/books/test.epub"); Menu_StartChoosing(); + bool isBookReading = false; while (run) { while (SDL_PollEvent(&EVENT)) { switch (EVENT.type) { @@ -116,6 +134,25 @@ int main(int argc, char *argv[]) { SDL_RenderClear(RENDERER); SDL_RenderPresent(RENDERER);*/ + /*if (!isBookReading) { + SDL_ClearScreen(RENDERER, WHITE); + std::cout << "Cleared Screen" << std::endl; + SDL_RenderClear(RENDERER); + std::cout << "Render Clear" << std::endl;*/ + + /*int space_index = 0; + while ((entry = readdir(dir)) != NULL) { + SDL_DrawText(RENDERER, ARIAL, 20, 20 + (30 * space_index), BLACK, entry->d_name); + space_index++; + //cout << entry->d_name << endl; + }*/ + + /*SDL_DrawText(RENDERER, ARIAL, 50, 50, BLACK, "TEST"); + std::cout << "Draw text" << std::endl; + + SDL_RenderPresent(RENDERER); + std::cout << "Render Present" << std::endl; + }*/ } Term_Services(); diff --git a/source/menus/book-chooser/MenuChooser.cpp b/source/menus/book-chooser/MenuChooser.cpp index 643846a..815d3ca 100644 --- a/source/menus/book-chooser/MenuChooser.cpp +++ b/source/menus/book-chooser/MenuChooser.cpp @@ -1,35 +1,83 @@ extern "C" { #include "MenuChooser.h" + #include "menu_book_reader.h" #include "common.h" #include "SDL_helper.h" } #include #include -#include -#include +/*#include +#include */ +#include +using namespace std; +namespace fs = filesystem; //using namespace std; +//extern bool readingBook; + void Menu_StartChoosing() { - int choosen_index = 0; - - struct dirent *entry; - DIR *dir = opendir("/switch/eBookReader/books"); - - if (dir == NULL) { - return; - } + int choosenIndex = 0; + bool readingBook = false; + string path = "/switch/eBookReader/books"; while(appletMainLoop()) { + if (readingBook) { + break; + } + SDL_ClearScreen(RENDERER, WHITE); SDL_RenderClear(RENDERER); + hidScanInput(); + + u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + u64 kHeld = hidKeysHeld(CONTROLLER_P1_AUTO); + + if (kDown & KEY_PLUS) { + break; + } + + if (kDown & KEY_A) { + int bookIndex = 0; + for (const auto & entry : fs::directory_iterator(path)) { + string filename = entry.path().filename().string(); + string extention = filename.substr(filename.length() - 3); + if (extention == "pdf") { + if (bookIndex == choosenIndex) { + char* book = (char *) entry.path().string().c_str(); + Menu_OpenBook(book); + readingBook = true; + break; + } + + choosenIndex++; + } + } + } + + if (kDown & KEY_DUP) { + if (choosenIndex != 0) choosenIndex--; + } + + if (kDown & KEY_DDOWN) { + choosenIndex++; + } + int space_index = 0; - while ((entry = readdir(dir)) != NULL) { - SDL_DrawText(RENDERER, ARIAL_UNICODE, 20, 20 + (30 * space_index), BLACK, entry->d_name); - space_index++; - //cout << entry->d_name << endl; + for (const auto & entry : fs::directory_iterator(path)) { + string filename = entry.path().filename().string(); + string extention = filename.substr(filename.length() - 3); + if (extention == "pdf") { + if (choosenIndex == space_index) { + SDL_DrawRect(RENDERER, 15, 20 + (40 * space_index), 1265, 40, VERY_LIGHT_GRAY); + } + + SDL_DrawText(RENDERER, ARIAL, 20, 20 + (40 * space_index), BLACK, entry.path().filename().c_str()); + + space_index++; + } } SDL_RenderPresent(RENDERER); diff --git a/source/menus/book/BookReader.cpp b/source/menus/book/BookReader.cpp index 4980bc3..c429393 100644 --- a/source/menus/book/BookReader.cpp +++ b/source/menus/book/BookReader.cpp @@ -142,15 +142,13 @@ void BookReader::draw() { char *title = layout->info(); int title_width = 0, title_height = 0; - //TTF_SizeText(Roboto, title, &title_width, &title_height); - TTF_SizeText(ARIAL_UNICODE, title, &title_width, &title_height); + TTF_SizeText(ARIAL, title, &title_width, &title_height); //SDL_Color color = config_dark_theme ? STATUS_BAR_DARK : STATUS_BAR_LIGHT; SDL_Color color = STATUS_BAR_LIGHT; SDL_DrawRect(RENDERER, 0, 0, 1280, 40, SDL_MakeColour(color.r, color.g, color.b , 128)); - //SDL_DrawText(RENDERER, Roboto, (1280 - title_width) / 2, (44 - title_height) / 2, WHITE, title); - SDL_DrawText(RENDERER, ARIAL_UNICODE, (1280 - title_width) / 2, (44 - title_height) / 2, WHITE, title); + SDL_DrawText(RENDERER, ARIAL, (1280 - title_width) / 2, (44 - title_height) / 2, WHITE, title); StatusBar_DisplayTime(); } diff --git a/source/menus/book/menu_book_reader.cpp b/source/menus/book/menu_book_reader.cpp index 5467d20..9e2ddbf 100644 --- a/source/menus/book/menu_book_reader.cpp +++ b/source/menus/book/menu_book_reader.cpp @@ -1,5 +1,6 @@ extern "C" { #include "menu_book_reader.h" + #include "MenuChooser.h" #include "common.h" } @@ -116,5 +117,6 @@ void Menu_OpenBook(char *path) { }*/ } + //readingBook = false; delete reader; } diff --git a/source/status_bar.c b/source/status_bar.c index b9d515a..3c57195 100644 --- a/source/status_bar.c +++ b/source/status_bar.c @@ -97,14 +97,14 @@ static void StatusBar_GetBatteryStatus(int x, int y) } snprintf(buf, 5, "%d%%", percent); - TTF_SizeText(ARIAL_UNICODE, buf, &width, NULL); - SDL_DrawText(RENDERER, ARIAL_UNICODE, (x - width - 10), y, WHITE, buf); + TTF_SizeText(ARIAL, buf, &width, NULL); + SDL_DrawText(RENDERER, ARIAL, (x - width - 10), y, WHITE, buf); } else { snprintf(buf, 5, "%d%%", percent); - TTF_SizeText(ARIAL_UNICODE, buf, &width, NULL); - SDL_DrawText(RENDERER, ARIAL_UNICODE, (x - width - 10), y, WHITE, buf); + TTF_SizeText(ARIAL, buf, &width, NULL); + SDL_DrawText(RENDERER, ARIAL, (x - width - 10), y, WHITE, buf); SDL_DrawImage(RENDERER, battery_unknown, x, 1); } } @@ -112,8 +112,8 @@ static void StatusBar_GetBatteryStatus(int x, int y) void StatusBar_DisplayTime(void) { int width = 0, height = 0; - TTF_SizeText(ARIAL_UNICODE, Clock_GetCurrentTime(), &width, &height); + TTF_SizeText(ARIAL, Clock_GetCurrentTime(), &width, &height); - StatusBar_GetBatteryStatus(1260 - width - 44, (40 - height) / 2); - SDL_DrawText(RENDERER, ARIAL_UNICODE, 1260 - width, (40 - height) / 2, WHITE, Clock_GetCurrentTime()); + //StatusBar_GetBatteryStatus(1260 - width - 44, (40 - height) / 2); + SDL_DrawText(RENDERER, ARIAL, 1260 - width, (40 - height) / 2, WHITE, Clock_GetCurrentTime()); } \ No newline at end of file diff --git a/source/textures.c b/source/textures.c index 62997a2..9aa2364 100644 --- a/source/textures.c +++ b/source/textures.c @@ -1,80 +1,27 @@ +#include "textures.h" #include "common.h" #include "SDL_helper.h" -#include "textures.h" void Textures_Load(void) { - /*SDL_LoadImage(RENDERER, &icon_app, "romfs:/res/images/ic_fso_type_executable.png"); - SDL_LoadImage(RENDERER, &icon_archive, "romfs:/res/images/ic_fso_type_compress.png"); - SDL_LoadImage(RENDERER, &icon_audio, "romfs:/res/images/ic_fso_type_audio.png"); - SDL_LoadImage(RENDERER, &icon_dir, "romfs:/res/images/ic_fso_folder.png"); - SDL_LoadImage(RENDERER, &icon_dir_dark, "romfs:/res/images/ic_fso_folder_dark.png"); - SDL_LoadImage(RENDERER, &icon_doc, "romfs:/res/images/ic_fso_type_document.png"); - SDL_LoadImage(RENDERER, &icon_file, "romfs:/res/images/ic_fso_default.png"); - SDL_LoadImage(RENDERER, &icon_image, "romfs:/res/images/ic_fso_type_image.png"); - SDL_LoadImage(RENDERER, &icon_text, "romfs:/res/images/ic_fso_type_text.png"); - SDL_LoadImage(RENDERER, &icon_check, "romfs:/res/images/btn_material_light_check_on_normal.png"); - SDL_LoadImage(RENDERER, &icon_check_dark, "romfs:/res/images/btn_material_light_check_on_normal_dark.png"); - SDL_LoadImage(RENDERER, &icon_uncheck, "romfs:/res/images/btn_material_light_check_off_normal.png"); - SDL_LoadImage(RENDERER, &icon_uncheck_dark, "romfs:/res/images/btn_material_light_check_off_normal_dark.png"); - SDL_LoadImage(RENDERER, &dialog, "romfs:/res/images/ic_material_dialog.png"); - SDL_LoadImage(RENDERER, &options_dialog, "romfs:/res/images/ic_material_options_dialog.png"); - SDL_LoadImage(RENDERER, &properties_dialog, "romfs:/res/images/ic_material_properties_dialog.png"); - SDL_LoadImage(RENDERER, &dialog_dark, "romfs:/res/images/ic_material_dialog_dark.png"); - SDL_LoadImage(RENDERER, &options_dialog_dark, "romfs:/res/images/ic_material_options_dialog_dark.png"); - SDL_LoadImage(RENDERER, &properties_dialog_dark, "romfs:/res/images/ic_material_properties_dialog_dark.png"); - SDL_LoadImage(RENDERER, &bg_header, "romfs:/res/images/bg_header.png"); - SDL_LoadImage(RENDERER, &icon_settings, "romfs:/res/images/ic_material_light_settings.png"); - SDL_LoadImage(RENDERER, &icon_sd, "romfs:/res/images/ic_material_light_sdcard.png"); - SDL_LoadImage(RENDERER, &icon_secure, "romfs:/res/images/ic_material_light_secure.png"); - SDL_LoadImage(RENDERER, &icon_settings_dark, "romfs:/res/images/ic_material_light_settings_dark.png"); - SDL_LoadImage(RENDERER, &icon_sd_dark, "romfs:/res/images/ic_material_light_sdcard_dark.png"); - SDL_LoadImage(RENDERER, &icon_secure_dark, "romfs:/res/images/ic_material_light_secure_dark.png"); - SDL_LoadImage(RENDERER, &icon_radio_off, "romfs:/res/images/btn_material_light_radio_off_normal.png"); - SDL_LoadImage(RENDERER, &icon_radio_on, "romfs:/res/images/btn_material_light_radio_on_normal.png"); - SDL_LoadImage(RENDERER, &icon_radio_dark_off, "romfs:/res/images/btn_material_light_radio_off_normal_dark.png"); - SDL_LoadImage(RENDERER, &icon_radio_dark_on, "romfs:/res/images/btn_material_light_radio_on_normal_dark.png"); - SDL_LoadImage(RENDERER, &icon_toggle_on, "romfs:/res/images/btn_material_light_toggle_on_normal.png"); - SDL_LoadImage(RENDERER, &icon_toggle_dark_on, "romfs:/res/images/btn_material_light_toggle_on_normal_dark.png"); - SDL_LoadImage(RENDERER, &icon_toggle_off, "romfs:/res/images/btn_material_light_toggle_off_normal.png"); - SDL_LoadImage(RENDERER, &default_artwork, "romfs:/res/images/default_artwork.png"); - SDL_LoadImage(RENDERER, &default_artwork_blur, "romfs:/res/images/default_artwork_blur.png"); - SDL_LoadImage(RENDERER, &btn_play, "romfs:/res/images/btn_playback_play.png"); - SDL_LoadImage(RENDERER, &btn_pause, "romfs:/res/images/btn_playback_pause.png"); - SDL_LoadImage(RENDERER, &btn_rewind, "romfs:/res/images/btn_playback_rewind.png"); - SDL_LoadImage(RENDERER, &btn_forward, "romfs:/res/images/btn_playback_forward.png"); - SDL_LoadImage(RENDERER, &btn_repeat, "romfs:/res/images/btn_playback_repeat.png"); - SDL_LoadImage(RENDERER, &btn_shuffle, "romfs:/res/images/btn_playback_shuffle.png"); - SDL_LoadImage(RENDERER, &btn_repeat_overlay, "romfs:/res/images/btn_playback_repeat_overlay.png"); - SDL_LoadImage(RENDERER, &btn_shuffle_overlay, "romfs:/res/images/btn_playback_shuffle_overlay.png"); - SDL_LoadImage(RENDERER, &icon_nav_drawer, "romfs:/res/images/ic_material_light_navigation_drawer.png"); - SDL_LoadImage(RENDERER, &icon_actions, "romfs:/res/images/ic_material_light_contextual_action.png"); - SDL_LoadImage(RENDERER, &icon_back, "romfs:/res/images/ic_arrow_back_normal.png"); - SDL_LoadImage(RENDERER, &icon_accept, "romfs:/res/images/ic_material_light_accept.png"); - SDL_LoadImage(RENDERER, &icon_accept_dark, "romfs:/res/images/ic_material_light_accept_dark.png"); - SDL_LoadImage(RENDERER, &icon_remove, "romfs:/res/images/ic_material_light_remove.png"); - SDL_LoadImage(RENDERER, &icon_remove_dark, "romfs:/res/images/ic_material_light_remove_dark.png");*/ - SDL_LoadImage(RENDERER, &battery_20, "romfs:/res/images/battery_20.png"); - SDL_LoadImage(RENDERER, &battery_20_charging, "romfs:/res/images/battery_20_charging.png"); - SDL_LoadImage(RENDERER, &battery_30, "romfs:/res/images/battery_30.png"); - SDL_LoadImage(RENDERER, &battery_30_charging, "romfs:/res/images/battery_30_charging.png"); - SDL_LoadImage(RENDERER, &battery_50, "romfs:/res/images/battery_50.png"); - SDL_LoadImage(RENDERER, &battery_50_charging, "romfs:/res/images/battery_50_charging.png"); - SDL_LoadImage(RENDERER, &battery_60, "romfs:/res/images/battery_60.png"); - SDL_LoadImage(RENDERER, &battery_60_charging, "romfs:/res/images/battery_60_charging.png"); - SDL_LoadImage(RENDERER, &battery_80, "romfs:/res/images/battery_80.png"); - SDL_LoadImage(RENDERER, &battery_80_charging, "romfs:/res/images/battery_80_charging.png"); - SDL_LoadImage(RENDERER, &battery_90, "romfs:/res/images/battery_90.png"); - SDL_LoadImage(RENDERER, &battery_90_charging, "romfs:/res/images/battery_90_charging.png"); - SDL_LoadImage(RENDERER, &battery_full, "romfs:/res/images/battery_full.png"); - SDL_LoadImage(RENDERER, &battery_full_charging, "romfs:/res/images/battery_full_charging.png"); - SDL_LoadImage(RENDERER, &battery_low, "romfs:/res/images/battery_low.png"); - SDL_LoadImage(RENDERER, &battery_unknown, "romfs:/res/images/battery_unknown.png"); - //SDL_LoadImage(RENDERER, &icon_lock, "romfs:/res/images/ic_material_dialog_fs_locked.png"); + SDL_LoadImage(RENDERER, &battery_20, "romfs:/battery_20.png"); + SDL_LoadImage(RENDERER, &battery_20_charging, "romfs:/battery_20_charging.png"); + SDL_LoadImage(RENDERER, &battery_30, "romfs:/battery_30.png"); + SDL_LoadImage(RENDERER, &battery_30_charging, "romfs:/battery_30_charging.png"); + SDL_LoadImage(RENDERER, &battery_50, "romfs:/battery_50.png"); + SDL_LoadImage(RENDERER, &battery_50_charging, "romfs:/battery_50_charging.png"); + SDL_LoadImage(RENDERER, &battery_60, "romfs:/battery_60.png"); + SDL_LoadImage(RENDERER, &battery_60_charging, "romfs:/battery_60_charging.png"); + SDL_LoadImage(RENDERER, &battery_80, "romfs:/battery_80.png"); + SDL_LoadImage(RENDERER, &battery_80_charging, "romfs:/battery_80_charging.png"); + SDL_LoadImage(RENDERER, &battery_90, "romfs:/battery_90.png"); + SDL_LoadImage(RENDERER, &battery_90_charging, "romfs:/battery_90_charging.png"); + SDL_LoadImage(RENDERER, &battery_full, "romfs:/battery_full.png"); + SDL_LoadImage(RENDERER, &battery_full_charging, "romfs:/battery_full_charging.png"); + SDL_LoadImage(RENDERER, &battery_low, "romfs:/battery_low.png"); + SDL_LoadImage(RENDERER, &battery_unknown, "romfs:/battery_unknown.png"); } -void Textures_Free(void) -{ - //SDL_DestroyTexture(icon_lock); +void Textures_Free(void) { SDL_DestroyTexture(battery_unknown); SDL_DestroyTexture(battery_low); SDL_DestroyTexture(battery_full_charging); @@ -90,54 +37,4 @@ void Textures_Free(void) SDL_DestroyTexture(battery_30); SDL_DestroyTexture(battery_20_charging); SDL_DestroyTexture(battery_20); - /*SDL_DestroyTexture(icon_remove_dark); - SDL_DestroyTexture(icon_remove); - SDL_DestroyTexture(icon_accept_dark); - SDL_DestroyTexture(icon_accept); - SDL_DestroyTexture(icon_back); - SDL_DestroyTexture(icon_actions); - SDL_DestroyTexture(icon_nav_drawer); - SDL_DestroyTexture(btn_shuffle_overlay); - SDL_DestroyTexture(btn_repeat_overlay); - SDL_DestroyTexture(btn_shuffle); - SDL_DestroyTexture(btn_repeat); - SDL_DestroyTexture(btn_forward); - SDL_DestroyTexture(btn_rewind); - SDL_DestroyTexture(btn_pause); - SDL_DestroyTexture(btn_play); - SDL_DestroyTexture(default_artwork_blur); - SDL_DestroyTexture(default_artwork); - SDL_DestroyTexture(icon_toggle_off); - SDL_DestroyTexture(icon_toggle_dark_on); - SDL_DestroyTexture(icon_toggle_on); - SDL_DestroyTexture(icon_radio_dark_on); - SDL_DestroyTexture(icon_radio_dark_off); - SDL_DestroyTexture(icon_radio_on); - SDL_DestroyTexture(icon_radio_off); - SDL_DestroyTexture(icon_secure_dark); - SDL_DestroyTexture(icon_sd_dark); - SDL_DestroyTexture(icon_settings_dark); - SDL_DestroyTexture(icon_secure); - SDL_DestroyTexture(icon_sd); - SDL_DestroyTexture(icon_settings); - SDL_DestroyTexture(bg_header); - SDL_DestroyTexture(properties_dialog_dark); - SDL_DestroyTexture(options_dialog_dark); - SDL_DestroyTexture(dialog_dark); - SDL_DestroyTexture(properties_dialog); - SDL_DestroyTexture(options_dialog); - SDL_DestroyTexture(dialog); - SDL_DestroyTexture(icon_uncheck_dark); - SDL_DestroyTexture(icon_uncheck); - SDL_DestroyTexture(icon_check_dark); - SDL_DestroyTexture(icon_check); - SDL_DestroyTexture(icon_text); - SDL_DestroyTexture(icon_image); - SDL_DestroyTexture(icon_file); - SDL_DestroyTexture(icon_doc); - SDL_DestroyTexture(icon_dir_dark); - SDL_DestroyTexture(icon_dir); - SDL_DestroyTexture(icon_audio); - SDL_DestroyTexture(icon_archive); - SDL_DestroyTexture(icon_app);*/ } \ No newline at end of file