comparison tools/lib64gfx.c @ 1471:a988baa5b21f

Add stub function to prevent attempts to encode formats that do not support encoding yet.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 10 May 2018 23:07:50 +0300
parents 0046b4e1b35f
children b9d3577d8290
comparison
equal deleted inserted replaced
1470:499835ba215c 1471:a988baa5b21f
584 dmGrowBufFree(&mem); 584 dmGrowBufFree(&mem);
585 return res; 585 return res;
586 } 586 }
587 587
588 588
589 static int fmtEncodeStub(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt)
590 {
591 (void) buf;
592 (void) img;
593 (void) fmt;
594
595 return dmError(DMERR_NOT_SUPPORTED,
596 "Encoding of '%s' format not supported.\n",
597 fmt->name);
598 }
599
600
589 static Uint8 fmtGetPixelFunPaint2( 601 static Uint8 fmtGetPixelFunPaint2(
590 const DMC64Image *img, const int bmoffs, const int scroffs, 602 const DMC64Image *img, const int bmoffs, const int scroffs,
591 const int vshift, const int vbitmap, const int raster) 603 const int vshift, const int vbitmap, const int raster)
592 { 604 {
593 const int vbank = (raster & 7) + (vbitmap * 8); 605 const int vbank = (raster & 7) + (vbitmap * 8);
696 { 708 {
697 D64_FMT_MC, "d2p", "DrazPaint 2.0 (packed)", 0x5800, 0, 709 D64_FMT_MC, "d2p", "DrazPaint 2.0 (packed)", 0x5800, 0,
698 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, 710 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
699 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, 711 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
700 fmtProbeDrazPaint20Packed, 712 fmtProbeDrazPaint20Packed,
701 fmtDecodeDrazPaintPacked, NULL, 713 fmtDecodeDrazPaintPacked, fmtEncodeStub,
702 NULL, NULL, 714 NULL, NULL,
703 NULL, 715 NULL,
704 { 716 {
705 { DT_COLOR_RAM, 0x0000, 0, 0, NULL, NULL }, 717 { DT_COLOR_RAM, 0x0000, 0, 0, NULL, NULL },
706 { DT_BITMAP, 0x0800, 0, 0, NULL, NULL }, 718 { DT_BITMAP, 0x0800, 0, 0, NULL, NULL },
713 { 725 {
714 D64_FMT_MC | D64_FMT_ILACE, "dlp", "DrazLace 1.0 (packed)", 0x5800, 0, 726 D64_FMT_MC | D64_FMT_ILACE, "dlp", "DrazLace 1.0 (packed)", 0x5800, 0,
715 C64_SCR_WIDTH , C64_SCR_HEIGHT, 727 C64_SCR_WIDTH , C64_SCR_HEIGHT,
716 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT, 728 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT,
717 fmtProbeDrazLace10Packed, 729 fmtProbeDrazLace10Packed,
718 fmtDecodeDrazPaintPacked, NULL, 730 fmtDecodeDrazPaintPacked, fmtEncodeStub,
719 NULL, NULL, 731 NULL, NULL,
720 NULL, 732 NULL,
721 { 733 {
722 { DT_COLOR_RAM, 0x0000, 0, 0, NULL, NULL }, 734 { DT_COLOR_RAM, 0x0000, 0, 0, NULL, NULL },
723 { DT_BITMAP, 0x0800, 0, 0, NULL, NULL }, 735 { DT_BITMAP, 0x0800, 0, 0, NULL, NULL },
822 { 834 {
823 D64_FMT_MC, "ami", "Amica Paint (packed)", 0x4000, 0, 835 D64_FMT_MC, "ami", "Amica Paint (packed)", 0x4000, 0,
824 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, 836 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
825 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, 837 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
826 fmtProbeAmicaPaintPacked, 838 fmtProbeAmicaPaintPacked,
827 fmtDecodeAmicaPaintPacked, NULL, 839 fmtDecodeAmicaPaintPacked, fmtEncodeStub,
828 NULL, NULL, 840 NULL, NULL,
829 NULL, 841 NULL,
830 { 842 {
831 { DT_COLOR_RAM, 0x2328, 0, 0, NULL, NULL }, 843 { DT_COLOR_RAM, 0x2328, 0, 0, NULL, NULL },
832 { DT_BITMAP, 0x0000, 0, 0, NULL, NULL }, 844 { DT_BITMAP, 0x0000, 0, 0, NULL, NULL },
990 { 1002 {
991 D64_FMT_MC | D64_FMT_FLI | D64_FMT_ILACE, "fp2", "FunPaint II (unpacked)", 0x3ff0, 33694, 1003 D64_FMT_MC | D64_FMT_FLI | D64_FMT_ILACE, "fp2", "FunPaint II (unpacked)", 0x3ff0, 33694,
992 C64_SCR_WIDTH, C64_SCR_HEIGHT, 1004 C64_SCR_WIDTH, C64_SCR_HEIGHT,
993 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, 1005 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
994 fmtProbeFunPaint2Unpacked, 1006 fmtProbeFunPaint2Unpacked,
995 fmtDecodeFunPaint2Unpacked, NULL, 1007 fmtDecodeFunPaint2Unpacked, fmtEncodeStub,
996 NULL, NULL, 1008 NULL, NULL,
997 fmtGetPixelFunPaint2, 1009 fmtGetPixelFunPaint2,
998 { 1010 {
999 DEF_SCREEN_RAMS_8( 0x0000, 0, 0x400) 1011 DEF_SCREEN_RAMS_8( 0x0000, 0, 0x400)
1000 { DT_BITMAP, 0x2000, 0, 0, NULL, NULL }, 1012 { DT_BITMAP, 0x2000, 0, 0, NULL, NULL },
1010 { 1022 {
1011 D64_FMT_MC | D64_FMT_FLI | D64_FMT_ILACE, "fp2p", "FunPaint II (packed)", 0x3ff0, 0, 1023 D64_FMT_MC | D64_FMT_FLI | D64_FMT_ILACE, "fp2p", "FunPaint II (packed)", 0x3ff0, 0,
1012 C64_SCR_WIDTH, C64_SCR_HEIGHT, 1024 C64_SCR_WIDTH, C64_SCR_HEIGHT,
1013 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, 1025 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
1014 fmtProbeFunPaint2Packed, 1026 fmtProbeFunPaint2Packed,
1015 fmtDecodeFunPaint2Packed, NULL, 1027 fmtDecodeFunPaint2Packed, fmtEncodeStub,
1016 NULL, NULL, 1028 NULL, NULL,
1017 fmtGetPixelFunPaint2, 1029 fmtGetPixelFunPaint2,
1018 { 1030 {
1019 DEF_SCREEN_RAMS_8( 0x0000, 0, 0x400) 1031 DEF_SCREEN_RAMS_8( 0x0000, 0, 0x400)
1020 { DT_BITMAP, 0x2000, 0, 0, NULL, NULL }, 1032 { DT_BITMAP, 0x2000, 0, 0, NULL, NULL },