diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-03-26 10:47:51 +0000 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-03-26 10:47:51 +0000 |
commit | 6eca1b485dba7355d827745284ed2f0072f9e370 (patch) | |
tree | 6298e90b5ec5802ac26c9a8b674c7cbd59d0c048 /src/resources/resourcemanager.h | |
parent | 5dd1950adfef870b26670cbee938513433953d19 (diff) | |
download | mana-6eca1b485dba7355d827745284ed2f0072f9e370.tar.gz mana-6eca1b485dba7355d827745284ed2f0072f9e370.tar.bz2 mana-6eca1b485dba7355d827745284ed2f0072f9e370.tar.xz mana-6eca1b485dba7355d827745284ed2f0072f9e370.zip |
Use SDL2 support for color and system mouse cursors
This way the cursor is not limited by the framerate nor affected by
input lag. Also, when custom cursor is disabled, a few different system
cursors are now used instead.
It also avoids an issue on Wayland, where hiding the cursor (as done to
render our own one) would cause the cursor to get locked within the
window.
On macOS it fixes two cursors being visible when hovering the window
while it is in the background.
The cursor can unfortunately no longer gently fade away.
Diffstat (limited to 'src/resources/resourcemanager.h')
-rw-r--r-- | src/resources/resourcemanager.h | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h index 7a92818f..6694321c 100644 --- a/src/resources/resourcemanager.h +++ b/src/resources/resourcemanager.h @@ -105,6 +105,16 @@ class ResourceManager std::string getPath(const std::string &file); /** + * Opens a file for reading. The caller is responsible for closing the + * file. + * + * @param path The file name. + * @return A valid SDL_RWops pointer or <code>NULL</code> if the file + * could not be opened. + */ + SDL_RWops *open(const std::string &path); + + /** * Creates a resource and adds it to the resource map. * * @param idPath The resource identifier path. @@ -124,18 +134,7 @@ class ResourceManager * @return A valid resource or <code>NULL</code> if the resource could * not be loaded. */ - Resource *load(const std::string &path, loader fun); - - /** - * Copies a file from one place to another (useful for extracting - * raw files from a zip archive, for example) - * - * @param src Source file name - * @param dst Destination file name - * @return true on success, false on failure. An error message should be - * in the log file. - */ - bool copyFile(const std::string &src, const std::string &dst); + Resource *get(const std::string &path, loader fun); /** * Convenience wrapper around ResourceManager::get for loading @@ -183,6 +182,17 @@ class ResourceManager bool inflate = true); /** + * Copies a file from one place to another (useful for extracting + * raw files from a zip archive, for example) + * + * @param src Source file name + * @param dst Destination file name + * @return true on success, false on failure. An error message should be + * in the log file. + */ + bool copyFile(const std::string &src, const std::string &dst); + + /** * Retrieves the contents of a text file. */ std::vector<std::string> loadTextFile(const std::string &fileName); |