|
@@ -1,7 +1,3 @@
|
|
|
-/*
|
|
|
|
|
- * Theme.cpp
|
|
|
|
|
- */
|
|
|
|
|
-
|
|
|
|
|
#include "Base.h"
|
|
#include "Base.h"
|
|
|
#include "Theme.h"
|
|
#include "Theme.h"
|
|
|
|
|
|
|
@@ -26,28 +22,22 @@ namespace gameplay
|
|
|
SAFE_DELETE(style);
|
|
SAFE_DELETE(style);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- for (unsigned int i = 0, count = _cursors.size(); i < count; ++i)
|
|
|
|
|
|
|
+ for (unsigned int i = 0, count = _images.size(); i < count; ++i)
|
|
|
{
|
|
{
|
|
|
- Cursor* cursor = _cursors[i];
|
|
|
|
|
- SAFE_RELEASE(cursor);
|
|
|
|
|
|
|
+ Image* image = _images[i];
|
|
|
|
|
+ SAFE_RELEASE(image);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- for (unsigned int i = 0, count = _icons.size(); i < count; ++i)
|
|
|
|
|
|
|
+ for (unsigned int i = 0, count = _imageLists.size(); i < count; ++i)
|
|
|
{
|
|
{
|
|
|
- Icon* icon = _icons[i];
|
|
|
|
|
- SAFE_RELEASE(icon);
|
|
|
|
|
|
|
+ ImageList* imageList = _imageLists[i];
|
|
|
|
|
+ SAFE_RELEASE(imageList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- for (unsigned int i = 0, count = _sliders.size(); i < count; ++i)
|
|
|
|
|
|
|
+ for (unsigned int i = 0, count = _skins.size(); i < count; ++i)
|
|
|
{
|
|
{
|
|
|
- SliderIcon* slider = _sliders[i];
|
|
|
|
|
- SAFE_RELEASE(slider);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- for (unsigned int i = 0, count = _containers.size(); i < count; ++i)
|
|
|
|
|
- {
|
|
|
|
|
- ContainerRegion* container = _containers[i];
|
|
|
|
|
- SAFE_RELEASE(container);
|
|
|
|
|
|
|
+ Skin* skin = _skins[i];
|
|
|
|
|
+ SAFE_RELEASE(skin);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
SAFE_DELETE(_spriteBatch);
|
|
SAFE_DELETE(_spriteBatch);
|
|
@@ -104,80 +94,24 @@ namespace gameplay
|
|
|
theme->_texture = Texture::create(textureFile, false);
|
|
theme->_texture = Texture::create(textureFile, false);
|
|
|
theme->_spriteBatch = SpriteBatch::create(theme->_texture);
|
|
theme->_spriteBatch = SpriteBatch::create(theme->_texture);
|
|
|
|
|
|
|
|
|
|
+ float tw = 1.0f / theme->_texture->getWidth();
|
|
|
|
|
+ float th = 1.0f / theme->_texture->getHeight();
|
|
|
|
|
+
|
|
|
Properties* space = themeProperties->getNextNamespace();
|
|
Properties* space = themeProperties->getNextNamespace();
|
|
|
while (space != NULL)
|
|
while (space != NULL)
|
|
|
{
|
|
{
|
|
|
// First load all cursors, checkboxes etc. that can be referred to by styles.
|
|
// First load all cursors, checkboxes etc. that can be referred to by styles.
|
|
|
const char* spacename = space->getNamespace();
|
|
const char* spacename = space->getNamespace();
|
|
|
- if (strcmp(spacename, "cursor") == 0)
|
|
|
|
|
- {
|
|
|
|
|
- Vector4 regionVector;
|
|
|
|
|
- space->getVector4("region", ®ionVector);
|
|
|
|
|
- const Rectangle region(regionVector.x, regionVector.y, regionVector.z, regionVector.w);
|
|
|
|
|
-
|
|
|
|
|
- Vector4 color(1, 1, 1, 1);
|
|
|
|
|
- if (space->exists("color"))
|
|
|
|
|
- {
|
|
|
|
|
- space->getColor("color", &color);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- Theme::Cursor* c = Theme::Cursor::create(space->getId(), *theme->_texture, region, color);
|
|
|
|
|
- theme->_cursors.push_back(c);
|
|
|
|
|
- }
|
|
|
|
|
- else if (strcmp(spacename, "icon") == 0)
|
|
|
|
|
- {
|
|
|
|
|
- Vector2 offVec;
|
|
|
|
|
- Vector2 onVec;
|
|
|
|
|
- Vector2 size;
|
|
|
|
|
- space->getVector2("offPosition", &offVec);
|
|
|
|
|
- space->getVector2("onPosition", &onVec);
|
|
|
|
|
- space->getVector2("size", &size);
|
|
|
|
|
-
|
|
|
|
|
- Vector4 color(1, 1, 1, 1);
|
|
|
|
|
- if (space->exists("color"))
|
|
|
|
|
- {
|
|
|
|
|
- space->getColor("color", &color);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- Icon* icon = Icon::create(space->getId(), *theme->_texture, size, offVec, onVec, color);
|
|
|
|
|
- theme->_icons.push_back(icon);
|
|
|
|
|
- }
|
|
|
|
|
- else if (strcmp(spacename, "slider") == 0)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (strcmp(spacename, "image") == 0)
|
|
|
{
|
|
{
|
|
|
- Vector4 minCapRegion;
|
|
|
|
|
- Vector4 maxCapRegion;
|
|
|
|
|
- Vector4 trackRegion;
|
|
|
|
|
- Vector4 markerRegion;
|
|
|
|
|
- space->getVector4("minCapRegion", &minCapRegion);
|
|
|
|
|
- space->getVector4("maxCapRegion", &maxCapRegion);
|
|
|
|
|
- space->getVector4("trackRegion", &trackRegion);
|
|
|
|
|
- space->getVector4("markerRegion", &markerRegion);
|
|
|
|
|
-
|
|
|
|
|
- Vector4 color(1, 1, 1, 1);
|
|
|
|
|
- if (space->exists("color"))
|
|
|
|
|
- {
|
|
|
|
|
- space->getColor("color", &color);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- SliderIcon* sliderIcon = SliderIcon::create(space->getId(), *theme->_texture, minCapRegion, maxCapRegion, markerRegion, trackRegion, color);
|
|
|
|
|
- theme->_sliders.push_back(sliderIcon);
|
|
|
|
|
|
|
+ theme->_images.push_back(Image::create(tw, th, space, Vector4::one()));
|
|
|
}
|
|
}
|
|
|
- else if (strcmp(spacename, "cursor") == 0)
|
|
|
|
|
|
|
+ else if (strcmp(spacename, "imageList") == 0)
|
|
|
{
|
|
{
|
|
|
- Vector4 regionVector;
|
|
|
|
|
- space->getVector4("region", ®ionVector);
|
|
|
|
|
- const Rectangle region(regionVector.x, regionVector.y, regionVector.z, regionVector.w);
|
|
|
|
|
-
|
|
|
|
|
- Vector4 color(1, 1, 1, 1);
|
|
|
|
|
- if (space->exists("color"))
|
|
|
|
|
- {
|
|
|
|
|
- space->getColor("color", &color);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- Cursor* cursor = Cursor::create(space->getId(), *theme->_texture, region, color);
|
|
|
|
|
- theme->_cursors.push_back(cursor);
|
|
|
|
|
|
|
+ theme->_imageLists.push_back(ImageList::create(tw, th, space));
|
|
|
}
|
|
}
|
|
|
- else if (strcmp(spacename, "container") == 0)
|
|
|
|
|
|
|
+ else if (strcmp(spacename, "skin") == 0)
|
|
|
{
|
|
{
|
|
|
Theme::Border border;
|
|
Theme::Border border;
|
|
|
Properties* innerSpace = space->getNextNamespace();
|
|
Properties* innerSpace = space->getNextNamespace();
|
|
@@ -203,8 +137,8 @@ namespace gameplay
|
|
|
space->getColor("color", &color);
|
|
space->getColor("color", &color);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- ContainerRegion* container = ContainerRegion::create(space->getId(), *theme->_texture, region, border, color);
|
|
|
|
|
- theme->_containers.push_back(container);
|
|
|
|
|
|
|
+ Skin* skin = Skin::create(space->getId(), tw, th, region, border, color);
|
|
|
|
|
+ theme->_skins.push_back(skin);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
space = themeProperties->getNextNamespace();
|
|
space = themeProperties->getNextNamespace();
|
|
@@ -231,7 +165,7 @@ namespace gameplay
|
|
|
while (innerSpace != NULL)
|
|
while (innerSpace != NULL)
|
|
|
{
|
|
{
|
|
|
const char* innerSpacename = innerSpace->getNamespace();
|
|
const char* innerSpacename = innerSpace->getNamespace();
|
|
|
- if (strcmp(innerSpacename, "normal") == 0)
|
|
|
|
|
|
|
+ if (strcmp(innerSpacename, "stateNormal") == 0)
|
|
|
{
|
|
{
|
|
|
Vector4 textColor(0, 0, 0, 1);
|
|
Vector4 textColor(0, 0, 0, 1);
|
|
|
if (innerSpace->exists("textColor"))
|
|
if (innerSpace->exists("textColor"))
|
|
@@ -254,26 +188,27 @@ namespace gameplay
|
|
|
}
|
|
}
|
|
|
bool rightToLeft = innerSpace->getBool("rightToLeft");
|
|
bool rightToLeft = innerSpace->getBool("rightToLeft");
|
|
|
|
|
|
|
|
- Icon* checkBoxIcon = NULL;
|
|
|
|
|
- Icon* radioButtonIcon = NULL;
|
|
|
|
|
- SliderIcon* sliderIcon = NULL;
|
|
|
|
|
- Cursor* textCursor = NULL;
|
|
|
|
|
- Cursor* mouseCursor = NULL;
|
|
|
|
|
- ContainerRegion* containerRegion = NULL;
|
|
|
|
|
- theme->lookUpSprites(innerSpace, &checkBoxIcon, &radioButtonIcon, &sliderIcon, &textCursor, &mouseCursor, &containerRegion);
|
|
|
|
|
|
|
+ float opacity = 1.0f;
|
|
|
|
|
+ if (innerSpace->exists("opacity"))
|
|
|
|
|
+ {
|
|
|
|
|
+ opacity = innerSpace->getFloat("opacity");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ImageList* imageList = NULL;
|
|
|
|
|
+ Image* cursor = NULL;
|
|
|
|
|
+ Skin* skin = NULL;
|
|
|
|
|
+ theme->lookUpSprites(innerSpace, &imageList, &cursor, &skin);
|
|
|
|
|
|
|
|
normal = Theme::Style::Overlay::create();
|
|
normal = Theme::Style::Overlay::create();
|
|
|
- normal->setContainerRegion(containerRegion);
|
|
|
|
|
- normal->setTextCursor(textCursor);
|
|
|
|
|
- normal->setMouseCursor(mouseCursor);
|
|
|
|
|
- normal->setCheckBoxIcon(checkBoxIcon);
|
|
|
|
|
- normal->setRadioButtonIcon(radioButtonIcon);
|
|
|
|
|
- normal->setSliderIcon(sliderIcon);
|
|
|
|
|
|
|
+ normal->setSkin(skin);
|
|
|
|
|
+ normal->setCursor(cursor);
|
|
|
|
|
+ normal->setImageList(imageList);
|
|
|
normal->setTextColor(textColor);
|
|
normal->setTextColor(textColor);
|
|
|
normal->setFont(font);
|
|
normal->setFont(font);
|
|
|
normal->setFontSize(fontSize);
|
|
normal->setFontSize(fontSize);
|
|
|
normal->setTextAlignment(alignment);
|
|
normal->setTextAlignment(alignment);
|
|
|
normal->setTextRightToLeft(rightToLeft);
|
|
normal->setTextRightToLeft(rightToLeft);
|
|
|
|
|
+ normal->setOpacity(opacity);
|
|
|
|
|
|
|
|
theme->_fonts.insert(font);
|
|
theme->_fonts.insert(font);
|
|
|
|
|
|
|
@@ -308,7 +243,7 @@ namespace gameplay
|
|
|
padding.left = innerSpace->getFloat("left");
|
|
padding.left = innerSpace->getFloat("left");
|
|
|
padding.right = innerSpace->getFloat("right");
|
|
padding.right = innerSpace->getFloat("right");
|
|
|
}
|
|
}
|
|
|
- else if (strcmp(innerSpacename, "normal") != 0)
|
|
|
|
|
|
|
+ else if (strcmp(innerSpacename, "stateNormal") != 0)
|
|
|
{
|
|
{
|
|
|
// Either OVERLAY_FOCUS or OVERLAY_ACTIVE.
|
|
// Either OVERLAY_FOCUS or OVERLAY_ACTIVE.
|
|
|
// If a property isn't specified, it inherits from OVERLAY_NORMAL.
|
|
// If a property isn't specified, it inherits from OVERLAY_NORMAL.
|
|
@@ -360,94 +295,78 @@ namespace gameplay
|
|
|
rightToLeft = normal->getTextRightToLeft();
|
|
rightToLeft = normal->getTextRightToLeft();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- Icon* checkBoxIcon = NULL;
|
|
|
|
|
- Icon* radioButtonIcon = NULL;
|
|
|
|
|
- SliderIcon* sliderIcon = NULL;
|
|
|
|
|
- Cursor* textCursor = NULL;
|
|
|
|
|
- Cursor* mouseCursor = NULL;
|
|
|
|
|
- ContainerRegion* containerRegion = NULL;
|
|
|
|
|
- theme->lookUpSprites(innerSpace, &checkBoxIcon, &radioButtonIcon, &sliderIcon, &textCursor, &mouseCursor, &containerRegion);
|
|
|
|
|
-
|
|
|
|
|
- if (!checkBoxIcon)
|
|
|
|
|
|
|
+ float opacity;
|
|
|
|
|
+ if (innerSpace->exists("opacity"))
|
|
|
{
|
|
{
|
|
|
- checkBoxIcon = normal->getCheckBoxIcon();
|
|
|
|
|
|
|
+ opacity = innerSpace->getFloat("opacity");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- if (!radioButtonIcon)
|
|
|
|
|
- {
|
|
|
|
|
- radioButtonIcon = normal->getRadioButtonIcon();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (!sliderIcon)
|
|
|
|
|
|
|
+ else
|
|
|
{
|
|
{
|
|
|
- sliderIcon = normal->getSliderIcon();
|
|
|
|
|
|
|
+ opacity = normal->getOpacity();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (!textCursor)
|
|
|
|
|
|
|
+ ImageList* imageList = NULL;
|
|
|
|
|
+ Image* cursor = NULL;
|
|
|
|
|
+ Skin* skin = NULL;
|
|
|
|
|
+ theme->lookUpSprites(innerSpace, &imageList, &cursor, &skin);
|
|
|
|
|
+
|
|
|
|
|
+ if (!imageList)
|
|
|
{
|
|
{
|
|
|
- textCursor = normal->getTextCursor();
|
|
|
|
|
|
|
+ imageList = normal->getImageList();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (!mouseCursor)
|
|
|
|
|
|
|
+ if (!cursor)
|
|
|
{
|
|
{
|
|
|
- mouseCursor = normal->getMouseCursor();
|
|
|
|
|
|
|
+ cursor = normal->getCursor();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (!containerRegion)
|
|
|
|
|
|
|
+ if (!skin)
|
|
|
{
|
|
{
|
|
|
- containerRegion = normal->getContainerRegion();
|
|
|
|
|
|
|
+ skin = normal->getSkin();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (strcmp(innerSpacename, "focus") == 0)
|
|
|
|
|
|
|
+ if (strcmp(innerSpacename, "stateFocus") == 0)
|
|
|
{
|
|
{
|
|
|
focus = Theme::Style::Overlay::create();
|
|
focus = Theme::Style::Overlay::create();
|
|
|
- focus->setContainerRegion(containerRegion);
|
|
|
|
|
- focus->setCheckBoxIcon(checkBoxIcon);
|
|
|
|
|
- focus->setTextCursor(textCursor);
|
|
|
|
|
- focus->setMouseCursor(mouseCursor);
|
|
|
|
|
- focus->setCheckBoxIcon(checkBoxIcon);
|
|
|
|
|
- focus->setRadioButtonIcon(radioButtonIcon);
|
|
|
|
|
- focus->setSliderIcon(sliderIcon);
|
|
|
|
|
|
|
+ focus->setSkin(skin);
|
|
|
|
|
+ focus->setCursor(cursor);
|
|
|
|
|
+ focus->setImageList(imageList);
|
|
|
focus->setTextColor(textColor);
|
|
focus->setTextColor(textColor);
|
|
|
focus->setFont(font);
|
|
focus->setFont(font);
|
|
|
focus->setFontSize(fontSize);
|
|
focus->setFontSize(fontSize);
|
|
|
focus->setTextAlignment(alignment);
|
|
focus->setTextAlignment(alignment);
|
|
|
focus->setTextRightToLeft(rightToLeft);
|
|
focus->setTextRightToLeft(rightToLeft);
|
|
|
|
|
+ focus->setOpacity(opacity);
|
|
|
|
|
|
|
|
theme->_fonts.insert(font);
|
|
theme->_fonts.insert(font);
|
|
|
}
|
|
}
|
|
|
- else if (strcmp(innerSpacename, "active") == 0)
|
|
|
|
|
|
|
+ else if (strcmp(innerSpacename, "stateActive") == 0)
|
|
|
{
|
|
{
|
|
|
active = Theme::Style::Overlay::create();
|
|
active = Theme::Style::Overlay::create();
|
|
|
- active->setContainerRegion(containerRegion);
|
|
|
|
|
- active->setTextCursor(textCursor);
|
|
|
|
|
- active->setMouseCursor(mouseCursor);
|
|
|
|
|
- active->setCheckBoxIcon(checkBoxIcon);
|
|
|
|
|
- active->setRadioButtonIcon(radioButtonIcon);
|
|
|
|
|
- active->setSliderIcon(sliderIcon);
|
|
|
|
|
|
|
+ active->setSkin(skin);
|
|
|
|
|
+ active->setCursor(cursor);
|
|
|
|
|
+ active->setImageList(imageList);
|
|
|
active->setTextColor(textColor);
|
|
active->setTextColor(textColor);
|
|
|
active->setFont(font);
|
|
active->setFont(font);
|
|
|
active->setFontSize(fontSize);
|
|
active->setFontSize(fontSize);
|
|
|
active->setTextAlignment(alignment);
|
|
active->setTextAlignment(alignment);
|
|
|
active->setTextRightToLeft(rightToLeft);
|
|
active->setTextRightToLeft(rightToLeft);
|
|
|
|
|
+ active->setOpacity(opacity);
|
|
|
|
|
|
|
|
theme->_fonts.insert(font);
|
|
theme->_fonts.insert(font);
|
|
|
}
|
|
}
|
|
|
- else if (strcmp(innerSpacename, "disabled") == 0)
|
|
|
|
|
|
|
+ else if (strcmp(innerSpacename, "stateDisabled") == 0)
|
|
|
{
|
|
{
|
|
|
disabled = Theme::Style::Overlay::create();
|
|
disabled = Theme::Style::Overlay::create();
|
|
|
- disabled->setContainerRegion(containerRegion);
|
|
|
|
|
- disabled->setTextCursor(textCursor);
|
|
|
|
|
- disabled->setMouseCursor(mouseCursor);
|
|
|
|
|
- disabled->setCheckBoxIcon(checkBoxIcon);
|
|
|
|
|
- disabled->setRadioButtonIcon(radioButtonIcon);
|
|
|
|
|
- disabled->setSliderIcon(sliderIcon);
|
|
|
|
|
|
|
+ disabled->setSkin(skin);
|
|
|
|
|
+ disabled->setCursor(cursor);
|
|
|
|
|
+ disabled->setImageList(imageList);
|
|
|
disabled->setTextColor(textColor);
|
|
disabled->setTextColor(textColor);
|
|
|
disabled->setFont(font);
|
|
disabled->setFont(font);
|
|
|
disabled->setFontSize(fontSize);
|
|
disabled->setFontSize(fontSize);
|
|
|
disabled->setTextAlignment(alignment);
|
|
disabled->setTextAlignment(alignment);
|
|
|
disabled->setTextRightToLeft(rightToLeft);
|
|
disabled->setTextRightToLeft(rightToLeft);
|
|
|
|
|
+ disabled->setOpacity(opacity);
|
|
|
|
|
|
|
|
theme->_fonts.insert(font);
|
|
theme->_fonts.insert(font);
|
|
|
}
|
|
}
|
|
@@ -474,7 +393,7 @@ namespace gameplay
|
|
|
disabled->addRef();
|
|
disabled->addRef();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Theme::Style* s = new Theme::Style(space->getId(), margin, padding, normal, focus, active, disabled);
|
|
|
|
|
|
|
+ Theme::Style* s = new Theme::Style(space->getId(), tw, th, margin, padding, normal, focus, active, disabled);
|
|
|
theme->_styles.push_back(s);
|
|
theme->_styles.push_back(s);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -519,223 +438,222 @@ namespace gameplay
|
|
|
return _spriteBatch;
|
|
return _spriteBatch;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /***************
|
|
|
|
|
- * Theme::Icon *
|
|
|
|
|
- ***************/
|
|
|
|
|
- Theme::Icon* Theme::Icon::create(const char* id, const Texture& texture, const Vector2& size,
|
|
|
|
|
- const Vector2& offPosition, const Vector2& onPosition, const Vector4& color)
|
|
|
|
|
|
|
+ /**************
|
|
|
|
|
+ * Theme::UVs *
|
|
|
|
|
+ **************/
|
|
|
|
|
+ Theme::UVs::UVs()
|
|
|
|
|
+ : u1(0), v1(0), u2(0), v2(0)
|
|
|
{
|
|
{
|
|
|
- Icon* icon = new Icon(texture, size, offPosition, onPosition, color);
|
|
|
|
|
-
|
|
|
|
|
- if (id)
|
|
|
|
|
- {
|
|
|
|
|
- icon->_id = id;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- return icon;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Theme::Icon::Icon(const Texture& texture, const Vector2& size,
|
|
|
|
|
- const Vector2& offPosition, const Vector2& onPosition, const Vector4& color)
|
|
|
|
|
- : _size(size), _color(color)
|
|
|
|
|
|
|
+ Theme::UVs::UVs(float u1, float v1, float u2, float v2)
|
|
|
|
|
+ : u1(u1), v1(v1), u2(u2), v2(v2)
|
|
|
{
|
|
{
|
|
|
- generateUVs(texture, offPosition.x, offPosition.y, size.x, size.y, &_off);
|
|
|
|
|
- generateUVs(texture, onPosition.x, onPosition.y, size.x, size.y, &_on);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Theme::Icon::~Icon()
|
|
|
|
|
|
|
+ const Theme::UVs& Theme::UVs::empty()
|
|
|
{
|
|
{
|
|
|
|
|
+ static UVs empty(0, 0, 0, 0);
|
|
|
|
|
+ return empty;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const char* Theme::Icon::getId() const
|
|
|
|
|
- {
|
|
|
|
|
- return _id.c_str();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const Vector2& Theme::Icon::getSize() const
|
|
|
|
|
|
|
+ /**********************
|
|
|
|
|
+ * Theme::SideRegions *
|
|
|
|
|
+ **********************/
|
|
|
|
|
+ const Theme::SideRegions& Theme::SideRegions::empty()
|
|
|
{
|
|
{
|
|
|
- return _size;
|
|
|
|
|
|
|
+ static SideRegions empty;
|
|
|
|
|
+ return empty;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const Vector4& Theme::Icon::getColor() const
|
|
|
|
|
|
|
+ /****************
|
|
|
|
|
+ * Theme::Image *
|
|
|
|
|
+ ****************/
|
|
|
|
|
+ Theme::Image::Image(float tw, float th, const Rectangle& region, const Vector4& color)
|
|
|
|
|
+ : _region(region), _color(color)
|
|
|
{
|
|
{
|
|
|
- return _color;
|
|
|
|
|
|
|
+ generateUVs(tw, th, region.x, region.y, region.width, region.height, &_uvs);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const Theme::UVs& Theme::Icon::getOffUVs() const
|
|
|
|
|
|
|
+ Theme::Image::~Image()
|
|
|
{
|
|
{
|
|
|
- return _off;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const Theme::UVs& Theme::Icon::getOnUVs() const
|
|
|
|
|
|
|
+ Theme::Image* Theme::Image::create(float tw, float th, Properties* properties, const Vector4& defaultColor)
|
|
|
{
|
|
{
|
|
|
- return _on;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ Vector4 regionVector;
|
|
|
|
|
+ properties->getVector4("region", ®ionVector);
|
|
|
|
|
+ const Rectangle region(regionVector.x, regionVector.y, regionVector.z, regionVector.w);
|
|
|
|
|
|
|
|
- /*********************
|
|
|
|
|
- * Theme::SliderIcon *
|
|
|
|
|
- *********************/
|
|
|
|
|
- Theme::SliderIcon* Theme::SliderIcon::create(const char* id, const Texture& texture, const Vector4& minCapRegion,
|
|
|
|
|
- const Vector4& maxCapRegion, const Vector4& markerRegion, const Vector4& trackRegion, const Vector4& color)
|
|
|
|
|
- {
|
|
|
|
|
- SliderIcon* sliderIcon = new SliderIcon(texture, minCapRegion, maxCapRegion, markerRegion, trackRegion, color);
|
|
|
|
|
|
|
+ Vector4 color;
|
|
|
|
|
+ if (properties->exists("color"))
|
|
|
|
|
+ {
|
|
|
|
|
+ properties->getColor("color", &color);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ color.set(defaultColor);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ Image* image = new Image(tw, th, region, color);
|
|
|
|
|
+ const char* id = properties->getId();
|
|
|
if (id)
|
|
if (id)
|
|
|
{
|
|
{
|
|
|
- sliderIcon->_id = id;
|
|
|
|
|
|
|
+ image->_id = id;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return sliderIcon;
|
|
|
|
|
|
|
+ return image;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Theme::SliderIcon::SliderIcon(const Texture& texture, const Vector4& minCapRegion, const Vector4& maxCapRegion,
|
|
|
|
|
- const Vector4& markerRegion, const Vector4& trackRegion, const Vector4& color)
|
|
|
|
|
- : _color(color)
|
|
|
|
|
|
|
+ const char* Theme::Image::getId() const
|
|
|
{
|
|
{
|
|
|
- _minCapSize.set(minCapRegion.z, minCapRegion.w);
|
|
|
|
|
- _maxCapSize.set(maxCapRegion.z, maxCapRegion.w);
|
|
|
|
|
- _markerSize.set(markerRegion.z, markerRegion.w);
|
|
|
|
|
- _trackSize.set(trackRegion.z, trackRegion.w);
|
|
|
|
|
-
|
|
|
|
|
- generateUVs(texture, minCapRegion.x, minCapRegion.y, minCapRegion.z, minCapRegion.w, &_minCap);
|
|
|
|
|
- generateUVs(texture, maxCapRegion.x, maxCapRegion.y, maxCapRegion.z, maxCapRegion.w, &_maxCap);
|
|
|
|
|
- generateUVs(texture, markerRegion.x, markerRegion.y, markerRegion.z, markerRegion.w, &_marker);
|
|
|
|
|
- generateUVs(texture, trackRegion.x, trackRegion.y, trackRegion.z, trackRegion.w, &_track);
|
|
|
|
|
|
|
+ return _id.c_str();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Theme::SliderIcon::~SliderIcon()
|
|
|
|
|
|
|
+ const Theme::UVs& Theme::Image::getUVs() const
|
|
|
{
|
|
{
|
|
|
|
|
+ return _uvs;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const char* Theme::SliderIcon::getId() const
|
|
|
|
|
|
|
+ const Rectangle& Theme::Image::getRegion() const
|
|
|
{
|
|
{
|
|
|
- return _id.c_str();
|
|
|
|
|
|
|
+ return _region;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const Theme::UVs& Theme::SliderIcon::getMinCapUVs() const
|
|
|
|
|
|
|
+ const Vector4& Theme::Image::getColor() const
|
|
|
{
|
|
{
|
|
|
- return _minCap;
|
|
|
|
|
|
|
+ return _color;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const Theme::UVs& Theme::SliderIcon::getMaxCapUVs() const
|
|
|
|
|
|
|
+ /********************
|
|
|
|
|
+ * Theme::ImageList *
|
|
|
|
|
+ ********************/
|
|
|
|
|
+ Theme::ImageList::ImageList(const Vector4& color) : _color(color)
|
|
|
{
|
|
{
|
|
|
- return _maxCap;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const Theme::UVs& Theme::SliderIcon::getMarkerUVs() const
|
|
|
|
|
- {
|
|
|
|
|
- return _marker;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const Theme::UVs& Theme::SliderIcon::getTrackUVs() const
|
|
|
|
|
- {
|
|
|
|
|
- return _track;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const Vector2& Theme::SliderIcon::getMinCapSize() const
|
|
|
|
|
|
|
+ Theme::ImageList::ImageList(const ImageList& copy)
|
|
|
{
|
|
{
|
|
|
- return _minCapSize;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ _id = copy._id;
|
|
|
|
|
+ _color = copy._color;
|
|
|
|
|
|
|
|
- const Vector2& Theme::SliderIcon::getMaxCapSize() const
|
|
|
|
|
- {
|
|
|
|
|
- return _maxCapSize;
|
|
|
|
|
|
|
+ std::vector<Image*>::const_iterator it;
|
|
|
|
|
+ for (it = copy._images.begin(); it != copy._images.end(); it++)
|
|
|
|
|
+ {
|
|
|
|
|
+ Image* image = *it;
|
|
|
|
|
+ _images.push_back(new Image(*image));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const Vector2& Theme::SliderIcon::getMarkerSize() const
|
|
|
|
|
|
|
+ Theme::ImageList::~ImageList()
|
|
|
{
|
|
{
|
|
|
- return _markerSize;
|
|
|
|
|
|
|
+ std::vector<Image*>::const_iterator it;
|
|
|
|
|
+ for (it = _images.begin(); it != _images.end(); it++)
|
|
|
|
|
+ {
|
|
|
|
|
+ Image* image = *it;
|
|
|
|
|
+ SAFE_RELEASE(image);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const Vector2& Theme::SliderIcon::getTrackSize() const
|
|
|
|
|
|
|
+ Theme::ImageList* Theme::ImageList::create(float tw, float th, Properties* properties)
|
|
|
{
|
|
{
|
|
|
- return _trackSize;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ Vector4 color(1, 1, 1, 1);
|
|
|
|
|
+ if (properties->exists("color"))
|
|
|
|
|
+ {
|
|
|
|
|
+ properties->getColor("color", &color);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- const Vector4& Theme::SliderIcon::getColor() const
|
|
|
|
|
- {
|
|
|
|
|
- return _color;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ ImageList* imageList = new ImageList(color);
|
|
|
|
|
|
|
|
- /*****************
|
|
|
|
|
- * Theme::Cursor *
|
|
|
|
|
- *****************/
|
|
|
|
|
- Theme::Cursor* Theme::Cursor::create(const char* id, const Texture& texture, const Rectangle& region, const Vector4& color)
|
|
|
|
|
- {
|
|
|
|
|
- Cursor* cursor = new Cursor(texture, region, color);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ const char* id = properties->getId();
|
|
|
if (id)
|
|
if (id)
|
|
|
{
|
|
{
|
|
|
- cursor->_id = id;
|
|
|
|
|
|
|
+ imageList->_id = id;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Properties* space = properties->getNextNamespace();
|
|
|
|
|
+ while (space != NULL)
|
|
|
|
|
+ {
|
|
|
|
|
+ Image* image = Image::create(tw, th, space, color);
|
|
|
|
|
+ imageList->_images.push_back(image);
|
|
|
|
|
+ space = properties->getNextNamespace();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return cursor;
|
|
|
|
|
|
|
+ return imageList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Theme::Cursor::Cursor(const Texture& texture, const Rectangle& region, const Vector4& color)
|
|
|
|
|
- : _color(color)
|
|
|
|
|
|
|
+ const char* Theme::ImageList::getId() const
|
|
|
{
|
|
{
|
|
|
- _size.set(region.width, region.height);
|
|
|
|
|
- generateUVs(texture, region.x, region.y, region.width, region.height, &_uvs);
|
|
|
|
|
|
|
+ return _id.c_str();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Theme::Cursor::~Cursor()
|
|
|
|
|
|
|
+ Theme::Image* Theme::ImageList::getImage(const char* imageId) const
|
|
|
{
|
|
{
|
|
|
|
|
+ std::vector<Image*>::const_iterator it;
|
|
|
|
|
+ for (it = _images.begin(); it != _images.end(); it++)
|
|
|
|
|
+ {
|
|
|
|
|
+ Image* image = *it;
|
|
|
|
|
+ if (strcmp(image->getId(), imageId) == 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ return image;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return NULL;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const char* Theme::Cursor::getId() const
|
|
|
|
|
|
|
+ /***************
|
|
|
|
|
+ * Theme::Skin *
|
|
|
|
|
+ ***************/
|
|
|
|
|
+ Theme::Skin* Theme::Skin::create(const char* id, float tw, float th, const Rectangle& region, const Theme::Border& border, const Vector4& color)
|
|
|
{
|
|
{
|
|
|
- return _id.data();
|
|
|
|
|
|
|
+ Skin* skin = new Skin(tw, th, region, border, color);
|
|
|
|
|
+
|
|
|
|
|
+ if (id)
|
|
|
|
|
+ {
|
|
|
|
|
+ skin->_id = id;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return skin;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const Theme::UVs& Theme::Cursor::getUVs() const
|
|
|
|
|
|
|
+ Theme::Skin::Skin(float tw, float th, const Rectangle& region, const Theme::Border& border, const Vector4& color)
|
|
|
|
|
+ : _border(border), _color(color), _region(region)
|
|
|
{
|
|
{
|
|
|
- return _uvs;
|
|
|
|
|
|
|
+ setRegion(region, tw, th);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const Vector2& Theme::Cursor::getSize() const
|
|
|
|
|
|
|
+ Theme::Skin::~Skin()
|
|
|
{
|
|
{
|
|
|
- return _size;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const Vector4& Theme::Cursor::getColor() const
|
|
|
|
|
|
|
+ const char* Theme::Skin::getId() const
|
|
|
{
|
|
{
|
|
|
- return _color;
|
|
|
|
|
|
|
+ return _id.c_str();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**************************
|
|
|
|
|
- * Theme::ContainerRegion *
|
|
|
|
|
- **************************/
|
|
|
|
|
- Theme::ContainerRegion* Theme::ContainerRegion::create(const char* id, const Texture& texture, const Rectangle& region, const Theme::Border& border, const Vector4& color)
|
|
|
|
|
|
|
+ const Theme::Border& Theme::Skin::getBorder() const
|
|
|
{
|
|
{
|
|
|
- ContainerRegion* containerRegion = new ContainerRegion(texture, region, border, color);
|
|
|
|
|
-
|
|
|
|
|
- if (id)
|
|
|
|
|
- {
|
|
|
|
|
- containerRegion->_id = id;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- return containerRegion;
|
|
|
|
|
|
|
+ return _border;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Theme::ContainerRegion::ContainerRegion(const Texture& texture, const Rectangle& region, const Theme::Border& border, const Vector4& color)
|
|
|
|
|
- : _border(border), _color(color)
|
|
|
|
|
|
|
+ const Rectangle& Theme::Skin::getRegion() const
|
|
|
{
|
|
{
|
|
|
- // Need to convert pixel coords to unit space by dividing by texture size.
|
|
|
|
|
- float tw = 1.0f / (float)texture.getWidth();
|
|
|
|
|
- float th = 1.0f / (float)texture.getHeight();
|
|
|
|
|
|
|
+ return _region;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ void Theme::Skin::setRegion(const Rectangle& region, float tw, float th)
|
|
|
|
|
+ {
|
|
|
// Can calculate all measurements in advance.
|
|
// Can calculate all measurements in advance.
|
|
|
float leftEdge = region.x * tw;
|
|
float leftEdge = region.x * tw;
|
|
|
float rightEdge = (region.x + region.width) * tw;
|
|
float rightEdge = (region.x + region.width) * tw;
|
|
|
- float leftBorder = (region.x + border.left) * tw;
|
|
|
|
|
- float rightBorder = (region.x + region.width - border.right) * tw;
|
|
|
|
|
|
|
+ float leftBorder = (region.x + _border.left) * tw;
|
|
|
|
|
+ float rightBorder = (region.x + region.width - _border.right) * tw;
|
|
|
|
|
|
|
|
float topEdge = 1.0f - (region.y * th);
|
|
float topEdge = 1.0f - (region.y * th);
|
|
|
float bottomEdge = 1.0f - ((region.y + region.height) * th);
|
|
float bottomEdge = 1.0f - ((region.y + region.height) * th);
|
|
|
- float topBorder = 1.0f - ((region.y + border.top) * th);
|
|
|
|
|
- float bottomBorder = 1.0f - ((region.y + region.height - border.bottom) * th);
|
|
|
|
|
|
|
+ float topBorder = 1.0f - ((region.y + _border.top) * th);
|
|
|
|
|
+ float bottomBorder = 1.0f - ((region.y + region.height - _border.bottom) * th);
|
|
|
|
|
|
|
|
// There are 9 sets of UVs to set.
|
|
// There are 9 sets of UVs to set.
|
|
|
_uvs[TOP_LEFT].u1 = leftEdge;
|
|
_uvs[TOP_LEFT].u1 = leftEdge;
|
|
@@ -784,26 +702,12 @@ namespace gameplay
|
|
|
_uvs[BOTTOM_RIGHT].v2 = bottomEdge;
|
|
_uvs[BOTTOM_RIGHT].v2 = bottomEdge;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Theme::ContainerRegion::~ContainerRegion()
|
|
|
|
|
- {
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const char* Theme::ContainerRegion::getId() const
|
|
|
|
|
- {
|
|
|
|
|
- return _id.c_str();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const Theme::Border& Theme::ContainerRegion::getBorder() const
|
|
|
|
|
- {
|
|
|
|
|
- return _border;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const Theme::UVs& Theme::ContainerRegion::getUVs(ContainerArea area) const
|
|
|
|
|
|
|
+ const Theme::UVs& Theme::Skin::getUVs(SkinArea area) const
|
|
|
{
|
|
{
|
|
|
return _uvs[area];
|
|
return _uvs[area];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const Vector4& Theme::ContainerRegion::getColor() const
|
|
|
|
|
|
|
+ const Vector4& Theme::Skin::getColor() const
|
|
|
{
|
|
{
|
|
|
return _color;
|
|
return _color;
|
|
|
}
|
|
}
|
|
@@ -811,9 +715,10 @@ namespace gameplay
|
|
|
/****************
|
|
/****************
|
|
|
* Theme::Style *
|
|
* Theme::Style *
|
|
|
****************/
|
|
****************/
|
|
|
- Theme::Style::Style(const char* id, const Theme::Margin& margin, const Theme::Padding& padding,
|
|
|
|
|
|
|
+ Theme::Style::Style(const char* id, float tw, float th,
|
|
|
|
|
+ const Theme::Margin& margin, const Theme::Padding& padding,
|
|
|
Theme::Style::Overlay* normal, Theme::Style::Overlay* focus, Theme::Style::Overlay* active, Theme::Style::Overlay* disabled)
|
|
Theme::Style::Overlay* normal, Theme::Style::Overlay* focus, Theme::Style::Overlay* active, Theme::Style::Overlay* disabled)
|
|
|
- : _id(id), _margin(margin), _padding(padding)
|
|
|
|
|
|
|
+ : _id(id), _tw(tw), _th(th), _margin(margin), _padding(padding)
|
|
|
{
|
|
{
|
|
|
_overlays[OVERLAY_NORMAL] = normal;
|
|
_overlays[OVERLAY_NORMAL] = normal;
|
|
|
_overlays[OVERLAY_FOCUS] = focus;
|
|
_overlays[OVERLAY_FOCUS] = focus;
|
|
@@ -821,6 +726,20 @@ namespace gameplay
|
|
|
_overlays[OVERLAY_DISABLED] = disabled;
|
|
_overlays[OVERLAY_DISABLED] = disabled;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ Theme::Style::Style(const Style& copy)
|
|
|
|
|
+ {
|
|
|
|
|
+ _id = copy._id;
|
|
|
|
|
+ _margin = copy._margin;
|
|
|
|
|
+ _padding = copy._padding;
|
|
|
|
|
+ _tw = copy._tw;
|
|
|
|
|
+ _th = copy._th;
|
|
|
|
|
+
|
|
|
|
|
+ for (int i = 0; i < MAX_OVERLAYS; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ _overlays[i] = new Theme::Style::Overlay(*copy._overlays[i]);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
Theme::Style::~Style()
|
|
Theme::Style::~Style()
|
|
|
{
|
|
{
|
|
|
for (unsigned int i = 0; i < MAX_OVERLAYS; i++)
|
|
for (unsigned int i = 0; i < MAX_OVERLAYS; i++)
|
|
@@ -839,16 +758,32 @@ namespace gameplay
|
|
|
return _overlays[overlayType];
|
|
return _overlays[overlayType];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ void Theme::Style::setMargin(float top, float bottom, float left, float right)
|
|
|
|
|
+ {
|
|
|
|
|
+ _margin.top = top;
|
|
|
|
|
+ _margin.bottom = bottom;
|
|
|
|
|
+ _margin.left = left;
|
|
|
|
|
+ _margin.right = right;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const Theme::Margin& Theme::Style::getMargin() const
|
|
const Theme::Margin& Theme::Style::getMargin() const
|
|
|
{
|
|
{
|
|
|
return _margin;
|
|
return _margin;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ void Theme::Style::setPadding(float top, float bottom, float left, float right)
|
|
|
|
|
+ {
|
|
|
|
|
+ _padding.top = top;
|
|
|
|
|
+ _padding.bottom = bottom;
|
|
|
|
|
+ _padding.left = left;
|
|
|
|
|
+ _padding.right = right;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const Theme::Padding& Theme::Style::getPadding() const
|
|
const Theme::Padding& Theme::Style::getPadding() const
|
|
|
{
|
|
{
|
|
|
return _padding;
|
|
return _padding;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/*************************
|
|
/*************************
|
|
|
* Theme::Style::Overlay *
|
|
* Theme::Style::Overlay *
|
|
|
*************************/
|
|
*************************/
|
|
@@ -858,21 +793,123 @@ namespace gameplay
|
|
|
return overlay;
|
|
return overlay;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Theme::Style::Overlay::Overlay() : _container(NULL), _textCursor(NULL), _mouseCursor(NULL), _checkBoxIcon(NULL), _radioButtonIcon(NULL), _sliderIcon(NULL), _font(NULL)
|
|
|
|
|
|
|
+ Theme::Style::Overlay::Overlay() : _skin(NULL), _cursor(NULL), _imageList(NULL), _font(NULL)
|
|
|
{
|
|
{
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ Theme::Style::Overlay::Overlay(const Overlay& copy) : _skin(NULL), _cursor(NULL), _imageList(NULL), _font(NULL)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (copy._skin)
|
|
|
|
|
+ {
|
|
|
|
|
+ _skin = new Skin(*copy._skin);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (copy._cursor)
|
|
|
|
|
+ {
|
|
|
|
|
+ _cursor = new Image(*copy._cursor);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (copy._imageList)
|
|
|
|
|
+ {
|
|
|
|
|
+ _imageList = new ImageList(*copy._imageList);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ _font = copy._font;
|
|
|
|
|
+ _fontSize = copy._fontSize;
|
|
|
|
|
+ _alignment = copy._alignment;
|
|
|
|
|
+ _textRightToLeft = copy._textRightToLeft;
|
|
|
|
|
+ _textColor = Vector4(copy._textColor);
|
|
|
|
|
+ _opacity = copy._opacity;
|
|
|
|
|
+
|
|
|
|
|
+ if (_font)
|
|
|
|
|
+ {
|
|
|
|
|
+ _font->addRef();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
Theme::Style::Overlay::~Overlay()
|
|
Theme::Style::Overlay::~Overlay()
|
|
|
{
|
|
{
|
|
|
- SAFE_RELEASE(_container);
|
|
|
|
|
- SAFE_RELEASE(_checkBoxIcon);
|
|
|
|
|
- SAFE_RELEASE(_radioButtonIcon);
|
|
|
|
|
- SAFE_RELEASE(_sliderIcon);
|
|
|
|
|
- SAFE_RELEASE(_mouseCursor);
|
|
|
|
|
- SAFE_RELEASE(_textCursor);
|
|
|
|
|
|
|
+ SAFE_RELEASE(_skin);
|
|
|
|
|
+ SAFE_RELEASE(_imageList);
|
|
|
|
|
+ SAFE_RELEASE(_cursor);
|
|
|
SAFE_RELEASE(_font);
|
|
SAFE_RELEASE(_font);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ float Theme::Style::Overlay::getOpacity() const
|
|
|
|
|
+ {
|
|
|
|
|
+ return _opacity;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ void Theme::Style::Overlay::setOpacity(float opacity)
|
|
|
|
|
+ {
|
|
|
|
|
+ _opacity = opacity;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ void Theme::Style::Overlay::setBorder(float top, float bottom, float left, float right)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (_skin)
|
|
|
|
|
+ {
|
|
|
|
|
+ _skin->_border.top = top;
|
|
|
|
|
+ _skin->_border.bottom = bottom;
|
|
|
|
|
+ _skin->_border.left = left;
|
|
|
|
|
+ _skin->_border.right = right;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const Theme::Border& Theme::Style::Overlay::getBorder() const
|
|
|
|
|
+ {
|
|
|
|
|
+ if (_skin)
|
|
|
|
|
+ {
|
|
|
|
|
+ return _skin->getBorder();
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ return Theme::Border::empty();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ void Theme::Style::Overlay::setSkinColor(const Vector4& color)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (_skin)
|
|
|
|
|
+ {
|
|
|
|
|
+ _skin->_color.set(color);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const Vector4& Theme::Style::Overlay::getSkinColor() const
|
|
|
|
|
+ {
|
|
|
|
|
+ if (_skin)
|
|
|
|
|
+ {
|
|
|
|
|
+ return _skin->getColor();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return Vector4::one();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ void Theme::Style::Overlay::setSkinRegion(const Rectangle& region, float tw, float th)
|
|
|
|
|
+ {
|
|
|
|
|
+ assert(_skin);
|
|
|
|
|
+ _skin->setRegion(region, tw, th);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const Rectangle& Theme::Style::Overlay::getSkinRegion() const
|
|
|
|
|
+ {
|
|
|
|
|
+ if (_skin)
|
|
|
|
|
+ {
|
|
|
|
|
+ return _skin->getRegion();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return Rectangle::empty();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const Theme::UVs& Theme::Style::Overlay::getSkinUVs(Theme::Skin::SkinArea area) const
|
|
|
|
|
+ {
|
|
|
|
|
+ if (_skin)
|
|
|
|
|
+ {
|
|
|
|
|
+ return _skin->_uvs[area];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return UVs::empty();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
Font* Theme::Style::Overlay::getFont() const
|
|
Font* Theme::Style::Overlay::getFont() const
|
|
|
{
|
|
{
|
|
|
return _font;
|
|
return _font;
|
|
@@ -933,213 +970,260 @@ namespace gameplay
|
|
|
_textColor = color;
|
|
_textColor = color;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Theme::Cursor* Theme::Style::Overlay::getTextCursor() const
|
|
|
|
|
|
|
+ const Rectangle& Theme::Style::Overlay::getImageRegion(const char* id) const
|
|
|
{
|
|
{
|
|
|
- return _textCursor;
|
|
|
|
|
|
|
+ Image* image = _imageList->getImage(id);
|
|
|
|
|
+ if (image)
|
|
|
|
|
+ {
|
|
|
|
|
+ return image->getRegion();
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ return Rectangle::empty();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ void Theme::Style::Overlay::setImageRegion(const char* id, const Rectangle& region, float tw, float th)
|
|
|
|
|
+ {
|
|
|
|
|
+ Image* image = _imageList->getImage(id);
|
|
|
|
|
+ assert(image);
|
|
|
|
|
+ image->_region.set(region);
|
|
|
|
|
+ generateUVs(tw, th, region.x, region.y, region.width, region.height, &(image->_uvs));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- void Theme::Style::Overlay::setTextCursor(Theme::Cursor* cursor)
|
|
|
|
|
|
|
+ const Vector4& Theme::Style::Overlay::getImageColor(const char* id) const
|
|
|
{
|
|
{
|
|
|
- if (_textCursor != cursor)
|
|
|
|
|
|
|
+ Image* image = _imageList->getImage(id);
|
|
|
|
|
+ if (image)
|
|
|
{
|
|
{
|
|
|
- SAFE_RELEASE(_textCursor);
|
|
|
|
|
-
|
|
|
|
|
- _textCursor = cursor;
|
|
|
|
|
-
|
|
|
|
|
- if (cursor)
|
|
|
|
|
- {
|
|
|
|
|
- cursor->addRef();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ return image->getColor();
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ return Vector4::zero();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Theme::Cursor* Theme::Style::Overlay::getMouseCursor() const
|
|
|
|
|
|
|
+ void Theme::Style::Overlay::setImageColor(const char* id, const Vector4& color)
|
|
|
{
|
|
{
|
|
|
- return _mouseCursor;
|
|
|
|
|
|
|
+ Image* image = _imageList->getImage(id);
|
|
|
|
|
+ assert(image);
|
|
|
|
|
+ image->_color.set(color);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- void Theme::Style::Overlay::setMouseCursor(Theme::Cursor* cursor)
|
|
|
|
|
|
|
+ const Theme::UVs& Theme::Style::Overlay::getImageUVs(const char* id) const
|
|
|
{
|
|
{
|
|
|
- if (_mouseCursor != cursor)
|
|
|
|
|
|
|
+ Image* image = _imageList->getImage(id);
|
|
|
|
|
+ if (image)
|
|
|
{
|
|
{
|
|
|
- SAFE_RELEASE(_mouseCursor);
|
|
|
|
|
-
|
|
|
|
|
- _mouseCursor = cursor;
|
|
|
|
|
-
|
|
|
|
|
- if (cursor)
|
|
|
|
|
- {
|
|
|
|
|
- cursor->addRef();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ return image->getUVs();
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ return UVs::empty();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- void Theme::Style::Overlay::setCheckBoxIcon(Icon* icon)
|
|
|
|
|
|
|
+ const Rectangle& Theme::Style::Overlay::getCursorRegion() const
|
|
|
{
|
|
{
|
|
|
- if (_checkBoxIcon != icon)
|
|
|
|
|
|
|
+ if (_cursor)
|
|
|
{
|
|
{
|
|
|
- SAFE_RELEASE(_checkBoxIcon);
|
|
|
|
|
|
|
+ return _cursor->getRegion();
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ return Rectangle::empty();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ void Theme::Style::Overlay::setCursorRegion(const Rectangle& region, float tw, float th)
|
|
|
|
|
+ {
|
|
|
|
|
+ assert(_cursor);
|
|
|
|
|
+ _cursor->_region.set(region);
|
|
|
|
|
+ generateUVs(tw, th, region.x, region.y, region.width, region.height, &(_cursor->_uvs));
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- _checkBoxIcon = icon;
|
|
|
|
|
-
|
|
|
|
|
- if (icon)
|
|
|
|
|
- {
|
|
|
|
|
- icon->addRef();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const Vector4& Theme::Style::Overlay::getCursorColor() const
|
|
|
|
|
+ {
|
|
|
|
|
+ if (_cursor)
|
|
|
|
|
+ {
|
|
|
|
|
+ return _cursor->getColor();
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ return Vector4::zero();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Theme::Icon* Theme::Style::Overlay::getCheckBoxIcon() const
|
|
|
|
|
|
|
+ void Theme::Style::Overlay::setCursorColor(const Vector4& color)
|
|
|
{
|
|
{
|
|
|
- return _checkBoxIcon;
|
|
|
|
|
|
|
+ assert(_cursor);
|
|
|
|
|
+ _cursor->_color.set(color);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- void Theme::Style::Overlay::setRadioButtonIcon(Icon* icon)
|
|
|
|
|
|
|
+ const Theme::UVs Theme::Style::Overlay::getCursorUVs() const
|
|
|
{
|
|
{
|
|
|
- if (_radioButtonIcon != icon)
|
|
|
|
|
|
|
+ if (_cursor)
|
|
|
|
|
+ {
|
|
|
|
|
+ return _cursor->getUVs();
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
{
|
|
{
|
|
|
- SAFE_RELEASE(_radioButtonIcon);
|
|
|
|
|
|
|
+ return UVs::empty();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- _radioButtonIcon = icon;
|
|
|
|
|
|
|
+ void Theme::Style::Overlay::setSkin(Skin* skin)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (_skin != skin)
|
|
|
|
|
+ {
|
|
|
|
|
+ SAFE_RELEASE(_skin);
|
|
|
|
|
+ _skin = skin;
|
|
|
|
|
|
|
|
- if (icon)
|
|
|
|
|
|
|
+ if (skin)
|
|
|
{
|
|
{
|
|
|
- icon->addRef();
|
|
|
|
|
|
|
+ skin->addRef();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Theme::Icon* Theme::Style::Overlay::getRadioButtonIcon() const
|
|
|
|
|
|
|
+ Theme::Skin* Theme::Style::Overlay::getSkin() const
|
|
|
{
|
|
{
|
|
|
- return _radioButtonIcon;
|
|
|
|
|
|
|
+ return _skin;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- void Theme::Style::Overlay::setSliderIcon(SliderIcon* slider)
|
|
|
|
|
|
|
+ void Theme::Style::Overlay::setCursor(Image* cursor)
|
|
|
{
|
|
{
|
|
|
- if (_sliderIcon != slider)
|
|
|
|
|
|
|
+ if (_cursor != cursor)
|
|
|
{
|
|
{
|
|
|
- SAFE_RELEASE(_sliderIcon);
|
|
|
|
|
|
|
+ SAFE_RELEASE(_cursor);
|
|
|
|
|
+ _cursor = cursor;
|
|
|
|
|
|
|
|
- _sliderIcon = slider;
|
|
|
|
|
-
|
|
|
|
|
- if (slider)
|
|
|
|
|
|
|
+ if (cursor)
|
|
|
{
|
|
{
|
|
|
- slider->addRef();
|
|
|
|
|
|
|
+ cursor->addRef();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Theme::SliderIcon* Theme::Style::Overlay::getSliderIcon() const
|
|
|
|
|
|
|
+ Theme::Image* Theme::Style::Overlay::getCursor() const
|
|
|
{
|
|
{
|
|
|
- return _sliderIcon;
|
|
|
|
|
|
|
+ return _cursor;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- void Theme::Style::Overlay::setContainerRegion(ContainerRegion* container)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ void Theme::Style::Overlay::setImageList(ImageList* imageList)
|
|
|
{
|
|
{
|
|
|
- if (_container != container)
|
|
|
|
|
|
|
+ if (_imageList != imageList)
|
|
|
{
|
|
{
|
|
|
- SAFE_RELEASE(_container);
|
|
|
|
|
|
|
+ SAFE_RELEASE(_imageList);
|
|
|
|
|
+ _imageList = imageList;
|
|
|
|
|
|
|
|
- _container = container;
|
|
|
|
|
-
|
|
|
|
|
- if (container)
|
|
|
|
|
|
|
+ if (imageList)
|
|
|
{
|
|
{
|
|
|
- container->addRef();
|
|
|
|
|
|
|
+ imageList->addRef();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- Theme::ContainerRegion* Theme::Style::Overlay::getContainerRegion() const
|
|
|
|
|
|
|
+
|
|
|
|
|
+ Theme::ImageList* Theme::Style::Overlay::getImageList() const
|
|
|
{
|
|
{
|
|
|
- return _container;
|
|
|
|
|
|
|
+ return _imageList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- void Theme::generateUVs(const Texture& texture, float x, float y, float width, float height, UVs* uvs)
|
|
|
|
|
|
|
+ // Implementation of AnimationHandler
|
|
|
|
|
+ unsigned int Theme::Style::Overlay::getAnimationPropertyComponentCount(int propertyId) const
|
|
|
{
|
|
{
|
|
|
- float tw = 1.0f / texture.getWidth();
|
|
|
|
|
- float th = 1.0f / texture.getHeight();
|
|
|
|
|
-
|
|
|
|
|
- uvs->u1 = x * tw;
|
|
|
|
|
- uvs->u2 = (x + width) * tw;
|
|
|
|
|
- uvs->v1 = 1.0f - (y * th);
|
|
|
|
|
- uvs->v2 = 1.0f - ((y + height) * th);
|
|
|
|
|
|
|
+ switch(propertyId)
|
|
|
|
|
+ {
|
|
|
|
|
+ case Theme::Style::Overlay::ANIMATE_OPACITY:
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ default:
|
|
|
|
|
+ return -1;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- void Theme::lookUpSprites(const Properties* overlaySpace, Icon** checkBoxIcon, Icon** radioButtonIcon, SliderIcon** sliderIcon,
|
|
|
|
|
- Cursor** textCursor, Cursor** mouseCursor, ContainerRegion** containerRegion)
|
|
|
|
|
|
|
+ void Theme::Style::Overlay::getAnimationPropertyValue(int propertyId, AnimationValue* value)
|
|
|
{
|
|
{
|
|
|
- const char* checkBoxString = overlaySpace->getString("checkBox");
|
|
|
|
|
- if (checkBoxString)
|
|
|
|
|
|
|
+ switch(propertyId)
|
|
|
{
|
|
{
|
|
|
- for (unsigned int i = 0; i < _icons.size(); i++)
|
|
|
|
|
- {
|
|
|
|
|
- if (strcmp(_icons[i]->getId(), checkBoxString) == 0)
|
|
|
|
|
- {
|
|
|
|
|
- *checkBoxIcon = _icons[i];
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ case ANIMATE_OPACITY:
|
|
|
|
|
+ value->setFloat(0, _opacity);
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- const char* radioButtonString = overlaySpace->getString("radioButton");
|
|
|
|
|
- if (radioButtonString)
|
|
|
|
|
|
|
+ void Theme::Style::Overlay::setAnimationPropertyValue(int propertyId, AnimationValue* value, float blendWeight)
|
|
|
|
|
+ {
|
|
|
|
|
+ switch(propertyId)
|
|
|
{
|
|
{
|
|
|
- for (unsigned int i = 0; i < _icons.size(); i++)
|
|
|
|
|
|
|
+ case ANIMATE_OPACITY:
|
|
|
{
|
|
{
|
|
|
- if (strcmp(_icons[i]->getId(), radioButtonString) == 0)
|
|
|
|
|
|
|
+ float opacity = value->getFloat(0);
|
|
|
|
|
+ if ((_animationPropertyBitFlag & ANIMATION_OPACITY_BIT) != ANIMATION_OPACITY_BIT)
|
|
|
{
|
|
{
|
|
|
- *radioButtonIcon = _icons[i];
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ _animationPropertyBitFlag |= ANIMATION_OPACITY_BIT;
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const char* sliderString = overlaySpace->getString("slider");
|
|
|
|
|
- if (sliderString)
|
|
|
|
|
- {
|
|
|
|
|
- for (unsigned int i = 0; i < _sliders.size(); ++i)
|
|
|
|
|
- {
|
|
|
|
|
- if (strcmp(_sliders[i]->getId(), sliderString) == 0)
|
|
|
|
|
|
|
+ else
|
|
|
{
|
|
{
|
|
|
- *sliderIcon = _sliders[i];
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ opacity = Curve::lerp(blendWeight, _opacity, opacity);
|
|
|
}
|
|
}
|
|
|
|
|
+ _opacity = opacity;
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
|
|
+ default:
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Theme utility methods.
|
|
|
|
|
+ */
|
|
|
|
|
+ void Theme::generateUVs(float tw, float th, float x, float y, float width, float height, UVs* uvs)
|
|
|
|
|
+ {
|
|
|
|
|
+ uvs->u1 = x * tw;
|
|
|
|
|
+ uvs->u2 = (x + width) * tw;
|
|
|
|
|
+ uvs->v1 = 1.0f - (y * th);
|
|
|
|
|
+ uvs->v2 = 1.0f - ((y + height) * th);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- const char* textCursorString = overlaySpace->getString("textCursor");
|
|
|
|
|
- if (textCursorString)
|
|
|
|
|
|
|
+ void Theme::lookUpSprites(const Properties* overlaySpace, ImageList** imageList, Image** cursor, Skin** Skin)
|
|
|
|
|
+ {
|
|
|
|
|
+ const char* imageListString = overlaySpace->getString("imageList");
|
|
|
|
|
+ if (imageListString)
|
|
|
{
|
|
{
|
|
|
- for (unsigned int i = 0; i < _cursors.size(); ++i)
|
|
|
|
|
|
|
+ for (unsigned int i = 0; i < _imageLists.size(); ++i)
|
|
|
{
|
|
{
|
|
|
- if (strcmp(_cursors[i]->getId(), textCursorString) == 0)
|
|
|
|
|
|
|
+ if (strcmp(_imageLists[i]->getId(), imageListString) == 0)
|
|
|
{
|
|
{
|
|
|
- *textCursor = _cursors[i];
|
|
|
|
|
|
|
+ *imageList = _imageLists[i];
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const char* mouseCursorString = overlaySpace->getString("mouseCursor");
|
|
|
|
|
- if (mouseCursorString)
|
|
|
|
|
|
|
+ const char* cursorString = overlaySpace->getString("cursor");
|
|
|
|
|
+ if (cursorString)
|
|
|
{
|
|
{
|
|
|
- for (unsigned int i = 0; i < _cursors.size(); ++i)
|
|
|
|
|
|
|
+ for (unsigned int i = 0; i < _images.size(); ++i)
|
|
|
{
|
|
{
|
|
|
- if (strcmp(_cursors[i]->getId(), mouseCursorString) == 0)
|
|
|
|
|
|
|
+ if (strcmp(_images[i]->getId(), cursorString) == 0)
|
|
|
{
|
|
{
|
|
|
- *mouseCursor = _cursors[i];
|
|
|
|
|
|
|
+ *cursor = _images[i];
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const char* containerString = overlaySpace->getString("container");
|
|
|
|
|
- if (containerString)
|
|
|
|
|
|
|
+ const char* skinString = overlaySpace->getString("skin");
|
|
|
|
|
+ if (skinString)
|
|
|
{
|
|
{
|
|
|
- for (unsigned int i = 0; i < _containers.size(); ++i)
|
|
|
|
|
|
|
+ for (unsigned int i = 0; i < _skins.size(); ++i)
|
|
|
{
|
|
{
|
|
|
- if (strcmp(_containers[i]->getId(), containerString) == 0)
|
|
|
|
|
|
|
+ if (strcmp(_skins[i]->getId(), skinString) == 0)
|
|
|
{
|
|
{
|
|
|
- *containerRegion = _containers[i];
|
|
|
|
|
|
|
+ *Skin = _skins[i];
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|