From 818c89313e54bcf3de98b976c0da57c88a8588d2 Mon Sep 17 00:00:00 2001 From: magumagu Date: Wed, 16 Apr 2014 14:51:18 -0700 Subject: Video backends: unify xfregs/xfmem structures. Removes the duplicate swxfregs global variable/struct from the software backend in favor of the ones from VideoCommon. --- Source/Core/VideoCommon/VertexLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/VertexLoader.cpp') diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp index 80fbf08cb5..5b99174822 100644 --- a/Source/Core/VideoCommon/VertexLoader.cpp +++ b/Source/Core/VideoCommon/VertexLoader.cpp @@ -217,7 +217,7 @@ void LOADERDECL UpdateBoundingBox() // We need to get the raw projection values for the bounding box calculation // to work properly. That means, no projection hacks! const float * const orig_point = s_bbox_vertex_buffer; - const float * const world_matrix = (float*)xfmem + s_curposmtx * 4; + const float * const world_matrix = (float*)xfmem.posMatrices + s_curposmtx * 4; const float * const proj_matrix = xfregs.projection.rawProjection; // Transform by world matrix -- cgit v1.2.3 From 8f5342c442c8e78784b4ea7002250781ba768767 Mon Sep 17 00:00:00 2001 From: magumagu Date: Wed, 16 Apr 2014 18:10:33 -0700 Subject: Video backend: merge global var xfmem into xfregs. There isn't really any reason to keep them separate. --- Source/Core/VideoCommon/VertexLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/VertexLoader.cpp') diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp index 5b99174822..fc8b2771a1 100644 --- a/Source/Core/VideoCommon/VertexLoader.cpp +++ b/Source/Core/VideoCommon/VertexLoader.cpp @@ -217,7 +217,7 @@ void LOADERDECL UpdateBoundingBox() // We need to get the raw projection values for the bounding box calculation // to work properly. That means, no projection hacks! const float * const orig_point = s_bbox_vertex_buffer; - const float * const world_matrix = (float*)xfmem.posMatrices + s_curposmtx * 4; + const float * const world_matrix = (float*)xfregs.posMatrices + s_curposmtx * 4; const float * const proj_matrix = xfregs.projection.rawProjection; // Transform by world matrix -- cgit v1.2.3 From 1357277f40166683a3ac4eb9979010c3038d2db8 Mon Sep 17 00:00:00 2001 From: magumagu Date: Sun, 27 Apr 2014 11:59:04 -0700 Subject: Video backends: mass-replace "xfregs" with "xfmem". --- Source/Core/VideoCommon/VertexLoader.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Source/Core/VideoCommon/VertexLoader.cpp') diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp index fc8b2771a1..62c06a9f50 100644 --- a/Source/Core/VideoCommon/VertexLoader.cpp +++ b/Source/Core/VideoCommon/VertexLoader.cpp @@ -217,8 +217,8 @@ void LOADERDECL UpdateBoundingBox() // We need to get the raw projection values for the bounding box calculation // to work properly. That means, no projection hacks! const float * const orig_point = s_bbox_vertex_buffer; - const float * const world_matrix = (float*)xfregs.posMatrices + s_curposmtx * 4; - const float * const proj_matrix = xfregs.projection.rawProjection; + const float * const world_matrix = (float*)xfmem.posMatrices + s_curposmtx * 4; + const float * const proj_matrix = xfmem.projection.rawProjection; // Transform by world matrix // Only calculate what we need, discard the rest @@ -226,7 +226,7 @@ void LOADERDECL UpdateBoundingBox() transformed[1] = orig_point[0] * world_matrix[4] + orig_point[1] * world_matrix[5] + orig_point[2] * world_matrix[6] + world_matrix[7]; // Transform by projection matrix - switch (xfregs.projection.type) + switch (xfmem.projection.type) { // Perspective projection, we must divide by w case GX_PERSPECTIVE: @@ -246,13 +246,13 @@ void LOADERDECL UpdateBoundingBox() break; default: - ERROR_LOG(VIDEO, "Unknown projection type: %d", xfregs.projection.type); + ERROR_LOG(VIDEO, "Unknown projection type: %d", xfmem.projection.type); screenPoint[0] = screenPoint[1] = screenPoint[2] = 1; } // Convert to screen space and add the point to the list - round like the real hardware - s_bbox_points[s_bbox_currPoint].x = (((s32) (0.5f + (16.0f * (screenPoint[0] * xfregs.viewport.wd + (xfregs.viewport.xOrig - 342.0f))))) + 3) >> 4; - s_bbox_points[s_bbox_currPoint].y = (((s32) (0.5f + (16.0f * (screenPoint[1] * xfregs.viewport.ht + (xfregs.viewport.yOrig - 342.0f))))) + 3) >> 4; + s_bbox_points[s_bbox_currPoint].x = (((s32) (0.5f + (16.0f * (screenPoint[0] * xfmem.viewport.wd + (xfmem.viewport.xOrig - 342.0f))))) + 3) >> 4; + s_bbox_points[s_bbox_currPoint].y = (((s32) (0.5f + (16.0f * (screenPoint[1] * xfmem.viewport.ht + (xfmem.viewport.yOrig - 342.0f))))) + 3) >> 4; s_bbox_points[s_bbox_currPoint].z = screenPoint[2]; // Update point list for primitive -- cgit v1.2.3