/ * 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. */
| 147 | * Return True on success. |
| 148 | */ |
| 149 | Bool 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 |
no test coverage detected