Initial public source release

Split reusable rendering and format support into vectorail-core and vectorail-gc.
This commit is contained in:
2026-08-02 17:05:27 +02:00
commit 831d96e562
109 changed files with 20558 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
#pragma once
namespace openroller::psp {
constexpr int kScreenWidth = 480;
constexpr int kScreenHeight = 272;
constexpr int kLogicalWidth = 720;
constexpr int kLogicalHeight = 1280;
constexpr float kLogicalScale = 3.0f / 8.0f;
constexpr int kScaledWidth = 270;
constexpr int kBorder = (kScreenHeight - kScaledWidth) / 2;
enum class TateSide {
Clockwise,
CounterClockwise,
};
struct Point {
float x;
float y;
};
inline Point toScreen(float logicalX, float logicalY, TateSide side) {
if (side == TateSide::Clockwise) {
return {
static_cast<float>(kScreenWidth) - logicalY * kLogicalScale,
static_cast<float>(kBorder) + logicalX * kLogicalScale,
};
}
return {
logicalY * kLogicalScale,
static_cast<float>(kBorder + kScaledWidth) - logicalX * kLogicalScale,
};
}
inline Point screenDirectionToLogical(float screenX, float screenY, TateSide side) {
if (side == TateSide::Clockwise) {
return {screenY, -screenX};
}
return {-screenY, screenX};
}
} // namespace openroller::psp