Skip to content

Commit 8298726

Browse files
committed
prepared for 0.5.0 release;
removed debug message from filesystem;
1 parent dd7313e commit 8298726

File tree

7 files changed

+33
-26
lines changed

7 files changed

+33
-26
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# 0.5.0
2+
3+
## Added
4+
5+
* added `filesystem::load_file_async` to allow for file loading on WASM as well
6+
7+
## Changed
8+
9+
* updated `miniquad` to 0.3.0-alpha.38 (highest version currently compatible with the docker build script and without
10+
an icon bug on windows)
11+
* changed `offset` behavior and added default error type to `EventHandler` to match `ggez` 0.7.0
12+
* made `filesystem::open` check the cache first and then only load files whenever they're not present in the cache
13+
* `filesystem::open` now internally uses `miniquad::fs::load_file`, allowing to load files on Android now as well
14+
* ```cargo
15+
[package.metadata.android]
16+
assets = "<your ressource folder>/"
17+
```
18+
can be used in your `Cargo.toml` file to specify which folder to include in the apk as the assets folder
19+
120
# 0.4.2
221
322
* added a dependency on `twox_hash 1.5.0` to coerce semver into using a `rand < 0.8` in order to avoid `getrandom`, so

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "good-web-game"
3-
version = "0.4.2"
3+
version = "0.5.0"
44
authors = ["not-fl3 <[email protected]>", "PSteinhaus"]
55
license = "MIT"
66
edition = "2021"
@@ -26,7 +26,7 @@ mint = "0.5"
2626
cgmath = { version = "0.17", features = ["mint"] }
2727
twox-hash = "=1.5.0" # necessary to force a version of rand < 0.8 to avoid getrandom
2828
glyph_brush = "0.7"
29-
miniquad = "0.3.0-alpha.45"
29+
miniquad = "=0.3.0-alpha.38"
3030
image = { version = "0.22", default-features = false, features = ["png_codec"] }
3131
serde = "1"
3232
serde_derive = "1"

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99

1010
good-web-game is a wasm32-unknown-unknown implementation of a [ggez](https://github.com/ggez/ggez) subset on top of [miniquad](https://github.com/not-fl3/miniquad/). Originally built to run [Zemeroth](https://github.com/ozkriff/zemeroth) on the web.
1111

12-
It has been recently updated to support much of the ggez 0.6.1 API. If you're already working with ggez you might use this library to port your game to the web (or even mobile).
12+
It currently supports most of the ggez 0.7.0 API. If you're already working with ggez you might use this library to port your game to the web (or even mobile).
1313
Since it also runs well on desktop it also offers an alternative implementation of ggez, which might always come in handy.
1414

15-
If you are just looking for a well supported minimal high-level engine on top of miniquad you might want to take a look at [macroquad](https://github.com/not-fl3/macroquad/).
15+
If you are just looking for a well supported, more serious, minimal high-level engine on top of miniquad you might want to take a look at [macroquad](https://github.com/not-fl3/macroquad/).
1616

1717
## Supported Platforms
1818

@@ -22,22 +22,23 @@ The idea behind good-web-game is to offer a way to easily port ggez games to the
2222
<img width="90%" src="about/supported_platforms.svg">
2323
</p>
2424

25-
Note that we don't give any guarantees for iOS / macOS support, as we currently simply don't have Macs lying around to test it on. It _should_ work just fine though.
25+
Note that we don't give any guarantees for iOS / macOS support, as we currently simply don't have Macs lying around to test it on. In theory, it _should_ work though.
2626

2727
## Status
2828

29-
"good-web-game" implements most of the ggez 0.6.1 API.
29+
"good-web-game" implements most of the ggez 0.7.0 API.
3030

3131
### Differences
3232

3333
* boilerplate code differs slightly, [as shown here](https://github.com/PSteinhaus/PSteinhaus.github.io/tree/main/ggez/web-examples#ggez-animation-example)
34-
* audio API differs slightly due to use of `quad-snd` instead of `rodio` for easy portability
34+
* audio API differs somewhat due to use of `quad-snd` instead of `rodio` for easy portability
3535
* if you want to run on the web, shaders have to be written in GLSL100, due to support for WebGL1
3636
* API for creation of shaders and their corresponding uniform structs differs slightly, but the workflow remains the same, see [the `shader` example](examples/shader.rs)
3737

3838
### Missing / Not available:
3939

40-
* ggez (and therefore good-web-game) loads files in a blocking fashion, which doesn't work on Wasm (and is also currently not supported on mobile)
40+
* ggez (and therefore good-web-game) usually loads files in a blocking fashion, which doesn't work on WASM
41+
* loading files asynchronously is possible through [`load_file_async`](https://docs.rs/good-web-game/0.5.0/good_web_game/filesystem/fn.load_file_async.html) everywhere though
4142
* filesystem with writing access (if you need it take a look at [`quad-storage`](https://github.com/optozorax/quad-storage))
4243
* writing your own event loop (doesn't make much sense on callback-only platforms like HTML5)
4344
* spatial audio (overall audio support is still relatively limited)
@@ -59,13 +60,13 @@ You can also check out [astroblasto running on the web](https://psteinhaus.githu
5960

6061
To build and run an example as a native binary:
6162

62-
```rust
63+
```
6364
cargo run --example astroblasto
6465
```
6566

6667
### WebAssembly
6768

68-
```rust
69+
```
6970
rustup target add wasm32-unknown-unknown
7071
cargo build --example astroblasto --target wasm32-unknown-unknown
7172
```

examples/astroblasto.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use ggez::timer;
1616
use ggez::{audio, graphics};
1717
use ggez::{Context, GameResult};
1818
use std::f32::consts::PI;
19-
use std::{env, path};
2019

2120
type Point2 = glam::Vec2;
2221
type Vector2 = glam::Vec2;

src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl From<lyon::lyon_tessellation::geometry_builder::GeometryBuilderError> for G
8989

9090
impl From<zip::result::ZipError> for GameError {
9191
fn from(e: zip::result::ZipError) -> GameError {
92-
let errstr = format!("Zip error: {}", e.to_string());
92+
let errstr = format!("Zip error: {}", e);
9393
GameError::ResourceLoadError(errstr)
9494
}
9595
}

src/filesystem.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ pub struct Filesystem {
2626
}
2727

2828
impl Filesystem {
29+
#[allow(clippy::redundant_closure)]
2930
pub(crate) fn new(conf: &Conf) -> Filesystem {
3031
let mut files = HashMap::new();
3132

@@ -129,8 +130,6 @@ impl Filesystem {
129130
path
130131
};
131132

132-
println!("loading with path {}", &path);
133-
134133
let buf = load_file_inner(&path)?;
135134
let bytes = io::Cursor::new(buf);
136135
Ok(File { bytes })

src/graphics/text.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -131,25 +131,14 @@ where
131131

132132
/// Cached font metrics that we can keep attached to a `Text`
133133
/// so we don't have to keep recalculating them.
134-
#[derive(Clone, Debug)]
134+
#[derive(Clone, Debug, Default)]
135135
struct CachedMetrics {
136136
string: Option<String>,
137137
width: Option<f32>,
138138
height: Option<f32>,
139139
glyph_positions: Vec<mint::Point2<f32>>,
140140
}
141141

142-
impl Default for CachedMetrics {
143-
fn default() -> CachedMetrics {
144-
CachedMetrics {
145-
string: None,
146-
width: None,
147-
height: None,
148-
glyph_positions: Vec::new(),
149-
}
150-
}
151-
}
152-
153142
/// Drawable text object. Essentially a list of [`TextFragment`](struct.TextFragment.html)'s
154143
/// and some cached size information.
155144
///

0 commit comments

Comments
 (0)