Просмотр исходного кода

Linux fixes, fixed UIMenuBar not rendering properly, UIMenuBar now uses theme accent color, added linux build shell script to the repository

Ivan Safrin 12 лет назад
Родитель
Сommit
8a4923f08b

+ 0 - 3
Bindings/Scripts/create_lua_library/create_lua_library.py

@@ -182,9 +182,6 @@ def createLUABindings(inputPath, prefix, mainInclude, libSmallName, libName, api
 						else: # Parent class is in Polycore
 						else: # Parent class is in Polycore
 							luaClassBindingOut += "require \"Polycode/%s\"\n\n" % (c["inherits"][0]["class"])
 							luaClassBindingOut += "require \"Polycode/%s\"\n\n" % (c["inherits"][0]["class"])
 
 
-						if (ckey == "ScreenParticleEmitter" or ckey == "SceneParticleEmitter"):
-							luaClassBindingOut += "require \"Polycode/ParticleEmitter\"\n\n"
-
 						luaClassBindingOut += "class \"%s\" (%s)\n\n" % (ckey, c["inherits"][0]["class"])
 						luaClassBindingOut += "class \"%s\" (%s)\n\n" % (ckey, c["inherits"][0]["class"])
 						parentClass = c["inherits"][0]["class"]
 						parentClass = c["inherits"][0]["class"]
 						inherits = True
 						inherits = True

+ 21 - 0
BuildLinux.sh

@@ -0,0 +1,21 @@
+#!/bin/bash
+# ~/bin/build-polycode
+
+mkdir -p Dependencies/Build/Debug Dependencies/Build/Release Build/Debug Build/Release Standalone/Build
+cd Dependencies/Build/Debug
+cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug ../..
+make
+cd ../Release
+cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ../..
+make
+cd ../../../Build/Debug
+cmake -G "Unix Makefiles" -DPOLYCODE_BUILD_BINDINGS=ON -DPOLYCODE_BUILD_PLAYER=ON -DCMAKE_BUILD_TYPE=Debug -DPYTHON_EXECUTABLE=/usr/bin/python2 ../..
+make
+make install
+cd ../Release
+cmake -G "Unix Makefiles" -DPOLYCODE_BUILD_BINDINGS=ON -DPOLYCODE_BUILD_PLAYER=ON -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python2 ../..
+make
+make install
+cd ../../Standalone/Build
+cmake -G "Unix Makefiles"
+make install

+ 1 - 1
Core/Contents/Include/PolySDLCore.h

@@ -43,7 +43,7 @@ namespace Polycode {
 		
 		
 	public:
 	public:
 		
 		
-		SDLCore(PolycodeView *view, int xRes, int yRes, bool fullScreen, bool vSync, int aaLevel, int anisotropyLevel, int frameRate, int monitorIndex=-1);
+		SDLCore(PolycodeView *view, int xRes, int yRes, bool fullScreen, bool vSync, int aaLevel, int anisotropyLevel, int frameRate, int monitorIndex=-1, bool retinaSupport=false);
 		~SDLCore();
 		~SDLCore();
 
 
 		void enableMouse(bool newval);
 		void enableMouse(bool newval);

+ 1 - 1
Core/Contents/Source/PolySDLCore.cpp

@@ -80,7 +80,7 @@ void Core::getScreenInfo(int *width, int *height, int *hz) {
 	if (hz) *hz = 0;
 	if (hz) *hz = 0;
 }
 }
 
 
-SDLCore::SDLCore(PolycodeView *view, int _xRes, int _yRes, bool fullScreen, bool vSync, int aaLevel, int anisotropyLevel, int frameRate, int monitorIndex) : Core(_xRes, _yRes, fullScreen, vSync, aaLevel, anisotropyLevel, frameRate, monitorIndex) {
+SDLCore::SDLCore(PolycodeView *view, int _xRes, int _yRes, bool fullScreen, bool vSync, int aaLevel, int anisotropyLevel, int frameRate, int monitorIndex, bool retinaSupport) : Core(_xRes, _yRes, fullScreen, vSync, aaLevel, anisotropyLevel, frameRate, monitorIndex) {
 
 
 	this->resizableWindow = view->resizable;
 	this->resizableWindow = view->resizable;
 
 

+ 0 - 2
Core/Contents/Source/PolyShader.cpp

@@ -305,6 +305,4 @@ void LocalShaderParam::setParamValueFromString(int type, String pvalue) {
             }
             }
                 break;
                 break;
         }
         }
-    
-    return false;
 }
 }

+ 2 - 0
Core/Contents/Source/PolySound.cpp

@@ -30,9 +30,11 @@
 #include "OSBasics.h"
 #include "OSBasics.h"
 #include <string>
 #include <string>
 #include <vector>
 #include <vector>
+#include <stdint.h>
 #include <limits>
 #include <limits>
 
 
 #define MAX_FLOAT (std::numeric_limits<double>::infinity())
 #define MAX_FLOAT (std::numeric_limits<double>::infinity())
+#define INT32_MAX (std::numeric_limits<int32_t>::max())
 
 
 using namespace std;
 using namespace std;
 using namespace Polycode;
 using namespace Polycode;

+ 1 - 1
IDE/Build/Linux/Makefile

@@ -2,7 +2,7 @@ CC=g++
 CFLAGS=-I../../Contents/Include -I../../../Release/Linux/Framework/Core/Dependencies/include -I../../../Release/Linux/Framework/Core/Dependencies/include/AL -I../../../Release/Linux/Framework/Core/include -I../../../Release/Linux/Framework/Modules/include -I../../../Release/Linux/Framework/Modules/Dependencies/include -I../../../Release/Linux/Framework/Modules/Dependencies/include/bullet -DUSE_POLYCODEUI_FILE_DIALOGS -DUSE_POLYCODEUI_MENUBAR
 CFLAGS=-I../../Contents/Include -I../../../Release/Linux/Framework/Core/Dependencies/include -I../../../Release/Linux/Framework/Core/Dependencies/include/AL -I../../../Release/Linux/Framework/Core/include -I../../../Release/Linux/Framework/Modules/include -I../../../Release/Linux/Framework/Modules/Dependencies/include -I../../../Release/Linux/Framework/Modules/Dependencies/include/bullet -DUSE_POLYCODEUI_FILE_DIALOGS -DUSE_POLYCODEUI_MENUBAR
 LDFLAGS=-lrt -ldl -lpthread ../../../Release/Linux/Framework/Core/lib/libPolycore.a ../../../Release/Linux/Framework/Core/Dependencies/lib/libfreetype.a ../../../Release/Linux/Framework/Core/Dependencies/lib/liblibvorbisfile.a ../../../Release/Linux/Framework/Core/Dependencies/lib/liblibvorbis.a ../../../Release/Linux/Framework/Core/Dependencies/lib/liblibogg.a ../../../Release/Linux/Framework/Core/Dependencies/lib/libopenal.so ../../../Release/Linux/Framework/Core/Dependencies/lib/libphysfs.a ../../../Release/Linux/Framework/Core/Dependencies/lib/libpng15.a ../../../Release/Linux/Framework/Core/Dependencies/lib/libz.a -lGL -lGLU -lSDL ../../../Release/Linux/Framework/Modules/lib/libPolycode2DPhysics.a ../../../Release/Linux/Framework/Modules/Dependencies/lib/libBox2D.a ../../../Release/Linux/Framework/Modules/lib/libPolycode3DPhysics.a ../../../Release/Linux/Framework/Modules/Dependencies/lib/libBulletDynamics.a ../../../Release/Linux/Framework/Modules/Dependencies/lib/libBulletCollision.a ../../../Release/Linux/Framework/Modules/Dependencies/lib/libLinearMath.a ../../../Release/Linux/Framework/Modules/lib/libPolycodeUI.a -lX11
 LDFLAGS=-lrt -ldl -lpthread ../../../Release/Linux/Framework/Core/lib/libPolycore.a ../../../Release/Linux/Framework/Core/Dependencies/lib/libfreetype.a ../../../Release/Linux/Framework/Core/Dependencies/lib/liblibvorbisfile.a ../../../Release/Linux/Framework/Core/Dependencies/lib/liblibvorbis.a ../../../Release/Linux/Framework/Core/Dependencies/lib/liblibogg.a ../../../Release/Linux/Framework/Core/Dependencies/lib/libopenal.so ../../../Release/Linux/Framework/Core/Dependencies/lib/libphysfs.a ../../../Release/Linux/Framework/Core/Dependencies/lib/libpng15.a ../../../Release/Linux/Framework/Core/Dependencies/lib/libz.a -lGL -lGLU -lSDL ../../../Release/Linux/Framework/Modules/lib/libPolycode2DPhysics.a ../../../Release/Linux/Framework/Modules/Dependencies/lib/libBox2D.a ../../../Release/Linux/Framework/Modules/lib/libPolycode3DPhysics.a ../../../Release/Linux/Framework/Modules/Dependencies/lib/libBulletDynamics.a ../../../Release/Linux/Framework/Modules/Dependencies/lib/libBulletCollision.a ../../../Release/Linux/Framework/Modules/Dependencies/lib/libLinearMath.a ../../../Release/Linux/Framework/Modules/lib/libPolycodeUI.a -lX11
 LDFLAGS_DEBUG=-lrt -ldl -lpthread ../../../Release/Linux/Framework/Core/lib/libPolycore_d.a ../../../Release/Linux/Framework/Core/Dependencies/lib/libfreetype_d.a ../../../Release/Linux/Framework/Core/Dependencies/lib/liblibvorbisfiled.a ../../../Release/Linux/Framework/Core/Dependencies/lib/liblibvorbisd.a ../../../Release/Linux/Framework/Core/Dependencies/lib/libliboggd.a ../../../Release/Linux/Framework/Core/Dependencies/lib/libopenal.so ../../../Release/Linux/Framework/Core/Dependencies/lib/libphysfsd.a ../../../Release/Linux/Framework/Core/Dependencies/lib/libpng15d.a ../../../Release/Linux/Framework/Core/Dependencies/lib/libz.a -lGL -lGLU -lSDL ../../../Release/Linux/Framework/Modules/lib/libPolycode2DPhysics_d.a ../../../Release/Linux/Framework/Modules/Dependencies/lib/libBox2D_d.a ../../../Release/Linux/Framework/Modules/lib/libPolycode3DPhysics_d.a ../../../Release/Linux/Framework/Modules/Dependencies/lib/libBulletDynamics_d.a ../../../Release/Linux/Framework/Modules/Dependencies/lib/libBulletCollision_d.a ../../../Release/Linux/Framework/Modules/Dependencies/lib/libLinearMath_d.a ../../../Release/Linux/Framework/Modules/lib/libPolycodeUI_d.a -lX11
 LDFLAGS_DEBUG=-lrt -ldl -lpthread ../../../Release/Linux/Framework/Core/lib/libPolycore_d.a ../../../Release/Linux/Framework/Core/Dependencies/lib/libfreetype_d.a ../../../Release/Linux/Framework/Core/Dependencies/lib/liblibvorbisfiled.a ../../../Release/Linux/Framework/Core/Dependencies/lib/liblibvorbisd.a ../../../Release/Linux/Framework/Core/Dependencies/lib/libliboggd.a ../../../Release/Linux/Framework/Core/Dependencies/lib/libopenal.so ../../../Release/Linux/Framework/Core/Dependencies/lib/libphysfsd.a ../../../Release/Linux/Framework/Core/Dependencies/lib/libpng15d.a ../../../Release/Linux/Framework/Core/Dependencies/lib/libz.a -lGL -lGLU -lSDL ../../../Release/Linux/Framework/Modules/lib/libPolycode2DPhysics_d.a ../../../Release/Linux/Framework/Modules/Dependencies/lib/libBox2D_d.a ../../../Release/Linux/Framework/Modules/lib/libPolycode3DPhysics_d.a ../../../Release/Linux/Framework/Modules/Dependencies/lib/libBulletDynamics_d.a ../../../Release/Linux/Framework/Modules/Dependencies/lib/libBulletCollision_d.a ../../../Release/Linux/Framework/Modules/Dependencies/lib/libLinearMath_d.a ../../../Release/Linux/Framework/Modules/lib/libPolycodeUI_d.a -lX11
-SRCS=../../Contents/Source/ExampleBrowserWindow.cpp ../../Contents/Source/PolycodeEditorManager.cpp  ../../Contents/Source/PolycodeProject.cpp        ../../Contents/Source/PolycodeScreenEditor.cpp ../../Contents/Source/ExportProjectWindow.cpp  ../../Contents/Source/PolycodeFontEditor.cpp     ../../Contents/Source/PolycodeProjectBrowser.cpp ../../Contents/Source/PolycodeSpriteEditor.cpp ../../Contents/Source/NewFileWindow.cpp        ../../Contents/Source/PolycodeFrame.cpp          ../../Contents/Source/PolycodeProjectEditor.cpp  ../../Contents/Source/PolycodeTextEditor.cpp ../../Contents/Source/NewProjectWindow.cpp     ../../Contents/Source/PolycodeIDEApp.cpp         ../../Contents/Source/PolycodeProjectManager.cpp ../../Contents/Source/PolycodeToolLauncher.cpp ../../Contents/Source/PolycodeConsole.cpp      ../../Contents/Source/PolycodeImageEditor.cpp    ../../Contents/Source/PolycodeProps.cpp          ../../Contents/Source/TextureBrowser.cpp ../../Contents/Source/PolycodeEditor.cpp       ../../Contents/Source/PolycodeMaterialEditor.cpp ../../Contents/Source/PolycodeRemoteDebugger.cpp ../../Contents/Source/ToolWindows.cpp ../../Contents/Source/PolycodeClipboard.cpp ../../Contents/Source/SettingsWindow.cpp
+SRCS=../../Contents/Source/ExampleBrowserWindow.cpp ../../Contents/Source/PolycodeEditorManager.cpp  ../../Contents/Source/PolycodeProject.cpp ../../Contents/Source/ExportProjectWindow.cpp  ../../Contents/Source/PolycodeFontEditor.cpp     ../../Contents/Source/PolycodeProjectBrowser.cpp ../../Contents/Source/PolycodeSpriteEditor.cpp ../../Contents/Source/NewFileWindow.cpp        ../../Contents/Source/PolycodeFrame.cpp          ../../Contents/Source/PolycodeProjectEditor.cpp  ../../Contents/Source/PolycodeTextEditor.cpp ../../Contents/Source/NewProjectWindow.cpp     ../../Contents/Source/PolycodeIDEApp.cpp         ../../Contents/Source/PolycodeProjectManager.cpp ../../Contents/Source/PolycodeToolLauncher.cpp ../../Contents/Source/PolycodeConsole.cpp      ../../Contents/Source/PolycodeImageEditor.cpp    ../../Contents/Source/PolycodeProps.cpp          ../../Contents/Source/TextureBrowser.cpp ../../Contents/Source/PolycodeEditor.cpp       ../../Contents/Source/PolycodeMaterialEditor.cpp ../../Contents/Source/PolycodeRemoteDebugger.cpp ../../Contents/Source/ToolWindows.cpp ../../Contents/Source/PolycodeClipboard.cpp ../../Contents/Source/SettingsWindow.cpp ../../Contents/Source/PolycodeEntityEditor.cpp ../../Contents/Source/EditorGrid.cpp ../../Contents/Source/EntityEditorPropertyView.cpp ../../Contents/Source/TrackballCamera.cpp ../../Contents/Source/TransformGizmo.cpp ../../Contents/Source/PolycodeMeshEditor.cpp
 
 
 default:
 default:
 	mkdir -p ./Build
 	mkdir -p ./Build

+ 1 - 1
IDE/Contents/Source/PolycodeIDEApp.cpp

@@ -204,7 +204,7 @@ PolycodeIDEApp::PolycodeIDEApp(PolycodeView *view) : EventDispatcher() {
 	menuBar->addEventListener(this, UIEvent::OK_EVENT);
 	menuBar->addEventListener(this, UIEvent::OK_EVENT);
 
 
 	screen->addChild(menuBar);
 	screen->addChild(menuBar);
-	frame->position.y = 25;
+	frame->setPositionY(25);
 #else
 #else
 	menuBar = NULL;
 	menuBar = NULL;
 #endif
 #endif

+ 6 - 3
Modules/Contents/UI/Source/PolyUIMenuBar.cpp

@@ -3,6 +3,8 @@
 #include "PolyLabel.h"
 #include "PolyLabel.h"
 #include <PolyCoreServices.h>
 #include <PolyCoreServices.h>
 #include <PolyCore.h>
 #include <PolyCore.h>
+#include <PolyConfig.h>
+#include <PolyRenderer.h>
 
 
 using namespace Polycode;
 using namespace Polycode;
 
 
@@ -39,21 +41,22 @@ UIMenuBarEntry::UIMenuBarEntry(String name): UIElement() {
 	
 	
 	label = new SceneLabel(name, 14, "sans");
 	label = new SceneLabel(name, 14, "sans");
 	setWidth(label->getLabel()->getTextWidth() + 20);
 	setWidth(label->getLabel()->getTextWidth() + 20);
+	label->setBlendingMode(Renderer::BLEND_MODE_NORMAL);
 	bg = new UIRect(getWidth(), 25);
 	bg = new UIRect(getWidth(), 25);
 	bg->setAnchorPoint(-1.0, -1.0, 0.0);
 	bg->setAnchorPoint(-1.0, -1.0, 0.0);
 	addChild(bg);
 	addChild(bg);
-	bg->color.setColorHex(0xce5a1600);
 	bg->processInputEvents = true;
 	bg->processInputEvents = true;
+	bg->color.setColorHex(0x00000000);
 	addChild(label);
 	addChild(label);
 	label->setPosition(10, 5);
 	label->setPosition(10, 5);
 }
 }
 
 
 void UIMenuBarEntry::Select() {
 void UIMenuBarEntry::Select() {
-	bg->color.setColorHex(0xce5a16ff);
+	bg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiAccentColor"));
 }
 }
 
 
 void UIMenuBarEntry::Deselect() {
 void UIMenuBarEntry::Deselect() {
-	bg->color.setColorHex(0xce5a1600);
+	bg->color.setColorHex(0x00000000);
 }
 }
 
 
 void UIMenuBarEntry::addItem(String name, String code, PolyKEY shortCut1, PolyKEY shortCut2) {
 void UIMenuBarEntry::addItem(String name, String code, PolyKEY shortCut1, PolyKEY shortCut2) {