mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 13:50:03 +00:00 
			
		
		
		
	Resolve compilation errors related to the Color namespace change
This commit is contained in:
		
							parent
							
								
									81bf21283f
								
							
						
					
					
						commit
						95c7bac8a6
					
				
					 6 changed files with 66 additions and 65 deletions
				
			
		|  | @ -35,23 +35,23 @@ void DrawPixel(int x, int y, const Common::Vec4<u8>& color) { | |||
| 
 | ||||
|     switch (framebuffer.color_format) { | ||||
|     case FramebufferRegs::ColorFormat::RGBA8: | ||||
|         Color::EncodeRGBA8(color, dst_pixel); | ||||
|         Common::Color::EncodeRGBA8(color, dst_pixel); | ||||
|         break; | ||||
| 
 | ||||
|     case FramebufferRegs::ColorFormat::RGB8: | ||||
|         Color::EncodeRGB8(color, dst_pixel); | ||||
|         Common::Color::EncodeRGB8(color, dst_pixel); | ||||
|         break; | ||||
| 
 | ||||
|     case FramebufferRegs::ColorFormat::RGB5A1: | ||||
|         Color::EncodeRGB5A1(color, dst_pixel); | ||||
|         Common::Color::EncodeRGB5A1(color, dst_pixel); | ||||
|         break; | ||||
| 
 | ||||
|     case FramebufferRegs::ColorFormat::RGB565: | ||||
|         Color::EncodeRGB565(color, dst_pixel); | ||||
|         Common::Color::EncodeRGB565(color, dst_pixel); | ||||
|         break; | ||||
| 
 | ||||
|     case FramebufferRegs::ColorFormat::RGBA4: | ||||
|         Color::EncodeRGBA4(color, dst_pixel); | ||||
|         Common::Color::EncodeRGBA4(color, dst_pixel); | ||||
|         break; | ||||
| 
 | ||||
|     default: | ||||
|  | @ -76,19 +76,19 @@ const Common::Vec4<u8> GetPixel(int x, int y) { | |||
| 
 | ||||
|     switch (framebuffer.color_format) { | ||||
|     case FramebufferRegs::ColorFormat::RGBA8: | ||||
|         return Color::DecodeRGBA8(src_pixel); | ||||
|         return Common::Color::DecodeRGBA8(src_pixel); | ||||
| 
 | ||||
|     case FramebufferRegs::ColorFormat::RGB8: | ||||
|         return Color::DecodeRGB8(src_pixel); | ||||
|         return Common::Color::DecodeRGB8(src_pixel); | ||||
| 
 | ||||
|     case FramebufferRegs::ColorFormat::RGB5A1: | ||||
|         return Color::DecodeRGB5A1(src_pixel); | ||||
|         return Common::Color::DecodeRGB5A1(src_pixel); | ||||
| 
 | ||||
|     case FramebufferRegs::ColorFormat::RGB565: | ||||
|         return Color::DecodeRGB565(src_pixel); | ||||
|         return Common::Color::DecodeRGB565(src_pixel); | ||||
| 
 | ||||
|     case FramebufferRegs::ColorFormat::RGBA4: | ||||
|         return Color::DecodeRGBA4(src_pixel); | ||||
|         return Common::Color::DecodeRGBA4(src_pixel); | ||||
| 
 | ||||
|     default: | ||||
|         LOG_CRITICAL(Render_Software, "Unknown framebuffer color format {:x}", | ||||
|  | @ -115,11 +115,11 @@ u32 GetDepth(int x, int y) { | |||
| 
 | ||||
|     switch (framebuffer.depth_format) { | ||||
|     case FramebufferRegs::DepthFormat::D16: | ||||
|         return Color::DecodeD16(src_pixel); | ||||
|         return Common::Color::DecodeD16(src_pixel); | ||||
|     case FramebufferRegs::DepthFormat::D24: | ||||
|         return Color::DecodeD24(src_pixel); | ||||
|         return Common::Color::DecodeD24(src_pixel); | ||||
|     case FramebufferRegs::DepthFormat::D24S8: | ||||
|         return Color::DecodeD24S8(src_pixel).x; | ||||
|         return Common::Color::DecodeD24S8(src_pixel).x; | ||||
|     default: | ||||
|         LOG_CRITICAL(HW_GPU, "Unimplemented depth format {}", | ||||
|                      static_cast<u32>(framebuffer.depth_format.Value())); | ||||
|  | @ -144,7 +144,7 @@ u8 GetStencil(int x, int y) { | |||
| 
 | ||||
|     switch (framebuffer.depth_format) { | ||||
|     case FramebufferRegs::DepthFormat::D24S8: | ||||
|         return Color::DecodeD24S8(src_pixel).y; | ||||
|         return Common::Color::DecodeD24S8(src_pixel).y; | ||||
| 
 | ||||
|     default: | ||||
|         LOG_WARNING( | ||||
|  | @ -171,15 +171,15 @@ void SetDepth(int x, int y, u32 value) { | |||
| 
 | ||||
|     switch (framebuffer.depth_format) { | ||||
|     case FramebufferRegs::DepthFormat::D16: | ||||
|         Color::EncodeD16(value, dst_pixel); | ||||
|         Common::Color::EncodeD16(value, dst_pixel); | ||||
|         break; | ||||
| 
 | ||||
|     case FramebufferRegs::DepthFormat::D24: | ||||
|         Color::EncodeD24(value, dst_pixel); | ||||
|         Common::Color::EncodeD24(value, dst_pixel); | ||||
|         break; | ||||
| 
 | ||||
|     case FramebufferRegs::DepthFormat::D24S8: | ||||
|         Color::EncodeD24X8(value, dst_pixel); | ||||
|         Common::Color::EncodeD24X8(value, dst_pixel); | ||||
|         break; | ||||
| 
 | ||||
|     default: | ||||
|  | @ -211,7 +211,7 @@ void SetStencil(int x, int y, u8 value) { | |||
|         break; | ||||
| 
 | ||||
|     case Pica::FramebufferRegs::DepthFormat::D24S8: | ||||
|         Color::EncodeX24S8(value, dst_pixel); | ||||
|         Common::Color::EncodeX24S8(value, dst_pixel); | ||||
|         break; | ||||
| 
 | ||||
|     default: | ||||
|  |  | |||
|  | @ -86,18 +86,18 @@ union ETC1Tile { | |||
|                 ret.g() += static_cast<int>(differential.dg); | ||||
|                 ret.b() += static_cast<int>(differential.db); | ||||
|             } | ||||
|             ret.r() = Color::Convert5To8(ret.r()); | ||||
|             ret.g() = Color::Convert5To8(ret.g()); | ||||
|             ret.b() = Color::Convert5To8(ret.b()); | ||||
|             ret.r() = Common::Color::Convert5To8(ret.r()); | ||||
|             ret.g() = Common::Color::Convert5To8(ret.g()); | ||||
|             ret.b() = Common::Color::Convert5To8(ret.b()); | ||||
|         } else { | ||||
|             if (x < 2) { | ||||
|                 ret.r() = Color::Convert4To8(static_cast<u8>(separate.r1)); | ||||
|                 ret.g() = Color::Convert4To8(static_cast<u8>(separate.g1)); | ||||
|                 ret.b() = Color::Convert4To8(static_cast<u8>(separate.b1)); | ||||
|                 ret.r() = Common::Color::Convert4To8(static_cast<u8>(separate.r1)); | ||||
|                 ret.g() = Common::Color::Convert4To8(static_cast<u8>(separate.g1)); | ||||
|                 ret.b() = Common::Color::Convert4To8(static_cast<u8>(separate.b1)); | ||||
|             } else { | ||||
|                 ret.r() = Color::Convert4To8(static_cast<u8>(separate.r2)); | ||||
|                 ret.g() = Color::Convert4To8(static_cast<u8>(separate.g2)); | ||||
|                 ret.b() = Color::Convert4To8(static_cast<u8>(separate.b2)); | ||||
|                 ret.r() = Common::Color::Convert4To8(static_cast<u8>(separate.r2)); | ||||
|                 ret.g() = Common::Color::Convert4To8(static_cast<u8>(separate.g2)); | ||||
|                 ret.b() = Common::Color::Convert4To8(static_cast<u8>(separate.b2)); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|  |  | |||
|  | @ -80,27 +80,27 @@ Common::Vec4<u8> LookupTexelInTile(const u8* source, unsigned int x, unsigned in | |||
| 
 | ||||
|     switch (info.format) { | ||||
|     case TextureFormat::RGBA8: { | ||||
|         auto res = Color::DecodeRGBA8(source + MortonInterleave(x, y) * 4); | ||||
|         auto res = Common::Color::DecodeRGBA8(source + MortonInterleave(x, y) * 4); | ||||
|         return {res.r(), res.g(), res.b(), static_cast<u8>(disable_alpha ? 255 : res.a())}; | ||||
|     } | ||||
| 
 | ||||
|     case TextureFormat::RGB8: { | ||||
|         auto res = Color::DecodeRGB8(source + MortonInterleave(x, y) * 3); | ||||
|         auto res = Common::Color::DecodeRGB8(source + MortonInterleave(x, y) * 3); | ||||
|         return {res.r(), res.g(), res.b(), 255}; | ||||
|     } | ||||
| 
 | ||||
|     case TextureFormat::RGB5A1: { | ||||
|         auto res = Color::DecodeRGB5A1(source + MortonInterleave(x, y) * 2); | ||||
|         auto res = Common::Color::DecodeRGB5A1(source + MortonInterleave(x, y) * 2); | ||||
|         return {res.r(), res.g(), res.b(), static_cast<u8>(disable_alpha ? 255 : res.a())}; | ||||
|     } | ||||
| 
 | ||||
|     case TextureFormat::RGB565: { | ||||
|         auto res = Color::DecodeRGB565(source + MortonInterleave(x, y) * 2); | ||||
|         auto res = Common::Color::DecodeRGB565(source + MortonInterleave(x, y) * 2); | ||||
|         return {res.r(), res.g(), res.b(), 255}; | ||||
|     } | ||||
| 
 | ||||
|     case TextureFormat::RGBA4: { | ||||
|         auto res = Color::DecodeRGBA4(source + MortonInterleave(x, y) * 2); | ||||
|         auto res = Common::Color::DecodeRGBA4(source + MortonInterleave(x, y) * 2); | ||||
|         return {res.r(), res.g(), res.b(), static_cast<u8>(disable_alpha ? 255 : res.a())}; | ||||
|     } | ||||
| 
 | ||||
|  | @ -116,7 +116,7 @@ Common::Vec4<u8> LookupTexelInTile(const u8* source, unsigned int x, unsigned in | |||
|     } | ||||
| 
 | ||||
|     case TextureFormat::RG8: { | ||||
|         auto res = Color::DecodeRG8(source + MortonInterleave(x, y) * 2); | ||||
|         auto res = Common::Color::DecodeRG8(source + MortonInterleave(x, y) * 2); | ||||
|         return {res.r(), res.g(), 0, 255}; | ||||
|     } | ||||
| 
 | ||||
|  | @ -138,8 +138,8 @@ Common::Vec4<u8> LookupTexelInTile(const u8* source, unsigned int x, unsigned in | |||
|     case TextureFormat::IA4: { | ||||
|         const u8* source_ptr = source + MortonInterleave(x, y); | ||||
| 
 | ||||
|         u8 i = Color::Convert4To8(((*source_ptr) & 0xF0) >> 4); | ||||
|         u8 a = Color::Convert4To8((*source_ptr) & 0xF); | ||||
|         u8 i = Common::Color::Convert4To8(((*source_ptr) & 0xF0) >> 4); | ||||
|         u8 a = Common::Color::Convert4To8((*source_ptr) & 0xF); | ||||
| 
 | ||||
|         if (disable_alpha) { | ||||
|             // Show intensity as red, alpha as green
 | ||||
|  | @ -154,7 +154,7 @@ Common::Vec4<u8> LookupTexelInTile(const u8* source, unsigned int x, unsigned in | |||
|         const u8* source_ptr = source + morton_offset / 2; | ||||
| 
 | ||||
|         u8 i = (morton_offset % 2) ? ((*source_ptr & 0xF0) >> 4) : (*source_ptr & 0xF); | ||||
|         i = Color::Convert4To8(i); | ||||
|         i = Common::Color::Convert4To8(i); | ||||
| 
 | ||||
|         return {i, i, i, 255}; | ||||
|     } | ||||
|  | @ -164,7 +164,7 @@ Common::Vec4<u8> LookupTexelInTile(const u8* source, unsigned int x, unsigned in | |||
|         const u8* source_ptr = source + morton_offset / 2; | ||||
| 
 | ||||
|         u8 a = (morton_offset % 2) ? ((*source_ptr & 0xF0) >> 4) : (*source_ptr & 0xF); | ||||
|         a = Color::Convert4To8(a); | ||||
|         a = Common::Color::Convert4To8(a); | ||||
| 
 | ||||
|         if (disable_alpha) { | ||||
|             return {a, a, a, 255}; | ||||
|  | @ -194,7 +194,8 @@ Common::Vec4<u8> LookupTexelInTile(const u8* source, unsigned int x, unsigned in | |||
|             memcpy(&packed_alpha, subtile_ptr, sizeof(u64)); | ||||
|             subtile_ptr += sizeof(u64); | ||||
| 
 | ||||
|             alpha = Color::Convert4To8((packed_alpha >> (4 * (x * subtile_width + y))) & 0xF); | ||||
|             alpha = | ||||
|                 Common::Color::Convert4To8((packed_alpha >> (4 * (x * subtile_width + y))) & 0xF); | ||||
|         } | ||||
| 
 | ||||
|         u64_le subtile_data; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue