diff --git a/README.md b/README.md
index f86aea6..fb72323 100644
--- a/README.md
+++ b/README.md
@@ -132,26 +132,7 @@ The archive from Humble Bundle contains the necessary `data` folder, in the same
WiiWare
-Tools required:
-* [ShowMiiWads](https://github.com/WiiDatabase/showmiiwads-mod/releases/tag/v1.5.2)
-* [QuickBMS](http://aluigi.altervista.org/papers/quickbms.zip)
-* A full version WiiWare `.wad` ([Extraction guide](https://wii.guide/dump-wads.html))
-* This `script.bms`:
-```
-get name FILENAME
-get zsize asize
-comtype lz77wii
-clog name 0 zsize zsize
-```
-
-1. Run ShowMiiWads and open the folder containing your `.wad`.
-2. Right click the `.wad` and hit `Extract` > `To Folder` and choose an output folder.
-3. Now go to `Tools` > `Unpack u8 Archive`, find your and select `00000002.app` and choose an output folder.
-4. Run QuickBMS with the following command, changing each path to where `script.bms` and `.app` output are located
- ```
- quickbms.exe -D script_path\script.bms input_path\00000002_app_OUT\data output_path\data
- ```
-5. Verify `output_path\data` folder contains valid [Cave Story assets](https://user-images.githubusercontent.com/53099651/159585593-43fead24-b041-48f4-8332-be50d712310d.png)
+Extract the `.wad` in order to get valid [Cave Story assets](https://user-images.githubusercontent.com/53099651/159585593-43fead24-b041-48f4-8332-be50d712310d.png)
@@ -164,19 +145,7 @@ Interchanging the save files may result in spawning in wrong locations, softlock
Nintendo Switch
-(Only 1.2+ has been tested, earlier versions may not work properly due to lack of 2P/Original Graphics support.)
-
-Your interest is only in `data` directory placed in romfs.
-
-Requires a hackable/modchipped console. If you got your Switch early, it's likely that it's hackable so give it a shot -
-just be very careful to not get your console banned. There's tons of guides you can easily find online so we won't cover
-it there.
-
-You can dump the ROM (or just dump the romfs directly but it's just a bit slow so we recommend doing it on PC instead)
-using [nxdumptool](https://github.com/DarkMatterCore/nxdumptool).
-
-Once you got the keys and ROM dumped you can use the romfs extraction feature in Ryujinx or yuzu emulators to grab the
-data files.
+Extract the `data` folder directly from the ROM.
@@ -185,8 +154,6 @@ data files.
Same controls as the default for freeware and Cave Story+ keyboard.
To change, edit `doukutsu-rs\data\settings.json` within your user directory.
-
-Default Controls
| | P1 | P2 |
|--------------|-----------|-----------|
@@ -198,16 +165,9 @@ To change, edit `doukutsu-rs\data\settings.json` within your user directory.
| Map | `W` | `Y` |
| Strafe | `LShift` | `RShift` |
-
-
-
- Extra Features
-
- `Alt + Enter` - Toggle Fullscreen
- `F2` (While paused) - Quick Restart
-- `F3 - F12` - Debug keys
-
-
+
#### Screenshots
diff --git a/src/components/map_system.rs b/src/components/map_system.rs
index 6cb3e5f..4b0ace4 100644
--- a/src/components/map_system.rs
+++ b/src/components/map_system.rs
@@ -5,6 +5,7 @@ use crate::framework::backend::{BackendTexture, SpriteBatchCommand};
use crate::framework::context::Context;
use crate::framework::error::GameResult;
use crate::graphics;
+use crate::input::touch_controls::TouchControlType;
use crate::player::Player;
use crate::scripting::tsc::text_script::TextScriptExecutionState;
use crate::shared_game_state::{Language, SharedGameState};
@@ -87,8 +88,11 @@ impl MapSystem {
stage: &Stage,
players: [&Player; 2],
) -> GameResult {
+ let touch_rect = Rect::new_size(0, 0, state.canvas_size.0 as isize, state.canvas_size.1 as isize);
+
if state.textscript_vm.state == TextScriptExecutionState::MapSystem {
if self.state == MapSystemState::Hidden {
+ state.touch_controls.control_type = TouchControlType::None;
state.control_flags.set_control_enabled(false);
self.state = MapSystemState::FadeInBox(0);
}
@@ -139,7 +143,10 @@ impl MapSystem {
}
for player in &players {
- if player.controller.trigger_jump() || player.controller.trigger_shoot() {
+ if player.controller.trigger_jump()
+ || player.controller.trigger_shoot()
+ || state.touch_controls.consume_click_in(touch_rect)
+ {
self.state = MapSystemState::FadeOutBox(8);
break;
}
@@ -147,7 +154,10 @@ impl MapSystem {
}
MapSystemState::Visible => {
for player in &players {
- if player.controller.trigger_jump() || player.controller.trigger_shoot() {
+ if player.controller.trigger_jump()
+ || player.controller.trigger_shoot()
+ || state.touch_controls.consume_click_in(touch_rect)
+ {
self.state = MapSystemState::FadeOutBox(8);
break;
}
diff --git a/src/framework/backend_sdl2.rs b/src/framework/backend_sdl2.rs
index 3b8daa3..f291b8e 100644
--- a/src/framework/backend_sdl2.rs
+++ b/src/framework/backend_sdl2.rs
@@ -29,10 +29,10 @@ use crate::framework::graphics::BlendMode;
use crate::framework::keyboard::ScanCode;
use crate::framework::render_opengl::{GLContext, OpenGLRenderer};
use crate::framework::ui::init_imgui;
+use crate::graphics::VSyncMode;
use crate::Game;
use crate::GameError::RenderError;
use crate::GAME_SUSPENDED;
-use crate::graphics::VSyncMode;
pub struct SDL2Backend {
context: Sdl,
@@ -256,6 +256,7 @@ impl BackendEventLoop for SDL2EventLoop {
Event::KeyDown { scancode: Some(scancode), repeat, keymod, .. } => {
if let Some(drs_scan) = conv_scancode(scancode) {
if !repeat {
+ #[cfg(debug_assertions)]
state.process_debug_keys(drs_scan);
if keymod.intersects(keyboard::Mod::RALTMOD | keyboard::Mod::LALTMOD)
@@ -365,7 +366,8 @@ impl BackendEventLoop for SDL2EventLoop {
*user_data = Rc::into_raw(refs) as *mut c_void;
}
- let gl_context = GLContext { gles2_mode: false, is_sdl: true, get_proc_address, swap_buffers, user_data, ctx };
+ let gl_context =
+ GLContext { gles2_mode: false, is_sdl: true, get_proc_address, swap_buffers, user_data, ctx };
return Ok(Box::new(OpenGLRenderer::new(gl_context, UnsafeCell::new(imgui))));
} else {
diff --git a/src/input/touch_player_controller.rs b/src/input/touch_player_controller.rs
index 08687a2..f84d4a6 100644
--- a/src/input/touch_player_controller.rs
+++ b/src/input/touch_player_controller.rs
@@ -26,12 +26,12 @@ bitfield! {
pub right, set_right: 1;
pub up, set_up: 2;
pub down, set_down: 3;
- pub map, set_map: 4;
+ pub map, _: 4;
pub inventory, set_inventory: 5;
pub jump, set_jump: 6;
pub shoot, set_shoot: 7;
- pub next_weapon, set_next_weapon: 8;
- pub prev_weapon, set_prev_weapon: 9;
+ pub next_weapon, _: 8;
+ pub prev_weapon, _: 9;
pub pause, set_pause: 10;
}
diff --git a/src/lib.rs b/src/lib.rs
index 2daaa83..299af27 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -51,8 +51,6 @@ mod map;
mod menu;
mod mod_list;
mod mod_requirements;
-#[cfg(feature = "netplay")]
-mod netplay;
mod npc;
mod physics;
mod player;
diff --git a/src/menu/mod.rs b/src/menu/mod.rs
index 1103d14..cff3a3b 100644
--- a/src/menu/mod.rs
+++ b/src/menu/mod.rs
@@ -13,6 +13,7 @@ pub mod pause_menu;
pub mod save_select_menu;
pub mod settings_menu;
+#[allow(dead_code)]
#[derive(Clone)]
pub enum MenuEntry {
Hidden,
diff --git a/src/mod_requirements.rs b/src/mod_requirements.rs
index 161c07e..c9ce424 100644
--- a/src/mod_requirements.rs
+++ b/src/mod_requirements.rs
@@ -29,7 +29,7 @@ impl ModRequirements {
Ok(ModRequirements::default())
}
- fn upgrade(mut self) -> Self {
+ fn upgrade(self) -> Self {
self
}
diff --git a/src/netplay/mod.rs b/src/netplay/mod.rs
deleted file mode 100644
index d2d360b..0000000
--- a/src/netplay/mod.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-pub mod packets;
-pub mod server;
-pub mod server_config;
diff --git a/src/netplay/packets.rs b/src/netplay/packets.rs
deleted file mode 100644
index 763b7cb..0000000
--- a/src/netplay/packets.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-#[derive(serde::Serialize, serde::Deserialize)]
-#[serde(tag = "i")]
-pub enum DRSPacket {
- #[serde(rename = "\x01")]
- Ping(u16),
- #[serde(rename = "\x02")]
- Pong(u16),
-}
diff --git a/src/netplay/server.rs b/src/netplay/server.rs
deleted file mode 100644
index 2381947..0000000
--- a/src/netplay/server.rs
+++ /dev/null
@@ -1,34 +0,0 @@
-use tokio::net::UdpSocket;
-use crate::framework::error::GameResult;
-use crate::netplay::server_config::ServerConfiguration;
-
-pub struct Server {
-}
-
-impl Server {
- pub fn start(config: ServerConfiguration) -> GameResult {
- let context = ServerContext::new(config);
-
-
- Ok(Server {
-
- })
- }
-}
-
-struct ServerContext {
- config: ServerConfiguration,
-}
-
-impl ServerContext {
- pub fn new(config: ServerConfiguration) -> ServerContext {
- ServerContext {
- config
- }
- }
-
- pub async fn run(self) {
- let socket = UdpSocket::bind(&self.config.bind_to).await.unwrap();
-
- }
-}
diff --git a/src/netplay/server_config.rs b/src/netplay/server_config.rs
deleted file mode 100644
index e7aee16..0000000
--- a/src/netplay/server_config.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-#[derive(serde::Serialize, serde::Deserialize)]
-pub struct ServerConfiguration {
- #[serde(default = "default_bind")]
- pub bind_to: String,
-}
-
-// 'RS' = 0x5253 = 21075
-fn default_bind() -> String {
- "0.0.0.0:21075".to_string()
-}
diff --git a/src/player/mod.rs b/src/player/mod.rs
index cfde63e..000ac0f 100644
--- a/src/player/mod.rs
+++ b/src/player/mod.rs
@@ -20,7 +20,6 @@ use crate::rng::RNG;
use crate::shared_game_state::SharedGameState;
mod player_hit;
-pub mod player_list;
pub mod skin;
#[derive(Debug, Clone, Copy, PartialEq, Eq, FromPrimitive)]
diff --git a/src/player/skin/mod.rs b/src/player/skin/mod.rs
index 2dae8f6..73e019b 100644
--- a/src/player/skin/mod.rs
+++ b/src/player/skin/mod.rs
@@ -10,7 +10,7 @@ bitfield! {
pub struct PlayerSkinFlags(u16);
impl Debug;
- pub supports_color, set_supports_color: 0;
+ pub supports_color, _: 0;
}
#[derive(Clone, Copy, PartialEq, Eq)]
diff --git a/src/shared_game_state.rs b/src/shared_game_state.rs
index d81616b..4e80359 100644
--- a/src/shared_game_state.rs
+++ b/src/shared_game_state.rs
@@ -284,6 +284,7 @@ impl SharedGameState {
constants.load_locales(ctx)?;
+ #[cfg(not(target_os = "android"))]
if filesystem::exists(ctx, "/base/lighting.tbl") {
info!("Cave Story+ (Switch) data files detected.");
ctx.size_hint = (854, 480);