@@ -23,3 +23,4 @@ add_subdirectory(core.mod) | |||
add_executable(swan src/main.cc) | |||
target_link_libraries(swan libswan sfml-graphics sfml-system sfml-window dl) | |||
file(COPY assets DESTINATION .) |
@@ -38,7 +38,7 @@ void Mod::registerAsset(const std::string &name, Asset *asset) { | |||
asset->name_ = name_ + "::" + name; | |||
if (!asset->load(path_)) { | |||
fprintf(stderr, "Asset %s: Failed to load image %s", name.c_str(), (path_ + "/" + asset->path_).c_str()); | |||
fprintf(stderr, "Asset %s: Failed to load image '%s'", name.c_str(), (path_ + "/" + asset->path_).c_str()); | |||
abort(); | |||
} | |||
@@ -1,6 +1,7 @@ | |||
#include <vector> | |||
#include <time.h> | |||
#include <unistd.h> | |||
#include <stdio.h> | |||
#include <swan/common.h> | |||
#include <swan/World.h> | |||
@@ -10,8 +11,15 @@ | |||
using namespace Swan; | |||
int main() { | |||
sf::Image icon; | |||
if (!icon.loadFromFile("assets/icon.png")) { | |||
fprintf(stderr, "Failed to load image 'icon.png'\n"); | |||
abort(); | |||
} | |||
sf::RenderWindow window(sf::VideoMode(800, 600), "good gaem"); | |||
window.setVerticalSyncEnabled(true); | |||
window.setIcon(icon.getSize().x, icon.getSize().y, icon.getPixelsPtr()); | |||
Win win(&window); | |||
Game::initGlobal(); |