diff --git a/run b/run index d93f68f..bb7bb94 100755 --- a/run +++ b/run @@ -17,7 +17,7 @@ then run_target=$2 fi -run_command="./build-$build_configuration/src/$run_target ${3:-}" +run_command="./build-$build_configuration/src/$run_target ${@:3}" if [ $build_configuration = "mingw" ]; then if [ ! -d "build-$build_configuration" ]; then diff --git a/run_it b/run_it new file mode 100755 index 0000000..4d98016 --- /dev/null +++ b/run_it @@ -0,0 +1,3 @@ +#!/bin/bash +./run Release client 1280 1024 & +osascript set_position.scpt diff --git a/set_position.scpt b/set_position.scpt new file mode 100644 index 0000000..53612d7 Binary files /dev/null and b/set_position.scpt differ diff --git a/src/client/client.cpp b/src/client/client.cpp index a5045db..6aa6c61 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -91,6 +91,8 @@ namespace games { scale = Scale::load_from_file(*current_scale); // simulation + sim.bounds.xmax = window_width_; + sim.bounds.ymax = window_height_; beat.notes.emplace_back(note_type::kQuarterNote, note_info{100.0f, 100.0f}); cheap_line_type line{{{50.0f, 100.0f}, {150.0f, 200.0f}, simulation::kOneWay}}; add_line(line); diff --git a/src/client_main.cpp b/src/client_main.cpp index ae93804..9840b81 100644 --- a/src/client_main.cpp +++ b/src/client_main.cpp @@ -8,11 +8,15 @@ typedef games::Client Game; constexpr char Game::bundle_name[]; motor::Bundle const bundle(Game::bundle_name); -int main(int __unused argc, __unused char** argv){ - const bool fullscreen = false; +int main(int argc, char** argv){ + if(argc != 3) { + CERR << "too few arguments\n"; + exit(1); + } - const int window_width = 800; - const int window_height = 600; + const bool fullscreen = true; + const int window_width = atoi(argv[1]); + const int window_height = atoi(argv[2]); GenericMain m(fullscreen, window_width, window_height); m.main(); diff --git a/src/generic_main.hpp b/src/generic_main.hpp index 48c3277..69d7de5 100644 --- a/src/generic_main.hpp +++ b/src/generic_main.hpp @@ -39,7 +39,7 @@ private: SDL_Surface * screen = nullptr; if(fullscreen){ - screen = SDL_SetVideoMode(0, 0, 32, SDL_OPENGL | SDL_FULLSCREEN); + screen = SDL_SetVideoMode(wanted_resolution_width, wanted_resolution_height, 32, SDL_OPENGL | SDL_NOFRAME); } else { screen = SDL_SetVideoMode(wanted_resolution_width, wanted_resolution_height, 32, SDL_OPENGL); }