Cutscene example now works

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@4075 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2009-10-04 19:39:17 +00:00
parent 01c96a3165
commit 6f123202ce
2 changed files with 17 additions and 3 deletions

View File

@ -30,8 +30,13 @@ FeatureUnlockedCutScene::FeatureUnlockedCutScene() : CutScene(CUTSCENE_NAME)
void FeatureUnlockedCutScene::prepare()
{
angle = 0.0f;
sky = irr_driver->addSkyDome(file_manager->getTextureFile("lscales.png"), 16 /* hori_res */, 16 /* vert_res */,
15.0f /* texture_percent */, 1.3f /* sphere_percent */);
1.0f /* texture_percent */, 2.0f /* sphere_percent */);
camera = irr_driver->addCamera();
/*
for (unsigned int i=0; i<sky->getMaterialCount(); i++)
{
@ -49,13 +54,20 @@ void FeatureUnlockedCutScene::prepare()
void FeatureUnlockedCutScene::terminate()
{
printf("+++++++ FeatureUnlockedCutScene:Terminate +++++++++\n");
irr_driver->removeNode(sky);
sky = NULL;
irr_driver->removeCamera(camera);
camera = NULL;
}
void FeatureUnlockedCutScene::onUpdate(float dt, irr::video::IVideoDriver* driver)
{
sky->render();
angle += dt*2;
if (angle > 360) angle -= 360;
sky->setRotation( core::vector3df(0, angle, 0) );
const int w = irr_driver->getFrameSize().Width;
const int h = irr_driver->getFrameSize().Height;
const irr::video::SColor color(255, 255, 0 ,0);

View File

@ -3,14 +3,16 @@
#include "guiengine/cutscene.hpp"
namespace irr { namespace scene { class ISceneNode; } }
namespace irr { namespace scene { class ISceneNode; class ICameraSceneNode; } }
class FeatureUnlockedCutScene : public GUIEngine::CutScene
{
FeatureUnlockedCutScene();
void prepare();
float angle;
irr::scene::ISceneNode* sky;
irr::scene::ICameraSceneNode* camera;
public:
static void show();