Make -2 the magic infinite loops value
This commit is contained in:
@@ -178,7 +178,7 @@ Picture number
|
|||||||
Picture type
|
Picture type
|
||||||
Unused
|
Unused
|
||||||
Unused
|
Unused
|
||||||
Animation Loops (-1 for infinite)
|
Animation Loops (-2 for infinite)
|
||||||
Unused
|
Unused
|
||||||
Unused
|
Unused
|
||||||
Animation FPS (-1 for default 2)
|
Animation FPS (-1 for default 2)
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ Picture number
|
|||||||
Picture type
|
Picture type
|
||||||
Label of 2nd button (-1 - no button)
|
Label of 2nd button (-1 - no button)
|
||||||
Special if button 2 pressed
|
Special if button 2 pressed
|
||||||
Animation Loops (-1 for infinite)
|
Animation Loops (-2 for infinite)
|
||||||
Label of 3rd button (-1 - no button)
|
Label of 3rd button (-1 - no button)
|
||||||
Special if button 3 pressed
|
Special if button 3 pressed
|
||||||
Animation FPS (-1 for default 2)
|
Animation FPS (-1 for default 2)
|
||||||
@@ -144,7 +144,7 @@ Picture number
|
|||||||
Picture type
|
Picture type
|
||||||
Item to give
|
Item to give
|
||||||
Amount of gold to give
|
Amount of gold to give
|
||||||
Animation Loops (-1 for infinite)
|
Animation Loops (-2 for infinite)
|
||||||
Amount of food to give
|
Amount of food to give
|
||||||
Special if item IS taken
|
Special if item IS taken
|
||||||
Animation FPS (-1 for default 2)
|
Animation FPS (-1 for default 2)
|
||||||
@@ -229,7 +229,7 @@ Picture number
|
|||||||
Picture type
|
Picture type
|
||||||
Type of trap
|
Type of trap
|
||||||
Trap severity (0 .. 3)
|
Trap severity (0 .. 3)
|
||||||
Animation Loops (-1 for infinite)
|
Animation Loops (-2 for infinite)
|
||||||
Penalty (0 .. 100, higher is harder)
|
Penalty (0 .. 100, higher is harder)
|
||||||
(Custom only) Special node for effect
|
(Custom only) Special node for effect
|
||||||
Animation FPS (-1 for default 2)
|
Animation FPS (-1 for default 2)
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ Picture number
|
|||||||
Picture type
|
Picture type
|
||||||
Unused
|
Unused
|
||||||
If Pulled, call this special ...
|
If Pulled, call this special ...
|
||||||
Animation Loops (-1 for infinite)
|
Animation Loops (-2 for infinite)
|
||||||
Unused
|
Unused
|
||||||
Unused
|
Unused
|
||||||
Animation FPS (-1 for default 2)
|
Animation FPS (-1 for default 2)
|
||||||
@@ -331,7 +331,7 @@ Picture number
|
|||||||
Picture type
|
Picture type
|
||||||
X coordinate to telep. to
|
X coordinate to telep. to
|
||||||
Y coordinate to telep. to
|
Y coordinate to telep. to
|
||||||
Animation Loops (-1 for infinite)
|
Animation Loops (-2 for infinite)
|
||||||
Unused
|
Unused
|
||||||
Unused
|
Unused
|
||||||
Animation FPS (-1 for default 2)
|
Animation FPS (-1 for default 2)
|
||||||
|
|||||||
@@ -935,6 +935,12 @@ void cPict::drawPresetField(short num, rectangle to_rect){
|
|||||||
rect_draw_some_item(*from_gw, from_rect, getWindow(), to_rect, sf::BlendAlpha);
|
rect_draw_some_item(*from_gw, from_rect, getWindow(), to_rect, sf::BlendAlpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cPict::setAnimLoops(short value) {
|
||||||
|
// -2 is infinite loops. Anything else <= 0 is no animation.
|
||||||
|
if(value >= 0 || value == -2) animLoops = value;
|
||||||
|
else animLoops = 0;
|
||||||
|
}
|
||||||
|
|
||||||
void cPict::updateAnim(short loop_frames) {
|
void cPict::updateAnim(short loop_frames) {
|
||||||
if(prevAnimFrame != animFrame){
|
if(prevAnimFrame != animFrame){
|
||||||
if(animFrame % loop_frames == 0 && animLoops > 0)
|
if(animFrame % loop_frames == 0 && animLoops > 0)
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ public:
|
|||||||
cPict& operator=(cPict& other) = delete;
|
cPict& operator=(cPict& other) = delete;
|
||||||
cPict(cPict& other) = delete;
|
cPict(cPict& other) = delete;
|
||||||
inline static void resetAnim() { animFrame = 0; }
|
inline static void resetAnim() { animFrame = 0; }
|
||||||
inline void setAnimLoops(short value) { animLoops = value; }
|
void setAnimLoops(short value);
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<const sf::Texture> getSheetInternal(eSheetType type, size_t n);
|
static std::shared_ptr<const sf::Texture> getSheetInternal(eSheetType type, size_t n);
|
||||||
std::shared_ptr<const sf::Texture> getSheet(eSheetType type, size_t n = 0);
|
std::shared_ptr<const sf::Texture> getSheet(eSheetType type, size_t n = 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user