MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / update_path

Method update_path

ogsr_engine/xrCore/LocatorAPI.cpp:1178–1250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1176static std::recursive_mutex file_copy_mutex;
1177
1178LPCSTR CLocatorAPI::update_path(string_path& dest, LPCSTR initial, LPCSTR src)
1179{
1180 static bool dev_reference_copy = !!strstr(Core.Params, "-dev_reference_copy");
1181
1182 string_path src_origin{};
1183
1184 if (dev_reference_copy || gamedata_unused_references)
1185 {
1186 strcpy_s(src_origin, sizeof(src_origin), src);
1187 }
1188
1189 LPCSTR r = get_path(initial)->_update(dest, src);
1190
1191 if (dev_reference_copy)
1192 {
1193 std::scoped_lock lock(file_copy_mutex);
1194
1195 string_path fn_ref;
1196
1197 if (strcmp(initial, fsgame::game_sounds) == 0)
1198 {
1199 if (!exist(dest))
1200 {
1201 if (exist(fn_ref, fsgame::game_sounds_reference, src_origin))
1202 {
1203 Msg("[NFTC]: Sound founded: [%s] in $game_sounds_reference$ folder. Copying begins...", src_origin);
1204 file_copy(fn_ref, dest);
1205 }
1206 }
1207 }
1208 else if (strcmp(initial, fsgame::game_textures) == 0)
1209 {
1210 if (!exist(dest))
1211 {
1212 if (exist(fn_ref, fsgame::game_textures_reference, src_origin))
1213 {
1214 Msg("[NFTC]: Texture founded: [%s] in $game_textures_reference$ folder. Copying begins...", src_origin);
1215 file_copy(fn_ref, dest);
1216 }
1217 }
1218 }
1219 else if (strcmp(initial, fsgame::game_meshes) == 0)
1220 {
1221 if (!exist(dest))
1222 {
1223 if (exist(fn_ref, fsgame::game_meshes_reference, src_origin))
1224 {
1225 Msg("[NFTC]: Mesh founded: [%s] in $game_meshes_reference$ folder. Copying begins...", src_origin);
1226 file_copy(fn_ref, dest);
1227 }
1228 }
1229 }
1230 }
1231
1232 // v2 ))
1233
1234 if (gamedata_unused_references)
1235 {

Callers 15

LookupScriptMethod · 0.45
reload_system_iniFunction · 0.45
initialize_ini_file_fullFunction · 0.45
CSE_AbstractMethod · 0.45
set_current_levelMethod · 0.45
env_save_allMethod · 0.45
loadMethod · 0.45
ExecuteMethod · 0.45
ExecuteMethod · 0.45
InitSettingsFunction · 0.45
execUserScriptFunction · 0.45
Surface_DetectFunction · 0.45

Calls 3

MsgFunction · 0.85
_updateMethod · 0.80
remove_lineMethod · 0.80

Tested by

no test coverage detected