[gnome-games] game-cube: Replace GameCubeGame by GenericGame
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] game-cube: Replace GameCubeGame by GenericGame
- Date: Fri, 25 Mar 2016 06:45:23 +0000 (UTC)
commit 09342687507871fda16b856e89e7e5b1a9c3de1a
Author: Adrien Plazas <kekun plazas laposte net>
Date: Wed Mar 23 09:12:07 2016 +0100
game-cube: Replace GameCubeGame by GenericGame
plugins/game-cube/src/Makefile.am | 1 -
plugins/game-cube/src/game-cube-game.vala | 46 ---------------------------
plugins/game-cube/src/game-cube-plugin.vala | 12 ++++++-
3 files changed, 11 insertions(+), 48 deletions(-)
---
diff --git a/plugins/game-cube/src/Makefile.am b/plugins/game-cube/src/Makefile.am
index 4b2af19..d576a5a 100644
--- a/plugins/game-cube/src/Makefile.am
+++ b/plugins/game-cube/src/Makefile.am
@@ -6,7 +6,6 @@ libgames_game_cube_plugin_la_DEPENDENCIES = \
$(NULL)
libgames_game_cube_plugin_la_SOURCES = \
- game-cube-game.vala \
game-cube-header.vala \
game-cube-plugin.vala \
game-cube-uid.vala \
diff --git a/plugins/game-cube/src/game-cube-plugin.vala b/plugins/game-cube/src/game-cube-plugin.vala
index ddfdb46..d9e41ff 100644
--- a/plugins/game-cube/src/game-cube-plugin.vala
+++ b/plugins/game-cube/src/game-cube-plugin.vala
@@ -2,6 +2,7 @@
private class Games.GameCubePlugin : Object, Plugin {
private const string MIME_TYPE = "application/x-gamecube-rom";
+ private const string MODULE_BASENAME = "libretro-game-cube.so";
public GameSource get_game_source () throws Error {
var query = new MimeTypeTrackerQuery (MIME_TYPE, game_for_uri);
@@ -13,7 +14,16 @@ private class Games.GameCubePlugin : Object, Plugin {
}
private static Game game_for_uri (string uri) throws Error {
- return new GameCubeGame (uri);
+ var file = File.new_for_uri (uri);
+ var header = new GameCubeHeader (file);
+ header.check_validity ();
+
+ var uid = new GameCubeUid (header);
+ var title = new FilenameTitle (uri);
+ var cover = new DummyCover ();
+ var runner = new RetroRunner (MODULE_BASENAME, uri, uid);
+
+ return new GenericGame (title, cover, runner);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]