Commit 9449eec5 authored by mercury233's avatar mercury233 Committed by DailyShana

update loading databases (#1899)

* change the priority of db
* update
* update
* Revert "update"
parent 7f8ff147
......@@ -9,7 +9,7 @@ DataManager dataManager;
bool DataManager::LoadDB(const char* file) {
sqlite3* pDB;
if(sqlite3_open(file, &pDB) != SQLITE_OK)
if(sqlite3_open_v2(file, &pDB, SQLITE_OPEN_READONLY, 0) != SQLITE_OK)
return Error(pDB);
sqlite3_stmt* pStmt;
const char* sql = "select * from datas,texts where datas.id=texts.id";
......
......@@ -55,11 +55,11 @@ bool Game::Initialize() {
imageManager.SetDevice(device);
if(!imageManager.Initial())
return false;
LoadExpansionDB();
if(!dataManager.LoadDB("cards.cdb"))
return false;
if(!dataManager.LoadStrings("strings.conf"))
return false;
RefreshExpansionDB();
dataManager.LoadStrings("./expansions/strings.conf");
env = device->getGUIEnvironment();
numFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.numfont, 16);
......@@ -713,7 +713,7 @@ void Game::SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, irr::gu
dataManager.strBuffer[pbuffer] = 0;
pControl->setText(dataManager.strBuffer);
}
void Game::RefreshExpansionDB() {
void Game::LoadExpansionDB() {
#ifdef _WIN32
char fpath[1000];
WIN32_FIND_DATAW fdataw;
......
......@@ -82,7 +82,7 @@ public:
void BuildProjectionMatrix(irr::core::matrix4& mProjection, f32 left, f32 right, f32 bottom, f32 top, f32 znear, f32 zfar);
void InitStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, u32 cHeight, irr::gui::CGUITTFont* font, const wchar_t* text);
void SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, irr::gui::CGUITTFont* font, const wchar_t* text, u32 pos = 0);
void RefreshExpansionDB();
void LoadExpansionDB();
void RefreshDeck(irr::gui::IGUIComboBox* cbDeck);
void RefreshReplay();
void RefreshSingleplay();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment