Fixed compiler warnings, and many coding style issues.
This commit is contained in:
@@ -68,8 +68,8 @@ const int GIFT_EXIT_TO = GIFT_EXIT_FROM + 7;
|
||||
#pragma mark FeatureUnlockedCutScene::UnlockedThing
|
||||
#endif
|
||||
|
||||
FeatureUnlockedCutScene::UnlockedThing::UnlockedThing(std::string model,
|
||||
irr::core::stringw msg)
|
||||
FeatureUnlockedCutScene::UnlockedThing::UnlockedThing(const std::string &model,
|
||||
const irr::core::stringw &msg)
|
||||
{
|
||||
m_unlocked_kart = NULL;
|
||||
m_unlock_message = msg;
|
||||
@@ -78,11 +78,11 @@ FeatureUnlockedCutScene::UnlockedThing::UnlockedThing(std::string model,
|
||||
m_scale = 1.0f;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
FeatureUnlockedCutScene::UnlockedThing::UnlockedThing(const KartProperties* kart,
|
||||
irr::core::stringw msg)
|
||||
const irr::core::stringw &msg)
|
||||
{
|
||||
m_unlocked_kart = kart;
|
||||
m_unlock_message = msg;
|
||||
@@ -90,11 +90,11 @@ FeatureUnlockedCutScene::UnlockedThing::UnlockedThing(const KartProperties* kart
|
||||
m_scale = 1.0f;
|
||||
} // UnlockedThing::UnlockedThing
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
FeatureUnlockedCutScene::UnlockedThing::UnlockedThing(irr::video::ITexture* pict,
|
||||
float w, float h,
|
||||
irr::core::stringw msg)
|
||||
const irr::core::stringw &msg)
|
||||
{
|
||||
m_unlocked_kart = NULL;
|
||||
#ifndef SERVER_ONLY
|
||||
@@ -118,9 +118,10 @@ FeatureUnlockedCutScene::UnlockedThing::UnlockedThing(irr::video::ITexture* pict
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
FeatureUnlockedCutScene::UnlockedThing::UnlockedThing(std::vector<irr::video::ITexture*> picts,
|
||||
float w, float h,
|
||||
irr::core::stringw msg)
|
||||
FeatureUnlockedCutScene::UnlockedThing
|
||||
::UnlockedThing(std::vector<irr::video::ITexture*> picts,
|
||||
float w, float h,
|
||||
const irr::core::stringw &msg)
|
||||
{
|
||||
m_unlocked_kart = NULL;
|
||||
#ifndef SERVER_ONLY
|
||||
@@ -173,7 +174,7 @@ void FeatureUnlockedCutScene::loadedFromFile()
|
||||
{
|
||||
} // loadedFromFile
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void FeatureUnlockedCutScene::onCutsceneEnd()
|
||||
{
|
||||
@@ -192,7 +193,9 @@ void FeatureUnlockedCutScene::onCutsceneEnd()
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void FeatureUnlockedCutScene::findWhatWasUnlocked(RaceManager::Difficulty difficulty,std::vector<const ChallengeData*>& unlocked)
|
||||
void FeatureUnlockedCutScene::
|
||||
findWhatWasUnlocked(RaceManager::Difficulty difficulty,
|
||||
std::vector<const ChallengeData*>& unlocked)
|
||||
{
|
||||
PlayerProfile *player = PlayerManager::getCurrentPlayer();
|
||||
|
||||
@@ -205,7 +208,8 @@ void FeatureUnlockedCutScene::findWhatWasUnlocked(RaceManager::Difficulty diffic
|
||||
std::vector<std::string> karts;
|
||||
|
||||
player->computeActive();
|
||||
unlock_manager->findWhatWasUnlocked(points_before, points_now, tracks, gps, karts, unlocked);
|
||||
unlock_manager->findWhatWasUnlocked(points_before, points_now, tracks, gps,
|
||||
karts, unlocked);
|
||||
|
||||
for (unsigned int i = 0; i < tracks.size(); i++)
|
||||
{
|
||||
@@ -223,7 +227,8 @@ void FeatureUnlockedCutScene::findWhatWasUnlocked(RaceManager::Difficulty diffic
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void FeatureUnlockedCutScene::addTrophy(RaceManager::Difficulty difficulty, bool is_grandprix)
|
||||
void FeatureUnlockedCutScene::addTrophy(RaceManager::Difficulty difficulty,
|
||||
bool is_grandprix)
|
||||
{
|
||||
core::stringw msg;
|
||||
|
||||
@@ -236,20 +241,28 @@ void FeatureUnlockedCutScene::addTrophy(RaceManager::Difficulty difficulty, bool
|
||||
switch (difficulty)
|
||||
{
|
||||
case RaceManager::DIFFICULTY_EASY:
|
||||
msg = _("You completed the easy challenge! Points earned on this level: %i/%i",
|
||||
CHALLENGE_POINTS[RaceManager::DIFFICULTY_EASY]*gp_factor, CHALLENGE_POINTS[max_unlocked_difficulty]*gp_factor);
|
||||
msg = _("You completed the easy challenge! "
|
||||
"Points earned on this level: %i/%i",
|
||||
CHALLENGE_POINTS[RaceManager::DIFFICULTY_EASY]*gp_factor,
|
||||
CHALLENGE_POINTS[max_unlocked_difficulty]*gp_factor);
|
||||
break;
|
||||
case RaceManager::DIFFICULTY_MEDIUM:
|
||||
msg = _("You completed the intermediate challenge! Points earned on this level: %i/%i",
|
||||
CHALLENGE_POINTS[RaceManager::DIFFICULTY_MEDIUM]*gp_factor, CHALLENGE_POINTS[max_unlocked_difficulty]*gp_factor);
|
||||
msg = _("You completed the intermediate challenge! "
|
||||
"Points earned on this level: %i/%i",
|
||||
CHALLENGE_POINTS[RaceManager::DIFFICULTY_MEDIUM]*gp_factor,
|
||||
CHALLENGE_POINTS[max_unlocked_difficulty]*gp_factor);
|
||||
break;
|
||||
case RaceManager::DIFFICULTY_HARD:
|
||||
msg = _("You completed the difficult challenge! Points earned on this level: %i/%i",
|
||||
CHALLENGE_POINTS[RaceManager::DIFFICULTY_HARD]*gp_factor, CHALLENGE_POINTS[max_unlocked_difficulty]*gp_factor);
|
||||
msg = _("You completed the difficult challenge! "
|
||||
"Points earned on this level: %i/%i",
|
||||
CHALLENGE_POINTS[RaceManager::DIFFICULTY_HARD]*gp_factor,
|
||||
CHALLENGE_POINTS[max_unlocked_difficulty]*gp_factor);
|
||||
break;
|
||||
case RaceManager::DIFFICULTY_BEST:
|
||||
msg = _("You completed the SuperTux challenge! Points earned on this level: %i/%i",
|
||||
CHALLENGE_POINTS[RaceManager::DIFFICULTY_BEST]*gp_factor, CHALLENGE_POINTS[max_unlocked_difficulty]*gp_factor);
|
||||
msg = _("You completed the SuperTux challenge! "
|
||||
"Points earned on this level: %i/%i",
|
||||
CHALLENGE_POINTS[RaceManager::DIFFICULTY_BEST]*gp_factor,
|
||||
CHALLENGE_POINTS[max_unlocked_difficulty]*gp_factor);
|
||||
break;
|
||||
default:
|
||||
assert(false);
|
||||
@@ -277,7 +290,7 @@ void FeatureUnlockedCutScene::addTrophy(RaceManager::Difficulty difficulty, bool
|
||||
|
||||
|
||||
m_unlocked_stuff.push_back( new UnlockedThing(model, msg) );
|
||||
}
|
||||
} // addTrophy
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@@ -285,7 +298,8 @@ void FeatureUnlockedCutScene::addUnlockedKart(const KartProperties* unlocked_kar
|
||||
{
|
||||
if (unlocked_kart == NULL)
|
||||
{
|
||||
Log::error("FeatureUnlockedCutScene::addUnlockedKart", "Unlocked kart does not exist");
|
||||
Log::error("FeatureUnlockedCutScene::addUnlockedKart",
|
||||
"Unlocked kart does not exist");
|
||||
return;
|
||||
}
|
||||
irr::core::stringw msg = _("You unlocked %s!", unlocked_kart->getName());
|
||||
@@ -296,13 +310,15 @@ void FeatureUnlockedCutScene::addUnlockedKart(const KartProperties* unlocked_kar
|
||||
|
||||
void FeatureUnlockedCutScene::addUnlockedPicture(irr::video::ITexture* picture,
|
||||
float w, float h,
|
||||
irr::core::stringw msg)
|
||||
const irr::core::stringw &msg)
|
||||
{
|
||||
if (picture == NULL)
|
||||
{
|
||||
Log::warn("FeatureUnlockedCutScene::addUnlockedPicture", "Unlockable has no picture: %s",
|
||||
core::stringc(msg.c_str()).c_str());
|
||||
picture = irr_driver->getTexture(file_manager->getAsset(FileManager::GUI,"main_help.png"));
|
||||
Log::warn("FeatureUnlockedCutScene::addUnlockedPicture",
|
||||
"Unlockable has no picture: %s",
|
||||
core::stringc(msg.c_str()).c_str());
|
||||
picture = irr_driver->getTexture(
|
||||
file_manager->getAsset(FileManager::GUI,"main_help.png"));
|
||||
|
||||
}
|
||||
|
||||
@@ -311,9 +327,9 @@ void FeatureUnlockedCutScene::addUnlockedPicture(irr::video::ITexture* picture,
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void FeatureUnlockedCutScene::addUnlockedPictures(std::vector<irr::video::ITexture*> pictures,
|
||||
float w, float h,
|
||||
irr::core::stringw msg)
|
||||
void FeatureUnlockedCutScene::addUnlockedPictures
|
||||
(std::vector<irr::video::ITexture*> pictures,
|
||||
float w, float h, irr::core::stringw msg)
|
||||
{
|
||||
assert(!pictures.empty());
|
||||
|
||||
@@ -330,27 +346,31 @@ void FeatureUnlockedCutScene::init()
|
||||
const int unlockedStuffCount = m_unlocked_stuff.size();
|
||||
|
||||
if (unlockedStuffCount == 0)
|
||||
Log::error("FeatureUnlockedCutScene::init", "There is nothing in the unlock chest");
|
||||
Log::error("FeatureUnlockedCutScene::init",
|
||||
"There is nothing in the unlock chest");
|
||||
|
||||
m_all_kart_models.clearAndDeleteAll();
|
||||
for (int n=0; n<unlockedStuffCount; n++)
|
||||
{
|
||||
if (m_unlocked_stuff[n].m_unlock_model.size() > 0)
|
||||
{
|
||||
m_unlocked_stuff[n].m_root_gift_node = irr_driver->addMesh(
|
||||
irr_driver->getMesh(m_unlocked_stuff[n].m_unlock_model), "unlocked_model");
|
||||
irr::scene::IMesh *mesh =
|
||||
irr_driver->getMesh(m_unlocked_stuff[n].m_unlock_model);
|
||||
m_unlocked_stuff[n].m_root_gift_node =
|
||||
irr_driver->addMesh(mesh, "unlocked_model");
|
||||
m_unlocked_stuff[n].m_scale = 0.7f;
|
||||
//m_unlocked_stuff[n].m_root_gift_node->setScale(core::vector3df(0.2f, 0.2f, 0.2f));
|
||||
}
|
||||
else if (m_unlocked_stuff[n].m_unlocked_kart != NULL)
|
||||
{
|
||||
KartModel *kart_model =
|
||||
m_unlocked_stuff[n].m_unlocked_kart->getKartModelCopy();
|
||||
m_all_kart_models.push_back(kart_model);
|
||||
m_unlocked_stuff[n].m_root_gift_node = kart_model->attachModel(true, false);
|
||||
m_unlocked_stuff[n].m_root_gift_node =
|
||||
kart_model->attachModel(true, false);
|
||||
m_unlocked_stuff[n].m_scale = 5.0f;
|
||||
kart_model->setAnimation(KartModel::AF_DEFAULT);
|
||||
kart_model->update(0.0f, 0.0f, 0.0f, 0.0f, 0.0f); // set model current frame to "center"
|
||||
// Set model current frame to "center"
|
||||
kart_model->update(0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
#ifdef DEBUG
|
||||
m_unlocked_stuff[n].m_root_gift_node->setName("unlocked kart");
|
||||
@@ -361,7 +381,8 @@ void FeatureUnlockedCutScene::init()
|
||||
{
|
||||
scene::IMesh* mesh = irr_driver->createTexturedQuadMesh(NULL,
|
||||
m_unlocked_stuff[n].m_w, m_unlocked_stuff[n].m_h);
|
||||
m_unlocked_stuff[n].m_root_gift_node = irr_driver->getSceneManager()->addEmptySceneNode();
|
||||
m_unlocked_stuff[n].m_root_gift_node =
|
||||
irr_driver->getSceneManager()->addEmptySceneNode();
|
||||
SP::SPMesh* spm = SP::convertEVTStandard(mesh);
|
||||
m_unlocked_stuff[n].m_side_1 = irr_driver->addMesh(spm,
|
||||
"unlocked_picture", m_unlocked_stuff[n].m_root_gift_node);
|
||||
@@ -407,17 +428,23 @@ void FeatureUnlockedCutScene::init()
|
||||
irr_driver->createTexturedQuadMesh(&m,
|
||||
m_unlocked_stuff[n].m_w,
|
||||
m_unlocked_stuff[n].m_h);
|
||||
m_unlocked_stuff[n].m_root_gift_node = irr_driver->getSceneManager()->addEmptySceneNode();
|
||||
m_unlocked_stuff[n].m_root_gift_node =
|
||||
irr_driver->getSceneManager()->addEmptySceneNode();
|
||||
irr_driver->setAllMaterialFlags(mesh);
|
||||
m_unlocked_stuff[n].m_side_1 = irr_driver->addMesh(mesh, "unlocked_picture", m_unlocked_stuff[n].m_root_gift_node);
|
||||
m_unlocked_stuff[n].m_side_1 =
|
||||
irr_driver->addMesh(mesh, "unlocked_picture",
|
||||
m_unlocked_stuff[n].m_root_gift_node);
|
||||
mesh->drop();
|
||||
|
||||
mesh = irr_driver->createTexturedQuadMesh(&m,
|
||||
m_unlocked_stuff[n].m_w,
|
||||
m_unlocked_stuff[n].m_h);
|
||||
irr_driver->setAllMaterialFlags(mesh);
|
||||
m_unlocked_stuff[n].m_side_2 = irr_driver->addMesh(mesh, "unlocked_picture", m_unlocked_stuff[n].m_root_gift_node);
|
||||
m_unlocked_stuff[n].m_side_2->setRotation(core::vector3df(0.0f, 180.0f, 0.0f));
|
||||
m_unlocked_stuff[n].m_side_2 =
|
||||
irr_driver->addMesh(mesh, "unlocked_picture",
|
||||
m_unlocked_stuff[n].m_root_gift_node);
|
||||
m_unlocked_stuff[n].m_side_2
|
||||
->setRotation(core::vector3df(0.0f, 180.0f, 0.0f));
|
||||
mesh->drop();
|
||||
#ifdef DEBUG
|
||||
m_unlocked_stuff[n].m_root_gift_node->setName("unlocked track picture");
|
||||
@@ -458,8 +485,10 @@ void FeatureUnlockedCutScene::onUpdate(float dt)
|
||||
// When the chest has opened but the items are not yet at their final position
|
||||
if (m_global_time > GIFT_EXIT_FROM && m_global_time < GIFT_EXIT_TO)
|
||||
{
|
||||
float progress_factor = (m_global_time - GIFT_EXIT_FROM) / (GIFT_EXIT_TO - GIFT_EXIT_FROM);
|
||||
float smoothed_progress_factor = sin((progress_factor - 0.5f)*M_PI)/2.0f + 0.5f;
|
||||
float progress_factor = (m_global_time - GIFT_EXIT_FROM)
|
||||
/ (GIFT_EXIT_TO - GIFT_EXIT_FROM);
|
||||
float smoothed_progress_factor =
|
||||
sin((progress_factor - 0.5f)*M_PI)/2.0f + 0.5f;
|
||||
|
||||
for (int n=0; n<unlockedStuffCount; n++)
|
||||
{
|
||||
@@ -473,9 +502,9 @@ void FeatureUnlockedCutScene::onUpdate(float dt)
|
||||
// and that they won't end offscreen in usual situations
|
||||
|
||||
// Put the trophy in center
|
||||
float pos_value = (n == 0) ? unlockedStuffCount/2 :
|
||||
float pos_value = (n == 0) ? unlockedStuffCount/2.0f :
|
||||
(n == unlockedStuffCount/2) ? 0 : n;
|
||||
float offset = (float) pos_value - ((float) unlockedStuffCount)/2.0f + 0.5f;
|
||||
float offset = (float) pos_value - unlockedStuffCount/2.0f + 0.5f;
|
||||
offset *= (unlockedStuffCount <= 3) ? 1.4f :
|
||||
(unlockedStuffCount <= 5) ? 1.2f : 1.0f;
|
||||
pos.X += offset*dt;
|
||||
@@ -490,7 +519,10 @@ void FeatureUnlockedCutScene::onUpdate(float dt)
|
||||
{
|
||||
if (m_unlocked_stuff[n].m_root_gift_node == NULL) continue;
|
||||
|
||||
m_unlocked_stuff[n].m_root_gift_node->setRotation(m_unlocked_stuff[n].m_root_gift_node->getRotation() + core::vector3df(0.0f, dt*25.0f, 0.0f));
|
||||
irr::core::vector3df new_rot = m_unlocked_stuff[n].m_root_gift_node
|
||||
->getRotation()
|
||||
+ core::vector3df(0.0f, dt*25.0f, 0.0f);
|
||||
m_unlocked_stuff[n].m_root_gift_node->setRotation(new_rot);
|
||||
|
||||
if (!m_unlocked_stuff[n].m_pictures.empty())
|
||||
{
|
||||
@@ -506,8 +538,8 @@ void FeatureUnlockedCutScene::onUpdate(float dt)
|
||||
#ifndef SERVER_ONLY
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
SP::SPMesh* mesh =
|
||||
static_cast<SP::SPMeshNode*>(m_unlocked_stuff[n].m_side_1)->getSPM();
|
||||
SP::SPMesh* mesh = static_cast<SP::SPMeshNode*>
|
||||
(m_unlocked_stuff[n].m_side_1)->getSPM();
|
||||
|
||||
assert(mesh->getMeshBufferCount() == 1);
|
||||
SP::SPMeshBuffer* mb = mesh->getSPMeshBuffer(0);
|
||||
@@ -515,8 +547,8 @@ void FeatureUnlockedCutScene::onUpdate(float dt)
|
||||
m_unlocked_stuff[n].m_sp_pictures[textureID];
|
||||
mb->reloadTextureCompare();
|
||||
|
||||
mesh =
|
||||
static_cast<SP::SPMeshNode*>(m_unlocked_stuff[n].m_side_2)->getSPM();
|
||||
mesh = static_cast<SP::SPMeshNode*>
|
||||
(m_unlocked_stuff[n].m_side_2)->getSPM();
|
||||
assert(mesh->getMeshBufferCount() == 1);
|
||||
mb = mesh->getSPMeshBuffer(0);
|
||||
mb->getSPTextures()[0] =
|
||||
@@ -527,8 +559,9 @@ void FeatureUnlockedCutScene::onUpdate(float dt)
|
||||
}
|
||||
else
|
||||
{
|
||||
scene::IMesh* mesh =
|
||||
static_cast<scene::IMeshSceneNode*>(m_unlocked_stuff[n].m_side_1)->getMesh();
|
||||
scene::IMesh* mesh =
|
||||
static_cast<scene::IMeshSceneNode*>
|
||||
(m_unlocked_stuff[n].m_side_1)->getMesh();
|
||||
|
||||
assert(mesh->getMeshBufferCount() == 1);
|
||||
|
||||
@@ -537,23 +570,28 @@ void FeatureUnlockedCutScene::onUpdate(float dt)
|
||||
SMaterial& m = mb->getMaterial();
|
||||
m.setTexture(0, m_unlocked_stuff[n].m_pictures[textureID]);
|
||||
|
||||
// FIXME: this mesh is already associated with this node. I'm calling this
|
||||
// to force irrLicht to refresh the display, now that Material has changed.
|
||||
static_cast<scene::IMeshSceneNode*>(m_unlocked_stuff[n].m_side_1)->setMesh(mesh);
|
||||
// FIXME: this mesh is already associated with this
|
||||
// node. I'm calling this to force irrLicht to refresh
|
||||
// the display, now that Material has changed.
|
||||
static_cast<scene::IMeshSceneNode*>
|
||||
(m_unlocked_stuff[n].m_side_1)->setMesh(mesh);
|
||||
|
||||
m_unlocked_stuff[n].m_curr_image = textureID;
|
||||
|
||||
|
||||
mesh = static_cast<scene::IMeshSceneNode*>(m_unlocked_stuff[n].m_side_2)->getMesh();
|
||||
mesh = static_cast<scene::IMeshSceneNode*>
|
||||
(m_unlocked_stuff[n].m_side_2)->getMesh();
|
||||
assert(mesh->getMeshBufferCount() == 1);
|
||||
mb = mesh->getMeshBuffer(0);
|
||||
|
||||
SMaterial& m2 = mb->getMaterial();
|
||||
m2.setTexture(0, m_unlocked_stuff[n].m_pictures[textureID]);
|
||||
|
||||
// FIXME: this mesh is already associated with this node. I'm calling this
|
||||
// to force irrLicht to refresh the display, now that Material has changed.
|
||||
static_cast<scene::IMeshSceneNode*>(m_unlocked_stuff[n].m_side_2)->setMesh(mesh);
|
||||
// FIXME: this mesh is already associated with this
|
||||
// node. I'm calling this to force irrLicht to refresh
|
||||
// the display, now that Material has changed.
|
||||
static_cast<scene::IMeshSceneNode*>
|
||||
(m_unlocked_stuff[n].m_side_2)->setMesh(mesh);
|
||||
|
||||
m_unlocked_stuff[n].m_curr_image = textureID;
|
||||
}
|
||||
@@ -565,9 +603,14 @@ void FeatureUnlockedCutScene::onUpdate(float dt)
|
||||
float scale = m_unlocked_stuff[n].m_scale;
|
||||
if (m_global_time <= GIFT_EXIT_FROM)
|
||||
scale *= 0.1f;
|
||||
else if (m_global_time > GIFT_EXIT_FROM && m_global_time < GIFT_EXIT_TO)
|
||||
scale *= ((m_global_time - GIFT_EXIT_FROM) / (GIFT_EXIT_TO - GIFT_EXIT_FROM));
|
||||
m_unlocked_stuff[n].m_root_gift_node->setScale(core::vector3df(scale, scale, scale));
|
||||
else if (m_global_time > GIFT_EXIT_FROM &&
|
||||
m_global_time < GIFT_EXIT_TO)
|
||||
{
|
||||
scale *= ( (m_global_time - GIFT_EXIT_FROM)
|
||||
/ (GIFT_EXIT_TO - GIFT_EXIT_FROM) );
|
||||
}
|
||||
m_unlocked_stuff[n].m_root_gift_node
|
||||
->setScale(core::vector3df(scale, scale, scale));
|
||||
} // for n<unlockedStuffCount
|
||||
|
||||
assert(m_unlocked_stuff.size() > 0);
|
||||
@@ -592,7 +635,8 @@ void FeatureUnlockedCutScene::onUpdate(float dt)
|
||||
for (int n=unlockedStuffCount - 1; n>=0; n--)
|
||||
{
|
||||
GUIEngine::getFont()->draw(m_unlocked_stuff[n].m_unlock_message,
|
||||
core::rect< s32 >( 0, message_y, w, message_y + fontH ),
|
||||
core::rect< s32 >( 0, message_y, w,
|
||||
message_y + fontH ),
|
||||
color2,
|
||||
true /* center h */, true /* center v */ );
|
||||
message_y -= (fontH + MARGIN);
|
||||
@@ -606,7 +650,8 @@ void FeatureUnlockedCutScene::addUnlockedTrack(const Track* track)
|
||||
{
|
||||
if (track == NULL)
|
||||
{
|
||||
Log::error("FeatureUnlockedCutScene::addUnlockedTrack", "Unlocked track does not exist");
|
||||
Log::error("FeatureUnlockedCutScene::addUnlockedTrack",
|
||||
"Unlocked track does not exist");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -624,8 +669,11 @@ void FeatureUnlockedCutScene::addUnlockedGP(const GrandPrixData* gp)
|
||||
core::stringw gpname;
|
||||
if (gp == NULL)
|
||||
{
|
||||
Log::error("FeatureUnlockedCutScene::addUnlockedGP", "Unlocked GP does not exist");
|
||||
video::ITexture* WTF_image = irr_driver->getTexture( file_manager->getAsset(FileManager::GUI,"main_help.png"));
|
||||
Log::error("FeatureUnlockedCutScene::addUnlockedGP",
|
||||
"Unlocked GP does not exist");
|
||||
const std::string t_name =
|
||||
file_manager->getAsset(FileManager::GUI, "main_help.png");
|
||||
video::ITexture* WTF_image = irr_driver->getTexture(t_name);
|
||||
images.push_back(WTF_image);
|
||||
}
|
||||
else
|
||||
@@ -635,8 +683,11 @@ void FeatureUnlockedCutScene::addUnlockedGP(const GrandPrixData* gp)
|
||||
|
||||
if (track_amount == 0)
|
||||
{
|
||||
Log::error("FeatureUnlockedCutScene::addUnlockedGP", "Unlocked GP is empty");
|
||||
video::ITexture* WTF_image = irr_driver->getTexture( file_manager->getAsset(FileManager::GUI,"main_help.png"));
|
||||
Log::error("FeatureUnlockedCutScene::addUnlockedGP",
|
||||
"Unlocked GP is empty");
|
||||
video::ITexture* WTF_image =
|
||||
irr_driver->getTexture( file_manager
|
||||
->getAsset(FileManager::GUI,"main_help.png"));
|
||||
images.push_back(WTF_image);
|
||||
}
|
||||
|
||||
@@ -644,8 +695,10 @@ void FeatureUnlockedCutScene::addUnlockedGP(const GrandPrixData* gp)
|
||||
{
|
||||
Track* track = track_manager->getTrack(gptracks[t]);
|
||||
|
||||
ITexture* tex = irr_driver->getTexture(track ? track->getScreenshotFile().c_str()
|
||||
: file_manager->getAsset(FileManager::GUI,"main_help.png"));
|
||||
const std::string t_name =
|
||||
track ? track->getScreenshotFile()
|
||||
: file_manager->getAsset(FileManager::GUI, "main_help.png");
|
||||
ITexture* tex = irr_driver->getTexture(t_name);
|
||||
images.push_back(tex);
|
||||
}
|
||||
gpname = gp->getName();
|
||||
@@ -662,7 +715,7 @@ bool FeatureUnlockedCutScene::onEscapePressed()
|
||||
return false; // continueButtonPressed already pop'ed the menu
|
||||
} // onEscapePressed
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void FeatureUnlockedCutScene::continueButtonPressed()
|
||||
{
|
||||
@@ -683,7 +736,7 @@ void FeatureUnlockedCutScene::continueButtonPressed()
|
||||
|
||||
} // continueButtonPressed
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void FeatureUnlockedCutScene::eventCallback(GUIEngine::Widget* widget,
|
||||
const std::string& name,
|
||||
@@ -695,7 +748,7 @@ void FeatureUnlockedCutScene::eventCallback(GUIEngine::Widget* widget,
|
||||
}
|
||||
} // eventCallback
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
MusicInformation* FeatureUnlockedCutScene::getInGameMenuMusic() const
|
||||
{
|
||||
|
||||
@@ -44,7 +44,8 @@ class ChallengeData;
|
||||
* \brief Screen shown when a feature has been unlocked
|
||||
* \ingroup states_screens
|
||||
*/
|
||||
class FeatureUnlockedCutScene : public GUIEngine::CutsceneScreen, public GUIEngine::ScreenSingleton<FeatureUnlockedCutScene>
|
||||
class FeatureUnlockedCutScene : public GUIEngine::CutsceneScreen,
|
||||
public GUIEngine::ScreenSingleton<FeatureUnlockedCutScene>
|
||||
{
|
||||
friend class GUIEngine::ScreenSingleton<FeatureUnlockedCutScene>;
|
||||
|
||||
@@ -78,9 +79,9 @@ class FeatureUnlockedCutScene : public GUIEngine::CutsceneScreen, public GUIEngi
|
||||
|
||||
irr::core::stringw m_unlock_message;
|
||||
|
||||
UnlockedThing(std::string model, irr::core::stringw msg);
|
||||
UnlockedThing(const std::string &model, const irr::core::stringw &msg);
|
||||
|
||||
UnlockedThing(const KartProperties* kart, irr::core::stringw msg);
|
||||
UnlockedThing(const KartProperties* kart, const irr::core::stringw &msg);
|
||||
|
||||
/**
|
||||
* Creates a 'picture' reward.
|
||||
@@ -88,7 +89,8 @@ class FeatureUnlockedCutScene : public GUIEngine::CutsceneScreen, public GUIEngi
|
||||
* \param w width of the picture to display
|
||||
* \param y height of the picture to display
|
||||
*/
|
||||
UnlockedThing(irr::video::ITexture* pict, float w, float h, irr::core::stringw msg);
|
||||
UnlockedThing(irr::video::ITexture* pict, float w, float h,
|
||||
const irr::core::stringw &msg);
|
||||
|
||||
/**
|
||||
* Creates a 'picture slideshow' reward.
|
||||
@@ -96,7 +98,8 @@ class FeatureUnlockedCutScene : public GUIEngine::CutsceneScreen, public GUIEngi
|
||||
* \param w width of the pictures to display
|
||||
* \param y height of the pictures to display
|
||||
*/
|
||||
UnlockedThing(std::vector<irr::video::ITexture*> picts, float w, float h, irr::core::stringw msg);
|
||||
UnlockedThing(std::vector<irr::video::ITexture*> picts, float w, float h,
|
||||
const irr::core::stringw &msg);
|
||||
|
||||
~UnlockedThing();
|
||||
};
|
||||
@@ -137,18 +140,23 @@ public:
|
||||
void eventCallback(GUIEngine::Widget* widget, const std::string& name,
|
||||
const int playerID) OVERRIDE;
|
||||
|
||||
void findWhatWasUnlocked(RaceManager::Difficulty difficulty,std::vector<const ChallengeData*>& unlocked);
|
||||
void findWhatWasUnlocked(RaceManager::Difficulty difficulty,
|
||||
std::vector<const ChallengeData*>& unlocked);
|
||||
|
||||
/** Call before showing up the screen to make a kart come out of the chest.
|
||||
'addUnlockedThings' will invoke this, so you generally don't need to call this directly. */
|
||||
* 'addUnlockedThings' will invoke this, so you generally don't need to
|
||||
* call this directly. */
|
||||
void addUnlockedKart(const KartProperties* unlocked_kart);
|
||||
|
||||
/** Call before showing up the screen to make a picture come out of the chest
|
||||
'addUnlockedThings' will invoke this, so you generally don't need to call this directly. */
|
||||
void addUnlockedPicture(irr::video::ITexture* picture, float w, float h, irr::core::stringw msg);
|
||||
/** Call before showing up the screen to make a picture come out of the
|
||||
* chest 'addUnlockedThings' will invoke this, so you generally don't
|
||||
* need to call this directly. */
|
||||
void addUnlockedPicture(irr::video::ITexture* picture, float w, float h,
|
||||
const irr::core::stringw &msg);
|
||||
|
||||
/** Call before showing up the screen to make a picture slideshow come out of the chest
|
||||
'addUnlockedThings' will invoke this, so you generally don't need to call this directly. */
|
||||
/** Call before showing up the screen to make a picture slideshow come out
|
||||
* of the chest 'addUnlockedThings' will invoke this, so you generally
|
||||
* don't need to call this directly. */
|
||||
void addUnlockedPictures(std::vector<irr::video::ITexture*> pictures,
|
||||
float w, float h, irr::core::stringw msg);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user