eirys / ft_vox

A procedural voxel terrain rendering engine in C++ and Vulkan
Apache License 2.0
0 stars 0 forks source link

Change `cursor++` to `++cursor` #12

Closed eirys closed 12 months ago

eirys commented 12 months ago

Actually, it's a Windows feature: Every line feed (\LF) on Linux are actually interpreted as carriage-return/line-feed (\CRLF). The "fix" is in the readExcept lambda function:

ParseNumberFn   readExcept = [this]() -> uint8_t {
    if (cursor >= base::data.size()) {
        throw PpmParseError("unexpected end of file");
    }
    // replace `cursor++` to `++cursor`:
    return base::data[++cursor];
};