From b3af6a0473d091cc8dee04aecc2c25b293a7e22d Mon Sep 17 00:00:00 2001 From: hiker Date: Mon, 27 Aug 2018 08:53:58 +1000 Subject: [PATCH 1/7] Fixed compiler warnings. --- src/states_screens/dialogs/ghost_replay_info_dialog.cpp | 2 +- src/states_screens/ghost_replay_selection.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/states_screens/dialogs/ghost_replay_info_dialog.cpp b/src/states_screens/dialogs/ghost_replay_info_dialog.cpp index cf377ed7a..06b103542 100644 --- a/src/states_screens/dialogs/ghost_replay_info_dialog.cpp +++ b/src/states_screens/dialogs/ghost_replay_info_dialog.cpp @@ -75,7 +75,7 @@ GhostReplayInfoDialog::GhostReplayInfoDialog(unsigned int replay_id, /* Used to display kart icons for the selected replay(s) */ irr::gui::STKModifiedSpriteBank *icon_bank = GhostReplaySelection::getInstance()->getIconBank(); - int icon_height = getHeight()/18.0f; + int icon_height = getHeight()/18; m_replay_info_widget->setIcons(icon_bank, (int)icon_height); updateReplayDisplayedInfo(); diff --git a/src/states_screens/ghost_replay_selection.cpp b/src/states_screens/ghost_replay_selection.cpp index 29b8ab033..9621ce6ef 100644 --- a/src/states_screens/ghost_replay_selection.cpp +++ b/src/states_screens/ghost_replay_selection.cpp @@ -159,7 +159,7 @@ void GhostReplaySelection::init() m_icon_unknown_kart = m_icon_bank->addTextureAsSprite(kart_not_found); - int icon_height = getHeight()/24.0f; + int icon_height = getHeight()/24; // 128 is the height of the image file //FIXME : this isn't guaranteed // Amanda's icon is 300x300 From a9793a10a06f23204ad1d39c5907cad1ad899a6c Mon Sep 17 00:00:00 2001 From: Deve Date: Sat, 1 Sep 2018 20:33:13 +0200 Subject: [PATCH 2/7] Better fix for legacy pipeline --- src/graphics/cpu_particle_manager.cpp | 9 ++++----- src/tracks/track.cpp | 9 +++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/graphics/cpu_particle_manager.cpp b/src/graphics/cpu_particle_manager.cpp index 3b5026428..582d34775 100644 --- a/src/graphics/cpu_particle_manager.cpp +++ b/src/graphics/cpu_particle_manager.cpp @@ -137,6 +137,8 @@ CPUParticleManager::GLParticle::GLParticle(bool flips) // ---------------------------------------------------------------------------- CPUParticleManager::CPUParticleManager() { + assert(CVS->isGLSL()); + const float vertices[] = { -0.5f, 0.5f, 0.0f, 0.0f, @@ -150,11 +152,8 @@ CPUParticleManager::CPUParticleManager() glBindBuffer(GL_ARRAY_BUFFER, 0); // For preloading shaders - if (CVS->isGLSL()) - { - ParticleRenderer::getInstance(); - AlphaTestParticleRenderer::getInstance(); - } + ParticleRenderer::getInstance(); + AlphaTestParticleRenderer::getInstance(); } // CPUParticleManager // ---------------------------------------------------------------------------- diff --git a/src/tracks/track.cpp b/src/tracks/track.cpp index 874119bdc..982c71358 100644 --- a/src/tracks/track.cpp +++ b/src/tracks/track.cpp @@ -308,12 +308,13 @@ void Track::cleanup() Graph::destroy(); ItemManager::destroy(); #ifndef SERVER_ONLY - if (!ProfileWorld::isNoGraphics()) - { - CPUParticleManager::getInstance()->cleanMaterialMap(); - } if (CVS->isGLSL()) { + if (!ProfileWorld::isNoGraphics()) + { + CPUParticleManager::getInstance()->cleanMaterialMap(); + } + SP::resetEmptyFogColor(); } ParticleKindManager::get()->cleanUpTrackSpecificGfx(); From 5a82c6b537e10fc9d064cfa2441d6382fe04c428 Mon Sep 17 00:00:00 2001 From: Deve Date: Sun, 2 Sep 2018 22:53:06 +0200 Subject: [PATCH 3/7] Slightly increase a size of some gui elements. --- data/gui/main_menu.stkgui | 6 +++--- data/gui/online/networking_lobby.stkgui | 14 +++++++------- data/gui/overworld_dialog.stkgui | 2 +- data/gui/race_paused_dialog.stkgui | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/data/gui/main_menu.stkgui b/data/gui/main_menu.stkgui index ab4bac2f7..d796f1dd3 100644 --- a/data/gui/main_menu.stkgui +++ b/data/gui/main_menu.stkgui @@ -25,9 +25,9 @@ I18N="Main menu button" text="Addons"/> - + - + @@ -38,7 +38,7 @@ - + -
- - +
+ + -
-
diff --git a/data/gui/overworld_dialog.stkgui b/data/gui/overworld_dialog.stkgui index cf304fb03..62c8453c5 100644 --- a/data/gui/overworld_dialog.stkgui +++ b/data/gui/overworld_dialog.stkgui @@ -1,7 +1,7 @@
-
+
diff --git a/data/gui/race_paused_dialog.stkgui b/data/gui/race_paused_dialog.stkgui index b31d50af8..f8a19c343 100644 --- a/data/gui/race_paused_dialog.stkgui +++ b/data/gui/race_paused_dialog.stkgui @@ -1,7 +1,7 @@ -
-
+
+
From 03c003b68dc4420af8cc9c8e625de52adfd3adc5 Mon Sep 17 00:00:00 2001 From: hiker Date: Mon, 3 Sep 2018 10:08:33 +1000 Subject: [PATCH 4/7] First fix for bubble bum support in networking (and some documentation updates). --- src/items/network_item_manager.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/items/network_item_manager.cpp b/src/items/network_item_manager.cpp index b1070f228..383a2a73c 100644 --- a/src/items/network_item_manager.cpp +++ b/src/items/network_item_manager.cpp @@ -137,17 +137,17 @@ Item* NetworkItemManager::dropNewItem(ItemState::ItemType type, // Server: store the data for this event: m_item_events.lock(); m_item_events.getData().emplace_back(World::getWorld()->getTicksSinceStart(), - type, item->getItemId(), - kart->getWorldKartId(), - kart->getXYZ()); + type, item->getItemId(), + kart->getWorldKartId(), + kart->getXYZ() ); m_item_events.unlock(); return item; } // newItem // ---------------------------------------------------------------------------- /** Called by the GameProtocol when a confirmation for an item event is - * received by a host. Once all hosts have confirmed an event, it can be - * deleted and won't be send to any clients again. + * received by the server. Once all hosts have confirmed an event, it can be + * deleted and won't be sent to any clients again. * \param peer Peer confirming the latest event time received. * \param ticks Time at which the last event was received. */ @@ -251,8 +251,8 @@ void NetworkItemManager::restoreState(BareNetworkString *buffer, int count) // forward this confirmed state to the current time (i.e. world time). // This is done in several steps: // 1) First remove all client-side predicted items from the list of all - // items, and store them for now in a predictem_item cache. Predicted - // item only happen between m_confirmed_state_time and 'now'. + // items. Predicted item only happen between m_confirmed_state_time + // and 'now'. // 2) Apply all events included in this state to the confirmed state. // a) When a collection event is found, adjust the confirmed item state // only (this state will later be copied to the current item state). @@ -338,7 +338,7 @@ void NetworkItemManager::restoreState(BareNetworkString *buffer, int count) gp->sendItemEventConfirmation(World::getWorld()->getTicksSinceStart()); } - // Forward the confirmed item state till the world time: + // Forward the confirmed item state to the world time: int dt = World::getWorld()->getTicksSinceStart() - current_time; if(dt>0) forwardTime(dt); @@ -359,6 +359,7 @@ void NetworkItemManager::restoreState(BareNetworkString *buffer, int count) item_new->setPredicted(false); item_new->setItemId(i); m_all_items[i] = item_new; + *((ItemState*)m_all_items[i]) = *is; } else if (!is && item) { From 6bd5b5276a3fe340d7d08c838291f7e2ab17cbc3 Mon Sep 17 00:00:00 2001 From: Deve Date: Mon, 3 Sep 2018 22:10:33 +0200 Subject: [PATCH 5/7] Make GP editor GUI working better on different resolutions --- data/gui/edit_track.stkgui | 19 ++++++++++++------- data/gui/grand_prix_editor.stkgui | 8 ++++---- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/data/gui/edit_track.stkgui b/data/gui/edit_track.stkgui index 89d48f18c..115adfdb9 100644 --- a/data/gui/edit_track.stkgui +++ b/data/gui/edit_track.stkgui @@ -2,25 +2,26 @@
-
- - + + - + -
+
@@ -40,8 +41,10 @@
+ + -
+
+ +
diff --git a/data/gui/grand_prix_editor.stkgui b/data/gui/grand_prix_editor.stkgui index c27c72dc6..71b72cc36 100644 --- a/data/gui/grand_prix_editor.stkgui +++ b/data/gui/grand_prix_editor.stkgui @@ -7,9 +7,9 @@
- + - + @@ -20,7 +20,7 @@ - +
diff --git a/src/states_screens/soccer_setup_screen.cpp b/src/states_screens/soccer_setup_screen.cpp index 80db9cc98..520f09097 100644 --- a/src/states_screens/soccer_setup_screen.cpp +++ b/src/states_screens/soccer_setup_screen.cpp @@ -120,11 +120,11 @@ void SoccerSetupScreen::beforeAddingWidget() // Add red/blue team icon above the karts IconButtonWidget* red = getWidget("red_team"); IconButtonWidget* blue = getWidget("blue_team"); - red->m_x = central_div->m_x + central_div->m_w/4; - red->m_y = central_div->m_y + red->m_h; + red->m_x = central_div->m_x + central_div->m_w/4 - red->m_w/2; + red->m_y = central_div->m_y + (int)(red->m_h * 0.5f); - blue->m_x = central_div->m_x + (central_div->m_w/4)*3; - blue->m_y = central_div->m_y + blue->m_h; + blue->m_x = central_div->m_x + (central_div->m_w/4)*3 - blue->m_w/2; + blue->m_y = central_div->m_y + (int)(blue->m_h * 0.5f); // Add the 3D views for the karts int nb_players = race_manager->getNumPlayers(); @@ -463,7 +463,7 @@ void SoccerSetupScreen::updateKartViewsLayout() // Compute/get some dimensions const int nb_columns = 2; // two karts maximum per column - const int kart_area_width = (central_div->m_w) / 2; // size of one half of the screen + const int kart_area_width = (int)((central_div->m_w) / 2 * 0.8f); // size of one half of the screen with some margin const int kart_view_size = kart_area_width/nb_columns; // Size (width and height) of a kart view const int center_x = central_div->m_x + central_div->m_w/2; const int center_y = central_div->m_y + central_div->m_h/2;