26 int defsy,
const unsigned int flags )
32 xmlr_attr_int_def( node,
"sx", sx, defsx );
33 xmlr_attr_int_def( node,
"sy", sy, defsy );
36 buf = xml_get( node );
41 if (( buf[0] ==
'/' ) || ( path == NULL ))
42 snprintf( filename,
sizeof( filename ),
"%s", buf );
44 snprintf( filename,
sizeof( filename ), path, buf );
47 if (( sx == 1 ) && ( sy == 1 ))
61 xmlTextWriterSetIndentString( writer, (
const xmlChar *)
" " );
62 xmlTextWriterSetIndent( writer, 1 );
80 WARN( _(
"Unable to read data from '%s'" ), filename );
88 doc = xmlParseMemory( buf, bufsize );
90 WARN( _(
"Unable to parse document '%s'" ), filename );
95int xmlw_saveTime( xmlTextWriterPtr writer,
const char *name, time_t t )
97 xmlw_elem( writer, name,
"%lld", (
long long)t );
101int xmlw_saveNTime( xmlTextWriterPtr writer,
const char *name, ntime_t t )
103 xmlw_elem( writer, name,
"%" PRIu64, t );
107int xml_parseTime( xmlNodePtr node, time_t *t )
109 *t = xml_getULong( node );
112int xml_parseNTime( xmlNodePtr node, ntime_t *t )
114 *t = xml_getULong( node );
void * ndata_read(const char *path, size_t *filesize)
Reads a file from the ndata (will be NUL terminated).
glTexture * xml_parseTexture(xmlNodePtr node, const char *path, int defsx, int defsy, const unsigned int flags)
Parses a texture handling the sx and sy elements.
void xmlw_setParams(xmlTextWriterPtr writer)
Sets up the standard xml write parameters.
xmlDocPtr xml_parsePhysFS(const char *filename)
Analogous to xmlParseMemory/xmlParseFile.
glTexture * gl_newSprite(const char *path, const int sx, const int sy, const unsigned int flags)
Loads the texture immediately, but also sets it as a sprite.
glTexture * gl_newImage(const char *path, const unsigned int flags)
Loads an image as a texture.
Abstraction for rendering sprite sheets.