1910 Commits

Author SHA1 Message Date
Max Horn
e59b4587b7 COMMON: Added a new IS_ALIGNED macro (for now using size_t, we can change it if this turns out to be not portable enough. Also added a doxygen comment to the ARRAYSIZE macro
svn-id: r39542
2009-03-19 21:43:27 +00:00
Paul Gilbert
52d6f3323b Added a syncString variation needed for the Cruise engine
svn-id: r39442
2009-03-16 09:16:56 +00:00
Max Horn
9cbed926cd Moved Tinsel::Serializer to Common::Serializer, so that I can use it in the SCI engine
svn-id: r39428
2009-03-15 20:30:57 +00:00
Max Horn
073cc060e9 Fixed warning in list code
svn-id: r39287
2009-03-10 02:41:35 +00:00
Max Horn
5181546c63 Rewrote Common::List iterator code to ensure const correctness is preserved.
We tried to implement the list iterators in a clever way, to reduce code
duplication. But this is essentially impossible to do properly, sadly --
this is one of the places where the ugly drawbacks of C++ really show.
As a consequence, our implementation had a bug which allowed one to
convert any const_iterator to an iterator, thus allowing modifying
elements of const lists.

This rewrite reintroduces code duplication but at least ensures that no
const list is written to accidentally.

Also fix some places which incorrectly used iterator instead of const_iterator
or (in the kyra code) accidentally wrote into a const list.

svn-id: r39279
2009-03-09 22:26:02 +00:00
Max Lingua
ccf9dedecb Modified HashMap ctr to skip _defaultVal() on PS2 to avoid gcc 3.2.2 ICE
svn-id: r39174
2009-03-07 05:01:56 +00:00
Max Horn
05b4370c21 Fix for bug #2664460: Various SeekableReadStream::seek() implementations (as well as our unit tests, ouch) handled SEEK_END incorrectly (using -offset instead of offset), contrary to what the docs said and what fseek does. Hopefully I found and fixed all affected parts, but still watch out for regressions
svn-id: r39135
2009-03-05 20:37:53 +00:00
Johannes Schickel
4542258336 Fix documentation, debug(C/N) prints to stdout not stderr.
svn-id: r39058
2009-03-01 22:09:46 +00:00
Max Horn
81943a9f8c COMMON: added a debugC variant which only takes a debug channel mask
svn-id: r39054
2009-03-01 21:47:57 +00:00
Eugene Sandulenko
5aa50ec889 Patch #2638336: Broken Sword PSX Support
svn-id: r38956
2009-02-28 10:46:33 +00:00
Willem Jan Palenstijn
de239a4bc5 Clarify timer API.
svn-id: r38938
2009-02-27 22:19:33 +00:00
Johannes Schickel
868b589af6 Commit patch #2641592 "Wrong type promotion for SharedPtr" with a slight formatting change.
svn-id: r38901
2009-02-26 13:54:21 +00:00
Max Horn
6eef86ef4c Fix my wrong comment on OSystem::updateScreen(). Now it is hopefully correct
svn-id: r38860
2009-02-24 21:22:04 +00:00
Max Horn
d3b715817d Add some remarks on OSystem::updateScreen() properties
svn-id: r38859
2009-02-24 21:15:23 +00:00
Max Horn
d7b3c04588 Moved FSDirectory implementation from common/archive.cpp to common/fs.cpp
svn-id: r38824
2009-02-24 03:22:34 +00:00
Max Horn
9b45dd2849 Modified FSDirectory::lookupCache to return a FSNode *pointer*, so that we can distinguish between lookup failures and invalid cache entries. Also changed SearchSet::createReadStreamForMember to not use hasFile anymore, based on the assumption that any Archive::createReadStreamForMember implementation has to verify whether the member name is valid anyway (clarified the doxygen docs accordingly)
svn-id: r38787
2009-02-22 16:48:02 +00:00
Max Horn
c397b37bfb Modified ZipArchive::createReadStreamForMember to check whether the zip archive contains a file with the given name
svn-id: r38786
2009-02-22 16:27:48 +00:00
Max Horn
f6de07921e Changed Common::File and FSDirectory to invoke FSNode::exists a few times less, reducing overhead
svn-id: r38780
2009-02-22 04:40:10 +00:00
Travis Howell
21a13c3219 Disable MSVC warning, which is frequently paranoid.
svn-id: r38575
2009-02-20 03:56:42 +00:00
Johannes Schickel
1cb39726e5 Fix documentation, warning prints to stderr not stdout.
svn-id: r38490
2009-02-18 16:35:24 +00:00
Willem Jan Palenstijn
f23b6f91b7 typo
svn-id: r38440
2009-02-17 19:54:11 +00:00
Filippos Karapetis
5b8d0a77ff Added an "equals" function to Common::Rect (used by SCI)
svn-id: r38428
2009-02-17 17:44:04 +00:00
Max Horn
6098cadde3 More paranoia checks
svn-id: r38339
2009-02-16 01:58:20 +00:00
Max Horn
bf6a7c1d72 cleanup
svn-id: r38338
2009-02-16 01:04:19 +00:00
Johannes Schickel
5417f6bacb - Replace OSystem::clearScreen with OSystem::fillScreen as discussed on -devel.
- Update BaseBackend and DC port to properly implement OSystem::fillScreen (now only PalmOS has to be updated).
- Update all client code which relied on OSystem::clearScreen so far.

svn-id: r38304
2009-02-15 21:20:21 +00:00
Max Horn
17014c4f47 Merged internal 'matchPath' method of class Archive into global matchString function (via an optional 'path mode' in the latter). Also changed Archive::listMatchingMembers to use path mode when matching, just like FSDirectory::listMatchingMembers
svn-id: r38277
2009-02-15 18:45:53 +00:00
Oystein Eftevaag
a99e3e3fa6 Merged rev 38209 from 0.13 to trunk: XML parsing fix
svn-id: r38241
2009-02-15 14:00:41 +00:00
Torbjörn Andersson
5bf56fe991 Changed OverlayColor from int16 to uint16 to fix the strange colours that
appeared in the GUI with r36288. At least, it fixes the problem for me. I hope I
didn't accidentally break anything else.

svn-id: r36298
2009-02-13 06:17:43 +00:00
Max Horn
e7afcecda2 Removed default implementations of OSystem::getOverlayHeight() and getOverlayWidth()
svn-id: r36152
2009-01-30 16:23:41 +00:00
Max Horn
f49e0667a4 Document OSystem::copyRectToOverlay params more explicitly (esp. the pitch param, which differs from that of copyRectToScreen)
svn-id: r36150
2009-01-30 16:16:52 +00:00
Max Horn
341bc64aaf do not include common/debug.h from common/util.h
svn-id: r36143
2009-01-30 05:25:17 +00:00
Max Horn
7cb437b56f Renamed SpecialDebugLevel to DebugChannel
svn-id: r36142
2009-01-30 05:10:24 +00:00
Max Horn
7b50c293e6 Switched special debug levels to using a hashmap internally
svn-id: r36141
2009-01-30 05:03:04 +00:00
Max Horn
76deee02d6 Some more 'special debug levels' tweaks
svn-id: r36140
2009-01-30 04:52:53 +00:00
Max Horn
de7c89e381 Some work on the 'special debug levels' aka 'engine debug levels' code
svn-id: r36139
2009-01-30 04:42:30 +00:00
Max Horn
c69ebfd798 Moved default implementations for various OSystem methods into a new class BaseBackend
svn-id: r36135
2009-01-30 03:35:47 +00:00
Max Horn
1d097d9791 Moved debug() etc. and special debug flag handling code to common/debug.*; also some tweaks to the code
svn-id: r36134
2009-01-30 01:17:12 +00:00
Max Horn
28cf213605 Moved AdvancedDetector from common/ to engines/
svn-id: r36132
2009-01-29 22:13:01 +00:00
Max Horn
7eaafd933f Be paranoid about g_system being set
svn-id: r36131
2009-01-29 22:09:06 +00:00
Max Horn
abc76c6ddc cleanup
svn-id: r36128
2009-01-29 17:43:55 +00:00
Max Horn
ac59693be2 A ton of code formatting fixes; also fixed warnings about single line loops like 'while(cond);' by inserting newlines
svn-id: r36127
2009-01-29 05:26:12 +00:00
Max Horn
14c5bbbccf Renamed Archive::openFile to createReadStreamForMember
svn-id: r36021
2009-01-23 04:45:44 +00:00
Max Horn
9861afd8fd Renamed ArchiveMember::open -> createReadStream, and made it a cv member (const); same for Archive::openFile
svn-id: r36020
2009-01-23 04:36:18 +00:00
Max Horn
8f16458e9b Renamed FSNode::openForReading / openForWriting to createReadStream / createWriteStream, again to make ownership of the returned stream clear
svn-id: r36014
2009-01-23 03:41:36 +00:00
Max Horn
e4b013f616 Renamed OSystem::openConfigFileForReading & openConfigFileForWriting to createConfigReadStream & createConfigWriteStream, in order to make it clear that the *caller* is responsible for deleting the streams (i.e., 'owns' them)
svn-id: r36013
2009-01-23 03:30:40 +00:00
Max Horn
83b3f336b4 cleanup
svn-id: r36009
2009-01-23 02:30:09 +00:00
Max Horn
abc06ca18e Moved Graphics::PixelFormat into its own header file; turned RGBToColor etc. into methods, and added an operator==
svn-id: r35993
2009-01-22 04:35:10 +00:00
Max Horn
53cd1361c5 Made Common::Stack return refs, thus ensuring that it matches exactly the behavior of FixedStack; added unit tests
svn-id: r35974
2009-01-21 02:23:09 +00:00
Johannes Schickel
cd952a7c27 Whoops it seems the comment used "backslashes" instead of "slashes" in other places too.
svn-id: r35949
2009-01-20 12:44:44 +00:00
Johannes Schickel
c0cd121ffd Fixed typo in comment.
svn-id: r35948
2009-01-20 12:37:05 +00:00