mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
(RGL PS3) Take out pushBack from RGLVector
This commit is contained in:
parent
346557c7d6
commit
ac550dc1dc
@ -30,22 +30,6 @@ namespace RGL
|
|||||||
array = 0;
|
array = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline unsigned int pushBack( const T &element )
|
|
||||||
{
|
|
||||||
uint32_t newCapacity = count + 1;
|
|
||||||
|
|
||||||
if (newCapacity > capacity)
|
|
||||||
{
|
|
||||||
if ( newCapacity > capacity )
|
|
||||||
newCapacity = ( newCapacity > capacity + increment ) ? newCapacity : ( capacity + increment );
|
|
||||||
|
|
||||||
array = (T*)realloc((void *)(array), sizeof(T) * newCapacity);
|
|
||||||
capacity = newCapacity;
|
|
||||||
}
|
|
||||||
new((void *)(array + count))T( element );
|
|
||||||
return ++count;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void removeElement( const T &element )
|
inline void removeElement( const T &element )
|
||||||
{
|
{
|
||||||
for ( unsigned int i = count; i > 0; --i )
|
for ( unsigned int i = count; i > 0; --i )
|
||||||
@ -55,7 +39,8 @@ namespace RGL
|
|||||||
unsigned int index = i - 1;
|
unsigned int index = i - 1;
|
||||||
( array + index )->~T();
|
( array + index )->~T();
|
||||||
--count;
|
--count;
|
||||||
if ( count > index ) memmove( array + index, array + index + 1, ( count - index )*sizeof( T ) );
|
if ( count > index )
|
||||||
|
memmove( array + index, array + index + 1, ( count - index )*sizeof( T ) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3279,6 +3279,25 @@ GLAPI GLenum APIENTRY glCheckFramebufferStatusOES( GLenum target )
|
|||||||
return GL_FRAMEBUFFER_COMPLETE_OES;
|
return GL_FRAMEBUFFER_COMPLETE_OES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void frameBuffer_pushBack(GLuint texture, rglFramebuffer *element)
|
||||||
|
{
|
||||||
|
RGLcontext* LContext = (RGLcontext*)_CurrentContext;
|
||||||
|
rglTexture *textureObject = (rglTexture*)LContext->textureNameSpace.data[texture];
|
||||||
|
|
||||||
|
uint32_t newCapacity = textureObject->framebuffers.count + 1;
|
||||||
|
|
||||||
|
if (newCapacity > textureObject->framebuffers.capacity)
|
||||||
|
{
|
||||||
|
if ( newCapacity > textureObject->framebuffers.capacity )
|
||||||
|
newCapacity = ( newCapacity > textureObject->framebuffers.capacity + textureObject->framebuffers.increment ) ? newCapacity : ( textureObject->framebuffers.capacity + textureObject->framebuffers.increment );
|
||||||
|
|
||||||
|
textureObject->framebuffers.array = (rglFramebuffer**)realloc((void *)(textureObject->framebuffers.array), sizeof(rglFramebuffer) * newCapacity);
|
||||||
|
textureObject->framebuffers.capacity = newCapacity;
|
||||||
|
}
|
||||||
|
new((void *)(textureObject->framebuffers.array + textureObject->framebuffers.count))rglFramebuffer((const rglFramebuffer&)element);
|
||||||
|
++textureObject->framebuffers.count;
|
||||||
|
}
|
||||||
|
|
||||||
GLAPI void APIENTRY glFramebufferTexture2DOES( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level )
|
GLAPI void APIENTRY glFramebufferTexture2DOES( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level )
|
||||||
{
|
{
|
||||||
RGLcontext* LContext = _CurrentContext;
|
RGLcontext* LContext = _CurrentContext;
|
||||||
@ -3299,8 +3318,7 @@ GLAPI void APIENTRY glFramebufferTexture2DOES( GLenum target, GLenum attachment,
|
|||||||
if (texture)
|
if (texture)
|
||||||
{
|
{
|
||||||
attach->type = RGL_FRAMEBUFFER_ATTACHMENT_TEXTURE;
|
attach->type = RGL_FRAMEBUFFER_ATTACHMENT_TEXTURE;
|
||||||
textureObject = (rglTexture*)LContext->textureNameSpace.data[texture];
|
frameBuffer_pushBack(texture, framebuffer);
|
||||||
textureObject->framebuffers.pushBack( framebuffer );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
attach->type = RGL_FRAMEBUFFER_ATTACHMENT_NONE;
|
attach->type = RGL_FRAMEBUFFER_ATTACHMENT_NONE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user