mirror of
https://github.com/GTAmodding/re3.git
synced 2021-02-19 17:49:54 +01:00
fixes for glfw
This commit is contained in:
parent
b7ee3792df
commit
41586c7cda
@ -290,9 +290,29 @@ RwTextureAddressMode RwTextureGetAddressingV(const RwTexture *texture);
|
||||
// TODO
|
||||
void _rwD3D8TexDictionaryEnableRasterFormatConversion(bool enable) { }
|
||||
|
||||
static rw::Raster*
|
||||
ConvertTexRaster(rw::Raster *ras)
|
||||
{
|
||||
using namespace rw;
|
||||
Image *img = ras->toImage();
|
||||
ras->destroy();
|
||||
img->unindex();
|
||||
ras = Raster::createFromImage(img);
|
||||
img->destroy();
|
||||
return ras;
|
||||
}
|
||||
|
||||
// hack for reading native textures
|
||||
RwBool rwNativeTextureHackRead(RwStream *stream, RwTexture **tex, RwInt32 size)
|
||||
{ *tex = Texture::streamReadNative(stream); return *tex != nil; }
|
||||
{
|
||||
*tex = Texture::streamReadNative(stream);
|
||||
#ifdef RW_GL3
|
||||
if(strcmp((*tex)->name, "copnu") == 0)
|
||||
tex = tex;
|
||||
(*tex)->raster = ConvertTexRaster((*tex)->raster);
|
||||
#endif
|
||||
return *tex != nil;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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");
|
||||
|
@ -19,11 +19,25 @@
|
||||
#include "platform.h"
|
||||
#include "crossplatform.h"
|
||||
|
||||
#include "patcher.h"
|
||||
#include "main.h"
|
||||
#include "FileMgr.h"
|
||||
#include "Text.h"
|
||||
#include "Pad.h"
|
||||
#include "Timer.h"
|
||||
#include "DMAudio.h"
|
||||
#include "ControllerConfig.h"
|
||||
#include "Frontend.h"
|
||||
#include "Game.h"
|
||||
#include "PCSave.h"
|
||||
#include "Sprite2d.h"
|
||||
#include "AnimViewer.h"
|
||||
|
||||
|
||||
#define MAX_SUBSYSTEMS (16)
|
||||
|
||||
|
||||
using namespace rw;
|
||||
EngineOpenParams openParams;
|
||||
rw::EngineOpenParams openParams;
|
||||
|
||||
static RwBool ForegroundApp = TRUE;
|
||||
|
||||
@ -49,19 +63,6 @@ static psGlobalType PsGlobal;
|
||||
#define JIF(x) if (FAILED(hr=(x))) \
|
||||
{debug(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("\n"), hr); return;}
|
||||
|
||||
#include "patcher.h"
|
||||
#include "main.h"
|
||||
#include "FileMgr.h"
|
||||
#include "Text.h"
|
||||
#include "Pad.h"
|
||||
#include "Timer.h"
|
||||
#include "DMAudio.h"
|
||||
#include "ControllerConfig.h"
|
||||
#include "Frontend.h"
|
||||
#include "Game.h"
|
||||
#include "PCSave.h"
|
||||
#include "Sprite2d.h"
|
||||
#include "AnimViewer.h"
|
||||
|
||||
// TODO: This is used on selecting video mode, so either think something or remove it completely
|
||||
DWORD _dwMemTotalVideo = 1024 * (1024 * 1024); // 1024 MB as placeholder
|
||||
|
Loading…
Reference in New Issue
Block a user