Moving things around

This commit is contained in:
SeanOMik 2019-09-02 19:01:34 -05:00
parent 787893c0bc
commit a1867f00ef
26 changed files with 36 additions and 43 deletions

View File

@ -39,9 +39,9 @@ include $(DEVKITPRO)/libnx/switch_rules
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
TARGET := $(notdir $(CURDIR)) TARGET := $(notdir $(CURDIR))
BUILD := build BUILD := build
SOURCES := source source/menus/book source/menus/book-chooser SOURCES := source source/menus/book source/menus/book-chooser source/helpers
DATA := data DATA := data
INCLUDES := include include/menus/book include/menus/book-chooser INCLUDES := include include/menus/book include/menus/book-chooser include/helpers
ROMFS := romfs ROMFS := romfs
VERSION_MAJOR := 0 VERSION_MAJOR := 0
@ -67,11 +67,7 @@ CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
ASFLAGS := -g $(ARCH) ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) 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 -lfreetype -lz -lnx
LIBS := -lstdc++fs `sdl2-config --libs` -lSDL2_ttf -lSDL2_image -lfreetype -lpng -ljpeg -lwebp -lz -lbz2 -ltwili -lnx -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 # list of directories containing libraries, this must be the top level containing
@ -79,7 +75,6 @@ LIBS := -lstdc++fs `sdl2-config --libs` -lSDL2_ttf -lSDL2_image -lfreetype -
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
LIBDIRS := $(PORTLIBS) $(LIBNX) LIBDIRS := $(PORTLIBS) $(LIBNX)
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional # no real need to edit anything past this point unless you need to add additional
# rules for different file extensions # rules for different file extensions

View File

@ -3,7 +3,7 @@
#include <SDL2/SDL.h> #include <SDL2/SDL.h>
#include <SDL2/SDL_ttf.h> #include <SDL2/SDL_ttf.h>
#include "SDL_helper.h" //#include "SDL_helper.h"
extern SDL_Window *WINDOW; extern SDL_Window *WINDOW;
extern SDL_Surface *WINDOW_SURFACE; extern SDL_Surface *WINDOW_SURFACE;

View File

@ -4,27 +4,25 @@
#include <SDL2/SDL.h> #include <SDL2/SDL.h>
#include <SDL2/SDL_ttf.h> #include <SDL2/SDL_ttf.h>
static inline SDL_Color SDL_MakeColour(Uint8 r, Uint8 g, Uint8 b, Uint8 a) static inline SDL_Color SDL_MakeColour(Uint8 r, Uint8 g, Uint8 b, Uint8 a) {
{
SDL_Color colour = {r, g, b, a}; SDL_Color colour = {r, g, b, a};
return colour; return colour;
} }
#define WHITE SDL_MakeColour(255, 255, 255, 255) #define WHITE SDL_MakeColour(255, 255, 255, 255)
#define VERY_LIGHT_GRAY SDL_MakeColour(222, 222, 222, 255) #define BLACK SDL_MakeColour(0, 0, 0, 255)
#define LIGHT_GRAY SDL_MakeColour(181, 181, 181, 255) #define LIGHT_GRAY SDL_MakeColour(181, 181, 181, 255)
#define DARK_GRAY SDL_MakeColour(148, 148, 148, 255) #define DARK_GRAY SDL_MakeColour(148, 148, 148, 255)
#define BLACK_BG SDL_MakeColour(48, 48, 48, 255) #define BLACK_BG SDL_MakeColour(48, 48, 48, 255)
#define STATUS_BAR_LIGHT SDL_MakeColour(37, 79, 174, 255) #define STATUS_BAR_LIGHT SDL_MakeColour(240, 43, 43, 255)
#define STATUS_BAR_DARK SDL_MakeColour(38, 50, 56, 255) #define STATUS_BAR_DARK SDL_MakeColour(163, 20, 20, 255)
#define MENU_BAR_LIGHT SDL_MakeColour(51, 103, 214, 255) #define MENU_BAR_LIGHT SDL_MakeColour(240, 43, 43, 255)
#define MENU_BAR_DARK SDL_MakeColour(55, 71, 79, 255) #define MENU_BAR_DARK SDL_MakeColour(163, 20, 20, 255)
#define BLACK SDL_MakeColour(0, 0, 0, 255) #define TEXT_MIN_COLOUR_LIGHT SDL_MakeColour(32, 32, 32, 255)
#define SELECTOR_COLOUR_LIGHT SDL_MakeColour(241, 241, 241, 255) #define SELECTOR_COLOUR_LIGHT SDL_MakeColour(241, 241, 241, 255)
#define SELECTOR_COLOUR_DARK SDL_MakeColour(76, 76, 76, 255) #define SELECTOR_COLOUR_DARK SDL_MakeColour(76, 76, 76, 255)
#define TITLE_COLOUR SDL_MakeColour(30, 136, 229, 255) #define TITLE_COLOUR SDL_MakeColour(30, 136, 229, 255)
#define TITLE_COLOUR_DARK SDL_MakeColour(0, 150, 136, 255) #define TITLE_COLOUR_DARK SDL_MakeColour(0, 150, 136, 255)
#define TEXT_MIN_COLOUR_LIGHT SDL_MakeColour(32, 32, 32, 255)
#define TEXT_MIN_COLOUR_DARK SDL_MakeColour(185, 185, 185, 255) #define TEXT_MIN_COLOUR_DARK SDL_MakeColour(185, 185, 185, 255)
#define BAR_COLOUR SDL_MakeColour(200, 200, 200, 255) #define BAR_COLOUR SDL_MakeColour(200, 200, 200, 255)

View File

@ -1,5 +1,5 @@
#ifndef NX_SHELL_TEXTURES_H #ifndef EBOOK_READER_TEXTURES_H
#define NX_SHELL_TEXTURES_H #define EBOOK_READER_TEXTURES_H
#include <SDL2/SDL.h> #include <SDL2/SDL.h>

View File

Before

Width:  |  Height:  |  Size: 257 B

After

Width:  |  Height:  |  Size: 257 B

View File

Before

Width:  |  Height:  |  Size: 517 B

After

Width:  |  Height:  |  Size: 517 B

View File

Before

Width:  |  Height:  |  Size: 263 B

After

Width:  |  Height:  |  Size: 263 B

View File

Before

Width:  |  Height:  |  Size: 529 B

After

Width:  |  Height:  |  Size: 529 B

View File

Before

Width:  |  Height:  |  Size: 263 B

After

Width:  |  Height:  |  Size: 263 B

View File

Before

Width:  |  Height:  |  Size: 527 B

After

Width:  |  Height:  |  Size: 527 B

View File

Before

Width:  |  Height:  |  Size: 263 B

After

Width:  |  Height:  |  Size: 263 B

View File

Before

Width:  |  Height:  |  Size: 560 B

After

Width:  |  Height:  |  Size: 560 B

View File

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 264 B

View File

Before

Width:  |  Height:  |  Size: 578 B

After

Width:  |  Height:  |  Size: 578 B

View File

Before

Width:  |  Height:  |  Size: 263 B

After

Width:  |  Height:  |  Size: 263 B

View File

Before

Width:  |  Height:  |  Size: 556 B

After

Width:  |  Height:  |  Size: 556 B

View File

Before

Width:  |  Height:  |  Size: 263 B

After

Width:  |  Height:  |  Size: 263 B

View File

Before

Width:  |  Height:  |  Size: 534 B

After

Width:  |  Height:  |  Size: 534 B

View File

Before

Width:  |  Height:  |  Size: 295 B

After

Width:  |  Height:  |  Size: 295 B

View File

Before

Width:  |  Height:  |  Size: 551 B

After

Width:  |  Height:  |  Size: 551 B

View File

@ -1,5 +1,5 @@
#include "SDL_helper.h"
#include "common.h" #include "common.h"
#include "SDL_helper.h"
void SDL_ClearScreen(SDL_Renderer *renderer, SDL_Color colour) { void SDL_ClearScreen(SDL_Renderer *renderer, SDL_Color colour) {
SDL_SetRenderDrawColor(renderer, colour.r, colour.g, colour.b, colour.a); SDL_SetRenderDrawColor(renderer, colour.r, colour.g, colour.b, colour.a);

View File

@ -84,7 +84,7 @@ void Init_Services() {
Textures_Load(); Textures_Load();
std::cout << "Loaded Textures" << std::endl;*/ std::cout << "Loaded Textures" << std::endl;*/
ARIAL = TTF_OpenFont("romfs:/arial.ttf", 35); ARIAL = TTF_OpenFont("romfs:/resources/images/arial.ttf", 35);
if (!ARIAL) { if (!ARIAL) {
Term_Services(); Term_Services();
} }

View File

@ -71,7 +71,7 @@ void Menu_StartChoosing() {
string extention = filename.substr(filename.length() - 3); string extention = filename.substr(filename.length() - 3);
if (extention == "pdf") { if (extention == "pdf") {
if (choosenIndex == space_index) { if (choosenIndex == space_index) {
SDL_DrawRect(RENDERER, 15, 20 + (40 * space_index), 1265, 40, VERY_LIGHT_GRAY); SDL_DrawRect(RENDERER, 15, 20 + (40 * space_index), 1265, 40, SELECTOR_COLOUR_LIGHT);
} }
SDL_DrawText(RENDERER, ARIAL, 20, 20 + (40 * space_index), BLACK, entry.path().filename().c_str()); SDL_DrawText(RENDERER, ARIAL, 20, 20 + (40 * space_index), BLACK, entry.path().filename().c_str());

View File

@ -5,11 +5,11 @@
#include <algorithm> #include <algorithm>
//#include <libconfig.h> //#include <libconfig.h>
extern "C" { //extern "C" {
#include "SDL_helper.h" #include "SDL_helper.h"
#include "status_bar.h" #include "status_bar.h"
//#include "config.h" //#include "config.h"
} //}
fz_context *ctx = NULL; fz_context *ctx = NULL;
/*config_t *config = NULL; /*config_t *config = NULL;
@ -131,7 +131,7 @@ void BookReader::draw() {
/*if (config_dark_theme == true) /*if (config_dark_theme == true)
SDL_ClearScreen(RENDERER, SDL_MakeColour(33, 39, 43, 255)); SDL_ClearScreen(RENDERER, SDL_MakeColour(33, 39, 43, 255));
else */ else */
SDL_ClearScreen(RENDERER, SDL_MakeColour(255, 255, 255, 255)); SDL_ClearScreen(RENDERER, WHITE);
SDL_RenderClear(RENDERER); SDL_RenderClear(RENDERER);

View File

@ -3,22 +3,22 @@
#include "SDL_helper.h" #include "SDL_helper.h"
void Textures_Load(void) { void Textures_Load(void) {
SDL_LoadImage(RENDERER, &battery_20, "romfs:/battery_20.png"); SDL_LoadImage(RENDERER, &battery_20, "romfs:/resources/images/resources/images/battery_20.png");
SDL_LoadImage(RENDERER, &battery_20_charging, "romfs:/battery_20_charging.png"); SDL_LoadImage(RENDERER, &battery_20_charging, "romfs:/resources/images/battery_20_charging.png");
SDL_LoadImage(RENDERER, &battery_30, "romfs:/battery_30.png"); SDL_LoadImage(RENDERER, &battery_30, "romfs:/resources/images/battery_30.png");
SDL_LoadImage(RENDERER, &battery_30_charging, "romfs:/battery_30_charging.png"); SDL_LoadImage(RENDERER, &battery_30_charging, "romfs:/resources/images/battery_30_charging.png");
SDL_LoadImage(RENDERER, &battery_50, "romfs:/battery_50.png"); SDL_LoadImage(RENDERER, &battery_50, "romfs:/resources/images/battery_50.png");
SDL_LoadImage(RENDERER, &battery_50_charging, "romfs:/battery_50_charging.png"); SDL_LoadImage(RENDERER, &battery_50_charging, "romfs:/resources/images/battery_50_charging.png");
SDL_LoadImage(RENDERER, &battery_60, "romfs:/battery_60.png"); SDL_LoadImage(RENDERER, &battery_60, "romfs:/resources/images/battery_60.png");
SDL_LoadImage(RENDERER, &battery_60_charging, "romfs:/battery_60_charging.png"); SDL_LoadImage(RENDERER, &battery_60_charging, "romfs:/resources/images/battery_60_charging.png");
SDL_LoadImage(RENDERER, &battery_80, "romfs:/battery_80.png"); SDL_LoadImage(RENDERER, &battery_80, "romfs:/resources/images/battery_80.png");
SDL_LoadImage(RENDERER, &battery_80_charging, "romfs:/battery_80_charging.png"); SDL_LoadImage(RENDERER, &battery_80_charging, "romfs:/resources/images/battery_80_charging.png");
SDL_LoadImage(RENDERER, &battery_90, "romfs:/battery_90.png"); SDL_LoadImage(RENDERER, &battery_90, "romfs:/resources/images/battery_90.png");
SDL_LoadImage(RENDERER, &battery_90_charging, "romfs:/battery_90_charging.png"); SDL_LoadImage(RENDERER, &battery_90_charging, "romfs:/resources/images/battery_90_charging.png");
SDL_LoadImage(RENDERER, &battery_full, "romfs:/battery_full.png"); SDL_LoadImage(RENDERER, &battery_full, "romfs:/resources/images/battery_full.png");
SDL_LoadImage(RENDERER, &battery_full_charging, "romfs:/battery_full_charging.png"); SDL_LoadImage(RENDERER, &battery_full_charging, "romfs:/resources/images/battery_full_charging.png");
SDL_LoadImage(RENDERER, &battery_low, "romfs:/battery_low.png"); SDL_LoadImage(RENDERER, &battery_low, "romfs:/resources/images/battery_low.png");
SDL_LoadImage(RENDERER, &battery_unknown, "romfs:/battery_unknown.png"); SDL_LoadImage(RENDERER, &battery_unknown, "romfs:/resources/images/battery_unknown.png");
} }
void Textures_Free(void) { void Textures_Free(void) {