Commit Graph

113 Commits

Author SHA1 Message Date
Johannes Schickel
b2693c81ec SWORD25: Fix compilation, caused by zlib.h including unistd.h 2011-05-02 17:19:54 +02:00
Ori Avtalion
9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
Alyssa Milburn
a762173794 SWORD25: Always create the MoviePlayer, even without USE_THEORADEC. 2011-04-14 18:45:45 +02:00
Filippos Karapetis
832cfddf34 SWORD25: Cache related changes
- Increase the resource cache limits
- Added a check before forcing resources to be freed
- Only force free image and animation resources, with a warning. It seems like there is
a bug in the resource reference code and several bitmap resources are not freed - added
a FIXME
- Clarify that initializeAnimationResource() is used with XML resources

svn-id: r55736
2011-02-02 19:32:04 +00:00
Filippos Karapetis
a4a09ac284 SWORD25: Added a cache minimum and maximum limit, so that the resources loaded will always be inside these limits. Resources can now be forcefully unlocked when the upper limit is reached
svn-id: r55722
2011-02-02 15:35:05 +00:00
Filippos Karapetis
5978d8f63d SWORD25: Marked several unused LUA callbacks as dummy functions. Some cleanup.
svn-id: r55597
2011-01-28 17:29:08 +00:00
Filippos Karapetis
7ed5a92823 SWORD25: Removed some more unused/unimplemented debug code
svn-id: r55595
2011-01-28 17:02:02 +00:00
Filippos Karapetis
c63ff39a7f SWORD25: Resources are now cleaned up correctly
The original checked the total amount of memory occupied by all resources. This has been
changed to a maximum number of simultaneous resources instead, so the game resources
are no longer leaked. Also disabled the unused or debug functions getUsedMemory(), 
setMaxMemoryUsage(), setMaxMemoryUsage(), isLogCacheMiss(), setLogCacheMiss(). Performed
some cleanup on code related to the above.

svn-id: r55594
2011-01-28 16:54:55 +00:00
Filippos Karapetis
a2f9600179 SWORD25: Disabled the mechanism which precaches all of the game's resources on startup.
This reduced the initial memory used by 100MB for me, though the game keeps allocating
new resources in each scene without deleting them, because of the missing functionality in
getUsedMemory(). This change also slightly reduces the loading time on game startup.

svn-id: r55593
2011-01-28 16:13:12 +00:00
Filippos Karapetis
1f1cb1f140 SWORD25: Removed the logErrorLn and logWarningLn wrappers
svn-id: r55488
2011-01-24 00:03:09 +00:00
Filippos Karapetis
1250785822 SWORD25: Replaced BS_ASSERT() with assert()
svn-id: r55464
2011-01-23 15:01:24 +00:00
Filippos Karapetis
00a0f8d15d SWORD25: Removed the custom log class and replaced it with warning/error/debugC calls
svn-id: r55462
2011-01-23 14:49:50 +00:00
Max Horn
5d2b77899f SWORD25: Fix warning: deref type-punned pointer breaks strict-aliasing rules
svn-id: r54550
2010-11-28 21:33:02 +00:00
Max Horn
2180b2d6b5 COMMON: Split common/stream.h into several headers
svn-id: r54385
2010-11-19 17:03:07 +00:00
Johannes Schickel
2c042c263b SWORD25: Comment out unused static variable.
svn-id: r53909
2010-10-28 22:45:15 +00:00
Paul Gilbert
b53d12da23 SWORD25: Standardised savegame filenames, start on advanced engine features
svn-id: r53901
2010-10-28 09:51:56 +00:00
Max Horn
b2fa7e58a3 SWORD25: Start to rename read/write methods of *PersistenceBlock classes
All should be renamed to reduce risk of accidental incorrect use.

svn-id: r53899
2010-10-28 00:26:25 +00:00
Max Horn
cf3551525f SWORD25: Get rid of CallbackRegistry
svn-id: r53898
2010-10-28 00:25:33 +00:00
Max Horn
ed0de8462d SWORD25: Add FIXME about savegame names; cleanup
svn-id: r53839
2010-10-25 23:34:12 +00:00
Max Horn
a783285625 SWORD25: Simplify FS 'wrapper' code a bit, add FIXME comments
The save system of this engine currently partially bypasses the
SaveFileManager API, by (abusing) the fact that the Lua engine allows
creating files in arbitrary places (it exposes fopen, fread, fwrite
etc.). This is used to create a 'config.lua' configuration file. This makes it non-portable.

In addition, the filenames used for the savestates ("0.b25s") do not
comply with our naming conventions for engine savestates.

It should be possible to overcome all this, but it might require hacking
the Lua engine; or we could try to replace some of the BS2.5 script
functions with our own, dynamically.

svn-id: r53838
2010-10-25 23:19:39 +00:00
Max Horn
e761f76653 SWORD25: Get rid of most of the 'kernel service/superclass' code
svn-id: r53835
2010-10-25 22:41:25 +00:00
Max Horn
90dcc8c91a SWORD25: Get rid of classes ScummVMWindow and Window
svn-id: r53832
2010-10-25 21:51:11 +00:00
Max Horn
518526ba2f SWORD25: Remove some dead code; cleanup
svn-id: r53760
2010-10-24 01:53:32 +00:00
Max Horn
fa0151683c SWORD25: Replace ResourceManager's hash table by a Common::HashMap
svn-id: r53759
2010-10-24 01:53:01 +00:00
Max Horn
48d15398e5 SWORD25: Get rid of kernel/string.h
svn-id: r53758
2010-10-24 01:52:27 +00:00
Paul Gilbert
14e82dbe7f SWORD25: Added description field to savegames
This stores the date and time of when the game was saved, since ScummVM doesn't support getting a file's age like the original engine did.

svn-id: r53638
2010-10-20 11:11:09 +00:00
Paul Gilbert
66ecd08868 SWORD25: Fix to correctly write game state to savegame files
svn-id: r53637
2010-10-20 10:53:50 +00:00
Eugene Sandulenko
6629efc676 SWORD25: Enforced code formatting rules in rest of the engine
svn-id: r53626
2010-10-19 21:03:33 +00:00
Eugene Sandulenko
bbd95da899 SWORD25: Fix engine exit when running without theoradec
svn-id: r53622
2010-10-19 20:52:06 +00:00
Max Horn
4caa1d40a8 SWORD25: Simplify log listener code (and get rid of another global constructor)
svn-id: r53610
2010-10-19 09:44:48 +00:00
Max Horn
d6b7ebab16 SWORD25: Some code cleanup
svn-id: r53608
2010-10-19 09:44:13 +00:00
Max Horn
ddf0a3d80c SWORD25: Move BS_ServiceInfo to service_ids.h and turn it into a POD struct
svn-id: r53607
2010-10-19 09:43:53 +00:00
Max Horn
88bca8e13d SWORD25: Optimize ReverseArray, move it to only place it is used
svn-id: r53606
2010-10-19 09:43:31 +00:00
Paul Gilbert
355032d4f9 SWORD25: Fix cppcheck warnings in BS_Log::LogPrefix
The LogPrefix method isn't currently used, but I'm fixing it just in case it's ever used again

svn-id: r53602
2010-10-19 08:12:04 +00:00
Torbjörn Andersson
9744167adc SWORD25: Fix infinite recursion
If I understand this, we don't need to call Kernel::GetInstance()
when we are already in the Kernel class. In this particular case,
_RegisterScriptBindings() is called from the Kernel constructor, so
it gets called again and again because _Instance hasn't yet been set.

svn-id: r53512
2010-10-15 20:01:13 +00:00
Max Horn
550073ee04 SWORD25: Do not use Kernel::GetService directly anymore
svn-id: r53477
2010-10-15 12:18:19 +00:00
Johannes Schickel
bc2781fdb3 SWORD25: Semi-colon cleanup.
svn-id: r53446
2010-10-13 20:04:50 +00:00
Torbjörn Andersson
bbbfdad458 SWORD25: Check if _LogFile has been created before flushing.
svn-id: r53445
2010-10-13 19:33:12 +00:00
Filippos Karapetis
2880ebdeb4 Fixed ifdef. I'm too tired today :/
svn-id: r53440
2010-10-13 17:45:20 +00:00
Filippos Karapetis
96e05a1ff9 SWORD25: Hopefully fix compilation when libtheora is not present
svn-id: r53439
2010-10-13 17:42:56 +00:00
Max Horn
8f4f0d16fc SWORD25: Renamed getInstance() -> instance()
svn-id: r53430
2010-10-13 15:41:00 +00:00
Max Horn
fa8275f27b SWORD25: Don't even compile theora related code when that lib is not present
svn-id: r53428
2010-10-13 15:00:51 +00:00
Filippos Karapetis
d83a70af43 SWORD25: Renamed ENABLE_THEORADEC to USE_THEORADEC (like in configure)
svn-id: r53418
2010-10-13 13:32:30 +00:00
Filippos Karapetis
f2d9319d9e SWORD25: Renamed ENABLE_THEORA to ENABLE_THEORADEC (like in configure)
svn-id: r53417
2010-10-13 13:27:55 +00:00
Filippos Karapetis
681ec59292 SWORD25: Added a ENABLE_THEORA define inside fmv/theora_decoder.h
This define can be used to disable building of the Theora decoder, and thus makes
libtheora optional (therefore resolving an item in the Sword25 TODO). Disabling the
Theora decoder will effectively disable the game's videos

Note that running the game with the Theora decoder disabled is still untested

svn-id: r53416
2010-10-13 13:07:16 +00:00
Sven Hesse
ff0160050a SWORD25: Force cast to uint instead of unsigned long long
As per Fingolfin's request, because apparently there's no long long
in the C++ standard; and ScummVM's hashmap needs uint.

svn-id: r53413
2010-10-13 11:42:17 +00:00
Sven Hesse
ab57b38fdf SWORD25: Resolve ambigous write() call on 64 bit systems
svn-id: r53410
2010-10-13 11:22:52 +00:00
Sven Hesse
c86c0b6b96 SWORD25: Cast the pointer to unsigned long long
...Instead of to uint, which fails on my 64 bit system where pointers
are 64 bit, but normal ints 32 bit wide.

svn-id: r53409
2010-10-13 11:22:19 +00:00
Filippos Karapetis
59c6223d49 SWORD25: Fixed signed/unsigned bug
svn-id: r53407
2010-10-13 11:18:34 +00:00
Max Horn
85fa23afbe SWORD25: Get rid of kernel/bs_stdint.h
svn-id: r53405
2010-10-13 10:51:20 +00:00