Commit Graph

190 Commits

Author SHA1 Message Date
Eugene Sandulenko
e373c9b7b5 - Revert my last change with moving addDefaultDirectory() from TheneNew.cpp
- Removed locking of further directory adds because it did not work for themes.

svn-id: r21452
2006-03-25 19:30:10 +00:00
Travis Howell
a98aea6efd Add kListAllNoRoot type to listDir() to handle recent file class changes, on file system backends which use _isPseudoRoot
svn-id: r21449
2006-03-25 10:39:05 +00:00
Eugene Sandulenko
22042bc637 - Implemented case insensitive file reading. Left old system as a fallback
in case some engine writer decide to do something unwise
- Removed used of ConfMan.getKey("path") in file-related cases, because
  now File class handles that
- Fixed bug in ScummEngine_v80he::o80_getFileSize() where path delimiters
  weren't translated

svn-id: r21443
2006-03-25 04:17:17 +00:00
Oystein Eftevaag
dabfcbf10c Moving the MacOS bundle file checking to another function, it was getting called redundantly.
svn-id: r21309
2006-03-15 09:41:22 +00:00
Oystein Eftevaag
58eed3830b * 'make bundle' now copies the default theme files into the bundle.
* Common::File will now look inside the application bundle on MacOS X for a file if
it can't find it anywhere else (so it'll find default-theme.ini and .zip)
* Cleaned up some #ifs.

svn-id: r21308
2006-03-15 07:43:44 +00:00
Max Horn
36934b611d Change CVS keywords to SVN keywords
svn-id: r20510
2006-02-11 09:53:53 +00:00
Eugene Sandulenko
ea42bad781 Update copyright notice
svn-id: r20088
2006-01-18 17:39:49 +00:00
Eugene Sandulenko
b36677af71 Update FSF address. Eek. Actually that took place on May 1, 2005
svn-id: r19142
2005-10-18 01:30:26 +00:00
Chris Apers
c6c22db6ae Change PalmOS ident
svn-id: r18746
2005-09-03 16:12:52 +00:00
Max Horn
b75c969e66 Moved class File and the MD5 stuff to namespace Common
svn-id: r18037
2005-05-10 22:56:25 +00:00
Max Horn
52bbc86797 Patch #1181544 (AmigaOS 4 changes)
svn-id: r18011
2005-05-09 21:21:21 +00:00
Travis Howell
789007ec67 Check for a '\' before adding slash too, otherwise starting a game in root directory will fail.
svn-id: r17763
2005-04-23 09:21:41 +00:00
Max Horn
969ef3dac9 * Added new virtual base class 'Stream', ReadStream and
WriteStream are now subclasses of it.
* Added new methods eos(), ioFailed(), clearIOFailed() to
  all streams. This allows better error checking.
* SaveFile classes take advantage of these new standard
  stream APIS
* Removed File::gets()
* Added SeekableReadStream::readLine() (replaces File::gets)
* Added WriteStream::writeString, for convenience

svn-id: r17752
2005-04-22 17:40:09 +00:00
Max Horn
bc44b5ec15 Added new interface SeekableReadStream
svn-id: r16493
2005-01-09 01:41:43 +00:00
Max Horn
47280d9433 Updated copyright
svn-id: r16398
2005-01-01 16:09:25 +00:00
Max Horn
b78ac6a18b Make use of our String class instead of juggling with char pointers; added File::exists method
svn-id: r15913
2004-11-27 15:09:53 +00:00
Eugene Sandulenko
0b3949389e Extend fopenNoCase with probe of capitalized files, such as Cave.mid.
svn-id: r15812
2004-11-14 21:10:50 +00:00
Max Horn
f6d9b66e21 For now, perform writing always in the current directory (the old code would just create a new file in the first place it was looking at when using the write mode, which definitely is not what we want in most cases)
svn-id: r15730
2004-11-07 17:20:32 +00:00
Torbjörn Andersson
1fa79b09de Got rid of ungetc() to save Chrilith from the trouble of implementing it
himself on PalmOS.

svn-id: r15616
2004-10-19 18:28:41 +00:00
Eugene Sandulenko
acf6e4a12f Accepted patch #1048693 -- Making File::gets() more well-defined.
svn-id: r15608
2004-10-18 21:22:10 +00:00
Eugene Sandulenko
2337d924ce Fix bug #1048129 which prevented eof() method from working.
svn-id: r15573
2004-10-16 18:40:06 +00:00
Eugene Sandulenko
54dc902ae4 Add gets() method to File class.
svn-id: r15572
2004-10-16 13:09:52 +00:00
Max Horn
61bf615168 Try the current dir last, not first
svn-id: r14469
2004-08-05 11:10:27 +00:00
Max Horn
cef2de6a69 Fixed bug #1001069; clarified/simplified some error messages
svn-id: r14375
2004-07-31 09:34:10 +00:00
Max Horn
1db27f0203 slightly more informative error messages in class File
svn-id: r14345
2004-07-26 22:53:29 +00:00
Max Horn
3381b831eb Allow subclasses to modify File class members (e.g. to set _ioFailed); change some warnings into errors
svn-id: r14302
2004-07-23 01:39:05 +00:00
Max Horn
006cac577d Simplified fopenNoCase (and reduced the code redundancy)
svn-id: r14252
2004-07-18 17:08:10 +00:00
Eugene Sandulenko
3423c617a1 Fix bug introduced with last addDefaultDirectory() change. It prevented
lowercase files from opening.

svn-id: r14148
2004-07-01 12:18:28 +00:00
Max Horn
a5df4fba77 Added simple ref-counting to the File class
svn-id: r14106
2004-06-28 22:34:22 +00:00
Max Horn
53af3dc670 Enhanced default directory support in the File class; now one can specify arbitrary many default search directories
svn-id: r14095
2004-06-28 00:06:31 +00:00
Max Horn
b8ad54b3af Reversed param order of File::open() -- this allowed me to get rid of a few more getGameDataPath() calls
svn-id: r14090
2004-06-27 22:14:35 +00:00
Max Horn
9defe4fc18 Removed XOR encoding stuff from File class; instead the new Scumm::XORFile class provides this functionality now
svn-id: r13597
2004-04-17 16:29:03 +00:00
Max Horn
ae50adfd31 Fix byte reads
svn-id: r13596
2004-04-17 12:42:40 +00:00
Max Horn
e17a15d96e Introduce ReadStream and WriteStream (as explained in my File class design mails on scummvm-devel)
svn-id: r13595
2004-04-17 09:57:15 +00:00
Travis Howell
9271ca5233 Previous method wouldn't work, since each langague is in different directory.
svn-id: r12810
2004-02-10 10:56:16 +00:00
Travis Howell
c29e0d2dd0 Add extra paths for international version of Simon the Sorcerer 1, so game can be played from CD.
svn-id: r12745
2004-02-06 00:58:24 +00:00
Jonathan Gray
1356d4c354 add missing comma to ensure all directories are checked
svn-id: r12177
2004-01-06 12:52:08 +00:00
Max Horn
033ff78ae9 updated copyright notice
svn-id: r12176
2004-01-06 12:45:34 +00:00
Travis Howell
8640153331 Search additional folder for BS1
svn-id: r11956
2003-12-27 05:43:03 +00:00
Max Horn
88873d5b31 be stricter about File::open params
svn-id: r11919
2003-12-25 17:52:25 +00:00
Max Horn
81f210544a cleanup
svn-id: r11432
2003-11-30 00:06:27 +00:00
Travis Howell
6c814c4864 Add extra directory checks for Macintosh versions of indy3/loom
svn-id: r11333
2003-11-18 00:55:40 +00:00
Max Horn
5301edc383 some cleanup
svn-id: r10720
2003-10-10 13:55:08 +00:00
Travis Howell
3854ce8f3d Add Acorn version of Simon the Sorcerer 1 Talkie
svn-id: r10389
2003-09-24 06:19:30 +00:00
Max Horn
468275bb94 added a static method setDefaultDirectory to class File; used this to simplify some code; added a global g_sound pointer in bs2, this cuts down on uses of g_sword2 (of course both should be removed on the long run); some other minor tweaks/fixes
svn-id: r10278
2003-09-17 21:06:16 +00:00
Max Horn
1d60dc552d delete name only after closing the file
svn-id: r10270
2003-09-17 13:28:48 +00:00
Max Horn
110152ddcf moved declaration of error/warning/debug from engine.h to util.h
svn-id: r10149
2003-09-10 12:15:51 +00:00
Chris Apers
a304d550c0 Some files are located in a different folder in Atari-ST version of Zak
svn-id: r10087
2003-09-08 12:59:08 +00:00
Jonathan Gray
a02eba1bee add sword2 cd dirs
svn-id: r9816
2003-08-22 06:40:29 +00:00
Jonathan Gray
ce42f4d3dd patch #791738 g++ 3.4 compile fix, from Falk Hueffner and a few minor local bits in my tree
svn-id: r9807
2003-08-21 13:39:21 +00:00
Travis Howell
04cd9d8375 mingw compile broken when include order was changed
svn-id: r9363
2003-08-01 13:16:23 +00:00
Max Horn
0df319e952 #include cleanup (explicityl specify the location for headers from common/, so that we at some point can get rid of -Icommon; exception is made for stdafx.h, since a) we might want to rename it and b) might want to move it to the top level)
svn-id: r9359
2003-08-01 12:21:04 +00:00
Torbjörn Andersson
7404d5662d Made read() return the number of bytes that were actually read, rather than
the number that was requested. A lot of our code obviously assumes this
behaviour, and the MP3 file player depends on it because otherwise, when
reaching the end of the file, it will think it read a full buffer, when in
fact it only got part of it and the rest is the remains from the previous
read.

This would cause a brief note from earlier in the track at the end of the
MI1 chapter one screen. Probably other cases as well.

Of course, this may cause regressions but only - I think - if the code was
buggy to begin with.

svn-id: r8721
2003-07-03 07:03:18 +00:00
Paweł Kołodziejski
91cf11e99c ops
svn-id: r8667
2003-06-27 05:11:16 +00:00
Paweł Kołodziejski
0ccd872187 chenged ifdef to handle all win32 ports
svn-id: r8666
2003-06-27 05:10:11 +00:00
Bertrand Augereau
dd5bd03dc9 Parentheses didn't compile on WIN32
svn-id: r8512
2003-06-15 18:56:41 +00:00
Max Horn
9658dd6ea3 fixed aquadran's Windows fix (a pointer is const for good reasons; simply casting it to something non-const is bad, and undermines the compilers aliasing detection
svn-id: r8481
2003-06-14 18:20:56 +00:00
Paweł Kołodziejski
a42fa9e25c fix for bug #749249, related with path of game data placed on root drive under win98
svn-id: r8478
2003-06-14 16:45:38 +00:00
Max Horn
2dd2e99cab the _encbyte code was evil, because it modified the memory passed to write(); worse, though, it incremented ptr2, which then was later passed to fwrite - hence if used to write something while _encbyte != 0, write() resulted in wrong data being written
svn-id: r8055
2003-05-28 19:03:12 +00:00
Max Horn
3fae6fbf46 added some missing checks for file being open before reading/writing
svn-id: r8043
2003-05-28 02:06:53 +00:00
Max Horn
ffac2da5aa added fixme comment
svn-id: r7791
2003-05-21 17:29:51 +00:00
Max Horn
d6cf47dfaa Patch #739911: Fix for undefined behaviour in fopenNoCase()
svn-id: r7695
2003-05-19 19:19:32 +00:00
Jonathan Gray
a2da94d580 fix leak
svn-id: r7244
2003-05-01 12:36:36 +00:00
Max Horn
81c3ade331 more PalmOS changes
svn-id: r7220
2003-04-30 12:43:56 +00:00
Joost Peters
81ac7cc8f8 fixed GP32 port
svn-id: r6958
2003-04-10 13:44:50 +00:00
Paweł Kołodziejski
aa3766018f updated copyrights headers
svn-id: r6726
2003-03-06 21:46:56 +00:00
Paweł Kołodziejski
6ce098172f next pedantic cleanup code
svn-id: r6714
2003-03-06 16:27:06 +00:00
Max Horn
727399ad0e search for files in voices/ subdir (useful for Simon2Mac)
svn-id: r6409
2003-01-12 01:06:28 +00:00
Max Horn
80fde14548 indention
svn-id: r6369
2003-01-09 14:50:35 +00:00
Max Horn
7692091a9c File object stores file name (useful for debugging)
svn-id: r6089
2002-12-24 02:02:53 +00:00
Travis Howell
e03be389de Added simon sound bugfix, patch #632518
Added fix for simon sound-related crash, patch #632517

svn-id: r5377
2002-11-02 10:51:32 +00:00
Max Horn
6e5ff6884f fixed warnings (and simplified the code, gosh, aquadran, why so complicated? :-)
svn-id: r5264
2002-10-22 23:36:54 +00:00
Paweł Kołodziejski
3c2a409b11 cleanup array
svn-id: r5250
2002-10-22 20:40:51 +00:00
Max Horn
03daa01caf don't shadow vars
svn-id: r5237
2002-10-22 11:35:45 +00:00
Max Horn
060ded9ee7 don't shadow vars
svn-id: r5236
2002-10-22 11:34:21 +00:00
Max Horn
8af300fec3 The terms Word and DWord are somewhat Windows centric; in fact there are systems on which word is 32bit, as opposed to our 16 bits. Hence, use the uin16/uint32 naming scheme, which is not ambigious
svn-id: r5216
2002-10-21 13:23:25 +00:00
Ruediger Hanke
068042781f Appending a slash in all cases breaks some games on MOS
svn-id: r4961
2002-09-17 21:45:13 +00:00
Paweł Kołodziejski
f7ff5c67fa improved open function in File class
svn-id: r4945
2002-09-15 19:28:34 +00:00
Max Horn
f2da602963 factored out the case-insensitive fopen into its own function - makes it easier to adapt all the code to use it. TODO: improve it to work like in exult, i.e. sometimes other parts of the path have to be changed to upper/lower case (e.g. video vs. VIDEO)
svn-id: r4935
2002-09-13 18:02:34 +00:00
Max Horn
fd91bb67dc ugh! yes, negative offsets for seek do occur! Thus using an unsigned isn't such a good choice for the offset parameter
svn-id: r4927
2002-09-13 12:16:03 +00:00
Paweł Kołodziejski
dcf05149fe changed scumm file io to class File
svn-id: r4920
2002-09-10 07:34:27 +00:00
Max Horn
523d8e64c0 rewrote config class; cleanup; code restructuring
svn-id: r4903
2002-09-08 01:08:12 +00:00
Paweł Kołodziejski
5b4f2cefef added write support to File
svn-id: r4900
2002-09-02 22:06:26 +00:00
Paweł Kołodziejski
e0dcf4d8ec removed (+ pos)
svn-id: r4899
2002-09-02 21:12:57 +00:00
Paweł Kołodziejski
bb6bff1b5e corrected lower/upper changes in File
svn-id: r4898
2002-09-02 20:53:12 +00:00
Paweł Kołodziejski
687e82c0fa fixes
svn-id: r4897
2002-09-02 20:15:14 +00:00
Paweł Kołodziejski
ca03c9b5fc changed file io in sounds to class File
svn-id: r4896
2002-09-02 07:53:43 +00:00
Max Horn
a39711e256 fixed compilation on Mac OS X; some cleanup; moved header file scumm/smusH/rect.h to common/rect.h
svn-id: r4877
2002-08-31 13:29:10 +00:00
Paweł Kołodziejski
e8c4f2099c updated
svn-id: r4875
2002-08-31 09:55:58 +00:00
Paweł Kołodziejski
bd7b93061b added class File
svn-id: r4873
2002-08-31 07:43:34 +00:00