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

Method Load

ogsr_engine/xrGame/PostprocessAnimator.cpp:53–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void CPostprocessAnimator::Load(LPCSTR name)
54{
55 m_Name = name;
56
57 string_path full_path;
58 if (!FS.exist(full_path, "$level$", name))
59 if (!FS.exist(full_path, "$game_anims$", name))
60 Debug.fatal(DEBUG_INFO, "Can't find motion file '%s'.", name);
61
62 LPCSTR ext = strext(full_path);
63 if (ext)
64 {
65 if (!xr_strcmp(ext, POSTPROCESS_FILE_EXTENSION))
66 {
67 IReader* F = FS.r_open(full_path);
68 u32 dwVersion = F->r_u32();
69 // load base color
70 VERIFY(m_Params[0]);
71 m_Params[0]->load(*F);
72 // load add color
73 VERIFY(m_Params[1]);
74 m_Params[1]->load(*F);
75 // load gray color
76 VERIFY(m_Params[2]);
77 m_Params[2]->load(*F);
78 // load gray value
79 VERIFY(m_Params[3]);
80 m_Params[3]->load(*F);
81 // load blur value
82 VERIFY(m_Params[4]);
83 m_Params[4]->load(*F);
84 // load duality horizontal
85 VERIFY(m_Params[5]);
86 m_Params[5]->load(*F);
87 // load duality vertical
88 VERIFY(m_Params[6]);
89 m_Params[6]->load(*F);
90 // load noise intensity
91 VERIFY(m_Params[7]);
92 m_Params[7]->load(*F);
93 // load noise granularity
94 VERIFY(m_Params[8]);
95 m_Params[8]->load(*F);
96 // load noise fps
97 VERIFY(m_Params[9]);
98 m_Params[9]->load(*F);
99 if (dwVersion >= 0x0002)
100 {
101 VERIFY(m_Params[10]);
102 m_Params[10]->load(*F);
103 F->r_stringZ(m_EffectorParams.cm_tex1);
104 }
105 // close reader
106 FS.r_close(F);
107 }
108 else
109 FATAL("ERROR: Can't support files with many animations set. Incorrect file.");
110 }

Callers

nothing calls this directly

Calls 10

strextFunction · 0.85
GetLengthFunction · 0.85
existMethod · 0.80
r_openMethod · 0.80
r_closeMethod · 0.80
xr_strcmpFunction · 0.50
fatalMethod · 0.45
r_u32Method · 0.45
loadMethod · 0.45
r_stringZMethod · 0.45

Tested by

no test coverage detected