| 282 | } |
| 283 | |
| 284 | void addwaterquad(int x, int y, int size) // update bounding rect that contains water |
| 285 | { |
| 286 | int x2 = x+size; |
| 287 | int y2 = y+size; |
| 288 | if(wx1<0) |
| 289 | { |
| 290 | wx1 = x; |
| 291 | wy1 = y; |
| 292 | wx2 = x2; |
| 293 | wy2 = y2; |
| 294 | } |
| 295 | else |
| 296 | { |
| 297 | if(x<wx1) wx1 = x; |
| 298 | if(y<wy1) wy1 = y; |
| 299 | if(x2>wx2) wx2 = x2; |
| 300 | if(y2>wy2) wy2 = y2; |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | void calcwaterscissor() |
| 305 | { |