Commit Graph
23 Commits
Author SHA1 Message Date
Walter Agazzi aa45beee50 AGS: Common: ensure Close and Seek from BufferedStream
a pointer could cause it to call parent close due to virtual
From upstream c8760b810242d6b0c6b4cd5f92057918e13d29a0
2024-10-30 18:07:42 +02:00
Walter Agazzi 496afb9a35 AGS: Common: fixed Seek return value for stream sections
From upstream 3d6e90b3dd0c4ed2af7a1094b8eace036721363a
2024-10-30 18:07:42 +02:00
Walter Agazzi dc16de544e AGS: Common: Stream::Seek() returns new position
This was done for the IAGSStream in plugin api in the first iteration,
 but lost when fixing the api recently.
 From upstream e248f320074d8430f14c1c4e513e5fb120e55eb2 and
 76b49c0c7a4df46b06aebea86573999f29400809
2024-10-30 18:07:42 +02:00
Walter Agazzi 25e4c703d7 AGS: Common: fixed BufferedStream::WriteByte return value
From upstream 98db4c4527684d872d96c150fd25417514239c78
2024-10-30 18:07:42 +02:00
Walter Agazzi b4f9385a3f AGS: Engine: fixed BufferedStream::Seek return value
It turns out our Stream's Seek return value is not defined, and not documented
either. But judging by the other Stream implementations, it was supposed to return
positive whenever there's NO ERROR, regardless of whether the position is matching
user's request.
I suppose we may also make Seek return the resulting position, similar to how some
other libs do (e.g. see SDL and .NET Framework).
From upstream 208fd913225d0732060744fa3b2377a265ad89a3
2024-10-30 18:07:42 +02:00
Hubert Maier e94b47c01a JANITORIAL: AGS: Fix typos 2024-09-11 11:01:26 +03:00
Le Philousophe 49b4c1b3c4 AGS: Revert to use std namespace
This allows to minimize changes from upstream
2024-07-08 21:37:28 +02:00
Paul Gilbert c2a476411c AGS: Move std namespace into common/std/ 2024-07-07 15:28:31 -07:00
Walter Agazzi a76b930e87 AGS: Common: bufferedstream add default and remove unused break
From upstream 957ad1ad7cb2d1df396f57de52c3808c28c53bb6
2023-03-12 20:58:28 +00:00
Thierry Crozat 9a14045e0e AGS: Common: fixed linker error at BufferedStream::BufferSize
From upstream 919f14226d1391bdee7ea50ac4825414b4dd5e95
2022-12-15 22:40:17 +01:00
Thierry Crozat 5c8287dfec AGS: Common: fixed BufferedSectionStream not preventing read past end
There have been this stupid oversight all along since the introduction
of the class: while it reported Length and EOS correctly, it still
allowed to read past the end.

This can cause issues if the user code relies, for example, on Read()
or ReadByte() return value.

For upstream code, in practice this fixes MP3 streaming, where the length
of data is not always possible to precalculate. In ScummVM we used a
different code for MP3, but this may fix other cases as well.

From upstream 6f02bedc65b902ce41858b7e92970662020a11cf
2022-12-15 22:40:17 +01:00
D G Turner 8af2dc3a8c AGS: Fix Remaining Compiler Warnings 2022-06-17 12:19:37 +01:00
Thierry Crozat 9789a32bac AGS: In BufferedStream skip buffering if reading large chunk at once
From upstream 8137918c209a479edf5127bb7c21d29470b8c40e
2022-06-16 23:16:20 +01:00
Thierry Crozat 98bb288bbe AGS: Fixed BufferedStream may overwrite dest with clear buffer
From upstream 39c8f628575eeabff1ed583b43bd6c58530c6b24
2022-06-15 22:13:02 +01:00
Thierry Crozat 56154c8065 AGS: Made BufferedStream work as expected in writing mode
From upstream 97eebe7b91010ad9e507de5c8b9c2515bb8d6cfd
2022-06-15 02:22:03 +01:00
Thierry Crozat 01dd8d5abf AGS: Clean BufferedStream code
Part of upstream 82a928cb07970acc5918905c5836c39ce11b7f32
(Tests: added BufferedStream tests)

This commit has no functional change but allows to keep the code
in ScummVM close to upstream code.
2022-06-15 02:22:03 +01:00
Paul Gilbert eb7421400c AGS: Use empty() to check for emptiness in vector
From upstream 166803dd6cb99851e424f9eb9d150169cd3909fe
2022-05-10 21:18:00 -07:00
Paul Gilbert b1649597d7 AGS: Replaced Math/std Min/Max with ScummVM macros
Inspired by 6dee5ee6f271c600e30879d892295ea6069e8cc9
2022-05-05 22:41:10 -07:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Paul Gilbert 3f215aa374 AGS: Added BufferedSectionStream, limited to an offset range
From upstream e7d6d4927a073f405012ca0c97361e7d519637a8
2021-07-31 14:34:08 -07:00
Paul Gilbert e584f41a4c AGS: fixed BufferedStream was not closing file handle on error
From upstream 399371a7fafcb5560a2836186f23090acf92d263
2021-06-13 21:09:07 -07:00
Paul Gilbert b104d78888 AGS: Enabling disabled blocks, and making ScummVM needed changes 2021-06-13 21:08:50 -07:00
Paul Gilbert 701396361c AGS: Import of fresh codebase 2021-06-13 21:08:44 -07:00