Skip to content
This repository was archived by the owner on Jul 17, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
e0f3266
refactor(gameplayscene): revamp drawcombo logic
AlberttFrgk Jan 6, 2024
c343bed
fix(game): fix thread synchronization, removed sdl_delay
AlberttFrgk Jan 9, 2024
12c53a4
fix(game): forgot to implement stop() notify
AlberttFrgk Jan 9, 2024
4deb60e
Updated Game.cpp
AlberttFrgk Jan 9, 2024
209aca8
fix(game): condition variable has false wake-ups
AlberttFrgk Jan 11, 2024
a25d8dd
Update Game.cpp
AlberttFrgk Jan 22, 2024
5c06e19
feat: fix chart logger, improve combo animation
AlberttFrgk Jan 28, 2024
f4bdff6
Merge branch 'master' of https://github.com/AlberttFrgk/O2Game
AlberttFrgk Jan 28, 2024
40ba895
Update Chart.cpp
AlberttFrgk Jan 31, 2024
0724c8f
feat: slighly performance improvement
AlberttFrgk Jan 31, 2024
5a945c0
feat: improved framelimiter and combo animation
AlberttFrgk Feb 4, 2024
064065e
Update Game.h
AlberttFrgk Feb 4, 2024
e7dea28
Update Game.cpp
AlberttFrgk Feb 4, 2024
ae7c979
feat(gameplayscene): Draw Image for Mods
AlberttFrgk Feb 13, 2024
6ada348
refactor(gameplay): swap playfield and playfooter
AlberttFrgk Feb 13, 2024
dd60565
refactor(gameplay): better filename
AlberttFrgk Feb 13, 2024
d2047fa
feat(gameplay): add modifier logger
AlberttFrgk Feb 13, 2024
ae837d9
feat: add new modifier
AlberttFrgk Feb 15, 2024
c378acb
refactor(gameplayscene): move few code
AlberttFrgk Feb 15, 2024
2c68f09
fix(songselectscene): rearrange should not selected if random,mirror,…
AlberttFrgk Feb 16, 2024
81a5283
refactor(gameplayscene): fix duplicate code
AlberttFrgk Feb 16, 2024
61bde3f
feat: small changes, remove unnecessary code
AlberttFrgk Feb 17, 2024
4a97557
refactor(gameplayscene): lerp removed, optimize combo animation
AlberttFrgk Feb 17, 2024
da6e032
refactor(gameplayscene): remove useless code
AlberttFrgk Feb 17, 2024
0105872
refactor(gameplayscene): clean few codes
AlberttFrgk Feb 17, 2024
99b9a92
AlberttFrgk Feb 17, 2024
2a1406b
feat: sprite now can play once or stop on last frame
AlberttFrgk Feb 18, 2024
ee16279
refactor(gameplayscene): fix for visual modifier
AlberttFrgk Feb 18, 2024
44ef416
refactor(gameplayscene): remove unused code
AlberttFrgk Feb 18, 2024
4d74bc4
feat: fix thread and performance overtime
AlberttFrgk Feb 20, 2024
35c07b4
refactor(drawablenote): temporary fix render on note
AlberttFrgk Feb 20, 2024
8e21d1a
refactor(gameplayscene): TargetBar AlphaBlend
AlberttFrgk Feb 20, 2024
8e32379
typo
AlberttFrgk Feb 20, 2024
c24e185
feat: better implementation song bg
AlberttFrgk Feb 20, 2024
a3554e2
refactor(gameplayscene): move some code and clean things
AlberttFrgk Feb 25, 2024
abeb3ea
feat: o2jam health rules based on difficulty 🔥
AlberttFrgk Feb 25, 2024
fc3b9a0
fix(Texture2D): Color3 not handled while using Vulkan Render
AlberttFrgk Feb 29, 2024
2de93cd
Update DrawableNote.cpp
AlberttFrgk Feb 29, 2024
871ea9a
fix(loadingscene): fix song background for supported file and if no i…
AlberttFrgk Feb 29, 2024
3d37071
Merge branch 'master' of https://github.com/AlberttFrgk/O2Game
AlberttFrgk Feb 29, 2024
a6d5469
feat(note): make note normal disappear while it pressed
AlberttFrgk Mar 2, 2024
39e64c0
Revert "feat(note): make note normal disappear while it pressed"
albertfrengki Apr 10, 2024
899013e
refactor(scenemanager): fix slow loading scene causing stuck for a while
albertfrengki Apr 10, 2024
68bfca8
refactor(ojm): fix no sound in few ojm (kenz)
AlberttFrgk May 22, 2024
c784e18
refactor(rhythmengine): adjusted delay
albertfrengki Apr 10, 2024
10bd83d
refactor some codes
albertfrengki Apr 12, 2024
97a87a6
Rebase
albertfrengki Apr 10, 2024
28ad7ae
fix: note has render glitching and inconsistent frame index
albertfrengki Apr 13, 2024
96f0a3e
albertfrengki Apr 13, 2024
3f75ebf
fix
albertfrengki Apr 13, 2024
0f10ed2
feat: move background option to settings
albertfrengki Apr 13, 2024
b10e6a1
fix(songselectscene): fix switch case modifier
albertfrengki Apr 13, 2024
684b273
feat: open file feature inside game
albertfrengki Apr 14, 2024
46c5b05
albertfrengki Apr 14, 2024
0b2c6e2
feat: open file now can load selected mod
albertfrengki Apr 15, 2024
cfa9984
refactor(songselectscene): added difficulty to saved selected mod aft…
albertfrengki Apr 15, 2024
9df2a24
albertfrengki Apr 15, 2024
5747db7
feat: added new settings and fix
albertfrengki Apr 19, 2024
044e9ee
refactor(gameplayscene): The true O2Jam Combo animation
albertfrengki Apr 20, 2024
664e095
fix: antivirus false detection
albertfrengki Apr 21, 2024
8848758
refactor: fix Lv. 0 on Title and stuff
albertfrengki May 14, 2024
349a76e
refactor: improve framelimit and scenemanager
albertfrengki May 16, 2024
139af50
fix(texture2d): fixed half white line
albertfrengki May 17, 2024
339a9c5
albertfrengki May 17, 2024
1b6c364
albertfrengki May 19, 2024
c034d80
Revert ""
albertfrengki May 19, 2024
5605858
refactor: better approach for white line issues, added game version i…
albertfrengki May 21, 2024
3b135fd
albertfrengki May 21, 2024
57941c6
albertfrengki May 21, 2024
2e6f25a
AlberttFrgk May 21, 2024
f86a4cf
refactor(ojm): add handler for unencoded audio data
AlberttFrgk May 21, 2024
f689acc
refactor: better solution for half white line issue (2)
AlberttFrgk May 22, 2024
5acf404
refactor: better solution for half white line issue
AlberttFrgk May 22, 2024
3c77949
AlberttFrgk May 22, 2024
bb787ac
refactor(ojm): fix no sound in few OJM
AlberttFrgk May 22, 2024
93fa479
added comment
AlberttFrgk May 22, 2024
cab75a7
AlberttFrgk May 22, 2024
7e566b7
refactor(ojm): game now can read the other mask ojm files
AlberttFrgk May 23, 2024
88c4cb1
refactor: fix everything
AlberttFrgk May 24, 2024
a5f61da
refactor: fix everything (2)
AlberttFrgk May 24, 2024
bf00f6b
AlberttFrgk May 24, 2024
23cddeb
refactor(sprite2d): fix for drawstop
AlberttFrgk May 24, 2024
50e2e70
refactor: hide directx11 due weird framedrop (instead use vulkan lmao)
AlberttFrgk May 24, 2024
45720a3
refactor(game): changed some code
AlberttFrgk May 25, 2024
87b20fa
refactor(setting): now game grab refresh rate and make values by mult…
AlberttFrgk May 26, 2024
3f6f057
AlberttFrgk May 27, 2024
8df764c
refactor(note): forget to add trail on tail Long Note, fix crash in r…
AlberttFrgk May 29, 2024
5a04bbb
refactor(scoremanager): make code easiest to read
AlberttFrgk May 30, 2024
19babe4
AlberttFrgk May 30, 2024
bcb6c63
refactor(chart): fix game not read event and audio sample properly on…
AlberttFrgk May 31, 2024
01bf097
AlberttFrgk May 31, 2024
298e2e2
refactor: fix missing font and panic mod causing overlapped
AlberttFrgk Jun 1, 2024
cf9183e
refactor: idk what i'm doing
AlberttFrgk Jun 2, 2024
b490187
test
AlberttFrgk Jun 2, 2024
35479d4
this ok
AlberttFrgk Jun 2, 2024
f1d0383
AlberttFrgk Jun 2, 2024
545b822
refactor(note): adjust code a little bit
AlberttFrgk Jun 2, 2024
b5c115a
refactor: optimize
AlberttFrgk Jun 5, 2024
add34b1
refactor: new Resources, new note type option, optimized code on Font…
AlberttFrgk Jun 6, 2024
c40bc1d
refactor(LuaScripting): fix config doesn't load Notes.ini and Notes.l…
AlberttFrgk Jun 7, 2024
6c24e1e
fix later
AlberttFrgk Jun 12, 2024
1d59ff3
apalah
AlberttFrgk Jun 16, 2024
785cfb5
refactor(gameplayscene): refactor combo animation
AlberttFrgk Jun 19, 2024
162316c
AlberttFrgk Jun 19, 2024
3d5b64e
refactor: ez2on look like hold note (note percy option)
AlberttFrgk Jun 21, 2024
87b5879
refactor(note):readjusted lnbody height and pos so it will in the mid…
AlberttFrgk Jun 21, 2024
151f319
remove percy option
AlberttFrgk Jun 21, 2024
e6b399d
refactor: add new measure line type, remove useless options
AlberttFrgk Jun 22, 2024
3c2bce7
refactor(note):add option Long Note Body On Top for few skins and ref…
AlberttFrgk Jun 22, 2024
2c62539
AlberttFrgk Jun 22, 2024
06891f2
AlberttFrgk Jun 22, 2024
ecf3474
AlberttFrgk Jun 22, 2024
11ff090
refactor(chart): fix stupid vector subscript out of range and adjustL…
AlberttFrgk Jun 27, 2024
aa5b13e
refector(noteimagecachemanaher): remove useless code
AlberttFrgk Jun 27, 2024
edcac05
AlberttFrgk Jul 4, 2024
dd3b7ae
refactor(note): code now easier to read
AlberttFrgk Jul 4, 2024
3f7121f
AlberttFrgk Jul 4, 2024
8c6030a
refactor(gameplayscene): O2JAM COMBO ANIMATION (FINAL)
AlberttFrgk Jul 7, 2024
8c2e057
AlberttFrgk Jul 8, 2024
944f85c
stupid github desktop
AlberttFrgk Jul 8, 2024
c61e1f7
Merge branch 'o2jamsimulator' of https://github.com/AlberttFrgk/O2Gam…
AlberttFrgk Jul 8, 2024
ad95640
refactor(gameplayscene): added code
AlberttFrgk Jul 9, 2024
2105090
refactor(gameplayscene): o2jam combo animation should be like this
AlberttFrgk Jul 9, 2024
292f2eb
AlberttFrgk Jul 14, 2024
dde950e
remove problematic feature
AlberttFrgk Aug 27, 2024
d95baac
improve game experience
AlberttFrgk Aug 27, 2024
8a20b88
remove option other than 7K
AlberttFrgk Aug 27, 2024
0e2f06f
AlberttFrgk Aug 27, 2024
c5d1692
merge everything (#1)
AlberttFrgk Aug 27, 2024
cb39315
Revert ""
AlberttFrgk Aug 28, 2024
273c4a3
Revert "" (#2)
AlberttFrgk Oct 24, 2024
b56d361
feat: fix key mode lane for skinning later
AlberttFrgk Jun 6, 2026
bbdafb3
feat: loaded file now has preview and info than reopen game
AlberttFrgk Jun 6, 2026
2dbb8bb
fix: crash sometimes on first game open
AlberttFrgk Jun 6, 2026
6ff77ea
fix: dx11 unstable rendering
AlberttFrgk Jun 7, 2026
b5416fa
fix: modifier not properly working as intended
AlberttFrgk Jun 7, 2026
86d05cd
fix: some background failed to load
AlberttFrgk Jun 7, 2026
7c18ae8
feat: improved animation
AlberttFrgk Jun 7, 2026
b0cd361
feat: improve animation and framelimit
AlberttFrgk Jun 7, 2026
86a4393
fix: game sometimes crash
AlberttFrgk Jun 7, 2026
b5fcf64
x
AlberttFrgk Jun 7, 2026
eb730c8
fix; remove dx11 unsafe for daily use case
AlberttFrgk Jun 8, 2026
95ef45e
fix: submodule
AlberttFrgk Jun 8, 2026
6a2dce5
refactor: cleanup a bit
AlberttFrgk Jun 8, 2026
d1d92e6
feat: fix crash and improve skin arena
AlberttFrgk Jun 8, 2026
e9fcf0d
refactor: clean duplicate code for animation
AlberttFrgk Jun 8, 2026
d9380e0
feat: use Chart::CalculateBeat to calculate animation instead
AlberttFrgk Jun 8, 2026
abdae18
refactor: very accurate GetBPMAnimationIndex calculation
AlberttFrgk Jun 8, 2026
1bb65a9
fix: play 1 cycle animation if song ended
AlberttFrgk Jun 8, 2026
aefbc25
fix: if load o2jam file, no info loaded
AlberttFrgk Jun 8, 2026
5eead62
fix: typo
AlberttFrgk Jun 8, 2026
400a7cb
feat: ignore sv if it normalized
AlberttFrgk Jun 8, 2026
44d94b9
feat: panic mod (in testing)
AlberttFrgk Jun 8, 2026
13a2918
refactor: added more launch option
AlberttFrgk Jun 9, 2026
487fd30
feat: improve game end check and game
AlberttFrgk Jun 11, 2026
855bad9
fix: GetBPMAnimationIndex ignore sv if bpm more than 1
AlberttFrgk Jun 11, 2026
5083be8
feat: proper panic mod and bpm based animation
AlberttFrgk Jun 11, 2026
82d8faa
fix: correctly show actual bpm on loaded file
AlberttFrgk Jun 11, 2026
f71cd7b
refactor: no need wait 5 sec, already fix
AlberttFrgk Jun 11, 2026
b8090b2
feat: make end game more quicker and improve bpm based animation
AlberttFrgk Jun 12, 2026
a158b31
new: load video from osu!mania beatmaps, improve later
AlberttFrgk Jun 12, 2026
575d29d
fix: audio sudden stop while loaded file
AlberttFrgk Jun 12, 2026
e8db8aa
feat: improve video performance and settings
AlberttFrgk Jun 13, 2026
3f0f7da
refactor: rework skin system
AlberttFrgk Jun 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Language: Cpp
BasedOnStyle: LLVM
UseTab: Never
UseTab: Always
IndentWidth: 4
TabWidth: 4
BreakBeforeBraces: Custom
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "GameResources"]
path = GameResources
url = https://github.com/Estrol/O2GameResources
path = resources
url = https://github.com/AlberttFrgk/O2GameResources
34 changes: 21 additions & 13 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,43 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(Windows) Attach",
"type": "cppvsdbg",
"request": "attach",
},
{
"program": "${workspaceFolder}/build/Game/Game",
"name": "Game - Linux Debug",
"type": "cppdbg",
"request": "launch",
"args": [],
"cwd": "${workspaceFolder}/build/Game",
"preLaunchTask": "cmake-gcc-build"
},
{
"program": "${workspaceFolder}/build/Game/Debug/Game.exe",
"name": "Game - Windows Debug",
"type": "cppvsdbg",
"program": "${workspaceFolder}/build/Game/Game",
"name": "Game - Linux Release",
"type": "cppdbg",
"request": "launch",
"args": [],
"cwd": "${workspaceFolder}/build/Game",
"preLaunchTask": "cmake-gcc-build"
},
{
"name": "Game - Compile and Debug",
"type": "cppvsdbg",
"program": "${workspaceFolder}/build/Game/Debug/Game.exe",
"name": "Game - Windows Debug (LLDB)",
"type": "lldb",
"request": "launch",
"preLaunchTask": "cmake-msvc-build",
"program": "${workspaceFolder}/build/Game/Debug/Game",
"args": [],
"cwd": "${workspaceFolder}/build/Game/Debug",
"args": []
"console": "integratedTerminal",
"preLaunchTask": "cmake-msvc-build"
},
{
"program": "${workspaceFolder}/build/Game/Release/Game.exe",
"name": "Game - Windows Release (LLDB)",
"type": "lldb",
"request": "launch",
"args": [],
"cwd": "${workspaceFolder}/build/Game/Release",
"console": "integratedTerminal",
"preLaunchTask": "cmake-msvc-build"
}
]
}
14 changes: 12 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@
{
"label": "cmake-gcc-build",
"type": "shell",
"command": "cmake --build ${workspaceRoot}/build -- -j 4"
"command": "cmake --build ${workspaceRoot}/build -- -j 4",
"presentation": {
"reveal": "always",
"panel": "shared",
"focus": true
}
},
{
"label": "cmake-msvc-build",
"type": "shell",
"command": "cmake --build ${workspaceRoot}/build"
"command": "cmake --build ${workspaceRoot}/build",
"presentation": {
"reveal": "always",
"panel": "shared",
"focus": true
}
}
]
}
60 changes: 16 additions & 44 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.15)
message("Unnamed O2 Game Clone Project - CMake Build System")

# check if CXX_COMPILER is not cl.exe then set
Expand Down Expand Up @@ -61,11 +61,13 @@ find_package(ZLIB REQUIRED)
find_package(JPEG REQUIRED)
find_package(BZip2 REQUIRED)
find_package(Iconv REQUIRED)
find_package(Sol2 REQUIRED)
set(Sol2_LIBRARIES sol2)
find_package(sol2 CONFIG REQUIRED)
set(Sol2_LIBRARIES sol2::sol2)

find_package(Lua REQUIRED)
set(Lua_LIBRARIES lua)

find_package(PkgConfig REQUIRED)
pkg_check_modules(FFMPEG REQUIRED IMPORTED_TARGET libavcodec libavformat libavutil libswscale)

find_package(Vulkan)

Expand All @@ -87,57 +89,26 @@ include_directories(
${Iconv_INCLUDE_DIRS}
)

# third-party libraries
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(LIB_INDEX 3)
else()
set(LIB_INDEX 1)
endif()

message("CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE} ${LIB_INDEX}")

if (WIN32)
set(THIRD_PARTY_LIBS
"${PROJECT_SOURCE_DIR}/third-party/lib/${O2GAME_PLATFORM}-windows/${CMAKE_BUILD_TYPE}/bass.lib"
"${PROJECT_SOURCE_DIR}/third-party/lib/${O2GAME_PLATFORM}-windows/${CMAKE_BUILD_TYPE}/bass_fx.lib"
"${PROJECT_SOURCE_DIR}/third-party/lib/${O2GAME_PLATFORM}-windows/$<CONFIG>/bass.lib"
"${PROJECT_SOURCE_DIR}/third-party/lib/${O2GAME_PLATFORM}-windows/$<CONFIG>/bass_fx.lib"
)

elseif (UNIX AND NOT APPLE)
set(THIRD_PARTY_LIBS
"${PROJECT_SOURCE_DIR}/third-party/lib/${O2GAME_PLATFORM}-linux/${CMAKE_BUILD_TYPE}/libbass.so"
"${PROJECT_SOURCE_DIR}/third-party/lib/${O2GAME_PLATFORM}-linux/${CMAKE_BUILD_TYPE}/libbass_fx.so"
"${PROJECT_SOURCE_DIR}/third-party/lib/${O2GAME_PLATFORM}-linux/$<CONFIG>/libbass.so"
"${PROJECT_SOURCE_DIR}/third-party/lib/${O2GAME_PLATFORM}-linux/$<CONFIG>/libbass_fx.so"
dl
pthread
m
)
endif()

# check if FREETYPE_LIBRAIES is a list then check first index if optimized
if (FREETYPE_LIBRARIES MATCHES ";")
list(GET FREETYPE_LIBRARIES ${LIB_INDEX} LIB_FREETYPE)
else()
set(LIB_FREETYPE ${FREETYPE_LIBRARIES})
endif()

if (JPEG_LIBRARIES MATCHES ";")
list(GET JPEG_LIBRARIES ${LIB_INDEX} LIB_JPEG)
else()
set(LIB_JPEG ${JPEG_LIBRARIES})
endif()

list(GET PNG_LIBRARIES ${LIB_INDEX} LIB_PNG)

if (PNG_LIBRARIES MATCHES ";")
list(GET PNG_LIBRARIES ${LIB_INDEX} LIB_PNG)
else()
set(LIB_PNG ${PNG_LIBRARIES})
endif()

if (BZIP2_LIBRARIES MATCHES ";")
list(GET BZIP2_LIBRARIES ${LIB_INDEX} LIB_BZIP2)
else()
set(LIB_BZIP2 ${BZIP2_LIBRARIES})
endif()
set(LIB_FREETYPE Freetype::Freetype)
set(LIB_JPEG JPEG::JPEG)
set(LIB_PNG PNG::PNG)
set(LIB_BZIP2 BZip2::BZip2)

if (WIN32)
set(VOLK_STATIC_DEFINES VK_USE_PLATFORM_WIN32_KHR)
Expand All @@ -150,13 +121,14 @@ set(O2GAME_LIBRARIES
${SDL2_IMAGE_LIBRARIES}
${SQLite3_LIBRARIES}
${Sol2_LIBRARIES}
${Lua_LIBRARIES}
${LUA_LIBRARIES}
${LIB_FREETYPE}
${LIB_PNG}
${LIB_JPEG}
${LIB_BZIP2}
${THIRD_PARTY_LIBS}
${Iconv_LIBRARIES}
PkgConfig::FFMPEG
)

message("Libraries: ${O2GAME_LIBRARIES}")
Expand Down
4 changes: 2 additions & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "windows-base",
"hidden": true,
"generator": "Visual Studio 17 2022",
"generator": "Visual Studio 18 2026",
"binaryDir": "${sourceDir}/build",
"installDir": "${sourceDir}/build",
"cacheVariables": {
Expand All @@ -14,7 +14,7 @@
},
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"toolset": {
"value": "host=x64,version=14.29",
"value": "host=x64",
"strategy": "external"
},
"condition": {
Expand Down
11 changes: 4 additions & 7 deletions Engine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0.0)
cmake_minimum_required(VERSION 3.15)

project(EstEngine VERSION 0.1.0 LANGUAGES C CXX)

Expand Down Expand Up @@ -99,12 +99,9 @@ add_library(EstEngine
"src/Game.cpp"
)

if (WIN32)
set(glslangValidator "$ENV{VULKAN_SDK}/Bin/glslangValidator.exe")
elseif (UNIX AND NOT APPLE)
set(glslangValidator "$ENV{VULKAN_SDK}/Bin/glslangValidator")
else()
message(FATAL_ERROR "Unsupported platform")
find_program(glslangValidator NAMES glslangValidator PATHS "${CMAKE_SOURCE_DIR}/build/vcpkg_installed/x64-windows/tools/glslang" "$ENV{VULKAN_SDK}/Bin")
if(NOT glslangValidator)
message(FATAL_ERROR "glslangValidator not found! Ensure it is installed via vcpkg or VULKAN_SDK.")
endif()

execute_process(
Expand Down
7 changes: 6 additions & 1 deletion Engine/include/Game.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#include <string>
#include "Inputs/InputManager.h"
#include "Overlay.h"
#include "Rendering/Renderer.h"
Expand Down Expand Up @@ -51,6 +52,7 @@ class Game
virtual void Render(double deltaTime);
virtual void Input(double deltaTime);
virtual void Mouse(double deltaTime);
virtual void OnDropFile(std::string path);

GameWindow *m_window;
Renderer *m_renderer;
Expand Down Expand Up @@ -87,4 +89,7 @@ class Game
GameThread mRenderThread;
GameThread mAudioThread;
GameThread mLocalThread;
};

std::mutex m_mutex;
std::condition_variable m_cv;
};
1 change: 0 additions & 1 deletion Engine/include/Rendering/Renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ enum class RendererMode {
OPENGL, // 0
VULKAN, // 1
DIRECTX, // 2
DIRECTX11, // 3
DIRECTX12, // 4
METAL, // 5
};
Expand Down
3 changes: 3 additions & 0 deletions Engine/include/Rendering/Threading/GameThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <functional>
#include <thread>
#include <vector>
#include <mutex>

class GameThread
{
Expand All @@ -19,6 +20,8 @@ class GameThread
bool m_run;
bool m_background;

std::mutex m_mutex;

std::thread m_thread;

std::function<void()> m_main_cb;
Expand Down
3 changes: 3 additions & 0 deletions Engine/include/Rendering/Vulkan/Texture2DVulkan.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ namespace vkTexture {

Texture2D_Vulkan *TexLoadImage(std::filesystem::path imagePath);
Texture2D_Vulkan *TexLoadImage(void *buffer, size_t size);
Texture2D_Vulkan *AllocateTexture(int width, int height);
Texture2D_Vulkan *GetDummyImage();
VkDescriptorSet GetVkDescriptorSet(Texture2D_Vulkan *image);

void UpdateTexture(Texture2D_Vulkan *handle, void *buffer, int pitch);

void QueryTexture(Texture2D_Vulkan *handle, int &outWidth, int &outHeight);
void ReleaseTexture(Texture2D_Vulkan *handle);

Expand Down
2 changes: 1 addition & 1 deletion Engine/include/Rendering/Window.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class GameWindow
float GetHeightScale();

void SetScaleOutput(bool value);
bool IsScaleOutput();
bool IsScaleOutput() const;

void SetWindowTitle(std::string &title);
void SetWindowSubTitle(std::string &subTitle);
Expand Down
23 changes: 17 additions & 6 deletions Engine/include/Texture/Sprite2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,41 @@ class Sprite2D
public:
Sprite2D() = default;

Sprite2D(std::vector<Texture2D *> textures, float delay = 1.0f);
Sprite2D(std::vector<std::string> textures, float delay = 1.0f);
Sprite2D(std::vector<std::filesystem::path> textures, float delay = 1.0f);
Sprite2D(std::vector<SDL_Texture *> textures, float delay = 1.0f);
Sprite2D(std::vector<Texture2D *> textures, double delay = 1.0);
Sprite2D(std::vector<std::string> textures, double delay = 1.0);
Sprite2D(std::vector<std::filesystem::path> textures, double delay = 1.0);
Sprite2D(std::vector<SDL_Texture *> textures, double delay = 1.0);

~Sprite2D();

bool AlphaBlend;
bool FlipX = false;
bool FlipY = false;
Vector2 AnchorPoint;
UDim2 Position;
UDim2 Position2;
UDim2 Size;

void Draw(double delta, bool manual = false);
void Draw(double delta, Rect *rect, bool manual = false);
void DrawStop(double delta, bool manual = false);
void DrawOnce(double delta, bool manual = false);

Texture2D *GetTexture();
void SetFPS(float fps);
void SetFPS(double fps);
void Reset();
void SetIndex(int index) { m_currentIndex = index; }
int GetFrameCount() const { return static_cast<int>(m_textures.size()); }

double m_spritespeed = 1.0;

private:
double m_delay = 1.0;
float m_currentTime = 0;
int m_currentIndex = 0;

bool m_drawOnce = false;

std::vector<Texture2D *> m_textures;

void DrawInternal(double delta, bool playOnce, Rect* rect, bool manual);
};
12 changes: 8 additions & 4 deletions Engine/include/Texture/Texture2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ class Texture2D

public:
Texture2D();
Texture2D(std::string fileName);
Texture2D(std::filesystem::path path);
Texture2D(uint8_t *fileData, size_t size);
Texture2D(const std::string& fileName);
Texture2D(int width, int height);
Texture2D(const std::filesystem::path& path);
Texture2D(const uint8_t *fileData, size_t size);
Texture2D(SDL_Texture *texture);
Texture2D(Texture2D_Vulkan *texture);
~Texture2D();
Expand All @@ -33,9 +34,12 @@ class Texture2D
void Draw(Rect *clipRect, bool manualDraw);

void CalculateSize();
void UpdateTexture(uint8_t* buffer, int width, int height, int pitch);

float Transparency;
float Rotation;
bool FlipX = false;
bool FlipY = false;
bool AlphaBlend;
bool m_ready = false;

Expand All @@ -51,7 +55,7 @@ class Texture2D
Rect GetOriginalRECT();
void SetOriginalRECT(Rect size);

static Texture2D *FromTexture2D(Texture2D *tex);
// static Texture2D *FromTexture2D(Texture2D *tex);

static Texture2D *FromBMP(uint8_t *fileData, size_t size);
static Texture2D *FromBMP(std::string fileName);
Expand Down
Loading