25 if (propName ==
"-w") {
31 }
else if (propName ==
"-h") {
37 }
else if (propName ==
"-relw") {
39 if (relSize.x != relw) {
43 }
else if (propName ==
"-relh") {
45 if (relSize.y != relh) {
49 }
else if (propName ==
"-scale") {
50 float scale2 = value.
getFloat(interp);
51 if (scale != scale2) {
55 }
else if (propName ==
"-image") {
57 if (imageName != val) {
67 }
else if (propName ==
"-bordersize") {
68 float newSize = value.
getFloat(interp);
69 if (borderSize != newSize) {
73 }
else if (propName ==
"-relbordersize") {
74 float newSize = value.
getFloat(interp);
75 if (relBorderSize != newSize) {
76 relBorderSize = newSize;
79 }
else if (propName ==
"-borderrgba") {
80 uint32_t newRGBA = value.
getInt(interp);
81 if (borderRGBA != newRGBA) {
92 if (propName ==
"-w") {
94 }
else if (propName ==
"-h") {
96 }
else if (propName ==
"-relw") {
98 }
else if (propName ==
"-relh") {
100 }
else if (propName ==
"-scale") {
102 }
else if (propName ==
"-image") {
104 }
else if (propName ==
"-bordersize") {
106 }
else if (propName ==
"-relbordersize") {
107 result = relBorderSize;
108 }
else if (propName ==
"-borderrgba") {
120bool OSDRectangle::takeImageDimensions()
const
122 return (size ==
vec2()) && (relSize ==
vec2());
125vec2 OSDRectangle::getSize(
const OutputSurface& output)
const
127 if (!imageName.empty() &&
image && takeImageDimensions()) {
135uint8_t OSDRectangle::getFadedAlpha()
const
140std::unique_ptr<GLImage> OSDRectangle::create(OutputSurface& output)
142 if (imageName.empty()) {
144 (((borderRGBA & 0xFF) == 0) || (borderSize == 0.0f))) {
152 vec2 sz = getSize(output);
154 auto bs = narrow_cast<int>(lrintf(factor * borderSize + sz.x * relBorderSize));
156 return std::make_unique<GLImage>(
round(sz),
getRGBA4(), bs, borderRGBA);
159 if (takeImageDimensions()) {
161 return std::make_unique<GLImage>(file, factor);
164 return std::make_unique<GLImage>(file, iSize);
Represents the output window/screen of openMSX.
std::string resolve(std::string_view filename) const
void getProperty(std::string_view name, TclObject &result) const override
OSDRectangle(Display &display, const TclObject &name)
void setProperty(Interpreter &interp, std::string_view name, const TclObject &value) override
std::string_view getType() const override
float getFloat(Interpreter &interp) const
int getInt(Interpreter &interp) const
zstring_view getString() const
constexpr double round(double x)
bool isRegularFile(const Stat &st)
This file implemented 3 utility functions:
const FileContext & systemFileContext()