diff --git a/3rdParty/Storm/Source/storm.h b/3rdParty/Storm/Source/storm.h index 8434276ce..4e1c032c6 100644 --- a/3rdParty/Storm/Source/storm.h +++ b/3rdParty/Storm/Source/storm.h @@ -3,12 +3,19 @@ #ifndef __BLIZZARD_STORM_HEADER #define __BLIZZARD_STORM_HEADER -#ifndef MINIWIN +#ifdef __WIN32__ #include #include #include #include -#else +#endif + +#ifdef MINIWIN +#include "miniwin.h" +#endif + + +#ifdef ANDROID #include "miniwin.h" #endif diff --git a/Source/pfile.cpp b/Source/pfile.cpp index 3d8963713..46bb84691 100644 --- a/Source/pfile.cpp +++ b/Source/pfile.cpp @@ -111,6 +111,32 @@ void __fastcall pfile_encode_hero(const PkPlayerStruct *pPack) BOOL __fastcall pfile_open_archive(BOOL a1, unsigned int save_num) { +#ifdef ANDROID + char SaveDir[MAX_PATH] = "/sdcard/Diablo/"; // Full path to SAVDIR + char FileName[MAX_PATH]; + + + pfile_get_save_path(FileName, sizeof(FileName), save_num); + + strcat(SaveDir,FileName+2); + printf("FULL ITEM ? %s \n", SaveDir ); + strcpy(FileName, SaveDir); + if ( mpqapi_open_archive(FileName, FALSE, save_num) ) + return TRUE; + + if ( a1 && gbMaxPlayers > 1 ) + mpqapi_update_multi_creation_time(save_num); + return FALSE; + + + + + +#else + + + + char FileName[MAX_PATH]; pfile_get_save_path(FileName, sizeof(FileName), save_num); @@ -120,6 +146,9 @@ BOOL __fastcall pfile_open_archive(BOOL a1, unsigned int save_num) if ( a1 && gbMaxPlayers > 1 ) mpqapi_update_multi_creation_time(save_num); return FALSE; + +#endif + } void __fastcall pfile_get_save_path(char *pszBuf, DWORD dwBufSize, unsigned int save_num) @@ -407,13 +436,32 @@ BOOL __fastcall pfile_read_hero(void *archive, PkPlayerStruct *pPack) HANDLE __fastcall pfile_open_save_archive(int *unused, unsigned int save_num) { - char SrcStr[MAX_PATH]; - HANDLE archive; +#ifdef ANDROID + char SaveDir[MAX_PATH] = "/sdcard/Diablo/"; // Full path to SAVDIR + char SrcStr[MAX_PATH]; + HANDLE archive; + + pfile_get_save_path(SrcStr, sizeof(SrcStr), save_num); + + strcat(SaveDir,SrcStr+2); + printf("FULL ITEM ? %s \n", SaveDir ); + strcpy(SrcStr, SaveDir); + if ( SFileOpenArchive(SrcStr, 0x7000, 0, &archive) ) + return archive; + return NULL; + +#else // IF NOT ANDROID + + char SrcStr[MAX_PATH]; + HANDLE archive; + + pfile_get_save_path(SrcStr, sizeof(SrcStr), save_num); + if (SFileOpenArchive(SrcStr, 0x7000, 0, &archive)) + return archive; + return NULL; + +#endif - pfile_get_save_path(SrcStr, sizeof(SrcStr), save_num); - if ( SFileOpenArchive(SrcStr, 0x7000, 0, &archive) ) - return archive; - return NULL; } void __fastcall pfile_SFileCloseArchive(HANDLE hsArchive) diff --git a/Stub/init.cpp b/Stub/init.cpp index 047312232..38240af77 100644 --- a/Stub/init.cpp +++ b/Stub/init.cpp @@ -594,7 +594,7 @@ void SDL_Diablo_UI() // I anticipate to move this later. - if ( cpu_time_used > 1 && (x > NewGameBox.x) && (y > NewGameBox.y) && (x < NewGameBox.w) && (y < NewGameBox.h)) { + if ( cpu_time_used > 0.5 && (x > NewGameBox.x) && (y > NewGameBox.y) && (x < NewGameBox.w) && (y < NewGameBox.h)) { printf(" New Game I was hit\n\n\n"); menu = 6; @@ -603,7 +603,7 @@ void SDL_Diablo_UI() // I anticipate to move this later. start = 0; } - if (cpu_time_used > 1 && (x > LoadGameBox.x) && (y > LoadGameBox.y) && (x < LoadGameBox.w) && (y < LoadGameBox.h)) { + if (cpu_time_used > 0.5 && (x > LoadGameBox.x) && (y > LoadGameBox.y) && (x < LoadGameBox.w) && (y < LoadGameBox.h)) { printf(" Load Game I was hit\n\n\n"); break; @@ -676,13 +676,13 @@ void SDL_Diablo_UI() // I anticipate to move this later. CreateHeroCancelBox.w = CreateHeroCancelBox.x + 100; CreateHeroCancelBox.h = CreateHeroCancelBox.y + 30; - if (cpu_time_used > 1 && (x > NormalSelectBox.x) && (y > NormalSelectBox.y) && (x < NormalSelectBox.w) && + if (cpu_time_used > 0.5 && (x > NormalSelectBox.x) && (y > NormalSelectBox.y) && (x < NormalSelectBox.w) && (y < NormalSelectBox.h)) { StartNewGame = 1; gnDifficulty = DIFF_NORMAL; break; } - if (cpu_time_used > 1 && (x > NightmareSelectBox.x) && (y > NightmareSelectBox.y) && (x < NightmareSelectBox.w) && + if (cpu_time_used > 0.5 && (x > NightmareSelectBox.x) && (y > NightmareSelectBox.y) && (x < NightmareSelectBox.w) && (y < NightmareSelectBox.h)) { StartNewGame = 1; gnDifficulty = DIFF_NIGHTMARE; diff --git a/Stub/sdlrender.cpp b/Stub/sdlrender.cpp index 4b9844fa0..15883c3b6 100644 --- a/Stub/sdlrender.cpp +++ b/Stub/sdlrender.cpp @@ -2,9 +2,6 @@ #include "miniwin_sdl.h" #include "stubs.h" -#include -//#include -#include int SCREEN_WIDTH = 800; // 1024×768 int SCREEN_HEIGHT = 600;