2010-04-08 00:20:28 +02:00
|
|
|
|
// ==============================================================
|
|
|
|
|
// This file is part of Glest (www.glest.org)
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2001-2008 Marti<74>o Figueroa
|
|
|
|
|
//
|
|
|
|
|
// You can redistribute this code and/or modify it under
|
|
|
|
|
// the terms of the GNU General Public License as published
|
|
|
|
|
// by the Free Software Foundation; either version 2 of the
|
|
|
|
|
// License, or (at your option) any later version
|
|
|
|
|
// ==============================================================
|
|
|
|
|
|
|
|
|
|
#ifndef _GLEST_GAME_COREDATA_H_
|
|
|
|
|
#define _GLEST_GAME_COREDATA_H_
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
#include "sound.h"
|
|
|
|
|
#include "font.h"
|
|
|
|
|
#include "texture.h"
|
|
|
|
|
#include "sound_container.h"
|
2010-09-07 07:25:40 +02:00
|
|
|
|
#include "leak_dumper.h"
|
2010-04-08 00:20:28 +02:00
|
|
|
|
|
|
|
|
|
namespace Glest{ namespace Game{
|
|
|
|
|
|
|
|
|
|
using Shared::Graphics::Texture2D;
|
|
|
|
|
using Shared::Graphics::Texture3D;
|
|
|
|
|
using Shared::Graphics::Font2D;
|
2011-06-08 09:18:06 +02:00
|
|
|
|
using Shared::Graphics::Font3D;
|
2010-04-08 00:20:28 +02:00
|
|
|
|
using Shared::Sound::StrSound;
|
|
|
|
|
using Shared::Sound::StaticSound;
|
|
|
|
|
|
|
|
|
|
// =====================================================
|
|
|
|
|
// class CoreData
|
|
|
|
|
//
|
|
|
|
|
/// Data shared ammont all the ProgramStates
|
|
|
|
|
// =====================================================
|
|
|
|
|
|
|
|
|
|
class CoreData{
|
|
|
|
|
private:
|
|
|
|
|
StrSound introMusic;
|
|
|
|
|
StrSound menuMusic;
|
|
|
|
|
StaticSound clickSoundA;
|
|
|
|
|
StaticSound clickSoundB;
|
2010-05-16 18:40:21 +02:00
|
|
|
|
StaticSound clickSoundC;
|
|
|
|
|
StaticSound attentionSound;
|
2011-01-01 21:31:25 +01:00
|
|
|
|
StaticSound highlightSound;
|
2010-04-08 00:20:28 +02:00
|
|
|
|
SoundContainer waterSounds;
|
|
|
|
|
|
|
|
|
|
Texture2D *logoTexture;
|
2010-08-06 00:27:26 +02:00
|
|
|
|
std::vector<Texture2D *> logoTextureList;
|
2010-04-08 00:20:28 +02:00
|
|
|
|
Texture2D *backgroundTexture;
|
|
|
|
|
Texture2D *fireTexture;
|
|
|
|
|
Texture2D *snowTexture;
|
|
|
|
|
Texture2D *waterSplashTexture;
|
|
|
|
|
Texture2D *customTexture;
|
|
|
|
|
Texture2D *buttonSmallTexture;
|
|
|
|
|
Texture2D *buttonBigTexture;
|
2010-12-27 01:59:57 +01:00
|
|
|
|
Texture2D *horizontalLineTexture;
|
|
|
|
|
Texture2D *verticalLineTexture;
|
|
|
|
|
Texture2D *checkBoxTexture;
|
|
|
|
|
Texture2D *checkedCheckBoxTexture;
|
2011-04-05 15:34:54 +02:00
|
|
|
|
Texture2D *gameWinnerTexture;
|
2010-04-08 00:20:28 +02:00
|
|
|
|
|
|
|
|
|
Font2D *displayFont;
|
|
|
|
|
Font2D *menuFontNormal;
|
|
|
|
|
Font2D *displayFontSmall;
|
|
|
|
|
Font2D *menuFontBig;
|
|
|
|
|
Font2D *menuFontVeryBig;
|
|
|
|
|
Font2D *consoleFont;
|
|
|
|
|
|
2011-06-08 09:18:06 +02:00
|
|
|
|
Font3D *displayFont3D;
|
|
|
|
|
Font3D *menuFontNormal3D;
|
|
|
|
|
Font3D *displayFontSmall3D;
|
|
|
|
|
Font3D *menuFontBig3D;
|
|
|
|
|
Font3D *menuFontVeryBig3D;
|
|
|
|
|
Font3D *consoleFont3D;
|
|
|
|
|
|
2010-04-08 00:20:28 +02:00
|
|
|
|
public:
|
|
|
|
|
static CoreData &getInstance();
|
|
|
|
|
~CoreData();
|
|
|
|
|
|
|
|
|
|
void load();
|
|
|
|
|
|
|
|
|
|
Texture2D *getBackgroundTexture() const {return backgroundTexture;}
|
|
|
|
|
Texture2D *getFireTexture() const {return fireTexture;}
|
|
|
|
|
Texture2D *getSnowTexture() const {return snowTexture;}
|
|
|
|
|
Texture2D *getLogoTexture() const {return logoTexture;}
|
|
|
|
|
Texture2D *getWaterSplashTexture() const {return waterSplashTexture;}
|
|
|
|
|
Texture2D *getCustomTexture() const {return customTexture;}
|
|
|
|
|
Texture2D *getButtonSmallTexture() const {return buttonSmallTexture;}
|
|
|
|
|
Texture2D *getButtonBigTexture() const {return buttonBigTexture;}
|
2010-12-27 01:59:57 +01:00
|
|
|
|
Texture2D *getHorizontalLineTexture() const {return horizontalLineTexture;}
|
|
|
|
|
Texture2D *getVerticalLineTexture() const {return verticalLineTexture;}
|
|
|
|
|
Texture2D *getCheckBoxTexture() const {return checkBoxTexture;}
|
|
|
|
|
Texture2D *getCheckedCheckBoxTexture() const {return checkedCheckBoxTexture;}
|
2010-04-08 00:20:28 +02:00
|
|
|
|
|
2011-04-05 15:34:54 +02:00
|
|
|
|
Texture2D *getGameWinnerTexture() const {return gameWinnerTexture;}
|
|
|
|
|
|
2010-10-21 09:20:17 +02:00
|
|
|
|
size_t getLogoTextureExtraCount() const {return logoTextureList.size();}
|
2010-08-06 00:27:26 +02:00
|
|
|
|
Texture2D *getLogoTextureExtra(int idx) const {return logoTextureList[idx];}
|
|
|
|
|
|
2010-04-08 00:20:28 +02:00
|
|
|
|
StrSound *getIntroMusic() {return &introMusic;}
|
|
|
|
|
StrSound *getMenuMusic() {return &menuMusic;}
|
|
|
|
|
StaticSound *getClickSoundA() {return &clickSoundA;}
|
|
|
|
|
StaticSound *getClickSoundB() {return &clickSoundB;}
|
|
|
|
|
StaticSound *getClickSoundC() {return &clickSoundC;}
|
2010-05-16 18:40:21 +02:00
|
|
|
|
StaticSound *getAttentionSound() {return &attentionSound;}
|
2011-01-01 21:31:25 +01:00
|
|
|
|
StaticSound *getHighlightSound() {return &highlightSound;}
|
2010-04-08 00:20:28 +02:00
|
|
|
|
StaticSound *getWaterSound() {return waterSounds.getRandSound();}
|
|
|
|
|
|
|
|
|
|
Font2D *getDisplayFont() const {return displayFont;}
|
|
|
|
|
Font2D *getDisplayFontSmall() const {return displayFontSmall;}
|
|
|
|
|
Font2D *getMenuFontNormal() const {return menuFontNormal;}
|
|
|
|
|
Font2D *getMenuFontBig() const {return menuFontBig;}
|
|
|
|
|
Font2D *getMenuFontVeryBig() const {return menuFontVeryBig;}
|
|
|
|
|
Font2D *getConsoleFont() const {return consoleFont;}
|
|
|
|
|
|
2011-06-08 09:18:06 +02:00
|
|
|
|
Font3D *getDisplayFont3D() const {return displayFont3D;}
|
|
|
|
|
Font3D *getDisplayFontSmall3D() const {return displayFontSmall3D;}
|
|
|
|
|
Font3D *getMenuFontNormal3D() const {return menuFontNormal3D;}
|
|
|
|
|
Font3D *getMenuFontBig3D() const {return menuFontBig3D;}
|
|
|
|
|
Font3D *getMenuFontVeryBig3D() const {return menuFontVeryBig3D;}
|
|
|
|
|
Font3D *getConsoleFont3D() const {return consoleFont3D;}
|
|
|
|
|
|
2010-04-08 00:20:28 +02:00
|
|
|
|
private:
|
|
|
|
|
CoreData(){};
|
|
|
|
|
|
|
|
|
|
int computeFontSize(int size);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}} //end namespace
|
|
|
|
|
|
|
|
|
|
#endif
|