mirror of
https://github.com/edubart/otclient.git
synced 2025-11-30 23:26:51 +01:00
More multiprotocol support
This commit is contained in:
@@ -37,14 +37,14 @@ static const std::string glslMainWithTexCoordsVertexShader = "\n\
|
||||
void main()\n\
|
||||
{\n\
|
||||
gl_Position = calculatePosition();\n\
|
||||
v_TexCoord = (u_TextureMatrix * vec3(a_TexCoord,1)).xy;\n\
|
||||
v_TexCoord = (u_TextureMatrix * vec3(a_TexCoord,1.0)).xy;\n\
|
||||
}\n";
|
||||
|
||||
static std::string glslPositionOnlyVertexShader = "\n\
|
||||
attribute highp vec2 a_Vertex;\n\
|
||||
uniform highp mat3 u_ProjectionMatrix;\n\
|
||||
highp vec4 calculatePosition() {\n\
|
||||
return vec4(u_ProjectionMatrix * vec3(a_Vertex.xy, 1), 1);\n\
|
||||
return vec4(u_ProjectionMatrix * vec3(a_Vertex.xy, 1.0), 1.0);\n\
|
||||
}\n";
|
||||
|
||||
static const std::string glslMainFragmentShader = "\n\
|
||||
|
||||
@@ -336,6 +336,7 @@ void Application::registerLuaFunctions()
|
||||
g_lua.bindClassMemberFunction<UIWidget>("getChildByIndex", &UIWidget::getChildByIndex);
|
||||
g_lua.bindClassMemberFunction<UIWidget>("recursiveGetChildById", &UIWidget::recursiveGetChildById);
|
||||
g_lua.bindClassMemberFunction<UIWidget>("recursiveGetChildByPos", &UIWidget::recursiveGetChildByPos);
|
||||
g_lua.bindClassMemberFunction<UIWidget>("recursiveGetChildren", &UIWidget::recursiveGetChildren);
|
||||
g_lua.bindClassMemberFunction<UIWidget>("recursiveGetChildrenByPos", &UIWidget::recursiveGetChildrenByPos);
|
||||
g_lua.bindClassMemberFunction<UIWidget>("recursiveGetChildrenByMarginPos", &UIWidget::recursiveGetChildrenByMarginPos);
|
||||
g_lua.bindClassMemberFunction<UIWidget>("backwardsGetWidgetById", &UIWidget::backwardsGetWidgetById);
|
||||
|
||||
@@ -56,7 +56,7 @@ private:
|
||||
SoundSourcePtr createSoundSource(const std::string& filename);
|
||||
uint loadFileIntoBuffer(const SoundFilePtr& soundFile);
|
||||
|
||||
std::map<std::string, SoundBufferPtr> m_buffers;
|
||||
std::unordered_map<std::string, SoundBufferPtr> m_buffers;
|
||||
std::vector<SoundSourcePtr> m_sources;
|
||||
SoundSourcePtr m_musicSource;
|
||||
ALCdevice *m_device;
|
||||
|
||||
@@ -81,7 +81,7 @@ protected:
|
||||
|
||||
private:
|
||||
bool updateWidget(const UIWidgetPtr& widget, UIAnchorGroup& anchorGroup, UIWidgetPtr first = nullptr);
|
||||
std::map<UIWidgetPtr, UIAnchorGroup> m_anchorsGroups;
|
||||
std::unordered_map<UIWidgetPtr, UIAnchorGroup> m_anchorsGroups;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1130,6 +1130,18 @@ UIWidgetPtr UIWidget::recursiveGetChildByPos(const Point& childPos, bool wantsPh
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
UIWidgetList UIWidget::recursiveGetChildren()
|
||||
{
|
||||
UIWidgetList children;
|
||||
for(const UIWidgetPtr& child : m_children) {
|
||||
UIWidgetList subChildren = child->recursiveGetChildren();
|
||||
if(!subChildren.empty())
|
||||
children.insert(children.end(), subChildren.begin(), subChildren.end());
|
||||
children.push_back(child);
|
||||
}
|
||||
return children;
|
||||
}
|
||||
|
||||
UIWidgetList UIWidget::recursiveGetChildrenByPos(const Point& childPos)
|
||||
{
|
||||
UIWidgetList children;
|
||||
|
||||
@@ -147,6 +147,7 @@ public:
|
||||
UIWidgetPtr getChildByIndex(int index);
|
||||
UIWidgetPtr recursiveGetChildById(const std::string& id);
|
||||
UIWidgetPtr recursiveGetChildByPos(const Point& childPos, bool wantsPhantom);
|
||||
UIWidgetList recursiveGetChildren();
|
||||
UIWidgetList recursiveGetChildrenByPos(const Point& childPos);
|
||||
UIWidgetList recursiveGetChildrenByMarginPos(const Point& childPos);
|
||||
UIWidgetPtr backwardsGetWidgetById(const std::string& id);
|
||||
|
||||
Reference in New Issue
Block a user