diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a694117d07..6bfcfabe17 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -84,11 +84,11 @@ jobs:
- name: Build
run: |
- cmake --build build --config "${{ matrix.cfg.type }}" -j 2
+ cmake --build build --config "${{ matrix.cfg.type }}" -j 4
- name: Install
run: |
- cmake --build build --target INSTALL --config "${{ matrix.cfg.type }}" -j 2
+ cmake --build build --target INSTALL --config "${{ matrix.cfg.type }}" -j 4
- name: Upload Artifacts
uses: actions/upload-artifact@v3
@@ -98,7 +98,7 @@ jobs:
- name: Test
run: |
- cmake --build build --target check --config "${{ matrix.cfg.type }}" -j 2
+ cmake --build build --target check --config "${{ matrix.cfg.type }}" -j 4
max:
# Can only run if we have a token for our super seekrit Max SDK repo. Sad.
@@ -161,7 +161,7 @@ jobs:
- name: Build
run: |
- cmake --build build --target INSTALL --config Release -j 2
+ cmake --build build --target INSTALL --config Release -j 4
- name: Upload Artifacts
uses: actions/upload-artifact@v3
@@ -231,11 +231,11 @@ jobs:
- name: Test
run: |
- cmake --build build --target check -j 2
+ cmake --build build --target check -j 4
- name: Install
run: |
- cmake --build build --target install -j 2
+ cmake --build build --target install -j 4
- name: Upload Artifacts
uses: actions/upload-artifact@v3
@@ -245,13 +245,13 @@ jobs:
macos:
- runs-on: macos-latest
+ runs-on: ${{ matrix.platform.runner }}
name: ${{ matrix.platform.str }}-${{ matrix.cfg.str }}
strategy:
matrix:
platform:
- - { str: macos-arm64, arch: arm64 }
- - { str: macos-x64, arch: x86_64 }
+ - { str: macos-arm64, arch: arm64, runner: "macos-14" }
+ - { str: macos-x64, arch: x86_64, runner: "macos-latest" }
cfg:
- { external: OFF, type: RelWithDebInfo, str: internal-release }
- { external: OFF, type: Debug, str: internal-debug }
@@ -264,15 +264,12 @@ jobs:
- name: Install dependencies
run: |
brew install \
- ${{ (matrix.platform.arch == 'x86_64' && 'qt@5') || '' }} \
+ qt@5 \
autoconf \
automake \
libtool \
- nasm
-
- # Workaround for missing distutils on macOS: https://github.com/actions/runner/issues/2958
- - name: Install setuptools
- run: sudo -H pip install setuptools
+ nasm \
+ python-setuptools
- name: Setup NuGet
run: |
@@ -298,7 +295,7 @@ jobs:
-DPLASMA_BUILD_TESTS=ON \
-DPLASMA_BUILD_TOOLS=ON \
-DPLASMA_EXTERNAL_RELEASE=${{ matrix.cfg.external }} \
- ${{ (matrix.platform.arch == 'x86_64' && '-DQt5_ROOT=$(brew --prefix qt@5)') || '' }} \
+ -DQt5_ROOT=$(brew --prefix qt@5) \
-DVCPKG_INSTALL_OPTIONS=--clean-after-build \
-S . -B build
env:
diff --git a/Scripts/Python/plasma/Plasma.py b/Scripts/Python/plasma/Plasma.py
index 513d9ed2af..19901433fa 100644
--- a/Scripts/Python/plasma/Plasma.py
+++ b/Scripts/Python/plasma/Plasma.py
@@ -827,6 +827,10 @@ def PtStartScreenCapture(selfKey,width=800,height=600):
"""Starts a capture of the screen"""
pass
+def PtSupportsPlanarReflections() -> bool:
+ """Returns if planar reflections are supported"""
+ ...
+
def PtToggleAvatarClickability(on):
"""Turns on and off our avatar's clickability"""
pass
diff --git a/Scripts/Python/xEntryCam.py b/Scripts/Python/xEntryCam.py
new file mode 100644
index 0000000000..5af971b330
--- /dev/null
+++ b/Scripts/Python/xEntryCam.py
@@ -0,0 +1,124 @@
+# -*- coding: utf-8 -*-
+""" *==LICENSE==*
+
+CyanWorlds.com Engine - MMOG client, server and tools
+Copyright (C) 2011 Cyan Worlds, Inc.
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see .
+
+Additional permissions under GNU GPL version 3 section 7
+
+If you modify this Program, or any covered work, by linking or
+combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
+NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
+JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
+(or a modified version of those libraries),
+containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
+PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
+JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
+licensors of this Program grant you additional
+permission to convey the resulting work. Corresponding Source for a
+non-source form of such a combination shall include the source code for
+the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
+work.
+
+You can contact Cyan Worlds, Inc. by email legal@cyan.com
+ or by snail mail at:
+ Cyan Worlds, Inc.
+ 14617 N Newport Hwy
+ Mead, WA 99021
+
+ *==LICENSE==* """
+
+from Plasma import *
+from PlasmaTypes import *
+from PlasmaConstants import *
+
+actRegionSensor = ptAttribActivator(1, "act: Camera Region Sensor")
+camera = ptAttribSceneobject(2, "Entry Camera")
+undoFirstPerson = ptAttribBoolean(3, "Override the player's first person camera setting?", default=True)
+
+class xEntryCam(ptModifier):
+ def __init__(self):
+ ptModifier.__init__(self)
+ self.id = 900378302
+ self.version = 1
+
+ self._entryCamActive = False
+ self._linkedIn = False
+
+ PtDebugPrint(f"xEntryCam.__init__() {self.version=}", level=kWarningLevel)
+
+ def _DisableEnterRgn(self, reason="unknown"):
+ PtDebugPrint(f"xEntryCam._DisableEnterRgn(): [{self.sceneobject.getName()}] Disabling entry region... [Reason: {reason}]", level=kWarningLevel)
+
+ # We're tracking the enable/disable state of the entry camera region in
+ # a variable because disabling the activator seems to propagate out to
+ # the host scene object, disabling both regions. We need the exit region
+ # to be active, though, to ensure the entry camera is popped off on exit,
+ # not when we link-in... that defeats the purpose!
+ self._linkedIn = True
+ PtGetLocalAvatar().avatar.unRegisterForBehaviorNotify(self.key)
+
+ def OnServerInitComplete(self):
+ # When we finish linking in, all entry regions will be disabled.
+ PtGetLocalAvatar().avatar.registerForBehaviorNotify(self.key)
+
+ # No need for server arbitration on these because it's all local.
+ actRegionSensor.volumeSensorNoArbitration()
+
+ def OnBehaviorNotify(self, type, id, state):
+ PtDebugPrint(f"xEntryCam.OnBehaviorNotify(): {type=} {id=} {state=}", level=kDebugDumpLevel)
+ if type == PtBehaviorTypes.kBehaviorTypeLinkIn:
+ self._DisableEnterRgn("done linking in")
+
+ def OnNotify(self, state, id, events):
+ if PtFindAvatar(events) != PtGetLocalAvatar():
+ return
+ if id != actRegionSensor.id:
+ return
+
+ # Search for a collision event in the notification's event records. The second item in
+ # the record is the entered state. Note that the engine is currently passing integers
+ # instead of proper booleans, and a value of `None` indicates that no collision
+ # event was found at all. Be careful!
+ rgnEntered = next((event[1] for event in events if event[0] == kCollisionEvent), None)
+
+ if rgnEntered is None:
+ PtDebugPrint(f"xEntryCam.OnNotify(): [{self.sceneobject.getName()}] Ignoring spurious notification", level=kDebugDumpLevel)
+ elif rgnEntered:
+ if self._linkedIn:
+ PtDebugPrint(f"xEntryCam.OnNotify(): [{self.sceneobject.getName()}] Ignoring entry cam enter trigger.", level=kDebugDumpLevel)
+ return
+
+ self._DisableEnterRgn("entry cam triggered")
+ PtDebugPrint(f"xEntryCam.OnNotify(): [{self.sceneobject.getName()}] Pushing entry camera {camera.value.getName()}", level=kWarningLevel)
+ if not self._entryCamActive:
+ virtCam = ptCamera()
+ virtCam.save(camera.value.getKey())
+ # This will only force the player out of first person if the age creator says that we should do so *and* the player
+ # has *not* enabled the "stay in first person" flag. If the player has "stay in first person" enabled, then they
+ # will not be forced into third person for this entry camera.
+ if undoFirstPerson.value:
+ virtCam.undoFirstPerson()
+ self._entryCamActive = True
+ else:
+ if not self._entryCamActive:
+ PtDebugPrint(f"xEntryCam.OnNotify(): [{self.sceneobject.getName()}] Ignoring entry cam region exit trigger.", level=kDebugDumpLevel)
+ return
+
+ PtDebugPrint(f"xEntryCam.OnNotify(): [{self.sceneobject.getName()}] Popping entry camera {camera.value.getName()}", level=kWarningLevel)
+ virtCam = ptCamera()
+ virtCam.restore(camera.value.getKey())
+ self._entryCamActive = False
diff --git a/Scripts/Python/xIniDisplay.py b/Scripts/Python/xIniDisplay.py
index 6d14035559..a7552d1566 100644
--- a/Scripts/Python/xIniDisplay.py
+++ b/Scripts/Python/xIniDisplay.py
@@ -62,9 +62,10 @@
kGraphicsShadows = "Graphics.Shadow.Enable"
kGraphicsVerticalSync = "Graphics.EnableVSync"
kGraphicsShadowQuality = "Graphics.Shadow.VisibleDistance"
+kGraphicsDynamicReflections = "Graphics.EnablePlanarReflections"
-CmdList = [kGraphicsWidth, kGraphicsHeight, kGraphicsColorDepth, kGraphicsWindowed, kGraphicsTextureQuality, kGraphicsAntiAliasLevel, kGraphicsAnisotropicLevel, kGraphicsQualityLevel, kGraphicsShadows, kGraphicsVerticalSync, kGraphicsShadowQuality]
-DefaultsList = ["800", "600", "32", "false", "2", "0", "0", "2", "true", "false", "0"]
+CmdList = [kGraphicsWidth, kGraphicsHeight, kGraphicsColorDepth, kGraphicsWindowed, kGraphicsTextureQuality, kGraphicsAntiAliasLevel, kGraphicsAnisotropicLevel, kGraphicsQualityLevel, kGraphicsShadows, kGraphicsVerticalSync, kGraphicsShadowQuality, kGraphicsDynamicReflections]
+DefaultsList = ["800", "600", "32", "false", "2", "0", "0", "2", "true", "false", "0", "1"]
def ConstructFilenameAndPath():
global gFilenameAndPath
@@ -105,6 +106,7 @@ def ReadIni():
gIniFile.addEntry(kGraphicsShadows + " true")
gIniFile.addEntry(kGraphicsVerticalSync + " false")
gIniFile.addEntry(kGraphicsShadowQuality + " 0")
+ gIniFile.addEntry(kGraphicsDynamicReflections + " 1")
gIniFile.writeFile(gFilenameAndPath)
else:
@@ -120,9 +122,9 @@ def ReadIni():
ConstructFilenameAndPath()
gIniFile.writeFile(gFilenameAndPath)
-def SetGraphicsOptions(width, heigth, colordepth, windowed, texquality, aaLevel, anisoLevel, qualityLevel, useShadows, vsync, shadowqual):
+def SetGraphicsOptions(width, heigth, colordepth, windowed, texquality, aaLevel, anisoLevel, qualityLevel, useShadows, vsync, shadowqual, dynRefl):
if gIniFile:
- paramList = [width, heigth, colordepth, windowed, texquality, aaLevel, anisoLevel, qualityLevel, useShadows, vsync, shadowqual]
+ paramList = [width, heigth, colordepth, windowed, texquality, aaLevel, anisoLevel, qualityLevel, useShadows, vsync, shadowqual, dynRefl]
for idx in range(len(CmdList)):
entry,junk = gIniFile.findByCommand(CmdList[idx])
val = str(paramList[idx])
diff --git a/Scripts/Python/xOptionsMenu.py b/Scripts/Python/xOptionsMenu.py
index bddee491bb..eee1a991f2 100644
--- a/Scripts/Python/xOptionsMenu.py
+++ b/Scripts/Python/xOptionsMenu.py
@@ -82,7 +82,7 @@
AdvGameSettingDlg = ptAttribGUIDialog(10, "The Adv Game Settings dialog")
ResetWarnDlg = ptAttribGUIDialog(11, "The Reset Warning dialog")
ReleaseNotesDlg = ptAttribGUIDialog(12, "Release Notes dialog")
-respDisableItems = ptAttribResponder(13, "resp: Disable Items", ["enableRes", "disableRes", "enableWindow", "disableWindow", "enableEAX", "disableEAX", "enableGamma", "disableGamma"])
+respDisableItems = ptAttribResponder(13, "resp: Disable Items", ["enableRes", "disableRes", "enableWindow", "disableWindow", "enableEAX", "disableEAX", "enableGamma", "disableGamma", "enableDynRefl", "disableDynRefl"])
SupportDlg = ptAttribGUIDialog(14, "Support dialog")
@@ -372,6 +372,8 @@
kVideoResSliderTag = 461
kVideoResTextTag = 473
kVideoVerticalSyncCheckTag = 453
+kVideoDynamicReflectionsCheckTag = 900
+kVideoDynamicReflectionsTextTag = 901
kGSAudioMuteCheckbox = 456
kGSMouseTurnSensSlider = 460
@@ -585,9 +587,7 @@ def OnGUINotify(self,id,control,event):
###############################################
if id == OptionsMenuDlg.id:
if event == kShowHide:
- if control.isEnabled():
- textField = ptGUIControlTextBox(OptionsMenuDlg.dialog.getControlFromTag(kOptionsOkText))
- textField.setString(PtGetLocalizedString("OptionsMenu.Main.Resume"))
+ pass
elif event == kAction or event == kValueChanged:
# test to see which control had the event
@@ -667,12 +667,6 @@ def OnGUINotify(self,id,control,event):
self._releaseNotesCtrl.lock()
elif event == kShowHide:
if control.isEnabled():
- # buttons localized
- textField = ptGUIControlTextBox(ReleaseNotesDlg.dialog.getControlFromTag(kRNOkText))
- textField.setString(PtGetLocalizedString("OptionsMenu.Main.Resume"))
- textField = ptGUIControlTextBox(ReleaseNotesDlg.dialog.getControlFromTag(kRNGoBackText))
- textField.setString(PtGetLocalizedString("OptionsMenu.Main.GoBack"))
-
# BOOM if you do this on dialog load. Probably due to how early it happens
# in the init process. Do it now.
if not self._releaseNotesCtrl.getBufferSize():
@@ -702,41 +696,8 @@ def OnGUINotify(self,id,control,event):
if event == kDialogLoaded:
pass
elif event == kShowHide:
- # reset the edit text lines
if control.isEnabled():
- # localize the strings
- textField = ptGUIControlTextBox(KeyMapDlg.dialog.getControlFromTag(kKMTextLine1))
- textField.setString(PtGetLocalizedString("OptionsMenu.KeyCommands.MoveForward"))
- textField = ptGUIControlTextBox(KeyMapDlg.dialog.getControlFromTag(kKMTextLine2))
- textField.setString(PtGetLocalizedString("OptionsMenu.KeyCommands.MoveBackward"))
- textField = ptGUIControlTextBox(KeyMapDlg.dialog.getControlFromTag(kKMTextLine3))
- textField.setString(PtGetLocalizedString("OptionsMenu.KeyCommands.RotateLeft"))
- textField = ptGUIControlTextBox(KeyMapDlg.dialog.getControlFromTag(kKMTextLine4))
- textField.setString(PtGetLocalizedString("OptionsMenu.KeyCommands.RotateRight"))
- textField = ptGUIControlTextBox(KeyMapDlg.dialog.getControlFromTag(kKMTextLine5))
- textField.setString(PtGetLocalizedString("OptionsMenu.KeyCommands.Jump"))
- textField = ptGUIControlTextBox(KeyMapDlg.dialog.getControlFromTag(kKMTextLine6))
- textField.setString(PtGetLocalizedString("OptionsMenu.KeyCommands.StrafeLeft"))
- textField = ptGUIControlTextBox(KeyMapDlg.dialog.getControlFromTag(kKMTextLine7))
- textField.setString(PtGetLocalizedString("OptionsMenu.KeyCommands.StrafeRight"))
- textField = ptGUIControlTextBox(KeyMapDlg.dialog.getControlFromTag(kKMTextLine8))
- textField.setString(PtGetLocalizedString("OptionsMenu.KeyCommands.ExitMode"))
- textField = ptGUIControlTextBox(KeyMapDlg.dialog.getControlFromTag(kKMTextLine9))
- textField.setString(PtGetLocalizedString("OptionsMenu.KeyCommands.FirstPerson"))
-
- # buttons localized
- textField = ptGUIControlTextBox(KeyMapDlg.dialog.getControlFromTag(kOptionsOkText))
- textField.setString(PtGetLocalizedString("OptionsMenu.Main.Resume"))
- textField = ptGUIControlTextBox(KeyMapDlg.dialog.getControlFromTag(kOptionsDefaultsText))
- textField.setString(PtGetLocalizedString("OptionsMenu.Main.Defaults"))
- textField = ptGUIControlTextBox(KeyMapDlg.dialog.getControlFromTag(kOptionsGoBackText))
- textField.setString(PtGetLocalizedString("OptionsMenu.Main.GoBack"))
- self.IShowMappedKeys(control,gKM1ControlCodesRow1,gKM1ControlCodesRow2)
- # read the ini file in
- # xIniInput.ReadIni()
- else:
- # xIniInput.WriteIni()
- pass
+ self.IShowMappedKeys(control, gKM1ControlCodesRow1, gKM1ControlCodesRow2)
elif event == kAction or event == kValueChanged:
kmID = control.getTagID()
if kmID == kKMOkBtn:
@@ -843,31 +804,6 @@ def OnGUINotify(self,id,control,event):
elif event == kShowHide:
if control.isEnabled():
self.IRefreshAdvSettings()
-
- # localize the strings
- textField = ptGUIControlTextBox(AdvGameSettingDlg.dialog.getControlFromTag(kAGSAdvanceHeader))
- textField.setString(PtGetLocalizedString("OptionsMenu.GameSettings.Advanced"))
- textField = ptGUIControlTextBox(AdvGameSettingDlg.dialog.getControlFromTag(kAGSQuickerCameraText))
- textField.setString(PtGetLocalizedString("OptionsMenu.GameSettings.SmootherCamera"))
- textField = ptGUIControlTextBox(AdvGameSettingDlg.dialog.getControlFromTag(kAGSMouseInvert))
- textField.setString(PtGetLocalizedString("OptionsMenu.GameSettings.InvertMouse"))
- textField = ptGUIControlTextBox(AdvGameSettingDlg.dialog.getControlFromTag(kAGSWalkAndPan))
- textField.setString(PtGetLocalizedString("OptionsMenu.GameSettings.WalkAndPan"))
- textField = ptGUIControlTextBox(AdvGameSettingDlg.dialog.getControlFromTag(kAGSStayInFirstPerson))
- textField.setString(PtGetLocalizedString("OptionsMenu.GameSettings.StayInFP"))
- textField = ptGUIControlTextBox(AdvGameSettingDlg.dialog.getControlFromTag(kAGSClickToTurn))
- textField.setString(PtGetLocalizedString("OptionsMenu.GameSettings.ClickToTurn"))
- textField = ptGUIControlTextBox(AdvGameSettingDlg.dialog.getControlFromTag(kAGSMouseTurn))
- textField.setString(PtGetLocalizedString("OptionsMenu.GameSettings.MouseTurn"))
-
- # buttons localized
- textField = ptGUIControlTextBox(AdvGameSettingDlg.dialog.getControlFromTag(kOptionsGoBackText))
- textField.setString(PtGetLocalizedString("OptionsMenu.Main.GoBack"))
- textField = ptGUIControlTextBox(AdvGameSettingDlg.dialog.getControlFromTag(kOptionsOkText))
- textField.setString(PtGetLocalizedString("OptionsMenu.Main.Resume"))
- textField = ptGUIControlTextBox(AdvGameSettingDlg.dialog.getControlFromTag(kOptionsDefaultsText))
- textField.setString(PtGetLocalizedString("OptionsMenu.Main.Defaults"))
-
elif event == kAction or event == kValueChanged:
gsID = control.getTagID()
PtDebugPrint("gsID = " + str(gsID))
@@ -964,14 +900,7 @@ def OnGUINotify(self,id,control,event):
##
###############################################
elif id == CalibrateDlg.id:
- if event == kDialogLoaded:
- textField = ptGUIControlTextBox(CalibrateDlg.dialog.getControlFromTag(kCalMessageText))
- textField.setString(PtGetLocalizedString("OptionsMenu.Messages.Calibration"))
- elif event == kShowHide:
- if control.isEnabled():
- textField = ptGUIControlTextBox(CalibrateDlg.dialog.getControlFromTag(kCalMessageText))
- textField.setString(PtGetLocalizedString("OptionsMenu.Messages.Calibration"))
- elif event == kAction or event == kValueChanged:
+ if event == kAction or event == kValueChanged:
cbID = control.getTagID()
if cbID == kClickOnMeBtn:
CalibrateDlg.dialog.hide()
@@ -1072,14 +1001,6 @@ def OnGUINotify(self,id,control,event):
if control.isEnabled():
self.IRefreshHelpSettings()
- # buttons localized
- textField = ptGUIControlTextBox(NavigationDlg.dialog.getControlFromTag(kOptionsGoBackText))
- textField.setString(PtGetLocalizedString("OptionsMenu.Main.GoBack"))
- textField = ptGUIControlTextBox(NavigationDlg.dialog.getControlFromTag(kOptionsOkText))
- textField.setString(PtGetLocalizedString("OptionsMenu.Main.Resume"))
- textField = ptGUIControlTextBox(NavigationDlg.dialog.getControlFromTag(kGSAdvancedBtnText))
- textField.setString(PtGetLocalizedString("OptionsMenu.Main.Advanced"))
-
elif event == kAction or event == kValueChanged:
NavigationID = control.getTagID()
PtDebugPrint("NavigationID = ", NavigationID)
@@ -1124,16 +1045,6 @@ def OnGUINotify(self,id,control,event):
if event == kShowHide:
if control.isEnabled():
self.InitVideoControlsGUI()
-
- # buttons localized
- # Temporary HACK - These controls lack TagIDs in the 902 PRPs, so we're going to call them up by index instead.
- textField = ptGUIControlTextBox(GraphicsSettingsDlg.dialog.getControlFromIndex(3)) # (kOptionsGoBackText) GSGoBackBtnText_5
- textField.setString(PtGetLocalizedString("OptionsMenu.Main.GoBack"))
- textField = ptGUIControlTextBox(GraphicsSettingsDlg.dialog.getControlFromIndex(4)) # (kOptionsOkText) GSOkBtnText_6
- textField.setString(PtGetLocalizedString("OptionsMenu.Main.Resume"))
- textField = ptGUIControlTextBox(GraphicsSettingsDlg.dialog.getControlFromIndex(6)) # (kOptionsDefaultsText) GSDefaultsBtnText_2
- textField.setString(PtGetLocalizedString("OptionsMenu.Main.Defaults"))
-
self.restartWarn = 0
elif (event == kAction or event == kValueChanged):
@@ -1253,30 +1164,6 @@ def OnGUINotify(self,id,control,event):
elif event == kShowHide:
# reset the edit text lines
if control.isEnabled():
- # localize the strings
- textField = ptGUIControlTextBox(AudioSettingsDlg.dialog.getControlFromTag(kGSVolumeHeader))
- textField.setString(PtGetLocalizedString("OptionsMenu.Main.AudioSettings"))
- textField = ptGUIControlTextBox(AudioSettingsDlg.dialog.getControlFromTag(kGSVolSoundFXText))
- textField.setString(PtGetLocalizedString("OptionsMenu.GameSettings.SoundFX"))
- textField = ptGUIControlTextBox(AudioSettingsDlg.dialog.getControlFromTag(kGSVolMusicText))
- textField.setString(PtGetLocalizedString("OptionsMenu.GameSettings.Music"))
- textField = ptGUIControlTextBox(AudioSettingsDlg.dialog.getControlFromTag(kGSMyVoiceHeader))
- textField.setString(PtGetLocalizedString("OptionsMenu.GameSettings.MyVoice"))
- textField = ptGUIControlTextBox(AudioSettingsDlg.dialog.getControlFromTag(kGSVolAmbientText))
- textField.setString(PtGetLocalizedString("OptionsMenu.GameSettings.Ambient"))
- textField = ptGUIControlTextBox(AudioSettingsDlg.dialog.getControlFromTag(kGSVoiceHeader))
- textField.setString(PtGetLocalizedString("OptionsMenu.GameSettings.OtherVoice"))
- textField = ptGUIControlTextBox(AudioSettingsDlg.dialog.getControlFromTag(kGSVolMuteText))
- textField.setString(PtGetLocalizedString("OptionsMenu.GameSettings.Mute"))
-
- # buttons localized
- textField = ptGUIControlTextBox(AudioSettingsDlg.dialog.getControlFromTag(kOptionsGoBackText))
- textField.setString(PtGetLocalizedString("OptionsMenu.Main.GoBack"))
- textField = ptGUIControlTextBox(AudioSettingsDlg.dialog.getControlFromTag(kOptionsOkText))
- textField.setString(PtGetLocalizedString("OptionsMenu.Main.Resume"))
- textField = ptGUIControlTextBox(AudioSettingsDlg.dialog.getControlFromTag(kOptionsDefaultsText))
- textField.setString(PtGetLocalizedString("OptionsMenu.Main.Defaults"))
-
self.restartAudio = 0
else:
@@ -1568,6 +1455,19 @@ def InitVideoControlsGUI(self):
else:
videoField.setChecked(0)
+ dynReflCB = GraphicsSettingsDlg.dialog.getControlModFromTag(kVideoDynamicReflectionsCheckTag)
+ dynReflTB = GraphicsSettingsDlg.dialog.getControlModFromTag(kVideoDynamicReflectionsTextTag)
+ if PtSupportsPlanarReflections():
+ respDisableItems.run(self.key, state="enableDynRefl")
+ dynReflCB.setChecked(bool(opts[xIniDisplay.kGraphicsDynamicReflections]))
+ dynReflCB.enable()
+ dynReflTB.setForeColor(ptColor().white())
+ else:
+ respDisableItems.run(self.key, state="disableDynRefl")
+ dynReflCB.setChecked(False)
+ dynReflCB.disable()
+ dynReflTB.setForeColor(ptColor(0.839, 0.785, 0.695, 1))
+
# video res stuff
vidRes = str(opts[xIniDisplay.kGraphicsWidth]) + "x" + str(opts[xIniDisplay.kGraphicsHeight])
videoResField = ptGUIControlTextBox(GraphicsSettingsDlg.dialog.getControlFromTag(kVideoResTextTag))
@@ -1685,7 +1585,9 @@ def WriteVideoControls(self, setMode = 0):
gammaField = ptGUIControlKnob(GraphicsSettingsDlg.dialog.getControlFromTag(kGSDisplayGammaSlider))
gamma = gammaField.getValue()
- xIniDisplay.SetGraphicsOptions(width, height, colordepth, windowed, tex_quality, antialias, aniso, quality, shadowsstr, vsyncstr, shadow_quality)
+ dynRefl = int(GraphicsSettingsDlg.dialog.getControlModFromTag(kVideoDynamicReflectionsCheckTag).isChecked())
+
+ xIniDisplay.SetGraphicsOptions(width, height, colordepth, windowed, tex_quality, antialias, aniso, quality, shadowsstr, vsyncstr, shadow_quality, dynRefl)
xIniDisplay.WriteIni()
self.setNewChronicleVar("gamma", gamma)
@@ -1694,6 +1596,7 @@ def WriteVideoControls(self, setMode = 0):
PtDebugPrint("SETTING GAMMA")
PtSetGamma2(gamma)
PtSetShadowVisDistance(shadow_quality)
+ PtEnablePlanarReflections(dynRefl)
if shadows:
PtEnableShadows()
diff --git a/Sources/Plasma/Apps/plClient/plClient.cpp b/Sources/Plasma/Apps/plClient/plClient.cpp
index 2ef6ae8a38..7b253b1e7b 100644
--- a/Sources/Plasma/Apps/plClient/plClient.cpp
+++ b/Sources/Plasma/Apps/plClient/plClient.cpp
@@ -495,19 +495,17 @@ bool plClient::InitPipeline(hsWindowHndl display, uint32_t devType)
}
plPipeline *pipe = ICreatePipeline(display, fWindowHndl, &dmr);
- if (pipe->GetErrorString() != nullptr)
- {
+ if (!pipe->GetErrorString().empty()) {
ISetGraphicsDefaults();
#ifdef PLASMA_EXTERNAL_RELEASE
hsMessageBox(ST_LITERAL("There was an error initializing the video card.\nSetting defaults."), ST_LITERAL("Error"), hsMessageBoxNormal);
#else
- hsMessageBox(ST::string(pipe->GetErrorString()), ST_LITERAL("Error creating pipeline"), hsMessageBoxNormal);
+ hsMessageBox(pipe->GetErrorString(), ST_LITERAL("Error creating pipeline"), hsMessageBoxNormal);
#endif
delete pipe;
devSel.GetDefault(&dmr);
pipe = ICreatePipeline(display, fWindowHndl, &dmr);
- if (pipe->GetErrorString() != nullptr)
- {
+ if (!pipe->GetErrorString().empty()) {
// not much else we can do
return true;
}
@@ -1617,7 +1615,7 @@ bool plClient::IUpdate()
plgDispatch::MsgSend(eval);
plProfile_EndTiming(EvalMsg);
- const char *xFormLap1 = "Main";
+ const ST::string xFormLap1 = ST_LITERAL("Main");
plProfile_BeginLap(TransformMsg, xFormLap1);
plTransformMsg* xform = new plTransformMsg(nullptr, nullptr, nullptr, nullptr);
plgDispatch::MsgSend(xform);
@@ -1635,7 +1633,7 @@ bool plClient::IUpdate()
// At this point, we just register for a plDelayedTransformMsg when dirtied.
if (!plCoordinateInterface::GetDelayedTransformsEnabled())
{
- const char *xFormLap2 = "Simulation";
+ const ST::string xFormLap2 = ST_LITERAL("Simulation");
plProfile_BeginLap(TransformMsg, xFormLap2);
xform = new plTransformMsg(nullptr, nullptr, nullptr, nullptr);
plgDispatch::MsgSend(xform);
@@ -1643,7 +1641,7 @@ bool plClient::IUpdate()
}
else
{
- const char *xFormLap3 = "Delayed";
+ const ST::string xFormLap3 = ST_LITERAL("Delayed");
plProfile_BeginLap(TransformMsg, xFormLap3);
xform = new plDelayedTransformMsg(nullptr, nullptr, nullptr, nullptr);
plgDispatch::MsgSend(xform);
diff --git a/Sources/Plasma/Apps/plCrashHandler/CMakeLists.txt b/Sources/Plasma/Apps/plCrashHandler/CMakeLists.txt
index f86792d561..aca228ecd1 100644
--- a/Sources/Plasma/Apps/plCrashHandler/CMakeLists.txt
+++ b/Sources/Plasma/Apps/plCrashHandler/CMakeLists.txt
@@ -14,10 +14,12 @@ target_link_libraries(
CoreLib
plClipboard
plMessageBox
+ plStatusLog
+ plWinDpi
pfCrashHandler
- $<$:Comctl32>
- $<$:UxTheme>
+ $<$:comctl32>
+ $<$:uxtheme>
)
target_compile_definitions(
plCrashHandler
@@ -25,6 +27,10 @@ target_compile_definitions(
$<$:UNICODE>
)
+if(MINGW)
+ target_link_options(plCrashHandler PRIVATE -municode)
+endif()
+
source_group("Source Files" FILES ${plCrashHandler_SOURCES})
source_group("Resource Files" FILES ${plCrashHandler_RESOURCES})
diff --git a/Sources/Plasma/Apps/plCrashHandler/plCrashHandler.rc b/Sources/Plasma/Apps/plCrashHandler/plCrashHandler.rc
index 519ed2e314..1c418887e3 100644
--- a/Sources/Plasma/Apps/plCrashHandler/plCrashHandler.rc
+++ b/Sources/Plasma/Apps/plCrashHandler/plCrashHandler.rc
@@ -58,7 +58,7 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER |
EXSTYLE WS_EX_APPWINDOW
FONT 8, "MS Shell Dlg", 400, 0, 0x0
BEGIN
- CONTROL IDB_BITMAP,IDB_BITMAP,"Static",SS_BITMAP | SS_SUNKEN,7,7,286,36
+ CONTROL IDB_BITMAP,IDB_BITMAP,"Static",SS_BITMAP | SS_REALSIZECONTROL,7,7,291,36
LTEXT "Unfortunately, URU has experienced a serious error and had to exit. Please report the following information to the developers.",IDC_STATUS_TEXT,19,57,266,17
GROUPBOX "",IDC_STATIC,7,46,291,49
RTEXT "Product String",IDC_PRODUCTSTRING,19,85,272,8
diff --git a/Sources/Plasma/Apps/plCrashHandler/winmain.cpp b/Sources/Plasma/Apps/plCrashHandler/winmain.cpp
index 0f4f4f28ed..e6cbc9e6d3 100644
--- a/Sources/Plasma/Apps/plCrashHandler/winmain.cpp
+++ b/Sources/Plasma/Apps/plCrashHandler/winmain.cpp
@@ -50,16 +50,18 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include
#include
-#include
+#include
#include
-#include
+#include
#include
-#include
+#include
#include "resource.h"
#include "plClipboard/plClipboard.h"
#include "plMessageBox/hsMessageBox.h"
+#include "plStatusLog/plStatusLog.h"
+#include "plWinDpi/plWinDpi.h"
#include "pfCrashHandler/plCrashSrv.h"
@@ -363,6 +365,9 @@ static void IShowCrashDialog(HINSTANCE hInstance)
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow)
{
+ plStatusLog::fLoggingOff = true;
+ plWinDpi::Instance();
+
enum { kArgCrashFile, kArgForceShow };
const plCmdArgDef cmdLineArgs[] = {
{ kCmdArgRequired | kCmdTypeString, "file", kArgCrashFile },
diff --git a/Sources/Plasma/CoreLib/hsMatrix44.cpp b/Sources/Plasma/CoreLib/hsMatrix44.cpp
index 848fb931b6..c8e500a68a 100644
--- a/Sources/Plasma/CoreLib/hsMatrix44.cpp
+++ b/Sources/Plasma/CoreLib/hsMatrix44.cpp
@@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsStream.h"
#include
+#include
#ifdef HS_BUILD_FOR_APPLE
#include
diff --git a/Sources/Plasma/CoreLib/hsRefCnt.h b/Sources/Plasma/CoreLib/hsRefCnt.h
index 7a656796cc..2f0a2d9bde 100644
--- a/Sources/Plasma/CoreLib/hsRefCnt.h
+++ b/Sources/Plasma/CoreLib/hsRefCnt.h
@@ -53,9 +53,9 @@ class hsRefCnt {
hsRefCnt(int initRefs = 1);
virtual ~hsRefCnt();
- inline int RefCnt() const { return fRefCnt; }
- void UnRef(const char* tag = nullptr);
- void Ref(const char* tag = nullptr);
+ virtual int RefCnt() const { return fRefCnt; }
+ virtual void UnRef(const char* tag = nullptr);
+ virtual void Ref(const char* tag = nullptr);
// Useless, but left here for debugging compatibility with AtomicRef
void TransferRef(const char* oldTag, const char* newTag);
diff --git a/Sources/Plasma/CoreLib/hsThread_Unix.cpp b/Sources/Plasma/CoreLib/hsThread_Unix.cpp
index e704f3574c..52159a0831 100644
--- a/Sources/Plasma/CoreLib/hsThread_Unix.cpp
+++ b/Sources/Plasma/CoreLib/hsThread_Unix.cpp
@@ -45,6 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include
#include
#include
+#include
#define NO_POSIX_CLOCK 1
diff --git a/Sources/Plasma/FeatureLib/pfAnimation/plFollowMod.cpp b/Sources/Plasma/FeatureLib/pfAnimation/plFollowMod.cpp
index f2d5835656..ba6b9c4827 100644
--- a/Sources/Plasma/FeatureLib/pfAnimation/plFollowMod.cpp
+++ b/Sources/Plasma/FeatureLib/pfAnimation/plFollowMod.cpp
@@ -72,11 +72,11 @@ bool plFollowMod::MsgReceive(plMessage* msg)
plRenderMsg* rend = plRenderMsg::ConvertNoRef(msg);
if( rend )
{
- plProfile_BeginLap(FollowMod, this->GetKey()->GetUoid().GetObjectName().c_str());
+ plProfile_BeginLap(FollowMod, this->GetKey()->GetUoid().GetObjectName());
fLeaderL2W = rend->Pipeline()->GetCameraToWorld();
fLeaderW2L = rend->Pipeline()->GetWorldToCamera();
fLeaderSet = true;
- plProfile_EndLap(FollowMod, this->GetKey()->GetUoid().GetObjectName().c_str());
+ plProfile_EndLap(FollowMod, this->GetKey()->GetUoid().GetObjectName());
return true;
}
plListenerMsg* list = plListenerMsg::ConvertNoRef(msg);
diff --git a/Sources/Plasma/FeatureLib/pfAnimation/plLineFollowMod.cpp b/Sources/Plasma/FeatureLib/pfAnimation/plLineFollowMod.cpp
index 4b4b76ea8d..9d66452ad2 100644
--- a/Sources/Plasma/FeatureLib/pfAnimation/plLineFollowMod.cpp
+++ b/Sources/Plasma/FeatureLib/pfAnimation/plLineFollowMod.cpp
@@ -243,11 +243,11 @@ bool plLineFollowMod::MsgReceive(plMessage* msg)
plRenderMsg* rend = plRenderMsg::ConvertNoRef(msg);
if( rend )
{
- plProfile_BeginLap(LineFollow, this->GetKey()->GetUoid().GetObjectName().c_str());
+ plProfile_BeginLap(LineFollow, this->GetKey()->GetUoid().GetObjectName());
hsPoint3 oldPos = fSearchPos;
fSearchPos = rend->Pipeline()->GetViewPositionWorld();
ICheckForPop(oldPos, fSearchPos);
- plProfile_EndLap(LineFollow, this->GetKey()->GetUoid().GetObjectName().c_str());
+ plProfile_EndLap(LineFollow, this->GetKey()->GetUoid().GetObjectName());
return true;
}
plListenerMsg* list = plListenerMsg::ConvertNoRef(msg);
diff --git a/Sources/Plasma/FeatureLib/pfAnimation/plViewFaceModifier.cpp b/Sources/Plasma/FeatureLib/pfAnimation/plViewFaceModifier.cpp
index 9aec6d9eb0..3f892bd773 100644
--- a/Sources/Plasma/FeatureLib/pfAnimation/plViewFaceModifier.cpp
+++ b/Sources/Plasma/FeatureLib/pfAnimation/plViewFaceModifier.cpp
@@ -274,7 +274,7 @@ bool plViewFaceModifier::MsgReceive(plMessage* msg)
if( rend )
{
- plProfile_BeginLap(ViewFace, this->GetKey()->GetUoid().GetObjectName().c_str());
+ plProfile_BeginLap(ViewFace, this->GetKey()->GetUoid().GetObjectName());
if( HasFlag(kFaceCam) )
{
@@ -310,7 +310,7 @@ bool plViewFaceModifier::MsgReceive(plMessage* msg)
IFacePoint(rend->Pipeline(), fFacePoint);
- plProfile_EndLap(ViewFace, this->GetKey()->GetUoid().GetObjectName().c_str());
+ plProfile_EndLap(ViewFace, this->GetKey()->GetUoid().GetObjectName());
return true;
}
plArmatureUpdateMsg* armMsg = plArmatureUpdateMsg::ConvertNoRef(msg);
diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
index 7f3f96dd34..677f57047b 100644
--- a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
+++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
@@ -480,13 +480,12 @@ PF_CONSOLE_CMD( Stats, Show, // Group name, Function name
"Shows or hides a given category of statistics.\n"
"List the valid categories using Stats.ListGroups")
{
- const ST::string& group = numParams > 0 ? params[0] : ST::string();
-
if (numParams > 1) {
- const ST::string& stat = params[1];
- plProfileManagerFull::Instance().ShowLaps(group.c_str(), stat.c_str());
+ plProfileManagerFull::Instance().ShowLaps(params[0], params[1]);
+ } else if (numParams > 0) {
+ plProfileManagerFull::Instance().ShowGroup(params[0]);
} else {
- plProfileManagerFull::Instance().ShowGroup(group.c_str());
+ plProfileManagerFull::Instance().ShowGroup(ST_LITERAL("General"));
}
}
@@ -506,9 +505,7 @@ PF_CONSOLE_CMD(Stats, ShowLaps,
"string group, string stat",
"")
{
- const ST::string& group = params[0];
- const ST::string& stat = params[1];
- plProfileManagerFull::Instance().ShowLaps(group.c_str(), stat.c_str());
+ plProfileManagerFull::Instance().ShowLaps(params[0], params[1]);
}
PF_CONSOLE_CMD(Stats, ListGroups, "", "Prints the names of all the stat groups to the console")
@@ -554,8 +551,7 @@ PF_CONSOLE_CMD(Stats, SetAvgTime, "int ms", "Sets the amount of time stats are a
PF_CONSOLE_CMD(Stats, Graph, "string stat, int min, int max", "Graphs the specified stat")
{
- const ST::string& stat = params[0];
- plProfileManagerFull::Instance().CreateGraph(stat.c_str(), (int)params[1], (int)params[2]);
+ plProfileManagerFull::Instance().CreateGraph(params[0], (int)params[1], (int)params[2]);
}
PF_CONSOLE_CMD(Stats, ShowDetail, "", "Shows the detail stat graph")
@@ -575,36 +571,31 @@ PF_CONSOLE_CMD(Stats, ResetDetailDefaults, "", "Resets the detail graph's defaul
PF_CONSOLE_CMD(Stats, AddDetailVar, "string stat", "Adds the specified var to the detail graph with the default range of 0->100")
{
- const ST::string& stat = params[0];
- plProfileManagerFull::Instance().AddDetailVar(stat.c_str(), 0, 100);
+ plProfileManagerFull::Instance().AddDetailVar(params[0], 0, 100);
}
PF_CONSOLE_CMD(Stats, AddDetailVarWithOffset, "string stat, int offset", "Adds the specified var to the detail graph with a offset and default range\n"
"of 0->(100-offset)")
{
- const ST::string& stat = params[0];
int offset = (int)params[1];
- plProfileManagerFull::Instance().AddDetailVar(stat.c_str(), -offset, 100-offset);
+ plProfileManagerFull::Instance().AddDetailVar(params[0], -offset, 100-offset);
}
PF_CONSOLE_CMD(Stats, AddDetailVarWithRange, "string stat, int min, int max", "Adds the specified var to the detail graph")
{
- const ST::string& stat = params[0];
- plProfileManagerFull::Instance().AddDetailVar(stat.c_str(), (int)params[1], (int)params[2]);
+ plProfileManagerFull::Instance().AddDetailVar(params[0], (int)params[1], (int)params[2]);
}
PF_CONSOLE_CMD(Stats, AddDetailVarWithOffsetAndRange, "string stat, int offset, int min, int max", "Adds the specified var to the detail graph with an\n"
"offset and a range of min->(max-offset)")
{
- const ST::string& stat = params[0];
int offset = (int)params[1];
- plProfileManagerFull::Instance().AddDetailVar(stat.c_str(), (int)params[2]-offset, (int)params[3]-offset);
+ plProfileManagerFull::Instance().AddDetailVar(params[0], (int)params[2]-offset, (int)params[3]-offset);
}
PF_CONSOLE_CMD(Stats, RemoveDetailVar, "string stat", "Removes the specified var from the detail graph")
{
- const ST::string& stat = params[0];
- plProfileManagerFull::Instance().RemoveDetailVar(stat.c_str());
+ plProfileManagerFull::Instance().RemoveDetailVar(params[0]);
}
diff --git a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXDevice.cpp b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXDevice.cpp
index 7d795c863a..0722bfbb4f 100644
--- a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXDevice.cpp
+++ b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXDevice.cpp
@@ -52,8 +52,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plDXVertexShader.h"
#include "plDXPixelShader.h"
+#include
+
//// Macros for D3D error handling
-#define INIT_ERROR_CHECK( cond, errMsg ) if( FAILED( fPipeline->fSettings.fDXError = cond ) ) { return fPipeline->ICreateFail( errMsg ); }
+#define INIT_ERROR_CHECK(cond, errMsg) if (FAILED(fSettings.fDXError = cond)) { return ICreateFail(ST_LITERAL(errMsg)); }
#if 1 // DEBUG
#define STRONG_ERROR_CHECK( cond ) if( FAILED( fPipeline->fSettings.fDXError = cond ) ) { fPipeline->IGetD3DError(); fPipeline->IShowErrorMessage(); }
@@ -189,7 +191,7 @@ void plDXDevice::SetLocalToWorldMatrix(const hsMatrix44& src)
fD3DDevice->SetTransform(D3DTS_WORLD, &mat);
}
-const char* plDXDevice::GetErrorString() const
+ST::string plDXDevice::GetErrorString() const
{
return fPipeline->fSettings.fErrorStr;
}
diff --git a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXDevice.h b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXDevice.h
index ed62c19808..f34354760b 100644
--- a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXDevice.h
+++ b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXDevice.h
@@ -54,6 +54,7 @@ class plDXPipeline;
class plRenderTarget;
struct IDirect3DDevice9;
struct IDirect3DSurface9;
+namespace ST { class string; }
class plDXDevice
{
@@ -98,7 +99,7 @@ class plDXDevice
void SetWorldToCameraMatrix(const hsMatrix44& src);
void SetLocalToWorldMatrix(const hsMatrix44& src);
- const char* GetErrorString() const;
+ ST::string GetErrorString() const;
};
#endif
diff --git a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXDeviceRefs.cpp b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXDeviceRefs.cpp
index 9a2922bf01..a0b7606ba7 100644
--- a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXDeviceRefs.cpp
+++ b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXDeviceRefs.cpp
@@ -144,7 +144,7 @@ void plDXVertexBufferRef::Release()
if (!Volatile())
{
plProfile_DelMem(MemVertex, fCount * fVertexSize);
- PROFILE_POOL_MEM(D3DPOOL_MANAGED, fCount * fVertexSize, false, "VtxBuff");
+ PROFILE_POOL_MEM(D3DPOOL_MANAGED, fCount * fVertexSize, false, ST_LITERAL("VtxBuff"));
plDXPipeline::FreeManagedVertex(fCount * fVertexSize);
}
}
@@ -159,7 +159,7 @@ void plDXIndexBufferRef::Release()
if (fD3DBuffer != nullptr)
{
plProfile_DelMem(MemIndex, fCount * sizeof(uint16_t));
- PROFILE_POOL_MEM(fPoolType, fCount * sizeof(uint16_t), false, "IndexBuff");
+ PROFILE_POOL_MEM(fPoolType, fCount * sizeof(uint16_t), false, ST_LITERAL("IndexBuff"));
ReleaseObject( fD3DBuffer );
}
@@ -221,7 +221,7 @@ void plDXTextureRef::Release()
{
plProfile_DelMem(MemTexture, fDataSize + sizeof(plDXTextureRef));
plProfile_Extern(ManagedMem);
- PROFILE_POOL_MEM(D3DPOOL_MANAGED, fDataSize, false, (fOwner ? fOwner->GetKey() ? fOwner->GetKey()->GetUoid().GetObjectName().c_str() : "(UnknownTexture)" : "(UnknownTexture)"));
+ PROFILE_POOL_MEM(D3DPOOL_MANAGED, fDataSize, false, fOwner && fOwner->GetKey() ? fOwner->GetKey()->GetUoid().GetObjectName() : ST_LITERAL("(UnknownTexture)"));
plDXPipeline::FreeManagedTexture(fDataSize);
fDataSize = 0;
diff --git a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXEnumerate.cpp b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXEnumerate.cpp
index 23b9525667..ca5f504f0a 100644
--- a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXEnumerate.cpp
+++ b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXEnumerate.cpp
@@ -110,15 +110,17 @@ bool hsGDirect3DTnLEnumerate::SelectFromDevMode(const hsG3DDeviceRecord* devRec,
D3DEnum_SelectDefaultDisplay(0);
if( !GetCurrentDisplay() || !GetCurrentRenderer() )
{
- if( !*GetEnumeErrorStr() )
- SetEnumeErrorStr("Error finding device");
+ if (GetEnumeErrorStr().empty()) {
+ fEnumeErrorStr = ST_LITERAL("Error finding device");
+ }
return true;
}
D3DEnum_SelectDefaultMode(width, height, colorDepth);
if( !GetCurrentMode() )
{
- if( !*GetEnumeErrorStr() )
- SetEnumeErrorStr("Error finding mode");
+ if (GetEnumeErrorStr().empty()) {
+ fEnumeErrorStr = ST_LITERAL("Error finding mode");
+ }
return true;
}
@@ -260,8 +262,6 @@ HRESULT hsGDirect3DTnLEnumerate::D3DEnum_SelectDefaultDisplay( DWORD dwFlags )
hsGDirect3DTnLEnumerate::hsGDirect3DTnLEnumerate()
{
- memset( &fEnumeErrorStr[0], 0x00, sizeof(fEnumeErrorStr) );
-
fCurrentDisplay = nullptr; // The selected DD driver
fDisplays.clear(); // List of DD drivers
@@ -269,7 +269,7 @@ hsGDirect3DTnLEnumerate::hsGDirect3DTnLEnumerate()
IDirect3D9* pD3D = hsGDirect3D::GetDirect3D();
if (!pD3D)
{
- strcpy( fEnumeErrorStr, "Cannot load DirectX!" );
+ fEnumeErrorStr = ST_LITERAL("Cannot load DirectX!");
return;
}
@@ -285,8 +285,8 @@ hsGDirect3DTnLEnumerate::hsGDirect3DTnLEnumerate()
pD3D->GetAdapterDisplayMode(iAdapter, &newDriver.fDesktopMode);
newDriver.fAdapterInfo = adapterInfo;
- strncpy(newDriver.fStrName, adapterInfo.Driver, 39);
- strncpy(newDriver.fStrDesc, adapterInfo.Description, 39);
+ newDriver.fStrName = ST::string::from_latin_1(adapterInfo.Driver);
+ newDriver.fStrDesc = ST::string::from_latin_1(adapterInfo.Description);
newDriver.fGuid = adapterInfo.DeviceIdentifier;
newDriver.fMemory = 16 * 1024 * 1024; /// Simulate 16 MB
@@ -307,7 +307,7 @@ void hsGDirect3DTnLEnumerate::IEnumAdapterDevices( IDirect3D9 *pD3D, UINT iAd
// Then we can enum through the modes for each format.
const DWORD numDeviceTypes = 2;
- const TCHAR* strDeviceDescs[] = { "HAL", "REF" };
+ const ST::string strDeviceDescs[] = {ST_LITERAL("HAL"), ST_LITERAL("REF")};
const D3DDEVTYPE deviceTypes[] = { D3DDEVTYPE_HAL, D3DDEVTYPE_REF };
BOOL *formatWorks = new BOOL[kNumDisplayFormats + 1]; // One for each format
@@ -318,7 +318,7 @@ void hsGDirect3DTnLEnumerate::IEnumAdapterDevices( IDirect3D9 *pD3D, UINT iAd
D3DEnum_RendererInfo& deviceInfo = drivInfo->fRenderers.emplace_back();
pD3D->GetDeviceCaps(iAdapter, deviceTypes[iDevice], &deviceInfo.fDDCaps);
- strncpy(deviceInfo.fStrName, strDeviceDescs[iDevice], 39);
+ deviceInfo.fStrName = strDeviceDescs[iDevice];
deviceInfo.fDDType = deviceTypes[iDevice];
deviceInfo.fIsHardware = deviceInfo.fDDCaps.DevCaps & D3DDEVCAPS_HWRASTERIZATION;
@@ -408,7 +408,7 @@ void hsGDirect3DTnLEnumerate::IEnumAdapterDevices( IDirect3D9 *pD3D, UINT iAd
/// Add it to our driver's global mode list
D3DEnum_ModeInfo& modeInfo = drivInfo->fModes.emplace_back();
modeInfo.fDDmode = dispMode;
- sprintf(modeInfo.fStrDesc, TEXT("%ld x %ld x %ld"), dispMode.Width, dispMode.Height, bitDepth);
+ modeInfo.fStrDesc = ST::format("{} x {} x {}", dispMode.Width, dispMode.Height, bitDepth);
modeInfo.fBitDepth = bitDepth;
// Add it to the device
@@ -434,7 +434,7 @@ void hsGDirect3DTnLEnumerate::IEnumAdapterDevices( IDirect3D9 *pD3D, UINT iAd
pModeInfo.fDDmode = dispMode;
pModeInfo.fDDBehavior = behavior[iFormat];
pModeInfo.fBitDepth = bitDepth;
- sprintf(pModeInfo.fStrDesc, TEXT("Windowed"));
+ pModeInfo.fStrDesc = ST_LITERAL("Windowed");
pModeInfo.fWindowed = true;
IFindDepthFormats(pD3D, iAdapter, deviceInfo.fDDType, &pModeInfo);
@@ -556,15 +556,6 @@ VOID hsGDirect3DTnLEnumerate::D3DEnum_FreeResources()
{
}
-//-----------------------------------------------------------------------------
-// Name: SetEnumeErrorStr()
-// Desc:
-//-----------------------------------------------------------------------------
-void hsGDirect3DTnLEnumerate::SetEnumeErrorStr(const char* s)
-{
- hsStrncpy(fEnumeErrorStr, s, 128);
-}
-
//// IGetDXBitDepth //////////////////////////////////////////////////////////
//
// From a D3DFORMAT enumeration, return the bit depth associated with it.
@@ -602,7 +593,7 @@ bool hsG3DDeviceSelector::IGetD3DCardInfo( hsG3DDeviceRecord &record,
void *driverInfo,
void *deviceInfo,
uint32_t *vendorID, uint32_t *deviceID, // Out
- char **driverString, char **descString )
+ ST::string& driverString, ST::string& descString)
{
D3DEnum_DisplayInfo *driverD3DInfo = (D3DEnum_DisplayInfo *)driverInfo;
D3DEnum_RendererInfo *deviceD3DInfo = (D3DEnum_RendererInfo *)deviceInfo;
@@ -613,8 +604,8 @@ bool hsG3DDeviceSelector::IGetD3DCardInfo( hsG3DDeviceRecord &record,
*vendorID = adapterInfo->VendorId;
*deviceID = adapterInfo->DeviceId;
- *driverString = adapterInfo->Driver;
- *descString = adapterInfo->Description;
+ driverString = ST::string::from_latin_1(adapterInfo->Driver);
+ descString = ST::string::from_latin_1(adapterInfo->Description);
return true;
}
@@ -644,15 +635,11 @@ void hsG3DDeviceSelector::ITryDirect3DTnLDriver(D3DEnum_DisplayInfo* drivInfo)
devRec.SetDriverName( drivInfo->fAdapterInfo.Driver );
devRec.SetDriverDesc( drivInfo->fAdapterInfo.Description );
- char buff[ 256 ];
- sprintf( buff, "%d.%02d.%02d.%04d",
- HIWORD( drivInfo->fAdapterInfo.DriverVersion.u.HighPart ),
- LOWORD( drivInfo->fAdapterInfo.DriverVersion.u.HighPart ),
- HIWORD( drivInfo->fAdapterInfo.DriverVersion.u.LowPart ),
- LOWORD( drivInfo->fAdapterInfo.DriverVersion.u.LowPart ) );
-
-
- devRec.SetDriverVersion(buff);
+ devRec.SetDriverVersion(ST::format("{}.{02d}.{02d}.{04d}",
+ HIWORD(drivInfo->fAdapterInfo.DriverVersion.u.HighPart),
+ LOWORD(drivInfo->fAdapterInfo.DriverVersion.u.HighPart),
+ HIWORD(drivInfo->fAdapterInfo.DriverVersion.u.LowPart),
+ LOWORD(drivInfo->fAdapterInfo.DriverVersion.u.LowPart)));
devRec.SetMemoryBytes(drivInfo->fMemory);
diff --git a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXEnumerate.h b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXEnumerate.h
index a372de3bde..3e15d771bf 100644
--- a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXEnumerate.h
+++ b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXEnumerate.h
@@ -42,6 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef hsGDirect3DTnLEnumerate_h
#define hsGDirect3DTnLEnumerate_h
+#include
#include
#include "HeadSpin.h"
@@ -60,9 +61,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
struct D3DEnum_ModeInfo
{
D3DDISPLAYMODE fDDmode;
- CHAR fStrDesc[40];
+ ST::string fStrDesc;
BOOL fWindowed;
- char fBitDepth;
+ uint8_t fBitDepth;
DWORD fDDBehavior;
std::vector fDepthFormats;
std::vector fFSAATypes;
@@ -82,7 +83,7 @@ struct D3DEnum_ModeInfo
struct D3DEnum_RendererInfo
{
D3DDEVTYPE fDDType;
- CHAR fStrName[40];
+ ST::string fStrName;
D3DCAPS9 fDDCaps;
BOOL fCanWindow;
BOOL fCompatibleWithDesktop;
@@ -110,8 +111,8 @@ struct D3DEnum_DisplayInfo
{
GUID fGuid;
- CHAR fStrDesc[40];
- CHAR fStrName[40];
+ ST::string fStrDesc;
+ ST::string fStrName;
unsigned int fMemory;
@@ -136,7 +137,7 @@ class hsG3DDeviceMode;
class hsGDirect3DTnLEnumerate
{
protected:
- char fEnumeErrorStr[128]; // Driver & device enumeration error message buffer
+ ST::string fEnumeErrorStr; // Driver & device enumeration error message buffer
std::vector fDisplays;
@@ -160,8 +161,6 @@ class hsGDirect3DTnLEnumerate
VOID D3DEnum_FreeResources();
- char* GetErrorString() { return (fEnumeErrorStr[0] ? fEnumeErrorStr : nullptr); }
-
bool SelectFromDevMode(const hsG3DDeviceRecord* devRec, const hsG3DDeviceMode* devMode);
HRESULT D3DEnum_SelectDefaultMode(int width, int height, int depth);
HRESULT D3DEnum_SelectDefaultDisplay( DWORD dwFlags );
@@ -177,8 +176,7 @@ class hsGDirect3DTnLEnumerate
void SetCurrentRenderer(D3DEnum_RendererInfo* d) { hsAssert(GetCurrentDisplay(), "Set Display first"); GetCurrentDisplay()->fCurrentRenderer = d; }
void SetCurrentMode(D3DEnum_ModeInfo* m) { hsAssert(GetCurrentDisplay(), "Set Display first"); GetCurrentDisplay()->fCurrentMode = m; }
- char* GetEnumeErrorStr() { return fEnumeErrorStr; }
- void SetEnumeErrorStr(const char* s);
+ ST::string GetEnumeErrorStr() const { return fEnumeErrorStr; }
};
diff --git a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXPipeline.cpp b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXPipeline.cpp
index 787b82f9d8..ded0d4ffa9 100644
--- a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXPipeline.cpp
+++ b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXPipeline.cpp
@@ -232,7 +232,7 @@ inline DWORD F2DW( FLOAT f )
}
//// Macros for D3D error handling
-#define INIT_ERROR_CHECK( cond, errMsg ) if( FAILED( fSettings.fDXError = cond ) ) { return ICreateFail( errMsg ); }
+#define INIT_ERROR_CHECK(cond, errMsg) if (FAILED(fSettings.fDXError = cond)) { return ICreateFail(ST_LITERAL(errMsg)); }
#if 1 // DEBUG
#define STRONG_ERROR_CHECK( cond ) if( FAILED( fSettings.fDXError = cond ) ) { IGetD3DError(); IShowErrorMessage(); }
@@ -337,7 +337,7 @@ void D3DSURF_MEMNEW(IDirect3DSurface9* surf)
{
D3DSURFACE_DESC info;
surf->GetDesc( &info );
- PROFILE_POOL_MEM(D3DPOOL_DEFAULT, info.Width * info.Height * plDXPipeline::GetDXBitDepth(info.Format) / 8 + sizeof(IDirect3DSurface9), true, "D3DSurface");
+ PROFILE_POOL_MEM(D3DPOOL_DEFAULT, info.Width * info.Height * plDXPipeline::GetDXBitDepth(info.Format) / 8 + sizeof(IDirect3DSurface9), true, ST_LITERAL("D3DSurface"));
plProfile_NewMem(MemPipelineSurfaces, info.Width * info.Height * plDXPipeline::GetDXBitDepth(info.Format) / 8 + sizeof(IDirect3DSurface9));
}
}
@@ -381,7 +381,7 @@ void D3DSURF_MEMDEL(IDirect3DSurface9* surf)
{
D3DSURFACE_DESC info;
surf->GetDesc( &info );
- PROFILE_POOL_MEM(D3DPOOL_DEFAULT, info.Width * info.Height * plDXPipeline::GetDXBitDepth(info.Format) / 8 + sizeof(IDirect3DSurface9), false, "D3DSurface");
+ PROFILE_POOL_MEM(D3DPOOL_DEFAULT, info.Width * info.Height * plDXPipeline::GetDXBitDepth(info.Format) / 8 + sizeof(IDirect3DSurface9), false, ST_LITERAL("D3DSurface"));
plProfile_DelMem(MemPipelineSurfaces, info.Width * info.Height * plDXPipeline::GetDXBitDepth(info.Format) / 8 + sizeof(IDirect3DSurface9));
}
}
@@ -428,7 +428,7 @@ void D3DSURF_MEMDEL(IDirect3DCubeTexture9* cTex) {}
#endif // PLASMA_EXTERNAL_RELEASE
#ifndef PLASMA_EXTERNAL_RELEASE
-void plDXPipeline::ProfilePoolMem(D3DPOOL poolType, uint32_t size, bool add, const char *id)
+void plDXPipeline::ProfilePoolMem(D3DPOOL poolType, uint32_t size, bool add, const ST::string& id)
{
switch( poolType )
{
@@ -550,15 +550,14 @@ plDXPipeline::plDXPipeline( hsWinRef hWnd, const hsG3DDeviceModeRecord *devModeR
fSettings.fNumAASamples = devMode->GetFSAAType( devRec->GetAASetting() - 1 );
hsGDirect3DTnLEnumerate& d3dEnum = hsGDirect3D::EnumerateTnL();
- if( d3dEnum.GetEnumeErrorStr()[ 0 ] )
- {
- IShowErrorMessage( (char *)d3dEnum.GetEnumeErrorStr() );
+ if (!d3dEnum.GetEnumeErrorStr().empty()) {
+ IShowErrorMessage(d3dEnum.GetEnumeErrorStr());
return;
}
if( d3dEnum.SelectFromDevMode(devRec, devMode) )
{
- IShowErrorMessage( (char *)d3dEnum.GetEnumeErrorStr() );
+ IShowErrorMessage(d3dEnum.GetEnumeErrorStr());
return;
}
@@ -591,7 +590,7 @@ plDXPipeline::plDXPipeline( hsWinRef hWnd, const hsG3DDeviceModeRecord *devModeR
// Go create surfaces and DX-dependent objects
if( ICreateDeviceObjects() )
{
- IShowErrorMessage( "Cannot create Direct3D device" );
+ IShowErrorMessage(ST_LITERAL("Cannot create Direct3D device"));
return;
}
@@ -715,7 +714,7 @@ void plDXGeneralSettings::Reset()
fIsIntel = false;
fDXError = D3D_OK;
- memset( fErrorStr, 0, sizeof( fErrorStr ) );
+ fErrorStr.clear();
fCurrFVFFormat = 0;
fCurrVertexShader = nullptr;
@@ -1151,8 +1150,8 @@ void plDXPipeline::ISetCurrentDisplay( D3DEnum_DisplayInfo *driv )
fCurrentDisplay = new D3DEnum_DisplayInfo;
fCurrentDisplay->fGuid = driv->fGuid;
- hsStrncpy( fCurrentDisplay->fStrDesc, driv->fStrDesc, 40 );
- hsStrncpy( fCurrentDisplay->fStrName, driv->fStrName, 40 );
+ fCurrentDisplay->fStrDesc = driv->fStrDesc;
+ fCurrentDisplay->fStrName = driv->fStrName;
fCurrentDisplay->fDesktopMode = driv->fDesktopMode;
fCurrentDisplay->fAdapterInfo = driv->fAdapterInfo;
@@ -1185,7 +1184,7 @@ void plDXPipeline::ISetCurrentRenderer( D3DEnum_RendererInfo *dev )
delete fCurrentRenderer;
fCurrentRenderer = new D3DEnum_RendererInfo;
- hsStrncpy( fCurrentRenderer->fStrName, dev->fStrName, 40 );
+ fCurrentRenderer->fStrName = dev->fStrName;
fCurrentRenderer->fDDCaps = dev->fDDCaps;
fCurrentRenderer->fDDType = dev->fDDType;
@@ -1209,7 +1208,7 @@ void plDXPipeline::ISetCurrentRenderer( D3DEnum_RendererInfo *dev )
currMode.fDepthFormats = mode.fDepthFormats;
currMode.fFSAATypes = mode.fFSAATypes;
memcpy(&currMode.fDDmode, &mode.fDDmode, sizeof(D3DDISPLAYMODE));
- strcpy(currMode.fStrDesc, mode.fStrDesc);
+ currMode.fStrDesc = mode.fStrDesc;
currMode.fWindowed = mode.fWindowed;
fCurrentRenderer->fModes.emplace_back(currMode);
@@ -1305,13 +1304,10 @@ bool plDXPipeline::ICreateDevice(bool windowed)
/// First, create the D3D Device object
D3DPRESENT_PARAMETERS params;
D3DDISPLAYMODE dispMode;
-#ifdef DBG_WRITE_FORMATS
- char msg[ 256 ];
-#endif // DBG_WRITE_FORMATS
IDirect3D9* d3d = hsGDirect3D::GetDirect3D();
if (!d3d)
- return ICreateFail("Failed to get Direct3D Object");
+ return ICreateFail(ST_LITERAL("Failed to get Direct3D Object"));
INIT_ERROR_CHECK( d3d->GetAdapterDisplayMode( fCurrentAdapter, &dispMode ),
"Cannot get desktop display mode" );
@@ -1351,8 +1347,7 @@ bool plDXPipeline::ICreateDevice(bool windowed)
#ifdef DBG_WRITE_FORMATS
for (D3DFORMAT fmt : fCurrentMode->fDepthFormats)
{
- sprintf(msg, "-- Valid depth buffer format: %s", IGetDXFormatName(fmt));
- hsDebugMessage( msg, 0 );
+ hsDebugMessage(ST::format("-- Valid depth buffer format: {}", IGetDXFormatName(fmt)).c_str(), 0);
}
#endif
@@ -1375,7 +1370,7 @@ bool plDXPipeline::ICreateDevice(bool windowed)
params.MultiSampleType = D3DMULTISAMPLE_NONE;
if( !IFindDepthFormat(params) )
// Okay, we're screwed here, we might as well bail.
- return ICreateFail( "Can't find a Depth Buffer format" );
+ return ICreateFail(ST_LITERAL("Can't find a Depth Buffer format"));
}
/// TEMP HACK--if we're running 16-bit z-buffer or below, use our z-bias (go figure, it works better
@@ -1386,15 +1381,13 @@ bool plDXPipeline::ICreateDevice(bool windowed)
fSettings.fD3DCaps &= ~kCapsZBias;
#ifdef DBG_WRITE_FORMATS
- sprintf( msg, "-- Requesting depth buffer format: %s", IGetDXFormatName( params.AutoDepthStencilFormat ) );
- hsDebugMessage( msg, 0 );
+ hsDebugMessage(ST::format("-- Requesting depth buffer format: {}", IGetDXFormatName(params.AutoDepthStencilFormat)).c_str(), 0);
#endif
params.BackBufferFormat = dispMode.Format;
#ifdef DBG_WRITE_FORMATS
- sprintf( msg, "-- Requesting back buffer format: %s", IGetDXFormatName( params.BackBufferFormat ) );
- hsDebugMessage( msg, 0 );
+ hsDebugMessage(ST::format("-- Requesting back buffer format: {}", IGetDXFormatName(params.BackBufferFormat)).c_str(), 0);
#endif
params.hDeviceWindow = fDevice.fHWnd;
@@ -1768,7 +1761,7 @@ void plDXPipeline::IReleaseDynamicBuffers()
// Actually, if it's volatile, it's sharing the global dynamic vertex buff, so we're already
// accounting for the memory when we clear the global buffer.
- //PROFILE_POOL_MEM(D3DPOOL_DEFAULT, vbRef->fCount * vbRef->fVertexSize, false, "VtxBuff");
+ //PROFILE_POOL_MEM(D3DPOOL_DEFAULT, vbRef->fCount * vbRef->fVertexSize, false, ST_LITERAL("VtxBuff"));
}
// 9600 THRASH
else if( fSettings.fBadManaged )
@@ -1787,14 +1780,14 @@ void plDXPipeline::IReleaseDynamicBuffers()
{
iRef->fD3DBuffer->Release();
iRef->fD3DBuffer = nullptr;
- PROFILE_POOL_MEM(iRef->fPoolType, iRef->fCount * sizeof(uint16_t), false, "IndexBuff");
+ PROFILE_POOL_MEM(iRef->fPoolType, iRef->fCount * sizeof(uint16_t), false, ST_LITERAL("IndexBuff"));
}
iRef = iRef->GetNext();
}
if (fDynVtxBuff)
{
ReleaseObject(fDynVtxBuff);
- PROFILE_POOL_MEM(D3DPOOL_DEFAULT, fDynVtxSize, false, "DynVtxBuff");
+ PROFILE_POOL_MEM(D3DPOOL_DEFAULT, fDynVtxSize, false, ST_LITERAL("DynVtxBuff"));
fDynVtxBuff = nullptr;
}
@@ -1837,7 +1830,7 @@ void plDXPipeline::ICreateDynamicBuffers()
D3DPOOL poolType = D3DPOOL_DEFAULT;
if( fDynVtxSize )
{
- PROFILE_POOL_MEM(poolType, fDynVtxSize, true, "DynVtxBuff");
+ PROFILE_POOL_MEM(poolType, fDynVtxSize, true, ST_LITERAL("DynVtxBuff"));
if( FAILED( fD3DDevice->CreateVertexBuffer( fDynVtxSize,
usage,
0,
@@ -2253,14 +2246,14 @@ void plDXPipeline::Resize( uint32_t width, uint32_t height )
// Recreate
if( hsGDirect3D::GetDirect3D(true) )
{
- IShowErrorMessage( "Cannot create D3D master object" );
+ IShowErrorMessage(ST_LITERAL("Cannot create D3D master object"));
return;
}
// Go recreate surfaces and DX-dependent objects
if( ICreateDeviceObjects() )
{
- IShowErrorMessage( "Cannot create Direct3D device" );
+ IShowErrorMessage(ST_LITERAL("Cannot create Direct3D device"));
return;
}
@@ -7290,7 +7283,7 @@ IDirect3DTexture9 *plDXPipeline::IMakeD3DTexture( plDXTextureRef *ref, D3DFORM
ref->fMaxWidth, ref->fMaxHeight, ref->fMMLvs, ref->GetFlags() );
return nullptr;
}
- PROFILE_POOL_MEM(poolType, ref->fDataSize, true, (ref->fOwner ? ref->fOwner->GetKey() ? ref->fOwner->GetKey()->GetUoid().GetObjectName().c_str() : "(UnknownTexture)" : "(UnknownTexture)"));
+ PROFILE_POOL_MEM(poolType, ref->fDataSize, true, ref->fOwner && ref->fOwner->GetKey() ? ref->fOwner->GetKey()->GetUoid().GetObjectName() : ST_LITERAL("(UnknownTexture)"));
fTexManaged += ref->fDataSize;
return texPtr;
@@ -7329,7 +7322,7 @@ void plDXPipeline::IFillD3DTexture( plDXTextureRef *ref )
return;
}
- memcpy( (char *)lockInfo.pBits, pTexDat, ref->fLevelSizes[ i ] );
+ memcpy(lockInfo.pBits, pTexDat, ref->fLevelSizes[i]);
pTexDat += ref->fLevelSizes[ i ];
lpDst->UnlockRect( i );
}
@@ -7344,7 +7337,7 @@ IDirect3DCubeTexture9 *plDXPipeline::IMakeD3DCubeTexture( plDXTextureRef *ref,
IDirect3DCubeTexture9 *texPtr = nullptr;
fManagedAlloced = true;
WEAK_ERROR_CHECK(fD3DDevice->CreateCubeTexture( ref->fMaxWidth, ref->fMMLvs, 0, formatType, poolType, &texPtr, nullptr));
- PROFILE_POOL_MEM(poolType, ref->fDataSize, true, (ref->fOwner ? ref->fOwner->GetKey() ? ref->fOwner->GetKey()->GetUoid().GetObjectName().c_str() : "(UnknownTexture)" : "(UnknownTexture)"));
+ PROFILE_POOL_MEM(poolType, ref->fDataSize, true, ref->fOwner && ref->fOwner->GetKey() ? ref->fOwner->GetKey()->GetUoid().GetObjectName() : ST_LITERAL("(UnknownTexture)"));
fTexManaged += ref->fDataSize;
return texPtr;
}
@@ -7371,7 +7364,7 @@ void plDXPipeline::IFillD3DCubeTexture( plDXCubeTextureRef *ref )
D3DLOCKED_RECT lockInfo;
lpDst->LockRect(faces[f], i, &lockInfo, nullptr, 0);
- memcpy( (char *)lockInfo.pBits, pTexDat, ref->fLevelSizes[ i ] );
+ memcpy(lockInfo.pBits, pTexDat, ref->fLevelSizes[i]);
pTexDat += ref->fLevelSizes[ i ];
lpDst->UnlockRect( faces[ f ], i );
}
@@ -8144,7 +8137,7 @@ void plDXPipeline::ICheckStaticVertexBuffer(plDXVertexBufferRef* vRef, plGBuffer
vRef->fD3DBuffer = nullptr;
return;
}
- PROFILE_POOL_MEM(poolType, numVerts * vertSize, true, "VtxBuff");
+ PROFILE_POOL_MEM(poolType, numVerts * vertSize, true, ST_LITERAL("VtxBuff"));
// Record that we've allocated this into managed memory, in case we're
// fighting that NVidia driver bug. Search for OSVERSION for mor info.
@@ -8495,7 +8488,7 @@ void plDXPipeline::ICheckIndexBuffer(plDXIndexBufferRef* iRef)
iRef->fD3DBuffer = nullptr;
return;
}
- PROFILE_POOL_MEM(poolType, sizeof(uint16_t) * iRef->fCount, true, "IndexBuff");
+ PROFILE_POOL_MEM(poolType, sizeof(uint16_t) * iRef->fCount, true, ST_LITERAL("IndexBuff"));
iRef->fPoolType = poolType;
iRef->SetDirty(true);
@@ -9719,7 +9712,7 @@ void plDXPlateManager::ICreateGeometry(plDXPipeline* pipe)
fCreatedSucessfully = false;
return;
}
- PROFILE_POOL_MEM(poolType, 4 * sizeof(plPlateVertex), true, "PlateMgrVtxBuff");
+ PROFILE_POOL_MEM(poolType, 4 * sizeof(plPlateVertex), true, ST_LITERAL("PlateMgrVtxBuff"));
/// Lock the buffer
plPlateVertex *ptr;
@@ -9760,7 +9753,7 @@ void plDXPlateManager::IReleaseGeometry()
if (fVertBuffer)
{
ReleaseObject(fVertBuffer);
- PROFILE_POOL_MEM(D3DPOOL_DEFAULT, 4 * sizeof(plPlateVertex), false, "PlateMgrVtxBuff");
+ PROFILE_POOL_MEM(D3DPOOL_DEFAULT, 4 * sizeof(plPlateVertex), false, ST_LITERAL("PlateMgrVtxBuff"));
fVertBuffer = nullptr;
}
}
@@ -9911,43 +9904,38 @@ void plDXPipeline::IDrawPlate( plPlate *plate )
// IAddErrorMessage ////////////////////////////////////////////////////
// Append the error string to the current error string.
-void plDXPipeline::IAddErrorMessage(const char* errStr)
+void plDXPipeline::IAddErrorMessage(const ST::string& errStr)
{
- static char str[ 512 ];
- if( errStr && strlen( errStr ) + strlen( fSettings.fErrorStr ) < sizeof( fSettings.fErrorStr ) - 4 )
- {
- strcpy( str, fSettings.fErrorStr );
- sprintf( fSettings.fErrorStr, "%s\n(%s)", errStr, str );
+ if (!errStr.empty()) {
+ fSettings.fErrorStr = ST::format("{}\n({})", errStr, fSettings.fErrorStr);
plStatusLog::AddLineS("pipeline.log", fSettings.fErrorStr);
}
}
// ISetErrorMessage //////////////////////////////////////////////////////////
// Clear the current error string to the input string.
-void plDXPipeline::ISetErrorMessage(const char* errStr)
+void plDXPipeline::ISetErrorMessage(ST::string errStr)
{
- if( errStr )
- {
- strcpy( fSettings.fErrorStr, errStr );
+ fSettings.fErrorStr = std::move(errStr);
+ if (!fSettings.fErrorStr.empty()) {
plStatusLog::AddLineS("pipeline.log", fSettings.fErrorStr);
}
- else
- fSettings.fErrorStr[ 0 ] = 0;
}
// IGetD3DError /////////////////////////////////////////////////////////////////
// Convert the last D3D error code to a string (probably "Conflicting Render State").
void plDXPipeline::IGetD3DError()
{
- sprintf( fSettings.fErrorStr, "D3DError : %s", fSettings.fDXError.ToString().c_str() );
+ fSettings.fErrorStr = ST::format("D3DError : {}", fSettings.fDXError.ToString());
}
// IShowErrorMessage /////////////////////////////////////////////////////////////
// Append the string to the running error string.
-void plDXPipeline::IShowErrorMessage(const char* errStr)
+void plDXPipeline::IShowErrorMessage(const ST::string& errStr)
{
- if (errStr != nullptr)
- IAddErrorMessage( errStr );
+ if (!errStr.empty()) {
+ IAddErrorMessage(errStr);
+ }
// hsAssert( false, fSettings.fErrorStr );
}
@@ -9955,18 +9943,18 @@ void plDXPipeline::IShowErrorMessage(const char* errStr)
// ICreateFail ////////////////////////////////////////////////////////////////////
// Called on unrecoverable error during device creation. Frees up anything
// allocated so far, sets the error string, and returns true.
-bool plDXPipeline::ICreateFail(const char* errStr)
+bool plDXPipeline::ICreateFail(const ST::string& errStr)
{
// Don't overwrite any error string we already had
- if( fSettings.fErrorStr[ 0 ] == 0 )
+ if (fSettings.fErrorStr.empty()) {
IGetD3DError();
+ }
- if( errStr && *errStr )
- {
- IAddErrorMessage( errStr );
+ if (!errStr.empty()) {
+ IAddErrorMessage(errStr);
+ } else if (fSettings.fErrorStr.empty()) {
+ IAddErrorMessage(ST_LITERAL("unknown"));
}
- else if( !*fSettings.fErrorStr )
- IAddErrorMessage( "unknown" );
IReleaseDeviceObjects();
return true;
@@ -9974,11 +9962,8 @@ bool plDXPipeline::ICreateFail(const char* errStr)
// GetErrorString ///////////////////////////////////////////////////////////////////////////
// Return the current error string.
-const char* plDXPipeline::GetErrorString()
+ST::string plDXPipeline::GetErrorString()
{
- if( fSettings.fErrorStr[ 0 ] == 0 )
- return nullptr;
-
return fSettings.fErrorStr;
}
@@ -10076,51 +10061,50 @@ short plDXPipeline::GetDXBitDepth( D3DFORMAT format )
//
// From a D3DFORMAT enumeration, return the string for it.
-const char *plDXPipeline::IGetDXFormatName( D3DFORMAT format )
-{
- switch( format )
- {
- case D3DFMT_UNKNOWN: return "D3DFMT_UNKNOWN";
- case D3DFMT_R8G8B8: return "D3DFMT_R8G8B8";
- case D3DFMT_A8R8G8B8: return "D3DFMT_A8R8G8B8";
- case D3DFMT_X8R8G8B8: return "D3DFMT_X8R8G8B8";
- case D3DFMT_R5G6B5: return "D3DFMT_R5G6B5";
- case D3DFMT_X1R5G5B5: return "D3DFMT_X1R5G5B5";
- case D3DFMT_A1R5G5B5: return "D3DFMT_A1R5G5B5";
- case D3DFMT_A4R4G4B4: return "D3DFMT_A4R4G4B4";
- case D3DFMT_R3G3B2: return "D3DFMT_R3G3B2";
- case D3DFMT_A8: return "D3DFMT_A8";
- case D3DFMT_A8R3G3B2: return "D3DFMT_A8R3G3B2";
- case D3DFMT_X4R4G4B4: return "D3DFMT_X4R4G4B4";
- case D3DFMT_A8P8: return "D3DFMT_A8P8";
- case D3DFMT_P8: return "D3DFMT_P8";
- case D3DFMT_L8: return "D3DFMT_L8";
- case D3DFMT_A8L8: return "D3DFMT_A8L8";
- case D3DFMT_A4L4: return "D3DFMT_A4L4";
- case D3DFMT_V8U8: return "D3DFMT_V8U8";
- case D3DFMT_L6V5U5: return "D3DFMT_L6V5U5";
- case D3DFMT_X8L8V8U8: return "D3DFMT_X8L8V8U8";
- case D3DFMT_Q8W8V8U8: return "D3DFMT_Q8W8V8U8";
- case D3DFMT_V16U16: return "D3DFMT_V16U16";
- //case D3DFMT_W11V11U10: return "D3DFMT_W11V11U10";
- case D3DFMT_UYVY: return "D3DFMT_UYVY";
- case D3DFMT_YUY2: return "D3DFMT_YUY2";
- case D3DFMT_DXT1: return "D3DFMT_DXT1";
-// case D3DFMT_DXT2: return "D3DFMT_DXT2";
-// case D3DFMT_DXT3: return "D3DFMT_DXT3";
-// case D3DFMT_DXT4: return "D3DFMT_DXT4";
- case D3DFMT_DXT5: return "D3DFMT_DXT5";
- case D3DFMT_VERTEXDATA: return "D3DFMT_VERTEXDATA";
- case D3DFMT_D16_LOCKABLE: return "D3DFMT_D16_LOCKABLE";
- case D3DFMT_D32: return "D3DFMT_D32";
- case D3DFMT_D15S1: return "D3DFMT_D15S1";
- case D3DFMT_D24S8: return "D3DFMT_D24S8";
- case D3DFMT_D16: return "D3DFMT_D16";
- case D3DFMT_D24X8: return "D3DFMT_D24X8";
- case D3DFMT_D24X4S4: return "D3DFMT_D24X4S4";
- case D3DFMT_INDEX16: return "D3DFMT_INDEX16";
- case D3DFMT_INDEX32: return "D3DFMT_INDEX32";
- default: return "Bad format";
+ST::string plDXPipeline::IGetDXFormatName(D3DFORMAT format)
+{
+ switch (format) {
+ case D3DFMT_UNKNOWN: return ST_LITERAL("D3DFMT_UNKNOWN");
+ case D3DFMT_R8G8B8: return ST_LITERAL("D3DFMT_R8G8B8");
+ case D3DFMT_A8R8G8B8: return ST_LITERAL("D3DFMT_A8R8G8B8");
+ case D3DFMT_X8R8G8B8: return ST_LITERAL("D3DFMT_X8R8G8B8");
+ case D3DFMT_R5G6B5: return ST_LITERAL("D3DFMT_R5G6B5");
+ case D3DFMT_X1R5G5B5: return ST_LITERAL("D3DFMT_X1R5G5B5");
+ case D3DFMT_A1R5G5B5: return ST_LITERAL("D3DFMT_A1R5G5B5");
+ case D3DFMT_A4R4G4B4: return ST_LITERAL("D3DFMT_A4R4G4B4");
+ case D3DFMT_R3G3B2: return ST_LITERAL("D3DFMT_R3G3B2");
+ case D3DFMT_A8: return ST_LITERAL("D3DFMT_A8");
+ case D3DFMT_A8R3G3B2: return ST_LITERAL("D3DFMT_A8R3G3B2");
+ case D3DFMT_X4R4G4B4: return ST_LITERAL("D3DFMT_X4R4G4B4");
+ case D3DFMT_A8P8: return ST_LITERAL("D3DFMT_A8P8");
+ case D3DFMT_P8: return ST_LITERAL("D3DFMT_P8");
+ case D3DFMT_L8: return ST_LITERAL("D3DFMT_L8");
+ case D3DFMT_A8L8: return ST_LITERAL("D3DFMT_A8L8");
+ case D3DFMT_A4L4: return ST_LITERAL("D3DFMT_A4L4");
+ case D3DFMT_V8U8: return ST_LITERAL("D3DFMT_V8U8");
+ case D3DFMT_L6V5U5: return ST_LITERAL("D3DFMT_L6V5U5");
+ case D3DFMT_X8L8V8U8: return ST_LITERAL("D3DFMT_X8L8V8U8");
+ case D3DFMT_Q8W8V8U8: return ST_LITERAL("D3DFMT_Q8W8V8U8");
+ case D3DFMT_V16U16: return ST_LITERAL("D3DFMT_V16U16");
+ //case D3DFMT_W11V11U10: return ST_LITERAL("D3DFMT_W11V11U10");
+ case D3DFMT_UYVY: return ST_LITERAL("D3DFMT_UYVY");
+ case D3DFMT_YUY2: return ST_LITERAL("D3DFMT_YUY2");
+ case D3DFMT_DXT1: return ST_LITERAL("D3DFMT_DXT1");
+ //case D3DFMT_DXT2: return ST_LITERAL("D3DFMT_DXT2");
+ //case D3DFMT_DXT3: return ST_LITERAL("D3DFMT_DXT3");
+ //case D3DFMT_DXT4: return ST_LITERAL("D3DFMT_DXT4");
+ case D3DFMT_DXT5: return ST_LITERAL("D3DFMT_DXT5");
+ case D3DFMT_VERTEXDATA: return ST_LITERAL("D3DFMT_VERTEXDATA");
+ case D3DFMT_D16_LOCKABLE: return ST_LITERAL("D3DFMT_D16_LOCKABLE");
+ case D3DFMT_D32: return ST_LITERAL("D3DFMT_D32");
+ case D3DFMT_D15S1: return ST_LITERAL("D3DFMT_D15S1");
+ case D3DFMT_D24S8: return ST_LITERAL("D3DFMT_D24S8");
+ case D3DFMT_D16: return ST_LITERAL("D3DFMT_D16");
+ case D3DFMT_D24X8: return ST_LITERAL("D3DFMT_D24X8");
+ case D3DFMT_D24X4S4: return ST_LITERAL("D3DFMT_D24X4S4");
+ case D3DFMT_INDEX16: return ST_LITERAL("D3DFMT_INDEX16");
+ case D3DFMT_INDEX32: return ST_LITERAL("D3DFMT_INDEX32");
+ default: return ST_LITERAL("Bad format");
}
}
@@ -10590,7 +10574,7 @@ void plDXPipeline::IReleaseBlurVBuffers()
if (fBlurVBuffers[i])
{
ReleaseObject(fBlurVBuffers[i]);
- PROFILE_POOL_MEM(D3DPOOL_DEFAULT, 4 * kVSize, false, "BlurVtxBuff");
+ PROFILE_POOL_MEM(D3DPOOL_DEFAULT, 4 * kVSize, false, ST_LITERAL("BlurVtxBuff"));
fBlurVBuffers[i] = nullptr;
}
}
@@ -10673,7 +10657,7 @@ bool plDXPipeline::ICreateBlurVBuffers()
vBuffer->Release();
return false;
}
- PROFILE_POOL_MEM(D3DPOOL_DEFAULT, 4 * kVSize, true, "BlurVtxBuff");
+ PROFILE_POOL_MEM(D3DPOOL_DEFAULT, 4 * kVSize, true, ST_LITERAL("BlurVtxBuff"));
plShadowVertStruct vert;
vert.fPos[0] = -1.f;
diff --git a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXPipeline.h b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXPipeline.h
index bb0b86f839..3b33cdcb44 100644
--- a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXPipeline.h
+++ b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXPipeline.h
@@ -417,11 +417,11 @@ class plDXPipeline : public pl3DPipeline
inline D3DCOLORVALUE inlPlToD3DColor(const hsColorRGBA& c, float a) const;
// Error handling
- void IAddErrorMessage(const char* errStr);
- void ISetErrorMessage(const char* errStr = nullptr);
- void IGetD3DError();
- void IShowErrorMessage(const char* errStr = nullptr);
- bool ICreateFail(const char* errStr);
+ void IAddErrorMessage(const ST::string& errStr);
+ void ISetErrorMessage(ST::string errStr);
+ void IGetD3DError();
+ void IShowErrorMessage(const ST::string& errStr = {});
+ bool ICreateFail(const ST::string& errStr);
// Device initialization
void IInvalidateState();
@@ -476,7 +476,7 @@ class plDXPipeline : public pl3DPipeline
bool IFindRenderTargetInfo( plRenderTarget *owner, D3DFORMAT &surfFormat, D3DRESOURCETYPE &resType );
// From a D3DFORMAT enumeration, return the string literal for it
- static const char *IGetDXFormatName( D3DFORMAT format );
+ static ST::string IGetDXFormatName(D3DFORMAT format);
/////// Shadow internals
// Generation
@@ -573,7 +573,7 @@ class plDXPipeline : public pl3DPipeline
static void AllocManagedVertex(uint32_t sz) { fVtxManaged += sz; }
#ifndef PLASMA_EXTERNAL_RELEASE
- static void ProfilePoolMem(D3DPOOL poolType, uint32_t size, bool add, const char *id);
+ static void ProfilePoolMem(D3DPOOL poolType, uint32_t size, bool add, const ST::string& id);
#endif // PLASMA_EXTERNAL_RELEASE
// From a D3DFORMAT enumeration, return the bit depth associated with it.
@@ -595,7 +595,7 @@ class plDXPipeline : public pl3DPipeline
plMipmap* ExtractMipMap(plRenderTarget* targ) override;
/// Error handling
- const char *GetErrorString() override;
+ ST::string GetErrorString() override;
bool ManagedAlloced() const { return fManagedAlloced; }
diff --git a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXPixelShader.cpp b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXPixelShader.cpp
index b020713f8c..1ad2a76119 100644
--- a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXPixelShader.cpp
+++ b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXPixelShader.cpp
@@ -66,8 +66,7 @@ void plDXPixelShader::Release()
ReleaseObject(fHandle);
fHandle = nullptr;
fPipe = nullptr;
-
- ISetError(nullptr);
+ fErrorString.clear();
}
bool plDXPixelShader::VerifyFormat(uint8_t format) const
@@ -94,17 +93,17 @@ HRESULT plDXPixelShader::ICreate(plDXPipeline* pipe)
{
fHandle = nullptr; // in case something goes wrong.
fPipe = nullptr;
- ISetError(nullptr);
+ fErrorString.clear();
DWORD* shaderCodes = (DWORD*)(fOwner->GetDecl()->GetCodes());
if( !shaderCodes )
- return IOnError(-1, "Shaders must be compiled into the engine.");
+ return IOnError(-1, ST_LITERAL("Shaders must be compiled into the engine."));
HRESULT hr = pipe->GetD3DDevice()->CreatePixelShader(shaderCodes, &fHandle);
if( FAILED(hr) )
{
- return IOnError(hr, "Error on CreatePixelShader");
+ return IOnError(hr, ST_LITERAL("Error on CreatePixelShader"));
}
hsAssert(fHandle, "No error, but no pixel shader handle. Grrrr.");
@@ -123,7 +122,7 @@ HRESULT plDXPixelShader::ISetConstants(plDXPipeline* pipe)
(const float*)fOwner->GetConstBasePtr(),
fOwner->GetNumConsts());
if( FAILED(hr) )
- return IOnError(hr, "Error setting constants");
+ return IOnError(hr, ST_LITERAL("Error setting constants"));
}
return S_OK;
diff --git a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXSettings.h b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXSettings.h
index 10ca790927..014448a8ce 100644
--- a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXSettings.h
+++ b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXSettings.h
@@ -56,6 +56,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsWindows.h"
#include
+#include
#include
#include "hsBitVector.h"
@@ -73,6 +74,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//// General Settings /////////////////////////////////////////////////////////
+class plLightInfo;
class plRenderRequest;
class plRenderTarget;
struct IDirect3DSurface9;
@@ -109,7 +111,7 @@ class plDXGeneralSettings
DWORD fCurrFVFFormat;
hsCOMError fDXError;
- char fErrorStr[ 256 ];
+ ST::string fErrorStr;
void Reset();
};
diff --git a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXShader.cpp b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXShader.cpp
index b68f3bccaf..03db98dccc 100644
--- a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXShader.cpp
+++ b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXShader.cpp
@@ -60,8 +60,7 @@ plDXShader::plDXShader(plShader* owner)
plDXShader::~plDXShader()
{
fPipe = nullptr;
-
- ISetError(nullptr);
+ fErrorString.clear();
}
void plDXShader::SetOwner(plShader* owner)
@@ -74,13 +73,13 @@ void plDXShader::SetOwner(plShader* owner)
}
}
-HRESULT plDXShader::IOnError(HRESULT hr, const char* errStr)
+HRESULT plDXShader::IOnError(HRESULT hr, ST::string errStr)
{
- ISetError(errStr);
+ fErrorString = std::move(errStr);
fOwner->Invalidate();
- hsStatusMessage(errStr);
+ hsStatusMessage(fErrorString.c_str());
return hr;
}
diff --git a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXShader.h b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXShader.h
index f4035127b1..daedc9e1b0 100644
--- a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXShader.h
+++ b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXShader.h
@@ -56,8 +56,7 @@ class plDXShader : public plDXDeviceRef
ST::string fErrorString;
plDXPipeline* fPipe;
- HRESULT IOnError(HRESULT hr, const char* errStr);
- void ISetError(const char* errStr) { fErrorString = errStr; }
+ HRESULT IOnError(HRESULT hr, ST::string errStr);
virtual HRESULT ICreate(plDXPipeline* pipe) = 0;
virtual HRESULT ISetConstants(plDXPipeline* pipe) = 0; // On error, sets error string.
diff --git a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXVertexShader.cpp b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXVertexShader.cpp
index 1ba4fe6999..c9f1b87450 100644
--- a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXVertexShader.cpp
+++ b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXVertexShader.cpp
@@ -66,8 +66,7 @@ void plDXVertexShader::Release()
ReleaseObject(fHandle);
fHandle = nullptr;
fPipe = nullptr;
-
- ISetError(nullptr);
+ fErrorString.clear();
}
bool plDXVertexShader::VerifyFormat(uint8_t format) const
@@ -94,7 +93,7 @@ HRESULT plDXVertexShader::ICreate(plDXPipeline* pipe)
{
fHandle = nullptr; // in case something goes wrong.
fPipe = nullptr;
- ISetError(nullptr);
+ fErrorString.clear();
// We could store the compiled buffer and skip the assembly step
// if we need to recreate the shader (e.g. on device lost).
@@ -102,12 +101,12 @@ HRESULT plDXVertexShader::ICreate(plDXPipeline* pipe)
DWORD* shaderCodes = (DWORD*)(fOwner->GetDecl()->GetCodes());
if( !shaderCodes )
- return IOnError(-1, "Shaders must be compiled into the engine.");
+ return IOnError(-1, ST_LITERAL("Shaders must be compiled into the engine."));
HRESULT hr = pipe->GetD3DDevice()->CreateVertexShader(shaderCodes, &fHandle);
if( FAILED(hr) )
- return IOnError(hr, "Error on CreateVertexShader");
+ return IOnError(hr, ST_LITERAL("Error on CreateVertexShader"));
hsAssert(fHandle, "No error, but no vertex shader handle. Grrrr.");
@@ -125,7 +124,7 @@ HRESULT plDXVertexShader::ISetConstants(plDXPipeline* pipe)
(const float*)fOwner->GetConstBasePtr(),
fOwner->GetNumConsts());
if( FAILED(hr) )
- return IOnError(hr, "Failure setting vertex shader constants");
+ return IOnError(hr, ST_LITERAL("Failure setting vertex shader constants"));
}
return S_OK;
diff --git a/Sources/Plasma/FeatureLib/pfGLPipeline/plGLDevice.h b/Sources/Plasma/FeatureLib/pfGLPipeline/plGLDevice.h
index 49c4110fa1..2de62f4cfd 100644
--- a/Sources/Plasma/FeatureLib/pfGLPipeline/plGLDevice.h
+++ b/Sources/Plasma/FeatureLib/pfGLPipeline/plGLDevice.h
@@ -44,13 +44,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsMatrix44.h"
+#include
+
class plGLPipeline;
class plRenderTarget;
class plGLDevice
{
protected:
- const char* fErrorMsg;
+ ST::string fErrorMsg;
plGLPipeline* fPipeline;
public:
@@ -76,7 +78,7 @@ class plGLDevice
struct IndexBufferRef;
struct TextureRef;
- const char* GetErrorString() const { return fErrorMsg; }
+ ST::string GetErrorString() const { return fErrorMsg; }
};
#endif
diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIControlMod.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIControlMod.cpp
index 1f8e5c16d8..c9ba51efa8 100644
--- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIControlMod.cpp
+++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIControlMod.cpp
@@ -549,9 +549,9 @@ bool pfGUIControlMod::MsgReceive( plMessage *msg )
if (rend || device) {
plPipeline* pipe = rend ? rend->Pipeline() : device->Pipeline();
- plProfile_BeginLap(GUITime, this->GetKey()->GetUoid().GetObjectName().c_str());
+ plProfile_BeginLap(GUITime, this->GetKey()->GetUoid().GetObjectName());
ISetUpDynTextMap(pipe);
- plProfile_EndLap(GUITime, this->GetKey()->GetUoid().GetObjectName().c_str());
+ plProfile_EndLap(GUITime, this->GetKey()->GetUoid().GetObjectName());
if (rend)
plgDispatch::Dispatch()->UnRegisterForExactType(plRenderMsg::Index(), GetKey());
diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp
index 4ba537eb77..59b000fb2c 100644
--- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp
+++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp
@@ -55,6 +55,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plgDispatch.h"
#include "hsResMgr.h"
+#include
+
#include "pfGameGUIMgr.h"
#include "pnInputCore/plKeyMap.h"
diff --git a/Sources/Plasma/FeatureLib/pfMetalPipeline/CMakeLists.txt b/Sources/Plasma/FeatureLib/pfMetalPipeline/CMakeLists.txt
index 2fc73c1de7..86fdca3090 100644
--- a/Sources/Plasma/FeatureLib/pfMetalPipeline/CMakeLists.txt
+++ b/Sources/Plasma/FeatureLib/pfMetalPipeline/CMakeLists.txt
@@ -1,5 +1,9 @@
include(FetchContent)
+if(POLICY CMP0135)
+ cmake_policy(SET CMP0135 NEW)
+endif()
+
FetchContent_Declare(
metalcpp
URL_HASH_SHA256 0afd87ca851465191ae4e3980aa036c7e9e02fe32e7c760ac1a74244aae6023b
@@ -11,6 +15,7 @@ FetchContent_MakeAvailable(metalcpp)
set(pfMetalPipeline_SOURCES
plMetalDevice.cpp
plMetalDeviceRefs.cpp
+ plMetalEnumerate.cpp
plMetalMaterialShaderRef.cpp
plMetalPipeline.cpp
plMetalPipelineState.cpp
@@ -19,7 +24,6 @@ set(pfMetalPipeline_SOURCES
plMetalFragmentShader.cpp
plMetalVertexShader.cpp
plMetalTextFont.cpp
- plMetalEnumerate.mm
plMetalDevicePerformanceShaders.mm
)
diff --git a/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalDevice.cpp b/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalDevice.cpp
index dbe9889835..d188e067ee 100644
--- a/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalDevice.cpp
+++ b/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalDevice.cpp
@@ -186,27 +186,14 @@ void plMetalDevice::SetMaxAnsiotropy(uint8_t maxAnsiotropy)
void plMetalDevice::SetMSAASampleCount(uint8_t sampleCount)
{
- // Plasma has some MSAA levels that don't completely correspond to what Metal can do
- // Best fit them to levels Metal can do. Once they are best fit see if the hardware
- // is capable.
-
- uint8_t actualSampleCount = 1;
- if (sampleCount == 6) {
- actualSampleCount = 8;
- } else if (sampleCount == 4) {
- actualSampleCount = 4;
- } else if (sampleCount == 2) {
- actualSampleCount = 2;
- }
-
- while (actualSampleCount != 1) {
- if (fMetalDevice->supportsTextureSampleCount(actualSampleCount)) {
+ while (sampleCount != 1) {
+ if (fMetalDevice->supportsTextureSampleCount(sampleCount)) {
break;
}
- actualSampleCount /= 2;
+ sampleCount--;
}
- fSampleCount = actualSampleCount;
+ fSampleCount = sampleCount;
}
void plMetalDevice::ReleaseSamplerStates()
diff --git a/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalDevice.h b/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalDevice.h
index c5f3cfd89a..9fbff73299 100644
--- a/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalDevice.h
+++ b/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalDevice.h
@@ -47,6 +47,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include
#include
#include
+#include
#include
#include "HeadSpin.h"
@@ -85,7 +86,7 @@ class plMetalDevice
hsWindowHndl fDevice;
hsWindowHndl fWindow;
- const char* fErrorMsg;
+ ST::string fErrorMsg;
MTL::RenderCommandEncoder* CurrentRenderCommandEncoder();
MTL::Device* fMetalDevice;
@@ -140,7 +141,7 @@ class plMetalDevice
void MakeTextureRef(TextureRef* tRef, plMipmap* img);
void MakeCubicTextureRef(TextureRef* tRef, plCubicEnvironmap* img);
- const char* GetErrorString() const { return fErrorMsg; }
+ ST::string GetErrorString() const { return fErrorMsg; }
void SetProjectionMatrix(const hsMatrix44& src);
void SetWorldToCameraMatrix(const hsMatrix44& src);
diff --git a/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalEnumerate.mm b/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalEnumerate.cpp
similarity index 83%
rename from Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalEnumerate.mm
rename to Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalEnumerate.cpp
index eaef5f157e..d0b6e323e0 100644
--- a/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalEnumerate.mm
+++ b/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalEnumerate.cpp
@@ -44,10 +44,9 @@
#include "HeadSpin.h"
#include
+#include
+#include
-#include
-
-#include
#include "plMetalPipeline.h"
void plMetalEnumerate::Enumerate(std::vector& records)
@@ -62,17 +61,11 @@
devRec.SetG3DDeviceType(hsG3DDeviceSelector::kDevTypeMetal);
devRec.SetDriverName("Metal");
devRec.SetDeviceDesc(device->name()->utf8String());
+
// Metal has ways to query capabilities, but doesn't expose a flat version
// Populate with the OS version
- @autoreleasepool {
- NSProcessInfo* processInfo = [NSProcessInfo processInfo];
- NSOperatingSystemVersion version = processInfo.operatingSystemVersion;
- NSString* versionString =
- [NSString stringWithFormat:@"%li.%li.%li", (long)version.majorVersion,
- (long)version.minorVersion, version.patchVersion];
- devRec.SetDriverVersion([versionString cStringUsingEncoding:NSUTF8StringEncoding]);
- }
- devRec.SetDriverDesc(device->name()->utf8String());
+ auto version = NS::ProcessInfo::processInfo()->operatingSystemVersion();
+ devRec.SetDriverVersion(ST::format("{}.{}.{}", version.majorVersion, version.minorVersion, version.patchVersion));
devRec.SetCap(hsG3DDeviceSelector::kCapsMipmap);
devRec.SetCap(hsG3DDeviceSelector::kCapsPerspective);
diff --git a/Sources/Plasma/FeatureLib/pfPython/CMakeLists.txt b/Sources/Plasma/FeatureLib/pfPython/CMakeLists.txt
index ffdf8b1612..15399ffb54 100644
--- a/Sources/Plasma/FeatureLib/pfPython/CMakeLists.txt
+++ b/Sources/Plasma/FeatureLib/pfPython/CMakeLists.txt
@@ -207,6 +207,7 @@ set(pfPython_GLUE
pyGameScoreGlue.cpp
pyGameScoreMsgGlue.cpp
pyGeometry3Glue.cpp
+ pyGlueDefinitions.h
pyGlueHelpers.h
pyGmBlueSpiralGlue.cpp
pyGmMarkerGlue.cpp
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAccountManagement.cpp b/Sources/Plasma/FeatureLib/pfPython/cyAccountManagement.cpp
index f7d5c5c314..3e43266040 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyAccountManagement.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyAccountManagement.cpp
@@ -46,12 +46,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// PURPOSE: Python wrapper for account management functions
//
-#include
-
-#include "pyGlueHelpers.h"
#include "cyAccountManagement.h"
+
#include "plNetClientComm/plNetClientComm.h"
+#include "pyGlueHelpers.h"
+
PyObject* cyAccountManagement::GetPlayerList()
{
const std::vector& playerList = NetCommGetPlayerList();
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAccountManagementGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyAccountManagementGlue.cpp
index 9c3d615260..e113c5eba7 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyAccountManagementGlue.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyAccountManagementGlue.cpp
@@ -40,15 +40,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
-#include
-#include
-
#include "cyAccountManagement.h"
-#include "pyGlueHelpers.h"
-#include "pyEnum.h"
+
+#include
#include "plMessage/plAccountUpdateMsg.h"
+#include "pyEnum.h"
+#include "pyGlueHelpers.h"
+
PYTHON_GLOBAL_METHOD_DEFINITION_NOARGS(PtGetAccountPlayerList, "Returns list of players associated with the current account")
{
return cyAccountManagement::GetPlayerList();
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAnimation.cpp b/Sources/Plasma/FeatureLib/pfPython/cyAnimation.cpp
index 2e6aed18fe..e8822c9a97 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyAnimation.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyAnimation.cpp
@@ -46,12 +46,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// PURPOSE: Class wrapper to map animation functions to plasma2 message
//
+#include "cyAnimation.h"
+
#include "plgDispatch.h"
-#include "pyKey.h"
-#include "cyAnimation.h"
#include "plMessage/plAnimCmdMsg.h"
+#include "pyKey.h"
+
cyAnimation::cyAnimation()
: fAnimName(), fNetForce()
{
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAnimation.h b/Sources/Plasma/FeatureLib/pfPython/cyAnimation.h
index 56b394ca59..bde2d9ddf3 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyAnimation.h
+++ b/Sources/Plasma/FeatureLib/pfPython/cyAnimation.h
@@ -51,7 +51,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include
-#include "pyGlueHelpers.h"
+#include "pnKeyedObject/plKey.h"
+
+#include "pyGlueDefinitions.h"
+
+class pyKey;
class cyAnimation
{
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAnimationGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyAnimationGlue.cpp
index c900cf8818..0d7f86bf8b 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyAnimationGlue.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyAnimationGlue.cpp
@@ -40,11 +40,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
-#include
-#include "pyKey.h"
-
#include "cyAnimation.h"
+#include "pyGlueHelpers.h"
+#include "pyKey.h"
// glue functions
PYTHON_CLASS_DEFINITION(ptAnimation, cyAnimation);
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp b/Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp
index 319942c690..9661fa3204 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp
@@ -40,42 +40,39 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
-#include
-#include
+#include "cyAvatar.h"
+
+#include
#include "plFileSystem.h"
#include "plgDispatch.h"
-#include "pyKey.h"
#include "plPhysical.h"
-#include "cyAvatar.h"
-
-#include "plAvatar/plAvatarMgr.h"
-#include "plMessage/plAvatarMsg.h"
-#include "plMessage/plOneShotMsg.h"
-#include "plMessage/plMultistageMsg.h"
#include "pnMessage/plNotifyMsg.h"
-#include "plGImage/plMipmap.h"
-#include "pySceneObject.h"
-#include "pyColor.h"
-#include "pyImage.h"
+#include "pnSceneObject/plSceneObject.h"
-#include "plAvatar/plOneShotMod.h"
-#include "plAvatar/plMultistageBehMod.h"
+#include "plAnimation/plAGAnim.h" // to get the BodyUsage enum
+#include "plAvatar/plArmatureMod.h"
#include "plAvatar/plAvatarClothing.h"
+#include "plAvatar/plAvatarMgr.h"
+#include "plAvatar/plAvBrainHuman.h" // needed to call the emote
#include "plAvatar/plClothingLayout.h"
-#include "plAvatar/plArmatureMod.h"
-#include "plAvatar/plAvBrainHuman.h" // needed to call the emote
-#include "plAnimation/plAGAnim.h" // to get the BodyUsage enum
+#include "plAvatar/plMultistageBehMod.h"
+#include "plAvatar/plOneShotMod.h"
+#include "plDrawable/plMorphSequence.h"
+#include "plDrawable/plSharedMesh.h"
#include "plInputCore/plAvatarInputInterface.h"
+#include "plMessage/plAvatarMsg.h"
+#include "plMessage/plMultistageMsg.h"
+#include "plMessage/plOneShotMsg.h"
#include "plMessage/plSimStateMsg.h"
-
#include "plVault/plVault.h"
-#include "plDrawable/plSharedMesh.h"
-
-#include "pnSceneObject/plSceneObject.h"
-#include "plDrawable/plMorphSequence.h"
+#include "pyColor.h"
+#include "pyGlueHelpers.h"
+#include "pyImage.h"
+#include "pyKey.h"
+#include "pySceneObject.h"
///////////////////////////////////////////////////////////////////////////
//
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h b/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h
index bf88d0cb42..e23a29ab3d 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h
+++ b/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h
@@ -53,15 +53,16 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnKeyedObject/plKey.h"
-#include "pyGlueHelpers.h"
+#include "pyGlueDefinitions.h"
+class plArmatureMod;
+class plClothingItem;
class plFileName;
-class pySceneObject;
-class pyColor;
class plMipmap;
-class plClothingItem;
-class plArmatureMod;
class plMorphSequence;
+class pyColor;
+class pyKey;
+class pySceneObject;
namespace ST { class string; }
class cyAvatar
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAvatarGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyAvatarGlue.cpp
index 5373e8786c..b08aedf3aa 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyAvatarGlue.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyAvatarGlue.cpp
@@ -40,20 +40,20 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
-#include
+#include "cyAvatar.h"
+
#include
#include "plFileSystem.h"
-#include "pyKey.h"
+#include "plAvatar/plAvBrainHuman.h"
-#include "cyAvatar.h"
#include "pyColor.h"
#include "pyEnum.h"
+#include "pyGlueHelpers.h"
+#include "pyKey.h"
#include "pySceneObject.h"
-#include "plAvatar/plAvBrainHuman.h"
-
// glue functions
PYTHON_CLASS_DEFINITION(ptAvatar, cyAvatar);
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyCamera.cpp b/Sources/Plasma/FeatureLib/pfPython/cyCamera.cpp
index 1ecf4f246c..b9dbe1007d 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyCamera.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyCamera.cpp
@@ -40,20 +40,22 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
-#include "plgDispatch.h"
-#include "pyKey.h"
-#include "hsResMgr.h"
-
#include "cyCamera.h"
-#include "pnMessage/plCameraMsg.h"
-#include "plMessage/plInputEventMsg.h"
+#include "hsResMgr.h"
+#include "plgDispatch.h"
+
#include "pnKeyedObject/plFixedKey.h"
#include "pnKeyedObject/plUoid.h"
+#include "pnMessage/plCameraMsg.h"
+
+#include "plMessage/plInputEventMsg.h"
-#include "pfCamera/plVirtualCamNeu.h"
-#include "pfCamera/plCameraModifier.h"
#include "pfCamera/plCameraBrain.h"
+#include "pfCamera/plCameraModifier.h"
+#include "pfCamera/plVirtualCamNeu.h"
+
+#include "pyKey.h"
cyCamera::cyCamera()
{
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyCamera.h b/Sources/Plasma/FeatureLib/pfPython/cyCamera.h
index 63c626553e..78e9289770 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyCamera.h
+++ b/Sources/Plasma/FeatureLib/pfPython/cyCamera.h
@@ -50,9 +50,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//
#include "HeadSpin.h"
-#include "pyGlueHelpers.h"
+
#include "pnKeyedObject/plKey.h"
-#include "pfCamera/plVirtualCamNeu.h"
+
+#include "pfCamera/plVirtualCamNeu.h"
+
+#include "pyGlueDefinitions.h"
+
+class pyKey;
class cyCamera
{
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyCameraGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyCameraGlue.cpp
index e10d05184f..cb38e3a5bd 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyCameraGlue.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyCameraGlue.cpp
@@ -40,11 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
-#include
-#include "pyKey.h"
-
#include "cyCamera.h"
+#include "pyGlueHelpers.h"
+#include "pyKey.h"
+
// glue functions
PYTHON_CLASS_DEFINITION(ptCamera, cyCamera);
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyDraw.cpp b/Sources/Plasma/FeatureLib/pfPython/cyDraw.cpp
index fb5321031d..dbbf86be8e 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyDraw.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyDraw.cpp
@@ -40,9 +40,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
+#include "cyDraw.h"
+
#include "plgDispatch.h"
-#include "cyDraw.h"
#include "pnMessage/plEnableMsg.h"
cyDraw::cyDraw(plKey sender, plKey recvr)
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyDraw.h b/Sources/Plasma/FeatureLib/pfPython/cyDraw.h
index f3b8c995d9..4b0560a346 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyDraw.h
+++ b/Sources/Plasma/FeatureLib/pfPython/cyDraw.h
@@ -53,7 +53,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnKeyedObject/plKey.h"
-#include "pyGlueHelpers.h"
+#include "pyGlueDefinitions.h"
class cyDraw
{
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyDrawGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyDrawGlue.cpp
index 285ad2696f..eedb558c3c 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyDrawGlue.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyDrawGlue.cpp
@@ -40,11 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
-#include
-#include "pyKey.h"
-
#include "cyDraw.h"
+#include "pyGlueHelpers.h"
+#include "pyKey.h"
+
// glue functions
PYTHON_CLASS_DEFINITION(ptDraw, cyDraw);
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyInputInterface.cpp b/Sources/Plasma/FeatureLib/pfPython/cyInputInterface.cpp
index e3e38d7446..7eb2df7618 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyInputInterface.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyInputInterface.cpp
@@ -41,8 +41,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "cyInputInterface.h"
-#include "plMessage/plInputIfaceMgrMsg.h"
+
#include "plInputCore/plTelescopeInputInterface.h"
+#include "plMessage/plInputIfaceMgrMsg.h"
cyInputInterface::cyInputInterface() :
fTelescopeInterface()
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyInputInterface.h b/Sources/Plasma/FeatureLib/pfPython/cyInputInterface.h
index b794812526..35e61eef0e 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyInputInterface.h
+++ b/Sources/Plasma/FeatureLib/pfPython/cyInputInterface.h
@@ -49,7 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// PURPOSE: Class wrapper to map InputInterface functions to plasma2 message
//
-#include "pyGlueHelpers.h"
+#include "pyGlueDefinitions.h"
class plInputInterface;
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyInputInterfaceGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyInputInterfaceGlue.cpp
index d9447078cf..18013e8890 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyInputInterfaceGlue.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyInputInterfaceGlue.cpp
@@ -40,10 +40,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
-#include
-
#include "cyInputInterface.h"
+#include "pyGlueHelpers.h"
+
// glue functions
PYTHON_CLASS_DEFINITION(ptInputInterface, cyInputInterface);
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp
index 86f1bde52a..16bb609b61 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp
@@ -40,70 +40,68 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
+#include "cyMisc.h"
+
#include
#include
#include
-#include "plgDispatch.h"
#include "hsResMgr.h"
-#include "pyKey.h"
-
-#include "cyMisc.h"
+#include "plgDispatch.h"
+#include "plTimerCallbackManager.h"
-#include "plResMgr/plKeyFinder.h"
+#include "pnKeyedObject/plFixedKey.h"
#include "pnKeyedObject/plKey.h"
#include "pnKeyedObject/plKeyImp.h"
-#include "pnKeyedObject/plFixedKey.h"
-#include "plMessage/plLinkToAgeMsg.h"
-#include "plMessage/plAnimCmdMsg.h"
-#include "plMessage/plExcludeRegionMsg.h"
-#include "plMessage/plInputEventMsg.h"
-#include "plMessage/plInputIfaceMgrMsg.h"
-#include "plMessage/plLoadCloneMsg.h"
-#include "pnMessage/plCmdIfaceModMsg.h"
#include "pnMessage/plAttachMsg.h"
-#include "plMessage/plTimerCallbackMsg.h"
-#include "plMessage/plNetVoiceListMsg.h"
-#include "pnMessage/plClientMsg.h"
#include "pnMessage/plCameraMsg.h"
-#include "plTimerCallbackManager.h"
-#include "plVault/plVault.h"
-#include "pnNetCommon/pnNetCommon.h"
+#include "pnMessage/plClientMsg.h"
+#include "pnMessage/plCmdIfaceModMsg.h"
#include "plNetClient/plNetClientMgr.h"
#include "plNetClient/plNetLinkingMgr.h"
+#include "pnNetCommon/pnNetCommon.h"
#include "plNetTransport/plNetTransport.h"
#include "plNetTransport/plNetTransportMember.h"
-#include "plAvatar/plAvatarMgr.h"
-#include "plAvatar/plMultistageBehMod.h"
-#include "plAvatar/plAvBrainCritter.h"
-#include "pyCritterBrain.h"
-#include "pySceneObject.h"
-#include "pyPlayer.h"
-#include "pyColor.h"
-#include "pyAgeInfoStruct.h"
-#include "pyAlarm.h"
-#include "pyGeometry3.h"
-#include "pfMessage/pfKIMsg.h"
-#include "pfCamera/plVirtualCamNeu.h"
-#include "plPipeline/plDynamicEnvMap.h"
-
-#include "pfGameGUIMgr/pfGameGUIMgr.h"
-#include "pfGameGUIMgr/pfGUIDialogMod.h"
-#include "pyGUIDialog.h"
-#include "pnSceneObject/plSceneObject.h"
#include "pnSceneObject/plCoordinateInterface.h"
+#include "pnSceneObject/plSceneObject.h"
-#include "plMessage/plCCRMsg.h"
-
-#include "plResMgr/plLocalization.h"
+#include "plAvatar/plAvatarMgr.h"
+#include "plAvatar/plAvBrainCritter.h"
+#include "plAvatar/plMultistageBehMod.h"
#include "plGLight/plLightInfo.h"
-
#include "plInputCore/plAvatarInputInterface.h"
#include "plInputCore/plInputDevice.h"
+#include "plMessage/plAnimCmdMsg.h"
+#include "plMessage/plCCRMsg.h"
+#include "plMessage/plExcludeRegionMsg.h"
+#include "plMessage/plInputEventMsg.h"
+#include "plMessage/plInputIfaceMgrMsg.h"
+#include "plMessage/plLinkToAgeMsg.h"
+#include "plMessage/plLoadCloneMsg.h"
+#include "plMessage/plNetVoiceListMsg.h"
+#include "plMessage/plTimerCallbackMsg.h"
+#include "plPipeline/plDynamicEnvMap.h"
+#include "plResMgr/plKeyFinder.h"
+#include "plResMgr/plLocalization.h"
+#include "plStatusLog/plStatusLog.h"
+#include "plVault/plVault.h"
+#include "pfCamera/plVirtualCamNeu.h"
+#include "pfGameGUIMgr/pfGameGUIMgr.h"
+#include "pfGameGUIMgr/pfGUIDialogMod.h"
#include "pfLocalizationMgr/pfLocalizationMgr.h"
+#include "pfMessage/pfKIMsg.h"
-#include "plStatusLog/plStatusLog.h"
+#include "pyAgeInfoStruct.h"
+#include "pyAlarm.h"
+#include "pyColor.h"
+#include "pyCritterBrain.h"
+#include "pyGeometry3.h"
+#include "pyGlueHelpers.h"
+#include "pyGUIDialog.h"
+#include "pyKey.h"
+#include "pyPlayer.h"
+#include "pySceneObject.h"
//// Static Class Stuff //////////////////////////////////////////////////////
plPipeline* cyMisc::fPipeline = nullptr;
@@ -2541,6 +2539,11 @@ void cyMisc::EnablePlanarReflections(bool enable)
plDynamicCamMap::SetEnabled(enable);
}
+bool cyMisc::ArePlanarReflectionsSupported()
+{
+ return plDynamicCamMap::GetCapable();
+}
+
void cyMisc::GetSupportedDisplayModes(std::vector *res)
{
fPipeline->GetSupportedDisplayModes(res);
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMisc.h b/Sources/Plasma/FeatureLib/pfPython/cyMisc.h
index 91d21f9e04..e118b4bcb3 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyMisc.h
+++ b/Sources/Plasma/FeatureLib/pfPython/cyMisc.h
@@ -48,21 +48,22 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//
// PURPOSE: Class wrapper to map misc functions, such as the console
//
-class pyKey;
-class pySceneObject;
-class pyPlayer;
-class pyColor;
-class pyAgeInfoStruct;
-class pyPoint3;
#include "HeadSpin.h"
+#include
-class pyGUIDialog;
-class plPipeline;
+struct PipelineParams;
class plDisplayMode;
-class plUUID;
class plFileName;
-struct PipelineParams;
+class plPipeline;
+class plUUID;
+class pyAgeInfoStruct;
+class pyColor;
+class pyGUIDialog;
+class pyKey;
+class pyPlayer;
+class pyPoint3;
+class pySceneObject;
namespace ST { class string; }
typedef struct _object PyObject;
@@ -897,6 +898,7 @@ class cyMisc
static ST::string GetLocalizedString(const ST::string& name, const std::vector & arguments);
static void EnablePlanarReflections(bool enable = true);
+ static bool ArePlanarReflectionsSupported();
static void SetGraphicsOptions(int Width, int Height, int ColorDepth, bool Windowed, int NumAASamples, int MaxAnisotropicSamples, bool VSync);
static void GetSupportedDisplayModes(std::vector *res);
static int GetDesktopWidth();
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue.cpp
index a6fa1ad1c6..3aab3a215f 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue.cpp
@@ -42,7 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "cyMisc.h"
-#include
#include
#include
#include
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue2.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue2.cpp
index 8c52696a62..fe9f703868 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue2.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue2.cpp
@@ -42,23 +42,22 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "cyMisc.h"
-#include
#include
#include
#include
-#include "pyEnum.h"
+#include "plMessage/plConfirmationMsg.h"
+#include "plMessage/plLOSRequestMsg.h"
+#include "plNetCommon/plNetCommon.h"
+#include "plResMgr/plLocalization.h"
+
+#include "plPythonCallable.h"
+#include "plPythonConvert.h"
#include "pyColor.h"
+#include "pyEnum.h"
#include "pyGlueHelpers.h"
#include "pyKey.h"
#include "pyPlayer.h"
-#include "plPythonCallable.h"
-#include "plPythonConvert.h"
-
-#include "plMessage/plConfirmationMsg.h"
-#include "plNetCommon/plNetCommon.h"
-#include "plResMgr/plLocalization.h"
-#include "plMessage/plLOSRequestMsg.h"
namespace plPython
{
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue3.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue3.cpp
index 8e1994a59f..e4df581709 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue3.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue3.cpp
@@ -40,15 +40,18 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
-#include
+#include "cyMisc.h"
+
#include
#include
-#include "pyKey.h"
-#include "cyMisc.h"
+#include "plFileSystem.h"
+
+#include "pnUUID/pnUUID.h"
+
#include "pyGlueHelpers.h"
+#include "pyKey.h"
#include "pySceneObject.h"
-#include "pnUUID/pnUUID.h"
PYTHON_GLOBAL_METHOD_DEFINITION(PtSendPetitionToCCR, args, "Params: message,reason=0,title=\"\"\nSends a petition with a message to the CCR group")
{
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp
index 440c7ee68b..3843b10982 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp
@@ -40,19 +40,20 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
-#include
-#include
+#include "cyMisc.h"
+
+#include
#include
-#include "pyGeometry3.h"
-#include "pyKey.h"
#include "plPipeline.h"
-#include "cyMisc.h"
+#include "pnNetBase/pnNetBase.h"
+
+#include "pyAgeInfoStruct.h"
+#include "pyGeometry3.h"
#include "pyGlueHelpers.h"
+#include "pyKey.h"
#include "pySceneObject.h"
-#include "pyAgeInfoStruct.h"
-#include "pnNetBase/pnNetBase.h"
PYTHON_GLOBAL_METHOD_DEFINITION(PtRequestLOSScreen, args, "Params: selfKey,ID,xPos,yPos,distance,what,reportType\nRequest a LOS check from a point on the screen")
{
@@ -610,6 +611,11 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtEnablePlanarReflections, args, "Params: on\nEn
PYTHON_RETURN_NONE;
}
+PYTHON_GLOBAL_METHOD_DEFINITION_NOARGS(PtSupportsPlanarReflections, "Returns if planar reflections are supported")
+{
+ return PyBool_FromLong(cyMisc::ArePlanarReflectionsSupported() ? 1 : 0);
+}
+
PYTHON_GLOBAL_METHOD_DEFINITION_NOARGS(PtGetSupportedDisplayModes, "Returns a list of supported resolutions")
{
std::vector res;
@@ -818,6 +824,7 @@ void cyMisc::AddPlasmaMethods4(PyObject* m)
PYTHON_GLOBAL_METHOD_NOARGS(PtCheckVisLOSFromCursor)
PYTHON_GLOBAL_METHOD(PtEnablePlanarReflections)
+ PYTHON_GLOBAL_METHOD_NOARGS(PtSupportsPlanarReflections)
PYTHON_GLOBAL_METHOD_NOARGS(PtGetSupportedDisplayModes)
PYTHON_GLOBAL_METHOD_NOARGS(PtGetDesktopWidth)
PYTHON_GLOBAL_METHOD_NOARGS(PtGetDesktopHeight)
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyParticleSys.cpp b/Sources/Plasma/FeatureLib/pfPython/cyParticleSys.cpp
index 54904a6c19..1bb0faf800 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyParticleSys.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyParticleSys.cpp
@@ -40,10 +40,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
+#include "cyParticleSys.h"
+
#include "plgDispatch.h"
-#include "cyParticleSys.h"
#include "pnMessage/plMessage.h"
+
#include "plMessage/plParticleUpdateMsg.h"
cyParticleSys::cyParticleSys(plKey sender, plKey recvr)
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyParticleSys.h b/Sources/Plasma/FeatureLib/pfPython/cyParticleSys.h
index 680665592b..56675bf1e7 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyParticleSys.h
+++ b/Sources/Plasma/FeatureLib/pfPython/cyParticleSys.h
@@ -52,7 +52,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include
#include "pnKeyedObject/plKey.h"
-#include "pyGlueHelpers.h"
+
+#include "pyGlueDefinitions.h"
class cyParticleSys
{
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyParticleSysGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyParticleSysGlue.cpp
index 408714f042..562e7f8a0d 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyParticleSysGlue.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyParticleSysGlue.cpp
@@ -40,11 +40,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
-#include
-#include "pyKey.h"
-
#include "cyParticleSys.h"
+#include "pyGlueHelpers.h"
+#include "pyKey.h"
// glue functions
PYTHON_CLASS_DEFINITION(ptParticle, cyParticleSys);
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyPhysics.cpp b/Sources/Plasma/FeatureLib/pfPython/cyPhysics.cpp
index a924bac9d6..22083a2cb7 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyPhysics.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyPhysics.cpp
@@ -40,25 +40,28 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
+#include "cyPhysics.h"
+
#include
+#include
+
#include "plgDispatch.h"
-#include "pyGeometry3.h"
-#include "pnKeyedObject/plKey.h"
-#include "pyKey.h"
#include "hsQuat.h"
-#include "pyMatrix44.h"
-#include "cyPhysics.h"
+#include "pnKeyedObject/plKey.h"
+#include "pnMessage/plEnableMsg.h"
+#include "pnMessage/plWarpMsg.h"
+#include "pnSceneObject/plCoordinateInterface.h"
+#include "pnSceneObject/plSceneObject.h"
#include "plMessage/plAngularVelocityMsg.h"
#include "plMessage/plDampMsg.h"
-#include "pnMessage/plEnableMsg.h"
#include "plMessage/plImpulseMsg.h"
#include "plMessage/plLinearVelocityMsg.h"
-#include "pnMessage/plWarpMsg.h"
-#include "pnSceneObject/plSceneObject.h"
-#include "pnSceneObject/plCoordinateInterface.h"
+#include "pyGeometry3.h"
+#include "pyKey.h"
+#include "pyMatrix44.h"
cyPhysics::cyPhysics(plKey sender, plKey recvr)
{
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyPhysics.h b/Sources/Plasma/FeatureLib/pfPython/cyPhysics.h
index 26ba2779cc..37a1a6e988 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyPhysics.h
+++ b/Sources/Plasma/FeatureLib/pfPython/cyPhysics.h
@@ -52,11 +52,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include
#include "pnKeyedObject/plKey.h"
-#include "pyGlueHelpers.h"
+#include "pyGlueDefinitions.h"
+
+class pyKey;
+class pyMatrix44;
class pyPoint3;
class pyVector3;
-class pyMatrix44;
class cyPhysics
{
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyPhysicsGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyPhysicsGlue.cpp
index aa083cd394..e701d6c5ad 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyPhysicsGlue.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyPhysicsGlue.cpp
@@ -40,13 +40,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
-#include
+#include "cyPhysics.h"
+
#include "pyGeometry3.h"
+#include "pyGlueHelpers.h"
#include "pyKey.h"
#include "pyMatrix44.h"
-#include "cyPhysics.h"
-
// glue functions
PYTHON_CLASS_DEFINITION(ptPhysics, cyPhysics);
diff --git a/Sources/Plasma/FeatureLib/pfPython/cyPythonModule451.cpp b/Sources/Plasma/FeatureLib/pfPython/cyPythonModule451.cpp
index 2136a711cc..e3a7291bc2 100644
--- a/Sources/Plasma/FeatureLib/pfPython/cyPythonModule451.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/cyPythonModule451.cpp
@@ -40,16 +40,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
-#include
-#include "pyGlueHelpers.h"
-#include "pyObjectRef.h"
#include
#include
+#include "plStatusLog/plStatusLog.h"
+
#include "cyPythonInterface.h"
#include "plPythonPack.h"
-
-#include "plStatusLog/plStatusLog.h"
+#include "pyGlueHelpers.h"
+#include "pyObjectRef.h"
// ==========================================================================
diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonCallable.h b/Sources/Plasma/FeatureLib/pfPython/plPythonCallable.h
index 78bfcfe509..a950aa6834 100644
--- a/Sources/Plasma/FeatureLib/pfPython/plPythonCallable.h
+++ b/Sources/Plasma/FeatureLib/pfPython/plPythonCallable.h
@@ -48,7 +48,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include
#include
-#include
#include
#include "HeadSpin.h"
diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonConvert.h b/Sources/Plasma/FeatureLib/pfPython/plPythonConvert.h
index 1a6ed53f31..ec752dfa9f 100644
--- a/Sources/Plasma/FeatureLib/pfPython/plPythonConvert.h
+++ b/Sources/Plasma/FeatureLib/pfPython/plPythonConvert.h
@@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef _plPythonConvert_h_
#define _plPythonConvert_h_
-#include
#include
#include
#include
diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp b/Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp
index 6094db72be..d433a78eb0 100644
--- a/Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp
@@ -43,6 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include
#include
#include
+#include
#include "HeadSpin.h"
#include "hsStream.h"
diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.cpp b/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.cpp
index 960119aa2d..9d68513abf 100644
--- a/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.cpp
+++ b/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.cpp
@@ -40,25 +40,24 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
-#include
-#include "pyKey.h"
-
#include "plPythonSDLModifier.h"
-#include "cyPythonInterface.h"
-
-#include "plPythonFileMod.h"
-#include "pyObjectRef.h"
-#include "cyMisc.h"
#include
#include "pnNetCommon/plNetApp.h"
#include "pnSceneObject/plSceneObject.h"
-#include "plResMgr/plKeyFinder.h"
-#include "plAgeDescription/plAgeDescription.h"
+#include "plAgeDescription/plAgeDescription.h"
+#include "plResMgr/plKeyFinder.h"
#include "plSDL/plSDL.h"
+#include "cyMisc.h"
+#include "cyPythonInterface.h"
+#include "plPythonFileMod.h"
+#include "pyGlueHelpers.h"
+#include "pyKey.h"
+#include "pyObjectRef.h"
+
plStateDataRecord * GetAgeSDL()
{
const plPythonSDLModifier * mod = plPythonSDLModifier::FindAgeSDL();
diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.h b/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.h
index 06b8d7cd61..75f36ff339 100644
--- a/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.h
+++ b/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.h
@@ -42,16 +42,16 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef plPythonSDLModifier_h_inc
#define plPythonSDLModifier_h_inc
-class plPythonFileMod;
-class plStateDataRecord;
-class plSimpleStateVariable;
-class pyKey;
-
#include