Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
usineur committed Sep 26, 2020
1 parent 520528c commit 21f9147
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 26 deletions.
7 changes: 2 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions monsters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int32_t>(m->goalPosBounds_x1, walkPath->coords[1][1] + vf);
int va = MIN<int32_t>(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;
Expand Down
16 changes: 0 additions & 16 deletions sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down

0 comments on commit 21f9147

Please sign in to comment.