forked from Mirrors/openclonk
Move Game.GraphicsSystem to ::GraphicsSystem
parent
a0bbab441f
commit
ad779a0dc1
|
@ -90,7 +90,6 @@ class C4Game
|
|||
~C4Game();
|
||||
public:
|
||||
C4DefList Defs;
|
||||
C4GraphicsSystem GraphicsSystem;
|
||||
C4MessageInput MessageInput;
|
||||
C4GraphicsResource GraphicsResource;
|
||||
C4Network2 Network;
|
||||
|
|
|
@ -123,4 +123,5 @@ class C4GraphicsSystem
|
|||
bool ViewportZoomIn();
|
||||
};
|
||||
|
||||
extern C4GraphicsSystem GraphicsSystem;
|
||||
#endif
|
||||
|
|
|
@ -227,7 +227,7 @@ bool C4Application::PreInit()
|
|||
{
|
||||
//Log(LoadResStr("IDS_PRC_INITLOADER"));
|
||||
bool fUseBlackScreenLoader = UseStartupDialog && !C4Startup::WasFirstRun() && !Config.Startup.NoSplash && !NoSplash && FileExists(C4CFN_Splash);
|
||||
if (!Game.GraphicsSystem.InitLoaderScreen(C4CFN_StartupBackgroundMain, fUseBlackScreenLoader))
|
||||
if (!::GraphicsSystem.InitLoaderScreen(C4CFN_StartupBackgroundMain, fUseBlackScreenLoader))
|
||||
{ LogFatal(LoadResStr("IDS_PRC_ERRLOADER")); return false; }
|
||||
}
|
||||
|
||||
|
|
|
@ -1629,7 +1629,7 @@ void C4Console::Execute()
|
|||
PropertyDlg.Execute();
|
||||
ObjectListDlg.Execute();
|
||||
UpdateStatusBars();
|
||||
Game.GraphicsSystem.Execute();
|
||||
::GraphicsSystem.Execute();
|
||||
}
|
||||
|
||||
bool C4Console::OpenGame(const char *szCmdLine)
|
||||
|
|
|
@ -154,7 +154,7 @@ void C4ControlSet::Execute() const
|
|||
if (Game.Control.isCtrlHost() && !Game.Control.isReplay() && Game.Control.isNetwork())
|
||||
Config.Network.ControlRate = Game.Control.ControlRate;
|
||||
// always show msg
|
||||
Game.GraphicsSystem.FlashMessage(FormatString(LoadResStr("IDS_NET_CONTROLRATE"),Game.Control.ControlRate,Game.FrameCounter).getData());
|
||||
::GraphicsSystem.FlashMessage(FormatString(LoadResStr("IDS_NET_CONTROLRATE"),Game.Control.ControlRate,Game.FrameCounter).getData());
|
||||
break;
|
||||
|
||||
case C4CVT_AllowDebug: // allow debug mode?
|
||||
|
@ -164,7 +164,7 @@ void C4ControlSet::Execute() const
|
|||
if (!fSet && Game.DebugMode)
|
||||
{
|
||||
Game.DebugMode=FALSE;
|
||||
Game.GraphicsSystem.DeactivateDebugOutput();
|
||||
::GraphicsSystem.DeactivateDebugOutput();
|
||||
}
|
||||
// save flag, log
|
||||
Game.Parameters.AllowDebug = fSet;
|
||||
|
@ -233,10 +233,10 @@ void C4ControlSet::Execute() const
|
|||
if(Game.Parameters.UseFairCrew)
|
||||
{
|
||||
int iRank = ::DefaultRanks.RankByExperience(Game.Parameters.FairCrewStrength);
|
||||
Game.GraphicsSystem.FlashMessage(FormatString(LoadResStr("IDS_MSG_FAIRCREW_ACTIVATED"), ::DefaultRanks.GetRankName(iRank, true).getData()).getData());
|
||||
::GraphicsSystem.FlashMessage(FormatString(LoadResStr("IDS_MSG_FAIRCREW_ACTIVATED"), ::DefaultRanks.GetRankName(iRank, true).getData()).getData());
|
||||
}
|
||||
else
|
||||
Game.GraphicsSystem.FlashMessage(LoadResStr("IDS_MSG_FAIRCREW_DEACTIVATED"));
|
||||
::GraphicsSystem.FlashMessage(LoadResStr("IDS_MSG_FAIRCREW_DEACTIVATED"));
|
||||
}
|
||||
// lobby updates
|
||||
if (Game.Network.isLobbyActive())
|
||||
|
|
|
@ -58,17 +58,17 @@ LRESULT APIENTRY FullScreenWinProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
|
|||
lpDDraw->TaskOut();
|
||||
}
|
||||
// redraw background
|
||||
Game.GraphicsSystem.InvalidateBg();
|
||||
::GraphicsSystem.InvalidateBg();
|
||||
// Redraw after task switch
|
||||
if (Application.Active)
|
||||
Game.GraphicsSystem.Execute();
|
||||
::GraphicsSystem.Execute();
|
||||
// update cursor clip
|
||||
Game.MouseControl.UpdateClip();
|
||||
return FALSE;
|
||||
case WM_PAINT:
|
||||
// Redraw after task switch
|
||||
if (Application.Active)
|
||||
Game.GraphicsSystem.Execute();
|
||||
::GraphicsSystem.Execute();
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
Application.Quit();
|
||||
|
@ -111,15 +111,15 @@ LRESULT APIENTRY FullScreenWinProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
|
|||
Log((const char *)lParam);
|
||||
return FALSE;
|
||||
case WM_LBUTTONDOWN:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_LeftDown,LOWORD(lParam),HIWORD(lParam),wParam, NULL);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_LeftDown,LOWORD(lParam),HIWORD(lParam),wParam, NULL);
|
||||
break;
|
||||
case WM_LBUTTONUP: Game.GraphicsSystem.MouseMove(C4MC_Button_LeftUp,LOWORD(lParam),HIWORD(lParam),wParam, NULL); break;
|
||||
case WM_RBUTTONDOWN: Game.GraphicsSystem.MouseMove(C4MC_Button_RightDown,LOWORD(lParam),HIWORD(lParam),wParam, NULL); break;
|
||||
case WM_RBUTTONUP: Game.GraphicsSystem.MouseMove(C4MC_Button_RightUp,LOWORD(lParam),HIWORD(lParam),wParam, NULL); break;
|
||||
case WM_LBUTTONDBLCLK: Game.GraphicsSystem.MouseMove(C4MC_Button_LeftDouble,LOWORD(lParam),HIWORD(lParam),wParam, NULL); break;
|
||||
case WM_RBUTTONDBLCLK: Game.GraphicsSystem.MouseMove(C4MC_Button_RightDouble,LOWORD(lParam),HIWORD(lParam),wParam, NULL); break;
|
||||
case WM_MOUSEMOVE: Game.GraphicsSystem.MouseMove(C4MC_Button_None,LOWORD(lParam),HIWORD(lParam),wParam, NULL); break;
|
||||
case WM_MOUSEWHEEL: Game.GraphicsSystem.MouseMove(C4MC_Button_Wheel,LOWORD(lParam),HIWORD(lParam),wParam, NULL); break;
|
||||
case WM_LBUTTONUP: ::GraphicsSystem.MouseMove(C4MC_Button_LeftUp,LOWORD(lParam),HIWORD(lParam),wParam, NULL); break;
|
||||
case WM_RBUTTONDOWN: ::GraphicsSystem.MouseMove(C4MC_Button_RightDown,LOWORD(lParam),HIWORD(lParam),wParam, NULL); break;
|
||||
case WM_RBUTTONUP: ::GraphicsSystem.MouseMove(C4MC_Button_RightUp,LOWORD(lParam),HIWORD(lParam),wParam, NULL); break;
|
||||
case WM_LBUTTONDBLCLK: ::GraphicsSystem.MouseMove(C4MC_Button_LeftDouble,LOWORD(lParam),HIWORD(lParam),wParam, NULL); break;
|
||||
case WM_RBUTTONDBLCLK: ::GraphicsSystem.MouseMove(C4MC_Button_RightDouble,LOWORD(lParam),HIWORD(lParam),wParam, NULL); break;
|
||||
case WM_MOUSEMOVE: ::GraphicsSystem.MouseMove(C4MC_Button_None,LOWORD(lParam),HIWORD(lParam),wParam, NULL); break;
|
||||
case WM_MOUSEWHEEL: ::GraphicsSystem.MouseMove(C4MC_Button_Wheel,LOWORD(lParam),HIWORD(lParam),wParam, NULL); break;
|
||||
}
|
||||
return DefWindowProc(hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
|
@ -157,36 +157,36 @@ void C4FullScreen::HandleMessage (XEvent &e)
|
|||
{
|
||||
case Button1:
|
||||
if (timeGetTime() - last_left_click < 400) {
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_LeftDouble,
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_LeftDouble,
|
||||
e.xbutton.x, e.xbutton.y, e.xbutton.state, NULL);
|
||||
last_left_click = 0;
|
||||
} else {
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_LeftDown,
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_LeftDown,
|
||||
e.xbutton.x, e.xbutton.y, e.xbutton.state, NULL);
|
||||
last_left_click = timeGetTime();
|
||||
}
|
||||
break;
|
||||
case Button2:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_MiddleDown,
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_MiddleDown,
|
||||
e.xbutton.x, e.xbutton.y, e.xbutton.state, NULL);
|
||||
break;
|
||||
case Button3:
|
||||
if (timeGetTime() - last_right_click < 400) {
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_RightDouble,
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_RightDouble,
|
||||
e.xbutton.x, e.xbutton.y, e.xbutton.state, NULL);
|
||||
last_right_click = 0;
|
||||
} else {
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_RightDown,
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_RightDown,
|
||||
e.xbutton.x, e.xbutton.y, e.xbutton.state, NULL);
|
||||
last_right_click = timeGetTime();
|
||||
}
|
||||
break;
|
||||
case Button4:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_Wheel,
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_Wheel,
|
||||
e.xbutton.x, e.xbutton.y, e.xbutton.state + (short(32) << 16), NULL);
|
||||
break;
|
||||
case Button5:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_Wheel,
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_Wheel,
|
||||
e.xbutton.x, e.xbutton.y, e.xbutton.state + (short(-32) << 16), NULL);
|
||||
break;
|
||||
default:
|
||||
|
@ -198,20 +198,20 @@ void C4FullScreen::HandleMessage (XEvent &e)
|
|||
switch (e.xbutton.button)
|
||||
{
|
||||
case Button1:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_LeftUp, e.xbutton.x, e.xbutton.y, e.xbutton.state, NULL);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_LeftUp, e.xbutton.x, e.xbutton.y, e.xbutton.state, NULL);
|
||||
break;
|
||||
case Button2:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_MiddleUp, e.xbutton.x, e.xbutton.y, e.xbutton.state, NULL);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_MiddleUp, e.xbutton.x, e.xbutton.y, e.xbutton.state, NULL);
|
||||
break;
|
||||
case Button3:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_RightUp, e.xbutton.x, e.xbutton.y, e.xbutton.state, NULL);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_RightUp, e.xbutton.x, e.xbutton.y, e.xbutton.state, NULL);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case MotionNotify:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_None, e.xbutton.x, e.xbutton.y, e.xbutton.state, NULL);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_None, e.xbutton.x, e.xbutton.y, e.xbutton.state, NULL);
|
||||
break;
|
||||
case FocusIn:
|
||||
Application.Active = true;
|
||||
|
@ -344,14 +344,14 @@ void C4FullScreen::HandleMessage (SDL_Event &e)
|
|||
e.key.keysym.mod & (KMOD_LSHIFT | KMOD_RSHIFT), false, NULL);
|
||||
break;
|
||||
case SDL_MOUSEMOTION:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_None, e.motion.x, e.motion.y, 0, NULL);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_None, e.motion.x, e.motion.y, 0, NULL);
|
||||
break;
|
||||
case SDL_MOUSEBUTTONUP:
|
||||
case SDL_MOUSEBUTTONDOWN:
|
||||
int32_t button;
|
||||
DWORD flags;
|
||||
sdlToC4MCBtn(e.button, button, flags);
|
||||
Game.GraphicsSystem.MouseMove(button, e.button.x, e.button.y, flags, NULL);
|
||||
::GraphicsSystem.MouseMove(button, e.button.x, e.button.y, flags, NULL);
|
||||
break;
|
||||
case SDL_JOYAXISMOTION:
|
||||
case SDL_JOYHATMOTION:
|
||||
|
@ -399,7 +399,7 @@ void C4FullScreen::Execute()
|
|||
// Execute menu
|
||||
if (pMenu) pMenu->Execute();
|
||||
// Draw
|
||||
Game.GraphicsSystem.Execute();
|
||||
::GraphicsSystem.Execute();
|
||||
}
|
||||
|
||||
BOOL C4FullScreen::ViewportCheck()
|
||||
|
@ -410,7 +410,7 @@ BOOL C4FullScreen::ViewportCheck()
|
|||
// Determine film mode
|
||||
bool fFilm = (Game.C4S.Head.Replay && Game.C4S.Head.Film);
|
||||
// Check viewports
|
||||
switch (Game.GraphicsSystem.GetViewportCount())
|
||||
switch (::GraphicsSystem.GetViewportCount())
|
||||
{
|
||||
// No viewports: create no-owner viewport
|
||||
case 0:
|
||||
|
@ -429,7 +429,7 @@ BOOL C4FullScreen::ViewportCheck()
|
|||
// Display message for how to open observer menu (this message will be cleared if any owned viewport opens)
|
||||
StdStrBuf sKey;
|
||||
sKey.Format("<c ffff00><%s></c>", Game.KeyboardInput.GetKeyCodeNameByKeyName("FullscreenMenuOpen", false).getData());
|
||||
Game.GraphicsSystem.FlashMessage(FormatString(LoadResStr("IDS_MSG_PRESSORPUSHANYGAMEPADBUTT"), sKey.getData()).getData());
|
||||
::GraphicsSystem.FlashMessage(FormatString(LoadResStr("IDS_MSG_PRESSORPUSHANYGAMEPADBUTT"), sKey.getData()).getData());
|
||||
}
|
||||
break;
|
||||
// One viewport: do nothing
|
||||
|
@ -437,11 +437,11 @@ BOOL C4FullScreen::ViewportCheck()
|
|||
break;
|
||||
// More than one viewport: remove all no-owner viewports
|
||||
default:
|
||||
Game.GraphicsSystem.CloseViewport(NO_OWNER, true);
|
||||
::GraphicsSystem.CloseViewport(NO_OWNER, true);
|
||||
break;
|
||||
}
|
||||
// Look for no-owner viewport
|
||||
C4Viewport *pNoOwnerVp = Game.GraphicsSystem.GetViewport(NO_OWNER);
|
||||
C4Viewport *pNoOwnerVp = ::GraphicsSystem.GetViewport(NO_OWNER);
|
||||
// No no-owner viewport found
|
||||
if (!pNoOwnerVp)
|
||||
{
|
||||
|
|
|
@ -1613,7 +1613,7 @@ BOOL C4Game::EnumerateMaterials()
|
|||
{ LogFatal(LoadResStr("IDS_PRC_NOSYSMATS")); return FALSE; }
|
||||
// mapping to landscape palette will occur when landscape has been created
|
||||
// set the pal
|
||||
Game.GraphicsSystem.SetPalette();
|
||||
::GraphicsSystem.SetPalette();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -450,7 +450,7 @@ void C4GameControlNetwork::CalcPerformance(int32_t iCtrlTick)
|
|||
if (getControlPreSend() != iBestPreSend)
|
||||
{
|
||||
setControlPreSend(iBestPreSend);
|
||||
Game.GraphicsSystem.FlashMessage(FormatString("PreSend: %d - TargetFPS: %d", iBestPreSend, iTargetFPS).getData());
|
||||
::GraphicsSystem.FlashMessage(FormatString("PreSend: %d - TargetFPS: %d", iBestPreSend, iTargetFPS).getData());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -197,7 +197,7 @@ BOOL C4GraphicsResource::Init(bool fInitGUI)
|
|||
AlphaPalette[0]=255;
|
||||
AlphaPalette[191]=127;
|
||||
// update game pal
|
||||
if (!Game.GraphicsSystem.SetPalette()) { LogFatal("Pal error (2)!"); return FALSE; }
|
||||
if (!::GraphicsSystem.SetPalette()) { LogFatal("Pal error (2)!"); return FALSE; }
|
||||
idPalGrp = idNewPalGrp;
|
||||
}
|
||||
|
||||
|
|
|
@ -354,7 +354,7 @@ void C4GraphicsSystem::ClearFullscreenBackground()
|
|||
|
||||
void OnSurfaceRestore()
|
||||
{
|
||||
Game.GraphicsSystem.InvalidateBg();
|
||||
::GraphicsSystem.InvalidateBg();
|
||||
}
|
||||
|
||||
BOOL C4GraphicsSystem::InitLoaderScreen(const char *szLoaderSpec, bool fDrawBlackScreenFirst)
|
||||
|
@ -695,7 +695,7 @@ void C4GraphicsSystem::DrawHoldMessages()
|
|||
Application.DDraw->lpBack, C4GUI::GetScreenWdt()/2,
|
||||
C4GUI::GetScreenHgt()/2 - Game.GraphicsResource.FontRegular.iLineHgt*2,
|
||||
CStdDDraw::DEFAULT_MESSAGE_COLOR, ACenter);
|
||||
Game.GraphicsSystem.OverwriteBg();
|
||||
::GraphicsSystem.OverwriteBg();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -905,7 +905,7 @@ bool C4GraphicsSystem::ToggleShowHelp()
|
|||
bool C4GraphicsSystem::ViewportNextPlayer()
|
||||
{
|
||||
// safety: switch valid?
|
||||
if ((!Game.C4S.Head.Film || !Game.C4S.Head.Replay) && !Game.GraphicsSystem.GetViewport(NO_OWNER)) return false;
|
||||
if ((!Game.C4S.Head.Film || !Game.C4S.Head.Replay) && !::GraphicsSystem.GetViewport(NO_OWNER)) return false;
|
||||
// do switch then
|
||||
C4Viewport *vp = GetFirstViewport();
|
||||
if (!vp) return false;
|
||||
|
@ -916,7 +916,7 @@ bool C4GraphicsSystem::ViewportNextPlayer()
|
|||
bool C4GraphicsSystem::FreeScroll(C4Vec2D vScrollBy)
|
||||
{
|
||||
// safety: move valid?
|
||||
if ((!Game.C4S.Head.Replay || !Game.C4S.Head.Film) && !Game.GraphicsSystem.GetViewport(NO_OWNER)) return false;
|
||||
if ((!Game.C4S.Head.Replay || !Game.C4S.Head.Film) && !::GraphicsSystem.GetViewport(NO_OWNER)) return false;
|
||||
C4Viewport *vp = GetFirstViewport();
|
||||
if (!vp) return false;
|
||||
// move then (old static code crap...)
|
||||
|
@ -942,3 +942,5 @@ bool C4GraphicsSystem::ViewportZoomIn()
|
|||
if (FirstViewport) FlashMessage(FormatString("%s: %f", "[!]Zoom", (float)FirstViewport->ZoomTarget).getData());
|
||||
return true;
|
||||
}
|
||||
|
||||
C4GraphicsSystem GraphicsSystem;
|
||||
|
|
|
@ -565,7 +565,7 @@ void Screen::ElementPosChanged(Element *pOfElement)
|
|||
{
|
||||
// redraw fullscreen BG if dlgs are dragged around in shared mode
|
||||
if (!IsExclusive())
|
||||
Game.GraphicsSystem.InvalidateBg();
|
||||
::GraphicsSystem.InvalidateBg();
|
||||
}
|
||||
|
||||
void Screen::ShowDialog(Dialog *pDlg, bool fFade)
|
||||
|
@ -637,7 +637,7 @@ void Screen::CloseDialog(Dialog *pDlg, bool fFade)
|
|||
if (pActiveDlg && pActiveDlg->IsFading()) pActiveDlg = NULL;
|
||||
}
|
||||
// redraw background; clip update
|
||||
Game.GraphicsSystem.InvalidateBg(); UpdateMouseFocus();
|
||||
::GraphicsSystem.InvalidateBg(); UpdateMouseFocus();
|
||||
}
|
||||
|
||||
void Screen::RecheckActiveDialog()
|
||||
|
@ -700,8 +700,8 @@ void Screen::Draw(C4TargetFacet &cgo, bool fDoBG)
|
|||
Dialog *pFSDlg = GetFullscreenDialog(false);
|
||||
if (!pFSDlg || !pFSDlg->HasBackground())
|
||||
{
|
||||
if (Game.GraphicsSystem.pLoaderScreen)
|
||||
Game.GraphicsSystem.pLoaderScreen->fctBackground.DrawFullScreen(cgo);
|
||||
if (::GraphicsSystem.pLoaderScreen)
|
||||
::GraphicsSystem.pLoaderScreen->fctBackground.DrawFullScreen(cgo);
|
||||
else
|
||||
// loader not yet loaded: black BG
|
||||
lpDDraw->DrawBoxDw(cgo.Surface, 0,0, cgo.Wdt+1, cgo.Hgt+1, 0x00000000);
|
||||
|
@ -969,7 +969,7 @@ void Screen::DrawToolTip(const char *szTip, C4TargetFacet &cgo, float x, float y
|
|||
// draw tooltip
|
||||
lpDDraw->TextOut(sText.getData(), *pUseFont, 1.0f, cgo.Surface, tX+3,tY+1, C4GUI_ToolTipColor, ALeft);
|
||||
// while there's a tooltip, redraw the bg, because it might overlap
|
||||
Game.GraphicsSystem.InvalidateBg();
|
||||
::GraphicsSystem.InvalidateBg();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -248,7 +248,7 @@ LRESULT APIENTRY DialogWinProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara
|
|||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
case WM_PAINT:
|
||||
// 2do: only draw specific dlg?
|
||||
//Game.GraphicsSystem.Execute();
|
||||
//::GraphicsSystem.Execute();
|
||||
break;
|
||||
return 0;
|
||||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -296,7 +296,7 @@ void C4Landscape::Draw(C4TargetFacet &cgo, int32_t iPlayer)
|
|||
// do relights
|
||||
DoRelights();
|
||||
// blit landscape
|
||||
if (Game.GraphicsSystem.ShowSolidMask)
|
||||
if (::GraphicsSystem.ShowSolidMask)
|
||||
Application.DDraw->Blit8Fast(Surface8, cgo.TargetX, cgo.TargetY, cgo.Surface, cgo.X,cgo.Y,cgo.Wdt,cgo.Hgt);
|
||||
else
|
||||
Application.DDraw->BlitLandscape(Surface32, AnimationSurface, &Game.GraphicsResource.sfcLiquidAnimation, cgo.TargetX, cgo.TargetY, cgo.Surface, cgo.X,cgo.Y,cgo.Wdt,cgo.Hgt);
|
||||
|
|
|
@ -162,9 +162,9 @@ bool Log(const char *szMessage)
|
|||
|
||||
// Add message to log buffer
|
||||
bool fNotifyMsgBoard = false;
|
||||
if (Game.GraphicsSystem.MessageBoard.Active)
|
||||
if (::GraphicsSystem.MessageBoard.Active)
|
||||
{
|
||||
Game.GraphicsSystem.MessageBoard.AddLog(szMessage);
|
||||
::GraphicsSystem.MessageBoard.AddLog(szMessage);
|
||||
fNotifyMsgBoard = true;
|
||||
}
|
||||
|
||||
|
@ -172,7 +172,7 @@ bool Log(const char *szMessage)
|
|||
LogSilent(szMessage, true);
|
||||
|
||||
// Notify message board
|
||||
if(fNotifyMsgBoard) Game.GraphicsSystem.MessageBoard.LogNotify();
|
||||
if(fNotifyMsgBoard) ::GraphicsSystem.MessageBoard.LogNotify();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -237,7 +237,7 @@ bool C4MainMenu::DoRefillInternal(bool &rfRefilled)
|
|||
// Clear items
|
||||
ClearItems();
|
||||
// Check validity
|
||||
C4Viewport *pVP = Game.GraphicsSystem.GetViewport(NO_OWNER);
|
||||
C4Viewport *pVP = ::GraphicsSystem.GetViewport(NO_OWNER);
|
||||
if (!pVP) return false;
|
||||
int32_t iInitialSelection = 0;
|
||||
// Add free view
|
||||
|
@ -822,7 +822,7 @@ bool C4MainMenu::MenuCommand(const char *szCommand, bool fIsCloseCommand)
|
|||
if (SEqual(szCommand + 8, "UpperBoard"))
|
||||
{
|
||||
Config.Graphics.UpperBoard = !Config.Graphics.UpperBoard;
|
||||
Game.GraphicsSystem.RecalculateViewports();
|
||||
::GraphicsSystem.RecalculateViewports();
|
||||
}
|
||||
// FPS
|
||||
if (SEqual(szCommand + 8, "FPS")) Config.General.FPS = !Config.General.FPS;
|
||||
|
@ -881,7 +881,7 @@ bool C4MainMenu::MenuCommand(const char *szCommand, bool fIsCloseCommand)
|
|||
if (SEqual2(szCommand, "Observe:"))
|
||||
{
|
||||
const char *szObserverTarget = szCommand+8;
|
||||
C4Viewport *pVP = Game.GraphicsSystem.GetViewport(NO_OWNER);
|
||||
C4Viewport *pVP = ::GraphicsSystem.GetViewport(NO_OWNER);
|
||||
if (pVP) // viewport may have closed meanwhile
|
||||
{
|
||||
if (SEqual(szObserverTarget, "Free"))
|
||||
|
@ -917,7 +917,7 @@ bool C4MainMenu::ActivateCommand(int32_t iPlayer, const char *szCommand)
|
|||
bool C4MainMenu::ActivateObserver()
|
||||
{
|
||||
// Safety: Viewport lost?
|
||||
if (!Game.GraphicsSystem.GetViewport(NO_OWNER)) return false;
|
||||
if (!::GraphicsSystem.GetViewport(NO_OWNER)) return false;
|
||||
// Menu symbol/init
|
||||
InitRefSym(C4GUI::Icon::GetIconFacet(C4GUI::Ico_View), LoadResStr("IDS_TEXT_VIEW"), NO_OWNER, C4MN_Extra_None, 0, C4MN_Observer, C4MN_Style_Context);
|
||||
SetAlignment(C4MN_Align_Left | C4MN_Align_Bottom);
|
||||
|
|
|
@ -1148,7 +1148,7 @@ bool C4Menu::SetTextProgress(int32_t iToProgress, bool fAdd)
|
|||
C4Viewport *C4Menu::GetViewport()
|
||||
{
|
||||
// ask all viewports
|
||||
for (C4Viewport *pVP = Game.GraphicsSystem.GetFirstViewport(); pVP; pVP = pVP->GetNext())
|
||||
for (C4Viewport *pVP = ::GraphicsSystem.GetFirstViewport(); pVP; pVP = pVP->GetNext())
|
||||
if (pVP->IsViewportMenu(this))
|
||||
return pVP;
|
||||
// none matching
|
||||
|
|
|
@ -129,7 +129,7 @@ void C4MessageBoard::ChangeMode(int inMode)
|
|||
Output.Hgt = iHeight;
|
||||
LogBuffer.SetLBWidth(Output.Wdt);
|
||||
// recalc viewports
|
||||
Game.GraphicsSystem.RecalculateViewports();
|
||||
::GraphicsSystem.RecalculateViewports();
|
||||
}
|
||||
|
||||
void C4MessageBoard::Execute()
|
||||
|
@ -258,8 +258,8 @@ void C4MessageBoard::Draw(C4Facet &cgo)
|
|||
// Startup: draw Loader
|
||||
if (Startup)
|
||||
{
|
||||
if (Game.GraphicsSystem.pLoaderScreen)
|
||||
Game.GraphicsSystem.pLoaderScreen->Draw(cgo, Game.InitProgress, &LogBuffer);
|
||||
if (::GraphicsSystem.pLoaderScreen)
|
||||
::GraphicsSystem.pLoaderScreen->Draw(cgo, Game.InitProgress, &LogBuffer);
|
||||
else
|
||||
// loader not yet loaded: black BG
|
||||
Application.DDraw->DrawBoxDw(cgo.Surface, 0,0, cgo.Wdt, cgo.Hgt, 0x00000000);
|
||||
|
@ -305,7 +305,7 @@ void C4MessageBoard::Draw(C4Facet &cgo)
|
|||
if (iMsgY < cgo.Y)
|
||||
{
|
||||
dwFade = (0xff - BoundBy((cgo.Y - iMsgY + Max(ScreenFader, 0)) * 256 / Max(iMsgFader, 1) / iLineHgt, 0, 0xff)) << 24;
|
||||
Game.GraphicsSystem.OverwriteBg();
|
||||
::GraphicsSystem.OverwriteBg();
|
||||
}
|
||||
else
|
||||
dwFade = 0xff000000;
|
||||
|
@ -323,11 +323,11 @@ void C4MessageBoard::EnsureLastMessage()
|
|||
// not active: do nothing
|
||||
if (iMode == 2) return;
|
||||
// "console" mode: just set BackScroll to 0 and draw
|
||||
if (iMode == 1) { iBackScroll = 0; Game.GraphicsSystem.Execute(); return; }
|
||||
if (iMode == 1) { iBackScroll = 0; ::GraphicsSystem.Execute(); return; }
|
||||
// scroll mode: scroll until end of log
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
Game.GraphicsSystem.Execute();
|
||||
::GraphicsSystem.Execute();
|
||||
Execute();
|
||||
if (iBackScroll < 0) break;
|
||||
Delay=0;
|
||||
|
|
|
@ -566,8 +566,8 @@ bool C4MessageInput::ProcessCommand(const char *szCommand)
|
|||
pLobby->ClearLog();
|
||||
}
|
||||
// fullscreen
|
||||
else if (Game.GraphicsSystem.MessageBoard.Active)
|
||||
Game.GraphicsSystem.MessageBoard.ClearLog();
|
||||
else if (::GraphicsSystem.MessageBoard.Active)
|
||||
::GraphicsSystem.MessageBoard.ClearLog();
|
||||
else
|
||||
{
|
||||
// EM mode
|
||||
|
@ -631,13 +631,13 @@ bool C4MessageInput::ProcessCommand(const char *szCommand)
|
|||
// get line cnt
|
||||
int32_t iLineCnt = BoundBy(atoi(pCmdPar), 0, 20);
|
||||
if(iLineCnt == 0)
|
||||
Game.GraphicsSystem.MessageBoard.ChangeMode(2);
|
||||
::GraphicsSystem.MessageBoard.ChangeMode(2);
|
||||
else if(iLineCnt == 1)
|
||||
Game.GraphicsSystem.MessageBoard.ChangeMode(0);
|
||||
::GraphicsSystem.MessageBoard.ChangeMode(0);
|
||||
else
|
||||
{
|
||||
Game.GraphicsSystem.MessageBoard.iLines = iLineCnt;
|
||||
Game.GraphicsSystem.MessageBoard.ChangeMode(1);
|
||||
::GraphicsSystem.MessageBoard.iLines = iLineCnt;
|
||||
::GraphicsSystem.MessageBoard.ChangeMode(1);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -193,7 +193,7 @@ void C4MouseControl::UpdateClip()
|
|||
// application or mouse control not active? remove any clips
|
||||
if (!Active || !Application.Active || (Game.pGUI && Game.pGUI->HasMouseFocus())) { ClipCursor(NULL); return; }
|
||||
// get controlled viewport
|
||||
C4Viewport *pVP=Game.GraphicsSystem.GetViewport(Player);
|
||||
C4Viewport *pVP=::GraphicsSystem.GetViewport(Player);
|
||||
if (!pVP) { ClipCursor(NULL); return; }
|
||||
// adjust size by viewport size
|
||||
RECT vpRct;
|
||||
|
@ -222,7 +222,7 @@ void C4MouseControl::Move(int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyFl
|
|||
// Check player
|
||||
if ((Player>NO_OWNER) && !(pPlayer=Game.Players.Get(Player))) { Active=FALSE; return; }
|
||||
// Check viewport
|
||||
if (!(Viewport=Game.GraphicsSystem.GetViewport(Player))) return;
|
||||
if (!(Viewport=::GraphicsSystem.GetViewport(Player))) return;
|
||||
// get view position
|
||||
C4Rect rcViewport = Viewport->GetOutputRect();
|
||||
fctViewport.Set(NULL, rcViewport.x, rcViewport.y, rcViewport.Wdt, rcViewport.Hgt);
|
||||
|
|
|
@ -563,7 +563,7 @@ bool C4MusicSystem::ToggleOnOff()
|
|||
// game music
|
||||
Config.Sound.RXMusic = !Config.Sound.RXMusic;
|
||||
if (!Config.Sound.RXMusic) Stop(); else Play();
|
||||
Game.GraphicsSystem.FlashMessageOnOff(LoadResStr("IDS_CTL_MUSIC"), !!Config.Sound.RXMusic);
|
||||
::GraphicsSystem.FlashMessageOnOff(LoadResStr("IDS_CTL_MUSIC"), !!Config.Sound.RXMusic);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -706,7 +706,7 @@ void C4Network2::AllowJoin(bool fAllow)
|
|||
fAllowJoin = fAllow;
|
||||
if (Game.IsRunning)
|
||||
{
|
||||
Game.GraphicsSystem.FlashMessage(LoadResStr(fAllowJoin ? "IDS_NET_RUNTIMEJOINFREE" : "IDS_NET_RUNTIMEJOINBARRED"));
|
||||
::GraphicsSystem.FlashMessage(LoadResStr(fAllowJoin ? "IDS_NET_RUNTIMEJOINFREE" : "IDS_NET_RUNTIMEJOINBARRED"));
|
||||
Config.Network.NoRuntimeJoin = !fAllowJoin;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -217,7 +217,7 @@ BOOL C4Object::Init(C4Def *pDef, C4Object *pCreator,
|
|||
UpdateFace(true);
|
||||
|
||||
// Initial audibility
|
||||
Audible=Game.GraphicsSystem.GetAudibility(GetX(), GetY(), &AudiblePan);
|
||||
Audible=::GraphicsSystem.GetAudibility(GetX(), GetY(), &AudiblePan);
|
||||
|
||||
// Initial OCF
|
||||
SetOCF();
|
||||
|
@ -1983,7 +1983,7 @@ BOOL C4Object::ActivateMenu(int32_t iMenu, int32_t iMenuSelect,
|
|||
Menu->Init(fctSymbol, pTarget->GetName(), this, C4MN_Extra_None, 0, iMenu, C4MN_Style_Info);
|
||||
Menu->SetPermanent(TRUE);
|
||||
Menu->SetAlignment(C4MN_Align_Free);
|
||||
C4Viewport *pViewport = Game.GraphicsSystem.GetViewport(Controller); // Hackhackhack!!!
|
||||
C4Viewport *pViewport = ::GraphicsSystem.GetViewport(Controller); // Hackhackhack!!!
|
||||
if (pViewport) Menu->SetLocation((pTarget->GetX() + pTarget->Shape.GetX() + pTarget->Shape.Wdt + 10 - pViewport->ViewX) * pViewport->Zoom,
|
||||
(pTarget->GetY() + pTarget->Shape.GetY() - pViewport->ViewY) * pViewport->Zoom);
|
||||
// Add info item
|
||||
|
@ -2258,7 +2258,7 @@ void C4Object::Draw(C4TargetFacet &cgo, int32_t iByPlayer, DrawMode eDrawMode)
|
|||
if (GetGraphics()->BitmapClr) GetGraphics()->BitmapClr->SetClr(Color);
|
||||
|
||||
// Debug Display //////////////////////////////////////////////////////////////////////
|
||||
if (Game.GraphicsSystem.ShowCommand && !eDrawMode)
|
||||
if (::GraphicsSystem.ShowCommand && !eDrawMode)
|
||||
{
|
||||
C4Command *pCom;
|
||||
int32_t ccx=GetX(),ccy=GetY();
|
||||
|
@ -2339,7 +2339,7 @@ void C4Object::Draw(C4TargetFacet &cgo, int32_t iByPlayer, DrawMode eDrawMode)
|
|||
// Debug Display ///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Don't draw (show solidmask)
|
||||
if (Game.GraphicsSystem.ShowSolidMask)
|
||||
if (::GraphicsSystem.ShowSolidMask)
|
||||
if (SolidMask.Wdt)
|
||||
{
|
||||
// DrawSolidMask(cgo); - no need to draw it, because the 8bit-surface will be shown
|
||||
|
@ -2441,7 +2441,7 @@ void C4Object::Draw(C4TargetFacet &cgo, int32_t iByPlayer, DrawMode eDrawMode)
|
|||
|
||||
|
||||
// Debug Display ////////////////////////////////////////////////////////////////////////
|
||||
if (Game.GraphicsSystem.ShowVertices) if (eDrawMode!=ODM_BaseOnly)
|
||||
if (::GraphicsSystem.ShowVertices) if (eDrawMode!=ODM_BaseOnly)
|
||||
{
|
||||
int32_t cnt;
|
||||
if (Shape.VtxNum>1)
|
||||
|
@ -2455,7 +2455,7 @@ void C4Object::Draw(C4TargetFacet &cgo, int32_t iByPlayer, DrawMode eDrawMode)
|
|||
}
|
||||
}
|
||||
|
||||
if (Game.GraphicsSystem.ShowEntrance) if (eDrawMode!=ODM_BaseOnly)
|
||||
if (::GraphicsSystem.ShowEntrance) if (eDrawMode!=ODM_BaseOnly)
|
||||
{
|
||||
if (OCF & OCF_Entrance)
|
||||
Application.DDraw->DrawFrame(cgo.Surface,cgo.X+cox-Shape.x+Def->Entrance.x,
|
||||
|
@ -2471,7 +2471,7 @@ void C4Object::Draw(C4TargetFacet &cgo, int32_t iByPlayer, DrawMode eDrawMode)
|
|||
CRed);
|
||||
}
|
||||
|
||||
if (Game.GraphicsSystem.ShowAction) if (eDrawMode!=ODM_BaseOnly)
|
||||
if (::GraphicsSystem.ShowAction) if (eDrawMode!=ODM_BaseOnly)
|
||||
{
|
||||
if (Action.Act>ActIdle)
|
||||
{
|
||||
|
@ -2543,7 +2543,7 @@ void C4Object::DrawTopFace(C4TargetFacet &cgo, int32_t iByPlayer, DrawMode eDraw
|
|||
|| !Inside<float>(coy,1-Shape.Hgt,cgo.Hgt))
|
||||
return;
|
||||
// Don't draw (show solidmask)
|
||||
if (Game.GraphicsSystem.ShowSolidMask)
|
||||
if (::GraphicsSystem.ShowSolidMask)
|
||||
if (SolidMask.Wdt)
|
||||
return;
|
||||
// Contained
|
||||
|
|
|
@ -613,13 +613,13 @@ BOOL C4PathFinder::Execute()
|
|||
if (iRays>=C4PF_MaxRay) return FALSE;
|
||||
|
||||
// Draw
|
||||
if (Game.GraphicsSystem.ShowPathfinder)
|
||||
if (::GraphicsSystem.ShowPathfinder)
|
||||
{
|
||||
static int32_t iDelay=0;
|
||||
iDelay++; if (iDelay>C4PF_Draw_Rate)
|
||||
{
|
||||
iDelay=0;
|
||||
Game.GraphicsSystem.Execute();
|
||||
::GraphicsSystem.Execute();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -419,7 +419,7 @@ BOOL C4Player::Save()
|
|||
if (GetType() == C4PT_Script) return FALSE;
|
||||
// Log
|
||||
LogF(LoadResStr("IDS_PRC_SAVEPLR"), Config.AtRelativePath(Filename));
|
||||
Game.GraphicsSystem.MessageBoard.EnsureLastMessage();
|
||||
::GraphicsSystem.MessageBoard.EnsureLastMessage();
|
||||
// copy player to save somewhere else
|
||||
char szPath[_MAX_PATH + 1];
|
||||
SCopy(Config.AtTempPath(C4CFN_TempPlayer), szPath, _MAX_PATH);
|
||||
|
|
|
@ -288,7 +288,7 @@ BOOL C4PlayerList::Remove(C4Player *pPlr, bool fDisconnect, bool fNoCalls)
|
|||
pPlr->CrewInfoList.DetachFromObjects();
|
||||
|
||||
// Clear viewports
|
||||
Game.GraphicsSystem.CloseViewport(pPlr->Number, fNoCalls);
|
||||
::GraphicsSystem.CloseViewport(pPlr->Number, fNoCalls);
|
||||
// Check fullscreen viewports
|
||||
FullScreen.ViewportCheck();
|
||||
|
||||
|
|
|
@ -5267,13 +5267,13 @@ static long FnReloadParticle(C4AulContext* ctx, C4String *szParticleName)
|
|||
|
||||
static bool FnSetGamma(C4AulContext* ctx, long dwClr1, long dwClr2, long dwClr3, long iRampIndex)
|
||||
{
|
||||
Game.GraphicsSystem.SetGamma(dwClr1, dwClr2, dwClr3, iRampIndex);
|
||||
::GraphicsSystem.SetGamma(dwClr1, dwClr2, dwClr3, iRampIndex);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static bool FnResetGamma(C4AulContext* ctx, long iRampIndex)
|
||||
{
|
||||
Game.GraphicsSystem.SetGamma(0x000000, 0x808080, 0xffffff, iRampIndex);
|
||||
::GraphicsSystem.SetGamma(0x000000, 0x808080, 0xffffff, iRampIndex);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -5378,7 +5378,7 @@ static bool FnSetFilmView(C4AulContext *ctx, long iToPlr)
|
|||
// real switch in replays only
|
||||
if (!Game.Control.isReplay()) return TRUE;
|
||||
// set new target plr
|
||||
if (C4Viewport *vp = Game.GraphicsSystem.GetFirstViewport()) vp->Init(iToPlr, true);
|
||||
if (C4Viewport *vp = ::GraphicsSystem.GetFirstViewport()) vp->Init(iToPlr, true);
|
||||
// done, always success (sync)
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -5940,7 +5940,7 @@ static bool FnSetViewOffset(C4AulContext *ctx, long iPlayer, long iX, long iY)
|
|||
{
|
||||
if(!ValidPlr(iPlayer)) return 0;
|
||||
// get player viewport
|
||||
C4Viewport *pView = Game.GraphicsSystem.GetViewport(iPlayer);
|
||||
C4Viewport *pView = ::GraphicsSystem.GetViewport(iPlayer);
|
||||
if(!pView) return 1; // sync safety
|
||||
// set
|
||||
pView->ViewOffsX = iX;
|
||||
|
@ -5957,7 +5957,7 @@ static bool FnSetPreSend(C4AulContext *cthr, long iToVal, C4String *pNewName)
|
|||
if (!szClient || !*szClient || WildcardMatch(szClient, Game.Clients.getLocalName()))
|
||||
{
|
||||
Game.Control.Network.setTargetFPS(iToVal);
|
||||
Game.GraphicsSystem.FlashMessage(FormatString("TargetFPS: %ld", iToVal).getData());
|
||||
::GraphicsSystem.FlashMessage(FormatString("TargetFPS: %ld", iToVal).getData());
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -367,7 +367,7 @@ void C4SoundInstance::Execute()
|
|||
|
||||
void C4SoundInstance::SetVolumeByPos(int32_t x, int32_t y)
|
||||
{
|
||||
iVolume = Game.GraphicsSystem.GetAudibility(x, y, &iPan);
|
||||
iVolume = ::GraphicsSystem.GetAudibility(x, y, &iPan);
|
||||
}
|
||||
|
||||
void C4SoundInstance::ClearPointers(C4Object *pDelete)
|
||||
|
|
|
@ -282,7 +282,7 @@ bool C4Startup::DoStartup()
|
|||
#endif
|
||||
|
||||
// make sure loader is drawn after splash
|
||||
Game.GraphicsSystem.EnableLoaderDrawing();
|
||||
::GraphicsSystem.EnableLoaderDrawing();
|
||||
|
||||
// Play some music!
|
||||
if (Config.Sound.FEMusic)
|
||||
|
|
|
@ -214,7 +214,7 @@ void C4Video::Draw(C4TargetFacet &cgo)
|
|||
bool C4Video::AdjustPosition()
|
||||
{
|
||||
// Get source player & viewport
|
||||
C4Viewport *pViewport = Game.GraphicsSystem.GetFirstViewport();
|
||||
C4Viewport *pViewport = ::GraphicsSystem.GetFirstViewport();
|
||||
if (!pViewport) return false;
|
||||
C4Player *pPlr = Game.Players.Get(pViewport->GetPlayer());
|
||||
if (!pPlr) return false;
|
||||
|
@ -269,7 +269,7 @@ void C4Video::Draw()
|
|||
if (!Active) return;
|
||||
// Get viewport
|
||||
C4Viewport *pViewport;
|
||||
if (pViewport = Game.GraphicsSystem.GetFirstViewport())
|
||||
if (pViewport = ::GraphicsSystem.GetFirstViewport())
|
||||
{
|
||||
C4TargetFacet cgo;
|
||||
cgo.Set(Surface,pViewport->DrawX,pViewport->DrawY,pViewport->ViewWdt,pViewport->ViewHgt,pViewport->ViewX,pViewport->ViewY);
|
||||
|
|
|
@ -78,7 +78,7 @@ LRESULT APIENTRY ViewportWinProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
|
|||
{
|
||||
// Determine viewport
|
||||
C4Viewport *cvp;
|
||||
if (!(cvp=Game.GraphicsSystem.GetViewport(hwnd)))
|
||||
if (!(cvp=::GraphicsSystem.GetViewport(hwnd)))
|
||||
return DefWindowProc(hwnd, uMsg, wParam, lParam);
|
||||
|
||||
// Process message
|
||||
|
@ -133,7 +133,7 @@ LRESULT APIENTRY ViewportWinProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
|
|||
break;
|
||||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
case WM_PAINT:
|
||||
Game.GraphicsSystem.Execute();
|
||||
::GraphicsSystem.Execute();
|
||||
break;
|
||||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
case WM_HSCROLL:
|
||||
|
@ -170,27 +170,27 @@ LRESULT APIENTRY ViewportWinProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
|
|||
switch (uMsg)
|
||||
{
|
||||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
case WM_LBUTTONDOWN: Game.GraphicsSystem.MouseMove(C4MC_Button_LeftDown,LOWORD(lParam),HIWORD(lParam),wParam, cvp); break;
|
||||
case WM_LBUTTONDOWN: ::GraphicsSystem.MouseMove(C4MC_Button_LeftDown,LOWORD(lParam),HIWORD(lParam),wParam, cvp); break;
|
||||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
case WM_LBUTTONUP: Game.GraphicsSystem.MouseMove(C4MC_Button_LeftUp,LOWORD(lParam),HIWORD(lParam),wParam, cvp); break;
|
||||
case WM_LBUTTONUP: ::GraphicsSystem.MouseMove(C4MC_Button_LeftUp,LOWORD(lParam),HIWORD(lParam),wParam, cvp); break;
|
||||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
case WM_RBUTTONDOWN: Game.GraphicsSystem.MouseMove(C4MC_Button_RightDown,LOWORD(lParam),HIWORD(lParam),wParam, cvp); break;
|
||||
case WM_RBUTTONDOWN: ::GraphicsSystem.MouseMove(C4MC_Button_RightDown,LOWORD(lParam),HIWORD(lParam),wParam, cvp); break;
|
||||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
case WM_RBUTTONUP: Game.GraphicsSystem.MouseMove(C4MC_Button_RightUp,LOWORD(lParam),HIWORD(lParam),wParam, cvp); break;
|
||||
case WM_RBUTTONUP: ::GraphicsSystem.MouseMove(C4MC_Button_RightUp,LOWORD(lParam),HIWORD(lParam),wParam, cvp); break;
|
||||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
case WM_LBUTTONDBLCLK: Game.GraphicsSystem.MouseMove(C4MC_Button_LeftDouble,LOWORD(lParam),HIWORD(lParam),wParam, cvp); break;
|
||||
case WM_LBUTTONDBLCLK: ::GraphicsSystem.MouseMove(C4MC_Button_LeftDouble,LOWORD(lParam),HIWORD(lParam),wParam, cvp); break;
|
||||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
case WM_RBUTTONDBLCLK: Game.GraphicsSystem.MouseMove(C4MC_Button_RightDouble,LOWORD(lParam),HIWORD(lParam),wParam, cvp); break;
|
||||
case WM_RBUTTONDBLCLK: ::GraphicsSystem.MouseMove(C4MC_Button_RightDouble,LOWORD(lParam),HIWORD(lParam),wParam, cvp); break;
|
||||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
case WM_MOUSEMOVE:
|
||||
if ( Inside<int32_t>(LOWORD(lParam)-cvp->DrawX,0,cvp->ViewWdt-1)
|
||||
&& Inside<int32_t>(HIWORD(lParam)-cvp->DrawY,0,cvp->ViewHgt-1) )
|
||||
SetCursor(NULL);
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_None,LOWORD(lParam),HIWORD(lParam),wParam, cvp);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_None,LOWORD(lParam),HIWORD(lParam),wParam, cvp);
|
||||
break;
|
||||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
case WM_MOUSEWHEEL:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_Wheel,LOWORD(lParam),HIWORD(lParam),wParam, cvp);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_Wheel,LOWORD(lParam),HIWORD(lParam),wParam, cvp);
|
||||
break;
|
||||
//----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -510,10 +510,10 @@ gboolean C4ViewportWindow::OnScrollStatic(GtkWidget* widget, GdkEventScroll* eve
|
|||
switch(event->direction)
|
||||
{
|
||||
case GDK_SCROLL_UP:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_Wheel, (int32_t)event->x, (int32_t)event->y, event->state + (short(1) << 16), window->cvp);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_Wheel, (int32_t)event->x, (int32_t)event->y, event->state + (short(1) << 16), window->cvp);
|
||||
break;
|
||||
case GDK_SCROLL_DOWN:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_Wheel, (int32_t)event->x, (int32_t)event->y, event->state + (short(-1) << 16), window->cvp);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_Wheel, (int32_t)event->x, (int32_t)event->y, event->state + (short(-1) << 16), window->cvp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -531,18 +531,18 @@ gboolean C4ViewportWindow::OnButtonPressStatic(GtkWidget* widget, GdkEventButton
|
|||
{
|
||||
case 1:
|
||||
if(event->type == GDK_BUTTON_PRESS)
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_LeftDown, (int32_t)event->x, (int32_t)event->y, event->state, window->cvp);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_LeftDown, (int32_t)event->x, (int32_t)event->y, event->state, window->cvp);
|
||||
else if(event->type == GDK_2BUTTON_PRESS)
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_LeftDouble, (int32_t)event->x, (int32_t)event->y, event->state, window->cvp);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_LeftDouble, (int32_t)event->x, (int32_t)event->y, event->state, window->cvp);
|
||||
break;
|
||||
case 2:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_MiddleDown, (int32_t)event->x, (int32_t)event->y, event->state, window->cvp);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_MiddleDown, (int32_t)event->x, (int32_t)event->y, event->state, window->cvp);
|
||||
break;
|
||||
case 3:
|
||||
if(event->type == GDK_BUTTON_PRESS)
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_RightDown, (int32_t)event->x, (int32_t)event->y, event->state, window->cvp);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_RightDown, (int32_t)event->x, (int32_t)event->y, event->state, window->cvp);
|
||||
else if(event->type == GDK_2BUTTON_PRESS)
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_RightDouble, (int32_t)event->x, (int32_t)event->y, event->state, window->cvp);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_RightDouble, (int32_t)event->x, (int32_t)event->y, event->state, window->cvp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -571,13 +571,13 @@ gboolean C4ViewportWindow::OnButtonReleaseStatic(GtkWidget* widget, GdkEventButt
|
|||
switch (event->button)
|
||||
{
|
||||
case 1:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_LeftUp, (int32_t)event->x, (int32_t)event->y, event->state, window->cvp);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_LeftUp, (int32_t)event->x, (int32_t)event->y, event->state, window->cvp);
|
||||
break;
|
||||
case 2:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_MiddleUp, (int32_t)event->x, (int32_t)event->y, event->state, window->cvp);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_MiddleUp, (int32_t)event->x, (int32_t)event->y, event->state, window->cvp);
|
||||
break;
|
||||
case 3:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_RightUp, (int32_t)event->x, (int32_t)event->y, event->state, window->cvp);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_RightUp, (int32_t)event->x, (int32_t)event->y, event->state, window->cvp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -603,7 +603,7 @@ gboolean C4ViewportWindow::OnMotionNotifyStatic(GtkWidget* widget, GdkEventMotio
|
|||
|
||||
if (Game.MouseControl.IsViewport(window->cvp) && (Console.EditCursor.GetMode()==C4CNS_ModePlay))
|
||||
{
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_None, (int32_t)event->x, (int32_t)event->y, event->state, window->cvp);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_None, (int32_t)event->x, (int32_t)event->y, event->state, window->cvp);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -676,36 +676,36 @@ void C4ViewportWindow::HandleMessage (XEvent & e)
|
|||
{
|
||||
case Button1:
|
||||
if (timeGetTime() - last_left_click < 400) {
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_LeftDouble,
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_LeftDouble,
|
||||
e.xbutton.x, e.xbutton.y, e.xbutton.state, cvp);
|
||||
last_left_click = 0;
|
||||
} else {
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_LeftDown,
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_LeftDown,
|
||||
e.xbutton.x, e.xbutton.y, e.xbutton.state, cvp);
|
||||
last_left_click = timeGetTime();
|
||||
}
|
||||
break;
|
||||
case Button2:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_MiddleDown,
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_MiddleDown,
|
||||
e.xbutton.x, e.xbutton.y, e.xbutton.state, cvp);
|
||||
break;
|
||||
case Button3:
|
||||
if (timeGetTime() - last_right_click < 400) {
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_RightDouble,
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_RightDouble,
|
||||
e.xbutton.x, e.xbutton.y, e.xbutton.state, cvp);
|
||||
last_right_click = 0;
|
||||
} else {
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_RightDown,
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_RightDown,
|
||||
e.xbutton.x, e.xbutton.y, e.xbutton.state, cvp);
|
||||
last_right_click = timeGetTime();
|
||||
}
|
||||
break;
|
||||
case Button4:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_Wheel,
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_Wheel,
|
||||
e.xbutton.x, e.xbutton.y, e.xbutton.state + (short(1) << 16), cvp);
|
||||
break;
|
||||
case Button5:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_Wheel,
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_Wheel,
|
||||
e.xbutton.x, e.xbutton.y, e.xbutton.state + (short(-1) << 16), cvp);
|
||||
break;
|
||||
default:
|
||||
|
@ -732,13 +732,13 @@ void C4ViewportWindow::HandleMessage (XEvent & e)
|
|||
switch (e.xbutton.button)
|
||||
{
|
||||
case Button1:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_LeftUp, e.xbutton.x, e.xbutton.y, e.xbutton.state, cvp);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_LeftUp, e.xbutton.x, e.xbutton.y, e.xbutton.state, cvp);
|
||||
break;
|
||||
case Button2:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_MiddleUp, e.xbutton.x, e.xbutton.y, e.xbutton.state, cvp);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_MiddleUp, e.xbutton.x, e.xbutton.y, e.xbutton.state, cvp);
|
||||
break;
|
||||
case Button3:
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_RightUp, e.xbutton.x, e.xbutton.y, e.xbutton.state, cvp);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_RightUp, e.xbutton.x, e.xbutton.y, e.xbutton.state, cvp);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -760,7 +760,7 @@ void C4ViewportWindow::HandleMessage (XEvent & e)
|
|||
case MotionNotify:
|
||||
if (Game.MouseControl.IsViewport(cvp) && (Console.EditCursor.GetMode()==C4CNS_ModePlay))
|
||||
{
|
||||
Game.GraphicsSystem.MouseMove(C4MC_Button_None, e.xbutton.x, e.xbutton.y, e.xbutton.state, cvp);
|
||||
::GraphicsSystem.MouseMove(C4MC_Button_None, e.xbutton.x, e.xbutton.y, e.xbutton.state, cvp);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -776,7 +776,7 @@ void C4ViewportWindow::HandleMessage (XEvent & e)
|
|||
#endif // WITH_DEVELOPER_MODE/_WIN32
|
||||
|
||||
void C4ViewportWindow::Close() {
|
||||
Game.GraphicsSystem.CloseViewport(cvp);
|
||||
::GraphicsSystem.CloseViewport(cvp);
|
||||
}
|
||||
|
||||
BOOL C4Viewport::UpdateOutputSize()
|
||||
|
@ -1093,7 +1093,7 @@ void C4Viewport::Draw(C4TargetFacet &cgo, bool fDrawOverlay)
|
|||
Game.ForeObjects.DrawIfCategory(cgo, Player, C4D_Parallax, true);
|
||||
|
||||
// Draw PathFinder
|
||||
if (Game.GraphicsSystem.ShowPathfinder) Game.PathFinder.Draw(cgo);
|
||||
if (::GraphicsSystem.ShowPathfinder) Game.PathFinder.Draw(cgo);
|
||||
|
||||
// Draw overlay
|
||||
if (!Game.C4S.Head.Film || !Game.C4S.Head.Replay) Game.DrawCursors(cgo, Player);
|
||||
|
@ -1121,7 +1121,7 @@ void C4Viewport::Draw(C4TargetFacet &cgo, bool fDrawOverlay)
|
|||
DrawOverlay(cgo, GameZoom);
|
||||
|
||||
// Netstats
|
||||
if (Game.GraphicsSystem.ShowNetstatus)
|
||||
if (::GraphicsSystem.ShowNetstatus)
|
||||
Game.Network.DrawStatus(cgo);
|
||||
|
||||
C4ST_STOP(OvrStat)
|
||||
|
@ -1170,8 +1170,8 @@ void C4Viewport::Execute()
|
|||
Draw(cgo, true);
|
||||
// Video record & status (developer mode, first player viewport)
|
||||
if (!Application.isFullScreen)
|
||||
if (Player==0 && (this==Game.GraphicsSystem.GetViewport((int32_t) 0)))
|
||||
Game.GraphicsSystem.Video.Execute();
|
||||
if (Player==0 && (this==::GraphicsSystem.GetViewport((int32_t) 0)))
|
||||
::GraphicsSystem.Video.Execute();
|
||||
// Blit output
|
||||
BlitOutput();
|
||||
#ifdef USE_GL
|
||||
|
@ -1375,7 +1375,7 @@ BOOL C4Viewport::Init(int32_t iPlayer, bool fSetTempOnly)
|
|||
Player=iPlayer;
|
||||
if (!fSetTempOnly) fIsNoOwnerViewport = (iPlayer == NO_OWNER);
|
||||
// Owned viewport: clear any flash message explaining observer menu
|
||||
if (ValidPlr(iPlayer)) Game.GraphicsSystem.FlashMessage("");
|
||||
if (ValidPlr(iPlayer)) ::GraphicsSystem.FlashMessage("");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -275,7 +275,7 @@ void C4Weather::SetSeasonGamma()
|
|||
dwClr[i] |= BoundBy<int32_t>(iChanVal,0,255)<<iChan;
|
||||
}
|
||||
// apply gamma ramp
|
||||
Game.GraphicsSystem.SetGamma(dwClr[0], dwClr[1], dwClr[2], C4GRI_SEASON);
|
||||
::GraphicsSystem.SetGamma(dwClr[0], dwClr[1], dwClr[2], C4GRI_SEASON);
|
||||
}
|
||||
|
||||
void C4Weather::CompileFunc(StdCompiler *pComp)
|
||||
|
@ -300,5 +300,5 @@ void C4Weather::CompileFunc(StdCompiler *pComp)
|
|||
dwGammaDefaults[i*3+1] = 0x808080;
|
||||
dwGammaDefaults[i*3+2] = 0xffffff;
|
||||
}
|
||||
pComp->Value(mkNamingAdapt(mkArrayAdaptM(Game.GraphicsSystem.dwGamma), "Gamma", dwGammaDefaults));
|
||||
pComp->Value(mkNamingAdapt(mkArrayAdaptM(::GraphicsSystem.dwGamma), "Gamma", dwGammaDefaults));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue