Skip to content

Commit

Permalink
Undisguise gwg
Browse files Browse the repository at this point in the history
  • Loading branch information
ozkriff committed Mar 27, 2020
1 parent 0f98990 commit b20bbe3
Show file tree
Hide file tree
Showing 30 changed files with 81 additions and 81 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ zcomponents = { path = "zcomponents" }
rand = { version = "0.7", features = [] }
nalgebra = { version = "0.18", features = ["mint"] } # TODO: update (or replace with cgmath)
qrand = { git = "https://github.com/not-fl3/quad-rand", package = "quad-rand", features = ['rand'] }
ggez = { git = "https://github.com/not-fl3/good-web-game", package = "good-web-game" }
gwg = { git = "https://github.com/not-fl3/good-web-game", package = "good-web-game" }

[dev-dependencies]
pretty_assertions = "0.6"
4 changes: 2 additions & 2 deletions ggwp-zgui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ authors = ["Andrey Lesnikov <[email protected]>"]
edition = "2018"
license = "MIT/Apache-2.0"
description = "Tiny and opionated GUI library"
keywords = ["ggez", "gamedev", "gui"]
keywords = ["gamedev", "gui"]

[dependencies]
log = "0.4"
nalgebra = { version = "0.18", features = ["mint"] }
ggez = { git = "https://github.com/not-fl3/good-web-game", package = "good-web-game" }
gwg = { git = "https://github.com/not-fl3/good-web-game", package = "good-web-game" }
8 changes: 4 additions & 4 deletions ggwp-zgui/examples/absolute_coordinates.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use ggez::{
use ggwp_zgui as ui;
use gwg::{
conf, event,
graphics::{self, Font, Rect, Text},
Context, GameResult,
};
use ggwp_zgui as ui;
use nalgebra::Point2;

#[derive(Clone, Copy, Debug)]
Expand Down Expand Up @@ -94,8 +94,8 @@ impl event::EventHandler for State {
}
}

fn main() -> ggez::GameResult {
ggez::start(
fn main() -> gwg::GameResult {
gwg::start(
conf::Conf {
physical_root_dir: Some("resources".into()),
..Default::default()
Expand Down
10 changes: 5 additions & 5 deletions ggwp-zgui/examples/layers_layout.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use ggez::{
use ggwp_zgui as ui;
use gwg::{
conf, event,
graphics::{self, Font, Image, Text},
Context, GameResult,
};
use ggwp_zgui as ui;
use nalgebra::Point2;

#[derive(Clone, Copy, Debug)]
Expand Down Expand Up @@ -58,7 +58,7 @@ impl event::EventHandler for State {
fn mouse_button_up_event(
&mut self,
context: &mut Context,
_: ggez::event::MouseButton,
_: gwg::event::MouseButton,
x: f32,
y: f32,
) {
Expand All @@ -73,8 +73,8 @@ impl event::EventHandler for State {
}
}

fn main() -> ggez::GameResult {
ggez::start(
fn main() -> gwg::GameResult {
gwg::start(
conf::Conf {
physical_root_dir: Some("resources".into()),
..Default::default()
Expand Down
10 changes: 5 additions & 5 deletions ggwp-zgui/examples/nested.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use ggez::{
use ggwp_zgui as ui;
use gwg::{
conf, event,
graphics::{self, Font, Image, Rect, Text},
Context, GameResult,
};
use ggwp_zgui as ui;
use nalgebra::Point2;

#[derive(Clone, Copy, Debug)]
Expand Down Expand Up @@ -120,7 +120,7 @@ impl event::EventHandler for State {
fn mouse_button_up_event(
&mut self,
context: &mut Context,
_: ggez::event::MouseButton,
_: gwg::event::MouseButton,
x: f32,
y: f32,
) {
Expand All @@ -131,8 +131,8 @@ impl event::EventHandler for State {
}
}

fn main() -> ggez::GameResult {
ggez::start(
fn main() -> gwg::GameResult {
gwg::start(
conf::Conf {
physical_root_dir: Some("resources".into()),
..Default::default()
Expand Down
8 changes: 4 additions & 4 deletions ggwp-zgui/examples/pixel_coordinates.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use ggez::{
use ggwp_zgui as ui;
use gwg::{
conf, event,
graphics::{self, Font, Text},
Context, GameResult,
};
use ggwp_zgui as ui;
use nalgebra::Point2;

#[derive(Clone, Copy, Debug)]
Expand Down Expand Up @@ -94,8 +94,8 @@ impl event::EventHandler for State {
}
}

fn main() -> ggez::GameResult {
ggez::start(
fn main() -> gwg::GameResult {
gwg::start(
conf::Conf {
physical_root_dir: Some("resources".into()),
..Default::default()
Expand Down
10 changes: 5 additions & 5 deletions ggwp-zgui/examples/remove.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use ggez::{
use ggwp_zgui as ui;
use gwg::{
conf, event,
graphics::{self, Font, Image, Text},
Context, GameResult,
};
use ggwp_zgui as ui;
use nalgebra::Point2;

#[derive(Clone, Copy, Debug)]
Expand Down Expand Up @@ -82,7 +82,7 @@ impl event::EventHandler for State {
fn mouse_button_up_event(
&mut self,
context: &mut Context,
_: ggez::event::MouseButton,
_: gwg::event::MouseButton,
x: f32,
y: f32,
) {
Expand All @@ -100,8 +100,8 @@ impl event::EventHandler for State {
}
}

fn main() -> ggez::GameResult {
ggez::start(
fn main() -> gwg::GameResult {
gwg::start(
conf::Conf {
physical_root_dir: Some("resources".into()),
..Default::default()
Expand Down
8 changes: 4 additions & 4 deletions ggwp-zgui/examples/text_button.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use ggez::{
use ggwp_zgui as ui;
use gwg::{
conf, event,
graphics::{self, Font, Text},
Context, GameResult,
};
use ggwp_zgui as ui;
use nalgebra::Point2;

#[derive(Clone, Copy, Debug)]
Expand Down Expand Up @@ -68,8 +68,8 @@ impl event::EventHandler for State {
}
}

fn main() -> ggez::GameResult {
ggez::start(
fn main() -> gwg::GameResult {
gwg::start(
conf::Conf {
physical_root_dir: Some("resources".into()),
..Default::default()
Expand Down
10 changes: 5 additions & 5 deletions ggwp-zgui/examples/vertical_layout.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use ggez::{
use ggwp_zgui as ui;
use gwg::{
conf, event,
graphics::{self, Font, Text},
Context, GameResult,
};
use ggwp_zgui as ui;
use nalgebra::Point2;

#[derive(Clone, Copy, Debug)]
Expand Down Expand Up @@ -63,7 +63,7 @@ impl event::EventHandler for State {
fn mouse_button_up_event(
&mut self,
context: &mut Context,
_: ggez::event::MouseButton,
_: gwg::event::MouseButton,
x: f32,
y: f32,
) {
Expand All @@ -74,8 +74,8 @@ impl event::EventHandler for State {
}
}

fn main() -> ggez::GameResult {
ggez::start(
fn main() -> gwg::GameResult {
gwg::start(
conf::Conf {
physical_root_dir: Some("resources".into()),
..Default::default()
Expand Down
12 changes: 6 additions & 6 deletions ggwp-zgui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::{
sync::mpsc::{channel, Receiver, Sender},
};

use ggez::{
use gwg::{
graphics::{self, Color, Drawable, Rect},
Context, GameResult,
};
Expand Down Expand Up @@ -39,11 +39,11 @@ pub fn pack<W: Widget + 'static>(widget: W) -> RcWidget {
mod error {
use std::{error::Error as StdError, fmt};

use ggez::GameError;
use gwg::GameError;

#[derive(Debug)]
pub enum Error {
GgezError(GameError),
GwgError(GameError),
BadBorderCoefficient,
BadContentCoefficient,
NoDimensions,
Expand All @@ -52,7 +52,7 @@ mod error {
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
Error::GgezError(ref e) => write!(f, "GGEZ Error: {}", e),
Error::GwgError(ref e) => write!(f, "gwg Error: {}", e),
Error::BadBorderCoefficient => write!(f, "Border size is too large"),
Error::BadContentCoefficient => write!(f, "Content size is too large"),
Error::NoDimensions => write!(f, "The drawable has no dimensions"),
Expand All @@ -63,7 +63,7 @@ mod error {
impl StdError for Error {
fn source(&self) -> Option<&(dyn StdError + 'static)> {
match *self {
Error::GgezError(ref e) => Some(e),
Error::GwgError(ref e) => Some(e),
Error::BadBorderCoefficient
| Error::BadContentCoefficient
| Error::NoDimensions => None,
Expand All @@ -73,7 +73,7 @@ mod error {

impl From<GameError> for Error {
fn from(e: GameError) -> Self {
Error::GgezError(e)
Error::GwgError(e)
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions ggwp-zscene/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ version = "0.1.0"
authors = ["Andrey Lesnikov <[email protected]>"]
edition = "2018"
license = "MIT/Apache-2.0"
description = "Scene and Actions for GGEZ"
keywords = ["ggez", "gamedev", "2D"]
description = "Scene and Actions for gwg"
keywords = ["gamedev", "2D"]

[dependencies]
nalgebra = { version = "0.18", features = ["mint"] }
ggez = { git = "https://github.com/not-fl3/good-web-game", package = "good-web-game" }
gwg = { git = "https://github.com/not-fl3/good-web-game", package = "good-web-game" }
10 changes: 5 additions & 5 deletions ggwp-zscene/examples/action.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use std::time::Duration;

use ggez::{
use ggwp_zscene::{self as zscene, action, Boxed, Layer, Scene, Sprite};
use gwg::{
conf, event,
graphics::{self, Font, Rect, Text},
Context, GameResult,
};
use ggwp_zscene::{self as zscene, action, Boxed, Layer, Scene, Sprite};
use nalgebra::{Point2, Vector2};

#[derive(Debug, Clone, Default)]
Expand Down Expand Up @@ -94,7 +94,7 @@ impl State {

impl event::EventHandler for State {
fn update(&mut self, context: &mut Context) -> GameResult {
let dtime = ggez::timer::delta(context);
let dtime = gwg::timer::delta(context);
self.scene.tick(dtime);
Ok(())
}
Expand All @@ -110,8 +110,8 @@ impl event::EventHandler for State {
}
}

fn main() -> ggez::GameResult {
ggez::start(
fn main() -> gwg::GameResult {
gwg::start(
conf::Conf {
physical_root_dir: Some("resources".into()),
..Default::default()
Expand Down
2 changes: 1 addition & 1 deletion ggwp-zscene/src/action/change_color_to.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::time::Duration;

use ggez::{graphics::Color, timer};
use gwg::{graphics::Color, timer};

use crate::{Action, Sprite};

Expand Down
2 changes: 1 addition & 1 deletion ggwp-zscene/src/action/move_by.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::time::Duration;

use ggez::timer;
use gwg::timer;
use nalgebra::Vector2;

use crate::{Action, Sprite};
Expand Down
2 changes: 1 addition & 1 deletion ggwp-zscene/src/action/set_color.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use ggez::graphics::Color;
use gwg::graphics::Color;

use crate::{Action, Sprite};

Expand Down
12 changes: 6 additions & 6 deletions ggwp-zscene/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ use std::{error, fmt};

#[derive(Debug)]
pub enum Error {
GgezError(ggez::GameError),
GwgError(gwg::GameError),
NoDimensions,
}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::GgezError(ref e) => write!(f, "GGEZ Error: {}", e),
Error::GwgError(ref e) => write!(f, "gwg Error: {}", e),
Error::NoDimensions => write!(f, "The drawable has no dimensions"),
}
}
Expand All @@ -18,14 +18,14 @@ impl fmt::Display for Error {
impl error::Error for Error {
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
match self {
Error::GgezError(ref e) => Some(e),
Error::GwgError(ref e) => Some(e),
Error::NoDimensions => None,
}
}
}

impl From<ggez::GameError> for Error {
fn from(e: ggez::GameError) -> Self {
Error::GgezError(e)
impl From<gwg::GameError> for Error {
fn from(e: gwg::GameError) -> Self {
Error::GwgError(e)
}
}
2 changes: 1 addition & 1 deletion ggwp-zscene/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{cell::RefCell, rc::Rc, time::Duration};

use ggez::{Context, GameResult};
use gwg::{Context, GameResult};

// TODO: z-order? (https://github.com/ozkriff/zemeroth/issues/319)

Expand Down
2 changes: 1 addition & 1 deletion ggwp-zscene/src/sprite.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{cell::RefCell, collections::HashMap, fmt, hash::Hash, path::Path, rc::Rc};

use ggez::{
use gwg::{
graphics::{self, Drawable, Rect},
Context, GameResult,
};
Expand Down
Loading

0 comments on commit b20bbe3

Please sign in to comment.