Skip to content
Permalink
Browse files

Deprecates TLN_SetAnimationDelay() to no_op, as each frame has its ow…

…n delay and the function did nothing. Kept for backwards compatibility
  • Loading branch information
megamarc committed Feb 13, 2020
1 parent 9351f91 commit d095656529f1a7fc33575c377a4bc60906c4927d
Showing with 5 additions and 36 deletions.
  1. +1 −31 src/Animation.c
  2. +0 −1 src/Animation.h
  3. +3 −3 src/simplexml.c
  4. +1 −1 src/simplexml.h
@@ -374,40 +374,10 @@ bool TLN_SetSpriteAnimation (int index, int nsprite, TLN_Sequence sequence, int

/*!
* \brief
* Sets the playback speed of a given animation
*
* \param index
* Id of the animation to set (0 <= id < num_animations)
*
* \param delay
* New delay between frames to assign
*
* Each sequence has its own delay set in the sqx file. However sometimes it's convenient
* to speed up or down the playback speed in realtime, for example for a character that is
* accelerating.
*
* \remarks
* The meaning of the delay value (i.e. its units) is application dependant. It can usually be frames
* or milliseconds. Make sure that its units match the ones insode the sqx file and the ones
* passed to the TLN_UpdateFrame()
*
* \see
* Animations, TLN_UpdateFrame()
* Deprecated, each frame has its own delay
*/
bool TLN_SetAnimationDelay (int index, int delay)
{
Animation* animation;

if (index >= engine->numanimations)
{
TLN_SetLastError (TLN_ERR_IDX_ANIMATION);
return false;
}

animation = &engine->animations[index];
animation->delay = delay;

TLN_SetLastError (TLN_ERR_OK);
return true;
}

@@ -35,7 +35,6 @@ typedef struct
int loop;
int pos;
int timer;
int delay;
int idx; /* indice de capa, sprite */
bool blend;
TLN_Palette palette;
@@ -155,7 +155,7 @@ typedef struct simplexml_parser_state {
SimpleXmlParserState createSimpleXmlParser (const char *sData, long nDataSize);
void destroySimpleXmlParser (SimpleXmlParserState parser);
int initializeSimpleXmlParser (SimpleXmlParserState parser, const char *sData, long nDataSize);
char* getSimpleXmlParseErrorDescription (SimpleXmlParserState parser);
const char* getSimpleXmlParseErrorDescription (SimpleXmlParserState parser);
int parseSimpleXml (SimpleXmlParserState parser, SimpleXmlTagHandler handler);
int parseOneTag (SimpleXmlParserState parser, SimpleXmlTagHandler parentHandler);
int readNextTagToken (SimpleXmlParserState parser);
@@ -202,7 +202,7 @@ int simpleXmlParse (SimpleXmlParser parser, SimpleXmlTagHandler handler) {
return 0;
}

char* simpleXmlGetErrorDescription (SimpleXmlParser parser) {
const char* simpleXmlGetErrorDescription (SimpleXmlParser parser) {
return getSimpleXmlParseErrorDescription((SimpleXmlParserState) parser);
}

@@ -384,7 +384,7 @@ int initializeSimpleXmlParser (SimpleXmlParserState parser, const char *sData, l
* @return an error description or NULL if there was
* no error during parsing.
*/
char* getSimpleXmlParseErrorDescription (SimpleXmlParserState parser) {
const char* getSimpleXmlParseErrorDescription (SimpleXmlParserState parser) {
if (parser == NULL) {
return NULL;
}
@@ -136,7 +136,7 @@ int simpleXmlParse (SimpleXmlParser parser, SimpleXmlTagHandler handler);
* @param parser the parser for which to get the error description.
* @return an error description or NULL if there was no error during parsing.
*/
char* simpleXmlGetErrorDescription (SimpleXmlParser parser);
const char* simpleXmlGetErrorDescription (SimpleXmlParser parser);

/**
* Returns the line number of the current input line that the parser has read.

0 comments on commit d095656

Please sign in to comment.
You can’t perform that action at this time.