This commit is contained in:
Arthur-D 2014-10-02 14:04:49 +02:00
commit f6e9fec017
20 changed files with 52 additions and 168 deletions

View File

@ -9,9 +9,8 @@
<spacer height="25" width="10"/>
<tabs id="profile_tabs" height="10%" max_height="110" x="2%" width="98%" align="center">
<icon-button id="tab_overview" width="128" height="128" icon="gui/options_ui.png" />
<icon-button id="tab_friends" width="128" height="128" icon="gui/options_players.png"/>
<icon-button id="tab_achievements" width="128" height="128" icon="gui/options_players.png" I18N="Section in the profile menu" text="Achievements"/>
<icon-button id="tab_friends" width="128" height="128" icon="gui/options_players.png"/>
<icon-button id="tab_settings" width="128" height="128" icon="gui/main_options.png"/>
</tabs>

View File

@ -9,9 +9,8 @@
<spacer height="25" width="10"/>
<tabs id="profile_tabs" height="10%" max_height="110" x="2%" width="98%" align="center">
<icon-button id="tab_overview" width="128" height="128" icon="gui/options_ui.png" />
<icon-button id="tab_friends" width="128" height="128" icon="gui/options_players.png" I18N="Section in the profile menu" text="Friends"/>
<icon-button id="tab_achievements" width="128" height="128" icon="gui/options_players.png"/>
<icon-button id="tab_friends" width="128" height="128" icon="gui/options_players.png" I18N="Section in the profile menu" text="Friends"/>
<icon-button id="tab_settings" width="128" height="128" icon="gui/main_options.png"/>
</tabs>

View File

@ -9,9 +9,8 @@
<spacer height="25" width="10"/>
<tabs id="profile_tabs" height="10%" max_height="110" x="2%" width="98%" align="center">
<icon-button id="tab_overview" width="128" height="128" icon="gui/options_ui.png"/>
<icon-button id="tab_friends" width="128" height="128" icon="gui/options_players.png" />
<icon-button id="tab_achievements" width="128" height="128" icon="gui/options_players.png"/>
<icon-button id="tab_friends" width="128" height="128" icon="gui/options_players.png" />
<icon-button id="tab_settings" width="128" height="128" icon="gui/main_options.png" I18N="Section in the profile menu" text="Account Settings"/>
</tabs>

View File

@ -11,8 +11,9 @@ void main(void)
{
vec3 eyedir = gl_FragCoord.xyz / vec3(screen, 1.);
eyedir = 2.0 * eyedir - 1.0;
vec4 tmp = (InverseViewMatrix * InverseProjectionMatrix * vec4(eyedir, 1.));
eyedir = tmp.xyz / tmp.w;
vec4 tmp = (InverseProjectionMatrix * vec4(eyedir, 1.));
tmp /= tmp.w;
eyedir = (InverseViewMatrix * vec4(tmp.xyz, 0.)).xyz;
vec4 color = texture(tex, eyedir);
FragColor = vec4(color.xyz, 1.);
}

View File

@ -153,8 +153,8 @@
when the camera is pointing backwards. This is usually
larger than the forward-up-angle, since the kart itself
otherwise obstricts too much of the view. -->
<camera distance="1.5" forward-up-angle="15"
backward-up-angle="30"/>
<camera distance="1.0" forward-up-angle="15"
backward-up-angle="5"/>
<!-- Additional offset to move graphical chassis with regards to the physics. -->
<graphics y-offset="0.0"/>
@ -380,7 +380,7 @@
<stability roll-influence="0.3"
chassis-linear-damping="0.2"
chassis-angular-damping="0"
downward-impulse-factor="0"
downward-impulse-factor="5"
track-connection-accel="2"
smooth-flying-impulse="25"/>

View File

@ -285,7 +285,7 @@ void CGUIButton::draw()
}
}
if (SpriteBank)
if (false) //SpriteBank)
{
// pressed / unpressed animation
u32 state = Pressed ? (u32)EGBS_BUTTON_DOWN : (u32)EGBS_BUTTON_UP;

View File

@ -1,5 +1,5 @@
# Modify this file to change the last-modified date when you add/remove a file.
# This will then trigger a new cmake run automatically.
# This will then trigger a new cmake run automatically.
file(GLOB_RECURSE STK_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.hpp")
file(GLOB_RECURSE STK_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.cpp")
file(GLOB_RECURSE STK_SHADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "data/shaders/*")

View File

@ -113,7 +113,7 @@ irr::core::stringw AchievementInfo::toString() const
count = m_goal_values.begin()->second;
break;
default:
Log::fatal("AchievementInfo", "Missing toString for tpye %d.",
Log::fatal("AchievementInfo", "Missing toString for type %d.",
m_check_type);
}
return StringUtils::toWString(count);

View File

@ -142,7 +142,11 @@ void STKAnimatedMesh::updateGL()
if (!rnd->isTransparent())
{
Material* material = material_manager->getMaterialFor(mb->getMaterial().getTexture(0), mb);
Material::ShaderType MatType = MaterialTypeToMeshMaterial(type, mb->getVertexType(), material);
Material* material2 = NULL;
if (mb->getMaterial().getTexture(1) != NULL)
material2 = material_manager->getMaterialFor(mb->getMaterial().getTexture(1), mb);
Material::ShaderType MatType = MaterialTypeToMeshMaterial(type, mb->getVertexType(), material, material2);
InitTextures(mesh, MatType);
}

View File

@ -11,12 +11,16 @@
#include "modes/world.hpp"
Material::ShaderType MaterialTypeToMeshMaterial(video::E_MATERIAL_TYPE MaterialType, video::E_VERTEX_TYPE tp, Material* material)
Material::ShaderType MaterialTypeToMeshMaterial(video::E_MATERIAL_TYPE MaterialType, video::E_VERTEX_TYPE tp,
Material* material, Material* layer2Material)
{
if (layer2Material != NULL && layer2Material->getShaderType() == Material::SHADERTYPE_SPLATTING)
return Material::SHADERTYPE_SPLATTING;
switch (material->getShaderType())
{
default:
return material->getShaderType();
return material->getShaderType();
case Material::SHADERTYPE_SOLID:
if (MaterialType == irr_driver->getShader(ES_NORMAL_MAP))
return Material::SHADERTYPE_NORMAL_MAP;

View File

@ -174,7 +174,8 @@ class ListDisplacement : public MiscList<ListDisplacement, GLMesh *, core::matri
class ListInstancedGlow : public Singleton<ListInstancedGlow>, public std::vector<GLMesh *>
{};
Material::ShaderType MaterialTypeToMeshMaterial(video::E_MATERIAL_TYPE MaterialType, video::E_VERTEX_TYPE tp, Material* material);
Material::ShaderType MaterialTypeToMeshMaterial(video::E_MATERIAL_TYPE MaterialType, video::E_VERTEX_TYPE tp,
Material* material, Material* layer2Material);
TransparentMaterial MaterialTypeToTransparentMaterial(video::E_MATERIAL_TYPE, f32 MaterialTypeParam, Material* material);
void InitTextures(GLMesh &mesh, Material::ShaderType);

View File

@ -143,7 +143,10 @@ void STKMeshSceneNode::updateNoGL()
else
{
assert(!isDisplacement);
Material::ShaderType MatType = MaterialTypeToMeshMaterial(type, mb->getVertexType(), material);
Material* material2 = NULL;
if (mb->getMaterial().getTexture(1) != NULL)
material2 = material_manager->getMaterialFor(mb->getMaterial().getTexture(1), mb);
Material::ShaderType MatType = MaterialTypeToMeshMaterial(type, mb->getVertexType(), material, material2);
if (!immediate_draw)
MeshSolidMaterial[MatType].push_back(&mesh);
}
@ -179,7 +182,10 @@ void STKMeshSceneNode::updateGL()
if (!rnd->isTransparent())
{
Material* material = material_manager->getMaterialFor(mb->getMaterial().getTexture(0), mb);
Material::ShaderType MatType = MaterialTypeToMeshMaterial(type, mb->getVertexType(), material);
Material* material2 = NULL;
if (mb->getMaterial().getTexture(1) != NULL)
material2 = material_manager->getMaterialFor(mb->getMaterial().getTexture(1), mb);
Material::ShaderType MatType = MaterialTypeToMeshMaterial(type, mb->getVertexType(), material, material2);
if (!immediate_draw)
InitTextures(mesh, MatType);
}

View File

@ -573,8 +573,9 @@ void Kart::createPhysics()
{
// First: Create the chassis of the kart
// -------------------------------------
float kart_length = getKartLength();
float kart_height = getKartHeight();
const float kart_length = getKartLength();
const float kart_width = getKartWidth();
float kart_height = getKartHeight();
// improve physics for tall karts
if (kart_height > kart_length*0.6f)
@ -596,9 +597,9 @@ void Kart::createPhysics()
{
for (int x = -1; x <= 1; x += 2)
{
Vec3 p(x*getKartModel()->getWidth() *0.5f,
y*getKartModel()->getHeight()*0.5f,
z*getKartModel()->getLength()*0.5f);
Vec3 p(x*kart_width *0.5f,
y*kart_height *0.5f,
z*kart_length *0.5f);
hull->addPoint(p*orig_factor);
hull->addPoint(p*bevel_factor);
@ -614,7 +615,7 @@ void Kart::createPhysics()
{
// All wheel positions are relative to the center of
// the collision shape.
wheel_pos[index].setX(x*0.5f*getKartWidth());
wheel_pos[index].setX(x*0.5f*kart_width);
float radius = getKartProperties()->getWheelRadius();
// The y position of the wheels (i.e. the points where
// the suspension is attached to) is just at the
@ -624,8 +625,8 @@ void Kart::createPhysics()
// point 'radius' up. That means that if the suspension
// is fully compressed (0), the wheel will just be at
// the bottom of the kart chassis and touch the ground
wheel_pos[index].setY(- 0.5f*getKartHeight() + radius);
wheel_pos[index].setZ((0.5f*getKartLength() - radius)* z);
wheel_pos[index].setY(- 0.5f*kart_height + radius);
wheel_pos[index].setZ((0.5f*kart_length - radius)* z);
}
else

View File

@ -21,8 +21,8 @@
#include "guiengine/dialog_queue.hpp"
#include "guiengine/engine.hpp"
#include "online/online_profile.hpp"
#include "states_screens/online_profile_achievements.hpp"
#include "states_screens/online_profile_friends.hpp"
#include "states_screens/online_profile_overview.hpp"
#include "states_screens/state_manager.hpp"
#include "utils/translation.hpp"
@ -481,7 +481,7 @@ void UserInfoDialog::onUpdate(float dt)
{
ModalDialog::dismiss();
if (m_enter_profile)
StateManager::get()->replaceTopMostScreen(OnlineProfileOverview::getInstance());
StateManager::get()->replaceTopMostScreen(OnlineProfileAchievements::getInstance());
return;
}
} // onUpdate

View File

@ -42,7 +42,7 @@
#include "states_screens/grand_prix_editor_screen.hpp"
#include "states_screens/help_screen_1.hpp"
#include "states_screens/offline_kart_selection.hpp"
#include "states_screens/online_profile_overview.hpp"
#include "states_screens/online_profile_achievements.hpp"
#include "states_screens/online_screen.hpp"
#include "states_screens/options_screen_video.hpp"
#include "states_screens/state_manager.hpp"
@ -442,10 +442,10 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
}
if (PlayerManager::getCurrentOnlineId())
{
// For 0.8.2 disable the server menu, instead go to online profile
// For 0.8.2 disable the server menu, instead go to online profile
//OnlineScreen::getInstance()->push();
ProfileManager::get()->setVisiting(PlayerManager::getCurrentOnlineId());
OnlineProfileOverview::getInstance()->push();
ProfileManager::get()->setVisiting(PlayerManager::getCurrentOnlineId());
OnlineProfileAchievements::getInstance()->push();
}
else

View File

@ -24,7 +24,6 @@
#include "online/online_profile.hpp"
#include "states_screens/state_manager.hpp"
#include "utils/translation.hpp"
#include "states_screens/online_profile_overview.hpp"
#include "states_screens/online_profile_friends.hpp"
#include "states_screens/online_profile_achievements.hpp"
#include "states_screens/online_profile_settings.hpp"
@ -52,9 +51,6 @@ void OnlineProfileBase::loadedFromFile()
m_header = getWidget<LabelWidget>("title");
assert(m_header != NULL);
m_overview_tab =
(IconButtonWidget *)m_profile_tabs->findWidgetNamed("tab_overview");
assert(m_overview_tab != NULL);
m_friends_tab =
(IconButtonWidget *) m_profile_tabs->findWidgetNamed("tab_friends");
assert(m_friends_tab != NULL);
@ -91,7 +87,6 @@ void OnlineProfileBase::init()
{
Screen::init();
m_overview_tab->setTooltip( _("Overview") );
m_friends_tab->setTooltip( _("Friends") );
m_achievements_tab->setTooltip( _("Achievements") );
m_settings_tab->setTooltip( _("Account Settings") );
@ -119,9 +114,7 @@ void OnlineProfileBase::eventCallback(Widget* widget, const std::string& name,
std::string selection =
((RibbonWidget*)widget)->getSelectionIDString(PLAYER_ID_GAME_MASTER);
StateManager *sm = StateManager::get();
if (selection == m_overview_tab->m_properties[PROP_ID])
sm->replaceTopMostScreen(OnlineProfileOverview::getInstance());
else if (selection == m_friends_tab->m_properties[PROP_ID])
if (selection == m_friends_tab->m_properties[PROP_ID])
sm->replaceTopMostScreen(OnlineProfileFriends::getInstance());
else if (selection == m_achievements_tab->m_properties[PROP_ID])
sm->replaceTopMostScreen(OnlineProfileAchievements::getInstance());

View File

@ -30,7 +30,7 @@ namespace GUIEngine { class Widget; }
/** Online profile base screen. Used for displaying friends, achievements,
* overview, and settings. It handles the tabs which are common to each
* and settings. It handles the tabs which are common to each
* of those screens, and keeps track of the profile to display.
* \ingroup states_screens
*/
@ -42,7 +42,6 @@ protected:
/** Pointer to the various widgets on the screen. */
GUIEngine::LabelWidget * m_header;
GUIEngine::RibbonWidget* m_profile_tabs;
GUIEngine::IconButtonWidget * m_overview_tab;
GUIEngine::IconButtonWidget * m_friends_tab;
GUIEngine::IconButtonWidget * m_achievements_tab;
GUIEngine::IconButtonWidget * m_settings_tab;

View File

@ -1,67 +0,0 @@
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2010 Glenn De Jonghe
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 3
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "states_screens/online_profile_overview.hpp"
#include "guiengine/engine.hpp"
#include "guiengine/scalable_font.hpp"
#include "guiengine/screen.hpp"
#include "guiengine/widget.hpp"
#include "states_screens/state_manager.hpp"
#include "utils/translation.hpp"
#include <IGUIButton.h>
#include <iostream>
#include <sstream>
using namespace GUIEngine;
using namespace irr::core;
using namespace irr::gui;
using namespace Online;
DEFINE_SCREEN_SINGLETON( OnlineProfileOverview );
// -----------------------------------------------------------------------------
OnlineProfileOverview::OnlineProfileOverview() : OnlineProfileBase("online/profile_overview.stkgui")
{
} // OnlineProfileOverview
// -----------------------------------------------------------------------------
void OnlineProfileOverview::loadedFromFile()
{
OnlineProfileBase::loadedFromFile();
} // loadedFromFile
// -----------------------------------------------------------------------------
void OnlineProfileOverview::init()
{
OnlineProfileBase::init();
m_profile_tabs->select( m_overview_tab->m_properties[PROP_ID], PLAYER_ID_GAME_MASTER );
} // init
// -----------------------------------------------------------------------------
void OnlineProfileOverview::eventCallback(Widget* widget, const std::string& name, const int playerID)
{
OnlineProfileBase::eventCallback( widget, name, playerID);
} // eventCallback

View File

@ -1,55 +0,0 @@
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2013 Glenn De Jonghe
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 3
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef __HEADER_ONLINE_PROFILE_OVERVIEW_HPP__
#define __HEADER_ONLINE_PROFILE_OVERVIEW_HPP__
#include <string>
#include <irrString.h>
#include "guiengine/screen.hpp"
#include "guiengine/widgets.hpp"
#include "states_screens/online_profile_base.hpp"
namespace GUIEngine { class Widget; }
/**
* \brief Online profiel overview screen
* \ingroup states_screens
*/
class OnlineProfileOverview : public OnlineProfileBase, public GUIEngine::ScreenSingleton<OnlineProfileOverview>
{
protected:
OnlineProfileOverview();
public:
friend class GUIEngine::ScreenSingleton<OnlineProfileOverview>;
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void loadedFromFile() OVERRIDE;
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void eventCallback(GUIEngine::Widget* widget, const std::string& name,
const int playerID) OVERRIDE;
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void init() OVERRIDE;
};
#endif

View File

@ -40,7 +40,7 @@
#include "states_screens/networking_lobby.hpp"
#include "states_screens/server_selection.hpp"
#include "states_screens/create_server_screen.hpp"
#include "states_screens/online_profile_overview.hpp"
#include "states_screens/online_profile_achievements.hpp"
#include <string>
#include <iostream>
@ -233,7 +233,7 @@ void OnlineScreen::eventCallback(Widget* widget, const std::string& name,
else if (selection == m_profile_widget->m_properties[PROP_ID])
{
ProfileManager::get()->setVisiting(PlayerManager::getCurrentOnlineId());
OnlineProfileOverview::getInstance()->push();
OnlineProfileAchievements::getInstance()->push();
}
else if (selection == m_find_server_widget->m_properties[PROP_ID])
{