[Scummvm-git-logs] scummvm master -> b2333d95503a5d0a38f5472b8c6cf8110813f74c
aquadran
noreply at scummvm.org
Wed Jul 9 05:29:07 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
b2333d9550 WINTERMUTE: Enable read/write double
Commit: b2333d95503a5d0a38f5472b8c6cf8110813f74c
https://github.com/scummvm/scummvm/commit/b2333d95503a5d0a38f5472b8c6cf8110813f74c
Author: PaweÅ KoÅodziejski (aquadran at gmail.com)
Date: 2025-07-09T07:29:02+02:00
Commit Message:
WINTERMUTE: Enable read/write double
Changed paths:
engines/wintermute/base/scriptables/script_ext_file.cpp
diff --git a/engines/wintermute/base/scriptables/script_ext_file.cpp b/engines/wintermute/base/scriptables/script_ext_file.cpp
index 5c4f7eb2cb5..ec261aa8175 100644
--- a/engines/wintermute/base/scriptables/script_ext_file.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_file.cpp
@@ -456,8 +456,7 @@ bool SXFile::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
//////////////////////////////////////////////////////////////////////////
// ReadDouble
//////////////////////////////////////////////////////////////////////////
- else if (strcmp(name, "ReadDouble") == 0) { // TODO: Solve reading a 8 byte double.
- error("SXFile::ReadDouble - Not endian safe yet");
+ else if (strcmp(name, "ReadDouble") == 0) {
stack->correctParams(0);
if (_textMode || !_readFile) {
script->runtimeError("File.%s: File must be open for reading in binary mode.", name);
@@ -598,16 +597,15 @@ bool SXFile::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
// WriteDouble
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "WriteDouble") == 0) {
- error("SXFile::WriteDouble - Not endian safe yet");
stack->correctParams(1);
- /* double val = */ stack->pop()->getFloat();
+ double val = stack->pop()->getFloat();
if (_textMode || !_writeFile) {
script->runtimeError("File.%s: File must be open for writing in binary mode.", name);
stack->pushBool(false);
return STATUS_OK;
}
- //fwrite(&val, sizeof(val), 1, (FILE *)_writeFile);
+ _writeFile->writeDoubleLE(val);
stack->pushBool(true);
return STATUS_OK;
More information about the Scummvm-git-logs
mailing list