MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / LoadDocument

Method LoadDocument

legacy/hogedit/HogEditDoc.cpp:158–185  ·  view source on GitHub ↗

loads a RIB file or HOG file.

Source from the content-addressed store, hash-verified

156
157// loads a RIB file or HOG file.
158int CHogEditDoc::LoadDocument(CString &name) {
159 char *ascii_name;
160 char ext[_MAX_EXT];
161 int res;
162
163 // Get ascii string from name
164 ascii_name = name.GetBuffer(0);
165
166 // extract file extension from name
167 _splitpath(ascii_name, NULL, NULL, NULL, ext);
168
169 // load either .rib or .hog file
170 if (stricmp(ext, ".rib") == 0) {
171 res = LoadRib(ascii_name);
172 if (res)
173 m_StaticHog = false;
174 } else {
175 res = LoadHog(ascii_name);
176 if (res)
177 m_StaticHog = true;
178 }
179
180 // Set the new document name
181 if (res)
182 m_DocumentName = name;
183
184 return (res);
185}
186
187// saves a RIB file
188int CHogEditDoc::SaveDocument(CString &name) {

Callers 2

OnFileOpenMethod · 0.80
OnActionCreateMethod · 0.80

Calls 2

_splitpathFunction · 0.85
GetBufferMethod · 0.80

Tested by

no test coverage detected