comparison tools/lib64gfx.c @ 1722:de8e0a404c06

Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions now that they support backwards growing buffers, and get rid of dmReverseGetByte() and dmReversePutByte() helpers.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 06 Jun 2018 15:22:15 +0300
parents c9a6f1dae756
children 40a5ba0b3838
comparison
equal deleted inserted replaced
1721:c9a6f1dae756 1722:de8e0a404c06
95 if (op->bank > nbanks) 95 if (op->bank > nbanks)
96 nbanks = op->bank; 96 nbanks = op->bank;
97 } 97 }
98 98
99 return nbanks + 1; 99 return nbanks + 1;
100 }
101
102
103 BOOL dmReverseGetByte(const Uint8 *buf, size_t *offs, Uint8 *data)
104 {
105 if (*offs > 0)
106 {
107 *data = buf[--(*offs)];
108 return TRUE;
109 }
110 else
111 return FALSE;
112 }
113
114
115 BOOL dmReversePutByte(Uint8 *buf, size_t *offs, const Uint8 data)
116 {
117 if (*offs > 0)
118 {
119 buf[--(*offs)] = data;
120 return TRUE;
121 }
122 else
123 return FALSE;
124 } 100 }
125 101
126 102
127 int dmC64MemBlockAlloc(DMC64MemBlock *blk, const size_t size) 103 int dmC64MemBlockAlloc(DMC64MemBlock *blk, const size_t size)
128 { 104 {