Skip to content

Commit

Permalink
Add text to image destructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
gabordemooij committed Jul 13, 2024
1 parent babcbdf commit 9c807d5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/media/media.c
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ ctr_object* ctr_media_screen(ctr_object* myself, ctr_argument* argumentList) {
}
if (controllableObject != NULL) {
player = (MediaIMG*) controllableObject->value.rvalue->ptr;
if (CtrMediaJump == 1) {
if (CtrMediaJump == 1 && CtrMediaJumpHeightFactor) {
CtrMediaJumpHeight = player->h * CtrMediaJumpHeightFactor;
CtrMediaJump = 2;
}
Expand Down Expand Up @@ -2183,6 +2183,10 @@ extern ctr_object* ctr_network_basic_text_send(ctr_object* myself, ctr_argument*

void ctr_img_destructor(ctr_resource* rs) {
MediaIMG* image = (MediaIMG*) rs->ptr;
if (image->text != NULL) {
ctr_heap_free(image->text);
image->text = NULL;
}
if (image->texture) {
SDL_DestroyTexture(image->texture);
}
Expand Down

0 comments on commit 9c807d5

Please sign in to comment.