diff OSInfo.h @ 2152:d44b7775fc06

Removed DirectDraw2 compatibility. 3D Sound enabled (change 3DSoundProvider registry entry to activate it). Moved all forward declarations to mm7_unsorted_subs.h (many cpp files do not need them anyweay).
author Nomad
date Thu, 09 Jan 2014 01:37:34 +0200
parents 934074e7fcc1
children
line wrap: on
line diff
--- a/OSInfo.h	Wed Jan 08 22:29:11 2014 +0200
+++ b/OSInfo.h	Thu Jan 09 01:37:34 2014 +0200
@@ -1,31 +1,34 @@
 #pragma once
 #include "OSAPI.h"
 
-/*  293 */
-#pragma pack(push, 1)
-struct OSVersion
+class OSInfo
 {
-  //----- (004AD48F) --------------------------------------------------------
-  OSVersion()
-  {
-    bInitialized = false;
-    pVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
-    if (GetVersionExA(&pVersionInfo))
-      bInitialized = true;
-  }
+  public:
+    inline static bool CanUseDirectDraw4()
+    {
+      if (Ready())
+        return info.dwPlatformId != VER_PLATFORM_WIN32_NT || info.dwMajorVersion >= 4;
+      return false;
+    }
 
-  //----- (004AD4BA) --------------------------------------------------------
-  virtual ~OSVersion()
-  {
-    bInitialized = false;
-  }
+    inline static bool CanUseDirectDraw2()
+    {
+      return true;
+    }
 
 
-  //void ( ***vdestructor_ptr)(OSVersion *, bool);
-  OSVERSIONINFOA pVersionInfo;
-  int bInitialized;
-};
-#pragma pack(pop)
+  private:
+    static bool           initialized;
+    static OSVERSIONINFOA info;
 
-
-extern struct OSVersion *pVersion; // idb
\ No newline at end of file
+    static bool Ready()
+    {
+      if (!initialized)
+      {
+        info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
+        if (GetVersionExA(&info))
+          initialized = true;
+      }
+      return initialized;
+    }
+};
\ No newline at end of file