mirror of
https://github.com/pspdev/pspsdk.git
synced 2025-10-04 09:08:30 +00:00
Improve the sceGuEndObject implementation
This commit is contained in:
@@ -779,8 +779,10 @@ void sceGuBeginObject(int vtype, int count, const void* indices, const void* ver
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* End conditional rendering of object
|
* End conditional rendering of object
|
||||||
|
*
|
||||||
|
* @return 0 for success, < 0 for failure
|
||||||
**/
|
**/
|
||||||
void sceGuEndObject(void);
|
int sceGuEndObject(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable or disable GE state
|
* Enable or disable GE state
|
||||||
|
@@ -8,16 +8,30 @@
|
|||||||
|
|
||||||
#include "guInternal.h"
|
#include "guInternal.h"
|
||||||
|
|
||||||
void sceGuEndObject(void)
|
#define ERROR_NOT_FOUND 0x80000025
|
||||||
|
|
||||||
|
int sceGuEndObject(void)
|
||||||
{
|
{
|
||||||
// rewrite commands from sceGuBeginObject()
|
int res;
|
||||||
|
|
||||||
|
gu_object_stack_depth--;
|
||||||
|
if (gu_object_stack_depth < 0) {
|
||||||
|
return -ERROR_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int *current = gu_list->current;
|
unsigned int *current = gu_list->current;
|
||||||
gu_list->current = gu_object_stack[gu_object_stack_depth - 1];
|
gu_list->current = gu_object_stack[gu_object_stack_depth];
|
||||||
|
|
||||||
sendCommandi(BASE, (((unsigned int)current) >> 8) & 0xf0000);
|
sendCommandi(BASE, (((unsigned int)current) >> 8) & 0xf0000);
|
||||||
sendCommandi(BJUMP, (unsigned int)current);
|
sendCommandi(BJUMP, (unsigned int)current);
|
||||||
gu_list->current = current;
|
gu_list->current = current;
|
||||||
|
|
||||||
gu_object_stack_depth--;
|
if (gu_curr_context == GU_DIRECT) {
|
||||||
|
res = _sceGuUpdateStallAddr();
|
||||||
|
if (res < 0) {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return gu_object_stack_depth;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user