diff --git a/src/r_drawers.h b/src/r_drawers.h index 102d3159fa..8ac259e11d 100644 --- a/src/r_drawers.h +++ b/src/r_drawers.h @@ -247,7 +247,7 @@ struct TriDrawTriangleArgs uint8_t stencilWriteValue; uint32_t *subsectorGBuffer; const uint8_t *colormaps; - const uint8_t *RGB32k; + const uint8_t *RGB256k; const uint8_t *BaseColors; }; diff --git a/src/r_poly_triangle.cpp b/src/r_poly_triangle.cpp index e06cf2b7fa..72851b6b34 100644 --- a/src/r_poly_triangle.cpp +++ b/src/r_poly_triangle.cpp @@ -130,7 +130,7 @@ void PolyTriangleDrawer::draw_arrays(const PolyDrawArgs &drawargs, WorkerThreadD args.stencilMasks = PolyStencilBuffer::Instance()->Masks(); args.subsectorGBuffer = PolySubsectorGBuffer::Instance()->Values(); args.colormaps = drawargs.colormaps; - args.RGB32k = RGB32k.All; + args.RGB256k = RGB256k.All; args.BaseColors = (const uint8_t *)GPalette.BaseColors; bool ccw = drawargs.ccw; diff --git a/tools/drawergen/fixedfunction/drawtrianglecodegen.cpp b/tools/drawergen/fixedfunction/drawtrianglecodegen.cpp index 674543ff2d..c5f7405f5c 100644 --- a/tools/drawergen/fixedfunction/drawtrianglecodegen.cpp +++ b/tools/drawergen/fixedfunction/drawtrianglecodegen.cpp @@ -492,7 +492,7 @@ SSAInt DrawTriangleCodegen::ToPal8(SSAVec4i c) SSAInt red = SSAInt::clamp(c[0], SSAInt(0), SSAInt(255)); SSAInt green = SSAInt::clamp(c[1], SSAInt(0), SSAInt(255)); SSAInt blue = SSAInt::clamp(c[2], SSAInt(0), SSAInt(255)); - return RGB32k[((blue >> 3) * 32 + (green >> 3)) * 32 + (red >> 3)].load(true).zext_int(); + return RGB256k[((blue >> 2) * 64 + (green >> 2)) * 64 + (red >> 2)].load(true).zext_int(); } SSAInt DrawTriangleCodegen::ProcessPixel8(SSAInt bg, SSAInt *varying) @@ -631,7 +631,7 @@ void DrawTriangleCodegen::LoadArgs(SSAValue args, SSAValue thread_data) if (!truecolor) { Colormaps = args[0][20].load(true); - RGB32k = args[0][21].load(true); + RGB256k = args[0][21].load(true); BaseColors = args[0][22].load(true); } diff --git a/tools/drawergen/fixedfunction/drawtrianglecodegen.h b/tools/drawergen/fixedfunction/drawtrianglecodegen.h index 640a22aea4..71d6ebd58f 100644 --- a/tools/drawergen/fixedfunction/drawtrianglecodegen.h +++ b/tools/drawergen/fixedfunction/drawtrianglecodegen.h @@ -95,7 +95,7 @@ private: SSABool is_fixed_light; SSAUBytePtr Colormaps; - SSAUBytePtr RGB32k; + SSAUBytePtr RGB256k; SSAUBytePtr BaseColors; SSAInt numSpans; diff --git a/tools/drawergen/llvmdrawers.cpp b/tools/drawergen/llvmdrawers.cpp index e0300946cb..e68470188f 100644 --- a/tools/drawergen/llvmdrawers.cpp +++ b/tools/drawergen/llvmdrawers.cpp @@ -430,7 +430,7 @@ llvm::Type *LLVMDrawers::GetTriDrawTriangleArgs(llvm::LLVMContext &context) elements.push_back(llvm::Type::getInt8Ty(context)); // uint8_t stencilWriteValue; elements.push_back(llvm::Type::getInt32PtrTy(context)); // uint32_t *subsectorGBuffer; elements.push_back(llvm::Type::getInt8PtrTy(context)); // const uint8_t *colormaps; - elements.push_back(llvm::Type::getInt8PtrTy(context)); // const uint8_t *RGB32k; + elements.push_back(llvm::Type::getInt8PtrTy(context)); // const uint8_t *RGB256k; elements.push_back(llvm::Type::getInt8PtrTy(context)); // const uint8_t *BaseColors; TriDrawTriangleArgs = llvm::StructType::create(context, elements, "TriDrawTriangle", false)->getPointerTo(); return TriDrawTriangleArgs;