aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Texture.cpp
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-08 17:31:25 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-08 17:31:25 +0100
commit91a277c69fd5f8ba814adc1006a49c7415ff65be (patch)
tree5545e9a9374e017a45ea56a81c2b7e24091cbcc2 /src/crepe/api/Texture.cpp
parentcb6aae1751a95a29bc04d805d9cc9135b5c54c1e (diff)
updated to satisfy the code review
Diffstat (limited to 'src/crepe/api/Texture.cpp')
-rw-r--r--src/crepe/api/Texture.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/crepe/api/Texture.cpp b/src/crepe/api/Texture.cpp
index 5519e5e..e6c2e05 100644
--- a/src/crepe/api/Texture.cpp
+++ b/src/crepe/api/Texture.cpp
@@ -32,18 +32,10 @@ void Texture::load(unique_ptr<Asset> res) {
}
int Texture::get_width() const{
- if (this->texture) {
- return SDLContext::get_instance().get_width(*this);
- }
- else {
- return 0;
- }
+ if (this->texture == nullptr) return 0;
+ return SDLContext::get_instance().get_width(*this);
}
int Texture::get_height() const{
- if (this->texture) {
- return SDLContext::get_instance().get_height(*this);
- }
- else {
- return 0;
- }
+ if (this->texture == nullptr) return 0;
+ return SDLContext::get_instance().get_width(*this);
}