Mercurial > mm7
changeset 2574:dd36326a9994
More texture refactoring
GetLeather -> DrawTextureCustomHeight
line wrap: on
line diff
--- a/Arcomage/Arcomage.h Sat Mar 05 16:25:53 2016 +0200 +++ b/Arcomage/Arcomage.h Mon Mar 07 03:48:40 2016 +0200 @@ -1,7 +1,7 @@ #pragma once #include "OSAPI.h" -#include "..\Engine/Graphics/Texture.h" +#include "Engine/Graphics/Texture.h"
--- a/Engine/AssetsManager.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/AssetsManager.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -5,26 +5,13 @@ AssetsManager *assets = new AssetsManager(); - -Texture *AssetsManager::GetTexture(const char *name) +Image *AssetsManager::GetImage_16BitColorKey(const char *name, unsigned __int16 colorkey) { - //wchar_t wname[1024]; - //swprintf(wname, L"%S", name); - - return pIcons_LOD->LoadTexturePtr(name); -} - + wchar_t namew[1024]; + swprintf(namew, L"%S", name); -Texture *AssetsManager::GetTexture(const wchar_t *wname) -{ - char name[1024]; - sprintf(name, "%S", name); - - return this->GetTexture(name); + return this->GetImage_16BitColorKey(namew, colorkey); } - - - Image *AssetsManager::GetImage_16BitColorKey(const wchar_t *name, unsigned __int16 colorkey) { Image *img = new Image(); @@ -37,6 +24,47 @@ return img; } + + + + + +Image *AssetsManager::GetImage_16Bit(const char *name) +{ + wchar_t wname[1024]; + swprintf(wname, L"%S", name); + + return this->GetImage_16Bit(wname); +} + +Image *AssetsManager::GetImage_16Bit(const wchar_t *name) +{ + Image *img = new Image(); + if (!img->Image16bit_From_LOD(name)) + { + delete img; + img = nullptr; + } + + return img; +} + + + + + + + + + +Image *AssetsManager::GetImage_16BitAlpha(const char *name) +{ + wchar_t wname[1024]; + swprintf(wname, L"%S", name); + + return this->GetImage_16BitAlpha(wname); +} + Image *AssetsManager::GetImage_16BitAlpha(const wchar_t *name) { Image *img = new Image(); @@ -49,6 +77,10 @@ return img; } + + + + Image *AssetsManager::GetImage_PCXFromIconsLOD(const wchar_t *name) { Image *img = new Image();
--- a/Engine/AssetsManager.h Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/AssetsManager.h Mon Mar 07 03:48:40 2016 +0200 @@ -1,21 +1,22 @@ #pragma once -#include "Engine/LOD.h" +class Image; class AssetsManager { public: AssetsManager() {} - Texture *GetTexture(const char *name); - Texture *GetTexture(const wchar_t *name); - Image *GetImage_PCXFromFile(const wchar_t *filename); Image *GetImage_PCXFromIconsLOD(const wchar_t *name); Image *GetImage_PCXFromNewLOD(const wchar_t *name); + Image *GetImage_16Bit(const wchar_t *name); + Image *GetImage_16Bit(const char *name); Image *GetImage_16BitColorKey(const wchar_t *name, unsigned __int16 colorkey); + Image *GetImage_16BitColorKey(const char *name, unsigned __int16 colorkey); Image *GetImage_16BitAlpha(const wchar_t *name); + Image *GetImage_16BitAlpha(const char *name); protected: };
--- a/Engine/Engine.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Engine.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -846,7 +846,7 @@ void sub_42FBDD() { pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); - pRenderer->DrawTextureIndexedAlpha(pBtn_YES->uX, pBtn_YES->uY, pBtn_YES->pTextures[0]); + pRenderer->DrawTextureAlphaNew(pBtn_YES->uX/640.0f, pBtn_YES->uY/480.0f, pBtn_YES->pTextures[0]); pRenderer->Present(); } @@ -854,7 +854,7 @@ void CloseWindowBackground() { pAudioPlayer->PlaySound(SOUND_StartMainChoice02, -2, 0, -1, 0, 0, 0, 0); - pRenderer->DrawTextureIndexedAlpha(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pBtn_ExitCancel->pTextures[0]); + pRenderer->DrawTextureAlphaNew(pBtn_ExitCancel->uX/640.0f, pBtn_ExitCancel->uY/480.0f, pBtn_ExitCancel->pTextures[0]); pRenderer->Present(); } @@ -967,7 +967,7 @@ static_assert(sizeof(SpriteFrame) == 60, "Wrong type size"); static_assert(sizeof(RenderVertexSoft) == 0x30, "Wrong type size"); static_assert(sizeof(RenderBillboard) == 0x34, "Wrong type size"); - static_assert(sizeof(Texture) == 0x48, "Wrong type size"); + static_assert(sizeof(Texture_MM7) == 0x48, "Wrong type size"); //static_assert(sizeof(RGBTexture) == 0x28, "Wrong type size"); //static_assert(sizeof(LODFile_IconsBitmaps) == 0x11BB8 + 4, "Wrong type size"); // + virtual dtor ptr static_assert(sizeof(AudioPlayer) == 0xC84, "Wrong type size");
--- a/Engine/Engine.h Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Engine.h Mon Mar 07 03:48:40 2016 +0200 @@ -16,6 +16,7 @@ #include "OSAPI.h" #include "Engine/MapInfo.h" +#include "Engine/AssetsManager.h" #define GAME_FLAGS_1_01_lightmap_related 0x01
--- a/Engine/Events.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Events.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -69,7 +69,7 @@ unsigned int uTextureSize; // esi@3 //char Args[60]; // [sp+8h] [bp-B4h]@6 void *ptr; // [sp+B8h] [bp-4h]@1 - Texture DstBuf; // [sp+6Ch] [bp-50h]@1 + Texture_MM7 DstBuf; // [sp+6Ch] [bp-50h]@1 ptr = pEvents_LOD->LoadRaw(pContainerName, 0); pLodFile = pEvents_LOD->FindContainer(pContainerName, 0);
--- a/Engine/Graphics/IRender.h Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Graphics/IRender.h Mon Mar 07 03:48:40 2016 +0200 @@ -46,7 +46,7 @@ virtual void DrawPolygon(unsigned int uNumVertices, struct Polygon *a3, ODMFace *a4, IDirect3DTexture2 *pTexture) = 0; virtual void DrawTerrainPolygon(unsigned int uNumVertices, struct Polygon *a4, IDirect3DTexture2 *a5, bool transparent, bool clampAtTextureBorders) = 0; - virtual void DrawIndoorPolygon(unsigned int uNumVertices, struct BLVFace *a3, IDirect3DTexture2 *pHwTex, struct Texture *pTex, int uPackedID, unsigned int uColor, int a8) = 0; + virtual void DrawIndoorPolygon(unsigned int uNumVertices, struct BLVFace *a3, IDirect3DTexture2 *pHwTex, struct Texture_MM7 *pTex, int uPackedID, unsigned int uColor, int a8) = 0; virtual void MakeParticleBillboardAndPush_BLV(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle) = 0; virtual void MakeParticleBillboardAndPush_ODM(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle) = 0; @@ -69,30 +69,30 @@ virtual void ResetUIClipRect() = 0; virtual void CreditsTextureScroll(unsigned int pX, unsigned int pY, int move_X, int move_Y, struct RGBTexture *pTexture) = 0; - virtual void DrawTextureNew(float u, float v, struct Texture *) = 0; virtual void DrawTextureNew(float u, float v, struct Image *) = 0; virtual void DrawTextureAlphaNew(float u, float v, struct Image *) = 0; - virtual void DrawTextureTransparentColorKey(signed int x, signed int y, struct Texture *tex) = 0; + virtual void DrawTextureCustomHeight(float u, float v, class Image *img, int height) = 0; + //virtual void DrawTextureNew(float u, float v, struct Texture_MM7 *) = 0; + //virtual void DrawTextureTransparentColorKey(signed int x, signed int y, struct Texture_MM7 *tex) = 0; + //virtual void DrawTextureIndexedAlpha(unsigned int uX, unsigned int uY, struct Texture_MM7 *pTexture) = 0; - virtual void ZBuffer_Fill_2(signed int a2, signed int a3, struct Texture *pTexture, int a5) = 0; - virtual void DrawMaskToZBuffer(signed int uOutX, unsigned int uOutY, struct Texture *pTexture, int zVal) = 0; - virtual void DrawTextureIndexedAlpha(unsigned int uX, unsigned int uY, struct Texture *pTexture) = 0; - virtual void DrawAura(unsigned int a2, unsigned int a3, struct Texture *a4, struct Texture *a5, int a6, int a7, int a8) = 0; - virtual void _4A65CC(unsigned int x, unsigned int y, struct Texture *a4, struct Texture *a5, int a6, int a7, int a8) = 0; + virtual void ZBuffer_Fill_2(signed int a2, signed int a3, struct Image *pTexture, int a5) = 0; + virtual void ZDrawTextureAlpha(float u, float v, struct Image *pTexture, int zVal) = 0; + virtual void BlendTextures(unsigned int a2, unsigned int a3, struct Image *a4, struct Texture_MM7 *a5, int t, int start_opacity, int end_opacity) = 0; + virtual void _4A65CC(unsigned int x, unsigned int y, struct Texture_MM7 *a4, struct Texture_MM7 *a5, int a6, int a7, int a8) = 0; - virtual void DrawTransparentRedShade(unsigned int a2, unsigned int a3, struct Texture *a4) = 0; - virtual void DrawTransparentGreenShade(signed int a2, signed int a3, struct Texture *pTexture) = 0; + virtual void DrawTransparentRedShade(float u, float v, struct Image *a4) = 0; + virtual void DrawTransparentGreenShade(float u, float v, struct Image *pTexture) = 0; virtual void DrawFansTransparent(const RenderVertexD3D3 *vertices, unsigned int num_vertices) = 0; - virtual void DrawMasked(signed int a2, signed int a3, struct Texture *pTexture, unsigned __int16 mask) = 0; - virtual void GetLeather(unsigned int a2, unsigned int a3, struct Texture *a4, __int16 height) = 0; + virtual void DrawMasked(float u, float v, struct Image *pTexture, unsigned __int16 mask) = 0; virtual void DrawTextAlpha(int x, int y, unsigned char* font_pixels, int a5, unsigned int uFontHeight, unsigned __int16 *pPalette, bool present_time_transparency) = 0; virtual void DrawText(signed int uOutX, signed int uOutY, unsigned __int8 *pFontPixels, unsigned int uCharWidth, unsigned int uCharHeight, unsigned __int16 *pFontPalette, unsigned __int16 uFaceColor, unsigned __int16 uShadowColor) = 0; virtual void FillRectFast(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, unsigned int uColor16) = 0; virtual void _4A6DF5(unsigned __int16 *pBitmap, unsigned int uBitmapPitch, struct Vec2_int_ *pBitmapXY, void *pTarget, unsigned int uTargetPitch, Vec4_int_ *a7) = 0; - virtual void DrawTranslucent(unsigned int a2, unsigned int a3, struct Texture *a4) = 0; + virtual void DrawTranslucent(unsigned int a2, unsigned int a3, struct Texture_MM7 *a4) = 0; virtual void DrawBuildingsD3D() = 0;
--- a/Engine/Graphics/Indoor.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Graphics/Indoor.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -666,7 +666,7 @@ } //----- (004AE5BA) -------------------------------------------------------- -Texture *BLVFace::GetTexture() +Texture_MM7 *BLVFace::GetTexture() { unsigned int v1; // ecx@2
--- a/Engine/Graphics/Indoor.h Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Graphics/Indoor.h Mon Mar 07 03:48:40 2016 +0200 @@ -480,7 +480,7 @@ #define FACE_FLOW_HORIZONTAL 0x00000800 // Horizontal flow of the lava or water #define FACE_HAS_EVENT_HINT 0x00001000 #define FACE_INVISIBLE 0x00002000 -#define FACE_TEXTURE_FRAME 0x00004000 // Texture ID is a frameset from TextureFrameTable, otherwise BitmapID +#define FACE_TEXTURE_FRAME 0x00004000 // Texture_MM7 ID is a frameset from TextureFrameTable, otherwise BitmapID #define FACE_OUTLINED 0x00010000 // outline face edges #define FACE_INDOOR_DOOR 0x00020000 #define FACE_TEXTURE_FLOW 0x00040000 // The texture moves slowly. For horizontal facets only. @@ -515,7 +515,7 @@ } void _get_normals(Vec3_int_ *a2, Vec3_int_ *a3); - struct Texture *GetTexture(); + struct Texture_MM7 *GetTexture(); void FromODM(struct ODMFace *face); inline bool Invisible() const {return (uAttributes & FACE_INVISIBLE) != 0;}
--- a/Engine/Graphics/Outdoor.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Graphics/Outdoor.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -33,6 +33,7 @@ #include "GUI/GUIWindow.h" #include "GUI/GUIProgressBar.h" #include "GUI/UI/UITransition.h" +#include "GUI/UI/UIRest.h" #include "Media/Audio/AudioPlayer.h" @@ -1224,7 +1225,7 @@ LABEL_19: *(short *)(v21 + 272) = v20; v149 = (void *)(v20 != -1 ? &pBitmaps_LOD->pTextures[v20] : 0); - auto pTex = (Texture *)v149; + auto pTex = (Texture_MM7 *)v149; if (pTex) pTex->palette_id2 = pPaletteManager->LoadPalette(pTex->palette_id1); goto LABEL_20; @@ -2887,13 +2888,22 @@ //----- (0041F54A) -------------------------------------------------------- void OutdoorLocation::LoadActualSkyFrame() { - if ( pTexture_RestUI_CurrentSkyFrame ) - pTexture_RestUI_CurrentSkyFrame->Release(); - if ( pTexture_RestUI_CurrentHourglassFrame ) - pTexture_RestUI_CurrentHourglassFrame->Release(); - pIcons_LOD->SyncLoadedFilesCount(); + if (rest_ui_sky_frame_current) + { + rest_ui_sky_frame_current->Release(); + rest_ui_sky_frame_current = nullptr; + } + if (rest_ui_hourglass_frame_current) + { + rest_ui_hourglass_frame_current->Release(); + rest_ui_hourglass_frame_current = nullptr; + } + + wchar_t name[1024]; + swprintf(name, L"TERRA%03d", pParty->uCurrentMinute / 6 + 10 * pParty->uCurrentHour); + sprintf(pTmpBuf.data(), "TERRA%03d", pParty->uCurrentMinute / 6 + 10 * pParty->uCurrentHour); - pTexture_RestUI_CurrentSkyFrame = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE); + rest_ui_sky_frame_current = assets->GetImage_16BitColorKey(name, 0x7FF); }
--- a/Engine/Graphics/PaletteManager.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Graphics/PaletteManager.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -773,8 +773,8 @@ { sprintf(Source, "pal%03i", uPaletteID); - Texture tex; // [sp+318h] [bp-88h]@4 - //Texture::Texture(&tex); + Texture_MM7 tex; // [sp+318h] [bp-88h]@4 + //Texture_MM7::Texture_MM7(&tex); if ( pBitmaps_LOD->LoadTextureFromLOD(&tex, Source, TEXTURE_24BIT_PALETTE) == 1 ) {
--- a/Engine/Graphics/Render.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Graphics/Render.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -306,7 +306,7 @@ pTilePolygon->flags = 0; pTilePolygon->field_32 = 0; pTilePolygon->uTileBitmapID = pOutdoor->DoGetTileTexture(x, z); - pTilePolygon->pTexture = (Texture *)&pBitmaps_LOD->pHardwareTextures[pTilePolygon->uTileBitmapID]; + pTilePolygon->pTexture = (Texture_MM7 *)&pBitmaps_LOD->pHardwareTextures[pTilePolygon->uTileBitmapID]; if (pTilePolygon->uTileBitmapID == 0xFFFF) continue; @@ -5146,7 +5146,7 @@ } //----- (004A2FC0) -------------------------------------------------------- -void Render::DrawIndoorPolygon(unsigned int uNumVertices, BLVFace *pFace, IDirect3DTexture2 *pHwTex, Texture *pTex, int uPackedID, unsigned int uColor, int a8) +void Render::DrawIndoorPolygon(unsigned int uNumVertices, BLVFace *pFace, IDirect3DTexture2 *pHwTex, Texture_MM7 *pTex, int uPackedID, unsigned int uColor, int a8) { if (!uNumD3DSceneBegins || uNumVertices < 3) return; @@ -6370,13 +6370,15 @@ 0xF800 & (r << (6 + 5 + 5 - 8)); } -void Render::DrawTextureNew(float u, float v, Texture *a4) +void Render::DrawTextureNew(float u, float v, Texture_MM7 *a4) { __debugbreak(); } -void Render::DrawTextureNew(float u, float v, Image *bmp) + + +void Render::DrawTextureCustomHeight(float u, float v, class Image *img, int custom_height) { unsigned __int16 *v6; // esi@3 unsigned int v8; // eax@5 @@ -6385,60 +6387,65 @@ unsigned int v15; // eax@14 int v19; // [sp+10h] [bp-8h]@3 - if (!bmp) + if (!img) return; unsigned int uOutX = 640 * u; unsigned int uOutY = 480 * v; - int width = bmp->GetWidth(); - int height = bmp->GetHeight(); - v6 = (unsigned __int16 *)bmp->GetPixels(IMAGE_FORMAT_R5G6B5); - - //v5 = &this->pTargetSurface[uOutX + uOutY * this->uTargetSurfacePitch]; - v19 = width; - if (this->bClip) - { - if ((signed int)uOutX < (signed int)this->uClipX) - { - v8 = this->uClipX - uOutX; - unsigned int v9 = uOutX - this->uClipX; - v8 *= 2; - width += v9; - v6 = (unsigned __int16 *)((char *)v6 + v8); - //v5 = (unsigned __int16 *)((char *)v5 + v8); - } - if ((signed int)uOutY < (signed int)this->uClipY) - { - v11 = this->uClipY - uOutY; - v6 += v19 * v11; - height += uOutY - this->uClipY; - //v5 += this->uTargetSurfacePitch * v11; - } - v12 = max(this->uClipX, uOutX); - if ((signed int)(width + v12) >(signed int)this->uClipZ) - { - width = this->uClipZ - max(this->uClipX, uOutX); - } - v15 = max(this->uClipY, uOutY); - if ((signed int)(v15 + height) > (signed int)this->uClipW) - { - height = this->uClipW - max(this->uClipY, uOutY); - } + int width = img->GetWidth(); + int height = min(img->GetHeight(), custom_height); + v6 = (unsigned __int16 *)img->GetPixels(IMAGE_FORMAT_R5G6B5); + + //v5 = &this->pTargetSurface[uOutX + uOutY * this->uTargetSurfacePitch]; + v19 = width; + if (this->bClip) + { + if ((signed int)uOutX < (signed int)this->uClipX) + { + v8 = this->uClipX - uOutX; + unsigned int v9 = uOutX - this->uClipX; + v8 *= 2; + width += v9; + v6 = (unsigned __int16 *)((char *)v6 + v8); + //v5 = (unsigned __int16 *)((char *)v5 + v8); + } + if ((signed int)uOutY < (signed int)this->uClipY) + { + v11 = this->uClipY - uOutY; + v6 += v19 * v11; + height += uOutY - this->uClipY; + //v5 += this->uTargetSurfacePitch * v11; } - - for (int y = 0; y < height; y++) - { - for (int x = 0; x < width; x++) - { - WritePixel16(uOutX + x, uOutY + y, *v6); - //*v5 = *v6; - //++v5; - ++v6; - } - v6 += v19 - width; - //v5 += this->uTargetSurfacePitch - v4; + v12 = max(this->uClipX, uOutX); + if ((signed int)(width + v12) >(signed int)this->uClipZ) + { + width = this->uClipZ - max(this->uClipX, uOutX); + } + v15 = max(this->uClipY, uOutY); + if ((signed int)(v15 + height) > (signed int)this->uClipW) + { + height = this->uClipW - max(this->uClipY, uOutY); } + } + + for (int y = 0; y < height; y++) + { + for (int x = 0; x < width; x++) + { + WritePixel16(uOutX + x, uOutY + y, *v6); + //*v5 = *v6; + //++v5; + ++v6; + } + v6 += v19 - width; + //v5 += this->uTargetSurfacePitch - v4; + } +} + +void Render::DrawTextureNew(float u, float v, Image *bmp) +{ + DrawTextureCustomHeight(u, v, bmp, bmp->GetHeight()); } @@ -6515,7 +6522,7 @@ } //----- (004A6E7E) -------------------------------------------------------- -void Render::DrawTranslucent(unsigned int a2, unsigned int a3, Texture *a4) +void Render::DrawTranslucent(unsigned int a2, unsigned int a3, Texture_MM7 *a4) { int v5; // edx@4 unsigned int v6; // edi@4 @@ -6790,16 +6797,17 @@ } } +/* //----- (004A6A68) -------------------------------------------------------- -void Render::GetLeather(unsigned int a2, unsigned int a3, Texture *a4, __int16 height) -{ - Texture tex; // [sp+Ch] [bp-48h]@1 - - memcpy(&tex, a4, sizeof(tex)); - tex.uTextureHeight = a4->uTextureHeight - height; +void Render::DrawTextureCustomHeight(unsigned int x, unsigned int y, Texture_MM7 *texture, __int16 height) +{ + Texture_MM7 tex; // [sp+Ch] [bp-48h]@1 + + memcpy(&tex, texture, sizeof(tex)); + tex.uTextureHeight = texture->uTextureHeight - height; if ( (signed __int16)tex.uTextureHeight > 0 ) - DrawTextureTransparentColorKey(a2, a3, &tex); -} + DrawTextureTransparentColorKey(x, y, &tex); +}*/ //----- (004A6AB1) -------------------------------------------------------- void Render::DrawTextAlpha( int x, int y, unsigned char* font_pixels, int a5, unsigned int uFontHeight, unsigned __int16 *pPalette, bool present_time_transparency ) @@ -6963,124 +6971,20 @@ } //----- (004A68EF) -------------------------------------------------------- -void Render::DrawTransparentGreenShade(signed int a2, signed int a3, Texture *pTexture) -{ - DrawMasked(a2, a3, pTexture, 0x07E0); +void Render::DrawTransparentGreenShade(float u, float v, Image *pTexture) +{ + DrawMasked(u, v, pTexture, 0x07E0); } //----- (004A6776) -------------------------------------------------------- -void Render::DrawTransparentRedShade(unsigned int a2, unsigned int a3, Texture *a4) -{ - DrawMasked(a2, a3, a4, 0xF800); - /*Texture *v4; // edi@2 - unsigned int v5; // ebx@4 - unsigned __int16 *v6; // eax@4 - unsigned int v7; // edx@5 - unsigned int v8; // edx@6 - unsigned int v9; // edx@7 - unsigned int v10; // edx@8 - unsigned int v11; // edx@9 - unsigned int v12; // esi@12 - unsigned int v13; // esi@15 - unsigned int v14; // edx@17 - unsigned int v15; // esi@18 - unsigned __int8 *v16; // ebx@22 - char v17; // zf@28 - int v18; // [sp+10h] [bp-10h]@4 - unsigned __int8 *v19; // [sp+18h] [bp-8h]@4 - int v20; // [sp+1Ch] [bp-4h]@4 - int a2a; // [sp+28h] [bp+8h]@24 - unsigned int a3a; // [sp+2Ch] [bp+Ch]@22 - unsigned int a4a; // [sp+30h] [bp+10h]@11 - - if ( this->uNumSceneBegins ) - { - v4 = a4; - if ( a4 ) - { - if ( a4->pPalette16 ) - { - v5 = a4->uTextureHeight; - v6 = &this->pTargetSurface[a2 + a3 * this->uTargetSurfacePitch]; - v19 = a4->pLevelOfDetail0_prolly_alpha_mask; - v20 = a4->uTextureWidth; - v18 = a4->uTextureWidth; - if ( this->bClip ) - { - v7 = this->uClipX; - if ( (signed int)a2 < (signed int)v7 ) - { - v8 = v7 - a2; - v19 += v8; - v20 += a2 - this->uClipX; - v6 += v8; - } - v9 = this->uClipY; - v5 = a4->uTextureHeight; - if ( (signed int)a3 < (signed int)v9 ) - { - v10 = v9 - a3; - v19 += v18 * v10; - v5 = a3 - this->uClipY + a4->uTextureHeight; - v4 = a4; - v6 += this->uTargetSurfacePitch * v10; - } - v11 = this->uClipX; - if ( (signed int)v11 < (signed int)a2 ) - v11 = a2; - a4a = this->uClipZ; - if ( (signed int)(v11 + v20) > (signed int)a4a ) - { - v12 = this->uClipX; - if ( (signed int)v12 < (signed int)a2 ) - v12 = a2; - v20 = a4a - v12; - } - v13 = this->uClipY; - if ( (signed int)v13 < (signed int)a3 ) - v13 = a3; - v14 = this->uClipW; - if ( (signed int)(v5 + v13) > (signed int)v14 ) - { - v15 = this->uClipY; - if ( (signed int)v15 < (signed int)a3 ) - v15 = a3; - v5 = v14 - v15; - } - } - if ( (signed int)v5 > 0 ) - { - a3a = v5; - v16 = v19; - do - { - if ( v20 > 0 ) - { - a2a = v20; - do - { - if ( *v16 ) - *v6 = this->uTargetRMask & v4->pPalette16[*v16]; - ++v6; - ++v16; - --a2a; - } - while ( a2a ); - } - v16 += v18 - v20; - v17 = a3a-- == 1; - v6 += this->uTargetSurfacePitch - v20; - } - while ( !v17 ); - } - } - } - }*/ +void Render::DrawTransparentRedShade(float u, float v, Image *a4) +{ + DrawMasked(u, v, a4, 0xF800); } //----- (004A68EF) -------------------------------------------------------- -void Render::DrawMasked(signed int a2, signed int a3, Texture *pTexture, unsigned __int16 mask) +void Render::DrawMasked(float u, float v, Image *pTexture, unsigned __int16 mask) { unsigned int v5; // ebx@4 int v10; // edx@8 @@ -7088,37 +6992,42 @@ signed int v12; // esi@12 signed int v13; // esi@15 signed int v15; // esi@18 - unsigned __int8 *v16; // ebx@22 + //unsigned __int8 *v16; // ebx@22 int v18; // [sp+10h] [bp-10h]@4 - unsigned __int8 *v19; // [sp+18h] [bp-8h]@4 + //unsigned __int8 *v19; // [sp+18h] [bp-8h]@4 int v20; // [sp+1Ch] [bp-4h]@4 if (!uNumSceneBegins || !pTexture) return; - if ( pTexture->pPalette16 ) - { - v5 = pTexture->uTextureHeight; + //if ( pTexture->pPalette16 ) + { + v5 = pTexture->GetHeight(); //v6 = &this->pTargetSurface[a2 + a3 * this->uTargetSurfacePitch]; - v19 = pTexture->paletted_pixels; - v20 = pTexture->uTextureWidth; - v18 = pTexture->uTextureWidth; + //v19 = pTexture->paletted_pixels; + auto pixels = (unsigned __int32 *)pTexture->GetPixels(IMAGE_FORMAT_A8R8G8B8); + + v18 = v20 = pTexture->GetWidth(); + + int a2 = u * window->GetWidth(); + int a3 = v * window->GetHeight(); + int clipped_out_x = a2; int clipped_out_y = a3; if ( this->bClip ) { if ( a2 < this->uClipX ) { - v19 += this->uClipX - a2; + pixels += this->uClipX - a2; v20 += a2 - this->uClipX; clipped_out_x = uClipX; } - v5 = pTexture->uTextureHeight; + v5 = pTexture->GetHeight(); if ( a3 < this->uClipY ) { v10 = this->uClipY - a3; - v19 += v18 * v10; - v5 = a3 - this->uClipY + pTexture->uTextureHeight; + pixels += v18 * v10; + v5 = a3 - this->uClipY + pTexture->GetHeight(); clipped_out_y = uClipY; } v11 = this->uClipX; @@ -7143,7 +7052,7 @@ } } - v16 = v19; + /*v16 = v19; for (uint y = 0; y < v5; ++y) { for (int x = 0; x < v20; ++x) @@ -7153,39 +7062,28 @@ ++v16; } v16 += v18 - v20; - } - - /*if ( (signed int)v5 > 0 ) - { - v22 = v5; - v16 = v19; - do - { - if ( v20 > 0 ) - { - v21 = v20; - do - { - if ( *v16 ) - *v6 = this->uTargetGMask & v4->pPalette16[*v16]; - ++v6; - ++v16; - --v21; - } - while ( v21 ); - } - v16 += v18 - v20; - v17 = v22-- == 1; - v6 += this->uTargetSurfacePitch - v20; - } - while ( !v17 ); - }*/ + }*/ + + for (uint y = 0; y < v5; ++y) + { + for (int x = 0; x < v20; ++x) + { + if (*pixels & 0xFF000000) + WritePixel16( + clipped_out_x + x, + clipped_out_y + y, + Color16((*pixels >> 16) & 0xFF, (*pixels >> 8) & 0xFF, *pixels & 0xFF) & mask + ); + ++pixels; + } + pixels += v18 - v20; + } } } //----- (004A65CC) -------------------------------------------------------- -void Render::_4A65CC(unsigned int x, unsigned int y, Texture *a4, Texture *a5, int a6, int a7, int a8) +void Render::_4A65CC(unsigned int x, unsigned int y, Texture_MM7 *a4, Texture_MM7 *a5, int a6, int a7, int a8) { unsigned int uHeight; // edi@6 unsigned int v14; // edx@11 @@ -7291,7 +7189,8 @@ } //----- (004A63E6) -------------------------------------------------------- -void Render::DrawAura(unsigned int a2, unsigned int a3, Texture *a4, Texture *a5, int a6, int a7, int a8) +void Render::BlendTextures(unsigned int a2, unsigned int a3, Image *a4, Texture_MM7 *a5, int t, int start_opacity, int end_opacity) + //unsigned int a2, unsigned int a3, Image *a4, Texture_MM7 *a5, int a6, int a7, int a8) { unsigned int v14; // edx@11 unsigned int v16; // edx@14 @@ -7304,7 +7203,7 @@ int v27; // [sp+24h] [bp+Ch]@23 unsigned __int8 *v28; // [sp+28h] [bp+10h]@6 - if ( this->uNumSceneBegins ) + /*if ( this->uNumSceneBegins ) { if ( a4 ) { @@ -7387,7 +7286,7 @@ } } } - } + }*/ } @@ -7460,10 +7359,16 @@ { for (int x = 0; x < uWidth; ++x) { - //if (*v19) if (*pixels & 0xFF000000) - //WritePixel16(clipped_out_x + x, clipped_out_y + y, pTexture->pPalette16[*v19]); - WritePixel16(clipped_out_x + x, clipped_out_y + y, Color16((*pixels >> 16) & 0xFF, (*pixels >> 8) & 0xFF, *pixels & 0xFF)); + WritePixel16( + clipped_out_x + x, + clipped_out_y + y, + Color16( + (*pixels >> 16) & 0xFF, + (*pixels >> 8) & 0xFF, + *pixels & 0xFF + ) + ); ++pixels; } pixels += img->GetWidth() - uWidth; @@ -7473,7 +7378,7 @@ //----- (004A6274) -------------------------------------------------------- -void Render::DrawTextureIndexedAlpha(unsigned int uX, unsigned int uY, Texture *pTexture) +void Render::DrawTextureIndexedAlpha(unsigned int uX, unsigned int uY, Texture_MM7 *pTexture) { int uHeight; // ebx@4 unsigned int v11; // edx@9 @@ -7545,37 +7450,13 @@ } v19 += pTexture->uTextureWidth - uWidth; } - /*if ( (signed int)uHeight > 0 ) - { - uYa = uHeight; - v16 = v19; - do - { - if ( uWidth > 0 ) - { - uXa = uWidth; - do - { - if ( *v16 ) - *v6 = pCurrentTexture->pPalette16[*v16]; - ++v6; - ++v16; - } - while ( uXa-- !=1 ); - } - v16 += v18 - uWidth; - uFlag = uYa-- == 1; - v6 += this->uTargetSurfacePitch - uWidth; - } - while ( !uFlag ); - }*/ } } } } //----- (004A612A) -------------------------------------------------------- -void Render::DrawMaskToZBuffer(signed int uOutX, unsigned int uOutY, Texture *pTexture, int zVal) +void Render::ZDrawTextureAlpha(float u, float v, Image *img, int zVal) { unsigned int v6; // edx@3 int v7; // ebx@3 @@ -7589,33 +7470,34 @@ int v19; // [sp+Ch] [bp-Ch]@3 int v20; // [sp+10h] [bp-8h]@3 int uOutXa; // [sp+20h] [bp+8h]@21 - unsigned __int8 *uOutYa; // [sp+24h] [bp+Ch]@3 + //unsigned __int8 *uOutYa; // [sp+24h] [bp+Ch]@3 int *pZBuffer; // [sp+28h] [bp+10h]@3 - if ( this->uNumSceneBegins ) - { - if ( pTexture ) - { + if (!this->uNumSceneBegins || !img) + return; + + int uOutX = u * this->window->GetWidth(); + int uOutY = v * this->window->GetHeight(); + v6 = uOutY; - v7 = pTexture->uTextureHeight; + v7 = img->GetHeight(); pZBuffer = &this->pActiveZBuffer[uOutX + window->GetWidth() * uOutY]; - uOutYa = pTexture->paletted_pixels; - v8 = pTexture->uTextureWidth; - v20 = pTexture->uTextureWidth; - v19 = pTexture->uTextureWidth; + //uOutYa = pTexture->paletted_pixels; + v8 = v20 = v19 = img->GetWidth(); + auto pixels = (unsigned __int32 *)img->GetPixels(IMAGE_FORMAT_A8R8G8B8); if ( this->bClip ) { if ( uOutX < this->uClipX ) { v10 = this->uClipX - uOutX; - uOutYa += v10; + pixels += v10; v8 += uOutX - this->uClipX; v20 = v8; pZBuffer += v10; } if ( (signed int)v6 < (signed int)this->uClipY ) { - uOutYa += v19 * (this->uClipY - v6); + pixels += v19 * (this->uClipY - v6); v7 += v6 - this->uClipY; pZBuffer += window->GetWidth() * (this->uClipY - v6); v8 = v20; @@ -7641,6 +7523,9 @@ v7 = this->uClipW - v6; } } + + + if ( v7 > 0 ) { uOutXa = v7; @@ -7651,28 +7536,27 @@ v18 = v8; do { - if ( *uOutYa ) + if ( *pixels & 0xFF000000) *pZBuffer = zVal; ++pZBuffer; - ++uOutYa; + ++pixels; --v18; } while ( v18 ); } pZBuffer += window->GetWidth() - v8; - uOutYa += v19 - v8; + pixels += v19 - v8; --uOutXa; } while ( uOutXa ); } - } - } + } //----- (004A601E) -------------------------------------------------------- -void Render::ZBuffer_Fill_2(signed int a2, signed int a3, Texture *pTexture, int a5) -{ - signed int v5; // edx@3 +void Render::ZBuffer_Fill_2(signed int a2, signed int a3, Image *pTexture, int a5) +{ +/* signed int v5; // edx@3 int v6; // ebx@3 int v7; // esi@3 void *v8; // esi@3 @@ -7739,13 +7623,13 @@ } while ( v6 ); } - } + }*/ } //----- (004A5EB2) -------------------------------------------------------- -void Render::DrawTextureTransparentColorKey(signed int x, signed int y, Texture *tex) +void Render::DrawTextureTransparentColorKey(signed int x, signed int y, Texture_MM7 *tex) { int v5; // ebx@4 unsigned int v8; // edx@6 @@ -8306,7 +8190,7 @@ void Render::DrawBuildingsD3D() { int v9; // ecx@8 - Texture *pFaceTexture; // eax@10 + Texture_MM7 *pFaceTexture; // eax@10 unsigned int v16; // edi@22 int v27; // eax@57 // int vertex_id; // eax@58 @@ -8548,7 +8432,7 @@ //pSkyPolygon.uTileBitmapID = pOutdoor->New_SKY_NIGHT_ID; //else pSkyPolygon.uTileBitmapID = pOutdoor->sSky_TextureID;//179(original 166) - pSkyPolygon.pTexture = (Texture *)(pSkyPolygon.uTileBitmapID != -1 ? (int)&pBitmaps_LOD->pTextures[pSkyPolygon.uTileBitmapID] : 0); + pSkyPolygon.pTexture = (Texture_MM7 *)(pSkyPolygon.uTileBitmapID != -1 ? (int)&pBitmaps_LOD->pTextures[pSkyPolygon.uTileBitmapID] : 0); if ( pSkyPolygon.pTexture ) { pSkyPolygon.dimming_level = 0;
--- a/Engine/Graphics/Render.h Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Graphics/Render.h Mon Mar 07 03:48:40 2016 +0200 @@ -74,7 +74,7 @@ __int16 field_32; int field_34; struct stru149 *ptr_38; - struct Texture *pTexture; + struct Texture_MM7 *pTexture; struct Span *_unused_prolly_head; struct Span *_unused_prolly_tail; int **ptr_48; @@ -228,7 +228,7 @@ virtual void DrawPolygon(unsigned int uNumVertices, struct Polygon *a3, ODMFace *a4, IDirect3DTexture2 *pTexture); virtual void DrawTerrainPolygon(unsigned int uNumVertices, struct Polygon *a4, IDirect3DTexture2 *a5, bool transparent, bool clampAtTextureBorders); - virtual void DrawIndoorPolygon(unsigned int uNumVertices, struct BLVFace *a3, IDirect3DTexture2 *pHwTex, struct Texture *pTex, int uPackedID, unsigned int uColor, int a8); + virtual void DrawIndoorPolygon(unsigned int uNumVertices, struct BLVFace *a3, IDirect3DTexture2 *pHwTex, struct Texture_MM7 *pTex, int uPackedID, unsigned int uColor, int a8); virtual void MakeParticleBillboardAndPush_BLV(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle); virtual void MakeParticleBillboardAndPush_ODM(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle); @@ -251,30 +251,30 @@ virtual void ResetUIClipRect(); virtual void CreditsTextureScroll(unsigned int pX, unsigned int pY, int move_X, int move_Y, struct RGBTexture *pTexture); - virtual void DrawTextureNew(float u, float v, struct Texture *); virtual void DrawTextureNew(float u, float v, struct Image *); virtual void DrawTextureAlphaNew(float u, float v, struct Image *); - virtual void DrawTextureTransparentColorKey(signed int x, signed int y, struct Texture *tex); + virtual void DrawTextureCustomHeight(float u, float v, class Image *img, int height); + //virtual void DrawTextureNew(float u, float v, struct Texture_MM7 *); + //virtual void DrawTextureTransparentColorKey(signed int x, signed int y, struct Texture_MM7 *tex); + //virtual void DrawTextureIndexedAlpha(unsigned int uX, unsigned int uY, struct Texture_MM7 *pTexture); - virtual void ZBuffer_Fill_2(signed int a2, signed int a3, struct Texture *pTexture, int a5); - virtual void DrawMaskToZBuffer(signed int uOutX, unsigned int uOutY, struct Texture *pTexture, int zVal); - virtual void DrawTextureIndexedAlpha(unsigned int uX, unsigned int uY, struct Texture *pTexture); - virtual void DrawAura(unsigned int a2, unsigned int a3, struct Texture *a4, struct Texture *a5, int a6, int a7, int a8); - virtual void _4A65CC(unsigned int x, unsigned int y, struct Texture *a4, struct Texture *a5, int a6, int a7, int a8); + virtual void ZBuffer_Fill_2(signed int a2, signed int a3, struct Image *pTexture, int a5); + virtual void ZDrawTextureAlpha(float u, float v, struct Image *pTexture, int zVal); + virtual void BlendTextures(unsigned int a2, unsigned int a3, struct Image *a4, struct Texture_MM7 *a5, int t, int start_opacity, int end_opacity); + virtual void _4A65CC(unsigned int x, unsigned int y, struct Texture_MM7 *a4, struct Texture_MM7 *a5, int a6, int a7, int a8); - virtual void DrawTransparentRedShade(unsigned int a2, unsigned int a3, struct Texture *a4); - virtual void DrawTransparentGreenShade(signed int a2, signed int a3, struct Texture *pTexture); + virtual void DrawTransparentRedShade(float u, float v, struct Image *a4); + virtual void DrawTransparentGreenShade(float u, float v, struct Image *pTexture); virtual void DrawFansTransparent(const RenderVertexD3D3 *vertices, unsigned int num_vertices); - virtual void DrawMasked(signed int a2, signed int a3, struct Texture *pTexture, unsigned __int16 mask); - virtual void GetLeather(unsigned int a2, unsigned int a3, struct Texture *a4, __int16 height); + virtual void DrawMasked(float u, float v, struct Image *pTexture, unsigned __int16 mask); virtual void DrawTextAlpha(int x, int y, unsigned char* font_pixels, int a5, unsigned int uFontHeight, unsigned __int16 *pPalette, bool present_time_transparency); virtual void DrawText(signed int uOutX, signed int uOutY, unsigned __int8 *pFontPixels, unsigned int uCharWidth, unsigned int uCharHeight, unsigned __int16 *pFontPalette, unsigned __int16 uFaceColor, unsigned __int16 uShadowColor); virtual void FillRectFast(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, unsigned int uColor16); virtual void _4A6DF5(unsigned __int16 *pBitmap, unsigned int uBitmapPitch, struct Vec2_int_ *pBitmapXY, void *pTarget, unsigned int uTargetPitch, Vec4_int_ *a7); - virtual void DrawTranslucent(unsigned int a2, unsigned int a3, struct Texture *a4); + virtual void DrawTranslucent(unsigned int a2, unsigned int a3, struct Texture_MM7 *a4); virtual void DrawBuildingsD3D(); //struct BSPModel *DrawBuildingsSW();
--- a/Engine/Graphics/RenderD3D11.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Graphics/RenderD3D11.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -47,7 +47,7 @@ unsigned int RenderD3D11::GetActorTintColor(float a2, int tint, int a4, int a5, RenderBillboard *a6) {__debugbreak(); return 0;} void RenderD3D11::DrawPolygon(unsigned int uNumVertices, struct Polygon *a3, ODMFace *a4, IDirect3DTexture2 *pTexture) {__debugbreak();} void RenderD3D11::DrawTerrainPolygon(unsigned int uNumVertices, struct Polygon *a4, IDirect3DTexture2 *a5, bool transparent, bool clampAtTextureBorders) {__debugbreak();} -void RenderD3D11::DrawIndoorPolygon(unsigned int uNumVertices, struct BLVFace *a3, IDirect3DTexture2 *pHwTex, struct Texture *pTex, int uPackedID, unsigned int uColor, int a8) {__debugbreak();} +void RenderD3D11::DrawIndoorPolygon(unsigned int uNumVertices, struct BLVFace *a3, IDirect3DTexture2 *pHwTex, struct Texture_MM7 *pTex, int uPackedID, unsigned int uColor, int a8) {__debugbreak();} void RenderD3D11::MakeParticleBillboardAndPush_BLV(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle) {__debugbreak();} void RenderD3D11::MakeParticleBillboardAndPush_ODM(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle) {__debugbreak();} void RenderD3D11::DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene() {__debugbreak();} @@ -58,18 +58,18 @@ void RenderD3D11::DrawProjectile(float srcX, float srcY, float a3, float a4, float dstX, float dstY, float a7, float a8, IDirect3DTexture2 *a9) {__debugbreak();} void RenderD3D11::ScreenFade(unsigned int color, float t) {__debugbreak();} void RenderD3D11::CreditsTextureScroll(unsigned int pX, unsigned int pY, int move_X, int move_Y, RGBTexture *pTexture) {__debugbreak();} -void RenderD3D11::ZBuffer_Fill_2(signed int a2, signed int a3, struct Texture *pTexture, int a5) {__debugbreak();} -void RenderD3D11::DrawMaskToZBuffer(signed int uOutX, unsigned int uOutY, struct Texture *pTexture, int zVal) {__debugbreak();} -void RenderD3D11::DrawAura(unsigned int a2, unsigned int a3, struct Texture *a4, struct Texture *a5, int a6, int a7, int a8) {__debugbreak();} -void RenderD3D11::_4A65CC(unsigned int x, unsigned int y, struct Texture *a4, struct Texture *a5, int a6, int a7, int a8) {__debugbreak();} -void RenderD3D11::DrawTransparentRedShade(unsigned int a2, unsigned int a3, struct Texture *a4) {__debugbreak();} -void RenderD3D11::DrawTransparentGreenShade(signed int a2, signed int a3, struct Texture *pTexture) {__debugbreak();} +void RenderD3D11::ZBuffer_Fill_2(signed int a2, signed int a3, struct Image *pTexture, int a5) {__debugbreak();} +void RenderD3D11::ZDrawTextureAlpha(float u, float v, struct Image *pTexture, int zVal) {__debugbreak();} +void RenderD3D11::BlendTextures(unsigned int a2, unsigned int a3, struct Image *a4, struct Texture_MM7 *a5, int t, int start_opacity, int end_opacity) {__debugbreak();} +void RenderD3D11::_4A65CC(unsigned int x, unsigned int y, struct Texture_MM7 *a4, struct Texture_MM7 *a5, int a6, int a7, int a8) {__debugbreak();} +void RenderD3D11::DrawTransparentRedShade(float u, float v, struct Image *a4) {__debugbreak();} +void RenderD3D11::DrawTransparentGreenShade(float u, float v, struct Image *pTexture) {__debugbreak();} void RenderD3D11::DrawFansTransparent(const RenderVertexD3D3 *vertices, unsigned int num_vertices) {__debugbreak();} -void RenderD3D11::DrawMasked(signed int a2, signed int a3, struct Texture *pTexture, unsigned __int16 mask) {__debugbreak();} -void RenderD3D11::GetLeather(unsigned int a2, unsigned int a3, struct Texture *a4, __int16 height) {__debugbreak();} +void RenderD3D11::DrawMasked(float u, float v, struct Image *pTexture, unsigned __int16 mask) {__debugbreak();} +void RenderD3D11::DrawTextureCustomHeight(float u, float v, class Image *img, int height) {__debugbreak();} void RenderD3D11::FillRectFast(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, unsigned int uColor16) {__debugbreak();} void RenderD3D11::_4A6DF5(unsigned __int16 *pBitmap, unsigned int uBitmapPitch, struct Vec2_int_ *pBitmapXY, void *pTarget, unsigned int uTargetPitch, Vec4_int_ *a7) {__debugbreak();} -void RenderD3D11::DrawTranslucent(unsigned int a2, unsigned int a3, struct Texture *a4) {__debugbreak();} +void RenderD3D11::DrawTranslucent(unsigned int a2, unsigned int a3, struct Texture_MM7 *a4) {__debugbreak();} void RenderD3D11::DrawBuildingsD3D() {__debugbreak();} void RenderD3D11::DrawIndoorSky(unsigned int uNumVertices, unsigned int uFaceID) {__debugbreak();} void RenderD3D11::DrawOutdoorSkyD3D() {__debugbreak();} @@ -146,7 +146,7 @@ } -void RenderD3D11::DrawTextureTransparentColorKey(signed int x, signed int y, struct Texture *tex) +void RenderD3D11::DrawTextureTransparentColorKey(signed int x, signed int y, struct Texture_MM7 *tex) { PrepareTextureIndexed(tex); DrawTexture((float)x / window->GetWidth(), (float)y / window->GetHeight(), tex->uTextureWidth, tex->uTextureHeight, tex->d3d11_srv, ui_blend_solid); @@ -158,14 +158,14 @@ __debugbreak(); } -void RenderD3D11::DrawTextureIndexedAlpha(unsigned int uX, unsigned int uY, struct Texture *a4) +void RenderD3D11::DrawTextureIndexedAlpha(unsigned int uX, unsigned int uY, struct Texture_MM7 *a4) { PrepareTextureIndexed(a4); DrawTexture((float)uX / window->GetWidth(), (float)uY / window->GetHeight(), a4->uTextureWidth, a4->uTextureHeight, a4->d3d11_srv, ui_blend_alpha); } -void RenderD3D11::DrawTextureNew(float u, float v, Texture *tex) +void RenderD3D11::DrawTextureNew(float u, float v, Texture_MM7 *tex) { __debugbreak(); } @@ -871,7 +871,7 @@ -void RenderD3D11::PrepareTextureIndexed(Texture *p) +void RenderD3D11::PrepareTextureIndexed(Texture_MM7 *p) { if (!p->d3d11_srv) {
--- a/Engine/Graphics/RenderD3D11.h Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Graphics/RenderD3D11.h Mon Mar 07 03:48:40 2016 +0200 @@ -55,7 +55,7 @@ virtual void DrawPolygon(unsigned int uNumVertices, struct Polygon *a3, ODMFace *a4, IDirect3DTexture2 *pTexture); virtual void DrawTerrainPolygon(unsigned int uNumVertices, struct Polygon *a4, IDirect3DTexture2 *a5, bool transparent, bool clampAtTextureBorders); - virtual void DrawIndoorPolygon(unsigned int uNumVertices, struct BLVFace *a3, IDirect3DTexture2 *pHwTex, struct Texture *pTex, int uPackedID, unsigned int uColor, int a8); + virtual void DrawIndoorPolygon(unsigned int uNumVertices, struct BLVFace *a3, IDirect3DTexture2 *pHwTex, struct Texture_MM7 *pTex, int uPackedID, unsigned int uColor, int a8); virtual void MakeParticleBillboardAndPush_BLV(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle); virtual void MakeParticleBillboardAndPush_ODM(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle); @@ -78,30 +78,30 @@ virtual void ResetUIClipRect(); virtual void CreditsTextureScroll(unsigned int pX, unsigned int pY, int move_X, int move_Y, RGBTexture *pTexture); - virtual void DrawTextureNew(float u, float v, struct Texture *); virtual void DrawTextureNew(float u, float v, struct Image *); virtual void DrawTextureAlphaNew(float u, float v, struct Image *); - virtual void DrawTextureTransparentColorKey(signed int x, signed int y, struct Texture *tex); + virtual void DrawTextureCustomHeight(float u, float v, class Image *img, int height); + //virtual void DrawTextureNew(float u, float v, struct Texture_MM7 *); + //virtual void DrawTextureTransparentColorKey(signed int x, signed int y, struct Texture_MM7 *tex); + //virtual void DrawTextureIndexedAlpha(unsigned int uX, unsigned int uY, struct Texture_MM7 *pTexture); - virtual void ZBuffer_Fill_2(signed int a2, signed int a3, struct Texture *pTexture, int a5); - virtual void DrawMaskToZBuffer(signed int uOutX, unsigned int uOutY, struct Texture *pTexture, int zVal); - virtual void DrawTextureIndexedAlpha(unsigned int uX, unsigned int uY, struct Texture *pTexture); - virtual void DrawAura(unsigned int a2, unsigned int a3, struct Texture *a4, struct Texture *a5, int a6, int a7, int a8); - virtual void _4A65CC(unsigned int x, unsigned int y, struct Texture *a4, struct Texture *a5, int a6, int a7, int a8); + virtual void ZBuffer_Fill_2(signed int a2, signed int a3, struct Image *pTexture, int a5); + virtual void ZDrawTextureAlpha(float u, float v, struct Image *pTexture, int zVal); + virtual void BlendTextures(unsigned int a2, unsigned int a3, struct Image *a4, struct Texture_MM7 *a5, int t, int start_opacity, int end_opacity); + virtual void _4A65CC(unsigned int x, unsigned int y, struct Texture_MM7 *a4, struct Texture_MM7 *a5, int a6, int a7, int a8); - virtual void DrawTransparentRedShade(unsigned int a2, unsigned int a3, struct Texture *a4); - virtual void DrawTransparentGreenShade(signed int a2, signed int a3, struct Texture *pTexture); + virtual void DrawTransparentRedShade(float u, float v, struct Image *a4); + virtual void DrawTransparentGreenShade(float u, float v, struct Image *pTexture); virtual void DrawFansTransparent(const RenderVertexD3D3 *vertices, unsigned int num_vertices); - virtual void DrawMasked(signed int a2, signed int a3, struct Texture *pTexture, unsigned __int16 mask); - virtual void GetLeather(unsigned int a2, unsigned int a3, struct Texture *a4, __int16 height); + virtual void DrawMasked(float u, float v, struct Image *pTexture, unsigned __int16 mask); virtual void DrawTextAlpha(int x, int y, unsigned char* font_pixels, int a5, unsigned int uFontHeight, unsigned __int16 *pPalette, bool present_time_transparency); virtual void DrawText(signed int uOutX, signed int uOutY, unsigned __int8 *pFontPixels, unsigned int uCharWidth, unsigned int uCharHeight, unsigned __int16 *pFontPalette, unsigned __int16 uFaceColor, unsigned __int16 uShadowColor); virtual void FillRectFast(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, unsigned int uColor16); virtual void _4A6DF5(unsigned __int16 *pBitmap, unsigned int uBitmapPitch, struct Vec2_int_ *pBitmapXY, void *pTarget, unsigned int uTargetPitch, Vec4_int_ *a7); - virtual void DrawTranslucent(unsigned int a2, unsigned int a3, struct Texture *a4); + virtual void DrawTranslucent(unsigned int a2, unsigned int a3, struct Texture_MM7 *a4); virtual void DrawBuildingsD3D(); @@ -165,7 +165,7 @@ protected: void DrawTexture(float u, float v, int texture_width, int texture_height, ID3D11ShaderResourceView *srv, ID3D11BlendState *blend); - void PrepareTextureIndexed(struct Texture *p); + void PrepareTextureIndexed(struct Texture_MM7 *p); ID3D11ShaderResourceView *PrepareFontTexture(unsigned char *pFontPixels, unsigned int uCharWidth, unsigned int uCharHeight, unsigned short *pFontPalette, unsigned short uFaceColor, unsigned short uShadowColor); ID3D11ShaderResourceView *PrepareFontTexture(unsigned char *pFontPixels, unsigned int uCharWidth, unsigned int uCharHeight, unsigned short *pFontPalette);
--- a/Engine/Graphics/RenderStruct.h Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Graphics/RenderStruct.h Mon Mar 07 03:48:40 2016 +0200 @@ -17,7 +17,7 @@ } while(0) struct Polygon; -struct Texture; +struct Texture_MM7; struct RGBTexture; struct RenderBillboardTransform_local0; struct ODMFace;
--- a/Engine/Graphics/Texture.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Graphics/Texture.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -27,153 +27,10 @@ - - -std::array<Texture *, 2> pTexture_LloydBeacons; -Texture *pTexture_50635C; -Texture *pTex_book_button8_off; -Texture *pTex_book_button8_on; -Texture *pTex_book_button7_off; -Texture *pTex_book_button7_on; -Texture *pTex_book_button6_off; -Texture *pTex_book_button6_on; -Texture *pTex_book_button5_off; -Texture *pTex_book_button5_on; -Texture *pTex_book_button4_off; -Texture *pTex_book_button4_on; -Texture *pTex_book_button3_off; -Texture *pTex_book_button3_on; -Texture *pTex_book_button2_off; -Texture *pTex_book_button1_off; -Texture *pTex_book_button2_on; -Texture *pTex_book_button1_on; -std::array<Texture *, 6> pTexture_TownPortalIcons; // [0]Harmonale, [1]Pierpont, [2]Nighon, [3]Evenmorn Island, [4]Celestia, [5]The Pit -std::array<Texture *, 12> SBPageCSpellsTextureList; -std::array<Texture *, 12> SBPageSSpellsTextureList; -Texture *pSBQuickSpellBtnTextr; -Texture *pSpellBookClickCloseBtnTextr; -Texture *pSBClickQuickSpellBtnTextr; -Texture *pSpellBookCloseBtnTextr; -std::array<std::array<Texture *, 2>, 9> pTextures_tabs; -Texture *pTexture_mapbordr; // idb -Texture *pTexture_pagemask; // idb -std::array<Texture *, 9> pSpellBookPagesTextr; -Texture *pSpellBookPagesTextr_9; -Texture *pSpellBookPagesTextr_10; -Texture *pSpellBookPagesTextr_11; -Texture *pSpellBookPagesTextr_12; -Texture *pSpellBookPagesTextr_13; -Texture *pTexture_AutonotesBook; -Texture *pTexture_CurrentBook; -Texture *pTex_moon_new; -Texture *pTex_moon_4; -Texture *pTex_moon_2; -Texture *pTex_moon_2_2; -Texture *pTex_moon_ful; - -struct Texture *minimap_loop; // 5079D8 -struct Texture *_5079B4_compass; // 5079B4 -struct Texture *_5079C8_init_y; // 5079C8 -struct Texture *_5079CC_init_r; // 5079CC -struct Texture *_5079D0_init_g; // 5079D0 - - -int uTextureID_RestUI_restb4; // weak -int uTextureID_RestUI_restexit; // weak -int uTextureID_RestUI_restb3; // weak -int uTextureID_RestUI_restb1; // weak -int uTextureID_RestUI_restb2; // weak -int uTextureID_RestUI_restmain; // weak -unsigned int uTextureID_Leather; -int uTextureID_ar_dn_dn; // weak -int uTextureID_ar_dn_up; // weak -int uTextureID_ar_up_dn; // weak -int uTextureID_ar_up_up; // weak - - -unsigned int uTextureID_mhp_yel; -unsigned int uTextureID_mhp_red; -unsigned int uTextureID_mhp_grn; -unsigned int uTextureID_mhp_capr; -unsigned int uTextureID_mhp_capl; -unsigned int uTextureID_mhp_bd; -unsigned int uTextureID_BUTTDESC2; -unsigned int uTextureID_x_x_u; -unsigned int uTextureID_BUTTMAKE2; -unsigned int uTextureID_BUTTMAKE; -unsigned int uTextureID_BUTTYES2; -unsigned int uTextureID_x_ok_u; -std::array<Texture *, 22> pPlayerPortraits; -std::array<Texture *, 9> pTexture_IC_KNIGHT; -Texture *pTexture_MAKESKY; -Texture *pTexture_MAKETOP; -std::array<Texture *, 20> pTextures_arrowr; -std::array<Texture *, 20> pTextures_arrowl; -Texture *pTexture_presleft; -Texture *pTexture_pressrigh; -Texture *pTexture_buttminu; -Texture *pTexture_buttplus; -unsigned int uTextureID_Quit1; // weak -unsigned int uTextureID_Resume1; // weak -unsigned int uTextureID_Controls1; // weak -unsigned int uTextureID_Save1; // weak -unsigned int uTextureID_Load1; // weak -unsigned int uTextureID_New1; // weak -unsigned int uTextureID_Options; // weak - - -unsigned int uTextureID_ib_td5_A; -unsigned int uTextureID_ib_td4_A; -unsigned int uTextureID_ib_td3_A; -unsigned int uTextureID_ib_td2_A; -unsigned int uTextureID_ib_td1_A; -int uTextureID_50795C; // weak - - -unsigned int uTextureID_Btn_GameSettings; - - -unsigned int uTextureID_Btn_Rest; -unsigned int uTextureID_Btn_CastSpell; -unsigned int uTextureID_Btn_ZoomIn; -unsigned int uTextureID_Btn_ZoomOut; -unsigned int uTextureID_FONTPAL; -unsigned int uTextureID_Btn_NPCRight; -unsigned int uTextureID_Btn_NPCLeft; -std::array<unsigned int, 8> pTextureIDs_pMapDirs; - - -unsigned int uTextureID_BarRed; -unsigned int uTextureID_BarYellow; -unsigned int uTextureID_BarGreen; -unsigned int uTextureID_BarBlue; - - - - -Texture *pTexture_Leather; -Texture *pTexture_RestUI_CurrentSkyFrame; // idb -Texture *pTexture_RestUI_CurrentHourglassFrame; // idb - - -std::array<unsigned int, 5> uTextureID_Optkb; - -unsigned int optvid_base_texture_id; -unsigned int bloodsplats_texture_id; -unsigned int us_colored_lights_texture_id; -unsigned int tinting_texture_id; -unsigned int uTextureID_507C20; // weak -unsigned int uTextureID_507C24; // weak -std::array<unsigned int, 10> pTextureIDs_GammaPositions; -unsigned int not_available_bloodsplats_texture_id; -unsigned int not_available_us_colored_lights_texture_id; -unsigned int not_available_tinting_texture_id; - - stru355 stru_4E82A4 = {0x20, 0x41, 0, 0x20, 0xFF0000, 0xFF00, 0xFF, 0xFF000000}; stru355 stru_4EFCBC = {0x20, 0x41, 0, 0x10, 0x7C00, 0x3E0, 0x1F, 0x8000}; -Texture pTex_F7CE30; +//Texture_MM7 pTex_F7CE30; @@ -334,12 +191,12 @@ //----- (0040F806) -------------------------------------------------------- -void *Texture::UnzipPalette() +void *Texture_MM7::UnzipPalette() { - Texture *v1; // esi@1 + Texture_MM7 *v1; // esi@1 void *v2; // edi@1 - Texture *pSource; // [sp+0h] [bp-4h]@1 + Texture_MM7 *pSource; // [sp+0h] [bp-4h]@1 pSource = this; v1 = this; @@ -349,7 +206,7 @@ } //----- (0040F77C) -------------------------------------------------------- -void Texture::Release() +void Texture_MM7::Release() { if (this) { @@ -410,7 +267,7 @@ unsigned __int16 *v8; // ST20_4@14 int v9; // eax@14 char color_map[48]; // [sp+8h] [bp-98h]@9 - Texture DstBuf; // [sp+38h] [bp-68h]@1 + Texture_MM7 DstBuf; // [sp+38h] [bp-68h]@1 PCXHeader1 header1; // [sp+80h] [bp-20h]@9 PCXHeader2 header2; // [sp+90h] [bp-10h]@9 FILE *File; // [sp+98h] [bp-8h]@3 @@ -467,7 +324,7 @@ } //----- (0040F5BE) -------------------------------------------------------- -Texture::Texture() +Texture_MM7::Texture_MM7() { pName[0] = 0; uSizeOfMaxLevelOfDetail = 0; @@ -495,7 +352,7 @@ FILE *file; // eax@1 void *v6; // ebx@5 char color_map[48]; // [sp+Ch] [bp-98h]@7 - Texture DstBuf; // [sp+3Ch] [bp-68h]@1 + Texture_MM7 DstBuf; // [sp+3Ch] [bp-68h]@1 PCXHeader1 header1; // [sp+84h] [bp-20h]@7 PCXHeader2 header2; // [sp+94h] [bp-10h]@7 size_t Count; // [sp+A0h] [bp-4h]@4 @@ -2007,6 +1864,67 @@ +struct Image16bit_LOD_Loader : public ImageLoader +{ + inline Image16bit_LOD_Loader(LODFile_IconsBitmaps *lod, const wchar_t *name) + { + wcscpy(this->name, name); + this->lod = lod; + } + + virtual bool Load(unsigned int *width, unsigned int *height, void **pixels, IMAGE_FORMAT *format); + + wchar_t name[1024]; + LODFile_IconsBitmaps *lod; +}; + + +bool Image16bit_LOD_Loader::Load(unsigned int *out_width, unsigned int *out_height, void **out_pixels, IMAGE_FORMAT *out_format) +{ + *out_width = 0; + *out_height = 0; + *out_pixels = nullptr; + *out_format = IMAGE_INVALID_FORMAT; + + char namea[1024]; + sprintf(namea, "%S", name); + + auto tex = lod->GetTexture(lod->LoadTexture(namea, TEXTURE_16BIT_PALETTE)); + if (tex->pBits & 512) + Log::Warning(L"Alpha texture is loaded as Image16bit (%s)", name); + + if (tex->pPalette16 && tex->paletted_pixels) + { + auto palette = tex->pPalette16; + auto paletted_pixels = tex->paletted_pixels; + + auto width = tex->uTextureWidth; + auto height = tex->uTextureHeight; + auto pixels = new unsigned __int16[width * height]; + if (pixels) + { + for (unsigned int y = 0; y < height; ++y) + for (unsigned int x = 0; x < width; ++x) + { + auto index = paletted_pixels[y * width + x]; + auto pixel = tex->pPalette16[index]; + + pixels[y * width + x] = pixel; + } + *out_width = width; + *out_height = height; + *out_pixels = pixels; + *out_format = IMAGE_FORMAT_R5G6B5; + } + } + + return *out_pixels != nullptr; +} + + + + + struct Alpha_LOD_Loader : public ImageLoader { @@ -2034,6 +1952,8 @@ sprintf(namea, "%S", name); auto tex = lod->GetTexture(lod->LoadTexture(namea, TEXTURE_16BIT_PALETTE)); + if (~tex->pBits & 512) + Log::Warning(L"ColorKey texture is loaded as Alpha (%s)", name); if (tex->pPalette16 && tex->paletted_pixels) { @@ -2104,6 +2024,8 @@ sprintf(namea, "%S", name); auto tex = lod->GetTexture(lod->LoadTexture(namea, TEXTURE_16BIT_PALETTE)); + if (tex->pBits & 512) + Log::Warning(L"Alpha texture is loaded as ColorKey (%s)", name); if (tex->pPalette16 && tex->paletted_pixels) { @@ -2478,7 +2400,7 @@ FILE *file; // eax@1 void *v6; // ebx@5 char color_map[48]; // [sp+Ch] [bp-98h]@7 - Texture DstBuf; // [sp+3Ch] [bp-68h]@1 + Texture_MM7 DstBuf; // [sp+3Ch] [bp-68h]@1 PCXHeader1 header1; // [sp+84h] [bp-20h]@7 PCXHeader2 header2; // [sp+94h] [bp-10h]@7 size_t Count; // [sp+A0h] [bp-4h]@4 @@ -2591,6 +2513,16 @@ return true; } +bool Image::Image16bit_From_LOD(const wchar_t *name) +{ + loader = new Image16bit_LOD_Loader(pIcons_LOD, name); + + if (!lazy_initialization) + this->LoadImageData(); + + return true; +} + bool Image::ColorKey_From_LOD(const wchar_t *name, unsigned __int16 colorkey)
--- a/Engine/Graphics/Texture.h Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Graphics/Texture.h Mon Mar 07 03:48:40 2016 +0200 @@ -37,32 +37,33 @@ -struct Image +class Image { - inline Image(bool lazy_initialization = true): - lazy_initialization(lazy_initialization), initialized(false), - width(0), height(0), native_format(IMAGE_INVALID_FORMAT), - loader(nullptr) - { - for (unsigned int i = 0; i < IMAGE_NUM_FORMATS; ++i) - pixels[i] = 0; - } + public: + inline Image(bool lazy_initialization = true): + lazy_initialization(lazy_initialization), initialized(false), + width(0), height(0), native_format(IMAGE_INVALID_FORMAT), + loader(nullptr) + { + for (unsigned int i = 0; i < IMAGE_NUM_FORMATS; ++i) + pixels[i] = nullptr; + } - bool Image_From_LOD(const wchar_t *name); - bool ColorKey_From_LOD(const wchar_t *name, unsigned __int16 colorkey); - bool Alpha_From_LOD(const wchar_t *name); + bool Image16bit_From_LOD(const wchar_t *name); + bool ColorKey_From_LOD(const wchar_t *name, unsigned __int16 colorkey); + bool Alpha_From_LOD(const wchar_t *name); - bool PCX_From_IconsLOD(const wchar_t *name); - bool PCX_From_NewLOD(const wchar_t *name); - bool PCX_From_File(const wchar_t *filename); + bool PCX_From_IconsLOD(const wchar_t *name); + bool PCX_From_NewLOD(const wchar_t *name); + bool PCX_From_File(const wchar_t *filename); - unsigned int GetWidth(); - unsigned int GetHeight(); - const void *GetPixels(IMAGE_FORMAT format); + unsigned int GetWidth(); + unsigned int GetHeight(); + const void *GetPixels(IMAGE_FORMAT format); - bool Release(); + bool Release(); protected: @@ -111,9 +112,9 @@ #pragma pack(push, 1) -struct Texture +struct Texture_MM7 { - Texture(); + Texture_MM7(); void Release(); void *UnzipPalette(); @@ -204,172 +205,28 @@ -extern std::array<struct Image *, 45> pSavegameThumbnails; -extern std::array<struct Texture *, 2> pTexture_LloydBeacons; -extern struct Texture *pTexture_50635C; -extern struct Texture *pTex_book_button8_off; -extern struct Texture *pTex_book_button8_on; -extern struct Texture *pTex_book_button7_off; -extern struct Texture *pTex_book_button7_on; -extern struct Texture *pTex_book_button6_off; -extern struct Texture *pTex_book_button6_on; -extern struct Texture *pTex_book_button5_off; -extern struct Texture *pTex_book_button5_on; -extern struct Texture *pTex_book_button4_off; -extern struct Texture *pTex_book_button4_on; -extern struct Texture *pTex_book_button3_off; -extern struct Texture *pTex_book_button3_on; -extern struct Texture *pTex_book_button2_off; -extern struct Texture *pTex_book_button1_off; -extern struct Texture *pTex_book_button2_on; -extern struct Texture *pTex_book_button1_on; -extern std::array<struct Texture *, 6> pTexture_TownPortalIcons; // [0]Harmonale, [1]Pierpont, [2]Nighon, [3]Evenmorn Island, [4]Celestia, [5]The Pit - -extern std::array<struct Texture *, 12> SBPageCSpellsTextureList; -extern std::array<struct Texture *, 12> SBPageSSpellsTextureList; -extern struct Texture *pSBQuickSpellBtnTextr; -extern struct Texture *pSpellBookClickCloseBtnTextr; -extern struct Texture *pSBClickQuickSpellBtnTextr; -extern struct Texture *pSpellBookCloseBtnTextr; -extern std::array<std::array<struct Texture *, 2>, 9> pTextures_tabs; -extern struct Texture *pTexture_mapbordr; // idb -extern struct Texture *pTexture_pagemask; // idb -extern std::array<struct Texture *, 9> pSpellBookPagesTextr; -extern struct Texture *pSpellBookPagesTextr_9; -extern struct Texture *pSpellBookPagesTextr_10; -extern struct Texture *pSpellBookPagesTextr_11; -extern struct Texture *pSpellBookPagesTextr_12; -extern struct Texture *pSpellBookPagesTextr_13; -extern struct Texture *pTexture_AutonotesBook; -extern struct Texture *pTexture_CurrentBook; -extern struct Texture *pTex_moon_new; -extern struct Texture *pTex_moon_4; -extern struct Texture *pTex_moon_2; -extern struct Texture *pTex_moon_2_2; -extern struct Texture *pTex_moon_ful; - -extern struct Texture *minimap_loop; // 5079D8 -extern struct Texture *_5079B4_compass; // 5079B4 -extern struct Texture *_5079C8_init_y; // 5079C8 -extern struct Texture *_5079CC_init_r; // 5079CC -extern struct Texture *_5079D0_init_g; // 5079D0 - - -extern int uTextureID_RestUI_restb4; // weak -extern int uTextureID_RestUI_restexit; // weak -extern int uTextureID_RestUI_restb3; // weak -extern int uTextureID_RestUI_restb1; // weak -extern int uTextureID_RestUI_restb2; // weak -extern int uTextureID_RestUI_restmain; // weak -extern unsigned int uTextureID_Leather; -extern int uTextureID_ar_dn_dn; // weak -extern int uTextureID_ar_dn_up; // weak -extern int uTextureID_ar_up_dn; // weak -extern int uTextureID_ar_up_up; // weak - - -extern unsigned int uTextureID_mhp_yel; -extern unsigned int uTextureID_mhp_red; -extern unsigned int uTextureID_mhp_grn; -extern unsigned int uTextureID_mhp_capr; -extern unsigned int uTextureID_mhp_capl; -extern unsigned int uTextureID_mhp_bd; -extern unsigned int uTextureID_BUTTDESC2; -extern unsigned int uTextureID_x_x_u; -extern unsigned int uTextureID_BUTTMAKE2; -extern unsigned int uTextureID_BUTTMAKE; -extern unsigned int uTextureID_BUTTYES2; -extern unsigned int uTextureID_x_ok_u; -extern std::array<struct Texture *, 22> pPlayerPortraits; -extern std::array<struct Texture *, 9> pTexture_IC_KNIGHT; -extern struct Texture *pTexture_MAKESKY; -extern struct Texture *pTexture_MAKETOP; -extern std::array<struct Texture *, 20> pTextures_arrowr; -extern std::array<struct Texture *, 20> pTextures_arrowl; -extern struct Texture *pTexture_presleft; -extern struct Texture *pTexture_pressrigh; -extern struct Texture *pTexture_buttminu; -extern struct Texture *pTexture_buttplus; -extern unsigned int uTextureID_Quit1; -extern unsigned int uTextureID_Resume1; -extern unsigned int uTextureID_Controls1; -extern unsigned int uTextureID_Save1; -extern unsigned int uTextureID_Load1; -extern unsigned int uTextureID_New1; -extern unsigned int uTextureID_Options; - - -extern unsigned int uTextureID_ib_td5_A; -extern unsigned int uTextureID_ib_td4_A; -extern unsigned int uTextureID_ib_td3_A; -extern unsigned int uTextureID_ib_td2_A; -extern unsigned int uTextureID_ib_td1_A; -extern int uTextureID_50795C; // weak - - -extern unsigned int uTextureID_Btn_GameSettings; - - -extern unsigned int uTextureID_Btn_Rest; -extern unsigned int uTextureID_Btn_CastSpell; -extern unsigned int uTextureID_Btn_ZoomIn; -extern unsigned int uTextureID_Btn_ZoomOut; -extern unsigned int uTextureID_FONTPAL; -extern unsigned int uTextureID_Btn_NPCRight; -extern unsigned int uTextureID_Btn_NPCLeft; -extern std::array<unsigned int, 8> pTextureIDs_pMapDirs; - - -extern unsigned int uTextureID_BarRed; -extern unsigned int uTextureID_BarYellow; -extern unsigned int uTextureID_BarGreen; -extern unsigned int uTextureID_BarBlue; - - - -extern struct Texture *pTexture_Leather; -extern struct Texture *pTexture_RestUI_CurrentSkyFrame; // idb -extern struct Texture *pTexture_RestUI_CurrentHourglassFrame; // idb - - -extern std::array<unsigned int, 5> uTextureID_Optkb; - -extern unsigned int optvid_base_texture_id; -extern unsigned int bloodsplats_texture_id; -extern unsigned int us_colored_lights_texture_id; -extern unsigned int tinting_texture_id; -extern unsigned int uTextureID_507C20; // weak -extern unsigned int uTextureID_507C24; // weak -extern std::array<unsigned int, 10> pTextureIDs_GammaPositions; -extern unsigned int not_available_bloodsplats_texture_id; -extern unsigned int not_available_us_colored_lights_texture_id; -extern unsigned int not_available_tinting_texture_id; - struct OptionsMenuSkin { OptionsMenuSkin(); void Relaease(); - unsigned int uTextureID_Background; // 507C60 - unsigned int uTextureID_TurnSpeed[3]; // 507C64 - unsigned int uTextureID_ArrowLeft; // 507C70 - unsigned int uTextureID_ArrowRight; // 507C74 - unsigned int uTextureID_unused_0; // 507C78 - unsigned int uTextureID_unused_1; // 507C7C - unsigned int uTextureID_unused_2; // 507C80 - unsigned int uTextureID_FlipOnExit; // 507C84 - unsigned int uTextureID_SoundLevels[10]; // 507C88 - unsigned int uTextureID_AlwaysRun; // 507CB0 - unsigned int uTextureID_WalkSound; // 507CB4 - unsigned int uTextureID_ShowDamage; // 507CB8 + class Image *uTextureID_Background; // 507C60 + class Image *uTextureID_TurnSpeed[3]; // 507C64 + class Image *uTextureID_ArrowLeft; // 507C70 + class Image *uTextureID_ArrowRight; // 507C74 + class Image *uTextureID_unused_0; // 507C78 + class Image *uTextureID_unused_1; // 507C7C + class Image *uTextureID_unused_2; // 507C80 + class Image *uTextureID_FlipOnExit; // 507C84 + class Image *uTextureID_SoundLevels[10]; // 507C88 + class Image *uTextureID_AlwaysRun; // 507CB0 + class Image *uTextureID_WalkSound; // 507CB4 + class Image *uTextureID_ShowDamage; // 507CB8 }; extern OptionsMenuSkin options_menu_skin; // 507C60 - -extern struct Texture pTex_F7CE30; - extern struct stru355 stru_4E82A4;// = {0x20, 0x41, 0, 0x20, 0xFF0000, 0xFF00, 0xFF, 0xFF000000}; moved to texture.h extern struct stru355 stru_4EFCBC;// = {0x20, 0x41, 0, 0x10, 0x7C00, 0x3E0, 0x1F, 0x8000}; moved to texture.h
--- a/Engine/LOD.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/LOD.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -1041,7 +1041,7 @@ void LODFile_IconsBitmaps::SyncLoadedFilesCount() { signed int loaded_files; // eax@1 - Texture *pTex; // edx@1 + Texture_MM7 *pTex; // edx@1 loaded_files = this->uNumLoadedFiles; for ( pTex = &this->pTextures[loaded_files]; !pTex->pName[0]; --pTex ) @@ -1143,7 +1143,7 @@ v3 = 1000; do { - Texture::Texture(v2); + Texture_MM7::Texture_MM7(v2); ++v2; --v3; } @@ -1732,8 +1732,8 @@ this->uTextureBlueBits = uTargetBBits; for ( uint i = 0; i < this->uNumLoadedFiles; ++i ) { - Texture DstBuf; // [sp+4h] [bp-50h]@6 - //Texture::Texture(&DstBuf); + Texture_MM7 DstBuf; // [sp+4h] [bp-50h]@6 + //Texture_MM7::Texture_MM7(&DstBuf); if ( this->pTextures[i].pPalette16 ) { File = FindContainer((const char *)this->pTextures[i].pName, 0); @@ -1764,7 +1764,7 @@ FILE *File; // eax@1 void *v7; // ebx@7 void *v8; // edi@7 - Texture DstBuf; // [sp+Ch] [bp-4Ch]@1 + Texture_MM7 DstBuf; // [sp+Ch] [bp-4Ch]@1 File = FindContainer(pContainer, 0); if ( !File ) @@ -1795,7 +1795,7 @@ } //----- (00410522) -------------------------------------------------------- -int LODFile_IconsBitmaps::_410522(Texture *pDst, const char *pContainer, unsigned int uTextureType) +int LODFile_IconsBitmaps::_410522(Texture_MM7 *pDst, const char *pContainer, unsigned int uTextureType) { void *v9; // ST2C_4@6 int v15; // ecx@12 @@ -2055,9 +2055,9 @@ } //----- (004101B1) -------------------------------------------------------- -int LODFile_IconsBitmaps::ReloadTexture(Texture *pDst, const char *pContainer, int mode) +int LODFile_IconsBitmaps::ReloadTexture(Texture_MM7 *pDst, const char *pContainer, int mode) { - Texture *v6; // esi@2 + Texture_MM7 *v6; // esi@2 unsigned int v7; // ebx@6 unsigned int v8; // ecx@6 signed int result; // eax@7 @@ -2113,9 +2113,9 @@ } //----- (0040FC08) -------------------------------------------------------- -int LODFile_IconsBitmaps::LoadTextureFromLOD(Texture *pOutTex, const char *pContainer, enum TEXTURE_TYPE eTextureType) +int LODFile_IconsBitmaps::LoadTextureFromLOD(Texture_MM7 *pOutTex, const char *pContainer, enum TEXTURE_TYPE eTextureType) { - Texture *v8; // esi@3 + Texture_MM7 *v8; // esi@3 enum TEXTURE_TYPE v12; // eax@14 signed int result; // esi@14 unsigned int v14; // eax@21 @@ -2183,7 +2183,7 @@ free(v19); if ( /*bUseLoResSprites*/false && v8->pBits & 2 ) { - pOutTex = (Texture *)(((signed int)v8->uSizeOfMaxLevelOfDetail >> 2) + pOutTex = (Texture_MM7 *)(((signed int)v8->uSizeOfMaxLevelOfDetail >> 2) + ((signed int)v8->uSizeOfMaxLevelOfDetail >> 4) + ((signed int)v8->uSizeOfMaxLevelOfDetail >> 6)); v22 = (size_t)pOutTex; @@ -2339,11 +2339,11 @@ return 1; } -Texture *LODFile_IconsBitmaps::LoadTexturePtr(const char *pContainer, enum TEXTURE_TYPE uTextureType) +Texture_MM7 *LODFile_IconsBitmaps::LoadTexturePtr(const char *pContainer, enum TEXTURE_TYPE uTextureType) { uint id = LoadTexture(pContainer, uTextureType); - Assert(id != -1 && L"Texture not found"); + Assert(id != -1 && L"Texture_MM7 not found"); return &pTextures[id]; } @@ -2393,12 +2393,12 @@ // return v4; } -Texture * LODFile_IconsBitmaps::GetTexture( int idx ) +Texture_MM7 * LODFile_IconsBitmaps::GetTexture( int idx ) { - Assert(idx < MAX_LOD_TEXTURES, "Texture index out of bounds (%u)", idx); + Assert(idx < MAX_LOD_TEXTURES, "Texture_MM7 index out of bounds (%u)", idx); if (idx == -1) { - //Log::Warning(L"Texture id = %d missing", idx); + //Log::Warning(L"Texture_MM7 id = %d missing", idx); return pTextures + LoadDummyTexture(); } return pTextures + idx;
--- a/Engine/LOD.h Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/LOD.h Mon Mar 07 03:48:40 2016 +0200 @@ -153,13 +153,13 @@ bool Load(const char *pFilename, const char *pFolderName); void ReleaseAll(); unsigned int LoadTexture(const char *pContainer, enum TEXTURE_TYPE uTextureType = TEXTURE_DEFAULT); - struct Texture *LoadTexturePtr(const char *pContainer, enum TEXTURE_TYPE uTextureType = TEXTURE_DEFAULT); - int LoadTextureFromLOD(struct Texture *pOutTex, const char *pContainer, enum TEXTURE_TYPE eTextureType); - int ReloadTexture(struct Texture *pDst, const char *pContainer, int mode); + struct Texture_MM7 *LoadTexturePtr(const char *pContainer, enum TEXTURE_TYPE uTextureType = TEXTURE_DEFAULT); + int LoadTextureFromLOD(struct Texture_MM7 *pOutTex, const char *pContainer, enum TEXTURE_TYPE eTextureType); + int ReloadTexture(struct Texture_MM7 *pDst, const char *pContainer, int mode); void ReleaseHardwareTextures(); void ReleaseLostHardwareTextures(); void _410423_move_textures_to_device(); - int _410522(struct Texture *pDst, const char *pContainer, unsigned int uTextureType); + int _410522(struct Texture_MM7 *pDst, const char *pContainer, unsigned int uTextureType); void SetupPalettes(unsigned int uTargetRBits, unsigned int uTargetGBits, unsigned int uTargetBBits); void ReleaseAll2(); void RemoveTexturesPackFromTextureList(); @@ -170,7 +170,7 @@ int LoadDummyTexture(); - Texture *GetTexture(int idx); + Texture_MM7 *GetTexture(int idx); /*FILE *pFile; @@ -187,7 +187,7 @@ struct LOD::Directory *pSubIndices; unsigned int uOffsetToSubIndex; FILE *pOutputFileHandle;*/ - Texture pTextures[MAX_LOD_TEXTURES]; + Texture_MM7 pTextures[MAX_LOD_TEXTURES]; unsigned int uNumLoadedFiles; int dword_11B80; int dword_11B84;
--- a/Engine/MMT.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/MMT.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -56,7 +56,7 @@ } -Texture *LoadPNG(const char *name) +Texture_MM7 *LoadPNG(const char *name) { int x, y; int width, height; @@ -67,7 +67,7 @@ int number_of_passes; png_bytep * row_pointers; uint i = 0; - Texture *tex; + Texture_MM7 *tex; char header[8]; // 8 is the maximum size that can be checked @@ -114,7 +114,7 @@ fclose(fp); - tex = new Texture; + tex = new Texture_MM7; tex->uTextureHeight = height; tex->uTextureWidth = width; tex->uSizeOfMaxLevelOfDetail = png_get_rowbytes(png_ptr, info_ptr); @@ -154,7 +154,7 @@ unsigned int pControlParam; // ecx@35 unsigned int pX; unsigned int pY; // [sp-18h] [bp-54h]@39 - Texture *pTexture; // [sp-14h] [bp-50h]@39 + Texture_MM7 *pTexture; // [sp-14h] [bp-50h]@39 char pContainerName[64]; MSG msg; @@ -177,15 +177,15 @@ pWindow_MMT_MainMenu = new GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, 0); //load buttons - //Texture* MMT_MM6 = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE); + //Texture_MM7* MMT_MM6 = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE); sprintf(pContainerName, "data\\New_Icons/%s", "mm6_button_oval.png"); - Texture* MMT_MM6 = LoadPNG(pContainerName); + Texture_MM7* MMT_MM6 = LoadPNG(pContainerName); - Texture* MMT_MM7 = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE); - Texture* MMT_MM8 = pIcons_LOD->LoadTexturePtr("title_cred", TEXTURE_16BIT_PALETTE); - Texture* MMT_Continue = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE); - Texture* MMT_Exit = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE); + Texture_MM7* MMT_MM7 = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE); + Texture_MM7* MMT_MM8 = pIcons_LOD->LoadTexturePtr("title_cred", TEXTURE_16BIT_PALETTE); + Texture_MM7* MMT_Continue = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE); + Texture_MM7* MMT_Exit = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE); pMMT_MainMenu_BtnMM6 = pWindow_MMT_MainMenu->CreateButton(0, 0, MMT_MM6->uTextureWidth, MMT_MM6->uTextureHeight, 1, 0, UIMSG_MMT_MainMenu_MM6, 0, 0, "", MMT_MM6, 0); pMMT_MainMenu_BtnMM7 = pWindow_MMT_MainMenu->CreateButton(window->GetWidth() - (window->GetWidth() / 4), window->GetHeight() / 4, MMT_MM7->uTextureWidth, MMT_MM7->uTextureHeight, 1, 0, UIMSG_MMT_MainMenu_MM7, 1, 0, "", MMT_MM7, 0);
--- a/Engine/Objects/Actor.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Objects/Actor.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -6,6 +6,8 @@ #include "Engine/Engine.h" +#include "GUI/UI/UIGame.h" + #include "../Graphics/PaletteManager.h" #include "../Graphics/DecalBuilder.h" #include "../Graphics/Sprites.h" @@ -75,7 +77,7 @@ { unsigned int bar_length; // esi@1 unsigned int uX; // ebx@10 - unsigned int v9; // [sp+14h] [bp-Ch]@4 + Image *v9; // [sp+14h] [bp-Ch]@4 unsigned int v10; // [sp+1Ch] [bp-4h]@4 if (actor->pMonsterInfo.uHP <= 25) @@ -86,12 +88,11 @@ bar_length = 200; v10 = bar_length; + v9 = game_ui_monster_hp_green; if ( actor->sCurrentHP <= (0.34 * actor->pMonsterInfo.uHP) ) - v9 = uTextureID_mhp_red; + v9 = game_ui_monster_hp_red; else if ( actor->sCurrentHP <= ( 0.67 * actor->pMonsterInfo.uHP) ) - v9 = uTextureID_mhp_yel; - else - v9 = uTextureID_mhp_grn; + v9 = game_ui_monster_hp_yellow; if ( actor->sCurrentHP < (int)actor->pMonsterInfo.uHP ) v10 = bar_length / actor->pMonsterInfo.uHP * actor->sCurrentHP; @@ -99,13 +100,13 @@ uX = window->uFrameX + (signed int)(window->uFrameWidth - bar_length) / 2; pRenderer->SetUIClipRect(uX, window->uFrameY + 32, uX + bar_length, window->uFrameY + 52); - pRenderer->DrawTextureTransparentColorKey(uX, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_bd)); + pRenderer->DrawTextureAlphaNew(uX/640.0f, (window->uFrameY + 32)/480.0f, game_ui_monster_hp_background); pRenderer->SetUIClipRect(uX, window->uFrameY + 32, uX + v10, window->uFrameY + 52); - pRenderer->DrawTextureTransparentColorKey(uX, window->uFrameY + 34, pIcons_LOD->GetTexture(v9)); + pRenderer->DrawTextureAlphaNew(uX/640.0f, (window->uFrameY + 34)/480.0f, v9); pRenderer->ResetUIClipRect(); - pRenderer->DrawTextureTransparentColorKey(uX - 5, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capl)); - pRenderer->DrawTextureTransparentColorKey(uX + bar_length, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capr)); + pRenderer->DrawTextureAlphaNew((uX - 5)/640.0f, (window->uFrameY + 32)/480.0f, game_ui_monster_hp_border_left); + pRenderer->DrawTextureAlphaNew((uX + bar_length)/640.0f, (window->uFrameY + 32)/480.0f, game_ui_monster_hp_border_right); } //----- (00448A40) --------------------------------------------------------
--- a/Engine/Objects/Chest.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Objects/Chest.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -219,7 +219,7 @@ { // int v3; // eax@1 unsigned int item_texture_id; // eax@1 - Texture *item_texture; // ecx@1 + Texture_MM7 *item_texture; // ecx@1 signed int v6; // eax@1 // signed int v7; // edi@3 signed int v8; // eax@3 @@ -314,7 +314,7 @@ int result; // eax@11 unsigned int v7; // eax@12 int v8; // edx@12 - Texture *texture; // ecx@12 + Texture_MM7 *texture; // ecx@12 signed int v10; // eax@12 signed int v11; // edi@14 unsigned int v12; // esi@14 @@ -408,7 +408,7 @@ int uItemID; // edi@1 int v6; // edx@4 unsigned int v7; // eax@5 - Texture *texture; // ecx@5 + Texture_MM7 *texture; // ecx@5 signed int v9; // eax@5 signed int v10; // edi@7 unsigned int texture_cell_width; // ebx@7 @@ -635,7 +635,7 @@ { //Give item from chest(rus: Взять предмет из ящика) void *v2; // eax@1 unsigned int v4; // eax@1 - Texture *texture; // ecx@1 + Texture_MM7 *texture; // ecx@1 signed int v6; // eax@1 signed int v7; // edi@3 signed int v8; // eax@3
--- a/Engine/Objects/Items.h Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Objects/Items.h Mon Mar 07 03:48:40 2016 +0200 @@ -88,6 +88,7 @@ ITEM_CHAINMAIL_1 = 71, ITEM_PLATE_1 = 76, ITEM_BUCKLER_1 = 84, + ITEM_92 = 92, ITEM_GAUNTLETS_1 = 110, ITEM_BOOTS_1 = 115, ITEM_WAND_FIRE = 135,
--- a/Engine/Objects/NPC.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Objects/NPC.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -20,7 +20,7 @@ #include "../Graphics/Overlays.h" int pDialogueNPCCount; -std::array<struct Texture *, 6> pDialogueNPCPortraits; +std::array<struct Texture_MM7 *, 6> pDialogueNPCPortraits; int uNumDialogueNPCPortraits; // weak struct NPCStats *pNPCStats = nullptr; @@ -1329,8 +1329,7 @@ pDialogueWindow = new GUIWindow(0, 0, window->GetWidth(), 350, 0, 0); pBtn_ExitCancel = pDialogueWindow->CreateButton( 471, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34], //"Cancel" - pIcons_LOD->GetTexture(uExitCancelTextureId), - 0); + ui_exit_cancel_button_background, 0); pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); if ( pNPCStats->pProfessions[v1->uProfession].pBenefits)//*(&pNPCStats->field_13A5C + 5 * v1->uProfession) ) { @@ -1365,8 +1364,8 @@ pDialogueWindow->Release(); pDialogueWindow = new GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, 0); sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S], pMapStats->pInfos[uHouse_ExitPic].pName); - pBtn_ExitCancel = pDialogueWindow->CreateButton(566, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 'N', pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);// "Cancel" - pBtn_YES = pDialogueWindow->CreateButton(486, 445, 75, 33, 1, 0, UIMSG_BF, 1, 'Y', sHouseName.data(), pIcons_LOD->GetTexture(uTextureID_BUTTYES2), 0); + pBtn_ExitCancel = pDialogueWindow->CreateButton(566, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 'N', pGlobalTXT_LocalizationStrings[34], ui_buttdesc2, 0);// "Cancel" + pBtn_YES = pDialogueWindow->CreateButton(486, 445, 75, 33, 1, 0, UIMSG_BF, 1, 'Y', sHouseName.data(), ui_buttyes2, 0); pDialogueWindow->CreateButton( pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 63u, 73u, 1, 0, UIMSG_BF, 1u, 0x20u, sHouseName.data(), 0); pDialogueWindow->CreateButton(8, 8, 460, 344, 1, 0, UIMSG_BF, 1, 0x59u, sHouseName.data(), 0); } @@ -1385,7 +1384,7 @@ pDialogueWindow = new GUIWindow(0, 0, window->GetWidth(), 345, 0, 0); pBtn_ExitCancel = pDialogueWindow->CreateButton( 471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation" - pIcons_LOD->GetTexture(uExitCancelTextureId), 0); + ui_exit_cancel_button_background, nullptr); pDialogueWindow->CreateButton(8, 8, 450, 320, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); if ( pDialogueNPCCount == 1 && dword_591080 ) {
--- a/Engine/Objects/NPC.h Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Objects/NPC.h Mon Mar 07 03:48:40 2016 +0200 @@ -198,7 +198,7 @@ #pragma pack(pop) extern int pDialogueNPCCount; -extern std::array<struct Texture *, 6> pDialogueNPCPortraits; +extern std::array<struct Texture_MM7 *, 6> pDialogueNPCPortraits; extern int uNumDialogueNPCPortraits; // weak extern struct NPCStats *pNPCStats;
--- a/Engine/Objects/Player.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Objects/Player.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -768,7 +768,7 @@ //----- (00492528) -------------------------------------------------------- bool Player::CanFitItem(unsigned int uSlot, unsigned int uItemID) { - Texture *texture; // esi@1 + Texture_MM7 *texture; // esi@1 unsigned int slotWidth; // ebx@1 unsigned int slotHeight; // [sp+1Ch] [bp+Ch]@1 @@ -939,7 +939,7 @@ //----- (0049298B) -------------------------------------------------------- void Player::PutItemArInventoryIndex( int uItemID, int itemListPos, int index ) //originally accepted ItemGen* but needed only its uItemID { - Texture *item_texture; // esi@1 + Texture_MM7 *item_texture; // esi@1 int *pInvPos; // esi@4 unsigned int slot_width; // [sp+Ch] [bp-4h]@1 unsigned int slot_height; // [sp+18h] [bp+8h]@1 @@ -970,7 +970,7 @@ void Player::RemoveItemAtInventoryIndex( unsigned int index ) { ItemGen *item_in_slot; // ecx@1 - Texture *item_texture; // esi@1 + Texture_MM7 *item_texture; // esi@1 unsigned int slot_height; // ebp@1 int *pInvPos; // edx@4 unsigned int slot_width; // [sp+14h] [bp+4h]@1
--- a/Engine/Party.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Party.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -1024,7 +1024,7 @@ void Party::sub_421B2C_PlaceInInventory_or_DropPickedItem() { unsigned int v0; // eax@2 - Texture *v1; // ebx@2 + Texture_MM7 *v1; // ebx@2 int v2; // eax@3 int v4; // eax@6 unsigned __int16 v5; // dx@11 @@ -1105,7 +1105,7 @@ { unsigned int v2; // eax@1 char *v5; // eax@8 - Texture *v7; // ebx@10 + Texture_MM7 *v7; // ebx@10 signed int v8; // esi@10 Player *v9; // edi@11 int v10; // eax@11
--- a/Engine/SaveLoad.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/SaveLoad.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -35,14 +35,60 @@ struct SavegameList *pSavegameList = new SavegameList; unsigned int uNumSavegameFiles; std::array<unsigned int, 45> pSavegameUsedSlots; -//std::array<struct RGBTexture, 45> pSavegameThumbnails; std::array<Image *, 45> pSavegameThumbnails; std::array<SavegameHeader, 45> pSavegameHeader; + + +//----- (00411B59) -------------------------------------------------------- +void LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer) +{ + //unsigned int v2; // esi@1 + //unsigned int v3; // edi@1 + FILE *v4; // ebx@1 + FILE *v5; // eax@2 + //char pContainerName[64]; // [sp+Ch] [bp-44h]@1 + //unsigned int v7; // [sp+4Ch] [bp-4h]@1 + + if (pSavegameThumbnails[uSlot]) + { + pSavegameThumbnails[uSlot]->Release(); + pSavegameThumbnails[uSlot] = nullptr; + } + + + wchar_t filename[1024]; + swprintf(filename, L"data\\lloyd%d%d.pcx", uPlayer, uSlot + 1); + pSavegameThumbnails[uSlot] = assets->GetImage_PCXFromFile(filename); + + if (!pSavegameThumbnails[uSlot]) + { + swprintf(filename, L"lloyd%d%d.pcx", uPlayer, uSlot + 1); + pSavegameThumbnails[uSlot] = assets->GetImage_PCXFromNewLOD(filename); + } + /*sprintf(pContainerName, "data\\lloyd%d%d.pcx", uPlayer, uSlot + 1); + v4 = fopen(pContainerName, "rb"); + if ( v4 ) + { + pSavegameThumbnails[uSlot].LoadFromFILE(v4, 0, 1); + fclose(v4); + } + else + { + sprintf(pContainerName, "lloyd%d%d.pcx", uPlayer, uSlot + 1); + v5 = pNew_LOD->FindContainer(pContainerName, 1); + if ( v5 ) + pSavegameThumbnails[uSlot].LoadFromFILE(v5, 0, 0); + else + *((int *)&pSavegameThumbnails.data()->pPixels + 10 * uSlot) = 0; + }*/ +} + + //----- (0045EE8A) -------------------------------------------------------- -void __fastcall LoadGame(unsigned int uSlot) +void LoadGame(unsigned int uSlot) { bool v25; // esi@62 bool v26; // eax@62 @@ -308,8 +354,8 @@ if (current_screen_type == SCREEN_SAVEGAME) { - pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, img_loadsave); - pRenderer->DrawTextureAlphaNew(18/640.0f, 141/480.0f, img_loadsave); + pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, saveload_ui_loadsave); + pRenderer->DrawTextureAlphaNew(18/640.0f, 141/480.0f, saveload_ui_loadsave); text_pos = pFontSmallnum->AlignText_Center(186, pGlobalTXT_LocalizationStrings[190]); pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, text_pos + 25, 219, 0, pGlobalTXT_LocalizationStrings[190], 0, 0, 0); //Сохранение text_pos = pFontSmallnum->AlignText_Center(186, pSavegameHeader[uLoadGameUI_SelectedSlot].pName); @@ -570,7 +616,7 @@ } //----- (00460078) -------------------------------------------------------- -void __fastcall DoSavegame(unsigned int uSlot) +void DoSavegame(unsigned int uSlot) { if ( _stricmp(pCurrentMapName, "d05.blv") )//Not Arena(не Арена) {
--- a/Engine/SaveLoad.h Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/SaveLoad.h Mon Mar 07 03:48:40 2016 +0200 @@ -44,13 +44,16 @@ #pragma pack(pop) -void __fastcall LoadGame(unsigned int uSlot); // idb +void LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer); +void LoadGame(unsigned int uSlot); void SaveGame(bool IsAutoSAve, bool NotSaveWorld); -void __fastcall DoSavegame(unsigned int uSlot); // idb +void DoSavegame(unsigned int uSlot); bool Initialize_GamesLOD_NewLOD(); void SaveNewGame(); extern unsigned int uNumSavegameFiles; extern std::array<unsigned int, 45> pSavegameUsedSlots; extern struct SavegameList *pSavegameList; -extern std::array<SavegameHeader, 45> pSavegameHeader; \ No newline at end of file +extern std::array<SavegameHeader, 45> pSavegameHeader; + +extern std::array<struct Image *, 45> pSavegameThumbnails; \ No newline at end of file
--- a/Engine/Spells/CastSpellInfo.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/Spells/CastSpellInfo.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -3537,15 +3537,15 @@ { pGUIWindow_CastTargetedSpell = new OnCastTargetedSpell(0, 0, window->GetWidth(), window->GetHeight(), (int)&pCastSpellInfo[result], 0); pBtn_NPCLeft = pGUIWindow_CastTargetedSpell->CreateButton(469, 178, - pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureWidth, - pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureHeight, + ui_btn_npc_left->GetWidth(), + ui_btn_npc_left->GetHeight(), 1, 0, UIMSG_ScrollNPCPanel, 0, 0, "", - pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft), 0); + ui_btn_npc_left, 0); pBtn_NPCRight = pGUIWindow_CastTargetedSpell->CreateButton(626, 178, - pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureWidth, - pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureHeight, + ui_btn_npc_right->GetWidth(), + ui_btn_npc_right->GetHeight(), 1, 0, UIMSG_ScrollNPCPanel, 1, 0, "", - pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight), 0); + ui_btn_npc_right, 0); pGUIWindow_CastTargetedSpell->CreateButton(491, 149, 64, 74, 1, 0, UIMSG_HiredNPC_CastSpell, 4, 0x35u, "", 0); pGUIWindow_CastTargetedSpell->CreateButton(561, 149, 64, 74, 1, 0, UIMSG_HiredNPC_CastSpell, 5, 0x36u, "", 0); }
--- a/Engine/mm7_data.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/mm7_data.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -731,7 +731,6 @@ unsigned int uRequiredMana; // idb int _506348_current_lloyd_playerid; // weak __int64 lloyds_beacon_spell_level; // qword_506350 -char byte_506360; // weak int dword_506364; // weak int books_page_number; // weak int books_primary_item_per_page; // weak @@ -747,7 +746,7 @@ char byte_506550; // weak std::array<const char *, 5> aMoonPhaseNames; int _506568_autonote_type; // weak -char bRecallingBeacon; // weak +bool bRecallingBeacon; // weak int uLastPointedObjectID; // weak //unsigned __int8 bMonsterInfoUI_bDollInitialized; std::array<const char *, 44> aSpellNames; @@ -772,7 +771,6 @@ int uTextureID_PlayerBuff_Hammerhands; // weak int uTextureID_PlayerBuff_Preservation; // weak int uTextureID_PlayerBuff_Bless; // weak -int uTextureID_Btn_QuickReference; // weak struct GUIButton *pBtn_ZoomOut; // idb struct GUIButton *pBtn_ZoomIn; // idb unsigned int uGameUIFontShadow; @@ -848,8 +846,6 @@ std::array<std::array<char, 100>, 6> byte_591180; // idb std::array<struct NPCData *, 7> HouseNPCData;//0 zero element holds standart house npc GUIButton* HouseNPCPortraitsButtonsList[6];//dword_5913F4 -struct Texture *pTexture_outside; // idb -struct Texture *pTexture_Dialogue_Background; std::array<char, 2000> byte_5B0938; int EvtTargetObj; // 0x5B5920 int _unused_5B5924_is_travel_ui_drawn = false; // 005B5924 @@ -938,10 +934,6 @@ std::array<int, 64> dword_69B010; float flt_69B138_dist; // weak char byte_69BD41_unused; // weak -unsigned int uTextureID_AR_DN_DN; -unsigned int uTextureID_AR_UP_DN; -unsigned int uTextureID_LS_; -unsigned int uTextureID_x_d; int pSaveListPosition; // weak unsigned int uLoadGameUI_SelectedSlot; HWND hInsertCDWindow; // idb @@ -1031,10 +1023,9 @@ int uPlayerCreationUI_ArrowAnim; unsigned int uPlayerCreationUI_SelectedCharacter; int dword_A74CDC; // weak -struct Texture *pTexture_PlayerFaceMask; -struct Texture *pTexture_PlayerFaceEradicated; -struct Texture *pTexture_PlayerFaceDead; -std::array< std::array<struct Texture *, 56>, 4> pTextures_PlayerFaces; +struct Texture_MM7 *pTexture_PlayerFaceEradicated; +struct Texture_MM7 *pTexture_PlayerFaceDead; +std::array< std::array<struct Texture_MM7 *, 56>, 4> pTextures_PlayerFaces; __int64 _A750D8_player_speech_timer; // qword_A750D8 enum PlayerSpeech PlayerSpeechID; int uSpeakingCharacter; // weak @@ -1046,7 +1037,7 @@ //int dword_F8B144; // nexindex [-1] to the following std::array<int, 4> player_levels = {{1, 1, 1, 1}}; std::array<__int16, 6> weapons_Ypos; // word_F8B158 -std::array<struct Texture *, 12> ItemsInShopTexture; +std::array<struct Texture_MM7 *, 12> ItemsInShopTexture; __int16 bountyHunting_monster_id_for_hunting; // word_F8B1A0 const char *bountyHunting_text; // word_F8B1A4 int contract_approved; // weak
--- a/Engine/mm7_data.h Sat Mar 05 16:25:53 2016 +0200 +++ b/Engine/mm7_data.h Mon Mar 07 03:48:40 2016 +0200 @@ -399,9 +399,8 @@ extern unsigned int uRequiredMana; // idb extern int _506348_current_lloyd_playerid; // weak extern __int64 lloyds_beacon_spell_level; // qword_506350 -extern char byte_506360; // weak extern int dword_506364; // weak -//extern Texture *dword_50640C[]; // weak +//extern Texture_MM7 *dword_50640C[]; // weak extern int books_page_number; // number for page in books(номер страницы в книгах) extern int books_primary_item_per_page; // number primary item in book page(номер начальной записи на странице) extern int Autonotes_Instructors_page_flag; // dword_50652C @@ -416,7 +415,7 @@ extern char byte_506550; // weak extern std::array<const char *, 5> aMoonPhaseNames; extern int _506568_autonote_type; // 506568 -extern char bRecallingBeacon; // weak +extern bool bRecallingBeacon; // weak extern int uLastPointedObjectID; // weak //extern unsigned __int8 bMonsterInfoUI_bDollInitialized; extern std::array<const char *, 44> aSpellNames; @@ -442,7 +441,6 @@ extern int uTextureID_PlayerBuff_Hammerhands; // weak extern int uTextureID_PlayerBuff_Preservation; // weak extern int uTextureID_PlayerBuff_Bless; // weak -extern int uTextureID_Btn_QuickReference; // weak extern struct GUIButton *pBtn_ZoomOut; // idb extern struct GUIButton *pBtn_ZoomIn; // idb extern unsigned int uGameUIFontShadow; @@ -490,7 +488,6 @@ extern std::array<unsigned __int8, 5> IsPlayerWearingWatersuit; extern std::array<char, 54> party_has_equipment; extern std::array<char, 17> byte_5111F6_OwnedArtifacts; -extern std::array<unsigned int, 16> papredoll_dbrds; extern unsigned int uNumBlueFacesInBLVMinimap; extern std::array<unsigned __int16, 50> pBlueFacesInBLVMinimapIDs; @@ -518,8 +515,6 @@ extern std::array<std::array<char, 100>, 6> byte_591180; // idb extern std::array<struct NPCData *, 7> HouseNPCData; //0this array size temporarily increased to 60 from 6 to work aroud house overflow extern GUIButton* HouseNPCPortraitsButtonsList[6]; -extern struct Texture *pTexture_outside; // idb -extern struct Texture *pTexture_Dialogue_Background; extern std::array<char, 2000> byte_5B0938; extern int EvtTargetObj; // weak extern int _unused_5B5924_is_travel_ui_drawn; // 005B5924 @@ -607,10 +602,6 @@ extern std::array<int, 64> dword_69B010; extern float flt_69B138_dist; // weak extern char byte_69BD41_unused; // weak -extern unsigned int uTextureID_AR_DN_DN; -extern unsigned int uTextureID_AR_UP_DN; -extern unsigned int uTextureID_LS_; -extern unsigned int uTextureID_x_d; extern int pSaveListPosition; // weak extern unsigned int uLoadGameUI_SelectedSlot; extern HWND hInsertCDWindow; // idb @@ -726,10 +717,9 @@ extern int uPlayerCreationUI_ArrowAnim; extern unsigned int uPlayerCreationUI_SelectedCharacter; extern int dword_A74CDC; // weak -extern struct Texture *pTexture_PlayerFaceMask; -extern struct Texture *pTexture_PlayerFaceEradicated; -extern struct Texture *pTexture_PlayerFaceDead; -extern std::array< std::array<struct Texture *, 56>, 4> pTextures_PlayerFaces; +extern struct Texture_MM7 *pTexture_PlayerFaceEradicated; +extern struct Texture_MM7 *pTexture_PlayerFaceDead; +extern std::array< std::array<struct Texture_MM7 *, 56>, 4> pTextures_PlayerFaces; extern __int64 _A750D8_player_speech_timer; // qword_A750D8 extern enum PlayerSpeech PlayerSpeechID; extern int uSpeakingCharacter; // weak @@ -740,7 +730,7 @@ extern std::array<int, 32> dword_F1B430; // weak extern std::array<int, 4> player_levels; extern std::array<__int16, 6> weapons_Ypos; // word_F8B158 -extern std::array<struct Texture *, 12> ItemsInShopTexture; +extern std::array<struct Texture_MM7 *, 12> ItemsInShopTexture; extern __int16 bountyHunting_monster_id_for_hunting; // weak extern const char *bountyHunting_text; // idb extern int contract_approved; // weak
--- a/GUI/GUIButton.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/GUIButton.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -5,13 +5,15 @@ #define _CRT_SECURE_NO_WARNINGS #include "Engine/Engine.h" +#include "Engine/LOD.h" +#include "Engine/Texts.h" + +#include "GUI/GUIWindow.h" #include "GUIButton.h" #include "GUIWindow.h" #include "GUIFont.h" -#include "Engine/LOD.h" -#include "Engine/Texts.h" #include "OSWindow.h" @@ -217,17 +219,17 @@ } } pBtn_Up = pGUIWindow_CurrentMenu->CreateButton(438, 46, - pIcons_LOD->GetTexture(uTextureID_ar_up_up)->uTextureWidth, - pIcons_LOD->GetTexture(uTextureID_ar_up_up)->uTextureHeight, + ui_ar_up_up->GetWidth(), + ui_ar_up_up->GetHeight(), 1, 0, UIMSG_ClickAwardsUpBtn, 0, 0, "", - pIcons_LOD->GetTexture(uTextureID_ar_up_up), - pIcons_LOD->GetTexture(uTextureID_ar_up_dn), 0); + ui_ar_up_up, + ui_ar_up_dn, 0); pBtn_Down = pGUIWindow_CurrentMenu->CreateButton(438, 292, - pIcons_LOD->GetTexture(uTextureID_ar_dn_up)->uTextureWidth, - pIcons_LOD->GetTexture(uTextureID_ar_dn_up)->uTextureHeight, + ui_ar_dn_up->GetWidth(), + ui_ar_dn_up->GetHeight(), 1, 0, UIMSG_ClickAwardsDownBtn, 0, 0, "", - pIcons_LOD->GetTexture(uTextureID_ar_dn_up), - pIcons_LOD->GetTexture(uTextureID_ar_dn_dn), 0); + ui_ar_dn_up, + ui_ar_dn_dn, 0); ptr_507BA4 = pGUIWindow_CurrentMenu->CreateButton(440, 62, 16, 232, 1, 0, UIMSG_ClickAwardScrollBar, 0, 0, "", 0); } } @@ -238,6 +240,6 @@ pDialogueWindow = new GUIWindow(0, 0, window->GetWidth(), 345, 0, 0); pBtn_ExitCancel = pDialogueWindow->CreateButton( 471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[74], //"End Conversation" - pIcons_LOD->GetTexture(uExitCancelTextureId), 0); + ui_exit_cancel_button_background, 0); pDialogueWindow->CreateButton(8, 8, 450, 320, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); } \ No newline at end of file
--- a/GUI/GUIFont.h Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/GUIFont.h Mon Mar 07 03:48:40 2016 +0200 @@ -53,7 +53,7 @@ #pragma warning( pop ) GUIFont *LoadFont(const char *pFontFile, const char *pFontPalette, ...); -char * FitTextInAWindow(const char *pInString, GUIFont *pFont, GUIWindow *pWindow, signed int uX, int a5); +char * FitTextInAWindow(const char *pInString, GUIFont *pFont, struct GUIWindow *pWindow, signed int uX, int a5); extern struct GUIFont *pAutonoteFont;
--- a/GUI/GUIProgressBar.h Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/GUIProgressBar.h Mon Mar 07 03:48:40 2016 +0200 @@ -41,9 +41,9 @@ //RGBTexture field_68; //RGBTexture field_90; //RGBTexture field_B8; - struct Texture field_E0; - struct Texture pBardata; - struct Texture pLoadingProgress; + struct Texture_MM7 field_E0; + struct Texture_MM7 pBardata; + struct Texture_MM7 pLoadingProgress; inline GUIProgressBar():
--- a/GUI/GUIWindow.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/GUIWindow.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -76,17 +76,32 @@ Image *ui_exit_cancel_button_background = nullptr; Image *game_ui_right_panel_frame = nullptr; -unsigned int uExitCancelTextureId; +Image *dialogue_ui_x_ok_u = nullptr; +Image *dialogue_ui_x_x_u = nullptr; + +Image *ui_buttdesc2 = nullptr; +Image *ui_buttyes2 = nullptr; + +Image *ui_btn_npc_right = nullptr; +Image *ui_btn_npc_left = nullptr; + +Image *ui_ar_dn_dn = nullptr; +Image *ui_ar_dn_up = nullptr; +Image *ui_ar_up_dn = nullptr; +Image *ui_ar_up_up = nullptr; +Image *ui_leather_mm6 = nullptr; +Image *ui_leather_mm7 = nullptr; + GUIWindow_Inventory_CastSpell::GUIWindow_Inventory_CastSpell(unsigned int x, unsigned int y, unsigned int width, unsigned int height, int button, const char *hint) : GUIWindow(x, y, width, height, button, hint) { pMouse->SetCursorBitmap("MICON2"); pBtn_ExitCancel = CreateButton(392, 318, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34],//Отмена - pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); + ui_buttdesc2, nullptr); ShowStatusBarString(pGlobalTXT_LocalizationStrings[39], 2); // Choose target / Выбрать цель ++pIcons_LOD->uTexturePacksCount; current_character_screen_window = WINDOW_CharacterWindow_Inventory; @@ -100,7 +115,7 @@ { current_screen_type = SCREEN_HOUSE; pBtn_ExitCancel = CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[80], // Quit building / Выйти из здания - pIcons_LOD->GetTexture(uExitCancelTextureId), 0); + ui_exit_cancel_button_background, 0); for (int v26 = 0; v26 < uNumDialogueNPCPortraits; ++v26) { char *v29, *v30; @@ -135,7 +150,7 @@ prev_screen_type = current_screen_type; current_screen_type = SCREEN_NPC_DIALOGUE; pBtn_ExitCancel = CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], //"Exit" - pIcons_LOD->GetTexture(uExitCancelTextureId), 0); + ui_exit_cancel_button_background, 0); if (par1C != 1) { int num_menu_buttons = 0; @@ -406,9 +421,13 @@ if (!dword_591084) pDialogueNPCPortraits[0]->Release(); uNumDialogueNPCPortraits = 0; - pTexture_Dialogue_Background->Release(); - pIcons_LOD->SyncLoadedFilesCount(); + if (game_ui_dialogue_background) + { + game_ui_dialogue_background->Release(); + game_ui_dialogue_background = nullptr; + } + current_screen_type = prev_screen_type; GUIWindow::Release(); @@ -432,10 +451,13 @@ for (int i = 0; i < uNumDialogueNPCPortraits; ++i) pDialogueNPCPortraits[i]->Release(); uNumDialogueNPCPortraits = 0; - pTexture_Dialogue_Background->Release(); - pIcons_LOD->SyncLoadedFilesCount(); - pIcons_LOD->RemoveTexturesPackFromTextureList(); + if (game_ui_dialogue_background) + { + game_ui_dialogue_background->Release(); + game_ui_dialogue_background = nullptr; + } + dword_5C35D4 = 0; if (bFlipOnExit) { @@ -572,49 +594,7 @@ current_window.DrawTitleText(pFontLucida, 0, (signed int)(v16 - pFontLucida->CalcTextHeight(this->Hint, ¤t_window, 0, 0)) / 2 - 14, 0, this->Hint, 3); } -//----- (00411B59) -------------------------------------------------------- -void LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer) -{ - //unsigned int v2; // esi@1 - //unsigned int v3; // edi@1 - FILE *v4; // ebx@1 - FILE *v5; // eax@2 - //char pContainerName[64]; // [sp+Ch] [bp-44h]@1 - //unsigned int v7; // [sp+4Ch] [bp-4h]@1 - if (pSavegameThumbnails[uSlot]) - { - pSavegameThumbnails[uSlot]->Release(); - pSavegameThumbnails[uSlot] = nullptr; - } - - - wchar_t filename[1024]; - swprintf(filename, L"data\\lloyd%d%d.pcx", uPlayer, uSlot + 1); - pSavegameThumbnails[uSlot] = assets->GetImage_PCXFromFile(filename); - - if (!pSavegameThumbnails[uSlot]) - { - swprintf(filename, L"lloyd%d%d.pcx", uPlayer, uSlot + 1); - pSavegameThumbnails[uSlot] = assets->GetImage_PCXFromNewLOD(filename); - } - /*sprintf(pContainerName, "data\\lloyd%d%d.pcx", uPlayer, uSlot + 1); - v4 = fopen(pContainerName, "rb"); - if ( v4 ) - { - pSavegameThumbnails[uSlot].LoadFromFILE(v4, 0, 1); - fclose(v4); - } - else - { - sprintf(pContainerName, "lloyd%d%d.pcx", uPlayer, uSlot + 1); - v5 = pNew_LOD->FindContainer(pContainerName, 1); - if ( v5 ) - pSavegameThumbnails[uSlot].LoadFromFILE(v5, 0, 0); - else - *((int *)&pSavegameThumbnails.data()->pPixels + 10 * uSlot) = 0; - }*/ -} //----- (004B3157) -------------------------------------------------------- @@ -642,8 +622,8 @@ pWindow.uFrameZ -= 18; pWhiteColor = Color16(0xFFu, 0xFFu, 0xFFu); pColor2 = Color16(0x15u, 0x99u, 0xE9u); - pRenderer->DrawTextureTransparentColorKey(0x1DDu, 0, pTexture_Dialogue_Background); - pRenderer->DrawTextureAlphaNew(468, 0, game_ui_right_panel_frame); + pRenderer->DrawTextureNew(477/640.0f, 0, game_ui_dialogue_background); + pRenderer->DrawTextureAlphaNew(468/640.0f, 0, game_ui_right_panel_frame); if ( pDialogueNPCCount != uNumDialogueNPCPortraits || !uHouse_ExitPic ) { pDialogWindow.uFrameWidth = 130; @@ -668,8 +648,8 @@ JailDialog(); if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) { - pRenderer->DrawTextureTransparentColorKey(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); - pRenderer->DrawTextureTransparentColorKey(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); + pRenderer->DrawTextureAlphaNew(556/640.0f, 451/480.0f, dialogue_ui_x_x_u); + pRenderer->DrawTextureAlphaNew(476/640.0f, 451/480.0f, dialogue_ui_x_ok_u); } else pRenderer->DrawTextureAlphaNew(471/640.0f, 445/480.0f, ui_exit_cancel_button_background); @@ -681,8 +661,11 @@ pDialogWindow.uFrameZ = 457; pTextHeight = pFontArrus->CalcTextHeight(current_npc_text, &pDialogWindow, 13, 0); v6 = pTextHeight + 7; - pRenderer->GetLeather(8, 352 - (pTextHeight + 7), &pIcons_LOD->pTextures[uTextureID_Leather], - pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - (pTextHeight + 7)); + pRenderer->DrawTextureCustomHeight( + 8/640.0f, + (352 - (pTextHeight + 7))/480.0f, + ui_leather_mm7, + pTextHeight + 7); pRenderer->DrawTextureAlphaNew(8/640.0f, (347 - v6)/480.0f, _591428_endcap); v7 = FitTextInAWindow(current_npc_text, pFontArrus, &pDialogWindow, 0xDu, 0); window_SpeakInHouse->DrawText(pFontArrus, 13, 354 - v6, 0, v7, 0, 0, 0); @@ -691,8 +674,8 @@ { if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) { - pRenderer->DrawTextureTransparentColorKey(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); - pRenderer->DrawTextureTransparentColorKey(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); + pRenderer->DrawTextureAlphaNew(556/640.0f, 451/480.0f, dialogue_ui_x_x_u); + pRenderer->DrawTextureAlphaNew(476/640.0f, 451/480.0f, dialogue_ui_x_ok_u); } else pRenderer->DrawTextureAlphaNew(471 / 640.0f, 445 / 480.0f, ui_exit_cancel_button_background); @@ -700,8 +683,8 @@ } for ( v8 = 0; v8 < uNumDialogueNPCPortraits; ++v8 ) { - pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8] - 4, - pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]); + pRenderer->DrawTextureAlphaNew((pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8] - 4)/640.0f, + (pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8] - 4)/480.0f, game_ui_evtnpc); pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8], pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8], pDialogueNPCPortraits[v8]); if ( uNumDialogueNPCPortraits < 4 ) @@ -728,26 +711,26 @@ } if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) { - pRenderer->DrawTextureTransparentColorKey(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); - pRenderer->DrawTextureTransparentColorKey(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); + pRenderer->DrawTextureAlphaNew(556/640.0f, 451/480.0f, dialogue_ui_x_x_u); + pRenderer->DrawTextureAlphaNew(476/640.0f, 451/480.0f, dialogue_ui_x_ok_u); } else pRenderer->DrawTextureAlphaNew(471 / 640.0f, 445 / 480.0f, ui_exit_cancel_button_background); return; } v4 = (char *)pDialogueNPCCount - 1; - pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]); + pRenderer->DrawTextureAlphaNew((pNPCPortraits_x[0][0] - 4)/640.0f, (pNPCPortraits_y[0][0] - 4)/480.0f, game_ui_evtnpc); pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[(signed int)v4]); if ( current_screen_type == SCREEN_E ) { CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) { - pRenderer->DrawTextureTransparentColorKey(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); - pRenderer->DrawTextureTransparentColorKey(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); + pRenderer->DrawTextureAlphaNew(556/640.0f, 451/480.0f, dialogue_ui_x_x_u); + pRenderer->DrawTextureAlphaNew(476/640.0f, 451/480.0f, dialogue_ui_x_ok_u); } else - pRenderer->DrawTextureAlphaNew(471 / 640.0f, 445 / 480.0f, ui_exit_cancel_button_background); + pRenderer->DrawTextureAlphaNew(471/640.0f, 445/480.0f, ui_exit_cancel_button_background); return; } if ( v4 || !dword_591080 )//на изумрудном острове заходит на корабле пока не выполнены квесты @@ -816,11 +799,11 @@ } if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) { - pRenderer->DrawTextureTransparentColorKey(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); - pRenderer->DrawTextureTransparentColorKey(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); + pRenderer->DrawTextureAlphaNew(556/640.0f, 451/480.0f, dialogue_ui_x_x_u); + pRenderer->DrawTextureAlphaNew(476/640.0f, 451/480.0f, dialogue_ui_x_ok_u); } else - pRenderer->DrawTextureAlphaNew(471 / 640.0f, 445 / 480.0f, ui_exit_cancel_button_background); + pRenderer->DrawTextureAlphaNew(471/640.0f, 445/480.0f, ui_exit_cancel_button_background); } //----- (004B1854) -------------------------------------------------------- @@ -1163,7 +1146,7 @@ //----- (0041D12F) -------------------------------------------------------- GUIButton *GUIWindow::CreateButton(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, - int a6, int a7, UIMessageType msg, unsigned int msg_param, unsigned __int8 uHotkey, const char *pName, Texture *pTextures, ...) + int a6, int a7, UIMessageType msg, unsigned int msg_param, unsigned __int8 uHotkey, const char *pName, Image *pTextures, ...) { GUIButton *pButton; // esi@1 // unsigned int v13; // eax@1 @@ -1171,13 +1154,17 @@ // unsigned int v15; // eax@4 unsigned int TextureNum=0; // ebx@4 // unsigned int v17; // eax@4 -// Texture *v18; // eax@4 -// Texture **v19; // ecx@5 -// Texture **v20; // edx@5 +// Texture_MM7 *v18; // eax@4 +// Texture_MM7 **v19; // ecx@5 +// Texture_MM7 **v20; // edx@5 // GUIButton *v21; // eax@7 va_list texturs_ptr; pButton = (GUIButton *)malloc(0xBC); + + for (unsigned int i = 0; i < 5; ++i) + pButton->pTextures[i] = nullptr; + pButton->pParent = this; pButton->uWidth = uWidth; pButton->uHeight = uHeight; @@ -1197,13 +1184,20 @@ pButton->uHotkey = uHotkey; //strlen(pName); strcpy(pButton->pButtonName, pName); + + + va_start(texturs_ptr, pName); - while (NULL!=(pTextures=va_arg(texturs_ptr, Texture *))) + do { - pButton->pTextures[TextureNum]=pTextures; - ++TextureNum; - } + pTextures = va_arg(texturs_ptr, Image *); + pButton->pTextures[TextureNum] = pTextures; + ++TextureNum; + } while (pTextures); va_end(texturs_ptr); + + + pButton->uNumTextures = TextureNum; if ( this->pControlsTail ) this->pControlsTail->pNext = pButton; @@ -1306,7 +1300,7 @@ ContractSelectText(pEventCode); pDialogueWindow->Release(); pDialogueWindow = new GUIWindow(0, 0, window->GetWidth(), 350, pEventCode, 0); - pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uExitCancelTextureId), 0); // Cancel + pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34], ui_exit_cancel_button_background, 0); // Cancel pDialogueWindow->CreateButton( 0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); pDialogueWindow->CreateButton(480, 160, 140, 30, 1, 0, UIMSG_ClickNPCTopic, 82, 0, pGlobalTXT_LocalizationStrings[122], 0); pDialogueWindow->_41D08F_set_keyboard_control_group(1, 1, 0, 2); @@ -1328,7 +1322,7 @@ // ----------------------------------- // 004156F0 GUI_UpdateWindows --- part auto pButton = (GUIButton *)ptr_1C; - pRenderer->DrawTextureTransparentColorKey(uFrameY, uFrameX, pButton->pTextures[0]); + pRenderer->DrawTextureAlphaNew(uFrameY/640.0f, uFrameX/480.0f, pButton->pTextures[0]); viewparams->bRedrawGameUI = true; } @@ -1400,7 +1394,7 @@ draw_leather(); CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); CharacterUI_DrawPaperdoll(pPlayers[uActiveCharacter]); - pRenderer->DrawTextureIndexedAlpha(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uTextureID_x_x_u)); + pRenderer->DrawTextureAlphaNew(pBtn_ExitCancel->uX/640.0f, pBtn_ExitCancel->uY/480.0f, dialogue_ui_x_x_u); } void OnButtonClick::Update() @@ -1410,7 +1404,7 @@ if (Hint != (char *)1) pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); GUIButton *pButton = (GUIButton *)ptr_1C; - pRenderer->DrawTextureIndexedAlpha(uFrameX, uFrameY, pButton->pTextures[0]); + pRenderer->DrawTextureAlphaNew(uFrameX/640.0f, uFrameY/480.0f, pButton->pTextures[0]); viewparams->bRedrawGameUI = true; if (Hint && Hint != (char *)1) pButton->DrawLabel(Hint, pFontCreate, 0, 0); @@ -1428,7 +1422,7 @@ { if (pButton->uY >= 0 && pButton->uY <= window->GetHeight()) { - pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, pButton->pTextures[0]); + pRenderer->DrawTextureAlphaNew(uFrameX/640.0f, uFrameY/480.0f, pButton->pTextures[0]); viewparams->bRedrawGameUI = true; if (Hint && Hint != (char *)1) pButton->DrawLabel(Hint, pFontCreate, 0, 0); @@ -1449,7 +1443,7 @@ if (Hint != (char *)1) pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); auto pButton = (GUIButton *)ptr_1C; - pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, pButton->pTextures[1]); + pRenderer->DrawTextureAlphaNew(uFrameX/640.0f, uFrameY/480.0f, pButton->pTextures[1]); viewparams->bRedrawGameUI = 1; if (Hint && Hint != (char *)1) pButton->DrawLabel(Hint, pFontCreate, 0, 0); @@ -1463,7 +1457,7 @@ if (Hint != (char *)1) pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); auto pButton = (GUIButton *)ptr_1C; - pRenderer->DrawTextureIndexedAlpha(uFrameX, uFrameY, pButton->pTextures[1]); + pRenderer->DrawTextureAlphaNew(uFrameX/640.0f, uFrameY/480.0f, pButton->pTextures[1]); viewparams->bRedrawGameUI = true; Release(); @@ -1476,7 +1470,7 @@ if (Hint != (char *)1) pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); auto pButton = (GUIButton *)ptr_1C; - pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, pButton->pTextures[0]); + pRenderer->DrawTextureAlphaNew(uFrameX/640.0f, uFrameY/480.0f, pButton->pTextures[0]); viewparams->bRedrawGameUI = true; if (Hint && Hint != (char *)1) pButton->DrawLabel(Hint, pFontCreate, 0, 0); @@ -1495,7 +1489,7 @@ if (Hint != (char *)1) pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); auto pGUIButton = (GUIButton *)ptr_1C; - pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, pGUIButton->pTextures[0]); + pRenderer->DrawTextureAlphaNew(uFrameX/640.0f, uFrameY/480.0f, pGUIButton->pTextures[0]); viewparams->bRedrawGameUI = true; if (Hint && Hint != (char *)1) pGUIButton->DrawLabel(Hint, pFontCreate, 0, 0); @@ -1511,7 +1505,7 @@ if (Hint != (char *)1) pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); auto pButton = (GUIButton *)ptr_1C; - pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, pButton->pTextures[1]); + pRenderer->DrawTextureAlphaNew(uFrameX/640.0f, uFrameY/480.0f, pButton->pTextures[1]); viewparams->bRedrawGameUI = true; if (Hint && Hint != (char *)1) pButton->DrawLabel(Hint, pFontCreate, 0, 0); @@ -1527,7 +1521,7 @@ if (Hint != (char *)1) pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); auto pButton = (GUIButton *)ptr_1C; - pRenderer->DrawTextureIndexedAlpha(uFrameX, uFrameY, pButton->pTextures[0]); + pRenderer->DrawTextureAlphaNew(uFrameX/640.0f, uFrameY/480.0f, pButton->pTextures[0]); viewparams->bRedrawGameUI = true; if (Hint && Hint != (char *)1) pButton->DrawLabel(Hint, pFontCreate, 0, 0); @@ -1554,8 +1548,8 @@ GUIButton *pGUIButton; // ebp@146 //unsigned int pX; // [sp-1Ch] [bp-124h]@17 //unsigned int pY; // [sp-18h] [bp-120h]@17 - //Texture *pTexture; // [sp-14h] [bp-11Ch]@17 - //Texture *pTexture2; // [sp-14h] [bp-11Ch]@86 + //Texture_MM7 *pTexture; // [sp-14h] [bp-11Ch]@17 + //Texture_MM7 *pTexture2; // [sp-14h] [bp-11Ch]@86 int i; // [sp+0h] [bp-108h]@3 // ItemGen pItemGen; // [sp+4h] [bp-104h]@98 GUIButton GUIButton2; // [sp+28h] [bp-E0h]@133 @@ -1732,21 +1726,23 @@ game_ui_statusbar = assets->GetImage_PCXFromIconsLOD(L"IB-Foot-c.pcx"); game_ui_right_panel_frame = assets->GetImage_16BitAlpha(L"ib-mb-C"); - minimap_loop = assets->GetTexture("ib-autmask-c"); - _5079B4_compass = assets->GetTexture("IB-COMP-C"); - _5079D0_init_g = assets->GetTexture("IB-InitG-c"); - _5079C8_init_y = assets->GetTexture("IB-InitY-c"); - _5079CC_init_r = assets->GetTexture("IB-InitR-c"); + + game_ui_minimap_frame = assets->GetImage_16BitAlpha(L"ib-autmask-c"); + game_ui_minimap_compass = assets->GetImage_16BitColorKey(L"IB-COMP-C", 0x7FF); + + game_ui_player_alert_green = assets->GetImage_16BitAlpha(L"IB-InitG-c"); + game_ui_player_alert_yellow = assets->GetImage_16BitAlpha(L"IB-InitY-c"); + game_ui_player_alert_red = assets->GetImage_16BitAlpha(L"IB-InitR-c"); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-C", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-C", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-C", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-C", 2); + ui_btn_npc_left = assets->GetImage_16BitAlpha(L"IB-NPCLD-C"); + ui_btn_npc_right = assets->GetImage_16BitAlpha(L"IB-NPCRD-C"); + game_ui_btn_zoomin = assets->GetImage_16BitAlpha("ib-autout-C"); + game_ui_btn_zoomout = assets->GetImage_16BitAlpha("ib-autin-C"); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-C", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-c", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-c", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-c", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-c", 2); + game_ui_btn_cast = assets->GetImage_16BitAlpha("ib-m1d-c"); + game_ui_btn_rest = assets->GetImage_16BitAlpha("ib-m2d-c"); + game_ui_btn_quickref = assets->GetImage_16BitAlpha("ib-m3d-c"); + game_ui_btn_settings = assets->GetImage_16BitAlpha("ib-m4d-c"); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-c", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-c", 2); @@ -1759,8 +1755,8 @@ pIconsFrameTable->InitializeAnimation(pUIAnum_Torchlight->uIconID); ui_exit_cancel_button_background = assets->GetImage_16BitColorKey(L"ib-bcu-c", 0x7FF); - uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-c", TEXTURE_16BIT_PALETTE); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-c", 2); + + game_ui_evtnpc = assets->GetImage_16BitColorKey(L"evtnpc-c", 0x7FF); ui_character_inventory_background = assets->GetImage_16BitColorKey(L"fr_inven-c", 0x7FF); messagebox_corner_y = assets->GetImage_16BitAlpha(L"cornr_ll-c"); messagebox_corner_w = assets->GetImage_16BitAlpha(L"cornr_lr-c"); @@ -1781,28 +1777,28 @@ game_ui_statusbar = assets->GetImage_PCXFromIconsLOD(L"IB-Foot-c.pcx"); game_ui_right_panel_frame = assets->GetImage_16BitAlpha(L"ib-mb-C"); - minimap_loop = assets->GetTexture("ib-autmask-c"); - _5079B4_compass = assets->GetTexture("IB-COMP-C"); - _5079D0_init_g = assets->GetTexture("IB-InitG-c"); - _5079C8_init_y = assets->GetTexture("IB-InitY-c"); - _5079CC_init_r = assets->GetTexture("IB-InitR-c"); + game_ui_minimap_frame = assets->GetImage_16BitAlpha(L"ib-autmask-c"); + game_ui_minimap_compass = assets->GetImage_16BitColorKey(L"IB-COMP-C", 0x7FF); + game_ui_player_alert_green = assets->GetImage_16BitAlpha(L"IB-InitG-c"); + game_ui_player_alert_yellow = assets->GetImage_16BitAlpha(L"IB-InitY-c"); + game_ui_player_alert_red = assets->GetImage_16BitAlpha(L"IB-InitR-c"); - uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-C", TEXTURE_16BIT_PALETTE); - uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-C", TEXTURE_16BIT_PALETTE); - uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-C", TEXTURE_16BIT_PALETTE); - uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-C", TEXTURE_16BIT_PALETTE); + ui_btn_npc_left = assets->GetImage_16BitAlpha(L"IB-NPCLD-C"); + ui_btn_npc_right = assets->GetImage_16BitAlpha(L"IB-NPCRD-C"); + game_ui_btn_zoomin = assets->GetImage_16BitAlpha(L"ib-autout-C"); + game_ui_btn_zoomout = assets->GetImage_16BitAlpha(L"ib-autin-C"); uTextureID_GameUI_CharSelectionFrame = pIcons_LOD->LoadTexture("IB-selec-C", TEXTURE_16BIT_PALETTE); - uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-c", TEXTURE_16BIT_PALETTE); - uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-c", TEXTURE_16BIT_PALETTE); - uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-c", TEXTURE_16BIT_PALETTE); - uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-c", TEXTURE_16BIT_PALETTE); + game_ui_btn_cast = assets->GetImage_16BitAlpha(L"ib-m1d-c"); + game_ui_btn_rest = assets->GetImage_16BitAlpha("ib-m2d-c"); + game_ui_btn_quickref = assets->GetImage_16BitAlpha("ib-m3d-c"); + game_ui_btn_settings = assets->GetImage_16BitAlpha("ib-m4d-c"); ui_exit_cancel_button_background = assets->GetImage_16BitColorKey(L"ib-bcu-c", 0x7FF); - uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-c", TEXTURE_16BIT_PALETTE); + uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-c", TEXTURE_16BIT_PALETTE); uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-c", TEXTURE_16BIT_PALETTE); uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-c", TEXTURE_16BIT_PALETTE); uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-c", TEXTURE_16BIT_PALETTE); - uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc-c", TEXTURE_16BIT_PALETTE); + game_ui_evtnpc = assets->GetImage_16BitColorKey(L"evtnpc-c", 0x7FF); ui_character_inventory_background = assets->GetImage_16BitColorKey(L"fr_inven", 0x7FF); pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); @@ -1823,21 +1819,21 @@ game_ui_statusbar = assets->GetImage_PCXFromIconsLOD(L"IB-Foot-a.pcx"); game_ui_right_panel_frame = assets->GetImage_16BitAlpha(L"ib-mb-a"); - minimap_loop = assets->GetTexture("ib-autmask-a"); - _5079B4_compass = assets->GetTexture("IB-COMP-a"); - _5079D0_init_g = assets->GetTexture("IB-InitG-a"); - _5079C8_init_y = assets->GetTexture("IB-InitY-a"); - _5079CC_init_r = assets->GetTexture("IB-InitR-a"); + game_ui_minimap_frame = assets->GetImage_16BitAlpha(L"ib-autmask-a"); + game_ui_minimap_compass = assets->GetImage_16BitColorKey(L"IB-COMP-a", 0x7FF); + game_ui_player_alert_green = assets->GetImage_16BitAlpha(L"IB-InitG-a"); + game_ui_player_alert_yellow = assets->GetImage_16BitAlpha(L"IB-InitY-a"); + game_ui_player_alert_red = assets->GetImage_16BitAlpha(L"IB-InitR-a"); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-a", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-a", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-a", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-a", 2); + ui_btn_npc_left = assets->GetImage_16BitAlpha(L"IB-NPCLD-a"); + ui_btn_npc_right = assets->GetImage_16BitAlpha(L"IB-NPCRD-a"); + game_ui_btn_zoomin = assets->GetImage_16BitAlpha("ib-autout-a"); + game_ui_btn_zoomout = assets->GetImage_16BitAlpha("ib-autin-a"); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-a", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-a", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-a", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-a", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-a", 2); + game_ui_btn_cast = assets->GetImage_16BitAlpha("ib-m1d-a"); + game_ui_btn_rest = assets->GetImage_16BitAlpha("ib-m2d-a"); + game_ui_btn_quickref = assets->GetImage_16BitAlpha("ib-m3d-a"); + game_ui_btn_settings = assets->GetImage_16BitAlpha("ib-m4d-a"); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-a", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-a", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-a", 2); @@ -1846,9 +1842,10 @@ pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); + ui_exit_cancel_button_background = assets->GetImage_16BitColorKey(L"ib-bcu-a", 0x7FF); - uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-a", TEXTURE_16BIT_PALETTE); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc", 2); + + game_ui_evtnpc = assets->GetImage_16BitColorKey(L"evtnpc", 0x7FF); ui_character_inventory_background = assets->GetImage_16BitColorKey(L"fr_inven", 0x7FF); messagebox_corner_y = assets->GetImage_16BitAlpha(L"cornr_ll"); messagebox_corner_w = assets->GetImage_16BitAlpha(L"cornr_lr"); @@ -1869,28 +1866,28 @@ game_ui_statusbar = assets->GetImage_PCXFromIconsLOD(L"IB-Foot-a.pcx"); game_ui_right_panel_frame = assets->GetImage_16BitAlpha(L"ib-mb-A"); - minimap_loop = assets->GetTexture("ib-autmask-a"); - _5079B4_compass = assets->GetTexture("IB-COMP-A"); - _5079D0_init_g = assets->GetTexture("IB-InitG-a"); - _5079C8_init_y = assets->GetTexture("IB-InitY-a"); - _5079CC_init_r = assets->GetTexture("IB-InitR-a"); + game_ui_minimap_frame = assets->GetImage_16BitAlpha(L"ib-autmask-a"); + game_ui_minimap_compass = assets->GetImage_16BitColorKey(L"IB-COMP-A", 0x7FF); + game_ui_player_alert_green = assets->GetImage_16BitAlpha(L"IB-InitG-a"); + game_ui_player_alert_yellow = assets->GetImage_16BitAlpha(L"IB-InitY-a"); + game_ui_player_alert_red = assets->GetImage_16BitAlpha(L"IB-InitR-a"); - uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-A", TEXTURE_16BIT_PALETTE); - uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-A", TEXTURE_16BIT_PALETTE); + ui_btn_npc_left = assets->GetImage_16BitAlpha(L"IB-NPCLD-A"); + ui_btn_npc_right = assets->GetImage_16BitAlpha(L"IB-NPCRD-A"); uTextureID_GameUI_CharSelectionFrame = pIcons_LOD->LoadTexture("IB-selec-A", TEXTURE_16BIT_PALETTE); - uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-a", TEXTURE_16BIT_PALETTE); - uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-a", TEXTURE_16BIT_PALETTE); - uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-a", TEXTURE_16BIT_PALETTE); - uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-a", TEXTURE_16BIT_PALETTE); - uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-a", TEXTURE_16BIT_PALETTE); - uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-a", TEXTURE_16BIT_PALETTE); + game_ui_btn_cast = assets->GetImage_16BitAlpha("ib-m1d-a"); + game_ui_btn_rest = assets->GetImage_16BitAlpha("ib-m2d-a"); + game_ui_btn_quickref = assets->GetImage_16BitAlpha("ib-m3d-a"); + game_ui_btn_settings = assets->GetImage_16BitAlpha("ib-m4d-a"); + game_ui_btn_zoomin = assets->GetImage_16BitAlpha("ib-autout-a"); + game_ui_btn_zoomout = assets->GetImage_16BitAlpha("ib-autin-a"); ui_exit_cancel_button_background = assets->GetImage_16BitColorKey(L"ib-bcu-a", 0x7FF); - uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-a", TEXTURE_16BIT_PALETTE); + uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-a", TEXTURE_16BIT_PALETTE); uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-a", TEXTURE_16BIT_PALETTE); uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-a", TEXTURE_16BIT_PALETTE); uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-a", TEXTURE_16BIT_PALETTE); - uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc", TEXTURE_16BIT_PALETTE); + game_ui_evtnpc = assets->GetImage_16BitColorKey(L"evtnpc", 0x7FF); ui_character_inventory_background = assets->GetImage_16BitColorKey(L"fr_inven", 0x7FF); pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); @@ -1920,21 +1917,21 @@ game_ui_statusbar = assets->GetImage_PCXFromIconsLOD(L"IB-Foot-b.pcx"); game_ui_right_panel_frame = assets->GetImage_16BitAlpha(L"ib-mb-B"); - minimap_loop = assets->GetTexture("ib-autmask-b"); - _5079B4_compass = assets->GetTexture("IB-COMP-B"); - _5079D0_init_g = assets->GetTexture("IB-InitG-b"); - _5079C8_init_y = assets->GetTexture("IB-InitY-b"); - _5079CC_init_r = assets->GetTexture("IB-InitR-b"); + game_ui_minimap_frame = assets->GetImage_16BitAlpha(L"ib-autmask-b"); + game_ui_minimap_compass = assets->GetImage_16BitColorKey(L"IB-COMP-B", 0x7FF); + game_ui_player_alert_green = assets->GetImage_16BitAlpha(L"IB-InitG-b"); + game_ui_player_alert_yellow = assets->GetImage_16BitAlpha(L"IB-InitY-b"); + game_ui_player_alert_red = assets->GetImage_16BitAlpha(L"IB-InitR-b"); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-B", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-B", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-B", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-B", 2); + ui_btn_npc_left = assets->GetImage_16BitAlpha(L"IB-NPCLD-B"); + ui_btn_npc_right = assets->GetImage_16BitAlpha(L"IB-NPCRD-B"); + game_ui_btn_zoomin = assets->GetImage_16BitAlpha("ib-autout-B"); + game_ui_btn_zoomout = assets->GetImage_16BitAlpha("ib-autin-B"); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-B", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-b", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-b", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-b", 2); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-b", 2); + game_ui_btn_cast = assets->GetImage_16BitAlpha("ib-m1d-b"); + game_ui_btn_rest = assets->GetImage_16BitAlpha("ib-m2d-b"); + game_ui_btn_quickref = assets->GetImage_16BitAlpha("ib-m3d-b"); + game_ui_btn_settings = assets->GetImage_16BitAlpha("ib-m4d-b"); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-b", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-b", 2); pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-b", 2); @@ -1944,8 +1941,8 @@ pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchB"); pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); ui_exit_cancel_button_background = assets->GetImage_16BitColorKey(L"ib-bcu-b", 0x7FF); - uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-b", TEXTURE_16BIT_PALETTE); - pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-b", 2); + + game_ui_evtnpc = assets->GetImage_16BitColorKey(L"evtnpc-b", 0x7FF); ui_character_inventory_background = assets->GetImage_16BitColorKey(L"fr_inven-b", 0x7FF); messagebox_corner_y = assets->GetImage_16BitAlpha(L"cornr_ll-b"); messagebox_corner_w = assets->GetImage_16BitAlpha(L"cornr_lr-b"); @@ -2084,7 +2081,7 @@ } //----- (0040F92A) -------------------------------------------------------- -void __fastcall ZBuffer_DoFill2(int *pZBuffer, Texture *a2, int a3) +void __fastcall ZBuffer_DoFill2(int *pZBuffer, Texture_MM7 *a2, int a3) {//срабатывает в покупке в магазине void *v4; // eax@3 //int *v5; // edi@5 @@ -2123,7 +2120,7 @@ } //----- (0040F89C) -------------------------------------------------------- -void __fastcall ZBuffer_DoFill(int *pZBuffer, Texture *pTex, int uZValue) +void __fastcall ZBuffer_DoFill(int *pZBuffer, Texture_MM7 *pTex, int uZValue) {//срабатывает при продаже в магазине void *v3; // eax@3 //void *v4; // esi@5 @@ -2651,7 +2648,7 @@ pDialogueWindow->Release(); pDialogueWindow = new GUIWindow(0, 0, window->GetWidth(), 350, a4, 0); pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, - pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uExitCancelTextureId), 0); + pGlobalTXT_LocalizationStrings[34], ui_exit_cancel_button_background, 0); pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); v2 = ""; if (contract_approved) @@ -2763,7 +2760,7 @@ pDialogueWindow->Release(); pDialogueWindow = new GUIWindow(0, 0, window->GetWidth(), 350, 0, 0); pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34],// "Cancel" - pIcons_LOD->GetTexture(uExitCancelTextureId), 0); + ui_exit_cancel_button_background, 0); pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); pDialogueWindow->CreateButton(480, 160, 140, 30, 1, 0, UIMSG_0, 83, 0, "", 0); pDialogueWindow->_41D08F_set_keyboard_control_group(1, 1, 0, 2);
--- a/GUI/GUIWindow.h Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/GUIWindow.h Mon Mar 07 03:48:40 2016 +0200 @@ -318,7 +318,7 @@ }; struct GUIButton; -struct Texture; +struct Texture_MM7; #define WINDOW_INPUT_NONE 0 @@ -335,7 +335,8 @@ virtual ~GUIWindow() {} GUIButton *CreateButton(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, int a6, int a7, - UIMessageType msg, unsigned int msg_param, unsigned __int8 uHotkey, const char *pName, struct Texture *pTextures, ...); + UIMessageType msg, unsigned int msg_param, unsigned __int8 uHotkey, const char *pName, + struct Image *pTextures, ...); void DrawFlashingInputCursor(signed int uX, int uY, struct GUIFont *a2); int DrawTextInRect(GUIFont *pFont, unsigned int uX, unsigned int uY, unsigned int uColor, const char *text, int rect_width, int reverse_text); void DrawText(GUIFont *a2, signed int uX, int uY, unsigned short uFontColor, const char *Str, bool present_time_transparency, int max_text_height, signed int uFontShadowColor); @@ -682,7 +683,6 @@ void CreateAwardsScrollBar(); void ReleaseAwardsScrollBar(); void Inventory_ItemPopupAndAlchemy(); -void LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer); unsigned int UI_GetHealthManaAndOtherQualitiesStringColor(signed int current_pos, signed int base_pos); unsigned int __fastcall GetSizeInInventorySlots(unsigned int uNumPixels); struct GUIButton *__fastcall GUI_HandleHotkey(unsigned __int8 uHotkey); // idb @@ -713,8 +713,8 @@ void __fastcall ZBuffer_Fill(int *pZBuffer, int uTextureId, int iZValue); -void __fastcall ZBuffer_DoFill(int *pZBuffer, struct Texture *pTex, int uZValue); -void __fastcall ZBuffer_DoFill2(int *pZBuffer, struct Texture *a2, int a3); // idb +void __fastcall ZBuffer_DoFill(int *pZBuffer, struct Texture_MM7 *pTex, int uZValue); +void __fastcall ZBuffer_DoFill2(int *pZBuffer, struct Texture_MM7 *a2, int a3); // idb @@ -732,6 +732,12 @@ #pragma pack(push, 1) struct GUIButton { + GUIButton() + { + for (unsigned int i = 0; i < 5; ++i) + pTextures[i] = nullptr; + } + void DrawLabel(const char *label_text, struct GUIFont *pFont, int a5, int uFontShadowColor); void Release(); @@ -752,7 +758,7 @@ GUIButton *pPrev; GUIButton *pNext; struct GUIWindow *pParent; - struct Texture *pTextures[5]; + struct Image *pTextures[5]; unsigned int uNumTextures; unsigned __int8 uHotkey; char pButtonName[32]; @@ -920,4 +926,22 @@ extern class Image *ui_exit_cancel_button_background; extern class Image *game_ui_right_panel_frame; -extern unsigned int uExitCancelTextureId; \ No newline at end of file +extern class Image *dialogue_ui_x_ok_u; +extern class Image *dialogue_ui_x_x_u; + +extern class Image *ui_buttdesc2; +extern class Image *ui_buttyes2; + +extern class Image *ui_btn_npc_right; +extern class Image *ui_btn_npc_left; + +extern class Image *ui_ar_dn_dn; +extern class Image *ui_ar_dn_up; +extern class Image *ui_ar_up_dn; +extern class Image *ui_ar_up_up; + +extern class Image *ui_leather_mm6; +extern class Image *ui_leather_mm7; + +//extern unsigned int 507C20_gamma_slider_left_texid; // 507C20 +//extern unsigned int 507C24_gamma_slider_right_texid; // 507C24 \ No newline at end of file
--- a/GUI/UI/Books/AutonotesBook.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/Books/AutonotesBook.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -1,4 +1,5 @@ #include "Engine/Engine.h" +#include "Engine/AssetsManager.h" #include "Engine/LOD.h" #include "Engine/Party.h" #include "Engine/Timer.h" @@ -13,6 +14,11 @@ #include "Media/Audio/AudioPlayer.h" + + +Image *ui_book_autonotes_background = nullptr; + + GUIWindow_AutonotesBook::GUIWindow_AutonotesBook() : GUIWindow_Book() { @@ -28,56 +34,57 @@ // ---------------------------------------------- // 00411BFC GUIWindow::InitializeBookView -- part - pTexture_AutonotesBook = pIcons_LOD->LoadTexturePtr("sbautnot", TEXTURE_16BIT_PALETTE); - pSpellBookPagesTextr_10 = pIcons_LOD->LoadTexturePtr("divbar", TEXTURE_16BIT_PALETTE); - pTex_book_button1_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); - pTex_book_button2_on = pIcons_LOD->LoadTexturePtr("tab-an-7b", TEXTURE_16BIT_PALETTE); - pTex_book_button1_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); - pTex_book_button2_off = pIcons_LOD->LoadTexturePtr("tab-an-7a", TEXTURE_16BIT_PALETTE); - pTex_book_button3_on = pIcons_LOD->LoadTexturePtr("tab-an-1b", TEXTURE_16BIT_PALETTE); - pTex_book_button3_off = pIcons_LOD->LoadTexturePtr("tab-an-1a", TEXTURE_16BIT_PALETTE); - pTex_book_button4_on = pIcons_LOD->LoadTexturePtr("tab-an-2b", TEXTURE_16BIT_PALETTE); - pTex_book_button4_off = pIcons_LOD->LoadTexturePtr("tab-an-2a", TEXTURE_16BIT_PALETTE); - pTex_book_button5_on = pIcons_LOD->LoadTexturePtr("tab-an-3b", TEXTURE_16BIT_PALETTE); - pTex_book_button5_off = pIcons_LOD->LoadTexturePtr("tab-an-3a", TEXTURE_16BIT_PALETTE); - pTex_book_button6_on = pIcons_LOD->LoadTexturePtr("tab-an-5b", TEXTURE_16BIT_PALETTE); - pTex_book_button6_off = pIcons_LOD->LoadTexturePtr("tab-an-5a", TEXTURE_16BIT_PALETTE); - pTex_book_button7_on = pIcons_LOD->LoadTexturePtr("tab-an-4b", TEXTURE_16BIT_PALETTE); - pTex_book_button7_off = pIcons_LOD->LoadTexturePtr("tab-an-4a", TEXTURE_16BIT_PALETTE); - pTex_book_button8_on = pIcons_LOD->LoadTexturePtr("tab-an-8b", TEXTURE_16BIT_PALETTE); - pTex_book_button8_off = pIcons_LOD->LoadTexturePtr("tab-an-8a", TEXTURE_16BIT_PALETTE); + ui_book_autonotes_background = assets->GetImage_16BitColorKey(L"sbautnot", 0x7FF); + ui_book_quest_div_bar = assets->GetImage_16BitAlpha(L"divbar"); + + ui_book_button1_on = assets->GetImage_16BitAlpha(L"tab-an-6b"); + ui_book_button2_on = assets->GetImage_16BitAlpha(L"tab-an-7b"); + ui_book_button3_on = assets->GetImage_16BitAlpha(L"tab-an-1b"); + ui_book_button4_on = assets->GetImage_16BitAlpha(L"tab-an-2b"); + ui_book_button5_on = assets->GetImage_16BitAlpha(L"tab-an-3b"); + ui_book_button6_on = assets->GetImage_16BitAlpha(L"tab-an-5b"); + ui_book_button7_on = assets->GetImage_16BitAlpha(L"tab-an-4b"); + ui_book_button8_on = assets->GetImage_16BitAlpha(L"tab-an-8b"); + ui_book_button1_off = assets->GetImage_16BitAlpha(L"tab-an-6a"); + ui_book_button2_off = assets->GetImage_16BitAlpha(L"tab-an-7a"); + ui_book_button3_off = assets->GetImage_16BitAlpha(L"tab-an-1a"); + ui_book_button4_off = assets->GetImage_16BitAlpha(L"tab-an-2a"); + ui_book_button5_off = assets->GetImage_16BitAlpha(L"tab-an-3a"); + ui_book_button6_off = assets->GetImage_16BitAlpha(L"tab-an-5a"); + ui_book_button7_off = assets->GetImage_16BitAlpha(L"tab-an-4a"); + ui_book_button8_off = assets->GetImage_16BitAlpha(L"tab-an-8a"); pBtn_Book_1 = CreateButton( pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, 50, 34, 1, 0, - UIMSG_ClickBooksBtn, 11, 0, pGlobalTXT_LocalizationStrings[193], pTex_book_button1_on, 0 + UIMSG_ClickBooksBtn, 11, 0, pGlobalTXT_LocalizationStrings[193], ui_book_button1_on, 0 ); pBtn_Book_2 = CreateButton( pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, 50, 34, 1, 0, - UIMSG_ClickBooksBtn, 10, 0, pGlobalTXT_LocalizationStrings[192], pTex_book_button2_on, 0 + UIMSG_ClickBooksBtn, 10, 0, pGlobalTXT_LocalizationStrings[192], ui_book_button2_on, 0 ); pBtn_Book_3 = CreateButton( pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, 50, 34, 1, 0, - UIMSG_ClickBooksBtn, 2, 0, pGlobalTXT_LocalizationStrings[85], pTex_book_button3_on, 0 + UIMSG_ClickBooksBtn, 2, 0, pGlobalTXT_LocalizationStrings[85], ui_book_button3_on, 0 ); // "Potion Notes" pBtn_Book_4 = CreateButton( pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, 50, 34, 1, 0, - UIMSG_ClickBooksBtn, 3, 0, pGlobalTXT_LocalizationStrings[137], pTex_book_button4_on, 0 + UIMSG_ClickBooksBtn, 3, 0, pGlobalTXT_LocalizationStrings[137], ui_book_button4_on, 0 ); // "Fountain Notes" pBtn_Book_5 = CreateButton( pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, 50, 34, 1, 0, - UIMSG_ClickBooksBtn, 4, 0, pGlobalTXT_LocalizationStrings[8], pTex_book_button5_on, 0 + UIMSG_ClickBooksBtn, 4, 0, pGlobalTXT_LocalizationStrings[8], ui_book_button5_on, 0 ); // "Obelisk Notes" pBtn_Book_6 = CreateButton( pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, 50, 34, 1, 0, - UIMSG_ClickBooksBtn, 5, 0, pGlobalTXT_LocalizationStrings[141], pTex_book_button6_on, 0 + UIMSG_ClickBooksBtn, 5, 0, pGlobalTXT_LocalizationStrings[141], ui_book_button6_on, 0 ); // "Seer Notes" pBtn_Autonotes_Misc = CreateButton( pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 264, 50, 34, 1, 0, - UIMSG_ClickBooksBtn, 6, 0, pGlobalTXT_LocalizationStrings[123], pTex_book_button7_on, 0 + UIMSG_ClickBooksBtn, 6, 0, pGlobalTXT_LocalizationStrings[123], ui_book_button7_on, 0 ); // "Miscellaneous Notes" pBtn_Autonotes_Instructors = CreateButton( pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 302, 50, 34, 1, 0, - UIMSG_ClickBooksBtn, 7, 0, pGlobalTXT_LocalizationStrings[662], pTex_book_button8_on, 0 + UIMSG_ClickBooksBtn, 7, 0, pGlobalTXT_LocalizationStrings[662], ui_book_button8_on, 0 ); // "Instructors" int num_achieved_awards = 0; @@ -123,135 +130,135 @@ GUIWindow autonotes_window; // [sp+14h] [bp-54h]@46 change_flag = false; - pRenderer->DrawTextureTransparentColorKey(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_AutonotesBook); + pRenderer->DrawTextureAlphaNew(pViewport->uViewportTL_X/640.0f, pViewport->uViewportTL_Y/480.0f, ui_book_autonotes_background); if (BtnUp_flag || !books_primary_item_per_page) - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 2, pTex_book_button1_off); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 407)/640.0f, (pViewport->uViewportTL_Y + 2)/480.0f, ui_book_button1_off); else - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, pTex_book_button1_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 398)/640.0f, (pViewport->uViewportTL_Y + 1)/480.0f, ui_book_button1_on); if (BtnDown_flag || books_primary_item_per_page + num_achieved_awards >= full_num_items_in_book) - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 38, pTex_book_button2_off); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 407)/640.0f, (pViewport->uViewportTL_Y + 38)/480.0f, ui_book_button2_off); else - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, pTex_book_button2_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 398)/640.0f, (pViewport->uViewportTL_Y + 38)/480.0f, ui_book_button2_on); if (Book_PageBtn3_flag)//Potions_page_flag { if (_506568_autonote_type == AUTONOTE_POTION_RECEPIE)//press again(повторное нажатие) - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, pTex_book_button3_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 398)/640.0f, (pViewport->uViewportTL_Y + 113)/480.0f, ui_book_button3_on); else//press(нажатие) { change_flag = true; pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); _506568_autonote_type = AUTONOTE_POTION_RECEPIE; - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, pTex_book_button3_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 398)/640.0f, (pViewport->uViewportTL_Y + 113)/480.0f, ui_book_button3_on); } } else { if (_506568_autonote_type == AUTONOTE_POTION_RECEPIE)// default(по умолчанию при запуске окна) - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, pTex_book_button3_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 398)/640.0f, (pViewport->uViewportTL_Y + 113)/480.0f, ui_book_button3_on); else//Potions_page not active(вкладка снадобья не активна) - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 113, pTex_book_button3_off); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 408)/640.0f, (pViewport->uViewportTL_Y + 113)/480.0f, ui_book_button3_off); } if (Book_PageBtn4_flag)//Fontains_page_flag { if (_506568_autonote_type == AUTONOTE_STAT_HINT) - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, pTex_book_button4_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 399)/640.0f, (pViewport->uViewportTL_Y + 150)/480.0f, ui_book_button4_on); else { change_flag = true; pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); _506568_autonote_type = AUTONOTE_STAT_HINT; - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, pTex_book_button4_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 399)/640.0f, (pViewport->uViewportTL_Y + 150)/480.0f, ui_book_button4_on); } } else { if (_506568_autonote_type == AUTONOTE_STAT_HINT) - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, pTex_book_button4_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 399)/640.0f, (pViewport->uViewportTL_Y + 150)/480.0f, ui_book_button4_on); else - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 150, pTex_book_button4_off); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 408)/640.0f, (pViewport->uViewportTL_Y + 150)/480.0f, ui_book_button4_off); } if (Book_PageBtn5_flag)//Autonotes_Obelisks_page_flag { if (_506568_autonote_type == AUTONOTE_OBELISK) - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, pTex_book_button5_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 397)/640.0f, (pViewport->uViewportTL_Y + 188)/480.0f, ui_book_button5_on); else { change_flag = true; pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); _506568_autonote_type = AUTONOTE_OBELISK; - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, pTex_book_button5_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 397)/640.0f, (pViewport->uViewportTL_Y + 188)/480.0f, ui_book_button5_on); } } else { if (_506568_autonote_type == AUTONOTE_OBELISK) - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, pTex_book_button5_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 397)/640.0f, (pViewport->uViewportTL_Y + 188)/480.0f, ui_book_button5_on); else - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 188, pTex_book_button5_off); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 408)/640.0f, (pViewport->uViewportTL_Y + 188)/480.0f, ui_book_button5_off); } if (Book_PageBtn6_flag)//Autonotes_Seer_page_flag { if (_506568_autonote_type == AUTONOTE_SEER) - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, pTex_book_button6_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 397)/640.0f, (pViewport->uViewportTL_Y + 226)/480.0f, ui_book_button6_on); else { change_flag = true; pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); _506568_autonote_type = AUTONOTE_SEER; - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, pTex_book_button6_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 397)/640.0f, (pViewport->uViewportTL_Y + 226)/480.0f, ui_book_button6_on); } } else { if (_506568_autonote_type == AUTONOTE_SEER) - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, pTex_book_button6_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 397)/640.0f, (pViewport->uViewportTL_Y + 226)/480.0f, ui_book_button6_on); else - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 226, pTex_book_button6_off); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 408)/640.0f, (pViewport->uViewportTL_Y + 226)/480.0f, ui_book_button6_off); } if (Autonotes_Misc_page_flag) { if (_506568_autonote_type == AUTONOTE_MISC) - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 264, pTex_book_button7_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 397)/640.0f, (pViewport->uViewportTL_Y + 264)/480.0f, ui_book_button7_on); else { change_flag = true; pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); _506568_autonote_type = AUTONOTE_MISC; - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 264, pTex_book_button7_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 397)/640.0f, (pViewport->uViewportTL_Y + 264)/480.0f, ui_book_button7_on); } } else { if (_506568_autonote_type == AUTONOTE_MISC) - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 264, pTex_book_button7_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 397)/640.0f, (pViewport->uViewportTL_Y + 264)/480.0f, ui_book_button7_on); else - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 263, pTex_book_button7_off); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 408)/640.0f, (pViewport->uViewportTL_Y + 263)/480.0f, ui_book_button7_off); } if (Autonotes_Instructors_page_flag) { if (_506568_autonote_type == AUTONOTE_TEACHER) - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 302, pTex_book_button8_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 397)/640.0f, (pViewport->uViewportTL_Y + 302)/480.0f, ui_book_button8_on); else { change_flag = true; pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); _506568_autonote_type = AUTONOTE_TEACHER; - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 302, pTex_book_button8_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 397)/640.0f, (pViewport->uViewportTL_Y + 302)/480.0f, ui_book_button8_on); } } else { if (_506568_autonote_type == AUTONOTE_TEACHER) - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 302, pTex_book_button8_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 397)/640.0f, (pViewport->uViewportTL_Y + 302)/480.0f, ui_book_button8_on); else - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 302, pTex_book_button8_off); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 408)/640.0f, (pViewport->uViewportTL_Y + 302)/480.0f, ui_book_button8_off); } //for title @@ -325,7 +332,9 @@ pTextHeight = pAutonoteFont->CalcTextHeight(pAutonoteTxt[achieved_awards[i]].pText, &autonotes_window, 1, 0); if ((signed int)(autonotes_window.uFrameY + pTextHeight) > (signed int)autonotes_window.uFrameHeight) break; - pRenderer->DrawTextureIndexedAlpha(100, (autonotes_window.uFrameY + pTextHeight) + 12, pSpellBookPagesTextr_10); + + pRenderer->DrawTextureAlphaNew(100/640.0f, ((autonotes_window.uFrameY + pTextHeight) + 12)/480.0f, ui_book_quest_div_bar); + autonotes_window.uFrameY = (autonotes_window.uFrameY + pTextHeight) + 24; } } \ No newline at end of file
--- a/GUI/UI/Books/CalendarBook.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/Books/CalendarBook.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -13,6 +13,14 @@ +Image *ui_book_calendar_background = nullptr; + +Image *ui_book_calendar_moon_new = nullptr; +Image *ui_book_calendar_moon_4 = nullptr; +Image *ui_book_calendar_moon_2 = nullptr; +Image *ui_book_calendar_moon_2_2 = nullptr; +Image *ui_book_calendar_moon_full = nullptr; + GUIWindow_CalendarBook::GUIWindow_CalendarBook() : GUIWindow_Book() { @@ -27,12 +35,12 @@ // ---------------------------------------------- // 00411BFC GUIWindow::InitializeBookView -- part - pSpellBookPagesTextr_13 = pIcons_LOD->LoadTexturePtr("sbdate-time", TEXTURE_16BIT_PALETTE); - pTex_moon_new = pIcons_LOD->LoadTexturePtr("moon_new", TEXTURE_16BIT_PALETTE); - pTex_moon_4 = pIcons_LOD->LoadTexturePtr("moon_4", TEXTURE_16BIT_PALETTE); - pTex_moon_2 = pIcons_LOD->LoadTexturePtr("moon_2", TEXTURE_16BIT_PALETTE); - pTex_moon_2_2 = pIcons_LOD->LoadTexturePtr("moon_2", TEXTURE_16BIT_PALETTE); - pTex_moon_ful = pIcons_LOD->LoadTexturePtr("moon_ful", TEXTURE_16BIT_PALETTE); + ui_book_calendar_background = assets->GetImage_16BitColorKey(L"sbdate-time", 0x7FF); + ui_book_calendar_moon_new = assets->GetImage_16BitColorKey("moon_new", 0x7FF); + ui_book_calendar_moon_4 = assets->GetImage_16BitColorKey("moon_4", 0x7FF); + ui_book_calendar_moon_2 = assets->GetImage_16BitColorKey("moon_2", 0x7FF); + ui_book_calendar_moon_2_2 = assets->GetImage_16BitColorKey("moon_2", 0x7FF); + ui_book_calendar_moon_full = assets->GetImage_16BitColorKey("moon_ful", 0x7FF); } @@ -87,7 +95,7 @@ 1, 1, 1, 1 }; - pRenderer->DrawTextureTransparentColorKey(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_13); + pRenderer->DrawTextureAlphaNew(pViewport->uViewportTL_X/640.0f, pViewport->uViewportTL_Y/480.0f, ui_book_calendar_background); pHour = pParty->uCurrentHour; if ((signed int)pHour >= 12) {
--- a/GUI/UI/Books/JournalBook.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/Books/JournalBook.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -1,4 +1,5 @@ #include "Engine/Engine.h" +#include "Engine/AssetsManager.h" #include "Engine/LOD.h" #include "Engine/Party.h" #include "Engine/Timer.h" @@ -14,6 +15,8 @@ #include "Media/Audio/AudioPlayer.h" +Image *ui_book_journal_background = nullptr; + GUIWindow_JournalBook::GUIWindow_JournalBook() : GUIWindow_Book() @@ -35,18 +38,19 @@ unsigned int page_count; // esi@12 GUIWindow journal_window; // [sp+18h] [bp-54h]@8 - pSpellBookPagesTextr_11 = pIcons_LOD->LoadTexturePtr("sbplayrnot", TEXTURE_16BIT_PALETTE); - pTex_book_button1_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); - pTex_book_button2_on = pIcons_LOD->LoadTexturePtr("tab-an-7b", TEXTURE_16BIT_PALETTE); - pTex_book_button1_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); - pTex_book_button2_off = pIcons_LOD->LoadTexturePtr("tab-an-7a", TEXTURE_16BIT_PALETTE); + ui_book_journal_background = assets->GetImage_16BitColorKey(L"sbplayrnot", 0x7FF); + + ui_book_button1_on = assets->GetImage_16BitAlpha(L"tab-an-6b"); + ui_book_button2_on = assets->GetImage_16BitAlpha(L"tab-an-7b"); + ui_book_button1_off = assets->GetImage_16BitAlpha(L"tab-an-6a"); + ui_book_button2_off = assets->GetImage_16BitAlpha(L"tab-an-7a"); pBtn_Book_1 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, - pTex_book_button1_on->uTextureWidth, pTex_book_button1_on->uTextureHeight, 1, 0, - UIMSG_ClickBooksBtn, 11, 0, pGlobalTXT_LocalizationStrings[192], pTex_book_button1_on, 0); - pBtn_Book_2 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, pTex_book_button2_on->uTextureHeight, - pTex_book_button2_on->uTextureHeight, 1, 0, UIMSG_ClickBooksBtn, 10, 0, - pGlobalTXT_LocalizationStrings[193], pTex_book_button2_on, 0); + ui_book_button1_on->GetWidth(), ui_book_button1_on->GetHeight(), 1, 0, + UIMSG_ClickBooksBtn, 11, 0, pGlobalTXT_LocalizationStrings[192], ui_book_button1_on, 0); + pBtn_Book_2 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, + ui_book_button2_on->GetWidth(), ui_book_button2_on->GetHeight(), 1, 0, UIMSG_ClickBooksBtn, 10, 0, + pGlobalTXT_LocalizationStrings[193], ui_book_button2_on, 0); num_achieved_awards = 0; journal_window.uFrameX = 48; @@ -103,16 +107,16 @@ char* pStringOnPage; // eax@22 GUIWindow journal_window; // [sp+8h] [bp-54h]@10 - pRenderer->DrawTextureTransparentColorKey(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_11); + pRenderer->DrawTextureAlphaNew(pViewport->uViewportTL_X/640.0f, pViewport->uViewportTL_Y/480.0f, ui_book_journal_background); if (BtnUp_flag || !books_primary_item_per_page) - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 2, pTex_book_button1_off); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 407)/640.0f, (pViewport->uViewportTL_Y + 2)/480.0f, ui_book_button1_off); else - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, pTex_book_button1_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 398)/640.0f, (pViewport->uViewportTL_Y + 1)/480.0f, ui_book_button1_on); if (BtnDown_flag || books_primary_item_per_page + num_achieved_awards >= full_num_items_in_book) - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 38, pTex_book_button2_off); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 407)/640.0f, (pViewport->uViewportTL_Y + 38)/480.0f, ui_book_button2_off); else - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, pTex_book_button2_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 398)/640.0f, (pViewport->uViewportTL_Y + 38)/480.0f, ui_book_button2_on); if (!Journal_limitation_factor[books_primary_item_per_page])//for title {
--- a/GUI/UI/Books/LloydsBook.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/Books/LloydsBook.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -1,4 +1,5 @@ #include "Engine/Engine.h" +#include "Engine/SaveLoad.h" #include "Engine/LOD.h" #include "Engine/Party.h" #include "Engine/texts.h" @@ -13,6 +14,12 @@ std::array<unsigned int, 5> pLloydsBeacons_SomeXs = { { 59, 279, 59, 279, 169 } }; std::array<unsigned int, 5> pLloydsBeacons_SomeYs = { { 82, 82, 226, 226, 153 } }; + +bool _506360_installing_beacon; // 506360 + +Image *ui_book_lloyds_border = nullptr; +std::array<Image *, 2> ui_book_lloyds_backgrounds; + GUIWindow_LloydsBook::GUIWindow_LloydsBook() : GUIWindow_Book() { @@ -21,12 +28,14 @@ // ---------------------------------------------- // 00411BFC GUIWindow::InitializeBookView -- part - byte_506360 = 0; - pTexture_CurrentBook = pIcons_LOD->LoadTexturePtr("lb_bordr", TEXTURE_16BIT_PALETTE); - pTexture_LloydBeacons[0] = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE); - pTexture_LloydBeacons[1] = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE); - pTex_book_button1_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); - pTex_book_button1_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); + _506360_installing_beacon = false; + if (!ui_book_lloyds_border) + ui_book_lloyds_border = assets->GetImage_16BitColorKey("lb_bordr", 0x7FF); + + ui_book_lloyds_backgrounds[0] = assets->GetImage_16BitColorKey(L"sbmap", 0x7FF); + ui_book_lloyds_backgrounds[1] = assets->GetImage_16BitColorKey(L"sbmap", 0x7FF); + ui_book_button1_on = assets->GetImage_16BitAlpha(L"tab-an-6b"); + ui_book_button1_off = assets->GetImage_16BitAlpha(L"tab-an-6a"); pBtn_Book_1 = CreateButton(415, 13, 39, 36, 1, 0, UIMSG_LloydsBeacon_FlippingBtn, 0, 0, pGlobalTXT_LocalizationStrings[375], 0); // Set Beacon pBtn_Book_2 = CreateButton(415, 48, 39, 36, 1, 0, UIMSG_LloydsBeacon_FlippingBtn, 1, 0, pGlobalTXT_LocalizationStrings[523], 0); // Recall Beacon @@ -78,14 +87,13 @@ unsigned int pHours; // esi@14 unsigned int pDays; // eax@14 const char *pSelectionText; // eax@19 - Texture *v19; // [sp-4h] [bp-8Ch]@4 GUIWindow pWindow; // [sp+Ch] [bp-7Ch]@1 char *Str; // [sp+74h] [bp-14h]@14 int BeaconID; // [sp+78h] [bp-10h]@11 int uNumMaxBeacons; // [sp+84h] [bp-4h]@6 pPlayer = &pParty->pPlayers[_506348_current_lloyd_playerid]; - pRenderer->DrawTextureTransparentColorKey(8, 8, pTexture_LloydBeacons[(unsigned __int8)bRecallingBeacon]); + pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, ui_book_lloyds_backgrounds[bRecallingBeacon ? 1 : 0]); pText = pGlobalTXT_LocalizationStrings[523]; // Recall Beacon pWindow.uFrameX = game_viewport_x; pWindow.uFrameY = game_viewport_y; @@ -99,15 +107,14 @@ pWindow.DrawTitleText(pBook2Font, 0, 22, 0, pTmpBuf.data(), 3); if (bRecallingBeacon) { - pRenderer->DrawTextureIndexedAlpha(pBtn_Book_1->uX, pBtn_Book_1->uY, pTex_book_button1_on); - v19 = pTex_book_button1_off; + pRenderer->DrawTextureAlphaNew(pBtn_Book_1->uX/640.0f, pBtn_Book_1->uY/480.0f, ui_book_button1_on); + pRenderer->DrawTextureAlphaNew(pBtn_Book_2->uX/640.0f, pBtn_Book_2->uY/480.0f, ui_book_button1_off); } else { - pRenderer->DrawTextureIndexedAlpha(pBtn_Book_1->uX, pBtn_Book_1->uY, pTex_book_button1_off); - v19 = pTex_book_button1_on; + pRenderer->DrawTextureAlphaNew(pBtn_Book_1->uX/640.0f, pBtn_Book_1->uY/480.0f, ui_book_button1_off); + pRenderer->DrawTextureAlphaNew(pBtn_Book_2->uX/640.0f, pBtn_Book_2->uY/480.0f, ui_book_button1_on); } - pRenderer->DrawTextureIndexedAlpha(pBtn_Book_2->uX, pBtn_Book_2->uY, v19); uNumMaxBeacons = 1; if (HIBYTE(pPlayer->pActiveSkills[PLAYER_SKILL_WATER]) & 1 || (pPlayer->pActiveSkills[PLAYER_SKILL_WATER] & 0x80u) != 0) { @@ -131,7 +138,7 @@ //if ( pSavegameThumbnails[BeaconID].pPixels != 0 ) if (pPlayer->pInstalledBeacons[BeaconID].SaveFileID != 0) { - pRenderer->DrawTextureIndexedAlpha(pLloydsBeacons_SomeXs[BeaconID], pLloydsBeacons_SomeYs[BeaconID], pTexture_CurrentBook); + pRenderer->DrawTextureAlphaNew(pLloydsBeacons_SomeXs[BeaconID]/640.0f, pLloydsBeacons_SomeYs[BeaconID]/480.0f, ui_book_lloyds_border); pRenderer->DrawTextureNew(pLloydsBeaconsPreviewXs[BeaconID]/640.0f, pLloydsBeaconsPreviewYs[BeaconID]/480.0f, pSavegameThumbnails[BeaconID]); Str = pMapStats->pInfos[pMapStats->sub_410D99_get_map_index(pPlayer->pInstalledBeacons[BeaconID].SaveFileID)].pName; pTextHeight = pSpellFont->CalcTextHeight(Str, &pWindow, 0, 0); @@ -168,12 +175,13 @@ } if (!bRecallingBeacon) { - pRenderer->DrawTextureIndexedAlpha(pLloydsBeacons_SomeXs[BeaconID], pLloydsBeacons_SomeYs[BeaconID], pTexture_CurrentBook); + pRenderer->DrawTextureAlphaNew(pLloydsBeacons_SomeXs[BeaconID]/640.0f, pLloydsBeacons_SomeYs[BeaconID]/480.0f, ui_book_lloyds_border); pTextHeight = pSpellFont->CalcTextHeight(pGlobalTXT_LocalizationStrings[19], &pWindow, 0, 0); pWindow.DrawTitleText(pSpellFont, 0, (signed int)pWindow.uFrameHeight / 2 - pTextHeight / 2, 1, pGlobalTXT_LocalizationStrings[19], 3);//Доступно } } } - if (byte_506360) + + if (_506360_installing_beacon) pMessageQueue_50CBD0->AddGUIMessage(UIMSG_CloseAfterInstallBeacon, 0, 0); } \ No newline at end of file
--- a/GUI/UI/Books/LloydsBook.h Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/Books/LloydsBook.h Mon Mar 07 03:48:40 2016 +0200 @@ -7,4 +7,7 @@ virtual ~GUIWindow_LloydsBook() {} virtual void Update(); -}; \ No newline at end of file +}; + + +extern bool _506360_installing_beacon; // 506360 \ No newline at end of file
--- a/GUI/UI/Books/MapBook.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/Books/MapBook.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -1,4 +1,5 @@ #include "Engine/Engine.h" +#include "Engine/AssetsManager.h" #include "Engine/LOD.h" #include "Engine/Party.h" #include "Engine/Timer.h" @@ -14,6 +15,7 @@ #include "IO/Mouse.h" #include "GUI/GUIFont.h" +#include "GUI/UI/UIGame.h" #include "GUI/UI/Books/MapBook.h" #include "Media/Audio/AudioPlayer.h" @@ -21,6 +23,12 @@ void DrawBook_Map_sub(unsigned int tl_x, unsigned int tl_y, unsigned int br_x, int br_y, int _48074); // idb + + +Image *ui_book_map_background = nullptr; + + + GUIWindow_MapBook::GUIWindow_MapBook() : GUIWindow_Book() { @@ -38,32 +46,33 @@ // ---------------------------------------------- // 00411BFC GUIWindow::InitializeBookView -- part dword_506364 = 1; - pSpellBookPagesTextr_12 = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE); - pTex_book_button1_on = pIcons_LOD->LoadTexturePtr("zoom-on", TEXTURE_16BIT_PALETTE); - pTex_book_button2_on = pIcons_LOD->LoadTexturePtr("zoot-on", TEXTURE_16BIT_PALETTE); - pTex_book_button1_off = pIcons_LOD->LoadTexturePtr("zoom-off", TEXTURE_16BIT_PALETTE); - pTex_book_button2_off = pIcons_LOD->LoadTexturePtr("zoot-off", TEXTURE_16BIT_PALETTE); - pTex_book_button3_on = pIcons_LOD->LoadTexturePtr("tabNon", TEXTURE_16BIT_PALETTE); - pTex_book_button3_off = pIcons_LOD->LoadTexturePtr("tabNoff", TEXTURE_16BIT_PALETTE); - pTex_book_button4_on = pIcons_LOD->LoadTexturePtr("tabSon", TEXTURE_16BIT_PALETTE); - pTex_book_button4_off = pIcons_LOD->LoadTexturePtr("tabSoff", TEXTURE_16BIT_PALETTE); - pTex_book_button5_on = pIcons_LOD->LoadTexturePtr("tabEon", TEXTURE_16BIT_PALETTE); - pTex_book_button5_off = pIcons_LOD->LoadTexturePtr("tabEoff", TEXTURE_16BIT_PALETTE); - pTex_book_button6_on = pIcons_LOD->LoadTexturePtr("tabWon", TEXTURE_16BIT_PALETTE); - pTex_book_button6_off = pIcons_LOD->LoadTexturePtr("tabWoff", TEXTURE_16BIT_PALETTE); + ui_book_map_background = assets->GetImage_16BitColorKey(L"sbmap", 0x7FF); + + ui_book_button1_on = assets->GetImage_16BitAlpha(L"zoom-on"); + ui_book_button2_on = assets->GetImage_16BitAlpha(L"zoot-on"); + ui_book_button3_on = assets->GetImage_16BitAlpha(L"tabNon"); + ui_book_button4_on = assets->GetImage_16BitAlpha(L"tabSon"); + ui_book_button5_on = assets->GetImage_16BitAlpha(L"tabEon"); + ui_book_button6_on = assets->GetImage_16BitAlpha(L"tabWon"); + ui_book_button1_off = assets->GetImage_16BitAlpha(L"zoom-off"); + ui_book_button2_off = assets->GetImage_16BitAlpha(L"zoot-off"); + ui_book_button3_off = assets->GetImage_16BitAlpha(L"tabNoff"); + ui_book_button4_off = assets->GetImage_16BitAlpha(L"tabSoff"); + ui_book_button5_off = assets->GetImage_16BitAlpha(L"tabEoff"); + ui_book_button6_off = assets->GetImage_16BitAlpha(L"tabWoff"); pBtn_Book_1 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, 50, 34, 1, 0, - UIMSG_ClickBooksBtn, 0, 0, pGlobalTXT_LocalizationStrings[251], pTex_book_button1_on, 0);// "Zoom In" + UIMSG_ClickBooksBtn, 0, 0, pGlobalTXT_LocalizationStrings[251], ui_book_button1_on, 0);// "Zoom In" pBtn_Book_2 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, 50, 34, 1, 0, - UIMSG_ClickBooksBtn, 1, 0, pGlobalTXT_LocalizationStrings[252], pTex_book_button2_on, 0);// "Zoom Out" + UIMSG_ClickBooksBtn, 1, 0, pGlobalTXT_LocalizationStrings[252], ui_book_button2_on, 0);// "Zoom Out" pBtn_Book_3 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 113, 50, 34, 1, 0, - UIMSG_ClickBooksBtn, 2, 0, pGlobalTXT_LocalizationStrings[192], (Texture *)"", 0);// Scroll Up + UIMSG_ClickBooksBtn, 2, 0, pGlobalTXT_LocalizationStrings[192], (Image *)"", 0);// Scroll Up pBtn_Book_4 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 150, 50, 34, 1, 0, - UIMSG_ClickBooksBtn, 3, 0, pGlobalTXT_LocalizationStrings[193], (Texture *)"", 0);// Scroll Down + UIMSG_ClickBooksBtn, 3, 0, pGlobalTXT_LocalizationStrings[193], (Image *)"", 0);// Scroll Down pBtn_Book_5 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, 50, 34, 1, 0, - UIMSG_ClickBooksBtn, 4, 0, pGlobalTXT_LocalizationStrings[573], (Texture *)"", 0);// "Scroll Right" + UIMSG_ClickBooksBtn, 4, 0, pGlobalTXT_LocalizationStrings[573], (Image *)"", 0);// "Scroll Right" pBtn_Book_6 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, 50, 34, 1, 0, - UIMSG_ClickBooksBtn, 5, 0, pGlobalTXT_LocalizationStrings[572], (Texture *)"", 0);// "Scroll Left" + UIMSG_ClickBooksBtn, 5, 0, pGlobalTXT_LocalizationStrings[572], (Image *)"", 0);// "Scroll Left" } @@ -90,36 +99,36 @@ char party_coord[120]; // [sp+Ch] [bp-CCh]@37 GUIWindow map_window; // [sp+84h] [bp-54h]@35 - pRenderer->DrawTextureTransparentColorKey(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_12); + pRenderer->DrawTextureAlphaNew(pViewport->uViewportTL_X/640.0f, pViewport->uViewportTL_Y/480.0f, ui_book_map_background); if (BtnUp_flag || viewparams->uMapBookMapZoom / 128 >= 12)//Button 1 - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 2, pTex_book_button1_off); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 408)/640.0f, (pViewport->uViewportTL_Y + 2)/480.0f, ui_book_button1_off); else - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, pTex_book_button1_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 398)/640.0f, (pViewport->uViewportTL_Y + 1)/480.0f, ui_book_button1_on); if (BtnDown_flag || viewparams->uMapBookMapZoom / 128 <= 3)//Button 2 - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 38, pTex_book_button2_off); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 408)/640.0f, (pViewport->uViewportTL_Y + 38)/480.0f, ui_book_button2_off); else - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, pTex_book_button2_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 398)/640.0f, (pViewport->uViewportTL_Y + 38)/480.0f, ui_book_button2_on); if (Book_PageBtn3_flag)//Button 3 - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 113, pTex_book_button3_off); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 408)/640.0f, (pViewport->uViewportTL_Y + 113)/480.0f, ui_book_button3_off); else - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, pTex_book_button3_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 398)/640.0f, (pViewport->uViewportTL_Y + 113)/480.0f, ui_book_button3_on); if (Book_PageBtn4_flag)//Button 4 - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 150, pTex_book_button4_off); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 408)/640.0f, (pViewport->uViewportTL_Y + 150)/480.0f, ui_book_button4_off); else - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, pTex_book_button4_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 399)/640.0f, (pViewport->uViewportTL_Y + 150)/480.0f, ui_book_button4_on); if (Book_PageBtn5_flag)//Button 5 - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 188, pTex_book_button5_off); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 408)/640.0f, (pViewport->uViewportTL_Y + 188)/480.0f, ui_book_button5_off); else - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, pTex_book_button5_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 397)/640.0f, (pViewport->uViewportTL_Y + 188)/480.0f, ui_book_button5_on); if (Book_PageBtn6_flag)//Button 6 - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 226, pTex_book_button6_off); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 408)/640.0f, (pViewport->uViewportTL_Y + 226)/480.0f, ui_book_button6_off); else - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, pTex_book_button6_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 397)/640.0f, (pViewport->uViewportTL_Y + 226)/480.0f, ui_book_button6_on); if (BtnDown_flag) viewparams->CenterOnParty2(); @@ -143,7 +152,7 @@ Book_PageBtn4_flag = 0; Book_PageBtn3_flag = 0; DrawBook_Map_sub(97, 49, 361, 313, 0); - pRenderer->DrawTextureIndexedAlpha(75, 22, pTexture_mapbordr); + pRenderer->DrawTextureAlphaNew(75/640.0f, 22/480.0f, ui_book_map_frame); map_window.uFrameWidth = game_viewport_width; map_window.uFrameHeight = game_viewport_height; map_window.uFrameX = game_viewport_x; @@ -394,7 +403,7 @@ v50 = 0; if ((signed int)v51 < 128 || (signed int)v51 > 1920) v50 = 7; - pRenderer->DrawTransparentRedShade(v47, v49, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[v50])); + pRenderer->DrawTransparentRedShade(v47/640.0f, v49/480.0f, game_ui_minimap_dirs[v50]); } if ((signed int)uNumLevelDecorations > 0) {
--- a/GUI/UI/Books/QuestBook.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/Books/QuestBook.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -1,4 +1,5 @@ #include "Engine/Engine.h" +#include "Engine/AssetsManager.h" #include "Engine/LOD.h" #include "Engine/Party.h" #include "Engine/Timer.h" @@ -12,6 +13,8 @@ #include "Media/Audio/AudioPlayer.h" +Image *ui_book_quests_background = nullptr; + GUIWindow_QuestBook::GUIWindow_QuestBook() : GUIWindow_Book() { @@ -27,23 +30,25 @@ // ---------------------------------------------- // 00411BFC GUIWindow::InitializeBookView -- part - pTexture_CurrentBook = pIcons_LOD->LoadTexturePtr("sbquiknot", TEXTURE_16BIT_PALETTE); - pSpellBookPagesTextr_10 = pIcons_LOD->LoadTexturePtr("divbar", TEXTURE_16BIT_PALETTE); - pTex_book_button1_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); - pTex_book_button2_on = pIcons_LOD->LoadTexturePtr("tab-an-7b", TEXTURE_16BIT_PALETTE); - pTex_book_button1_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); - pTex_book_button2_off = pIcons_LOD->LoadTexturePtr("tab-an-7a", TEXTURE_16BIT_PALETTE); + ui_book_quests_background = assets->GetImage_16Bit(L"sbquiknot"); + ui_book_quest_div_bar = assets->GetImage_16BitAlpha(L"divbar"); + + ui_book_button1_on = assets->GetImage_16BitAlpha(L"tab-an-6b"); + ui_book_button2_on = assets->GetImage_16BitAlpha(L"tab-an-7b"); + ui_book_button1_off = assets->GetImage_16BitAlpha(L"tab-an-6a"); + ui_book_button2_off = assets->GetImage_16BitAlpha(L"tab-an-7a"); + pBtn_Book_1 = CreateButton( pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, - pTex_book_button1_on->uTextureWidth, pTex_book_button1_on->uTextureHeight, + ui_book_button1_on->GetWidth(), ui_book_button1_on->GetWidth(), 1, 0, UIMSG_ClickBooksBtn, 0xBu, 0, pGlobalTXT_LocalizationStrings[192],// "Scroll Up" - pTex_book_button1_on, 0 + ui_book_button1_on, 0 ); pBtn_Book_2 = CreateButton( pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, - pTex_book_button2_on->uTextureHeight, pTex_book_button2_on->uTextureHeight, + ui_book_button2_on->GetWidth(), ui_book_button2_on->GetHeight(), 1, 0, UIMSG_ClickBooksBtn, 0xAu, 0, pGlobalTXT_LocalizationStrings[193],// "Scroll Down" - pTex_book_button2_on, 0 + ui_book_button2_on, 0 ); num_achieved_awards = 0; memset(achieved_awards.data(), 0, 4000); @@ -81,16 +86,16 @@ int pTextHeight; // eax@19 GUIWindow questbook_window; // [sp+Ch] [bp-54h]@9 - pRenderer->DrawTextureTransparentColorKey(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_CurrentBook); + pRenderer->DrawTextureNew(pViewport->uViewportTL_X/640.0f, pViewport->uViewportTL_Y/480.0f, ui_book_quests_background); if (BtnUp_flag || !books_primary_item_per_page)//Bookmark Up(Закладка вверх) - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 2, pTex_book_button1_off); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 407)/640.0f, (pViewport->uViewportTL_Y + 2)/480.0f, ui_book_button1_off); else - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, pTex_book_button1_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 398)/640.0f, (pViewport->uViewportTL_Y + 1)/480.0f, ui_book_button1_on); if (BtnDown_flag || books_primary_item_per_page + num_achieved_awards >= full_num_items_in_book)//Bookmark Down(Закладка вниз) - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 38, pTex_book_button2_off); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 407)/640.0f, (pViewport->uViewportTL_Y + 38)/480.0f, ui_book_button2_off); else - pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, pTex_book_button2_on); + pRenderer->DrawTextureAlphaNew((pViewport->uViewportTL_X + 398)/640.0f, (pViewport->uViewportTL_Y + 38)/480.0f, ui_book_button2_on); //for title questbook_window.uFrameWidth = game_viewport_width; @@ -135,7 +140,9 @@ pTextHeight = pAutonoteFont->CalcTextHeight(pQuestTable[achieved_awards[i]], &questbook_window, 1, 0); if ((signed int)(questbook_window.uFrameY + pTextHeight) > (signed int)questbook_window.uFrameHeight) break; - pRenderer->DrawTextureIndexedAlpha(100, (questbook_window.uFrameY + pTextHeight) + 12, pSpellBookPagesTextr_10); + + pRenderer->DrawTextureAlphaNew(100/640.0f, ((questbook_window.uFrameY + pTextHeight) + 12)/480.0f, ui_book_quest_div_bar); + questbook_window.uFrameY = (questbook_window.uFrameY + pTextHeight) + 24; } } \ No newline at end of file
--- a/GUI/UI/Books/TownPortalBook.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/Books/TownPortalBook.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -1,4 +1,5 @@ #include "Engine/Engine.h" +#include "Engine/AssetsManager.h" #include "Engine/LOD.h" #include "Engine/Party.h" #include "Engine/texts.h" @@ -14,6 +15,11 @@ static int pTownPortalBook_ws[6] = { 80, 66, 68, 72, 67, 74 }; static int pTownPortalBook_hs[6] = { 55, 56, 65, 67, 67, 59 }; +static std::array<Image *, 6> ui_book_townportal_icons; // [0]Harmonale, [1]Pierpont, [2]Nighon, [3]Evenmorn Island, [4]Celestia, [5]The Pit + +Image *ui_book_townportal_background = nullptr; + + GUIWindow_TownPortalBook::GUIWindow_TownPortalBook(const char *a1) : GUIWindow_Book() { @@ -23,13 +29,14 @@ // ---------------------------------------------- // 00411BFC GUIWindow::InitializeBookView -- part - pTexture_CurrentBook = pIcons_LOD->LoadTexturePtr("townport", TEXTURE_16BIT_PALETTE); - pTexture_TownPortalIcons[0] = pIcons_LOD->LoadTexturePtr("tpharmndy", TEXTURE_16BIT_PALETTE); - pTexture_TownPortalIcons[1] = pIcons_LOD->LoadTexturePtr("tpelf", TEXTURE_16BIT_PALETTE); - pTexture_TownPortalIcons[2] = pIcons_LOD->LoadTexturePtr("tpwarlock", TEXTURE_16BIT_PALETTE); - pTexture_TownPortalIcons[3] = pIcons_LOD->LoadTexturePtr("tpisland", TEXTURE_16BIT_PALETTE); - pTexture_TownPortalIcons[4] = pIcons_LOD->LoadTexturePtr("tpheaven", TEXTURE_16BIT_PALETTE); - pTexture_TownPortalIcons[5] = pIcons_LOD->LoadTexturePtr("tphell", TEXTURE_16BIT_PALETTE); + ui_book_townportal_background = assets->GetImage_16Bit(L"townport"); + + ui_book_townportal_icons[0] = assets->GetImage_16BitColorKey(L"tpharmndy", 0x7FF); + ui_book_townportal_icons[1] = assets->GetImage_16BitColorKey(L"tpelf", 0x7FF); + ui_book_townportal_icons[2] = assets->GetImage_16BitColorKey(L"tpwarlock", 0x7FF); + ui_book_townportal_icons[3] = assets->GetImage_16BitColorKey(L"tpisland", 0x7FF); + ui_book_townportal_icons[4] = assets->GetImage_16BitColorKey(L"tpheaven", 0x7FF); + ui_book_townportal_icons[5] = assets->GetImage_16BitColorKey(L"tphell", 0x7FF); for (uint i = 0; i < 6; ++i) CreateButton( @@ -64,7 +71,7 @@ POINT a2; // [sp+68h] [bp-8h]@17 pRenderer->ClearZBuffer(0, 479); - pRenderer->DrawTextureIndexedAlpha(8, 8, pTexture_CurrentBook); + pRenderer->DrawTextureNew(8/640.0f, 8/480.0f, ui_book_townportal_background); pRenderer->DrawTextureAlphaNew(471/640.0f, 445/480.0f, ui_exit_cancel_button_background); TownPortalWindow.uFrameX = game_viewport_x; @@ -87,10 +94,10 @@ { if (_449B57_test_bit(pParty->_quest_bits, fountain_bits_lut[i])) - pRenderer->DrawMaskToZBuffer( - pTownPortalBook_xs[i], - pTownPortalBook_ys[i], - pTexture_TownPortalIcons[i], i + 1 + pRenderer->ZDrawTextureAlpha( + pTownPortalBook_xs[i]/640.0f, + pTownPortalBook_ys[i]/480.0f, + ui_book_townportal_icons[i], i + 1 ); } @@ -100,7 +107,7 @@ if (v3) { if (_449B57_test_bit(pParty->_quest_bits, fountain_bits_lut[v3 - 1])) - pRenderer->DrawTextureTransparentColorKey(pTownPortalBook_xs[v3 - 1], pTownPortalBook_ys[v3 - 1], pTexture_TownPortalIcons[v3 - 1]); + pRenderer->DrawTextureAlphaNew(pTownPortalBook_xs[v3 - 1]/640.0f, pTownPortalBook_ys[v3 - 1]/480.0f, ui_book_townportal_icons[v3 - 1]); } TownPortalWindow.DrawTitleText(pBook2Font, 0, 22, 0, pGlobalTXT_LocalizationStrings[10], 3); } \ No newline at end of file
--- a/GUI/UI/Chest.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/Chest.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -29,7 +29,7 @@ // -------------------------------------------------------- // 0042041E bool Chest::Open( signed int uChestID ) -- part - pBtn_ExitCancel = CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], pIcons_LOD->GetTexture(uExitCancelTextureId), 0);// Exit + pBtn_ExitCancel = CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], ui_exit_cancel_button_background, 0);// Exit CreateButton(7, 8, 460, 343, 1, 0, UIMSG_CHEST_ClickItem, 0, 0, "", 0); current_screen_type = SCREEN_CHEST; pEventTimer->Pause(); @@ -60,7 +60,7 @@ unsigned int v5; // eax@1 int chest_item_index; // ecx@3 unsigned int item_texture_id; // eax@4 - Texture *item_texture; // esi@4 + Texture_MM7 *item_texture; // esi@4 signed int itemPixelWidth; // ecx@4 signed int itemPixelHeght; // edx@4 // signed int v11; // eax@4
--- a/GUI/UI/Spellbook.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/Spellbook.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -1,4 +1,5 @@ #include "Engine/Engine.h" +#include "Engine/AssetsManager.h" #include "Engine/Party.h" #include "Engine/LOD.h" #include "Engine/Timer.h" @@ -40,6 +41,18 @@ }; +Image *ui_spellbook_btn_quckspell = nullptr; +Image *ui_spellbook_btn_quckspell_click = nullptr; +Image *ui_spellbook_btn_close = nullptr; +Image *ui_spellbook_btn_close_click = nullptr; + + +std::array<Image *, 12> SBPageCSpellsTextureList; +std::array<Image *, 12> SBPageSSpellsTextureList; + +std::array<Image *, 9> ui_spellbook_school_backgrounds; +std::array<std::array<Image *, 2>, 9> ui_spellbook_school_tabs; + GUIWindow_Spellbook::GUIWindow_Spellbook() : @@ -64,7 +77,7 @@ { // ------------------------------------ // 004304E7 void Game_EventLoop -- part - + OnCloseSpellBookPage(); pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = page; OpenSpellbook(); @@ -95,10 +108,11 @@ continue; v4 = pPlayer->lastOpenedSpellbookPage; //v4 = (12 * pPlayer->lastOpenedSpellbookPage + pSpellbookSpellIndices[pPlayer->lastOpenedSpellbookPage][i + 1]); - CreateButton(pViewport->uViewportTL_X + pIconPos[v4][pSpellbookSpellIndices[v4][i + 1]].Xpos, + CreateButton( + pViewport->uViewportTL_X + pIconPos[v4][pSpellbookSpellIndices[v4][i + 1]].Xpos, pViewport->uViewportTL_Y + pIconPos[v4][pSpellbookSpellIndices[v4][i + 1]].Ypos, //dword_4E20D0 - SBPageSSpellsTextureList[i + 1]->uTextureWidth, - SBPageSSpellsTextureList[i + 1]->uTextureHeight, + SBPageSSpellsTextureList[i + 1]->GetWidth(), + SBPageSSpellsTextureList[i + 1]->GetHeight(), 1, 79, UIMSG_SelectSpell, i, 0, "", 0); ++a2; //++v3; @@ -119,10 +133,10 @@ if (pPlayer->pActiveSkills[PLAYER_SKILL_LIGHT]) CreateButton(400, 271, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 7, 0, aSpellSchoolNames[7], 0); if (pPlayer->pActiveSkills[PLAYER_SKILL_DARK]) CreateButton(400, 307, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 8, 0, aSpellSchoolNames[8], 0); - CreateButton(476, 450, pSBClickQuickSpellBtnTextr->uTextureWidth, pSBClickQuickSpellBtnTextr->uTextureHeight, 1, 78, UIMSG_ClickInstallRemoveQuickSpellBtn, 0, 0, "", 0); - pBtn_InstallRemoveSpell = CreateButton(476, 450, 48, 32, 1, 78, UIMSG_ClickInstallRemoveQuickSpellBtn, 0, 0, "", pSBClickQuickSpellBtnTextr, 0); - CreateButton(561, 450, pSpellBookClickCloseBtnTextr->uTextureWidth, pSpellBookClickCloseBtnTextr->uTextureHeight, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], 0); - pBtn_CloseBook = CreateButton(561, 450, 48, 32, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], pSpellBookClickCloseBtnTextr, 0); + CreateButton(476, 450, ui_spellbook_btn_quckspell->GetWidth(), ui_spellbook_btn_quckspell->GetHeight(), 1, 78, UIMSG_ClickInstallRemoveQuickSpellBtn, 0, 0, "", 0); + pBtn_InstallRemoveSpell = CreateButton(476, 450, 48, 32, 1, 78, UIMSG_ClickInstallRemoveQuickSpellBtn, 0, 0, "", ui_spellbook_btn_quckspell_click, 0); + CreateButton(561, 450, ui_spellbook_btn_close->GetWidth(), ui_spellbook_btn_close->GetHeight(), 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], 0); + pBtn_CloseBook = CreateButton(561, 450, 48, 32, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], ui_spellbook_btn_close_click, 0); } void GUIWindow_Spellbook::Update() @@ -137,12 +151,12 @@ // 00412B58 void DrawSpellBookContent(Player *player) auto player = pPlayers[uActiveCharacter]; - Texture *PendingTexture; // edi@1 - Texture *pTexture; // edx@5 + //Texture_MM7 *PendingTexture; // edi@1 + Image *pTexture; // edx@5 int v10; // eax@13 unsigned int pX_coord; // esi@18 unsigned int pY_coord; // edi@18 - Texture *pPageTexture; // eax@21 + //Texture_MM7 *pPageTexture; // eax@21 // signed int v22; // [sp-4h] [bp-24h]@22 POINT a2; // [sp+18h] [bp-8h]@13 @@ -154,7 +168,7 @@ BookUI_Spellbook_DrawCurrentSchoolBackground(); - PendingTexture = pIcons_LOD->GetTexture(pIcons_LOD->FindTextureByName("Pending")); + //PendingTexture = pIcons_LOD->GetTexture(pIcons_LOD->FindTextureByName("Pending")); pRenderer->ClearZBuffer(0, 479); if ((11 * player->lastOpenedSpellbookPage) || ((11 * player->lastOpenedSpellbookPage) + 11))//??? maybe structure need fix { @@ -162,22 +176,22 @@ { if (player->_achieved_awards_bits[(11 * player->lastOpenedSpellbookPage) + i + 63]) { - if (SBPageSSpellsTextureList[i] != PendingTexture) + if (SBPageSSpellsTextureList[i]) { if (quick_spell_at_page == i) pTexture = SBPageCSpellsTextureList[i]; else pTexture = SBPageSSpellsTextureList[i]; - if (pTexture->paletted_pixels) + if (pTexture) { pX_coord = pViewport->uViewportTL_X + pIconPos[player->lastOpenedSpellbookPage][pSpellbookSpellIndices[player->lastOpenedSpellbookPage][i]].Xpos; pY_coord = pViewport->uViewportTL_Y + pIconPos[player->lastOpenedSpellbookPage][pSpellbookSpellIndices[player->lastOpenedSpellbookPage][i]].Ypos; - if (pTexture->pBits & 0x200) - pRenderer->DrawTextureIndexedAlpha(pX_coord, pY_coord, pTexture); - else - pRenderer->DrawTextureTransparentColorKey(pX_coord, pY_coord, pTexture); - pRenderer->DrawMaskToZBuffer(pIconPos[player->lastOpenedSpellbookPage][pSpellbookSpellIndices[player->lastOpenedSpellbookPage][i]].Xpos, - pIconPos[player->lastOpenedSpellbookPage][pSpellbookSpellIndices[player->lastOpenedSpellbookPage][i]].Ypos, pTexture, i); + + pRenderer->DrawTextureAlphaNew(pX_coord/640.0f, pY_coord/480.0f, pTexture); + pRenderer->ZDrawTextureAlpha( + pIconPos[player->lastOpenedSpellbookPage][pSpellbookSpellIndices[player->lastOpenedSpellbookPage][i]].Xpos/640.0f, + pIconPos[player->lastOpenedSpellbookPage][pSpellbookSpellIndices[player->lastOpenedSpellbookPage][i]].Ypos/480.0f, + pTexture, i); } } } @@ -188,35 +202,34 @@ v10 = pRenderer->pActiveZBuffer[a2.x + pSRZBufferLineOffsets[a2.y]] & 0xFFFF; if (v10) { - if (SBPageCSpellsTextureList[v10]->paletted_pixels) + if (SBPageCSpellsTextureList[v10]) { pX_coord = pViewport->uViewportTL_X + pIconPos[player->lastOpenedSpellbookPage][pSpellbookSpellIndices[player->lastOpenedSpellbookPage][v10]].Xpos; pY_coord = pViewport->uViewportTL_Y + pIconPos[player->lastOpenedSpellbookPage][pSpellbookSpellIndices[player->lastOpenedSpellbookPage][v10]].Ypos; - if (SBPageCSpellsTextureList[v10]->pBits & 0x200) - pRenderer->DrawTextureIndexedAlpha(pX_coord, pY_coord, SBPageCSpellsTextureList[v10]); - else - pRenderer->DrawTextureTransparentColorKey(pX_coord, pY_coord, SBPageCSpellsTextureList[v10]); + + pRenderer->DrawTextureAlphaNew(pX_coord/640.0f, pY_coord/480.0f, SBPageCSpellsTextureList[v10]); } } - //pX_coord = (unsigned int)&player->pActiveSkills[PLAYER_SKILL_FIRE]; - //pY_coord = (unsigned int)&player->pActiveSkills[PLAYER_SKILL_FIRE]; + for (uint i = 0; i < 9; i++) { if (player->pActiveSkills[PLAYER_SKILL_FIRE + i]) { + auto pPageTexture = ui_spellbook_school_tabs[i][0]; if (player->lastOpenedSpellbookPage == i) { - pPageTexture = pTextures_tabs[i][1]; + pPageTexture = ui_spellbook_school_tabs[i][1]; pX_coord = texture_tab_coord1[i][0]; pY_coord = texture_tab_coord1[i][1]; } else { - pPageTexture = pTextures_tabs[i][0]; + pPageTexture = ui_spellbook_school_tabs[i][0]; pX_coord = texture_tab_coord0[i][0]; pY_coord = texture_tab_coord0[i][1]; } - pRenderer->DrawTextureIndexedAlpha(pX_coord, pY_coord, pPageTexture); + + pRenderer->DrawTextureAlphaNew(pX_coord/640.0f, pY_coord/480.0f, pPageTexture); } } } @@ -249,10 +262,10 @@ if (pPlayers[uActiveCharacter]->spellbook.pChapters[spell_school].bIsSpellAvailable[i - 1]) { sprintf(pContainer, "SB%sS%02d", spellbook_texture_filename_suffices[spell_school], pSpellbookSpellIndices[spell_school][i]); - SBPageSSpellsTextureList[i] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); + SBPageSSpellsTextureList[i] = assets->GetImage_16BitAlpha(pContainer); sprintf(pContainer, "SB%sC%02d", spellbook_texture_filename_suffices[spell_school], pSpellbookSpellIndices[spell_school][i]); - SBPageCSpellsTextureList[i] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); + SBPageCSpellsTextureList[i] = assets->GetImage_16BitAlpha(pContainer); } } } @@ -263,9 +276,10 @@ int pTexID = 0; if ( uActiveCharacter ) pTexID = pParty->pPlayers[uActiveCharacter - 1].lastOpenedSpellbookPage; - pRenderer->DrawTextureTransparentColorKey(8, 8, pSpellBookPagesTextr[pTexID]); - pRenderer->DrawTextureTransparentColorKey(476, 450, pSBQuickSpellBtnTextr); - pRenderer->DrawTextureTransparentColorKey(561, 450, pSpellBookCloseBtnTextr); + pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, ui_spellbook_school_backgrounds[pTexID]); + + pRenderer->DrawTextureAlphaNew(476/640.0f, 450/480.0f, ui_spellbook_btn_quckspell); + pRenderer->DrawTextureAlphaNew(561/640.0f, 450/480.0f, ui_spellbook_btn_close); } @@ -280,11 +294,11 @@ if (!pIcons_LOD->uNumPrevLoadedFiles) pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; pAudioPlayer->PlaySound(SOUND_openbook, 0, 0, -1, 0, 0, 0, 0); - pSpellBookPagesTextr_9 = pIcons_LOD->LoadTexturePtr("book", TEXTURE_16BIT_PALETTE); - pTexture_pagemask = pIcons_LOD->LoadTexturePtr("pagemask", TEXTURE_16BIT_PALETTE); - pSpellBookCloseBtnTextr = pIcons_LOD->LoadTexturePtr("ib-m5-u", TEXTURE_16BIT_PALETTE); - pSpellBookClickCloseBtnTextr = pIcons_LOD->LoadTexturePtr("ib-m5-d", TEXTURE_16BIT_PALETTE); - pSBQuickSpellBtnTextr = pIcons_LOD->LoadTexturePtr("ib-m6-u", TEXTURE_16BIT_PALETTE); + + ui_spellbook_btn_close = assets->GetImage_16BitAlpha(L"ib-m5-u"); + ui_spellbook_btn_close_click = assets->GetImage_16BitAlpha(L"ib-m5-d"); + ui_spellbook_btn_quckspell = assets->GetImage_16BitAlpha(L"ib-m6-u"); + ui_spellbook_btn_quckspell_click = assets->GetImage_16BitAlpha(L"ib-m6-d"); static const char *texNames[9] = // 004E24EC { @@ -292,14 +306,15 @@ "SBSB00", "SBMB00", "SBBB00", "SBLB00", "SBDB00" }; - pSBClickQuickSpellBtnTextr = pIcons_LOD->LoadTexturePtr("ib-m6-d", TEXTURE_16BIT_PALETTE); for (uint i = 0; i < 9; ++i) { - pSpellBookPagesTextr[i] = pIcons_LOD->LoadTexturePtr(texNames[i], TEXTURE_16BIT_PALETTE); + ui_spellbook_school_backgrounds[i] = assets->GetImage_16BitColorKey(texNames[i], 0x7FF); + sprintf(pTmpBuf.data(), "tab%da", i + 1); - pTextures_tabs[i][0] = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE); + ui_spellbook_school_tabs[i][0] = assets->GetImage_16BitAlpha(pTmpBuf.data()); + sprintf(pTmpBuf.data(), "tab%db", i + 1); - pTextures_tabs[i][1] = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE); + ui_spellbook_school_tabs[i][1] = assets->GetImage_16BitAlpha(pTmpBuf.data()); } } @@ -307,15 +322,88 @@ //----- (00411473) -------------------------------------------------------- void OnCloseSpellBook() { - pTexture_pagemask->Release(); - pSpellBookCloseBtnTextr->Release(); - pSBQuickSpellBtnTextr->Release(); + if (ui_spellbook_btn_close) + { + ui_spellbook_btn_close->Release(); + ui_spellbook_btn_close = nullptr; + } + if (ui_spellbook_btn_close_click) + { + ui_spellbook_btn_close_click->Release(); + ui_spellbook_btn_close_click = nullptr; + } + + + + if (ui_spellbook_btn_quckspell) + { + ui_spellbook_btn_quckspell->Release(); + ui_spellbook_btn_quckspell = nullptr; + } + if (ui_spellbook_btn_quckspell_click) + { + ui_spellbook_btn_quckspell_click->Release(); + ui_spellbook_btn_quckspell_click = nullptr; + } + + for (uint i = 0; i < 9; ++i) { - pSpellBookPagesTextr[i]->Release(); - pTextures_tabs[i][0]->Release(); - pTextures_tabs[i][1]->Release(); + if (ui_spellbook_school_backgrounds[i]) + { + ui_spellbook_school_backgrounds[i]->Release(); + ui_spellbook_school_backgrounds[i] = nullptr; + } + + if (ui_spellbook_school_tabs[i][0]) + { + ui_spellbook_school_tabs[i][0]->Release(); + ui_spellbook_school_tabs[i][0] = nullptr; + } + if (ui_spellbook_school_tabs[i][1]) + { + ui_spellbook_school_tabs[i][1]->Release(); + ui_spellbook_school_tabs[i][1] = nullptr; + } } + pAudioPlayer->PlaySound(SOUND_openbook, 0, 0, -1, 0, 0, 0, 0); - pIcons_LOD->RemoveTexturesPackFromTextureList(); } + + + +//----- (0041140B) -------------------------------------------------------- +void OnCloseSpellBookPage() +{ + GUIButton *pNextButton; // esi@4 + for ( uint i = 1; i <= 11; i++ ) + { + if (SBPageCSpellsTextureList[i]) + { + SBPageCSpellsTextureList[i]->Release(); + SBPageCSpellsTextureList[i] = nullptr; + } + if (SBPageSSpellsTextureList[i]) + { + SBPageSSpellsTextureList[i]->Release(); + SBPageSSpellsTextureList[i] = nullptr; + } + } + + + pIcons_LOD->SyncLoadedFilesCount(); + if ( pGUIWindow_CurrentMenu->pControlsHead ) + { + do + { + pNextButton = pGUIWindow_CurrentMenu->pControlsHead->pNext; + free(pGUIWindow_CurrentMenu->pControlsHead); + pGUIWindow_CurrentMenu->pControlsHead = pNextButton; + } + while ( pNextButton ); + } + pGUIWindow_CurrentMenu->pControlsHead = 0; + pGUIWindow_CurrentMenu->pControlsTail = 0; + pGUIWindow_CurrentMenu->uNumControls = 0; +} +
--- a/GUI/UI/Spellbook.h Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/Spellbook.h Mon Mar 07 03:48:40 2016 +0200 @@ -11,4 +11,10 @@ void OpenSpellbook(); void OpenSpellbookPage(int page); -}; \ No newline at end of file +}; + + +extern class Image *ui_spellbook_btn_quckspell; +extern class Image *ui_spellbook_btn_quckspell_click; +extern class Image *ui_spellbook_btn_close; +extern class Image *ui_spellbook_btn_close_click; \ No newline at end of file
--- a/GUI/UI/UIArena.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/UIArena.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -112,7 +112,7 @@ pDialogueWindow->uNumControls = 0; pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], //Close, Закрыть - pIcons_LOD->GetTexture(uExitCancelTextureId), 0); + ui_exit_cancel_button_background, 0); pDialogueWindow->CreateButton(480, 160, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 85, 0, "", 0); pDialogueWindow->CreateButton(480, 190, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 86, 0, "", 0); pDialogueWindow->CreateButton(480, 220, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 87, 0, "", 0); @@ -165,8 +165,12 @@ pViewport->uViewportBR_Y - pViewport->uViewportTL_Y + 1, 0x7FF); - Texture* pTex = pIcons_LOD->GetTexture(uTextureID_Leather); - pRenderer->GetLeather(8, 352 - v0, pTex, pTex->uTextureHeight - v0); + //Texture_MM7* pTex = pIcons_LOD->GetTexture(ui_leather_mm7); + pRenderer->DrawTextureCustomHeight( + 8/640.0f, + (352 - v0)/480.0f, + ui_leather_mm7, + v0); pRenderer->DrawTextureAlphaNew(8/640.0f, (347 - v0)/480.0f, _591428_endcap); v1 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[575], pFontArrus, &window, 0xDu, 0);//Пожалуйста, подождите пока я вызываю существ. Удачи.
--- a/GUI/UI/UIBooks.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/UIBooks.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -16,6 +16,28 @@ + +Image *ui_book_button8_off = nullptr; +Image *ui_book_button8_on = nullptr; +Image *ui_book_button7_off = nullptr; +Image *ui_book_button7_on = nullptr; +Image *ui_book_button6_off = nullptr; +Image *ui_book_button6_on = nullptr; +Image *ui_book_button5_off = nullptr; +Image *ui_book_button5_on = nullptr; +Image *ui_book_button4_off = nullptr; +Image *ui_book_button4_on = nullptr; +Image *ui_book_button3_off = nullptr; +Image *ui_book_button3_on = nullptr; +Image *ui_book_button2_off = nullptr; +Image *ui_book_button2_on = nullptr; +Image *ui_book_button1_off = nullptr; +Image *ui_book_button1_on = nullptr; + +Image *ui_book_map_frame = nullptr; + +Image *ui_book_quest_div_bar = nullptr; + //----- (00411597) -------------------------------------------------------- void GUIWindow_Book::Release() { @@ -29,7 +51,13 @@ pBook2Font = nullptr; free(pAutonoteFont); pAutonoteFont = nullptr; - pTexture_mapbordr->Release(); + + if (ui_book_map_frame) + { + ui_book_map_frame->Release(); + ui_book_map_frame = nullptr; + } + pAudioPlayer->PlaySound(SOUND_closebook, 0, 0, -1, 0, 0, 0, 0); pIcons_LOD->RemoveTexturesPackFromTextureList(); dword_506364 = 0; @@ -66,35 +94,11 @@ if (!pIcons_LOD->uNumPrevLoadedFiles) pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; pAudioPlayer->PlaySound(SOUND_openbook, 0, 0, -1, 0, 0, 0, 0); - pTexture_mapbordr = pIcons_LOD->LoadTexturePtr("mapbordr", TEXTURE_16BIT_PALETTE); + + ui_book_map_frame = assets->GetImage_16BitAlpha("mapbordr"); + pBookFont = LoadFont("book.fnt", "FONTPAL", NULL); pBook2Font = LoadFont("book2.fnt", "FONTPAL", NULL); pAutonoteFont = LoadFont("autonote.fnt", "FONTPAL", NULL); pSpellFont = LoadFont("spell.fnt", "FONTPAL", NULL); } - - -//----- (0041140B) -------------------------------------------------------- -void OnCloseSpellBookPage() -{ - GUIButton *pNextButton; // esi@4 - for ( uint i = 1; i <= 11; i++ ) - { - SBPageCSpellsTextureList[i]->Release(); - SBPageSSpellsTextureList[i]->Release(); - } - pIcons_LOD->SyncLoadedFilesCount(); - if ( pGUIWindow_CurrentMenu->pControlsHead ) - { - do - { - pNextButton = pGUIWindow_CurrentMenu->pControlsHead->pNext; - free(pGUIWindow_CurrentMenu->pControlsHead); - pGUIWindow_CurrentMenu->pControlsHead = pNextButton; - } - while ( pNextButton ); - } - pGUIWindow_CurrentMenu->pControlsHead = 0; - pGUIWindow_CurrentMenu->pControlsTail = 0; - pGUIWindow_CurrentMenu->uNumControls = 0; -}
--- a/GUI/UI/UIBooks.h Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/UIBooks.h Mon Mar 07 03:48:40 2016 +0200 @@ -25,4 +25,26 @@ virtual ~GUIWindow_BooksButtonOverlay() {} virtual void Update(); -}; \ No newline at end of file +}; + + + +extern class Image *ui_book_button8_off; +extern class Image *ui_book_button8_on; +extern class Image *ui_book_button7_off; +extern class Image *ui_book_button7_on; +extern class Image *ui_book_button6_off; +extern class Image *ui_book_button6_on; +extern class Image *ui_book_button5_off; +extern class Image *ui_book_button5_on; +extern class Image *ui_book_button4_off; +extern class Image *ui_book_button4_on; +extern class Image *ui_book_button3_off; +extern class Image *ui_book_button3_on; +extern class Image *ui_book_button2_off; +extern class Image *ui_book_button2_on; +extern class Image *ui_book_button1_off; +extern class Image *ui_book_button1_on; + +extern class Image *ui_book_map_frame; +extern class Image *ui_book_quest_div_bar; \ No newline at end of file
--- a/GUI/UI/UICharacter.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/UICharacter.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -7,7 +7,9 @@ #include "Engine/Engine.h" #include "Engine/AssetsManager.h" -#include "UICharacter.h" +#include "GUI/GUIWindow.h" +#include "GUI/UI/UICharacter.h" + #include "..\../Engine/MapInfo.h" #include "..\../GUI/GUIWindow.h" #include "..\../GUI/GUIFont.h" @@ -192,21 +194,20 @@ ui_house_player_cant_interact_color = Color16(255, 255, 155); } -std::array<unsigned int, 16> papredoll_dbrds; -unsigned int papredoll_drhs[4]; -unsigned int papredoll_dlhus[4]; -unsigned int papredoll_dlhs[4]; -unsigned int papredoll_dbods[5]; -int paperdoll_armor_texture[4][17][3];//0x511294 +Image *papredoll_drhs[4]; +Image *papredoll_dlhus[4]; +Image *papredoll_dlhs[4]; +Image *papredoll_dbods[5]; +Image *paperdoll_armor_texture[4][17][3];//0x511294 //int paperdoll_array_51132C[165]; -unsigned int papredoll_dlaus[5]; -unsigned int papredoll_dlads[4]; -int papredoll_flying_feet[22]; // 005115E0 -int paperdoll_boots_texture[4][6];//511638 -int paperdoll_cloak_collar_texture[4][10]; // weak -int paperdoll_cloak_texture[4][10]; -int paperdoll_helm_texture[2][16]; //511698 -int paperdoll_belt_texture[4][7]; //511718 +Image *papredoll_dlaus[5]; +Image *papredoll_dlads[4]; +Image *papredoll_flying_feet[22]; // 005115E0 +Image *paperdoll_boots_texture[4][6];//511638 +Image *paperdoll_cloak_collar_texture[4][10]; // weak +Image *paperdoll_cloak_texture[4][10]; +Image *paperdoll_helm_texture[2][16]; //511698 +Image *paperdoll_belt_texture[4][7]; //511718 const int paperdoll_Weapon[4][16][2] = {//4E4C30 {{128, 205}, {30, 144}, {88, 85}, {0, 0}, {0, 0}, {0, 0}, {17, 104}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}}, @@ -400,11 +401,33 @@ PLAYER_SKILL_UNARMED, PLAYER_SKILL_BLASTER }; -const int pMiscSkills[12] = {PLAYER_SKILL_ALCHEMY, PLAYER_SKILL_ARMSMASTER, PLAYER_SKILL_BODYBUILDING, PLAYER_SKILL_ITEM_ID, PLAYER_SKILL_MONSTER_ID, - PLAYER_SKILL_LEARNING, PLAYER_SKILL_TRAP_DISARM, PLAYER_SKILL_MEDITATION, PLAYER_SKILL_MERCHANT, PLAYER_SKILL_PERCEPTION, - PLAYER_SKILL_REPAIR, PLAYER_SKILL_STEALING}; -const int pMagicSkills[9] = {PLAYER_SKILL_FIRE, PLAYER_SKILL_AIR, PLAYER_SKILL_WATER, PLAYER_SKILL_EARTH, PLAYER_SKILL_SPIRIT, - PLAYER_SKILL_MIND, PLAYER_SKILL_BODY, PLAYER_SKILL_LIGHT, PLAYER_SKILL_DARK}; +const int pMiscSkills[12] = +{ + PLAYER_SKILL_ALCHEMY, + PLAYER_SKILL_ARMSMASTER, + PLAYER_SKILL_BODYBUILDING, + PLAYER_SKILL_ITEM_ID, + PLAYER_SKILL_MONSTER_ID, + PLAYER_SKILL_LEARNING, + PLAYER_SKILL_TRAP_DISARM, + PLAYER_SKILL_MEDITATION, + PLAYER_SKILL_MERCHANT, + PLAYER_SKILL_PERCEPTION, + PLAYER_SKILL_REPAIR, + PLAYER_SKILL_STEALING +}; +const int pMagicSkills[9] = +{ + PLAYER_SKILL_FIRE, + PLAYER_SKILL_AIR, + PLAYER_SKILL_WATER, + PLAYER_SKILL_EARTH, + PLAYER_SKILL_SPIRIT, + PLAYER_SKILL_MIND, + PLAYER_SKILL_BODY, + PLAYER_SKILL_LIGHT, + PLAYER_SKILL_DARK +}; @@ -419,6 +442,10 @@ Image *ui_character_inventory_paperdoll_rings_close = nullptr; +std::array<Image *, 16> paperdoll_dbrds; + + + GUIWindow_CharacterRecord::GUIWindow_CharacterRecord(unsigned int uActiveCharacter, enum CURRENT_SCREEN screen) : GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), uActiveCharacter, nullptr) { @@ -438,35 +465,35 @@ //auto wnd = new GUIWindow_CharacterRecord(0, 0, window->GetWidth(), window->GetHeight(), uActiveCharacter, 0); pCharacterScreen_StatsBtn = CreateButton(pViewport->uViewportTL_X + 12, pViewport->uViewportTL_Y + 308, - pIcons_LOD->GetTexture(papredoll_dbrds[9])->uTextureWidth, - pIcons_LOD->GetTexture(papredoll_dbrds[9])->uTextureHeight, + paperdoll_dbrds[9]->GetWidth(), + paperdoll_dbrds[9]->GetHeight(), 1, 0, UIMSG_ClickStatsBtn, 0, 'S', pGlobalTXT_LocalizationStrings[216],// Stats - pIcons_LOD->GetTexture(papredoll_dbrds[10]), - pIcons_LOD->GetTexture(papredoll_dbrds[9]), 0); + paperdoll_dbrds[10], + paperdoll_dbrds[9], 0); pCharacterScreen_SkillsBtn = CreateButton(pViewport->uViewportTL_X + 102, pViewport->uViewportTL_Y + 308, - pIcons_LOD->GetTexture(papredoll_dbrds[7])->uTextureWidth, - pIcons_LOD->GetTexture(papredoll_dbrds[7])->uTextureHeight, + paperdoll_dbrds[7]->GetWidth(), + paperdoll_dbrds[7]->GetHeight(), 1, 0, UIMSG_ClickSkillsBtn, 0, 'K', pGlobalTXT_LocalizationStrings[205],//Skills - pIcons_LOD->GetTexture(papredoll_dbrds[8]), - pIcons_LOD->GetTexture(papredoll_dbrds[7]), 0); + paperdoll_dbrds[8], + paperdoll_dbrds[7], 0); pCharacterScreen_InventoryBtn = CreateButton(pViewport->uViewportTL_X + 192, pViewport->uViewportTL_Y + 308, - pIcons_LOD->GetTexture(papredoll_dbrds[5])->uTextureWidth, - pIcons_LOD->GetTexture(papredoll_dbrds[5])->uTextureHeight, + paperdoll_dbrds[5]->GetWidth(), + paperdoll_dbrds[5]->GetHeight(), 1, 0, UIMSG_ClickInventoryBtn, 0, 'I', pGlobalTXT_LocalizationStrings[120], //Inventory - pIcons_LOD->GetTexture(papredoll_dbrds[6]), - pIcons_LOD->GetTexture(papredoll_dbrds[5]), 0); + paperdoll_dbrds[6], + paperdoll_dbrds[5], 0); pCharacterScreen_AwardsBtn = CreateButton(pViewport->uViewportTL_X + 282, pViewport->uViewportTL_Y + 308, - pIcons_LOD->GetTexture(papredoll_dbrds[3])->uTextureWidth, - pIcons_LOD->GetTexture(papredoll_dbrds[3])->uTextureHeight, + paperdoll_dbrds[3]->GetWidth(), + paperdoll_dbrds[3]->GetHeight(), 1, 0, UIMSG_ClickAwardsBtn, 0, 'A', pGlobalTXT_LocalizationStrings[22], //Awards - pIcons_LOD->GetTexture(papredoll_dbrds[4]), - pIcons_LOD->GetTexture(papredoll_dbrds[3]), 0); + paperdoll_dbrds[4], + paperdoll_dbrds[3], 0); pCharacterScreen_ExitBtn = CreateButton(pViewport->uViewportTL_X + 371, pViewport->uViewportTL_Y + 308, - pIcons_LOD->GetTexture(papredoll_dbrds[1])->uTextureWidth, - pIcons_LOD->GetTexture(papredoll_dbrds[1])->uTextureHeight, + paperdoll_dbrds[1]->GetWidth(), + paperdoll_dbrds[1]->GetHeight(), 1, 0, UIMSG_ClickExitCharacterWindowBtn, 0, 0, pGlobalTXT_LocalizationStrings[79],//Exit - pIcons_LOD->GetTexture(papredoll_dbrds[2]), - pIcons_LOD->GetTexture(papredoll_dbrds[1]), 0); + paperdoll_dbrds[2], + paperdoll_dbrds[1], 0); CreateButton(0, 0, 476, 345, 1, 122, UIMSG_InventoryLeftClick, 0, 0, "", 0); pCharacterScreen_DetalizBtn = CreateButton(600, 300, 30, 30, 1, 0, UIMSG_ChangeDetaliz, 0, 0, pGlobalTXT_LocalizationStrings[64], 0); pCharacterScreen_DollBtn = CreateButton(476, 0, 164, 345, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0); @@ -653,8 +680,8 @@ CS_inventory_window = new GUIWindow_Inventory_CastSpell(0, 0, window->GetWidth(), window->GetHeight(), (int)this, 0); pCharacterScreen_ExitBtn = CS_inventory_window->CreateButton(394, 318, 75, 33, 1, 0, UIMSG_ClickExitCharacterWindowBtn, 0, 0, pGlobalTXT_LocalizationStrings[79], // Close - pIcons_LOD->GetTexture(papredoll_dbrds[2]), - pIcons_LOD->GetTexture(papredoll_dbrds[1]), 0); + paperdoll_dbrds[2], + paperdoll_dbrds[1], 0); CS_inventory_window->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, UIMSG_InventoryLeftClick, 0, 0, "", 0); pCharacterScreen_DollBtn = CS_inventory_window->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0); @@ -867,7 +894,7 @@ //----- (0041A556) -------------------------------------------------------- void draw_leather() { - pRenderer->DrawTextureTransparentColorKey(8, 8, pIcons_LOD->GetTexture(uTextureID_Leather)); + pRenderer->DrawTextureNew(8/640.0f, 8/480.0f, ui_leather_mm7); } @@ -877,11 +904,11 @@ ItemGen *item; // edi@38 int item_X; // ebx@38 int index; // eax@65 - int v59; // ebx@129 - unsigned int v75; // ebx@170 - int v94; // ebx@214 - unsigned int v127; // ebx@314 - unsigned int v153; // eax@370 + Image *v59; // ebx@129 + Image *v75; // ebx@170 + Image *v94; // ebx@214 + Image *v127; // ebx@314 + Image *v153; // eax@370 char *v166; // [sp-8h] [bp-54h]@16 const char *container; // [sp-8h] [bp-54h]@79 char *v181; // [sp-8h] [bp-54h]@337 @@ -914,16 +941,19 @@ pRenderer->DrawTextureAlphaNew(467/640.0f, 0, ui_character_inventory_paperdoll_background); if ( IsPlayerWearingWatersuit[uPlayerID] )//акваланг { - pRenderer->DrawTextureIndexedAlpha(pPaperdoll_BodyX, pPaperdoll_BodyY, pIcons_LOD->GetTexture(papredoll_dbods[uPlayerID - 1])); + pRenderer->DrawTextureAlphaNew(pPaperdoll_BodyX/640.0f, pPaperdoll_BodyY/480.0f, papredoll_dbods[uPlayerID - 1]); if ( !bRingsShownInCharScreen ) - pRenderer->DrawMaskToZBuffer(pPaperdoll_BodyX, pPaperdoll_BodyY, pIcons_LOD->GetTexture(papredoll_dbods[uPlayerID - 1]), player->pEquipment.uArmor); + pRenderer->ZDrawTextureAlpha(pPaperdoll_BodyX/640.0f, pPaperdoll_BodyY/480.0f, papredoll_dbods[uPlayerID - 1], player->pEquipment.uArmor); + //Рука не занята или ... if ( !player->GetItem(&PlayerEquipment::uMainHand) || ( player->GetMainHandItem()->GetItemEquipType() != EQUIP_TWO_HANDED) && (player->GetMainHandItem()->GetItemEquipType() != PLAYER_SKILL_SPEAR || player->GetItem(&PlayerEquipment::uShield)) ) - pRenderer->DrawTextureIndexedAlpha(pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0], pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1], - pIcons_LOD->GetTexture(papredoll_dlads[uPlayerID - 1])); + pRenderer->DrawTextureAlphaNew( + (pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0])/640.0f, + (pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1])/480.0f, + papredoll_dlads[uPlayerID - 1]); //-----------------------------------------------------(Hand/Рука)--------------------------------------------------------------- if ( player->GetItem(&PlayerEquipment::uMainHand) ) { @@ -935,6 +965,8 @@ else v166 = item->GetIconName(); + auto texture = assets->GetImage_16BitAlpha(v166); + if ( item->ItemEnchanted() ) { if ( item->AuraEffectRed() ) @@ -952,18 +984,17 @@ item->ResetEnchantAnimation(); ptr_50C9A4_ItemToEnchant = nullptr; } - pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE)), - pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); + pRenderer->BlendTextures(item_X, item_Y, texture, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); } else if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE))); + pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, texture); else if ( item->uAttributes & ITEM_IDENTIFIED ) - pRenderer->DrawTextureIndexedAlpha(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE))); + pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, texture); else - pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE))); + pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, texture); if ( !bRingsShownInCharScreen ) - pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE)), player->pEquipment.uMainHand); + pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, texture, player->pEquipment.uMainHand); } } else// без акваланга @@ -975,6 +1006,7 @@ item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][2][0] - pItemsTable->pItems[item->uItemID].uEquipX; item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][2][1] - pItemsTable->pItems[item->uItemID].uEquipY; + auto texture = assets->GetImage_16BitAlpha(item->GetIconName()); if ( item->ItemEnchanted() )// применён закл { if ( item->AuraEffectRed() ) @@ -992,19 +1024,20 @@ item->ResetEnchantAnimation(); ptr_50C9A4_ItemToEnchant = nullptr; } - pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE)), - pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE),GetTickCount() * 0.1, 0, 255); + pRenderer->BlendTextures(item_X, item_Y, texture, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE),GetTickCount() * 0.1, 0, 255); } else if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE))); - else if ( !(item->uAttributes & ITEM_IDENTIFIED) )//не опознанный лук зелёный - pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE))); + pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, texture); + else if ( !(item->uAttributes & ITEM_IDENTIFIED) ) + pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, texture); else // опознанный лук - pRenderer->DrawTextureIndexedAlpha(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE))); + pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, texture); if ( !bRingsShownInCharScreen ) - pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE)), - player->pEquipment.uBow); + pRenderer->ZDrawTextureAlpha( + item_X/640.0f, item_Y/480.0f, + texture, + player->pEquipment.uBow); } //-----------------------------(Cloak/Плащ)--------------------------------------------------------- if ( player->GetItem(&PlayerEquipment::uCloak) ) @@ -1053,21 +1086,20 @@ item->ResetEnchantAnimation();//~0x000000F0 ptr_50C9A4_ItemToEnchant = nullptr; } - pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_texture[pBodyComplection][index]), + pRenderer->BlendTextures(item_X, item_Y, paperdoll_cloak_texture[pBodyComplection][index], pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); } else if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_texture[pBodyComplection][index])); + pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, paperdoll_cloak_texture[pBodyComplection][index]); else - pRenderer->DrawTextureIndexedAlpha(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_texture[pBodyComplection][index])); + pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, paperdoll_cloak_texture[pBodyComplection][index]); if ( !bRingsShownInCharScreen ) - pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_texture[pBodyComplection][index]), - player->pEquipment.uCloak); + pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, paperdoll_cloak_texture[pBodyComplection][index], player->pEquipment.uCloak); } } //-------------------------------(Paperdoll/Кукла)------------------------------------------- - pRenderer->DrawTextureIndexedAlpha(pPaperdoll_BodyX, pPaperdoll_BodyY, pIcons_LOD->GetTexture(papredoll_dbods[uPlayerID - 1])); + pRenderer->DrawTextureAlphaNew(pPaperdoll_BodyX/640.0f, pPaperdoll_BodyY/480.0f, papredoll_dbods[uPlayerID - 1]); //-------------------------------(Armor/Броня)----------------------------------------------- if ( player->GetItem(&PlayerEquipment::uArmor) ) { @@ -1112,19 +1144,18 @@ item->ResetEnchantAnimation();//~0x000000F0 ptr_50C9A4_ItemToEnchant = nullptr; } - pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][0]), + pRenderer->BlendTextures(item_X, item_Y, paperdoll_armor_texture[pBodyComplection][index][0], pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); } else if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][0])); + pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, paperdoll_armor_texture[pBodyComplection][index][0]); else if ( !(item->uAttributes & ITEM_IDENTIFIED) ) - pRenderer->DrawTransparentGreenShade(item_X, item_Y, &pIcons_LOD->pTextures[paperdoll_armor_texture[pBodyComplection][index][0]]); + pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, paperdoll_armor_texture[pBodyComplection][index][0]); else - pRenderer->DrawTextureIndexedAlpha(item_X, item_Y, &pIcons_LOD->pTextures[paperdoll_armor_texture[pBodyComplection][index][0]]); + pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, paperdoll_armor_texture[pBodyComplection][index][0]); if ( !bRingsShownInCharScreen ) - pRenderer->DrawMaskToZBuffer(item_X, item_Y, &pIcons_LOD->pTextures[paperdoll_armor_texture[pBodyComplection][index][0]], - player->pEquipment.uArmor); + pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, paperdoll_armor_texture[pBodyComplection][index][0], player->pEquipment.uArmor); } } //----------------------------------(Boot/Обувь)-------------------------------------------------------- @@ -1168,18 +1199,18 @@ item->ResetEnchantAnimation();//~0x000000F0 ptr_50C9A4_ItemToEnchant = nullptr; } - pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v59), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), + pRenderer->BlendTextures(item_X, item_Y, v59, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); } else if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v59)); + pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, v59); else if ( item->uAttributes & ITEM_IDENTIFIED ) - pRenderer->DrawTextureIndexedAlpha(item_X, item_Y, pIcons_LOD->GetTexture(v59)); + pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, v59); else - pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v59)); + pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, v59); if ( !bRingsShownInCharScreen ) - pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(v59), player->pEquipment.uBoot); + pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, v59, player->pEquipment.uBoot); } } //--------------------------------------------(Hand/Рука)------------------------------------------------------ @@ -1187,8 +1218,10 @@ || ( player->GetMainHandItem()->GetItemEquipType() != EQUIP_TWO_HANDED) && (player->GetMainHandItem()->GetPlayerSkillType() != PLAYER_SKILL_SPEAR || player->GetItem(&PlayerEquipment::uShield)) ) - pRenderer->DrawTextureIndexedAlpha(pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0], - pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_dlads[uPlayerID - 1])); + pRenderer->DrawTextureAlphaNew( + (pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0])/640.0f, + (pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1])/480.0f, + papredoll_dlads[uPlayerID - 1]); //--------------------------------------------(Belt/Пояс)------------------------------------------------------- if ( player->GetItem(&PlayerEquipment::uBelt)) { @@ -1231,18 +1264,18 @@ item->ResetEnchantAnimation();//~0x000000F0 ptr_50C9A4_ItemToEnchant = nullptr; } - pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v75), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), + pRenderer->BlendTextures(item_X, item_Y, v75, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); } else if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v75)); + pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, v75); else if ( item->uAttributes & ITEM_IDENTIFIED ) - pRenderer->DrawTextureIndexedAlpha(item_X, item_Y, pIcons_LOD->GetTexture(v75)); + pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, v75); else - pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v75)); + pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, v75); if ( !bRingsShownInCharScreen ) - pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(v75), player->pEquipment.uBelt); + pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, v75, player->pEquipment.uBelt); } } //--------------------------------(Shoulder/Плечи)--------------------------------------------- @@ -1274,7 +1307,7 @@ && !player->GetItem(&PlayerEquipment::uShield) ))//без щита { v94 = paperdoll_armor_texture[pBodyComplection][index][2]; - if ( paperdoll_armor_texture[pBodyComplection][index][2] == pIcons_LOD->FindTextureByName("pending") ) + if ( paperdoll_armor_texture[pBodyComplection][index][2] ) { v94 = paperdoll_armor_texture[pBodyComplection][index][1]; item_X = pPaperdoll_BodyX + paperdoll_shoulder_coord[pBodyComplection][index][0]; @@ -1285,11 +1318,11 @@ item_X = pPaperdoll_BodyX + paperdoll_shoulder_second_coord[pBodyComplection][index][0]; item_Y = pPaperdoll_BodyY + paperdoll_shoulder_second_coord[pBodyComplection][index][1]; } - if ( v94 != pIcons_LOD->FindTextureByName("pending") ) + if ( v94 ) { if ( item->ItemEnchanted() ) { - if ( paperdoll_armor_texture[pBodyComplection][index][2] != pIcons_LOD->FindTextureByName("pending") ) + if ( paperdoll_armor_texture[pBodyComplection][index][2] ) { if ( item->AuraEffectRed() ) container = "sptext01"; @@ -1306,23 +1339,23 @@ item->ResetEnchantAnimation();//~0x000000F0 ptr_50C9A4_ItemToEnchant = nullptr; } - pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v94), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), + pRenderer->BlendTextures(item_X, item_Y, v94, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); } } else if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v94)); + pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, v94); else if ( item->uAttributes & ITEM_IDENTIFIED ) - pRenderer->DrawTextureIndexedAlpha(item_X, item_Y, pIcons_LOD->GetTexture(v94)); + pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, v94); else - pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v94)); + pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, v94); } } else//без ничего или с щитом { //v94 = paperdoll_armor_texture[pBodyComplection][index][1]; - if ( paperdoll_armor_texture[pBodyComplection][index][1] != pIcons_LOD->FindTextureByName("pending") ) + if ( paperdoll_armor_texture[pBodyComplection][index][1] ) { item_X = pPaperdoll_BodyX + paperdoll_shoulder_coord[pBodyComplection][index][0]; item_Y = pPaperdoll_BodyY + paperdoll_shoulder_coord[pBodyComplection][index][1]; @@ -1344,16 +1377,15 @@ item->ResetEnchantAnimation();//~0x000000F0 ptr_50C9A4_ItemToEnchant = nullptr; } - pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1]), + pRenderer->BlendTextures(item_X, item_Y, paperdoll_armor_texture[pBodyComplection][index][1], pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); } else if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1])); + pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, paperdoll_armor_texture[pBodyComplection][index][1]); else if ( item->uAttributes & ITEM_IDENTIFIED ) - pRenderer->DrawTextureIndexedAlpha(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1])); + pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, paperdoll_armor_texture[pBodyComplection][index][1]); else - pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1])); - + pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, paperdoll_armor_texture[pBodyComplection][index][1]); } } } @@ -1388,7 +1420,7 @@ item_Y = pPaperdoll_BodyY + paperdoll_CloakCollar[pBodyComplection][index][1]; signed int r = pIcons_LOD->FindTextureByName("item325v2a1"); - if ( paperdoll_cloak_collar_texture[pBodyComplection][index] != pIcons_LOD->FindTextureByName("pending") ) + if ( paperdoll_cloak_collar_texture[pBodyComplection][index] ) { if ( item->ItemEnchanted() ) { @@ -1407,16 +1439,16 @@ item->ResetEnchantAnimation();//~0x000000F0 ptr_50C9A4_ItemToEnchant = nullptr; } - pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_collar_texture[pBodyComplection][index]), + pRenderer->BlendTextures(item_X, item_Y, paperdoll_cloak_collar_texture[pBodyComplection][index], pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); } else if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_collar_texture[pBodyComplection][index])); + pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, paperdoll_cloak_collar_texture[pBodyComplection][index]); else - pRenderer->DrawTextureIndexedAlpha(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_collar_texture[pBodyComplection][index])); + pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, paperdoll_cloak_collar_texture[pBodyComplection][index]); if ( !bRingsShownInCharScreen ) - pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_collar_texture[pBodyComplection][index]), + pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, paperdoll_cloak_collar_texture[pBodyComplection][index], player->pEquipment.uCloak); } } @@ -1424,10 +1456,11 @@ //--------------------------------------------(Beards/Борода)------------------------------------------------------- if ( player->uCurrentFace == 12 || player->uCurrentFace == 13 ) { - if ( papredoll_dbrds[player->uCurrentFace] != pIcons_LOD->FindTextureByName("Pending") ) - pRenderer->DrawTextureIndexedAlpha(pPaperdoll_BodyX + pPaperdoll_Beards[2 * player->uCurrentFace - 24], - pPaperdoll_BodyY + pPaperdoll_Beards[2 * player->uCurrentFace - 23], - pIcons_LOD->GetTexture(papredoll_dbrds[player->uCurrentFace])); + if ( paperdoll_dbrds[player->uCurrentFace]) + pRenderer->DrawTextureAlphaNew( + (pPaperdoll_BodyX + pPaperdoll_Beards[2 * player->uCurrentFace - 24])/640.0f, + (pPaperdoll_BodyY + pPaperdoll_Beards[2 * player->uCurrentFace - 23])/480.0f, + paperdoll_dbrds[player->uCurrentFace]); } //--------------------------------------------(Helm/Шлем)------------------------------------------------------------ if ( player->GetItem(&PlayerEquipment::uHelm) ) @@ -1457,10 +1490,10 @@ { item_X = pPaperdoll_BodyX + paperdoll_Helm[pBodyComplection][index][0]; item_Y = pPaperdoll_BodyY + paperdoll_Helm[pBodyComplection][index][1]; - if ( IsDwarf != 1 || item->uItemID != 92 ) + if ( IsDwarf != 1 || item->uItemID != ITEM_92) v127 = paperdoll_helm_texture[player->GetSexByVoice()][index]; else - v127 = papredoll_dbrds[11]; + v127 = paperdoll_dbrds[11]; if ( item->ItemEnchanted() ) { @@ -1479,18 +1512,18 @@ item->ResetEnchantAnimation(); ptr_50C9A4_ItemToEnchant = nullptr; } - pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v127), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), + pRenderer->BlendTextures(item_X, item_Y, v127, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); } else if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v127)); + pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, v127); else if ( item->uAttributes & ITEM_IDENTIFIED ) - pRenderer->DrawTextureIndexedAlpha(item_X, item_Y, pIcons_LOD->GetTexture(v127)); + pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, v127); else - pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v127)); + pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, v127); if ( !bRingsShownInCharScreen ) - pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(v127), player->pEquipment.uHelm); + pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, v127, player->pEquipment.uHelm); } } //------------------------------------------------(Hand3/Рука3)------------------------------------------- @@ -1504,6 +1537,8 @@ else v181 = item->GetIconName(); + auto texture = assets->GetImage_16BitAlpha(v181); + if ( item->ItemEnchanted() ) { if ( item->AuraEffectRed() ) @@ -1521,19 +1556,18 @@ item->ResetEnchantAnimation(); ptr_50C9A4_ItemToEnchant = nullptr; } - pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE)), + pRenderer->BlendTextures(item_X, item_Y, texture, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); } else if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE))); + pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, texture); else if ( item->uAttributes & ITEM_IDENTIFIED ) - pRenderer->DrawTextureIndexedAlpha(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE))); + pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, texture); else - pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE))); + pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, texture); if ( !bRingsShownInCharScreen ) - pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE)), - player->pEquipment.uMainHand); + pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, texture, player->pEquipment.uMainHand); } //--------------------------------------------------(Shield/Щит)--------------------------------------------- if ( player->GetItem(&PlayerEquipment::uShield) ) @@ -1569,7 +1603,8 @@ item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][0][0] - pItemsTable->pItems[item->uItemID].uEquipX; item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][0][1] - pItemsTable->pItems[item->uItemID].uEquipY; } - v153 = pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE); + //v153 = pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE); + v153 = assets->GetImage_16BitAlpha(item->GetIconName()); if ( item->ItemEnchanted() ) { @@ -1588,33 +1623,40 @@ item->ResetEnchantAnimation(); ptr_50C9A4_ItemToEnchant = nullptr; } - pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v153), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), + pRenderer->BlendTextures(item_X, item_Y, v153, pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); } else if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v153)); + pRenderer->DrawTransparentRedShade(item_X/640.0f, item_Y/480.0f, v153); else if ( !(item->uAttributes & ITEM_IDENTIFIED) ) - pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v153)); + pRenderer->DrawTransparentGreenShade(item_X/640.0f, item_Y/480.0f, v153); else - pRenderer->DrawTextureIndexedAlpha(item_X, item_Y, pIcons_LOD->GetTexture(v153)); + pRenderer->DrawTextureAlphaNew(item_X/640.0f, item_Y/480.0f, v153); if ( two_handed_left_fist )//two-handed - left fist/двуручие - левая кисть - pRenderer->DrawTextureIndexedAlpha(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[pBodyComplection][0], - pPaperdoll_BodyY + pPaperdollLeftEmptyHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_dlhs[uPlayerID - 1])); + pRenderer->DrawTextureAlphaNew( + (pPaperdoll_BodyX + pPaperdollLeftEmptyHand[pBodyComplection][0])/640.0f, + (pPaperdoll_BodyY + pPaperdollLeftEmptyHand[pBodyComplection][1])/480.0f, + papredoll_dlhs[uPlayerID - 1]); if ( !bRingsShownInCharScreen ) - pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(v153), player->pEquipment.uShield); + pRenderer->ZDrawTextureAlpha(item_X/640.0f, item_Y/480.0f, v153, player->pEquipment.uShield); } } //--------------------------------------------------------(RightHand/Правая кисть)-------------------------------------------------- - pRenderer->DrawTextureIndexedAlpha(pPaperdoll_BodyX + pPaperdoll_RightHand[pBodyComplection][0], pPaperdoll_BodyY + pPaperdoll_RightHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_drhs[uPlayerID - 1])); + pRenderer->DrawTextureAlphaNew( + (pPaperdoll_BodyX + pPaperdoll_RightHand[pBodyComplection][0])/640.0f, + (pPaperdoll_BodyY + pPaperdoll_RightHand[pBodyComplection][1])/480.0f, + papredoll_drhs[uPlayerID - 1]); //---------------------------------------------(two-handed - hand/Двуручие - рука)-------------------------------------------------- if ( player->GetItem(&PlayerEquipment::uMainHand) ) { if ( player->GetMainHandItem()->GetItemEquipType() == EQUIP_TWO_HANDED || player->GetMainHandItem()->GetPlayerSkillType() == PLAYER_SKILL_SPEAR && !player->GetItem(&PlayerEquipment::uShield) ) - pRenderer->DrawTextureIndexedAlpha(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[pBodyComplection][0], - pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_dlaus[uPlayerID - 1])); + pRenderer->DrawTextureAlphaNew( + (pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[pBodyComplection][0])/640.0f, + (pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1])/480.0f, + papredoll_dlaus[uPlayerID - 1]); } //--------------------------------------------------------(two-handed - fist/двуручие - кисть)---------------------------------------------------- if ( player->GetItem(&PlayerEquipment::uMainHand)) @@ -1623,21 +1665,22 @@ if ( item->GetItemEquipType() == EQUIP_TWO_HANDED || item->GetPlayerSkillType() == PLAYER_SKILL_SPEAR && !player->GetItem(&PlayerEquipment::uShield) ) - pRenderer->DrawTextureIndexedAlpha(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[pBodyComplection][0], - pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1], - pIcons_LOD->GetTexture(papredoll_dlhus[uPlayerID - 1])); + pRenderer->DrawTextureAlphaNew( + (pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[pBodyComplection][0])/640.0f, + (pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1])/480.0f, + papredoll_dlhus[uPlayerID - 1]); } if ( !bRingsShownInCharScreen )//рисование лупы pRenderer->DrawTextureAlphaNew(603/640.0f, 299/480.0f, ui_character_inventory_magnification_glass); - pRenderer->DrawTextureAlphaNew(468 / 640.0f, 0, game_ui_right_panel_frame); + pRenderer->DrawTextureAlphaNew(468/640.0f, 0, game_ui_right_panel_frame); } //----- (0041A2D1) -------------------------------------------------------- void CharacterUI_InventoryTab_Draw(Player *player, bool a2) { - Texture *pTexture; // esi@6 + Image *pTexture; // esi@6 unsigned int v17; // edi@15 unsigned int uCellX; // [sp+30h] [bp-8h]@5 unsigned int uCellY; // [sp+34h] [bp-4h]@5 @@ -1654,22 +1697,28 @@ continue; uCellY = 32 * (i / 14) + 17; uCellX = 32 * (i % 14) + 14; - uint item_texture_id = pIcons_LOD->LoadTexture(player->pInventoryItemList[player->pInventoryMatrix[i] - 1].GetIconName(), TEXTURE_16BIT_PALETTE); - pTexture = pIcons_LOD->GetTexture(item_texture_id); - if (pTexture->uTextureWidth < 14) - pTexture->uTextureWidth = 14; - if ( (pTexture->uTextureWidth - 14) / 32 == 0 && pTexture->uTextureWidth < 32) - uCellX += (32 - pTexture->uTextureWidth) / 2; - //v13 = pTexture->uTextureWidth - 14; - //LOBYTE(v13) = v13 & 0xE0; - //v15 = v13 + 32; - if (pTexture->uTextureHeight < 14 ) - pTexture->uTextureHeight = 14; - v17 = uCellX + (( (int)((pTexture->uTextureWidth - 14) & 0xE0) + 32 - pTexture->uTextureWidth) / 2) - + pSRZBufferLineOffsets[uCellY + (( (int)((pTexture->uTextureHeight - 14) & 0xFFFFFFE0) - pTexture->uTextureHeight + 32) / 2)]; //added typecast. without it the value in the brackets got cat to unsigned which messed stuff up + + //uint item_texture_id = pIcons_LOD->LoadTexture(player->pInventoryItemList[player->pInventoryMatrix[i] - 1].GetIconName(), TEXTURE_16BIT_PALETTE); + //pTexture = pIcons_LOD->GetTexture(item_texture_id); + pTexture = assets->GetImage_16BitAlpha(player->pInventoryItemList[player->pInventoryMatrix[i] - 1].GetIconName()); + + //if (pTexture->uTextureWidth < 14) + // pTexture->uTextureWidth = 14; + int width = pTexture->GetWidth(); + if (width < 14) + width = 14; + + if ( (width - 14) / 32 == 0 && width < 32) + uCellX += (32 - width) / 2; + + int height = pTexture->GetHeight(); + if (height < 14 ) + height = 14; + v17 = uCellX + (( (int)((width - 14) & 0xE0) + 32 - width) / 2) + + pSRZBufferLineOffsets[uCellY + (( (int)((height - 14) & 0xFFFFFFE0) - height + 32) / 2)]; //added typecast. without it the value in the brackets got cat to unsigned which messed stuff up if (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes & ITEM_ENCHANT_ANIMATION) { - Texture *loadedTextureptr = nullptr; + Texture_MM7 *loadedTextureptr = nullptr; switch (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes & ITEM_ENCHANT_ANIMATION) { case ITEM_AURA_EFFECT_RED: loadedTextureptr = pIcons_LOD->LoadTexturePtr("sptext01", TEXTURE_16BIT_PALETTE); break; @@ -1685,21 +1734,21 @@ ptr_50C9A4_ItemToEnchant = nullptr; } - pRenderer->DrawAura(uCellX, uCellY, pTexture, loadedTextureptr, GetTickCount() * 0.1, 0, 255); - ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, player->pInventoryMatrix[i]); + pRenderer->BlendTextures(uCellX, uCellY, pTexture, loadedTextureptr, GetTickCount() * 0.1, 0, 255); + //ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, player->pInventoryMatrix[i]); } else { if (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].IsIdentified() || current_screen_type != SCREEN_HOUSE) { if (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].IsBroken()) - pRenderer->DrawTransparentRedShade(uCellX, uCellY, pTexture); + pRenderer->DrawTransparentRedShade(uCellX/640.0f, uCellY/480.0f, pTexture); else - pRenderer->DrawTextureIndexedAlpha(uCellX, uCellY, pTexture); + pRenderer->DrawTextureAlphaNew(uCellX/640.0f, uCellY/480.0f, pTexture); } else - pRenderer->DrawTransparentGreenShade(uCellX, uCellY, pTexture); - ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, player->pInventoryMatrix[i]); + pRenderer->DrawTransparentGreenShade(uCellX/640.0f, uCellY/480.0f, pTexture); + //ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, player->pInventoryMatrix[i]); continue; } } @@ -1707,11 +1756,12 @@ static void CharacterUI_DrawItem(int x, int y, ItemGen *item, int id) { - Texture* item_texture = pIcons_LOD->LoadTexturePtr(item->GetIconName(), TEXTURE_16BIT_PALETTE); + //Texture_MM7* item_texture = pIcons_LOD->LoadTexturePtr(item->GetIconName(), TEXTURE_16BIT_PALETTE); + auto item_texture = assets->GetImage_16BitAlpha(item->GetIconName()); if (item->uAttributes & ITEM_ENCHANT_ANIMATION) // enchant animation { - Texture *enchantment_texture = nullptr; + Texture_MM7 *enchantment_texture = nullptr; switch (item->uAttributes & ITEM_ENCHANT_ANIMATION) { case ITEM_AURA_EFFECT_RED: enchantment_texture = pIcons_LOD->LoadTexturePtr("sptext01", TEXTURE_16BIT_PALETTE); break; @@ -1727,16 +1777,16 @@ item->uAttributes &= 0xFFFFFF0F; ptr_50C9A4_ItemToEnchant = nullptr; } - pRenderer->DrawAura(x, y, item_texture, enchantment_texture, GetTickCount() * 0.1, 0, 255); + pRenderer->BlendTextures(x, y, item_texture, enchantment_texture, GetTickCount() * 0.1, 0, 255); } else { if (item->IsBroken()) - pRenderer->DrawTransparentRedShade(x, y, item_texture); + pRenderer->DrawTransparentRedShade(x/640.0f, y/480.0f, item_texture); else if (!item->IsIdentified()) - pRenderer->DrawTransparentGreenShade(x, y, item_texture); + pRenderer->DrawTransparentGreenShade(x/640.0f, y/480.0f, item_texture); else - pRenderer->DrawTextureIndexedAlpha(x, y, item_texture); + pRenderer->DrawTextureAlphaNew(x/640.0f, y/480.0f, item_texture); pRenderer->ZBuffer_Fill_2(x, y, item_texture, id); } @@ -1796,51 +1846,57 @@ else v3 = (pPlayers[i + 1]->GetSexByVoice() != 0) + 1; wsprintfA(pContainer, "pc23v%dBod", v3); - papredoll_dbods[i] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);//Body texture + papredoll_dbods[i] = assets->GetImage_16BitAlpha(pContainer);//Body texture wsprintfA(pContainer, "pc23v%dlad", v3); - papredoll_dlads[i] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Hand + papredoll_dlads[i] = assets->GetImage_16BitAlpha(pContainer);// Left Hand wsprintfA(pContainer, "pc23v%dlau", v3); - papredoll_dlaus[i] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Hand2 + papredoll_dlaus[i] = assets->GetImage_16BitAlpha(pContainer);// Left Hand2 wsprintfA(pContainer, "pc23v%drh", v3); - papredoll_drhs[i] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Right Hand + papredoll_drhs[i] = assets->GetImage_16BitAlpha(pContainer);// Right Hand wsprintfA(pContainer, "pc23v%dlh", v3); - papredoll_dlhs[i] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Fist + papredoll_dlhs[i] = assets->GetImage_16BitAlpha(pContainer);// Left Palm wsprintfA(pContainer, "pc23v%dlhu", v3); - papredoll_dlhus[i] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); // Left Fist 2 + papredoll_dlhus[i] = assets->GetImage_16BitAlpha(pContainer); // Left Fist pPlayer = pPlayers[i + 1]; + if ( pPlayer->uCurrentFace == 12 || pPlayer->uCurrentFace == 13 ) - papredoll_dbrds[(char)pPlayer->uCurrentFace] = 0; - papredoll_flying_feet[pPlayer->uCurrentFace] = 0; - IsPlayerWearingWatersuit[i + 1] = 1; + paperdoll_dbrds[(char)pPlayer->uCurrentFace] = nullptr; + papredoll_flying_feet[pPlayer->uCurrentFace] = nullptr; + + IsPlayerWearingWatersuit[i + 1] = true; } else { - papredoll_dbods[i] = pIcons_LOD->LoadTexture(dbod_texnames_by_face[pPlayers[i + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); - papredoll_dlads[i] = pIcons_LOD->LoadTexture(dlad_texnames_by_face[pPlayers[i + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); - papredoll_dlaus[i] = pIcons_LOD->LoadTexture(dlau_texnames_by_face[pPlayers[i + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); - papredoll_drhs[i] = pIcons_LOD->LoadTexture(drh_texnames_by_face[pPlayers[i + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); - papredoll_dlhs[i] = pIcons_LOD->LoadTexture(dlh_texnames_by_face[pPlayers[i + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); - papredoll_dlhus[i] = pIcons_LOD->LoadTexture(dlhu_texnames_by_face[pPlayers[i + 1]->uCurrentFace], TEXTURE_16BIT_PALETTE); + papredoll_dbods[i] = assets->GetImage_16BitAlpha(dbod_texnames_by_face[pPlayers[i + 1]->uCurrentFace]); + papredoll_dlads[i] = assets->GetImage_16BitAlpha(dlad_texnames_by_face[pPlayers[i + 1]->uCurrentFace]); + papredoll_dlaus[i] = assets->GetImage_16BitAlpha(dlau_texnames_by_face[pPlayers[i + 1]->uCurrentFace]); + papredoll_drhs[i] = assets->GetImage_16BitAlpha(drh_texnames_by_face[pPlayers[i + 1]->uCurrentFace]); + papredoll_dlhs[i] = assets->GetImage_16BitAlpha(dlh_texnames_by_face[pPlayers[i + 1]->uCurrentFace]); + papredoll_dlhus[i] = assets->GetImage_16BitAlpha(dlhu_texnames_by_face[pPlayers[i + 1]->uCurrentFace]); + + wchar_t name[1024]; if ( pPlayers[i + 1]->uCurrentFace == 12 || pPlayers[i + 1]->uCurrentFace == 13 ) { - wsprintfA(pContainer, "pc%02dbrd", pPlayers[i + 1]->uCurrentFace + 1); - papredoll_dbrds[pPlayers[i + 1]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + wsprintfW(name, L"pc%02dbrd", pPlayers[i + 1]->uCurrentFace + 1); + paperdoll_dbrds[pPlayers[i + 1]->uCurrentFace] = assets->GetImage_16BitAlpha(name); } - wsprintfA(pContainer, "item281pc%02d", pPlayers[i + 1]->uCurrentFace + 1); - papredoll_flying_feet[pPlayers[i + 1]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + wsprintfW(name, L"item281pc%02d", pPlayers[i + 1]->uCurrentFace + 1); + papredoll_flying_feet[pPlayers[i + 1]->uCurrentFace] = assets->GetImage_16BitAlpha(name); IsPlayerWearingWatersuit[i + 1] = 0; } } - uTextureID_ar_up_up = pIcons_LOD->LoadTexture("ar_up_up", TEXTURE_16BIT_PALETTE); - uTextureID_ar_up_dn = pIcons_LOD->LoadTexture("ar_up_dn", TEXTURE_16BIT_PALETTE); - uTextureID_ar_dn_up = pIcons_LOD->LoadTexture("ar_dn_up", TEXTURE_16BIT_PALETTE); - uTextureID_ar_dn_dn = pIcons_LOD->LoadTexture("ar_dn_dn", TEXTURE_16BIT_PALETTE); - papredoll_dbrds[9] = pIcons_LOD->LoadTexture("ib-cd1-d", TEXTURE_16BIT_PALETTE); - papredoll_dbrds[7] = pIcons_LOD->LoadTexture("ib-cd2-d", TEXTURE_16BIT_PALETTE); - papredoll_dbrds[5] = pIcons_LOD->LoadTexture("ib-cd3-d", TEXTURE_16BIT_PALETTE); - papredoll_dbrds[3] = pIcons_LOD->LoadTexture("ib-cd4-d", TEXTURE_16BIT_PALETTE); - papredoll_dbrds[1] = pIcons_LOD->LoadTexture("ib-cd5-d", TEXTURE_16BIT_PALETTE); + ui_ar_up_up = assets->GetImage_16BitAlpha(L"ar_up_up"); + ui_ar_up_dn = assets->GetImage_16BitAlpha(L"ar_up_dn"); + ui_ar_dn_up = assets->GetImage_16BitAlpha(L"ar_dn_up"); + ui_ar_dn_dn = assets->GetImage_16BitAlpha(L"ar_dn_dn"); + + paperdoll_dbrds[9] = assets->GetImage_16BitAlpha(L"ib-cd1-d"); + paperdoll_dbrds[7] = assets->GetImage_16BitAlpha(L"ib-cd2-d"); + paperdoll_dbrds[5] = assets->GetImage_16BitAlpha(L"ib-cd3-d"); + paperdoll_dbrds[3] = assets->GetImage_16BitAlpha(L"ib-cd4-d"); + paperdoll_dbrds[1] = assets->GetImage_16BitAlpha(L"ib-cd5-d"); + for ( uint i = 0; i < 54; ++i )// test equipment { party_has_equipment[i] = 0; @@ -1882,27 +1938,28 @@ for ( uint j = 0; j < 5; ++j )//Belt { GetItemTextureFilename(pContainer, j + 100, i + 1, 0); - paperdoll_belt_texture[i][j] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_belt_texture[i][j] = assets->GetImage_16BitAlpha(pContainer); } GetItemTextureFilename(pContainer, 535, i + 1, 0); - paperdoll_belt_texture[i][6] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_belt_texture[i][6] = assets->GetImage_16BitAlpha(pContainer); for ( uint j = 0; j < 11; ++j )//Helm { GetItemTextureFilename(pContainer, j + 89, i + 1, 0); - paperdoll_helm_texture[i][j] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_helm_texture[i][j] = assets->GetImage_16BitAlpha(pContainer); } GetItemTextureFilename(pContainer, 521, i + 1, 0); - paperdoll_helm_texture[i][11] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_helm_texture[i][11] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 522, i + 1, 0); - paperdoll_helm_texture[i][12] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_helm_texture[i][12] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 523, i + 1, 0); - paperdoll_helm_texture[i][13] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_helm_texture[i][13] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 532, i + 1, 0); - paperdoll_helm_texture[i][14] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_helm_texture[i][14] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 544, i + 1, 0); - paperdoll_helm_texture[i][15] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_helm_texture[i][15] = assets->GetImage_16BitAlpha(pContainer); + if ( IsDwarfPresentInParty(true) ) //the phynaxian helm uses a slightly different graphic for dwarves - papredoll_dbrds[11] = pIcons_LOD->LoadTexture("item092v3", TEXTURE_16BIT_PALETTE); + paperdoll_dbrds[11] = assets->GetImage_16BitAlpha(L"item092v3"); } //v43 = 0; for (uint i = 0; i < 4; ++i) @@ -1910,76 +1967,77 @@ if ( ShouldLoadTexturesForRaceAndGender(i) ) { GetItemTextureFilename(pContainer, 524, i + 1, 0); - paperdoll_belt_texture[i][5] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);//Titans belt + paperdoll_belt_texture[i][5] = assets->GetImage_16BitAlpha(pContainer);//Titans belt pItemTXTNum = 66; for ( v32 = 0; v32 < 13; ++v32 )//simple armor { GetItemTextureFilename(pContainer, pItemTXTNum, i + 1, 0); - paperdoll_armor_texture[i][v32][0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// armor + paperdoll_armor_texture[i][v32][0] = assets->GetImage_16BitAlpha(pContainer);// armor GetItemTextureFilename(pContainer, pItemTXTNum, i + 1, 1); - paperdoll_armor_texture[i][v32][1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// shoulder 1 + paperdoll_armor_texture[i][v32][1] = assets->GetImage_16BitAlpha(pContainer);// shoulder 1 GetItemTextureFilename(pContainer, pItemTXTNum, i + 1, 2); - paperdoll_armor_texture[i][v32][2] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// shoulder 2 + paperdoll_armor_texture[i][v32][2] = assets->GetImage_16BitAlpha(pContainer);// shoulder 2 pItemTXTNum++; } GetItemTextureFilename(pContainer, 516, i + 1, 0);//artefacts - paperdoll_armor_texture[i][v32][0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_armor_texture[i][v32][0] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 516, i + 1, 1); - paperdoll_armor_texture[i][v32][1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_armor_texture[i][v32][1] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 516, i + 1, 2); - paperdoll_armor_texture[i][v32][2] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_armor_texture[i][v32][2] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 505, i + 1, 0); - paperdoll_armor_texture[i][v32 + 1][0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_armor_texture[i][v32 + 1][0] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 505, i + 1, 1); - paperdoll_armor_texture[i][v32 + 1][1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_armor_texture[i][v32 + 1][1] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 505, i + 1, 2); - paperdoll_armor_texture[i][v32 + 1][2] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_armor_texture[i][v32 + 1][2] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 504, i + 1, 0); - paperdoll_armor_texture[i][v32 + 2][0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_armor_texture[i][v32 + 2][0] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 504, i + 1, 1); - paperdoll_armor_texture[i][v32 + 2][1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_armor_texture[i][v32 + 2][1] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 504, i + 1, 2); - paperdoll_armor_texture[i][v32 + 2][2] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_armor_texture[i][v32 + 2][2] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 533, i + 1, 0); - paperdoll_armor_texture[i][v32 + 3][0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_armor_texture[i][v32 + 3][0] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 533, i + 1, 1); - paperdoll_armor_texture[i][v32 + 3][1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_armor_texture[i][v32 + 3][1] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 533, i + 1, 2); - paperdoll_armor_texture[i][v32 + 3][2] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_armor_texture[i][v32 + 3][2] = assets->GetImage_16BitAlpha(pContainer); for ( v33 = 0; v33 < 5; ++v33 )//boots { GetItemTextureFilename(pContainer, v33 + 115, i + 1, 0); - paperdoll_boots_texture[i][v33] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_boots_texture[i][v33] = assets->GetImage_16BitAlpha(pContainer); } GetItemTextureFilename(pContainer, 512, i + 1, 0); - paperdoll_boots_texture[i][v33] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_boots_texture[i][v33] = assets->GetImage_16BitAlpha(pContainer); for ( v38 = 0; v38 < 5; ++v38 )//Cloak { GetItemTextureFilename(pContainer, v38 + 105, i + 1, 0); - paperdoll_cloak_texture[i][v38] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_cloak_texture[i][v38] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, v38 + 105, i + 1, 1); - paperdoll_cloak_collar_texture[i][v38] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_cloak_collar_texture[i][v38] = assets->GetImage_16BitAlpha(pContainer); } + GetItemTextureFilename(pContainer, 525, i + 1, 0); - paperdoll_cloak_texture[i][5] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_cloak_texture[i][5] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 530, i + 1, 0); - paperdoll_cloak_texture[i][6] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_cloak_texture[i][6] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 547, i + 1, 0); - paperdoll_cloak_texture[i][7] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_cloak_texture[i][7] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 548, i + 1, 0); - paperdoll_cloak_texture[i][8] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_cloak_texture[i][8] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 550, i + 1, 0); - paperdoll_cloak_texture[i][9] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_cloak_texture[i][9] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 525, i + 1, 1); - paperdoll_cloak_collar_texture[i][5] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_cloak_collar_texture[i][5] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 530, i + 1, 1); - paperdoll_cloak_collar_texture[i][6] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_cloak_collar_texture[i][6] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 547, i + 1, 1); - paperdoll_cloak_collar_texture[i][7] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_cloak_collar_texture[i][7] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 548, i + 1, 1); - paperdoll_cloak_collar_texture[i][8] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_cloak_collar_texture[i][8] = assets->GetImage_16BitAlpha(pContainer); GetItemTextureFilename(pContainer, 550, i + 1, 1); - paperdoll_cloak_collar_texture[i][9] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + paperdoll_cloak_collar_texture[i][9] = assets->GetImage_16BitAlpha(pContainer); } //else //{ @@ -2364,23 +2422,25 @@ texture_num = (player_sex != 0) + 3; else texture_num = (player_sex != 0) + 1; + wsprintfA(pContainer, "pc23v%dBod", texture_num); - papredoll_dbods[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + papredoll_dbods[uPlayerID - 1] = assets->GetImage_16BitAlpha(pContainer); wsprintfA(pContainer, "pc23v%dlad", texture_num); - papredoll_dlads[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + papredoll_dlads[uPlayerID - 1] = assets->GetImage_16BitAlpha(pContainer); wsprintfA(pContainer, "pc23v%dlau", texture_num); - papredoll_dlaus[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + papredoll_dlaus[uPlayerID - 1] = assets->GetImage_16BitAlpha(pContainer); wsprintfA(pContainer, "pc23v%drh", texture_num); - papredoll_drhs[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + papredoll_drhs[uPlayerID - 1] = assets->GetImage_16BitAlpha(pContainer); wsprintfA(pContainer, "pc23v%dlh", texture_num); - papredoll_dlhs[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + papredoll_dlhs[uPlayerID - 1] = assets->GetImage_16BitAlpha(pContainer); wsprintfA(pContainer, "pc23v%dlhu", texture_num); - papredoll_dlhus[uPlayerID - 1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + papredoll_dlhus[uPlayerID - 1] = assets->GetImage_16BitAlpha(pContainer); if ( pPlayers[uPlayerID]->uCurrentFace == 12 || pPlayers[uPlayerID]->uCurrentFace == 13 ) - papredoll_dbrds[pPlayers[uPlayerID]->uCurrentFace] = 0; - papredoll_flying_feet[pPlayers[uPlayerID]->uCurrentFace] = 0; - IsPlayerWearingWatersuit[uPlayerID] = 1; + paperdoll_dbrds[pPlayers[uPlayerID]->uCurrentFace] = nullptr; + papredoll_flying_feet[pPlayers[uPlayerID]->uCurrentFace] = nullptr; + + IsPlayerWearingWatersuit[uPlayerID] = true; } } @@ -2391,21 +2451,24 @@ if (uPlayerID > 0 ) { - papredoll_dbods[uPlayerID - 1] = pIcons_LOD->LoadTexture(dbod_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); - papredoll_dlads[uPlayerID - 1] = pIcons_LOD->LoadTexture(dlad_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); - papredoll_dlaus[uPlayerID - 1] = pIcons_LOD->LoadTexture(dlau_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); - papredoll_drhs [uPlayerID - 1] = pIcons_LOD->LoadTexture(drh_texnames_by_face [pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); - papredoll_dlhs [uPlayerID - 1] = pIcons_LOD->LoadTexture(dlh_texnames_by_face [pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); - papredoll_dlhus[uPlayerID - 1] = pIcons_LOD->LoadTexture(dlhu_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace], TEXTURE_16BIT_PALETTE); + papredoll_dbods[uPlayerID - 1] = assets->GetImage_16BitAlpha(dbod_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace]); + papredoll_dlads[uPlayerID - 1] = assets->GetImage_16BitAlpha(dlad_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace]); + papredoll_dlaus[uPlayerID - 1] = assets->GetImage_16BitAlpha(dlau_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace]); + papredoll_drhs [uPlayerID - 1] = assets->GetImage_16BitAlpha(drh_texnames_by_face [pPlayers[uPlayerID]->uCurrentFace]); + papredoll_dlhs [uPlayerID - 1] = assets->GetImage_16BitAlpha(dlh_texnames_by_face [pPlayers[uPlayerID]->uCurrentFace]); + papredoll_dlhus[uPlayerID - 1] = assets->GetImage_16BitAlpha(dlhu_texnames_by_face[pPlayers[uPlayerID]->uCurrentFace]); + wchar_t name[1024]; if ( pPlayers[uPlayerID]->uCurrentFace == 12 || pPlayers[uPlayerID]->uCurrentFace == 13 ) { - wsprintfA(pContainer, "pc%02dbrd", pPlayers[uPlayerID]->uCurrentFace + 1); - papredoll_dbrds[pPlayers[uPlayerID]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + wsprintfW(name, L"pc%02dbrd", pPlayers[uPlayerID]->uCurrentFace + 1); + paperdoll_dbrds[pPlayers[uPlayerID]->uCurrentFace] = assets->GetImage_16BitAlpha(name); } - wsprintfA(pContainer, "item281pc%02d", pPlayers[uPlayerID]->uCurrentFace + 1); - papredoll_flying_feet[pPlayers[uPlayerID]->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - IsPlayerWearingWatersuit[uPlayerID] = 0; + + wsprintfW(name, L"item281pc%02d", pPlayers[uPlayerID]->uCurrentFace + 1); + papredoll_flying_feet[pPlayers[uPlayerID]->uCurrentFace] = assets->GetImage_16BitAlpha(name); + + IsPlayerWearingWatersuit[uPlayerID] = false; } }
--- a/GUI/UI/UICharacter.h Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/UICharacter.h Mon Mar 07 03:48:40 2016 +0200 @@ -29,4 +29,6 @@ extern class Image *ui_character_stats_background; extern class Image *ui_character_inventory_background; extern class Image *ui_character_inventory_background_strip; -extern class Image *ui_character_inventory_paperdoll_background; \ No newline at end of file +extern class Image *ui_character_inventory_paperdoll_background; + +extern std::array<struct Image *, 16> paperdoll_dbrds; \ No newline at end of file
--- a/GUI/UI/UIGame.h Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/UIGame.h Mon Mar 07 03:48:40 2016 +0200 @@ -53,4 +53,51 @@ extern class Image *game_ui_rightframe; extern class Image *game_ui_topframe; extern class Image *game_ui_leftframe; -extern class Image *game_ui_bottomframe; \ No newline at end of file +extern class Image *game_ui_bottomframe; + +extern class Image *game_ui_monster_hp_green; +extern class Image *game_ui_monster_hp_yellow; +extern class Image *game_ui_monster_hp_red; +extern class Image *game_ui_monster_hp_background; +extern class Image *game_ui_monster_hp_border_left; +extern class Image *game_ui_monster_hp_border_right; + +extern class Image *game_ui_bar_red; +extern class Image *game_ui_bar_yellow; +extern class Image *game_ui_bar_green; +extern class Image *game_ui_bar_blue; + +extern class Image *game_ui_player_alert_yellow; // 5079C8 +extern class Image *game_ui_player_alert_red; // 5079CC +extern class Image *game_ui_player_alert_green; // 5079D0 + +extern class Image *game_ui_minimap_frame; // 5079D8 +extern class Image *game_ui_minimap_compass; // 5079B4 +extern std::array<class Image *, 8> game_ui_minimap_dirs; + +extern class Image *game_ui_menu_quit; +extern class Image *game_ui_menu_resume; +extern class Image *game_ui_menu_controls; +extern class Image *game_ui_menu_save; +extern class Image *game_ui_menu_load; +extern class Image *game_ui_menu_new; +extern class Image *game_ui_menu_options; + +extern class Image *game_ui_tome_storyline; +extern class Image *game_ui_tome_calendar; +extern class Image *game_ui_tome_maps; +extern class Image *game_ui_tome_autonotes; +extern class Image *game_ui_tome_quests; + +extern class Image *game_ui_btn_rest; +extern class Image *game_ui_btn_cast; +extern class Image *game_ui_btn_zoomin; +extern class Image *game_ui_btn_zoomout; +extern class Image *game_ui_btn_quickref; +extern class Image *game_ui_btn_settings; + +extern class Image *game_ui_dialogue_background; + +extern std::array<class Image *, 5> game_ui_options_controls; + +extern class Image *game_ui_evtnpc; // 50795C \ No newline at end of file
--- a/GUI/UI/UIHouses.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/UIHouses.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -7,6 +7,8 @@ #include "Engine/Engine.h" #include "Engine/AssetsManager.h" +#include "GUI/UI/UIGame.h" + #include "UIGuilds.h" #include "UIPartyCreation.h" #include "UIShops.h" @@ -804,7 +806,7 @@ // int v11; // ecx@17 // unsigned int v12; // kr00_4@25 // int v14; // eax@25 - unsigned int v17; // eax@37 + //unsigned int v17; // eax@37 signed int v18; // edi@37 signed int v19; // edi@41 char pContainer[40]; // [sp+Ch] [bp-30h]@32 @@ -901,9 +903,10 @@ default: Error("Invalid alignment type: %u", pParty->alignment); } - v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - pDialogueNPCCount = 0; - pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v17]; + pDialogueNPCCount = 0; + //v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + //game_ui_dialogue_background = &pIcons_LOD->pTextures[v17]; + game_ui_dialogue_background = assets->GetImage_16Bit(pContainer); PrepareHouse(uHouseID); v18 = 1; @@ -1042,7 +1045,7 @@ pDialogueWindow->Release(); pDialogueWindow = new GUIWindow(0, 0, window->GetWidth(), 345, 0, 0); pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation" - pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); + ui_buttdesc2, 0); pDialogueWindow->CreateButton(8, 8, 450, 320, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", nullptr); } if ( in_current_building_type != BuildingType_Training ) @@ -1054,7 +1057,7 @@ pDialogueWindow->Release(); pDialogueWindow = new GUIWindow(0, 0, window->GetWidth(), 345, 0, 0); pBtn_ExitCancel = pDialogueWindow->CreateButton(526, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation" - pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); + ui_buttdesc2, 0); pDialogueWindow->CreateButton(8, 8, 450, 320, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", nullptr); } else if (uActiveCharacter) @@ -1736,7 +1739,7 @@ pOutString = pFontCreate; pTextHeight = pFontCreate->CalcTextHeight(current_npc_text, &window, 13, 0) + 7; } - pRenderer->GetLeather(8, 352 - pTextHeight, pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - pTextHeight); + pRenderer->DrawTextureCustomHeight(8/640.0f, (352 - pTextHeight)/480.0f, ui_leather_mm7, pTextHeight); pRenderer->DrawTextureAlphaNew(8/640.0f, (347 - pTextHeight)/480.0f, _591428_endcap); window.DrawText(pOutString, 13, 354 - pTextHeight, 0, FitTextInAWindow(current_npc_text, pOutString, &window, 13, 0), 0, 0, 0); break; @@ -2035,7 +2038,7 @@ pOutString = pFontCreate; pTextHeight = pFontCreate->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0) + 7; } - pRenderer->GetLeather(8, 352 - pTextHeight, pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - pTextHeight); + pRenderer->DrawTextureCustomHeight(8/640.0f, (352 - pTextHeight)/480.0f, ui_leather_mm7, pTextHeight); pRenderer->DrawTextureAlphaNew(8/640.0f, (347 - pTextHeight)/480.0f, _591428_endcap); window_SpeakInHouse->DrawText(pOutString, 12, 354 - pTextHeight, 0, FitTextInAWindow(pTmpBuf.data(), pOutString, &dialog_window, 0xCu, 0), 0, 0, 0); break; @@ -2046,7 +2049,7 @@ dialog_window.uFrameWidth = game_viewport_width; dialog_window.uFrameZ = 452; pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0) + 7; - pRenderer->GetLeather(8, 352 - pTextHeight, pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - pTextHeight); + pRenderer->DrawTextureCustomHeight(8/640.0f, (352 - pTextHeight)/480.0f, ui_leather_mm7, pTextHeight); pRenderer->DrawTextureAlphaNew(8/640.0f, (347 - pTextHeight)/480.0f, _591428_endcap); window_SpeakInHouse->DrawText(pFontArrus, 12, 354 - pTextHeight, 0, FitTextInAWindow(pTmpBuf.data(), pFontArrus, &dialog_window, 0xCu, 0), 0, 0, 0); @@ -2924,9 +2927,11 @@ house_window.uFrameZ = 452; pInString = pNPCStats->pNPCGreetings[pNPC->greet].pGreetings[((pNPC->uFlags & 3) == 2)]; //pInString = (char *)*(&pNPCStats->field_17884 + ((pNPC->uFlags & 3) == 2) + 2 * pNPC->greet); - pRenderer->GetLeather(8, 352 - (pFontArrus->CalcTextHeight(pInString, &house_window, 13, 0) + 7), - pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - - (pFontArrus->CalcTextHeight(pInString, &house_window, 13, 0) + 7)); + pRenderer->DrawTextureCustomHeight( + 8/640.0f, + (352 - (pFontArrus->CalcTextHeight(pInString, &house_window, 13, 0) + 7))/480.0f, + ui_leather_mm7, + (pFontArrus->CalcTextHeight(pInString, &house_window, 13, 0) + 7)); int h = (pFontArrus->CalcTextHeight(pInString, &house_window, 13, 0) + 7); pRenderer->DrawTextureAlphaNew(8/640.0f, (347 - h)/480.0f, _591428_endcap); @@ -3084,7 +3089,7 @@ pTextFont = pFontCreate; pTextHeight = pFontCreate->CalcTextHeight(current_npc_text, &w, 13, 0) + 7; } - pRenderer->GetLeather(8, 352 - pTextHeight, pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - pTextHeight); + pRenderer->DrawTextureCustomHeight(8/640.0f, (352 - pTextHeight)/480.0f, ui_leather_mm7, pTextHeight); pRenderer->DrawTextureAlphaNew(8/640.0f, (347 - pTextHeight)/480.0f, _591428_endcap); house_window.DrawText(pTextFont, 13, 354 - pTextHeight, 0, FitTextInAWindow(current_npc_text, pTextFont, &w, 13, 0), 0, 0, 0); }
--- a/GUI/UI/UIMainMenu.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/UIMainMenu.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -16,8 +16,10 @@ #include "IO/Mouse.h" #include "IO/Keyboard.h" +#include "GUI/GUIFont.h" #include "GUI/UI/UIMainMenu.h" -#include "GUI/GUIFont.h" +#include "GUI/UI/UIGame.h" +#include "GUI/UI/UIPartyCreation.h" #include "Media/Audio/AudioPlayer.h" @@ -31,6 +33,10 @@ GUIButton *pMainMenu_BtnLoad = nullptr; GUIButton *pMainMenu_BtnNew = nullptr; +Image *ui_mainmenu_new = nullptr; +Image *ui_mainmenu_load = nullptr; +Image *ui_mainmenu_credits = nullptr; +Image *ui_mainmenu_exit = nullptr; GUIWindow_MainMenu::GUIWindow_MainMenu() : @@ -38,15 +44,15 @@ { // ----------------------------------- // 004627B7 void MainMenu_Loop -- part - Texture *pNew = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE); - Texture *pLoad = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE); - Texture *pCredits = pIcons_LOD->LoadTexturePtr("title_cred", TEXTURE_16BIT_PALETTE); - Texture *pExit = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE); + ui_mainmenu_new = assets->GetImage_16BitColorKey(L"title_new", 0x7FF); + ui_mainmenu_load = assets->GetImage_16BitColorKey(L"title_load", 0x7FF); + ui_mainmenu_credits = assets->GetImage_16BitColorKey(L"title_cred", 0x7FF); + ui_mainmenu_exit = assets->GetImage_16BitColorKey(L"title_exit", 0x7FF); - pMainMenu_BtnNew = CreateButton(495, 172, pNew->uTextureWidth, pNew->uTextureHeight, 1, 0, UIMSG_MainMenu_ShowPartyCreationWnd, 0, 'N', "", pNew, 0); - pMainMenu_BtnLoad = CreateButton(495, 227, pLoad->uTextureWidth, pLoad->uTextureHeight, 1, 0, UIMSG_MainMenu_ShowLoadWindow, 1, 'L', "", pLoad, 0); - pMainMenu_BtnCredits = CreateButton(495, 282, pCredits->uTextureWidth, pCredits->uTextureHeight, 1, 0, UIMSG_ShowCredits, 2, 'C', "", pCredits, 0); - pMainMenu_BtnExit = CreateButton(495, 337, pExit->uTextureWidth, pExit->uTextureHeight, 1, 0, UIMSG_ExitToWindows, 3, 0, "", pExit, 0); + pMainMenu_BtnNew = CreateButton(495, 172, ui_mainmenu_new->GetWidth(), ui_mainmenu_new->GetHeight(), 1, 0, UIMSG_MainMenu_ShowPartyCreationWnd, 0, 'N', "", ui_mainmenu_new, 0); + pMainMenu_BtnLoad = CreateButton(495, 227, ui_mainmenu_load->GetWidth(), ui_mainmenu_load->GetHeight(), 1, 0, UIMSG_MainMenu_ShowLoadWindow, 1, 'L', "", ui_mainmenu_load, 0); + pMainMenu_BtnCredits = CreateButton(495, 282, ui_mainmenu_credits->GetWidth(), ui_mainmenu_credits->GetHeight(), 1, 0, UIMSG_ShowCredits, 2, 'C', "", ui_mainmenu_credits, 0); + pMainMenu_BtnExit = CreateButton(495, 337, ui_mainmenu_exit->GetWidth(), ui_mainmenu_exit->GetHeight(), 1, 0, UIMSG_ExitToWindows, 3, 0, "", ui_mainmenu_exit, 0); } @@ -63,7 +69,7 @@ if (GetCurrentMenuID() == MENU_MAIN) { - Texture *pTexture = nullptr; + Texture_MM7 *pTexture = nullptr; if (!pModalWindow)// ??? { auto pButton = pWindow->pControlsHead; @@ -114,8 +120,6 @@ for (uint i = 0; i < window->GetHeight(); ++i) pSRZBufferLineOffsets[i] = window->GetWidth() * i; - uTextureID_FONTPAL = pIcons_LOD->LoadTexture("FONTPAL", TEXTURE_16BIT_PALETTE); - pFontArrus = LoadFont("arrus.fnt", "FONTPAL", nullptr); pFontArrus->field_3 = 0; @@ -153,33 +157,33 @@ pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchB")); pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchA")); - pTextureIDs_pMapDirs[0] = pIcons_LOD->LoadTexture("MAPDIR1", TEXTURE_16BIT_PALETTE); - pTextureIDs_pMapDirs[1] = pIcons_LOD->LoadTexture("MAPDIR2", TEXTURE_16BIT_PALETTE); - pTextureIDs_pMapDirs[2] = pIcons_LOD->LoadTexture("MAPDIR3", TEXTURE_16BIT_PALETTE); - pTextureIDs_pMapDirs[3] = pIcons_LOD->LoadTexture("MAPDIR4", TEXTURE_16BIT_PALETTE); - pTextureIDs_pMapDirs[4] = pIcons_LOD->LoadTexture("MAPDIR5", TEXTURE_16BIT_PALETTE); - pTextureIDs_pMapDirs[5] = pIcons_LOD->LoadTexture("MAPDIR6", TEXTURE_16BIT_PALETTE); - pTextureIDs_pMapDirs[6] = pIcons_LOD->LoadTexture("MAPDIR7", TEXTURE_16BIT_PALETTE); - pTextureIDs_pMapDirs[7] = pIcons_LOD->LoadTexture("MAPDIR8", TEXTURE_16BIT_PALETTE); + game_ui_minimap_dirs[0] = assets->GetImage_16BitAlpha("MAPDIR1"); + game_ui_minimap_dirs[1] = assets->GetImage_16BitAlpha("MAPDIR2"); + game_ui_minimap_dirs[2] = assets->GetImage_16BitAlpha("MAPDIR3"); + game_ui_minimap_dirs[3] = assets->GetImage_16BitAlpha("MAPDIR4"); + game_ui_minimap_dirs[4] = assets->GetImage_16BitAlpha("MAPDIR5"); + game_ui_minimap_dirs[5] = assets->GetImage_16BitAlpha("MAPDIR6"); + game_ui_minimap_dirs[6] = assets->GetImage_16BitAlpha("MAPDIR7"); + game_ui_minimap_dirs[7] = assets->GetImage_16BitAlpha("MAPDIR8"); - uTextureID_BarBlue = pIcons_LOD->LoadTexture("ib-statB", TEXTURE_16BIT_PALETTE); - uTextureID_BarGreen = pIcons_LOD->LoadTexture("ib-statG", TEXTURE_16BIT_PALETTE); - uTextureID_BarYellow = pIcons_LOD->LoadTexture("ib-statY", TEXTURE_16BIT_PALETTE); - uTextureID_BarRed = pIcons_LOD->LoadTexture("ib-statR", TEXTURE_16BIT_PALETTE); - uTextureID_mhp_bd = pIcons_LOD->LoadTexture("mhp_bg", TEXTURE_16BIT_PALETTE); - uTextureID_mhp_capl = pIcons_LOD->LoadTexture("mhp_capl", TEXTURE_16BIT_PALETTE); - uTextureID_mhp_capr = pIcons_LOD->LoadTexture("mhp_capr", TEXTURE_16BIT_PALETTE); - uTextureID_mhp_grn = pIcons_LOD->LoadTexture("mhp_grn", TEXTURE_16BIT_PALETTE); - uTextureID_mhp_red = pIcons_LOD->LoadTexture("mhp_red", TEXTURE_16BIT_PALETTE); - uTextureID_mhp_yel = pIcons_LOD->LoadTexture("mhp_yel", TEXTURE_16BIT_PALETTE); - uTextureID_Leather = pIcons_LOD->LoadTexture("LEATHER", TEXTURE_16BIT_PALETTE); - pTexture_Leather = pIcons_LOD->LoadTexturePtr("ibground", TEXTURE_16BIT_PALETTE); - uTextureID_x_x_u = pIcons_LOD->LoadTexture("x_x_u", TEXTURE_16BIT_PALETTE); - uTextureID_BUTTDESC2 = pIcons_LOD->LoadTexture("BUTTESC2", TEXTURE_16BIT_PALETTE); - uTextureID_x_ok_u = pIcons_LOD->LoadTexture("x_ok_u", TEXTURE_16BIT_PALETTE); - uTextureID_BUTTYES2 = pIcons_LOD->LoadTexture("BUTTYES2", TEXTURE_16BIT_PALETTE); - uTextureID_BUTTMAKE = pIcons_LOD->LoadTexture("BUTTMAKE", TEXTURE_16BIT_PALETTE); - uTextureID_BUTTMAKE2 = pIcons_LOD->LoadTexture("BUTTMAKE2", TEXTURE_16BIT_PALETTE); + game_ui_bar_blue = assets->GetImage_16BitColorKey(L"ib-statB", 0x7FF); + game_ui_bar_green = assets->GetImage_16BitColorKey(L"ib-statG", 0x7FF); + game_ui_bar_yellow = assets->GetImage_16BitColorKey(L"ib-statY", 0x7FF); + game_ui_bar_red = assets->GetImage_16BitColorKey(L"ib-statR", 0x7FF); + game_ui_monster_hp_background = assets->GetImage_16BitColorKey(L"mhp_bg", 0x7FF); + game_ui_monster_hp_border_left = assets->GetImage_16BitColorKey(L"mhp_capl", 0x7FF); + game_ui_monster_hp_border_right = assets->GetImage_16BitColorKey(L"mhp_capr", 0x7FF); + game_ui_monster_hp_green = assets->GetImage_16BitColorKey(L"mhp_grn", 0x7FF); + game_ui_monster_hp_red = assets->GetImage_16BitColorKey(L"mhp_red", 0x7FF); + game_ui_monster_hp_yellow = assets->GetImage_16BitColorKey(L"mhp_yel", 0x7FF); + ui_leather_mm7 = assets->GetImage_16Bit("LEATHER"); + ui_leather_mm6 = assets->GetImage_16Bit("ibground"); + dialogue_ui_x_x_u = assets->GetImage_16BitColorKey(L"x_x_u", 0x7FF); + ui_buttdesc2 = assets->GetImage_16BitAlpha(L"BUTTESC2"); + dialogue_ui_x_ok_u = assets->GetImage_16BitColorKey(L"x_ok_u", 0x7FF); + ui_buttyes2 = assets->GetImage_16BitAlpha(L"BUTTYES2"); + ui_partycreation_buttmake = assets->GetImage_16BitAlpha(L"BUTTMAKE"); + ui_partycreation_buttmake2 = assets->GetImage_16BitAlpha(L"BUTTMAKE2"); pPrimaryWindow = new GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, 0); pPrimaryWindow->CreateButton(7, 8, 460, 343, 1, 0, UIMSG_MouseLeftClickInGame, 0, 0, "", 0); @@ -199,52 +203,62 @@ pPrimaryWindow->CreateButton(328, 404, 5, 49, 1, 93, UIMSG_0, 3, 0, "", 0); pPrimaryWindow->CreateButton(443, 404, 5, 49, 1, 93, UIMSG_0, 4, 0, "", 0); - uTextureID_ib_td1_A = pIcons_LOD->LoadTexture("ib-td1-A", TEXTURE_16BIT_PALETTE); + game_ui_tome_quests = assets->GetImage_16BitAlpha(L"ib-td1-A"); pBtn_Quests = pPrimaryWindow->CreateButton( - 491, 353, pIcons_LOD->GetTexture(uTextureID_ib_td1_A)->uTextureWidth, - pIcons_LOD->GetTexture(uTextureID_ib_td1_A)->uTextureHeight, 1, 0, UIMSG_OpenQuestBook, 0, pKeyActionMap->GetActionVKey(INPUT_Quest), - pGlobalTXT_LocalizationStrings[174], pIcons_LOD->GetTexture(uTextureID_ib_td1_A), 0 + 491, 353, + game_ui_tome_quests->GetWidth(), + game_ui_tome_quests->GetHeight(), + 1, 0, UIMSG_OpenQuestBook, 0, pKeyActionMap->GetActionVKey(INPUT_Quest), + pGlobalTXT_LocalizationStrings[174], game_ui_tome_quests, 0 ); //Quests - uTextureID_ib_td2_A = pIcons_LOD->LoadTexture("ib-td2-A", TEXTURE_16BIT_PALETTE); - pBtn_Autonotes = pPrimaryWindow->CreateButton(527, 353, pIcons_LOD->GetTexture( - uTextureID_ib_td2_A)->uTextureWidth, - pIcons_LOD->GetTexture(uTextureID_ib_td2_A)->uTextureHeight, 1, 0, UIMSG_OpenAutonotes, 0, pKeyActionMap->GetActionVKey(INPUT_Autonotes), - pGlobalTXT_LocalizationStrings[154], pIcons_LOD->GetTexture(uTextureID_ib_td2_A), 0 + game_ui_tome_autonotes = assets->GetImage_16BitAlpha(L"ib-td2-A"); + pBtn_Autonotes = pPrimaryWindow->CreateButton( + 527, 353, + game_ui_tome_autonotes->GetWidth(), + game_ui_tome_autonotes->GetHeight(), + 1, 0, UIMSG_OpenAutonotes, 0, pKeyActionMap->GetActionVKey(INPUT_Autonotes), + pGlobalTXT_LocalizationStrings[154], game_ui_tome_autonotes, 0 );//Autonotes - uTextureID_ib_td3_A = pIcons_LOD->LoadTexture("ib-td3-A", TEXTURE_16BIT_PALETTE); + game_ui_tome_maps = assets->GetImage_16BitAlpha("ib-td3-A"); pBtn_Maps = pPrimaryWindow->CreateButton( - 546, 353, pIcons_LOD->GetTexture(uTextureID_ib_td3_A)->uTextureWidth, - pIcons_LOD->GetTexture(uTextureID_ib_td3_A)->uTextureHeight, 1, 0, UIMSG_OpenMapBook, 0, pKeyActionMap->GetActionVKey(INPUT_Mapbook), - pGlobalTXT_LocalizationStrings[139], pIcons_LOD->GetTexture(uTextureID_ib_td3_A), 0 + 546, 353, + game_ui_tome_maps->GetWidth(), + game_ui_tome_maps->GetHeight(), + 1, 0, UIMSG_OpenMapBook, 0, pKeyActionMap->GetActionVKey(INPUT_Mapbook), + pGlobalTXT_LocalizationStrings[139], game_ui_tome_maps, 0 ); //Maps - uTextureID_ib_td4_A = pIcons_LOD->LoadTexture("ib-td4-A", TEXTURE_16BIT_PALETTE); + game_ui_tome_calendar = assets->GetImage_16BitAlpha("ib-td4-A"); pBtn_Calendar = pPrimaryWindow->CreateButton( - 570, 353, pIcons_LOD->GetTexture(uTextureID_ib_td4_A)->uTextureWidth, - pIcons_LOD->GetTexture(uTextureID_ib_td4_A)->uTextureHeight, 1, 0, UIMSG_OpenCalendar, 0, pKeyActionMap->GetActionVKey(INPUT_TimeCal), - pGlobalTXT_LocalizationStrings[78], pIcons_LOD->GetTexture(uTextureID_ib_td4_A), 0 + 570, 353, + game_ui_tome_calendar->GetWidth(), + game_ui_tome_calendar->GetHeight(), + 1, 0, UIMSG_OpenCalendar, 0, pKeyActionMap->GetActionVKey(INPUT_TimeCal), + pGlobalTXT_LocalizationStrings[78], game_ui_tome_calendar, 0 );//Calendar - uTextureID_ib_td5_A = pIcons_LOD->LoadTexture("ib-td5-A", TEXTURE_16BIT_PALETTE); + game_ui_tome_storyline = assets->GetImage_16BitAlpha("ib-td5-A"); pBtn_History = pPrimaryWindow->CreateButton( - 600, 361, pIcons_LOD->GetTexture(uTextureID_ib_td5_A)->uTextureWidth, - pIcons_LOD->GetTexture(uTextureID_ib_td5_A)->uTextureHeight, 1, 0, UIMSG_OpenHistoryBook, 0, 72,//ascii - pGlobalTXT_LocalizationStrings[602], pIcons_LOD->GetTexture(uTextureID_ib_td5_A), 0 + 600, 361, + game_ui_tome_storyline->GetWidth(), + game_ui_tome_storyline->GetHeight(), + 1, 0, UIMSG_OpenHistoryBook, 0, 72,//ascii + pGlobalTXT_LocalizationStrings[602], game_ui_tome_storyline, 0 );//History bFlashAutonotesBook = 0; bFlashQuestBook = 0; bFlashHistoryBook = 0; - pBtn_ZoomIn = pPrimaryWindow->CreateButton(574, 136, pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn].uTextureWidth, - pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn].uTextureHeight, 2, 0, UIMSG_ClickZoomInBtn, 0, pKeyActionMap->GetActionVKey(INPUT_ZoomIn), - pGlobalTXT_LocalizationStrings[252], &pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], 0); // Zoom In + pBtn_ZoomIn = pPrimaryWindow->CreateButton(574, 136, game_ui_btn_zoomin->GetWidth(), + game_ui_btn_zoomin->GetHeight(), 2, 0, UIMSG_ClickZoomInBtn, 0, pKeyActionMap->GetActionVKey(INPUT_ZoomIn), + pGlobalTXT_LocalizationStrings[252], game_ui_btn_zoomin, 0); // Zoom In - pBtn_ZoomOut = pPrimaryWindow->CreateButton(519, 136, pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut].uTextureWidth, - pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut].uTextureHeight, 2, 0, UIMSG_ClickZoomOutBtn, 0, pKeyActionMap->GetActionVKey(INPUT_ZoomOut), - pGlobalTXT_LocalizationStrings[251], &pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], 0); // Zoom Out + pBtn_ZoomOut = pPrimaryWindow->CreateButton(519, 136, game_ui_btn_zoomout->GetWidth(), + game_ui_btn_zoomout->GetHeight(), 2, 0, UIMSG_ClickZoomOutBtn, 0, pKeyActionMap->GetActionVKey(INPUT_ZoomOut), + pGlobalTXT_LocalizationStrings[251], game_ui_btn_zoomout, 0); // Zoom Out pPrimaryWindow->CreateButton(481, 0, 153, 67, 1, 92, UIMSG_0, 0, 0, "", 0); pPrimaryWindow->CreateButton(491, 149, 64, 74, 1, 0, UIMSG_StartHireling1Dialogue, 0, '5', "", 0); @@ -253,30 +267,30 @@ pPrimaryWindow->CreateButton(555, 322, 77, 17, 1, 101, UIMSG_0, 0, 0, "", 0); pBtn_CastSpell = pPrimaryWindow->CreateButton(476, 450, - pIcons_LOD->GetTexture(uTextureID_Btn_CastSpell)->uTextureWidth, - pIcons_LOD->GetTexture(uTextureID_Btn_CastSpell)->uTextureHeight, - 1, 0, UIMSG_SpellBookWindow, 0, 67, pGlobalTXT_LocalizationStrings[38], pIcons_LOD->GetTexture(uTextureID_Btn_CastSpell), 0); + game_ui_btn_cast->GetWidth(), + game_ui_btn_cast->GetHeight(), + 1, 0, UIMSG_SpellBookWindow, 0, 67, pGlobalTXT_LocalizationStrings[38], game_ui_btn_cast, 0); pBtn_Rest = pPrimaryWindow->CreateButton(518, 450, - pIcons_LOD->GetTexture(uTextureID_Btn_Rest)->uTextureWidth, - pIcons_LOD->GetTexture(uTextureID_Btn_Rest)->uTextureHeight, - 1, 0, UIMSG_RestWindow, 0, 82, pGlobalTXT_LocalizationStrings[182], pIcons_LOD->GetTexture(uTextureID_Btn_Rest), 0); + game_ui_btn_rest->GetWidth(), + game_ui_btn_rest->GetHeight(), + 1, 0, UIMSG_RestWindow, 0, 82, pGlobalTXT_LocalizationStrings[182], game_ui_btn_rest, 0); pBtn_QuickReference = pPrimaryWindow->CreateButton(560, 450, - pIcons_LOD->GetTexture(uTextureID_Btn_QuickReference)->uTextureWidth, - pIcons_LOD->GetTexture(uTextureID_Btn_QuickReference)->uTextureHeight, - 1, 0, UIMSG_QuickReference, 0, 90, pGlobalTXT_LocalizationStrings[173], pIcons_LOD->GetTexture(uTextureID_Btn_QuickReference), 0); + game_ui_btn_quickref->GetWidth(), + game_ui_btn_quickref->GetHeight(), + 1, 0, UIMSG_QuickReference, 0, 90, pGlobalTXT_LocalizationStrings[173], game_ui_btn_quickref, 0); pBtn_GameSettings = pPrimaryWindow->CreateButton(602, 450, - pIcons_LOD->GetTexture(uTextureID_Btn_GameSettings)->uTextureWidth, - pIcons_LOD->GetTexture(uTextureID_Btn_GameSettings)->uTextureHeight, - 1, 0, UIMSG_GameMenuButton, 0, 0, pGlobalTXT_LocalizationStrings[93], pIcons_LOD->GetTexture(uTextureID_Btn_GameSettings), 0); + game_ui_btn_settings->GetWidth(), + game_ui_btn_settings->GetHeight(), + 1, 0, UIMSG_GameMenuButton, 0, 0, pGlobalTXT_LocalizationStrings[93], game_ui_btn_settings, 0); pBtn_NPCLeft = pPrimaryWindow->CreateButton(469, 178, - pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureWidth, - pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureHeight, - 1, 0, UIMSG_ScrollNPCPanel, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft), 0); + ui_btn_npc_left->GetWidth(), + ui_btn_npc_left->GetHeight(), + 1, 0, UIMSG_ScrollNPCPanel, 0, 0, "", ui_btn_npc_left, 0); pBtn_NPCRight = pPrimaryWindow->CreateButton(626, 178, - pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureWidth, - pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureHeight, - 1, 0, UIMSG_ScrollNPCPanel, 1, 0, "", pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight), 0); + ui_btn_npc_right->GetWidth(), + ui_btn_npc_right->GetHeight(), + 1, 0, UIMSG_ScrollNPCPanel, 1, 0, "", ui_btn_npc_right, 0); LoadPartyBuffIcons(); } @@ -327,7 +341,7 @@ GUIFont *pFontQuick; // [sp+134h] [bp-8h]@1 GUIFont *pFontCChar; // [sp+138h] [bp-4h]@1 RGBTexture cred_texture; // [sp+100h] [bp-3Ch]@1 - Texture pTemporaryTexture; // [sp+Ch] [bp-130h]@5 + Texture_MM7 pTemporaryTexture; // [sp+Ch] [bp-130h]@5 pFontQuick = LoadFont("quick.fnt", "FONTPAL", NULL); pFontCChar = LoadFont("cchar.fnt", "FONTPAL", NULL);
--- a/GUI/UI/UIMainMenu.h Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/UIMainMenu.h Mon Mar 07 03:48:40 2016 +0200 @@ -16,4 +16,4 @@ virtual ~GUIWindow_MainMenu() {} virtual void Update(); -}; \ No newline at end of file +};
--- a/GUI/UI/UIPartyCreation.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/UIPartyCreation.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -26,6 +26,26 @@ #include "Game/CreateParty.h" + + +Image *ui_partycreation_top = nullptr; +Image *ui_partycreation_sky_scroller = nullptr; + +Image *ui_partycreation_left = nullptr; +Image *ui_partycreation_right = nullptr; +Image *ui_partycreation_minus = nullptr; +Image *ui_partycreation_plus = nullptr; +Image *ui_partycreation_buttmake2 = nullptr; +Image *ui_partycreation_buttmake = nullptr; + +std::array<Image *, 9> ui_partycreation_class_icons; +std::array<Image *, 22> ui_partycreation_portraits; + +std::array<Image *, 20> ui_partycreation_arrow_r; +std::array<Image *, 20> ui_partycreation_arrow_l; + +Image *ui_partycreation_face_mask = nullptr; + //----- (004908DE) -------------------------------------------------------- bool PlayerCreation_Choose4Skills() { @@ -46,7 +66,7 @@ } //----- (00491CB5) -------------------------------------------------------- -void LoadPlayerPortraintsAndVoices() +void LoadPlayerPortraintsAndVoices() { pIcons_LOD->pFacesLock = pIcons_LOD->uNumLoadedFiles; @@ -59,7 +79,7 @@ pTexture_PlayerFaceEradicated = pIcons_LOD->LoadTexturePtr("ERADCATE", TEXTURE_16BIT_PALETTE); pTexture_PlayerFaceDead = pIcons_LOD->LoadTexturePtr("DEAD", TEXTURE_16BIT_PALETTE); - pTexture_PlayerFaceMask = pIcons_LOD->LoadTexturePtr("FACEMASK", TEXTURE_16BIT_PALETTE); + ui_partycreation_face_mask = assets->GetImage_16BitColorKey("FACEMASK", 0x7FF); if (SoundSetAction[24][0]) for (uint i = 0; i < 4; ++i) @@ -112,9 +132,9 @@ pRenderer->BeginScene(); pRenderer->DrawTextureNew(0, 0, main_menu_background); uPlayerCreationUI_SkySliderPos = (GetTickCount() % 12800) / 20; - pRenderer->DrawTextureTransparentColorKey(uPlayerCreationUI_SkySliderPos, 2, pTexture_MAKESKY); - pRenderer->DrawTextureTransparentColorKey(uPlayerCreationUI_SkySliderPos - window->GetWidth(), 2, pTexture_MAKESKY); - pRenderer->DrawTextureIndexedAlpha(0, 0, pTexture_MAKETOP); + pRenderer->DrawTextureAlphaNew(uPlayerCreationUI_SkySliderPos/640.0f, 2/480.0f, ui_partycreation_sky_scroller); + pRenderer->DrawTextureAlphaNew((uPlayerCreationUI_SkySliderPos - window->GetWidth())/640.0f, 2/480.0f, ui_partycreation_sky_scroller); + pRenderer->DrawTextureAlphaNew(0, 0, ui_partycreation_top); uPlayerCreationUI_SelectedCharacter = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) / 7; switch (uPlayerCreationUI_SelectedCharacter) @@ -128,19 +148,19 @@ } pTextCenter = pFontCChar->AlignText_Center(window->GetWidth(), pGlobalTXT_LocalizationStrings[51]); - pGUIWindow_CurrentMenu->DrawText(pFontCChar, pTextCenter + 1, 0, 0, pGlobalTXT_LocalizationStrings[51], 0, 0, 0);//С О З Д А Т Ь О Т Р Я Д - pRenderer->DrawTextureIndexedAlpha(17, 35, pPlayerPortraits[pParty->pPlayers[0].uCurrentFace]); - pRenderer->DrawTextureIndexedAlpha(176, 35, pPlayerPortraits[pParty->pPlayers[1].uCurrentFace]); - pRenderer->DrawTextureIndexedAlpha(335, 35, pPlayerPortraits[pParty->pPlayers[2].uCurrentFace]); - pRenderer->DrawTextureIndexedAlpha(494, 35, pPlayerPortraits[pParty->pPlayers[3].uCurrentFace]); + pGUIWindow_CurrentMenu->DrawText(pFontCChar, pTextCenter + 1, 0, 0, pGlobalTXT_LocalizationStrings[51], 0, 0, 0);// CREATE PARTY / С О З Д А Т Ь О Т Р Я Д + pRenderer->DrawTextureAlphaNew(17/640.0f, 35/480.0f, ui_partycreation_portraits[pParty->pPlayers[0].uCurrentFace]); + pRenderer->DrawTextureAlphaNew(176/640.0f, 35/480.0f, ui_partycreation_portraits[pParty->pPlayers[1].uCurrentFace]); + pRenderer->DrawTextureAlphaNew(335/640.0f, 35/480.0f, ui_partycreation_portraits[pParty->pPlayers[2].uCurrentFace]); + pRenderer->DrawTextureAlphaNew(494/640.0f, 35/480.0f, ui_partycreation_portraits[pParty->pPlayers[3].uCurrentFace]); pFrame = pIconsFrameTable->GetFrame(uIconID_CharacterFrame, pEventTimer->uStartTime); //arrows pRenderer->DrawTextureIndexedAlpha(pX, 29, &pIcons_LOD->pTextures[pFrame->uTextureID]); uPosActiveItem = pGUIWindow_CurrentMenu->GetControl(pGUIWindow_CurrentMenu->pCurrentPosActiveItem); uPlayerCreationUI_ArrowAnim = 18 - (GetTickCount() % 450) / 25; - pRenderer->DrawTextureIndexedAlpha(uPosActiveItem->uZ - 4, uPosActiveItem->uY, pTextures_arrowl[uPlayerCreationUI_ArrowAnim + 1]); - pRenderer->DrawTextureIndexedAlpha(uPosActiveItem->uX - 12, uPosActiveItem->uY, pTextures_arrowr[uPlayerCreationUI_ArrowAnim + 1]); + pRenderer->DrawTextureAlphaNew((uPosActiveItem->uZ - 4)/640.0f, uPosActiveItem->uY/480.0f, ui_partycreation_arrow_l[uPlayerCreationUI_ArrowAnim + 1]); + pRenderer->DrawTextureAlphaNew((uPosActiveItem->uX - 12)/640.0f, uPosActiveItem->uY/480.0f, ui_partycreation_arrow_r[uPlayerCreationUI_ArrowAnim + 1]); memset(pText, 0, 200); strcpy(pText, pGlobalTXT_LocalizationStrings[205]);// "Skills" @@ -155,7 +175,7 @@ for (int i = 0; i < 4; ++i) { pGUIWindow_CurrentMenu->DrawText(pFontCreate, pIntervalX + 73, 100, 0, pClassNames[pParty->pPlayers[i].classType], 0, 0, 0); - pRenderer->DrawTextureIndexedAlpha(pIntervalX + 77, 50, pTexture_IC_KNIGHT[pParty->pPlayers[i].classType / 4]); + pRenderer->DrawTextureAlphaNew((pIntervalX + 77)/640.0f, 50/480.0f, ui_partycreation_class_icons[pParty->pPlayers[i].classType / 4]); if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 != WINDOW_INPUT_NONE && pGUIWindow_CurrentMenu->ptr_1C == (void *)i ) { @@ -411,36 +431,39 @@ uPlayerCreationUI_SkySliderPos = 0; uPlayerCreationUI_SelectedCharacter = 0; v0 = LOBYTE(pFontCreate->uFontHeight) - 2; - pTexture_IC_KNIGHT[0] = pIcons_LOD->LoadTexturePtr("IC_KNIGHT", TEXTURE_16BIT_PALETTE); - pTexture_IC_KNIGHT[1] = pIcons_LOD->LoadTexturePtr("IC_THIEF", TEXTURE_16BIT_PALETTE); - pTexture_IC_KNIGHT[2] = pIcons_LOD->LoadTexturePtr("IC_MONK", TEXTURE_16BIT_PALETTE); - pTexture_IC_KNIGHT[3] = pIcons_LOD->LoadTexturePtr("IC_PALAD", TEXTURE_16BIT_PALETTE); - pTexture_IC_KNIGHT[4] = pIcons_LOD->LoadTexturePtr("IC_ARCH", TEXTURE_16BIT_PALETTE); - pTexture_IC_KNIGHT[5] = pIcons_LOD->LoadTexturePtr("IC_RANGER", TEXTURE_16BIT_PALETTE); - pTexture_IC_KNIGHT[6] = pIcons_LOD->LoadTexturePtr("IC_CLER", TEXTURE_16BIT_PALETTE); - pTexture_IC_KNIGHT[7] = pIcons_LOD->LoadTexturePtr("IC_DRUID", TEXTURE_16BIT_PALETTE); - pTexture_IC_KNIGHT[8] = pIcons_LOD->LoadTexturePtr("IC_SORC", TEXTURE_16BIT_PALETTE); - pTexture_MAKETOP = pIcons_LOD->LoadTexturePtr("MAKETOP", TEXTURE_16BIT_PALETTE); - pTexture_MAKESKY = pIcons_LOD->LoadTexturePtr("MAKESKY", TEXTURE_16BIT_PALETTE); - for( uX = 0; uX < 22; ++uX ) // load PlayerPortraits texture + + ui_partycreation_class_icons[0] = assets->GetImage_16BitColorKey("IC_KNIGHT", 0x7FF); + ui_partycreation_class_icons[1] = assets->GetImage_16BitColorKey("IC_THIEF", 0x7FF); + ui_partycreation_class_icons[2] = assets->GetImage_16BitColorKey("IC_MONK", 0x7FF); + ui_partycreation_class_icons[3] = assets->GetImage_16BitColorKey("IC_PALAD", 0x7FF); + ui_partycreation_class_icons[4] = assets->GetImage_16BitColorKey("IC_ARCH", 0x7FF); + ui_partycreation_class_icons[5] = assets->GetImage_16BitColorKey("IC_RANGER", 0x7FF); + ui_partycreation_class_icons[6] = assets->GetImage_16BitColorKey("IC_CLER", 0x7FF); + ui_partycreation_class_icons[7] = assets->GetImage_16BitColorKey("IC_DRUID", 0x7FF); + ui_partycreation_class_icons[8] = assets->GetImage_16BitColorKey("IC_SORC", 0x7FF); + + ui_partycreation_top = assets->GetImage_16BitColorKey("MAKETOP", 0x7FF); + ui_partycreation_sky_scroller = assets->GetImage_16BitColorKey("MAKESKY", 0x7FF); + + for( uX = 0; uX < 22; ++uX ) { sprintf(pTmpBuf.data(), "%s01", pPlayerPortraitsNames[uX]); - pPlayerPortraits[uX] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf.data(), TEXTURE_16BIT_PALETTE)]; - + ui_partycreation_portraits[uX] = assets->GetImage_16BitColorKey(pTmpBuf.data(), 0x7FF); } - pTexture_PlayerFaceMask = pIcons_LOD->LoadTexturePtr("FACEMASK", TEXTURE_16BIT_PALETTE); - pTexture_buttminu = pIcons_LOD->LoadTexturePtr("buttminu", TEXTURE_16BIT_PALETTE); - pTexture_buttplus = pIcons_LOD->LoadTexturePtr("buttplus", TEXTURE_16BIT_PALETTE); - pTexture_pressrigh = pIcons_LOD->LoadTexturePtr("presrigh", TEXTURE_16BIT_PALETTE); - pTexture_presleft = pIcons_LOD->LoadTexturePtr("presleft", TEXTURE_16BIT_PALETTE); + + ui_partycreation_face_mask = assets->GetImage_16BitColorKey("FACEMASK", 0x7FF); + ui_partycreation_minus = assets->GetImage_16BitColorKey(L"buttminu", 0x7FF); + ui_partycreation_plus = assets->GetImage_16BitColorKey(L"buttplus", 0x7FF); + ui_partycreation_right = assets->GetImage_16BitColorKey(L"presrigh", 0x7FF); + ui_partycreation_left = assets->GetImage_16BitColorKey(L"presleft", 0x7FF); for (int i = 1; i < 20; ++i) { sprintf(pTmpBuf.data(), "arrowl%d", i); - pTextures_arrowl[i] = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE); + ui_partycreation_arrow_l[i] = assets->GetImage_16BitAlpha(pTmpBuf.data()); sprintf(pTmpBuf.data(), "arrowr%d", i); - pTextures_arrowr[i] = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE); + ui_partycreation_arrow_r[i] = assets->GetImage_16BitAlpha(pTmpBuf.data()); } //pGUIWindow_CurrentMenu = new GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, 0); @@ -454,25 +477,25 @@ } while ( (signed int)uX < window->GetWidth() ); - pCreationUI_BtnPressLeft[0] = CreateButton( 10, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 0, 0, "", pTexture_presleft, 0); - pCreationUI_BtnPressLeft[1] = CreateButton(169, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 1, 0, "", pTexture_presleft, 0); - pCreationUI_BtnPressLeft[2] = CreateButton(327, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 2, 0, "", pTexture_presleft, 0); - pCreationUI_BtnPressLeft[3] = CreateButton(486, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 3, 0, "", pTexture_presleft, 0); + pCreationUI_BtnPressLeft[0] = CreateButton( 10, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 0, 0, "", ui_partycreation_left, 0); + pCreationUI_BtnPressLeft[1] = CreateButton(169, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 1, 0, "", ui_partycreation_left, 0); + pCreationUI_BtnPressLeft[2] = CreateButton(327, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 2, 0, "", ui_partycreation_left, 0); + pCreationUI_BtnPressLeft[3] = CreateButton(486, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 3, 0, "", ui_partycreation_left, 0); - pCreationUI_BtnPressRight[0] = CreateButton( 74, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 0, 0, "", pTexture_pressrigh, 0); - pCreationUI_BtnPressRight[1] = CreateButton(233, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 1, 0, "", pTexture_pressrigh, 0); - pCreationUI_BtnPressRight[2] = CreateButton(391, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 2, 0, "", pTexture_pressrigh, 0); - pCreationUI_BtnPressRight[3] = CreateButton(549, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 3, 0, "", pTexture_pressrigh, 0); + pCreationUI_BtnPressRight[0] = CreateButton( 74, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 0, 0, "", ui_partycreation_right, 0); + pCreationUI_BtnPressRight[1] = CreateButton(233, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 1, 0, "", ui_partycreation_right, 0); + pCreationUI_BtnPressRight[2] = CreateButton(391, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 2, 0, "", ui_partycreation_right, 0); + pCreationUI_BtnPressRight[3] = CreateButton(549, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 3, 0, "", ui_partycreation_right, 0); - pCreationUI_BtnPressLeft2[0] = CreateButton( 10, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 0, 0, "", pTexture_presleft, 0); - pCreationUI_BtnPressLeft2[1] = CreateButton(169, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 1, 0, "", pTexture_presleft, 0); - pCreationUI_BtnPressLeft2[2] = CreateButton(327, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 2, 0, "", pTexture_presleft, 0); - pCreationUI_BtnPressLeft2[3] = CreateButton(486, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 3, 0, "", pTexture_presleft, 0); + pCreationUI_BtnPressLeft2[0] = CreateButton( 10, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 0, 0, "", ui_partycreation_left, 0); + pCreationUI_BtnPressLeft2[1] = CreateButton(169, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 1, 0, "", ui_partycreation_left, 0); + pCreationUI_BtnPressLeft2[2] = CreateButton(327, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 2, 0, "", ui_partycreation_left, 0); + pCreationUI_BtnPressLeft2[3] = CreateButton(486, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 3, 0, "", ui_partycreation_left, 0); - pCreationUI_BtnPressRight2[0] = CreateButton( 74, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 0, 0, "", pTexture_pressrigh, 0); - pCreationUI_BtnPressRight2[1] = CreateButton(233, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 1, 0, "", pTexture_pressrigh, 0); - pCreationUI_BtnPressRight2[2] = CreateButton(391, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 2, 0, "", pTexture_pressrigh, 0); - pCreationUI_BtnPressRight2[3] = CreateButton(549, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 3, 0, "", pTexture_pressrigh, 0); + pCreationUI_BtnPressRight2[0] = CreateButton( 74, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 0, 0, "", ui_partycreation_right, 0); + pCreationUI_BtnPressRight2[1] = CreateButton(233, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 1, 0, "", ui_partycreation_right, 0); + pCreationUI_BtnPressRight2[2] = CreateButton(391, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 2, 0, "", ui_partycreation_right, 0); + pCreationUI_BtnPressRight2[3] = CreateButton(549, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 3, 0, "", ui_partycreation_right, 0); uControlParam = 0; uX = 8; @@ -534,10 +557,10 @@ } while ( uControlParam < 9 ); - pPlayerCreationUI_BtnOK = CreateButton(580, 431, 51, 39, 1, 0, UIMSG_PlayerCreationClickOK, 0, '\r', "", pIcons_LOD->GetTexture(uTextureID_BUTTMAKE), 0); - pPlayerCreationUI_BtnReset = CreateButton(527, 431, 51, 39, 1, 0, UIMSG_PlayerCreationClickReset, 0, 'C', "", pIcons_LOD->GetTexture(uTextureID_BUTTMAKE2), 0); - pPlayerCreationUI_BtnMinus = CreateButton(523, 393, 20, 35, 1, 0, UIMSG_PlayerCreationClickMinus, 0, '-', "", pTexture_buttminu, 0); - pPlayerCreationUI_BtnPlus = CreateButton(613, 393, 20, 35, 1, 0, UIMSG_PlayerCreationClickPlus, 1, '+', "", pTexture_buttplus, 0); + pPlayerCreationUI_BtnOK = CreateButton(580, 431, 51, 39, 1, 0, UIMSG_PlayerCreationClickOK, 0, '\r', "", ui_partycreation_buttmake, 0); + pPlayerCreationUI_BtnReset = CreateButton(527, 431, 51, 39, 1, 0, UIMSG_PlayerCreationClickReset, 0, 'C', "", ui_partycreation_buttmake2, 0); + pPlayerCreationUI_BtnMinus = CreateButton(523, 393, 20, 35, 1, 0, UIMSG_PlayerCreationClickMinus, 0, '-', "", ui_partycreation_minus, 0); + pPlayerCreationUI_BtnPlus = CreateButton(613, 393, 20, 35, 1, 0, UIMSG_PlayerCreationClickPlus, 1, '+', "", ui_partycreation_plus, 0); pFontCChar = LoadFont("cchar.fnt", "FONTPAL", NULL); }
--- a/GUI/UI/UIPartyCreation.h Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/UIPartyCreation.h Mon Mar 07 03:48:40 2016 +0200 @@ -16,4 +16,13 @@ virtual ~GUIWindow_PartyCreation() {} virtual void Update(); -}; \ No newline at end of file +}; + + + +extern class Image *ui_partycreation_left; +extern class Image *ui_partycreation_right; +extern class Image *ui_partycreation_minus; +extern class Image *ui_partycreation_plus; +extern class Image *ui_partycreation_buttmake2; +extern class Image *ui_partycreation_buttmake; \ No newline at end of file
--- a/GUI/UI/UIPopup.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/UIPopup.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -279,7 +279,12 @@ iteminfo_window.uFrameHeight -= 12; iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; - pRenderer->DrawTransparentRedShade(iteminfo_window.uFrameX + v78, v81 + iteminfo_window.uFrameY + 30, pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)); + + pRenderer->DrawTransparentRedShade( + (iteminfo_window.uFrameX + v78) / 640.0f, + (v81 + iteminfo_window.uFrameY + 30) / 480.0f, + //pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)); + assets->GetImage_16BitAlpha(inspect_item->GetIconName())); if ( inspect_item->IsIdentified()) pText = (char *)inspect_item->GetIdentifiedName(); else
--- a/GUI/UI/UIQuickReference.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/UIQuickReference.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -1,4 +1,5 @@ #include "Engine/Engine.h" +#include "Engine/AssetsManager.h" #include "Engine/Timer.h" #include "Engine/LOD.h" #include "Engine/texts.h" @@ -7,6 +8,7 @@ #include "GUI/GUIFont.h" #include "GUI/UI/UIQuickReference.h" +#include "GUI/UI/UICharacter.h" #include "Media/Audio/AudioPlayer.h" @@ -17,11 +19,13 @@ pEventTimer->Pause(); pAudioPlayer->StopChannels(-1, -1); current_screen_type = SCREEN_QUICK_REFERENCE; - papredoll_dbrds[2] = pIcons_LOD->LoadTexture("BUTTEXI1", TEXTURE_16BIT_PALETTE); + + //paperdoll_dbrds[2] = assets->GetImage_16BitAlpha(L"BUTTEXI1"); + pBtn_ExitCancel = CreateButton( 0x187u, 0x13Cu, 0x4Bu, 0x21u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79],// "Exit" - pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), + ui_buttdesc2, 0 ); //, v179); }
--- a/GUI/UI/UIRest.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/UIRest.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -5,6 +5,7 @@ #define _CRT_SECURE_NO_WARNINGS #include "Engine/Engine.h" +#include "Engine/AssetsManager.h" #include "Engine/Graphics/Outdoor.h" #include "Engine/LOD.h" @@ -20,6 +21,19 @@ + +Image *rest_ui_btn_4 = nullptr; +Image *rest_ui_btn_exit = nullptr; +Image *rest_ui_btn_3 = nullptr; +Image *rest_ui_btn_1 = nullptr; +Image *rest_ui_btn_2 = nullptr; +Image *rest_ui_restmain = nullptr; + +Image *rest_ui_sky_frame_current = nullptr; +Image *rest_ui_hourglass_frame_current = nullptr; + + + void GUIWindow_RestWindow::Update() { __debugbreak(); // doesnt seems to get here, check stack trace & conditions @@ -33,7 +47,7 @@ GUIButton2.uHeight = 37; GUIButton2.pParent = pButton_RestUI_WaitUntilDawn->pParent; pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); - pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, *((Texture **)ptr_1C + 15)); + pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, *((Texture_MM7 **)ptr_1C + 15)); viewparams->bRedrawGameUI = 1; GUIButton2.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, 0, 0); // Rest & Heal 8 hrs / Отдых и лечение 8 часов GUIButton2.pParent = 0; @@ -95,21 +109,21 @@ current_screen_type = SCREEN_REST; _507CD4_RestUI_hourglass_anim_controller = 0; - uTextureID_RestUI_restmain = pIcons_LOD->LoadTexture("restmain", TEXTURE_16BIT_PALETTE); - uTextureID_RestUI_restb1 = pIcons_LOD->LoadTexture("restb1", TEXTURE_16BIT_PALETTE); - uTextureID_RestUI_restb2 = pIcons_LOD->LoadTexture("restb2", TEXTURE_16BIT_PALETTE); - uTextureID_RestUI_restb3 = pIcons_LOD->LoadTexture("restb3", TEXTURE_16BIT_PALETTE); - uTextureID_RestUI_restb4 = pIcons_LOD->LoadTexture("restb4", TEXTURE_16BIT_PALETTE); - uTextureID_RestUI_restexit = pIcons_LOD->LoadTexture("restexit", TEXTURE_16BIT_PALETTE); + rest_ui_restmain = assets->GetImage_16BitAlpha("restmain"); + rest_ui_btn_1 = assets->GetImage_16BitAlpha("restb1"); + rest_ui_btn_2 = assets->GetImage_16BitAlpha("restb2"); + rest_ui_btn_3 = assets->GetImage_16BitAlpha("restb3"); + rest_ui_btn_4 = assets->GetImage_16BitAlpha("restb4"); + rest_ui_btn_exit = assets->GetImage_16BitAlpha("restexit"); OutdoorLocation::LoadActualSkyFrame(); //auto wnd = new GUIWindow_Rest(0, 0, window->GetWidth(), window->GetHeight()); - pButton_RestUI_Exit = CreateButton(280, 297, 154, 37, 1, 0, UIMSG_ExitRest, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_RestUI_restexit), 0); - pButton_RestUI_Main = CreateButton(24, 154, 225, 37, 1, 0, UIMSG_Rest8Hour, 0, 'R', "", pIcons_LOD->GetTexture(uTextureID_RestUI_restb4), 0); - pButton_RestUI_WaitUntilDawn = CreateButton(61, 232, 154, 33, 1, 0, UIMSG_AlreadyResting, 0, 'D', "", pIcons_LOD->GetTexture(uTextureID_RestUI_restb1), 0); - pButton_RestUI_Wait1Hour = CreateButton(61, 264, 154, 33, 1, 0, UIMSG_Wait1Hour, 0, 'H', "", pIcons_LOD->GetTexture(uTextureID_RestUI_restb2), 0); - pButton_RestUI_Wait5Minutes = CreateButton(61, 296, 154, 33, 1, 0, UIMSG_Wait5Minutes, 0, 'M', "", pIcons_LOD->GetTexture(uTextureID_RestUI_restb3), 0); + pButton_RestUI_Exit = CreateButton(280, 297, 154, 37, 1, 0, UIMSG_ExitRest, 0, 0, "", rest_ui_btn_exit, 0); + pButton_RestUI_Main = CreateButton(24, 154, 225, 37, 1, 0, UIMSG_Rest8Hour, 0, 'R', "", rest_ui_btn_4, 0); + pButton_RestUI_WaitUntilDawn = CreateButton(61, 232, 154, 33, 1, 0, UIMSG_AlreadyResting, 0, 'D', "", rest_ui_btn_1, 0); + pButton_RestUI_Wait1Hour = CreateButton(61, 264, 154, 33, 1, 0, UIMSG_Wait1Hour, 0, 'H', "", rest_ui_btn_2, 0); + pButton_RestUI_Wait5Minutes = CreateButton(61, 296, 154, 33, 1, 0, UIMSG_Wait5Minutes, 0, 'M', "", rest_ui_btn_3, 0); } @@ -129,7 +143,7 @@ if ( live_characters ) { - pRenderer->DrawTextureTransparentColorKey(8, 8, pIcons_LOD->GetTexture(uTextureID_RestUI_restmain)); + pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, rest_ui_restmain); am_pm_hours = pParty->uCurrentHour; dword_506F1C = pGUIWindow_CurrentMenu->pCurrentPosActiveItem; if ( (signed int)pParty->uCurrentHour <= 12 ) @@ -139,11 +153,11 @@ } else am_pm_hours -= 12; - pRenderer->DrawTextureTransparentColorKey(16, 26, pTexture_RestUI_CurrentSkyFrame); - if ( pTexture_RestUI_CurrentHourglassFrame ) + pRenderer->DrawTextureAlphaNew(16/640.0f, 26/480.0f, rest_ui_sky_frame_current); + if ( rest_ui_hourglass_frame_current ) { - pTexture_RestUI_CurrentHourglassFrame->Release(); - pIcons_LOD->SyncLoadedFilesCount(); + rest_ui_hourglass_frame_current->Release(); + rest_ui_hourglass_frame_current = nullptr; } v3 = pEventTimer->uTimeElapsed + _507CD4_RestUI_hourglass_anim_controller; _507CD4_RestUI_hourglass_anim_controller += pEventTimer->uTimeElapsed; @@ -156,9 +170,15 @@ if (hourglass_icon_idx >= 120 ) hourglass_icon_idx = 1; - sprintf(pTmpBuf.data(), "hglas%03d", hourglass_icon_idx); - pTexture_RestUI_CurrentHourglassFrame = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE); - pRenderer->DrawTextureTransparentColorKey(267, 159, pTexture_RestUI_CurrentHourglassFrame); + { + wchar_t name[1024]; + sprintf(pTmpBuf.data(), "hglas%03d", hourglass_icon_idx); + swprintf(name, L"hglas%03d", hourglass_icon_idx); + rest_ui_hourglass_frame_current = assets->GetImage_16BitColorKey(name, 0x7FF); + + pRenderer->DrawTextureAlphaNew(267/640.0f, 159/480.0f, rest_ui_hourglass_frame_current); + } + memset(&tmp_button, 0, sizeof(GUIButton)); tmp_button.uX = 24; tmp_button.uY = 154;
--- a/GUI/UI/UIRest.h Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/UIRest.h Mon Mar 07 03:48:40 2016 +0200 @@ -20,4 +20,8 @@ virtual void Update(); virtual void Release(); -}; \ No newline at end of file +}; + + +extern class Image *rest_ui_sky_frame_current; +extern class Image *rest_ui_hourglass_frame_current; \ No newline at end of file
--- a/GUI/UI/UISaveLoad.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/UISaveLoad.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -22,13 +22,14 @@ void UI_DrawSaveLoad(bool save); -Image *img_save_up = nullptr; -Image *img_load_up = nullptr; -Image *img_loadsave = nullptr; -Image *img_loadsave_saveu = nullptr; -Image *img_loadsave_loadu = nullptr; -Image *img_loadsave_x_u = nullptr; - +Image *saveload_ui_save_up = nullptr; +Image *saveload_ui_load_up = nullptr; +Image *saveload_ui_loadsave = nullptr; +Image *saveload_ui_saveu = nullptr; +Image *saveload_ui_loadu = nullptr; +Image *saveload_ui_x_u = nullptr; +Image *saveload_ui_ls_saved = nullptr; +Image *saveload_ui_x_d = nullptr; GUIWindow_Save::GUIWindow_Save() : GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, nullptr) @@ -43,20 +44,20 @@ pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; memset(&pSavegameUsedSlots, 0, sizeof(pSavegameUsedSlots)); memset(&pSavegameThumbnails, 0, sizeof(pSavegameThumbnails)); - img_loadsave = assets->GetImage_16BitColorKey(L"loadsave", 0x7FF); - img_save_up = assets->GetImage_16BitColorKey(L"save_up", 0x7FF); - img_load_up = assets->GetImage_16BitColorKey(L"load_up", 0x7FF); - img_loadsave_saveu = assets->GetImage_16BitColorKey(L"LS_saveU", 0x7FF); - img_loadsave_loadu = assets->GetImage_16BitColorKey(L"LS_loadU", 0x7FF); - img_loadsave_x_u = assets->GetImage_16BitColorKey(L"x_u", 0x7FF); + saveload_ui_loadsave = assets->GetImage_16BitColorKey(L"loadsave", 0x7FF); + saveload_ui_save_up = assets->GetImage_16BitColorKey(L"save_up", 0x7FF); + saveload_ui_load_up = assets->GetImage_16BitColorKey(L"load_up", 0x7FF); + saveload_ui_saveu = assets->GetImage_16BitColorKey(L"LS_saveU", 0x7FF); + saveload_ui_loadu = assets->GetImage_16BitColorKey(L"LS_loadU", 0x7FF); + saveload_ui_x_u = assets->GetImage_16BitColorKey(L"x_u", 0x7FF); - pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, img_loadsave); + pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, saveload_ui_loadsave); //if (screen == SCREEN_SAVEGAME) { - pRenderer->DrawTextureAlphaNew(241/640.0f, 302/480.0f, img_loadsave_saveu); - pRenderer->DrawTextureAlphaNew(351/640.0f, 302/480.0f, img_loadsave_x_u); - pRenderer->DrawTextureAlphaNew(18/640.0f, 141/480.0f, img_save_up); + pRenderer->DrawTextureAlphaNew(241/640.0f, 302/480.0f, saveload_ui_saveu); + pRenderer->DrawTextureAlphaNew(351/640.0f, 302/480.0f, saveload_ui_x_u); + pRenderer->DrawTextureAlphaNew(18/640.0f, 141/480.0f, saveload_ui_save_up); } /*else { @@ -95,10 +96,16 @@ } } pLODFile.FreeSubIndexAndIO(); - uTextureID_x_d = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE); - uTextureID_LS_ = pIcons_LOD->LoadTexture("LS_saveD", TEXTURE_16BIT_PALETTE); - uTextureID_AR_UP_DN = pIcons_LOD->LoadTexture("AR_UP_DN", TEXTURE_16BIT_PALETTE); - uTextureID_AR_DN_DN = pIcons_LOD->LoadTexture("AR_DN_DN", TEXTURE_16BIT_PALETTE); + + if (!saveload_ui_x_d) + saveload_ui_x_d = assets->GetImage_16BitAlpha("x_d"); + if (!saveload_ui_ls_saved) + saveload_ui_ls_saved = assets->GetImage_16BitAlpha("LS_saveD"); + if (!ui_ar_up_dn) + ui_ar_up_dn = assets->GetImage_16BitAlpha("ar_up_dn"); + if (!ui_ar_dn_dn) + ui_ar_dn_dn = assets->GetImage_16BitAlpha("ar_dn_dn"); + // ----------------------------- // GUIWindow_Save c-tor --- part @@ -109,10 +116,11 @@ CreateButton(21, 278, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 4, 0, "", 0); CreateButton(21, 298, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 5, 0, "", 0); CreateButton(21, 318, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 6, 0, "", 0); - pBtnLoadSlot = CreateButton(241, 302, 105, 40, 1, 0, UIMSG_SaveLoadBtn, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_LS_), 0); - pBtnCancel = CreateButton(350, 302, 105, 40, 1, 0, UIMSG_Cancel, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_x_d), 0); - pBtnArrowUp = CreateButton(215, 199, 17, 17, 1, 0, UIMSG_ArrowUp, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_AR_UP_DN), 0); - pBtnDownArrow = CreateButton(215, 323, 17, 17, 1, 0, UIMSG_DownArrow, 34, 0, "", pIcons_LOD->GetTexture(uTextureID_AR_DN_DN), 0); + + pBtnLoadSlot = CreateButton(241, 302, 105, 40, 1, 0, UIMSG_SaveLoadBtn, 0, 0, "", saveload_ui_ls_saved, 0); + pBtnCancel = CreateButton(350, 302, 105, 40, 1, 0, UIMSG_Cancel, 0, 0, "", saveload_ui_x_d, 0); + pBtnArrowUp = CreateButton(215, 199, 17, 17, 1, 0, UIMSG_ArrowUp, 0, 0, "", ui_ar_up_dn, 0); + pBtnDownArrow = CreateButton(215, 323, 17, 17, 1, 0, UIMSG_DownArrow, 34, 0, "", ui_ar_dn_dn, 0); } @@ -148,27 +156,27 @@ memset(pSavegameUsedSlots.data(), 0, sizeof(pSavegameUsedSlots)); memset(pSavegameThumbnails.data(), 0, 45 * sizeof(Image *)); - img_loadsave = assets->GetImage_16BitColorKey(L"loadsave", 0x7FF); - img_save_up = assets->GetImage_16BitColorKey(L"save_up", 0x7FF); - img_load_up = assets->GetImage_16BitColorKey(L"load_up", 0x7FF); - img_loadsave_saveu = assets->GetImage_16BitColorKey(L"LS_saveU", 0x7FF); - img_loadsave_loadu = assets->GetImage_16BitColorKey(L"LS_loadU", 0x7FF); - img_loadsave_x_u = assets->GetImage_16BitColorKey(L"x_u", 0x7FF); + saveload_ui_loadsave = assets->GetImage_16BitColorKey(L"loadsave", 0x7FF); + saveload_ui_save_up = assets->GetImage_16BitColorKey(L"save_up", 0x7FF); + saveload_ui_load_up = assets->GetImage_16BitColorKey(L"load_up", 0x7FF); + saveload_ui_saveu = assets->GetImage_16BitColorKey(L"LS_saveU", 0x7FF); + saveload_ui_loadu = assets->GetImage_16BitColorKey(L"LS_loadU", 0x7FF); + saveload_ui_x_u = assets->GetImage_16BitColorKey(L"x_u", 0x7FF); if (ingame) { - pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, img_loadsave); + pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, saveload_ui_loadsave); if (current_screen_type == SCREEN_SAVEGAME) { - pRenderer->DrawTextureAlphaNew(241/640.0f, 302/480.0f, img_loadsave_saveu); - pRenderer->DrawTextureAlphaNew(18 / 640.0f, 141 / 480.0f, img_save_up); + pRenderer->DrawTextureAlphaNew(241/640.0f, 302/480.0f, saveload_ui_saveu); + pRenderer->DrawTextureAlphaNew(18 / 640.0f, 141 / 480.0f, saveload_ui_save_up); } else { - pRenderer->DrawTextureAlphaNew(241 / 640.0f, 302 / 480.0f, img_loadsave_loadu); - pRenderer->DrawTextureAlphaNew(18 / 640.0f, 141 / 480.0f, img_load_up); + pRenderer->DrawTextureAlphaNew(241 / 640.0f, 302 / 480.0f, saveload_ui_loadu); + pRenderer->DrawTextureAlphaNew(18 / 640.0f, 141 / 480.0f, saveload_ui_load_up); } - pRenderer->DrawTextureAlphaNew(351 / 640.0f, 302 / 480.0f, img_loadsave_x_u); + pRenderer->DrawTextureAlphaNew(351 / 640.0f, 302 / 480.0f, saveload_ui_x_u); } else pRenderer->DrawTextureNew(0, 0, main_menu_background); @@ -228,18 +236,24 @@ } pLODFile.FreeSubIndexAndIO(); - if (current_screen_type == SCREEN_SAVEGAME) + + saveload_ui_x_d = assets->GetImage_16BitAlpha("x_d"); + + if (saveload_ui_ls_saved) { - uTextureID_x_d = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE); - uTextureID_LS_ = pIcons_LOD->LoadTexture("LS_saveD", TEXTURE_16BIT_PALETTE); + saveload_ui_ls_saved->Release(); + saveload_ui_ls_saved = nullptr; } + if (current_screen_type == SCREEN_SAVEGAME) + saveload_ui_ls_saved = assets->GetImage_16BitAlpha("LS_saveD"); else - { - uTextureID_x_d = pIcons_LOD->LoadTexture("x_d", TEXTURE_16BIT_PALETTE); - uTextureID_LS_ = pIcons_LOD->LoadTexture("LS_loadD", TEXTURE_16BIT_PALETTE); - } - uTextureID_AR_UP_DN = pIcons_LOD->LoadTexture("AR_UP_DN", TEXTURE_16BIT_PALETTE); - uTextureID_AR_DN_DN = pIcons_LOD->LoadTexture("AR_DN_DN", TEXTURE_16BIT_PALETTE); + saveload_ui_ls_saved = assets->GetImage_16BitAlpha("LS_loadD"); + + if (!ui_ar_up_dn) + ui_ar_up_dn = assets->GetImage_16BitAlpha("AR_UP_DN"); + if (!ui_ar_dn_dn) + ui_ar_dn_dn = assets->GetImage_16BitAlpha("AR_DN_DN"); + CreateButton(21, 198, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 0, 0, "", 0); CreateButton(21, 219, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 1, 0, "", 0); CreateButton(21, 240, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 2, 0, "", 0); @@ -247,10 +261,11 @@ CreateButton(21, 282, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 4, 0, "", 0); CreateButton(21, 303, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 5, 0, "", 0); CreateButton(21, 324, 191, 18, 1, 0, UIMSG_SelectLoadSlot, 6, 0, "", 0); - pBtnLoadSlot = CreateButton(241, 302, 105, 40, 1, 0, UIMSG_SaveLoadBtn, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_LS_), 0); - pBtnCancel = CreateButton(350, 302, 105, 40, 1, 0, UIMSG_Cancel, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_x_d), 0); - pBtnArrowUp = CreateButton(215, 199, 17, 17, 1, 0, UIMSG_ArrowUp, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_AR_UP_DN), 0); - pBtnDownArrow = CreateButton(215, 323, 17, 17, 1, 0, UIMSG_DownArrow, uNumSavegameFiles, 0, "", pIcons_LOD->GetTexture(uTextureID_AR_DN_DN), 0); + + pBtnLoadSlot = CreateButton(241, 302, 105, 40, 1, 0, UIMSG_SaveLoadBtn, 0, 0, "", saveload_ui_ls_saved, 0); + pBtnCancel = CreateButton(350, 302, 105, 40, 1, 0, UIMSG_Cancel, 0, 0, "", saveload_ui_x_d, 0); + pBtnArrowUp = CreateButton(215, 199, 17, 17, 1, 0, UIMSG_ArrowUp, 0, 0, "", ui_ar_up_dn, 0); + pBtnDownArrow = CreateButton(215, 323, 17, 17, 1, 0, UIMSG_DownArrow, uNumSavegameFiles, 0, "", ui_ar_dn_dn, 0); } @@ -288,18 +303,18 @@ pRenderer->BeginScene(); if ( GetCurrentMenuID() != MENU_SAVELOAD && GetCurrentMenuID() != MENU_LoadingProcInMainMenu ) { - pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, img_loadsave); + pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, saveload_ui_loadsave); if (save) { - pRenderer->DrawTextureAlphaNew(241 / 640.0f, 302 / 480.0f, img_loadsave_saveu); - pRenderer->DrawTextureAlphaNew( 18 / 640.0f, 139 / 480.0f, img_save_up); + pRenderer->DrawTextureAlphaNew(241 / 640.0f, 302 / 480.0f, saveload_ui_saveu); + pRenderer->DrawTextureAlphaNew( 18 / 640.0f, 139 / 480.0f, saveload_ui_save_up); } else { - pRenderer->DrawTextureAlphaNew(241 / 640.0f, 302 / 480.0f, img_loadsave_loadu); - pRenderer->DrawTextureAlphaNew( 18 / 640.0f, 139 / 480.0f, img_load_up); + pRenderer->DrawTextureAlphaNew(241 / 640.0f, 302 / 480.0f, saveload_ui_loadu); + pRenderer->DrawTextureAlphaNew( 18 / 640.0f, 139 / 480.0f, saveload_ui_load_up); } - pRenderer->DrawTextureAlphaNew(351 / 640.0f, 302 / 480.0f, img_loadsave_x_u); + pRenderer->DrawTextureAlphaNew(351 / 640.0f, 302 / 480.0f, saveload_ui_x_u); } if ( pSavegameUsedSlots[uLoadGameUI_SelectedSlot] ) {
--- a/GUI/UI/UISaveLoad.h Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/UISaveLoad.h Mon Mar 07 03:48:40 2016 +0200 @@ -18,9 +18,9 @@ }; -extern class Image *img_save_up; -extern class Image *img_load_up; -extern class Image *img_loadsave; -extern class Image *img_loadsave_saveu; -extern class Image *img_loadsave_loadu; -extern class Image *img_loadsave_x_u; \ No newline at end of file +extern class Image *saveload_ui_save_up; +extern class Image *saveload_ui_load_up; +extern class Image *saveload_ui_loadsave; +extern class Image *saveload_ui_saveu; +extern class Image *saveload_ui_loadu; +extern class Image *saveload_ui_x_u; \ No newline at end of file
--- a/GUI/UI/UITransition.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/UITransition.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -19,6 +19,7 @@ #include "GUI/GUIFont.h" #include "GUI/GUIProgressBar.h" #include "GUI/UI/UIHouses.h" +#include "GUI/UI/UIGame.h" #include "Media/Audio/AudioPlayer.h" #include "Media/MediaPlayer.h" @@ -26,13 +27,25 @@ +Image *transition_ui_icon = nullptr; + + void GUIWindow_Travel::Release() { // ----------------------------------------- // 0041C26A void GUIWindow::Release --- part - pTexture_outside->Release(); - pTexture_Dialogue_Background->Release(); - pIcons_LOD->SyncLoadedFilesCount(); + if (transition_ui_icon) + { + transition_ui_icon->Release(); + transition_ui_icon = nullptr; + } + + if (game_ui_dialogue_background) + { + game_ui_dialogue_background->Release(); + game_ui_dialogue_background = nullptr; + } + current_screen_type = prev_screen_type; GUIWindow::Release(); @@ -43,9 +56,18 @@ // ----------------------------------------- // 0041C26A void GUIWindow::Release --- part //pVideoPlayer->Unload(); - pTexture_outside->Release(); - pTexture_Dialogue_Background->Release(); - pIcons_LOD->SyncLoadedFilesCount(); + if (transition_ui_icon) + { + transition_ui_icon->Release(); + transition_ui_icon = nullptr; + } + + if (game_ui_dialogue_background) + { + game_ui_dialogue_background->Release(); + game_ui_dialogue_background = nullptr; + } + current_screen_type = prev_screen_type; GUIWindow::Release(); @@ -79,9 +101,9 @@ case PartyAlignment_Evil: sprintfex(pContainer, "evt%02d-c", const_2()); break; default: Error("Invalid alignment: %u", pParty->alignment); } + game_ui_dialogue_background = assets->GetImage_16Bit(pContainer); - pTexture_Dialogue_Background = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)]; - pTexture_outside = pIcons_LOD->LoadTexturePtr(pHouse_ExitPictures[exit_pic_id], TEXTURE_16BIT_PALETTE); + transition_ui_icon = assets->GetImage_16Bit(pHouse_ExitPictures[exit_pic_id]); if (anim_id) { if ( !IndoorLocation::GetLocationIndex(pLocationName) ) @@ -140,8 +162,8 @@ // 0041C432 GUIWindow c-tor -- part prev_screen_type = current_screen_type; current_screen_type = SCREEN_INPUT_BLV; - pBtn_ExitCancel = CreateButton(0x236u, 0x1BDu, 0x4Bu, 0x21u, 1, 0, UIMSG_TransitionWindowCloseBtn, 0, 'N', pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); // Cancel / Отмена - pBtn_YES = CreateButton(0x1E6u, 0x1BDu, 0x4Bu, 0x21u, 1, 0, UIMSG_TransitionUI_Confirm, 0, 'Y', hint, pIcons_LOD->GetTexture(uTextureID_BUTTYES2), 0); + pBtn_ExitCancel = CreateButton(0x236u, 0x1BDu, 0x4Bu, 0x21u, 1, 0, UIMSG_TransitionWindowCloseBtn, 0, 'N', pGlobalTXT_LocalizationStrings[34], ui_buttdesc2, 0); // Cancel / Отмена + pBtn_YES = CreateButton(0x1E6u, 0x1BDu, 0x4Bu, 0x21u, 1, 0, UIMSG_TransitionUI_Confirm, 0, 'Y', hint, ui_buttyes2, 0); CreateButton(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 0x3Fu, 0x49u, 1, 0, UIMSG_TransitionUI_Confirm, 1, 0x20u, hint, 0); CreateButton(8, 8, 0x1CCu, 0x158u, 1, 0, UIMSG_TransitionUI_Confirm, 1u, 0, hint, 0); } @@ -165,9 +187,9 @@ case PartyAlignment_Evil: sprintfex(pContainer, "evt%02d-c", const_2()); break; default: Error("Invalid alignment: %u", pParty->alignment); } + game_ui_dialogue_background = assets->GetImage_16Bit(pContainer); - pTexture_Dialogue_Background = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); - pTexture_outside = pIcons_LOD->LoadTexturePtr("outside", TEXTURE_16BIT_PALETTE); + transition_ui_icon = assets->GetImage_16Bit("outside"); if ( pMapStats->GetMapInfo(pCurrentMapName) ) sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)].pName);// "Leave %s" else @@ -187,7 +209,7 @@ 0, 'N', pGlobalTXT_LocalizationStrings[156], - pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), + ui_buttdesc2, 0 );// Stay in this area / Остаться в этой области pBtn_YES = CreateButton( @@ -196,7 +218,7 @@ 0, 'Y', hint, - pIcons_LOD->GetTexture(uTextureID_BUTTYES2), + ui_buttyes2, 0 ); CreateButton(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 63, 73, 1, 0, UIMSG_OnTravelByFoot, 1, ' ', hint, 0, 0, 0); @@ -215,11 +237,11 @@ memcpy(&travel_window, pPrimaryWindow, sizeof(travel_window)); pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pDestinationMapName, 20); - pRenderer->DrawTextureTransparentColorKey(477, 0, pTexture_Dialogue_Background); + pRenderer->DrawTextureNew(477/640.0f, 0, game_ui_dialogue_background); pRenderer->DrawTextureAlphaNew(468/640.0f, 0, game_ui_right_panel_frame); - pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pTexture_outside); - pRenderer->DrawTextureTransparentColorKey(556, 451, pIcons_LOD->GetTexture(uTextureID_x_x_u)); - pRenderer->DrawTextureTransparentColorKey(476, 451, pIcons_LOD->GetTexture(uTextureID_x_ok_u)); + pRenderer->DrawTextureNew(pNPCPortraits_x[0][0]/640.0f, pNPCPortraits_y[0][0]/480.0f, transition_ui_icon); + pRenderer->DrawTextureAlphaNew(556/640.0f, 451/480.0f, dialogue_ui_x_x_u); + pRenderer->DrawTextureAlphaNew(476/640.0f, 451/480.0f, dialogue_ui_x_ok_u); if ( pMapStats->GetMapInfo(pDestinationMapName) ) { travel_window.uFrameX = 493; @@ -256,13 +278,13 @@ memcpy(&transition_window, pPrimaryWindow, sizeof(transition_window)); v9 = IndoorLocation::GetLocationIndex(dword_591164_teleport_map_name); - pRenderer->DrawTextureTransparentColorKey(0x1DDu, 0, pTexture_Dialogue_Background); - pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, pIcons_LOD->GetTexture(uTextureID_50795C)); - pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pTexture_outside); + pRenderer->DrawTextureNew(477/640.0f, 0, game_ui_dialogue_background); + pRenderer->DrawTextureAlphaNew((pNPCPortraits_x[0][0] - 4)/640.0f, (pNPCPortraits_y[0][0] - 4)/480.0f, game_ui_evtnpc); + pRenderer->DrawTextureNew(pNPCPortraits_x[0][0]/640.0f, pNPCPortraits_y[0][0]/480.0f, transition_ui_icon); pRenderer->DrawTextureAlphaNew(468/640.0f, 0, game_ui_right_panel_frame); - pRenderer->DrawTextureTransparentColorKey(556, 451, pIcons_LOD->GetTexture(uTextureID_x_x_u)); - pRenderer->DrawTextureTransparentColorKey(476, 451, pIcons_LOD->GetTexture(uTextureID_x_ok_u)); + pRenderer->DrawTextureAlphaNew(556/640.0f, 451/480.0f, dialogue_ui_x_x_u); + pRenderer->DrawTextureAlphaNew(476/640.0f, 451/480.0f, dialogue_ui_x_ok_u); map_id = pMapStats->GetMapInfo(pCurrentMapName); if ( (pMovie_Track || v9) && *dword_591164_teleport_map_name != ' ' ) map_id = pMapStats->GetMapInfo(dword_591164_teleport_map_name);
--- a/GUI/UI/UiGame.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/UiGame.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -4,6 +4,7 @@ #include <crtdbg.h> #include "Engine/Engine.h" +#include "Engine/AssetsManager.h" #include "Engine/Events.h" #include "Engine/Graphics/Texture.h" #include "Engine/Graphics/Vis.h" @@ -52,54 +53,106 @@ Image *game_ui_leftframe = nullptr; Image *game_ui_bottomframe = nullptr; +Image *game_ui_monster_hp_green = nullptr; +Image *game_ui_monster_hp_yellow = nullptr; +Image *game_ui_monster_hp_red = nullptr; +Image *game_ui_monster_hp_background = nullptr; +Image *game_ui_monster_hp_border_left = nullptr; +Image *game_ui_monster_hp_border_right = nullptr; + +Image *game_ui_bar_red = nullptr; +Image *game_ui_bar_yellow = nullptr; +Image *game_ui_bar_green = nullptr; +Image *game_ui_bar_blue = nullptr; + +Image *game_ui_player_alert_yellow = nullptr; // 5079C8 +Image *game_ui_player_alert_red = nullptr; // 5079CC +Image *game_ui_player_alert_green = nullptr; // 5079D0 + +Image *game_ui_minimap_frame = nullptr; // 5079D8 +Image *game_ui_minimap_compass = nullptr; // 5079B4 +std::array<Image *, 8> game_ui_minimap_dirs; + +Image *game_ui_menu_quit = nullptr; +Image *game_ui_menu_resume = nullptr; +Image *game_ui_menu_controls = nullptr; +Image *game_ui_menu_save = nullptr; +Image *game_ui_menu_load = nullptr; +Image *game_ui_menu_new = nullptr; +Image *game_ui_menu_options = nullptr; + +Image *game_ui_tome_storyline = nullptr; +Image *game_ui_tome_calendar = nullptr; +Image *game_ui_tome_maps = nullptr; +Image *game_ui_tome_autonotes = nullptr; +Image *game_ui_tome_quests = nullptr; + +Image *game_ui_btn_rest = nullptr; +Image *game_ui_btn_cast = nullptr; +Image *game_ui_btn_zoomin = nullptr; +Image *game_ui_btn_zoomout = nullptr; +Image *game_ui_btn_quickref = nullptr; +Image *game_ui_btn_settings = nullptr; + +Image *game_ui_dialogue_background = nullptr; + +Image *game_ui_menu_options_video_background = nullptr; +Image *game_ui_menu_options_video_bloodsplats = nullptr; +Image *game_ui_menu_options_video_coloredlights = nullptr; +Image *game_ui_menu_options_video_tinting = nullptr; +std::array<Image *, 10> game_ui_menu_options_video_gamma_positions; +std::array<Image *, 5> game_ui_options_controls; + +Image *game_ui_evtnpc = nullptr; // 50795C + GUIWindow_GameMenu::GUIWindow_GameMenu() : GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, nullptr) { // ----------------------- // GameMenuUI_Load -- part - uTextureID_Options = pIcons_LOD->LoadTexture("options", TEXTURE_16BIT_PALETTE); - uTextureID_New1 = pIcons_LOD->LoadTexture("new1", TEXTURE_16BIT_PALETTE); - uTextureID_Load1 = pIcons_LOD->LoadTexture("load1", TEXTURE_16BIT_PALETTE); - uTextureID_Save1 = pIcons_LOD->LoadTexture("save1", TEXTURE_16BIT_PALETTE); - uTextureID_Controls1 = pIcons_LOD->LoadTexture("controls1", TEXTURE_16BIT_PALETTE); - uTextureID_Resume1 = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE); - uTextureID_Quit1 = pIcons_LOD->LoadTexture("quit1", TEXTURE_16BIT_PALETTE); + game_ui_menu_options = assets->GetImage_16BitAlpha(L"options"); + game_ui_menu_new = assets->GetImage_16BitAlpha(L"new1"); + game_ui_menu_load = assets->GetImage_16BitAlpha(L"load1"); + game_ui_menu_save = assets->GetImage_16BitAlpha(L"save1"); + game_ui_menu_controls = assets->GetImage_16BitAlpha(L"controls1"); + game_ui_menu_resume = assets->GetImage_16BitAlpha(L"resume1"); + game_ui_menu_quit = assets->GetImage_16BitAlpha(L"quit1"); pBtn_NewGame = CreateButton( 0x13u, 0x9Bu, 0xD6u, 0x28u, 1, 0, UIMSG_StartNewGame, 0, 0x4Eu, pGlobalTXT_LocalizationStrings[614],// "New Game" - pIcons_LOD->GetTexture(uTextureID_New1), + game_ui_menu_new, 0 ); pBtn_SaveGame = CreateButton( 0x13u, 0xD1u, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenSaveGameDialog, 0, 0x53u, pGlobalTXT_LocalizationStrings[615],// "Save Game" - pIcons_LOD->GetTexture(uTextureID_Save1), + game_ui_menu_save, 0 ); pBtn_LoadGame = CreateButton( 19, 263, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenLoadGameDialog, 0, 0x4Cu, pGlobalTXT_LocalizationStrings[616],// "Load Game" - pIcons_LOD->GetTexture(uTextureID_Load1), + game_ui_menu_load, 0 ); pBtn_GameControls = CreateButton( 241, 155, 214, 40, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0x43u, pGlobalTXT_LocalizationStrings[617],// ""Sound, Keyboard, Game Options:"" - pIcons_LOD->GetTexture(uTextureID_Controls1), + game_ui_menu_controls, 0 ); pBtn_QuitGame = CreateButton( 241, 209, 214, 40, 1, 0, UIMSG_Quit, 0, 0x51u, pGlobalTXT_LocalizationStrings[618],// "Quit" - pIcons_LOD->GetTexture(uTextureID_Quit1), + game_ui_menu_quit, 0 ); pBtn_Resume = CreateButton( 241, 263, 214, 40, 1, 0, UIMSG_GameMenu_ReturnToGame, 0, 0x52u, pGlobalTXT_LocalizationStrings[619],// "Return to Game" - pIcons_LOD->GetTexture(uTextureID_Resume1), + game_ui_menu_resume, 0 ); _41D08F_set_keyboard_control_group(6, 1, 0, 0); @@ -109,12 +162,13 @@ { // ----------------------------------- // 004156F0 GUI_UpdateWindows --- part - pRenderer->DrawTextureTransparentColorKey( - pViewport->uViewportTL_Y, - pViewport->uViewportTL_X, - pIcons_LOD->GetTexture(uTextureID_Options) + pRenderer->DrawTextureAlphaNew( + pViewport->uViewportTL_X/640.0f, + pViewport->uViewportTL_Y/480.0f, + game_ui_menu_options ); - viewparams->bRedrawGameUI = 1; + + viewparams->bRedrawGameUI = true; } @@ -156,11 +210,11 @@ { // ------------------------------------------ // GameMenuUI_OptionsKeymapping_Load --- part - uTextureID_Optkb[0] = pIcons_LOD->LoadTexture("optkb", TEXTURE_16BIT_PALETTE); - uTextureID_Optkb[1] = pIcons_LOD->LoadTexture("optkb_h", TEXTURE_16BIT_PALETTE); - uTextureID_Optkb[2] = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE); - uTextureID_Optkb[3] = pIcons_LOD->LoadTexture("optkb_1", TEXTURE_16BIT_PALETTE); - uTextureID_Optkb[4] = pIcons_LOD->LoadTexture("optkb_2", TEXTURE_16BIT_PALETTE); + game_ui_options_controls[0] = assets->GetImage_16BitColorKey(L"optkb", 0x7FF); + game_ui_options_controls[1] = assets->GetImage_16BitColorKey(L"optkb_h", 0x7FF); + game_ui_options_controls[2] = assets->GetImage_16BitColorKey(L"resume1", 0x7FF); + game_ui_options_controls[3] = assets->GetImage_16BitColorKey(L"optkb_1", 0x7FF); + game_ui_options_controls[4] = assets->GetImage_16BitColorKey(L"optkb_2", 0x7FF); CreateButton(241, 302, 214, 40, 1, 0, UIMSG_Escape, 0, 0, "", 0); @@ -221,10 +275,10 @@ uGameMenuUI_CurentlySelectedKeyIdx = -1; pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE; } - pRenderer->DrawTextureTransparentColorKey(8, 8, pIcons_LOD->GetTexture(uTextureID_Optkb[0]));//draw base texture + pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, game_ui_options_controls[0]);//draw base texture if (KeyboardPageNum == 1) { - pRenderer->DrawTextureTransparentColorKey(19, 302, pIcons_LOD->GetTexture(uTextureID_Optkb[3])); + pRenderer->DrawTextureAlphaNew(19/640.0f, 302/480.0f, game_ui_options_controls[3]); pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, ui_gamemenu_keys_action_name_color, "ВПЕРЁД", 0, 0, 0); pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 142, GameMenuUI_GetKeyBindingColor(0), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[0]), 0, 0, 0); @@ -257,7 +311,7 @@ } else { - pRenderer->DrawTextureTransparentColorKey(127, 302, pIcons_LOD->GetTexture(uTextureID_Optkb[4])); + pRenderer->DrawTextureAlphaNew(127/640.0f, 302/480.0f, game_ui_options_controls[4]); pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, ui_gamemenu_keys_action_name_color, "Б. СПРАВКА", 0, 0, 0); pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 142, GameMenuUI_GetKeyBindingColor(14), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[14]), 0, 0, 0); @@ -297,25 +351,24 @@ { // ------------------------------------- // GameMenuUI_OptionsVideo_Load --- part - optvid_base_texture_id = pIcons_LOD->LoadTexture("optvid", TEXTURE_16BIT_PALETTE); - bloodsplats_texture_id = pIcons_LOD->LoadTexture("opvdH-bs", TEXTURE_16BIT_PALETTE); - us_colored_lights_texture_id = pIcons_LOD->LoadTexture("opvdH-cl", TEXTURE_16BIT_PALETTE); - tinting_texture_id = pIcons_LOD->LoadTexture("opvdH-tn", TEXTURE_16BIT_PALETTE); - uTextureID_507C20 = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE); - uTextureID_507C24 = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE); - pTextureIDs_GammaPositions[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE); - pTextureIDs_GammaPositions[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE); - pTextureIDs_GammaPositions[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE); - pTextureIDs_GammaPositions[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE); - pTextureIDs_GammaPositions[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE); - pTextureIDs_GammaPositions[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE); - pTextureIDs_GammaPositions[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE); - pTextureIDs_GammaPositions[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE); - pTextureIDs_GammaPositions[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE); - pTextureIDs_GammaPositions[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE); - not_available_bloodsplats_texture_id = pIcons_LOD->LoadTexture("opvdG-bs", TEXTURE_16BIT_PALETTE); - not_available_us_colored_lights_texture_id = pIcons_LOD->LoadTexture("opvdG-cl", TEXTURE_16BIT_PALETTE); - not_available_tinting_texture_id = pIcons_LOD->LoadTexture("opvdG-tn", TEXTURE_16BIT_PALETTE); + game_ui_menu_options_video_background = assets->GetImage_16BitColorKey(L"optvid", 0x7FF); + game_ui_menu_options_video_bloodsplats = assets->GetImage_16BitColorKey(L"opvdH-bs", 0x7FF); + game_ui_menu_options_video_coloredlights = assets->GetImage_16BitColorKey(L"opvdH-cl", 0x7FF); + game_ui_menu_options_video_tinting = assets->GetImage_16BitColorKey(L"opvdH-tn", 0x7FF); + + game_ui_menu_options_video_gamma_positions[0] = assets->GetImage_16BitColorKey(L"convol10", 0x7FF); + game_ui_menu_options_video_gamma_positions[1] = assets->GetImage_16BitColorKey(L"convol20", 0x7FF); + game_ui_menu_options_video_gamma_positions[2] = assets->GetImage_16BitColorKey(L"convol30", 0x7FF); + game_ui_menu_options_video_gamma_positions[3] = assets->GetImage_16BitColorKey(L"convol40", 0x7FF); + game_ui_menu_options_video_gamma_positions[4] = assets->GetImage_16BitColorKey(L"convol50", 0x7FF); + game_ui_menu_options_video_gamma_positions[5] = assets->GetImage_16BitColorKey(L"convol60", 0x7FF); + game_ui_menu_options_video_gamma_positions[6] = assets->GetImage_16BitColorKey(L"convol70", 0x7FF); + game_ui_menu_options_video_gamma_positions[7] = assets->GetImage_16BitColorKey(L"convol80", 0x7FF); + game_ui_menu_options_video_gamma_positions[8] = assets->GetImage_16BitColorKey(L"convol90", 0x7FF); + game_ui_menu_options_video_gamma_positions[9] = assets->GetImage_16BitColorKey(L"convol00", 0x7FF); + //not_available_bloodsplats_texture_id = pIcons_LOD->LoadTexture("opvdG-bs", TEXTURE_16BIT_PALETTE); + //not_available_us_colored_lights_texture_id = pIcons_LOD->LoadTexture("opvdG-cl", TEXTURE_16BIT_PALETTE); + //not_available_tinting_texture_id = pIcons_LOD->LoadTexture("opvdG-tn", TEXTURE_16BIT_PALETTE); CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, UIMSG_Escape, 0, 0, "", 0); //if ( pRenderer->pRenderD3D ) @@ -324,16 +377,6 @@ CreateButton(0x13u, 0x12Eu, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleColoredLights, 0, 0, "", 0); CreateButton(0x13u, 0x144u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleTint, 0, 0, "", 0); } - /*if ( !pRenderer->bWindowMode ) - { - //v0 = 1; - if ( pRenderer->IsGammaSupported() ) - { - pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0x15u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 4u, 0, "", pIcons_LOD->GetTexture(uTextureID_507C20), 0); - pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0xD5u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 5u, 0, "", pIcons_LOD->GetTexture(uTextureID_507C24), 0); - pGUIWindow_CurrentMenu->CreateButton(42, 162, 170, 18, 1, 0, UIMSG_1A9, 0, 0, "", 0); - } - }*/ } @@ -345,10 +388,14 @@ // 004156F0 GUI_UpdateWindows --- part GUIWindow msg_window; // [sp+8h] [bp-54h]@3 - pRenderer->DrawTextureTransparentColorKey(8, 8, pIcons_LOD->GetTexture(optvid_base_texture_id));//draw base texture + pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, game_ui_menu_options_video_background);//draw base texture //if ( !pRenderer->bWindowMode && pRenderer->IsGammaSupported() ) { - pRenderer->DrawTextureTransparentColorKey(17 * uGammaPos + 42, 162, pIcons_LOD->GetTexture(pTextureIDs_GammaPositions[uGammaPos])); + pRenderer->DrawTextureAlphaNew( + (17 * uGammaPos + 42)/640.0f, + 162/480.0f, + game_ui_menu_options_video_gamma_positions[uGammaPos]); + pRenderer->DrawTextureNew(274/640.0f, 169/480.0f, gamma_preview_image); msg_window.uFrameX = 22; msg_window.uFrameY = 190; @@ -359,21 +406,13 @@ msg_window.DrawTitleText(pFontSmallnum, 0, 0, ui_gamemenu_video_gamma_title_color, pGlobalTXT_LocalizationStrings[226], 3); // "Gamma controls the relative ""brightness"" of the game. May vary depending on your monitor." } - /*if (!pRenderer->pRenderD3D) - { - pRenderer->DrawTextureTransparentColorKey(20, 281, pIcons_LOD->GetTexture(not_available_bloodsplats_texture_id)); - pRenderer->DrawTextureTransparentColorKey(20, 303, pIcons_LOD->GetTexture(not_available_us_colored_lights_texture_id)); - pRenderer->DrawTextureTransparentColorKey(20, 325, pIcons_LOD->GetTexture(not_available_tinting_texture_id)); - } - else*/ - { + if (pEngine->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS) - pRenderer->DrawTextureTransparentColorKey(20, 281, pIcons_LOD->GetTexture(bloodsplats_texture_id)); + pRenderer->DrawTextureAlphaNew(20/640.0f, 281/480.0f, game_ui_menu_options_video_bloodsplats); if (pRenderer->bUseColoredLights) - pRenderer->DrawTextureTransparentColorKey(20, 303, pIcons_LOD->GetTexture(us_colored_lights_texture_id)); + pRenderer->DrawTextureAlphaNew(20/640.0f, 303/480.0f, game_ui_menu_options_video_coloredlights); if (pRenderer->bTinting) - pRenderer->DrawTextureTransparentColorKey(20, 325, pIcons_LOD->GetTexture(tinting_texture_id)); - } + pRenderer->DrawTextureAlphaNew(20/640.0f, 325/480.0f, game_ui_menu_options_video_tinting); } @@ -406,11 +445,13 @@ void OptionsMenuSkin::Relaease() { -#define RELEASE(id) \ +#define RELEASE(img) \ {\ - if (id)\ - pIcons_LOD->GetTexture(id)->Release();\ - id = 0;\ + if (img)\ + {\ + img->Release(); \ + img = nullptr; \ + }\ } RELEASE(uTextureID_Background); @@ -433,67 +474,67 @@ GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, nullptr) { // GameMenuUI_Options_Load -- part - options_menu_skin.uTextureID_Background = pIcons_LOD->LoadTexture("ControlBG", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_TurnSpeed[2] = pIcons_LOD->LoadTexture("con_16x", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_TurnSpeed[1] = pIcons_LOD->LoadTexture("con_32x", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_TurnSpeed[0] = pIcons_LOD->LoadTexture("con_Smoo", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_ArrowLeft = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_ArrowRight = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_SoundLevels[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_SoundLevels[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_SoundLevels[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_SoundLevels[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_SoundLevels[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_SoundLevels[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_SoundLevels[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_SoundLevels[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_SoundLevels[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_SoundLevels[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_FlipOnExit = pIcons_LOD->LoadTexture("option04", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_AlwaysRun = pIcons_LOD->LoadTexture("option03", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_ShowDamage = pIcons_LOD->LoadTexture("option02", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_WalkSound = pIcons_LOD->LoadTexture("option01", TEXTURE_16BIT_PALETTE); + options_menu_skin.uTextureID_Background = assets->GetImage_16BitColorKey(L"ControlBG", 0x7FF); + options_menu_skin.uTextureID_TurnSpeed[2] = assets->GetImage_16BitColorKey(L"con_16x", 0x7FF); + options_menu_skin.uTextureID_TurnSpeed[1] = assets->GetImage_16BitColorKey(L"con_32x", 0x7FF); + options_menu_skin.uTextureID_TurnSpeed[0] = assets->GetImage_16BitColorKey(L"con_Smoo", 0x7FF); + options_menu_skin.uTextureID_ArrowLeft = assets->GetImage_16BitAlpha(L"con_ArrL"); + options_menu_skin.uTextureID_ArrowRight = assets->GetImage_16BitAlpha(L"con_ArrR"); + options_menu_skin.uTextureID_SoundLevels[0] = assets->GetImage_16BitColorKey(L"convol10", 0x7FF); + options_menu_skin.uTextureID_SoundLevels[1] = assets->GetImage_16BitColorKey(L"convol20", 0x7FF); + options_menu_skin.uTextureID_SoundLevels[2] = assets->GetImage_16BitColorKey(L"convol30", 0x7FF); + options_menu_skin.uTextureID_SoundLevels[3] = assets->GetImage_16BitColorKey(L"convol40", 0x7FF); + options_menu_skin.uTextureID_SoundLevels[4] = assets->GetImage_16BitColorKey(L"convol50", 0x7FF); + options_menu_skin.uTextureID_SoundLevels[5] = assets->GetImage_16BitColorKey(L"convol60", 0x7FF); + options_menu_skin.uTextureID_SoundLevels[6] = assets->GetImage_16BitColorKey(L"convol70", 0x7FF); + options_menu_skin.uTextureID_SoundLevels[7] = assets->GetImage_16BitColorKey(L"convol80", 0x7FF); + options_menu_skin.uTextureID_SoundLevels[8] = assets->GetImage_16BitColorKey(L"convol90", 0x7FF); + options_menu_skin.uTextureID_SoundLevels[9] = assets->GetImage_16BitColorKey(L"convol00", 0x7FF); + options_menu_skin.uTextureID_FlipOnExit = assets->GetImage_16BitColorKey(L"option04", 0x7FF); + options_menu_skin.uTextureID_AlwaysRun = assets->GetImage_16BitColorKey(L"option03", 0x7FF); + options_menu_skin.uTextureID_ShowDamage = assets->GetImage_16BitColorKey(L"option02", 0x7FF); + options_menu_skin.uTextureID_WalkSound = assets->GetImage_16BitColorKey(L"option01", 0x7FF); CreateButton(22, 270, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureWidth, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureHeight, + options_menu_skin.uTextureID_TurnSpeed[2]->GetWidth(), + options_menu_skin.uTextureID_TurnSpeed[2]->GetHeight(), 1, 0, UIMSG_SetTurnSpeed, 0x80, 0, "", 0); CreateButton(93, 270, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureWidth, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureHeight, + options_menu_skin.uTextureID_TurnSpeed[1]->GetWidth(), + options_menu_skin.uTextureID_TurnSpeed[1]->GetHeight(), 1, 0, UIMSG_SetTurnSpeed, 0x40u, 0, "", 0); CreateButton(164, 270, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureWidth, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureHeight, + options_menu_skin.uTextureID_TurnSpeed[0]->GetWidth(), + options_menu_skin.uTextureID_TurnSpeed[0]->GetHeight(), 1, 0, UIMSG_SetTurnSpeed, 0, 0, "", 0); CreateButton(20, 303, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureWidth, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureHeight, + options_menu_skin.uTextureID_WalkSound->GetWidth(), + options_menu_skin.uTextureID_WalkSound->GetHeight(), 1, 0, UIMSG_ToggleWalkSound, 0, 0, "", 0); CreateButton(128, 303, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureWidth, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureHeight, + options_menu_skin.uTextureID_ShowDamage->GetWidth(), + options_menu_skin.uTextureID_ShowDamage->GetHeight(), 1, 0, UIMSG_ToggleShowDamage, 0, 0, "", 0); CreateButton(20, 325, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureWidth, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureHeight, + options_menu_skin.uTextureID_AlwaysRun->GetWidth(), + options_menu_skin.uTextureID_AlwaysRun->GetHeight(), 1, 0, UIMSG_ToggleAlwaysRun, 0, 0, "", 0); CreateButton(128, 325, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureWidth, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureHeight, + options_menu_skin.uTextureID_FlipOnExit->GetWidth(), + options_menu_skin.uTextureID_FlipOnExit->GetHeight(), 1, 0, UIMSG_ToggleFlipOnExit, 0, 0, "", 0); - pBtn_SliderLeft = CreateButton(243, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); - pBtn_SliderRight = CreateButton(435, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); + pBtn_SliderLeft = CreateButton(243, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 4, 0, "", options_menu_skin.uTextureID_ArrowLeft, 0); + pBtn_SliderRight = CreateButton(435, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 5, 0, "", options_menu_skin.uTextureID_ArrowRight, 0); CreateButton(263, 162, 172, 17, 1, 0, UIMSG_ChangeSoundVolume, 0, 0, "", 0); - pBtn_SliderLeft = CreateButton(243, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); - pBtn_SliderRight = CreateButton(435, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); + pBtn_SliderLeft = CreateButton(243, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 4, 0, "", options_menu_skin.uTextureID_ArrowLeft, 0); + pBtn_SliderRight = CreateButton(435, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 5, 0, "", options_menu_skin.uTextureID_ArrowRight, 0); CreateButton(263, 216, 172, 17, 1, 0, UIMSG_ChangeMusicVolume, 0, 0, "", 0); - pBtn_SliderLeft = CreateButton(243, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); - pBtn_SliderRight = CreateButton(435, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); + pBtn_SliderLeft = CreateButton(243, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 4, 0, "", options_menu_skin.uTextureID_ArrowLeft, 0); + pBtn_SliderRight = CreateButton(435, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 5, 0, "", options_menu_skin.uTextureID_ArrowRight, 0); CreateButton(263, 270, 172, 17, 1, 0, UIMSG_ChangeVoiceVolume, 0, 0, "", 0); CreateButton(241, 302, 214, 40, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[619], 0); // "Return to Game" @@ -509,24 +550,24 @@ { // ----------------------------------- // 004156F0 GUI_UpdateWindows --- part - pRenderer->DrawTextureTransparentColorKey(8, 8, pIcons_LOD->GetTexture(uTextureID_Options)); - pRenderer->DrawTextureTransparentColorKey(8, 132, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_Background)); + pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, game_ui_menu_options); + pRenderer->DrawTextureAlphaNew(8/640.0f, 132/480.0f, options_menu_skin.uTextureID_Background); switch (uTurnSpeed) { - case 64: pRenderer->DrawTextureTransparentColorKey(BtnTurnCoord[1], 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])); break; - case 128: pRenderer->DrawTextureTransparentColorKey(BtnTurnCoord[2], 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])); break; - default: pRenderer->DrawTextureTransparentColorKey(BtnTurnCoord[0], 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])); break; + case 64: pRenderer->DrawTextureAlphaNew(BtnTurnCoord[1]/640.0f, 270/480.0f, options_menu_skin.uTextureID_TurnSpeed[1]); break; + case 128: pRenderer->DrawTextureAlphaNew(BtnTurnCoord[2]/640.0f, 270/480.0f, options_menu_skin.uTextureID_TurnSpeed[2]); break; + default: pRenderer->DrawTextureAlphaNew(BtnTurnCoord[0]/640.0f, 270/480.0f, options_menu_skin.uTextureID_TurnSpeed[0]); break; } - if (bWalkSound) pRenderer->DrawTextureTransparentColorKey(20, 303, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)); - if (bShowDamage) pRenderer->DrawTextureTransparentColorKey(128, 303, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)); - if (bFlipOnExit) pRenderer->DrawTextureTransparentColorKey(128, 325, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)); - if (bAlwaysRun) pRenderer->DrawTextureTransparentColorKey(20, 325, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)); + if (bWalkSound) pRenderer->DrawTextureAlphaNew(20/640.0f, 303/480.0f, options_menu_skin.uTextureID_WalkSound); + if (bShowDamage) pRenderer->DrawTextureAlphaNew(128/640.0f, 303/480.0f, options_menu_skin.uTextureID_ShowDamage); + if (bFlipOnExit) pRenderer->DrawTextureAlphaNew(128/640.0f, 325/480.0f, options_menu_skin.uTextureID_FlipOnExit); + if (bAlwaysRun) pRenderer->DrawTextureAlphaNew(20/640.0f, 325/480.0f, options_menu_skin.uTextureID_AlwaysRun); - pRenderer->DrawTextureTransparentColorKey(265 + 17 * uSoundVolumeMultiplier, 162, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_SoundLevels[uSoundVolumeMultiplier])); - pRenderer->DrawTextureTransparentColorKey(265 + 17 * uMusicVolimeMultiplier, 216, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_SoundLevels[uMusicVolimeMultiplier])); - pRenderer->DrawTextureTransparentColorKey(265 + 17 * uVoicesVolumeMultiplier, 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_SoundLevels[uVoicesVolumeMultiplier])); + pRenderer->DrawTextureAlphaNew((265 + 17 * uSoundVolumeMultiplier)/640.0f, 162/480.0f, options_menu_skin.uTextureID_SoundLevels[uSoundVolumeMultiplier]); + pRenderer->DrawTextureAlphaNew((265 + 17 * uMusicVolimeMultiplier)/640.0f, 216/480.0f, options_menu_skin.uTextureID_SoundLevels[uMusicVolimeMultiplier]); + pRenderer->DrawTextureAlphaNew((265 + 17 * uVoicesVolumeMultiplier)/640.0f, 270/480.0f, options_menu_skin.uTextureID_SoundLevels[uVoicesVolumeMultiplier]); } @@ -719,7 +760,7 @@ popup_window.DrawMessageBox(0); sprintfex(pTmpBuf2.data(), "NPC%03d", pNPC->uPortraitID); pRenderer->DrawTextureTransparentColorKey(popup_window.uFrameX + 22, popup_window.uFrameY + 36, - (Texture *)(pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE) != -1 + (Texture_MM7 *)(pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE) != -1 ? &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE)] : 0)); if ( pNPC->uProfession ) { @@ -769,7 +810,8 @@ pDialogueNPCCount = 0; uNumDialogueNPCPortraits = 1; - pTexture_Dialogue_Background = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); + + game_ui_dialogue_background = assets->GetImage_16Bit(pContainer); sprintfex(pContainer, "npc%03u", pNPCInfo->uPortraitID); v9 = 0; pDialogueNPCPortraits[0] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); @@ -871,9 +913,9 @@ pGreetType = GetGreetType(sDialogue_SpeakingActorNPC_ID); window.uFrameWidth -= 10; window.uFrameZ -= 10; - pRenderer->DrawTextureTransparentColorKey(477, 0, pTexture_Dialogue_Background); + pRenderer->DrawTextureNew(477/640.0f, 0, game_ui_dialogue_background); pRenderer->DrawTextureAlphaNew(468/640.0f, 0, game_ui_right_panel_frame); - pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, (Texture *)(uTextureID_50795C != -1 ? &pIcons_LOD->pTextures[uTextureID_50795C] : 0)); + pRenderer->DrawTextureAlphaNew((pNPCPortraits_x[0][0] - 4)/640.0f, (pNPCPortraits_y[0][0] - 4)/480.0f, game_ui_evtnpc); pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[0]); if (pNPC->uProfession) @@ -964,8 +1006,14 @@ font = pFontCreate; pTextHeight = pFontCreate->CalcTextHeight(pInString, &window, 13, 0) + 7; } - if (uTextureID_Leather != -1) - pRenderer->GetLeather(8, 352 - pTextHeight, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - pTextHeight); + + if (ui_leather_mm7) + pRenderer->DrawTextureCustomHeight( + 8/640.0f, + (352 - pTextHeight)/480.0f, + ui_leather_mm7, + pTextHeight); + pRenderer->DrawTextureAlphaNew(8/640.0f, (347 - pTextHeight)/480.0f, _591428_endcap); pDialogueWindow->DrawText(font, 13, 354 - pTextHeight, 0, FitTextInAWindow(pInString, font, &window, 13, 0), 0, 0, 0); } @@ -1148,7 +1196,12 @@ pFont = pFontCreate; pTextHeight = pFontCreate->CalcTextHeight(byte_5B0938.data(), &BranchlessDlg_window, 12, 0) + 7; } - pRenderer->GetLeather(8, 352 - pTextHeight, pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - pTextHeight); + + pRenderer->DrawTextureCustomHeight( + 8/640.0f, + (352 - pTextHeight)/480.0f, + ui_leather_mm7, + pTextHeight); pRenderer->DrawTextureAlphaNew(8/640.0f, (347 - pTextHeight)/480.0f, _591428_endcap); pGUIWindow2->DrawText(pFont, 12, 354 - pTextHeight, 0, FitTextInAWindow(byte_5B0938.data(), pFont, &BranchlessDlg_window, 12, 0), 0, 0, 0); pRenderer->DrawTextureNew(0, 352/480.0f, game_ui_statusbar); @@ -1253,7 +1306,7 @@ //----- (0041D3B7) -------------------------------------------------------- void GameUI_CharacterQuickRecord_Draw(GUIWindow *window, Player *player) { - Texture *v13; // eax@6 + Texture_MM7 *v13; // eax@6 PlayerFrame *v15; // eax@12 unsigned int pTextColor; // eax@15 const char *v29; // eax@16 @@ -1353,9 +1406,9 @@ _50697C_book_flasher = !_50697C_book_flasher; if (_50697C_book_flasher && current_screen_type != SCREEN_REST ) { - if (bFlashQuestBook) pRenderer->DrawTextureIndexedAlpha(493, 355, pIcons_LOD->GetTexture(uTextureID_ib_td1_A)); - if (bFlashAutonotesBook) pRenderer->DrawTextureIndexedAlpha(527, 353, pIcons_LOD->GetTexture(uTextureID_ib_td2_A)); - if (bFlashHistoryBook) pRenderer->DrawTextureIndexedAlpha(600, 361, pIcons_LOD->GetTexture(uTextureID_ib_td5_A)); + if (bFlashQuestBook) pRenderer->DrawTextureAlphaNew(493/640.0f, 355/480.0f, game_ui_tome_quests); + if (bFlashAutonotesBook) pRenderer->DrawTextureAlphaNew(527/640.0f, 353/480.0f, game_ui_tome_autonotes); + if (bFlashHistoryBook) pRenderer->DrawTextureAlphaNew(600/640.0f, 361/480.0f, game_ui_tome_storyline); } else { @@ -1385,10 +1438,7 @@ { double v3; // st7@3 double v7; // st7@25 - Texture *pTextureHealth; // [sp-4h] [bp-30h]@10 - Texture *pTextureMana; // [sp+Ch] [bp-20h]@1 - pTextureMana = pIcons_LOD->GetTexture(uTextureID_BarBlue); for (uint i = 0; i < 4; ++i) { if (pParty->pPlayers[i].sHealth > 0) @@ -1397,21 +1447,25 @@ if (i == 2 || i == 3) v17 = 2; v3 = (double)pParty->pPlayers[i].sHealth / (double)pParty->pPlayers[i].GetMaxHealth(); + + auto pTextureHealth = game_ui_bar_green; if( v3 > 0.5 ) { if ( v3 > 1.0 ) v3 = 1.0; - pTextureHealth = pIcons_LOD->GetTexture(uTextureID_BarGreen); } else if ( v3 > 0.25 ) - pTextureHealth = pIcons_LOD->GetTexture(uTextureID_BarYellow); + pTextureHealth = game_ui_bar_yellow; else if ( v3 > 0.0 ) - pTextureHealth = pIcons_LOD->GetTexture(uTextureID_BarRed); + pTextureHealth = game_ui_bar_red; if( v3 > 0.0 ) { - pRenderer->SetUIClipRect(v17 + pHealthBarPos[i], (signed __int64)((1.0 - v3) * pTextureHealth->uTextureHeight) + 402, - v17 + pHealthBarPos[i] + pTextureHealth->uTextureWidth, pTextureHealth->uTextureHeight + 402); - pRenderer->DrawTextureTransparentColorKey(v17 + pHealthBarPos[i], 402, pTextureHealth); + pRenderer->SetUIClipRect( + v17 + pHealthBarPos[i], + (signed __int64)((1.0 - v3) * pTextureHealth->GetHeight()) + 402, + v17 + pHealthBarPos[i] + pTextureHealth->GetWidth(), + pTextureHealth->GetHeight() + 402); + pRenderer->DrawTextureAlphaNew((v17 + pHealthBarPos[i])/640.0f, 402/480.0f, pTextureHealth); pRenderer->ResetUIClipRect(); } } @@ -1423,9 +1477,12 @@ int v17 = 0; if (i == 2) v17 = 1; - pRenderer->SetUIClipRect(v17 + pManaBarPos[i], (signed __int64)((1.0 - v7) * pTextureMana->uTextureHeight) + 402, - v17 + pManaBarPos[i] + pTextureMana->uTextureWidth, pTextureMana->uTextureHeight + 402); - pRenderer->DrawTextureTransparentColorKey(v17 + pManaBarPos[i], 402, pTextureMana); + pRenderer->SetUIClipRect( + v17 + pManaBarPos[i], + (signed __int64)((1.0 - v7) * game_ui_bar_blue->GetHeight()) + 402, + v17 + pManaBarPos[i] + game_ui_bar_blue->GetWidth(), + game_ui_bar_blue->GetHeight() + 402); + pRenderer->DrawTextureAlphaNew((v17 + pManaBarPos[i])/640.0f, 402/480.0f, game_ui_bar_blue); pRenderer->ResetUIClipRect(); } } @@ -1902,8 +1959,8 @@ void GameUI_DrawPartySpells() { unsigned int v0; // ebp@1 - Texture *spell_texture; // [sp-4h] [bp-1Ch]@12 - //Texture *v9; // [sp-4h] [bp-1Ch]@21 + Texture_MM7 *spell_texture; // [sp-4h] [bp-1Ch]@12 + //Texture_MM7 *v9; // [sp-4h] [bp-1Ch]@21 v0 = (signed __int64)((double)GetTickCount() * 0.050000001); //v1 = 0; @@ -1912,7 +1969,7 @@ //v2 = byte_4E5DD8[v1]; if (pParty->pPartyBuffs[byte_4E5DD8[i]].uExpireTime) { - Texture* tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]); + Texture_MM7* tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]); //v3 = pTextureIDs_PartyBuffIcons[i]; pRenderer->_4A65CC(pPartySpellbuffsUI_XYs[i][0], pPartySpellbuffsUI_XYs[i][1], tex, tex, @@ -1964,7 +2021,7 @@ { unsigned int face_expression_ID; // eax@17 PlayerFrame *pFrame; // eax@21 - Texture *pPortrait; // [sp-4h] [bp-1Ch]@27 + Texture_MM7 *pPortrait; // [sp-4h] [bp-1Ch]@27 if ( _A750D8_player_speech_timer ) { @@ -2022,7 +2079,7 @@ if (pPlayer->field_1AA2 != pFrame->uTextureID - 1 || _this ) { pPlayer->field_1AA2 = pFrame->uTextureID - 1; - pPortrait = (Texture *)pTextures_PlayerFaces[i][pPlayer->field_1AA2];//pFace = (Texture *)pTextures_PlayerFaces[i][pFrame->uTextureID]; + pPortrait = (Texture_MM7 *)pTextures_PlayerFaces[i][pPlayer->field_1AA2];//pFace = (Texture_MM7 *)pTextures_PlayerFaces[i][pFrame->uTextureID]; if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait); else @@ -2047,18 +2104,16 @@ if (PID_TYPE(pTurnEngine->pQueue[i].uPackedID) != OBJECT_Player) break; - auto tex = _5079D0_init_g; - if ( pParty->uFlags & 0x10 ) - tex = _5079CC_init_r; - else - { - if ( pParty->uFlags & 0x20 ) - tex = _5079C8_init_y; - } - pRenderer->DrawTextureIndexedAlpha( - pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[PID_ID(pTurnEngine->pQueue[i].uPackedID)] - 4, - 385, - tex + auto alert_texture = game_ui_player_alert_green; + if (pParty->GetRedAlert()) + alert_texture = game_ui_player_alert_red; + else if (pParty->GetYellowAlert()) + alert_texture = game_ui_player_alert_yellow; + + pRenderer->DrawTextureAlphaNew( + (pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[PID_ID(pTurnEngine->pQueue[i].uPackedID)] - 4)/640.0f, + 385/480.0f, + alert_texture ); } } @@ -2071,15 +2126,16 @@ { if (pParty->pPlayers[i].CanAct() && !pParty->pPlayers[i].uTimeToRecovery) { - auto tex = _5079D0_init_g; - if ( pParty->uFlags & 0x10 ) - tex = _5079CC_init_r; - else - { - if ( pParty->uFlags & 0x20 ) - tex = _5079C8_init_y; - } - pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] - 4, 385, tex); + auto alert_texture = game_ui_player_alert_green; + if (pParty->GetRedAlert()) + alert_texture = game_ui_player_alert_red; + else if (pParty->GetYellowAlert()) + alert_texture = game_ui_player_alert_yellow; + + pRenderer->DrawTextureAlphaNew( + (pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] - 4)/640.0f, + 385/480.0f, + alert_texture); } } } @@ -2309,7 +2365,10 @@ arrow_idx = 0; if ( (signed int)rotate < 128 || (signed int)rotate > 1920 ) arrow_idx = 7; - pRenderer->DrawTextureIndexedAlpha(uCenterX - 3, uCenterY - 3, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[arrow_idx]));//стрелка + pRenderer->DrawTextureAlphaNew( + (uCenterX - 3)/640.0f, + (uCenterY - 3)/480.0f, + game_ui_minimap_dirs[arrow_idx]); //draw objects on the minimap if ( bWizardEyeActive ) @@ -2398,9 +2457,12 @@ } } } - pRenderer->DrawTextureIndexedAlpha(468, 0, minimap_loop); + pRenderer->DrawTextureAlphaNew(468/640.0f, 0, game_ui_minimap_frame); pRenderer->SetUIClipRect(541, 0, 567, 480); - pRenderer->DrawTextureTransparentColorKey(floorf(((double)pParty->sRotationY * 0.1171875) + 0.5f) + 285, 136, _5079B4_compass); + pRenderer->DrawTextureAlphaNew( + (floorf(((double)pParty->sRotationY * 0.1171875) + 0.5f) + 285)/640.0f, + 136/480.0f, + game_ui_minimap_compass); pRenderer->ResetUIClipRect(); } @@ -2431,7 +2493,6 @@ } } } -// 4E28F8: using guessed type int current_screen_type; //----- (00491F87) --------------------------------------------------------
--- a/Game/Game.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Game/Game.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -838,10 +838,10 @@ { for (uint i = 0; i < 5; i++) { - if (uTextureID_Optkb[i]) - pIcons_LOD->pTextures[uTextureID_Optkb[i]].Release(); + if (game_ui_options_controls[i]) + pIcons_LOD->pTextures[game_ui_options_controls[i]].Release(); } - memset(&uTextureID_Optkb, 0, 20); + memset(&game_ui_options_controls, 0, 20); pIcons_LOD->SyncLoadedFilesCount(); for (uint i = 0; i < 28; ++i) { @@ -944,12 +944,18 @@ pParty->pPlayers[1].SetAsleep(false); pParty->pPlayers[0].SetAsleep(false); } - pTexture_RestUI_CurrentSkyFrame->Release(); - pTexture_RestUI_CurrentHourglassFrame->Release(); - pTexture_RestUI_CurrentHourglassFrame = 0; - pTexture_RestUI_CurrentSkyFrame = 0; - pIcons_LOD->SyncLoadedFilesCount(); - pIcons_LOD->RemoveTexturesPackFromTextureList(); + if (rest_ui_sky_frame_current) + { + rest_ui_sky_frame_current->Release(); + rest_ui_sky_frame_current = nullptr; + } + + if (rest_ui_hourglass_frame_current) + { + rest_ui_hourglass_frame_current->Release(); + rest_ui_hourglass_frame_current = nullptr; + } + if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) { pOutdoor->UpdateSunlightVectors(); @@ -1487,7 +1493,10 @@ pPlayer9 = pPlayers[_506348_current_lloyd_playerid + 1]; if (!pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime && bRecallingBeacon) continue; - byte_506360 = 1; + + extern bool _506360_installing_beacon; + _506360_installing_beacon = true; + pPlayer9->CanCastSpell(uRequiredMana); if (pParty->bTurnBasedModeOn) {
--- a/Game/GameMenu.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Game/GameMenu.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -345,16 +345,16 @@ case UIMSG_ChangeSoundVolume: if (param == 4)//reduce sound level button left { - --uSoundVolumeMultiplier; - if ((char)uSoundVolumeMultiplier < 1) - uSoundVolumeMultiplier = 0; + if (uSoundVolumeMultiplier > 0) + --uSoundVolumeMultiplier; + new OnButtonClick2(243, 162, 0, 0, (int)pBtn_SliderLeft, (char *)1); pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f); pAudioPlayer->PlaySound(SOUND_church, -1, 0, -1, 0, 0, 0, 0); - int v = AIL_redbook_volume(pAudioPlayer->hAILRedbook); + //int v = AIL_redbook_volume(pAudioPlayer->hAILRedbook); //v = v+1; - if (v) - __debugbreak(); + //if (v) + // __debugbreak(); continue; } if (param == 5)//Increase sound level button right @@ -543,10 +543,13 @@ { for (uint i = 0; i < 5; i++) { - if (uTextureID_Optkb[i]) - pIcons_LOD->pTextures[uTextureID_Optkb[i]].Release(); + if (game_ui_options_controls[i]) + { + game_ui_options_controls[i]->Release(); + game_ui_options_controls[i] = nullptr; + } } - memset(uTextureID_Optkb.data(), 0, 20); + pIcons_LOD->SyncLoadedFilesCount(); for (uint i = 0; i < 28; ++i) {
--- a/Game/MainMenu.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/Game/MainMenu.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -366,7 +366,7 @@ GUIButton *pButton; // eax@27 unsigned int pControlParam; // ecx@35 unsigned int pY; // [sp-18h] [bp-54h]@39 - Texture *pTexture; // [sp-14h] [bp-50h]@39 + Texture_MM7 *pTexture; // [sp-14h] [bp-50h]@39 GUIWindow *pWindow; // [sp+4h] [bp-38h]@11 MSG msg;
--- a/IO/Mouse.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/IO/Mouse.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -67,8 +67,9 @@ ClearCursor(); if ( _strnicmp(pName, "MICON1", 5) )//for click to item / если курсор с вещью { - this->uCursorTextureID = pIcons_LOD->LoadTexture(pName, TEXTURE_16BIT_PALETTE); - this->uCursorTextureID_2 = pIcons_LOD->LoadTexture(pName, TEXTURE_16BIT_PALETTE); + //this->uCursorTextureID = pIcons_LOD->LoadTexture(pName, TEXTURE_16BIT_PALETTE); + //this->uCursorTextureID_2 = pIcons_LOD->LoadTexture(pName, TEXTURE_16BIT_PALETTE); + uCursorTextureID = uCursorTextureID_2 = -1; this->AllocCursorSystemMem(); this->field_C = 0; this->bRedraw = true; @@ -179,8 +180,9 @@ //----- (00469C0D) -------------------------------------------------------- void *Mouse::DoAllocCursorMem() { - Texture* tex = pIcons_LOD->GetTexture(uCursorTextureID); - return malloc(4 * tex->uTextureWidth * tex->uTextureHeight); + //Texture_MM7* tex = pIcons_LOD->GetTexture(uCursorTextureID); + //return malloc(4 * tex->uTextureWidth * tex->uTextureHeight); + return nullptr; } //----- (00469C39) -------------------------------------------------------- @@ -323,7 +325,7 @@ void Mouse::ReadCursorWithItem() { unsigned int pTextureID; // eax@2 - Texture *pTexture; // edi@2 + Image *pTexture; // edi@2 // int v8; // ecx@25 // int v9; // ebx@26 // unsigned int v10; // eax@26 @@ -335,8 +337,9 @@ if ( pParty->pPickedItem.uItemID ) { - pTextureID = pIcons_LOD->LoadTexture(pParty->pPickedItem.GetIconName(), TEXTURE_16BIT_PALETTE); - pTexture = (Texture *)(pTextureID != -1 ? (int)&pIcons_LOD->pTextures[pTextureID] : 0); + //pTextureID = pIcons_LOD->LoadTexture(pParty->pPickedItem.GetIconName(), TEXTURE_16BIT_PALETTE); + //pTexture = (Texture_MM7 *)(pTextureID != -1 ? (int)&pIcons_LOD->pTextures[pTextureID] : 0); + pTexture = assets->GetImage_16BitAlpha(pParty->pPickedItem.GetIconName()); if ( (signed int)pMouse->uMouseClickX <= window->GetWidth() - 1 && (signed int)pMouse->uMouseClickY <= window->GetHeight() - 1 ) { @@ -347,12 +350,12 @@ //v6 = 0; v15 = 0; } */ - if ( (signed int)(pTexture->uTextureWidth + pMouse->uMouseClickX) <= window->GetWidth() ) - pTextureWidth = pTexture->uTextureWidth; + if ( (signed int)(pTexture->GetWidth() + pMouse->uMouseClickX) <= window->GetWidth() ) + pTextureWidth = pTexture->GetWidth(); else pTextureWidth = window->GetWidth() - pMouse->uMouseClickX; - if ( (signed int)(pTexture->uTextureHeight + pMouse->uMouseClickY) <= window->GetHeight() ) - pTextureHeight = pTexture->uTextureHeight; + if ( (signed int)(pTexture->GetHeight() + pMouse->uMouseClickY) <= window->GetHeight() ) + pTextureHeight = pTexture->GetHeight(); else pTextureHeight = window->GetHeight() - pMouse->uMouseClickY; if ( !this->pCursorBitmap3_sysmembits_16bit @@ -362,7 +365,7 @@ || pMouse->uMouseClickY + pTextureHeight != this->uCursorWithItemZ ) { free(this->pCursorBitmap3_sysmembits_16bit); - this->pCursorBitmap3_sysmembits_16bit = (unsigned __int16 *)malloc(2 * pTexture->uTextureHeight * pTexture->uTextureWidth); + this->pCursorBitmap3_sysmembits_16bit = (unsigned __int16 *)malloc(2 * pTexture->GetHeight() * pTexture->GetWidth()); this->uCursorWithItemX = pMouse->uMouseClickX; this->uCursorWithItemW = pMouse->uMouseClickX + pTextureWidth; this->uCursorWithItemY = pMouse->uMouseClickY; @@ -377,39 +380,13 @@ *v22++ = pRenderer->ReadPixel16(x, y); } } - /*if ( v8 < this->field_4C ) - { - v9 = this->field_48; - v10 = pRenderer->uTargetSurfacePitch * v8; - do - { - v11 = this->field_40; - v18 = this->field_40; - if ( v11 < v9 ) - { - v20 = &v17[v10 + v11]; - do - { - //v12 = v20; - ++v18; - //++v20; - *v22++ = *v20++; - } - while ( v18 < v9 ); - } - v10 += v16; - ++v8; - } - while ( v8 < this->field_4C ); - v6 = v15; - }*/ if (pParty->pPickedItem.IsBroken()) - pRenderer->DrawTransparentRedShade(pMouse->uMouseClickX, pMouse->uMouseClickY, pTexture); + pRenderer->DrawTransparentRedShade(pMouse->uMouseClickX/640.0f, pMouse->uMouseClickY/480.0f, pTexture); else if (!pParty->pPickedItem.IsIdentified()) - pRenderer->DrawTransparentGreenShade(pMouse->uMouseClickX, pMouse->uMouseClickY, pTexture); + pRenderer->DrawTransparentGreenShade(pMouse->uMouseClickX/640.0f, pMouse->uMouseClickY/480.0f, pTexture); else - pRenderer->DrawTextureIndexedAlpha(pMouse->uMouseClickX, pMouse->uMouseClickY, pTexture); + pRenderer->DrawTextureAlphaNew(pMouse->uMouseClickX/640.0f, pMouse->uMouseClickY/480.0f, pTexture); } } else
--- a/_deleted.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/_deleted.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -885,7 +885,7 @@ v3 = a3->uTileBitmapID; v4 = a3->uTileBitmapID; a3->ptr_38 = &stru_8019C8; - a3->pTexture = (Texture *)(v4 != -1 ? (int)&pBitmaps_LOD->pTextures[v3] : 0); + a3->pTexture = (Texture_MM7 *)(v4 != -1 ? (int)&pBitmaps_LOD->pTextures[v3] : 0); v5 = 0; if ( (signed int)a3->uNumVertices > 0 ) { @@ -963,7 +963,7 @@ v42 = a1; if ( !v6 ) { - MessageBoxW(nullptr, L"The Texture Frame Table is not a supported feature.", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Odspan.cpp:162", 0); + MessageBoxW(nullptr, L"The Texture_MM7 Frame Table is not a supported feature.", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Odspan.cpp:162", 0); } LOBYTE(v7) = v4->field_108; v8 = v4->uNumVertices; @@ -1143,13 +1143,13 @@ signed __int64 v15; // qtt@3 stru149 *v16; // eax@3 signed int v17; // ebx@3 - Texture *v18; // eax@14 + Texture_MM7 *v18; // eax@14 unsigned __int16 *v19; // eax@15 stru149 *v20; // eax@21 signed int v21; // eax@21 int v22; // eax@21 int v23; // ecx@21 - Texture *v24; // edx@21 + Texture_MM7 *v24; // edx@21 signed int v25; // eax@21 signed int v27; // [sp-4h] [bp-A4h]@8 int v28; // [sp+Ch] [bp-94h]@1 @@ -1316,7 +1316,7 @@ int v22; // eax@31 int v23; // eax@35 int v24; // eax@39 - Texture *v25; // eax@43 + Texture_MM7 *v25; // eax@43 int v26; // esi@43 signed int v27; // ecx@43 double v28; // st6@43 @@ -1493,7 +1493,7 @@ result = (BSPModel *)&pBitmaps_LOD->pTextures[v16]; v19 = __OFSUB__(pODMRenderParams->uNumPolygons, 1999); v18 = pODMRenderParams->uNumPolygons - 1999 < 0; - v12->pTexture = (Texture *)(v17 != -1 ? (int)result : 0); + v12->pTexture = (Texture_MM7 *)(v17 != -1 ? (int)result : 0); if ( !(v18 ^ v19) ) return result; ++pODMRenderParams->uNumPolygons; @@ -1792,7 +1792,7 @@ Polygon *v2; // eax@1 Span *v3; // edi@6 Polygon *v4; // esi@9 - Texture *v5; // ebp@10 + Texture_MM7 *v5; // ebp@10 int v6; // esi@16 unsigned int v7; // edx@16 char *v8; // ecx@17 @@ -1803,7 +1803,7 @@ Span *v13; // esi@33 int v14; // ecx@37 int v15; // eax@40 - Texture *v16; // ebp@51 + Texture_MM7 *v16; // ebp@51 //unsigned int v17; // eax@51 int v18; // eax@54 char v19; // al@56 @@ -1935,7 +1935,7 @@ while ( 1 ) { v28 = pBitmaps_LOD->LoadTexture("wtrtyla"); - v4->pTexture = (Texture *)(v28 != -1 ? &pBitmaps_LOD->pTextures[v28] : 0); + v4->pTexture = (Texture_MM7 *)(v28 != -1 ? &pBitmaps_LOD->pTextures[v28] : 0); if ( !sr_sub_4847EB(v3) ) break; v4->pTexture = v5; @@ -2287,7 +2287,7 @@ int v20; // ST3C_4@11 int v21; // ST30_4@11 void *v22; // eax@11 - Texture *v23; // esi@11 + Texture_MM7 *v23; // esi@11 int v24; // ecx@11 unsigned int v25; // esi@11 int v26; // edi@11 @@ -2454,12 +2454,12 @@ signed __int64 v16; // qtt@5 int v17; // eax@5 unsigned __int16 *v18; // eax@7 - Texture *v19; // eax@8 - Texture *v20; // eax@10 - Texture *v21; // eax@12 - Texture *v22; // eax@14 + Texture_MM7 *v19; // eax@8 + Texture_MM7 *v20; // eax@10 + Texture_MM7 *v21; // eax@12 + Texture_MM7 *v22; // eax@14 int v23; // ecx@17 - Texture *v24; // ebx@17 + Texture_MM7 *v24; // ebx@17 signed int v25; // edx@17 signed int v26; // eax@17 char v27; // bl@17 @@ -4410,8 +4410,8 @@ unsigned int v1; // ebx@1 BLVFace *v2; // esi@3 unsigned int v3; // eax@3 - Texture *v4; // eax@8 - Texture *v5; // edi@8 + Texture_MM7 *v4; // eax@8 + Texture_MM7 *v5; // edi@8 int v6; // eax@9 int v7; // eax@9 int v8; // ecx@17 @@ -4514,7 +4514,7 @@ int v105; // [sp+2Ch] [bp-7Ch]@30 int v106; // [sp+30h] [bp-78h]@24 int v107; // [sp+34h] [bp-74h]@9 - Texture *v108; // [sp+38h] [bp-70h]@8 + Texture_MM7 *v108; // [sp+38h] [bp-70h]@8 int v109; // [sp+3Ch] [bp-6Ch]@9 unsigned int v110; // [sp+40h] [bp-68h]@24 unsigned int v111; // [sp+44h] [bp-64h]@1 @@ -5610,14 +5610,14 @@ signed __int64 v19; // qtt@3 int v20; // edi@3 unsigned __int16 *v21; // eax@3 - Texture *v22; // eax@4 - Texture *v23; // eax@6 - Texture *v24; // eax@8 - Texture *v25; // eax@10 + Texture_MM7 *v22; // eax@4 + Texture_MM7 *v23; // eax@6 + Texture_MM7 *v24; // eax@8 + Texture_MM7 *v25; // eax@10 stru149 *v26; // eax@13 int v27; // edi@13 signed int v28; // edx@13 - Texture *v29; // ebx@13 + Texture_MM7 *v29; // ebx@13 int v30; // edi@13 signed int v31; // edx@13 signed int v32; // eax@13 @@ -5919,18 +5919,18 @@ signed __int64 v17; // qtt@3 stru149 *v18; // eax@3 int v19; // ebx@3 - Texture *v20; // eax@4 + Texture_MM7 *v20; // eax@4 unsigned __int16 *v21; // eax@4 - Texture *v22; // eax@6 - Texture *v23; // ecx@8 - Texture *v24; // eax@10 + Texture_MM7 *v22; // eax@6 + Texture_MM7 *v23; // ecx@8 + Texture_MM7 *v24; // eax@10 stru149 *v25; // eax@12 signed int v26; // eax@12 int v27; // ecx@12 int v28; // eax@14 int v29; // edx@14 int v30; // ecx@14 - Texture *v31; // esi@14 + Texture_MM7 *v31; // esi@14 int v32; // edx@14 int v33; // eax@14 int v35; // [sp+Ch] [bp-8Ch]@1 @@ -6105,7 +6105,7 @@ int v24; // ecx@12 int v25; // ecx@14 unsigned int *v26; // eax@14 - Texture *v27; // esi@14 + Texture_MM7 *v27; // esi@14 signed int v28; // edi@14 signed int v29; // eax@14 signed int v31; // [sp+Ch] [bp-90h]@1 @@ -6264,7 +6264,7 @@ stru149 *v19; // eax@14 signed int v20; // eax@14 int v21; // ecx@14 - Texture *v22; // edx@16 + Texture_MM7 *v22; // edx@16 signed int v23; // eax@16 int v24; // ebx@16 int v25; // edi@17 @@ -6626,15 +6626,15 @@ int v18; // edi@3 int v19; // eax@3 unsigned __int8 *pLOD; // eax@3 - Texture *v21; // eax@4 - Texture *v22; // eax@6 - Texture *v23; // eax@8 - Texture *v24; // eax@10 + Texture_MM7 *v21; // eax@4 + Texture_MM7 *v22; // eax@6 + Texture_MM7 *v23; // eax@8 + Texture_MM7 *v24; // eax@10 stru149 *v25; // eax@13 stru149 *v26; // eax@13 signed int v27; // ebx@13 stru149 *v28; // eax@13 - Texture *v29; // esi@13 + Texture_MM7 *v29; // esi@13 signed int v30; // ebx@13 signed int v31; // edi@13 signed int v32; // edx@13 @@ -8023,7 +8023,7 @@ int result; // eax@1 signed int v2; // ebx@1 BLVFace *v3; // esi@3 - Texture *v4; // edi@6 + Texture_MM7 *v4; // edi@6 int v5; // eax@7 int v6; // edx@7 int v7; // ecx@7 @@ -8115,7 +8115,7 @@ int i; // [sp+28h] [bp-7Ch]@7 unsigned __int16 *v94; // [sp+2Ch] [bp-78h]@9 unsigned int v95; // [sp+30h] [bp-74h]@1 - Texture *v96; // [sp+34h] [bp-70h]@6 + Texture_MM7 *v96; // [sp+34h] [bp-70h]@6 int v97; // [sp+38h] [bp-6Ch]@15 unsigned int v98; // [sp+3Ch] [bp-68h]@9 int v99; // [sp+40h] [bp-64h]@9 @@ -8162,8 +8162,8 @@ if ( result ) { result = (int)v3->GetTexture(); - v4 = (Texture *)result; - v96 = (Texture *)result; + v4 = (Texture_MM7 *)result; + v96 = (Texture_MM7 *)result; if ( result ) { v5 = *(short *)(result + 38); @@ -8678,7 +8678,7 @@ BLVFaceExtra *v2; // ebx@1 int v3; // eax@1 int v4; // edi@1 - Texture *v5; // edi@1 + Texture_MM7 *v5; // edi@1 int v6; // eax@1 unsigned int v7; // eax@1 unsigned int v8; // ecx@1 @@ -8754,7 +8754,7 @@ v3 = v1->uBitmapID; v4 = v1->uBitmapID; v68 = v2; - v5 = (Texture *)(v4 != -1 ? (int)&pBitmaps_LOD->pTextures[v3] : 0); + v5 = (Texture_MM7 *)(v4 != -1 ? (int)&pBitmaps_LOD->pTextures[v3] : 0); v6 = 8 * uFaceID; LOBYTE(v6) = PID(OBJECT_BModel,uFaceID); Lights.field_0 = v6; @@ -9328,7 +9328,7 @@ int v1; // edi@1 BLVFace *v2; // esi@3 signed int v3; // ebx@4 - Texture *v4; // edi@9 + Texture_MM7 *v4; // edi@9 signed int v5; // eax@9 char *v6; // edi@12 signed int v7; // eax@15 @@ -9364,7 +9364,7 @@ unsigned __int16 v37; // cx@31 int v38; // edx@32 unsigned __int16 v39; // cx@32 - Texture *v40; // [sp-10h] [bp-6Ch]@16 + Texture_MM7 *v40; // [sp-10h] [bp-6Ch]@16 int v41; // [sp-Ch] [bp-68h]@15 unsigned int v42; // [sp+10h] [bp-4Ch]@1 signed int v43; // [sp+14h] [bp-48h]@12 @@ -14371,7 +14371,7 @@ } //v79 = 0; //v78 = pBitmaps_LOD->pHardwareTextures[v39]; - pTile->pTexture = (Texture *)&pBitmaps_LOD->pHardwareTextures[v39];// Ritor1: It's temporary + pTile->pTexture = (Texture_MM7 *)&pBitmaps_LOD->pHardwareTextures[v39];// Ritor1: It's temporary v77 = (int)pTile; //v76 = v16->uNumVertices; //LABEL_161: @@ -14635,7 +14635,7 @@ } //v79 = 0; v78 = pBitmaps_LOD->pHardwareTextures[v75]; - v71->pTexture = (Texture *)&pBitmaps_LOD->pHardwareTextures[v75];// Ritor1: It's temporary + v71->pTexture = (Texture_MM7 *)&pBitmaps_LOD->pHardwareTextures[v75];// Ritor1: It's temporary //v77 = (int)v71; //v76 = v71->uNumVertices; //goto LABEL_161;