OSDN Git Service

[VM][State] Apply new state framework to some VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / ex80 / keyboard.cpp
index 61b9476..cf1e15b 100644 (file)
@@ -62,40 +62,14 @@ void KEYBOARD::event_frame()
 
 #define STATE_VERSION  1
 
-#include "../../statesub.h"
-
-void KEYBOARD::decl_state(void)
+bool KEYBOARD::process_state(FILEIO* state_fio, bool loading)
 {
-       enter_decl_state(STATE_VERSION);
-       DECL_STATE_ENTRY_UINT32(column);
-       leave_decl_state();
-}
-
-void KEYBOARD::save_state(FILEIO* state_fio)
-{
-       if(state_entry != NULL) {
-               state_entry->save_state(state_fio);
+       if(!state_fio->StateCheckUint32(STATE_VERSION)) {
+               return false;
        }
-//     state_fio->FputUint32(STATE_VERSION);
-//     state_fio->FputInt32(this_device_id);
-       
-//     state_fio->FputUint32(column);
-}
-
-bool KEYBOARD::load_state(FILEIO* state_fio)
-{
-       bool mb = false;
-       if(state_entry != NULL) {
-               mb = state_entry->load_state(state_fio);
+       if(!state_fio->StateCheckInt32(this_device_id)) {
+               return false;
        }
-       if(!mb) return false;
-//     if(state_fio->FgetUint32() != STATE_VERSION) {
-//             return false;
-//     }
-//     if(state_fio->FgetInt32() != this_device_id) {
-//             return false;
-//     }
-//     column = state_fio->FgetUint32();
+       state_fio->StateUint32(column);
        return true;
 }
-