Browse Source

added new build

pull/18/head
aperturesecurity 7 years ago
parent
commit
22c941d488
  1. 11
      3rdParty/Storm/Source/storm.h
  2. 60
      Source/pfile.cpp
  3. 8
      Stub/init.cpp
  4. 3
      Stub/sdlrender.cpp

11
3rdParty/Storm/Source/storm.h vendored

@ -3,12 +3,19 @@
#ifndef __BLIZZARD_STORM_HEADER
#define __BLIZZARD_STORM_HEADER
#ifndef MINIWIN
#ifdef __WIN32__
#include <windows.h>
#include <winuser.h>
#include <winsock.h>
#include <ddraw.h>
#else
#endif
#ifdef MINIWIN
#include "miniwin.h"
#endif
#ifdef ANDROID
#include "miniwin.h"
#endif

60
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)

8
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;

3
Stub/sdlrender.cpp

@ -2,9 +2,6 @@
#include "miniwin_sdl.h"
#include "stubs.h"
#include <SDL2/SDL.h>
//#include <SDL_image.h>
#include <SDL_mixer.h>
int SCREEN_WIDTH = 800; // 1024×768
int SCREEN_HEIGHT = 600;

Loading…
Cancel
Save