[gnome-games/wip/exalm/rebrand: 94/124] mame: Move into the app




commit 8d27e275974995a8675e5f9603a2ba7eb7f3615f
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue Mar 30 17:44:24 2021 +0500

    mame: Move into the app

 meson_options.txt                                  |  2 --
 plugins/mame/data/mame.plugin                      |  6 -----
 plugins/mame/data/meson.build                      |  1 -
 plugins/mame/meson.build                           |  2 --
 plugins/mame/src/mame-plugin.vala                  | 26 ----------------------
 plugins/mame/src/mame.gresource.xml                |  6 -----
 plugins/mame/src/meson.build                       | 25 ---------------------
 plugins/meson.build                                |  1 -
 src/meson.build                                    |  4 ++++
 src/org.gnome.Games.gresource.xml                  |  2 ++
 .../src => src/platforms/mame}/mame-error.vala     |  0
 .../src => src/platforms/mame}/mame-game-info.vala |  2 +-
 .../src => src/platforms/mame}/mame-parser.vala    |  0
 .../src => src/platforms/mame}/supported-games     |  0
 src/platforms/platform-register.vala               | 10 +++++++++
 .../mame-extract-supported-games.sh                |  0
 16 files changed, 17 insertions(+), 70 deletions(-)
---
diff --git a/meson_options.txt b/meson_options.txt
index 5352290b..b35029f8 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -10,8 +10,6 @@ option (
 
 # Plugins
 # This must mirror the list in plugins/meson.build
-option ('libretro-plugin',      description: 'Support for Libretro games',      type: 'boolean')
-option ('mame-plugin',          description: 'Support for MAME games',          type: 'boolean')
 option ('ms-dos-plugin',        description: 'Support for MS-DOS games',        type: 'boolean')
 option ('nintendo-3ds-plugin',  description: 'Support for Nintendo 3DS games',  type: 'boolean')
 option ('nintendo-64-plugin',   description: 'Support for Nintendo 64 games',   type: 'boolean')
diff --git a/plugins/meson.build b/plugins/meson.build
index 072e8461..bd7e1404 100644
--- a/plugins/meson.build
+++ b/plugins/meson.build
@@ -1,5 +1,4 @@
 plugins = [
-  'mame',
   'ms-dos',
   'nintendo-3ds',
   'nintendo-64',
diff --git a/src/meson.build b/src/meson.build
index e245833c..12aaf2cb 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -89,6 +89,10 @@ vala_sources = [
   'platforms/game-cube/game-cube-parser.vala',
   'platforms/game-cube/game-cube-runner.vala',
 
+  'platforms/mame/mame-error.vala',
+  'platforms/mame/mame-game-info.vala',
+  'platforms/mame/mame-parser.vala',
+
   'platforms/platform.vala',
   'platforms/platform-model.vala',
   'platforms/platform-register.vala',
diff --git a/src/org.gnome.Games.gresource.xml b/src/org.gnome.Games.gresource.xml
index 08af0ae0..c988a61f 100644
--- a/src/org.gnome.Games.gresource.xml
+++ b/src/org.gnome.Games.gresource.xml
@@ -27,6 +27,8 @@
 
     <file>platforms/game-cube/game-settings/GZ2.ini</file>
 
+    <file>platforms/mame/supported-games</file>
+
     <file preprocess="xml-stripblanks">preferences/preferences-page-controllers.ui</file>
     <file preprocess="xml-stripblanks">preferences/preferences-page-platforms.ui</file>
     <file preprocess="xml-stripblanks">preferences/preferences-page-video.ui</file>
diff --git a/plugins/mame/src/mame-error.vala b/src/platforms/mame/mame-error.vala
similarity index 100%
rename from plugins/mame/src/mame-error.vala
rename to src/platforms/mame/mame-error.vala
diff --git a/plugins/mame/src/mame-game-info.vala b/src/platforms/mame/mame-game-info.vala
similarity index 85%
rename from plugins/mame/src/mame-game-info.vala
rename to src/platforms/mame/mame-game-info.vala
index 967fb949..97b0724a 100644
--- a/plugins/mame/src/mame-game-info.vala
+++ b/src/platforms/mame/mame-game-info.vala
@@ -9,7 +9,7 @@ private class Games.MameGameInfo {
 
                supported_games = new HashTable<string, string> (str_hash, str_equal);
 
-               var bytes = resources_lookup_data ("/org/gnome/Games/plugins/mame/supported-games", 
ResourceLookupFlags.NONE);
+               var bytes = resources_lookup_data ("/org/gnome/Games/platforms/mame/supported-games", 
ResourceLookupFlags.NONE);
                var text = (string) bytes.get_data ();
 
                var lines = text.split ("\n");
diff --git a/plugins/mame/src/mame-parser.vala b/src/platforms/mame/mame-parser.vala
similarity index 100%
rename from plugins/mame/src/mame-parser.vala
rename to src/platforms/mame/mame-parser.vala
diff --git a/plugins/mame/src/supported-games b/src/platforms/mame/supported-games
similarity index 100%
rename from plugins/mame/src/supported-games
rename to src/platforms/mame/supported-games
diff --git a/src/platforms/platform-register.vala b/src/platforms/platform-register.vala
index 62b17c3d..fcc1eb66 100644
--- a/src/platforms/platform-register.vala
+++ b/src/platforms/platform-register.vala
@@ -144,6 +144,16 @@ private class Games.PlatformRegister : Object {
                );
                add_platform (platform);
 
+               platform = new Platform.with_mime_types (
+                       "MAME",
+                       _("Arcade"),
+                       { "application/zip" },
+                       "application/x-mame-rom",
+                       "mame"
+               );
+               platform.parser_type = typeof (MameParser);
+               add_platform (platform);
+
                platform = new Platform (
                        "MasterSystem",
                        /* translators: also known as "Sega Mark III" in eastern Asia */
diff --git a/plugins/mame/tools/extract-suported-games.sh b/tools/mame-extract-supported-games.sh
similarity index 100%
rename from plugins/mame/tools/extract-suported-games.sh
rename to tools/mame-extract-supported-games.sh


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