bool weather::paste_time_frame (shared_str const& frame_id, char const* buffer, u32 const& buffer_size) { container_type::iterator i = m_times.begin(); container_type::iterator e = m_times.end(); for ( ; i != e; ++i) { if (frame_id._get() != (*i)->id()._get()) continue; IReader reader(const_cast<char*>(buffer), buffer_size); CInifile temp(&reader); if (temp.sections().empty()) return (false); (*i)->load_from ((*temp.sections().begin())->Name, temp, shared_str((*i)->id())); return (true); } return (false); }
void weather::reload_time_frame (shared_str const& frame_id) { string_path file_name; FS.update_path (file_name, "$game_weathers$", m_id.c_str()); strcat_s (file_name, ".ltx"); CInifile* config = CInifile::Create(file_name); container_type::iterator i = m_times.begin(); container_type::iterator e = m_times.end(); for ( ; i != e; ++i) { if (frame_id._get() != (*i)->id()._get()) continue; if (!config->section_exist((*i)->id())) return; (*i)->load_from ((*i)->id(), *config, (*i)->id()); CInifile::Destroy (config); return; } CInifile::Destroy (config); }
bool weather::save_time_frame (shared_str const& frame_id, char* buffer, u32 const& buffer_size) { container_type::iterator i = m_times.begin(); container_type::iterator e = m_times.end(); for ( ; i != e; ++i) { if (frame_id._get() != (*i)->id()._get()) continue; CInifile temp(0, FALSE, FALSE, FALSE); (*i)->save (temp); CMemoryWriter writer; temp.save_as (writer); if (writer.size() > buffer_size) return (false); writer.seek (0); Memory.mem_copy (buffer, writer.pointer(), writer.size()); return (true); } return (false); }
IC bool operator() (smart_cover::loophole const *loophole) const { return (m_id._get() == loophole->id()._get()); }
IC bool less (const shared_str &_1, const shared_str &_2) const { return (_1._get() < _2._get()); }
u16 CKinematics::LL_BoneID (const shared_str& B) { accel::iterator I = std::lower_bound (bone_map_P->begin(),bone_map_P->end(),B,pred_P); if (I == bone_map_P->end()) return BI_NONE; if (I->first._get() != B._get() ) return BI_NONE; return u16(I->second); }
bool pred_P(const std::pair<shared_str,u32>& N, const shared_str& B) { return N.first._get() < B._get(); }
IC bool operator() (SSCDrawHelper const &h) const { return (m_id._get() == h.string_identifier._get()); }
IC bool operator() (shared_str const &lhs, shared_str const &rhs) const { return (lhs._get() < rhs._get()); }
inline bool operator() (weather const* weather) const { return (value._get() == weather->id()._get()); }