Use macros for Seek modes (#1235)

* Use macros for `Seek` modes

* Fix syntax

* Use `OF_READ`

* Add names to skip.yml

* Revert "Add names to skip.yml"

This reverts commit 28b6f577dc.
This commit is contained in:
Christian Semmler
2024-12-16 14:13:52 -07:00
committed by GitHub
parent 615c3a5047
commit cfa3769abf
8 changed files with 20 additions and 14 deletions

View File

@@ -12,7 +12,7 @@
#include <assert.h>
// GLOBAL: LEGO1 0x101020e8
void (*g_omniUserMessage)(const char*, int) = NULL;
void (*g_omniUserMessage)(const char*, MxS32) = NULL;
// FUNCTION: LEGO1 0x100b6e10
MxBool GetRectIntersection(
@@ -166,7 +166,7 @@ MxDSObject* CreateStreamObject(MxDSFile* p_file, MxS16 p_ofs)
MxU8* buf;
_MMCKINFO tmpChunk;
if (p_file->Seek(((MxLong*) p_file->GetBuffer())[p_ofs], 0)) {
if (p_file->Seek(((MxLong*) p_file->GetBuffer())[p_ofs], SEEK_SET)) {
return NULL;
}

View File

@@ -92,11 +92,11 @@ MxResult MxDiskStreamProvider::SetResourceToGet(MxStreamController* p_resource)
m_pFile = new MxDSFile(path.GetData(), 0);
if (m_pFile != NULL) {
if (m_pFile->Open(0) != 0) {
if (m_pFile->Open(OF_READ) != 0) {
path = MxString(MxOmni::GetCD()) + p_resource->GetAtom().GetInternal() + ".si";
m_pFile->SetFileName(path.GetData());
if (m_pFile->Open(0) != 0) {
if (m_pFile->Open(OF_READ) != 0) {
goto done;
}
}
@@ -245,7 +245,7 @@ void MxDiskStreamProvider::PerformWork()
buffer = streamingAction->GetUnknowna0();
if (m_pFile->GetPosition() == streamingAction->GetBufferOffset() ||
m_pFile->Seek(streamingAction->GetBufferOffset(), 0) == 0) {
m_pFile->Seek(streamingAction->GetBufferOffset(), SEEK_SET) == 0) {
buffer->SetUnknown14(m_pFile->GetPosition());
if (m_pFile->ReadToBuffer(buffer) == SUCCESS) {

View File

@@ -41,7 +41,7 @@ MxResult MxDSFile::Open(MxULong p_uStyle)
Close();
}
else {
Seek(0, 0);
Seek(0, SEEK_SET);
}
return result;

View File

@@ -68,11 +68,11 @@ MxResult MxRAMStreamProvider::SetResourceToGet(MxStreamController* p_resource)
m_pFile = new MxDSFile(path.GetData(), 0);
if (m_pFile != NULL) {
if (m_pFile->Open(0) != 0) {
if (m_pFile->Open(OF_READ) != 0) {
path = MxString(MxOmni::GetCD()) + p_resource->GetAtom().GetInternal() + ".si";
m_pFile->SetFileName(path.GetData());
if (m_pFile->Open(0) != 0) {
if (m_pFile->Open(OF_READ) != 0) {
goto done;
}
}