mirror of
https://github.com/pspdev/pspsdk.git
synced 2025-10-04 09:08:30 +00:00
Merge pull request #305 from fjtrujy/improve_sceguclear
Improve `sceGuClear`
This commit is contained in:
@@ -46,7 +46,7 @@ void sceGuClear(int flags)
|
|||||||
vertices = (struct Vertex *)sceGuGetMemory(2 * sizeof(struct Vertex));
|
vertices = (struct Vertex *)sceGuGetMemory(2 * sizeof(struct Vertex));
|
||||||
count = 2;
|
count = 2;
|
||||||
|
|
||||||
vertices[0].color = 0;
|
vertices[0].color = filter;
|
||||||
vertices[0].x = 0;
|
vertices[0].x = 0;
|
||||||
vertices[0].y = 0;
|
vertices[0].y = 0;
|
||||||
vertices[0].z = context->clear_depth;
|
vertices[0].z = context->clear_depth;
|
||||||
@@ -59,8 +59,10 @@ void sceGuClear(int flags)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct Vertex *curr;
|
struct Vertex *curr;
|
||||||
unsigned int i;
|
unsigned int i, blockWidth;
|
||||||
count = ((gu_draw_buffer.width + 63) / 64) * 2;
|
// Use blockWidth of 32 for 8888, 64 for other formats
|
||||||
|
blockWidth = gu_draw_buffer.pixel_size == GU_PSM_8888 ? 32 : 64;
|
||||||
|
count = ((gu_draw_buffer.width + blockWidth - 1) / blockWidth) * 2;
|
||||||
vertices = (struct Vertex *)sceGuGetMemory(count * sizeof(struct Vertex));
|
vertices = (struct Vertex *)sceGuGetMemory(count * sizeof(struct Vertex));
|
||||||
curr = vertices;
|
curr = vertices;
|
||||||
|
|
||||||
@@ -72,7 +74,7 @@ void sceGuClear(int flags)
|
|||||||
k = (i & 1);
|
k = (i & 1);
|
||||||
|
|
||||||
curr->color = filter;
|
curr->color = filter;
|
||||||
curr->x = (j + k) * 64;
|
curr->x = (j + k) * blockWidth;
|
||||||
curr->y = k * gu_draw_buffer.height;
|
curr->y = k * gu_draw_buffer.height;
|
||||||
curr->z = context->clear_depth;
|
curr->z = context->clear_depth;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user