# HG changeset patch
# User a.parshin
# Date 1406133759 -10800
# Node ID 6d587789973035dbce6e0d181187bd10a99b3fe7
# Parent c99c99439f6c299184e80597feb70a4b12b50390
* -novideo disables shop videos
* replaced bicubic resampling for linear
diff -r c99c99439f6c -r 6d5877899730 Build/Visual Studio 2012/World of Might and Magic.vcxproj.user
--- a/Build/Visual Studio 2012/World of Might and Magic.vcxproj.user Wed Jul 23 13:32:09 2014 +0300
+++ b/Build/Visual Studio 2012/World of Might and Magic.vcxproj.user Wed Jul 23 19:42:39 2014 +0300
@@ -4,6 +4,6 @@
$(OutDir)$(TargetName)$(TargetExt)
$(OutDir)
WindowsLocalDebugger
- -nomarg -window -nointro -nologo
+ -nomarg -window -nointro -nologo -novideo
\ No newline at end of file
diff -r c99c99439f6c -r 6d5877899730 GUIProgressBar.cpp
--- a/GUIProgressBar.cpp Wed Jul 23 13:32:09 2014 +0300
+++ b/GUIProgressBar.cpp Wed Jul 23 19:42:39 2014 +0300
@@ -27,7 +27,7 @@
//GUIProgressBar *v2; // esi@1
signed int v4; // eax@7
int v5; // ecx@8
- int v6; // edi@8
+ //int v6; // edi@8
int v7; // edx@14
//const char *v8; // [sp-8h] [bp-84h]@20
//unsigned int v9; // [sp-4h] [bp-80h]@20
@@ -56,22 +56,22 @@
if (uType == TYPE_Fullscreen)
{
v5 = 0;
- v6 = (int)&field_10;
+ //v6 = (int)&field_10;
do
{
- if ( *(char *)(v6 + v4) == 1 ) //Uninitialized memory access (v6)
+ if ( field_10[v4] == 1 )
++v5;
++v4;
}
while ( v4 <= 5 );
if ( v5 == 5 )
- memset(&field_10, 0, 8);
+ memset(field_10, 0, 8);
v7 = rand() % 5 + 1;
- if ( *(&field_10 + v7) == 1 )
+ if ( field_10[v7] == 1 )
{
do
v7 = rand() % 5 + 1;
- while ( *(char *)(v6 + v7) == 1 );
+ while ( field_10[v7] == 1 );
}
sprintf(Str1, "loading%d.pcx", v7);
pLoadingBg.Load(Str1, 2);
@@ -86,25 +86,6 @@
return true;
}
- /*if ( !pParty->uAlignment )
- {
- v9 = 2;
- v8 = "bardata-b";
- goto LABEL_23;
- }
- if ( pParty->uAlignment == 1 )
- {
- v9 = 2;
- v8 = "bardata";
- goto LABEL_23;
- }
- if ( pParty->uAlignment == 2 )
- {
- v9 = 2;
- v8 = "bardata-c";
-LABEL_23:
- pIcons_LOD->_410522(&pBardata, v8, v9);
- }*/
switch (pParty->alignment)
{
case PartyAlignment_Good: pIcons_LOD->_410522(&pBardata, "bardata-b", 2); break;
diff -r c99c99439f6c -r 6d5877899730 GUIProgressBar.h
--- a/GUIProgressBar.h Wed Jul 23 13:32:09 2014 +0300
+++ b/GUIProgressBar.h Wed Jul 23 19:42:39 2014 +0300
@@ -28,14 +28,14 @@
char uProgressMax;
char uProgressCurrent;
Type uType;
- char field_10;
- char field_11;
- char field_12;
- char field_13;
- char field_14;
- char field_15;
- char field_16;
- char field_17;
+ char field_10[8];
+ //char field_11;
+ //char field_12;
+ //char field_13;
+ //char field_14;
+ //char field_15;
+ //char field_16;
+ //char field_17;
RGBTexture pLoadingBg;
RGBTexture field_40;
RGBTexture field_68;
diff -r c99c99439f6c -r 6d5877899730 OSWindow.h
--- a/OSWindow.h Wed Jul 23 13:32:09 2014 +0300
+++ b/OSWindow.h Wed Jul 23 19:42:39 2014 +0300
@@ -43,7 +43,7 @@
bool Initialize(const wchar_t *title, int window_width, int window_height);
bool WinApiMessageProc(UINT msg, WPARAM wparam, LPARAM lparam, LRESULT *result);
- HWND api_handle;
+ HWND api_handle;
private:
static LPARAM __stdcall WinApiMsgRouter(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
diff -r c99c99439f6c -r 6d5877899730 Render.cpp
--- a/Render.cpp Wed Jul 23 13:32:09 2014 +0300
+++ b/Render.cpp Wed Jul 23 19:42:39 2014 +0300
@@ -6281,8 +6281,22 @@
if ( LockSurface_DDraw4(pNextSurf, &desc, DDLOCK_WAIT | DDLOCK_WRITEONLY) )
{
- Dst.sub_451007_scale_image_bicubic(pHWLTexture->pPixels, pHWLTexture->uWidth, pHWLTexture->uHeight, pHWLTexture->uWidth,
- (unsigned short *)desc.lpSurface, desc.dwWidth, desc.dwHeight, desc.lPitch >> 1, 0, 0);
+ // linear scaling
+ for (int s = 0; s < desc.dwHeight; ++s)
+ for (int t = 0; t < desc.dwWidth; ++t)
+ {
+ unsigned int resampled_x = t * pHWLTexture->uWidth / desc.dwWidth,
+ resampled_y = s * pHWLTexture->uHeight / desc.dwHeight;
+ unsigned short sample = pHWLTexture->pPixels[resampled_y * pHWLTexture->uWidth + resampled_x];
+
+ ((unsigned short *)desc.lpSurface)[s * (desc.lPitch >> 1) + t] = sample;
+ }
+
+
+ //bicubic sampling
+ //Dst.sub_451007_scale_image_bicubic(pHWLTexture->pPixels, pHWLTexture->uWidth, pHWLTexture->uHeight, pHWLTexture->uWidth,
+ // (unsigned short *)desc.lpSurface, desc.dwWidth, desc.dwHeight, desc.lPitch >> 1, 0, 0);
+
ErrD3D(pNextSurf->Unlock(0));
//bMipMaps = 0x4D86ACu;
}
diff -r c99c99439f6c -r 6d5877899730 VideoPlayer.cpp
--- a/VideoPlayer.cpp Wed Jul 23 13:32:09 2014 +0300
+++ b/VideoPlayer.cpp Wed Jul 23 19:42:39 2014 +0300
@@ -267,7 +267,7 @@
void VideoPlayer::_inlined_in_463149()
{
- if (pMovie_Track)
+ if (pMovie_Track && !bNoVideo)
{
pRenderer->BeginScene();
pMouse->DrawCursorToTarget();