comparison tools/lib64gfx.c @ 1725:40a5ba0b3838

Return size of subject in dmC64GetOpSize() despite what the operator type is.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 07 Jun 2018 14:47:37 +0300
parents de8e0a404c06
children f9128665a47e
comparison
equal deleted inserted replaced
1724:12504f179749 1725:40a5ba0b3838
689 } 689 }
690 690
691 691
692 BOOL dmC64GetOpSize(const DMC64EncDecOp *op, const DMC64ImageFormat *fmt, size_t *size) 692 BOOL dmC64GetOpSize(const DMC64EncDecOp *op, const DMC64ImageFormat *fmt, size_t *size)
693 { 693 {
694 // Default to size of 0 694 switch (op->subject)
695 *size = 0; 695 {
696 696 case DS_SCREEN_RAM:
697 switch (op->type) 697 case DS_COLOR_RAM:
698 { 698 *size = fmt->chHeight * fmt->chWidth;
699 case DO_COPY: 699 break;
700 case DO_SET_MEM: 700
701 case DO_SET_OP: 701 case DS_BITMAP_RAM:
702 switch (op->subject) 702 *size = fmt->chHeight * fmt->chWidth * 8;
703 { 703 break;
704 case DS_SCREEN_RAM: 704
705 case DS_COLOR_RAM: 705 case DS_CHAR_DATA:
706 *size = fmt->chHeight * fmt->chWidth; 706 *size = C64_MAX_CHARS * C64_CHR_SIZE;
707 break; 707 break;
708 708
709 case DS_BITMAP_RAM: 709 case DS_D020:
710 *size = fmt->chHeight * fmt->chWidth * 8; 710 case DS_BGCOL:
711 break; 711 case DS_D021:
712 712 case DS_D022:
713 case DS_CHAR_DATA: 713 case DS_D023:
714 *size = C64_MAX_CHARS * C64_CHR_SIZE; 714 case DS_D024:
715 break; 715 *size = 1;
716 716 break;
717 case DS_D020: 717
718 case DS_BGCOL: 718 default:
719 case DS_D021: 719 // Default to size of 0
720 case DS_D022: 720 *size = 0;
721 case DS_D023: 721 break;
722 case DS_D024:
723 *size = 1;
724 break;
725 }
726 } 722 }
727 723
728 // If the operator specified size is larger, use it. 724 // If the operator specified size is larger, use it.
729 if (op->size > *size) 725 if (op->size > *size)
730 *size = op->size; 726 *size = op->size;