comparison Discovery/Src/gfx_engine.c @ 114:79b19d56ab08 FlipDisplay

Eliminate warnings
author Ideenmodellierer
date Thu, 03 Jan 2019 18:35:11 +0100
parents cc8e24374b83
children 76fa42fc0b20
comparison
equal deleted inserted replaced
113:ecd230187da8 114:79b19d56ab08
911 SSettings* pSettings; 911 SSettings* pSettings;
912 pSettings = settingsGetPointer(); 912 pSettings = settingsGetPointer();
913 913
914 if(pSettings->FlipDisplay) 914 if(pSettings->FlipDisplay)
915 { 915 {
916 pDestination = hgfx->FBStartAdress + (2*hgfx->ImageHeight * (hgfx->ImageWidth - x0 + offset)) + 2*(480 - y0+offset); 916 pDestination = (uint16_t*)hgfx->FBStartAdress;
917 pDestination += (hgfx->ImageHeight * (hgfx->ImageWidth - x0 + offset)) + (480 - y0+offset);
917 stepdir = -1; 918 stepdir = -1;
918 } 919 }
919 else 920 else
920 { 921 {
921 pDestination = hgfx->FBStartAdress + 2*(x0 - offset)*hgfx->ImageHeight + 2*(y0-offset); 922 pDestination = (uint16_t*)hgfx->FBStartAdress;
923 pDestination += (x0 - offset)*hgfx->ImageHeight + (y0-offset);
922 stepdir = 1; 924 stepdir = 1;
923 } 925 }
924 for(int x=thickness;x>0;x--) 926 for(int x=thickness;x>0;x--)
925 { 927 {
926 for(int y=thickness;y>0;y--) 928 for(int y=thickness;y>0;y--)
991 /* horizontal line */ 993 /* horizontal line */
992 if(start.x == stop.x) 994 if(start.x == stop.x)
993 { 995 {
994 if(start.y > stop.y) gfx_flip(&start,&stop); 996 if(start.y > stop.y) gfx_flip(&start,&stop);
995 997
996 pDestination = (uint32_t)hgfx->FBStartAdress; 998 pDestination = (uint16_t*)hgfx->FBStartAdress;
997 if(pSettings->FlipDisplay) 999 if(pSettings->FlipDisplay)
998 { 1000 {
999 pDestination += (800 - start.x) * hgfx->ImageHeight; 1001 pDestination += (800 - start.x) * hgfx->ImageHeight;
1000 pDestination += (480 - start.y); 1002 pDestination += (480 - start.y);
1001 stepdir = -1; 1003 stepdir = -1;
1014 } 1016 }
1015 else /* vertical line ? */ 1017 else /* vertical line ? */
1016 if(start.y == stop.y) 1018 if(start.y == stop.y)
1017 { 1019 {
1018 if(start.x > stop.x) gfx_flip(&start,&stop); 1020 if(start.x > stop.x) gfx_flip(&start,&stop);
1019 pDestination = (uint32_t)hgfx->FBStartAdress; 1021 pDestination = (uint16_t*)hgfx->FBStartAdress;
1020 1022
1021 if(pSettings->FlipDisplay) 1023 if(pSettings->FlipDisplay)
1022 { 1024 {
1023 pDestination += (800 - start.x) * hgfx->ImageHeight; 1025 pDestination += (800 - start.x) * hgfx->ImageHeight;
1024 pDestination += (480 - start.y); 1026 pDestination += (480 - start.y);
1087 1089
1088 if(pSettings->FlipDisplay) 1090 if(pSettings->FlipDisplay)
1089 { 1091 {
1090 for(int xx = start.x; xx < stop.x; xx++) 1092 for(int xx = start.x; xx < stop.x; xx++)
1091 { 1093 {
1092 pDestination = hgfx->FBStartAdress; 1094 pDestination = (uint16_t*)hgfx->FBStartAdress;
1093 pDestination += (hgfx->ImageHeight - start.y) + (stop.x * hgfx->ImageHeight) ; 1095 pDestination += (hgfx->ImageHeight - start.y) + (stop.x * hgfx->ImageHeight) ;
1094 pDestination -= (xx - start.x) * hgfx->ImageHeight; 1096 pDestination -= (xx - start.x) * hgfx->ImageHeight;
1095 1097
1096 for(int yy = start.y; yy < stop.y; yy++) 1098 for(int yy = start.y; yy < stop.y; yy++)
1097 { 1099 {
1098 *(__IO uint16_t*)pDestination-- = image->data[j++] << 8 + color; 1100 *(__IO uint16_t*)pDestination-- = (image->data[j++] << 8) + color;
1099 } 1101 }
1100 } 1102 }
1101 } 1103 }
1102 else 1104 else
1103 { 1105 {
1104 for(int xx = start.x; xx < stop.x; xx++) 1106 for(int xx = start.x; xx < stop.x; xx++)
1105 { 1107 {
1106 pDestination = (uint32_t)hgfx->FBStartAdress; 1108 pDestination = (uint16_t*)hgfx->FBStartAdress;
1107 pDestination += xx * hgfx->ImageHeight; 1109 pDestination += xx * hgfx->ImageHeight;
1108 pDestination += start.y; 1110 pDestination += start.y;
1109 for(int yy = start.y; yy < stop.y; yy++) 1111 for(int yy = start.y; yy < stop.y; yy++)
1110 { 1112 {
1111 *(__IO uint16_t*)pDestination++ = image->data[j++] << 8 + color; 1113 *(__IO uint16_t*)pDestination++ = (image->data[j++] << 8) + color;
1112 } 1114 }
1113 } 1115 }
1114 } 1116 }
1115 } 1117 }
1116 1118
1148 } 1150 }
1149 else 1151 else
1150 { 1152 {
1151 for(int xx = start.x; xx < stop.x; xx++) 1153 for(int xx = start.x; xx < stop.x; xx++)
1152 { 1154 {
1153 pDestination = (uint32_t)hgfx->FBStartAdress; 1155 pDestination = (uint16_t*)hgfx->FBStartAdress;
1154 pDestination += xx * hgfx->ImageHeight; 1156 pDestination += xx * hgfx->ImageHeight;
1155 pDestination += start.y; 1157 pDestination += start.y;
1156 for(int yy = start.y; yy < stop.y; yy++) 1158 for(int yy = start.y; yy < stop.y; yy++)
1157 { 1159 {
1158 *(__IO uint16_t*)pDestination++ = 0xFF << 8 | image->data[j++]; 1160 *(__IO uint16_t*)pDestination++ = 0xFF << 8 | image->data[j++];
1634 pDestination_zero_veil = (uint16_t*)hgfx->FBStartAdress; 1636 pDestination_zero_veil = (uint16_t*)hgfx->FBStartAdress;
1635 pDestination_zero_veil += ((479 - (drawVeilUntil - 2) ) + ((w1 + window->left) * hgfx->ImageHeight) ); 1637 pDestination_zero_veil += ((479 - (drawVeilUntil - 2) ) + ((w1 + window->left) * hgfx->ImageHeight) );
1636 } 1638 }
1637 else if(drawVeilUntil < 0 ) 1639 else if(drawVeilUntil < 0 )
1638 { 1640 {
1639 pDestination_zero_veil = hgfx->FBStartAdress; 1641 pDestination_zero_veil = (uint16_t*)hgfx->FBStartAdress;
1640 pDestination_zero_veil += ((479 + (drawVeilUntil)) + ((w1 + window->left) * hgfx->ImageHeight) ); 1642 pDestination_zero_veil += ((479 + (drawVeilUntil)) + ((w1 + window->left) * hgfx->ImageHeight) );
1641 } 1643 }
1642 } 1644 }
1643 else 1645 else
1644 { 1646 {
1645 if(drawVeilUntil > 0) 1647 if(drawVeilUntil > 0)
1646 { 1648 {
1647 pDestination_zero_veil = hgfx->FBStartAdress; 1649 pDestination_zero_veil = (uint16_t*)hgfx->FBStartAdress;
1648 pDestination_zero_veil += (((drawVeilUntil) ) + ( (window->right - w1) * hgfx->ImageHeight) ); 1650 pDestination_zero_veil += (((drawVeilUntil) ) + ( (window->right - w1) * hgfx->ImageHeight) );
1649 } 1651 }
1650 else if(drawVeilUntil < 0 ) 1652 else if(drawVeilUntil < 0 )
1651 { 1653 {
1652 pDestination_zero_veil = hgfx->FBStartAdress; 1654 pDestination_zero_veil = (uint16_t*)hgfx->FBStartAdress;
1653 pDestination_zero_veil += 479 - drawVeilUntil + ( (window->right - w1 -1) * hgfx->ImageHeight); 1655 pDestination_zero_veil += 479 - drawVeilUntil + ( (window->right - w1 -1) * hgfx->ImageHeight);
1654 } 1656 }
1655 } 1657 }
1656 if(h_ulong + window->top > max) 1658 if(h_ulong + window->top > max)
1657 { 1659 {
1663 // { 1665 // {
1664 //output_content[pointer] = colormask; 1666 //output_content[pointer] = colormask;
1665 //output_mask[pointer] = true; 1667 //output_mask[pointer] = true;
1666 if(w1 > 0) 1668 if(w1 > 0)
1667 { 1669 {
1668 pDestination_start = hgfx->FBStartAdress; 1670 pDestination_start = (uint16_t*)hgfx->FBStartAdress;
1669 if(!pSettings->FlipDisplay) 1671 if(!pSettings->FlipDisplay)
1670 { 1672 {
1671 pDestination_start += (((479 - (window->top)) + ((w1 + window->left) * hgfx->ImageHeight))); 1673 pDestination_start += (((479 - (window->top)) + ((w1 + window->left) * hgfx->ImageHeight)));
1672 } 1674 }
1673 else 1675 else
1875 SSettings* pSettings; 1877 SSettings* pSettings;
1876 pSettings = settingsGetPointer(); 1878 pSettings = settingsGetPointer();
1877 1879
1878 lineWidth = WidthHeight.x; 1880 lineWidth = WidthHeight.x;
1879 lineHeight = WidthHeight.y; 1881 lineHeight = WidthHeight.y;
1880 pStart = (uint32_t)hgfx->FBStartAdress; 1882 pStart = (uint16_t*)hgfx->FBStartAdress;
1881 1883
1882 if(!pSettings->FlipDisplay) 1884 if(!pSettings->FlipDisplay)
1883 { 1885 {
1884 pStart += LeftLow.x * hgfx->ImageHeight; 1886 pStart += LeftLow.x * hgfx->ImageHeight;
1885 pStart += LeftLow.y; 1887 pStart += LeftLow.y;
1889 { 1891 {
1890 pStart += (800 - LeftLow.x - 1) * hgfx->ImageHeight; 1892 pStart += (800 - LeftLow.x - 1) * hgfx->ImageHeight;
1891 pStart += (480 - LeftLow.y); 1893 pStart += (480 - LeftLow.y);
1892 stepdir = -1; 1894 stepdir = -1;
1893 } 1895 }
1894 pStart = pStart;
1895 1896
1896 // Untere Linie 1897 // Untere Linie
1897 pDestination = pStart; 1898 pDestination = pStart;
1898 if(Style) 1899 if(Style)
1899 { 1900 {
2583 { 2584 {
2584 uint32_t i, j; 2585 uint32_t i, j;
2585 uint32_t width, height; 2586 uint32_t width, height;
2586 uint32_t found; 2587 uint32_t found;
2587 uint16_t* pDestination; 2588 uint16_t* pDestination;
2588 uint32_t pDestinationColor;
2589 uint32_t pSource; 2589 uint32_t pSource;
2590 uint32_t OffsetDestination; 2590 uint32_t OffsetDestination;
2591 uint32_t width_left; 2591 uint32_t width_left;
2592 uint32_t height_left; 2592 uint32_t height_left;
2593 uint32_t char_truncated_WidthFlag; 2593 uint32_t char_truncated_WidthFlag;
2625 } 2625 }
2626 if(!found) 2626 if(!found)
2627 return cfg->Xdelta; 2627 return cfg->Xdelta;
2628 2628
2629 pSource = ((uint32_t)Font->chars[i].image->data); 2629 pSource = ((uint32_t)Font->chars[i].image->data);
2630 pDestination = 1 + (uint32_t)hgfx->Image->FBStartAdress; 2630 pDestination = (uint16_t*)(hgfx->Image->FBStartAdress+1);
2631 2631
2632 heightFont = Font->chars[i].image->height; 2632 heightFont = Font->chars[i].image->height;
2633 widthFont = Font->chars[i].image->width; 2633 widthFont = Font->chars[i].image->width;
2634 2634
2635 height = heightFont*2; 2635 height = heightFont*2;
2965 2965
2966 uint32_t i, j; 2966 uint32_t i, j;
2967 uint32_t width, height; 2967 uint32_t width, height;
2968 uint32_t found; 2968 uint32_t found;
2969 uint16_t* pDestination; 2969 uint16_t* pDestination;
2970 uint32_t pDestinationColor;
2971 uint32_t pSource; 2970 uint32_t pSource;
2972 uint32_t OffsetDestination; 2971 uint32_t OffsetDestination;
2973 uint32_t width_left; 2972 uint32_t width_left;
2974 uint32_t height_left; 2973 uint32_t height_left;
2975 uint32_t char_truncated_WidthFlag; 2974 uint32_t char_truncated_WidthFlag;
3014 */ 3013 */
3015 // ----------------------------- 3014 // -----------------------------
3016 3015
3017 3016
3018 pSource = ((uint32_t)Font->chars[i].image->data); 3017 pSource = ((uint32_t)Font->chars[i].image->data);
3019 pDestination = (uint32_t)hgfx->Image->FBStartAdress + 1; 3018 pDestination = (uint16_t*)(hgfx->Image->FBStartAdress + 1);
3020 3019
3021 height = Font->chars[i].image->height; 3020 height = Font->chars[i].image->height;
3022 width = Font->chars[i].image->width; 3021 width = Font->chars[i].image->width;
3023 3022
3024 OffsetDestination = hgfx->Image->ImageHeight - height; 3023 OffsetDestination = hgfx->Image->ImageHeight - height;