diff --git a/CMakeLists.txt b/CMakeLists.txt index 30d41b4..12e0b3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,10 +25,7 @@ target_link_libraries(${CMAKE_PROJECT_NAME} ${SDL2_STATIC_LIBRARIES} ) -if(SWITCH_LIBNX) - set(CMAKE_C_FLAGS "-O2 -ffunction-sections -fdata-sections -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE -ftls-model=local-exec") - set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}") - include_directories($ENV{DEVKITPRO}/libnx/include) +if(NSWITCH) add_definitions(-D__SWITCH__) add_custom_target(${CMAKE_PROJECT_NAME}.nro DEPENDS ${CMAKE_PROJECT_NAME} @@ -39,7 +36,7 @@ if(SWITCH_LIBNX) COMMAND nxlink -a $(SWITCHIP) ${CMAKE_PROJECT_NAME}.nro -s -p ${CMAKE_PROJECT_NAME}/${CMAKE_PROJECT_NAME}.nro DEPENDS ${CMAKE_PROJECT_NAME}.nro ) -endif(SWITCH_LIBNX) +endif(NSWITCH) if(VITA) include("${VITASDK}/share/vita.cmake" REQUIRED) diff --git a/monsters.cpp b/monsters.cpp index fb53847..c24e7b4 100644 --- a/monsters.cpp +++ b/monsters.cpp @@ -2655,13 +2655,8 @@ int Game::mstUpdateTaskMonsterObject1(Task *t) { if ((m->monsterInfos[946] & 2) == 0) { MstWalkNode *walkPath = m->walkNode; int vf = (int32_t)READ_LE_UINT32(m->monsterInfos + 904); -#ifdef __vita__ - int vb = MAX(m->goalPosBounds_x1, walkPath->coords[1][1] + vf); - int va = MIN(m->goalPosBounds_x2, walkPath->coords[0][1] - vf); -#else int vb = MAX(m->goalPosBounds_x1, walkPath->coords[1][1] + vf); int va = MIN(m->goalPosBounds_x2, walkPath->coords[0][1] - vf); -#endif const uint32_t indexUnk36 = walkPath->movingBoundsIndex2; const uint32_t indexUnk49 = _res->_mstMovingBoundsIndexData[indexUnk36].indexUnk49; uint8_t _bl = _res->_mstMovingBoundsData[indexUnk49].unk14; diff --git a/sound.cpp b/sound.cpp index 29d32bc..6e9eb12 100644 --- a/sound.cpp +++ b/sound.cpp @@ -837,11 +837,7 @@ SssObject *Game::startSoundObject(int bankIndex, int sampleIndex, uint32_t flags if (sample->framesCount != 0) { SssFilter *filter = &_res->_sssFilters[bank->sssFilter]; -#ifdef __vita__ - const int priority = CLIP(filter->priorityCurrent + sample->initPriority, 0l, 7l); -#else const int priority = CLIP(filter->priorityCurrent + sample->initPriority, 0, 7); -#endif uint32_t flags1 = flags & 0xFFF0F000; flags1 |= ((sampleIndex & 0xF) << 16) | (bankIndex & 0xFFF); SssObject *so = addSoundObject(pcm, priority, flags1, flags); @@ -1051,21 +1047,13 @@ void Game::setSoundObjectPanning(SssObject *so) { int volume = ((so->filter->volumeCurrent >> 16) * so->volume) >> 7; int panning = 0; if (so->panningPtr) { -#ifdef __vita__ - int priority = CLIP(so->priority + so->filter->priorityCurrent, 0l, 7l); -#else int priority = CLIP(so->priority + so->filter->priorityCurrent, 0, 7); -#endif if (so->panning == -2) { volume = 0; panning = kDefaultSoundPanning; priority = 0; } else { -#ifdef __vita__ - panning = CLIP(so->panning, 0l, 128l); -#else panning = CLIP(so->panning, 0, 128); -#endif volume >>= 2; priority /= 2; } @@ -1076,11 +1064,7 @@ void Game::setSoundObjectPanning(SssObject *so) { } } } else { -#ifdef __vita__ - panning = CLIP(so->panning + (so->filter->panningCurrent >> 16), 0l, 128l); -#else panning = CLIP(so->panning + (so->filter->panningCurrent >> 16), 0, 128); -#endif } if (so->pcm == 0) { return;