ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/map.h
(Generate patch)

Comparing deliantra/server/include/map.h (file contents):
Revision 1.117 by root, Sun Nov 8 15:11:23 2009 UTC vs.
Revision 1.120 by root, Sun Nov 8 20:55:39 2009 UTC

131 sint8 ACC (RW, light); /* How much light this space provides */ 131 sint8 ACC (RW, light); /* How much light this space provides */
132 MoveType ACC (RW, move_block); /* What movement types this space blocks */ 132 MoveType ACC (RW, move_block); /* What movement types this space blocks */
133 MoveType ACC (RW, move_slow); /* What movement types this space slows */ 133 MoveType ACC (RW, move_slow); /* What movement types this space slows */
134 MoveType ACC (RW, move_on); /* What movement types are activated */ 134 MoveType ACC (RW, move_on); /* What movement types are activated */
135 MoveType ACC (RW, move_off); /* What movement types are activated */ 135 MoveType ACC (RW, move_off); /* What movement types are activated */
136 uint16_t ACC (RW, nrof_); // saturates at 64k 136 uint16_t ACC (RW, items_); // saturates at 64k
137 uint32_t ACC (RW, volume_); // ~dm³ (not cm³) (factor is actually 1024) 137 uint32_t ACC (RW, volume_); // ~dm³ (not cm³) (factor is actually 1024)
138 uint32_t ACC (RW, smell); // the last count a player was seen here, or 0 138 uint32_t ACC (RW, smell); // the last count a player was seen here, or 0
139 static uint32_t ACC (RW, smellcount); // global smell counter 139 static uint32_t ACC (RW, smellcount); // global smell counter
140 140
141 uint32_t pad1_, pad2_; // pad to 64 bytes on 64 bit systems 141 uint32_t pad1_, pad2_; // pad to 64 bytes on 64 bit systems
145 void update_ (); 145 void update_ ();
146 MTH void update () 146 MTH void update ()
147 { 147 {
148 // we take advantage of the fact that 0x80 is the sign bit 148 // we take advantage of the fact that 0x80 is the sign bit
149 // to generate more efficient code on many cpus 149 // to generate more efficient code on many cpus
150 assert (P_UPTODATE == 0x80); 150 assert (sint8 (P_UPTODATE) < 0);
151 assert (sint8 (-1 & ~P_UPTODATE) >= 0);
151 152
152 if (expect_false (sint8 (flags_) < 0)) 153 if (expect_false (sint8 (flags_) >= 0))
153 update_ (); 154 update_ ();
154 155
155 // must be true by now 156 // must be true by now (gcc seems content with only the second test)
156 assume (sint8 (flags_) < 0); 157 assume (sint8 (flags_) < 0);
157 assume (flags_ & P_UPTODATE); 158 assume (flags_ & P_UPTODATE);
158 } 159 }
159 160
160 MTH uint8 flags () 161 MTH uint8 flags ()
179 op = 0; 180 op = 0;
180 181
181 return op; 182 return op;
182 } 183 }
183 184
184 MTH uint32 nrof () 185 MTH uint32 items()
185 { 186 {
186 update (); 187 update ();
187 return nrof_; 188 return items_;
188 } 189 }
189 190
190 // return the item volume on this mapspace in cm³ 191 // return the item volume on this mapspace in cm³
191 MTH uint64 volume () 192 MTH uint64 volume ()
192 { 193 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines