document warnings that i cannot handle on my own

This commit is contained in:
toxie 2021-10-17 19:32:34 +02:00
parent 51b637a5e3
commit efd4dc1d9e
5 changed files with 12 additions and 13 deletions

View File

@ -37,7 +37,7 @@ void TPlunger::Collision(TBall* ball, vector_type* nextPosition, vector_type* di
{
if (PinballTable->TiltLockFlag)
Message(1017, 0.0);
coef = RandFloat() * Boost * 0.1f + Boost;
coef = RandFloat() * Boost * 0.1f + Boost; //!! passed in coef is never used
maths::basic_collision(ball, nextPosition, direction, Elasticity, Smoothness, Threshold, coef);
}
@ -109,7 +109,7 @@ int TPlunger::Message(int code, float value)
if (PullbackTimer_)
timer::kill(PullbackTimer_);
PullbackTimer_ = 0;
if (code == 1005)
if (code == 1005) //!!
loader::play_sound(SoundIndexP2);
auto bmp = ListBitmap->at(0);
auto zMap = ListZMap->at(0);

View File

@ -1019,7 +1019,7 @@ void control::LaunchRampControl(int code, TPinballComponent* caller)
{
sound = control_soundwave21_tag.Component;
}
else if (someFlag <= 1 || someFlag > 3)
else if (someFlag <= 1 || someFlag > 3) //!! <1 ?
{
sound = control_soundwave24_tag.Component;
}
@ -2148,7 +2148,7 @@ void control::HyperspaceKickOutControl(int code, TPinballComponent* caller)
}
else
{
if (someFlag <= 1 || someFlag > 3)
if (someFlag <= 1 || someFlag > 3) //!! <1 ?
{
auto duration = control_soundwave41_tag.Component->Play();
control_soundwave36_1_tag.Component->Play();
@ -2919,7 +2919,7 @@ void control::GameoverController(int code, TPinballComponent* caller)
if (missionMsg & 0x200)
{
int highscoreId = missionMsg % 4;
int highscoreId = missionMsg % 4; //!! %5 ?
int highScore = pb::highscore_table[highscoreId].Score;
auto nextHidhscoreId = highscoreId + 1;
if (highScore > 0)
@ -3923,9 +3923,7 @@ void control::SelectMissionController(int code, TPinballComponent* caller)
if (light_on(&control_lite319_tag))
control_lite319_tag.Component->Message(20, 0.0);
if (!light_on(&control_lite317_tag))
{
control_lite317_tag.Component->Message(7, 0.0);
}
}
else
{
@ -4158,6 +4156,7 @@ void control::TimeWarpPartTwoController(int code, TPinballComponent* caller)
control_lite317_tag.Component->Message(20, 0.0);
control_lite198_tag.Component->MessageField = 1;
MissionControl(66, nullptr);
//!! Display score?
}
void control::UnselectMissionController(int code, TPinballComponent* caller)

View File

@ -58,7 +58,7 @@ int fullscrn::enableFullscreen()
if (!display_changed)
{
SDL_SetWindowFullscreen(winmain::MainWindow, SDL_WINDOW_FULLSCREEN_DESKTOP);
display_changed = 1;
display_changed = 1; //!!
if (display_changed)
return 1;
}

View File

@ -318,5 +318,5 @@ std::vector<uint8_t>* midi::MdsToMidi(std::string file)
delete[] fileBuf;
if (returnCode && midiOut)
delete midiOut;
return midiOut;
return midiOut; //!! could be already deleted
}

View File

@ -19,7 +19,7 @@ int winmain::bQuit = 0;
int winmain::activated;
int winmain::DispFrameRate = 0;
int winmain::DispGRhistory = 0;
int winmain::single_step = 0;
int winmain::single_step = 0; //!! is constant
int winmain::has_focus = 1;
int winmain::last_mouse_x;
int winmain::last_mouse_y;
@ -180,7 +180,7 @@ int winmain::WinMain(LPCSTR lpCmdLine)
if (!gfr_display)
{
auto plt = static_cast<ColorRgba*>(malloc(1024u));
auto pltPtr = &plt[10];
auto pltPtr = &plt[10]; // first 10 entries are system colors hardcoded in display_palette()
for (int i1 = 0, i2 = 0; i1 < 256 - 10; ++i1, i2 += 8)
{
unsigned char blue = i2, redGreen = i2;
@ -215,8 +215,8 @@ int winmain::WinMain(LPCSTR lpCmdLine)
int x, y, w, h;
SDL_GetMouseState(&x, &y);
SDL_GetWindowSize(window, &w, &h);
float dx = (last_mouse_x - x) / static_cast<float>(w);
float dy = (y - last_mouse_y) / static_cast<float>(h);
float dx = static_cast<float>(last_mouse_x - x) / static_cast<float>(w);
float dy = static_cast<float>(y - last_mouse_y) / static_cast<float>(h);
pb::ballset(dx, dy);
SDL_WarpMouseInWindow(window, last_mouse_x, last_mouse_y);