Lines Matching refs:cmo
107 static void CreateColorMapTexture ( MyTextureObj* to, MyColorMapObj* cmo );
108 static void CreateSampleImgTexture ( MyTextureObj* to, MyColorMapObj* cmo );
109 static void InitColorMap ( MyColorMapObj* cmo );
110 static void ChangeColorMap ( MyColorMapObj* cmo, u32 cmp_id );
111 static void LoadColorMap ( MyColorMapObj* cmo );
117 static void StatusMessage ( MyColorMapObj* cmo );
526 static void CreateColorMapTexture(MyTextureObj* to, MyColorMapObj* cmo) in CreateColorMapTexture() argument
532 ciSize = 1u << ( cmo->tlutNumber + 4 ); in CreateColorMapTexture()
584 cmo->tlutNumber ); in CreateColorMapTexture()
613 static void CreateSampleImgTexture(MyTextureObj* to, MyColorMapObj* cmo) in CreateSampleImgTexture() argument
621 ciSize = 1u << ( cmo->tlutNumber + 4 ); in CreateSampleImgTexture()
654 switch(cmo->tlutFormat) in CreateSampleImgTexture()
665 ic = ( ( c / 3 ) >> ( 8 - cmo->mapCtrl[0] )); in CreateSampleImgTexture()
667 shift = cmo->mapCtrl[0]; in CreateSampleImgTexture()
668 ic += (( 0xFF >> ( 8 - cmo->mapCtrl[1] )) << shift ); in CreateSampleImgTexture()
675 ic += (( c >> ( 8 - cmo->mapCtrl[id] )) << shift ); in CreateSampleImgTexture()
676 shift += cmo->mapCtrl[id]; in CreateSampleImgTexture()
684 ic = ( 0x00FFu >> ( 8 - cmo->mapCtrl[0] )); in CreateSampleImgTexture()
685 shift = cmo->mapCtrl[0]; in CreateSampleImgTexture()
690 ic += (( c >> ( 8 - cmo->mapCtrl[id] )) << shift ); in CreateSampleImgTexture()
691 shift += cmo->mapCtrl[id]; in CreateSampleImgTexture()
713 cmo->tlutNumber ); in CreateSampleImgTexture()
739 static void InitColorMap( MyColorMapObj* cmo ) in InitColorMap() argument
744 tlutNumBits = cmo->tlutNumber + 4; in InitColorMap()
746 switch(cmo->tlutFormat) in InitColorMap()
761 cmo->mapCtrl[i] = (u8)( ( i < components ) ? in InitColorMap()
778 static void ChangeColorMap( MyColorMapObj* cmo, u32 cmp_id ) in ChangeColorMap() argument
783 switch(cmo->tlutFormat) in ChangeColorMap()
810 if ( cmo->mapCtrl[cmp_id] >= limits[cmp_id] ) in ChangeColorMap()
814 while ( cmo->mapCtrl[i] <= 1 ) in ChangeColorMap()
821 --(cmo->mapCtrl[i]); in ChangeColorMap()
822 ++(cmo->mapCtrl[cmp_id]); in ChangeColorMap()
838 static void LoadColorMap(MyColorMapObj* cmo) in LoadColorMap() argument
844 ciSize = 1u << ( cmo->tlutNumber + 4 ); in LoadColorMap()
847 if ( cmo->tlutBuffer != NULL ) in LoadColorMap()
849 MEMFreeToAllocator(&DemoAllocator1, cmo->tlutBuffer); in LoadColorMap()
851 cmo->tlutBuffer = (u16*)MEMAllocFromAllocator(&DemoAllocator1, ciSize * sizeof(u16)); in LoadColorMap()
857 sizeTbl[i] = ( 1u << cmo->mapCtrl[i] ) - 1; in LoadColorMap()
865 if ( cmo->tlutFormat == GX_TL_IA8 ) in LoadColorMap()
871 else if ( cmo->tlutFormat == GX_TL_RGB565 ) in LoadColorMap()
878 else if ( cmo->tlutFormat == GX_TL_RGB5A3 ) in LoadColorMap()
887 cmo->tlutBuffer[offset] = (u16)data; in LoadColorMap()
906 DCFlushRange(cmo->tlutBuffer, ciSize * sizeof(u16)); in LoadColorMap()
911 cmo->tlutBuffer, in LoadColorMap()
912 cmo->tlutFormat, in LoadColorMap()
916 GXLoadTlut(&tlutObj, cmo->tlutNumber); in LoadColorMap()
1057 void StatusMessage( MyColorMapObj* cmo ) in StatusMessage() argument
1061 numEntries = 1u << ( cmo->tlutNumber + 4 ); in StatusMessage()
1064 switch(cmo->tlutFormat) in StatusMessage()
1070 cmo->mapCtrl[0], in StatusMessage()
1071 cmo->mapCtrl[1] ); in StatusMessage()
1077 cmo->mapCtrl[2], in StatusMessage()
1078 cmo->mapCtrl[1], in StatusMessage()
1079 cmo->mapCtrl[0] ); in StatusMessage()
1085 cmo->mapCtrl[3], in StatusMessage()
1086 cmo->mapCtrl[2], in StatusMessage()
1087 cmo->mapCtrl[1], in StatusMessage()
1088 cmo->mapCtrl[0] ); in StatusMessage()