Maybe a not good modif ...

This commit is contained in:
Edouard Dupin 2012-04-26 18:18:06 +02:00
parent 7b94a21fca
commit d489e1df83
3 changed files with 20 additions and 18 deletions

View File

@ -31,7 +31,7 @@
* @param ---
* @return ---
*/
ewol::GameElement::GameElement(SceneElement & sceneElement) : m_sceneElement(sceneElement)
ewol::GameElement::GameElement(SceneElement & sceneElement, etk::UString& tmpName) : m_sceneElement(sceneElement), m_fileNameConfig(tmpName)
{
m_group = -1;
m_type = -1;

View File

@ -35,24 +35,25 @@ namespace ewol {
class GameElement
{
private:
etk::UString m_fileNameConfig;
protected:
SceneElement & m_sceneElement; //!< all element neede in the scene
protected:
int32_t m_group;
int32_t m_type;
bool m_visible;
coord2D_ts m_position;
coord2D_ts m_speed;
etkFloat_t m_size;
etkFloat_t m_angle;
etkFloat_t m_gravity;
int32_t m_group;
int32_t m_type;
bool m_visible;
coord2D_ts m_position;
coord2D_ts m_speed;
etkFloat_t m_size;
etkFloat_t m_angle;
etkFloat_t m_gravity;
public:
/**
* @brief Constructor : here are requested all the needed sprite and effect that can be used in the game
* @param ---
* @return ---
*/
GameElement(SceneElement & sceneElement);
GameElement(SceneElement & sceneElement, etk::UString& tmpName);
/**
* @brief Destructor : This does not remove the sprite requested, they will be supressed when the scene is removed ...
* @param ---
@ -60,6 +61,7 @@ namespace ewol {
*/
virtual ~GameElement(void) { };
bool HasName(etk::UString tmpName) { return (tmpName == m_fileNameConfig); };
bool IsVisible(void) { return m_visible; };
void SetVisible(bool state) { m_visible = state; };
coord2D_ts PositionGet(void) { return m_position; };

View File

@ -299,38 +299,38 @@ void svg::Base::ParsePaintAttr(const TiXmlNode *node)
for( const char *sss=extractPartOfStyle(content, outputType, outputValue, 1024);
NULL != sss;
sss=extractPartOfStyle(sss, outputType, outputValue, 1024) ) {
SVG_INFO(" style parse : \"" << outputType << "\" with value : \"" << outputValue << "\"");
SVG_VERBOSE(" style parse : \"" << outputType << "\" with value : \"" << outputValue << "\"");
if (0 == strcmp(outputType, "fill") ) {
m_paint.fill = ParseColor(outputValue);
SVG_ERROR(" input : \"" << outputValue << "\" ==> " << m_paint.fill);
SVG_VERBOSE(" input : \"" << outputValue << "\" ==> " << m_paint.fill);
if (m_paint.fill.alpha == 0) {
fillNone = true;
}
} else if (0 == strcmp(outputType, "stroke") ) {
m_paint.stroke = ParseColor(outputValue);
SVG_ERROR(" input : \"" << outputValue << "\" ==> " << m_paint.stroke);
SVG_VERBOSE(" input : \"" << outputValue << "\" ==> " << m_paint.stroke);
if (m_paint.stroke.alpha == 0) {
strokeNone = true;
}
} else if (0 == strcmp(outputType, "stroke-width") ) {
m_paint.strokeWidth = ParseLength(outputValue);
SVG_ERROR(" input : \"" << outputValue << "\" ==> " << m_paint.strokeWidth);
SVG_VERBOSE(" input : \"" << outputValue << "\" ==> " << m_paint.strokeWidth);
} else if (0 == strcmp(outputType, "opacity") ) {
etkFloat_t opacity = ParseLength(outputValue);
opacity = etk_max(0.0, etk_min(1.0, opacity));
m_paint.fill.alpha = opacity*0xFF;
m_paint.stroke.alpha = opacity*0xFF;
SVG_ERROR(" input : \"" << outputValue << "\" ==> " << m_paint.fill);
SVG_VERBOSE(" input : \"" << outputValue << "\" ==> " << m_paint.fill);
} else if (0 == strcmp(outputType, "fill-opacity") ) {
etkFloat_t opacity = ParseLength(outputValue);
opacity = etk_max(0.0, etk_min(1.0, opacity));
m_paint.fill.alpha = opacity*0xFF;
SVG_ERROR(" input : \"" << outputValue << "\" ==> " << m_paint.fill);
SVG_VERBOSE(" input : \"" << outputValue << "\" ==> " << m_paint.fill);
} else if (0 == strcmp(outputType, "stroke-opacity") ) {
etkFloat_t opacity = ParseLength(outputValue);
opacity = etk_max(0.0, etk_min(1.0, opacity));
m_paint.stroke.alpha = opacity*0xFF;
SVG_ERROR(" input : \"" << outputValue << "\" ==> " << m_paint.stroke);
SVG_VERBOSE(" input : \"" << outputValue << "\" ==> " << m_paint.stroke);
} else if (0 == strcmp(outputType, "fill-rule") ) {
if (0 == strcmp(outputValue, "nonzero") ) {
m_paint.flagEvenOdd = false;