| 135 | } |
| 136 | |
| 137 | const Bitmap* Weather::ApplyToneEffect(const Bitmap& bitmap, Rect rect) { |
| 138 | if (tone_effect == Tone()) { |
| 139 | return &bitmap; |
| 140 | } |
| 141 | |
| 142 | if (!tone_bitmap) { |
| 143 | assert(tone_dirty && "Tone Bitmap Created but tone was not marked dirty!"); |
| 144 | tone_bitmap = Bitmap::Create(tone_bitmap_rect.width, tone_bitmap_rect.height, true); |
| 145 | } |
| 146 | |
| 147 | if (tone_dirty) { |
| 148 | tone_bitmap->ToneBlit(0, 0, bitmap, rect, tone_effect, Opacity::Opaque()); |
| 149 | } |
| 150 | return tone_bitmap.get(); |
| 151 | } |
| 152 | |
| 153 | void Weather::CreateRainParticle() { |
| 154 | constexpr int w = rain_bitmap_rect.width; |