VideoCommon: Add support for icons in OSD messages.

This commit is contained in:
Admiral H. Curtiss
2023-10-17 01:42:22 +02:00
parent 7122c7e872
commit cb13ad7a5f
3 changed files with 73 additions and 13 deletions

View File

@ -4,7 +4,9 @@
#pragma once
#include <functional>
#include <memory>
#include <string>
#include <vector>
#include "Common/CommonTypes.h"
@ -35,10 +37,18 @@ constexpr u32 NORMAL = 5000;
constexpr u32 VERY_LONG = 10000;
}; // namespace Duration
struct Icon
{
std::vector<u8> rgba_data;
u32 width = 0;
u32 height = 0;
}; // struct Icon
// On-screen message display (colored yellow by default)
void AddMessage(std::string message, u32 ms = Duration::SHORT, u32 argb = Color::YELLOW);
void AddMessage(std::string message, u32 ms = Duration::SHORT, u32 argb = Color::YELLOW,
std::unique_ptr<Icon> icon = nullptr);
void AddTypedMessage(MessageType type, std::string message, u32 ms = Duration::SHORT,
u32 argb = Color::YELLOW);
u32 argb = Color::YELLOW, std::unique_ptr<Icon> icon = nullptr);
// Draw the current messages on the screen. Only call once per frame.
void DrawMessages();