[Fix] Everything works now. :)
This commit is contained in:
parent
20bf55f117
commit
e124672464
10
dat/ship.xml
10
dat/ship.xml
@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Ships>
|
||||
<ship name="Ship">
|
||||
<GFX>../gfx/ship.png</GFX>
|
||||
<GFX>ship.png</GFX>
|
||||
<class>1</class>
|
||||
<movement>
|
||||
<thrust>400</thrust>
|
||||
<turn>960</turn>
|
||||
<turn>360</turn>
|
||||
<speed>360</speed>
|
||||
</movement>
|
||||
<health>
|
||||
@ -21,13 +21,13 @@
|
||||
<mass>7</mass>
|
||||
<cap_weapon>20</cap_weapon>
|
||||
<cap_cargo>20</cap_cargo>
|
||||
</caracteristics>
|
||||
</characteristics>
|
||||
<outfits>
|
||||
<outfit quantity='2'>laser</outfit>
|
||||
</outfits>
|
||||
</ship>
|
||||
<ship name="Miss. Test">
|
||||
<GFX>gfx/enemyship.png</GFX>
|
||||
<GFX>enemyship.png</GFX>
|
||||
<class>1</class>
|
||||
<movement>
|
||||
<thrust>180</thrust>
|
||||
@ -47,7 +47,7 @@
|
||||
<mass>130</mass>
|
||||
<cap_weapon>60</cap_weapon>
|
||||
<cap_cargo>40</cap_cargo>
|
||||
</caracteristics>
|
||||
</characteristics>
|
||||
<outfits>
|
||||
</outfits>
|
||||
</ship>
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "physics.h"
|
||||
#include "opengl.h"
|
||||
#include "ship.h"
|
||||
#include "pilot.h"
|
||||
#include "player.h"
|
||||
#include "joystick.h"
|
||||
#include "pilot.h"
|
||||
|
11
src/ship.c
11
src/ship.c
@ -15,7 +15,7 @@
|
||||
#define XML_SHIP "ship"
|
||||
|
||||
#define SHIP_DATA "../dat/ship.xml"
|
||||
#define SHIP_GFX "../gfx/ship/
|
||||
#define SHIP_GFX "../gfx/ship/"
|
||||
|
||||
static Ship* ship_stack = NULL;
|
||||
static int ships;
|
||||
@ -44,8 +44,9 @@ Ship* ship_parse(xmlNodePtr node) {
|
||||
if(strcmp((char*)node->name, "GFX")==0) {
|
||||
cur = node->children;
|
||||
if(strcmp((char*)cur->name, "text")==0) {
|
||||
snprintf(str, sizeof(cur->content)+4, "../gfx/%s", (char*)cur->content);
|
||||
tmp->gfx_ship = gl_newSprite((char*)cur->content, 6, 6);
|
||||
snprintf(str, strlen((char*)cur->content)+sizeof(SHIP_GFX),
|
||||
SHIP_GFX"%s", (char*)cur->content);
|
||||
tmp->gfx_ship = gl_newSprite(str, 6, 6);
|
||||
}
|
||||
}
|
||||
else if(strcmp((char*)node->name, "class")==0) {
|
||||
@ -106,8 +107,8 @@ int ships_load(void) {
|
||||
xmlNodePtr node;
|
||||
Ship* tmp = NULL;
|
||||
|
||||
if((reader == xmlNewTextReaderFilename(DATA)) == NULL) {
|
||||
WARN("XML error reading " DATA);
|
||||
if((reader = xmlNewTextReaderFilename(SHIP_DATA)) == NULL) {
|
||||
WARN("XML error reading " SHIP_DATA);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user