Mercurial > love-experiments
comparison src/modules/image/devil/ImageData.cpp @ 1418:357697c2e2a8
More internal code cleanup
| author | Alex Szpakowski <slime73@gmail.com> |
|---|---|
| date | Sun, 31 Mar 2013 19:02:27 -0300 |
| parents | 09e4aec8f429 |
| children |
comparison
equal
deleted
inserted
replaced
| 1417:c70c9e4d10f3 | 1418:357697c2e2a8 |
|---|---|
| 129 if (bpp != sizeof(pixel)) | 129 if (bpp != sizeof(pixel)) |
| 130 throw love::Exception("Could not convert image!"); | 130 throw love::Exception("Could not convert image!"); |
| 131 | 131 |
| 132 create(width, height, ilGetData()); | 132 create(width, height, ilGetData()); |
| 133 } | 133 } |
| 134 catch (love::Exception &) | |
| 135 { | |
| 136 ilDeleteImage(image); | |
| 137 throw; | |
| 138 } | |
| 139 catch (std::exception &e) | 134 catch (std::exception &e) |
| 140 { | 135 { |
| 136 // catches love and std exceptions | |
| 141 ilDeleteImage(image); | 137 ilDeleteImage(image); |
| 142 throw love::Exception("%s", e.what()); | 138 throw love::Exception("%s", e.what()); |
| 143 } | 139 } |
| 144 | 140 |
| 145 ilDeleteImage(image); | 141 ilDeleteImage(image); |
| 223 | 219 |
| 224 f->open(love::filesystem::File::WRITE); | 220 f->open(love::filesystem::File::WRITE); |
| 225 f->write(encoded_data, size); | 221 f->write(encoded_data, size); |
| 226 f->close(); | 222 f->close(); |
| 227 } | 223 } |
| 228 catch (love::Exception &) | |
| 229 { | |
| 230 ilDeleteImage(tempimage); | |
| 231 delete[] encoded_data; | |
| 232 throw; | |
| 233 } | |
| 234 catch (std::exception &e) | 224 catch (std::exception &e) |
| 235 { | 225 { |
| 226 // catches love and std exceptions | |
| 236 ilDeleteImage(tempimage); | 227 ilDeleteImage(tempimage); |
| 237 delete[] encoded_data; | 228 delete[] encoded_data; |
| 238 throw love::Exception("%s", e.what()); | 229 throw love::Exception("%s", e.what()); |
| 239 } | 230 } |
| 240 | 231 |
