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