From ddb0161f9c4448e198659ad53cd7e89c14bc0a89 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Mon, 21 Nov 2016 15:40:42 +0100 Subject: [PATCH] Sub pinkie crashes the pal drawer :( --- src/r_poly_sprite.cpp | 3 +++ src/r_poly_triangle.cpp | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/r_poly_sprite.cpp b/src/r_poly_sprite.cpp index 87d52b98f..453ab2d00 100644 --- a/src/r_poly_sprite.cpp +++ b/src/r_poly_sprite.cpp @@ -226,6 +226,9 @@ void RenderPolySprite::Render(const TriMatrix &worldToClip, AActor *thing, subse uint32_t g = (args.uniforms.color >> 8) & 0xff; uint32_t b = args.uniforms.color & 0xff; args.uniforms.color = RGB32k.RGB[r >> 3][g >> 3][b >> 3]; + + if (blendmode == TriBlendMode::Sub) // Sub crashes in pal mode for some weird reason. + blendmode = TriBlendMode::Add; } PolyTriangleDrawer::draw(args, TriDrawVariant::DrawSubsector, blendmode); diff --git a/src/r_poly_triangle.cpp b/src/r_poly_triangle.cpp index 88ee02a36..367d3df40 100644 --- a/src/r_poly_triangle.cpp +++ b/src/r_poly_triangle.cpp @@ -371,7 +371,9 @@ FString DrawPolyTrianglesCommand::DebugInfo() } FString info; - info.Format("DrawPolyTriangles: variant = %s, blend mode = %s, color = %d", variantstr.GetChars(), blendmodestr.GetChars(), args.uniforms.color); + info.Format("DrawPolyTriangles: variant = %s, blend mode = %s, color = %d, light = %d, textureWidth = %d, textureHeight = %d, texture = %s, translation = %s, colormaps = %s", + variantstr.GetChars(), blendmodestr.GetChars(), args.uniforms.color, args.uniforms.light, args.textureWidth, args.textureHeight, + args.texturePixels ? "ptr" : "null", args.translation ? "ptr" : "null", args.colormaps ? "ptr" : "null"); return info; }