directories needed: * build - for cmake output * deps - stuff needed to compile McRogueface (headers) libtcod -> ../modules/libtcod/src/libtcod sfml -> ../modules/SFML/include/SFML python -> ../modules/cpython/Include * lib - stuff needed to link McRogueFace (shared objects); also required at runtime libtcod -> `../modules/libtcod/buildsys/autotools/.libs/libtcod.so.1.0.24` sfml -> `../modules/SFML/build/lib/*` python -> `../modules/cpython/libpython3.12.so`; standard lib at ../modules/cpython/build/lib.linux-x86_64-3.12 & ../modules/cpython/Lib You can get dependencies by: - Build from source (i.e. all submodules) - Go download them from each project's website - install packages from your distro and symlink them to deps/lib directories
24 lines
863 B
C++
24 lines
863 B
C++
#include "IndexSprite.h"
|
|
#include "GameEngine.h"
|
|
|
|
//int texture_index, sprite_index, x, y;
|
|
|
|
GameEngine* IndexSprite::game;
|
|
|
|
sf::Sprite IndexSprite::drawable()
|
|
{
|
|
sf::Sprite s;
|
|
auto& tex = IndexSprite::game->textures[texture_index];
|
|
s.setTexture(tex.texture);
|
|
s.setScale(sf::Vector2f(scale, scale));
|
|
s.setPosition(sf::Vector2f(x, y));
|
|
//std::cout << "Drawable position: " << x << ", " << y << " -> " << s.getPosition().x << ", " << s.getPosition().y << std::endl;
|
|
s.setTextureRect(tex.spriteCoordinates(sprite_index));
|
|
return s;
|
|
}
|
|
|
|
IndexSprite::IndexSprite(int _ti, int _si, float _x, float _y, float _s):
|
|
texture_index(_ti), sprite_index(_si), x(_x), y(_y), scale(_s) {
|
|
//std::cout << "IndexSprite constructed with x, y " << _x << ", " << _y << std::endl;
|
|
//std::cout << " * Stored x, y " << x << ", " << y << std::endl;
|
|
}
|