This commit is contained in:
samuncle 2015-01-15 00:12:34 +01:00
commit 5a2ff025bd
4 changed files with 23 additions and 7 deletions

View File

@ -255,11 +255,15 @@ else()
mark_as_advanced(PTHREAD_LIBRARY) mark_as_advanced(PTHREAD_LIBRARY)
# Set data dir (absolute or relative to CMAKE_INSTALL_PREFIX) # Set data dir (absolute or relative to CMAKE_INSTALL_PREFIX)
get_filename_component(STK_INSTALL_DATA_DIR_ABSOLUTE ${STK_INSTALL_DATA_DIR} ABSOLUTE) if(NOT STK_INSTALL_DATA_DIR_ABSOLUTE)
if(${STK_INSTALL_DATA_DIR_ABSOLUTE} STREQUAL ${STK_INSTALL_DATA_DIR}) get_filename_component(STK_INSTALL_DATA_DIR_ABSOLUTE ${STK_INSTALL_DATA_DIR} ABSOLUTE)
add_definitions(-DSUPERTUXKART_DATADIR=\"${STK_INSTALL_DATA_DIR_ABSOLUTE}\") if(${STK_INSTALL_DATA_DIR_ABSOLUTE} STREQUAL ${STK_INSTALL_DATA_DIR})
add_definitions(-DSUPERTUXKART_DATADIR=\"${STK_INSTALL_DATA_DIR_ABSOLUTE}\")
else()
add_definitions(-DSUPERTUXKART_DATADIR=\"${CMAKE_INSTALL_PREFIX}/${STK_INSTALL_DATA_DIR}\")
endif()
else() else()
add_definitions(-DSUPERTUXKART_DATADIR=\"${CMAKE_INSTALL_PREFIX}/${STK_INSTALL_DATA_DIR}\") add_definitions(-DSUPERTUXKART_DATADIR=\"${STK_INSTALL_DATA_DIR_ABSOLUTE}\")
endif() endif()
# Build the final executable # Build the final executable

View File

@ -37,6 +37,7 @@
#include "physics/physical_object.hpp" #include "physics/physical_object.hpp"
#include "physics/stk_dynamics_world.hpp" #include "physics/stk_dynamics_world.hpp"
#include "physics/triangle_mesh.hpp" #include "physics/triangle_mesh.hpp"
#include "race/race_manager.hpp"
#include "scriptengine/script_engine.hpp" #include "scriptengine/script_engine.hpp"
#include "tracks/track.hpp" #include "tracks/track.hpp"
#include "utils/profiler.hpp" #include "utils/profiler.hpp"
@ -208,7 +209,8 @@ void Physics::update(float dt)
kart->setSquash(kp->getSquashDuration() * kart->getPlayerDifficulty()->getSquashDuration(), kart->setSquash(kp->getSquashDuration() * kart->getPlayerDifficulty()->getSquashDuration(),
kp->getSquashSlowdown() * kart->getPlayerDifficulty()->getSquashSlowdown()); kp->getSquashSlowdown() * kart->getPlayerDifficulty()->getSquashSlowdown());
} }
else if(obj->isSoccerBall()) else if(obj->isSoccerBall() &&
race_manager->getMinorMode() == RaceManager::MINOR_MODE_SOCCER)
{ {
int kartId = p->getUserPointer(1)->getPointerKart()->getWorldKartId(); int kartId = p->getUserPointer(1)->getPointerKart()->getWorldKartId();
SoccerWorld* soccerWorld = (SoccerWorld*)World::getWorld(); SoccerWorld* soccerWorld = (SoccerWorld*)World::getWorld();
@ -266,7 +268,8 @@ void Physics::update(float dt)
->hit(NULL, p->getUserPointer(1)->getPointerPhysicalObject()); ->hit(NULL, p->getUserPointer(1)->getPointerPhysicalObject());
PhysicalObject* obj = p->getUserPointer(1)->getPointerPhysicalObject(); PhysicalObject* obj = p->getUserPointer(1)->getPointerPhysicalObject();
if(obj->isSoccerBall()) if (obj->isSoccerBall() &&
race_manager->getMinorMode() == RaceManager::MINOR_MODE_SOCCER)
{ {
int kartId = p->getUserPointer(0)->getPointerFlyable()->getOwnerId(); int kartId = p->getUserPointer(0)->getPointerFlyable()->getOwnerId();
SoccerWorld* soccerWorld = (SoccerWorld*)World::getWorld(); SoccerWorld* soccerWorld = (SoccerWorld*)World::getWorld();

View File

@ -17,6 +17,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "tracks/track_manager.hpp" #include "tracks/track_manager.hpp"
#include "graphics/irr_driver.hpp"
#include <stdio.h> #include <stdio.h>
#include <stdexcept> #include <stdexcept>
@ -207,6 +208,10 @@ bool TrackManager::loadTrack(const std::string& dirname)
m_tracks.push_back(track); m_tracks.push_back(track);
m_track_avail.push_back(true); m_track_avail.push_back(true);
updateGroups(track); updateGroups(track);
//Populate the texture cache with track screenshots
irr_driver->getTexture(track->getScreenshotFile());
return true; return true;
} // loadTrack } // loadTrack

View File

@ -65,7 +65,11 @@ TrackObject::TrackObject(const core::vector3df& xyz, const core::vector3df& hpr,
m_physical_object = NULL; m_physical_object = NULL;
m_interaction = interaction; m_interaction = interaction;
m_presentation = presentation; m_presentation = presentation;
m_soccer_ball = false; m_is_driveable = false;
m_soccer_ball = false;
m_garage = false;
m_distance = 0;
m_type = "";
if (m_interaction != "ghost" && m_interaction != "none" && if (m_interaction != "ghost" && m_interaction != "none" &&
physics_settings ) physics_settings )