qmlfrontend/hwengine.cpp
branchqmlfrontend
changeset 12864 a03f245243b0
parent 12863 0c6fb706f747
child 12865 e33bcb9d5e9c
equal deleted inserted replaced
12863:0c6fb706f747 12864:a03f245243b0
     3 #include <QDebug>
     3 #include <QDebug>
     4 #include <QLibrary>
     4 #include <QLibrary>
     5 
     5 
     6 extern "C" {
     6 extern "C" {
     7 RunEngine_t* flibRunEngine;
     7 RunEngine_t* flibRunEngine;
       
     8 ipcToEngineRaw_t* flibIpcToEngineRaw;
       
     9 ipcSetEngineBarrier_t* flibIpcSetEngineBarrier;
       
    10 ipcRemoveBarrierFromEngineQueue_t* flibIpcRemoveBarrierFromEngineQueue;
     8 registerUIMessagesCallback_t* flibRegisterUIMessagesCallback;
    11 registerUIMessagesCallback_t* flibRegisterUIMessagesCallback;
     9 flibInit_t* flibInit;
    12 flibInit_t* flibInit;
    10 flibFree_t* flibFree;
    13 flibFree_t* flibFree;
    11 passFlibEvent_t* flibPassFlibEvent;
    14 passFlibEvent_t* flibPassFlibEvent;
    12 }
    15 }
    25 
    28 
    26     if (!hwlib.load())
    29     if (!hwlib.load())
    27         qWarning() << "Engine library not found" << hwlib.errorString();
    30         qWarning() << "Engine library not found" << hwlib.errorString();
    28 
    31 
    29     flibRunEngine = (RunEngine_t*)hwlib.resolve("RunEngine");
    32     flibRunEngine = (RunEngine_t*)hwlib.resolve("RunEngine");
       
    33     flibIpcToEngineRaw = (ipcToEngineRaw_t*)hwlib.resolve("ipcToEngineRaw");
       
    34     flibIpcSetEngineBarrier = (ipcSetEngineBarrier_t*)hwlib.resolve("ipcSetEngineBarrier");
       
    35     flibIpcRemoveBarrierFromEngineQueue = (ipcRemoveBarrierFromEngineQueue_t*)hwlib.resolve("ipcRemoveBarrierFromEngineQueue");
    30     flibRegisterUIMessagesCallback = (registerUIMessagesCallback_t*)hwlib.resolve("registerUIMessagesCallback");
    36     flibRegisterUIMessagesCallback = (registerUIMessagesCallback_t*)hwlib.resolve("registerUIMessagesCallback");
    31     flibInit = (flibInit_t*)hwlib.resolve("flibInit");
    37     flibInit = (flibInit_t*)hwlib.resolve("flibInit");
    32     flibFree = (flibFree_t*)hwlib.resolve("flibFree");
    38     flibFree = (flibFree_t*)hwlib.resolve("flibFree");
    33 
    39 
    34     flibInit("/usr/home/unC0Rr/Sources/Hedgewars/MainRepo/share/hedgewars/Data", "/usr/home/unC0Rr/.hedgewars");
    40     flibInit("/usr/home/unC0Rr/Sources/Hedgewars/MainRepo/share/hedgewars/Data", "/usr/home/unC0Rr/.hedgewars");
    68     }
    74     }
    69 }
    75 }
    70 
    76 
    71 void HWEngine::getPreview()
    77 void HWEngine::getPreview()
    72 {
    78 {
    73     int argc;
    79     m_runQueue.append(GameConfig());
    74     const char** argv;
    80     flibRunEngine(m_runQueue[0].argc(), m_runQueue[0].argv());
    75     flibRunEngine(argc, argv);
       
    76 }
    81 }
    77 
    82 
    78 void HWEngine::runQuickGame()
    83 void HWEngine::runQuickGame()
    79 {
    84 {
    80 }
    85 }