comparison tools/ppl.c @ 730:3d813c81f33c

More work on resources API.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 21 Apr 2013 19:29:00 +0300
parents d9888292f971
children ab645f4cb8fa
comparison
equal deleted inserted replaced
729:e09b7fbedf8c 730:3d813c81f33c
579 { 579 {
580 dmError("No filename specified.\n"); 580 dmError("No filename specified.\n");
581 return 1; 581 return 1;
582 } 582 }
583 583
584 if ((file = dmf_create_stdio(optFilename, "rb")) == NULL) 584 if ((result = dmf_create_stdio(optFilename, "rb", &file)) != DMERR_OK)
585 { 585 {
586 int err = dmGetErrno();
587 dmError("Error opening file '%s', %d: (%s)\n", 586 dmError("Error opening file '%s', %d: (%s)\n",
588 optFilename, err, dmErrorStr(err)); 587 optFilename, result, dmErrorStr(result));
589 return 1; 588 return 1;
590 } 589 }
591 590
592 // Initialize miniJSS 591 // Initialize miniJSS
593 jssInit(); 592 jssInit();
632 result, dmErrorStr(result)); 631 result, dmErrorStr(result));
633 goto error_exit; 632 goto error_exit;
634 } 633 }
635 634
636 // Get font 635 // Get font
637 // file = dmf_create_stdio("fnsmall.fnt", "rb"); 636 result = dmf_create_memio(NULL, "pplfont.fnt", engineSetupFont, sizeof(engineSetupFont), &file);
638 file = dmf_create_memio(NULL, "pplfont.fnt", engineSetupFont, sizeof(engineSetupFont)); 637 if (result != DMERR_OK)
639 if (file == NULL) 638 {
640 { 639 dmError("Error opening font file 'pplfont.fnt', #%d: %s\n",
641 dmError("Error opening font file 'pplfont.fnt'.\n"); 640 result, dmErrorStr(result));
642 goto error_exit; 641 goto error_exit;
643 } 642 }
644 result = dmLoadBitmapFont(file, &font); 643 result = dmLoadBitmapFont(file, &font);
645 dmf_close(file); 644 dmf_close(file);
646 if (result != DMERR_OK) 645 if (result != DMERR_OK)