[Improvement] (...): Optimize code.

This commit is contained in:
BZLZHH
2025-08-10 23:18:01 +08:00
parent 0b13cb5714
commit 253e14f2c9
27 changed files with 72 additions and 72 deletions
+2 -2
View File
@@ -216,8 +216,8 @@ namespace MobileGL {
}
void* MapBuffer_State(GLenum target, GLenum access) {
bool readable = access == GL_READ_ONLY || access == GL_READ_WRITE;
bool writable = access == GL_WRITE_ONLY || access == GL_READ_WRITE;
Bool readable = access == GL_READ_ONLY || access == GL_READ_WRITE;
Bool writable = access == GL_WRITE_ONLY || access == GL_READ_WRITE;
if (access != GL_READ_ONLY && access != GL_WRITE_ONLY && access != GL_READ_WRITE) {
MG_State::pGLContext->RecordError(
ErrorCode::InvalidEnum,
@@ -7,7 +7,7 @@
namespace MobileGL::MG_Impl::GLImpl {
namespace BufferImpl {
bool ValidateBufferTarget(BufferTarget target) {
Bool ValidateBufferTarget(BufferTarget target) {
if (target == BufferTarget::Unknown) {
using namespace MG_Util;
String bufferTargetStr = ConvertBufferTargetToString(target);
@@ -31,8 +31,8 @@ namespace MobileGL::MG_Impl::GLImpl {
return true;
}
bool ValidateBufferName(Uint index) {
bool isValid = MG_State::pGLContext->ValidateBufferName(index);
Bool ValidateBufferName(Uint index) {
Bool isValid = MG_State::pGLContext->ValidateBufferName(index);
if (isValid) return true;
MG_State::pGLContext->RecordError(
ErrorCode::InvalidOperation,
@@ -41,7 +41,7 @@ namespace MobileGL::MG_Impl::GLImpl {
return false;
}
bool ValidateBufferUsage(BufferUsage usage) {
Bool ValidateBufferUsage(BufferUsage usage) {
if (usage != BufferUsage::Unknown) {
return true;
}
@@ -56,7 +56,7 @@ namespace MobileGL::MG_Impl::GLImpl {
return false;
}
bool ValidateBufferMappingAccess(Flags<BufferMappingAccessBit> accessBits) {
Bool ValidateBufferMappingAccess(Flags<BufferMappingAccessBit> accessBits) {
if (accessBits == BufferMappingAccessBit::Null) {
MG_State::pGLContext->RecordError(ErrorCode::InvalidEnum,
MakeShared<GenericErrorInfo>("MG_Impl/GLImpl/BufferImpl",
+4 -4
View File
@@ -4,9 +4,9 @@
namespace MobileGL::MG_Impl::GLImpl {
namespace BufferImpl {
bool ValidateBufferTarget(BufferTarget target);
bool ValidateBufferName(Uint index);
bool ValidateBufferUsage(BufferUsage usage);
bool ValidateBufferMappingAccess(Flags<BufferMappingAccessBit> accessBits);
Bool ValidateBufferTarget(BufferTarget target);
Bool ValidateBufferName(Uint index);
Bool ValidateBufferUsage(BufferUsage usage);
Bool ValidateBufferMappingAccess(Flags<BufferMappingAccessBit> accessBits);
} // namespace BufferImpl
} // namespace MobileGL::MG_Impl::GLImpl