46 std::string full_path(full_path_cstr);
48 size_t slash_pos = full_path.rfind(
'/');
49 if (slash_pos != std::string::npos)
51 filename = full_path.substr(slash_pos+1);
59 std::string devel_filename;
60 std::string basename, ext;
61 Ogre::StringUtil::splitBaseFilename(filename, basename, ext);
64 devel_filename = basename +
"_DEVEL.as";
67 Ogre::DataStreamPtr ds;
68 std::string actual_filename = filename;
72 if (!devel_filename.empty())
76 ds = Ogre::ResourceGroupManager::getSingleton().openResource(
84 actual_filename = devel_filename;
86 fmt::format(
"Using development version of script: '{}'", devel_filename));
89 catch (Ogre::Exception&)
102 ds = Ogre::ResourceGroupManager::getSingleton().openResource(filename,
mResourceGroup);
104 catch (Ogre::Exception& e)
114 LOG(
"[RoR|Scripting] Failed to load file '"+filename+
"', reason unknown.");
118 const std::string& code = ds->getAsString();
121 return ProcessScriptSection(code.c_str(),
static_cast<unsigned int>(code.length()), actual_filename.c_str(), 0);