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 d6c3624
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
16 changes: 16 additions & 0 deletions Source/Game/Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const char* currentVersion =
uint16_t currentVersionNumbers[] = {0, 0, 0};

static int terMissionEdit = 0;
bool isRuntimePaused = false;

cLogicGeneric* terLogicGeneric = NULL;
cVisGeneric* terVisGeneric = NULL;
Expand Down Expand Up @@ -917,6 +918,14 @@ char* alloc_exec_arg_string(std::string arg, bool wrap_spaces) {
return str;
}

void pauseRuntime() {
isRuntimePaused = true;
}

void resumeRuntime() {
isRuntimePaused = false;
}

int SDL_main(int argc, char *argv[])
{
//Show help if requested
Expand Down Expand Up @@ -999,6 +1008,13 @@ int SDL_main(int argc, char *argv[])

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

app_event_poll();

//NetworkPause handler
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 d6c3624

Please sign in to comment.