Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Re-fix post fx issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
gennariarmando committed Mar 16, 2022
1 parent ee4f0ec commit 4725657
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions source/FontNew.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ void CFontNew::Clear() {
}

long CFontNew::AddFont(CFontTT t, LPD3DXFONT* font) {
return D3DXCreateFontA((LPDIRECT3DDEVICE9)RwD3D9GetCurrentD3DDevice(), t.height, t.width, FW_NORMAL, 0, FALSE, t.charSet, OUT_DEFAULT_PRECIS, t.quality, DEFAULT_PITCH | FF_DONTCARE, t.fontName, font);
return D3DXCreateFontA(GetD3DDevice(), t.height, t.width, FW_NORMAL, 0, FALSE, t.charSet, OUT_DEFAULT_PRECIS, t.quality, DEFAULT_PITCH | FF_DONTCARE, t.fontName, font);
}

void CFontNew::Shutdown() {
Expand Down Expand Up @@ -943,7 +943,7 @@ float CFontNew::DrawChar(bool print, bool calc, float x, float y, char c, int st
IDirect3DVertexShader9* savedVertexShader = NULL;
IDirect3DPixelShader9* savedPixelShader = NULL;

auto device = (LPDIRECT3DDEVICE9)RwD3D9GetCurrentD3DDevice();
auto device = GetD3DDevice();
device->GetRenderState(D3DRS_COLORWRITEENABLE, &savedColorWrite);
device->GetVertexDeclaration(&savedVertexDecl);
device->GetVertexShader(&savedVertexShader);
Expand Down
14 changes: 7 additions & 7 deletions source/MenuNew.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5026,15 +5026,15 @@ void CMenuNew::ChangeVideoMode(int mode, int msaa) {
RwEngineSetVideoMode(mode);
RwD3D9ChangeVideoMode(mode);

if (mode > 0)
ReloadCameraStuffAfterScreenChange();

int w = info.width;
int h = info.height;

RsGlobal.maximumWidth = w;
RsGlobal.maximumHeight = h;

if (mode > 0)
ReloadCameraStuffAfterScreenChange();

unsigned int refreshRate = plugin::CallAndReturn<unsigned int, 0x7460A0>(w, h, 32);
RwD3D9EngineSetRefreshRate(refreshRate);

Expand Down Expand Up @@ -5073,14 +5073,14 @@ void CMenuNew::ChangeVideoModeBorderlessWindowed(int mode, int msaa) {
SetWindowLong(wnd, GWL_STYLE, dwStyle & ~WS_OVERLAPPEDWINDOW);
SetWindowPos(wnd, HWND_NOTOPMOST, rect.left, rect.top, rect.right, rect.bottom, SWP_NOOWNERZORDER | SWP_FRAMECHANGED);

ReloadCameraStuffAfterScreenChange();

int w = info.width;
int h = info.height;

RsGlobal.maximumWidth = w;
RsGlobal.maximumHeight = h;

ReloadCameraStuffAfterScreenChange();

ps->fullScreen = false;
}

Expand Down Expand Up @@ -5116,14 +5116,14 @@ void CMenuNew::ChangeVideoModeWindowed(int mode, int msaa) {
SetWindowLong(wnd, GWL_STYLE, WS_VISIBLE | (WS_OVERLAPPEDWINDOW & ~WS_SIZEBOX));
SetWindowPos(wnd, HWND_NOTOPMOST, rect.left, rect.top, rect.right, rect.bottom, 0);

ReloadCameraStuffAfterScreenChange();

int w = info.width;
int h = info.height;

RsGlobal.maximumWidth = w;
RsGlobal.maximumHeight = h;

ReloadCameraStuffAfterScreenChange();

ps->fullScreen = false;
}

Expand Down

0 comments on commit 4725657

Please sign in to comment.