2015-05-24 06:55:12 +02:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2021-07-05 03:22:19 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2009-02-23 07:17:57 +01:00
|
|
|
|
2014-02-10 19:54:46 +01:00
|
|
|
#pragma once
|
2009-02-23 07:17:57 +01:00
|
|
|
|
2013-08-24 02:13:54 +02:00
|
|
|
#include <functional>
|
2013-08-24 01:41:17 +02:00
|
|
|
#include <string>
|
|
|
|
|
2014-10-21 08:01:38 +02:00
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
|
2013-08-24 01:41:17 +02:00
|
|
|
namespace OSD
|
2009-02-23 07:17:57 +01:00
|
|
|
{
|
2016-02-02 16:35:27 +01:00
|
|
|
enum class MessageType
|
|
|
|
{
|
|
|
|
NetPlayPing,
|
|
|
|
NetPlayBuffer,
|
|
|
|
|
|
|
|
// This entry must be kept last so that persistent typed messages are
|
|
|
|
// displayed before other messages
|
|
|
|
Typeless,
|
|
|
|
};
|
|
|
|
|
|
|
|
namespace Color
|
|
|
|
{
|
|
|
|
constexpr u32 CYAN = 0xFF00FFFF;
|
|
|
|
constexpr u32 GREEN = 0xFF00FF00;
|
|
|
|
constexpr u32 RED = 0xFFFF0000;
|
|
|
|
constexpr u32 YELLOW = 0xFFFFFF30;
|
2019-05-06 01:48:12 +02:00
|
|
|
}; // namespace Color
|
2016-02-02 16:35:27 +01:00
|
|
|
|
|
|
|
namespace Duration
|
|
|
|
{
|
|
|
|
constexpr u32 SHORT = 2000;
|
|
|
|
constexpr u32 NORMAL = 5000;
|
|
|
|
constexpr u32 VERY_LONG = 10000;
|
2019-05-06 01:48:12 +02:00
|
|
|
}; // namespace Duration
|
2016-02-02 16:35:27 +01:00
|
|
|
|
2015-01-01 19:23:34 +01:00
|
|
|
// On-screen message display (colored yellow by default)
|
2020-08-02 01:31:05 +02:00
|
|
|
void AddMessage(std::string message, u32 ms = Duration::SHORT, u32 argb = Color::YELLOW);
|
2019-07-29 04:46:08 +02:00
|
|
|
void AddTypedMessage(MessageType type, std::string message, u32 ms = Duration::SHORT,
|
2020-08-02 01:31:05 +02:00
|
|
|
u32 argb = Color::YELLOW);
|
2019-07-29 04:46:08 +02:00
|
|
|
|
|
|
|
// Draw the current messages on the screen. Only call once per frame.
|
|
|
|
void DrawMessages();
|
2011-02-02 05:40:27 +01:00
|
|
|
void ClearMessages();
|
2020-09-12 17:56:47 +02:00
|
|
|
|
|
|
|
void SetObscuredPixelsLeft(int width);
|
|
|
|
void SetObscuredPixelsTop(int height);
|
2013-08-24 02:13:54 +02:00
|
|
|
} // namespace OSD
|