UnwrappedHardwareScheduler::UnwrappedHardwareScheduler() : _lastTimeAtFrame0(0) , _lastDmaSyncedTime(std::chrono::seconds(0)) { dmaCh = 5; SchedulerBase::registerExitHandler(&cleanup, SCHED_IO_EXIT_LEVEL); makeMaps(); initSrcAndControlBlocks(); initPwm(); initDma(); }
void Save::loadRFromCSV(int num) { NewSave::LoadCSVBaseInfo((BaseInfo*)this, 1, num); NewSave::LoadCSVItemList(Items, ITEM_IN_BAG_COUNT, num); NewSave::LoadCSVRoleSave(roles_mem_, num); NewSave::LoadCSVItemSave(items_mem_, num); NewSave::LoadCSVSubMapInfoSave(submap_infos_mem_, num); NewSave::LoadCSVMagicSave(magics_mem_, num); NewSave::LoadCSVShopSave(shops_mem_, num); updateAllPtrVector(); makeMaps(); }
void Save::loadRFromDB(int num) { NewSave::initDBFieldInfo(); auto filename = "../game/save/" + std::to_string(num) + ".db"; if (!File::fileExist(filename)) { return; } sqlite3* db; sqlite3_open(filename.c_str(), &db); NewSave::LoadDBBaseInfo(db, (BaseInfo*)this, 1); NewSave::LoadDBItemList(db, Items, ITEM_IN_BAG_COUNT); NewSave::LoadDBRoleSave(db, roles_mem_); NewSave::LoadDBItemSave(db, items_mem_); NewSave::LoadDBSubMapInfoSave(db, submap_infos_mem_); NewSave::LoadDBMagicSave(db, magics_mem_); NewSave::LoadDBShopSave(db, shops_mem_); sqlite3_close(db); updateAllPtrVector(); makeMaps(); }
bool Save::load(int num) { if (!checkSaveFileExist(num)) { return false; } loadR(num); loadRFromDB(num); loadSD(num); //内部编码为cp936 if (Encode != 936) { Encode = 936; for (auto i : roles_) { PotConv::fromCP950ToCP936(i->Name); PotConv::fromCP950ToCP936(i->Nick); } for (auto i : items_) { PotConv::fromCP950ToCP936(i->Name); PotConv::fromCP950ToCP936(i->Introduction); } for (auto i : magics_) { PotConv::fromCP950ToCP936(i->Name); } for (auto i : submap_infos_) { PotConv::fromCP950ToCP936(i->Name); } } makeMaps(); return true; }