Fix reached macOS UI primitives and audio fade behavior
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "../src/platform/ScriptLib/PythonHost.h"
|
||||
#include "../src/platform/UserInterface/UserInterface.h"
|
||||
#include "../src/platform/EterLib/UIRenderCommands.h"
|
||||
#include "EterLib/GrpScreen.h"
|
||||
#include <dinput.h> // DIK_ESCAPE
|
||||
|
||||
#include <cmath>
|
||||
@@ -108,9 +109,31 @@ static void frames(int count)
|
||||
PythonBoot::UIUpdate();
|
||||
}
|
||||
|
||||
static void drawing_primitives()
|
||||
{
|
||||
UIRenderSetSize(800, 600);
|
||||
UIRenderBeginFrame();
|
||||
CScreen screen;
|
||||
screen.SetDiffuseColor(0xFF123456u);
|
||||
screen.RenderBox2d(10, 20, 30, 40);
|
||||
screen.RenderGradationBar2d(50, 60, 70, 80, 0xFF102030u, 0xFF405060u);
|
||||
const auto& commands = UIRenderCommands();
|
||||
CHECK(commands.size() == 5);
|
||||
if (commands.size() == 5)
|
||||
{
|
||||
CHECK(commands[0].kind == UIRenderCommand::Line && near(commands[0].x1, 10) && near(commands[0].y2, 20));
|
||||
CHECK(commands[3].kind == UIRenderCommand::Line && near(commands[3].x2, 31));
|
||||
CHECK(commands[4].kind == UIRenderCommand::GradientBar && commands[4].argb == 0xFF102030u &&
|
||||
commands[4].end_argb == 0xFF405060u);
|
||||
}
|
||||
UIRenderSetSize(0, 0);
|
||||
UIRenderBeginFrame();
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
drawing_primitives();
|
||||
const char* strict = std::getenv("MT_ASSETS_STRICT");
|
||||
const bool is_strict = strict && std::string(strict) == "1";
|
||||
const std::string client = argc > 1 ? argv[1] : "";
|
||||
|
||||
Reference in New Issue
Block a user