… | |
… | |
1061 | */ |
1061 | */ |
1062 | void |
1062 | void |
1063 | mapspace::update_ () |
1063 | mapspace::update_ () |
1064 | { |
1064 | { |
1065 | object *last = 0; |
1065 | object *last = 0; |
1066 | uint8 flags = P_UPTODATE, light = 0, anywhere = 0; |
1066 | uint8 flags = P_UPTODATE, anywhere = 0; |
|
|
1067 | sint8 light = 0; |
1067 | MoveType move_block = 0, move_slow = 0, move_on = 0, move_off = 0, move_allow = 0; |
1068 | MoveType move_block = 0, move_slow = 0, move_on = 0, move_off = 0, move_allow = 0; |
1068 | |
1069 | |
1069 | //object *middle = 0; |
1070 | //object *middle = 0; |
1070 | //object *top = 0; |
1071 | //object *top = 0; |
1071 | //object *floor = 0; |
1072 | //object *floor = 0; |
… | |
… | |
1074 | object *&middle = faces_obj[1] = 0; |
1075 | object *&middle = faces_obj[1] = 0; |
1075 | object *&floor = faces_obj[2] = 0; |
1076 | object *&floor = faces_obj[2] = 0; |
1076 | |
1077 | |
1077 | for (object *tmp = bot; tmp; last = tmp, tmp = tmp->above) |
1078 | for (object *tmp = bot; tmp; last = tmp, tmp = tmp->above) |
1078 | { |
1079 | { |
1079 | /* This could be made additive I guess (two lights better than |
1080 | // Lights are additive, up to MAX_LIGHT_RADIUS, see los.C) |
1080 | * one). But if so, it shouldn't be a simple additive - 2 |
|
|
1081 | * light bulbs do not illuminate twice as far as once since |
|
|
1082 | * it is a dissapation factor that is cubed. |
|
|
1083 | */ |
|
|
1084 | light = max (light, tmp->glow_radius); |
1081 | light += tmp->glow_radius; |
1085 | |
1082 | |
1086 | /* This call is needed in order to update objects the player |
1083 | /* This call is needed in order to update objects the player |
1087 | * is standing in that have animations (ie, grass, fire, etc). |
1084 | * is standing in that have animations (ie, grass, fire, etc). |
1088 | * However, it also causes the look window to be re-drawn |
1085 | * However, it also causes the look window to be re-drawn |
1089 | * 3 times each time the player moves, because many of the |
1086 | * 3 times each time the player moves, because many of the |
… | |
… | |
1137 | if (tmp->type == SAFE_GROUND) flags |= P_SAFE; |
1134 | if (tmp->type == SAFE_GROUND) flags |= P_SAFE; |
1138 | if (QUERY_FLAG (tmp, FLAG_ALIVE)) flags |= P_IS_ALIVE; |
1135 | if (QUERY_FLAG (tmp, FLAG_ALIVE)) flags |= P_IS_ALIVE; |
1139 | if (QUERY_FLAG (tmp, FLAG_DAMNED)) flags |= P_NO_CLERIC; |
1136 | if (QUERY_FLAG (tmp, FLAG_DAMNED)) flags |= P_NO_CLERIC; |
1140 | } |
1137 | } |
1141 | |
1138 | |
1142 | this->light = light; |
1139 | this->light = min (light, MAX_LIGHT_RADIUS); |
1143 | this->flags_ = flags; |
1140 | this->flags_ = flags; |
1144 | this->move_block = move_block & ~move_allow; |
1141 | this->move_block = move_block & ~move_allow; |
1145 | this->move_on = move_on; |
1142 | this->move_on = move_on; |
1146 | this->move_off = move_off; |
1143 | this->move_off = move_off; |
1147 | this->move_slow = move_slow; |
1144 | this->move_slow = move_slow; |