MCPcopy Create free account
hub / github.com/Meridian59/Meridian59 / DibOpenFileSimple

Function DibOpenFileSimple

roomedit/source/dibutil.cpp:149–168  ·  view source on GitHub ↗

/ * DibOpenFileSimple: Read basic bitmap information from the given file into * b, shrink, width, and height. This does not load the actual bits of any bitmap. * Return True on success. */

Source from the content-addressed store, hash-verified

147 * Return True on success.
148 */
149Bool DibOpenFileSimple(const char *szFile, Bitmaps *b, BYTE *shrink, int *width, int *height)
150{
151 file_node f;
152
153 if (!MappedFileOpenRead(szFile, &f))
154 return False;
155
156 if (!DibReadHeader(&f, b, shrink))
157 return MappedFileClose(&f);
158
159 // Switch width and height since walls are rotated 90 degrees
160 if (MappedFileRead(&f, height, 4) != 4)
161 return MappedFileClose(&f);
162
163 if (MappedFileRead(&f, width, 4) != 4)
164 return MappedFileClose(&f);
165
166 MappedFileClose(&f);
167 return True;
168}
169/************************************************************************/
170/*
171 * DibReadHeader: Read the initial bitmap information from the given file handle

Callers 1

AddTexturesFunction · 0.85

Calls 4

DibReadHeaderFunction · 0.85
MappedFileOpenReadFunction · 0.70
MappedFileCloseFunction · 0.70
MappedFileReadFunction · 0.70

Tested by

no test coverage detected