Yea, the current C++ code is:
IntroState::IntroState(Game *eGame):
IGameState(eGame)
{
IntroSprite = sf::Sprite(*(game->textureManager.getFile("./Resources/Images/blah.png", true)));
if(IntroSprite.GetTexture()->GetWidth() == 8)
IntroSprite.Scale(800/8.0f, 600/8.0f);
IntroSprite.SetPosition(sf::Vector2f(0.0f, 0.0f));
delay = 100.0f;
alpha = 0.0f;
disapearing = false;
appearing = true;
}
IntroState::~IntroState()
{
}
void IntroState::Init()
{
}
void IntroState::Cleanup(){}
void IntroState::Pause(){}
void IntroState::Resume(){}
void IntroState::HandleEvents(sf::Event &Event)
{
}
void IntroState::Update()
{
sf::Int32 delta = game->getDelta()/100;
if(appearing && !disapearing)
alpha += delta * 10.0f;
else if(!appearing && !disapearing && (alpha > 254.0f))
delay -= delta* 10.0f;
else if(!appearing && disapearing)
alpha -= delta * 10.0f;
if(alpha > 254.0f && delay > 0.0f)
{
disapearing = false;
appearing = false;
}
else if(alpha > 254.0f && delay < 0.0f)
{
disapearing = true;
}
else if(alpha < -10.0f && delay < 0.0f)
game->gameStateManager.PopState();
IntroSprite.SetColor(sf::Color(255,255,255,clamp(0.0f, 255.0f,alpha) ));
}
float IntroState::clamp(float min, float max, float num)
{
if(num > max) return max;
if(num < min) return min;
return num;
}
void IntroState::Draw()
{
game->App.Draw(IntroSprite);
}
and then this to draw the time:
void Game::drawDebug()
{
std::stringstream ss;
ss << Game::delta << " ms" << std::endl;
sf::Text text( ss.str() );
text.SetPosition(5,5);
text.SetCharacterSize(10);
text.SetColor(sf::Color::White);
App.Draw(text);
}
As for the C#, the map image is 54x42 (whith each tile being 16x16 so the overall size of the VertexArray is just over 800x600) and each point has 4 verteces