Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.
Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
This commit is contained in:
parent
35d2a8cb36
commit
a47d20f8be
890 changed files with 11796 additions and 16664 deletions
|
|
@ -1,51 +0,0 @@
|
|||
#include "UI/WindowGeometry.h"
|
||||
|
||||
#include <windows.h>
|
||||
// clang-format off
|
||||
#include <mmsystem.h>
|
||||
// clang-format on
|
||||
|
||||
// OFFSET: 0x00A79A90
|
||||
WindowGeometry::WindowGeometry()
|
||||
: width(0), height(0), x(0), y(0), surface(nullptr), visible(1), id(600), unknown_0030(0), unknown_0034(0),
|
||||
targetAlpha(255), alphaStart(timeGetTime()), currentAlpha(255) {
|
||||
}
|
||||
|
||||
// OFFSET: 0x00A81D40
|
||||
// FUNCTION: fn_16987
|
||||
void WindowGeometry::Move(int newX, int newY) {
|
||||
this->x = newX;
|
||||
this->y = newY;
|
||||
}
|
||||
|
||||
// OFFSET: 0x005C9630
|
||||
// FUNCTION: fn_03632
|
||||
void WindowGeometry::Show(int state) {
|
||||
this->visible = state;
|
||||
}
|
||||
|
||||
// OFFSET: 0x005C8F60
|
||||
// FUNCTION: fn_03629
|
||||
void WindowGeometry::SetId(int value) {
|
||||
this->id = value;
|
||||
}
|
||||
|
||||
// OFFSET: 0x00A7D6F0
|
||||
// FUNCTION: fn_16954
|
||||
std::uint32_t WindowGeometry::Color() {
|
||||
std::uint32_t value = this->currentAlpha;
|
||||
if (value != this->targetAlpha) {
|
||||
const std::uint32_t step = (timeGetTime() - this->alphaStart) >> 4;
|
||||
const std::uint32_t candidate = value < this->targetAlpha ? value + step : value - step;
|
||||
const bool keepCandidate =
|
||||
value < this->targetAlpha ? candidate < this->targetAlpha : this->targetAlpha < candidate;
|
||||
value = keepCandidate ? candidate : this->targetAlpha;
|
||||
this->currentAlpha = value;
|
||||
}
|
||||
if (value > 255) {
|
||||
value = this->targetAlpha;
|
||||
this->currentAlpha = value;
|
||||
}
|
||||
// Adds 0xFFFFFF, rather than OR: retain wrap at unusual values.
|
||||
return (value << 24) + 0xFFFFFF;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue