[Scummvm-cvs-logs] SF.net SVN: scummvm:[39577] scummvm/trunk/backends/platform/dc

marcus_c at users.sourceforge.net marcus_c at users.sourceforge.net
Fri Mar 20 23:55:43 CET 2009


Revision: 39577
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39577&view=rev
Author:   marcus_c
Date:     2009-03-20 22:55:42 +0000 (Fri, 20 Mar 2009)

Log Message:
-----------
Moved hardware initialization to a constructor, to make it run really early.

Modified Paths:
--------------
    scummvm/trunk/backends/platform/dc/dc.h
    scummvm/trunk/backends/platform/dc/dcmain.cpp

Modified: scummvm/trunk/backends/platform/dc/dc.h
===================================================================
--- scummvm/trunk/backends/platform/dc/dc.h	2009-03-20 22:33:45 UTC (rev 39576)
+++ scummvm/trunk/backends/platform/dc/dc.h	2009-03-20 22:55:42 UTC (rev 39577)
@@ -43,8 +43,15 @@
 
 #include "softkbd.h"
 
-class OSystem_Dreamcast : public BaseBackend, public FilesystemFactory {
+class DCHardware {
+ private:
+  static void dc_init_hardware();
+ protected:
+  DCHardware() { dc_init_hardware(); }
+};
 
+class OSystem_Dreamcast : private DCHardware, public BaseBackend, public FilesystemFactory {
+
  public:
   OSystem_Dreamcast();
 

Modified: scummvm/trunk/backends/platform/dc/dcmain.cpp
===================================================================
--- scummvm/trunk/backends/platform/dc/dcmain.cpp	2009-03-20 22:33:45 UTC (rev 39576)
+++ scummvm/trunk/backends/platform/dc/dcmain.cpp	2009-03-20 22:55:42 UTC (rev 39577)
@@ -199,7 +199,7 @@
   t = *localtime(&curTime);
 }
 
-void dc_init_hardware()
+void DCHardware::dc_init_hardware()
 {
 #ifndef NOSERIAL
   serial_init(57600);
@@ -213,18 +213,17 @@
   init_arm();
 }
 
+static OSystem_Dreamcast osys_dc;
+
 int main()
 {
   static char *argv[] = { "scummvm", NULL, };
   static int argc = 1;
 
-  dc_init_hardware();
+  g_system = &osys_dc;
 
-  g_system = new OSystem_Dreamcast();
-  assert(g_system);
-
 #ifdef DYNAMIC_MODULES
-	PluginManager::instance().addPluginProvider(new DCPluginProvider());
+  PluginManager::instance().addPluginProvider(new DCPluginProvider());
 #endif
 
   int res = scummvm_main(argc, argv);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list