diff --git a/src/tetris/background.h b/src/tetris/background.h index c1bddf674..b9bdfc42d 100644 --- a/src/tetris/background.h +++ b/src/tetris/background.h @@ -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); diff --git a/src/tetris/main.cpp b/src/tetris/main.cpp index ef6cd2c74..4920b1e88 100644 --- a/src/tetris/main.cpp +++ b/src/tetris/main.cpp @@ -8,7 +8,7 @@ #include #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;