Skip to content

Commit 7a71c34

Browse files
committed
Fixed intro text bug and added fonts to fonts folder
1 parent 7451472 commit 7a71c34

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed

GalaxyEngine/fonts/Unispace Bd.otf

21.9 KB
Binary file not shown.

GalaxyEngine/fonts/Unispace Rg.otf

21.8 KB
Binary file not shown.

GalaxyEngine/include/parameters.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ struct UpdateVariables{
7171
float halfDomainWidth = domainSize.x * 0.5f;
7272
float halfDomainHeight = domainSize.y * 0.5f;
7373

74-
bool fullscreenState = false;
74+
bool fullscreenState = true;
7575

7676
int targetFPS = 144;
7777

GalaxyEngine/src/globalLogic.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,8 @@ void drawScene(Texture2D& particleBlurTex, RenderTexture2D& myUITexture, RenderT
544544
Font fontToUse = (myVar.customFont.texture.id != 0) ? myVar.customFont : GetFontDefault();
545545

546546
Vector2 textSize = MeasureTextEx(fontToUse, text, fontSize, 1.0f);
547-
int posX = (GetScreenWidth() - textSize.x) / 2;
548-
int posY = (GetScreenHeight() - textSize.y) / 2;
547+
int posX = (GetScreenWidth() - textSize.x) * 0.5f;
548+
int posY = (GetScreenHeight() - textSize.y) * 0.5f;
549549

550550
float textAlpha;
551551
if (fadeProgress < 0.2f) {

GalaxyEngine/src/main.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ int main(int argc, char** argv) {
1818
std::cout << "Threads available: " << threadsAvailable << std::endl;
1919
std::cout << "Thread amount set to: " << myVar.threadsAmount << std::endl;
2020

21+
if (myVar.fullscreenState) {
22+
myVar.screenWidth = GetMonitorWidth(GetCurrentMonitor());
23+
myVar.screenHeight = GetMonitorHeight(GetCurrentMonitor());
24+
}
25+
2126
InitWindow(myVar.screenWidth, myVar.screenHeight, "Galaxy Engine");
2227

2328
// ---- Config ---- //
@@ -140,6 +145,11 @@ int main(int argc, char** argv) {
140145
TraceLog(LOG_WARNING, "Failed to load font! Using default font");
141146
}
142147

148+
if (myVar.fullscreenState) {
149+
myVar.screenWidth = GetMonitorWidth(GetCurrentMonitor()) * 0.5f;
150+
myVar.screenHeight = GetMonitorHeight(GetCurrentMonitor()) * 0.5f;
151+
}
152+
143153
while (!WindowShouldClose()) {
144154

145155
fullscreenToggle(lastScreenWidth, lastScreenHeight, wasFullscreen, lastScreenState, myParticlesTexture, myUITexture);

0 commit comments

Comments
 (0)