aboutsummaryrefslogtreecommitdiff
path: root/sword2/resman.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sword2/resman.cpp')
-rw-r--r--sword2/resman.cpp61
1 files changed, 5 insertions, 56 deletions
diff --git a/sword2/resman.cpp b/sword2/resman.cpp
index 5349dca4f2..c1a064d3e7 100644
--- a/sword2/resman.cpp
+++ b/sword2/resman.cpp
@@ -955,38 +955,11 @@ void resMan::CacheNewCluster(uint32 newCluster) {
char buf[1024];
sprintf(buf, "%sClusters\\%s", cdPath, resource_files[newCluster]);
- uint8 fadeStat;
-
- do {
- fadeStat = GetFadeStatus();
-
- //--------------------------------------------------
- // Service windows
-
- // if we pressed Ctrl-Q
- if (ServiceWindows() == RDERR_APPCLOSED) {
- Close_game(); //close engine systems down
- CloseAppWindow();
- exit(0); //quit the game
- }
- //--------------------------------------------------
- } while (fadeStat == RDFADE_UP || fadeStat == RDFADE_DOWN);
+ WaitForFade();
if (GetFadeStatus() != RDFADE_BLACK) {
FadeDown((float) 0.75);
-
- do {
- //--------------------------------------------------
- // Service windows
-
- // if we pressed Ctrl-Q
- if (ServiceWindows() == RDERR_APPCLOSED) {
- Close_game(); //close engine systems down
- CloseAppWindow();
- exit(0); //quit the game
- }
- //--------------------------------------------------
- } while (GetFadeStatus() != RDFADE_BLACK);
+ WaitForFade();
}
EraseBackBuffer();
@@ -1083,18 +1056,7 @@ void resMan::CacheNewCluster(uint32 newCluster) {
CopyScreenBuffer();
FadeUp((float) 0.75);
- do {
- //--------------------------------------------------
- // Service windows
-
- // if we pressed Ctrl-Q
- if (ServiceWindows() == RDERR_APPCLOSED) {
- Close_game(); //close engine systems down
- CloseAppWindow();
- exit(0); //quit the game
- }
- //--------------------------------------------------
- } while (GetFadeStatus() == RDFADE_UP);
+ WaitForFade();
fseek(inFile, 0, SEEK_END);
uint32 size = ftell(inFile);
@@ -1167,22 +1129,9 @@ void resMan::CacheNewCluster(uint32 newCluster) {
EraseSoftwareScreenBuffer(); // for software rendering
FadeDown((float) 0.75);
-
- do {
- //--------------------------------------------------
- // Service windows
-
- // if we pressed Ctrl-Q
- if (ServiceWindows() == RDERR_APPCLOSED) {
- Close_game(); //close engine systems down
- CloseAppWindow();
- exit(0); //quit the game
- }
- //--------------------------------------------------
- } while (GetFadeStatus() == RDFADE_DOWN);
-
+ WaitForFade();
CopyScreenBuffer();
- FadeUp((float)0.75);
+ FadeUp((float) 0.75);
// Git rid of read-only status.
SVM_SetFileAttributes(resource_files[newCluster], FILE_ATTRIBUTE_NORMAL);