changeset 380:2f67762d04f6

DecorationDesc: flags -> methods
author Nomad
date Fri, 22 Feb 2013 22:34:35 +0200
parents 5bea494a2365
children 39a60868e9c7
files DecorationList.h Indoor.cpp mm7_4.cpp
diffstat 3 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/DecorationList.h	Fri Feb 22 22:26:51 2013 +0200
+++ b/DecorationList.h	Fri Feb 22 22:34:35 2013 +0200
@@ -25,8 +25,10 @@
 #pragma pack(push, 1)
 struct DecorationDesc
 {
-  inline bool SoundOnDawn() {return uFlags & DECORATION_SOUND_ON_DAWN;}
-  inline bool SoundOnDusk() {return uFlags & DECORATION_SOUND_ON_DUSK;}
+  inline bool CanMoveThrough() {return uFlags & DECORATION_MOVE_THROUGH;}
+  inline bool DontDraw()       {return uFlags & DECORATION_DONT_DRAW;} 
+  inline bool SoundOnDawn()    {return uFlags & DECORATION_SOUND_ON_DAWN;}
+  inline bool SoundOnDusk()    {return uFlags & DECORATION_SOUND_ON_DUSK;}
 
   char pName[32];
   char field_20[32];
--- a/Indoor.cpp	Fri Feb 22 22:26:51 2013 +0200
+++ b/Indoor.cpp	Fri Feb 22 22:34:35 2013 +0200
@@ -4616,7 +4616,7 @@
     if ( !(pDecortaion->field_2 & 0x20) )
     {
       v17 = &pDecorationList->pDecorations[pDecortaion->uDecorationDescID];
-      if ( !((unsigned __int8)2 & v17->uFlags) )
+      if (!v17->DontDraw())
         {
           v18 = v17->uLightRadius;
           if ( v18 )
--- a/mm7_4.cpp	Fri Feb 22 22:26:51 2013 +0200
+++ b/mm7_4.cpp	Fri Feb 22 22:34:35 2013 +0200
@@ -1165,7 +1165,7 @@
     if ( !(v1->field_2 & 0x20) )
     {
       v2 = &pDecorationList->pDecorations[v1->uDecorationDescID];
-      if ( !(v2->uFlags & 1) )
+      if (!v2->CanMoveThrough())
       {
         v3 = v2->uRadius;
         v4 = v1->vPosition.x;
@@ -1274,7 +1274,7 @@
                 if ( !(v5->field_2 & 0x20) )
                 {
                   v6 = &pDecorationList->pDecorations[v5->uDecorationDescID];
-                  if ( !(v6->uFlags & 1) )
+                  if (!v6->CanMoveThrough())
                   {
                     v7 = v6->uRadius;
                     v8 = v5->vPosition.x;