]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
Worlds can be themed
authordrumsetmonkey <abelleisle@roadrunner.com>
Thu, 11 Feb 2016 13:25:57 +0000 (08:25 -0500)
committerdrumsetmonkey <abelleisle@roadrunner.com>
Thu, 11 Feb 2016 13:25:57 +0000 (08:25 -0500)
96 files changed:
assets/bg.png [deleted file]
assets/bgFarMountain.png [deleted file]
assets/bgFarTree.png [deleted file]
assets/bgFarTreeTile.png [deleted file]
assets/bgFrontTree.png [deleted file]
assets/bgFrontTreeTile.png [deleted file]
assets/bgMidTree.png [deleted file]
assets/bgMidTreeTile.png [deleted file]
assets/bgfarMountains.png [deleted file]
assets/bgn.png [deleted file]
assets/brazzier.png [deleted file]
assets/click.wav [deleted file]
assets/dirt.png [deleted file]
assets/forestTileBack.png [deleted file]
assets/forestTileFront.png [deleted file]
assets/forestTileMid.png [deleted file]
assets/fountain1.png [deleted file]
assets/grass.png [deleted file]
assets/house1.png [deleted file]
assets/house1N.png [deleted file]
assets/house2.png [deleted file]
assets/invUI.png [deleted file]
assets/lampPost1.png [deleted file]
assets/lightTest/Makefile [deleted file]
assets/lightTest/main.cp [deleted file]
assets/lightTest/main.cpp [deleted file]
assets/maybeplayer.png [deleted file]
assets/player.png [deleted file]
assets/player/maybeplayer.png [new file with mode: 0644]
assets/player/player.png [new file with mode: 0644]
assets/player/player1.png [new file with mode: 0644]
assets/player/player2.png [new file with mode: 0644]
assets/player/playerk.png [new file with mode: 0644]
assets/player/playerk1.png [new file with mode: 0644]
assets/player/playerk2.png [new file with mode: 0644]
assets/player/playerk3.png [new file with mode: 0644]
assets/player/playerk4.png [new file with mode: 0644]
assets/player/playerk5.png [new file with mode: 0644]
assets/player/playerk6.png [new file with mode: 0644]
assets/player/playerk7.png [new file with mode: 0644]
assets/player/playerk8.png [new file with mode: 0644]
assets/player1.png [deleted file]
assets/player2.png [deleted file]
assets/playerk.png [deleted file]
assets/playerk1.png [deleted file]
assets/playerk2.png [deleted file]
assets/playerk3.png [deleted file]
assets/playerk4.png [deleted file]
assets/playerk5.png [deleted file]
assets/playerk6.png [deleted file]
assets/playerk7.png [deleted file]
assets/playerk8.png [deleted file]
assets/sounds/click.wav [new file with mode: 0644]
assets/style/classic/bg/bg.png [new file with mode: 0644]
assets/style/classic/bg/bgFarMountain.png [new file with mode: 0644]
assets/style/classic/bg/bgFarTreeTile.png [new file with mode: 0644]
assets/style/classic/bg/bgFrontTreeTile.png [new file with mode: 0644]
assets/style/classic/bg/bgMidTreeTile.png [new file with mode: 0644]
assets/style/classic/bg/bgfarMountains.png [new file with mode: 0644]
assets/style/classic/bg/bgn.png [new file with mode: 0644]
assets/style/classic/bg/dirt.png [new file with mode: 0644]
assets/style/classic/bg/forestTileBack.png [new file with mode: 0644]
assets/style/classic/bg/forestTileFront.png [new file with mode: 0644]
assets/style/classic/bg/forestTileMid.png [new file with mode: 0644]
assets/style/classic/bg/grass.png [new file with mode: 0644]
assets/style/classic/brazzier.png [new file with mode: 0644]
assets/style/classic/fountain1.png [new file with mode: 0644]
assets/style/classic/house1.png [new file with mode: 0644]
assets/style/classic/house1N.png [new file with mode: 0644]
assets/style/classic/house2.png [new file with mode: 0644]
assets/style/classic/lampPost1.png [new file with mode: 0644]
assets/style/classic/townhall.png [new file with mode: 0644]
assets/style/rustic/bg/bg.png [new file with mode: 0644]
assets/style/rustic/bg/bgFarMountain.png [new file with mode: 0644]
assets/style/rustic/bg/bgFarTreeTile.png [new file with mode: 0644]
assets/style/rustic/bg/bgFrontTreeTile.png [new file with mode: 0644]
assets/style/rustic/bg/bgMidTreeTile.png [new file with mode: 0644]
assets/style/rustic/bg/bgfarMountains.png [new file with mode: 0644]
assets/style/rustic/bg/bgn.png [new file with mode: 0644]
assets/style/rustic/bg/dirt.png [new file with mode: 0644]
assets/style/rustic/bg/forestTileBack.png [new file with mode: 0644]
assets/style/rustic/bg/forestTileFront.png [new file with mode: 0644]
assets/style/rustic/bg/forestTileMid.png [new file with mode: 0644]
assets/style/rustic/bg/grass.png [new file with mode: 0644]
assets/style/rustic/fountain1.png [new file with mode: 0644]
assets/townhall.png [deleted file]
include/Texture.h
include/common.h
include/entities.h
include/world.h
src/Texture.cpp
src/entities.cpp
src/ui.cpp
src/world.cpp
xml/playerSpawnHill1.xml
xml/playerSpawnHill2.xml

diff --git a/assets/bg.png b/assets/bg.png
deleted file mode 100644 (file)
index 2dbc3f9..0000000
Binary files a/assets/bg.png and /dev/null differ
diff --git a/assets/bgFarMountain.png b/assets/bgFarMountain.png
deleted file mode 100644 (file)
index eb703bb..0000000
Binary files a/assets/bgFarMountain.png and /dev/null differ
diff --git a/assets/bgFarTree.png b/assets/bgFarTree.png
deleted file mode 100644 (file)
index 8b78cae..0000000
Binary files a/assets/bgFarTree.png and /dev/null differ
diff --git a/assets/bgFarTreeTile.png b/assets/bgFarTreeTile.png
deleted file mode 100644 (file)
index 07546a5..0000000
Binary files a/assets/bgFarTreeTile.png and /dev/null differ
diff --git a/assets/bgFrontTree.png b/assets/bgFrontTree.png
deleted file mode 100644 (file)
index 2cb54ad..0000000
Binary files a/assets/bgFrontTree.png and /dev/null differ
diff --git a/assets/bgFrontTreeTile.png b/assets/bgFrontTreeTile.png
deleted file mode 100644 (file)
index 7fc7450..0000000
Binary files a/assets/bgFrontTreeTile.png and /dev/null differ
diff --git a/assets/bgMidTree.png b/assets/bgMidTree.png
deleted file mode 100644 (file)
index 35f0c14..0000000
Binary files a/assets/bgMidTree.png and /dev/null differ
diff --git a/assets/bgMidTreeTile.png b/assets/bgMidTreeTile.png
deleted file mode 100644 (file)
index 126723e..0000000
Binary files a/assets/bgMidTreeTile.png and /dev/null differ
diff --git a/assets/bgfarMountains.png b/assets/bgfarMountains.png
deleted file mode 100644 (file)
index fa6b349..0000000
Binary files a/assets/bgfarMountains.png and /dev/null differ
diff --git a/assets/bgn.png b/assets/bgn.png
deleted file mode 100644 (file)
index 2aa3995..0000000
Binary files a/assets/bgn.png and /dev/null differ
diff --git a/assets/brazzier.png b/assets/brazzier.png
deleted file mode 100644 (file)
index e332599..0000000
Binary files a/assets/brazzier.png and /dev/null differ
diff --git a/assets/click.wav b/assets/click.wav
deleted file mode 100644 (file)
index 976fb42..0000000
Binary files a/assets/click.wav and /dev/null differ
diff --git a/assets/dirt.png b/assets/dirt.png
deleted file mode 100644 (file)
index 11252ac..0000000
Binary files a/assets/dirt.png and /dev/null differ
diff --git a/assets/forestTileBack.png b/assets/forestTileBack.png
deleted file mode 100644 (file)
index 0ea6022..0000000
Binary files a/assets/forestTileBack.png and /dev/null differ
diff --git a/assets/forestTileFront.png b/assets/forestTileFront.png
deleted file mode 100644 (file)
index e54f631..0000000
Binary files a/assets/forestTileFront.png and /dev/null differ
diff --git a/assets/forestTileMid.png b/assets/forestTileMid.png
deleted file mode 100644 (file)
index b23afd2..0000000
Binary files a/assets/forestTileMid.png and /dev/null differ
diff --git a/assets/fountain1.png b/assets/fountain1.png
deleted file mode 100644 (file)
index 46f7c44..0000000
Binary files a/assets/fountain1.png and /dev/null differ
diff --git a/assets/grass.png b/assets/grass.png
deleted file mode 100644 (file)
index e05fb9b..0000000
Binary files a/assets/grass.png and /dev/null differ
diff --git a/assets/house1.png b/assets/house1.png
deleted file mode 100644 (file)
index ce97a81..0000000
Binary files a/assets/house1.png and /dev/null differ
diff --git a/assets/house1N.png b/assets/house1N.png
deleted file mode 100644 (file)
index 0285533..0000000
Binary files a/assets/house1N.png and /dev/null differ
diff --git a/assets/house2.png b/assets/house2.png
deleted file mode 100644 (file)
index 7404cd9..0000000
Binary files a/assets/house2.png and /dev/null differ
diff --git a/assets/invUI.png b/assets/invUI.png
deleted file mode 100644 (file)
index 8647e38..0000000
Binary files a/assets/invUI.png and /dev/null differ
diff --git a/assets/lampPost1.png b/assets/lampPost1.png
deleted file mode 100644 (file)
index 24f1807..0000000
Binary files a/assets/lampPost1.png and /dev/null differ
diff --git a/assets/lightTest/Makefile b/assets/lightTest/Makefile
deleted file mode 100644 (file)
index c4d1042..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-LIBS = -lGL -lGLEW -lSDL2main -lSDL2 -lfreetype -lSDL2_image -lSDL2_mixer
-
-FLAGS = -m32 -std=c++11 -Iinclude -Iinclude/freetype2
-
-all:
-       @g++ $(FLAGS) -o main main.cpp $(LIBS)
\ No newline at end of file
diff --git a/assets/lightTest/main.cp b/assets/lightTest/main.cp
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/assets/lightTest/main.cpp b/assets/lightTest/main.cpp
deleted file mode 100644 (file)
index 4091389..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#include <GL/glew.h>
-
-#include <SDL2/SDL.h>
-#include <SDL2/SDL_opengl.h>
-#include <SDL2/SDL_image.h>
-#include <SDL2/SDL_mixer.h>
-#include <iostream>
-
-#define SCREEN_WIDTH 1280
-#define        SCREEN_HEIGHT 720
-
-SDL_Window* window;
-SDL_GLContext  mainGLContext = NULL;
-
-int main(void){
-       if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0){
-               std::cout << "SDL was not able to initialize! Error: " << SDL_GetError() << std::endl;
-               return -1;
-       }
-       // Run SDL_Quit when main returns
-    atexit(SDL_Quit);
-
-           window = SDL_CreateWindow("Ass",
-                                                         SDL_WINDOWPOS_UNDEFINED,      // Spawn the window at random (undefined) x and y coordinates
-                                                         SDL_WINDOWPOS_UNDEFINED,      //
-                                                         SCREEN_WIDTH,
-                                                         SCREEN_HEIGHT,
-                                                         SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL
-#ifdef FULLSCREEN
-                                                         | SDL_WINDOW_FULLSCREEN
-#endif // FULLSCREEN
-                              );
-
-       if(window==NULL){
-               std::cout << "The window failed to generate! SDL_Error: " << SDL_GetError() << std::endl;
-        return -1;
-    }
-
-    if((mainGLContext = SDL_GL_CreateContext(window)) == NULL){
-               std::cout << "The OpenGL context failed to initialize! SDL_Error: " << SDL_GetError() << std::endl;
-        return -1;
-    }
-       
-
-    GLenum err;
-       glewExperimental = GL_TRUE;
-       if((err=glewInit()) != GLEW_OK){
-               std::cout << "GLEW was not able to initialize! Error: " << glewGetErrorString(err) << std::endl;
-               return -1;
-       }
-
-       SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
-       
-       glViewport(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
-       
-       glEnable(GL_BLEND);
-       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
-
-       bool gameRunning = true;
-    while(gameRunning){
-
-    }
-    SDL_GL_DeleteContext(mainGLContext);
-    SDL_DestroyWindow(window);
-    return 0;
-}
\ No newline at end of file
diff --git a/assets/maybeplayer.png b/assets/maybeplayer.png
deleted file mode 100644 (file)
index c580ff7..0000000
Binary files a/assets/maybeplayer.png and /dev/null differ
diff --git a/assets/player.png b/assets/player.png
deleted file mode 100644 (file)
index 3977092..0000000
Binary files a/assets/player.png and /dev/null differ
diff --git a/assets/player/maybeplayer.png b/assets/player/maybeplayer.png
new file mode 100644 (file)
index 0000000..c580ff7
Binary files /dev/null and b/assets/player/maybeplayer.png differ
diff --git a/assets/player/player.png b/assets/player/player.png
new file mode 100644 (file)
index 0000000..3977092
Binary files /dev/null and b/assets/player/player.png differ
diff --git a/assets/player/player1.png b/assets/player/player1.png
new file mode 100644 (file)
index 0000000..edf8bf8
Binary files /dev/null and b/assets/player/player1.png differ
diff --git a/assets/player/player2.png b/assets/player/player2.png
new file mode 100644 (file)
index 0000000..cfd955f
Binary files /dev/null and b/assets/player/player2.png differ
diff --git a/assets/player/playerk.png b/assets/player/playerk.png
new file mode 100644 (file)
index 0000000..7abf012
Binary files /dev/null and b/assets/player/playerk.png differ
diff --git a/assets/player/playerk1.png b/assets/player/playerk1.png
new file mode 100644 (file)
index 0000000..1c4fb49
Binary files /dev/null and b/assets/player/playerk1.png differ
diff --git a/assets/player/playerk2.png b/assets/player/playerk2.png
new file mode 100644 (file)
index 0000000..97f769b
Binary files /dev/null and b/assets/player/playerk2.png differ
diff --git a/assets/player/playerk3.png b/assets/player/playerk3.png
new file mode 100644 (file)
index 0000000..19b97c4
Binary files /dev/null and b/assets/player/playerk3.png differ
diff --git a/assets/player/playerk4.png b/assets/player/playerk4.png
new file mode 100644 (file)
index 0000000..c32a9b3
Binary files /dev/null and b/assets/player/playerk4.png differ
diff --git a/assets/player/playerk5.png b/assets/player/playerk5.png
new file mode 100644 (file)
index 0000000..fabfa60
Binary files /dev/null and b/assets/player/playerk5.png differ
diff --git a/assets/player/playerk6.png b/assets/player/playerk6.png
new file mode 100644 (file)
index 0000000..269fccb
Binary files /dev/null and b/assets/player/playerk6.png differ
diff --git a/assets/player/playerk7.png b/assets/player/playerk7.png
new file mode 100644 (file)
index 0000000..aeac120
Binary files /dev/null and b/assets/player/playerk7.png differ
diff --git a/assets/player/playerk8.png b/assets/player/playerk8.png
new file mode 100644 (file)
index 0000000..ff03a02
Binary files /dev/null and b/assets/player/playerk8.png differ
diff --git a/assets/player1.png b/assets/player1.png
deleted file mode 100644 (file)
index edf8bf8..0000000
Binary files a/assets/player1.png and /dev/null differ
diff --git a/assets/player2.png b/assets/player2.png
deleted file mode 100644 (file)
index cfd955f..0000000
Binary files a/assets/player2.png and /dev/null differ
diff --git a/assets/playerk.png b/assets/playerk.png
deleted file mode 100644 (file)
index 7abf012..0000000
Binary files a/assets/playerk.png and /dev/null differ
diff --git a/assets/playerk1.png b/assets/playerk1.png
deleted file mode 100644 (file)
index 1c4fb49..0000000
Binary files a/assets/playerk1.png and /dev/null differ
diff --git a/assets/playerk2.png b/assets/playerk2.png
deleted file mode 100644 (file)
index 97f769b..0000000
Binary files a/assets/playerk2.png and /dev/null differ
diff --git a/assets/playerk3.png b/assets/playerk3.png
deleted file mode 100644 (file)
index 19b97c4..0000000
Binary files a/assets/playerk3.png and /dev/null differ
diff --git a/assets/playerk4.png b/assets/playerk4.png
deleted file mode 100644 (file)
index c32a9b3..0000000
Binary files a/assets/playerk4.png and /dev/null differ
diff --git a/assets/playerk5.png b/assets/playerk5.png
deleted file mode 100644 (file)
index fabfa60..0000000
Binary files a/assets/playerk5.png and /dev/null differ
diff --git a/assets/playerk6.png b/assets/playerk6.png
deleted file mode 100644 (file)
index 269fccb..0000000
Binary files a/assets/playerk6.png and /dev/null differ
diff --git a/assets/playerk7.png b/assets/playerk7.png
deleted file mode 100644 (file)
index aeac120..0000000
Binary files a/assets/playerk7.png and /dev/null differ
diff --git a/assets/playerk8.png b/assets/playerk8.png
deleted file mode 100644 (file)
index ff03a02..0000000
Binary files a/assets/playerk8.png and /dev/null differ
diff --git a/assets/sounds/click.wav b/assets/sounds/click.wav
new file mode 100644 (file)
index 0000000..976fb42
Binary files /dev/null and b/assets/sounds/click.wav differ
diff --git a/assets/style/classic/bg/bg.png b/assets/style/classic/bg/bg.png
new file mode 100644 (file)
index 0000000..2dbc3f9
Binary files /dev/null and b/assets/style/classic/bg/bg.png differ
diff --git a/assets/style/classic/bg/bgFarMountain.png b/assets/style/classic/bg/bgFarMountain.png
new file mode 100644 (file)
index 0000000..eb703bb
Binary files /dev/null and b/assets/style/classic/bg/bgFarMountain.png differ
diff --git a/assets/style/classic/bg/bgFarTreeTile.png b/assets/style/classic/bg/bgFarTreeTile.png
new file mode 100644 (file)
index 0000000..07546a5
Binary files /dev/null and b/assets/style/classic/bg/bgFarTreeTile.png differ
diff --git a/assets/style/classic/bg/bgFrontTreeTile.png b/assets/style/classic/bg/bgFrontTreeTile.png
new file mode 100644 (file)
index 0000000..7fc7450
Binary files /dev/null and b/assets/style/classic/bg/bgFrontTreeTile.png differ
diff --git a/assets/style/classic/bg/bgMidTreeTile.png b/assets/style/classic/bg/bgMidTreeTile.png
new file mode 100644 (file)
index 0000000..126723e
Binary files /dev/null and b/assets/style/classic/bg/bgMidTreeTile.png differ
diff --git a/assets/style/classic/bg/bgfarMountains.png b/assets/style/classic/bg/bgfarMountains.png
new file mode 100644 (file)
index 0000000..fa6b349
Binary files /dev/null and b/assets/style/classic/bg/bgfarMountains.png differ
diff --git a/assets/style/classic/bg/bgn.png b/assets/style/classic/bg/bgn.png
new file mode 100644 (file)
index 0000000..2aa3995
Binary files /dev/null and b/assets/style/classic/bg/bgn.png differ
diff --git a/assets/style/classic/bg/dirt.png b/assets/style/classic/bg/dirt.png
new file mode 100644 (file)
index 0000000..11252ac
Binary files /dev/null and b/assets/style/classic/bg/dirt.png differ
diff --git a/assets/style/classic/bg/forestTileBack.png b/assets/style/classic/bg/forestTileBack.png
new file mode 100644 (file)
index 0000000..0ea6022
Binary files /dev/null and b/assets/style/classic/bg/forestTileBack.png differ
diff --git a/assets/style/classic/bg/forestTileFront.png b/assets/style/classic/bg/forestTileFront.png
new file mode 100644 (file)
index 0000000..e54f631
Binary files /dev/null and b/assets/style/classic/bg/forestTileFront.png differ
diff --git a/assets/style/classic/bg/forestTileMid.png b/assets/style/classic/bg/forestTileMid.png
new file mode 100644 (file)
index 0000000..b23afd2
Binary files /dev/null and b/assets/style/classic/bg/forestTileMid.png differ
diff --git a/assets/style/classic/bg/grass.png b/assets/style/classic/bg/grass.png
new file mode 100644 (file)
index 0000000..e05fb9b
Binary files /dev/null and b/assets/style/classic/bg/grass.png differ
diff --git a/assets/style/classic/brazzier.png b/assets/style/classic/brazzier.png
new file mode 100644 (file)
index 0000000..e332599
Binary files /dev/null and b/assets/style/classic/brazzier.png differ
diff --git a/assets/style/classic/fountain1.png b/assets/style/classic/fountain1.png
new file mode 100644 (file)
index 0000000..46f7c44
Binary files /dev/null and b/assets/style/classic/fountain1.png differ
diff --git a/assets/style/classic/house1.png b/assets/style/classic/house1.png
new file mode 100644 (file)
index 0000000..ce97a81
Binary files /dev/null and b/assets/style/classic/house1.png differ
diff --git a/assets/style/classic/house1N.png b/assets/style/classic/house1N.png
new file mode 100644 (file)
index 0000000..0285533
Binary files /dev/null and b/assets/style/classic/house1N.png differ
diff --git a/assets/style/classic/house2.png b/assets/style/classic/house2.png
new file mode 100644 (file)
index 0000000..7404cd9
Binary files /dev/null and b/assets/style/classic/house2.png differ
diff --git a/assets/style/classic/lampPost1.png b/assets/style/classic/lampPost1.png
new file mode 100644 (file)
index 0000000..24f1807
Binary files /dev/null and b/assets/style/classic/lampPost1.png differ
diff --git a/assets/style/classic/townhall.png b/assets/style/classic/townhall.png
new file mode 100644 (file)
index 0000000..7b510e8
Binary files /dev/null and b/assets/style/classic/townhall.png differ
diff --git a/assets/style/rustic/bg/bg.png b/assets/style/rustic/bg/bg.png
new file mode 100644 (file)
index 0000000..2dbc3f9
Binary files /dev/null and b/assets/style/rustic/bg/bg.png differ
diff --git a/assets/style/rustic/bg/bgFarMountain.png b/assets/style/rustic/bg/bgFarMountain.png
new file mode 100644 (file)
index 0000000..eb703bb
Binary files /dev/null and b/assets/style/rustic/bg/bgFarMountain.png differ
diff --git a/assets/style/rustic/bg/bgFarTreeTile.png b/assets/style/rustic/bg/bgFarTreeTile.png
new file mode 100644 (file)
index 0000000..07546a5
Binary files /dev/null and b/assets/style/rustic/bg/bgFarTreeTile.png differ
diff --git a/assets/style/rustic/bg/bgFrontTreeTile.png b/assets/style/rustic/bg/bgFrontTreeTile.png
new file mode 100644 (file)
index 0000000..7fc7450
Binary files /dev/null and b/assets/style/rustic/bg/bgFrontTreeTile.png differ
diff --git a/assets/style/rustic/bg/bgMidTreeTile.png b/assets/style/rustic/bg/bgMidTreeTile.png
new file mode 100644 (file)
index 0000000..126723e
Binary files /dev/null and b/assets/style/rustic/bg/bgMidTreeTile.png differ
diff --git a/assets/style/rustic/bg/bgfarMountains.png b/assets/style/rustic/bg/bgfarMountains.png
new file mode 100644 (file)
index 0000000..fa6b349
Binary files /dev/null and b/assets/style/rustic/bg/bgfarMountains.png differ
diff --git a/assets/style/rustic/bg/bgn.png b/assets/style/rustic/bg/bgn.png
new file mode 100644 (file)
index 0000000..2aa3995
Binary files /dev/null and b/assets/style/rustic/bg/bgn.png differ
diff --git a/assets/style/rustic/bg/dirt.png b/assets/style/rustic/bg/dirt.png
new file mode 100644 (file)
index 0000000..038aae1
Binary files /dev/null and b/assets/style/rustic/bg/dirt.png differ
diff --git a/assets/style/rustic/bg/forestTileBack.png b/assets/style/rustic/bg/forestTileBack.png
new file mode 100644 (file)
index 0000000..0ea6022
Binary files /dev/null and b/assets/style/rustic/bg/forestTileBack.png differ
diff --git a/assets/style/rustic/bg/forestTileFront.png b/assets/style/rustic/bg/forestTileFront.png
new file mode 100644 (file)
index 0000000..8e532bb
Binary files /dev/null and b/assets/style/rustic/bg/forestTileFront.png differ
diff --git a/assets/style/rustic/bg/forestTileMid.png b/assets/style/rustic/bg/forestTileMid.png
new file mode 100644 (file)
index 0000000..b23afd2
Binary files /dev/null and b/assets/style/rustic/bg/forestTileMid.png differ
diff --git a/assets/style/rustic/bg/grass.png b/assets/style/rustic/bg/grass.png
new file mode 100644 (file)
index 0000000..6a35d8e
Binary files /dev/null and b/assets/style/rustic/bg/grass.png differ
diff --git a/assets/style/rustic/fountain1.png b/assets/style/rustic/fountain1.png
new file mode 100644 (file)
index 0000000..ff242bf
Binary files /dev/null and b/assets/style/rustic/fountain1.png differ
diff --git a/assets/townhall.png b/assets/townhall.png
deleted file mode 100644 (file)
index 7b510e8..0000000
Binary files a/assets/townhall.png and /dev/null differ
index 50681bfa8c1590c0718f02ee52e56ea842c09a78..c6376cb885df52bef9771de6262ac4cb2a0f7c6c 100644 (file)
@@ -33,6 +33,7 @@ namespace Texture{
        
        void initColorIndex();
        vec2 getIndex(Color c);
+       dim2 imageDim(const char *fileName);
 }
 
 /**
@@ -71,6 +72,7 @@ public:
         */
        
        Texturec(uint amt,const char **paths);
+       Texturec(std::vector<std::string>vec);
        
        /**
         * Frees memory taken by the image array.
index 0a8ba203f0275ff67065c9240a55d219147df69e..34260c95403cb18042703dd36e2af6c0378b3556 100644 (file)
@@ -234,6 +234,9 @@ const char *readFile(const char *path);
 
 int strCreateFunc(const char *equ);
 
+template<typename N, size_t s>
+size_t arrAmt(N (&)[s]){return s;}
+
 extern void *NULLPTR;
 
 #endif // COMMON_H
index 9cc1b310594e5acc6502125b2488df32da2eee5c..05ae64c08066560b4c714b5b6b611c67b678b100 100644 (file)
@@ -26,7 +26,7 @@ enum _TYPE {
 enum GENDER{
        MALE,
        FEMALE,
-       NONE 
+       TRANSBULLSHIT
 };
 
 enum MOB_SUB {
@@ -195,7 +195,9 @@ public:
 class Structures : public Entity{
 public:
        BUILD_SUB bsubtype;
+       World *inWorld;
        char *inside;
+       char *textureLoc;
        
        Structures();
        ~Structures();
index 47e11f52224b7623fb0cd99d78bc83bb61ae7252..43da6fc923dd8651c9344ba83081c84748201cfd 100644 (file)
@@ -145,7 +145,7 @@ protected:
         */
        
        Texturec *bgTex;
-       
+
        /**
         * Defines the set of background images that should be used for this world.
         */
@@ -163,6 +163,8 @@ protected:
         */
        
        char *bgm;
+       std::vector<std::string>bgFiles;
+       std::vector<std::string>bgFilesIndoors;
        
 public:
 
@@ -234,7 +236,14 @@ public:
         * A vector of all light elements in this world.
         */
        
-       std::vector<Light        >  light;
+       std::vector<Light        >  light;
+
+       /**
+        * Vector of all building textures for the current world style
+        */
+
+       std::vector<std::string  >  sTexLoc;
+
        
        /**
         * NULLifies pointers and allocates necessary memory. This should be
@@ -257,7 +266,7 @@ public:
         * the structure.
         */
        
-       void addStructure(BUILD_SUB subtype,float x,float y,const char *inside);
+       void addStructure(BUILD_SUB subtype,float x,float y, char* tex, const char *inside);
        //void addVillage(int buildingCount, int npcMin, int npcMax,const char *inside);
        
        /**
@@ -343,6 +352,12 @@ public:
         */
        
        void setBGM(const char *path);
+
+       /**
+        *      Sets the worlds style folder
+        */
+
+       void setStyle(const char* pre); 
        
        /**
         * Plays/stops this world's BGM. If `prev` is not NULL, that world's BGM
index e715b1ea2c2d0a0c52bcbc0c50615bbf88f28e86..1487dcd6a895cf06986d5b0bcaa0631f321092ea 100644 (file)
@@ -4,6 +4,7 @@
 struct texture_t {
        char *name;
        GLuint tex;
+       dim2 dim;
 } __attribute__ ((packed));
 
 struct index_t{
@@ -59,17 +60,28 @@ namespace Texture{
                                         GL_UNSIGNED_BYTE, 
                                         image->pixels
                                         );
-
-               SDL_FreeSurface(image); // Free the surface
                
                LoadedTexture[LoadedTextureCounter]               = new struct texture_t;               //(struct texture_t *)malloc(sizeof(struct texture_t));
                LoadedTexture[LoadedTextureCounter]->name = new char[strlen(fileName)+1];       //(char *)malloc(safe_strlen(fileName));
                LoadedTexture[LoadedTextureCounter]->tex  = object;
                strcpy(LoadedTexture[LoadedTextureCounter]->name,fileName);
+               LoadedTexture[LoadedTextureCounter]->dim.x = image->w;
+               LoadedTexture[LoadedTextureCounter]->dim.y = image->h;
                LoadedTextureCounter++;
                
+               SDL_FreeSurface(image); // Free the surface
+
                return object;
        }
+
+       dim2 imageDim(const char *fileName){
+               for(unsigned int i=0;i<LoadedTextureCounter;i++){
+                       if(!strcmp(LoadedTexture[i]->name,fileName)){
+                               return LoadedTexture[i]->dim;
+                       }
+               }
+               return {0,0};
+       }
        
        void freeTextures(void){
                for(unsigned int i=0;i<LoadedTextureCounter;i++){
@@ -158,6 +170,14 @@ Texturec::Texturec(uint amt, ...){
        va_end(fNames);
 }
 
+Texturec::Texturec(std::vector<std::string>v){
+       texState = 0;
+       image = new GLuint[v.size()];
+       for(unsigned int i = 0; i < v.size(); i++){
+               image[i] = Texture::loadTexture(v[i].c_str());
+       }
+}
+
 Texturec::Texturec(uint amt,const char **paths){
        texState = 0;
        image = new GLuint[amt];
index 5a9c42a5721ef879d26512a7ddf4bd31e4411eb1..0469ad281a9348dd1c889578b2df2f6b9602077c 100644 (file)
@@ -12,15 +12,6 @@ extern Player *player;
 
 extern const char *itemName;
 
-std::string sTexLoc[] = {      "assets/townhall.png",
-                                                       "assets/house1.png", 
-                                                       "assets/house2.png", 
-                                                       "assets/house1.png", 
-                                                       "assets/house1.png", 
-                                                       "assets/fountain1.png",
-                                                       "assets/lampPost1.png",
-                                                       "assets/brazzier.png"};
-
 GLuint waterTex;
 
 void initEntity(){
@@ -95,15 +86,15 @@ Player::Player(){ //sets all of the player specific traits on object creation
        subtype = 0;    
        health = maxHealth = 100;
        speed = 1;
-       tex = new Texturec(9,   "assets/playerk.png",
-                                                       "assets/playerk1.png",
-                                                       "assets/playerk2.png",
-                                                       "assets/playerk3.png",
-                                                       "assets/playerk4.png",
-                                                       "assets/playerk5.png",
-                                                       "assets/playerk6.png",
-                                                       "assets/playerk7.png",
-                                                       "assets/playerk8.png");
+       tex = new Texturec(9,   "assets/player/playerk.png",
+                                                       "assets/player/playerk1.png",
+                                                       "assets/player/playerk2.png",
+                                                       "assets/player/playerk3.png",
+                                                       "assets/player/playerk4.png",
+                                                       "assets/player/playerk5.png",
+                                                       "assets/player/playerk6.png",
+                                                       "assets/player/playerk7.png",
+                                                       "assets/player/playerk8.png");
        inv = new Inventory(PLAYER_INV_SIZE);
 }
 Player::~Player(){
@@ -126,7 +117,7 @@ NPC::NPC(){ //sets all of the NPC specific traits on object creation
        tex = new Texturec(1,"assets/NPC.png");
        inv = new Inventory(NPC_INV_SIZE);
        
-       randDialog = 6;//rand() % 12 - 1;
+       randDialog = rand() % 12 - 1;
        dialogIndex = 0;
 }
 NPC::~NPC(){
@@ -462,6 +453,7 @@ unsigned int Structures::spawn(BUILD_SUB sub, float x, float y){
        alive = true;
 
        bsubtype = sub;
+       dim2 dim;
        
        /*
         *      tempN is the amount of entities that will be spawned in the village. Currently the village
@@ -470,33 +462,11 @@ unsigned int Structures::spawn(BUILD_SUB sub, float x, float y){
 
        //unsigned int tempN = (getRand() % 5 + 2);
        switch(sub){
-               case TOWN_HALL:
-                       tex = new Texturec(1, sTexLoc[sub].c_str());
-                       width =  50 * HLINE;
-                       height = 40 * HLINE;
-
-                       break;
-               case HOUSE:
-                       tex = new Texturec(1, sTexLoc[sub].c_str());
-                       width =  50 * HLINE;
-                       height = 40 * HLINE;
-                       break;
-               case FOUNTAIN:
-                       tex = new Texturec(1, sTexLoc[sub].c_str());
-                       width =  50 * HLINE;
-                       height = 40 * HLINE;
-                       break;
-               case LAMP_POST:
-                       tex = new Texturec(1, sTexLoc[sub].c_str());
-                       width =  10 * HLINE;
-                       height = 40 * HLINE;
-                       break;
-               case FIRE_PIT:
-                       tex = new Texturec(1, sTexLoc[sub].c_str());
-                       width =  12 * HLINE;
-                       height = 12 * HLINE;
-                       break;
                default:
+                       tex = new Texturec(1, textureLoc ? textureLoc : inWorld->sTexLoc[sub].c_str());
+                       dim = Texture::imageDim(textureLoc ? textureLoc : inWorld->sTexLoc[sub].c_str());
+                       width = dim.x;
+                       height = dim.y;
                        break;
        }
        return 0;
index 56a88a33376cde51f9b3e55f83b80a2b622b472b..ead493226d95675bd33a6746e8f90ca16ca6f3b8 100644 (file)
@@ -146,10 +146,10 @@ namespace ui {
 #ifdef DEBUG
                DEBUG_printf("Initialized FreeType2.\n",NULL);
 #endif // DEBUG
-               dialogClick = Mix_LoadWAV("assets/click.wav");
+               dialogClick = Mix_LoadWAV("assets/sounds/click.wav");
                battleStart = Mix_LoadWAV("assets/sounds/frig.wav");
                sanic = Mix_LoadWAV("assets/sounds/sanic.wav");
-               Mix_Volume(1,50);
+               //Mix_Volume(1,50);
        }
        
        void destroyFonts(void){
@@ -258,9 +258,11 @@ namespace ui {
         *      Draws a character at the specified coordinates, aborting if the character is unknown.
        */
        
-       vec2 putChar(float x,float y,char c){
+       vec2 putChar(float xx,float yy,char c){
                vec2 c1,c2;
-               
+
+               int x = xx, y = yy;
+                               
                /*
                 *      Get the width and height of the rendered character.
                */
@@ -725,8 +727,7 @@ namespace ui {
        */
 
        void drawMenu(Menu *menu){
-
-               setFontSize(20);
+               setFontSize(18);
                SDL_Event e;
                        
                mouse.x=premouse.x+offset.x-(SCREEN_WIDTH/2);
@@ -1229,7 +1230,7 @@ DONE:
                                        //currentWorld->addVillage(player->loc.x, player->loc.y, 5, 10, 100, NULL);
                                        break;
                                case SDLK_b:
-                                       currentWorld->addStructure(FIRE_PIT, player->loc.x, player->loc.y, NULL);
+                                       currentWorld->addStructure(FIRE_PIT, player->loc.x, player->loc.y, NULL, NULL);
                                        currentWorld->addLight({player->loc.x + SCREEN_WIDTH/2, player->loc.y},{1.0f,1.0f,1.0f});
                                        break;
                                case SDLK_F12:
index 6118851ff0b0f803077904aa2e636a071238667c..2012d32fc77735074fbd77ac6671d34e0c99983f 100644 (file)
@@ -17,23 +17,49 @@ bool worldInside = false;           // True if player is inside a structure
 
 WEATHER weather = SUNNY;
 
-const char *bgPaths[2][7]={
-       {"assets/bg.png",                               // Daytime background
-       "assets/bgn.png",                               // Nighttime background
-       "assets/bgFarMountain.png",             // Furthest layer
-       "assets/forestTileBack.png",    // Closer layer
-       "assets/forestTileMid.png",             // Near layer
-       "assets/forestTileFront.png",   // Closest layer
-       "assets/dirt.png"},                             // Dirt
-       {"assets/bgWoodTile.png",
-        NULL,
-        NULL,
-        NULL,
-        NULL,
-        NULL}
+// const char *bgPaths[2][7]={
+//     {"assets/bg.png",                               // Daytime background
+//      "assets/bgn.png",                              // Nighttime background
+//      "assets/bgFarMountain.png",            // Furthest layer
+//      "assets/forestTileBack.png",   // Closer layer
+//      "assets/forestTileMid.png",            // Near layer
+//      "assets/forestTileFront.png",  // Closest layer
+//      "assets/dirt.png"},                            // Dirt
+//     {"assets/bgWoodTile.png",
+//      NULL,
+//      NULL,
+//      NULL,
+//      NULL,
+//      NULL}
+// };
+
+const std::string bgPaths[2][8]={
+       {"bg.png",                                      // Daytime background
+        "bgn.png",                                     // Nighttime background
+        "bgFarMountain.png",           // Furthest layer
+        "forestTileBack.png",          // Closer layer
+        "forestTileMid.png",           // Near layer
+        "forestTileFront.png",         // Closest layer
+        "dirt.png",                            // Dirt
+        "grass.png"},                          // Grass
+       {"bgWoodTile.png",
+        "bgWoodTile.png",
+        "bgWoodTile.png",
+        "bgWoodTile.png",
+        "bgWoodTile.png",
+        "bgWoodTile.png",
+        "bgWoodTile.png",
+        "bgWoodTile.png"}
 };
 
-Texturec *grassT;
+const std::string buildPaths[] = {     "townhall.png",
+                                                                       "house1.png", 
+                                                                       "house2.png", 
+                                                                       "house1.png", 
+                                                                       "house1.png", 
+                                                                       "fountain1.png",
+                                                                       "lampPost1.png",
+                                                                       "brazzier.png"};
 
 const float bgDraw[3][3]={
        {100,240,.6 },
@@ -56,14 +82,34 @@ void World::setBackground(WORLD_BG_TYPE bgt){
        bgType = bgt;
        switch(bgt){
        case BG_FOREST:
-               bgTex = new Texturec(7,bgPaths[0]);
+               bgTex = new Texturec(bgFiles);
                break;
        case BG_WOODHOUSE:
-               bgTex = new Texturec(1,bgPaths[1]);
+               bgTex = new Texturec(bgFilesIndoors);
                break;
        }
 }
 
+void World::setStyle(const char* pre){
+       std::string prefix = pre ? pre : "assets/style/classic/";
+       for(uint i = 0; i < arrAmt(buildPaths);i++){
+               sTexLoc.push_back(prefix);
+               sTexLoc.back() += buildPaths[i];
+               std::cout << sTexLoc.back() << std::endl;
+       }
+       prefix += "bg/";
+       for(uint i = 0; i < arrAmt(bgPaths[0]);i++){
+               bgFiles.push_back(prefix);
+               bgFiles.back() += bgPaths[0][i];
+               std::cout << bgFiles.back() << std::endl;
+       }
+       for(uint i = 0; i < arrAmt(bgPaths[1]);i++){
+               bgFilesIndoors.push_back(prefix);
+               bgFilesIndoors.back() += bgPaths[1][i];
+               std::cout << bgFilesIndoors.back() << std::endl;
+       }
+}
+
 World::World(void){
        
        bgm = NULL;
@@ -78,7 +124,6 @@ World::World(void){
        
        star = new vec2[100];
        memset(star,0,100 * sizeof(vec2));
-       grassT = new Texturec(1,"assets/grass.png");
 }
 
 void World::deleteEntities(void){
@@ -595,10 +640,10 @@ void World::draw(Player *p){
                        hey=true;
                        glColor4ub(0,0,0,255);
                }else safeSetColorA(150+shade*2,150+shade*2,150+shade*2,255);
-               glTexCoord2i(0,0);glVertex2i(cx_start+i*HLINE      ,cline[i].y-GRASS_HEIGHT);
-               glTexCoord2i(1,0);glVertex2i(cx_start+i*HLINE+HLINE,cline[i].y-GRASS_HEIGHT);
+               glTexCoord2i(0,0);                                                                      glVertex2i(cx_start+i*HLINE      ,cline[i].y-GRASS_HEIGHT);
+               glTexCoord2i(1,0);                                                                      glVertex2i(cx_start+i*HLINE+HLINE,cline[i].y-GRASS_HEIGHT);
                glTexCoord2i(1,(int)(cline[i].y/64)+cline[i].color);glVertex2i(cx_start+i*HLINE+HLINE,0);
-               glTexCoord2i(0,(int)(cline[i].y/64)+cline[i].color);glVertex2i(cx_start+i*HLINE    ,0);
+               glTexCoord2i(0,(int)(cline[i].y/64)+cline[i].color);glVertex2i(cx_start+i*HLINE          ,0);
                cline[i].y-=(yoff-DRAW_Y_OFFSET);                                                                                                                       // Restore the line's y value
                if(hey){
                        hey=false;
@@ -616,7 +661,7 @@ void World::draw(Player *p){
 
        glEnable(GL_TEXTURE_2D);
        glActiveTexture(GL_TEXTURE0);
-       grassT->bind(0);
+       bgTex->bindNext();
        glUseProgram(shaderProgram);
        glUniform1i(glGetUniformLocation(shaderProgram, "sampler"), 0);         
        //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); //for the s direction
@@ -948,10 +993,12 @@ void World::detect(Player *p){
                goto LOOOOP;
        }*/
 }
-void World::addStructure(BUILD_SUB sub, float x,float y,const char *inside){
+void World::addStructure(BUILD_SUB sub, float x,float y, char *tex, const char *inside){
        build.push_back(new Structures());
+       build.back()->inWorld = this;
+       build.back()->textureLoc = tex;
        build.back()->spawn(sub,x,y);
-       
+
        if(inside)
                strcpy((build.back()->inside = new char[1 + strlen(inside)]),inside);
        else
@@ -1071,8 +1118,7 @@ char *World::setToRight(const char *file){
 
 World *World::goWorldLeft(Player *p){
        World *tmp;
-       
-       if(toLeft && p->loc.x < x_start + HLINE * 15){
+       if(toLeft && p->loc.x < x_start + (int)HLINE * 15){
                tmp = loadWorldFromXML(toLeft);
                
                p->loc.x = -tmp->x_start - HLINE * 10;
@@ -1474,6 +1520,7 @@ World *loadWorldFromXML(const char *path){
                                tmp->setToRight(ptr);
                        else abort();
                }else if(!strcmp(name,"style")){
+                       tmp->setStyle(wxml->Attribute("folder"));
                        tmp->setBackground((WORLD_BG_TYPE)wxml->UnsignedAttribute("background"));
                        tmp->setBGM(wxml->Attribute("bgm"));
                }else if(!strcmp(name,"generation")){
@@ -1519,10 +1566,13 @@ World *loadWorldFromXML(const char *path){
                        
                }else if(!strcmp(name,"structure")){
                        ptr = wxml->Attribute("inside");
-                       if(wxml->QueryFloatAttribute("x",&spawnx) != XML_NO_ERROR)
-                               tmp->addStructure((BUILD_SUB)wxml->UnsignedAttribute("type"),getRand() % tmp->getTheWidth() / 2.0f,100,ptr);
-                       else
-                               tmp->addStructure((BUILD_SUB)wxml->UnsignedAttribute("type"),spawnx,wxml->FloatAttribute("y"),ptr);
+                       tmp->addStructure((BUILD_SUB)wxml->UnsignedAttribute("type"),
+                                                          wxml->QueryFloatAttribute("x",&spawnx) != XML_NO_ERROR ? 
+                                                                               getRand() % tmp->getTheWidth() / 2.0f : 
+                                                                               spawnx,
+                                                          100,
+                                                          (char*)wxml->Attribute("texture"),
+                                                          ptr);
                }else if(!strcmp(name,"trigger")){
                        tmp->addMob(MS_TRIGGER,wxml->FloatAttribute("x"),0,commonTriggerFunc);
                        tmp->mob.back()->heyid = wxml->Attribute("id");
index 55612d3a3c5f84153734005f19a4ce80e1eb60d7..a99b274120b110ae5cb22bec79dc97782bae1700 100644 (file)
@@ -1,9 +1,8 @@
 <?xml version="1.0"?>
 <World>
-       <style background="0" bgm="assets/music/embark.wav" />
+       <style background="0" bgm="assets/music/embark.wav" folder="assets/style/classic/" />
        <generation type="Random" width="1600" />
-       
-       <link right="playerSpawnHill2.xml" />
+       <link left="playerSpawnHill2.xml" />
        
        <mob type="1" aggressive="false" />
        
        
        <npc name="Ralph" hasDialog="true" />
        <npc name="Johnny" hasDialog="true" />
-       <structure type="5" inside="playerSpawnHill1_Building1.xml" />
+       <structure type="5" inside="playerSpawnHill1_Building1.xml"/>
+       <village>
+
+       </village>
 
 </World>
 
@@ -33,7 +35,7 @@ And it wasn't stormy.
        </text>
        
        <text id="2" call="Johnny" callid="1">
-               what you have done it to trick Microsoft
+               what you have done it to trick Microsoft?
        </text>
        
 </Dialog>
index 2da7bd3703c025dfe3b6655c76e53b7196092d36..c46dad33c34365d0adef4fb0aba20d6c137f4107 100644 (file)
@@ -1,8 +1,9 @@
 <?xml version="1.0"?>
 <World>
-       <style background="0" bgm="assets/music/embark.wav" />
-       <generation type="Random" width="500" />
+       <style background="0" bgm="assets/music/embark.wav" folder="assets/style/rustic/"/>
+       <generation type="Random" width="1000" />
+       <structure type="5" inside="playerSpawnHill1_Building1.xml"/>
        
-       <link left="playerSpawnHill1.xml" />
+       <link right="playerSpawnHill1.xml" />
 
 </World>