Fix default object sprites

This commit is contained in:
GriffinR 2023-03-15 21:38:58 -04:00
parent 11c2868b90
commit 0b6d61e3f1
2 changed files with 7 additions and 0 deletions

View file

@ -12,6 +12,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d
### Fixed ### Fixed
- Fix text boxes in the Palette Editor calculating color incorrectly. - Fix text boxes in the Palette Editor calculating color incorrectly.
- Fix default object sprites retaining dimensions and transparency of the previous sprite.
## [5.1.1] - 2023-02-20 ## [5.1.1] - 2023-02-20
### Added ### Added

View file

@ -244,6 +244,9 @@ void ObjectEvent::loadPixmap(Project *project) {
// No sprite associated with this gfx constant. // No sprite associated with this gfx constant.
// Use default sprite instead. // Use default sprite instead.
this->pixmap = project->entitiesPixmap.copy(0, 0, 16, 16); this->pixmap = project->entitiesPixmap.copy(0, 0, 16, 16);
this->spriteWidth = 16;
this->spriteHeight = 16;
this->usingSprite = false;
} else { } else {
this->setFrameFromMovement(project->facingDirections.value(this->movement)); this->setFrameFromMovement(project->facingDirections.value(this->movement));
this->setPixmapFromSpritesheet(eventGfx->spritesheet, eventGfx->spriteWidth, eventGfx->spriteHeight, eventGfx->inanimate); this->setPixmapFromSpritesheet(eventGfx->spritesheet, eventGfx->spriteWidth, eventGfx->spriteHeight, eventGfx->inanimate);
@ -387,6 +390,9 @@ void CloneObjectEvent::loadPixmap(Project *project) {
// No sprite associated with this gfx constant. // No sprite associated with this gfx constant.
// Use default sprite instead. // Use default sprite instead.
this->pixmap = project->entitiesPixmap.copy(0, 0, 16, 16); this->pixmap = project->entitiesPixmap.copy(0, 0, 16, 16);
this->spriteWidth = 16;
this->spriteHeight = 16;
this->usingSprite = false;
} else { } else {
this->setFrameFromMovement(project->facingDirections.value(this->movement)); this->setFrameFromMovement(project->facingDirections.value(this->movement));
this->setPixmapFromSpritesheet(eventGfx->spritesheet, eventGfx->spriteWidth, eventGfx->spriteHeight, eventGfx->inanimate); this->setPixmapFromSpritesheet(eventGfx->spritesheet, eventGfx->spriteWidth, eventGfx->spriteHeight, eventGfx->inanimate);