Esempio n. 1
0
	OverlayColors* ActionVisual::getColorOverlay(int32_t angle) {
		if (m_colorOverlayMap.empty()) {
			return 0;
		}
		int32_t closestMatch = 0;
		int32_t index = getIndexByAngle(angle, m_map, closestMatch);
		if (m_colorOverlayMap.find(index) == m_colorOverlayMap.end()) {
			return 0;
		}
		return &m_colorOverlayMap[getIndexByAngle(angle, m_map, closestMatch)];
	}
Esempio n. 2
0
	int32_t Object::getRestrictedRotation(int32_t rotation) {
		int32_t closest = rotation;
		if (m_multiProperty) {
			if (!m_multiProperty->m_multiAngleMap.empty()) {
				getIndexByAngle(rotation, m_multiProperty->m_multiAngleMap, closest);
			} else if (!m_multiProperty->m_partAngleMap.empty()) {
				getIndexByAngle(rotation, m_multiProperty->m_partAngleMap, closest);
			}
		} else if (m_inherited) {
			return m_inherited->getRestrictedRotation(rotation);
		}
		return closest;
	}
Esempio n. 3
0
	std::vector<ModelCoordinate> Object::getMultiObjectCoordinates(int32_t rotation) const {
		std::vector<ModelCoordinate> coordinates;
		if (m_multiProperty) {
			if (m_multiProperty->m_multiObjectCoordinates.empty()) {
				std::set<Object*>::iterator subit = m_multiProperty->m_multiParts.begin();
				for (; subit != m_multiProperty->m_multiParts.end(); ++subit) {
					const std::multimap<int32_t, ModelCoordinate>& subcoords = (*subit)->getMultiPartCoordinates();
					m_multiProperty->m_multiObjectCoordinates.insert(subcoords.begin(), subcoords.end());
				}
				std::multimap<int32_t, ModelCoordinate>::iterator it = m_multiProperty->m_multiObjectCoordinates.begin();
				for (; it != m_multiProperty->m_multiObjectCoordinates.end(); ++it) {
					m_multiProperty->m_multiAngleMap[(*it).first] = (*it).first;
				}
			}
			int32_t closest = 0;
			getIndexByAngle(rotation, m_multiProperty->m_multiAngleMap, closest);
			std::pair<std::multimap<int32_t, ModelCoordinate>::iterator,
				std::multimap<int32_t, ModelCoordinate>::iterator> result = m_multiProperty->m_multiObjectCoordinates.equal_range(closest);
			std::multimap<int32_t, ModelCoordinate>::iterator it = result.first;
			ModelCoordinate parent(0,0);
			coordinates.push_back(parent);
			for (; it != result.second; ++it) {
				coordinates.push_back((*it).second);
			}
		} else if (m_inherited) {
			return m_inherited->getMultiObjectCoordinates(rotation);
		}
		return coordinates;
	}
Esempio n. 4
0
	OverlayColors* ObjectVisual::getStaticColorOverlay(int32_t angle) {
		if (m_colorOverlayMap.empty()) {
			return 0;
		}
		int32_t closestMatch = 0;
		return &m_colorOverlayMap[getIndexByAngle(angle, m_map, closestMatch)];
	}
Esempio n. 5
0
	void ActionVisual::removeColorOverlay(int32_t angle) {
		if (m_colorOverlayMap.empty()) {
			return;
		}
		int32_t closestMatch = 0;
		int32_t index = getIndexByAngle(angle, m_map, closestMatch);
		m_colorOverlayMap.erase(index);
		//m_map.erase(index);
	}
Esempio n. 6
0
	void ActionVisual::removeColorOverlay(int32_t angle, int32_t order) {
		if (m_colorAnimationOverlayMap.empty()) {
			return;
		}

		int32_t closestMatch = 0;
		AngleColorAnimationOverlayMap::iterator it = m_colorAnimationOverlayMap.find(getIndexByAngle(angle, m_map, closestMatch));
		if (it != m_colorAnimationOverlayMap.end()) {
			it->second.erase(order);
		}
	}
Esempio n. 7
0
	OverlayColors* ActionVisual::getColorOverlay(int32_t angle, int32_t order) {
		if (m_colorAnimationOverlayMap.empty()) {
			return 0;
		}

		int32_t closestMatch = 0;
		AngleColorAnimationOverlayMap::iterator it = m_colorAnimationOverlayMap.find(getIndexByAngle(angle, m_map, closestMatch));
		if (it != m_colorAnimationOverlayMap.end()) {
			std::map<int32_t, OverlayColors>::iterator sit = it->second.find(order);
			if (sit != it->second.end()) {
				return &it->second[order];
			}
		}
		return 0;
	}
Esempio n. 8
0
	std::vector<ModelCoordinate> Object::getMultiPartCoordinates(int32_t rotation) const {
		std::vector<ModelCoordinate> coordinates;
		
		if (m_multiProperty) {
			int32_t closest = 0;
			getIndexByAngle(rotation, m_multiProperty->m_partAngleMap, closest);
			std::pair<std::multimap<int32_t, ModelCoordinate>::iterator,
				std::multimap<int32_t, ModelCoordinate>::iterator> result = m_multiProperty->m_multiPartCoordinates.equal_range(closest);
			std::multimap<int32_t, ModelCoordinate>::iterator it = result.first;
			for (; it != result.second; ++it) {
				coordinates.push_back((*it).second);
			}
		} else if (m_inherited) {
			return m_inherited->getMultiPartCoordinates(rotation);
		}
		return coordinates;
	}
Esempio n. 9
0
	int32_t ObjectVisual::getClosestMatchingAngle(int32_t angle) {
		int32_t closestMatch = 0;
		getIndexByAngle(angle, m_angle2img, closestMatch);
		return closestMatch;
	}
Esempio n. 10
0
	int32_t ObjectVisual::getStaticImageIndexByAngle(int32_t angle) {
		int32_t closestMatch = 0;
		return getIndexByAngle(angle, m_angle2img, closestMatch);
	}
Esempio n. 11
0
	AnimationPtr ActionVisual::getAnimationByAngle(int32_t angle) {
		int32_t closestMatch = 0;
		return m_animation_map[getIndexByAngle(angle, m_map, closestMatch)];
	}
Esempio n. 12
0
	void ActionVisual::removeAnimationOverlay(uint32_t angle, int32_t order) {
		int32_t closestMatch = 0;
		std::map<int32_t, AnimationPtr>& orderMap = m_animationOverlayMap[getIndexByAngle(angle, m_map, closestMatch)];
		std::map<int32_t, AnimationPtr>::iterator it = orderMap.begin();
		orderMap.erase(order);
	}
Esempio n. 13
0
	std::map<int32_t, AnimationPtr> ActionVisual::getAnimationOverlay(int32_t angle) {
		int32_t closestMatch = 0;
		return m_animationOverlayMap[getIndexByAngle(angle, m_map, closestMatch)];
	}
Esempio n. 14
0
	int ActionVisual::getAnimationIndexByAngle(int angle) {
		int closestMatch = 0;
		return getIndexByAngle(angle, m_animations, closestMatch);
	}