OSDN Git Service

[CONFIG] Fix forgetting data of config file.Maybe fixed (;´Д`)
authorK.Ohta <whatisthis.sowhat@gmail.com>
Sun, 11 Oct 2020 09:33:56 +0000 (18:33 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Sun, 11 Oct 2020 09:33:56 +0000 (18:33 +0900)
source/src/CMakeLists.txt
source/src/config.cpp
source/src/config.h
source/src/config_dll.cpp [new file with mode: 0644]
source/src/qt/emuutils/CMakeLists.txt

index 7b476ea..3003e88 100644 (file)
@@ -7,13 +7,14 @@ message("* common/common")
 #)
 if(USE_DEVICES_SHARED_LIB)
   add_library(common_${EXE_NAME}
-#      config.cpp
+       config.cpp
        debugger.cpp
        )
 else()
   add_library(common_${EXE_NAME}
        common.cpp
        config.cpp
+       config_dll.cpp
        debugger.cpp
        fileio.cpp
        fifo.cpp
index 8b00c0d..5013a36 100644 (file)
@@ -24,11 +24,6 @@ extern CSP_Logger *csp_logger;
 #include "common.h"
 #include "config.h"
 #include "fileio.h"
-#if defined(_USE_AGAR)
-#include "agar_main.h"
-#endif
-
-config_t DLL_PREFIX config;
 
 #ifndef CONFIG_NAME
 #define CONFIG_NAME "conf"
@@ -49,7 +44,7 @@ bool MyGetPrivateProfileBool(LPCTSTR lpAppName, LPCTSTR lpKeyName, bool bDefault
        return (MyGetPrivateProfileInt(lpAppName, lpKeyName, bDefault ? 1 : 0, lpFileName) != 0);
 }
 
-void DLL_PREFIX initialize_config()
+void initialize_config()
 {
        // initial settings
        memset(&config, 0, sizeof(config_t));
@@ -239,7 +234,7 @@ void DLL_PREFIX initialize_config()
 #endif 
 }
 
-void DLL_PREFIX load_config(const _TCHAR *config_path)
+void load_config(const _TCHAR *config_path)
 {
        int drv, i;
        // initial settings
@@ -615,7 +610,7 @@ void DLL_PREFIX load_config(const _TCHAR *config_path)
        #endif
 }
                
-void DLL_PREFIX save_config(const _TCHAR *config_path)
+void save_config(const _TCHAR *config_path)
 {
        int drv, i;
 #if !defined(_MSC_VER)
@@ -938,7 +933,7 @@ void DLL_PREFIX save_config(const _TCHAR *config_path)
 
 #define STATE_VERSION  6
 
-bool DLL_PREFIX process_config_state(void *f, bool loading)
+bool process_config_state(void *f, bool loading)
 {
        FILEIO *state_fio = (FILEIO *)f;
        
index 6007f42..903f10e 100644 (file)
@@ -99,10 +99,10 @@ enum {
        #endif
 #endif
 
-void DLL_PREFIX initialize_config();
-void DLL_PREFIX load_config(const _TCHAR* config_path);
-void DLL_PREFIX save_config(const _TCHAR* config_path);
-bool DLL_PREFIX process_config_state(void *f, bool loading);
+void initialize_config();
+void load_config(const _TCHAR* config_path);
+void save_config(const _TCHAR* config_path);
+bool process_config_state(void *f, bool loading);
 
 /*
  * 20160407 Ohta:
diff --git a/source/src/config_dll.cpp b/source/src/config_dll.cpp
new file mode 100644 (file)
index 0000000..f225db4
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+  Note: This file is only for DLL.
+       Author : Kyuma.Ohta <whatisthis.sowhat@gmail.com>
+       Date   : 2020.10.11 -
+  */
+#if defined(_USE_QT)
+#include <string>
+#include <vector>
+#include "fileio.h"
+#include "csp_logger.h"
+#include "qt_main.h"
+# if defined(Q_OS_WIN)
+# include <windows.h>
+# endif
+extern CSP_Logger *csp_logger;
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include "common.h"
+#include "config.h"
+#include "fileio.h"
+
+config_t DLL_PREFIX config;
index 29c30a0..72951f6 100644 (file)
@@ -8,7 +8,7 @@ set(s_qt_emuutils_headers
        
 set(s_qt_emuutils_srcs
          ../../common.cpp
-         ../../config.cpp
+         ../../config_dll.cpp
          ../../fifo.cpp
          ../../fileio.cpp
          ../../ringbuffer.cpp