From 688fe289549ce4d41ee2ff489bc03f6935304bf5 Mon Sep 17 00:00:00 2001 From: "Joao Dantas (dantasj)" Date: Thu, 7 Mar 2019 06:42:09 +0000 Subject: [PATCH 1/2] MapTile Bug with the loading of the tile, everything else is as intended! --- maptile | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 maptile diff --git a/maptile b/maptile new file mode 100644 index 0000000..9e5004c --- /dev/null +++ b/maptile @@ -0,0 +1,78 @@ +#include +#include +#include +#include +#include + +const int SCREEN_WIDTH = 640; +const int SCREEN_HEIGHT = 480; + +const int LEVEL_WIDTH = 1280; +const int LEVEL_WIDTH = 960; + +const int TILE_WIDTH = 80; +const int TILE_HEIGHT = 80; +const int TOTAL_TILES = 192; +const int TOTAL_TILE_SPRITES = 12; + + + +const int TILE_BROWN = 0; +const int TILE_GREEN = 1; +const int TILE_BLUE = 2; +const int TILE_WALL = 3; + + +class Tile +{ +public: + Tile(int x, int y, int tileType); + + void render(SDL_Rect & camera); + + int getType(); + + SDL_Rect getBox(); + +private: + SDL_Rect mBox; + + int mType; +}; + + +bool init(); + +bool loadMedia(Tile* tiles[]); + +void close(Tile* tiles[]); + + +bool setTiles(Tile *tiles[]); + +Tile::Tile(int x, int y, int tileType) +{ + mBox.x = x; + mBox.y = y; + + mBox.w = TILE_WIDTH; + mBox.h = TILE_HEIGHT; + + mType = tileType; + +} + +int Tile::getType() +{ + return mType; + +} + +bool loadMedia(Tile* tiles[]) +{ + bool success = true; + if (!gTileTexture.loadFromFile("Imagens/tiletect.png")) + { + printf( "Failed to load tile set texture!!!\n") + } +} From 9645016f0c8508610aa5664997a5ab1fb9f3ae84 Mon Sep 17 00:00:00 2001 From: "Joao Dantas (dantasj)" Date: Wed, 20 Mar 2019 19:02:57 +0000 Subject: [PATCH 2/2] Database DB Connection Test --- database | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 database diff --git a/database b/database new file mode 100644 index 0000000..9914190 --- /dev/null +++ b/database @@ -0,0 +1,21 @@ +#include "sqlite3.h" +#include "iostream" + +int DbConnectTest(int argc, char** argv) +{ + sqlite3* DB; + int exit = 0; + exit = sqlite3_open("allDB.db" , &DB); + + if (exit) + { + std::cerr << "Error open DB" << sqlite3_errmsg(DB) << std::endl; + return(-1); + } + else + std::cout << "Open Database Successfully!!!!" << std::endl; + sqlite3_close(DB); + return(0); + + +}