Files
Gleb MazovetskiyandClaude Sonnet 4.6 53b91fd7a2 Untangle more dependencies
Split several monolithic files to reduce transitive dependencies and
enable the dun_render_benchmark to link without bringing in all of
DevilutionX:

- Extract dungeon tile globals and loading functions from `gendung` into
  `dun_tile_data.{hpp,cpp}`
- Extract light table data and MakeLightTable from lighting into
  `engine/light_tables.{hpp,cpp}`
- Move cursor_id and SelectionRegion to cursor_defs.hpp
- Extract quest log rendering to `panels/quest_log.{hpp,cpp}`
- Extract drlg quest setpiece logic to `levels/drlg_quests.{hpp,cpp}`
- Extract quest data loading to `tables/questdat.{hpp,cpp}`
- Move `GameData` and `gbIsMultiplayer` into `game_mode.{hpp,cpp}`
- Add `parse_sfx_id.{hpp,cpp}`
- Update CMake libraries accordingly

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-08-23 06:08:15 +01:00

63 lines
1.5 KiB
C++

/**
* @file cursor.h
*
* Interface of cursor tracking functionality.
*/
#pragma once
#include "cursor_defs.hpp"
#include "engine/clx_sprite.hpp"
#include "engine/point.hpp"
#include "engine/size.hpp"
#include "engine/surface.hpp"
#include "utils/attributes.h"
namespace devilution {
extern int pcursmonst;
extern int8_t pcursinvitem;
extern uint16_t pcursstashitem;
extern int8_t pcursitem;
struct Object; // Defined in objects.h
extern Object *ObjectUnderCursor;
struct Player; // Defined in player.h
extern const Player *PlayerUnderCursor;
extern Point cursPosition;
extern DVL_API_FOR_TEST int pcurs;
void InitCursor();
void FreeCursor();
void ResetCursor();
struct Item;
/**
* @brief Use the item sprite as the cursor (or show the default hand cursor if the item isEmpty)
*/
void NewCursor(const Item &item);
void NewCursor(int cursId);
void InitLevelCursor();
void CheckRportal();
void CheckTown();
void CheckCursMove();
void DrawSoftwareCursor(const Surface &out, Point position, int cursId);
void DrawItem(const Item &item, const Surface &out, Point position, ClxSprite clx);
/** Returns the sprite for the given inventory index. */
ClxSprite GetInvItemSprite(int cursId);
ClxSprite GetHalfSizeItemSprite(int cursId);
ClxSprite GetHalfSizeItemSpriteRed(int cursId);
void CreateHalfSizeItemSprites();
void FreeHalfSizeItemSprites();
/** Returns the width and height for an inventory index. */
Size GetInvItemSize(int cursId);
} // namespace devilution