Mercurial > hg > dmlib
comparison tools/lib64fmts.c @ 2524:5a7e2aa8fef5
Rename DMSupeResCtx to DMSupeResDecCtx.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 15 May 2020 04:04:57 +0300 |
parents | 22d2cfeed831 |
children | 19b0ca169361 |
comparison
equal
deleted
inserted
replaced
2523:22d2cfeed831 | 2524:5a7e2aa8fef5 |
---|---|
89 size_t dstSize; | 89 size_t dstSize; |
90 | 90 |
91 Uint8 dbyte, repcount; | 91 Uint8 dbyte, repcount; |
92 | 92 |
93 size_t offs, end_offs; | 93 size_t offs, end_offs; |
94 } DMSupeResCtx; | 94 } DMSupeResDecCtx; |
95 | 95 |
96 | 96 |
97 static int fmtSupeResGetByte(DMSupeResCtx *ctx, Uint8 *data, const int mode) | 97 static int fmtSupeResGetByte(DMSupeResDecCtx *ctx, Uint8 *data, const int mode) |
98 { | 98 { |
99 if (!dmGrowBufGetU8(&ctx->src, data)) | 99 if (!dmGrowBufGetU8(&ctx->src, data)) |
100 { | 100 { |
101 return dmError(DMERR_INVALID_DATA, | 101 return dmError(DMERR_INVALID_DATA, |
102 "SupeRes: Out of input data (N=%d).\n", | 102 "SupeRes: Out of input data (N=%d).\n", |
105 else | 105 else |
106 return DMERR_OK; | 106 return DMERR_OK; |
107 } | 107 } |
108 | 108 |
109 | 109 |
110 static int fmtDecodeSupeRes24_25(DMSupeResCtx *ctx, Uint8 tmp) | 110 static int fmtDecodeSupeRes24_25(DMSupeResDecCtx *ctx, Uint8 tmp) |
111 { | 111 { |
112 if (tmp == 0x24) | 112 if (tmp == 0x24) |
113 { | 113 { |
114 ctx->dbyte = 0xff; | 114 ctx->dbyte = 0xff; |
115 } | 115 } |
129 | 129 |
130 return DMERR_OK; | 130 return DMERR_OK; |
131 } | 131 } |
132 | 132 |
133 | 133 |
134 static int fmtDecodeSupeResByte(DMSupeResCtx *ctx) | 134 static int fmtDecodeSupeResByte(DMSupeResDecCtx *ctx) |
135 { | 135 { |
136 Uint8 tmp; | 136 Uint8 tmp; |
137 int res; | 137 int res; |
138 | 138 |
139 lcont: | 139 lcont: |
184 out: | 184 out: |
185 return res; | 185 return res; |
186 } | 186 } |
187 | 187 |
188 | 188 |
189 static int fmtDecodeSupeResSection(DMSupeResCtx *ctx, const size_t offs, const size_t size) | 189 static int fmtDecodeSupeResSection(DMSupeResDecCtx *ctx, const size_t offs, const size_t size) |
190 { | 190 { |
191 int res = DMERR_OK; | 191 int res = DMERR_OK; |
192 | 192 |
193 ctx->offs = offs; | 193 ctx->offs = offs; |
194 ctx->end_offs = offs + size; | 194 ctx->end_offs = offs + size; |
208 } | 208 } |
209 | 209 |
210 | 210 |
211 static int fmtDecodeSupeRes(DMC64Image *img, const DMGrowBuf *psrc, const DMC64ImageFormat *fmt) | 211 static int fmtDecodeSupeRes(DMC64Image *img, const DMGrowBuf *psrc, const DMC64ImageFormat *fmt) |
212 { | 212 { |
213 DMSupeResCtx ctx; | 213 DMSupeResDecCtx ctx; |
214 DMGrowBuf tmp; | 214 DMGrowBuf tmp; |
215 int res; | 215 int res; |
216 | 216 |
217 memset(&ctx, 0, sizeof(ctx)); | 217 memset(&ctx, 0, sizeof(ctx)); |
218 ctx.dstSize = 0x3000; | 218 ctx.dstSize = 0x3000; |