mirror of
https://github.com/pspdev/pspsdk.git
synced 2025-10-03 16:51:27 +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
|
||||
*
|
||||
* @return 0 for success, < 0 for failure
|
||||
**/
|
||||
void sceGuEndObject(void);
|
||||
int sceGuEndObject(void);
|
||||
|
||||
/**
|
||||
* Enable or disable GE state
|
||||
|
@@ -8,16 +8,30 @@
|
||||
|
||||
#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;
|
||||
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(BJUMP, (unsigned int)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