Merge remote-tracking branch 'origin/master' into network_next

This commit is contained in:
Benau 2018-09-04 07:26:02 +08:00
commit a9ecebfbc8
15 changed files with 74 additions and 63 deletions

View File

@ -2,25 +2,26 @@
<stkgui>
<div x="2%" y="1%" width="96%" height="98%" layout="vertical-row" padding="10">
<header id="selected_track" width="80%" height="30"
<header id="selected_track" width="80%"
I18N="No neeed to translate this, it will be overwritten by the track name"
text="" align="center" text_align="center" />
<spacer height="20" />
<!-- Track selection -->
<box width="100%" height="60%" layout="vertical-row">
<ribbon_grid id="tracks" proportion="1" width="100%" height="100%" square_items="true"
label_location="each" align="center" child_width="240" child_height="160" />
<box proportion="3" width="100%" layout="vertical-row">
<ribbon_grid id="tracks" proportion="1" width="100%" square_items="true"
label_location="each" align="center" max_rows="2" child_width="160"
child_height="120"/>
</box>
<!-- Populated dynamically at runtime -->
<tabs width="100%" height="5%" id="trackgroups"> </tabs>
<spacer height="50" />
<spacer height="10%" />
<!-- Laps and reverse -->
<div width="100%" height="100" layout="horizontal-row" align="center">
<div width="100%" height="fit" layout="horizontal-row" align="center">
<spacer proportion="1" />
@ -40,8 +41,10 @@
<spacer proportion="1" />
</div>
<spacer height="5%" />
<!-- Dialog buttons -->
<div width="100%" height="60" layout="horizontal-row">
<div width="100%" height="fit" layout="horizontal-row">
<spacer proportion="2" />
<button id="ok" text="OK" proportion="1" />
<spacer proportion="1" />
@ -49,5 +52,7 @@
<spacer proportion="2" />
</div>
<spacer height="2%" />
</div>
</stkgui>

View File

@ -3,13 +3,13 @@
<div x="2%" y="10%" width="96%" height="80%" layout="vertical-row" >
<label id="title" raw_text="Text" proportion="1"/>
<spacer height="25" width="10" />
<spacer height="7%" width="10" />
<textbox id="textfield" width="75%" align="center"/>
<spacer height="20" width="20" />
<spacer height="7%" width="20" />
<button id="ok" I18N="In the general textfield dialog" text="OK" align="center" proportion="1"/>
<spacer height="15" width="20" />
<spacer height="5%" width="20" />
<button id="cancel" I18N="In the general textfield dialog" text="Cancel" align="center" proportion="1"/>
</div>
</stkgui>

View File

@ -7,9 +7,9 @@
<header width="80%" I18N="Title in grand prix editor screen" text="Grand Prix editor"
align="center" text_align="center" />
<spacer height="20" />
<spacer height="10" />
<box proportion="4" width="100%" layout="vertical-row">
<box proportion="8" width="100%" layout="vertical-row">
<ribbon_grid id="gplist" proportion="1" width="100%" square_items="true"
label_location="each" align="left" max_rows="2" child_width="160"
child_height="120" keep_selection="true" />
@ -20,7 +20,7 @@
<spacer height="20" />
<box proportion="2" width="100%" layout="vertical-row">
<box proportion="5" width="100%" layout="vertical-row">
<label id="gpname" text_align="center" width="100%" text="" />
<ribbon_grid id="tracks" proportion="1" width="100%" square_items="true"
label_location="each" align="left" max_rows="1"
@ -29,7 +29,7 @@
<spacer height="20" />
<buttonbar proportion="1" id="menu" height="135" width="100%" align="center">
<buttonbar proportion="3" id="menu" height="135" width="100%" align="center">
<icon-button id="new" width="128" height="128" icon="gui/gp_new.png"
I18N="Menu item" text="New" />
<icon-button id="copy" width="128" height="128" icon="gui/gp_copy.png"

View File

@ -25,9 +25,9 @@
I18N="Main menu button" text="Addons"/>
</buttonbar>
<spacer width="10" height="7%"/>
<spacer width="10" height="6%"/>
<bottombar width="100%" height="10%" layout="horizontal-row">
<bottombar width="100%" height="11%" layout="horizontal-row">
<spacer width="10" height="10" />
@ -38,7 +38,7 @@
<spacer width="10" height="10" />
<buttonbar id="menu_bottomrow" x="0" y="0" width="38%" height="100%" align="center">
<buttonbar id="menu_bottomrow" x="0" y="0" width="42%" height="100%" align="center">
<icon-button id="test_gpwin" width="64" height="64" icon="gui/main_options.png"
raw_text="TEST: GPWin" label_location="hover"/>
<icon-button id="test_gplose" width="64" height="64" icon="gui/main_options.png"

View File

@ -15,14 +15,14 @@
</div>
</div>
<spacer height="2%"/>
<div proportion="2" x="2%" width="96%" layout="horizontal-row">
<box proportion="4" height="100%" layout="vertical-row">
<textbox id="chat" width="100%" height="30%"/>
<div x="2%" width="96%" height="fit" layout="horizontal-row">
<box proportion="4" height="fit" layout="vertical-row">
<textbox id="chat" width="100%"/>
<spacer height="10"/>
<div width="100%" height="30%" proportion="1" layout="horizontal-row">
<button id="send" width="10%" height="fit" I18N="In the network lobby" text="Send" />
<spacer width="10"/>
<label id="timeout-message" width="80%" height="fit"/>
<div width="100%" height="fit" layout="horizontal-row">
<button id="send" width="20%" height="fit" I18N="In the network lobby" text="Send" />
<spacer width="1%"/>
<label id="timeout-message" width="79%" height="fit"/>
</div>
</box>
<spacer width="3%"/>

View File

@ -6,13 +6,13 @@
<button id="user-id" width="20%" height="fit" align="center"/>
<spacer height="20"/>
<box width="50%" height="10%" layout="horizontal-row" align="center" valign="center">
<spacer proportion="1"/>
<box width="fit" height="fit" layout="horizontal-row" align="center" valign="center">
<spacer width="25"/>
<label I18N="In the networking menu" align="center"
text="Enable splitscreen or player handicaps" text_align="right"/>
<spacer width="25"/>
<checkbox id="enable-splitscreen" align="center" />
<spacer proportion="1"/>
<spacer width="25"/>
</box>
<spacer height="15" width="10"/>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="5%" y="5%" width="90%" height="90%" layout="vertical-row" >
<header id="title" width="100%" text_align="center" text="Paused" proportion="3" />
<header id="title" width="100%" text_align="center" text="Paused" proportion="2" />
<!-- FIXME: some play in proportions occur below because the text of an icon
button is added UNDER it and not within its allocated height -->

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="5%" y="5%" width="90%" height="90%" layout="vertical-row" >
<header id="title" width="100%" text_align="center" text="Paused" proportion="3" />
<div x="2%" y="5%" width="90%" height="90%" layout="vertical-row" >
<header id="title" width="100%" text_align="center" text="Paused" proportion="2" />
<!-- FIXME: some play in proportions occur below because the text of an icon
button is added UNDER it and not within its allocated height -->

View File

@ -2,27 +2,30 @@
<stkgui>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
<div x="5%" y="5%" width="90%" height="90%" layout="vertical-row" >
<icon id="red_team" I18N="In soccer setup screen" text="Red Team" icon="gui/soccer_ball_red.png" width="7%" height="7%"/>
<icon id="blue_team" I18N="In soccer setup screen" text="Blue Team" icon="gui/soccer_ball_blue.png" width="7%" height="7%"/>
<div x="2%" y="1%" width="96%" height="98%" layout="vertical-row" >
<header width="80%" text="Race Setup" align="center" text_align="center" />
<spacer height="10" width="25"/>
<div layout="horizontal-row" width="fit" height="35" align="left">
<div layout="horizontal-row" width="fit" height="fit" align="left">
<bright proportion="1" height="100%"
I18N="In soccer setup screen" text="Number of goals to win" text_align="left" />
<spacer width="10" height="25"/>
<spinner id="goalamount" width="200" height="90%" min_value="1" max_value="10"/>
<spinner id="goalamount" width="200" min_value="1" max_value="10"/>
</div>
<div layout="horizontal-row" width="fit" height="35" align="left">
<div layout="horizontal-row" width="fit" height="fit" align="left">
<bright proportion="1" height="100%"
I18N="In soccer setup screen" text="Maximum time (min.)" text_align="left" />
<spacer width="10" height ="25"/>
<spinner id="timeamount" width="200" height="90%" min_value="1" max_value="15"/>
<spinner id="timeamount" width="200" min_value="1" max_value="15"/>
</div>
<div layout="horizontal-row" width="fit" height="35" align="left">
<div layout="horizontal-row" width="fit" height="fit" align="left">
<bright proportion="1" height="100%"
I18N="In soccer setup screen" text="Game type (Goals limit / Time limit)" text_align="left" />
<spacer width="10" height="25"/>
@ -33,14 +36,16 @@
<bubble height="fit" width="100%" id="lblLeftRight" I18N="In soccer setup screen" text="Use left/right to choose your team and press fire" word_wrap="true" text_align="center"/>
<spacer height="10" width="25"/>
<div id="central_div" layout="horizontal-row" width="100%" proportion="1" align="center">
<roundedbox y="5%" width="100%" layout="horizontal-row" height="95%">
<roundedbox width="100%" layout="horizontal-row" height="100%">
<!-- Content is added programmatically -->
</roundedbox>
<icon id="red_team" I18N="In soccer setup screen" text="Red Team" icon="gui/soccer_ball_red.png" width="font" height="font"/> <!-- Layout is done programmatically -->
<icon id="blue_team" I18N="In soccer setup screen" text="Blue Team" icon="gui/soccer_ball_blue.png" width="font" height="font"/>
</div>
<spacer height="10" width="25"/>
<button id="continue" I18N="In soccer setup screen" text="Continue" align="center" width="60%"/>
</div>
</stkgui>

View File

@ -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
// ----------------------------------------------------------------------------

View File

@ -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)
{

View File

@ -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();

View File

@ -160,7 +160,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

View File

@ -120,11 +120,11 @@ void SoccerSetupScreen::beforeAddingWidget()
// Add red/blue team icon above the karts
IconButtonWidget* red = getWidget<IconButtonWidget>("red_team");
IconButtonWidget* blue = getWidget<IconButtonWidget>("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;

View File

@ -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();