shithub: cstory

Download patch

ref: e687c502a968c4c3dc9403222ad31e0bbc47779d
parent: 4d2a2270689a8cc836d0297535b3cd91c986ffe1
author: Clownacy <Clownacy@users.noreply.github.com>
date: Mon Apr 20 23:22:22 EDT 2020

Cleanup

--- a/src/Backends/Rendering/WiiU.cpp
+++ b/src/Backends/Rendering/WiiU.cpp
@@ -129,14 +129,7 @@
 									   GX2_BLEND_MODE_ONE,
 									   GX2_BLEND_COMBINE_MODE_ADD);
 	*/
-					// Do some binding
-/*
-					WHBGfxBeginRender();
 
-					// Draw to the gamepad
-					WHBGfxBeginRenderDRC();
-					WHBGfxClearColor(0.0f, 0.0f, 0.0f, 1.0f);
-*/
 					return framebuffer_surface;
 				}
 
@@ -178,15 +171,15 @@
 	// Make sure the buffers aren't currently being used before we modify them
 	GX2DrawDone();
 
-	// Set buffer to full-screen
+	// Set buffer to (4:3) full-screen
 	float *position_pointer = (float*)GX2RLockBufferEx(&vertex_position_buffer, (GX2RResourceFlags)0);
-	position_pointer[0] = -1.0f;
+	position_pointer[0] = -640.0f / 854.0f;
 	position_pointer[1] = -1.0f;
-	position_pointer[2] = 1.0f;
+	position_pointer[2] = 640.0f / 854.0f;
 	position_pointer[3] = -1.0f;
-	position_pointer[4] = 1.0f;
+	position_pointer[4] = 640.0f / 854.0f;
 	position_pointer[5] = 1.0f;
-	position_pointer[6] = -1.0f;
+	position_pointer[6] = -640.0f / 854.0f;
 	position_pointer[7] = 1.0f;
 	GX2RUnlockBufferEx(&vertex_position_buffer, (GX2RResourceFlags)0);
 
@@ -202,10 +195,13 @@
 	texture_coordinate_pointer[7] = 0.0f;
 	GX2RUnlockBufferEx(&texture_coordinate_buffer, (GX2RResourceFlags)0);
 
-
+	// Start drawing
 	WHBGfxBeginRender();
 
-	// Draw to the TV
+	////////////////////
+	// Draw to the TV //
+	////////////////////
+
 	WHBGfxBeginRenderTV();
 	WHBGfxClearColor(0.0f, 0.0f, 0.0f, 1.0f);
 
@@ -212,20 +208,26 @@
 	// This might be needed? Not sure.
 //	GX2RInvalidateSurface(&framebuffer_surface->texture.surface, 0, (GX2RResourceFlags)0);
 
+	// Select texture shader
 	GX2SetFetchShader(&texture_shader.fetchShader);
 	GX2SetVertexShader(texture_shader.vertexShader);
 	GX2SetPixelShader(texture_shader.pixelShader);
 
+	// Bind a few things
 	GX2SetPixelSampler(&sampler, texture_shader.pixelShader->samplerVars[0].location);
 	GX2SetPixelTexture(&framebuffer_surface->texture, texture_shader.pixelShader->samplerVars[0].location);
 	GX2RSetAttributeBuffer(&vertex_position_buffer, 0, vertex_position_buffer.elemSize, 0);
 	GX2RSetAttributeBuffer(&texture_coordinate_buffer, 1, texture_coordinate_buffer.elemSize, 0);
 
+	// Draw
 	GX2DrawEx(GX2_PRIMITIVE_MODE_QUADS, 4, 0, 1);
 
 	WHBGfxFinishRenderTV();
 
-	// Draw to the gamepad
+	/////////////////////////
+	// Draw to the gamepad //
+	/////////////////////////
+
 	WHBGfxBeginRenderDRC();
 	WHBGfxClearColor(0.0f, 0.0f, 0.0f, 1.0f);
 
@@ -232,15 +234,18 @@
 	// This might be needed? Not sure.
 //	GX2RInvalidateSurface(&framebuffer_surface->texture.surface, 0, (GX2RResourceFlags)0);
 
+	// Select texture shader
 	GX2SetFetchShader(&texture_shader.fetchShader);
 	GX2SetVertexShader(texture_shader.vertexShader);
 	GX2SetPixelShader(texture_shader.pixelShader);
 
+	// Bind a few things
 	GX2SetPixelSampler(&sampler, texture_shader.pixelShader->samplerVars[0].location);
 	GX2SetPixelTexture(&framebuffer_surface->texture, texture_shader.pixelShader->samplerVars[0].location);
 	GX2RSetAttributeBuffer(&vertex_position_buffer, 0, vertex_position_buffer.elemSize, 0);
 	GX2RSetAttributeBuffer(&texture_coordinate_buffer, 1, texture_coordinate_buffer.elemSize, 0);
 
+	// Draw
 	GX2DrawEx(GX2_PRIMITIVE_MODE_QUADS, 4, 0, 1);
 
 	WHBGfxFinishRenderDRC();