mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 22:33:43 -07:00
Fix implicit conversion warnings in BossRush, Mouse, and UIWidgets.hpp.
This commit is contained in:
parent
049bf69e58
commit
7a745a4b97
3 changed files with 13 additions and 13 deletions
|
@ -111,7 +111,7 @@ const char* BossRush_GetSettingChoiceName(u8 optionIndex, u8 choiceIndex, u8 lan
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 BossRush_GetSettingOptionsAmount(u8 optionIndex) {
|
u8 BossRush_GetSettingOptionsAmount(u8 optionIndex) {
|
||||||
return BossRushOptions[optionIndex].choices.size();
|
return (u8)BossRushOptions[optionIndex].choices.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BossRush_SpawnBlueWarps(PlayState* play) {
|
void BossRush_SpawnBlueWarps(PlayState* play) {
|
||||||
|
@ -311,7 +311,7 @@ void BossRush_HandleCompleteBoss(PlayState* play) {
|
||||||
play->sceneNum == SCENE_GANON_BOSS) {
|
play->sceneNum == SCENE_GANON_BOSS) {
|
||||||
gSaveContext.ship.stats.playTimer += 2;
|
gSaveContext.ship.stats.playTimer += 2;
|
||||||
gSaveContext.ship.stats.gameComplete = 1;
|
gSaveContext.ship.stats.gameComplete = 1;
|
||||||
gSaveContext.ship.stats.itemTimestamp[TIMESTAMP_BOSSRUSH_FINISH] = GAMEPLAYSTAT_TOTAL_TIME;
|
gSaveContext.ship.stats.itemTimestamp[TIMESTAMP_BOSSRUSH_FINISH] = (uint32_t)GAMEPLAYSTAT_TOTAL_TIME;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,8 +50,8 @@ void Mouse_HandleFirstPerson(Player* player) {
|
||||||
: 1;
|
: 1;
|
||||||
s8 invertYAxisMulti = CVarGetInteger(CVAR_SETTING("Controls.InvertAimingYAxis"), 1) ? 1 : -1;
|
s8 invertYAxisMulti = CVarGetInteger(CVAR_SETTING("Controls.InvertAimingYAxis"), 1) ? 1 : -1;
|
||||||
if (MOUSE_ENABLED) {
|
if (MOUSE_ENABLED) {
|
||||||
player->actor.focus.rot.y -= mouseCoordRel.x * 6.0f * xAxisMulti * invertXAxisMulti;
|
player->actor.focus.rot.y -= (int16_t)(mouseCoordRel.x * 6.0f * xAxisMulti * invertXAxisMulti);
|
||||||
player->actor.focus.rot.x += mouseCoordRel.y * 6.0f * yAxisMulti * invertYAxisMulti;
|
player->actor.focus.rot.x += (int16_t)(mouseCoordRel.y * 6.0f * yAxisMulti * invertYAxisMulti);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,8 +78,8 @@ void Mouse_HandleShield(f32* sp50, f32* sp54) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static s8 iterMouse = 0;
|
static s8 iterMouse = 0;
|
||||||
static f32 mouseQuickspinX[5] = {};
|
static s32 mouseQuickspinX[5] = {};
|
||||||
static f32 mouseQuickspinY[5] = {};
|
static s32 mouseQuickspinY[5] = {};
|
||||||
static u8 quickspinCount = 0;
|
static u8 quickspinCount = 0;
|
||||||
|
|
||||||
void Mouse_UpdateQuickspinCount() {
|
void Mouse_UpdateQuickspinCount() {
|
||||||
|
@ -102,9 +102,9 @@ bool Mouse_HandleQuickspin(bool* should, s8* iter2, s8* sp3C) {
|
||||||
|
|
||||||
for (i = 0; i < 4; i++, iter2++) {
|
for (i = 0; i < 4; i++, iter2++) {
|
||||||
// Calculating angles as per z_lib.c:func_80077D10()
|
// Calculating angles as per z_lib.c:func_80077D10()
|
||||||
f32 relY = mouseQuickspinY[i + 1] - mouseQuickspinY[i];
|
s32 relY = mouseQuickspinY[i + 1] - mouseQuickspinY[i];
|
||||||
f32 relX = mouseQuickspinX[i + 1] - mouseQuickspinX[i];
|
s32 relX = mouseQuickspinX[i + 1] - mouseQuickspinX[i];
|
||||||
s16 aTan = Math_Atan2S(relY, -relX);
|
s16 aTan = Math_Atan2S((f32)relY, (f32)-relX);
|
||||||
iterMouse = (u16)(aTan + 0x2000) >> 9; // See z_player.c:Player_ProcessControlStick()
|
iterMouse = (u16)(aTan + 0x2000) >> 9; // See z_player.c:Player_ProcessControlStick()
|
||||||
if ((*iter2 = iterMouse) < 0) {
|
if ((*iter2 = iterMouse) < 0) {
|
||||||
return *should = false;
|
return *should = false;
|
||||||
|
|
|
@ -606,9 +606,9 @@ bool Combobox(const char* label, T* value, const std::vector<const char*>& combo
|
||||||
PushStyleCombobox(options.color);
|
PushStyleCombobox(options.color);
|
||||||
|
|
||||||
const char* longest;
|
const char* longest;
|
||||||
int length = 0;
|
size_t length = 0;
|
||||||
for (auto& string : comboVector) {
|
for (auto& string : comboVector) {
|
||||||
int len = strlen(string);
|
size_t len = strlen(string);
|
||||||
if (len > length) {
|
if (len > length) {
|
||||||
longest = string;
|
longest = string;
|
||||||
length = len;
|
length = len;
|
||||||
|
@ -690,9 +690,9 @@ bool Combobox(const char* label, T* value, const std::vector<std::string>& combo
|
||||||
PushStyleCombobox(options.color);
|
PushStyleCombobox(options.color);
|
||||||
|
|
||||||
const char* longest;
|
const char* longest;
|
||||||
int length = 0;
|
size_t length = 0;
|
||||||
for (auto& string : comboVector) {
|
for (auto& string : comboVector) {
|
||||||
int len = string.length();
|
size_t len = string.length();
|
||||||
if (len > length) {
|
if (len > length) {
|
||||||
longest = string.c_str();
|
longest = string.c_str();
|
||||||
length = len;
|
length = len;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue