Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add video support #1

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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