comparison tools/ppl.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 ab645f4cb8fa
children 97ecc0a9c21f
comparison
equal deleted inserted replaced
776:9acebca96dcc 777:ed60a7ee3ebb
598 result = jssLoadXM(file, &engine.mod); 598 result = jssLoadXM(file, &engine.mod);
599 #endif 599 #endif
600 #ifdef JSS_SUP_JSSMOD 600 #ifdef JSS_SUP_JSSMOD
601 if (result != 0) 601 if (result != 0)
602 { 602 {
603 size_t bufgot, bufsize = dmfsize(file);
604 Uint8 *buf = dmMalloc(bufsize);
605 dmfseek(file, 0L, SEEK_SET); 603 dmfseek(file, 0L, SEEK_SET);
606 dmMsg(2, "* Trying JSSMOD (%d bytes, %p)...\n", bufsize, buf); 604 dmMsg(1, "* Trying JSSMOD ...\n");
607 if ((bufgot = dmfread(buf, 1, bufsize, file)) != bufsize) 605 result = jssLoadJSSMOD(file, &engine.mod);
608 {
609 dmf_close(file);
610 dmError("Error reading file (not enough data %d), #%d: %s\n",
611 bufgot, dmferror(file), dmErrorStr(dmferror(file)));
612 goto error_exit;
613 }
614 result = jssLoadJSSMOD(buf, bufsize, &engine.mod);
615 dmFree(buf);
616 } 606 }
617 #endif 607 #endif
618 dmf_close(file); 608 dmf_close(file);
619 609
620 if (result != DMERR_OK) 610 if (result != DMERR_OK)