tetris: use background from installed path #466

pull/469/head
nick black 4 years ago
parent 69b716f7f8
commit 33e4341a67

@ -19,7 +19,11 @@ void DrawBackground(const std::string& s) { // drawn to the standard plane
}
void DrawBoard() { // draw all fixed components of the game
DrawBackground(BackgroundFile);
try{
DrawBackground(BackgroundFile);
}catch(TetrisNotcursesErr& e){
stdplane_->printf(1, 1, "couldn't load %s", BackgroundFile.c_str());
}
int y, x;
stdplane_->get_dim(&y, &x);
board_top_y_ = y - (BOARD_HEIGHT + 2);

@ -8,7 +8,7 @@
#include <ncpp/NotCurses.hh>
#include "version.h"
const std::string BackgroundFile = "../data/tetris-background.jpeg";
const std::string BackgroundFile = NOTCURSES_SHARE "/tetris-background.jpeg";
using namespace std::chrono_literals;

Loading…
Cancel
Save