mirror of
https://github.com/libretro/devilutionX.git
synced 2026-11-10 10:51:25 -10:00
The format is almost identical to CL2, except it uses the frame header to store frame width and height instead of 5 32-line offsets. This means we always have access to frame dimensions, so we can use it as an on-disk format for our graphics as well. Additionally, we may be able to optimize the rendering even more in the future now that we have guaranteed knowledge of frame dimensions.
45 lines
986 B
C++
45 lines
986 B
C++
/**
|
|
* @file dead.h
|
|
*
|
|
* Interface of functions for placing dead monsters.
|
|
*/
|
|
#pragma once
|
|
|
|
#include <array>
|
|
#include <cstdint>
|
|
|
|
#include "engine.h"
|
|
#include "engine/clx_sprite.hpp"
|
|
#include "engine/point.hpp"
|
|
|
|
namespace devilution {
|
|
|
|
static constexpr unsigned MaxCorpses = 31;
|
|
|
|
struct Corpse {
|
|
OptionalClxSpriteListOrSheet sprites;
|
|
int frame;
|
|
uint16_t width;
|
|
uint8_t translationPaletteIndex;
|
|
|
|
/**
|
|
* @brief Returns the sprite list for a given direction.
|
|
*
|
|
* @param direction One of the 16 directions. Valid range: [0, 15].
|
|
* @return ClxSpriteList
|
|
*/
|
|
[[nodiscard]] ClxSpriteList spritesForDirection(Direction direction) const
|
|
{
|
|
return sprites->isSheet() ? sprites->sheet()[static_cast<size_t>(direction)] : sprites->list();
|
|
}
|
|
};
|
|
|
|
extern Corpse Corpses[MaxCorpses];
|
|
extern int8_t stonendx;
|
|
|
|
void InitCorpses();
|
|
void AddCorpse(Point tilePosition, int8_t dv, Direction ddir);
|
|
void SyncUniqDead();
|
|
|
|
} // namespace devilution
|