[gnome-games/wip/exalm/rebrand: 92/124] dreamcast: Move into the app




commit fe78868b1432e2a161cd7442d6107b909404c713
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue Mar 30 17:32:16 2021 +0500

    dreamcast: Move into the app

 meson_options.txt                                  |  1 -
 plugins/dreamcast/data/dreamcast.plugin            |  6 -----
 plugins/dreamcast/data/meson.build                 |  1 -
 plugins/dreamcast/meson.build                      |  2 --
 plugins/dreamcast/src/dreamcast-plugin.vala        | 27 ----------------------
 plugins/dreamcast/src/meson.build                  | 20 ----------------
 plugins/meson.build                                |  1 -
 src/meson.build                                    |  5 ++++
 .../platforms/dreamcast}/dreamcast-error.vala      |  0
 .../platforms/dreamcast}/dreamcast-header.vala     |  0
 .../platforms/dreamcast}/dreamcast-parser.vala     |  5 ++--
 .../src => src/platforms/dreamcast}/gdi.vala       |  0
 src/platforms/platform-register.vala               | 10 ++++++++
 13 files changed, 17 insertions(+), 61 deletions(-)
---
diff --git a/meson_options.txt b/meson_options.txt
index 2e7916f3..ba683ad4 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -10,7 +10,6 @@ option (
 
 # Plugins
 # This must mirror the list in plugins/meson.build
-option ('dreamcast-plugin',     description: 'Support for Dreamcast games',     type: 'boolean')
 option ('game-cube-plugin',     description: 'Support for GameCube games',      type: 'boolean')
 option ('libretro-plugin',      description: 'Support for Libretro games',      type: 'boolean')
 option ('mame-plugin',          description: 'Support for MAME games',          type: 'boolean')
diff --git a/plugins/meson.build b/plugins/meson.build
index f5806035..beac15dc 100644
--- a/plugins/meson.build
+++ b/plugins/meson.build
@@ -1,5 +1,4 @@
 plugins = [
-  'dreamcast',
   'game-cube',
   'mame',
   'ms-dos',
diff --git a/src/meson.build b/src/meson.build
index 4964aa65..655e7529 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -80,6 +80,11 @@ vala_sources = [
   'keyboard/keyboard-mapping-manager.vala',
   'keyboard/keyboard-tester.vala',
 
+  'platforms/dreamcast/dreamcast-error.vala',
+  'platforms/dreamcast/dreamcast-header.vala',
+  'platforms/dreamcast/dreamcast-parser.vala',
+  'platforms/dreamcast/gdi.vala',
+
   'platforms/platform.vala',
   'platforms/platform-model.vala',
   'platforms/platform-register.vala',
diff --git a/plugins/dreamcast/src/dreamcast-error.vala b/src/platforms/dreamcast/dreamcast-error.vala
similarity index 100%
rename from plugins/dreamcast/src/dreamcast-error.vala
rename to src/platforms/dreamcast/dreamcast-error.vala
diff --git a/plugins/dreamcast/src/dreamcast-header.vala b/src/platforms/dreamcast/dreamcast-header.vala
similarity index 100%
rename from plugins/dreamcast/src/dreamcast-header.vala
rename to src/platforms/dreamcast/dreamcast-header.vala
diff --git a/plugins/dreamcast/src/dreamcast-parser.vala b/src/platforms/dreamcast/dreamcast-parser.vala
similarity index 89%
rename from plugins/dreamcast/src/dreamcast-parser.vala
rename to src/platforms/dreamcast/dreamcast-parser.vala
index cd162c7b..0d24b562 100644
--- a/plugins/dreamcast/src/dreamcast-parser.vala
+++ b/src/platforms/dreamcast/dreamcast-parser.vala
@@ -3,7 +3,6 @@
 public class Games.DreamcastParser : GameParser {
        private const string GDI_MIME_TYPE = "application/x-gd-rom-cue";
        private const string CDI_MIME_TYPE = "application/x-discjuggler-cd-image";
-       private const string DREAMCAST_MIME_TYPE = "application/x-dreamcast-rom";
 
        private string uid;
 
@@ -11,7 +10,7 @@ public class Games.DreamcastParser : GameParser {
                base (platform, uri);
        }
 
-       private static File get_binary_file (Gdi gdi) throws Error {
+       private File get_binary_file (Gdi gdi) throws Error {
                if (gdi.tracks_number == 0)
                        throw new DreamcastError.INVALID_GDI ("The file “%s” doesn’t have a track.", 
gdi.file.get_uri ());
 
@@ -19,7 +18,7 @@ public class Games.DreamcastParser : GameParser {
                var file = track.file;
 
                var file_info = file.query_info ("*", FileQueryInfoFlags.NONE);
-               if (file_info.get_content_type () != DREAMCAST_MIME_TYPE)
+               if (file_info.get_content_type () != platform.get_presentation_mime_type ())
                        throw new DreamcastError.INVALID_FILE_TYPE ("The file “%s” doesn’t have a valid 
Dreamcast binary file.", gdi.file.get_uri ());
 
                return file;
diff --git a/plugins/dreamcast/src/gdi.vala b/src/platforms/dreamcast/gdi.vala
similarity index 100%
rename from plugins/dreamcast/src/gdi.vala
rename to src/platforms/dreamcast/gdi.vala
diff --git a/src/platforms/platform-register.vala b/src/platforms/platform-register.vala
index f4e505f8..dc8aceb1 100644
--- a/src/platforms/platform-register.vala
+++ b/src/platforms/platform-register.vala
@@ -82,6 +82,16 @@ private class Games.PlatformRegister : Object {
                );
                add_platform (platform);
 
+               platform = new Platform.with_mime_types (
+                       "Dreamcast",
+                       _("Dreamcast"),
+                       { "application/x-gd-rom-cue", "application/x-discjuggler-cd-image" },
+                       "application/x-dreamcast-rom",
+                       "dreamcast"
+               );
+               platform.parser_type = typeof (DreamcastParser);
+               add_platform (platform);
+
                platform = new Platform (
                        "FamicomDiskSystem",
                        /* translators: only released in eastern Asia */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]