[PICA] Color mask

This commit is contained in:
wheremyfoodat 2023-04-28 01:18:08 +03:00
parent 069fe37602
commit 4f8fa164ff
2 changed files with 3 additions and 3 deletions

View file

@ -80,7 +80,7 @@ FileDescriptor SaveDataArchive::openFile(const FSPath& path, const FilePerms& pe
Rust::Result<DirectorySession, FSResult> SaveDataArchive::openDirectory(const FSPath& path) {
if (!cartHasSaveData()) {
printf("Tried to open SaveData directory without save data\n");
return Err(FSResult::Success);
return Err(FSResult::UnexpectedFileOrDir);
}
if (path.type == PathType::UTF16) {
@ -91,7 +91,7 @@ Rust::Result<DirectorySession, FSResult> SaveDataArchive::openDirectory(const FS
p += fs::path(path.utf16_string).make_preferred();
if (fs::is_regular_file(p)) {
printf("SaveData: OpenArchive used with a file path");
printf("SaveData: OpenDirectory used with a file path");
return Err(FSResult::UnexpectedFileOrDir);
}

View file

@ -277,6 +277,7 @@ void Renderer::drawVertices(OpenGL::Primitives primType, Vertex* vertices, u32 c
const bool depthWriteEnable = (depthControl >> 12) & 1;
const int depthFunc = (depthControl >> 4) & 7;
const int colourMask = (depthControl >> 8) & 0xf;
glColorMask(colourMask & 1, colourMask & 2, colourMask & 4, colourMask & 8);
static constexpr std::array<GLenum, 8> depthModes = {
GL_NEVER, GL_ALWAYS, GL_EQUAL, GL_NOTEQUAL, GL_LESS, GL_LEQUAL, GL_GREATER, GL_GEQUAL
@ -346,7 +347,6 @@ void Renderer::drawVertices(OpenGL::Primitives primType, Vertex* vertices, u32 c
}
}
if (colourMask != 0xf) Helpers::panic("[PICA] Colour mask = %X != 0xf", colourMask);
vbo.bufferVertsSub(vertices, count);
OpenGL::draw(primType, count);
}