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:
parent
4c3e6d864d
commit
9ba0c7f137
@ -376,6 +376,8 @@ void STKConfig::getAllData(const XMLNode * root)
|
||||
*/
|
||||
void STKConfig::getAllScores(std::vector<int> *all_scores, int num_karts)
|
||||
{
|
||||
if (num_karts == 0) return;
|
||||
|
||||
assert(num_karts <= m_max_karts);
|
||||
all_scores->resize(num_karts);
|
||||
(*all_scores)[num_karts-1] = 1; // last position gets one point
|
||||
|
@ -1382,8 +1382,7 @@ void IrrDriver::update(float dt)
|
||||
new ConfirmResolutionDialog();
|
||||
m_resolution_changing = RES_CHANGE_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!m_device->run())
|
||||
{
|
||||
main_loop->abort();
|
||||
@ -1444,6 +1443,13 @@ void IrrDriver::update(float dt)
|
||||
|
||||
RaceGUIBase *rg = world->getRaceGUI();
|
||||
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++)
|
||||
{
|
||||
AbstractKart *kart=world->getKart(i);
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <IMeshSceneNode.h>
|
||||
#include <ISceneManager.h>
|
||||
|
||||
#include "audio/music_manager.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
@ -48,6 +49,9 @@ CutsceneWorld::CutsceneWorld() : World()
|
||||
void CutsceneWorld::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
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -71,7 +75,7 @@ void CutsceneWorld::kartHit(const int kart_id)
|
||||
*/
|
||||
const std::string& CutsceneWorld::getIdent() const
|
||||
{
|
||||
return IDENT_STRIKES;
|
||||
return IDENT_CUSTSCENE;
|
||||
} // getIdent
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <IMesh.h>
|
||||
|
||||
#include <string>
|
||||
#include <ICameraSceneNode.h>
|
||||
|
||||
|
||||
/**
|
||||
@ -34,6 +35,8 @@
|
||||
class CutsceneWorld : public World
|
||||
{
|
||||
|
||||
scene::ICameraSceneNode* m_camera;
|
||||
|
||||
public:
|
||||
|
||||
CutsceneWorld();
|
||||
|
@ -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_STRIKES ("BATTLE_3_STRIKES");
|
||||
static const std::string IDENT_OVERWORLD("OVERWORLD" );
|
||||
static const std::string IDENT_CUSTSCENE("CUTSCENE" );
|
||||
|
||||
/**
|
||||
* The race manager has two functions:
|
||||
|
Loading…
Reference in New Issue
Block a user