Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Html/Scenarios/CurrentState_img.htm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
<BODY>
<h1>Current state</h1>
<p>Launch this scenario to return to your last simulation state.</p>
<img src="../../Images/CurrentState.jpg" width="100%" />
<img src="vfs://Images/CurrentState.jpg" width="100%" />
</BODY>
</HTML>
8 changes: 4 additions & 4 deletions OVP/D3D9Client/D3D9Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ HWND D3D9Client::clbkCreateRenderWindow()
g_pVtxmgr_vb = new Vtxmgr<LPDIRECT3DVERTEXBUFFER9>(pDevice, "TileVertex");
g_pIdxmgr_ib = new Idxmgr<LPDIRECT3DINDEXBUFFER9>(pDevice, "TileIndices");

HR(D3DXCreateTextureFromFileA(pDevice, "Textures/D3D9Noise.dds", &pNoiseTex));
HR(D3DXCreateTextureFromFileA(pDevice, VFS::realpath_ns("Textures/D3D9Noise.dds"), &pNoiseTex));

HR(pDevice->GetRenderTarget(0, &pBackBuffer));
HR(pDevice->GetDepthStencilSurface(&pDepthStencil));
Expand Down Expand Up @@ -2209,7 +2209,7 @@ HBITMAP D3D9Client::gcReadImageFromFile(const char *_path)
{
char path[MAX_PATH];
sprintf_s(path, sizeof(path), "%s\\%s", OapiExtension::GetTextureDir(), _path);
return ReadImageFromFile(path);
return ReadImageFromFile(VFS::realpath_ns(path));
}

// ==============================================================
Expand Down Expand Up @@ -2937,7 +2937,7 @@ void D3D9Client::SplashScreen()

if(pCustomSplashScreen != NULL) {
D3DXIMAGE_INFO info;
HR(D3DXGetImageInfoFromFile(pCustomSplashScreen, &info));
HR(D3DXGetImageInfoFromFile(VFS::realpath_ns(pCustomSplashScreen), &info));

double imageW = info.Width;
double imageH = info.Height;
Expand All @@ -2954,7 +2954,7 @@ void D3D9Client::SplashScreen()
static_cast<LONG>( round(_h + _t) )
};
HR(pDevice->ColorFill(pSplashScreen, NULL, D3DCOLOR_XRGB(0, 0, 0)));
HR(D3DXLoadSurfaceFromFile(pSplashScreen, NULL, &imgRect, pCustomSplashScreen, NULL, D3DX_FILTER_LINEAR, 0, NULL));
HR(D3DXLoadSurfaceFromFile(pSplashScreen, NULL, &imgRect, VFS::realpath_ns(pCustomSplashScreen), NULL, D3DX_FILTER_LINEAR, 0, NULL));
} else {
D3DXIMAGE_INFO Info;
HMODULE hOrbiter = GetModuleHandleA("orbiter.exe");
Expand Down
9 changes: 0 additions & 9 deletions OVP/D3D9Client/D3D9Client.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@
#ifndef __D3D9CLIENT_H
#define __D3D9CLIENT_H

// must be defined before windows includes to fix warnins on VS 2003+
#if defined(_MSC_VER) && (_MSC_VER >= 1300 ) // Microsoft Visual Studio Version 2003 and higher
//#define _CRT_SECURE_NO_DEPRECATE
//#define _CRT_NONSTDC_NO_WARNINGS
#include <fstream>
#else // older MSVC++ versions
#include <fstream.h>
#endif

#include <d3d9.h>
#include <d3dx9.h>
#include "D3D9Catalog.h"
Expand Down
6 changes: 3 additions & 3 deletions OVP/D3D9Client/D3D9Effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ void D3D9Effect::D3D9TechInit(D3D9Client *_gc, LPDIRECT3DDEVICE9 _pDev, const ch
if (Config->bIrradiance && Config->EnvMapMode) macro[m++].Name = "_IRRADIANCE";


HR(D3DXCreateEffectFromFileA(pDev, name, macro, 0, D3DXSHADER_NO_PRESHADER|D3DXSHADER_PREFER_FLOW_CONTROL, 0, &FX, &errors));
HR(D3DXCreateEffectFromFileA(pDev, VFS::realpath_ns(name), macro, 0, D3DXSHADER_NO_PRESHADER|D3DXSHADER_PREFER_FLOW_CONTROL, 0, &FX, &errors));

delete []macro[0].Definition;
delete []macro[1].Definition;
Expand Down Expand Up @@ -376,8 +376,8 @@ void D3D9Effect::D3D9TechInit(D3D9Client *_gc, LPDIRECT3DDEVICE9 _pDev, const ch
if (Config->ShaderDebug) {
LPD3DXBUFFER pBuffer = NULL;
if (D3DXDisassembleEffect(FX, true, &pBuffer) == S_OK) {
FILE *fp = NULL;
if (!fopen_s(&fp, "D9D9Effect_asm.html", "w")) {
FILE *fp = VFS::fopen("D9D9Effect_asm.html", "w");
if (fp) {
fwrite(pBuffer->GetBufferPointer(), 1, pBuffer->GetBufferSize(), fp);
fclose(fp);
}
Expand Down
8 changes: 4 additions & 4 deletions OVP/D3D9Client/D3D9Pad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void D3D9Pad::D3D9TechInit(D3D9Client *_gc, LPDIRECT3DDEVICE9 pDevice)


#ifdef SKPDBG
if (fopen_s(&log, "Sketchpad.log", "w+")) { log = NULL; } // Failed
log = VFS::fopen("Sketchpad.log", "w+");
#endif // SKPDBG


Expand All @@ -95,7 +95,7 @@ void D3D9Pad::D3D9TechInit(D3D9Client *_gc, LPDIRECT3DDEVICE9 pDevice)
// Create the Effect from a .fx file.
ID3DXBuffer* errors = 0;

HR(D3DXCreateEffectFromFileA(pDev, name, 0, 0, 0, 0, &FX, &errors));
HR(D3DXCreateEffectFromFileA(pDev, VFS::realpath_ns(name), 0, 0, 0, 0, &FX, &errors));

if (errors) {
LogErr("Effect Error: %s",(char*)errors->GetBufferPointer());
Expand All @@ -112,8 +112,8 @@ void D3D9Pad::D3D9TechInit(D3D9Client *_gc, LPDIRECT3DDEVICE9 pDevice)
if (Config->ShaderDebug) {
LPD3DXBUFFER pBuffer = NULL;
if (D3DXDisassembleEffect(FX, true, &pBuffer) == S_OK) {
FILE *fp = NULL;
if (!fopen_s(&fp, "Sketchpad_asm.html", "w")) {
FILE *fp = VFS::fopen("Sketchpad_asm.html", "w");
if (fp) {
fwrite(pBuffer->GetBufferPointer(), 1, pBuffer->GetBufferSize(), fp);
fclose(fp);
}
Expand Down
22 changes: 11 additions & 11 deletions OVP/D3D9Client/D3D9Surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ LPDIRECT3DTEXTURE9 NatLoadSpecialTexture(const char* fname, const char* ext)

if (g_client->TexturePath(name, path)) {
D3DXIMAGE_INFO info;
if (D3DXGetImageInfoFromFileA(path, &info) == S_OK) {
if (D3DXGetImageInfoFromFileA(VFS::realpath_ns(path), &info) == S_OK) {

DWORD Mips = D3DFMT_FROM_FILE;

if (Config->TextureMips == 2) Mips = 0; // Autogen all
if (Config->TextureMips == 1 && info.MipLevels == 1) Mips = 0; // Autogen missing

if (S_OK == D3DXCreateTextureFromFileExA(g_client->GetDevice(), path, info.Width, info.Height, Mips, 0, D3DFMT_FROM_FILE, D3DPOOL_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, &pTex))
if (S_OK == D3DXCreateTextureFromFileExA(g_client->GetDevice(), VFS::realpath_ns(path), info.Width, info.Height, Mips, 0, D3DFMT_FROM_FILE, D3DPOOL_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, &pTex))
{
return pTex;
}
Expand Down Expand Up @@ -109,7 +109,7 @@ SURFHANDLE NatLoadSurface(const char* file, DWORD flags, bool bPath)
{
D3DXIMAGE_INFO info;

if (D3DXGetImageInfoFromFileA(path, &info) == S_OK)
if (D3DXGetImageInfoFromFileA(VFS::realpath_ns(path), &info) == S_OK)
{

if (info.ImageFileFormat == D3DXIFF_JPG) info.Format = D3DFMT_X8R8G8B8;
Expand All @@ -120,7 +120,7 @@ SURFHANDLE NatLoadSurface(const char* file, DWORD flags, bool bPath)
if (Config->TextureMips == 2) Mips = 0; // Autogen all
if (Config->TextureMips == 1 && info.MipLevels == 1) Mips = 0; // Autogen missing

if (S_OK == D3DXCreateTextureFromFileExA(g_client->GetDevice(), path, info.Width, info.Height, Mips, 0, info.Format, D3DPOOL_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, &pTex))
if (S_OK == D3DXCreateTextureFromFileExA(g_client->GetDevice(), VFS::realpath_ns(path), info.Width, info.Height, Mips, 0, info.Format, D3DPOOL_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, &pTex))
{
pNat = new SurfNative(pTex, flags);
pNat->SetName(file);
Expand Down Expand Up @@ -149,7 +149,7 @@ SURFHANDLE NatLoadSurface(const char* file, DWORD flags, bool bPath)
//
D3DXIMAGE_INFO info;

if (S_OK == D3DXGetImageInfoFromFileA(path, &info))
if (S_OK == D3DXGetImageInfoFromFileA(VFS::realpath_ns(path), &info))
{
if (flags & OAPISURFACE_SKETCHPAD) flags |= OAPISURFACE_RENDERTARGET;
if (flags & OAPISURFACE_RENDERTARGET) flags |= OAPISURFACE_UNCOMPRESS;
Expand Down Expand Up @@ -192,7 +192,7 @@ SURFHANDLE NatLoadSurface(const char* file, DWORD flags, bool bPath)

if (flags & OAPISURFACE_TEXTURE)
{
if (S_OK == D3DXCreateTextureFromFileExA(g_client->GetDevice(), path, info.Width, info.Height, Mips,
if (S_OK == D3DXCreateTextureFromFileExA(g_client->GetDevice(), VFS::realpath_ns(path), info.Width, info.Height, Mips,
Usage, Format, Pool, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, &pTex))
{
SurfNative* pSrf = new SurfNative(pTex, flags);
Expand All @@ -208,7 +208,7 @@ SURFHANDLE NatLoadSurface(const char* file, DWORD flags, bool bPath)
LPDIRECT3DSURFACE9 pSurf = NULL;
if (S_OK == g_client->GetDevice()->CreateRenderTarget(info.Width, info.Height, Format, Multi, 0, bLock, &pSurf, NULL))
{
if (S_OK == D3DXLoadSurfaceFromFile(pSurf, NULL, NULL, path, NULL, D3DX_DEFAULT, 0, NULL))
if (S_OK == D3DXLoadSurfaceFromFile(pSurf, NULL, NULL, VFS::realpath_ns(path), NULL, D3DX_DEFAULT, 0, NULL))
{
SurfNative* pSrf = new SurfNative(pSurf, flags);
pSrf->SetName(file);
Expand Down Expand Up @@ -931,7 +931,7 @@ bool SurfNative::Decompress()
return false;
}

if (S_OK == D3DXCreateTextureFromFileExA(pDevice, path, desc.Width, desc.Height, Mipmaps, D3DUSAGE_RENDERTARGET, Format,
if (S_OK == D3DXCreateTextureFromFileExA(pDevice, VFS::realpath_ns(path), desc.Width, desc.Height, Mipmaps, D3DUSAGE_RENDERTARGET, Format,
D3DPOOL_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, &pDecomp))
{
HR(pDecomp->GetSurfaceLevel(0, &pDeSrf))
Expand Down Expand Up @@ -987,7 +987,7 @@ bool SurfNative::DeClone()
return false;
}

if (S_OK == D3DXCreateTextureFromFileExA(pDevice, path, desc.Width, desc.Height, Mipmaps, D3DUSAGE_RENDERTARGET, Format,
if (S_OK == D3DXCreateTextureFromFileExA(pDevice, VFS::realpath_ns(path), desc.Width, desc.Height, Mipmaps, D3DUSAGE_RENDERTARGET, Format,
D3DPOOL_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, &pTex))
{
pResource = pTex;
Expand Down Expand Up @@ -1026,13 +1026,13 @@ void SurfNative::Reload()
{
D3DXIMAGE_INFO info;

if (D3DXGetImageInfoFromFileA(path, &info) == S_OK)
if (D3DXGetImageInfoFromFileA(VFS::realpath_ns(path), &info) == S_OK)
{
DWORD Mips = D3DFMT_FROM_FILE;
if (Config->TextureMips == 2) Mips = 0; // Autogen all
if (Config->TextureMips == 1 && info.MipLevels == 1) Mips = 0; // Autogen missing

if (S_OK == D3DXCreateTextureFromFileExA(g_client->GetDevice(), path, info.Width, info.Height, Mips, 0,
if (S_OK == D3DXCreateTextureFromFileExA(g_client->GetDevice(), VFS::realpath_ns(path), info.Width, info.Height, Mips, 0,
D3DFMT_FROM_FILE, D3DPOOL_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, (LPDIRECT3DTEXTURE9 *)&pResource))
{
AddMap(MAP_HEAT, NatLoadSpecialTexture(name, "heat"));
Expand Down
13 changes: 7 additions & 6 deletions OVP/D3D9Client/D3D9Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ LPDIRECT3DPIXELSHADER9 CompilePixelShader(LPDIRECT3DDEVICE9 pDev, const char *fi
}
}

HR(D3DXCompileShaderFromFileA(file, macro, NULL, function, "ps_3_0", flags, &pCode, &pErrors, pConst));
HR(D3DXCompileShaderFromFileA(VFS::realpath_ns(file), macro, NULL, function, "ps_3_0", flags, &pCode, &pErrors, pConst));

if (pErrors) {
LogErr("Compiling a Shader [%s] function [%s] Failed:\n %s", file, function, (char*)pErrors->GetBufferPointer());
Expand Down Expand Up @@ -1125,10 +1125,11 @@ LPDIRECT3DPIXELSHADER9 CompilePixelShader(LPDIRECT3DDEVICE9 pDev, const char *fi
if (bDisassemble && pCode) {
LPD3DXBUFFER pBuffer = NULL;
if (D3DXDisassembleShader((DWORD*)pCode->GetBufferPointer(), true, NULL, &pBuffer) == S_OK) {
FILE *fp = NULL;
char name[256];
sprintf_s(name, 256, "%s_%s_asm.html", RemovePath(file), function);
if (!fopen_s(&fp, name, "w")) {
FILE *fp = VFS::fopen(name, "w");

if (fp) {
fwrite(pBuffer->GetBufferPointer(), 1, pBuffer->GetBufferSize(), fp);
fclose(fp);
}
Expand Down Expand Up @@ -1222,7 +1223,7 @@ LPDIRECT3DVERTEXSHADER9 CompileVertexShader(LPDIRECT3DDEVICE9 pDev, const char *

LogAlw("Compiling a Shader [%s] function [%s]...", file, function);

HR(D3DXCompileShaderFromFileA(file, macro, NULL, function, "vs_3_0", flags, &pCode, &pErrors, pConst));
HR(D3DXCompileShaderFromFileA(VFS::realpath_ns(file), macro, NULL, function, "vs_3_0", flags, &pCode, &pErrors, pConst));

if (pErrors) {
LogErr("Compiling a Shader [%s] function [%s] Failed:\n %s", file, function, (char*)pErrors->GetBufferPointer());
Expand Down Expand Up @@ -1553,9 +1554,9 @@ int LoadPlanetTextures(const char* fname, LPDIRECT3DTEXTURE9* ppdds, DWORD flags

if (g_client->TexturePath(fname, path)) {

FILE* f;
FILE* f = VFS::fopen(path, "rb");

if (fopen_s(&f, path, "rb")) return 0;
if (!f) return 0;

int ntex = 0;
char* buffer, * location;
Expand Down
2 changes: 1 addition & 1 deletion OVP/D3D9Client/DebugControls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,7 @@ bool Execute(HWND hWnd, LPOPENFILENAME pOF)
LPDIRECT3DTEXTURE9 pSave = NULL;
D3DXIMAGE_INFO info;

HR(D3DXCreateTextureFromFileExA(pDevice, pOF->lpstrFile, D3DX_DEFAULT_NONPOW2, D3DX_DEFAULT_NONPOW2, 0, 0, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, D3DX_DEFAULT, D3DX_DEFAULT, 0, &info, NULL, &pTex));
HR(D3DXCreateTextureFromFileExA(pDevice, VFS::realpath_ns(pOF->lpstrFile), D3DX_DEFAULT_NONPOW2, D3DX_DEFAULT_NONPOW2, 0, 0, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, D3DX_DEFAULT, D3DX_DEFAULT, 0, &info, NULL, &pTex));

if (!pTex) {
LogErr("Failed to open a file [%s]", pOF->lpstrFile);
Expand Down
2 changes: 1 addition & 1 deletion OVP/D3D9Client/IProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ ImageProcessing::ImageProcessing(LPDIRECT3DDEVICE9 pDev, const char *_file, cons

// Create a database of defines ----------------------------------------------------------------
std::string line;
std::ifstream fs(_file);
VFS::ifstream fs(_file);
while (std::getline(fs, line)) {
if (!line.length() || line.find("//") == 0) continue;
if (line.find("#define") == 0) def.push_front(line.substr(line.find("#define") + 8));
Expand Down
4 changes: 2 additions & 2 deletions OVP/D3D9Client/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ void D3D9InitLog(const char *file)
QueryPerformanceFrequency((LARGE_INTEGER*)&qpcFrq);
QueryPerformanceCounter((LARGE_INTEGER*)&qpcStart);

if (fopen_s(&d3d9client_log,file,"w+")) { d3d9client_log=NULL; } // Failed
else {
d3d9client_log = VFS::fopen(file,"w+");
if (d3d9client_log) {
QueryPerformanceCounter((LARGE_INTEGER*)&qpcRef);
InitializeCriticalSectionAndSpinCount(&LogCrit, 256);
fprintf_s(d3d9client_log,"<!DOCTYPE html><html><head><title>D3D9Client Log</title></head><body bgcolor=black text=white>");
Expand Down
6 changes: 3 additions & 3 deletions OVP/D3D9Client/MaterialMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ bool MatMgr::LoadConfiguration(bool bAppend)

if (file.IsInvalid()) {
sprintf_s(path, 256, "%sGC\\%s.cfg", cfgdir, classname);
fopen_s(&file.pFile, path, "r");
file.pFile = VFS::fopen(path, "r");
}

if (file.IsInvalid()) return true;
Expand Down Expand Up @@ -349,7 +349,7 @@ bool MatMgr::SaveConfiguration()
// Load them before overwriting the file
LoadConfiguration(true);

fopen_s(&file.pFile, path, "w");
file.pFile = VFS::fopen(path, "w");

if (file.IsInvalid()) {
LogErr("Failed to write a file");
Expand Down Expand Up @@ -415,7 +415,7 @@ bool MatMgr::LoadCameraConfig()
AutoFile file;

sprintf_s(path, 256, "%sGC\\%s_ecam.cfg", cfgdir, classname);
fopen_s(&file.pFile, path, "r");
file.pFile = VFS::fopen(path, "r");

if (file.IsInvalid()) return true;

Expand Down
2 changes: 1 addition & 1 deletion OVP/D3D9Client/RingMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ DWORD RingManager::LoadTextures ()

sprintf_s(temp, ARRAYSIZE(temp), "%s_ring_%d.dds", fname, size);
if (gc->TexturePath(temp, path) &&
D3DXCreateTextureFromFileExA(pDev, path, 0, 0, D3DFMT_FROM_FILE, 0, D3DFMT_FROM_FILE, D3DPOOL_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, &pTex) == S_OK)
D3DXCreateTextureFromFileExA(pDev, VFS::realpath_ns(path), 0, 0, D3DFMT_FROM_FILE, 0, D3DFMT_FROM_FILE, D3DPOOL_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, &pTex) == S_OK)
{
LogAlw("High resolution ring texture loaded [%s]", path);
}
Expand Down
6 changes: 2 additions & 4 deletions OVP/D3D9Client/RunwayLights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,7 @@ int RunwayLights::CreateRunwayLights(class vBase *vB, const class Scene *scn, co
std::vector<RunwayLights*> lights;
char cbuf[256];

FILE* file = NULL;
fopen_s(&file, filename, "r");
FILE* file = VFS::fopen(filename, "r");

if (file == NULL) {
LogErr("Could not open %s file.", filename);
Expand Down Expand Up @@ -1001,8 +1000,7 @@ int TaxiLights::CreateTaxiLights(OBJHANDLE base, const class Scene *scn, const c
std::vector<TaxiLights*> lights;
char cbuf[256];

FILE* file = NULL;
fopen_s(&file, filename, "r");
FILE* file = VFS::fopen(filename, "r");

if (file == NULL) {
LogErr("Could not open %s file.", filename);
Expand Down
8 changes: 4 additions & 4 deletions OVP/D3D9Client/Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Scene::Scene(D3D9Client *_gc, DWORD w, DWORD h)
// ------------------------------------------------------------------------------
// Read Sun glare sampling kernel file

ifstream fs("Modules/D3D9Client/GKernel.txt");
VFS::ifstream fs("Modules/D3D9Client/GKernel.txt");
if (fs.good()) {
string line; vector<FVECTOR2> data;
while (getline(fs, line)) {
Expand Down Expand Up @@ -281,8 +281,8 @@ Scene::Scene(D3D9Client *_gc, DWORD w, DWORD h)

// Load some textures
char buff[MAX_PATH];
if (gc->TexturePath("D3D9Noise.dds", buff)) HR(D3DXCreateTextureFromFileA(pDevice, buff, &pTextures[TEX_NOISE]));
if (gc->TexturePath("D3D9CLUT.dds", buff)) HR(D3DXCreateTextureFromFileA(pDevice, buff, &pTextures[TEX_CLUT]));
if (gc->TexturePath("D3D9Noise.dds", buff)) HR(D3DXCreateTextureFromFileA(pDevice, VFS::realpath_ns(buff), &pTextures[TEX_NOISE]));
if (gc->TexturePath("D3D9CLUT.dds", buff)) HR(D3DXCreateTextureFromFileA(pDevice, VFS::realpath_ns(buff), &pTextures[TEX_CLUT]));

if (pLightBlur) {
HR(D3DXCreateTexture(pDevice, viewW / BufSize, viewH / BufSize, 1, D3DUSAGE_RENDERTARGET, BackBuffer, D3DPOOL_DEFAULT, &ptgBuffer[GBUF_BLUR]));
Expand Down Expand Up @@ -3796,7 +3796,7 @@ void Scene::D3D9TechInit(LPDIRECT3DDEVICE9 pDev, const char *folder)
// Create the Effect from a .fx file.
ID3DXBuffer* errors = 0;

HR(D3DXCreateEffectFromFile(pDev, name, 0, 0, 0, 0, &FX, &errors));
HR(D3DXCreateEffectFromFile(pDev, VFS::realpath_ns(name), 0, 0, 0, 0, &FX, &errors));

if (errors) {

Expand Down
Loading
Loading