Mercurial > hg > dmlib
comparison tools/libgfx.c @ 1920:be7492a121f0
Define variable at start of block.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 27 Jun 2018 19:13:24 +0300 |
parents | 2977baab68db |
children | ee9bbf891352 |
comparison
equal
deleted
inserted
replaced
1919:f0225a52afce | 1920:be7492a121f0 |
---|---|
2012 | 2012 |
2013 for (offs = 0; offs < bufLen; offs++) | 2013 for (offs = 0; offs < bufLen; offs++) |
2014 { | 2014 { |
2015 Uint8 data = buf[offs]; | 2015 Uint8 data = buf[offs]; |
2016 int next_mode; | 2016 int next_mode; |
2017 BOOL flush; | |
2017 | 2018 |
2018 if (data == prev) | 2019 if (data == prev) |
2019 { | 2020 { |
2020 r_count++; | 2021 r_count++; |
2021 next_mode = DMODE_RLE; | 2022 next_mode = DMODE_RLE; |
2023 else | 2024 else |
2024 { | 2025 { |
2025 next_mode = DMODE_LIT; | 2026 next_mode = DMODE_LIT; |
2026 } | 2027 } |
2027 | 2028 |
2028 BOOL flush = offs - l_offs >= 126 || r_count >= 126; | 2029 flush = offs - l_offs >= 126 || r_count >= 126; |
2029 if ((next_mode != mode || flush) && | 2030 if ((next_mode != mode || flush) && |
2030 !dmIFFEncodeByteRun1Flush(fp, mode, flush, &l_offs, offs, buf, prev, &r_count)) | 2031 !dmIFFEncodeByteRun1Flush(fp, mode, flush, &l_offs, offs, buf, prev, &r_count)) |
2031 return FALSE; | 2032 return FALSE; |
2032 | 2033 |
2033 mode = next_mode; | 2034 mode = next_mode; |