0
0
mirror of https://github.com/Nimac0/SDL_Minigame synced 2026-01-12 15:53:42 +00:00

Removed all assets* from Engine

This commit is contained in:
Benedikt Galbavy 2024-11-05 17:44:39 +01:00
parent 0179a27aaf
commit 7c82ee5beb
45 changed files with 6 additions and 174 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,106 +0,0 @@
{ "frames": [
{
"filename": "MapNew.aseprite",
"frame": { "x": 0, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
},
{
"filename": "MapNew.aseprite",
"frame": { "x": 32, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
},
{
"filename": "MapNew.aseprite",
"frame": { "x": 64, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
},
{
"filename": "MapNew.aseprite",
"frame": { "x": 96, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
},
{
"filename": "MapNew.aseprite",
"frame": { "x": 128, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
},
{
"filename": "MapNew.aseprite",
"frame": { "x": 160, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
},
{
"filename": "MapNew.aseprite",
"frame": { "x": 192, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
},
{
"filename": "MapNew.aseprite",
"frame": { "x": 224, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
},
{
"filename": "MapNew.aseprite",
"frame": { "x": 256, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
},
{
"filename": "MapNew.aseprite",
"frame": { "x": 288, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
}
],
"meta": {
"app": "https://www.aseprite.org/",
"version": "1.3.2-x64",
"format": "RGBA8888",
"size": { "w": 320, "h": 32 },
"scale": "1",
"frameTags": [
],
"layers": [
],
"slices": [
]
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

View File

@ -1,20 +0,0 @@
3,3,3,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,3,3,3
3,3,3,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,2,3,3
3,3,3,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,2,2,2,3
3,3,3,2,3,3,3,3,2,3,7,1,1,1,9,3,3,3,3,3,3,3,2,2,3
3,3,2,2,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,3,3,3
3,3,2,2,2,3,3,3,3,3,7,1,1,1,9,3,3,2,3,3,3,3,3,3,3
3,3,2,2,2,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,3,3,3
3,3,3,2,2,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,3,3,3
3,3,3,3,2,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,3,3,3
3,3,3,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,3,3,3
3,3,3,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,3,3,3
3,3,3,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,2,3,3,3,3
3,3,3,2,2,3,3,3,3,3,7,1,1,1,9,3,3,3,3,2,2,3,3,3,3
3,3,3,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,2,2,2,3,3,3
3,3,3,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,2,2,3,3,3,3
3,3,3,3,3,3,3,2,3,3,7,1,1,1,9,3,2,3,3,2,3,3,3,3,3
3,3,3,3,3,3,3,3,3,3,7,1,1,1,9,3,2,3,3,3,3,3,3,3,3
2,2,3,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,3,3,3
3,2,2,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,3,3,3
3,3,3,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,3,3,3

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 571 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 913 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 847 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 877 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 943 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1011 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 914 B

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -5,6 +5,7 @@
#include "CollisionHandler.h" #include "CollisionHandler.h"
#include "AssetManager.h" #include "AssetManager.h"
#include "RenderManager.h" #include "RenderManager.h"
#include "SDL_mixer.h"
#include "SoundManager.h" #include "SoundManager.h"
#include "TileComponent.h" #include "TileComponent.h"
#include "Direction.h" #include "Direction.h"
@ -62,11 +63,11 @@ void GameInternal::init(const char* title, int xpos, int ypos, int width, int he
return; return;
} }
SDL_Surface* icon = SDL_LoadBMP("assets/iconImage.bmp"); // bad
if(!icon) SDL_Surface* icon;
if((icon = SDL_LoadBMP("assets/iconImage.bmp")))
{ {
std::cout << "ERROR: Couldn't create icon!" << std::endl; SDL_SetWindowIcon(window, icon);
return;
} }
SDL_SetWindowIcon(window, icon); SDL_SetWindowIcon(window, icon);
@ -80,12 +81,6 @@ void GameInternal::init(const char* title, int xpos, int ypos, int width, int he
} }
SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255); SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
SDL_Texture* backgroundTexture = GameInternal::textureManager->loadTexture("assets/startscreen.png");
SDL_RenderClear(renderer);
SDL_RenderCopy(renderer, backgroundTexture, NULL, NULL);
SDL_RenderPresent(renderer);
if (Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 2048) < 0) if (Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 2048) < 0)
{ {
std::cout << "ERROR: Mixer couldnt be initialized! " << SDL_GetError() << std::endl; std::cout << "ERROR: Mixer couldnt be initialized! " << SDL_GetError() << std::endl;
@ -96,43 +91,6 @@ void GameInternal::init(const char* title, int xpos, int ypos, int width, int he
Mix_Volume(-1, MIX_MAX_VOLUME); Mix_Volume(-1, MIX_MAX_VOLUME);
Mix_AllocateChannels(16); Mix_AllocateChannels(16);
//SDL_Event event;
bool hasQuit = false;
while (!hasQuit)
{
SDL_PollEvent(&event);
if (event.type == SDL_QUIT)
{
hasQuit = true;
break;
}
if (event.type == SDL_KEYDOWN)
{
if (event.key.keysym.scancode == SDL_SCANCODE_RETURN)
{
std::cout << "Enter pressed > Game start..." << std::endl;
break;
}
if (event.key.keysym.scancode == SDL_SCANCODE_ESCAPE)
{
std::cout << "Escape pressed > Game quit..." << std::endl;
hasQuit = true;
}
}
}
if (hasQuit)
{
this->setRunning(false);
return;
}
if (this->isRunning() == false) return;
map = new Map(); map = new Map();
// loading sounds // loading sounds

View File

@ -61,6 +61,6 @@ void Map::addTile(unsigned long id, int x, int y, GameInternal* game, const std:
auto& tile(game->manager.addEntity()); auto& tile(game->manager.addEntity());
tile.addComponent<TileComponent>(x, y, TILE_SIZE, TILE_SIZE, id, textureDict); tile.addComponent<TileComponent>(x, y, TILE_SIZE, TILE_SIZE, id, textureDict);
if(tile.getComponent<TileComponent>().hasCollision()) tile.addComponent<ColliderComponent>(tile.getComponent<TileComponent>().getName().data()); if(tile.getComponent<TileComponent>().hasCollision()) tile.addComponent<ColliderComponent>("tile"/*tile.getComponent<TileComponent>().getName().data()*/);
tile.addGroup((size_t)Entity::GroupLabel::MAPTILES); tile.addGroup((size_t)Entity::GroupLabel::MAPTILES);
} }