[gnome-games] doom: Replace DoomGame by GenericGame



commit 02200d8f290a7b9ae7992cf9810ab7c92a9d29c4
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Wed Mar 23 09:01:32 2016 +0100

    doom: Replace DoomGame by GenericGame

 plugins/doom/src/Makefile.am      |    1 -
 plugins/doom/src/doom-game.vala   |   43 -------------------------------------
 plugins/doom/src/doom-plugin.vala |    9 +++++++-
 3 files changed, 8 insertions(+), 45 deletions(-)
---
diff --git a/plugins/doom/src/Makefile.am b/plugins/doom/src/Makefile.am
index e5adbf0..2fda129 100644
--- a/plugins/doom/src/Makefile.am
+++ b/plugins/doom/src/Makefile.am
@@ -6,7 +6,6 @@ libgames_doom_plugin_la_DEPENDENCIES = \
        $(NULL)
 
 libgames_doom_plugin_la_SOURCES = \
-       doom-game.vala \
        doom-plugin.vala \
        $(NULL)
 
diff --git a/plugins/doom/src/doom-plugin.vala b/plugins/doom/src/doom-plugin.vala
index 4cb70e5..f0aa2ac 100644
--- a/plugins/doom/src/doom-plugin.vala
+++ b/plugins/doom/src/doom-plugin.vala
@@ -1,7 +1,9 @@
 // This file is part of GNOME Games. License: GPLv3
 
 private class Games.DoomPlugin : Object, Plugin {
+       private const string FINGERPRINT_PREFIX = "doom";
        private const string MIME_TYPE = "application/x-doom-wad";
+       private const string MODULE_BASENAME = "libretro-doom.so";
 
        public GameSource get_game_source () throws Error {
                var query = new MimeTypeTrackerQuery (MIME_TYPE, game_for_uri);
@@ -13,7 +15,12 @@ private class Games.DoomPlugin : Object, Plugin {
        }
 
        private static Game game_for_uri (string uri) throws Error {
-               return new DoomGame (uri);
+               var uid = new FingerprintUid (uri, FINGERPRINT_PREFIX);
+               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]