new xcode update
This commit is contained in:
parent
67bf868991
commit
e89f4e3dd3
@ -870,7 +870,7 @@
|
|||||||
4C8CE8F915B0A0F400078175 /* Project object */ = {
|
4C8CE8F915B0A0F400078175 /* Project object */ = {
|
||||||
isa = PBXProject;
|
isa = PBXProject;
|
||||||
attributes = {
|
attributes = {
|
||||||
LastUpgradeCheck = 0430;
|
LastUpgradeCheck = 0510;
|
||||||
};
|
};
|
||||||
buildConfigurationList = 4C8CE8FC15B0A0F400078175 /* Build configuration list for PBXProject "Salmon Engine" */;
|
buildConfigurationList = 4C8CE8FC15B0A0F400078175 /* Build configuration list for PBXProject "Salmon Engine" */;
|
||||||
compatibilityVersion = "Xcode 3.2";
|
compatibilityVersion = "Xcode 3.2";
|
||||||
@ -946,8 +946,13 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
|
||||||
CLANG_ENABLE_OBJC_ARC = YES;
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
COPY_PHASE_STRIP = NO;
|
COPY_PHASE_STRIP = NO;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
GCC_DYNAMIC_NO_PIC = NO;
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
@ -958,10 +963,14 @@
|
|||||||
);
|
);
|
||||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
|
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
@ -970,13 +979,21 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
|
||||||
CLANG_ENABLE_OBJC_ARC = YES;
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
COPY_PHASE_STRIP = YES;
|
COPY_PHASE_STRIP = YES;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
|
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
|
@ -22,10 +22,11 @@ extern const std::string CONST_TAPDOWN_SIGNAL_NAME;
|
|||||||
|
|
||||||
typedef boost::variant<cardinal, vec2> TSignalParam;
|
typedef boost::variant<cardinal, vec2> TSignalParam;
|
||||||
|
|
||||||
struct TWidgetDataStruct
|
struct TWidgetStruct
|
||||||
{
|
{
|
||||||
std::string Name;
|
std::string Name;
|
||||||
std::string GroupName;
|
std::string GroupName;
|
||||||
|
int Order;
|
||||||
|
|
||||||
bool IsMouseDown;
|
bool IsMouseDown;
|
||||||
|
|
||||||
@ -33,9 +34,10 @@ struct TWidgetDataStruct
|
|||||||
|
|
||||||
std::map<std::string, std::shared_ptr<boost::signal<void (TSignalParam)>>> SignalMap;
|
std::map<std::string, std::shared_ptr<boost::signal<void (TSignalParam)>>> SignalMap;
|
||||||
|
|
||||||
TWidgetDataStruct(const std::string& name, const std::string& groupName, std::shared_ptr<TInstancingWidgetAncestor> widget)
|
TWidgetStruct(const std::string& name, const std::string& groupName, std::shared_ptr<TInstancingWidgetAncestor> widget, int order = 0)
|
||||||
: Name(name)
|
: Name(name)
|
||||||
, GroupName(groupName)
|
, GroupName(groupName)
|
||||||
|
, Order(order)
|
||||||
, IsMouseDown(false)
|
, IsMouseDown(false)
|
||||||
, Widget(widget)
|
, Widget(widget)
|
||||||
{
|
{
|
||||||
@ -45,63 +47,30 @@ struct TWidgetDataStruct
|
|||||||
SignalMap[CONST_DRAG_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)>());
|
||||||
}
|
}
|
||||||
|
|
||||||
TWidgetDataStruct(const TWidgetDataStruct& widgetStruct)
|
TWidgetStruct(const TWidgetStruct& widgetStruct)
|
||||||
{
|
{
|
||||||
Name = widgetStruct.Name;
|
Name = widgetStruct.Name;
|
||||||
Widget = widgetStruct.Widget;
|
Widget = widgetStruct.Widget;
|
||||||
GroupName = widgetStruct.GroupName;
|
GroupName = widgetStruct.GroupName;
|
||||||
IsMouseDown = widgetStruct.IsMouseDown;
|
IsMouseDown = widgetStruct.IsMouseDown;
|
||||||
|
Order = widgetStruct.Order;
|
||||||
SignalMap = widgetStruct.SignalMap;
|
SignalMap = widgetStruct.SignalMap;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TWidgetDataStruct& operator=(const TWidgetDataStruct& widgetStruct)
|
TWidgetStruct& operator=(const TWidgetStruct& widgetStruct)
|
||||||
{
|
{
|
||||||
//Self-assignment is ok
|
//Self-assignment is ok
|
||||||
Name = widgetStruct.Name;
|
Name = widgetStruct.Name;
|
||||||
Widget = widgetStruct.Widget;
|
Widget = widgetStruct.Widget;
|
||||||
GroupName = widgetStruct.GroupName;
|
GroupName = widgetStruct.GroupName;
|
||||||
IsMouseDown = widgetStruct.IsMouseDown;
|
IsMouseDown = widgetStruct.IsMouseDown;
|
||||||
|
Order = widgetStruct.Order;
|
||||||
SignalMap = widgetStruct.SignalMap;
|
SignalMap = widgetStruct.SignalMap;
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
~TWidgetDataStruct()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
struct TWidgetStruct
|
|
||||||
{
|
|
||||||
|
|
||||||
boost::shared_ptr<TWidgetDataStruct> WidgetData;
|
|
||||||
|
|
||||||
int Order;
|
|
||||||
|
|
||||||
TWidgetStruct(const std::string& name, const std::string& groupName, std::shared_ptr<TInstancingWidgetAncestor> widget, int order = 0)
|
|
||||||
: WidgetData(new TWidgetDataStruct(name, groupName, widget))
|
|
||||||
, Order(order)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
TWidgetStruct(const TWidgetStruct& widgetStruct)
|
|
||||||
{
|
|
||||||
WidgetData = widgetStruct.WidgetData;
|
|
||||||
Order = widgetStruct.Order;
|
|
||||||
}
|
|
||||||
|
|
||||||
TWidgetStruct& operator=(const TWidgetStruct& widgetStruct)
|
|
||||||
{
|
|
||||||
if (&widgetStruct != this)
|
|
||||||
{
|
|
||||||
WidgetData = widgetStruct.WidgetData;
|
|
||||||
Order = widgetStruct.Order;
|
|
||||||
}
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
~TWidgetStruct()
|
~TWidgetStruct()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -189,6 +158,8 @@ public:
|
|||||||
|
|
||||||
void DeleteWidgetOnUpdate(const std::string& name);
|
void DeleteWidgetOnUpdate(const std::string& name);
|
||||||
void DeleteWidgetGroupOnUpdate(const std::string& groupName);
|
void DeleteWidgetGroupOnUpdate(const std::string& groupName);
|
||||||
|
void DeleteWidgetLaterOnUpdate(const std::string& name);
|
||||||
|
void DeleteWidgetGroupLaterOnUpdate(const std::string& groupName);
|
||||||
|
|
||||||
void Update(cardinal dt);
|
void Update(cardinal dt);
|
||||||
void Draw();
|
void Draw();
|
||||||
|
@ -27,5 +27,6 @@ void HideKeyboard();
|
|||||||
void ClearKeyboardText();
|
void ClearKeyboardText();
|
||||||
|
|
||||||
bool IsIpad();
|
bool IsIpad();
|
||||||
|
bool IsIphone5();
|
||||||
|
|
||||||
} //namespace SE
|
} //namespace SE
|
||||||
|
@ -48,7 +48,7 @@ void TGUIManager::AddWidget(std::shared_ptr<TInstancingWidgetAncestor> widgetAnc
|
|||||||
{
|
{
|
||||||
for (TWidgetArr::iterator i = WidgetArr.begin(); i != WidgetArr.end(); i++)
|
for (TWidgetArr::iterator i = WidgetArr.begin(); i != WidgetArr.end(); i++)
|
||||||
{
|
{
|
||||||
if (i->WidgetData->Name == name)
|
if (i->Name == name)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -61,7 +61,7 @@ void TGUIManager::DeleteWidget(std::string name)
|
|||||||
{
|
{
|
||||||
for (TWidgetArr::iterator i = WidgetArr.begin(); i != WidgetArr.end(); i++)
|
for (TWidgetArr::iterator i = WidgetArr.begin(); i != WidgetArr.end(); i++)
|
||||||
{
|
{
|
||||||
if (i->WidgetData->Name == name)
|
if (i->Name == name)
|
||||||
{
|
{
|
||||||
WidgetArr.erase(i);
|
WidgetArr.erase(i);
|
||||||
return;
|
return;
|
||||||
@ -75,7 +75,7 @@ void TGUIManager::DeleteWidgetGroup(std::string groupName)
|
|||||||
for (TWidgetArr::iterator i = WidgetArr.begin(); i != WidgetArr.end();)
|
for (TWidgetArr::iterator i = WidgetArr.begin(); i != WidgetArr.end();)
|
||||||
{
|
{
|
||||||
widgetErased = false;
|
widgetErased = false;
|
||||||
if (i->WidgetData->GroupName == groupName)
|
if (i->GroupName == groupName)
|
||||||
{
|
{
|
||||||
i = WidgetArr.erase(i);
|
i = WidgetArr.erase(i);
|
||||||
widgetErased = true;
|
widgetErased = true;
|
||||||
@ -90,14 +90,31 @@ void TGUIManager::DeleteWidgetGroup(std::string groupName)
|
|||||||
|
|
||||||
void TGUIManager::DeleteWidgetOnUpdate(const std::string& name)
|
void TGUIManager::DeleteWidgetOnUpdate(const std::string& name)
|
||||||
{
|
{
|
||||||
PerformInMainThreadAsyncLater(boost::bind(&TGUIManager::DeleteWidget, this, name));
|
//PerformInMainThreadAsyncLater(boost::bind(&TGUIManager::DeleteWidget, this, name));
|
||||||
|
PerformInMainThreadAsync(boost::bind(&TGUIManager::DeleteWidget, this, name));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TGUIManager::DeleteWidgetGroupOnUpdate(const std::string& groupName)
|
void TGUIManager::DeleteWidgetGroupOnUpdate(const std::string& groupName)
|
||||||
|
{
|
||||||
|
//PerformInMainThreadAsyncLater(boost::bind(&TGUIManager::DeleteWidgetGroup, this, groupName));
|
||||||
|
PerformInMainThreadAsync(boost::bind(&TGUIManager::DeleteWidgetGroup, this, groupName));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void TGUIManager::DeleteWidgetLaterOnUpdate(const std::string& name)
|
||||||
|
{
|
||||||
|
PerformInMainThreadAsyncLater(boost::bind(&TGUIManager::DeleteWidget, this, name));
|
||||||
|
}
|
||||||
|
|
||||||
|
void TGUIManager::DeleteWidgetGroupLaterOnUpdate(const std::string& groupName)
|
||||||
{
|
{
|
||||||
PerformInMainThreadAsyncLater(boost::bind(&TGUIManager::DeleteWidgetGroup, this, groupName));
|
PerformInMainThreadAsyncLater(boost::bind(&TGUIManager::DeleteWidgetGroup, this, groupName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void TGUIManager::AddWidgetTransformTask(TWidgetTransformTask widgetTransformTask)
|
void TGUIManager::AddWidgetTransformTask(TWidgetTransformTask widgetTransformTask)
|
||||||
{
|
{
|
||||||
WidgetTrasfromTaskList.push_back(widgetTransformTask);
|
WidgetTrasfromTaskList.push_back(widgetTransformTask);
|
||||||
@ -113,12 +130,12 @@ void TGUIManager::Update(cardinal dt)
|
|||||||
{
|
{
|
||||||
//i->Widget->Update(dt);
|
//i->Widget->Update(dt);
|
||||||
|
|
||||||
if (i->WidgetData->IsMouseDown)
|
if (i->IsMouseDown)
|
||||||
{
|
{
|
||||||
signalMap.push_back((i->WidgetData->SignalMap[CONST_HOLD_SIGNAL_NAME]));
|
signalMap.push_back((i->SignalMap[CONST_HOLD_SIGNAL_NAME]));
|
||||||
}
|
}
|
||||||
|
|
||||||
i->WidgetData->Widget->Update(dt);
|
i->Widget->Update(dt);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,7 +182,7 @@ void TGUIManager::Update(cardinal dt)
|
|||||||
|
|
||||||
for (TWidgetArr::iterator j = WidgetArr.begin(); j != WidgetArr.end(); ++j)
|
for (TWidgetArr::iterator j = WidgetArr.begin(); j != WidgetArr.end(); ++j)
|
||||||
{
|
{
|
||||||
if (j->WidgetData->GroupName == i->GroupName)
|
if (j->GroupName == i->GroupName)
|
||||||
{
|
{
|
||||||
MoveWidgetByIterator(j, moveDistance);
|
MoveWidgetByIterator(j, moveDistance);
|
||||||
}
|
}
|
||||||
@ -196,7 +213,7 @@ void TGUIManager::Draw()
|
|||||||
|
|
||||||
TRenderPairList::iterator j;
|
TRenderPairList::iterator j;
|
||||||
|
|
||||||
for (j = i->WidgetData->Widget->TriangleListVector.begin(); j != i->WidgetData->Widget->TriangleListVector.end(); ++j)
|
for (j = i->Widget->TriangleListVector.begin(); j != i->Widget->TriangleListVector.end(); ++j)
|
||||||
{
|
{
|
||||||
|
|
||||||
TRenderParamsSetter paramSetter(j->first);
|
TRenderParamsSetter paramSetter(j->first);
|
||||||
@ -215,7 +232,7 @@ TWidgetArr::iterator TGUIManager::FindWidgetInArr(const std::string& widgetName)
|
|||||||
|
|
||||||
for (i = WidgetArr.begin(); i != WidgetArr.end(); ++i)
|
for (i = WidgetArr.begin(); i != WidgetArr.end(); ++i)
|
||||||
{
|
{
|
||||||
if (i->WidgetData->Name == widgetName)
|
if (i->Name == widgetName)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -231,13 +248,13 @@ TWidgetArr::iterator TGUIManager::FindWidgetInArr(const std::string& widgetName)
|
|||||||
|
|
||||||
void TGUIManager::MoveWidgetByIterator(TWidgetArr::iterator widget, vec2 shift)
|
void TGUIManager::MoveWidgetByIterator(TWidgetArr::iterator widget, vec2 shift)
|
||||||
{
|
{
|
||||||
widget->WidgetData->Widget->LeftBottomPos += shift;
|
widget->Widget->LeftBottomPos += shift;
|
||||||
|
|
||||||
std::vector<vec3>::iterator i;
|
std::vector<vec3>::iterator i;
|
||||||
|
|
||||||
TRenderPairList::iterator itr;
|
TRenderPairList::iterator itr;
|
||||||
|
|
||||||
for (itr = widget->WidgetData->Widget->TriangleListVector.begin(); itr != widget->WidgetData->Widget->TriangleListVector.end(); ++itr)
|
for (itr = widget->Widget->TriangleListVector.begin(); itr != widget->Widget->TriangleListVector.end(); ++itr)
|
||||||
{
|
{
|
||||||
std::vector<vec3>& vertexCoordVec = itr->second.Data.Vec3CoordArr[CONST_STRING_POSITION_ATTRIB];
|
std::vector<vec3>& vertexCoordVec = itr->second.Data.Vec3CoordArr[CONST_STRING_POSITION_ATTRIB];
|
||||||
|
|
||||||
@ -261,7 +278,7 @@ void TGUIManager::MoveWidgetGroup(const std::string& widgetGroupName, const std:
|
|||||||
{
|
{
|
||||||
for (TWidgetArr::iterator i = WidgetArr.begin(); i != WidgetArr.end(); ++i)
|
for (TWidgetArr::iterator i = WidgetArr.begin(); i != WidgetArr.end(); ++i)
|
||||||
{
|
{
|
||||||
if (i->WidgetData->GroupName == widgetGroupName && i->WidgetData->Name != exceptWidget)
|
if (i->GroupName == widgetGroupName && i->Name != exceptWidget)
|
||||||
{
|
{
|
||||||
MoveWidgetByIterator(i, shift);
|
MoveWidgetByIterator(i, shift);
|
||||||
}
|
}
|
||||||
@ -285,14 +302,14 @@ void TGUIManager::OnMouseDown(vec2 pos, int touchNumber)
|
|||||||
|
|
||||||
for (i = WidgetArr.rbegin(); i != WidgetArr.rend(); ++i)
|
for (i = WidgetArr.rbegin(); i != WidgetArr.rend(); ++i)
|
||||||
{
|
{
|
||||||
if (i->WidgetData->Widget->CheckClick(pos))
|
if (i->Widget->CheckClick(pos))
|
||||||
{
|
{
|
||||||
bool isTransparentForInput = i->WidgetData->Widget->IsTransparentForInput();
|
bool isTransparentForInput = i->Widget->IsTransparentForInput();
|
||||||
|
|
||||||
i->WidgetData->Widget->OnTapDown(pos);
|
i->Widget->OnTapDown(pos);
|
||||||
i->WidgetData->IsMouseDown = true;
|
i->IsMouseDown = true;
|
||||||
|
|
||||||
signalMap.push_back((i->WidgetData->SignalMap[CONST_TAPDOWN_SIGNAL_NAME]));
|
signalMap.push_back((i->SignalMap[CONST_TAPDOWN_SIGNAL_NAME]));
|
||||||
|
|
||||||
if (! isTransparentForInput)
|
if (! isTransparentForInput)
|
||||||
{
|
{
|
||||||
@ -323,13 +340,13 @@ void TGUIManager::OnMouseUp(vec2 pos, int touchNumber)
|
|||||||
|
|
||||||
for (i = WidgetArr.rbegin(); i != WidgetArr.rend(); ++i)
|
for (i = WidgetArr.rbegin(); i != WidgetArr.rend(); ++i)
|
||||||
{
|
{
|
||||||
if (i->WidgetData->Widget->CheckClick(pos))
|
if (i->Widget->CheckClick(pos))
|
||||||
{
|
{
|
||||||
bool isTransparentForInput = i->WidgetData->Widget->IsTransparentForInput();
|
bool isTransparentForInput = i->Widget->IsTransparentForInput();
|
||||||
i->WidgetData->Widget->OnTapUp(pos);
|
i->Widget->OnTapUp(pos);
|
||||||
i->WidgetData->IsMouseDown = false;
|
i->IsMouseDown = false;
|
||||||
|
|
||||||
signalMap.push_back((i->WidgetData->SignalMap[CONST_CLICK_SIGNAL_NAME]));
|
signalMap.push_back((i->SignalMap[CONST_CLICK_SIGNAL_NAME]));
|
||||||
|
|
||||||
if (! isTransparentForInput)
|
if (! isTransparentForInput)
|
||||||
{
|
{
|
||||||
@ -361,11 +378,11 @@ void TGUIManager::OnMouseUp(vec2 pos, int touchNumber)
|
|||||||
|
|
||||||
for (i = WidgetArr.rbegin(); i != WidgetArr.rend(); ++i)
|
for (i = WidgetArr.rbegin(); i != WidgetArr.rend(); ++i)
|
||||||
{
|
{
|
||||||
if (i->WidgetData->Widget->CheckClick(pos))
|
if (i->Widget->CheckClick(pos))
|
||||||
{
|
{
|
||||||
bool isTransparentForInput = i->WidgetData->Widget->IsTransparentForInput();
|
bool isTransparentForInput = i->Widget->IsTransparentForInput();
|
||||||
i->WidgetData->Widget->OnTapUpAfterMove(pos);
|
i->Widget->OnTapUpAfterMove(pos);
|
||||||
i->WidgetData->IsMouseDown = false;
|
i->IsMouseDown = false;
|
||||||
|
|
||||||
//signalMap.push_back((i->SignalMap[CONST_CLICK_SIGNAL_NAME]));
|
//signalMap.push_back((i->SignalMap[CONST_CLICK_SIGNAL_NAME]));
|
||||||
//Do not call signals here
|
//Do not call signals here
|
||||||
@ -376,11 +393,11 @@ void TGUIManager::OnMouseUp(vec2 pos, int touchNumber)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i->WidgetData->Widget->CheckClick(LastTapPos[touchNumber]) && !i->WidgetData->Widget->CheckClick(pos))
|
if (i->Widget->CheckClick(LastTapPos[touchNumber]) && !i->Widget->CheckClick(pos))
|
||||||
{
|
{
|
||||||
bool isTransparentForInput = i->WidgetData->Widget->IsTransparentForInput();
|
bool isTransparentForInput = i->Widget->IsTransparentForInput();
|
||||||
i->WidgetData->Widget->OnTapUpAfterMoveOut(pos);
|
i->Widget->OnTapUpAfterMoveOut(pos);
|
||||||
i->WidgetData->IsMouseDown = false;
|
i->IsMouseDown = false;
|
||||||
|
|
||||||
//signalMap.push_back((i->SignalMap[CONST_CLICK_SIGNAL_NAME]));
|
//signalMap.push_back((i->SignalMap[CONST_CLICK_SIGNAL_NAME]));
|
||||||
//Do not call signals here
|
//Do not call signals here
|
||||||
@ -421,13 +438,13 @@ void TGUIManager::OnMove(vec2 shift, int touchNumber)
|
|||||||
|
|
||||||
for (i = WidgetArr.rbegin(); i != WidgetArr.rend(); ++i)
|
for (i = WidgetArr.rbegin(); i != WidgetArr.rend(); ++i)
|
||||||
{
|
{
|
||||||
if (!moveIsProcessed && i->WidgetData->Widget->CheckClick(LastTapPos[touchNumber]-TotalShift[touchNumber]))
|
if (!moveIsProcessed && i->Widget->CheckClick(LastTapPos[touchNumber]-TotalShift[touchNumber]))
|
||||||
{
|
{
|
||||||
bool isTransparentForInput = i->WidgetData->Widget->IsTransparentForInput();
|
bool isTransparentForInput = i->Widget->IsTransparentForInput();
|
||||||
|
|
||||||
i->WidgetData->Widget->OnMove(shift);
|
i->Widget->OnMove(shift);
|
||||||
|
|
||||||
signalMap.push_back((i->WidgetData->SignalMap[CONST_DRAG_SIGNAL_NAME]));
|
signalMap.push_back((i->SignalMap[CONST_DRAG_SIGNAL_NAME]));
|
||||||
|
|
||||||
if (! isTransparentForInput)
|
if (! isTransparentForInput)
|
||||||
{
|
{
|
||||||
@ -445,12 +462,12 @@ void TGUIManager::OnMove(vec2 shift, int touchNumber)
|
|||||||
|
|
||||||
for (i = WidgetArr.rbegin(); i != WidgetArr.rend(); ++i)
|
for (i = WidgetArr.rbegin(); i != WidgetArr.rend(); ++i)
|
||||||
{
|
{
|
||||||
if (!moveOutIsProcessed && i->WidgetData->Widget->CheckClick(LastTapPos[touchNumber]) && !i->WidgetData->Widget->CheckClick(LastTapPos[touchNumber]-TotalShift[touchNumber]))
|
if (!moveOutIsProcessed && i->Widget->CheckClick(LastTapPos[touchNumber]) && !i->Widget->CheckClick(LastTapPos[touchNumber]-TotalShift[touchNumber]))
|
||||||
{
|
{
|
||||||
bool isTransparentForInput = i->WidgetData->Widget->IsTransparentForInput();
|
bool isTransparentForInput = i->Widget->IsTransparentForInput();
|
||||||
|
|
||||||
i->WidgetData->Widget->OnMoveOut();
|
i->Widget->OnMoveOut();
|
||||||
i->WidgetData->IsMouseDown = false;
|
i->IsMouseDown = false;
|
||||||
if (! isTransparentForInput)
|
if (! isTransparentForInput)
|
||||||
{
|
{
|
||||||
moveOutIsProcessed = true;
|
moveOutIsProcessed = true;
|
||||||
@ -512,7 +529,7 @@ void TGUIManager::PrintWidgetList()
|
|||||||
|
|
||||||
for (i = WidgetArr.begin(); i != WidgetArr.end(); ++i)
|
for (i = WidgetArr.begin(); i != WidgetArr.end(); ++i)
|
||||||
{
|
{
|
||||||
std::string widgetRow = i->WidgetData->Name + " (" + tostr(i->WidgetData->Widget->LeftBottomPos.v[0]) + ", " + tostr(i->WidgetData->Widget->LeftBottomPos.v[1]) + ")";
|
std::string widgetRow = i->Name + " (" + tostr(i->Widget->LeftBottomPos.v[0]) + ", " + tostr(i->Widget->LeftBottomPos.v[1]) + ")";
|
||||||
Console->PrintImmediate(widgetRow);
|
Console->PrintImmediate(widgetRow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -523,7 +540,7 @@ std::shared_ptr<boost::signal<void (TSignalParam)>> TGUIManager::GetOnClickSigna
|
|||||||
|
|
||||||
TWidgetArr::iterator i = FindWidgetInArr(widgetName);
|
TWidgetArr::iterator i = FindWidgetInArr(widgetName);
|
||||||
|
|
||||||
return i->WidgetData->SignalMap[CONST_CLICK_SIGNAL_NAME];
|
return i->SignalMap[CONST_CLICK_SIGNAL_NAME];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -532,7 +549,7 @@ std::shared_ptr<boost::signal<void (TSignalParam)>> TGUIManager::GetOnHoldSignal
|
|||||||
|
|
||||||
TWidgetArr::iterator i = FindWidgetInArr(widgetName);
|
TWidgetArr::iterator i = FindWidgetInArr(widgetName);
|
||||||
|
|
||||||
return i->WidgetData->SignalMap[CONST_HOLD_SIGNAL_NAME];
|
return i->SignalMap[CONST_HOLD_SIGNAL_NAME];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -541,7 +558,7 @@ std::shared_ptr<boost::signal<void (TSignalParam)>> TGUIManager::GetOnTapDownSig
|
|||||||
|
|
||||||
TWidgetArr::iterator i = FindWidgetInArr(widgetName);
|
TWidgetArr::iterator i = FindWidgetInArr(widgetName);
|
||||||
|
|
||||||
return i->WidgetData->SignalMap[CONST_TAPDOWN_SIGNAL_NAME];
|
return i->SignalMap[CONST_TAPDOWN_SIGNAL_NAME];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -550,12 +567,12 @@ std::shared_ptr<boost::signal<void (TSignalParam)>> TGUIManager::GetSignal(const
|
|||||||
|
|
||||||
TWidgetArr::iterator i = FindWidgetInArr(widgetName);
|
TWidgetArr::iterator i = FindWidgetInArr(widgetName);
|
||||||
|
|
||||||
if (i->WidgetData->SignalMap.count(signalName) == 0)
|
if (i->SignalMap.count(signalName) == 0)
|
||||||
{
|
{
|
||||||
throw ErrorToLog("Illegal signal: "+signalName);
|
throw ErrorToLog("Illegal signal: "+signalName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return i->WidgetData->SignalMap[signalName];
|
return i->SignalMap[signalName];
|
||||||
}
|
}
|
||||||
|
|
||||||
void TGUIManager::SQ_MoveWidget(const SQChar *widgetName, float x, float y)
|
void TGUIManager::SQ_MoveWidget(const SQChar *widgetName, float x, float y)
|
||||||
|
@ -105,5 +105,16 @@ bool IsIpad()
|
|||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsIphone5()
|
||||||
|
{
|
||||||
|
if ([[UIScreen mainScreen] bounds].size.height == 568)
|
||||||
|
{
|
||||||
|
return YES; /* Device is iPhone5 */
|
||||||
|
}
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} //namespace SE
|
} //namespace SE
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user