Skip to content

Commit

Permalink
Add video support
Browse files Browse the repository at this point in the history
  • Loading branch information
Stazik committed Feb 16, 2024
1 parent 6424003 commit 3fd5592
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
19 changes: 19 additions & 0 deletions Source/Game/Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ int terScreenIndex = 0;
#ifdef GPX
constexpr int terFullScreen = 0;
constexpr int terResizableWindow = 0;
bool isRuntimePaused = false;
#else
int terFullScreen = 0;
int terResizableWindow = 1;
Expand Down Expand Up @@ -916,6 +917,15 @@ char* alloc_exec_arg_string(std::string arg, bool wrap_spaces) {
strcpy(str, arg.c_str());
return str;
}
#ifdef GPX
void pauseRuntime() {
isRuntimePaused = true;
}

void resumeRuntime() {
isRuntimePaused = false;
}
#endif

int SDL_main(int argc, char *argv[])
{
Expand Down Expand Up @@ -999,6 +1009,15 @@ int SDL_main(int argc, char *argv[])

bool run = true;
while (run) {
#ifdef GPX
if (isRuntimePaused) {
#ifdef EMSCRIPTEN
emscripten_sleep(0);
continue;
#endif
}
#endif

app_event_poll();

//NetworkPause handler
Expand Down
3 changes: 2 additions & 1 deletion Source/Game/Texts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ gamepix.com&FFFFFF
&CCCCFFВеб версия&FFFFFF
Александр "caiiiycuk" Гурьянов
Станислав "sta3ik" Павлов
&66CCFFК-Д ЛАБ
Expand All @@ -37,7 +38,7 @@ gamepix.com&FFFFFF
&CCCCFFWeb Version&FFFFFF
Alexander "caiiiycuk" Guryanov
Stanislav "sta3ik" Pavlov
&66CCFFK-D LAB
kdlab.com&FFFFFF
Expand Down
9 changes: 8 additions & 1 deletion Source/UserInterface/ReelManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ void ReelManager::showModal(const char* videoFileName, const char* soundFileName
}
}

#ifdef GPX
while (!player->IsEnd()) {
player->Update();
}
#else

Vect2i picSize;
Vect2i showPos;
switch (sizeType) {
Expand Down Expand Up @@ -122,7 +128,7 @@ void ReelManager::showModal(const char* videoFileName, const char* soundFileName
terRenderDevice->BeginScene();
terRenderDevice->EndScene();
terRenderDevice->Flush();

#endif
delete player;
player = NULL;
RELEASE(bgTexture);
Expand Down Expand Up @@ -195,4 +201,5 @@ void ReelManager::showPictureModal(const char* pictureFileName, int stableTime)
// RELEASE(bgTexture);

hide();

}
2 changes: 1 addition & 1 deletion Source/UserInterface/UserSingleProfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void UserSingleProfile::addProfile(const std::string& name) {
bool UserSingleProfile::removeDir(const std::string& dir) {
std::error_code error;
std::string allSaves = getAllSavesDirectory();
std::filesystem::path target_path = std::filesystem::u8path(allSaves + PATH_SEP + dir);
std::filesystem::path target_path = std::filesystem::u8path(allSaves + dir);
std::filesystem::remove_all(target_path, error);
if( error ) {
ErrH.Abort("Can't remove profile directory: ", XERR_USER, error.value(), error.message().c_str());
Expand Down

0 comments on commit 3fd5592

Please sign in to comment.