diff --git a/resources/backing.fs b/resources/backing.fs deleted file mode 100644 index 23016a3..0000000 --- a/resources/backing.fs +++ /dev/null @@ -1,12 +0,0 @@ -#version 330 core -out vec4 FragColor; - -in vec2 TexCoords; - -uniform sampler2D screenTexture; - -void main() -{ - vec3 col = texture(screenTexture, TexCoords).rgb; - FragColor = vec4(col, 1.0); -} \ No newline at end of file diff --git a/resources/backing.vs b/resources/backing.vs deleted file mode 100644 index 2a6ddb5..0000000 --- a/resources/backing.vs +++ /dev/null @@ -1,11 +0,0 @@ -#version 330 core -layout (location = 0) in vec2 aPos; -layout (location = 1) in vec2 aTexCoords; - -out vec2 TexCoords; - -void main() -{ - TexCoords = aTexCoords; - gl_Position = vec4(aPos.x, aPos.y, 0.0, 1.0); -} diff --git a/resources/console_no_bg.fs b/resources/console_no_bg.fs deleted file mode 100644 index 728f0de..0000000 --- a/resources/console_no_bg.fs +++ /dev/null @@ -1,17 +0,0 @@ -#version 330 core -out vec4 FragColor; - -in vec3 ourColor; -in vec2 TexCoord; -in vec3 ourBackground; - -// texture sampler -uniform sampler2D texture1; - -void main() -{ - vec4 original = texture(texture1, TexCoord); - if (original.r < 0.1f || original.g < 0.1f || original.b < 0.1f) discard; - vec4 fg = original * vec4(ourColor, 1.f); - FragColor = fg; -} diff --git a/resources/console_no_bg.vs b/resources/console_no_bg.vs deleted file mode 100644 index ec9300b..0000000 --- a/resources/console_no_bg.vs +++ /dev/null @@ -1,17 +0,0 @@ -#version 330 core -layout (location = 0) in vec3 aPos; -layout (location = 1) in vec3 aColor; -layout (location = 2) in vec3 bColor; -layout (location = 3) in vec2 aTexCoord; - -out vec3 ourColor; -out vec3 ourBackground; -out vec2 TexCoord; - -void main() -{ - gl_Position = vec4(aPos, 1.0); - ourColor = aColor; - ourBackground = bColor; - TexCoord = vec2(aTexCoord.x, aTexCoord.y); -} \ No newline at end of file diff --git a/resources/console_with_bg.fs b/resources/console_with_bg.fs deleted file mode 100644 index 4b5418b..0000000 --- a/resources/console_with_bg.fs +++ /dev/null @@ -1,16 +0,0 @@ -#version 330 core -out vec4 FragColor; - -in vec3 ourColor; -in vec2 TexCoord; -in vec3 ourBackground; - -// texture sampler -uniform sampler2D texture1; - -void main() -{ - vec4 original = texture(texture1, TexCoord); - vec4 fg = original.r > 0.1f || original.g > 0.1f || original.b > 0.1f ? original * vec4(ourColor, 1.f) : vec4(ourBackground, 1.f); - FragColor = fg; -} diff --git a/resources/console_with_bg.vs b/resources/console_with_bg.vs deleted file mode 100644 index ec9300b..0000000 --- a/resources/console_with_bg.vs +++ /dev/null @@ -1,17 +0,0 @@ -#version 330 core -layout (location = 0) in vec3 aPos; -layout (location = 1) in vec3 aColor; -layout (location = 2) in vec3 bColor; -layout (location = 3) in vec2 aTexCoord; - -out vec3 ourColor; -out vec3 ourBackground; -out vec2 TexCoord; - -void main() -{ - gl_Position = vec4(aPos, 1.0); - ourColor = aColor; - ourBackground = bColor; - TexCoord = vec2(aTexCoord.x, aTexCoord.y); -} \ No newline at end of file diff --git a/resources/curses_14x16.png b/resources/curses14x16.png similarity index 100% rename from resources/curses_14x16.png rename to resources/curses14x16.png diff --git a/resources/example_tiles.jpg b/resources/example_tiles.jpg deleted file mode 100644 index ca8aecd..0000000 Binary files a/resources/example_tiles.jpg and /dev/null differ diff --git a/resources/example_tiles.xcf b/resources/example_tiles.xcf deleted file mode 100644 index e663f66..0000000 Binary files a/resources/example_tiles.xcf and /dev/null differ diff --git a/resources/mltest.xp b/resources/mltest.xp deleted file mode 100644 index 640adc7..0000000 Binary files a/resources/mltest.xp and /dev/null differ diff --git a/resources/nyan.xp b/resources/nyan.xp deleted file mode 100644 index f27c58d..0000000 Binary files a/resources/nyan.xp and /dev/null differ diff --git a/resources/scanlines.fs b/resources/scanlines.fs deleted file mode 100644 index 57b8795..0000000 --- a/resources/scanlines.fs +++ /dev/null @@ -1,26 +0,0 @@ -#version 330 core -out vec4 FragColor; - -in vec2 TexCoords; - -uniform sampler2D screenTexture; -uniform vec3 screenSize; -uniform bool screenBurn; - -void main() -{ - vec3 col = texture(screenTexture, TexCoords).rgb; - float scanLine = mod(gl_FragCoord.y, 2.0) * 0.25; - vec3 scanColor = col.rgb - scanLine; - - if (col.r < 0.1f && col.g < 0.1f && col.b < 0.1f) { - if (screenBurn) { - float dist = (1.0 - distance(vec2(gl_FragCoord.x / screenSize.x, gl_FragCoord.y / screenSize.y), vec2(0.5,0.5))) * 0.2; - FragColor = vec4(0.0, dist, dist, 1.0); - } else { - FragColor = vec4(0.0, 0.0, 0.0, 1.0); - } - } else { - FragColor = vec4(scanColor, 1.0); - } -} \ No newline at end of file diff --git a/resources/scanlines.vs b/resources/scanlines.vs deleted file mode 100644 index 2a6ddb5..0000000 --- a/resources/scanlines.vs +++ /dev/null @@ -1,11 +0,0 @@ -#version 330 core -layout (location = 0) in vec2 aPos; -layout (location = 1) in vec2 aTexCoords; - -out vec2 TexCoords; - -void main() -{ - TexCoords = aTexCoords; - gl_Position = vec4(aPos.x, aPos.y, 0.0, 1.0); -} diff --git a/src/main.rs b/src/main.rs index 42aa92e..fe2b458 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,12 +37,10 @@ mod particle_system; use particle_system::{ParticleBuilder, DEFAULT_PARTICLE_LIFETIME, LONG_PARTICLE_LIFETIME}; mod random_table; mod rex_assets; + #[macro_use] extern crate lazy_static; -// Embedded resources for use in wasm build -rltk::embedded_resource!(CURSES14X16, "../resources/curses_14x16.png"); - //Consts pub const SHOW_MAPGEN: bool = false; @@ -208,7 +206,12 @@ impl State { // Notify player, restore health up to a point. let player_entity = self.ecs.fetch::(); - gamelog::Logger::new().append("You descend the stairwell, and take a moment to gather your strength.").log(); + gamelog::Logger::new() + .append("Taking a short rest, you manage to") + .colour((0, 255, 0)) + .append("recover some of your strength") + .period() + .log(); let mut player_health_store = self.ecs.write_storage::(); let player_health = player_health_store.get_mut(*player_entity); if let Some(player_health) = player_health { @@ -482,15 +485,20 @@ const DISPLAYWIDTH: i32 = 100; const DISPLAYHEIGHT: i32 = 56; fn main() -> rltk::BError { - rltk::link_resource!(CURSES14X16, "../resources/curses_14x16.png"); + // Embedded resources for use in wasm build + const CURSES_14_16_BYTES: &[u8] = include_bytes!("../resources/curses14x16.png"); + rltk::embedding::EMBED.lock().add_resource("resources/curses14x16.png".to_string(), CURSES_14_16_BYTES); + + //rltk::link_resource!(CURSES14X16, "../resources/curses_14x16.png"); + use rltk::RltkBuilder; let context = RltkBuilder::new() .with_title("rust-rl") .with_dimensions(DISPLAYWIDTH, DISPLAYHEIGHT) .with_fps_cap(60.0) - .with_font("curses_14x16.png", 14, 16) + .with_font("curses14x16.png", 14, 16) .with_tile_dimensions(14, 16) - .with_fancy_console(DISPLAYWIDTH, DISPLAYHEIGHT, "curses_14x16.png") + .with_fancy_console(DISPLAYWIDTH, DISPLAYHEIGHT, "curses14x16.png") //.with_simple_console_no_bg(DISPLAYWIDTH, DISPLAYHEIGHT, "terminal8x8.jpg") .build()?; diff --git a/wasm/rust-llyrl.js b/wasm/rust-llyrl.js index 703dbb5..b357877 100644 --- a/wasm/rust-llyrl.js +++ b/wasm/rust-llyrl.js @@ -801,16 +801,16 @@ function __wbg_get_imports() { const ret = wasm.memory; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper718 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 155, __wbg_adapter_20); + imports.wbg.__wbindgen_closure_wrapper780 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 127, __wbg_adapter_20); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1688 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 359, __wbg_adapter_23); + imports.wbg.__wbindgen_closure_wrapper1798 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 375, __wbg_adapter_23); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1690 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 359, __wbg_adapter_23); + imports.wbg.__wbindgen_closure_wrapper1800 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 375, __wbg_adapter_23); return addHeapObject(ret); }; diff --git a/wasm/rust-llyrl_bg.wasm b/wasm/rust-llyrl_bg.wasm index 3151c41..1b4508f 100644 Binary files a/wasm/rust-llyrl_bg.wasm and b/wasm/rust-llyrl_bg.wasm differ