Qt 5: Build fixes for Qt 5 platform

Recent changes to the develop branch broke Qt 5 support.
This commit is contained in:
Thomas Perl 2013-08-01 09:20:17 +02:00 committed by Thomas Perl
parent 08807cb5f5
commit 6f967fc107
5 changed files with 25 additions and 25 deletions

View File

@ -158,47 +158,47 @@ Application::getResourceRootPath()
return m_resourceRootPath;
}
TargetPlatform
Application::Platform
Application::getTargetPlatform()
{
return kTargetLinux;
return Platform::OS_LINUX;
}
ccLanguageType
LanguageType
Application::getCurrentLanguage()
{
QLocale locale;
switch (locale.language()) {
case QLocale::English:
return kLanguageEnglish;
return LanguageType::ENGLISH;
case QLocale::Chinese:
return kLanguageChinese;
return LanguageType::CHINESE;
case QLocale::French:
return kLanguageFrench;
return LanguageType::FRENCH;
case QLocale::Italian:
return kLanguageItalian;
return LanguageType::ITALIAN;
case QLocale::German:
return kLanguageGerman;
return LanguageType::GERMAN;
case QLocale::Spanish:
return kLanguageSpanish;
return LanguageType::SPANISH;
case QLocale::Russian:
return kLanguageRussian;
return LanguageType::RUSSIAN;
case QLocale::Korean:
return kLanguageKorean;
return LanguageType::KOREAN;
case QLocale::Japanese:
return kLanguageJapanese;
return LanguageType::JAPANESE;
case QLocale::Hungarian:
return kLanguageHungarian;
return LanguageType::HUNGARIAN;
case QLocale::Portuguese:
return kLanguagePortuguese;
return LanguageType::PORTUGUESE;
case QLocale::Arabic:
return kLanguageArabic;
return LanguageType::ARABIC;
default:
break;
}
return kLanguageEnglish;
return LanguageType::ENGLISH;
}
NS_CC_END

View File

@ -64,7 +64,7 @@ class Application : public ApplicationProtocol {
CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication();
/* override functions */
virtual ccLanguageType getCurrentLanguage();
virtual LanguageType getCurrentLanguage();
/**
* Sets the Resource root path.
@ -81,7 +81,7 @@ class Application : public ApplicationProtocol {
/**
@brief Get target platform
*/
virtual TargetPlatform getTargetPlatform();
virtual Platform getTargetPlatform();
protected:
QGuiApplication *m_application;

View File

@ -68,7 +68,8 @@ Cocos2DQt5OpenGLIntegration::Cocos2DQt5OpenGLIntegration(EGLView *view, int widt
{
setSurfaceType(QSurface::OpenGLSurface);
resize(width, height);
showFullScreen();
//showFullScreen();
show();
m_context = new QOpenGLContext(this);
m_context->create();

View File

@ -63,7 +63,6 @@ SOURCES += ../actions/CCAction.cpp \
../particle_nodes/CCParticleBatchNode.cpp \
../platform/CCSAXParser.cpp \
../platform/CCThread.cpp \
../platform/CCImageCommonWebp.cpp \
../platform/CCEGLViewProtocol.cpp \
../platform/CCFileUtils.cpp \
../platform/qt5/CCCommon.cpp \
@ -102,9 +101,7 @@ SOURCES += ../actions/CCAction.cpp \
../textures/CCTexture2D.cpp \
../textures/CCTextureAtlas.cpp \
../textures/CCTextureCache.cpp \
../textures/CCTextureETC.cpp \
../textures/CCTexturePVR.cpp \
../textures/etc/etc1.cpp \
../platform/third_party/common/etc/etc1.cpp \
../tilemap_parallax_nodes/CCParallaxNode.cpp \
../tilemap_parallax_nodes/CCTMXLayer.cpp \
../tilemap_parallax_nodes/CCTMXObjectGroup.cpp \
@ -158,6 +155,7 @@ INCLUDEPATH += ../../extensions/GUI/CCControlExtension
INCLUDEPATH += ../../external/chipmunk/include/chipmunk
INCLUDEPATH += ../../extensions/network
INCLUDEPATH += ../../extensions/Components
INCLUDEPATH += ../platform/third_party/common/etc
TARGET = $${LIB_OUTPUT_DIR}/cocos2d

View File

@ -8,8 +8,9 @@ DISABLED_WARNINGS = -Wno-ignored-qualifiers -Wno-unused-parameter -Wno-psabi
QMAKE_CXXFLAGS += $${DISABLED_WARNINGS} -Wno-reorder
QMAKE_CFLAGS += $${DISABLED_WARNINGS}
# C++11 support (GCC 4.6; for newer versions, change to -std=c++11)
QMAKE_CXXFLAGS += -Doverride= -std=c++0x
# C++11 support (Pick the first one if you have an old GCC version)
#QMAKE_CXXFLAGS += -Doverride= -std=c++0x
CONFIG += c++11
OS_TYPE = linux