diff --git a/Makefile b/Makefile index 4290dec69c84bcd7343955b8d3e1c7fe9b0f7b6d..db70caf4435afe813fbc265021493f43736c141d 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ CXXFLAGS := $(CFLAGS) -fexceptions -fno-rtti -fno-exceptions -std=gnu++17 -Wno-r ASFLAGS := -g $(ARCH) LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) -LIBS := -lminizip -lstdc++fs -lz -lfreetype -lSDL2_ttf -lSDL2_gfx -lSDL2_image -lSDL2 -lEGL -lGLESv2 -lglapi -ldrm_nouveau -lwebp -lpng -ljpeg `sdl2-config --libs` `freetype-config --libs` -lnx` +LIBS := -lminizip -lstdc++fs -lz -lfreetype -lSDL2_ttf -lSDL2_gfx -lSDL2_image -lSDL2 -lEGL -lGLESv2 -lglapi -ldrm_nouveau -lwebp -lpng -ljpeg `sdl2-config --libs` `freetype-config --libs` -lnx #--------------------------------------------------------------------------------- # list of directories containing libraries, this must be the top level containing diff --git a/include/Cursor.hpp b/include/Cursor.hpp index 380fc605e5782905f86bd2dbf25e9f1923fc0b45..0e991fbb060ddbfbba4bf1e6e252699896e114e8 100644 --- a/include/Cursor.hpp +++ b/include/Cursor.hpp @@ -17,6 +17,7 @@ private: int column = 0; SDL_Rect rectCursor {0, 0, 0, 0}; void moveCursorX(bool right); + void cursorRecenter(); void refreshPos(); public: diff --git a/include/RenderWindow.hpp b/include/RenderWindow.hpp index 2a7bf83cade07920319ad9fce163ab22997ead11..e78936cc711df465a37fc41829fb42ab271bb7d3 100644 --- a/include/RenderWindow.hpp +++ b/include/RenderWindow.hpp @@ -36,6 +36,8 @@ public: int horizontal = 0; int vertical = 0; + void renderCursorCircle(int column); + void drawCircleBehindIcons(); private: diff --git a/source/cursor.cpp b/source/cursor.cpp index 15f24c02fd6b23dd95a02988612ec6cc442b8ad1..68cdb9dcf60d90ae311ed566f56f207593b315d8 100644 --- a/source/cursor.cpp +++ b/source/cursor.cpp @@ -87,17 +87,39 @@ bool Cursor::checkInputCursor(int value) return false; } -void Cursor::printCursor(RenderWindow render) +void Cursor::cursorRecenter() { - if (column > 3){ - column = 0; + if (line == 0){ + if (column > 3){ + column = 0; + } + if (column < 0){ + column = 3; + } } - if (column < 0){ - column = 3; + + if (line == 1){ + if (column > 1){ + column = 0; + } + if (column < 0){ + column = 1; + } } +} + +void Cursor::printCursor(RenderWindow render) +{ + cursorRecenter(); refreshPos(); - rectCursor = {posX, posY, cursorWandH, cursorWandH}; - render.renderRect(rectCursor); + if (line == 0){ + rectCursor = {posX, posY, cursorWandH, cursorWandH}; + render.renderRect(rectCursor); + } + + else if (line == 1){ + render.renderCursorCircle(column); + } } void Cursor::refreshPos(){ @@ -113,3 +135,5 @@ void Cursor::refreshPos(){ + + diff --git a/source/menu.cpp b/source/menu.cpp index a64af5283bbe5d90d7f71d22402e79603bb266dc..c9375778f654978cd9d80f65fa0e31b9b0a5ebe6 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -83,7 +83,6 @@ void Menu::printMenu() vEntity.push_back(Entity (Vector2f(horizontal / 2 + size.x * 0.5, 550), tInfo, size.x, size.y, 0, 0)); - for (auto i : vEntity) { window.render(i, 1); diff --git a/source/renderWindow.cpp b/source/renderWindow.cpp index 87755a10ca8a21ed1da04cd842674c9229dac117..b70e6735bcee872534adfa38b9a876042da9dfb6 100644 --- a/source/renderWindow.cpp +++ b/source/renderWindow.cpp @@ -103,7 +103,7 @@ void RenderWindow::renderRect(SDL_Rect rect) rectangleRGBA(renderer, cursor.getPosX() + 258 + i, cursor.getPosY() - i, cursor.getPosX() - i, cursor.getPosY() + 258 + i, 25, 145, 218, 255); }*/ - SDL_SetRenderDrawColor(renderer, 25, 145, 218, 255); + SDL_SetRenderDrawColor(renderer, 3, 194, 195, 255); for (int i = 0; i < 5; ++i){ rect.w += 2; rect.h += 2; @@ -118,4 +118,12 @@ void RenderWindow::drawCircleBehindIcons() { filledCircleRGBA(renderer, 1280 / 2 + 50, 575, 38, 80, 80, 80, 255); filledCircleRGBA(renderer, 1280 / 2 - 50, 575, 38, 80, 80, 80, 255); -} \ No newline at end of file +} + +void RenderWindow::renderCursorCircle(int column) +{ + for (int i = 0; i < 6; ++i){ + circleRGBA(renderer, 552 + column * (100) + 38, 575, 38 + i, 3, 194, 195, 255); + } +} +