code for credits is finished

This commit is contained in:
2011-03-15 10:21:26 +01:00
parent 7daac06f59
commit ff87d9984a
8 changed files with 158 additions and 14 deletions
+3 -2
View File
@@ -530,7 +530,6 @@ bool LineEdit (int id, int x, int y, std::string &text_value, const int &maxleng
}
}
break;
}
}
@@ -652,8 +651,10 @@ bool CheckKeyPress (int keycode) {
}
bool CheckKeyPressed (int keycode) {
if (controller->uistate.keypressed_set.find(keycode) != controller->uistate.keypressed_set.end())
if (controller->uistate.keypressed_set.find(keycode) != controller->uistate.keypressed_set.end()) {
controller->uistate.keypressed_set.erase(keycode);
return true;
}
return false;
}
+10 -1
View File
@@ -293,12 +293,21 @@ void SetPlayerEntityId(unsigned int entity_id) {
float GetFrameDuration () {
if (!ModelInstance) {
LogError ("Couldn't create Entity: Model not initialized!");
LogError ("Couldn't get frame duration: Model not initialized!");
}
return ModelInstance->GetFrameDuration ();
}
float GetDurationApplicationStart () {
if (!ModelInstance) {
LogError ("Couldn't get application runtime: Model not initialized!");
}
return ModelInstance->GetDurationApplicationStart ();
}
EntityBase * CreateEntity (int type) {
if (!ModelInstance) {
LogError ("Couldn't create Entity: Model not initialized!");
+9 -7
View File
@@ -3,7 +3,6 @@
#include "Engine.h"
#include "EntityBase.h"
// #include "Timer.h"
namespace Engine {
@@ -13,10 +12,6 @@ class Events;
class EntityFactoryBase;
class OverlayManager;
#ifdef max
#undef max
#endif
const unsigned int NullEntityId = std::numeric_limits<unsigned int>::max() - 1;
struct EntityBase;
@@ -44,12 +39,16 @@ class ModelBase : public Module {
void UpdateTimer () {
static float last_frame = 0;
float current_frame = static_cast<float> (SDL_GetTicks ()) * 1.0e-3;
mDurationApplicationStart = current_frame;
mDeltaSec = current_frame - last_frame;
last_frame = current_frame;
}
float GetFrameDuration () {
return mDeltaSec;
}
float GetDurationApplicationStart () {
return mDurationApplicationStart;
}
/** Adds the given Entity to the Model */
void RegisterEntity (EntityBase *entity);
@@ -86,7 +85,8 @@ class ModelBase : public Module {
/** Returns the id of the entity the player is currently controlling */
unsigned int GetPlayerEntityId ();
/** \brief Assigns the player to an Entity. All controls will be redirected to that player
/** \brief Assigns the player to an Entity. All controls will be redirected
* \brief to that player
*
* This can be used to disable the controls of of the player by assinging
* the special entity id of NullEntityId */
@@ -94,7 +94,8 @@ class ModelBase : public Module {
/** Notifies the gamelogic of a collision event */
void SendEntityCollisionEvent (const unsigned int reference_entity_id,
const unsigned int incidence_entity_id, float collision_time, vector3d point, vector3d normal);
const unsigned int incidence_entity_id, float collision_time,
vector3d point, vector3d normal);
virtual void SetGameState (const unsigned int &state) {
mLastGameState = mGameState;
@@ -164,6 +165,7 @@ class ModelBase : public Module {
unsigned int mLastGameState;
float mDeltaSec;
float mDurationApplicationStart;
friend class ViewBase;
friend class OverlayManager;
+6
View File
@@ -19,6 +19,12 @@ void SetPlayerEntityId(unsigned int entity_id);
/** \brief Returns the duration of the frame in seconds */
float GetFrameDuration ();
/** \brief Returns the number of seconds the application is running
*
* \todo [low] rename GetTimeApplicationStart to a proper name!
*/
float GetDurationApplicationStart ();
// /** \brief Starts a timer with the given id that expires after sec seconds */
// void StartTimer(const std::string &id, float sec);
//
+2 -1
View File
@@ -316,7 +316,8 @@ bool ViewBase::LoadFont (const std::string &font_spec_string) {
return false;
}
font->setForegroundColor(font_color[0], font_color[1], font_color[2]);
font->setForegroundColor(font_color[0], font_color[1], font_color[2], 1.);
font->setBackgroundColor(0., 0., 0., 0.);
mFonts.insert(std::make_pair<std::string, OGLFT::Monochrome*>(font_spec_string, font));