[WIP] Fixed courses and started entity system

This commit is contained in:
KiritoDv 2021-05-04 21:55:57 +00:00
parent 86ad2e0921
commit e17ce2bc49
5 changed files with 13 additions and 6 deletions

View File

@ -272,6 +272,9 @@ SRC_DIRS += src/moon/ui src/moon/ui/interfaces src/moon/ui/screens src/moon/ui/s
# Moon64 SRC [IO] Directories
SRC_DIRS += src/moon/io src/moon/io/modules
# Moon64 SRC [Entity] Directories
SRC_DIRS += src/moon/entity src/moon/entity/interfaces
# RapidJSON Library
SRC_DIRS += src/moon/libs/rapidjson src/moon/libs/rapidjson/error src/moon/libs/rapidjson/internal src/moon/libs/rapidjson/msinttypes

View File

View File

@ -0,0 +1,4 @@
#ifndef MoonEntityInterface
#define MoonEntityInterface
#endif

View File

@ -1,6 +1,6 @@
#include "mouse-io.h"
#ifdef WAPI_SDL2
#ifndef WAPI_SDL2
#include <SDL2/SDL.h>
#endif
@ -29,10 +29,10 @@ void MouseIO::update(){
state = SDL_GetMouseState(&this->xLocalPos, &this->yLocalPos);
SDL_GetGlobalMouseState(&this->xGlobalPos, &this->yGlobalPos);
#elif defined(WAPI_DXGI)
//TODO: Implement directx hook
#endif
}
bool MouseIO::isBtnPressed(MouseBtn btn){
return (state & (btn == 0 ? SDL_BUTTON_LMASK : SDL_BUTTON_RMASK));
return state & (int) btn;
}

View File

@ -183,7 +183,7 @@ static void set_state(void) {
// when exiting a stage the act doesn't get reset
if (gCurrActNum && gCurrCourseNum) {
// any stage over 19 is a special stage without acts
if (gCurrCourseNum < 19) {
if (gCurrCourseNum < COURSE_STAGES_MAX) {
void **actNameTbl;
#ifndef VERSION_EU
actNameTbl = segmented_to_virtual(seg2_act_name_table);
@ -207,7 +207,7 @@ static void set_state(void) {
act[0] = '\0';
gCurrActNum = 0;
}
} else {
} else {
act[0] = '\0';
}
@ -218,7 +218,7 @@ static void set_state(void) {
void set_logo(void) {
if (lastCourseNum)
snprintf(largeImageKey, sizeof(largeImageKey), "%d", lastCourseNum);
else
else
strcpy(largeImageKey, "0");
/*