- WIP xml'd world linking
- textures?
- music?
+
+1/12/2015:
+==========
+
+ - world linking xml'd
+ - xml'ing indoors
+ - shaderssss
+ - more music
+
+1/13/2015:
+==========
+
+ - discovered how intel and nvidia gpus handle lighting
+ - xml'd buildings and their indoors
+ - xml'd settings for screen dimensions
+ - xml'd item giving through npc dialog
--- /dev/null
+<?xml version="1.0"?>
+
+<screen width="1024" height="720" />
+<hline value="3" />
* The desired width of the game window.
*/
-#define SCREEN_WIDTH 1280
+//#define SCREEN_WIDTH 1280
+extern unsigned int SCREEN_WIDTH;
/**
* The desired height of the game window.
*/
-#define SCREEN_HEIGHT 720
+//#define SCREEN_HEIGHT 720
+extern unsigned int SCREEN_HEIGHT;
//#define FULLSCREEN
*
*/
-#define HLINE 3
+#define HLINE 1
/**
* A 'wrapper' for libc's srand(), as we hope to eventually have our own random number
#include <world.h>
#include <ui.h>
#include <entities.h>
+#include <tinyxml2.h>
+
+using namespace tinyxml2;
/*
* TICKS_PER_SEC & MSEC_PER_TICK
extern bool fadeFast;
extern int fadeIntensity;
+unsigned int SCREEN_WIDTH;
+unsigned int SCREEN_HEIGHT;
+
/*******************************************************************************
* MAIN ************************************************************************
*******************************************************************************/
int main(/*int argc, char *argv[]*/){
//*argv = (char *)argc;
+
gameRunning=false;
+
+ XMLDocument xml;
+ xml.LoadFile("config/settings.xml");
+ SCREEN_WIDTH = xml.FirstChildElement("screen")->UnsignedAttribute("width");
+ SCREEN_HEIGHT = xml.FirstChildElement("screen")->UnsignedAttribute("height");
/*!
* (Attempt to) Initialize SDL libraries so that we can use SDL facilities and eventually
* see past the world render
*/
- if(currentWorld->getTheWidth() < SCREEN_WIDTH){
+ if(currentWorld->getTheWidth() < (int)SCREEN_WIDTH){
offset.x = 0;
}else if(!worldInside){
if(player->loc.x - SCREEN_WIDTH/2 < currentWorld->getTheWidth() * -0.5f)
if(!strcmp(exml->Name(),"text")){
if(exml->UnsignedAttribute("id") == idx){
+ if((oxml = exml->FirstChildElement("give"))){
+ while(oxml){
+ player->inv->addItem((ITEM_ID)oxml->UnsignedAttribute("id"),oxml->UnsignedAttribute("count"));
+ oxml = oxml->NextSiblingElement();
+ }
+ }
+
if((oxml = exml->FirstChildElement("option"))){
const char *op;
char *bp1 = new char[1],*bp2,*tmp;
}
}
}
- /*for(auto &l : earthlnk){
- if(!strcmp(file+4,l.name)){
- yoyo2 = &l.ptr;
- break;
- }
- }*/
if(wxml->QueryFloatAttribute("x",&spawnx) != XML_NO_ERROR)
earth.back()->addStructure((BUILD_SUB)wxml->UnsignedAttribute("type"),getRand() % earth.back()->getTheWidth() / 2.0f,100,yoyo);//,yoyo2);
else
<style background="0" bgm="assets/music/embark.wav" />
<generation type="Random" width="800" />
- <!--<link right="playerSpawnHill2.xml" />-->
+ <link right="playerSpawnHill2.xml" />
<mob type="1" />
<text id="1" >
My name's Johnny.
+
+ <give id="0" count="1" />
</text>
</Dialog>