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
131 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
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 .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
url = https://github.com/AlberttFrgk/O2GameResources
5 changes: 4 additions & 1 deletion Engine/include/Game.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,7 @@ class Game
GameThread mRenderThread;
GameThread mAudioThread;
GameThread mLocalThread;
};

std::mutex m_mutex;
std::condition_variable m_cv;
};
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
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
19 changes: 13 additions & 6 deletions Engine/include/Texture/Sprite2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ 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();

Expand All @@ -33,15 +33,22 @@ class Sprite2D

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();

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);
};
8 changes: 4 additions & 4 deletions Engine/include/Texture/Texture2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ 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(const std::filesystem::path& path);
Texture2D(const uint8_t *fileData, size_t size);
Texture2D(SDL_Texture *texture);
Texture2D(Texture2D_Vulkan *texture);
~Texture2D();
Expand Down Expand Up @@ -51,7 +51,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
2 changes: 1 addition & 1 deletion Engine/src/Configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void Configuration::Set(std::string key, std::string prop, std::string value)

void Configuration::Font_SetPath(std::filesystem::path path)
{
FontPath = path;
FontPath = std::filesystem::current_path() / "Resources";
}

std::filesystem::path Configuration::Font_GetPath()
Expand Down
41 changes: 32 additions & 9 deletions Engine/src/Fonts/FontResources.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma warning(disable : 4838) // Goddamit
#pragma warning(disable : 4838) // Goddamit
#pragma warning(disable : 4309)

#include <Misc/md5.h>
Expand All @@ -25,9 +25,9 @@
// BEGIN FONT FALLBACK

#include "FallbackFonts/arial.ttf.h"
#include "FallbackFonts/ch.ttf.h"
#include "FallbackFonts/jp.ttf.h"
#include "FallbackFonts/kr.ttf.h"
//#include "FallbackFonts/ch.ttf.h"
//#include "FallbackFonts/jp.ttf.h"
//#include "FallbackFonts/kr.ttf.h"
#include <Logs.h>

// END FONT FALLBACK
Expand Down Expand Up @@ -92,14 +92,37 @@ void FontResources::PreloadFontCaches()

GameWindow *wnd = GameWindow::GetInstance();

auto skinPath = Configuration::Font_GetPath();
auto fontPath = skinPath / "Fonts";
auto path = Configuration::Font_GetPath();
auto fontPath = path / "Fonts";

auto normalfont = fontPath / "normal.ttf";
auto jpFont = fontPath / "jp.ttf";
auto krFont = fontPath / "kr.ttf";
auto chFont = fontPath / "ch.ttf";

static const ImWchar glyphRanges[] = { // Optimized
(ImWchar)0x0020, (ImWchar)0x052F,
(ImWchar)0x2000, (ImWchar)0x27BF,
(ImWchar)0x2E80, (ImWchar)0x2FA1,
(ImWchar)0x1F300, (ImWchar)0x1FAFF,
(ImWchar)0x2660, (ImWchar)0x2663,
(ImWchar)0x2665, (ImWchar)0x2666,
(ImWchar)0x2600, (ImWchar)0x2606,
(ImWchar)0x2618, (ImWchar)0x2619,
(ImWchar)0x263A, (ImWchar)0x263B,
(ImWchar)0x2708, (ImWchar)0x2714,
(ImWchar)0x2728, (ImWchar)0x2734,
(ImWchar)0x2740, (ImWchar)0x274B,
(ImWchar)0x2756, (ImWchar)0x2758,
(ImWchar)0x2764, (ImWchar)0x2767,
(ImWchar)0x2794, (ImWchar)0x27BE,
(ImWchar)0x27F0, (ImWchar)0x27FF,
(ImWchar)0x2900, (ImWchar)0x297F,
(ImWchar)0x2A00, (ImWchar)0x2AFF,
(ImWchar)0x0000, (ImWchar)0x0000
};


{
float originScale = (wnd->GetBufferWidth() + wnd->GetBufferHeight()) / 15.6f;
float targetScale = (wnd->GetWidth() + wnd->GetHeight()) / 15.6f;
Expand All @@ -118,9 +141,9 @@ void FontResources::PreloadFontCaches()

{
if (std::filesystem::exists(normalfont)) {
Font.Font = io.Fonts->AddFontFromFileTTF((const char *)normalfont.u8string().c_str(), fontSize, &conf);
Font.Font = io.Fonts->AddFontFromFileTTF((const char *)normalfont.u8string().c_str(), fontSize, &conf, glyphRanges); // glyphRanges, fixing missing fonts
} else {
Font.Font = io.Fonts->AddFontFromMemoryTTF((void *)get_arial_font_data(), get_arial_font_size(), fontSize, &conf);
Font.Font = io.Fonts->AddFontFromMemoryTTF((void *)get_arial_font_data(), get_arial_font_size(), fontSize, &conf, glyphRanges);
}
}

Expand Down Expand Up @@ -151,7 +174,7 @@ void FontResources::PreloadFontCaches()
case TextRegion::Chinese:
{
if (std::filesystem::exists(chFont)) {
io.Fonts->AddFontFromFileTTF((const char *)chFont.u8string().c_str(), fontSize, &conf, io.Fonts->GetGlyphRangesChineseSimplifiedCommon());
io.Fonts->AddFontFromFileTTF((const char *)chFont.u8string().c_str(), fontSize, &conf, io.Fonts->GetGlyphRangesChineseFull());
}

break;
Expand Down
Loading