Skip to content

Commit 754bde6

Browse files
committed
Merge pull request scummvm#232 from fingolfin/refactor-plugins
Refactor plugins
2 parents a1618c2 + c638730 commit 754bde6

File tree

6 files changed

+155
-150
lines changed

6 files changed

+155
-150
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ EXECUTABLE := $(EXEPRE)scummvm$(EXEEXT)
7575
include $(srcdir)/Makefile.common
7676

7777
# check if configure has been run or has been changed since last run
78-
config.h config.mk: $(srcdir)/configure
78+
config.h config.mk: $(srcdir)/configure $(srcdir)/engines/configure.engines
7979
ifeq "$(findstring config.mk,$(MAKEFILE_LIST))" "config.mk"
8080
@echo "Running $(srcdir)/configure with the last specified parameters"
8181
@sleep 2

base/plugins.cpp

Lines changed: 1 addition & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -85,108 +85,7 @@ class StaticPluginProvider : public PluginProvider {
8585
// Iterate over all registered (static) plugins and load them.
8686

8787
// Engine plugins
88-
#if PLUGIN_ENABLED_STATIC(SCUMM)
89-
LINK_PLUGIN(SCUMM)
90-
#endif
91-
#if PLUGIN_ENABLED_STATIC(AGI)
92-
LINK_PLUGIN(AGI)
93-
#endif
94-
#if PLUGIN_ENABLED_STATIC(AGOS)
95-
LINK_PLUGIN(AGOS)
96-
#endif
97-
#if PLUGIN_ENABLED_STATIC(CGE)
98-
LINK_PLUGIN(CGE)
99-
#endif
100-
#if PLUGIN_ENABLED_STATIC(CINE)
101-
LINK_PLUGIN(CINE)
102-
#endif
103-
#if PLUGIN_ENABLED_STATIC(COMPOSER)
104-
LINK_PLUGIN(COMPOSER)
105-
#endif
106-
#if PLUGIN_ENABLED_STATIC(CRUISE)
107-
LINK_PLUGIN(CRUISE)
108-
#endif
109-
#if PLUGIN_ENABLED_STATIC(DRACI)
110-
LINK_PLUGIN(DRACI)
111-
#endif
112-
#if PLUGIN_ENABLED_STATIC(DRASCULA)
113-
LINK_PLUGIN(DRASCULA)
114-
#endif
115-
#if PLUGIN_ENABLED_STATIC(DREAMWEB)
116-
LINK_PLUGIN(DREAMWEB)
117-
#endif
118-
#if PLUGIN_ENABLED_STATIC(GOB)
119-
LINK_PLUGIN(GOB)
120-
#endif
121-
#if PLUGIN_ENABLED_STATIC(GROOVIE)
122-
LINK_PLUGIN(GROOVIE)
123-
#endif
124-
#if PLUGIN_ENABLED_STATIC(HUGO)
125-
LINK_PLUGIN(HUGO)
126-
#endif
127-
#if PLUGIN_ENABLED_STATIC(KYRA)
128-
LINK_PLUGIN(KYRA)
129-
#endif
130-
#if PLUGIN_ENABLED_STATIC(LASTEXPRESS)
131-
LINK_PLUGIN(LASTEXPRESS)
132-
#endif
133-
#if PLUGIN_ENABLED_STATIC(LURE)
134-
LINK_PLUGIN(LURE)
135-
#endif
136-
#if PLUGIN_ENABLED_STATIC(MADE)
137-
LINK_PLUGIN(MADE)
138-
#endif
139-
#if PLUGIN_ENABLED_STATIC(MOHAWK)
140-
LINK_PLUGIN(MOHAWK)
141-
#endif
142-
#if PLUGIN_ENABLED_STATIC(PARALLACTION)
143-
LINK_PLUGIN(PARALLACTION)
144-
#endif
145-
#if PLUGIN_ENABLED_STATIC(QUEEN)
146-
LINK_PLUGIN(QUEEN)
147-
#endif
148-
#if PLUGIN_ENABLED_STATIC(SAGA)
149-
LINK_PLUGIN(SAGA)
150-
#endif
151-
#if PLUGIN_ENABLED_STATIC(SCI)
152-
LINK_PLUGIN(SCI)
153-
#endif
154-
#if PLUGIN_ENABLED_STATIC(SKY)
155-
LINK_PLUGIN(SKY)
156-
#endif
157-
#if PLUGIN_ENABLED_STATIC(SWORD1)
158-
LINK_PLUGIN(SWORD1)
159-
#endif
160-
#if PLUGIN_ENABLED_STATIC(SWORD2)
161-
LINK_PLUGIN(SWORD2)
162-
#endif
163-
#if PLUGIN_ENABLED_STATIC(SWORD25)
164-
LINK_PLUGIN(SWORD25)
165-
#endif
166-
#if PLUGIN_ENABLED_STATIC(TEENAGENT)
167-
LINK_PLUGIN(TEENAGENT)
168-
#endif
169-
#if PLUGIN_ENABLED_STATIC(TESTBED)
170-
LINK_PLUGIN(TESTBED)
171-
#endif
172-
#if PLUGIN_ENABLED_STATIC(TINSEL)
173-
LINK_PLUGIN(TINSEL)
174-
#endif
175-
#if PLUGIN_ENABLED_STATIC(TOLTECS)
176-
LINK_PLUGIN(TOLTECS)
177-
#endif
178-
#if PLUGIN_ENABLED_STATIC(TOON)
179-
LINK_PLUGIN(TOON)
180-
#endif
181-
#if PLUGIN_ENABLED_STATIC(TSAGE)
182-
LINK_PLUGIN(TSAGE)
183-
#endif
184-
#if PLUGIN_ENABLED_STATIC(TOUCHE)
185-
LINK_PLUGIN(TOUCHE)
186-
#endif
187-
#if PLUGIN_ENABLED_STATIC(TUCKER)
188-
LINK_PLUGIN(TUCKER)
189-
#endif
88+
#include "engines/plugins_table.h"
19089

19190
// Music plugins
19291
// TODO: Use defines to disable or enable each MIDI driver as a

configure

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -77,52 +77,8 @@ add_engine() {
7777
done
7878
}
7979

80-
add_engine scumm "SCUMM" yes "scumm_7_8 he"
81-
add_engine scumm_7_8 "v7 & v8 games" yes
82-
add_engine he "HE71+ games" yes
83-
add_engine agi "AGI" yes
84-
add_engine agos "AGOS" yes "agos2"
85-
add_engine agos2 "AGOS 2 games" yes
86-
add_engine cge "CGE" yes
87-
add_engine cine "Cinematique evo 1" yes
88-
add_engine composer "Magic Composer" no
89-
add_engine cruise "Cinematique evo 2" yes
90-
add_engine draci "Dragon History" yes
91-
add_engine drascula "Drascula: The Vampire Strikes Back" yes
92-
add_engine dreamweb "Dreamweb" no
93-
add_engine gob "Gobli*ns" yes
94-
add_engine groovie "Groovie" yes "groovie2"
95-
add_engine groovie2 "Groovie 2 games" no
96-
add_engine hugo "Hugo Trilogy" yes
97-
add_engine kyra "Legend of Kyrandia" yes "lol eob"
98-
add_engine lol "Lands of Lore" yes
99-
add_engine eob "Eye of the Beholder" no
100-
add_engine lastexpress "The Last Express" no
101-
add_engine lure "Lure of the Temptress" yes
102-
add_engine made "MADE" yes
103-
add_engine mohawk "Mohawk" yes "cstime myst riven"
104-
add_engine cstime "Where in Time is Carmen Sandiego?" no
105-
add_engine riven "Riven: The Sequel to Myst" no
106-
add_engine myst "Myst" no
107-
add_engine parallaction "Parallaction" yes
108-
add_engine queen "Flight of the Amazon Queen" yes
109-
add_engine saga "SAGA" yes "ihnm saga2"
110-
add_engine ihnm "IHNM" yes
111-
add_engine saga2 "SAGA 2 games" no
112-
add_engine sci "SCI" yes "sci32"
113-
add_engine sci32 "SCI32 games" no
114-
add_engine sky "Beneath a Steel Sky" yes
115-
add_engine sword1 "Broken Sword" yes
116-
add_engine sword2 "Broken Sword II" yes
117-
add_engine sword25 "Broken Sword 2.5" no
118-
add_engine teenagent "Teen Agent" yes
119-
add_engine testbed "TestBed: the Testing framework" no
120-
add_engine tinsel "Tinsel" yes
121-
add_engine toltecs "3 Skulls of the Toltecs" no
122-
add_engine toon "Toonstruck" yes
123-
add_engine touche "Touche: The Adventures of the Fifth Musketeer" yes
124-
add_engine tsage "TsAGE" yes
125-
add_engine tucker "Bud Tucker in Double Trouble" yes
80+
# Read list of engines
81+
. engines/configure.engines
12682

12783
#
12884
# Default settings

devtools/create_project/create_project.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ bool parseEngine(const std::string &line, EngineDesc &engine);
693693
} // End of anonymous namespace
694694

695695
EngineDescList parseConfigure(const std::string &srcDir) {
696-
std::string configureFile = srcDir + "/configure";
696+
std::string configureFile = srcDir + "/engines/configure.engines";
697697

698698
std::ifstream configure(configureFile.c_str());
699699
if (!configure)

engines/configure.engines

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This file is included from the main "configure" script
2+
add_engine scumm "SCUMM" yes "scumm_7_8 he"
3+
add_engine scumm_7_8 "v7 & v8 games" yes
4+
add_engine he "HE71+ games" yes
5+
add_engine agi "AGI" yes
6+
add_engine agos "AGOS" yes "agos2"
7+
add_engine agos2 "AGOS 2 games" yes
8+
add_engine cge "CGE" yes
9+
add_engine cine "Cinematique evo 1" yes
10+
add_engine composer "Magic Composer" no
11+
add_engine cruise "Cinematique evo 2" yes
12+
add_engine draci "Dragon History" yes
13+
add_engine drascula "Drascula: The Vampire Strikes Back" yes
14+
add_engine dreamweb "Dreamweb" no
15+
add_engine gob "Gobli*ns" yes
16+
add_engine groovie "Groovie" yes "groovie2"
17+
add_engine groovie2 "Groovie 2 games" no
18+
add_engine hugo "Hugo Trilogy" yes
19+
add_engine kyra "Legend of Kyrandia" yes "lol eob"
20+
add_engine lol "Lands of Lore" yes
21+
add_engine eob "Eye of the Beholder" no
22+
add_engine lastexpress "The Last Express" no
23+
add_engine lure "Lure of the Temptress" yes
24+
add_engine made "MADE" yes
25+
add_engine mohawk "Mohawk" yes "cstime myst riven"
26+
add_engine cstime "Where in Time is Carmen Sandiego?" no
27+
add_engine riven "Riven: The Sequel to Myst" no
28+
add_engine myst "Myst" no
29+
add_engine parallaction "Parallaction" yes
30+
add_engine queen "Flight of the Amazon Queen" yes
31+
add_engine saga "SAGA" yes "ihnm saga2"
32+
add_engine ihnm "IHNM" yes
33+
add_engine saga2 "SAGA 2 games" no
34+
add_engine sci "SCI" yes "sci32"
35+
add_engine sci32 "SCI32 games" no
36+
add_engine sky "Beneath a Steel Sky" yes
37+
add_engine sword1 "Broken Sword" yes
38+
add_engine sword2 "Broken Sword II" yes
39+
add_engine sword25 "Broken Sword 2.5" no
40+
add_engine teenagent "Teen Agent" yes
41+
add_engine testbed "TestBed: the Testing framework" no
42+
add_engine tinsel "Tinsel" yes
43+
add_engine toltecs "3 Skulls of the Toltecs" no
44+
add_engine toon "Toonstruck" yes
45+
add_engine touche "Touche: The Adventures of the Fifth Musketeer" yes
46+
add_engine tsage "TsAGE" yes
47+
add_engine tucker "Bud Tucker in Double Trouble" yes

engines/plugins_table.h

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
// This file is being included by "base/plugins.cpp"
2+
#if PLUGIN_ENABLED_STATIC(SCUMM)
3+
LINK_PLUGIN(SCUMM)
4+
#endif
5+
#if PLUGIN_ENABLED_STATIC(AGI)
6+
LINK_PLUGIN(AGI)
7+
#endif
8+
#if PLUGIN_ENABLED_STATIC(AGOS)
9+
LINK_PLUGIN(AGOS)
10+
#endif
11+
#if PLUGIN_ENABLED_STATIC(CGE)
12+
LINK_PLUGIN(CGE)
13+
#endif
14+
#if PLUGIN_ENABLED_STATIC(CINE)
15+
LINK_PLUGIN(CINE)
16+
#endif
17+
#if PLUGIN_ENABLED_STATIC(COMPOSER)
18+
LINK_PLUGIN(COMPOSER)
19+
#endif
20+
#if PLUGIN_ENABLED_STATIC(CRUISE)
21+
LINK_PLUGIN(CRUISE)
22+
#endif
23+
#if PLUGIN_ENABLED_STATIC(DRACI)
24+
LINK_PLUGIN(DRACI)
25+
#endif
26+
#if PLUGIN_ENABLED_STATIC(DRASCULA)
27+
LINK_PLUGIN(DRASCULA)
28+
#endif
29+
#if PLUGIN_ENABLED_STATIC(DREAMWEB)
30+
LINK_PLUGIN(DREAMWEB)
31+
#endif
32+
#if PLUGIN_ENABLED_STATIC(GOB)
33+
LINK_PLUGIN(GOB)
34+
#endif
35+
#if PLUGIN_ENABLED_STATIC(GROOVIE)
36+
LINK_PLUGIN(GROOVIE)
37+
#endif
38+
#if PLUGIN_ENABLED_STATIC(HUGO)
39+
LINK_PLUGIN(HUGO)
40+
#endif
41+
#if PLUGIN_ENABLED_STATIC(KYRA)
42+
LINK_PLUGIN(KYRA)
43+
#endif
44+
#if PLUGIN_ENABLED_STATIC(LASTEXPRESS)
45+
LINK_PLUGIN(LASTEXPRESS)
46+
#endif
47+
#if PLUGIN_ENABLED_STATIC(LURE)
48+
LINK_PLUGIN(LURE)
49+
#endif
50+
#if PLUGIN_ENABLED_STATIC(MADE)
51+
LINK_PLUGIN(MADE)
52+
#endif
53+
#if PLUGIN_ENABLED_STATIC(MOHAWK)
54+
LINK_PLUGIN(MOHAWK)
55+
#endif
56+
#if PLUGIN_ENABLED_STATIC(PARALLACTION)
57+
LINK_PLUGIN(PARALLACTION)
58+
#endif
59+
#if PLUGIN_ENABLED_STATIC(QUEEN)
60+
LINK_PLUGIN(QUEEN)
61+
#endif
62+
#if PLUGIN_ENABLED_STATIC(SAGA)
63+
LINK_PLUGIN(SAGA)
64+
#endif
65+
#if PLUGIN_ENABLED_STATIC(SCI)
66+
LINK_PLUGIN(SCI)
67+
#endif
68+
#if PLUGIN_ENABLED_STATIC(SKY)
69+
LINK_PLUGIN(SKY)
70+
#endif
71+
#if PLUGIN_ENABLED_STATIC(SWORD1)
72+
LINK_PLUGIN(SWORD1)
73+
#endif
74+
#if PLUGIN_ENABLED_STATIC(SWORD2)
75+
LINK_PLUGIN(SWORD2)
76+
#endif
77+
#if PLUGIN_ENABLED_STATIC(SWORD25)
78+
LINK_PLUGIN(SWORD25)
79+
#endif
80+
#if PLUGIN_ENABLED_STATIC(TEENAGENT)
81+
LINK_PLUGIN(TEENAGENT)
82+
#endif
83+
#if PLUGIN_ENABLED_STATIC(TESTBED)
84+
LINK_PLUGIN(TESTBED)
85+
#endif
86+
#if PLUGIN_ENABLED_STATIC(TINSEL)
87+
LINK_PLUGIN(TINSEL)
88+
#endif
89+
#if PLUGIN_ENABLED_STATIC(TOLTECS)
90+
LINK_PLUGIN(TOLTECS)
91+
#endif
92+
#if PLUGIN_ENABLED_STATIC(TOON)
93+
LINK_PLUGIN(TOON)
94+
#endif
95+
#if PLUGIN_ENABLED_STATIC(TSAGE)
96+
LINK_PLUGIN(TSAGE)
97+
#endif
98+
#if PLUGIN_ENABLED_STATIC(TOUCHE)
99+
LINK_PLUGIN(TOUCHE)
100+
#endif
101+
#if PLUGIN_ENABLED_STATIC(TUCKER)
102+
LINK_PLUGIN(TUCKER)
103+
#endif

0 commit comments

Comments
 (0)