aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Brown2003-01-14 10:06:56 +0000
committerJames Brown2003-01-14 10:06:56 +0000
commit5bf741f96076fa5fcdc077d5fe0a6f4557bd1dcc (patch)
tree980a4f529c01bfd637470130a024f690adaa87c1
parent639cb13da189d269f53a9f895fc6109cd926c211 (diff)
downloadscummvm-rg350-5bf741f96076fa5fcdc077d5fe0a6f4557bd1dcc.tar.gz
scummvm-rg350-5bf741f96076fa5fcdc077d5fe0a6f4557bd1dcc.tar.bz2
scummvm-rg350-5bf741f96076fa5fcdc077d5fe0a6f4557bd1dcc.zip
Patch 667613: Extend gfxUsageBits[]
svn-id: r6453
-rw-r--r--scumm.dsp944
-rw-r--r--scumm/actor.cpp30
-rw-r--r--scumm/akos.cpp6
-rw-r--r--scumm/costume.cpp2
-rw-r--r--scumm/gfx.cpp26
-rw-r--r--scumm/module.mk1
-rw-r--r--scumm/object.cpp15
-rw-r--r--scumm/saveload.cpp12
-rw-r--r--scumm/saveload.h5
-rw-r--r--scumm/scumm.h25
-rw-r--r--scumm/usage_bits.cpp81
-rw-r--r--scumm/usage_bits.h28
12 files changed, 647 insertions, 528 deletions
diff --git a/scumm.dsp b/scumm.dsp
index aaf0000474..56cf103dce 100644
--- a/scumm.dsp
+++ b/scumm.dsp
@@ -1,470 +1,474 @@
-# Microsoft Developer Studio Project File - Name="scumm" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
-
-CFG=scumm - Win32 MP3 Enabled Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "scumm.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "scumm.mak" CFG="scumm - Win32 MP3 Enabled Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "scumm - Win32 Release" (based on "Win32 (x86) Static Library")
-!MESSAGE "scumm - Win32 Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE "scumm - Win32 MP3 Enabled Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE "scumm - Win32 MP3 Enabled Release" (based on "Win32 (x86) Static Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "scumm - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "scumm___Release"
-# PROP Intermediate_Dir "scumm___Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /WX /Zi /O2 /I "." /I "common" /I "scumm" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "USE_ADLIB" /D "BYPASS_COPY_PROT" /YX /FD /c
-# ADD BASE RSC /l 0x415 /d "NDEBUG"
-# ADD RSC /l 0x415 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ELSEIF "$(CFG)" == "scumm - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "scumm___Win32_Debug"
-# PROP BASE Intermediate_Dir "scumm___Win32_Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "scumm___Debug"
-# PROP Intermediate_Dir "scumm___Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /WX /Gm /GX /Zi /Od /I "." /I "common" /I "scumm" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "BYPASS_COPY_PROT" /D "USE_ADLIB" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x415 /d "_DEBUG"
-# ADD RSC /l 0x415 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ELSEIF "$(CFG)" == "scumm - Win32 MP3 Enabled Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "scumm___Win32_MP3_Enabled_Debug"
-# PROP BASE Intermediate_Dir "scumm___Win32_MP3_Enabled_Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "scumm___MP3_Enabled_Debug"
-# PROP Intermediate_Dir "scumm___MP3_Enabled_Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "common" /I "scumm" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "BYPASS_COPY_PROT" /D "USE_ADLIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /WX /Gm /GX /Zi /Od /I "." /I "common" /I "scumm" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "USE_ADLIB" /D "BYPASS_COPY_PROT" /D "USE_MAD" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x415 /d "_DEBUG"
-# ADD RSC /l 0x415 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ELSEIF "$(CFG)" == "scumm - Win32 MP3 Enabled Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "scumm___Win32_MP3_Enabled_Release"
-# PROP BASE Intermediate_Dir "scumm___Win32_MP3_Enabled_Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "scumm___MP3_Enabled_Release"
-# PROP Intermediate_Dir "scumm___MP3_Enabled_Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /I "." /I "common" /I "scumm" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "USE_ADLIB" /YX /FD /c
-# ADD CPP /nologo /G6 /MD /W3 /WX /GX /Zi /O2 /I "." /I "common" /I "scumm" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "USE_ADLIB" /D "BYPASS_COPY_PROT" /D "USE_MAD" /YX /FD /c
-# ADD BASE RSC /l 0x415 /d "NDEBUG"
-# ADD RSC /l 0x415 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ENDIF
-
-# Begin Target
-
-# Name "scumm - Win32 Release"
-# Name "scumm - Win32 Debug"
-# Name "scumm - Win32 MP3 Enabled Debug"
-# Name "scumm - Win32 MP3 Enabled Release"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Group "smush"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\scumm\smush\blitter.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\blitter.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\brenderer.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\brenderer.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\channel.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\chunk.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\chunk.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\chunk_type.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\codec1.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\codec1.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\codec37.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\codec37.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\codec44.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\codec44.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\codec47.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\codec47.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\color.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\color.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\config.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\decoder.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\frenderer.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\frenderer.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\imuse_channel.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\mixer.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\palette.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\player.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\player.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\renderer.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\saud_channel.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\scumm_renderer.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\smush\scumm_renderer.h
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=.\scumm\actor.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\actor.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\akos.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\akos.h
-# End Source File
-# Begin Source File
-
-SOURCE=".\scumm\base-costume.h"
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\boxes.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\boxes.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\bundle.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\bundle.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\charset.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\charset.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\costume.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\costume.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\debugger.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\debugger.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\debugrl.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\debugrl.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\dialogs.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\dialogs.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\gfx.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\gfx.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\imuse.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\imuse.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\imuse_digi.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\imuse_digi.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\instrument.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\instrument.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\intern.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\nut_renderer.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\nut_renderer.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\object.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\object.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\resource.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\resource.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\resource_v2.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\resource_v3.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\resource_v4.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\saveload.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\saveload.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\script.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\script_v5.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\script_v6.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\script_v8.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\scumm.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\scummvm.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\sound.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\sound.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\string.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\vars.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\verbs.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\scumm\verbs.h
-# End Source File
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="scumm" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=scumm - Win32 MP3 Enabled Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "scumm.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "scumm.mak" CFG="scumm - Win32 MP3 Enabled Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "scumm - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "scumm - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "scumm - Win32 MP3 Enabled Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "scumm - Win32 MP3 Enabled Release" (based on "Win32 (x86) Static Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "scumm - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "scumm___Release"
+# PROP Intermediate_Dir "scumm___Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /WX /Zi /O2 /I "." /I "common" /I "scumm" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "USE_ADLIB" /D "BYPASS_COPY_PROT" /YX /FD /c
+# ADD BASE RSC /l 0x415 /d "NDEBUG"
+# ADD RSC /l 0x415 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF "$(CFG)" == "scumm - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "scumm___Win32_Debug"
+# PROP BASE Intermediate_Dir "scumm___Win32_Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "scumm___Debug"
+# PROP Intermediate_Dir "scumm___Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /WX /Gm /GX /Zi /Od /I "." /I "common" /I "scumm" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "BYPASS_COPY_PROT" /D "USE_ADLIB" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x415 /d "_DEBUG"
+# ADD RSC /l 0x415 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF "$(CFG)" == "scumm - Win32 MP3 Enabled Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "scumm___Win32_MP3_Enabled_Debug"
+# PROP BASE Intermediate_Dir "scumm___Win32_MP3_Enabled_Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "scumm___MP3_Enabled_Debug"
+# PROP Intermediate_Dir "scumm___MP3_Enabled_Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "common" /I "scumm" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "BYPASS_COPY_PROT" /D "USE_ADLIB" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /WX /Gm /GX /Zi /Od /I "." /I "common" /I "scumm" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "USE_ADLIB" /D "BYPASS_COPY_PROT" /D "USE_MAD" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x415 /d "_DEBUG"
+# ADD RSC /l 0x415 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF "$(CFG)" == "scumm - Win32 MP3 Enabled Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "scumm___Win32_MP3_Enabled_Release"
+# PROP BASE Intermediate_Dir "scumm___Win32_MP3_Enabled_Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "scumm___MP3_Enabled_Release"
+# PROP Intermediate_Dir "scumm___MP3_Enabled_Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /I "." /I "common" /I "scumm" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "USE_ADLIB" /YX /FD /c
+# ADD CPP /nologo /G6 /MD /W3 /WX /GX /Zi /O2 /I "." /I "common" /I "scumm" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "USE_ADLIB" /D "BYPASS_COPY_PROT" /D "USE_MAD" /YX /FD /c
+# ADD BASE RSC /l 0x415 /d "NDEBUG"
+# ADD RSC /l 0x415 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ENDIF
+
+# Begin Target
+
+# Name "scumm - Win32 Release"
+# Name "scumm - Win32 Debug"
+# Name "scumm - Win32 MP3 Enabled Debug"
+# Name "scumm - Win32 MP3 Enabled Release"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Group "smush"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\scumm\smush\blitter.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\blitter.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\brenderer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\brenderer.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\channel.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\chunk.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\chunk.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\chunk_type.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\codec1.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\codec1.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\codec37.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\codec37.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\codec44.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\codec44.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\codec47.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\codec47.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\color.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\color.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\config.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\decoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\frenderer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\frenderer.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\imuse_channel.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\mixer.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\palette.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\player.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\player.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\renderer.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\saud_channel.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\scumm_renderer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\smush\scumm_renderer.h
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\scumm\actor.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\actor.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\akos.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\akos.h
+# End Source File
+# Begin Source File
+
+SOURCE=".\scumm\base-costume.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\boxes.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\boxes.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\bundle.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\bundle.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\charset.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\charset.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\costume.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\costume.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\debugger.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\debugger.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\debugrl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\debugrl.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\dialogs.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\dialogs.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\gfx.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\gfx.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\usage_bits.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\usage_bits.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\imuse.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\imuse_digi.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\imuse_digi.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\instrument.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\instrument.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\intern.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\nut_renderer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\nut_renderer.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\object.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\object.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\resource.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\resource_v2.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\resource_v3.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\resource_v4.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\saveload.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\saveload.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\script.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\script_v5.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\script_v6.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\script_v8.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\scumm.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\scummvm.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\sound.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\sound.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\string.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\vars.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\verbs.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\scumm\verbs.h
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index fc51f7c177..478156bb8f 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -28,6 +28,7 @@
#include "costume.h"
#include "resource.h"
#include "sound.h"
+#include "usage_bits.h"
#include <math.h>
@@ -1100,7 +1101,6 @@ void Actor::animateLimb(int limb, int f)
void Scumm::setActorRedrawFlags(bool fg, bool bg)
{
int i, j;
- uint32 bits;
if (_fullRedraw) {
for (j = 0; j < NUM_ACTORS; j++) {
@@ -1112,10 +1112,10 @@ void Scumm::setActorRedrawFlags(bool fg, bool bg)
}
} else {
for (i = 0; i < gdi._numStrips; i++) {
- bits = gfxUsageBits[_screenStartStrip + i];
- if (bits & 0x3FFFFFFF) {
+ int strip = _screenStartStrip + i;
+ if (testGfxAnyUsageBits(strip)) {
for (j = 0; j < NUM_ACTORS; j++) {
- if ((bits & (1 << j)) && bits != (uint32)(1 << j)) {
+ if (testGfxUsageBit(strip, j) && testGfxOtherUsageBits(strip, j)) {
Actor *a = derefActor(j);
if (fg)
a->needRedraw = true;
@@ -1130,15 +1130,13 @@ void Scumm::setActorRedrawFlags(bool fg, bool bg)
int Scumm::getActorFromPos(int x, int y)
{
- uint32 drawbits;
int i;
- drawbits = gfxUsageBits[x >> 3];
- if (!(drawbits & 0x3FFFFFFF))
+ if (!testGfxAnyUsageBits(x >> 3))
return 0;
for (i = 1; i < NUM_ACTORS; i++) {
Actor *a = derefActor(i);
- if (drawbits & (1 << i) && !getClass(i, 32) && y >= a->top && y <= a->bottom) {
+ if (testGfxUsageBit(x >> 3, i) && !getClass(i, 32) && y >= a->top && y <= a->bottom) {
return i;
}
}
@@ -1541,23 +1539,17 @@ void Actor::remapActorPalette(int r_fact, int g_fact, int b_fact, int threshold)
void Scumm::resetActorBgs()
{
Actor *a;
- int i;
- uint32 onlyActorFlags, bitpos;
+ int i, j;
for (i = 0; i < gdi._numStrips; i++) {
- onlyActorFlags = (gfxUsageBits[_screenStartStrip + i] &= 0x3FFFFFFF);
+ int strip = _screenStartStrip + i;
a = getFirstActor();
- bitpos = 1;
-
- while (onlyActorFlags) {
- if (onlyActorFlags & 1 && a->top != 0xFF && a->needBgReset) {
- gfxUsageBits[_screenStartStrip + i] ^= bitpos;
-
+ for (j = 0; j < NUM_ACTORS; j++) {
+ if (testGfxUsageBit(strip, j) && a->top != 0xFF && a->needBgReset) {
+ clearGfxUsageBit(strip, j);
if ((a->bottom - a->top) >= 0)
gdi.resetBackground(a->top, a->bottom, i);
}
- bitpos <<= 1;
- onlyActorFlags >>= 1;
a++;
}
}
diff --git a/scumm/akos.cpp b/scumm/akos.cpp
index c1734bee29..69ba36919c 100644
--- a/scumm/akos.cpp
+++ b/scumm/akos.cpp
@@ -829,7 +829,7 @@ void AkosRenderer::codec1()
if (v1.skip_width <= 0 || _height <= 0)
return;
- _vm->updateDirtyRect(0, x_left, x_right, y_top, y_bottom, 1 << _dirty_id);
+ _vm->updateDirtyRect(0, x_left, x_right, y_top, y_bottom, _dirty_id);
y_clipping = ((uint) y_bottom > outheight || y_top < 0);
@@ -949,7 +949,7 @@ void AkosRenderer::codec5() {
if ((clip_right <= clip_left) || (clip_top >= clip_bottom))
return;
- _vm->updateDirtyRect(0, clip_left, clip_right + 1, clip_top, clip_bottom + 1, 1 << _dirty_id);
+ _vm->updateDirtyRect(0, clip_left, clip_right + 1, clip_top, clip_bottom + 1, _dirty_id);
if (_draw_top > clip_top)
_draw_top = clip_top;
@@ -1280,7 +1280,7 @@ void AkosRenderer::codec16() {
if ((clip_left >= clip_right) || (clip_top >= clip_bottom))
return;
- _vm->updateDirtyRect(0, clip_left, clip_right + 1, clip_top, clip_bottom + 1, 1 << _dirty_id);
+ _vm->updateDirtyRect(0, clip_left, clip_right + 1, clip_top, clip_bottom + 1, _dirty_id);
if (_draw_top > clip_top)
_draw_top = clip_top;
diff --git a/scumm/costume.cpp b/scumm/costume.cpp
index c30dea3625..5ebcba3562 100644
--- a/scumm/costume.cpp
+++ b/scumm/costume.cpp
@@ -213,7 +213,7 @@ byte CostumeRenderer::mainRoutine(int slot, int frame)
_scaleIndexXStep = 1;
_ypostop = _ypos;
- _vm->updateDirtyRect(0, _left, _right + 1, _top, _bottom, 1 << _dirty_id);
+ _vm->updateDirtyRect(0, _left, _right + 1, _top, _bottom, _dirty_id);
if (_top >= (int)_outheight || _bottom <= 0)
return 0;
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index 1d55780bcf..50f3810c97 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -24,6 +24,7 @@
#include "actor.h"
#include "charset.h"
#include "resource.h"
+#include "usage_bits.h"
#include "util.h"
@@ -295,12 +296,10 @@ VirtScreen *Scumm::findVirtScreen(int y)
return NULL;
}
-void Scumm::updateDirtyRect(int virt, int left, int right, int top, int bottom, uint32 dirtybits)
+void Scumm::updateDirtyRect(int virt, int left, int right, int top, int bottom, int dirtybit)
{
VirtScreen *vs = &virtscr[virt];
int lp, rp;
- uint32 *sp;
- int num;
if (top > vs->height || left > vs->width || right < 0 || bottom < 0)
return;
@@ -314,7 +313,7 @@ void Scumm::updateDirtyRect(int virt, int left, int right, int top, int bottom,
if (right > vs->width)
right = vs->width;
- if (virt == 0 && dirtybits) {
+ if (virt == 0 && dirtybit) {
lp = (left >> 3) + _screenStartStrip;
if (lp < 0)
lp = 0;
@@ -331,13 +330,8 @@ void Scumm::updateDirtyRect(int virt, int left, int right, int top, int bottom,
if (rp >= 200)
rp = 200;
}
- if (lp <= rp) {
- num = rp - lp + 1;
- sp = &gfxUsageBits[lp];
- do {
- *sp++ |= dirtybits;
- } while (--num);
- }
+ for (; lp <= rp; lp++)
+ setGfxUsageBit(lp, dirtybit);
}
setVirtscreenDirty(vs, left, top, right, bottom);
@@ -632,7 +626,7 @@ void Scumm::drawFlashlight()
// Redraw any actors "under" the flashlight
for (i = _flashlight.x/8; i < (_flashlight.x+_flashlight.w)/8; i++) {
- gfxUsageBits[_screenStartStrip + i] |= 0x80000000;
+ setGfxUsageBit(_screenStartStrip + i, USAGE_BIT_DIRTY);
virtscr[0].tdirty[i] = 0;
virtscr[0].bdirty[i] = virtscr[0].height;
}
@@ -682,7 +676,7 @@ void Scumm::redrawBGAreas()
// Redraw parts of the background which are marked as dirty.
if (!_fullRedraw && _BgNeedsRedraw) {
for (i = 0; i != gdi._numStrips; i++) {
- if (gfxUsageBits[_screenStartStrip + i] & 0x80000000) {
+ if (testGfxUsageBit(_screenStartStrip + i, USAGE_BIT_DIRTY)) {
redrawBGStrip(i, 1);
}
}
@@ -723,10 +717,10 @@ void Scumm::redrawBGStrip(int start, int num)
{
int s = _screenStartStrip + start;
- assert(s >= 0 && (size_t) s < sizeof(gfxUsageBits) / sizeof(gfxUsageBits[0]));
+ assert(s >= 0 && (size_t) s < sizeof(gfxUsageBits) / (3 * sizeof(gfxUsageBits[0])));
for (int i = 0; i < num; i++)
- gfxUsageBits[s + i] |= 0x80000000;
+ setGfxUsageBit(s + i, USAGE_BIT_DIRTY);
gdi.drawBitmap(getResourceAddress(rtRoom, _roomResource) + _IM00_offs,
&virtscr[0], s, 0, virtscr[0].height, s, num, 0);
@@ -775,7 +769,7 @@ void Scumm::restoreBG(int left, int top, int right, int bottom, byte backColor)
if (bottom >= height)
bottom = height;
- updateDirtyRect(vs->number, left, right, top - topline, bottom - topline, 0x40000000);
+ updateDirtyRect(vs->number, left, right, top - topline, bottom - topline, USAGE_BIT_RESTORED);
int offset = (top - topline) * _realWidth + vs->xstart + left;
backbuff = vs->screenPtr + offset;
diff --git a/scumm/module.mk b/scumm/module.mk
index 49aeae4762..7567d99a41 100644
--- a/scumm/module.mk
+++ b/scumm/module.mk
@@ -27,6 +27,7 @@ SCUMM_OBJS = \
scumm/scummvm.o \
scumm/sound.o \
scumm/string.o \
+ scumm/usage_bits.o \
scumm/vars.o \
scumm/verbs.o
diff --git a/scumm/object.cpp b/scumm/object.cpp
index 0c7615858d..500b14c0ea 100644
--- a/scumm/object.cpp
+++ b/scumm/object.cpp
@@ -25,6 +25,7 @@
#include "actor.h"
#include "object.h"
#include "resource.h"
+#include "usage_bits.h"
bool Scumm::getClass(int obj, int cls)
{
@@ -393,7 +394,7 @@ void Scumm::drawObject(int obj, int arg)
continue;
if (tmp < _screenStartStrip || tmp > _screenEndStrip)
continue;
- gfxUsageBits[tmp] |= 0x80000000;
+ setGfxUsageBit(tmp, USAGE_BIT_DIRTY);
if (tmp < x)
x = tmp;
numstrip++;
@@ -762,17 +763,13 @@ void Scumm::clearOwnerOf(int obj)
void Scumm::removeObjectFromRoom(int obj)
{
- int i, cnt;
- uint32 *ptr;
+ int i, j;
for (i = 1; i < _numLocalObjects; i++) {
if (_objs[i].obj_nr == (uint16)obj) {
if (_objs[i].width != 0) {
- ptr = &gfxUsageBits[_objs[i].x_pos >> 3];
- cnt = _objs[i].width >> 3;
- do {
- *ptr++ |= 0x80000000;
- } while (--cnt);
+ for (j = 0; j < _objs[i].width; j++)
+ setGfxUsageBit((_objs[i].x_pos >> 3) + j, USAGE_BIT_DIRTY);
}
_BgNeedsRedraw = true;
return;
@@ -1619,7 +1616,7 @@ void Scumm::removeBlastObject(BlastObject *eo)
for (i = left_strip; i <= right_strip; i++)
gdi.resetBackground(top, bottom, i);
- updateDirtyRect(0, left, right, top, bottom, 0x40000000);
+ updateDirtyRect(0, left, right, top, bottom, USAGE_BIT_RESTORED);
}
int Scumm::findLocalObjectSlot()
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp
index d5520e828a..5adeaa160f 100644
--- a/scumm/saveload.cpp
+++ b/scumm/saveload.cpp
@@ -424,9 +424,10 @@ void Scumm::saveOrLoad(Serializer *s, uint32 savegameVersion)
MKLINE(Scumm, _palManipEnd, sleByte, VER_V10),
MKLINE(Scumm, _palManipCounter, sleUint16, VER_V10),
- // gfxUsageBits grew from 200 to 410 entries:
+ // gfxUsageBits grew from 200 to 410 entries. Then 3 * 410 entries:
MKARRAY_OLD(Scumm, gfxUsageBits[0], sleUint32, 200, VER_V8, VER_V9),
- MKARRAY(Scumm, gfxUsageBits[0], sleUint32, 410, VER_V10),
+ MKARRAY_OLD(Scumm, gfxUsageBits[0], sleUint32, 410, VER_V10, VER_V13),
+ MKARRAY(Scumm, gfxUsageBits[0], sleUint32, 3 * 410, VER_V14),
MKLINE(Scumm, gdi._transparentColor, sleByte, VER_V8),
MKARRAY(Scumm, _currentPalette[0], sleByte, 768, VER_V8),
@@ -557,8 +558,15 @@ void Scumm::saveOrLoad(Serializer *s, uint32 savegameVersion)
}
}
+ // Because old savegames won't fill the entire gfxUsageBits[] array,
+ // clear it here just to be sure it won't hold any unforseen garbage.
+ memset(gfxUsageBits, 0, sizeof(gfxUsageBits));
+
s->saveLoadEntries(this, mainEntries);
+ if (!s->isSaving() && savegameVersion < VER_V14)
+ upgradeGfxUsageBits();
+
s->saveLoadArrayOf(_actors, NUM_ACTORS, sizeof(_actors[0]), actorEntries);
if (savegameVersion < VER_V9)
diff --git a/scumm/saveload.h b/scumm/saveload.h
index 5934c8e154..b511a0c6d8 100644
--- a/scumm/saveload.h
+++ b/scumm/saveload.h
@@ -32,10 +32,11 @@ enum {
VER_V10,
VER_V11,
VER_V12,
- VER_V13
+ VER_V13,
+ VER_V14
};
-#define CURRENT_VER VER_V13
+#define CURRENT_VER VER_V14
// To work around a warning in GCC 3.2 (and 3.1 ?) regarding non-POD types,
diff --git a/scumm/scumm.h b/scumm/scumm.h
index ab791d0f95..69c524774d 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -748,7 +748,7 @@ public:
void useBompCursor(byte *im, int w, int h);
- void updateDirtyRect(int virt, int left, int right, int top, int bottom, uint32 dirtybits);
+ void updateDirtyRect(int virt, int left, int right, int top, int bottom, int dirtybit);
void setDirtyRange(int slot, int a, int height);
void drawDirtyScreenParts();
void updateDirtyScreen(int slot);
@@ -810,12 +810,18 @@ public:
byte *_palManipPalette;
byte *_palManipIntermediatePal;
- /* For each screen strip, gfxUsageBits contains a bitmask.
- * The lower 30 bits each correspond to one actor and signify if any part
- * of that actor is currently contained in that strip.
- * If the left most bit is set, the strip (background) is dirty needs to be redrawn.
+ /* For each of the 410 screen strips, gfxUsageBits contains a
+ * bitmask. The lower 80 bits each correspond to one actor and
+ * signify if any part of that actor is currently contained in
+ * that strip.
+ *
+ * If the leftmost bit is set, the strip (background) is dirty
+ * needs to be redrawn.
+ *
+ * The second leftmost bit is set by removeBlastObject() and
+ * restoreBG(), but I'm not yet sure why.
*/
- uint32 gfxUsageBits[410];
+ uint32 gfxUsageBits[410 * 3];
byte *_shadowPalette;
int _shadowPaletteSize;
@@ -924,6 +930,13 @@ public:
uint32 fileReadDword() { return _fileHandle.readUint32BE(); }
#endif
+ void upgradeGfxUsageBits();
+ void setGfxUsageBit(int strip, int bit);
+ void clearGfxUsageBit(int strip, int bit);
+ bool testGfxUsageBit(int strip, int bit);
+ bool testGfxAnyUsageBits(int strip);
+ bool testGfxOtherUsageBits(int strip, int bit);
+
/* Scumm Vars */
byte VAR_KEYPRESS;
byte VAR_EGO;
diff --git a/scumm/usage_bits.cpp b/scumm/usage_bits.cpp
new file mode 100644
index 0000000000..8cbde6e38d
--- /dev/null
+++ b/scumm/usage_bits.cpp
@@ -0,0 +1,81 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2001 Ludvig Strigeus
+ * Copyright (C) 2001-2003 The ScummVM project
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "stdafx.h"
+#include "scumm.h"
+#include "usage_bits.h"
+
+void Scumm::upgradeGfxUsageBits()
+{
+ int i;
+
+ for (i = 409; i >= 0; i--) {
+ bool dirty_bit = gfxUsageBits[i] & 0x80000000;
+ bool restored_bit = gfxUsageBits[i] & 0x40000000;
+
+ gfxUsageBits[3 * i] = gfxUsageBits[i] & 0x3FFFFFFF;
+ if (dirty_bit)
+ setGfxUsageBit(i, USAGE_BIT_DIRTY);
+ if (restored_bit)
+ setGfxUsageBit(i, USAGE_BIT_RESTORED);
+ }
+}
+
+void Scumm::setGfxUsageBit(int strip, int bit)
+{
+ gfxUsageBits[3 * strip + bit / 32] |= (1 << (bit - 1));
+}
+
+void Scumm::clearGfxUsageBit(int strip, int bit)
+{
+ gfxUsageBits[3 * strip + bit / 32] &= ~(1 << (bit - 1));
+}
+
+bool Scumm::testGfxUsageBit(int strip, int bit)
+{
+ return (gfxUsageBits[3 * strip + bit / 32] & (1 << (bit - 1))) != 0;
+}
+
+bool Scumm::testGfxAnyUsageBits(int strip)
+{
+ // Exclude the DIRTY and RESTORED bits from the test
+ uint32 bitmask[3] = { 0x3FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
+ int i;
+
+ for (i = 0; i < 3; i++)
+ if (gfxUsageBits[3 * strip + i] & bitmask[i])
+ return true;
+
+ return false;
+}
+
+bool Scumm::testGfxOtherUsageBits(int strip, int bit)
+{
+ // Don't exclude the DIRTY and RESTORED bits from the test
+ uint32 bitmask[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
+ int i;
+
+ bitmask[bit / 32] &= ~(1 << (bit - 1));
+
+ for (i = 0; i < 3; i++)
+ if (gfxUsageBits[3 * strip + i] & bitmask[i])
+ return true;
+
+ return false;
+}
diff --git a/scumm/usage_bits.h b/scumm/usage_bits.h
new file mode 100644
index 0000000000..e2752ff61b
--- /dev/null
+++ b/scumm/usage_bits.h
@@ -0,0 +1,28 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2001 Ludvig Strigeus
+ * Copyright (C) 2001-2003 The ScummVM project
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef USAGE_BITS_H
+#define USAGE_BITS_H
+
+enum {
+ USAGE_BIT_DIRTY = 96,
+ USAGE_BIT_RESTORED = 95
+};
+
+#endif