Gigoteur / UnicornConsole

Unicorn Console: create quick fantasy game in Rust/Python/Lua/Rhai/Wasm !
MIT License
908 stars 47 forks source link

Add runtime dynamic resolution selection #42

Closed johnbatty closed 7 years ago

johnbatty commented 7 years ago

Currently the screen resolution configurable, but is defined at compile time.

I think it would be interesting to allow it to be configured at runtime - i.e. switch between different modes. In particular, it would be nice to be able to use a higher resolution mode when editing code (in some future version that includes a text editor!) than when running the game.

What do you think?

hallucino commented 7 years ago

Yes I agree !

johnbatty commented 7 years ago

I quite like the idea of having "modes" that set the resolution, palette and font to that of a specific computer/console, e.g. mode("pico-8"), mode("spectrum"), etc...

hallucino commented 7 years ago

Yes I think it can be very good to have such features !

hallucino commented 7 years ago

Have you some news about this part ?

johnbatty commented 7 years ago

I have been working on this! Nearly there... just very busy with other things at the moment :-(

johnbatty commented 7 years ago

From a build earlier this evening... :-)

➜ cargo build --features="cpython lua" --release
   Compiling px8 v0.0.4 (file:///Users/john/Documents/PX8)
warning: constant item is never used: `SCREEN_WIDTH`
 --> /Users/john/Documents/PX8/target/release/build/px8-0b9199a5bb0d82c4/out/parameters.rs:1:1
  |
1 | pub const SCREEN_WIDTH: usize = 128;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: #[warn(dead_code)] on by default

warning: constant item is never used: `SCREEN_HEIGHT`
 --> /Users/john/Documents/PX8/target/release/build/px8-0b9199a5bb0d82c4/out/parameters.rs:2:1
  |
2 | pub const SCREEN_HEIGHT: usize = 128;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: #[warn(dead_code)] on by default

    Finished release [optimized] target(s) in 52.69 secs
hallucino commented 7 years ago

👍

hallucino commented 7 years ago

Seems ok I think ? I found only bugs with the menu after the modification but otherwise it seems to work perfectly !

johnbatty commented 7 years ago

Yep, I think we can close!