Commit Graph
18 Commits
Author SHA1 Message Date
Lars Sundström 49e30c93cd AGS: Remove function FileCloseNotify
In AGS there is a possibility to define a function, FileCloseNotify
with arguments, which is called when closing a file. This possibility
seems not to be used by any of the engines supported by ScummVM since
it's set to nullptr. This is not a problem in itself. Hoewever when
enabling compiler optimisiations the compiler may optimise away the
FileCloseNotify definition. This was discovered when compiling iOS
with Apple Clang in "Release" mode that the if-case in the code block
below was removed while the args parameter was left:
    if (FileCloseNotify) {
         CloseNotifyArgs args;
         args.Filepath = _fileName;
         args.WorkMode = _workMode;
         FileCloseNotify(args);
     }

This caused a nullptr exception since FileCloseNotify was nullptr.
A bit strange behavior by the compiler which could remove the entire
code block above.

Since the FileCloseNotify is not used in ScummVM, remove it as it
only seems to be used in upstream by the emscripten code which is
not part of the ScummVM repository.
2023-07-21 16:48:03 +02:00
Walter Agazzi a8df307602 AGS: Common: add Close Notify to FileStream
- with FileStream::FileCloseNotify we can run an event when a file closes
- the arguments are a struct so we can expand them later if needed easily

From upstream 2c170cacb84f56004d86d8e981710777c9c09554
2023-04-29 13:11:41 +02:00
Le Philousophe ef4ac3b728 AGS: Fix FileStream::EOS when used on a file opened for writing
EOS should always return false in this case.
2023-02-12 11:17:36 +01:00
Vladimir Serbinenko 9caa5324bc AGS: Switch from getFSNode to getFile to hide whether file comes from an archive 2022-11-18 01:22:59 +01:00
Paul Gilbert 662e9794ad AGS: Remove excessive validity checks in stream classes
From upstream 3ed254586a28e2f8ebe0e81b7a44270f3736efd6
2022-04-08 22:17:52 -07:00
Paul Gilbert 31e9bef490 AGS: Avoid crash trying to open files that don't exist 2022-03-27 13:37:12 -07:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Alexandre Detiste 6044504762 JANITORIAL: typos
some in the variable names, some in the comments;
no change for the strings that interract with original games assets
2021-10-31 20:46:31 +01:00
Paul Gilbert 1fa744d6b6 AGS: Correct save files to be created without compression 2021-09-01 21:38:37 -07:00
Paul Gilbert 94be258edb AGS: Consolidate opening save files for writing 2021-09-01 18:54:38 -07:00
Thierry Crozat db91429405 AGS; Fix opening stream in append mode 2021-08-31 17:36:12 +01:00
Paul Gilbert e455d1ba1a AGS: Simultate opening existing save files for read/write
When the open mode of kFile_Create is passed, files are
meant to be opened in read/write mode if they already exist,
rather than simply replacing them. The code of this commit
should allow this to be simulated, by opening the file first
for reading, and then duplicating into a new OutSaveFile for
writing
2021-08-30 21:45:09 -07:00
Paul Gilbert 92322ef01a AGS: Simplify FileStream now that save files support seeking 2021-08-08 18:13:30 -07:00
Max Horn b7e6d61669 JANITORIAL: Fix compiler warnings about unused code 2021-08-07 10:46:14 +02:00
Paul Gilbert eb1e337edd AGS: Removed String's "const char*" conversion operator
From upstream 7c426674e7e53bffe9120f8ffc059b77fa03a606
2021-06-13 21:08:59 -07:00
Paul Gilbert 91c7eeef14 AGS: Provided String method variants with "const String&" argument
From upstream 1e33b06b3329b6b0a79c9fe818c012741c08ae2a
2021-06-13 21:08:57 -07:00
Paul Gilbert e468302585 AGS: Standardize the AGS String npos 2021-06-13 21:08:53 -07:00
Paul Gilbert 701396361c AGS: Import of fresh codebase 2021-06-13 21:08:44 -07:00