- updated to support building with clang compiler (And cleaned up clang warnings from initial compile). Edit build-mg.sh and read the clang section as to how to build.
This commit is contained in:
parent
fe07998816
commit
ab64b9343f
|
@ -21,6 +21,7 @@ MESSAGE(STATUS "Build type for this compile will be: ${CMAKE_BUILD_TYPE}")
|
|||
|
||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
SET(CMAKE_COMPILER_IS_GNUCXX "YES")
|
||||
ADD_DEFINITIONS("-Qunused-arguments -Wno-switch")
|
||||
ENDIF()
|
||||
|
||||
FUNCTION(Subversion_IS_WC FOLDER RESULT_VAR)
|
||||
|
|
|
@ -4,7 +4,12 @@
|
|||
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
|
||||
# Copyright (c) 2011-2013 Mark Vejvoda under GNU GPL v3.0+
|
||||
|
||||
# to enable clang compilation:
|
||||
# 1. sudo apt-get install clang
|
||||
# 2. Set the two vars below, WANT_CLANG=YES and CLANG_BIN_PATH=<path to the clang binary>
|
||||
WANT_CLANG=NO
|
||||
CLANG_BIN_PATH=/usr/bin/
|
||||
|
||||
LANG=C
|
||||
NUMCORES=`lscpu -p | grep -cv '^#'`
|
||||
if [ "$NUMCORES" = '' ]; then NUMCORES=1; fi
|
||||
|
@ -113,9 +118,7 @@ esac
|
|||
CURRENTDIR="$(dirname $(readlink -f $0))"
|
||||
|
||||
if [ "$WANT_CLANG" = 'YES' ]; then
|
||||
export CC=/usr/bin/clang
|
||||
export CXX=/usr/bin/clang++
|
||||
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -D_CMAKE_TOOLCHAIN_PREFIX=llvm-"
|
||||
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DCMAKE_C_COMPILER=${CLANG_BIN_PATH}clang -DCMAKE_CXX_COMPILER=${CLANG_BIN_PATH}clang++"
|
||||
echo "USER WANTS to use CLANG / LLVM compiler! EXTRA_CMAKE_OPTIONS = ${EXTRA_CMAKE_OPTIONS}"
|
||||
#exit 1;
|
||||
fi
|
||||
|
|
|
@ -1039,7 +1039,7 @@ void Game::load(int loadTypes) {
|
|||
else {
|
||||
logger.loadGameHints(englishFile,languageFile,true);
|
||||
|
||||
Shared::Platform::Window::handleEvent();
|
||||
::Shared::Platform::Window::handleEvent();
|
||||
SDL_PumpEvents();
|
||||
}
|
||||
|
||||
|
@ -1047,7 +1047,7 @@ void Game::load(int loadTypes) {
|
|||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
Game::findFactionLogoFile(&gameSettings, &logger);
|
||||
|
||||
Shared::Platform::Window::handleEvent();
|
||||
::Shared::Platform::Window::handleEvent();
|
||||
SDL_PumpEvents();
|
||||
}
|
||||
|
||||
|
@ -1097,7 +1097,7 @@ void Game::load(int loadTypes) {
|
|||
|
||||
// give CPU time to update other things to avoid apperance of hanging
|
||||
sleep(0);
|
||||
Shared::Platform::Window::handleEvent();
|
||||
::Shared::Platform::Window::handleEvent();
|
||||
SDL_PumpEvents();
|
||||
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
@ -1145,7 +1145,7 @@ void Game::load(int loadTypes) {
|
|||
|
||||
// give CPU time to update other things to avoid apperance of hanging
|
||||
sleep(0);
|
||||
Shared::Platform::Window::handleEvent();
|
||||
::Shared::Platform::Window::handleEvent();
|
||||
SDL_PumpEvents();
|
||||
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
@ -1163,7 +1163,7 @@ void Game::load(int loadTypes) {
|
|||
|
||||
// give CPU time to update other things to avoid apperance of hanging
|
||||
sleep(0);
|
||||
Shared::Platform::Window::handleEvent();
|
||||
::Shared::Platform::Window::handleEvent();
|
||||
SDL_PumpEvents();
|
||||
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
@ -1252,7 +1252,7 @@ void Game::init(bool initForPreviewOnly) {
|
|||
|
||||
// give CPU time to update other things to avoid apperance of hanging
|
||||
sleep(0);
|
||||
Shared::Platform::Window::handleEvent();
|
||||
::Shared::Platform::Window::handleEvent();
|
||||
SDL_PumpEvents();
|
||||
}
|
||||
|
||||
|
@ -1302,7 +1302,7 @@ void Game::init(bool initForPreviewOnly) {
|
|||
if(initForPreviewOnly == false) {
|
||||
// give CPU time to update other things to avoid apperance of hanging
|
||||
sleep(0);
|
||||
Shared::Platform::Window::handleEvent();
|
||||
::Shared::Platform::Window::handleEvent();
|
||||
SDL_PumpEvents();
|
||||
|
||||
gui.init(this);
|
||||
|
@ -1370,7 +1370,7 @@ void Game::init(bool initForPreviewOnly) {
|
|||
if(initForPreviewOnly == false) {
|
||||
// give CPU time to update other things to avoid apperance of hanging
|
||||
sleep(0);
|
||||
Shared::Platform::Window::handleEvent();
|
||||
::Shared::Platform::Window::handleEvent();
|
||||
SDL_PumpEvents();
|
||||
|
||||
scriptManager.init(&world, &gameCamera,loadGameNode);
|
||||
|
@ -1425,7 +1425,7 @@ void Game::init(bool initForPreviewOnly) {
|
|||
|
||||
// give CPU time to update other things to avoid apperance of hanging
|
||||
sleep(0);
|
||||
Shared::Platform::Window::handleEvent();
|
||||
::Shared::Platform::Window::handleEvent();
|
||||
SDL_PumpEvents();
|
||||
|
||||
if(world.getFactionCount() == 1 && world.getFaction(0)->getPersonalityType() == fpt_Observer) {
|
||||
|
@ -1492,7 +1492,7 @@ void Game::init(bool initForPreviewOnly) {
|
|||
|
||||
// give CPU time to update other things to avoid apperance of hanging
|
||||
sleep(0);
|
||||
Shared::Platform::Window::handleEvent();
|
||||
::Shared::Platform::Window::handleEvent();
|
||||
SDL_PumpEvents();
|
||||
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] Waiting for network\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__);
|
||||
|
@ -4351,7 +4351,7 @@ void Game::mouseMove(int x, int y, const MouseState *ms) {
|
|||
float ymult = 0.2f;
|
||||
float xmult = 0.2f;
|
||||
|
||||
Vec2i oldPos=Shared::Platform::Window::getOldMousePos();
|
||||
Vec2i oldPos = ::Shared::Platform::Window::getOldMousePos();
|
||||
int oldx= (oldPos.x * metrics.getVirtualW() / metrics.getScreenW());
|
||||
int oldy= ((metrics.getScreenH()-oldPos.y) * metrics.getVirtualH() / metrics.getScreenH());
|
||||
lastMousePos.x=oldx;
|
||||
|
@ -4360,7 +4360,7 @@ void Game::mouseMove(int x, int y, const MouseState *ms) {
|
|||
}
|
||||
mouseX=lastMousePos.x;
|
||||
mouseY=lastMousePos.y;
|
||||
Shared::Platform::Window::revertMousePos();
|
||||
::Shared::Platform::Window::revertMousePos();
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -6120,7 +6120,7 @@ void Game::renderVideoPlayer() {
|
|||
|
||||
void Game::playStaticVideo(const string &playVideo) {
|
||||
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false &&
|
||||
Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true) {
|
||||
::Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true) {
|
||||
|
||||
//togglePauseGame(true,true);
|
||||
tryPauseToggle(true);
|
||||
|
@ -6151,13 +6151,13 @@ void Game::playStaticVideo(const string &playVideo) {
|
|||
void Game::playStreamingVideo(const string &playVideo) {
|
||||
if(videoPlayer == NULL) {
|
||||
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false &&
|
||||
Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true) {
|
||||
::Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true) {
|
||||
Context *c= GraphicsInterface::getInstance().getCurrentContext();
|
||||
SDL_Surface *screen = static_cast<ContextGl*>(c)->getPlatformContextGlPtr()->getScreen();
|
||||
|
||||
string vlcPluginsPath = Config::getInstance().getString("VideoPlayerPluginsPath","");
|
||||
|
||||
videoPlayer = new Shared::Graphics::VideoPlayer(
|
||||
videoPlayer = new ::Shared::Graphics::VideoPlayer(
|
||||
&Renderer::getInstance(),
|
||||
playVideo,
|
||||
"",
|
||||
|
@ -6177,13 +6177,13 @@ void Game::playStreamingVideo(const string &playVideo) {
|
|||
videoPlayer = NULL;
|
||||
|
||||
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false &&
|
||||
Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true) {
|
||||
::Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true) {
|
||||
Context *c= GraphicsInterface::getInstance().getCurrentContext();
|
||||
SDL_Surface *screen = static_cast<ContextGl*>(c)->getPlatformContextGlPtr()->getScreen();
|
||||
|
||||
string vlcPluginsPath = Config::getInstance().getString("VideoPlayerPluginsPath","");
|
||||
|
||||
videoPlayer = new Shared::Graphics::VideoPlayer(
|
||||
videoPlayer = new ::Shared::Graphics::VideoPlayer(
|
||||
&Renderer::getInstance(),
|
||||
playVideo,
|
||||
"",
|
||||
|
|
|
@ -37,7 +37,7 @@ using namespace Shared::PlatformCommon;
|
|||
|
||||
namespace Shared { namespace Graphics {
|
||||
class VideoPlayer;
|
||||
}}
|
||||
}};
|
||||
|
||||
namespace Glest{ namespace Game{
|
||||
|
||||
|
@ -197,7 +197,7 @@ private:
|
|||
std::vector<std::pair<int,NetworkCommand> > replayCommandList;
|
||||
|
||||
std::vector<string> streamingVideos;
|
||||
Shared::Graphics::VideoPlayer *videoPlayer;
|
||||
::Shared::Graphics::VideoPlayer *videoPlayer;
|
||||
bool playingStaticVideo;
|
||||
|
||||
Unit *currentCameraFollowUnit;
|
||||
|
|
|
@ -29,10 +29,10 @@ namespace Shared { namespace Xml {
|
|||
|
||||
namespace Glest{ namespace Game{
|
||||
|
||||
using Shared::Graphics::Quad2i;
|
||||
using Shared::Graphics::Vec3f;
|
||||
using Shared::Graphics::Vec2f;
|
||||
using Shared::Xml::XmlNode;
|
||||
using ::Shared::Graphics::Quad2i;
|
||||
using ::Shared::Graphics::Vec3f;
|
||||
using ::Shared::Graphics::Vec2f;
|
||||
using ::Shared::Xml::XmlNode;
|
||||
|
||||
class Config;
|
||||
|
||||
|
|
|
@ -26,12 +26,12 @@
|
|||
|
||||
namespace Glest{ namespace Game{
|
||||
|
||||
using Shared::Graphics::Texture2D;
|
||||
using Shared::Graphics::Texture3D;
|
||||
using Shared::Graphics::Font2D;
|
||||
using Shared::Graphics::Font3D;
|
||||
using Shared::Sound::StrSound;
|
||||
using Shared::Sound::StaticSound;
|
||||
using ::Shared::Graphics::Texture2D;
|
||||
using ::Shared::Graphics::Texture3D;
|
||||
using ::Shared::Graphics::Font2D;
|
||||
using ::Shared::Graphics::Font3D;
|
||||
using ::Shared::Sound::StrSound;
|
||||
using ::Shared::Sound::StaticSound;
|
||||
|
||||
// =====================================================
|
||||
// class CoreData
|
||||
|
@ -47,7 +47,7 @@ private:
|
|||
StrSound menuMusic;
|
||||
StaticSound clickSoundA;
|
||||
StaticSound clickSoundB;
|
||||
StaticSound clickSoundC;
|
||||
StaticSound clickSoundC;
|
||||
StaticSound attentionSound;
|
||||
StaticSound highlightSound;
|
||||
StaticSound markerSound;
|
||||
|
|
|
@ -941,7 +941,7 @@ Font3D *Renderer::newFont3D(ResourceScope rs){
|
|||
return fontManager[rs]->newFont3D();
|
||||
}
|
||||
|
||||
void Renderer::endFont(Shared::Graphics::Font *font, ResourceScope rs, bool mustExistInList) {
|
||||
void Renderer::endFont(::Shared::Graphics::Font *font, ResourceScope rs, bool mustExistInList) {
|
||||
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) {
|
||||
return;
|
||||
}
|
||||
|
@ -2576,7 +2576,7 @@ void Renderer::renderTextBoundingBox3D(const string &text, Font3D *font,
|
|||
for(int i = 0; i < useWidth; ++i) {
|
||||
temp += DEFAULT_CHAR_FOR_WIDTH_CALC;
|
||||
}
|
||||
float lineWidth = (font->getTextHandler()->Advance(temp.c_str()) * Shared::Graphics::Font::scaleFontValue);
|
||||
float lineWidth = (font->getTextHandler()->Advance(temp.c_str()) * ::Shared::Graphics::Font::scaleFontValue);
|
||||
useWidth = (int)lineWidth;
|
||||
|
||||
maxEditWidth = useWidth;
|
||||
|
@ -2642,7 +2642,7 @@ Vec2f Renderer::getCentered3DPos(const string &text, Font3D *font, Vec2f &pos, i
|
|||
throw megaglest_runtime_error("font->getTextHandler() == NULL (5)");
|
||||
}
|
||||
|
||||
float lineWidth = (font->getTextHandler()->Advance(text.c_str()) * Shared::Graphics::Font::scaleFontValue);
|
||||
float lineWidth = (font->getTextHandler()->Advance(text.c_str()) * ::Shared::Graphics::Font::scaleFontValue);
|
||||
if(lineWidth < w) {
|
||||
pos.x += ((w / 2.f) - (lineWidth / 2.f));
|
||||
}
|
||||
|
@ -2658,7 +2658,7 @@ Vec2f Renderer::getCentered3DPos(const string &text, Font3D *font, Vec2f &pos, i
|
|||
|
||||
//const Metrics &metrics= Metrics::getInstance();
|
||||
//float lineHeight = (font->getTextHandler()->LineHeight(text.c_str()) * Font::scaleFontValue);
|
||||
float lineHeight = (font->getTextHandler()->LineHeight(text.c_str()) * Shared::Graphics::Font::scaleFontValue);
|
||||
float lineHeight = (font->getTextHandler()->LineHeight(text.c_str()) * ::Shared::Graphics::Font::scaleFontValue);
|
||||
//lineHeight=metrics.toVirtualY(lineHeight);
|
||||
//lineHeight= lineHeight / (2.f + 0.2f * FontMetrics::DEFAULT_Y_OFFSET_FACTOR);
|
||||
//pos.y += (h / 2.f) - (lineHeight / 2.f);
|
||||
|
@ -2671,7 +2671,7 @@ Vec2f Renderer::getCentered3DPos(const string &text, Font3D *font, Vec2f &pos, i
|
|||
//if(Font::forceFTGLFonts == true) {
|
||||
// First go to top of bounding box
|
||||
pos.y += (h - lineHeight);
|
||||
pos.y -= ((h - lineHeight) / Shared::Graphics::Font::scaleFontValueCenterHFactor);
|
||||
pos.y -= ((h - lineHeight) / ::Shared::Graphics::Font::scaleFontValueCenterHFactor);
|
||||
// }
|
||||
// else {
|
||||
// pos.y += (float)(((float)h) / 2.0);
|
||||
|
@ -2718,7 +2718,7 @@ void Renderer::renderTextBoundingBox3D(const string &text, Font3D *font,
|
|||
for(int i = 0; i < useWidth; ++i) {
|
||||
temp += DEFAULT_CHAR_FOR_WIDTH_CALC;
|
||||
}
|
||||
float lineWidth = (font->getTextHandler()->Advance(temp.c_str()) * Shared::Graphics::Font::scaleFontValue);
|
||||
float lineWidth = (font->getTextHandler()->Advance(temp.c_str()) * ::Shared::Graphics::Font::scaleFontValue);
|
||||
useWidth = (int)lineWidth;
|
||||
|
||||
maxEditWidth = useWidth;
|
||||
|
@ -2794,7 +2794,7 @@ void Renderer::renderTextBoundingBox3D(const string &text, Font3D *font,
|
|||
for(int i = 0; i < useWidth; ++i) {
|
||||
temp += DEFAULT_CHAR_FOR_WIDTH_CALC;
|
||||
}
|
||||
float lineWidth = (font->getTextHandler()->Advance(temp.c_str()) * Shared::Graphics::Font::scaleFontValue);
|
||||
float lineWidth = (font->getTextHandler()->Advance(temp.c_str()) * ::Shared::Graphics::Font::scaleFontValue);
|
||||
useWidth = (int)lineWidth;
|
||||
|
||||
maxEditWidth = useWidth;
|
||||
|
@ -9259,7 +9259,7 @@ uint64 Renderer::getCurrentPixelByteCount(ResourceScope rs) const {
|
|||
uint64 result = 0;
|
||||
for(int i = (rs == rsCount ? 0 : rs); i < rsCount; ++i) {
|
||||
if(textureManager[i] != NULL) {
|
||||
const Shared::Graphics::TextureContainer &textures = textureManager[i]->getTextures();
|
||||
const ::Shared::Graphics::TextureContainer &textures = textureManager[i]->getTextures();
|
||||
for(int j = 0; j < (int)textures.size(); ++j) {
|
||||
const Texture *texture = textures[j];
|
||||
result += texture->getPixelByteCount();
|
||||
|
|
|
@ -55,8 +55,8 @@ enum DebugUILevelType {
|
|||
|
||||
namespace Glest{ namespace Game{
|
||||
|
||||
using namespace Shared::Graphics;
|
||||
using namespace Shared::PlatformCommon;
|
||||
using namespace ::Shared::Graphics;
|
||||
using namespace ::Shared::PlatformCommon;
|
||||
|
||||
//non shared classes
|
||||
class Config;
|
||||
|
@ -466,7 +466,7 @@ public:
|
|||
Texture3D *newTexture3D(ResourceScope rs);
|
||||
Font2D *newFont(ResourceScope rs);
|
||||
Font3D *newFont3D(ResourceScope rs);
|
||||
void endFont(Shared::Graphics::Font *font, ResourceScope rs, bool mustExistInList=false);
|
||||
void endFont(::Shared::Graphics::Font *font, ResourceScope rs, bool mustExistInList=false);
|
||||
void resetFontManager(ResourceScope rs);
|
||||
|
||||
inline TextRenderer2D *getTextRenderer() const {return textRenderer;}
|
||||
|
|
|
@ -288,7 +288,7 @@ void BattleEnd::initBackgroundMusic() {
|
|||
|
||||
void BattleEnd::initBackgroundVideo() {
|
||||
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false &&
|
||||
Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true) {
|
||||
::Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true) {
|
||||
|
||||
if(menuBackgroundVideo != NULL) {
|
||||
menuBackgroundVideo->closePlayer();
|
||||
|
|
|
@ -46,7 +46,7 @@ private:
|
|||
ProgramState *originState;
|
||||
const char *containerName;
|
||||
|
||||
Shared::Graphics::VideoPlayer *menuBackgroundVideo;
|
||||
::Shared::Graphics::VideoPlayer *menuBackgroundVideo;
|
||||
GameSettings *gameSettings;
|
||||
StrSound battleEndMusic;
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ Intro::Intro(Program *program):
|
|||
SoundRenderer &soundRenderer= SoundRenderer::getInstance();
|
||||
|
||||
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false &&
|
||||
(Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == false ||
|
||||
(::Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == false ||
|
||||
CoreData::getInstance().hasIntroVideoFilename() == false)) {
|
||||
soundRenderer.playMusic(CoreData::getInstance().getIntroMusic());
|
||||
}
|
||||
|
@ -509,7 +509,7 @@ Intro::Intro(Program *program):
|
|||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false &&
|
||||
Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true &&
|
||||
::Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true &&
|
||||
CoreData::getInstance().hasIntroVideoFilename() == true) {
|
||||
string introVideoFile = CoreData::getInstance().getIntroVideoFilename();
|
||||
string introVideoFileFallback = CoreData::getInstance().getIntroVideoFilenameFallback();
|
||||
|
@ -521,7 +521,7 @@ Intro::Intro(Program *program):
|
|||
|
||||
string vlcPluginsPath = Config::getInstance().getString("VideoPlayerPluginsPath","");
|
||||
//printf("screen->w = %d screen->h = %d screen->format->BitsPerPixel = %d\n",screen->w,screen->h,screen->format->BitsPerPixel);
|
||||
Shared::Graphics::VideoPlayer player(
|
||||
::Shared::Graphics::VideoPlayer player(
|
||||
&Renderer::getInstance(),
|
||||
introVideoFile,
|
||||
introVideoFileFallback,
|
||||
|
|
|
@ -662,7 +662,7 @@ void stackdumper(unsigned int type, EXCEPTION_POINTERS *ep, bool fatalExit) {
|
|||
|
||||
if(glActiveTexture != NULL) {
|
||||
for(;GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false && mainProgram->isMessageShowing();) {
|
||||
Shared::Platform::Window::handleEvent();
|
||||
::Shared::Platform::Window::handleEvent();
|
||||
try {
|
||||
mainProgram->loop();
|
||||
}
|
||||
|
@ -682,7 +682,7 @@ void stackdumper(unsigned int type, EXCEPTION_POINTERS *ep, bool fatalExit) {
|
|||
|
||||
if(glActiveTexture != NULL) {
|
||||
for(;GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false && mainProgram->isMessageShowing();) {
|
||||
Shared::Platform::Window::handleEvent();
|
||||
::Shared::Platform::Window::handleEvent();
|
||||
try {
|
||||
mainProgram->loop();
|
||||
}
|
||||
|
@ -4022,7 +4022,7 @@ int glestMain(int argc, char** argv) {
|
|||
if( haveSpecialOutputCommandLineOption == false ||
|
||||
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VERSION]) == true) {
|
||||
printf("%s %s",extractFileFromDirectoryPath(argv[0]).c_str(),getNetworkPlatformFreeVersionString().c_str());
|
||||
printf("\nCompiled using: %s on: %s platform: %s endianness: %s",getCompilerNameString().c_str(),getCompileDateTime().c_str(),getPlatformNameString().c_str(),(Shared::PlatformByteOrder::isBigEndian() == true ? "big" : "little"));
|
||||
printf("\nCompiled using: %s on: %s platform: %s endianness: %s",getCompilerNameString().c_str(),getCompileDateTime().c_str(),getPlatformNameString().c_str(),(::Shared::PlatformByteOrder::isBigEndian() == true ? "big" : "little"));
|
||||
|
||||
// printf("\n\nData type sizes int8 = " MG_SIZE_T_SPECIFIER " int16 = " MG_SIZE_T_SPECIFIER " int32 = " MG_SIZE_T_SPECIFIER " int64 = " MG_SIZE_T_SPECIFIER "\n\n",sizeof(int8),sizeof(int16),sizeof(int32),sizeof(int64));
|
||||
//
|
||||
|
@ -4089,9 +4089,9 @@ int glestMain(int argc, char** argv) {
|
|||
if(SystemFlags::VERBOSE_MODE_ENABLED == true) {
|
||||
int8 testVar = 111;
|
||||
printf("\nEndian value = %d",testVar);
|
||||
testVar = Shared::PlatformByteOrder::toCommonEndian(testVar);
|
||||
testVar = ::Shared::PlatformByteOrder::toCommonEndian(testVar);
|
||||
printf("\nEndian to common value = %d",testVar);
|
||||
testVar = Shared::PlatformByteOrder::fromCommonEndian(testVar);
|
||||
testVar = ::Shared::PlatformByteOrder::fromCommonEndian(testVar);
|
||||
printf("\nEndian from common value = %d",testVar);
|
||||
|
||||
printf("\nint8 sizeof = " MG_SIZE_T_SPECIFIER "",sizeof(int8));
|
||||
|
@ -4421,7 +4421,7 @@ int glestMain(int argc, char** argv) {
|
|||
}
|
||||
|
||||
if(config.getBool("ForceFTGLFonts","false") == true || hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_FORCE_FTGLFONTS]) == true) {
|
||||
Shared::Graphics::Font::forceFTGLFonts = true;
|
||||
::Shared::Graphics::Font::forceFTGLFonts = true;
|
||||
printf("**WARNING** Forcing use of FTGL Fonts\n");
|
||||
}
|
||||
else {
|
||||
|
@ -4429,7 +4429,7 @@ int glestMain(int argc, char** argv) {
|
|||
}
|
||||
|
||||
if(config.getBool("EnableLegacyFonts","false") == true || hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_ENABLE_LEGACYFONTS]) == true) {
|
||||
Shared::Graphics::Font::forceLegacyFonts = true;
|
||||
::Shared::Graphics::Font::forceLegacyFonts = true;
|
||||
Renderer::renderText3DEnabled = false;
|
||||
printf("**WARNING** Forcing Legacy Fonts Enabled\n");
|
||||
}
|
||||
|
@ -4574,20 +4574,20 @@ int glestMain(int argc, char** argv) {
|
|||
|
||||
// 256 for English
|
||||
// 30000 for Chinese
|
||||
Shared::Graphics::Font::charCount = config.getInt("FONT_CHARCOUNT",intToStr(Shared::Graphics::Font::charCount).c_str());
|
||||
Shared::Graphics::Font::fontTypeName = config.getString("FONT_TYPENAME",Shared::Graphics::Font::fontTypeName.c_str());
|
||||
Shared::Graphics::Font::fontIsMultibyte = config.getBool("FONT_MULTIBYTE",intToStr(Shared::Graphics::Font::fontIsMultibyte).c_str());
|
||||
Shared::Graphics::Font::fontIsRightToLeft = config.getBool("FONT_RIGHTTOLEFT",intToStr(Shared::Graphics::Font::fontIsRightToLeft).c_str());
|
||||
Shared::Graphics::Font::baseSize = config.getInt("FONT_BASE_SIZE",intToStr(Shared::Graphics::Font::baseSize).c_str());
|
||||
Shared::Graphics::Font::scaleFontValue = config.getFloat("FONT_SCALE_SIZE",floatToStr(Shared::Graphics::Font::scaleFontValue).c_str());
|
||||
Shared::Graphics::Font::scaleFontValueCenterHFactor = config.getFloat("FONT_SCALE_CENTERH_FACTOR",floatToStr(Shared::Graphics::Font::scaleFontValueCenterHFactor).c_str());
|
||||
Shared::Graphics::Font::langHeightText = config.getString("FONT_HEIGHT_TEXT",Shared::Graphics::Font::langHeightText.c_str());
|
||||
Shared::Graphics::Font::fontSupportMixedRightToLeft = config.getBool("FONT_RIGHTTOLEFT_MIXED_SUPPORT",intToStr(Shared::Graphics::Font::fontSupportMixedRightToLeft).c_str());
|
||||
::Shared::Graphics::Font::charCount = config.getInt("FONT_CHARCOUNT",intToStr(::Shared::Graphics::Font::charCount).c_str());
|
||||
::Shared::Graphics::Font::fontTypeName = config.getString("FONT_TYPENAME",::Shared::Graphics::Font::fontTypeName.c_str());
|
||||
::Shared::Graphics::Font::fontIsMultibyte = config.getBool("FONT_MULTIBYTE",intToStr(::Shared::Graphics::Font::fontIsMultibyte).c_str());
|
||||
::Shared::Graphics::Font::fontIsRightToLeft = config.getBool("FONT_RIGHTTOLEFT",intToStr(::Shared::Graphics::Font::fontIsRightToLeft).c_str());
|
||||
::Shared::Graphics::Font::baseSize = config.getInt("FONT_BASE_SIZE",intToStr(::Shared::Graphics::Font::baseSize).c_str());
|
||||
::Shared::Graphics::Font::scaleFontValue = config.getFloat("FONT_SCALE_SIZE",floatToStr(::Shared::Graphics::Font::scaleFontValue).c_str());
|
||||
::Shared::Graphics::Font::scaleFontValueCenterHFactor = config.getFloat("FONT_SCALE_CENTERH_FACTOR",floatToStr(::Shared::Graphics::Font::scaleFontValueCenterHFactor).c_str());
|
||||
::Shared::Graphics::Font::langHeightText = config.getString("FONT_HEIGHT_TEXT",::Shared::Graphics::Font::langHeightText.c_str());
|
||||
::Shared::Graphics::Font::fontSupportMixedRightToLeft = config.getBool("FONT_RIGHTTOLEFT_MIXED_SUPPORT",intToStr(::Shared::Graphics::Font::fontSupportMixedRightToLeft).c_str());
|
||||
|
||||
// Example values:
|
||||
// DEFAULT_CHARSET (English) = 1
|
||||
// GB2312_CHARSET (Chinese) = 134
|
||||
Shared::Platform::PlatformContextGl::charSet = config.getInt("FONT_CHARSET",intToStr(Shared::Platform::PlatformContextGl::charSet).c_str());
|
||||
::Shared::Platform::PlatformContextGl::charSet = config.getInt("FONT_CHARSET",intToStr(::Shared::Platform::PlatformContextGl::charSet).c_str());
|
||||
if(config.getBool("No2DMouseRendering","false") == false) {
|
||||
showCursor(false);
|
||||
}
|
||||
|
@ -4595,8 +4595,8 @@ int glestMain(int argc, char** argv) {
|
|||
SystemFlags::DEFAULT_HTTP_TIMEOUT = config.getInt("DEFAULT_HTTP_TIMEOUT",intToStr(SystemFlags::DEFAULT_HTTP_TIMEOUT).c_str());
|
||||
}
|
||||
|
||||
bool allowAltEnterFullscreenToggle = config.getBool("AllowAltEnterFullscreenToggle",boolToStr(Shared::Platform::Window::getAllowAltEnterFullscreenToggle()).c_str());
|
||||
Shared::Platform::Window::setAllowAltEnterFullscreenToggle(allowAltEnterFullscreenToggle);
|
||||
bool allowAltEnterFullscreenToggle = config.getBool("AllowAltEnterFullscreenToggle",boolToStr(::Shared::Platform::Window::getAllowAltEnterFullscreenToggle()).c_str());
|
||||
::Shared::Platform::Window::setAllowAltEnterFullscreenToggle(allowAltEnterFullscreenToggle);
|
||||
|
||||
if(config.getBool("noTeamColors","false") == true) {
|
||||
MeshCallbackTeamColor::noTeamColors = true;
|
||||
|
@ -4605,7 +4605,7 @@ int glestMain(int argc, char** argv) {
|
|||
// Setup debug logging etc
|
||||
setupLogging(config, haveSpecialOutputCommandLineOption);
|
||||
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Font::charCount = %d, Font::fontTypeName [%s] Shared::Platform::PlatformContextGl::charSet = %d, Font::fontIsMultibyte = %d, fontIsRightToLeft = %d\n",__FILE__,__FUNCTION__,__LINE__,Shared::Graphics::Font::charCount,Shared::Graphics::Font::fontTypeName.c_str(),Shared::Platform::PlatformContextGl::charSet,Shared::Graphics::Font::fontIsMultibyte, Shared::Graphics::Font::fontIsRightToLeft);
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Font::charCount = %d, Font::fontTypeName [%s] Shared::Platform::PlatformContextGl::charSet = %d, Font::fontIsMultibyte = %d, fontIsRightToLeft = %d\n",__FILE__,__FUNCTION__,__LINE__,::Shared::Graphics::Font::charCount,::Shared::Graphics::Font::fontTypeName.c_str(),::Shared::Platform::PlatformContextGl::charSet,::Shared::Graphics::Font::fontIsMultibyte, ::Shared::Graphics::Font::fontIsRightToLeft);
|
||||
|
||||
NetworkInterface::setDisplayMessageFunction(ExceptionHandler::DisplayMessage);
|
||||
MenuStateMasterserver::setDisplayMessageFunction(ExceptionHandler::DisplayMessage);
|
||||
|
@ -4640,7 +4640,7 @@ int glestMain(int argc, char** argv) {
|
|||
}
|
||||
|
||||
if(config.getBool("EnableVSynch","false") == true) {
|
||||
Shared::Platform::Window::setTryVSynch(true);
|
||||
::Shared::Platform::Window::setTryVSynch(true);
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("**ENABLED OPENGL VSYNCH**\n");
|
||||
}
|
||||
|
||||
|
@ -4749,7 +4749,7 @@ int glestMain(int argc, char** argv) {
|
|||
lang.loadGameStrings(language,false, true);
|
||||
|
||||
if( lang.hasString("FONT_HEIGHT_TEXT")) {
|
||||
Shared::Graphics::Font::langHeightText = config.getString("FONT_HEIGHT_TEXT",Shared::Graphics::Font::langHeightText.c_str());
|
||||
::Shared::Graphics::Font::langHeightText = config.getString("FONT_HEIGHT_TEXT",::Shared::Graphics::Font::langHeightText.c_str());
|
||||
}
|
||||
|
||||
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_FONT_BASESIZE]) == true) {
|
||||
|
@ -4765,7 +4765,7 @@ int glestMain(int argc, char** argv) {
|
|||
string newfontBaseSize = paramPartTokens[1];
|
||||
printf("Forcing font base size[%s]\n",newfontBaseSize.c_str());
|
||||
|
||||
Shared::Graphics::Font::baseSize = strToInt(newfontBaseSize);
|
||||
::Shared::Graphics::Font::baseSize = strToInt(newfontBaseSize);
|
||||
}
|
||||
else {
|
||||
printf("\nInvalid missing font base size specified on commandline [%s] value [%s]\n\n",argv[foundParamIndIndex],(paramPartTokens.size() >= 2 ? paramPartTokens[1].c_str() : NULL));
|
||||
|
@ -4774,8 +4774,8 @@ int glestMain(int argc, char** argv) {
|
|||
}
|
||||
}
|
||||
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Font::charCount = %d, Font::fontTypeName [%s] Shared::Platform::PlatformContextGl::charSet = %d, Font::fontIsMultibyte = %d, Font::fontIsRightToLeft = %d\n",__FILE__,__FUNCTION__,__LINE__,Shared::Graphics::Font::charCount,Shared::Graphics::Font::fontTypeName.c_str(),Shared::Platform::PlatformContextGl::charSet,Shared::Graphics::Font::fontIsMultibyte,Shared::Graphics::Font::fontIsRightToLeft);
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Using Font::charCount = %d, Font::fontTypeName [%s] Shared::Platform::PlatformContextGl::charSet = %d, Font::fontIsMultibyte = %d, Font::fontIsRightToLeft = %d\n",Shared::Graphics::Font::charCount,Shared::Graphics::Font::fontTypeName.c_str(),Shared::Platform::PlatformContextGl::charSet,Shared::Graphics::Font::fontIsMultibyte,Shared::Graphics::Font::fontIsRightToLeft);
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Font::charCount = %d, Font::fontTypeName [%s] Shared::Platform::PlatformContextGl::charSet = %d, Font::fontIsMultibyte = %d, Font::fontIsRightToLeft = %d\n",__FILE__,__FUNCTION__,__LINE__,::Shared::Graphics::Font::charCount,::Shared::Graphics::Font::fontTypeName.c_str(),::Shared::Platform::PlatformContextGl::charSet,::Shared::Graphics::Font::fontIsMultibyte,::Shared::Graphics::Font::fontIsRightToLeft);
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Using Font::charCount = %d, Font::fontTypeName [%s] Shared::Platform::PlatformContextGl::charSet = %d, Font::fontIsMultibyte = %d, Font::fontIsRightToLeft = %d\n",::Shared::Graphics::Font::charCount,::Shared::Graphics::Font::fontTypeName.c_str(),::Shared::Platform::PlatformContextGl::charSet,::Shared::Graphics::Font::fontIsMultibyte,::Shared::Graphics::Font::fontIsRightToLeft);
|
||||
|
||||
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_USE_FONT]) == true) {
|
||||
int foundParamIndIndex = -1;
|
||||
|
@ -5146,7 +5146,7 @@ int glestMain(int argc, char** argv) {
|
|||
}
|
||||
|
||||
sleep(0);
|
||||
Shared::Platform::Window::handleEvent();
|
||||
::Shared::Platform::Window::handleEvent();
|
||||
SDL_PumpEvents();
|
||||
|
||||
int result = 0;
|
||||
|
@ -5177,7 +5177,7 @@ int glestMain(int argc, char** argv) {
|
|||
renderer.swapBuffers();
|
||||
|
||||
sleep(0);
|
||||
Shared::Platform::Window::handleEvent();
|
||||
::Shared::Platform::Window::handleEvent();
|
||||
SDL_PumpEvents();
|
||||
|
||||
Model *model = renderer.newModel(rsGlobal);
|
||||
|
@ -5322,7 +5322,7 @@ int glestMain(int argc, char** argv) {
|
|||
//throw 123;
|
||||
|
||||
//main loop
|
||||
while(program->isShutdownApplicationEnabled() == false && Shared::Platform::Window::handleEvent()) {
|
||||
while(program->isShutdownApplicationEnabled() == false && ::Shared::Platform::Window::handleEvent()) {
|
||||
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) {
|
||||
|
||||
if(disableheadless_console == false) {
|
||||
|
|
|
@ -113,7 +113,7 @@ void MainMenu::init() {
|
|||
|
||||
void MainMenu::initBackgroundVideo() {
|
||||
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false &&
|
||||
Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true &&
|
||||
::Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true &&
|
||||
CoreData::getInstance().hasMainMenuVideoFilename() == true) {
|
||||
string introVideoFile = CoreData::getInstance().getMainMenuVideoFilename();
|
||||
string introVideoFileFallback = CoreData::getInstance().getMainMenuVideoFilenameFallback();
|
||||
|
|
|
@ -51,7 +51,7 @@ private:
|
|||
//shared
|
||||
GameSettings gameSettings;
|
||||
MenuBackground menuBackground;
|
||||
Shared::Graphics::VideoPlayer *menuBackgroundVideo;
|
||||
::Shared::Graphics::VideoPlayer *menuBackgroundVideo;
|
||||
|
||||
MenuState *state;
|
||||
|
||||
|
|
|
@ -1124,8 +1124,8 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){
|
|||
|
||||
string advanceToItemStartingWith = "";
|
||||
if(mainMessageBox.getEnabled() == false) {
|
||||
if(Shared::Platform::Window::isKeyStateModPressed(KMOD_SHIFT) == true) {
|
||||
wchar_t lastKey = Shared::Platform::Window::extractLastKeyPressed();
|
||||
if(::Shared::Platform::Window::isKeyStateModPressed(KMOD_SHIFT) == true) {
|
||||
wchar_t lastKey = ::Shared::Platform::Window::extractLastKeyPressed();
|
||||
//printf("lastKey = %d [%c]\n",lastKey,lastKey);
|
||||
advanceToItemStartingWith = lastKey;
|
||||
}
|
||||
|
@ -2367,7 +2367,7 @@ void MenuStateConnectedGame::render() {
|
|||
}
|
||||
else {
|
||||
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false &&
|
||||
Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true) {
|
||||
::Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true) {
|
||||
if(factionVideo != NULL) {
|
||||
factionVideo->closePlayer();
|
||||
delete factionVideo;
|
||||
|
@ -3536,7 +3536,7 @@ void MenuStateConnectedGame::keyDown(SDL_KeyboardEvent key) {
|
|||
chatManager.keyDown(key);
|
||||
}
|
||||
if(chatManager.getEditEnabled() == false &&
|
||||
(Shared::Platform::Window::isKeyStateModPressed(KMOD_SHIFT) == false)) {
|
||||
(::Shared::Platform::Window::isKeyStateModPressed(KMOD_SHIFT) == false)) {
|
||||
Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys));
|
||||
|
||||
if(isKeyPressed(configKeys.getSDLKey("ShowFullConsole"),key) == true) {
|
||||
|
@ -4693,7 +4693,7 @@ void MenuStateConnectedGame::initFactionPreview(const GameSettings *gameSettings
|
|||
if(currentFactionLogo != factionVideoUrl) {
|
||||
currentFactionLogo = factionVideoUrl;
|
||||
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false &&
|
||||
Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true) {
|
||||
::Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true) {
|
||||
|
||||
if(factionVideo != NULL) {
|
||||
factionVideo->closePlayer();
|
||||
|
|
|
@ -137,7 +137,7 @@ private:
|
|||
string currentFactionName_factionPreview;
|
||||
string currentFactionLogo;
|
||||
Texture2D *factionTexture;
|
||||
Shared::Graphics::VideoPlayer *factionVideo;
|
||||
::Shared::Graphics::VideoPlayer *factionVideo;
|
||||
bool factionVideoSwitchedOffVolume;
|
||||
|
||||
MapPreview mapPreview;
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
namespace Glest{ namespace Game{
|
||||
|
||||
using namespace Shared::Util;
|
||||
using namespace ::Shared::Util;
|
||||
|
||||
const int MASTERSERVER_BROADCAST_MAX_WAIT_RESPONSE_SECONDS = 15;
|
||||
const int MASTERSERVER_BROADCAST_PUBLISH_SECONDS = 6;
|
||||
|
@ -1035,8 +1035,8 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton) {
|
|||
}
|
||||
else {
|
||||
string advanceToItemStartingWith = "";
|
||||
if(Shared::Platform::Window::isKeyStateModPressed(KMOD_SHIFT) == true) {
|
||||
const wchar_t lastKey = Shared::Platform::Window::extractLastKeyPressed();
|
||||
if(::Shared::Platform::Window::isKeyStateModPressed(KMOD_SHIFT) == true) {
|
||||
const wchar_t lastKey = ::Shared::Platform::Window::extractLastKeyPressed();
|
||||
// xxx:
|
||||
// string hehe=lastKey;
|
||||
// printf("lastKey = %d [%c] '%s'\n",lastKey,lastKey,hehe);
|
||||
|
@ -1325,7 +1325,7 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton) {
|
|||
int slotsToChangeStart = i;
|
||||
int slotsToChangeEnd = i;
|
||||
// If control is pressed while changing player types then change all other slots to same type
|
||||
if(Shared::Platform::Window::isKeyStateModPressed(KMOD_CTRL) == true &&
|
||||
if(::Shared::Platform::Window::isKeyStateModPressed(KMOD_CTRL) == true &&
|
||||
currentControlType != ctHuman) {
|
||||
slotsToChangeStart = 0;
|
||||
slotsToChangeEnd = mapInfo.players-1;
|
||||
|
@ -1956,7 +1956,7 @@ void MenuStateCustomGame::render() {
|
|||
}
|
||||
else {
|
||||
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false &&
|
||||
Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true) {
|
||||
::Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true) {
|
||||
if(factionVideo != NULL) {
|
||||
factionVideo->closePlayer();
|
||||
delete factionVideo;
|
||||
|
@ -2867,7 +2867,7 @@ void MenuStateCustomGame::initFactionPreview(const GameSettings *gameSettings) {
|
|||
if(currentFactionLogo != factionVideoUrl) {
|
||||
currentFactionLogo = factionVideoUrl;
|
||||
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false &&
|
||||
Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true) {
|
||||
::Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true) {
|
||||
|
||||
if(factionVideo != NULL) {
|
||||
factionVideo->closePlayer();
|
||||
|
@ -4246,7 +4246,7 @@ void MenuStateCustomGame::keyDown(SDL_KeyboardEvent key) {
|
|||
chatManager.keyDown(key);
|
||||
}
|
||||
if(chatManager.getEditEnabled() == false &&
|
||||
(Shared::Platform::Window::isKeyStateModPressed(KMOD_SHIFT) == false) ) {
|
||||
(::Shared::Platform::Window::isKeyStateModPressed(KMOD_SHIFT) == false) ) {
|
||||
Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys));
|
||||
|
||||
//if(key == configKeys.getCharKey("ShowFullConsole")) {
|
||||
|
|
|
@ -187,7 +187,7 @@ private:
|
|||
string currentFactionName_factionPreview;
|
||||
string currentFactionLogo;
|
||||
Texture2D *factionTexture;
|
||||
Shared::Graphics::VideoPlayer *factionVideo;
|
||||
::Shared::Graphics::VideoPlayer *factionVideo;
|
||||
bool factionVideoSwitchedOffVolume;
|
||||
|
||||
MapPreview mapPreview;
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
namespace Glest{ namespace Game{
|
||||
|
||||
using namespace Shared::Util;
|
||||
using namespace ::Shared::Util;
|
||||
|
||||
// ===============================
|
||||
// class MenuStateJoinGame
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
namespace Glest{ namespace Game{
|
||||
|
||||
using namespace Shared::Util;
|
||||
using namespace ::Shared::Util;
|
||||
|
||||
struct FormatString {
|
||||
void operator()(string &s) {
|
||||
|
|
|
@ -47,7 +47,7 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m
|
|||
this->console.setOnlyChatMessagesInStoredLines(false);
|
||||
screenModeChangedTimer= time(NULL); // just init
|
||||
//modeinfos=list<ModeInfo> ();
|
||||
Shared::PlatformCommon::getFullscreenVideoModes(&modeInfos,!config.getBool("Windowed"));
|
||||
::Shared::PlatformCommon::getFullscreenVideoModes(&modeInfos,!config.getBool("Windowed"));
|
||||
|
||||
int leftLabelStart=50;
|
||||
int leftColumnStart=leftLabelStart+280;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
namespace Glest{ namespace Game{
|
||||
|
||||
using namespace Shared::Xml;
|
||||
using namespace ::Shared::Xml;
|
||||
|
||||
// =====================================================
|
||||
// class MenuStateScenario
|
||||
|
@ -221,8 +221,8 @@ void MenuStateScenario::mouseClick(int x, int y, MouseButton mouseButton) {
|
|||
return;
|
||||
}
|
||||
else {
|
||||
if(Shared::Platform::Window::isKeyStateModPressed(KMOD_SHIFT) == true) {
|
||||
const wchar_t lastKey = Shared::Platform::Window::extractLastKeyPressed();
|
||||
if(::Shared::Platform::Window::isKeyStateModPressed(KMOD_SHIFT) == true) {
|
||||
const wchar_t lastKey = ::Shared::Platform::Window::extractLastKeyPressed();
|
||||
// xxx:
|
||||
// string hehe=lastKey;
|
||||
// printf("lastKey = %d [%c] '%s'\n",lastKey,lastKey,hehe);
|
||||
|
|
|
@ -98,37 +98,37 @@ string NetworkCommand::toString() const {
|
|||
}
|
||||
|
||||
void NetworkCommand::toEndian() {
|
||||
networkCommandType = Shared::PlatformByteOrder::toCommonEndian(networkCommandType);
|
||||
unitId = Shared::PlatformByteOrder::toCommonEndian(unitId);
|
||||
unitTypeId = Shared::PlatformByteOrder::toCommonEndian(unitTypeId);
|
||||
commandTypeId = Shared::PlatformByteOrder::toCommonEndian(commandTypeId);
|
||||
positionX = Shared::PlatformByteOrder::toCommonEndian(positionX);
|
||||
positionY = Shared::PlatformByteOrder::toCommonEndian(positionY);
|
||||
targetId = Shared::PlatformByteOrder::toCommonEndian(targetId);
|
||||
wantQueue = Shared::PlatformByteOrder::toCommonEndian(wantQueue);
|
||||
fromFactionIndex = Shared::PlatformByteOrder::toCommonEndian(fromFactionIndex);
|
||||
unitFactionUnitCount = Shared::PlatformByteOrder::toCommonEndian(unitFactionUnitCount);
|
||||
unitFactionIndex = Shared::PlatformByteOrder::toCommonEndian(unitFactionIndex);
|
||||
commandStateType = Shared::PlatformByteOrder::toCommonEndian(commandStateType);
|
||||
commandStateValue = Shared::PlatformByteOrder::toCommonEndian(commandStateValue);
|
||||
unitCommandGroupId = Shared::PlatformByteOrder::toCommonEndian(unitCommandGroupId);
|
||||
networkCommandType = ::Shared::PlatformByteOrder::toCommonEndian(networkCommandType);
|
||||
unitId = ::Shared::PlatformByteOrder::toCommonEndian(unitId);
|
||||
unitTypeId = ::Shared::PlatformByteOrder::toCommonEndian(unitTypeId);
|
||||
commandTypeId = ::Shared::PlatformByteOrder::toCommonEndian(commandTypeId);
|
||||
positionX = ::Shared::PlatformByteOrder::toCommonEndian(positionX);
|
||||
positionY = ::Shared::PlatformByteOrder::toCommonEndian(positionY);
|
||||
targetId = ::Shared::PlatformByteOrder::toCommonEndian(targetId);
|
||||
wantQueue = ::Shared::PlatformByteOrder::toCommonEndian(wantQueue);
|
||||
fromFactionIndex = ::Shared::PlatformByteOrder::toCommonEndian(fromFactionIndex);
|
||||
unitFactionUnitCount = ::Shared::PlatformByteOrder::toCommonEndian(unitFactionUnitCount);
|
||||
unitFactionIndex = ::Shared::PlatformByteOrder::toCommonEndian(unitFactionIndex);
|
||||
commandStateType = ::Shared::PlatformByteOrder::toCommonEndian(commandStateType);
|
||||
commandStateValue = ::Shared::PlatformByteOrder::toCommonEndian(commandStateValue);
|
||||
unitCommandGroupId = ::Shared::PlatformByteOrder::toCommonEndian(unitCommandGroupId);
|
||||
|
||||
}
|
||||
void NetworkCommand::fromEndian() {
|
||||
networkCommandType = Shared::PlatformByteOrder::fromCommonEndian(networkCommandType);
|
||||
unitId = Shared::PlatformByteOrder::fromCommonEndian(unitId);
|
||||
unitTypeId = Shared::PlatformByteOrder::fromCommonEndian(unitTypeId);
|
||||
commandTypeId = Shared::PlatformByteOrder::fromCommonEndian(commandTypeId);
|
||||
positionX = Shared::PlatformByteOrder::fromCommonEndian(positionX);
|
||||
positionY = Shared::PlatformByteOrder::fromCommonEndian(positionY);
|
||||
targetId = Shared::PlatformByteOrder::fromCommonEndian(targetId);
|
||||
wantQueue = Shared::PlatformByteOrder::fromCommonEndian(wantQueue);
|
||||
fromFactionIndex = Shared::PlatformByteOrder::fromCommonEndian(fromFactionIndex);
|
||||
unitFactionUnitCount = Shared::PlatformByteOrder::fromCommonEndian(unitFactionUnitCount);
|
||||
unitFactionIndex = Shared::PlatformByteOrder::fromCommonEndian(unitFactionIndex);
|
||||
commandStateType = Shared::PlatformByteOrder::fromCommonEndian(commandStateType);
|
||||
commandStateValue = Shared::PlatformByteOrder::fromCommonEndian(commandStateValue);
|
||||
unitCommandGroupId = Shared::PlatformByteOrder::fromCommonEndian(unitCommandGroupId);
|
||||
networkCommandType = ::Shared::PlatformByteOrder::fromCommonEndian(networkCommandType);
|
||||
unitId = ::Shared::PlatformByteOrder::fromCommonEndian(unitId);
|
||||
unitTypeId = ::Shared::PlatformByteOrder::fromCommonEndian(unitTypeId);
|
||||
commandTypeId = ::Shared::PlatformByteOrder::fromCommonEndian(commandTypeId);
|
||||
positionX = ::Shared::PlatformByteOrder::fromCommonEndian(positionX);
|
||||
positionY = ::Shared::PlatformByteOrder::fromCommonEndian(positionY);
|
||||
targetId = ::Shared::PlatformByteOrder::fromCommonEndian(targetId);
|
||||
wantQueue = ::Shared::PlatformByteOrder::fromCommonEndian(wantQueue);
|
||||
fromFactionIndex = ::Shared::PlatformByteOrder::fromCommonEndian(fromFactionIndex);
|
||||
unitFactionUnitCount = ::Shared::PlatformByteOrder::fromCommonEndian(unitFactionUnitCount);
|
||||
unitFactionIndex = ::Shared::PlatformByteOrder::fromCommonEndian(unitFactionIndex);
|
||||
commandStateType = ::Shared::PlatformByteOrder::fromCommonEndian(commandStateType);
|
||||
commandStateValue = ::Shared::PlatformByteOrder::fromCommonEndian(commandStateValue);
|
||||
unitCommandGroupId = ::Shared::PlatformByteOrder::fromCommonEndian(unitCommandGroupId);
|
||||
}
|
||||
|
||||
XmlNode * NetworkCommand::saveGame(XmlNode *rootNode) {
|
||||
|
|
|
@ -71,7 +71,7 @@ private:
|
|||
time_t lastMasterserverHeartbeatTime;
|
||||
bool needToRepublishToMasterserver;
|
||||
|
||||
Shared::PlatformCommon::FTPServerThread *ftpServer;
|
||||
::Shared::PlatformCommon::FTPServerThread *ftpServer;
|
||||
bool exitServer;
|
||||
int64 nextEventId;
|
||||
|
||||
|
|
|
@ -27,11 +27,11 @@
|
|||
|
||||
namespace Glest{ namespace Game{
|
||||
|
||||
using Shared::Sound::StrSound;
|
||||
using Shared::Sound::StaticSound;
|
||||
using Shared::Sound::SoundPlayer;
|
||||
using Shared::Graphics::Vec3f;
|
||||
using namespace Shared::PlatformCommon;
|
||||
using ::Shared::Sound::StrSound;
|
||||
using ::Shared::Sound::StaticSound;
|
||||
using ::Shared::Sound::SoundPlayer;
|
||||
using ::Shared::Graphics::Vec3f;
|
||||
using namespace ::Shared::PlatformCommon;
|
||||
|
||||
// =====================================================
|
||||
// class SoundRenderer
|
||||
|
|
|
@ -3878,7 +3878,7 @@ void Unit::startDamageParticles() {
|
|||
ups->setOffset(Vec3f(0,2,0));
|
||||
ups->setDirection(Vec3f(0,1,-0.2f));
|
||||
ups->setRadius(type->getSize()/3.f);
|
||||
ups->setShape(Shared::Graphics::UnitParticleSystem::sLinear);
|
||||
ups->setShape(::Shared::Graphics::UnitParticleSystem::sLinear);
|
||||
ups->setTexture(CoreData::getInstance().getFireTexture());
|
||||
const Game *game = Renderer::getInstance().getGame();
|
||||
ups->setSpeed(2.0f / game->getWorld()->getUpdateFps(this->getFactionIndex()));
|
||||
|
|
|
@ -413,7 +413,7 @@ Checksum Map::load(const string &path, TechTree *techTree, Tileset *tileset) {
|
|||
snprintf(szBuf,8096,"fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.",readBytes,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
x = Shared::PlatformByteOrder::fromCommonEndian(x);
|
||||
x = ::Shared::PlatformByteOrder::fromCommonEndian(x);
|
||||
|
||||
readBytes = fread(&y, sizeof(int32), 1, f);
|
||||
if(readBytes != 1) {
|
||||
|
@ -421,7 +421,7 @@ Checksum Map::load(const string &path, TechTree *techTree, Tileset *tileset) {
|
|||
snprintf(szBuf,8096,"fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.",readBytes,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
y = Shared::PlatformByteOrder::fromCommonEndian(y);
|
||||
y = ::Shared::PlatformByteOrder::fromCommonEndian(y);
|
||||
|
||||
startLocations[i]= Vec2i(x, y)*cellScale;
|
||||
}
|
||||
|
@ -440,7 +440,7 @@ Checksum Map::load(const string &path, TechTree *techTree, Tileset *tileset) {
|
|||
snprintf(szBuf,8096,"fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.",readBytes,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
alt = Shared::PlatformByteOrder::fromCommonEndian(alt);
|
||||
alt = ::Shared::PlatformByteOrder::fromCommonEndian(alt);
|
||||
|
||||
SurfaceCell *sc= getSurfaceCell(i, j);
|
||||
sc->setVertex(Vec3f(i*mapScale, alt / heightFactor, j*mapScale));
|
||||
|
@ -457,7 +457,7 @@ Checksum Map::load(const string &path, TechTree *techTree, Tileset *tileset) {
|
|||
snprintf(szBuf,8096,"fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.",readBytes,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
surf = Shared::PlatformByteOrder::fromCommonEndian(surf);
|
||||
surf = ::Shared::PlatformByteOrder::fromCommonEndian(surf);
|
||||
|
||||
getSurfaceCell(i, j)->setSurfaceType(surf-1);
|
||||
}
|
||||
|
@ -474,7 +474,7 @@ Checksum Map::load(const string &path, TechTree *techTree, Tileset *tileset) {
|
|||
snprintf(szBuf,8096,"fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.",readBytes,__LINE__);
|
||||
throw megaglest_runtime_error(szBuf);
|
||||
}
|
||||
objNumber = Shared::PlatformByteOrder::fromCommonEndian(objNumber);
|
||||
objNumber = ::Shared::PlatformByteOrder::fromCommonEndian(objNumber);
|
||||
|
||||
SurfaceCell *sc= getSurfaceCell(toSurfCoords(Vec2i(i, j)));
|
||||
if(objNumber == 0) {
|
||||
|
|
|
@ -119,13 +119,13 @@ void World::cleanup() {
|
|||
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
for(std::map<string,StaticSound *>::iterator iterMap = staticSoundList.begin();
|
||||
for(std::map<string,::Shared::Sound::StaticSound *>::iterator iterMap = staticSoundList.begin();
|
||||
iterMap != staticSoundList.end(); ++iterMap) {
|
||||
delete iterMap->second;
|
||||
}
|
||||
staticSoundList.clear();
|
||||
|
||||
for(std::map<string,StrSound *>::iterator iterMap = streamSoundList.begin();
|
||||
for(std::map<string,::Shared::Sound::StrSound *>::iterator iterMap = streamSoundList.begin();
|
||||
iterMap != streamSoundList.end(); ++iterMap) {
|
||||
delete iterMap->second;
|
||||
}
|
||||
|
|
|
@ -49,8 +49,11 @@ class Config;
|
|||
class Game;
|
||||
class GameSettings;
|
||||
class ScriptManager;
|
||||
|
||||
namespace Shared{ namespace Sound{
|
||||
class StaticSound;
|
||||
class StrSound;
|
||||
}};
|
||||
|
||||
// =====================================================
|
||||
// class World
|
||||
|
@ -116,8 +119,8 @@ private:
|
|||
bool perfTimerEnabled;
|
||||
|
||||
bool unitParticlesEnabled;
|
||||
std::map<string,StaticSound *> staticSoundList;
|
||||
std::map<string,StrSound *> streamSoundList;
|
||||
std::map<string,::Shared::Sound::StaticSound *> staticSoundList;
|
||||
std::map<string,::Shared::Sound::StrSound *> streamSoundList;
|
||||
|
||||
uint32 nextCommandGroupId;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ template<class T> T EndianReverse(T t) {
|
|||
return t;
|
||||
}
|
||||
|
||||
static bool isBigEndian() {
|
||||
inline static bool isBigEndian() {
|
||||
short n = 0x1;
|
||||
return (*(char*)(&n) == 0x0);
|
||||
}
|
||||
|
|
|
@ -45,7 +45,6 @@ enum xml_engine_parser_type {
|
|||
XML_RAPIDXML_ENGINE = 1
|
||||
} ;
|
||||
|
||||
static xml_engine_parser_type DEFAULT_XML_ENGINE = XML_RAPIDXML_ENGINE;
|
||||
const int strSize= 8094;
|
||||
|
||||
class XmlIo;
|
||||
|
@ -129,7 +128,7 @@ private:
|
|||
void clearRootNode();
|
||||
|
||||
public:
|
||||
XmlTree(xml_engine_parser_type engine_type = DEFAULT_XML_ENGINE);
|
||||
XmlTree(xml_engine_parser_type engine_type = XML_RAPIDXML_ENGINE);
|
||||
~XmlTree();
|
||||
|
||||
void init(const string &name);
|
||||
|
|
|
@ -52,6 +52,7 @@ MapPreview::MapPreview() {
|
|||
title = "";
|
||||
desc = "";
|
||||
author = "";
|
||||
maxFactions = 0;
|
||||
refAlt = DEFAULT_MAP_CELL_HEIGHT;
|
||||
hasChanged = false;
|
||||
}
|
||||
|
@ -561,7 +562,7 @@ void MapPreview::reset(int w, int h, float alt, MapSurfaceType surf) {
|
|||
|
||||
this->w = w;
|
||||
this->h = h;
|
||||
this->maxFactions = maxFactions;
|
||||
//this->maxFactions = maxFactions;
|
||||
|
||||
//cells = new Cell*[w];
|
||||
cells.resize(w);
|
||||
|
@ -608,7 +609,7 @@ void MapPreview::resize(int w, int h, float alt, MapSurfaceType surf) {
|
|||
int oldH = this->h;
|
||||
this->w = w;
|
||||
this->h = h;
|
||||
this->maxFactions = maxFactions;
|
||||
//this->maxFactions = maxFactions;
|
||||
|
||||
//create new cells
|
||||
//Cell **oldCells = cells;
|
||||
|
|
|
@ -232,13 +232,13 @@ public:
|
|||
|
||||
void test_invalid_xml_engine_lowerbound() {
|
||||
xml_engine_parser_type testType = static_cast<xml_engine_parser_type>(XML_XERCES_ENGINE - 1);
|
||||
if(testType == XML_XERCES_ENGINE - 1) {
|
||||
if((int)testType == (int)(XML_XERCES_ENGINE - 1)) {
|
||||
XmlTree xml(testType);
|
||||
}
|
||||
}
|
||||
void test_invalid_xml_engine_upperbound() {
|
||||
xml_engine_parser_type testType = static_cast<xml_engine_parser_type>(XML_RAPIDXML_ENGINE + 1);
|
||||
if(testType == XML_RAPIDXML_ENGINE + 1) {
|
||||
if((int)testType == (int)(XML_RAPIDXML_ENGINE + 1)) {
|
||||
XmlTree xml(testType);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue