Mercurial > hg > dmlib
comparison tests/plrtest.c @ 777:ed60a7ee3ebb
Change JSSMOD loader to use DMResources.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 24 May 2013 01:19:11 +0300 |
parents | 3d813c81f33c |
children | 21ad08cdf408 |
comparison
equal
deleted
inserted
replaced
776:9acebca96dcc | 777:ed60a7ee3ebb |
---|---|
144 result = jssLoadXM(file, &mod); | 144 result = jssLoadXM(file, &mod); |
145 #endif | 145 #endif |
146 #ifdef JSS_SUP_JSSMOD | 146 #ifdef JSS_SUP_JSSMOD |
147 if (result != 0) | 147 if (result != 0) |
148 { | 148 { |
149 size_t bufgot, bufsize = dmfsize(file); | |
150 Uint8 *buf = dmMalloc(bufsize); | |
151 dmfseek(file, 0L, SEEK_SET); | 149 dmfseek(file, 0L, SEEK_SET); |
152 fprintf(stderr, "* Trying JSSMOD (%d bytes, %p)...\n", bufsize, buf); | 150 dmMsg(1, "* Trying JSSMOD ...\n"); |
153 if ((bufgot = dmfread(buf, 1, bufsize, file)) != bufsize) | 151 result = jssLoadJSSMOD(file, &mod); |
154 { | |
155 fprintf(stderr, "Error reading file (not enough data %d), #%d: %s\n", | |
156 bufgot, dmferror(file), dmErrorStr(dmferror(file))); | |
157 return 2; | |
158 } | |
159 result = jssLoadJSSMOD(buf, bufsize, &mod); | |
160 dmFree(buf); | |
161 } | 152 } |
162 #endif | 153 #endif |
163 dmf_close(file); | 154 dmf_close(file); |
164 | 155 |
165 if (result != DMERR_OK) | 156 if (result != DMERR_OK) |