From b1fc7bc533dc7d603daafbf8a158a92f710c1e60 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Thu, 16 Apr 2020 11:50:45 +0300 Subject: More refs removed --- src/rw/TxdStore.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/rw/TxdStore.cpp') diff --git a/src/rw/TxdStore.cpp b/src/rw/TxdStore.cpp index c751147d..a32755a4 100644 --- a/src/rw/TxdStore.cpp +++ b/src/rw/TxdStore.cpp @@ -6,8 +6,8 @@ #include "RwHelper.h" #include "TxdStore.h" -CPool *&CTxdStore::ms_pTxdPool = *(CPool**)0x8F5FB8; -RwTexDictionary *&CTxdStore::ms_pStoredTxd = *(RwTexDictionary**)0x9405BC; +CPool *CTxdStore::ms_pTxdPool;// = *(CPool**)0x8F5FB8; +RwTexDictionary *CTxdStore::ms_pStoredTxd;// = *(RwTexDictionary**)0x9405BC; void CTxdStore::Initialise(void) -- cgit v1.2.3 From a4922d5cb77e31657768d5da4b286a2e67ee0e6f Mon Sep 17 00:00:00 2001 From: Fire-Head Date: Fri, 17 Apr 2020 08:54:14 +0300 Subject: rem refs --- src/rw/TxdStore.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/rw/TxdStore.cpp') diff --git a/src/rw/TxdStore.cpp b/src/rw/TxdStore.cpp index a32755a4..d640d99d 100644 --- a/src/rw/TxdStore.cpp +++ b/src/rw/TxdStore.cpp @@ -6,8 +6,8 @@ #include "RwHelper.h" #include "TxdStore.h" -CPool *CTxdStore::ms_pTxdPool;// = *(CPool**)0x8F5FB8; -RwTexDictionary *CTxdStore::ms_pStoredTxd;// = *(RwTexDictionary**)0x9405BC; +CPool *CTxdStore::ms_pTxdPool; +RwTexDictionary *CTxdStore::ms_pStoredTxd; void CTxdStore::Initialise(void) -- cgit v1.2.3 From 599164006a9e7eb7328fc194c9bae1acbb2c887d Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Fri, 17 Apr 2020 16:31:11 +0300 Subject: Remove patches --- src/rw/TxdStore.cpp | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'src/rw/TxdStore.cpp') diff --git a/src/rw/TxdStore.cpp b/src/rw/TxdStore.cpp index d640d99d..51d018f6 100644 --- a/src/rw/TxdStore.cpp +++ b/src/rw/TxdStore.cpp @@ -1,5 +1,5 @@ #include "common.h" -#include "patcher.h" + #include "templates.h" #include "General.h" #include "Streaming.h" @@ -185,25 +185,3 @@ CTxdStore::RemoveTxd(int slot) RwTexDictionaryDestroy(def->texDict); def->texDict = nil; } - -STARTPATCHES - InjectHook(0x527440, CTxdStore::Initialise, PATCH_JUMP); - InjectHook(0x527470, CTxdStore::Shutdown, PATCH_JUMP); - InjectHook(0x527490, CTxdStore::GameShutdown, PATCH_JUMP); - InjectHook(0x5274E0, CTxdStore::AddTxdSlot, PATCH_JUMP); - InjectHook(0x5275D0, CTxdStore::FindTxdSlot, PATCH_JUMP); - InjectHook(0x527590, CTxdStore::GetTxdName, PATCH_JUMP); - InjectHook(0x527900, CTxdStore::PushCurrentTxd, PATCH_JUMP); - InjectHook(0x527910, CTxdStore::PopCurrentTxd, PATCH_JUMP); - InjectHook(0x5278C0, CTxdStore::SetCurrentTxd, PATCH_JUMP); - InjectHook(0x527830, CTxdStore::Create, PATCH_JUMP); - InjectHook(0x527A00, CTxdStore::GetNumRefs, PATCH_JUMP); - InjectHook(0x527930, CTxdStore::AddRef, PATCH_JUMP); - InjectHook(0x527970, CTxdStore::RemoveRef, PATCH_JUMP); - InjectHook(0x5279C0, CTxdStore::RemoveRefWithoutDelete, PATCH_JUMP); - InjectHook(0x527700, (bool (*)(int, RwStream*))CTxdStore::LoadTxd, PATCH_JUMP); - InjectHook(0x5276B0, (bool (*)(int, const char*))CTxdStore::LoadTxd, PATCH_JUMP); - InjectHook(0x527770, CTxdStore::StartLoadTxd, PATCH_JUMP); - InjectHook(0x5277E0, CTxdStore::FinishLoadTxd, PATCH_JUMP); - InjectHook(0x527870, CTxdStore::RemoveTxd, PATCH_JUMP); -ENDPATCHES -- cgit v1.2.3 From 6c1a1f7cd20a2674f33b5318e6e07a3a28d016f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Sun, 26 Apr 2020 13:25:03 +0300 Subject: Initial GLFW support --- src/rw/TxdStore.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'src/rw/TxdStore.cpp') diff --git a/src/rw/TxdStore.cpp b/src/rw/TxdStore.cpp index 51d018f6..bb7386d5 100644 --- a/src/rw/TxdStore.cpp +++ b/src/rw/TxdStore.cpp @@ -127,6 +127,38 @@ CTxdStore::RemoveRefWithoutDelete(int slot) GetSlot(slot)->refCount--; } +#ifdef RW_GL3 +rw::Raster* +convertTexRaster(rw::Raster* ras) +{ + rw::Image* img = ras->toImage(); +// ras->destroy(); + img->unindex(); + ras = rw::Raster::createFromImage(img); + img->destroy(); + return ras; +} + +void +convertTxd(rw::TexDictionary* txd) +{ + rw::Texture* tex; + FORLIST(lnk, txd->textures) { + tex = rw::Texture::fromDict(lnk); + rw::Raster* ras = tex->raster; + if (ras && ras->platform != rw::platform) { + if (!(ras->platform == rw::PLATFORM_D3D8 && rw::platform == rw::PLATFORM_D3D9 || + ras->platform == rw::PLATFORM_D3D9 && rw::platform == rw::PLATFORM_D3D8)) { + tex->raster = convertTexRaster(ras); + ras->destroy(); + } + } + tex->setFilter(rw::Texture::LINEAR); + } + +} +#endif + bool CTxdStore::LoadTxd(int slot, RwStream *stream) { @@ -134,6 +166,9 @@ CTxdStore::LoadTxd(int slot, RwStream *stream) if(RwStreamFindChunk(stream, rwID_TEXDICTIONARY, nil, nil)){ def->texDict = RwTexDictionaryGtaStreamRead(stream); +#ifdef RW_GL3 + convertTxd(def->texDict); +#endif return def->texDict != nil; } printf("Failed to load TXD\n"); -- cgit v1.2.3 From 41586c7cda403291be80f414082d16b5333933a5 Mon Sep 17 00:00:00 2001 From: aap Date: Sun, 26 Apr 2020 20:16:31 +0200 Subject: fixes for glfw --- src/rw/TxdStore.cpp | 35 ----------------------------------- 1 file changed, 35 deletions(-) (limited to 'src/rw/TxdStore.cpp') diff --git a/src/rw/TxdStore.cpp b/src/rw/TxdStore.cpp index bb7386d5..51d018f6 100644 --- a/src/rw/TxdStore.cpp +++ b/src/rw/TxdStore.cpp @@ -127,38 +127,6 @@ CTxdStore::RemoveRefWithoutDelete(int slot) GetSlot(slot)->refCount--; } -#ifdef RW_GL3 -rw::Raster* -convertTexRaster(rw::Raster* ras) -{ - rw::Image* img = ras->toImage(); -// ras->destroy(); - img->unindex(); - ras = rw::Raster::createFromImage(img); - img->destroy(); - return ras; -} - -void -convertTxd(rw::TexDictionary* txd) -{ - rw::Texture* tex; - FORLIST(lnk, txd->textures) { - tex = rw::Texture::fromDict(lnk); - rw::Raster* ras = tex->raster; - if (ras && ras->platform != rw::platform) { - if (!(ras->platform == rw::PLATFORM_D3D8 && rw::platform == rw::PLATFORM_D3D9 || - ras->platform == rw::PLATFORM_D3D9 && rw::platform == rw::PLATFORM_D3D8)) { - tex->raster = convertTexRaster(ras); - ras->destroy(); - } - } - tex->setFilter(rw::Texture::LINEAR); - } - -} -#endif - bool CTxdStore::LoadTxd(int slot, RwStream *stream) { @@ -166,9 +134,6 @@ CTxdStore::LoadTxd(int slot, RwStream *stream) if(RwStreamFindChunk(stream, rwID_TEXDICTIONARY, nil, nil)){ def->texDict = RwTexDictionaryGtaStreamRead(stream); -#ifdef RW_GL3 - convertTxd(def->texDict); -#endif return def->texDict != nil; } printf("Failed to load TXD\n"); -- cgit v1.2.3