30 const char *path,
int defsx,
int defsy,
31 const unsigned int flags )
37 xmlr_attr_int_def(node,
"sx", sx, defsx );
38 xmlr_attr_int_def(node,
"sy", sy, defsy );
41 buf = xml_get( node );
46 if ((buf[0]==
'/') || (path==NULL))
47 snprintf( filename,
sizeof(filename),
"%s", buf );
49 snprintf( filename,
sizeof(filename), path, buf );
52 if ((sx == 1) && (sy == 1))
66 xmlTextWriterSetIndentString(writer, (
const xmlChar*)
" ");
67 xmlTextWriterSetIndent(writer, 1);
85 WARN( _(
"Unable to read data from '%s'"), filename );
93 doc = xmlParseMemory( buf, bufsize );
95 WARN( _(
"Unable to parse document '%s'"), filename );
100int xmlw_saveTime( xmlTextWriterPtr writer,
const char *name, time_t t )
102 xmlw_elem( writer, name,
"%lu", t );
106int xml_parseTime( xmlNodePtr node, time_t *t )
108 *t = xml_getULong( node );
Header file with generic functions and naev-specifics.
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.