ios changes

This commit is contained in:
Vladislav Khorev 2017-02-27 02:26:42 +03:00
parent 6b67237804
commit 0bf1c60c9d
18 changed files with 116 additions and 69 deletions

View File

@ -1676,7 +1676,7 @@
REZ_SEARCH_PATHS = "";
SKIP_INSTALL = NO;
TARGETED_DEVICE_FAMILY = "1,2";
VALID_ARCHS = "arm64 armv7 armv7s i386 x86_64";
VALID_ARCHS = "arm64 armv7 armv7s";
};
name = Debug;
};
@ -1717,7 +1717,7 @@
REZ_SEARCH_PATHS = "";
SKIP_INSTALL = NO;
TARGETED_DEVICE_FAMILY = "1,2";
VALID_ARCHS = "arm64 armv7 armv7s i386 x86_64";
VALID_ARCHS = "arm64 armv7 armv7s";
};
name = Release;
};

View File

@ -106,7 +106,7 @@ struct TSquareStatic : public TInstancingWidgetAncestor
struct TDynamicText : public TInstancingWidgetAncestor
{
protected:
boost::signals::connection SmartValueConnection;
boost::signals2::connection SmartValueConnection;
TTextParams LastTextParams;
@ -194,16 +194,16 @@ protected:
void RefreshTextTriangleList();
boost::signals::connection InputConnection;
boost::signals2::connection InputConnection;
boost::signals::connection SetTextSlotConnection;
boost::signals2::connection SetTextSlotConnection;
public:
~TEdit();
TRenderPairList::iterator TextIterator;
boost::signal<void(std::string)> OnTextChanged;
boost::signals2::signal<void(std::string)> OnTextChanged;
virtual bool CheckClick(vec2 mousePos);
@ -230,7 +230,7 @@ class TCheckBox : public TInstancingWidgetAncestor
protected:
bool IsChecked; //To be set immediately on tap up
boost::signals::connection SetCheckedSlotConnection;
boost::signals2::connection SetCheckedSlotConnection;
void RefreshVisibility();
public:
std::vector<TRenderPairList::iterator> StaticTextureIteratorArr;
@ -252,7 +252,7 @@ public:
//Logic:
void SetChecked(bool isChecked);
boost::signal<void(bool)> OnSetChecked;
boost::signals2::signal<void(bool)> OnSetChecked;
static TCheckBox* CreateCheckBox(vec2 posFrom, vec2 posTo);
static TCheckBox* CreateCheckBoxWithFiller(vec2 posFrom, vec2 posTo, boost::function<void(TCheckBox*)> checkBoxFillerFunc);
@ -274,7 +274,7 @@ class TRadioButton : public TInstancingWidgetAncestor
protected:
bool IsChecked; //To be set immediately on tap up
boost::signals::connection SetCheckedSlotConnection;
boost::signals2::connection SetCheckedSlotConnection;
void RefreshVisibility();
public:
std::vector<TRenderPairList::iterator> StaticTextureIteratorArr;
@ -296,7 +296,7 @@ public:
//Logic:
void SetChecked(bool isChecked);
boost::signal<void(bool)> OnSetChecked;
boost::signals2::signal<void(bool)> OnSetChecked;
static TRadioButton* CreateRadioButton(vec2 posFrom, vec2 posTo);
static TRadioButton* CreateRadioButtonWithFiller(vec2 posFrom, vec2 posTo, boost::function<void(TRadioButton*)> radioButtonFillerFunc);

View File

@ -32,7 +32,7 @@ struct TWidgetStruct
std::shared_ptr<TInstancingWidgetAncestor> Widget;
std::map<std::string, std::shared_ptr<boost::signal<void (TSignalParam)>>> SignalMap;
std::map<std::string, std::shared_ptr<boost::signals2::signal<void (TSignalParam)>>> SignalMap;
TWidgetStruct(const std::string& name, const std::string& groupName, std::shared_ptr<TInstancingWidgetAncestor> widget, int order = 0)
: Name(name)
@ -41,10 +41,10 @@ struct TWidgetStruct
, IsMouseDown(false)
, Widget(widget)
{
SignalMap[CONST_HOLD_SIGNAL_NAME] = std::shared_ptr<boost::signal<void (TSignalParam)>>(new boost::signal<void (TSignalParam)>());
SignalMap[CONST_CLICK_SIGNAL_NAME] = std::shared_ptr<boost::signal<void (TSignalParam)>>(new boost::signal<void (TSignalParam)>());
SignalMap[CONST_TAPDOWN_SIGNAL_NAME] = std::shared_ptr<boost::signal<void (TSignalParam)>>(new boost::signal<void (TSignalParam)>());
SignalMap[CONST_DRAG_SIGNAL_NAME] = std::shared_ptr<boost::signal<void (TSignalParam)>>(new boost::signal<void (TSignalParam)>());
SignalMap[CONST_HOLD_SIGNAL_NAME] = std::shared_ptr<boost::signals2::signal<void (TSignalParam)>>(new boost::signals2::signal<void (TSignalParam)>());
SignalMap[CONST_CLICK_SIGNAL_NAME] = std::shared_ptr<boost::signals2::signal<void (TSignalParam)>>(new boost::signals2::signal<void (TSignalParam)>());
SignalMap[CONST_TAPDOWN_SIGNAL_NAME] = std::shared_ptr<boost::signals2::signal<void (TSignalParam)>>(new boost::signals2::signal<void (TSignalParam)>());
SignalMap[CONST_DRAG_SIGNAL_NAME] = std::shared_ptr<boost::signals2::signal<void (TSignalParam)>>(new boost::signals2::signal<void (TSignalParam)>());
}
TWidgetStruct(const TWidgetStruct& widgetStruct)
@ -142,10 +142,10 @@ protected:
public:
bool KeyboardIsOnScreen;
boost::signal<void(int)> KeyPressedSignal;
boost::signal<void(std::string)> SetTextSignal;
boost::signal<void()> OnKeyboardShowSignal;
boost::signal<void()> OnKeyboardHideSignal;
boost::signals2::signal<void(int)> KeyPressedSignal;
boost::signals2::signal<void(std::string)> SetTextSignal;
boost::signals2::signal<void()> OnKeyboardShowSignal;
boost::signals2::signal<void()> OnKeyboardHideSignal;
TGUIManager();
@ -185,10 +185,10 @@ public:
void PrintWidgetList();
std::shared_ptr<boost::signal<void (TSignalParam)>> GetOnClickSignal(const std::string& widgetName);
std::shared_ptr<boost::signal<void (TSignalParam)>> GetOnHoldSignal(const std::string& widgetName);
std::shared_ptr<boost::signal<void (TSignalParam)>> GetSignal(const std::string& signalName, const std::string& widgetName);
std::shared_ptr<boost::signal<void (TSignalParam)>> GetOnTapDownSignal(const std::string& widgetName);
std::shared_ptr<boost::signals2::signal<void (TSignalParam)>> GetOnClickSignal(const std::string& widgetName);
std::shared_ptr<boost::signals2::signal<void (TSignalParam)>> GetOnHoldSignal(const std::string& widgetName);
std::shared_ptr<boost::signals2::signal<void (TSignalParam)>> GetSignal(const std::string& signalName, const std::string& widgetName);
std::shared_ptr<boost::signals2::signal<void (TSignalParam)>> GetOnTapDownSignal(const std::string& widgetName);
//TFunctionBinderInterface implementation:
void SQ_MoveWidget(const SQChar *widgetName, float x, float y);

View File

@ -9,6 +9,13 @@
#include <GLES2/gl2ext.h>
#endif
#ifdef TARGET_IOS
//#include <OpenGLES/AEGL.h>
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES1/glext.h>
#include <OpenGLES/ES2/glext.h>
#endif
namespace SE
{

View File

@ -10,7 +10,10 @@ class TSalmonRendererIos : public TSalmonRendererGLES20
{
protected:
GLint defaultFBO;
public:
virtual void InitOpenGL(int screenWidth, int screenHeight, float matrixWidth, float matrixHeight);
virtual void SwitchToScreen();
};

View File

@ -40,7 +40,7 @@ public:
}
template<typename TYPENAME>
boost::signal<void(const TYPENAME&)>& GetSignal(const std::string& dictName, const std::string& valueName)
boost::signals2::signal<void(const TYPENAME&)>& GetSignal(const std::string& dictName, const std::string& valueName)
{
return boost::get<std::shared_ptr<TBindableVar<TYPENAME>>>(GetSmartValue(dictName, valueName))->OnVarChanged;
}

View File

@ -1,12 +1,14 @@
#ifndef BINDABLE_VAR_H_INCLUDED
#define BINDABLE_VAR_H_INCLUDED
#include "boost/signal.hpp"
#include "boost/signals2.hpp"
#include "boost/variant.hpp"
namespace SE
{
//Must be stored in shared_ptr:
template<typename TYPENAME>
@ -17,7 +19,7 @@ protected:
public:
boost::signal<void(const TYPENAME&)> OnVarChanged;
boost::signals2::signal<void(const TYPENAME&)> OnVarChanged;
TBindableVar()
{

View File

@ -22,4 +22,7 @@ void AppOnScale(float scale);
void AppOnTapUpAfterMove(int posx, int posy, int touchNumber);
void SetBindDrawableFunc(void(*funcPtr)());
}

View File

@ -10,12 +10,11 @@
#include "boost/asio.hpp"
#include "boost/date_time/posix_time/posix_time.hpp"
#include "boost/signal.hpp"
#include "boost/signals2.hpp"
#include "boost/variant.hpp"
#include "include/Utils/Network/SignalSender.h"
namespace SE
{
@ -28,7 +27,7 @@ void SendPropertyTree(boost::asio::io_service& ioService, boost::asio::ip::tcp::
class TDataReadSignalMap
{
protected:
std::map<std::string, std::shared_ptr<boost::signal<void(boost::property_tree::ptree)>>> SignalMap;
std::map<std::string, std::shared_ptr<boost::signals2::signal<void(boost::property_tree::ptree)>>> SignalMap;
public:
void AddSlot(const std::string& nodeName, boost::function<void(boost::property_tree::ptree)> f);
@ -69,7 +68,7 @@ public:
void HandleReadData(const boost::system::error_code& error);
boost::signal<void()> ErrorSignal;
boost::signals2::signal<void()> ErrorSignal;
};
@ -100,9 +99,9 @@ public:
void HandleGetData(boost::property_tree::ptree pTree);
boost::signal<void()> AuthorizedSignal;
boost::signal<void(std::string, std::string)> SaveLoginPasswordSignal;
boost::signal<void()> ErrorSignal;
boost::signals2::signal<void()> AuthorizedSignal;
boost::signals2::signal<void(std::string, std::string)> SaveLoginPasswordSignal;
boost::signals2::signal<void()> ErrorSignal;
};
typedef boost::variant<std::shared_ptr<TSimpleAuthorization>> TAuthorizationVariant;
@ -127,10 +126,10 @@ protected:
bool Opened;
public:
boost::signal<void()> OnAddressNotResolvedSignal;
boost::signal<void()> OnConnectedSignal;
boost::signal<void()> OnAutorizedSignal;
boost::signal<void()> OnDisconnectedSignal;
boost::signals2::signal<void()> OnAddressNotResolvedSignal;
boost::signals2::signal<void()> OnConnectedSignal;
boost::signals2::signal<void()> OnAutorizedSignal;
boost::signals2::signal<void()> OnDisconnectedSignal;
boost::shared_ptr<TDataReader> ClientDataReader;

View File

@ -6,12 +6,14 @@
#include "boost/shared_ptr.hpp"
#include "boost/array.hpp"
#include "boost/enable_shared_from_this.hpp"
#include "boost/signal.hpp"
#include "boost/signals2.hpp"
#include "boost/thread.hpp"
#include "boost/date_time/posix_time/posix_time.hpp"
#include "boost/property_tree/ptree.hpp"
#include "boost/property_tree/xml_parser.hpp"
namespace SE
{
//Xperimental -- need to optimize this
@ -25,7 +27,7 @@ struct TSignalSender
std::string Data;
boost::signal<void()> ErrorSignal;
boost::signals2::signal<void()> ErrorSignal;
TSignalSender(boost::asio::ip::tcp::socket& socket, int length, std::string data)
: Socket(socket)

View File

@ -2,7 +2,7 @@
#define THREAD_UTILS_H_INCLUDED
#include "boost/asio.hpp"
#include "boost/signal.hpp"
#include "boost/signals2.hpp"
#include "boost/thread.hpp"

View File

@ -14,7 +14,8 @@ This code combines additional routines (such as console/log, exceptions, math ut
#include "boost/asio.hpp"
#include "boost/date_time/posix_time/posix_time.hpp"
#include "boost/signal.hpp"
#include "boost/signals2.hpp"
#include "include/Utils/Console/Console.h"

View File

@ -61,6 +61,7 @@ cardinal TFrameManager::AddFrameRenderBuffer(const std::string& frameName,cardin
cardinal status;
glGenFramebuffers(1,&frameBuffer);
glBindFramebuffer(GL_FRAMEBUFFER, frameBuffer);
@ -78,6 +79,9 @@ cardinal TFrameManager::AddFrameRenderBuffer(const std::string& frameName,cardin
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height);
#endif
glBindRenderbuffer(GL_RENDERBUFFER, 0);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthRenderBuffer);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texID, 0);

View File

@ -124,7 +124,7 @@ void TGUIManager::Update(cardinal dt)
{
boost::lock_guard<boost::mutex> guard(WidgetListMutex);
std::vector<std::shared_ptr<boost::signal<void (TSignalParam)>>> signalMap;
std::vector<std::shared_ptr<boost::signals2::signal<void (TSignalParam)>>> signalMap;
for (TWidgetArr::iterator i = WidgetArr.begin(); i != WidgetArr.end(); ++i)
{
@ -298,7 +298,7 @@ void TGUIManager::OnMouseDown(vec2 pos, int touchNumber)
LastTapPos[touchNumber] = pos;
TotalShift[touchNumber] = vec2(0,0);
std::vector<std::shared_ptr<boost::signal<void (TSignalParam)>>> signalMap;
std::vector<std::shared_ptr<boost::signals2::signal<void (TSignalParam)>>> signalMap;
for (i = WidgetArr.rbegin(); i != WidgetArr.rend(); ++i)
{
@ -336,7 +336,7 @@ void TGUIManager::OnMouseUp(vec2 pos, int touchNumber)
TWidgetArr::reverse_iterator i;
std::vector<std::shared_ptr<boost::signal<void (TSignalParam)>>> signalMap;
std::vector<std::shared_ptr<boost::signals2::signal<void (TSignalParam)>>> signalMap;
for (i = WidgetArr.rbegin(); i != WidgetArr.rend(); ++i)
{
@ -374,7 +374,7 @@ void TGUIManager::OnMouseUp(vec2 pos, int touchNumber)
TWidgetArr::reverse_iterator i;
std::vector<std::shared_ptr<boost::signal<void (TSignalParam)>>> signalMap;
std::vector<std::shared_ptr<boost::signals2::signal<void (TSignalParam)>>> signalMap;
for (i = WidgetArr.rbegin(); i != WidgetArr.rend(); ++i)
{
@ -434,7 +434,7 @@ void TGUIManager::OnMove(vec2 shift, int touchNumber)
//LastTapPos += shift;
std::vector<std::shared_ptr<boost::signal<void (TSignalParam)>>> signalMap;
std::vector<std::shared_ptr<boost::signals2::signal<void (TSignalParam)>>> signalMap;
for (i = WidgetArr.rbegin(); i != WidgetArr.rend(); ++i)
{
@ -535,7 +535,7 @@ void TGUIManager::PrintWidgetList()
}
std::shared_ptr<boost::signal<void (TSignalParam)>> TGUIManager::GetOnClickSignal(const std::string& widgetName)
std::shared_ptr<boost::signals2::signal<void (TSignalParam)>> TGUIManager::GetOnClickSignal(const std::string& widgetName)
{
TWidgetArr::iterator i = FindWidgetInArr(widgetName);
@ -544,7 +544,7 @@ std::shared_ptr<boost::signal<void (TSignalParam)>> TGUIManager::GetOnClickSigna
}
std::shared_ptr<boost::signal<void (TSignalParam)>> TGUIManager::GetOnHoldSignal(const std::string& widgetName)
std::shared_ptr<boost::signals2::signal<void (TSignalParam)>> TGUIManager::GetOnHoldSignal(const std::string& widgetName)
{
TWidgetArr::iterator i = FindWidgetInArr(widgetName);
@ -553,7 +553,7 @@ std::shared_ptr<boost::signal<void (TSignalParam)>> TGUIManager::GetOnHoldSignal
}
std::shared_ptr<boost::signal<void (TSignalParam)>> TGUIManager::GetOnTapDownSignal(const std::string& widgetName)
std::shared_ptr<boost::signals2::signal<void (TSignalParam)>> TGUIManager::GetOnTapDownSignal(const std::string& widgetName)
{
TWidgetArr::iterator i = FindWidgetInArr(widgetName);
@ -562,7 +562,7 @@ std::shared_ptr<boost::signal<void (TSignalParam)>> TGUIManager::GetOnTapDownSig
}
std::shared_ptr<boost::signal<void (TSignalParam)>> TGUIManager::GetSignal(const std::string& signalName, const std::string& widgetName)
std::shared_ptr<boost::signals2::signal<void (TSignalParam)>> TGUIManager::GetSignal(const std::string& signalName, const std::string& widgetName)
{
TWidgetArr::iterator i = FindWidgetInArr(widgetName);

View File

@ -3,15 +3,27 @@
#include "include/Utils/Utils.h"
#include "include/Engine.h"
namespace SE
{
void TSalmonRendererIos::InitOpenGL(int screenWidth, int screenHeight, float matrixWidth, float matrixHeight)
{
TSalmonRendererGLES20::InitOpenGL(screenWidth, screenHeight, matrixWidth, matrixHeight);
//glGetIntegerv(GL_FRAMEBUFFER_BINDING_OES, &this->defaultFBO);
}
void TSalmonRendererIos::SwitchToScreen()
{
AssertIfInMainThread();
IosSwitchToScreen();
//glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}

View File

@ -12,11 +12,14 @@
#include "include/Utils/Utils.h"
GLKView* defaultView = 0; //Need to be set up by App!
//GLKView* defaultView = 0; //Need to be set up by App!
UITextField* extKeyboardTextView = 0;
void(*bindDrawableFuncPtr)() = nullptr;
namespace SE
{
@ -60,7 +63,11 @@ std::string IosGetFilePathUserData(const std::string& filename)
void IosSwitchToScreen()
{
[defaultView bindDrawable];
if (bindDrawableFuncPtr != nullptr)
{
(*bindDrawableFuncPtr)();
}
//[defaultView bindDrawable];
}
void ShowKeyboard(std::string text)
@ -115,6 +122,13 @@ bool IsIphone5()
}
void SetBindDrawableFunc(void(*funcPtr)())
{
bindDrawableFuncPtr = funcPtr;
}
} //namespace SE

View File

@ -28,7 +28,7 @@ void TDataReadSignalMap::AddSlot(const std::string& nodeName, boost::function<vo
{
if (SignalMap.count(nodeName) == 0)
{
SignalMap[nodeName] = std::shared_ptr<boost::signal<void(boost::property_tree::ptree)>>(new boost::signal<void(boost::property_tree::ptree)>);
SignalMap[nodeName] = std::shared_ptr<boost::signals2::signal<void(boost::property_tree::ptree)>>(new boost::signals2::signal<void(boost::property_tree::ptree)>);
SignalMap[nodeName]->connect(f);
}
else