You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.3KB

  1. #[derive(Debug)]
  2. pub struct Config {
  3. pub render_texture_width: i32, // the texture that the game is rendered onto
  4. pub render_texture_height: i32,
  5. pub canvas_width: i32, // the canvas that the rendertexture is rendered onto
  6. pub canvas_height: i32,
  7. // the size of the tileset texture
  8. pub tileset_texture_width: i32,
  9. pub tileset_texture_height: i32,
  10. // the number of sprites in the tileset
  11. pub tileset_num_sprites_x: i32,
  12. pub tileset_num_sprites_y: i32,
  13. pub menu_volume: i32,
  14. pub menu_max_volume: i32,
  15. pub menu_curvature: i32,
  16. pub menu_max_curvature: i32,
  17. }
  18. // todo: remove default trait since the calling code (e.g. wasm crate's BridgeConfig)
  19. // should set all relevent values for config
  20. impl Config {
  21. pub fn new() -> Config {
  22. Default::default()
  23. }
  24. }
  25. impl Default for Config {
  26. fn default() -> Config {
  27. Config {
  28. render_texture_width: 512,
  29. render_texture_height: 512,
  30. canvas_width: 512,
  31. canvas_height: 512,
  32. tileset_texture_width: 0,
  33. tileset_texture_height: 0,
  34. tileset_num_sprites_x: 13,
  35. tileset_num_sprites_y: 8,
  36. menu_volume: 4,
  37. menu_max_volume: 5,
  38. menu_curvature: 0,
  39. menu_max_curvature: 5,
  40. }
  41. }
  42. }