Project imported into KDevelop

This commit is contained in:
2021-01-29 22:20:54 -05:00
parent e89d9c577f
commit 618bda931e
9 changed files with 16 additions and 262 deletions

View File

@ -21,9 +21,6 @@
#include "../ui/UIText.h"
#include "../ui/UINineSlice.h"
#include "../cjson/cJSON.h"
#include "../fsm/GameManager.h"
#include "../fsm/GameManagerState.h"
// #include "../fsm/ConcreteGMStates.h"
Map* map;
Manager manager;
@ -103,14 +100,14 @@ void Game::init(const char *title, int width, int height, bool fullscreen, int g
assets->AddTexture("textBox", "assets/textures/ui/ui-element-tombstone.png");
assets->AddTexture("tree","assets/textures/objects/tree.png");
assets->AddTexture("jewel","assets/textures/objects/jewel.png");
assets->AddTexture("3","assets/textures/ui/day-night-icon.png");
assets->AddTexture("daynighticon","assets/textures/ui/day-night-icon.png");
assets->AddTexture("robber","assets/textures/actors/robberrodent.png");
assets->AddMusicTrack("simonZ","assets/audio/music/sailing16.ogg");
assets->AddSoundClip("bwoop","assets/audio/sfx/bwoop.wav");
map = new Map("terrain",globalScale,16);
const char* myText = "Graveyard Shift";
const char* myText = "Beagle Rescue";
text = new UIText(myText, "font", 0, 0, 8, 12, globalScale);
text->ParseString(myText, 12, 22, globalScale);
SDL_Rect myDestRect = SDL_Rect();
@ -163,18 +160,6 @@ void Game::init(const char *title, int width, int height, bool fullscreen, int g
enemy.addComponent<SpriteComponent>("robber", SpriteComponent::spriteAnimation, "assets/textures/actors/robberrodent.json");
enemy.addGroup(groupEnemies);
printf("Starting up GameManager\n");
GameManager gamemgr = GameManager();
gamemgr.toggle();
gamemgr.toggle();
gamemgr.toggle();
gamemgr.toggle();
gamemgr.toggle();
gamemgr.toggle();
gamemgr.toggle();
// gamemgr.setState(GameManager::setState(GameManagerState::enter(&PauseScreen)));
printf("GameManager Demo Completed.\n");
} else {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't Initialize SDL: %s", SDL_GetError());
isRunning = false;
@ -214,10 +199,9 @@ void Game::update()
if (Mix_PlayingMusic() == 0)
{
// std::cout << "Play Music Now" << std::endl;
// Mix_PlayMusic(assets->GetMusicTrack("simonZ"), -1);
Mix_PlayMusic(assets->GetMusicTrack("simonZ"), -1);
}
manager.refresh();
manager.update();
@ -292,12 +276,12 @@ void Game::render()
{
letter->draw();
}
Vector2D origPt;
Vector2D destPt;
origPt.Zero();
destPt.x = 320.0*gScale;
destPt.y = 240.0*gScale;
drawLine(origPt,destPt,255,0,0);
// Vector2D origPt;
// Vector2D destPt;
// origPt.Zero();
// destPt.x = 320.0*gScale;
// destPt.y = 240.0*gScale;
// drawLine(origPt,destPt,255,0,0);
SDL_RenderPresent(renderer);
}
@ -317,8 +301,8 @@ void Game::printDebug(char* debugInfo)
printf("\n");
}
void Game::drawLine(Vector2D srcpt, Vector2D destpt, int red, int green, int blue)
{
SDL_SetRenderDrawColor(renderer, red, green, blue, 255);
SDL_RenderDrawLine(renderer, srcpt.x, srcpt.y, destpt.x, destpt.y);
}
// void Game::drawLine(Vector2D srcpt, Vector2D destpt, int red, int green, int blue)
// {
// SDL_SetRenderDrawColor(renderer, red, green, blue, 255);
// SDL_RenderDrawLine(renderer, srcpt.x, srcpt.y, destpt.x, destpt.y);
// }

View File

@ -29,7 +29,7 @@ public:
void render();
void clean();
void printDebug(char* debugInfo);
void drawLine(Vector2D srcpt, Vector2D destpt, int red, int green, int blue);
// void drawLine(Vector2D srcpt, Vector2D destpt, int red, int green, int blue);
bool running() { return isRunning; }
// static void AddTile(int srcX, int srcY, int xpos, int ypos);
static SDL_Renderer *renderer;