![]() |
Routines |
| Prev: 44720 | Up: Map | Next: 44867 |
|
Used by the routines at CreateSpawnedEntity, SetEntityDefaults, StartBurst, SetUpCreature, UpdatePickupEntity, UpdateGrowingBubbleEntity, SetUpShotSprite, UpdateBurstEntity, AnimateEntity, UpdateExtraRecord, AddObjectEntity, RunFrame, HandleOverlap and ResetEntities.
Fetches the sprite for the entity with FindSpriteFrame and copies the width and the height of the sprite to fields 22 and 23. If either is too big, the game crashes with FlashBorder.
|
||||||||
| SetEntitySize | 44833 | CALL FindSpriteFrame | Find the sprite of the entity. | |||||
| 44836 | EX DE,HL | Point HL at the sprite. | ||||||
| 44837 | LD A,(HL) | Fetch the width of the sprite. | ||||||
| 44838 | CP 5 | Jump to FlashBorder to crash if the width is 5 bytes or more. | ||||||
| 44840 | JR NC,FlashBorder | |||||||
| 44842 | LD A,(IX+22) | Fetch the width byte of the entity. | ||||||
| 44845 | AND %11110000 | Keep the flags in bits 4-7. | ||||||
| 44847 | OR (HL) | Combine them with the width of the sprite. | ||||||
| 44848 | LD (IX+22),A | Store the width of the entity. | ||||||
| 44851 | INC HL | Move on to the height of the sprite. | ||||||
| 44852 | LD A,(HL) | Fetch the height of the sprite. | ||||||
| 44853 | CP 40 | Jump to FlashBorder to crash if the height is 40 or more. | ||||||
| 44855 | JR NC,FlashBorder | |||||||
| 44857 | LD A,(IX+23) | Fetch the height byte of the entity. | ||||||
| 44860 | AND %11000000 | Keep the flags in bits 6-7. | ||||||
| 44862 | OR (HL) | Combine them with the height of the sprite. | ||||||
| 44863 | LD (IX+23),A | Store the height of the entity. | ||||||
| 44866 | RET | Return. | ||||||
| Prev: 44720 | Up: Map | Next: 44867 |