107 Commits

Author SHA1 Message Date
Colin Snover
a6659ba9d5 DREAMWEB: Use accurate memory reclamation for Ex transfers
When the Ex memory regions are close to full, it is possible for
the game to fail to purge objects and then crash with an OOM error
even if it isn't actually out of memory. This patch calculates the
amount of free memory truly needed when allocating to Ex memory to
allow exactly the entire frame & text regions to be used, instead
previously where a hard-coded amount of free space to maintain was
used, which guaranteed that the entire memory region could not
actually be used by the game.

This change may be masking some underlying memory leak, or it may
just be that near the end of the game the game naturally comes
close to reaching the maximum memory region size. For the moment,
I am assuming the latter.

This commit also adds some assertion checks to the memory transfer
functions to make sure the regions don't quietly overflow in other
cases, since pickupConts performs transfers in a manner that
doesn't ensure enough free memory exists for them to be successful.

Fixes Trac#6820.
2017-11-12 23:15:05 -06:00
Johannes Schickel
aaff7b1736 DREAMWEB: Make GPL headers consistent in themselves. 2014-02-18 02:39:34 +01:00
Willem Jan Palenstijn
89a330cb5d DREAMWEB: Add some debugging output to emergencyPurge 2012-11-30 23:22:51 +01:00
Willem Jan Palenstijn
f2fe1b775a DREAMWEB: Make frame fixups more specific and add sanity checks
This should detect (and trigger asserts on) the kind of ex frame
data corruption in bug #3591088.
2012-11-30 20:06:41 +01:00
Willem Jan Palenstijn
f5dbd23bab DREAMWEB: Fix emergencyPurge checks
It could re-delete previously deleted objects, causing
ex data (frame/text) corruption. This is the likely cause of bug #3591088.

Asm conversion error from eaf87bdfa7ac279f736c03b25af94ac1df3b31ce.
2012-11-30 20:06:36 +01:00
D G Turner
617f6179c1 DREAMWEB: Change various loop variables to uint, rather than size_t.
This is partly for readability and partly to avoid any possible
portability issues i.e. though they should be the same, size_t is
defined by system headers, whereas uint is defined within our build
system.

Also, replaced a array size calculation with our ARRAYSIZE macro.
2012-11-30 12:08:55 +00:00
D G Turner
9dc4542f3c DREAMWEB: Migrate object/inventory related functions out of stubs. 2012-11-30 11:21:31 +00:00
D G Turner
bf876a13c6 DREAMWEB: Remove dead code functions and minor formatting cleanup. 2012-11-30 04:35:54 +00:00
Johannes Schickel
89abab97e3 JANITORIAL: Remove trailing whitespaces.
Powered by:
git ls-files "*.cpp" "*.h" "*.m" "*.mm" | xargs sed -i -e 's/[ \t]*$//'
2012-09-26 04:17:55 +02:00
D G Turner
ae31469a9a DREAMWEB: Replaced vsync() function with waitForVSync().
As a call to waitForVSync() was the only contents of vsync(), there
should be no functional change.
2012-05-30 04:23:34 +01:00
Max Horn
9f99fb5f8a DREAMWEB: Use ObjectType enums in more places 2011-12-28 23:53:54 +01:00
Max Horn
dc4af2afc2 DREAMWEB: Added commandOnlyCond() method 2011-12-28 23:06:49 +01:00
Willem Jan Palenstijn
ea6546ae25 DREAMWEB: Clean up checkCoords 2011-12-28 19:55:06 +01:00
Filippos Karapetis
e2aaba4a69 Merge pull request #154 from fingolfin/dreamweb-cleanup
Dreamweb: Mark structs packed, minor tweaks
2011-12-28 10:29:53 -08:00
Willem Jan Palenstijn
63da2ac271 DREAMWEB: Clean up some constants 2011-12-28 16:48:10 +01:00
Max Horn
ca7da4cffc DREAMWEB: Rename a member of SetObject & DynObject to objId
SetObject::name and DynObject::id are stored at the exact same offset,
and have the exact same meaning (see also objectMatches()). Now they
also have the same name, objId.
2011-12-28 16:36:16 +01:00
Max Horn
c10ea611e8 DREAMWEB: Rename getEitherAdCPP to getEitherAd, use obj type enums 2011-12-28 16:36:16 +01:00
Filippos Karapetis
279746fcf0 DREAMWEB: Completely remove all of the runtime, and move everything into DreamWebEngine
Also, remove dead code (allocateMem/deallocateMem)
2011-12-28 15:07:17 +02:00
Willem Jan Palenstijn
57e940f678 DREAMWEB: Move all saved variables to a GameVars struct
The data segment is now completely unused.
2011-12-28 13:12:22 +01:00
Filippos Karapetis
ed72efe05b DREAMWEB: Remove more global variables 2011-12-28 05:47:09 +02:00
Willem Jan Palenstijn
4c2d2684ea DREAMWEB: Mass-move variables out of data
This has been done by an automated search/replace, culling unused
variables in the process. The remaining variables in data are all stored
in savegames.
2011-12-28 02:36:52 +01:00
Willem Jan Palenstijn
d9aed2e00b DREAMWEB: Convert room text into TextFiles 2011-12-27 23:03:40 +01:00
Willem Jan Palenstijn
f729742f87 DREAMWEB: Convert exText into TextFile 2011-12-27 23:02:33 +01:00
Willem Jan Palenstijn
e54196f37f DREAMWEB: Remove Extras segment 2011-12-27 23:02:33 +01:00
Willem Jan Palenstijn
90cb52b7f6 DREAMWEB: Streamline graphics file access 2011-12-27 23:01:58 +01:00
D G Turner
5cfa1899bd DREAMWEB: Move kQuitRequested out of data blob. 2011-12-27 03:08:43 +00:00
Filippos Karapetis
3ff26ba84f DREAMWEB: Move all of the functions to DreamBase and remove stubs.h 2011-12-27 03:00:00 +02:00
Willem Jan Palenstijn
0be53a88d6 DREAMWEB: Move remaining use functions to DreamBase 2011-12-27 01:44:54 +01:00
Filippos Karapetis
a75d39895b DREAMWEB: Move some functions to DreamBase, remove dead code 2011-12-26 22:47:14 +02:00
Filippos Karapetis
1ba4f0a1a8 Revert "DREAMWEB: Remove dead code and move most functions to DreamBase"
This reverts commit 4c66f74b58e9a2c191f22a37f485047dd19be131.

These functions aren't ready to be moved yet till the remaining two are
finished, and they're so crossreferenced that the safest thing to do is
revert this commit and break it down to smaller chunks
2011-12-26 22:31:50 +02:00
Filippos Karapetis
4c66f74b58 DREAMWEB: Remove dead code and move most functions to DreamBase 2011-12-26 22:10:20 +02:00
Willem Jan Palenstijn
cb3eee8635 DREAMWEB: Reduce dependency on globals and move functions to DreamBase 2011-12-26 20:03:52 +01:00
Willem Jan Palenstijn
6f85de6b6e DREAMWEB: Combine transferMap and transferInv 2011-12-26 20:03:52 +01:00
Willem Jan Palenstijn
c2a94132c8 DREAMWEB: Convert pickupConts 2011-12-26 18:42:28 +01:00
Willem Jan Palenstijn
1237004756 DREAMWEB: Minor cleanup 2011-12-26 17:53:04 +01:00
Willem Jan Palenstijn
c86a830c4a DREAMWEB: Move openInvList, ryanInvList out of buffers 2011-12-26 17:42:19 +01:00
Willem Jan Palenstijn
c60ce59aa4 DREAMWEB: Fix regression in transferToEx 2011-12-26 17:27:17 +01:00
Filippos Karapetis
3b9b4cb6ba DREAMWEB: Fix a regression in fillOpen() and remove the now unused getOpenedSize() 2011-12-26 16:54:02 +02:00
Willem Jan Palenstijn
1fef9d1f75 DREAMWEB: Convert findAllOpen, fillOpen 2011-12-26 16:54:00 +02:00
Filippos Karapetis
63ba3988ff DREAMWEB: Port 'transfertoex' to C++ 2011-12-26 16:10:28 +02:00
Filippos Karapetis
1b11f48a35 DREAMWEB: Cleanup identifyOb() 2011-12-26 13:18:09 +02:00
D G Turner
389afc4666 DREAMWEB: Port 'findpathofpoint' to C++ 2011-12-26 05:02:51 +00:00
Filippos Karapetis
9a89f8884c Merge pull request #153 from fingolfin/dreamweb-cleanup
Dreamweb: Port rollEm() to C++, remove dead code
2011-12-25 16:58:58 -08:00
Filippos Karapetis
7945a0fbb0 DREAMWEB: Cleaned up findFirstPath(), fixed a regression and moved it to DreamBase 2011-12-26 02:50:02 +02:00
Max Horn
04a147921f DREAMWEB: Rename workToScreenCPP to workToScreen 2011-12-26 01:41:56 +01:00
Max Horn
d015f5d446 DREAMWEB: Remove some dead code 2011-12-26 01:41:55 +01:00
D G Turner
c7b1ec2198 DREAMWEB: Ported 'findfirstpath' to C++.
This conversion could do with a bit more work to remove the es/ax/cx
temp usage and clean up the code.
2011-12-25 23:33:11 +00:00
Filippos Karapetis
1f346baa92 DREAMWEB: Port 'findopenpos' to C++ 2011-12-25 22:31:07 +02:00
Filippos Karapetis
95ffd7f4ce DREAMWEB: Port 'purgeanitem' to C++, some cleanup 2011-12-25 19:25:00 +02:00
Filippos Karapetis
21a278bb63 DREAMWEB: Port 'outofopen' to C++ 2011-12-25 18:26:13 +02:00