More work to make cutscenes work

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11272 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2012-06-02 22:35:09 +00:00
parent 4c3e6d864d
commit 9ba0c7f137
5 changed files with 19 additions and 3 deletions

View File

@ -376,6 +376,8 @@ void STKConfig::getAllData(const XMLNode * root)
*/ */
void STKConfig::getAllScores(std::vector<int> *all_scores, int num_karts) void STKConfig::getAllScores(std::vector<int> *all_scores, int num_karts)
{ {
if (num_karts == 0) return;
assert(num_karts <= m_max_karts); assert(num_karts <= m_max_karts);
all_scores->resize(num_karts); all_scores->resize(num_karts);
(*all_scores)[num_karts-1] = 1; // last position gets one point (*all_scores)[num_karts-1] = 1; // last position gets one point

View File

@ -1382,8 +1382,7 @@ void IrrDriver::update(float dt)
new ConfirmResolutionDialog(); new ConfirmResolutionDialog();
m_resolution_changing = RES_CHANGE_NONE; m_resolution_changing = RES_CHANGE_NONE;
} }
if (!m_device->run()) if (!m_device->run())
{ {
main_loop->abort(); main_loop->abort();
@ -1444,6 +1443,13 @@ void IrrDriver::update(float dt)
RaceGUIBase *rg = world->getRaceGUI(); RaceGUIBase *rg = world->getRaceGUI();
if (rg) rg->update(dt); if (rg) rg->update(dt);
// No kart, this must be a cutscene
if (world->getNumKarts() == 0)
{
m_scene_manager->drawAll();
}
for(unsigned int i=0; i<world->getNumKarts(); i++) for(unsigned int i=0; i<world->getNumKarts(); i++)
{ {
AbstractKart *kart=world->getKart(i); AbstractKart *kart=world->getKart(i);

View File

@ -19,6 +19,7 @@
#include <string> #include <string>
#include <IMeshSceneNode.h> #include <IMeshSceneNode.h>
#include <ISceneManager.h>
#include "audio/music_manager.hpp" #include "audio/music_manager.hpp"
#include "graphics/irr_driver.hpp" #include "graphics/irr_driver.hpp"
@ -48,6 +49,9 @@ CutsceneWorld::CutsceneWorld() : World()
void CutsceneWorld::init() void CutsceneWorld::init()
{ {
World::init(); World::init();
m_camera = irr_driver->getSceneManager()->addCameraSceneNode(NULL, core::vector3df(-80.0f, 2.0f, 75.0f),
core::vector3df(-97.230003, -0.010000, 50.610001));
} // CutsceneWorld } // CutsceneWorld
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -71,7 +75,7 @@ void CutsceneWorld::kartHit(const int kart_id)
*/ */
const std::string& CutsceneWorld::getIdent() const const std::string& CutsceneWorld::getIdent() const
{ {
return IDENT_STRIKES; return IDENT_CUSTSCENE;
} // getIdent } // getIdent
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@ -25,6 +25,7 @@
#include <IMesh.h> #include <IMesh.h>
#include <string> #include <string>
#include <ICameraSceneNode.h>
/** /**
@ -34,6 +35,8 @@
class CutsceneWorld : public World class CutsceneWorld : public World
{ {
scene::ICameraSceneNode* m_camera;
public: public:
CutsceneWorld(); CutsceneWorld();

View File

@ -43,6 +43,7 @@ static const std::string IDENT_TTRIAL ("STD_TIMETRIAL" );
static const std::string IDENT_FTL ("FOLLOW_LEADER" ); static const std::string IDENT_FTL ("FOLLOW_LEADER" );
static const std::string IDENT_STRIKES ("BATTLE_3_STRIKES"); static const std::string IDENT_STRIKES ("BATTLE_3_STRIKES");
static const std::string IDENT_OVERWORLD("OVERWORLD" ); static const std::string IDENT_OVERWORLD("OVERWORLD" );
static const std::string IDENT_CUSTSCENE("CUTSCENE" );
/** /**
* The race manager has two functions: * The race manager has two functions: