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 + #include "plModifier/plSDLModifier.h" -#include "pyGlueHelpers.h" +#include "pyGlueDefinitions.h" +class plPythonFileMod; +class plSimpleStateVariable; +class plStateDataRecord; +class pyKey; // hack for plNetClientVNodeMgr single-player mode SDLHook stuff. plStateDataRecord * GetAgeSDL(); diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifierGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifierGlue.cpp index 18c88e0eca..a0983ae698 100644 --- a/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifierGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifierGlue.cpp @@ -40,13 +40,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "plPythonSDLModifier.h" + #include +#include "pyGlueHelpers.h" #include "pyKey.h" -#include "plPythonSDLModifier.h" - // glue functions PYTHON_CLASS_DEFINITION(ptSDL, pySDLModifier); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp index 0b0b48ec12..72baed6d2c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp @@ -40,11 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ +#include "pyAgeInfoStruct.h" + #include #include -#include "pyAgeInfoStruct.h" - #include "pnEncryption/plChecksum.h" #include "pnUUID/pnUUID.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h index baf869d463..0148c0f551 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h @@ -46,7 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plNetCommon/plNetServerSessionInfo.h" -#include "pyGlueHelpers.h" +#include "pyGlueDefinitions.h" ////////////////////////////////////////////////////////////////////// // diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStructGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStructGlue.cpp index 6d2c898ae5..0fd32130ed 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStructGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStructGlue.cpp @@ -40,10 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyAgeInfoStruct.h" + #include -#include "pyAgeInfoStruct.h" +#include "pyGlueHelpers.h" // glue functions PYTHON_CLASS_DEFINITION(ptAgeInfoStruct, pyAgeInfoStruct); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.cpp b/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.cpp index 97f1795111..6830517699 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.cpp @@ -40,10 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ +#include "pyAgeLinkStruct.h" + #include #include -#include "pyAgeLinkStruct.h" #include "pyAgeInfoStruct.h" #include "pySpawnPointInfo.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.h b/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.h index cf11f4036f..b38067fe28 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.h @@ -43,7 +43,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define pyAgeLinkStruct_h_inc #include "plNetCommon/plNetServerSessionInfo.h" -#include "pyGlueHelpers.h" + +#include "pyGlueDefinitions.h" ////////////////////////////////////////////////////////////////////// // @@ -51,10 +52,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +class pyAgeInfoStruct; +class pyAgeLinkStructRef; class pySpawnPointInfo; class pySpawnPointInfoRef; -class pyAgeLinkStructRef; -class pyAgeInfoStruct; class pyAgeLinkStruct { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStructGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStructGlue.cpp index 2bbc7e569f..0ad89d3fcc 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStructGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStructGlue.cpp @@ -40,12 +40,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyAgeLinkStruct.h" + #include #include -#include "pyAgeLinkStruct.h" #include "pyAgeInfoStruct.h" +#include "pyGlueHelpers.h" #include "pySpawnPointInfo.h" // glue functions diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp b/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp index 51b32d9cd4..cd83825af6 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp @@ -45,23 +45,23 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include +#include "pyAgeVault.h" + #include #include "pnNetBase/pnNbError.h" -#include "pyAgeVault.h" -#include "pyVaultFolderNode.h" +#include "plSDL/plSDL.h" +#include "plVault/plVault.h" + +#include "pyAgeInfoStruct.h" +#include "pyGlueHelpers.h" +#include "pySDL.h" #include "pyVaultAgeInfoNode.h" #include "pyVaultAgeLinkNode.h" #include "pyVaultChronicleNode.h" +#include "pyVaultFolderNode.h" #include "pyVaultTextNoteNode.h" -#include "pyAgeInfoStruct.h" -#include "pySDL.h" - - -#include "plVault/plVault.h" -#include "plSDL/plSDL.h" pyAgeVault::pyAgeVault() { } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.h b/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.h index 749e7e85da..ec3066ea5d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.h @@ -53,18 +53,19 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// #include "HeadSpin.h" -#include "pyGlueHelpers.h" -class pyVaultNode; -class pyVaultFolderNode; -class pyVaultPlayerInfoListNode; -class pyVaultAgeLinkNode; -class pyVaultAgeInfoNode; +#include "pyGlueDefinitions.h" + +class plUUID; class pyAgeInfoStruct; -class pyVaultChronicleNode; class pySDLStateDataRecord; +class pyVaultAgeInfoNode; +class pyVaultAgeLinkNode; +class pyVaultChronicleNode; +class pyVaultFolderNode; +class pyVaultNode; +class pyVaultPlayerInfoListNode; class pyVaultTextNoteNode; -class plUUID; namespace ST { class string; } class pyAgeVault diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeVaultGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyAgeVaultGlue.cpp index 8d6cb75b37..e64e6dd328 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeVaultGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeVaultGlue.cpp @@ -40,11 +40,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyAgeVault.h" + #include -#include "pyAgeVault.h" #include "pyAgeInfoStruct.h" +#include "pyGlueHelpers.h" #include "pySDL.h" // glue functions diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAudioControl.h b/Sources/Plasma/FeatureLib/pfPython/pyAudioControl.h index 49b1ab02c9..cbba936c18 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAudioControl.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyAudioControl.h @@ -49,10 +49,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// #include "HeadSpin.h" -#include "pyGlueHelpers.h" + #include #include +#include "pyGlueDefinitions.h" + class pyAudioControl { protected: diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAudioControlGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyAudioControlGlue.cpp index 44b7397226..817482de52 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAudioControlGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyAudioControlGlue.cpp @@ -40,10 +40,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include - #include "pyAudioControl.h" +#include "pyGlueHelpers.h" + // glue functions PYTHON_CLASS_DEFINITION(ptAudioControl, pyAudioControl); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyCluster.cpp b/Sources/Plasma/FeatureLib/pfPython/pyCluster.cpp index 29b6504df3..f3b0a33760 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyCluster.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyCluster.cpp @@ -40,11 +40,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include "pyKey.h" - #include "pyCluster.h" + #include "plDrawable/plClusterGroup.h" +#include "pyKey.h" + pyCluster::pyCluster(plKey key) { fClusterKey = std::move(key); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyCluster.h b/Sources/Plasma/FeatureLib/pfPython/pyCluster.h index 50af82c0b6..296bf54980 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyCluster.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyCluster.h @@ -43,7 +43,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define pyCluster_h #include "pnKeyedObject/plKey.h" -#include "pyGlueHelpers.h" + +#include "pyGlueDefinitions.h" ////////////////////////////////////////////////////////////////////// // diff --git a/Sources/Plasma/FeatureLib/pfPython/pyClusterGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyClusterGlue.cpp index 08fe4c3e6f..2852ed5b68 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyClusterGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyClusterGlue.cpp @@ -40,11 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" - #include "pyCluster.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" + // glue functions PYTHON_CLASS_DEFINITION(ptCluster, pyCluster); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyColor.h b/Sources/Plasma/FeatureLib/pfPython/pyColor.h index 4ed4424a34..29f536db28 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyColor.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyColor.h @@ -50,7 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsColorRGBA.h" -#include "pyGlueHelpers.h" +#include "pyGlueDefinitions.h" class pyColor { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyColorGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyColorGlue.cpp index d7b8d82f9f..3aadc1a739 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyColorGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyColorGlue.cpp @@ -40,10 +40,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include - #include "pyColor.h" +#include "pyGlueHelpers.h" + // glue functions PYTHON_CLASS_DEFINITION(ptColor, pyColor); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyCritterBrain.cpp b/Sources/Plasma/FeatureLib/pfPython/pyCritterBrain.cpp index 9bf9e3b125..2585c90bbf 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyCritterBrain.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyCritterBrain.cpp @@ -40,18 +40,18 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyCritterBrain.h" + #include +#include "plAvatar/plAvBrainCritter.h" +#include "pnSceneObject/plSceneObject.h" + #include "pyGeometry3.h" +#include "pyGlueHelpers.h" #include "pyKey.h" - -#include "pyCritterBrain.h" #include "pySceneObject.h" -#include "plAvatar/plAvBrainCritter.h" -#include "pnSceneObject/plSceneObject.h" - pyCritterBrain::pyCritterBrain() : fBrain() { } bool pyCritterBrain::operator==(const pyCritterBrain& other) const diff --git a/Sources/Plasma/FeatureLib/pfPython/pyCritterBrain.h b/Sources/Plasma/FeatureLib/pfPython/pyCritterBrain.h index 6646cd46d4..078b4e6b15 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyCritterBrain.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyCritterBrain.h @@ -42,11 +42,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef _pyCritterBrain_h_ #define _pyCritterBrain_h_ -#include "pyGlueHelpers.h" +#include "pyGlueDefinitions.h" +struct hsPoint3; class plAvBrainCritter; class pyKey; -struct hsPoint3; namespace ST { class string; } // simply here so we can pass our message types on to python diff --git a/Sources/Plasma/FeatureLib/pfPython/pyCritterBrainGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyCritterBrainGlue.cpp index 76c9d84e6a..4e2f03df0a 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyCritterBrainGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyCritterBrainGlue.cpp @@ -40,16 +40,16 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyCritterBrain.h" + #include -#include "pyGeometry3.h" -#include "pyKey.h" +#include "plMessage/plAIMsg.h" -#include "pyCritterBrain.h" #include "pyEnum.h" - -#include "plMessage/plAIMsg.h" +#include "pyGeometry3.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" /////////////////////////////////////////////////////////////////////////////// // diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.cpp b/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.cpp index a7ed93cc14..66ac3278e2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.cpp @@ -40,13 +40,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ +#include "pyDniCoordinates.h" + #include "hsGeometry3.h" -#include "pyDniCoordinates.h" -#include "plVault/plDniCoordinateInfo.h" #ifndef BUILDING_PYPLASMA #include "plAvatar/plAvatarMgr.h" #endif +#include "plVault/plDniCoordinateInfo.h" pyDniCoordinates::pyDniCoordinates(plDniCoordinateInfo* coord) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.h b/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.h index c0e85ea146..75dd39a2ac 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include "pyGlueHelpers.h" +#include "pyGlueDefinitions.h" -class plDniCoordinateInfo; struct hsPoint3; +class plDniCoordinateInfo; class pyDniCoordinates { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinatesGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinatesGlue.cpp index 334fc1fca2..4d3c044d39 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinatesGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinatesGlue.cpp @@ -40,12 +40,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyGeometry3.h" - #include "pyDniCoordinates.h" + #include "plVault/plDniCoordinateInfo.h" +#include "pyGeometry3.h" +#include "pyGlueHelpers.h" + // glue functions PYTHON_CLASS_DEFINITION(ptDniCoordinates, pyDniCoordinates); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp index f8dc520e7b..f60e50dd67 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp @@ -40,14 +40,16 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyDniInfoSource.h" + #include -#include "pyDniInfoSource.h" -#include "pnUUID/pnUUID.h" #include "plUnifiedTime/plUnifiedTime.h" +#include "pnUUID/pnUUID.h" #include "plVault/plVault.h" + #include "pyDniCoordinates.h" +#include "pyGlueHelpers.h" PyObject* pyDniInfoSource::GetAgeCoords() { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.h b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.h index 87b87cb19c..3fdd6e3867 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.h @@ -43,10 +43,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define pyDniInfoSource_h_inc #include "HeadSpin.h" -#include "pyGlueHelpers.h" -class pyDniCoordinates; +#include "pyGlueDefinitions.h" + class plUUID; +class pyDniCoordinates; namespace ST { class string; } class pyDniInfoSource diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSourceGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSourceGlue.cpp index 989662d226..fedfc8fa09 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSourceGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSourceGlue.cpp @@ -40,12 +40,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyDniInfoSource.h" + #include -#include "pyDniInfoSource.h" #include "pnUUID/pnUUID.h" +#include "pyGlueHelpers.h" + // glue functions PYTHON_CLASS_DEFINITION(ptDniInfoSource, pyDniInfoSource); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDrawControl.cpp b/Sources/Plasma/FeatureLib/pfPython/pyDrawControl.cpp index dfb8e75f5e..1a6c983632 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDrawControl.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyDrawControl.cpp @@ -45,19 +45,20 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include "plgDispatch.h" -#include "hsResMgr.h" - #include "pyDrawControl.h" #include +#include "hsResMgr.h" +#include "plgDispatch.h" + #ifndef BUILDING_PYPLASMA +# include "pnMessage/plClientMsg.h" + # include "plAvatar/plArmatureMod.h" # include "plGLight/plShadowCaster.h" # include "plGLight/plShadowMaster.h" # include "plInputCore/plInputDevice.h" -# include "pnMessage/plClientMsg.h" # include "plMessage/plInputEventMsg.h" #endif diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDrawControl.h b/Sources/Plasma/FeatureLib/pfPython/pyDrawControl.h index 5b143e2836..7850597db5 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDrawControl.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyDrawControl.h @@ -48,7 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include "pyGlueHelpers.h" +#include "pyGlueDefinitions.h" class pyDrawControl { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDrawControlGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyDrawControlGlue.cpp index 90f53bef6e..8385bbffa4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDrawControlGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyDrawControlGlue.cpp @@ -40,10 +40,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include - #include "pyDrawControl.h" +#include "pyGlueHelpers.h" + PYTHON_GLOBAL_METHOD_DEFINITION(PtSetGamma2, args, "Params: gamma\nSet the gamma with gamma2 rules") { float gamma; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.cpp b/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.cpp index a80e48833d..5e63757842 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.cpp @@ -46,17 +46,19 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // ////////////////////////////////////////////////////////////////////////////// +#include "pyDynamicText.h" + #include #include + #include "plgDispatch.h" -#include "pyKey.h" -#include "pyDynamicText.h" +#include "plGImage/plDynamicTextMap.h" #include "plMessage/plDynamicTextMsg.h" + #include "pyColor.h" #include "pyImage.h" -#include "plGImage/plDynamicTextMap.h" - +#include "pyKey.h" pyDynamicText::pyDynamicText() : fClipLeft(), fClipTop(), fClipRight(), fClipBottom(), fWrapWidth(), fWrapHeight(), diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.h b/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.h index ac53253112..5107d01856 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.h @@ -48,15 +48,18 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include + +#include "pnKeyedObject/plKey.h" + +#include "pyGlueDefinitions.h" + class plDynamicTextMsg; class pyColor; class pyImage; class pyKey; namespace ST { class string; } -#include "pyGlueHelpers.h" -#include "pnKeyedObject/plKey.h" - class pyDynamicText { private: diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDynamicTextGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyDynamicTextGlue.cpp index 83952d6350..95d5ddba39 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDynamicTextGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyDynamicTextGlue.cpp @@ -40,16 +40,18 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyDynamicText.h" + #include #include -#include "pyKey.h" -#include "pyDynamicText.h" -#include "pyEnum.h" +#include "plGImage/plDynamicTextMap.h" + #include "pyColor.h" +#include "pyEnum.h" +#include "pyGlueHelpers.h" #include "pyImage.h" -#include "plGImage/plDynamicTextMap.h" +#include "pyKey.h" // glue functions PYTHON_CLASS_DEFINITION(ptDynamicMap, pyDynamicText); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.cpp index 85937d9e6e..290adfe3aa 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.cpp @@ -40,17 +40,16 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" - #include "pyGUIControl.h" #include "pfGameGUIMgr/pfGUIControlMod.h" #include "pfGameGUIMgr/pfGUIDialogMod.h" -#include "pyGUIDialog.h" #include "pyColor.h" #include "pyGeometry3.h" +#include "pyGlueHelpers.h" +#include "pyGUIDialog.h" +#include "pyKey.h" pyGUIControl::pyGUIControl(pyKey& gckey) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.h index 852c335c83..ba8feb8859 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.h @@ -49,9 +49,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include "pyGlueHelpers.h" #include "pnKeyedObject/plKey.h" +#include "pyGlueDefinitions.h" + class pyKey; class pyPoint3; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButton.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButton.cpp index ba2ba85f98..1d5f2a0788 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButton.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButton.cpp @@ -40,11 +40,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include "pyKey.h" - #include "pyGUIControlButton.h" + #include "pfGameGUIMgr/pfGUIButtonMod.h" +#include "pyKey.h" + pyGUIControlButton::pyGUIControlButton(pyKey& gckey) : pyGUIControl(gckey) { } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButton.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButton.h index d019e8bb31..a9140d55f3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButton.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButton.h @@ -50,7 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// -#include "pyGlueHelpers.h" +#include "pyGlueDefinitions.h" #include "pyGUIControl.h" class plKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButtonGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButtonGlue.cpp index 9608efb117..ed28ceb810 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButtonGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButtonGlue.cpp @@ -40,13 +40,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" +#include "pyGUIControlButton.h" #include "pfGameGUIMgr/pfGUIButtonMod.h" #include "pyEnum.h" -#include "pyGUIControlButton.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlButton, pyGUIControlButton); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBox.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBox.cpp index 5e32e5d1d3..a847bf4812 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBox.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBox.cpp @@ -40,13 +40,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include "pyKey.h" +#include "pyGUIControlCheckBox.h" #include "pfGameGUIMgr/pfGUICheckBoxCtrl.h" #include "pfGameGUIMgr/pfGUIDialogMod.h" -#include "pyGUIControlCheckBox.h" -#include "pyGUIDialog.h" +#include "pyKey.h" pyGUIControlCheckBox::pyGUIControlCheckBox(pyKey& gckey) : pyGUIControl(gckey) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBox.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBox.h index 2c6c5796ce..a3569891cc 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBox.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBox.h @@ -50,7 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// -#include "pyGlueHelpers.h" +#include "pyGlueDefinitions.h" #include "pyGUIControl.h" class plKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBoxGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBoxGlue.cpp index 16cc279956..03779dcf57 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBoxGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBoxGlue.cpp @@ -40,11 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" - #include "pyGUIControlCheckBox.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" + // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlCheckBox, pyGUIControlCheckBox); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMap.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMap.cpp index 1eb130bbdc..16b878d892 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMap.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMap.cpp @@ -40,15 +40,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" +#include "pyGUIControlClickMap.h" #include "pfGameGUIMgr/pfGUIClickMapCtrl.h" #include "pfGameGUIMgr/pfGUIDialogMod.h" -#include "pyGUIControlClickMap.h" -#include "pyGUIDialog.h" #include "pyGeometry3.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" pyGUIControlClickMap::pyGUIControlClickMap(pyKey& gckey) : pyGUIControl(gckey) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMap.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMap.h index 9840721ab9..f13bdaf2e2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMap.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMap.h @@ -49,7 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include "pyGlueHelpers.h" +#include "pyGlueDefinitions.h" #include "pyGUIControl.h" class plKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMapGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMapGlue.cpp index a8b3adca45..216f797239 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMapGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMapGlue.cpp @@ -40,11 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" - #include "pyGUIControlClickMap.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" + // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlClickMap, pyGUIControlClickMap); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBar.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBar.cpp index 5c319b9bf3..4cbf1aa13c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBar.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBar.cpp @@ -44,10 +44,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // /////////////////////////////////////////////// -#include "pyKey.h" +#include "pyGUIControlDragBar.h" #include "pfGameGUIMgr/pfGUIDragBarCtrl.h" -#include "pyGUIControlDragBar.h" + +#include "pyKey.h" pyGUIControlDragBar::pyGUIControlDragBar(pyKey& gckey) : pyGUIControl(gckey) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBar.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBar.h index 7072509220..c4474c1dc6 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBar.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBar.h @@ -50,7 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// -#include "pyGlueHelpers.h" +#include "pyGlueDefinitions.h" #include "pyGUIControl.h" class plKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBarGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBarGlue.cpp index 472785d846..7d045769c3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBarGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBarGlue.cpp @@ -40,11 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" - #include "pyGUIControlDragBar.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" + // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlDragBar, pyGUIControlDragBar); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.cpp index e1816cec8c..cc4e3c719d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.cpp @@ -40,13 +40,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" +#include "pyGUIControlDraggable.h" #include "pfGameGUIMgr/pfGUIDraggableMod.h" -#include "pyGUIControlDraggable.h" #include "pyGeometry3.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" pyGUIControlDraggable::pyGUIControlDraggable(pyKey& gckey) : pyGUIControl(gckey) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.h index 09f5a14a25..03d0291f54 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.h @@ -49,8 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include "pyGlueHelpers.h" - +#include "pyGlueDefinitions.h" #include "pyGUIControl.h" class plKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggableGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggableGlue.cpp index 99f44b48ff..d0036fd8c0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggableGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggableGlue.cpp @@ -40,11 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" - #include "pyGUIControlDraggable.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" + // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlDraggable, pyGUIControlDraggable); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicText.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicText.cpp index 855df866d4..10b686fbf1 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicText.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicText.cpp @@ -40,14 +40,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" +#include "pyGUIControlDynamicText.h" -#include "pfGameGUIMgr/pfGUIDynDisplayCtrl.h" #include "plGImage/plDynamicTextMap.h" -#include "pyDynamicText.h" -#include "pyGUIControlDynamicText.h" +#include "pfGameGUIMgr/pfGUIDynDisplayCtrl.h" + +#include "pyDynamicText.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" pyGUIControlDynamicText::pyGUIControlDynamicText(pyKey& gckey) : pyGUIControl(gckey) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicText.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicText.h index 6e1594bd76..7a036acc1d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicText.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicText.h @@ -49,11 +49,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include "pyGlueDefinitions.h" #include "pyGUIControl.h" -#include "pyGlueHelpers.h" -class pyKey; class plKey; +class pyKey; class pyGUIControlDynamicText : public pyGUIControl { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicTextGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicTextGlue.cpp index 00bdca8f5c..c99e2ef041 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicTextGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicTextGlue.cpp @@ -40,11 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" - #include "pyGUIControlDynamicText.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" + // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlDynamicText, pyGUIControlDynamicText); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBox.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBox.cpp index a302e1b26f..5438bcb941 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBox.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBox.cpp @@ -40,14 +40,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyGUIControlEditBox.h" -#include "pyKey.h" +#include #include "pfGameGUIMgr/pfGUIEditBoxMod.h" -#include "pyGUIControlEditBox.h" #include "pyColor.h" +#include "pyKey.h" pyGUIControlEditBox::pyGUIControlEditBox(pyKey& gckey) : pyGUIControl(gckey) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBox.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBox.h index 5155724f1c..fa044ea429 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBox.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBox.h @@ -49,7 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include "pyGlueHelpers.h" +#include "pyGlueDefinitions.h" #include "pyGUIControl.h" class plKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBoxGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBoxGlue.cpp index ecbe4b48c2..1692302a27 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBoxGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBoxGlue.cpp @@ -40,13 +40,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include +#include "pyGUIControlEditBox.h" -#include "pyKey.h" +#include -#include "pyGUIControlEditBox.h" #include "pyColor.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlEditBox, pyGUIControlEditBox); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlGlue.cpp index 3ea5e1790e..b45a20f704 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlGlue.cpp @@ -40,11 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" - #include "pyGUIControl.h" + #include "pyGeometry3.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" // glue functions PYTHON_CLASS_DEFINITION(ptGUIControl, pyGUIControl); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp index 0a3d278d3e..bbec9db4e4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp @@ -40,18 +40,19 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include +#include "pyGUIControlListBox.h" -#include "pyKey.h" +#include + +#include "plGImage/plDynamicTextMap.h" #include "pfGameGUIMgr/pfGUIListBoxMod.h" #include "pfGameGUIMgr/pfGUIListElement.h" -#include "plGImage/plDynamicTextMap.h" -#include "pyGUIControlListBox.h" #include "pyColor.h" +#include "pyGlueHelpers.h" #include "pyImage.h" +#include "pyKey.h" // a special class for different coloured list items // diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.h index 0c78513864..1881f0b205 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.h @@ -51,15 +51,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include +#include "pyGlueDefinitions.h" #include "pyGUIControl.h" -#include "pyGlueHelpers.h" +class pfGUIListTreeRoot; class plKey; class pyColor; class pyImage; class pyKey; - -class pfGUIListTreeRoot; namespace ST { class string; } class pyGUIControlListBox : public pyGUIControl diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBoxGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBoxGlue.cpp index f3b1f9ef45..c96c29c44f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBoxGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBoxGlue.cpp @@ -40,15 +40,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include - -#include "pyKey.h" - #include "pyGUIControlListBox.h" +#include + #include "pyColor.h" +#include "pyGlueHelpers.h" #include "pyImage.h" +#include "pyKey.h" // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlListBox, pyGUIControlListBox); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.cpp index 509a22bafb..852ca8e10b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.cpp @@ -40,15 +40,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" +#include "pyGUIControlMultiLineEdit.h" #include #include "pfGameGUIMgr/pfGUIMultiLineEditCtrl.h" -#include "pyGUIControlMultiLineEdit.h" #include "pyColor.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" pyGUIControlMultiLineEdit::pyGUIControlMultiLineEdit(pyKey& gckey) : pyGUIControl(gckey) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.h index caf958b084..87a5d6e92e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.h @@ -49,8 +49,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include "pyGlueDefinitions.h" #include "pyGUIControl.h" -#include "pyGlueHelpers.h" #include diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEditGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEditGlue.cpp index 67acaabdbe..a453580e65 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEditGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEditGlue.cpp @@ -40,16 +40,16 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyGUIControlMultiLineEdit.h" + #include -#include "pyKey.h" +#include "pfGameGUIMgr/pfGUIMultiLineEditCtrl.h" -#include "pyGUIControlMultiLineEdit.h" -#include "pyEnum.h" #include "pyColor.h" - -#include "pfGameGUIMgr/pfGUIMultiLineEditCtrl.h" +#include "pyEnum.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlMultiLineEdit, pyGUIControlMultiLineEdit); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.cpp index 0d439f76af..3dbd219d92 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.cpp @@ -40,11 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include "pyKey.h" +#include "pyGUIControlRadioGroup.h" #include "pfGameGUIMgr/pfGUIRadioGroupCtrl.h" -#include "pyGUIControlRadioGroup.h" +#include "pyKey.h" pyGUIControlRadioGroup::pyGUIControlRadioGroup(pyKey& gckey) :pyGUIControl(gckey) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.h index 6e10f7f3dc..9de3faac01 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.h @@ -49,10 +49,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include "pyGlueDefinitions.h" #include "pyGUIControl.h" -#include "pyGlueHelpers.h" - class plKey; class pyKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroupGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroupGlue.cpp index d24696b159..89ab8841c2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroupGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroupGlue.cpp @@ -40,11 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" - #include "pyGUIControlRadioGroup.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" + // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlRadioGroup, pyGUIControlRadioGroup); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBox.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBox.cpp index 6b1b9c9868..3c1daf2019 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBox.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBox.cpp @@ -40,15 +40,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyGUIControlTextBox.h" -#include "pyKey.h" +#include -#include "pfGameGUIMgr/pfGUITextBoxMod.h" #include "pfGameGUIMgr/pfGUIListElement.h" +#include "pfGameGUIMgr/pfGUITextBoxMod.h" -#include "pyGUIControlTextBox.h" #include "pyColor.h" +#include "pyKey.h" pyGUIControlTextBox::pyGUIControlTextBox(pyKey& gckey) : pyGUIControl(gckey) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBox.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBox.h index 1dc576d43e..50a43d5745 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBox.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBox.h @@ -49,14 +49,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include "pyGlueDefinitions.h" #include "pyGUIControl.h" -#include "pyGlueHelpers.h" +class pfGUIColorScheme; class plKey; class pyColor; class pyKey; -class pfGUIColorScheme; - namespace ST { class string; } class pyGUIControlTextBox : public pyGUIControl diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBoxGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBoxGlue.cpp index a0aee89396..1ea0af1694 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBoxGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBoxGlue.cpp @@ -40,13 +40,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include +#include "pyGUIControlTextBox.h" -#include "pyKey.h" +#include -#include "pyGUIControlTextBox.h" #include "pyColor.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlTextBox, pyGUIControlTextBox); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlValue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlValue.cpp index aa1533e44a..71c326bccc 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlValue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlValue.cpp @@ -40,14 +40,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include "pyKey.h" +#include "pyGUIControlValue.h" -#include "pfGameGUIMgr/pfGUIValueCtrl.h" #include "pfGameGUIMgr/pfGUIKnobCtrl.h" -#include "pfGameGUIMgr/pfGUIUpDownPairMod.h" #include "pfGameGUIMgr/pfGUIProgressCtrl.h" +#include "pfGameGUIMgr/pfGUIUpDownPairMod.h" +#include "pfGameGUIMgr/pfGUIValueCtrl.h" -#include "pyGUIControlValue.h" +#include "pyKey.h" pyGUIControlValue::pyGUIControlValue(pyKey& gckey) : pyGUIControl(gckey) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlValue.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlValue.h index 523dd85a9a..ad92299089 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlValue.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlValue.h @@ -49,8 +49,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include "pyGlueDefinitions.h" #include "pyGUIControl.h" -#include "pyGlueHelpers.h" class plKey; class pyKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlValueGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlValueGlue.cpp index 9246f03918..cb3c10bc52 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlValueGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlValueGlue.cpp @@ -40,11 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" - #include "pyGUIControlValue.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" + // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlValue, pyGUIControlValue); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIDialog.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIDialog.cpp index 2fbd512d34..4638464dc4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIDialog.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIDialog.cpp @@ -40,35 +40,30 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include - -#include "pyKey.h" +#include "pyGUIDialog.h" -#include "pyColor.h" +#include #include "pfGameGUIMgr/pfGameGUIMgr.h" #include "pfGameGUIMgr/pfGUIDialogMod.h" +#include "pfGameGUIMgr/pfGUIKnobCtrl.h" +#include "pfGameGUIMgr/pfGUIProgressCtrl.h" +#include "pfGameGUIMgr/pfGUIUpDownPairMod.h" -#include "pyGUIDialog.h" - -// the rest of the controls +#include "pyColor.h" +#include "pyGlueHelpers.h" #include "pyGUIControlButton.h" #include "pyGUIControlCheckBox.h" +#include "pyGUIControlClickMap.h" +#include "pyGUIControlDynamicText.h" #include "pyGUIControlEditBox.h" #include "pyGUIControlListBox.h" +#include "pyGUIControlMultiLineEdit.h" #include "pyGUIControlRadioGroup.h" #include "pyGUIControlTextBox.h" #include "pyGUIControlValue.h" -#include "pyGUIControlDynamicText.h" -#include "pyGUIControlMultiLineEdit.h" #include "pyGUIPopUpMenu.h" -#include "pyGUIControlClickMap.h" - -// specific value controls -#include "pfGameGUIMgr/pfGUIKnobCtrl.h" -#include "pfGameGUIMgr/pfGUIProgressCtrl.h" -#include "pfGameGUIMgr/pfGUIUpDownPairMod.h" +#include "pyKey.h" pyGUIDialog::pyGUIDialog(pyKey& gckey) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIDialog.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIDialog.h index 874d533c1e..0dba4a6cdf 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIDialog.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIDialog.h @@ -49,10 +49,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include + #include "pnKeyedObject/plKey.h" -#include "pyGlueHelpers.h" -#include +#include "pyGlueDefinitions.h" class pyColor; class pyKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIDialogGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIDialogGlue.cpp index fa816c91a4..7ca87342ec 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIDialogGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIDialogGlue.cpp @@ -40,13 +40,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyGUIDialog.h" + #include +#include "pyGlueHelpers.h" #include "pyKey.h" -#include "pyGUIDialog.h" - // glue functions PYTHON_CLASS_DEFINITION(ptGUIDialog, pyGUIDialog); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.cpp index 4cdd085a3e..6233d09399 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.cpp @@ -40,18 +40,16 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include - -#include "pyKey.h" +#include "pyGUIPopUpMenu.h" -#include "pyColor.h" +#include +#include "pfGameGUIMgr/pfGUIControlHandlers.h" #include "pfGameGUIMgr/pfGUIControlMod.h" #include "pfGameGUIMgr/pfGUIPopUpMenu.h" -#include "pyGUIPopUpMenu.h" - -#include "pfGameGUIMgr/pfGUIControlHandlers.h" +#include "pyColor.h" +#include "pyKey.h" #define kGetMenuPtr(ret) \ if (fGCkey == nullptr) \ diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.h index 00bf0c8d18..b48b241313 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.h @@ -50,9 +50,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// #include "pnKeyedObject/plKey.h" -#include "pyGlueHelpers.h" #include "pnKeyedObject/plUoid.h" +#include "pyGlueDefinitions.h" + class pfGUIPopUpMenu; class pyColor; class pyKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenuGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenuGlue.cpp index 99a5c52e39..7581ba9028 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenuGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenuGlue.cpp @@ -40,13 +40,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyGUIPopUpMenu.h" + #include +#include "pyGlueHelpers.h" #include "pyKey.h" -#include "pyGUIPopUpMenu.h" - // glue functions PYTHON_CLASS_DEFINITION(ptGUIPopUpMenu, pyGUIPopUpMenu); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUISkin.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUISkin.cpp index 00d3767e06..d4d5db945a 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUISkin.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUISkin.cpp @@ -40,11 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include "pyKey.h" +#include "pyGUISkin.h" #include "pfGameGUIMgr/pfGUIPopUpMenu.h" -#include "pyGUISkin.h" +#include "pyKey.h" pyGUISkin::pyGUISkin(pyKey& gckey) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUISkin.h b/Sources/Plasma/FeatureLib/pfPython/pyGUISkin.h index bd799179d2..7aa54d3e18 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUISkin.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUISkin.h @@ -49,7 +49,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// #include "pnKeyedObject/plKey.h" -#include "pyGlueHelpers.h" + +#include "pyGlueDefinitions.h" class pyColor; class pyKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUISkinGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUISkinGlue.cpp index 0eb390ac88..a834a27043 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUISkinGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUISkinGlue.cpp @@ -40,11 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" - #include "pyGUISkin.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" + // glue functions PYTHON_CLASS_DEFINITION(ptGUISkin, pyGUISkin); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGameCli.h b/Sources/Plasma/FeatureLib/pfPython/pyGameCli.h index 4a5a9ff9ea..70fd9f8e35 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGameCli.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGameCli.h @@ -45,7 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" -#include "pyGlueHelpers.h" +#include "pyGlueDefinitions.h" // =========================================================================== diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGameCliGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGameCliGlue.cpp index a66317231a..6d1e8fb70c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGameCliGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGameCliGlue.cpp @@ -43,8 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyGameCli.h" #include "plPythonConvert.h" - -#include +#include "pyGlueHelpers.h" // =========================================================================== diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGameMgr.h b/Sources/Plasma/FeatureLib/pfPython/pyGameMgr.h index cbcb9517f5..25c13a5be8 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGameMgr.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGameMgr.h @@ -43,7 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef _pyGameMgr_h_ #define _pyGameMgr_h_ -#include "pyGlueHelpers.h" +#include "pyGlueDefinitions.h" class pyGameMgr { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGameMgrGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGameMgrGlue.cpp index 0e83db4434..7c7d17c020 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGameMgrGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGameMgrGlue.cpp @@ -42,10 +42,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyGameMgr.h" -#include "pyEnum.h" - #include "pnGameMgr/pnGameMgrConst.h" +#include "pyEnum.h" + // =========================================================================== void pyGameMgr::AddPlasmaGameConstantsClasses(PyObject* m) diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGameScore.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGameScore.cpp index c30a630b29..3c82ca30a7 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGameScore.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGameScore.cpp @@ -40,13 +40,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ +#include "pyGameScore.h" + #include -#include "pyKey.h" +#include "plVault/plVault.h" -#include "pyGameScore.h" #include "pfGameScoreMgr/pfGameScoreMgr.h" -#include "plVault/plVault.h" + +#include "pyKey.h" pyGameScore::pyGameScore() : fScore() diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGameScore.h b/Sources/Plasma/FeatureLib/pfPython/pyGameScore.h index 82c38632ab..1bc874925c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGameScore.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGameScore.h @@ -50,7 +50,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // #include "HeadSpin.h" -#include "pyGlueHelpers.h" + +#include "pyGlueDefinitions.h" class pfGameScore; class pyKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGameScoreGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGameScoreGlue.cpp index 3e30a96cf0..97db348c6a 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGameScoreGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGameScoreGlue.cpp @@ -40,14 +40,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyGameScore.h" + #include -#include "pyKey.h" +#include "pfGameScoreMgr/pfGameScoreMgr.h" -#include "pyGameScore.h" #include "pyEnum.h" -#include "pfGameScoreMgr/pfGameScoreMgr.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" // glue functions PYTHON_CLASS_DEFINITION(ptGameScore, pyGameScore); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGameScoreMsg.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGameScoreMsg.cpp index 2e7a8b5a12..caa096ce7e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGameScoreMsg.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGameScoreMsg.cpp @@ -45,6 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include "pfMessage/pfGameScoreMsg.h" + #include "pyGameScore.h" PyObject* pyGameScoreMsg::CreateFinal(pfGameScoreMsg* msg) diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGameScoreMsg.h b/Sources/Plasma/FeatureLib/pfPython/pyGameScoreMsg.h index 7f1f9f4b8a..3c6c203522 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGameScoreMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGameScoreMsg.h @@ -43,7 +43,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define _pyGameScoreMsg_h_ #include "pfMessage/pfGameScoreMsg.h" -#include "pyGlueHelpers.h" + +#include "pyGlueDefinitions.h" namespace ST { class string; } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGameScoreMsgGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGameScoreMsgGlue.cpp index f427adb0bf..87fafc4553 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGameScoreMsgGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGameScoreMsgGlue.cpp @@ -40,10 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyGameScoreMsg.h" + #include -#include "pyGameScoreMsg.h" +#include "pyGlueHelpers.h" // Maybe we need a better exception? Seems to be the best built in one though #define PFGS_PYERR PyExc_RuntimeError diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGeometry3.h b/Sources/Plasma/FeatureLib/pfPython/pyGeometry3.h index 69111497e1..3df550b7a1 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGeometry3.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGeometry3.h @@ -50,7 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsGeometry3.h" -#include "pyGlueHelpers.h" +#include "pyGlueDefinitions.h" class pyPoint3 { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGeometry3Glue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGeometry3Glue.cpp index 97a8b865fa..18ef48b452 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGeometry3Glue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGeometry3Glue.cpp @@ -40,9 +40,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include #include "pyGeometry3.h" +#include "pyGlueHelpers.h" + // glue functions PYTHON_CLASS_DEFINITION(ptPoint3, pyPoint3); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGlueDefinitions.h b/Sources/Plasma/FeatureLib/pfPython/pyGlueDefinitions.h new file mode 100644 index 0000000000..1aec46c3f1 --- /dev/null +++ b/Sources/Plasma/FeatureLib/pfPython/pyGlueDefinitions.h @@ -0,0 +1,68 @@ +/*==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==*/ +#ifndef _pyGlueDefinitions_h_ +#define _pyGlueDefinitions_h_ + +// Macros for use in Python glue header files. +// This header MUST NOT depend on any Python headers. +// Any macros and functions that require Python headers +// should go into pyGlueHelpers.h instead. + +typedef struct _object PyObject; +typedef struct _typeobject PyTypeObject; + +// This makes sure that our python new function can access our constructors +#define PYTHON_CLASS_NEW_FRIEND(pythonClassName) friend PyObject *pythonClassName##_new(PyTypeObject *type, PyObject *args, PyObject *keywords) + +// This defines the basic new function for a class +#define PYTHON_CLASS_NEW_DEFINITION static PyObject *New() + +// This defines the basic check function for a class +#define PYTHON_CLASS_CHECK_DEFINITION static bool Check(PyObject *obj) + +// This defines the basic convert from function for a class +#define PYTHON_CLASS_CONVERT_FROM_DEFINITION(glueClassName) static glueClassName *ConvertFrom(PyObject *obj) + +// small macros so that the type object can be accessed outside the glue file (for subclassing) +#define PYTHON_EXPOSE_TYPE static PyTypeObject* type_ptr + +#endif // _pyGlueDefinitions_h_ diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.cpp index 816ee1548b..b5eaa63bc7 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.cpp @@ -40,12 +40,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include #include -#include "pyGlueHelpers.h" #include "plFileSystem.h" +#include "pyGlueHelpers.h" + ST::string PyUnicode_AsSTString(PyObject* obj) { if (PyUnicode_Check(obj)) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.h b/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.h index 989fed270f..648cdd3af0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.h @@ -42,10 +42,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef _pyGlueHelpers_h_ #define _pyGlueHelpers_h_ +#include "pyGlueDefinitions.h" + +#include + namespace ST { class string; } -typedef struct _object PyObject; -typedef struct _typeobject PyTypeObject; -typedef struct PyMethodDef PyMethodDef; // Useful string functions ST::string PyUnicode_AsSTString(PyObject* obj); @@ -69,15 +70,7 @@ struct pythonClassName \ glueClassName *fThis; \ }; -// This makes sure that our python new function can access our constructors -#define PYTHON_CLASS_NEW_FRIEND(pythonClassName) friend PyObject *pythonClassName##_new(PyTypeObject *type, PyObject *args, PyObject *keywords) - -#define PYTHON_CLASS_VAULT_NODE_NEW_DEFINITION \ - static PyObject* New(hsRef vaultNode=nullptr); - // This defines the basic new function for a class -#define PYTHON_CLASS_NEW_DEFINITION static PyObject *New() - #define PYTHON_CLASS_NEW_IMPL(pythonClassName, glueClassName) \ PyObject *glueClassName::New() \ { \ @@ -86,8 +79,6 @@ PyObject *glueClassName::New() \ } // This defines the basic check function for a class -#define PYTHON_CLASS_CHECK_DEFINITION static bool Check(PyObject *obj) - #define PYTHON_CLASS_CHECK_IMPL(pythonClassName, glueClassName) \ bool glueClassName::Check(PyObject *obj) \ { \ @@ -95,8 +86,6 @@ bool glueClassName::Check(PyObject *obj) \ } // This defines the basic convert from function for a class -#define PYTHON_CLASS_CONVERT_FROM_DEFINITION(glueClassName) static glueClassName *ConvertFrom(PyObject *obj) - #define PYTHON_CLASS_CONVERT_FROM_IMPL(pythonClassName, glueClassName) \ glueClassName *glueClassName::ConvertFrom(PyObject *obj) \ { \ @@ -375,7 +364,6 @@ PYTHON_TYPE_START(pythonClassName) \ PYTHON_TYPE_END // small macros so that the type object can be accessed outside the glue file (for subclassing) -#define PYTHON_EXPOSE_TYPE static PyTypeObject* type_ptr #define PYTHON_EXPOSE_TYPE_DEFINITION(pythonClass, glueClass) PyTypeObject* glueClass::type_ptr = &pythonClass##_type ///////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGmBlueSpiral.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGmBlueSpiral.cpp index 03b9512cb5..8e35fcdc79 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGmBlueSpiral.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGmBlueSpiral.cpp @@ -42,13 +42,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyGmBlueSpiral.h" -#include "pyGameHandler.h" -#include "plPythonConvert.h" - #include #include "pfGameMgr/pfGmBlueSpiral.h" +#include "plPythonConvert.h" +#include "pyGameHandler.h" + // =========================================================================== void pyGmBlueSpiral::StartGame() const diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGmBlueSpiralGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGmBlueSpiralGlue.cpp index f1c53a9039..1466e0ac86 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGmBlueSpiralGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGmBlueSpiralGlue.cpp @@ -42,10 +42,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyGmBlueSpiral.h" -#include "pyGameCli.h" #include "plPythonConvert.h" - -#include +#include "pyGameCli.h" +#include "pyGlueHelpers.h" // =========================================================================== diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGmMarker.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGmMarker.cpp index e38b087804..fc0959708d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGmMarker.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGmMarker.cpp @@ -42,12 +42,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyGmMarker.h" -#include "pyGameHandler.h" +#include "pfGameMgr/pfGmMarker.h" + #include "plPythonCallable.h" +#include "pyGameHandler.h" #include "pyObjectRef.h" -#include "pfGameMgr/pfGmMarker.h" - // =========================================================================== void pyGmMarker::StartGame() const diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGmMarker.h b/Sources/Plasma/FeatureLib/pfPython/pyGmMarker.h index 082749d2d8..63395c2f5f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGmMarker.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGmMarker.h @@ -49,6 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com class pfGmMarker; class pyGmMarkerHandler; +namespace ST { class string; } class pyGmMarker : public pyGameCli { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGmMarkerGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGmMarkerGlue.cpp index 8fca3af54d..744d67b451 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGmMarkerGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGmMarkerGlue.cpp @@ -42,12 +42,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyGmMarker.h" +#include + +#include "plPythonConvert.h" #include "pyEnum.h" #include "pyGameCli.h" -#include "plPythonConvert.h" - -#include -#include +#include "pyGlueHelpers.h" // =========================================================================== diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGrassShader.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGrassShader.cpp index 22b8dd485f..9de0bcd4aa 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGrassShader.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGrassShader.cpp @@ -40,12 +40,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" - #include "pyGrassShader.h" + #include "plSurface/plGrassShaderMod.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" + pyGrassShader::pyGrassShader() { } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGrassShader.h b/Sources/Plasma/FeatureLib/pfPython/pyGrassShader.h index 87e1c01ac5..44626a92dd 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGrassShader.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGrassShader.h @@ -42,10 +42,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef pyGrassShader_h #define pyGrassShader_h -#include "pnKeyedObject/plKey.h" -#include "pyGlueHelpers.h" #include +#include "pnKeyedObject/plKey.h" + +#include "pyGlueDefinitions.h" + ////////////////////////////////////////////////////////////////////// // // pyGrassShader - a wrapper class to provide interface to the grass diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGrassShaderGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGrassShaderGlue.cpp index 3aaf859eba..a13fee9c97 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGrassShaderGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGrassShaderGlue.cpp @@ -40,11 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" - #include "pyGrassShader.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" + // glue functions PYTHON_CLASS_DEFINITION(ptGrassShader, pyGrassShader); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyImage.cpp b/Sources/Plasma/FeatureLib/pfPython/pyImage.cpp index 6b31c40397..4ba2c0d012 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyImage.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyImage.cpp @@ -40,22 +40,23 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include +#include "pyImage.h" -#include "pyKey.h" +#include -#include "plFileSystem.h" #include "hsResMgr.h" +#include "plFileSystem.h" -#include "pyColor.h" +#include "pnKeyedObject/plUoid.h" -#include "pyImage.h" -#include "pyGeometry3.h" #include "plGImage/plJPEG.h" #include "plGImage/plMipmap.h" #include "plGImage/plPNG.h" -#include "pnKeyedObject/plUoid.h" + +#include "pyColor.h" +#include "pyGeometry3.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" void pyImage::setKey(pyKey& mipmapKey) // only for python glue, do NOT call { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyImage.h b/Sources/Plasma/FeatureLib/pfPython/pyImage.h index f648d97f71..73fe2559e4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyImage.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyImage.h @@ -49,8 +49,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // PURPOSE: Class wrapper for Python to a plMipMap image // -#include "pyGlueHelpers.h" - #include #include "pnKeyedObject/plKey.h" @@ -59,6 +57,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com # include "plGImage/plMipmap.h" #endif +#include "pyGlueDefinitions.h" + class plFileName; class pyColor; class pyKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyImageGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyImageGlue.cpp index eb01380d5b..a0183fc0f0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyImageGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyImageGlue.cpp @@ -40,16 +40,16 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyImage.h" + #include #include "plFileSystem.h" #include "pyColor.h" +#include "pyGlueHelpers.h" #include "pyKey.h" -#include "pyImage.h" - // glue functions PYTHON_CLASS_DEFINITION(ptImage, pyImage); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.cpp b/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.cpp index 4aa8d807d7..5768f61495 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.cpp @@ -45,18 +45,20 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // /////////////////////////////////////////////// -#include +#include "pyJournalBook.h" + #include -#include "pyKey.h" #include "hsResMgr.h" -#include "pyJournalBook.h" +#include "pnKeyedObject/plUoid.h" + #include "pfJournalBook/pfJournalBook.h" #include "cyAnimation.h" +#include "pyGlueHelpers.h" #include "pyImage.h" -#include "pnKeyedObject/plUoid.h" +#include "pyKey.h" uint32_t pyJournalBook::fNextKeyID = 0; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h b/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h index 76bab40836..c057f835bd 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h @@ -48,13 +48,17 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include "pyGlueHelpers.h" +#include + +#include "HeadSpin.h" + +#include "pnKeyedObject/plKey.h" + +#include "pyGlueDefinitions.h" -class pyImage; class pfJournalBook; -class plKey; +class pyImage; class pyKey; -namespace ST { class string; } class pyJournalBook { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyJournalBookGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyJournalBookGlue.cpp index e24af37cf2..d2ee649597 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyJournalBookGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyJournalBookGlue.cpp @@ -40,16 +40,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include +#include "pyJournalBook.h" -#include "pyKey.h" +#include "pfJournalBook/pfJournalBook.h" -#include "pyJournalBook.h" #include "pyEnum.h" +#include "pyGlueHelpers.h" #include "pyImage.h" - -#include "pfJournalBook/pfJournalBook.h" +#include "pyKey.h" // glue functions PYTHON_CLASS_DEFINITION(ptBook, pyJournalBook); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyKey.cpp b/Sources/Plasma/FeatureLib/pfPython/pyKey.cpp index 084cef1fc1..9c8ce84d32 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyKey.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyKey.cpp @@ -48,15 +48,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include "plgDispatch.h" -#include "pyKey.h" -#include "hsResMgr.h" +#include "pnMessage/plEnableMsg.h" #include "pnModifier/plModifier.h" +#include "pnSceneObject/plSceneObject.h" #include "plPythonFileMod.h" -#include "pnMessage/plEnableMsg.h" +#include "pyKey.h" #include "pySceneObject.h" -#include "pnSceneObject/plSceneObject.h" pyKey::pyKey() { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyKey.h b/Sources/Plasma/FeatureLib/pfPython/pyKey.h index d095adfd85..de2d9d8f7b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyKey.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyKey.h @@ -48,12 +48,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include + #include "pnKeyedObject/plKey.h" -#include "pyGlueHelpers.h" +#include "pyGlueDefinitions.h" -class plPythonFileMod; class plPipeline; +class plPythonFileMod; namespace ST { class string; } class pyKey diff --git a/Sources/Plasma/FeatureLib/pfPython/pyKeyGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyKeyGlue.cpp index 20a1106293..43967501bb 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyKeyGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyKeyGlue.cpp @@ -40,10 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyKey.h" + #include -#include "pyKey.h" +#include "pyGlueHelpers.h" // glue functions PYTHON_CLASS_DEFINITION(ptKey, pyKey); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyKeyMap.cpp b/Sources/Plasma/FeatureLib/pfPython/pyKeyMap.cpp index 68206d0bdc..bead28df99 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyKeyMap.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyKeyMap.cpp @@ -50,9 +50,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include -#include "plInputCore/plInputInterfaceMgr.h" #include "pnInputCore/plKeyMap.h" +#include "plInputCore/plInputInterfaceMgr.h" + // conversion functions ST::string pyKeyMap::ConvertVKeyToChar(uint32_t vk, uint32_t flags) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyKeyMap.h b/Sources/Plasma/FeatureLib/pfPython/pyKeyMap.h index 3d70d61d7e..45404f86d8 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyKeyMap.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyKeyMap.h @@ -49,7 +49,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// #include "HeadSpin.h" -#include "pyGlueHelpers.h" + +#include "pyGlueDefinitions.h" namespace ST { class string; } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyKeyMapGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyKeyMapGlue.cpp index e767872b6e..266aefe289 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyKeyMapGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyKeyMapGlue.cpp @@ -40,10 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyKeyMap.h" + #include -#include "pyKeyMap.h" +#include "pyGlueHelpers.h" // glue functions PYTHON_CLASS_DEFINITION(ptKeyMap, pyKeyMap); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgr.cpp b/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgr.cpp index 00c78a8d94..cf48a68a58 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgr.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgr.cpp @@ -47,6 +47,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyMarkerMgr.h" + #include "pfCharacter/pfMarkerMgr.h" #include "pyGeometry3.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgr.h b/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgr.h index 81e40267d3..72668782d6 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgr.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgr.h @@ -50,6 +50,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" +#include "pyGlueDefinitions.h" + class pyPoint3; class pyMarkerMgr diff --git a/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgrGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgrGlue.cpp index 3fb449ec83..8c825459b0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgrGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgrGlue.cpp @@ -40,13 +40,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include - #include "pyMarkerMgr.h" + #include "pfMessage/pfMarkerMsg.h" -#include "pyGeometry3.h" #include "pyEnum.h" +#include "pyGeometry3.h" +#include "pyGlueHelpers.h" // glue functions PYTHON_CLASS_DEFINITION(ptMarkerMgr, pyMarkerMgr); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyMatrix44.cpp b/Sources/Plasma/FeatureLib/pfPython/pyMatrix44.cpp index 9fdf335bee..cbdf7c144d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyMatrix44.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyMatrix44.cpp @@ -40,10 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyGeometry3.h" #include "pyMatrix44.h" +#include "pyGeometry3.h" +#include "pyGlueHelpers.h" + PyObject* pyMatrix44::operator*(const pyVector3& p) const { return pyVector3::New(fMatrix * p.fVector); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyMatrix44.h b/Sources/Plasma/FeatureLib/pfPython/pyMatrix44.h index fd2dbdcef2..ee5b2895d0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyMatrix44.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyMatrix44.h @@ -43,8 +43,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define pyMatrix44_h_inc #include + #include "hsMatrix44.h" -#include "pyGlueHelpers.h" + +#include "pyGlueDefinitions.h" class pyPoint3; class pyVector3; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyMatrix44Glue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyMatrix44Glue.cpp index 73899309c4..631b515636 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyMatrix44Glue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyMatrix44Glue.cpp @@ -40,10 +40,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyMatrix44.h" #include "pyGeometry3.h" -#include "pyMatrix44.h" +#include "pyGlueHelpers.h" // glue functions PYTHON_CLASS_DEFINITION(ptMatrix44, pyMatrix44); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayer.cpp b/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayer.cpp index 2a6ad2dfac..ca5b770bf1 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayer.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayer.cpp @@ -45,14 +45,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include "pyKey.h" - #include "pyMoviePlayer.h" -#include "pyColor.h" #include "plMessage/plMovieMsg.h" + #include "pfMessage/pfMovieEventMsg.h" +#include "pyColor.h" +#include "pyKey.h" + pyMoviePlayer::pyMoviePlayer(const ST::string& movieName, pyKey& selfKey) { fMovieName = movieName; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayer.h b/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayer.h index 8ed577594c..2ec6ca7f7f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayer.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayer.h @@ -50,9 +50,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include -#include "pyGlueHelpers.h" #include "pnKeyedObject/plKey.h" +#include "pyGlueDefinitions.h" + class pyColor; class pyKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayerGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayerGlue.cpp index 4b11b0e584..a6958a3c9e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayerGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayerGlue.cpp @@ -40,15 +40,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" - #include "pyMoviePlayer.h" -#include "pyEnum.h" -#include "pyColor.h" #include "pfMessage/pfMovieEventMsg.h" +#include "pyColor.h" +#include "pyEnum.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" + // glue functions PYTHON_CLASS_DEFINITION(ptMoviePlayer, pyMoviePlayer); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.cpp b/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.cpp index 7aeb8cd082..f136b8fca3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.cpp @@ -49,9 +49,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include -#include "plNetClient/plNetLinkingMgr.h" -#include "plAvatar/plAvatarMgr.h" #include "plAvatar/plArmatureMod.h" +#include "plAvatar/plAvatarMgr.h" +#include "plNetClient/plNetLinkingMgr.h" #include "pyAgeLinkStruct.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.h b/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.h index 0f3ae51d5e..cafbb15d28 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.h @@ -43,7 +43,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define pyNetLinkingMgr_h_inc #include "HeadSpin.h" -#include "pyGlueHelpers.h" + +#include "pyGlueDefinitions.h" ////////////////////////////////////////////////////////////////////// // diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgrGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgrGlue.cpp index fc0c157bcc..b144c8c910 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgrGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgrGlue.cpp @@ -40,15 +40,16 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include - #include "pyNetLinkingMgr.h" -#include "pyEnum.h" -#include "pyAgeLinkStruct.h" + +#include #include "plNetCommon/plNetCommon.h" +#include "pyAgeLinkStruct.h" +#include "pyEnum.h" +#include "pyGlueHelpers.h" + #ifndef BUILDING_PYPLASMA // glue functions diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNotify.cpp b/Sources/Plasma/FeatureLib/pfPython/pyNotify.cpp index 71588e12d7..f5202a630e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNotify.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyNotify.cpp @@ -45,15 +45,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include "pyNotify.h" + #include #include "plgDispatch.h" + #include "pyGeometry3.h" #include "pyKey.h" -#include "pyNotify.h" - - pyNotify::pyNotify() : fNetPropagate(true), fNetForce(false) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNotify.h b/Sources/Plasma/FeatureLib/pfPython/pyNotify.h index 590cfb512b..7384152609 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNotify.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyNotify.h @@ -52,7 +52,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnKeyedObject/plKey.h" #include "pnMessage/plNotifyMsg.h" -#include "pyGlueHelpers.h" + +#include "pyGlueDefinitions.h" class pyKey; class pyPoint3; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNotifyGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyNotifyGlue.cpp index 5ae68b6a89..43ac83ec5f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNotifyGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyNotifyGlue.cpp @@ -40,15 +40,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyNotify.h" + #include +#include "pyEnum.h" #include "pyGeometry3.h" +#include "pyGlueHelpers.h" #include "pyKey.h" -#include "pyNotify.h" -#include "pyEnum.h" - // glue functions PYTHON_CLASS_DEFINITION(ptNotify, pyNotify); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyPlayer.cpp b/Sources/Plasma/FeatureLib/pfPython/pyPlayer.cpp index 1108ec8706..966f859d3b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyPlayer.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyPlayer.cpp @@ -40,10 +40,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include "pyKey.h" - #include "pyPlayer.h" +#include "pyKey.h" + pyPlayer::pyPlayer() // only used by python glue, do NOT call : fPlayerID(), fDistSq(-1), fIsCCR(), fIsServer() { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyPlayer.h b/Sources/Plasma/FeatureLib/pfPython/pyPlayer.h index 5521f50bdd..cc71e06962 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyPlayer.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyPlayer.h @@ -49,10 +49,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // PURPOSE: Class wrapper for Python to the player data // -#include "pyGlueHelpers.h" -#include "pnKeyedObject/plKey.h" #include +#include "pnKeyedObject/plKey.h" + +#include "pyGlueDefinitions.h" + class pyKey; class pyPlayer diff --git a/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp index e2897728ea..f5df3ed00c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp @@ -40,11 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" - #include "pyPlayer.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" + // glue functions PYTHON_CLASS_DEFINITION(ptPlayer, pyPlayer); diff --git a/Sources/Plasma/FeatureLib/pfPython/pySDL.cpp b/Sources/Plasma/FeatureLib/pfPython/pySDL.cpp index 8d106b9c30..f29aef0b8b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySDL.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pySDL.cpp @@ -42,13 +42,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pySDL.h" -#include #include #include "pnKeyedObject/plKey.h" #include "plSDL/plSDL.h" +#include "pyGlueHelpers.h" + /////////////////////////////////////////////////////////////////////////// pySDLStateDataRecord::pySDLStateDataRecord() diff --git a/Sources/Plasma/FeatureLib/pfPython/pySDL.h b/Sources/Plasma/FeatureLib/pfPython/pySDL.h index 236bb628f1..6856e743dd 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySDL.h +++ b/Sources/Plasma/FeatureLib/pfPython/pySDL.h @@ -48,14 +48,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include "HeadSpin.h" #include -#include "pyGlueHelpers.h" +#include "HeadSpin.h" + +#include "pyGlueDefinitions.h" -class plStateDataRecord; -class plSimpleStateVariable; class plKey; +class plSimpleStateVariable; +class plStateDataRecord; namespace ST { class string; } // pySDL -- this thing really only exists for the constants diff --git a/Sources/Plasma/FeatureLib/pfPython/pySDLGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pySDLGlue.cpp index f37d0245b3..94d464750d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySDLGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pySDLGlue.cpp @@ -40,14 +40,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include +#include "pySDL.h" -#include "pyKey.h" +#include -#include "pySDL.h" #include "plSDL/plSDL.h" + #include "pyEnum.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" void pySDL::AddPlasmaConstantsClasses(PyObject *m) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp b/Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp index d55e758edc..f09b4d5ef6 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp @@ -40,35 +40,35 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include +#include "pySceneObject.h" + +#include #include "plAudible.h" #include "plgDispatch.h" -#include "pyGeometry3.h" -#include "pyKey.h" -#include "pyMatrix44.h" -#include "pySceneObject.h" - -#include "cyAvatar.h" -#include "cyDraw.h" -#include "cyParticleSys.h" -#include "cyPhysics.h" - -#include "plMessage/plAnimCmdMsg.h" #include "pnMessage/plCameraMsg.h" #include "pnMessage/plNotifyMsg.h" +#include "pnSceneObject/plAudioInterface.h" +#include "pnSceneObject/plCoordinateInterface.h" #include "plAvatar/plArmatureMod.h" -#include "pnSceneObject/plAudioInterface.h" #include "plAvatar/plAvBrainHuman.h" -#include "pfCamera/plCameraModifier.h" -#include "pnSceneObject/plCoordinateInterface.h" +#include "plMessage/plAnimCmdMsg.h" #include "plModifier/plLogicModifier.h" -#include "plPythonFileMod.h" #include "plModifier/plResponderModifier.h" +#include "pfCamera/plCameraModifier.h" + +#include "cyAvatar.h" +#include "cyDraw.h" +#include "cyParticleSys.h" +#include "cyPhysics.h" +#include "plPythonFileMod.h" +#include "pyGeometry3.h" +#include "pyGlueHelpers.h" +#include "pyMatrix44.h" + void pySceneObject::IAddObjKeyToAll(const plKey& key) { // set the sender and the receiver to the same thing diff --git a/Sources/Plasma/FeatureLib/pfPython/pySceneObject.h b/Sources/Plasma/FeatureLib/pfPython/pySceneObject.h index b0e376971e..7a311994e6 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySceneObject.h +++ b/Sources/Plasma/FeatureLib/pfPython/pySceneObject.h @@ -49,11 +49,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include "pyGlueHelpers.h" -#include "pnKeyedObject/plKey.h" #include -class pyKey; +#include "pnKeyedObject/plKey.h" + +#include "pyGlueDefinitions.h" +#include "pyKey.h" + class pyMatrix44; namespace ST { class string; } diff --git a/Sources/Plasma/FeatureLib/pfPython/pySceneObjectGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pySceneObjectGlue.cpp index 37f2a211e5..83260e154c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySceneObjectGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pySceneObjectGlue.cpp @@ -40,15 +40,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pySceneObject.h" + #include #include "pyGeometry3.h" -#include "pyKey.h" +#include "pyGlueHelpers.h" #include "pyMatrix44.h" -#include "pySceneObject.h" - // glue functions PYTHON_CLASS_DEFINITION(ptSceneobject, pySceneObject); diff --git a/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfo.h b/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfo.h index 57c5adc698..fc9c55b8a3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfo.h +++ b/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfo.h @@ -45,7 +45,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include "plNetCommon/plSpawnPointInfo.h" -#include "pyGlueHelpers.h" + +#include "pyGlueDefinitions.h" ////////////////////////////////////////////////////////////////////// // diff --git a/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfoGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfoGlue.cpp index 53a94a536c..47e468f85a 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfoGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfoGlue.cpp @@ -40,10 +40,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include - #include "pySpawnPointInfo.h" +#include "pyGlueHelpers.h" + // glue functions PYTHON_CLASS_DEFINITION(ptSpawnPointInfo, pySpawnPointInfo); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.cpp b/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.cpp index df2dd6d56e..4d6f04f63b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.cpp @@ -46,12 +46,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // and interface to the ChatLog (ptChatStatusLog) ////////////////////////////////////////////////////////////////////// +#include "pyStatusLog.h" + #include -#include "pyColor.h" -#include "pyStatusLog.h" #include "plStatusLog/plStatusLog.h" +#include "pyColor.h" + pyStatusLog::pyStatusLog(plStatusLog* log/*=nullptr */) : fLog( log ) , fICreatedLog( false ) diff --git a/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.h b/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.h index befd745bb3..864553512c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.h @@ -50,10 +50,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// #include "HeadSpin.h" -#include "pyGlueHelpers.h" -class pyColor; +#include "pyGlueDefinitions.h" + class plStatusLog; +class pyColor; namespace ST { class string; } class pyStatusLog diff --git a/Sources/Plasma/FeatureLib/pfPython/pyStatusLogGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyStatusLogGlue.cpp index 8d709405c3..63a0431dc7 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyStatusLogGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyStatusLogGlue.cpp @@ -40,13 +40,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyStatusLog.h" + #include +#include "plStatusLog/plStatusLog.h" + #include "pyColor.h" #include "pyEnum.h" -#include "plStatusLog/plStatusLog.h" -#include "pyStatusLog.h" +#include "pyGlueHelpers.h" // glue functions PYTHON_CLASS_DEFINITION(ptStatusLog, pyStatusLog); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyStream.h b/Sources/Plasma/FeatureLib/pfPython/pyStream.h index d1ef6b4abc..a2fe636472 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyStream.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyStream.h @@ -48,14 +48,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include +#include #include "HeadSpin.h" -#include "pyGlueHelpers.h" +#include "hsStream.h" -#include -#include +#include "pyGlueDefinitions.h" -class hsStream; class plFileName; namespace ST { class string; } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyStreamGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyStreamGlue.cpp index 7296830bfc..7e51a3bb0a 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyStreamGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyStreamGlue.cpp @@ -40,12 +40,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyStream.h" + #include -#include "pyStream.h" #include "plFileSystem.h" +#include "pyGlueHelpers.h" // glue functions PYTHON_CLASS_DEFINITION(ptStream, pyStream); diff --git a/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterface.cpp b/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterface.cpp index 7d2c651337..c66fbf9e96 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterface.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterface.cpp @@ -40,11 +40,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include "pyKey.h" - #include "pySwimCurrentInterface.h" + #include "plAvatar/plSwimRegion.h" +#include "pyKey.h" + pySwimCurrentInterface::pySwimCurrentInterface(plKey key) { fSwimCurrentKey = std::move(key); diff --git a/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterface.h b/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterface.h index 2735b2608f..630cb80465 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterface.h +++ b/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterface.h @@ -42,9 +42,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef pySwimCurrentInterface_h #define pySwimCurrentInterface_h -#include "pyGlueHelpers.h" #include "pnKeyedObject/plKey.h" +#include "pyGlueDefinitions.h" + class pyKey; class pySwimCurrentInterface diff --git a/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterfaceGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterfaceGlue.cpp index e6bbab4cfa..e84fd0c6ae 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterfaceGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterfaceGlue.cpp @@ -40,11 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" - #include "pySwimCurrentInterface.h" +#include "pyGlueHelpers.h" +#include "pyKey.h" + // glue functions PYTHON_CLASS_DEFINITION(ptSwimCurrentInterface, pySwimCurrentInterface); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp index 60f0eb6e71..3fa69f8876 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp @@ -45,32 +45,32 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include "pyVault.h" + #include -#include #include #ifdef BUILDING_PYPLASMA # error "pyVault is not compatible with pyPlasma.pyd. Use BUILDING_PYPLASMA macro to ifdef out unwanted headers." #endif -#include "pyVault.h" -#include "pyVaultNode.h" -#include "pyVaultAgeInfoNode.h" +#include "plNetClient/plNetClientMgr.h" +#include "plNetCommon/plNetCommon.h" +#include "plSDL/plSDL.h" +#include "plVault/plVault.h" + +#include "pyAgeInfoStruct.h" +#include "pyAgeLinkStruct.h" +#include "pyGlueHelpers.h" +#include "pySDL.h" #include "pyVaultAgeInfoListNode.h" +#include "pyVaultAgeInfoNode.h" #include "pyVaultAgeLinkNode.h" +#include "pyVaultChronicleNode.h" #include "pyVaultFolderNode.h" +#include "pyVaultNode.h" #include "pyVaultPlayerInfoListNode.h" #include "pyVaultPlayerInfoNode.h" -#include "pyVaultChronicleNode.h" -#include "pyAgeInfoStruct.h" -#include "pyAgeLinkStruct.h" -#include "pySDL.h" - -#include "plVault/plVault.h" -#include "plNetClient/plNetClientMgr.h" -#include "plNetCommon/plNetCommon.h" - -#include "plSDL/plSDL.h" //============================================================================ static PyObject * GetFolder (unsigned folderType) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVault.h b/Sources/Plasma/FeatureLib/pfPython/pyVault.h index b2094f31c7..fd120968f4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVault.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVault.h @@ -49,14 +49,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// #include "HeadSpin.h" -#include "pyGlueHelpers.h" -class pyVaultNode; -class pyVaultAgeInfoNode; +#include "pyGlueDefinitions.h" + class pyAgeInfoStruct; class pyAgeLinkStruct; - class pySDLStateDataRecord; +class pyVaultAgeInfoNode; +class pyVaultNode; namespace ST { class string; } class pyVault diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNode.h index 4e8a35ca35..0201a202f5 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNode.h @@ -49,7 +49,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// #include "HeadSpin.h" -#include "pyGlueHelpers.h" + +#include "pyGlueDefinitions.h" #include "pyVaultFolderNode.h" class pyVaultAgeInfoListNode : public pyVaultFolderNode diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNodeGlue.cpp index 6de00912d6..8ca55cf983 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNodeGlue.cpp @@ -40,11 +40,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include - #include "pyVaultAgeInfoListNode.h" + #include "plVault/plVault.h" +#include "pyGlueHelpers.h" + // glue functions PYTHON_CLASS_DEFINITION(ptVaultAgeInfoListNode, pyVaultAgeInfoListNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp index f59afebcb8..52ac2747d1 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp @@ -45,19 +45,20 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include +#include "pyVaultAgeInfoNode.h" + #include #include -#include "pyVaultAgeInfoNode.h" +#include "pnUUID/pnUUID.h" +#include "plVault/plVault.h" + +#include "pyAgeInfoStruct.h" +#include "pyGlueHelpers.h" #include "pyVaultAgeInfoListNode.h" -#include "pyVaultPlayerInfoListNode.h" #include "pyVaultAgeLinkNode.h" -#include "pyAgeInfoStruct.h" - -#include "pnUUID/pnUUID.h" -#include "plVault/plVault.h" +#include "pyVaultPlayerInfoListNode.h" pyVaultAgeInfoNode::pyVaultAgeInfoNode() : pyVaultNode() diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.h index fd81780237..f97c5b1237 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.h @@ -49,7 +49,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// #include "HeadSpin.h" -#include "pyGlueHelpers.h" + +#include "pyGlueDefinitions.h" #include "pyVaultNode.h" class plUUID; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNodeGlue.cpp index 00146b791f..89b651a066 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNodeGlue.cpp @@ -40,12 +40,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyVaultAgeInfoNode.h" + #include -#include "pyVaultAgeInfoNode.h" #include "plVault/plVault.h" +#include "pyGlueHelpers.h" + // glue functions PYTHON_CLASS_DEFINITION(ptVaultAgeInfoNode, pyVaultAgeInfoNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.cpp index 1234dc4fa4..a2b5eec924 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.cpp @@ -45,17 +45,16 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include -#include - #include "pyVaultAgeLinkNode.h" -#include "pyVaultAgeInfoNode.h" -#include "pyAgeLinkStruct.h" -#include "pySpawnPointInfo.h" + +#include #include "plVault/plVault.h" -#include "plNetCommon/plSpawnPointInfo.h" +#include "pyAgeLinkStruct.h" +#include "pyGlueHelpers.h" +#include "pySpawnPointInfo.h" +#include "pyVaultAgeInfoNode.h" //create from the Python side pyVaultAgeLinkNode::pyVaultAgeLinkNode() diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.h index ec65dc77fa..ace1899548 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.h @@ -49,10 +49,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// #include "HeadSpin.h" -#include "pyGlueHelpers.h" -#include "pyVaultNode.h" + #include "plNetCommon/plNetServerSessionInfo.h" // for plAgeLinkStruct +#include "pyGlueDefinitions.h" +#include "pyVaultNode.h" + class pySpawnPointInfo; class pySpawnPointInfoRef; namespace ST { class string; } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNodeGlue.cpp index ca115d19fc..e69de44330 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNodeGlue.cpp @@ -40,14 +40,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include - #include "pyVaultAgeLinkNode.h" -#include "pySpawnPointInfo.h" + +#include #include "plVault/plVault.h" +#include "pyGlueHelpers.h" +#include "pySpawnPointInfo.h" + // glue functions PYTHON_CLASS_DEFINITION(ptVaultAgeLinkNode, pyVaultAgeLinkNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.h index 1dec9ca176..c4e8afbc62 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.h @@ -49,7 +49,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// #include "HeadSpin.h" -#include "pyGlueHelpers.h" + +#include "pyGlueDefinitions.h" #include "pyVaultNode.h" namespace ST { class string; } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNodeGlue.cpp index e6368e9a5e..54540ef28b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNodeGlue.cpp @@ -40,12 +40,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyVaultChronicleNode.h" + #include -#include "pyVaultChronicleNode.h" #include "plVault/plVault.h" +#include "pyGlueHelpers.h" + // glue functions PYTHON_CLASS_DEFINITION(ptVaultChronicleNode, pyVaultChronicleNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNode.h index a2c8d806ce..60f6f782ef 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNode.h @@ -48,7 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include "pyGlueHelpers.h" +#include "pyGlueDefinitions.h" #include "pyVaultNode.h" namespace ST { class string; } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNodeGlue.cpp index 4b621ee9b1..fc48d609dc 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNodeGlue.cpp @@ -40,13 +40,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include - #include "pyVaultFolderNode.h" +#include + #include "plVault/plVault.h" +#include "pyGlueHelpers.h" + // glue functions PYTHON_CLASS_DEFINITION(ptVaultFolderNode, pyVaultFolderNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultGlue.cpp index 4c370591b7..512fdc5857 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultGlue.cpp @@ -40,19 +40,20 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyVault.h" + #include -#include "pyVault.h" -#include "pyEnum.h" +#include "plMessage/plVaultNotifyMsg.h" +#include "plVault/plVault.h" + #include "pyAgeInfoStruct.h" -#include "pyVaultNode.h" -#include "pyVaultAgeInfoNode.h" -#include "pySDL.h" #include "pyAgeLinkStruct.h" - -#include "plVault/plVault.h" -#include "plMessage/plVaultNotifyMsg.h" +#include "pyEnum.h" +#include "pyGlueHelpers.h" +#include "pySDL.h" +#include "pyVaultAgeInfoNode.h" +#include "pyVaultNode.h" #ifndef BUILDING_PYPLASMA diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp index 9b2bfe3325..4bce7aea0c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp @@ -45,24 +45,22 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include +#include "pyVaultImageNode.h" + #include -#include "plPipeline.h" #include "hsResMgr.h" +#include "plPipeline.h" -#include "pyVaultImageNode.h" -#ifndef BUILDING_PYPLASMA -# include "pyVault.h" -#endif -#include "pyImage.h" -#include "cyMisc.h" +#include "pnMessage/plRefMsg.h" #include "plGImage/plMipmap.h" -#include "plVault/plVault.h" -#include "pnMessage/plRefMsg.h" #include "plNetClient/plNetClientMgr.h" +#include "plVault/plVault.h" +#include "cyMisc.h" +#include "pyGlueHelpers.h" +#include "pyImage.h" static unsigned s_keyseq; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.h index 111a4a3e81..42fe3c90e9 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.h @@ -48,8 +48,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include "pyGlueHelpers.h" #include "pnKeyedObject/plKey.h" + +#include "pyGlueDefinitions.h" #include "pyVaultNode.h" class plMipmap; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNodeGlue.cpp index 558a13d95f..36ca04dcbe 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNodeGlue.cpp @@ -40,14 +40,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include - #include "pyVaultImageNode.h" -#include "pyImage.h" + +#include #include "plVault/plVault.h" +#include "pyGlueHelpers.h" +#include "pyImage.h" + // glue functions PYTHON_CLASS_DEFINITION(ptVaultImageNode, pyVaultImageNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp index 38931457d6..bf597dcf3b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp @@ -45,14 +45,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include -#include +#include "pyVaultMarkerGameNode.h" -#include "pyGeometry3.h" +#include -#include "pyVaultMarkerGameNode.h" #include "plVault/plVault.h" +#include "pyGeometry3.h" +#include "pyGlueHelpers.h" + //create from the Python side pyVaultMarkerGameNode::pyVaultMarkerGameNode() : pyVaultNode() diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.h index 9b4d9809bf..9666221b56 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.h @@ -48,7 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include "pyGlueHelpers.h" +#include "pyGlueDefinitions.h" #include "pyVaultNode.h" #include diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNodeGlue.cpp index 4587d7a94c..c47e90e1e5 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNodeGlue.cpp @@ -40,14 +40,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include +#include "pyVaultMarkerGameNode.h" -#include "pyGeometry3.h" +#include -#include "pyVaultMarkerGameNode.h" #include "plVault/plVault.h" +#include "pyGeometry3.h" +#include "pyGlueHelpers.h" + // glue functions PYTHON_CLASS_DEFINITION(ptVaultMarkerGameNode, pyVaultMarkerGameNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp index 733c697aac..151db504e0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp @@ -45,37 +45,38 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include +#include "pyVaultNode.h" + #include -#include "pyVaultNode.h" +#include "pnUUID/pnUUID.h" -#ifndef BUILDING_PYPLASMA -# include "pyVault.h" -# include "pyVaultSystemNode.h" -# include "plNetClientComm/plNetClientComm.h" -#endif +#include "plVault/plVault.h" +#include "plPythonCallable.h" #include "pyDniCoordinates.h" +#include "pyGlueHelpers.h" #include "pyObjectRef.h" -#include "plPythonCallable.h" -#include "pyVaultNodeRef.h" -#include "pyVaultFolderNode.h" -#include "pyVaultPlayerInfoListNode.h" -#include "pyVaultImageNode.h" -#include "pyVaultTextNoteNode.h" +#include "pyVaultAgeInfoListNode.h" +#include "pyVaultAgeInfoNode.h" #include "pyVaultAgeLinkNode.h" #include "pyVaultChronicleNode.h" -#include "pyVaultPlayerInfoNode.h" +#include "pyVaultFolderNode.h" +#include "pyVaultImageNode.h" #include "pyVaultMarkerGameNode.h" -#include "pyVaultAgeInfoNode.h" -#include "pyVaultAgeInfoListNode.h" +#include "pyVaultNodeRef.h" +#include "pyVaultPlayerInfoListNode.h" +#include "pyVaultPlayerInfoNode.h" #include "pyVaultPlayerNode.h" #include "pyVaultSDLNode.h" +#include "pyVaultTextNoteNode.h" -#include "pnUUID/pnUUID.h" -#include "plVault/plVault.h" +#ifndef BUILDING_PYPLASMA +# include "plNetClientComm/plNetClientComm.h" +# include "pyVault.h" +# include "pyVaultSystemNode.h" +#endif /////////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h index 436bfd3700..24a652c555 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h @@ -49,14 +49,19 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// #include "HeadSpin.h" -#include "pyGlueHelpers.h" -#include "pyObjectRef.h" #include "hsRefCnt.h" #include "pnNetBase/pnNbError.h" +#include "pyGlueDefinitions.h" +#include "pyObjectRef.h" + struct RelVaultNode; class plUUID; +namespace ST { class string; } + +#define PYTHON_CLASS_VAULT_NODE_NEW_DEFINITION \ + static PyObject* New(hsRef vaultNode=nullptr); class pyVaultNode { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeGlue.cpp index 30f3e9154a..d503b3447d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeGlue.cpp @@ -40,12 +40,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyVaultNode.h" + #include -#include "pyVaultNode.h" #include "plVault/plVault.h" +#include "pyGlueHelpers.h" + // glue functions PYTHON_CLASS_DEFINITION(ptVaultNode, pyVaultNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.cpp index 23471c62b5..b0c6068421 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.cpp @@ -45,12 +45,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include - #include "pyVaultNodeRef.h" + +#include "plVault/plVault.h" + +#include "pyGlueHelpers.h" #include "pyVaultNode.h" #include "pyVaultPlayerInfoNode.h" -#include "plVault/plVault.h" ////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.h index d4047e1879..849e7adda6 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.h @@ -49,9 +49,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// #include "HeadSpin.h" -#include "pyGlueHelpers.h" #include "hsRefCnt.h" +#include "pyGlueDefinitions.h" + struct RelVaultNode; class pyVaultNodeRef diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRefGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRefGlue.cpp index 1b170c3960..d4a2b260a0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRefGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRefGlue.cpp @@ -40,12 +40,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include - #include "pyVaultNodeRef.h" #include "plVault/plVault.h" +#include "pyGlueHelpers.h" + // glue functions // glue functions PYTHON_CLASS_DEFINITION(ptVaultNodeRef, pyVaultNodeRef); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.cpp index e194791ae8..1ea2f9f0ef 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.cpp @@ -45,12 +45,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include - #include "pyVaultPlayerInfoListNode.h" + +#include "plVault/plVault.h" + +#include "pyGlueHelpers.h" #include "pyVaultFolderNode.h" #include "pyVaultPlayerInfoNode.h" -#include "plVault/plVault.h" //create from the Python side pyVaultPlayerInfoListNode::pyVaultPlayerInfoListNode() diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.h index e0ffe412e5..0dc080c1c4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.h @@ -49,7 +49,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// #include "HeadSpin.h" -#include "pyGlueHelpers.h" + +#include "pyGlueDefinitions.h" #include "pyVaultFolderNode.h" class pyVaultPlayerInfoListNode : public pyVaultFolderNode diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNodeGlue.cpp index d895772040..d6f5ffe635 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNodeGlue.cpp @@ -40,11 +40,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include - #include "pyVaultPlayerInfoListNode.h" + #include "plVault/plVault.h" +#include "pyGlueHelpers.h" + // glue functions PYTHON_CLASS_DEFINITION(ptVaultPlayerInfoListNode, pyVaultPlayerInfoListNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.cpp index b0b87cb87a..4d75ed7456 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.cpp @@ -50,9 +50,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include -#include "plVault/plVault.h" #include "pnUUID/pnUUID.h" +#include "plVault/plVault.h" + //create from the Python side pyVaultPlayerInfoNode::pyVaultPlayerInfoNode() : pyVaultNode() diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.h index 1df57c251c..3eef3fd13a 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.h @@ -48,8 +48,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include "pyGlueDefinitions.h" #include "pyVaultNode.h" -#include "pyGlueHelpers.h" class plUUID; namespace ST { class string; } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNodeGlue.cpp index 8e6fa231cc..41a0a386c9 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNodeGlue.cpp @@ -40,12 +40,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyVaultPlayerInfoNode.h" + #include -#include "pyVaultPlayerInfoNode.h" #include "plVault/plVault.h" +#include "pyGlueHelpers.h" + // glue functions PYTHON_CLASS_DEFINITION(ptVaultPlayerInfoNode, pyVaultPlayerInfoNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp index 35519cfcde..cb8becd454 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp @@ -45,17 +45,19 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include +#include "pyVaultPlayerNode.h" + #include -#include "pyVaultPlayerNode.h" +#include "plVault/plVault.h" + #include "pyAgeInfoStruct.h" +#include "pyAgeLinkStruct.h" +#include "pyGlueHelpers.h" #include "pyVaultAgeLinkNode.h" -#include "pyVaultPlayerInfoNode.h" -#include "pyVaultFolderNode.h" #include "pyVaultChronicleNode.h" -#include "pyAgeLinkStruct.h" -#include "plVault/plVault.h" +#include "pyVaultFolderNode.h" +#include "pyVaultPlayerInfoNode.h" //============================================================================ static PyObject * GetPlayerVaultFolder (unsigned folderType) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.h index d1dc8e7765..ed8f1162d7 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.h @@ -48,7 +48,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// #include "HeadSpin.h" -#include "pyGlueHelpers.h" + +#include "pyGlueDefinitions.h" #include "pyVaultNode.h" class pyAgeInfoStruct; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNodeGlue.cpp index 2fc758c04c..89f783c0bb 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNodeGlue.cpp @@ -40,13 +40,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyVaultPlayerNode.h" + #include -#include "pyVaultPlayerNode.h" -#include "pyAgeInfoStruct.h" #include "plVault/plVault.h" +#include "pyAgeInfoStruct.h" +#include "pyGlueHelpers.h" + // glue functions PYTHON_CLASS_DEFINITION(ptVaultPlayerNode, pyVaultPlayerNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.cpp index f27c8fa46a..6a602df7d6 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.cpp @@ -45,14 +45,16 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include +#include "pyVaultSDLNode.h" + #include -#include "pyVaultSDLNode.h" #include "plSDL/plSDL.h" -#include "pySDL.h" #include "plVault/plVault.h" +#include "pyGlueHelpers.h" +#include "pySDL.h" + //create from the Python side pyVaultSDLNode::pyVaultSDLNode() : pyVaultNode() diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.h index f532e8c7fe..afcaf3b76d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.h @@ -48,7 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include "pyGlueHelpers.h" +#include "pyGlueDefinitions.h" #include "pyVaultNode.h" class pySDLStateDataRecord; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNodeGlue.cpp index 04ea24ba91..8f8928bcef 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNodeGlue.cpp @@ -40,13 +40,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyVaultSDLNode.h" + #include -#include "pyVaultSDLNode.h" -#include "pySDL.h" #include "plVault/plVault.h" +#include "pyGlueHelpers.h" +#include "pySDL.h" + // glue functions PYTHON_CLASS_DEFINITION(ptVaultSDLNode, pyVaultSDLNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNode.cpp index 53b68738ec..9c81ac09d5 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNode.cpp @@ -45,8 +45,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// - #include "pyVaultSystemNode.h" + #include "plVault/plVault.h" //create from the Python side diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNode.h index 66c71293bf..743bf51013 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNode.h @@ -48,7 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include "pyGlueHelpers.h" +#include "pyGlueDefinitions.h" #include "pyVaultNode.h" class pyVaultSystemNode : public pyVaultNode diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNodeGlue.cpp index b5fe28bdab..a2aeef516a 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNodeGlue.cpp @@ -40,11 +40,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include - #include "pyVaultSystemNode.h" + #include "plVault/plVault.h" +#include "pyGlueHelpers.h" + // glue functions PYTHON_CLASS_DEFINITION(ptVaultSystemNode, pyVaultSystemNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.cpp index 65c9bc8454..425ad08efc 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.cpp @@ -45,13 +45,16 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include +#include "pyVaultTextNoteNode.h" + #include -#include "pyVaultTextNoteNode.h" #include "pnNetBase/pnNbError.h" + #include "plVault/plVault.h" +#include "pyGlueHelpers.h" + //create from the Python side pyVaultTextNoteNode::pyVaultTextNoteNode() : pyVaultNode() diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.h index 3f1d59d4fc..72f99d2cf9 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.h @@ -49,7 +49,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// #include "HeadSpin.h" -#include "pyGlueHelpers.h" + +#include "pyGlueDefinitions.h" #include "pyVaultNode.h" namespace ST { class string; } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNodeGlue.cpp index c6e16a6b98..7b00657bb7 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNodeGlue.cpp @@ -40,12 +40,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include +#include "pyVaultTextNoteNode.h" + #include -#include "pyVaultTextNoteNode.h" #include "plVault/plVault.h" +#include "pyGlueHelpers.h" + // glue functions PYTHON_CLASS_DEFINITION(ptVaultTextNoteNode, pyVaultTextNoteNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyWaveSet.cpp b/Sources/Plasma/FeatureLib/pfPython/pyWaveSet.cpp index fda4ceb705..921b3069b2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyWaveSet.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyWaveSet.cpp @@ -40,13 +40,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyKey.h" +#include "pyWaveSet.h" + +#include "plDrawable/plWaveSet7.h" #include "pyColor.h" #include "pyGeometry3.h" -#include "pyWaveSet.h" -#include "plDrawable/plWaveSet7.h" +#include "pyGlueHelpers.h" pyWaveSet::pyWaveSet(plKey key) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyWaveSet.h b/Sources/Plasma/FeatureLib/pfPython/pyWaveSet.h index 21d4f67c44..31e9092f90 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyWaveSet.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyWaveSet.h @@ -42,11 +42,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef pyWaveSet_h #define pyWaveSet_h -#include "pyGlueHelpers.h" #include "pnKeyedObject/plKey.h" +#include "pyGlueDefinitions.h" +#include "pyKey.h" + class pyColor; -class pyKey; class pyPoint3; class pyVector3; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyWaveSetGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyWaveSetGlue.cpp index f180e47812..abf44c5e68 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyWaveSetGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyWaveSetGlue.cpp @@ -40,12 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include -#include "pyGeometry3.h" -#include "pyKey.h" +#include "pyWaveSet.h" #include "pyColor.h" -#include "pyWaveSet.h" +#include "pyGeometry3.h" +#include "pyGlueHelpers.h" // glue functions PYTHON_CLASS_DEFINITION(ptWaveSet, pyWaveSet); diff --git a/Sources/Plasma/FeatureLib/pfSurface/plGrabCubeMap.cpp b/Sources/Plasma/FeatureLib/pfSurface/plGrabCubeMap.cpp index 64fdba7243..01956aad66 100644 --- a/Sources/Plasma/FeatureLib/pfSurface/plGrabCubeMap.cpp +++ b/Sources/Plasma/FeatureLib/pfSurface/plGrabCubeMap.cpp @@ -50,6 +50,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsMatrix44.h" #include "plPipeline.h" +#include + #include "pnSceneObject/plDrawInterface.h" #include "pnSceneObject/plSceneObject.h" diff --git a/Sources/Plasma/FeatureLib/pfSurface/plLayerMovie.cpp b/Sources/Plasma/FeatureLib/pfSurface/plLayerMovie.cpp index 6807dc3f48..eb85f0cb43 100644 --- a/Sources/Plasma/FeatureLib/pfSurface/plLayerMovie.cpp +++ b/Sources/Plasma/FeatureLib/pfSurface/plLayerMovie.cpp @@ -47,6 +47,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsResMgr.h" #include "hsStream.h" +#include #include "plMessage/plAnimCmdMsg.h" #include "plGImage/plMipmap.h" diff --git a/Sources/Plasma/NucleusLib/inc/plPipeline.h b/Sources/Plasma/NucleusLib/inc/plPipeline.h index 6b6f463ee5..12f8924ad1 100644 --- a/Sources/Plasma/NucleusLib/inc/plPipeline.h +++ b/Sources/Plasma/NucleusLib/inc/plPipeline.h @@ -337,7 +337,7 @@ class plPipeline : public plCreatable virtual plMipmap* ExtractMipMap(plRenderTarget* targ) = 0; /// Error handling - virtual const char *GetErrorString() = 0; + virtual ST::string GetErrorString() = 0; // info about current rendering device virtual void GetSupportedDisplayModes(std::vector *res, int ColorDepth = 32 ) = 0; diff --git a/Sources/Plasma/NucleusLib/inc/plProfile.h b/Sources/Plasma/NucleusLib/inc/plProfile.h index 6ccba04cdf..5dfdfe51f3 100644 --- a/Sources/Plasma/NucleusLib/inc/plProfile.h +++ b/Sources/Plasma/NucleusLib/inc/plProfile.h @@ -44,6 +44,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" +#include + #ifndef PLASMA_EXTERNAL_RELEASE #define PL_PROFILE_ENABLED #endif @@ -79,23 +81,23 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifdef PL_PROFILE_ENABLED -#define plProfile_CreateTimerNoReset(name, group, varName) plProfileVar gProfileVar##varName(name, group, plProfileVar::kDisplayTime | plProfileVar::kDisplayNoReset) -#define plProfile_CreateTimer(name, group, varName) plProfileVar gProfileVar##varName(name, group, plProfileVar::kDisplayTime) -#define plProfile_CreateAsynchTimer(name, group, varName) plProfileVar gProfileVar##varName(name, group, plProfileVar::kDisplayTime | plProfileVar::kDisplayResetEveryBegin | plProfileVar::kDisplayNoReset) +#define plProfile_CreateTimerNoReset(name, group, varName) plProfileVar gProfileVar##varName(ST_LITERAL(name), ST_LITERAL(group), plProfileVar::kDisplayTime | plProfileVar::kDisplayNoReset) +#define plProfile_CreateTimer(name, group, varName) plProfileVar gProfileVar##varName(ST_LITERAL(name), ST_LITERAL(group), plProfileVar::kDisplayTime) +#define plProfile_CreateAsynchTimer(name, group, varName) plProfileVar gProfileVar##varName(ST_LITERAL(name), ST_LITERAL(group), plProfileVar::kDisplayTime | plProfileVar::kDisplayResetEveryBegin | plProfileVar::kDisplayNoReset) #define plProfile_BeginTiming(varName) gProfileVar##varName.BeginTiming() #define plProfile_EndTiming(varName) gProfileVar##varName.EndTiming() #define plProfile_BeginLap(varName, lapName) gProfileVar##varName.BeginLap(lapName) #define plProfile_EndLap(varName, lapName) gProfileVar##varName.EndLap(lapName) -#define plProfile_CreateCounter(name, group, varName) plProfileVar gProfileVar##varName(name, group, plProfileVar::kDisplayCount) -#define plProfile_CreateCounterNoReset(name, group, varName) plProfileVar gProfileVar##varName(name, group, plProfileVar::kDisplayCount | plProfileVar::kDisplayNoReset) +#define plProfile_CreateCounter(name, group, varName) plProfileVar gProfileVar##varName(ST_LITERAL(name), ST_LITERAL(group), plProfileVar::kDisplayCount) +#define plProfile_CreateCounterNoReset(name, group, varName) plProfileVar gProfileVar##varName(ST_LITERAL(name), ST_LITERAL(group), plProfileVar::kDisplayCount | plProfileVar::kDisplayNoReset) #define plProfile_Inc(varName) gProfileVar##varName.Inc() #define plProfile_IncCount(varName, count) gProfileVar##varName.Inc(count) #define plProfile_Dec(varName) gProfileVar##varName.Dec() #define plProfile_Set(varName, value) gProfileVar##varName.Set(value) -#define plProfile_CreateMemCounter(name, group, varName) plProfileVar gProfileVar##varName(name, group, plProfileVar::kDisplayMem | plProfileVar::kDisplayNoReset) -#define plProfile_CreateMemCounterReset(name, group, varName) plProfileVar gProfileVar##varName(name, group, plProfileVar::kDisplayMem) +#define plProfile_CreateMemCounter(name, group, varName) plProfileVar gProfileVar##varName(ST_LITERAL(name), ST_LITERAL(group), plProfileVar::kDisplayMem | plProfileVar::kDisplayNoReset) +#define plProfile_CreateMemCounterReset(name, group, varName) plProfileVar gProfileVar##varName(ST_LITERAL(name), ST_LITERAL(group), plProfileVar::kDisplayMem) #define plProfile_NewMem(varName, memAmount) gProfileVar##varName.NewMem(memAmount) #define plProfile_DelMem(varName, memAmount) gProfileVar##varName.DelMem(memAmount) @@ -151,7 +153,7 @@ class plProfileBase }; protected: - const char* fName; // Name of timer + ST::string fName; // Name of timer uint64_t fValue; @@ -168,7 +170,7 @@ class plProfileBase void IAddAvg(); - void IPrintValue(uint64_t value, char* buf, bool printType); + ST::string IPrintValue(uint64_t value, bool printType); public: plProfileBase(); @@ -181,13 +183,13 @@ class plProfileBase uint64_t GetValue(); - void PrintValue(char* buf, bool printType=true); - void PrintAvg(char* buf, bool printType=true); - void PrintMax(char* buf, bool printType=true); + ST::string PrintValue(bool printType = true); + ST::string PrintAvg(bool printType = true); + ST::string PrintMax(bool printType = true); uint32_t GetTimerSamples() const { return fTimerSamples; } - const char* GetName() { return fName; } + ST::string GetName() const { return fName; } void SetActive(bool s) { fActive = s; } @@ -202,7 +204,7 @@ class plProfileBase class plProfileVar : public plProfileBase { protected: - const char* fGroup; + ST::string fGroup; plProfileLaps* fLaps; bool fLapsActive; @@ -210,13 +212,13 @@ class plProfileVar : public plProfileBase void IBeginTiming(); void IEndTiming(); - - void IBeginLap(const char* lapName); - void IEndLap(const char* lapName); + + void IBeginLap(const ST::string& lapName); + void IEndLap(const ST::string& lapName); public: // Name is the timer name. Each timer group gets its own plStatusLog - plProfileVar(const char *name, const char* group, uint8_t flags); + plProfileVar(ST::string name, ST::string group, uint8_t flags); ~plProfileVar(); // For timing @@ -238,10 +240,10 @@ class plProfileVar : public plProfileBase // Will output to log like // Timername : lapCnt: (lapName) : 3.22 msec // - void BeginLap(const char* lapName) { if(fActive && fRunning) IBeginLap(lapName); } - void EndLap(const char* lapName) { if(fActive && fRunning) IEndLap(lapName); } - - const char* GetGroup() { return fGroup; } + void BeginLap(const ST::string& lapName) { if (fActive && fRunning) IBeginLap(lapName); } + void EndLap(const ST::string& lapName) { if (fActive && fRunning) IEndLap(lapName); } + + ST::string GetGroup() const { return fGroup; } plProfileLaps* GetLaps() { return fLaps; } diff --git a/Sources/Plasma/NucleusLib/inc/plProfileManager.cpp b/Sources/Plasma/NucleusLib/inc/plProfileManager.cpp index f69d9b39c8..9c12570f61 100644 --- a/Sources/Plasma/NucleusLib/inc/plProfileManager.cpp +++ b/Sources/Plasma/NucleusLib/inc/plProfileManager.cpp @@ -42,7 +42,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plProfileManager.h" #include "plProfile.h" #include "hsTimer.h" -#include + +#include +#include plProfileManager::plProfileManager() : fLastAvgTime(0), fProcessorSpeed(0) { @@ -70,7 +72,7 @@ void plProfileManager::SetAvgTime(uint32_t avgMS) kAvgMilliseconds = avgMS; } -static plProfileVar gVarEFPS("EFPS", "General", plProfileVar::kDisplayTime | plProfileVar::kDisplayFPS); +static plProfileVar gVarEFPS(ST_LITERAL("EFPS"), ST_LITERAL("General"), plProfileVar::kDisplayTime | plProfileVar::kDisplayFPS); void plProfileManager::BeginFrame() { @@ -182,89 +184,65 @@ uint64_t plProfileBase::GetValue() return fValue; } -// Stolen from plMemTracker.cpp -static const char *insertCommas(unsigned long long value) +static ST::string insertCommas(unsigned long long value) { - static char str[30]; - memset(str, 0, sizeof(str)); - - snprintf(str, std::size(str), "%llu", value); - if (strlen(str) > 3) - { - memmove(&str[strlen(str)-3], &str[strlen(str)-4], 4); - str[strlen(str) - 4] = ','; - } - if (strlen(str) > 7) - { - memmove(&str[strlen(str)-7], &str[strlen(str)-8], 8); - str[strlen(str) - 8] = ','; + ST::string str; + while (value >= 1000) { + str = ST::format(",{>03}{}", value % 1000, str); + value /= 1000; } - if (strlen(str) > 11) - { - memmove(&str[strlen(str)-11], &str[strlen(str)-12], 12); - str[strlen(str) - 12] = ','; - } - - return str; + return ST::format("{}{}", value, str); } -void plProfileBase::IPrintValue(uint64_t value, char* buf, bool printType) +ST::string plProfileBase::IPrintValue(uint64_t value, bool printType) { - if (hsCheckBits(fDisplayFlags, kDisplayCount)) - { - if (printType) - { - const char* valueStr = insertCommas(value); - strcpy(buf, valueStr); + if (hsCheckBits(fDisplayFlags, kDisplayCount)) { + if (printType) { + return insertCommas(value); + } else { + return ST::string::from_uint(value); } - else - sprintf(buf, "%llu", static_cast(value)); - } - else if (hsCheckBits(fDisplayFlags, kDisplayFPS)) - { - sprintf(buf, "%.2f", 1000.0f / hsTimer::GetMilliSeconds(value)); - } - else if (hsCheckBits(fDisplayFlags, kDisplayTime)) - { - sprintf(buf, "%.2f", hsTimer::GetMilliSeconds(value)); - if (printType) - strcat(buf, " ms"); - } - else if (hsCheckBits(fDisplayFlags, kDisplayMem)) - { - if (printType) - { - if (value > (1024*1000)) - sprintf(buf, "%.2f MB", float(value) / (1024.f * 1024.f)); - else if (value > 1024) - sprintf(buf, "%llu KB", static_cast(value / 1024)); - else - sprintf(buf, "%llu b", static_cast(value)); + } else if (hsCheckBits(fDisplayFlags, kDisplayFPS)) { + return ST::format("{.2f}", 1000.0f / hsTimer::GetMilliSeconds(value)); + } else if (hsCheckBits(fDisplayFlags, kDisplayTime)) { + return ST::format("{.2f}{}", hsTimer::GetMilliSeconds(value), printType ? ST_LITERAL(" ms") : ST::string()); + } else if (hsCheckBits(fDisplayFlags, kDisplayMem)) { + if (printType) { + if (value > (1024*1000)) { + return ST::format("{.2f} MB", value / (1024.f * 1024.f)); + } else if (value > 1024) { + return ST::format("{} KB", value / 1024); + } else { + return ST::format("{} b", value); + } + } else { + return ST::string::from_uint(value); } - else - sprintf(buf, "%llu", static_cast(value)); + } else { + FATAL("Unhandled stat value type"); + return {}; } } -void plProfileBase::PrintValue(char* buf, bool printType) +ST::string plProfileBase::PrintValue(bool printType) { - IPrintValue(fValue, buf, printType); + return IPrintValue(fValue, printType); } -void plProfileBase::PrintAvg(char* buf, bool printType) +ST::string plProfileBase::PrintAvg(bool printType) { - IPrintValue(fLastAvg, buf, printType); + return IPrintValue(fLastAvg, printType); } -void plProfileBase::PrintMax(char* buf, bool printType) +ST::string plProfileBase::PrintMax(bool printType) { - IPrintValue(fMax, buf, printType); + return IPrintValue(fMax, printType); } //////////////////////////////////////////////////////////////////////////////// -plProfileLaps::LapInfo* plProfileLaps::IFindLap(const char* lapName) +plProfileLaps::LapInfo* plProfileLaps::IFindLap(const ST::string& lapName) { static int lastSearch = 0; @@ -290,13 +268,10 @@ plProfileLaps::LapInfo* plProfileLaps::IFindLap(const char* lapName) return nullptr; } -void plProfileLaps::BeginLap(uint64_t curValue, const char* name) +void plProfileLaps::BeginLap(uint64_t curValue, const ST::string& name) { LapInfo* lap = IFindLap(name); - if (!lap) - { - // Technically we shouldn't hold on to this pointer. However, I think - // it will be ok in all cases, so I'll wait until this blows up + if (!lap) { LapInfo info(name); fLapTimes.push_back(info); lap = &(*(fLapTimes.end()-1)); @@ -306,7 +281,7 @@ void plProfileLaps::BeginLap(uint64_t curValue, const char* name) lap->BeginTiming(curValue); } -void plProfileLaps::EndLap(uint64_t curValue, const char* name) +void plProfileLaps::EndLap(uint64_t curValue, const ST::string& name) { LapInfo* lap = IFindLap(name); @@ -333,9 +308,7 @@ void plProfileLaps::EndFrame() fLapTimes[i].EndFrame(); if (!fLapTimes[i].fUsedThisFrame) { - char buf[200]; - sprintf(buf, "Dropping unused lap %s", fLapTimes[i].GetName()); - hsStatusMessage(buf); + hsStatusMessage(ST::format("Dropping unused lap {}", fLapTimes[i].GetName()).c_str()); fLapTimes.erase(fLapTimes.begin()+i); i--; } @@ -363,11 +336,11 @@ plProfileBase* plProfileLaps::GetLap(int i) /////////////////////////////////////////////////////////////////////////////// -plProfileVar::plProfileVar(const char *name, const char* group, uint8_t flags) : - fGroup(group), +plProfileVar::plProfileVar(ST::string name, ST::string group, uint8_t flags) : + fGroup(std::move(group)), fLaps() { - fName = name; + fName = std::move(name); fDisplayFlags = flags; plProfileManager::Instance().AddTimer(this); fLapsActive = 0; @@ -378,7 +351,7 @@ plProfileVar::~plProfileVar() delete fLaps; } -void plProfileVar::IBeginLap(const char* lapName) +void plProfileVar::IBeginLap(const ST::string& lapName) { if (!fLaps) fLaps = new plProfileLaps; @@ -388,7 +361,7 @@ void plProfileVar::IBeginLap(const char* lapName) BeginTiming(); } -void plProfileVar::IEndLap(const char* lapName) +void plProfileVar::IEndLap(const ST::string& lapName) { EndTiming(); if(fLapsActive) diff --git a/Sources/Plasma/NucleusLib/inc/plProfileManager.h b/Sources/Plasma/NucleusLib/inc/plProfileManager.h index 344fc640f3..476dab7dec 100644 --- a/Sources/Plasma/NucleusLib/inc/plProfileManager.h +++ b/Sources/Plasma/NucleusLib/inc/plProfileManager.h @@ -43,6 +43,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plProfileManager_h_inc #include "HeadSpin.h" + +#include +#include #include #include "plProfile.h" @@ -88,7 +91,7 @@ class plProfileLaps public: bool fUsedThisFrame; - LapInfo(const char* name) : fUsedThisFrame() { fName = name; fDisplayFlags = kDisplayTime; } + LapInfo(ST::string name) : fUsedThisFrame() { fName = std::move(name); fDisplayFlags = kDisplayTime; } bool operator<(const LapInfo& rhs) const { return fLastAvg < rhs.fLastAvg; } void BeginTiming(uint64_t value) { fValue -= value; } @@ -96,11 +99,11 @@ class plProfileLaps }; std::vector fLapTimes; - LapInfo* IFindLap(const char* lapName); + LapInfo* IFindLap(const ST::string& lapName); public: - void BeginLap(uint64_t curValue, const char* name); - void EndLap(uint64_t curValue, const char* name); + void BeginLap(uint64_t curValue, const ST::string& name); + void EndLap(uint64_t curValue, const ST::string& name); void BeginFrame(); void EndFrame(); diff --git a/Sources/Plasma/NucleusLib/pnKeyedObject/plMsgForwarder.h b/Sources/Plasma/NucleusLib/pnKeyedObject/plMsgForwarder.h index 65f4addb25..ea2f695660 100644 --- a/Sources/Plasma/NucleusLib/pnKeyedObject/plMsgForwarder.h +++ b/Sources/Plasma/NucleusLib/pnKeyedObject/plMsgForwarder.h @@ -43,6 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plMsgForwarder_h_inc #include +#include #include "hsKeyedObject.h" diff --git a/Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp b/Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp index 4e378fb638..e45ea32dba 100644 --- a/Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp +++ b/Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp @@ -41,6 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "plUoid.h" #include "hsStream.h" +#include //// plLocation ////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/NucleusLib/pnMessage/plSDLModifierMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plSDLModifierMsg.h index 25740590ef..f8f4cd4c0e 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plSDLModifierMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plSDLModifierMsg.h @@ -43,7 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plSDLModifierMsg_INC #include "plMessage.h" - +#include // // A msg sent to an SDL modifier to tell it send or recv state. diff --git a/Sources/Plasma/NucleusLib/pnNetCli/Intern.h b/Sources/Plasma/NucleusLib/pnNetCli/Intern.h index 2f81b027a4..90903cfd64 100644 --- a/Sources/Plasma/NucleusLib/pnNetCli/Intern.h +++ b/Sources/Plasma/NucleusLib/pnNetCli/Intern.h @@ -59,12 +59,8 @@ namespace pnNetCli { * ***/ -struct NetMsgChannel; - -NetMsgChannel * NetMsgChannelLock ( - unsigned protocol, - bool server, - unsigned * largestRecv +void NetMsgChannelLock( + NetMsgChannel* channel ); void NetMsgChannelUnlock ( NetMsgChannel * channel @@ -77,10 +73,13 @@ const NetMsgInitSend * NetMsgChannelFindSendMessage ( NetMsgChannel * channel, uintptr_t messageId ); +uint32_t NetMsgChannelGetProtocol( + NetMsgChannel* channel +); void NetMsgChannelGetDhConstants ( const NetMsgChannel * channel, unsigned * dh_g, - const plBigNum** dh_xa, // client: dh_x server: dh_a + const plBigNum** dh_x, const plBigNum** dh_n ); @@ -99,13 +98,6 @@ void NetMsgCryptClientStart ( plBigNum* serverSeed ); -void NetMsgCryptServerConnect ( - NetMsgChannel* channel, - unsigned seedBytes, - const uint8_t seedData[], - plBigNum* clientSeed -); - /***************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnNetCli/pnNcChannel.cpp b/Sources/Plasma/NucleusLib/pnNetCli/pnNcChannel.cpp index a637b1ecd9..51216b80c1 100644 --- a/Sources/Plasma/NucleusLib/pnNetCli/pnNcChannel.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCli/pnNcChannel.cpp @@ -46,10 +46,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ***/ #include "Pch.h" -#include -#include + #include "hsRefCnt.h" -#include "hsLockGuard.h" namespace pnNetCli { @@ -60,70 +58,26 @@ namespace pnNetCli { * ***/ -struct ChannelCrit { - ~ChannelCrit(); - ChannelCrit() : m_init(true) { } - - inline void lock() - { - hsAssert(m_init, "Bad things have happened."); - m_critsect.lock(); - } - - inline void unlock() - { - hsAssert(m_init, "Bad things have happened."); - m_critsect.unlock(); - } - -private: - bool m_init; - std::mutex m_critsect; -}; - struct NetMsgChannel : hsRefCnt { - NetMsgChannel() : hsRefCnt(0), m_protocol(), m_server(), m_largestRecv(), m_dh_g() { } + NetMsgChannel(uint32_t protocol, uint32_t dh_g, const plBigNum& dh_x, const plBigNum& dh_n) : + m_protocol(protocol), + m_dh_g(dh_g), + m_dh_x(dh_x), + m_dh_n(dh_n) + {} uint32_t m_protocol; - bool m_server; // Message definitions - uint32_t m_largestRecv; std::vector m_sendMsgs; std::vector m_recvMsgs; // Diffie-Hellman constants uint32_t m_dh_g; - plBigNum m_dh_xa; // client: dh_x server: dh_a + plBigNum m_dh_x; plBigNum m_dh_n; }; -static ChannelCrit s_channelCrit; -static std::list* s_channels; - - -/**************************************************************************** -* -* ChannelCrit -* -***/ - -//=========================================================================== -ChannelCrit::~ChannelCrit () { - hsLockGuard(*this); - - if (s_channels) { - while (s_channels->size()) { - NetMsgChannel* const channel = s_channels->front(); - s_channels->remove(channel); - channel->UnRef("ChannelLink"); - } - - delete s_channels; - s_channels = nullptr; - } -} - /***************************************************************************** * @@ -131,29 +85,27 @@ ChannelCrit::~ChannelCrit () { * ***/ -//=========================================================================== -// Returns max size of message in bytes -static unsigned ValidateMsg (const NetMsg & msg) { +static void ValidateMsg(const NetMsg& msg) +{ ASSERT(msg.fields); ASSERT(msg.count); - unsigned maxBytes = sizeof(uint16_t); // for message id + bool gotVarCount = false; + bool gotVarField = false; bool prevFieldWasVarCount = false; for (unsigned i = 0; i < msg.count; i++) { const NetMsgField & field = msg.fields[i]; for (;;) { - bool gotVarCount = false; - bool gotVarField = false; if (field.type == kNetMsgFieldVarCount) { if (gotVarField || gotVarCount) FATAL("Msg definition may only include one variable length field"); gotVarCount = true; break; } - if (field.type == kNetMsgFieldVarPtr || field.type == kNetMsgFieldRawVarPtr) { - if (gotVarField || gotVarCount) + if (field.type == kNetMsgFieldVarPtr) { + if (gotVarField) FATAL("Msg definition may only include one variable length field"); if (!prevFieldWasVarCount) FATAL("Variable length field must preceded by variable length count field"); @@ -168,33 +120,18 @@ static unsigned ValidateMsg (const NetMsg & msg) { prevFieldWasVarCount = false; switch (field.type) { case kNetMsgFieldInteger: - maxBytes += sizeof(uint64_t); - break; - - case kNetMsgFieldReal: - maxBytes += sizeof(double); - break; - + case kNetMsgFieldString: + case kNetMsgFieldData: case kNetMsgFieldVarPtr: - case kNetMsgFieldRawVarPtr: - break; + break; case kNetMsgFieldVarCount: prevFieldWasVarCount = true; - // fall-thru... - case kNetMsgFieldString: - case kNetMsgFieldPtr: - case kNetMsgFieldRawPtr: - case kNetMsgFieldData: - case kNetMsgFieldRawData: - maxBytes += msg.fields[i].count * msg.fields[i].size; - break; + break; DEFAULT_FATAL(field.type); } } - - return maxBytes; } @@ -211,7 +148,7 @@ static unsigned MaxMsgId (const T msgs[], unsigned count) { } //=========================================================================== -static void AddSendMsgs_CS ( +static void AddSendMsgs( NetMsgChannel * channel, const NetMsgInitSend src[], unsigned count @@ -232,7 +169,7 @@ static void AddSendMsgs_CS ( } //=========================================================================== -static void AddRecvMsgs_CS ( +static void AddRecvMsgs( NetMsgChannel * channel, const NetMsgInitRecv src[], unsigned count @@ -251,44 +188,8 @@ static void AddRecvMsgs_CS ( // copy the message handler *dst = *src; - const uint32_t bytes = ValidateMsg(*dst->msg); - channel->m_largestRecv = std::max(channel->m_largestRecv, bytes); - } -} - -//=========================================================================== -static NetMsgChannel* FindChannel_CS (uint32_t protocol, bool server) { - if (!s_channels) - return nullptr; - - std::list::iterator it = s_channels->begin(); - for (; it != s_channels->end(); ++it) { - if (((*it)->m_protocol == protocol) && ((*it)->m_server == server)) - return *it; + ValidateMsg(*dst->msg); } - - return nullptr; -} - -//=========================================================================== -static NetMsgChannel* FindOrCreateChannel_CS (uint32_t protocol, bool server) { - if (!s_channels) { - s_channels = new std::list(); - } - - // find or create protocol - NetMsgChannel * channel = FindChannel_CS(protocol, server); - if (!channel) { - channel = new NetMsgChannel(); - channel->m_protocol = protocol; - channel->m_server = server; - channel->m_largestRecv = 0; - - s_channels->push_back(channel); - channel->Ref("ChannelLink"); - } - - return channel; } @@ -299,29 +200,14 @@ static NetMsgChannel* FindOrCreateChannel_CS (uint32_t protocol, bool server) { ***/ //============================================================================ -NetMsgChannel * NetMsgChannelLock ( - unsigned protocol, - bool server, - uint32_t * largestRecv -) { - NetMsgChannel * channel; - hsLockGuard(s_channelCrit); - if (nullptr != (channel = FindChannel_CS(protocol, server))) { - *largestRecv = channel->m_largestRecv; - channel->Ref("ChannelLock"); - } - else { - *largestRecv = 0; - } - return channel; +void NetMsgChannelLock(NetMsgChannel* channel) +{ + channel->Ref("ChannelLock"); } //============================================================================ -void NetMsgChannelUnlock ( - NetMsgChannel * channel -) { - hsLockGuard(s_channelCrit); - +void NetMsgChannelUnlock(NetMsgChannel* channel) +{ channel->UnRef("ChannelLock"); } @@ -359,15 +245,20 @@ const NetMsgInitSend * NetMsgChannelFindSendMessage ( } //============================================================================ +uint32_t NetMsgChannelGetProtocol(NetMsgChannel* channel) +{ + return channel->m_protocol; +} + void NetMsgChannelGetDhConstants ( const NetMsgChannel * channel, uint32_t * dh_g, - const plBigNum** dh_xa, + const plBigNum** dh_x, const plBigNum** dh_n ) { - if (dh_g) *dh_g = channel->m_dh_g; - if (dh_xa) *dh_xa = &channel->m_dh_xa; - if (dh_n) *dh_n = &channel->m_dh_n; + if (dh_g) *dh_g = channel->m_dh_g; + if (dh_x) *dh_x = &channel->m_dh_x; + if (dh_n) *dh_n = &channel->m_dh_n; } @@ -381,42 +272,30 @@ void NetMsgChannelGetDhConstants ( ***/ //=========================================================================== -void NetMsgProtocolRegister ( +NetMsgChannel* NetMsgChannelCreate( uint32_t protocol, - bool server, const NetMsgInitSend sendMsgs[], uint32_t sendMsgCount, const NetMsgInitRecv recvMsgs[], uint32_t recvMsgCount, uint32_t dh_g, - const plBigNum& dh_xa, // client: dh_x server: dh_a + const plBigNum& dh_x, const plBigNum& dh_n ) { - hsLockGuard(s_channelCrit); - - NetMsgChannel * channel = FindOrCreateChannel_CS(protocol, server); + NetMsgChannel* channel = new NetMsgChannel(protocol, dh_g, dh_x, dh_n); - // make sure no connections have been established on this protocol, otherwise - // we'll be modifying a live data structure; NetCli's don't lock their protocol - // to operate on it once they have linked to it! - ASSERT(channel->RefCnt() == 1); - - channel->m_dh_g = dh_g; - channel->m_dh_xa = dh_xa; - channel->m_dh_n = dh_n; + if (sendMsgCount) { + AddSendMsgs(channel, sendMsgs, sendMsgCount); + } + if (recvMsgCount) { + AddRecvMsgs(channel, recvMsgs, recvMsgCount); + } - if (sendMsgCount) - AddSendMsgs_CS(channel, sendMsgs, sendMsgCount); - if (recvMsgCount) - AddRecvMsgs_CS(channel, recvMsgs, recvMsgCount); + return channel; } //=========================================================================== -void NetMsgProtocolDestroy (uint32_t protocol, bool server) { - hsLockGuard(s_channelCrit); - - if (NetMsgChannel* channel = FindChannel_CS(protocol, server)) { - s_channels->remove(channel); - channel->UnRef("ChannelLink"); - } +void NetMsgChannelDelete(NetMsgChannel* channel) +{ + channel->UnRef("Lifetime"); } diff --git a/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp b/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp index c2075e352d..8a74ede3ea 100644 --- a/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp @@ -100,7 +100,6 @@ namespace pnNetCli { ***/ enum ENetCliMode { - kNetCliModeServerStart, kNetCliModeClientStart, kNetCliModeEncrypted, kNumNetCliModes @@ -120,9 +119,7 @@ struct NetCli { // communication channel AsyncSocket sock; - ENetProtocol protocol; NetMsgChannel * channel; - bool server; // message send/recv const NetMsgInitRecv * recvMsg; @@ -144,7 +141,7 @@ struct NetCli { std::vector recvBuffer; NetCli() - : sock(), protocol(), channel(), server(), recvMsg() + : sock(), channel(), recvMsg() , recvField(), recvFieldBytes(), recvDispatch(), sendCurr(), mode() , encryptFcn(), seed(), cryptIn(), cryptOut(), sendBuffer() { @@ -177,7 +174,7 @@ static void PutBufferOnWire (NetCli * cli, void * data, unsigned bytes) { // Write to the netlog if (s_netlog) { NetLogMessage_Header header; - header.m_protocol = cli->protocol; + header.m_protocol = NetMsgChannelGetProtocol(cli->channel); header.m_direction = 0; // kCli2Srv header.m_time = GetAdjustedTimer(); header.m_size = bytes; @@ -300,8 +297,6 @@ static void BufferedSendData ( *(uint16_t*)&temp[0] = hsToLE16(*(uint16_t*)msg); } else if (cmd->size == sizeof(uint32_t)) { *(uint32_t*)&temp[0] = hsToLE32(*(uint32_t*)msg); - } else if (cmd->size == sizeof(uint64_t)) { - *(uint64_t*)&temp[0] = hsToLE64(*(uint64_t*)msg); } } else { // Value arrays are passed in by ptr @@ -312,36 +307,6 @@ static void BufferedSendData ( *(uint16_t*)&temp[i] = hsToLE16(((uint16_t*)*msg)[i]); } else if (cmd->size == sizeof(uint32_t)) { *(uint32_t*)&temp[i] = hsToLE32(((uint32_t*)*msg)[i]); - } else if (cmd->size == sizeof(uint64_t)) { - *(uint64_t*)&temp[i] = hsToLE64(((uint64_t*)*msg)[i]); - } - } - } - - // Write values to send buffer - AddToSendBuffer(cli, bytes, temp.get()); - } - break; - - case kNetMsgFieldReal: { - const unsigned count = cmd->count ? cmd->count : 1; - const unsigned bytes = cmd->size * count; - auto temp = std::make_unique(bytes); - - if (count == 1) { - // Single values are passed in by value - if (cmd->size == sizeof(float)) { - *(float*)&temp[0] = hsToLEFloat(*(float*)msg); - } else if (cmd->size == sizeof(double)) { - *(double*)&temp[0] = hsToLEFloat(*(double*)msg); - } - } else { - // Value arrays are passed in by ptr - for (size_t i = 0; i < count; i++) { - if (cmd->size == sizeof(float)) { - *(float*)&temp[i] = hsToLEFloat(((float*)*msg)[i]); - } else if (cmd->size == sizeof(double)) { - *(double*)&temp[i] = hsToLEFloat(((double*)*msg)[i]); } } } @@ -371,8 +336,7 @@ static void BufferedSendData ( } break; - case kNetMsgFieldData: - case kNetMsgFieldRawData: { + case kNetMsgFieldData: { // write values to send buffer AddToSendBuffer(cli, cmd->count * cmd->size, (const void *) *msg); } @@ -389,8 +353,7 @@ static void BufferedSendData ( } break; - case kNetMsgFieldVarPtr: - case kNetMsgFieldRawVarPtr: { + case kNetMsgFieldVarPtr: { ASSERT(varSize); // write var sized array AddToSendBuffer(cli, varCount * varSize, (const void *) *msg); @@ -399,13 +362,6 @@ static void BufferedSendData ( } break; - case kNetMsgFieldPtr: - case kNetMsgFieldRawPtr: { - // write values - AddToSendBuffer(cli, cmd->count * cmd->size, (const void *) *msg); - } - break; - DEFAULT_FATAL(cmd->type); } } @@ -470,8 +426,6 @@ static bool DispatchData (NetCli * cli, void * param) { ((uint16_t*)data)[i] = hsToLE16(((uint16_t*)data)[i]); } else if (cli->recvField->size == sizeof(uint32_t)) { ((uint32_t*)data)[i] = hsToLE32(((uint32_t*)data)[i]); - } else if (cli->recvField->size == sizeof(uint64_t)) { - ((uint64_t*)data)[i] = hsToLE64(((uint64_t*)data)[i]); } } @@ -479,37 +433,7 @@ static bool DispatchData (NetCli * cli, void * param) { } break; - case kNetMsgFieldReal: { - const unsigned count - = cli->recvField->count - ? cli->recvField->count - : 1; - - // Get float values - const unsigned bytes = count * cli->recvField->size; - const size_t oldSize = cli->recvBuffer.size(); - cli->recvBuffer.resize(oldSize + bytes); - uint8_t * data = cli->recvBuffer.data() + oldSize; - if (!cli->input.Get(bytes, data)) { - cli->recvBuffer.resize(oldSize); - goto NEED_MORE_DATA; - } - - // Convert to platform endianness - for (size_t i = 0; i < count; i++) { - if (cli->recvField->size == sizeof(float)) { - ((float*)data)[i] = hsToLEFloat(((float*)data)[i]); - } else if (cli->recvField->size == sizeof(double)) { - ((double*)data)[i] = hsToLEDouble(((double*)data)[i]); - } - } - - // Field complete - } - break; - - case kNetMsgFieldData: - case kNetMsgFieldRawData: { + case kNetMsgFieldData: { // Read fixed-length data into destination buffer const unsigned bytes = cli->recvField->count * cli->recvField->size; const size_t oldSize = cli->recvBuffer.size(); @@ -545,8 +469,7 @@ static bool DispatchData (NetCli * cli, void * param) { } break; - case kNetMsgFieldVarPtr: - case kNetMsgFieldRawVarPtr: { + case kNetMsgFieldVarPtr: { // Read var-length data into destination buffer const unsigned bytes = cli->recvFieldBytes; const size_t oldSize = cli->recvBuffer.size(); @@ -727,72 +650,6 @@ static void ClientConnect (NetCli * cli) { } } -//============================================================================ -static bool ServerRecvConnect ( - NetCli * cli, - const NetCli_PacketHeader & pkt -) { - // Validate connection state - if (cli->mode != kNetCliModeServerStart) - return false; - - // Validate message size - const NetCli_Cli2Srv_Connect & msg = - * (const NetCli_Cli2Srv_Connect *) &pkt; - if (pkt.length < sizeof(msg)) - return false; - int seedLength = msg.length - sizeof(pkt); - - // Send the server seed to the client (unencrypted) - if (cli->sock) { - NetCli_Srv2Cli_Encrypt reply; - reply.message = kNetCliSrv2CliEncrypt; - reply.length = seedLength == 0 ? 0 : sizeof(reply); // reply with empty seed if we got empty seed (this means: no encryption) - memcpy(reply.serverSeed, cli->seed, sizeof(reply.serverSeed)); - AsyncSocketSend(cli->sock, &reply, reply.length); - } - - if (seedLength == 0) { // client wishes no encryption (that's okay, nobody else can "fake" us as nobody has the private key, so if the client actually wants encryption it will only work with the correct peer) - cli->cryptIn = nullptr; - cli->cryptOut = nullptr; - } - else { - // Compute client seed - uint8_t clientSeed[kNetMaxSymmetricSeedBytes]; - plBigNum clientSeedValue; - { - NetMsgCryptServerConnect( - cli->channel, - seedLength, - msg.dh_y_data, - &clientSeedValue - ); - - memset(&clientSeed, 0, sizeof(clientSeed)); - unsigned bytes; - unsigned char * data = clientSeedValue.GetData_LE(&bytes); - memcpy(clientSeed, data, std::min(size_t(bytes), sizeof(clientSeed))); - delete [] data; - } - - // Create the symmetric key from a combination - // of the client seed and the server seed - uint8_t sharedSeed[kNetMaxSymmetricSeedBytes]; - CreateSymmetricKey( - sizeof(cli->seed), cli->seed, // server seed - sizeof(clientSeed), clientSeed, // client seed - sizeof(sharedSeed), sharedSeed // combined seed - ); - - // Switch to encrypted mode - cli->cryptIn = CryptKeyCreate(kCryptRc4, sizeof(sharedSeed), sharedSeed); - cli->cryptOut = CryptKeyCreate(kCryptRc4, sizeof(sharedSeed), sharedSeed); - } - - cli->mode = kNetCliModeEncrypted; // should rather be called "established", but whatever - return cli->encryptFcn(kNetSuccess); -} - //============================================================================ static bool ClientRecvEncrypt ( NetCli * cli, @@ -875,7 +732,7 @@ static unsigned DispatchPacket ( bool result = false; switch (pkt.message) { case kNetCliCli2SrvConnect: - result = ServerRecvConnect(cli, pkt); + hsAssert(false, "Server sent a client-to-server encryption packet!?"); break; case kNetCliSrv2CliEncrypt: result = ClientRecvEncrypt(cli, pkt); @@ -917,26 +774,14 @@ static void ResetSendRecv (NetCli * cli) { } //=========================================================================== -static NetCli * ConnCreate ( - AsyncSocket sock, - unsigned protocol, - ENetCliMode mode -) { - // find channel - unsigned largestRecv; - NetMsgChannel * channel = NetMsgChannelLock( - protocol, - mode == kNetCliModeServerStart, - &largestRecv - ); - if (!channel) - return nullptr; +static NetCli* ConnCreate(AsyncSocket sock, NetMsgChannel* channel) +{ + NetMsgChannelLock(channel); NetCli * const cli = new NetCli; cli->sock = sock; - cli->protocol = (ENetProtocol) protocol; cli->channel = channel; - cli->mode = mode; + cli->mode = kNetCliModeClientStart; #if !defined(PLASMA_EXTERNAL_RELEASE) && defined(HS_BUILD_FOR_WIN32) // Network debug pipe @@ -989,20 +834,18 @@ static void SetConnSeed ( //============================================================================ NetCli * NetCliConnectAccept ( AsyncSocket sock, - unsigned protocol, + NetMsgChannel* channel, bool unbuffered, FNetCliEncrypt encryptFcn, unsigned seedBytes, const uint8_t seedData[] ) { // Create connection - NetCli * cli = ConnCreate(sock, protocol, kNetCliModeClientStart); - if (cli) { - AsyncSocketEnableNagling(sock, !unbuffered); - cli->encryptFcn = std::move(encryptFcn); - SetConnSeed(cli, seedBytes, seedData); - Connect::ClientConnect(cli); - } + NetCli* cli = ConnCreate(sock, channel); + AsyncSocketEnableNagling(sock, !unbuffered); + cli->encryptFcn = std::move(encryptFcn); + SetConnSeed(cli, seedBytes, seedData); + Connect::ClientConnect(cli); return cli; } @@ -1097,7 +940,7 @@ bool NetCliDispatch ( // Write to the netlog if (s_netlog) { NetLogMessage_Header header; - header.m_protocol = cli->protocol; + header.m_protocol = NetMsgChannelGetProtocol(cli->channel); header.m_direction = 1; // kSrv2Cli header.m_time = GetAdjustedTimer(); header.m_size = bytes; diff --git a/Sources/Plasma/NucleusLib/pnNetCli/pnNcEncrypt.cpp b/Sources/Plasma/NucleusLib/pnNetCli/pnNcEncrypt.cpp index f4fac00919..f6e8903d88 100644 --- a/Sources/Plasma/NucleusLib/pnNetCli/pnNcEncrypt.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCli/pnNcEncrypt.cpp @@ -80,31 +80,6 @@ namespace pnNetCli { static_assert(IS_POW2(kNetDiffieHellmanKeyBits), "DH Key bit count is not a power of 2"); -/***************************************************************************** -* -* Private -* -***/ - -//============================================================================ -// TODO: Cache computed keys -static void GetCachedServerKey ( - NetMsgChannel* channel, - plBigNum* ka, - const plBigNum& dh_y -) { - // Get diffie-hellman constants - unsigned DH_G; - const plBigNum* DH_A; - const plBigNum* DH_N; - NetMsgChannelGetDhConstants(channel, &DH_G, &DH_A, &DH_N); - hsAssert(!DH_N->isZero(), "DH_N must not be zero in encrypted mode"); - - // Compute the result - ka->PowMod(dh_y, *DH_A, *DH_N); -} - - /***************************************************************************** * * Module functions @@ -141,16 +116,4 @@ void NetMsgCryptClientStart ( } } -//============================================================================ -void NetMsgCryptServerConnect ( - NetMsgChannel* channel, - unsigned seedBytes, - const uint8_t seedData[], - plBigNum* clientSeed -) { - // Server computes client key: ka = y^a mod n - const plBigNum dh_y(seedBytes, seedData); - GetCachedServerKey(channel, clientSeed, dh_y); -} - } // namespace pnNetCli diff --git a/Sources/Plasma/NucleusLib/pnNetCli/pnNetCli.h b/Sources/Plasma/NucleusLib/pnNetCli/pnNetCli.h index 6178fe0944..c8098d135b 100644 --- a/Sources/Plasma/NucleusLib/pnNetCli/pnNetCli.h +++ b/Sources/Plasma/NucleusLib/pnNetCli/pnNetCli.h @@ -103,7 +103,7 @@ How to create a message sender/receiver: static const NetMsgField kFieldPlayerId = NET_MSG_FIELD_DWORD(); static const NetMsgField kFieldObjectPos = NET_MSG_FIELD_FLOAT_ARRAY(3); static const NetMsgField kFieldPlayerName = NET_MSG_FIELD_STRING(kPlayerNameMaxLength); - static const NetMsgField kFieldPlayerData = NET_MSG_FIELD_PTR(kPlayerDataMaxLength); + static const NetMsgField kFieldPlayerData = NET_MSG_FIELD_DATA(kPlayerDataMaxLength); static const NetMsgField kFieldVaultDataLen = NET_MSG_FIELD_VAR_COUNT(kVaultDataMaxLength); static const NetMsgField kFieldVaultData = NET_MSG_FIELD_VAR_PTR(); static const NetMsgField kFieldPingTimeMs = NET_MSG_FIELD_DWORD(); @@ -132,41 +132,20 @@ How to create a message sender/receiver: 5. Register message description blocks -// for server: - static const NetMsgInitSend s_srvSend[] = { - { s_moveObject }, - { s_playerJoin }, - { s_ping }, - }; - - static const NetMsgInitRecv s_srvRecv[] = { - { s_pingReply, RecvMsgPingReply }, - }; - - s_srvConn = NetMsgProtocolRegister( - kNetProtocolCliToGame, - true, - s_srvSend, std::size(s_srvSend), - s_srvRecv, std::size(s_srvRecv) - ); - - -// for client: - static const NetMsgInitSend s_cliSend[] = { + static const NetMsgInitSend s_send[] = { { s_pingReply }, }; - static const NetMsgInitRecv s_cliRecv[] = { + static const NetMsgInitRecv s_recv[] = { { s_moveObject, RecvMsgMoveObject }, { s_playerJoin, RecvMsgPlayerJoin }, { s_ping, RecvMsgPing }, }; - s_cliConn = NetMsgProtocolRegister( + s_channel = NetMsgChannelCreate( kNetProtocolCliToGame, - false, - s_cliSend, std::size(s_cliSend), - s_cliRecv, std::size(s_cliRecv) + s_send, std::size(s_send), + s_recv, std::size(s_recv) ); @@ -232,20 +211,11 @@ How to create a message sender/receiver: ***/ enum ENetMsgFieldType { - // Compressable fields kNetMsgFieldInteger, - kNetMsgFieldReal, kNetMsgFieldString, // variable length unicode string kNetMsgFieldData, // data with length <= sizeof(uint32_t) - kNetMsgFieldPtr, // pointer to fixed length data kNetMsgFieldVarPtr, // pointer to variable length data - - // Non-compressible fields (images, sounds, encrypted data, etc) - kNetMsgFieldRawData, // data with length <= sizeof(uint32_t) - kNetMsgFieldRawPtr, // pointer to fixed length data - kNetMsgFieldRawVarPtr, // pointer to variable length data - - kNetMsgFieldVarCount, // count for kNetMsgFieldVarPtr and kNetMsgFieldRawVarPtr + kNetMsgFieldVarCount, // count for kNetMsgFieldVarPtr kNumNetMsgFieldTypes }; @@ -276,33 +246,18 @@ struct NetCli; #define NET_MSG(msgId, msgFields) { #msgId, msgId, msgFields, (unsigned)std::size(msgFields) } -#define NET_MSG_FIELD(type, count, size) { type, count, size } - -#define NET_MSG_FIELD_BYTE() NET_MSG_FIELD(kNetMsgFieldInteger, 0, sizeof(uint8_t)) -#define NET_MSG_FIELD_WORD() NET_MSG_FIELD(kNetMsgFieldInteger, 0, sizeof(uint16_t)) -#define NET_MSG_FIELD_DWORD() NET_MSG_FIELD(kNetMsgFieldInteger, 0, sizeof(uint32_t)) -#define NET_MSG_FIELD_QWORD() NET_MSG_FIELD(kNetMsgFieldInteger, 0, sizeof(uint64_t)) -#define NET_MSG_FIELD_FLOAT() NET_MSG_FIELD(kNetMsgFieldReal, 0, sizeof(float)) -#define NET_MSG_FIELD_DOUBLE() NET_MSG_FIELD(kNetMsgFieldReal, 0, sizeof(double)) - -#define NET_MSG_FIELD_BYTE_ARRAY(maxCount) NET_MSG_FIELD(kNetMsgFieldInteger, maxCount, sizeof(uint8_t)) -#define NET_MSG_FIELD_WORD_ARRAY(maxCount) NET_MSG_FIELD(kNetMsgFieldInteger, maxCount, sizeof(uint16_t)) -#define NET_MSG_FIELD_DWORD_ARRAY(maxCount) NET_MSG_FIELD(kNetMsgFieldInteger, maxCount, sizeof(uint32_t)) -#define NET_MSG_FIELD_QWORD_ARRAY(maxCount) NET_MSG_FIELD(kNetMsgFieldInteger, maxCount, sizeof(uint64_t)) -#define NET_MSG_FIELD_FLOAT_ARRAY(maxCount) NET_MSG_FIELD(kNetMsgFieldReal, maxCount, sizeof(float)) -#define NET_MSG_FIELD_DOUBLE_ARRAY(maxCount) NET_MSG_FIELD(kNetMsgFieldReal, maxCount, sizeof(double)) +#define NET_MSG_FIELD_BYTE() { kNetMsgFieldInteger, 0, sizeof(uint8_t) } +#define NET_MSG_FIELD_WORD() { kNetMsgFieldInteger, 0, sizeof(uint16_t) } +#define NET_MSG_FIELD_DWORD() { kNetMsgFieldInteger, 0, sizeof(uint32_t) } -#define NET_MSG_FIELD_STRING(maxLength) NET_MSG_FIELD(kNetMsgFieldString, maxLength, sizeof(char16_t)) +#define NET_MSG_FIELD_BYTE_ARRAY(maxCount) { kNetMsgFieldInteger, maxCount, sizeof(uint8_t) } +#define NET_MSG_FIELD_WORD_ARRAY(maxCount) { kNetMsgFieldInteger, maxCount, sizeof(uint16_t) } +#define NET_MSG_FIELD_DWORD_ARRAY(maxCount) { kNetMsgFieldInteger, maxCount, sizeof(uint32_t) } -#define NET_MSG_FIELD_DATA(maxBytes) NET_MSG_FIELD(kNetMsgFieldData, maxBytes, 1) -#define NET_MSG_FIELD_PTR(maxBytes) NET_MSG_FIELD(kNetMsgFieldPtr, maxBytes, 1) -#define NET_MSG_FIELD_RAW_DATA(maxBytes) NET_MSG_FIELD(kNetMsgFieldRawData, maxBytes, 1) -#define NET_MSG_FIELD_RAW_PTR(maxBytes) NET_MSG_FIELD(kNetMsgFieldRawPtr, maxBytes, 1) - -#define NET_MSG_FIELD_VAR_PTR() NET_MSG_FIELD(kNetMsgFieldVarPtr, 0, 0) -#define NET_MSG_FIELD_RAW_VAR_PTR() NET_MSG_FIELD(kNetMsgFieldRawVarPtr, 0, 0) - -#define NET_MSG_FIELD_VAR_COUNT(elemSize, maxCount) NET_MSG_FIELD(kNetMsgFieldVarCount, maxCount, elemSize) +#define NET_MSG_FIELD_STRING(maxLength) { kNetMsgFieldString, maxLength, sizeof(char16_t) } +#define NET_MSG_FIELD_DATA(maxBytes) { kNetMsgFieldData, maxBytes, 1 } +#define NET_MSG_FIELD_VAR_PTR() { kNetMsgFieldVarPtr, 0, 0 } +#define NET_MSG_FIELD_VAR_COUNT(elemSize, maxCount) { kNetMsgFieldVarCount, maxCount, elemSize } /***************************************************************************** @@ -311,6 +266,10 @@ struct NetCli; * ***/ +// Opaque type +namespace pnNetCli { struct NetMsgChannel; } +using pnNetCli::NetMsgChannel; + struct NetMsgInitSend { const NetMsg *msg; }; @@ -319,22 +278,20 @@ struct NetMsgInitRecv { bool (* recv)(const uint8_t msg[], unsigned bytes, void * param); }; -void NetMsgProtocolRegister ( +NetMsgChannel* NetMsgChannelCreate( uint32_t protocol, // from pnNetBase/pnNbProtocol.h - bool server, const NetMsgInitSend sendMsgs[], // messages this program can send uint32_t sendMsgCount, const NetMsgInitRecv recvMsgs[], // messages this program can receive uint32_t recvMsgCount, // Diffie-Hellman keys uint32_t dh_g, - const plBigNum& dh_xa, // client: dh_x server: dh_a + const plBigNum& dh_x, const plBigNum& dh_n ); -void NetMsgProtocolDestroy ( - uint32_t protocol, - bool server +void NetMsgChannelDelete( + NetMsgChannel* channel ); @@ -351,7 +308,7 @@ typedef std::function FNetCliEncrypt; NetCli * NetCliConnectAccept ( AsyncSocket sock, - unsigned protocol, + NetMsgChannel* channel, bool unbuffered, FNetCliEncrypt encryptFcn, unsigned seedBytes, // optional diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h index 413359c2bc..441bff4636 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h @@ -126,7 +126,7 @@ struct AsyncSocketConnectPacket { const NetMsgField kNetMsgFieldAccountName = NET_MSG_FIELD_STRING(kMaxAccountNameLength); const NetMsgField kNetMsgFieldPlayerName = NET_MSG_FIELD_STRING(kMaxPlayerNameLength); -const NetMsgField kNetMsgFieldShaDigest = NET_MSG_FIELD_RAW_DATA(sizeof(ShaDigest)); +const NetMsgField kNetMsgFieldShaDigest = NET_MSG_FIELD_DATA(sizeof(ShaDigest)); const NetMsgField kNetMsgFieldUuid = NET_MSG_FIELD_DATA(sizeof(plUUID)); const NetMsgField kNetMsgFieldTransId = NET_MSG_FIELD_DWORD(); const NetMsgField kNetMsgFieldTimeMs = NET_MSG_FIELD_DWORD(); diff --git a/Sources/Plasma/PubUtilLib/plAnimation/plAGMasterMod.cpp b/Sources/Plasma/PubUtilLib/plAnimation/plAGMasterMod.cpp index 6a9e596bcb..ccbd51e943 100644 --- a/Sources/Plasma/PubUtilLib/plAnimation/plAGMasterMod.cpp +++ b/Sources/Plasma/PubUtilLib/plAnimation/plAGMasterMod.cpp @@ -242,7 +242,7 @@ bool plAGMasterMod::IEval(double secs, float del, uint32_t dirty) // APPLYANIMATIONS void plAGMasterMod::ApplyAnimations(double time, float elapsed) { - plProfile_BeginLap(ApplyAnimation, this->GetKey()->GetUoid().GetObjectName().c_str()); + plProfile_BeginLap(ApplyAnimation, this->GetKey()->GetUoid().GetObjectName()); // update any fades for (int i = 0; i < fAnimInstances.size(); i++) @@ -252,7 +252,7 @@ void plAGMasterMod::ApplyAnimations(double time, float elapsed) AdvanceAnimsToTime(time); - plProfile_EndLap(ApplyAnimation,this->GetKey()->GetUoid().GetObjectName().c_str()); + plProfile_EndLap(ApplyAnimation,this->GetKey()->GetUoid().GetObjectName()); } void plAGMasterMod::AdvanceAnimsToTime(double time) diff --git a/Sources/Plasma/PubUtilLib/plAudio/plAudioSystem.cpp b/Sources/Plasma/PubUtilLib/plAudio/plAudioSystem.cpp index 612716f878..d19b8fb64d 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plAudioSystem.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plAudioSystem.cpp @@ -817,7 +817,7 @@ bool plAudioSystem::MsgReceive(plMessage* msg) if (plRenderMsg* pRMsg = plRenderMsg::ConvertNoRef( msg )) { //if (fListener) { - plProfile_BeginLap(AudioUpdate, this->GetKey()->GetUoid().GetObjectName().c_str()); + plProfile_BeginLap(AudioUpdate, this->GetKey()->GetUoid().GetObjectName()); if (hsTimer::GetMilliSeconds() - fLastUpdateTimeMs > UPDATE_TIME_MS) { IUpdateSoftSounds(fCurrListenerPos); @@ -827,7 +827,7 @@ bool plAudioSystem::MsgReceive(plMessage* msg) plProfile_EndTiming(SoundEAXUpdate); } } - plProfile_EndLap(AudioUpdate, this->GetKey()->GetUoid().GetObjectName().c_str()); + plProfile_EndLap(AudioUpdate, this->GetKey()->GetUoid().GetObjectName()); } return true; } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp index 697fdba40c..8c370204fd 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp @@ -54,6 +54,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTimer.h" #include +#include // other #include "pnMessage/plNotifyMsg.h" diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp index fe7d42e5cb..5c6b91a602 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp @@ -43,6 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plAvBehaviors.h" #include +#include #include "plAvBrainHuman.h" #include "plArmatureMod.h" diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp index 041453ebeb..89d11d80c1 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp @@ -65,6 +65,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTimer.h" #include +#include // other #include "pnMessage/plCameraMsg.h" diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskBrain.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskBrain.cpp index 4ab5c6114b..5ebe5e5093 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskBrain.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskBrain.cpp @@ -107,7 +107,7 @@ void plAvTaskBrain::DumpDebug(const char *name, int &x, int&y, int lineHeight, p // GetBrain ------------------------ // --------- -plArmatureBrain *plAvTaskBrain::GetBrain() +plArmatureBrain* plAvTaskBrain::GetBrain() const { return fBrain; } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskBrain.h b/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskBrain.h index c63e8d1f16..e84330f73a 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskBrain.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskBrain.h @@ -77,7 +77,7 @@ class plAvTaskBrain : public plAvTask /** dump descriptive stuff to the given debug text */ void DumpDebug(const char *name, int &x, int&y, int lineHeight, plDebugText &debugTxt) override; - plArmatureBrain *GetBrain(); + plArmatureBrain* GetBrain() const; CLASSNAME_REGISTER( plAvTaskBrain ); GETINTERFACE_ANY( plAvTaskBrain, plAvTask ); diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plCoopCoordinator.h b/Sources/Plasma/PubUtilLib/plAvatar/plCoopCoordinator.h index 195e8b9e75..529003c733 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plCoopCoordinator.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plCoopCoordinator.h @@ -48,6 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ///////////////////////////////////////////////////////////////////////////////////////// +#include // global #include "pnKeyedObject/hsKeyedObject.h" @@ -128,6 +129,8 @@ class plCoopCoordinator : public hsKeyedObject bool fGuestAccepted; bool fGuestLinked; // guest linked, so ignore the timeout timer + + friend class plNetClientMsgScreener; // Needs to screen the brains and message }; -#endif // plCoopCoordinator_h \ No newline at end of file +#endif // plCoopCoordinator_h diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDrawableGenerator.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plDrawableGenerator.cpp index 7a495beb48..ca69217cf0 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDrawableGenerator.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDrawableGenerator.cpp @@ -55,6 +55,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plGeoSpanDice.h" #include "plGeometrySpan.h" #include "plGBufferGroup.h" +#include #include "hsFastMath.h" #include "plRenderLevel.h" #include "hsResMgr.h" diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.cpp index 61a34819c5..2fa789cb9f 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.cpp @@ -1222,7 +1222,7 @@ bool plDrawableSpans::MsgReceive( plMessage* msg ) } else if( plRenderMsg::ConvertNoRef( msg ) ) { - plProfile_BeginLap(PalletteHack, this->GetKey()->GetUoid().GetObjectName().c_str()); + plProfile_BeginLap(PalletteHack, this->GetKey()->GetUoid().GetObjectName()); IUpdateMatrixPaletteBoundsHack(); @@ -1233,7 +1233,7 @@ bool plDrawableSpans::MsgReceive( plMessage* msg ) // The pipeline will then clear out those bits as it blends them, and then we simply // re-set them here, since plRenderMsg is sent once before all the rendering is done :) fFakeBlendingSpanVector = fBlendingSpanVector; - plProfile_EndLap(PalletteHack, this->GetKey()->GetUoid().GetObjectName().c_str()); + plProfile_EndLap(PalletteHack, this->GetKey()->GetUoid().GetObjectName()); return true; } @@ -1433,7 +1433,7 @@ void plDrawableSpans::SortSpan( uint32_t index, plPipeline *pipe ) { plProfile_Inc(FaceSortCalls); - plProfile_BeginLap(FaceSort, "0"); + plProfile_BeginLap(FaceSort, ST_LITERAL("0")); plIcicle *span = (plIcicle *)fSpans[ index ]; plGBufferTriangle *list, temp; @@ -1462,8 +1462,8 @@ void plDrawableSpans::SortSpan( uint32_t index, plPipeline *pipe ) tempTriList.resize(numTris * 3); elem = sortList.data(); - plProfile_EndLap(FaceSort, "0"); - plProfile_BeginLap(FaceSort, "1"); + plProfile_EndLap(FaceSort, ST_LITERAL("0")); + plProfile_BeginLap(FaceSort, ST_LITERAL("1")); hsVector3 vec(w2cMatrix.fMap[2][0], w2cMatrix.fMap[2][1], w2cMatrix.fMap[2][2]); float trans = w2cMatrix.fMap[2][3]; @@ -1478,15 +1478,15 @@ void plDrawableSpans::SortSpan( uint32_t index, plPipeline *pipe ) } elem[i - 1].fNext = nullptr; - plProfile_EndLap(FaceSort, "1"); - plProfile_BeginLap(FaceSort, "2"); + plProfile_EndLap(FaceSort, ST_LITERAL("1")); + plProfile_BeginLap(FaceSort, ST_LITERAL("2")); // Do da sort thingy hsRadixSort rad; hsRadixSort::Elem *sortedList = rad.Sort( elem, 0 ); - plProfile_EndLap(FaceSort, "2"); - plProfile_BeginLap(FaceSort, "3"); + plProfile_EndLap(FaceSort, ST_LITERAL("2")); + plProfile_BeginLap(FaceSort, ST_LITERAL("3")); uint16_t* indices = tempTriList.data(); // Stuff into the temp array @@ -1498,8 +1498,8 @@ void plDrawableSpans::SortSpan( uint32_t index, plPipeline *pipe ) elem = elem->fNext; } - plProfile_EndLap(FaceSort, "3"); - plProfile_BeginLap(FaceSort, "4"); + plProfile_EndLap(FaceSort, ST_LITERAL("3")); + plProfile_BeginLap(FaceSort, ST_LITERAL("4")); /// Now send them on to the buffer group fGroups[ span->fGroupIdx ]->StuffFromTriList( span->fIBufferIdx, span->fIStartIdx, @@ -1515,7 +1515,7 @@ void plDrawableSpans::SortSpan( uint32_t index, plPipeline *pipe ) /// All done! (force buffer groups to refresh during next render call) fReadyToRender = false; - plProfile_EndLap(FaceSort, "4"); + plProfile_EndLap(FaceSort, ST_LITERAL("4")); } //// SortVisibleSpans //////////////////////////////////////////////////////// @@ -1757,7 +1757,7 @@ void plDrawableSpans::SortVisibleSpans(const std::vector& visList, plPi plProfile_EndTiming(FaceSort); - plProfile_BeginLap(FaceSort, "0"); + plProfile_BeginLap(FaceSort, ST_LITERAL("0")); startIndex.resize(fSpans.size()); @@ -1777,7 +1777,7 @@ void plDrawableSpans::SortVisibleSpans(const std::vector& visList, plPi } if( totTris == 0 ) { - plProfile_EndLap(FaceSort, "0"); + plProfile_EndLap(FaceSort, ST_LITERAL("0")); return; } @@ -1788,12 +1788,12 @@ void plDrawableSpans::SortVisibleSpans(const std::vector& visList, plPi hsRadixSort::Elem* elem = sortScratch.data(); - plProfile_EndLap(FaceSort, "0"); + plProfile_EndLap(FaceSort, ST_LITERAL("0")); size_t iVis = 0; while (iVis < visList.size()) { - plProfile_BeginLap(FaceSort, "1"); + plProfile_BeginLap(FaceSort, ST_LITERAL("1")); // Pack them into the sort structure. We probably want to make the // plGBufferTriangle look like plTriSortData (just add span index) @@ -1824,15 +1824,15 @@ void plDrawableSpans::SortVisibleSpans(const std::vector& visList, plPi } elem[cnt-1].fNext = nullptr; - plProfile_EndLap(FaceSort, "1"); - plProfile_BeginLap(FaceSort, "2"); + plProfile_EndLap(FaceSort, ST_LITERAL("1")); + plProfile_BeginLap(FaceSort, ST_LITERAL("2")); // Actual sort hsRadixSort rad; hsRadixSort::Elem* sortedList = rad.Sort( elem, 0 ); - plProfile_EndLap(FaceSort, "2"); - plProfile_BeginLap(FaceSort, "3"); + plProfile_EndLap(FaceSort, ST_LITERAL("2")); + plProfile_BeginLap(FaceSort, ST_LITERAL("3")); counters.assign(fSpans.size(), 0); @@ -1853,10 +1853,10 @@ void plDrawableSpans::SortVisibleSpans(const std::vector& visList, plPi sortedList = sortedList->fNext; } - plProfile_EndLap(FaceSort, "3"); + plProfile_EndLap(FaceSort, ST_LITERAL("3")); } - plProfile_BeginLap(FaceSort, "4"); + plProfile_BeginLap(FaceSort, ST_LITERAL("4")); constexpr size_t kMaxBufferGroups = 20; constexpr size_t kMaxIndexBuffers = 20; @@ -1882,7 +1882,7 @@ void plDrawableSpans::SortVisibleSpans(const std::vector& visList, plPi span->fILength / 3, triList.data() + startIndex[idx]); } - plProfile_EndLap(FaceSort, "4"); + plProfile_EndLap(FaceSort, ST_LITERAL("4")); fReadyToRender = false; diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp index b1966e63b6..57b4728e29 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp @@ -56,6 +56,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plPrintShape.h" +#include + #include "plAvatar/plArmatureMod.h" #include "plParticleSystem/plParticleSystem.h" diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plProxyGen.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plProxyGen.cpp index 942d8edbe7..0fbcc814b8 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plProxyGen.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plProxyGen.cpp @@ -41,6 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include +#include #include "HeadSpin.h" #include "plProxyGen.h" diff --git a/Sources/Plasma/PubUtilLib/plGImage/plMipmap.h b/Sources/Plasma/PubUtilLib/plGImage/plMipmap.h index c43d1056a3..83e9fd73d2 100644 --- a/Sources/Plasma/PubUtilLib/plGImage/plMipmap.h +++ b/Sources/Plasma/PubUtilLib/plGImage/plMipmap.h @@ -70,6 +70,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define ASSERT_UNCOMPRESSED() #endif +#ifdef MEMORY_LEAK_TRACER + #include +#endif + //// Class Definition ///////////////////////////////////////////////////////// class plBitmapCreator; diff --git a/Sources/Plasma/PubUtilLib/plGLight/plLightInfo.cpp b/Sources/Plasma/PubUtilLib/plGLight/plLightInfo.cpp index e815fcc3d3..08e49601bb 100644 --- a/Sources/Plasma/PubUtilLib/plGLight/plLightInfo.cpp +++ b/Sources/Plasma/PubUtilLib/plGLight/plLightInfo.cpp @@ -370,7 +370,7 @@ bool plLightInfo::MsgReceive(plMessage* msg) plRenderMsg* rendMsg = plRenderMsg::ConvertNoRef(msg); if( rendMsg ) { - plProfile_BeginLap(LightInfo, this->GetKey()->GetUoid().GetObjectName().c_str()); + plProfile_BeginLap(LightInfo, this->GetKey()->GetUoid().GetObjectName()); if( !fDeviceRef && !GetProperty(kLPShadowOnly) ) { @@ -379,7 +379,7 @@ bool plLightInfo::MsgReceive(plMessage* msg) ICheckMaxStrength(); - plProfile_EndLap(LightInfo, this->GetKey()->GetUoid().GetObjectName().c_str()); + plProfile_EndLap(LightInfo, this->GetKey()->GetUoid().GetObjectName()); return true; } plGenRefMsg* refMsg = plGenRefMsg::ConvertNoRef(msg); diff --git a/Sources/Plasma/PubUtilLib/plGLight/plShadowCaster.cpp b/Sources/Plasma/PubUtilLib/plGLight/plShadowCaster.cpp index 64429eba8d..fadeb30ed4 100644 --- a/Sources/Plasma/PubUtilLib/plGLight/plShadowCaster.cpp +++ b/Sources/Plasma/PubUtilLib/plGLight/plShadowCaster.cpp @@ -210,9 +210,9 @@ bool plShadowCaster::MsgReceive(plMessage* msg) plRenderMsg* rendMsg = plRenderMsg::ConvertNoRef(msg); if( rendMsg ) { - plProfile_BeginLap(ShadowCaster, this->GetKey()->GetUoid().GetObjectName().c_str()); + plProfile_BeginLap(ShadowCaster, this->GetKey()->GetUoid().GetObjectName()); IOnRenderMsg(rendMsg); - plProfile_EndLap(ShadowCaster, this->GetKey()->GetUoid().GetObjectName().c_str()); + plProfile_EndLap(ShadowCaster, this->GetKey()->GetUoid().GetObjectName()); return true; } diff --git a/Sources/Plasma/PubUtilLib/plGLight/plShadowMaster.cpp b/Sources/Plasma/PubUtilLib/plGLight/plShadowMaster.cpp index 42d428c28f..b56d58c8f5 100644 --- a/Sources/Plasma/PubUtilLib/plGLight/plShadowMaster.cpp +++ b/Sources/Plasma/PubUtilLib/plGLight/plShadowMaster.cpp @@ -177,9 +177,9 @@ bool plShadowMaster::MsgReceive(plMessage* msg) plRenderMsg* rendMsg = plRenderMsg::ConvertNoRef(msg); if( rendMsg ) { - plProfile_BeginLap(ShadowMaster, this->GetKey()->GetUoid().GetObjectName().c_str()); + plProfile_BeginLap(ShadowMaster, this->GetKey()->GetUoid().GetObjectName()); IBeginRender(); - plProfile_EndLap(ShadowMaster, this->GetKey()->GetUoid().GetObjectName().c_str()); + plProfile_EndLap(ShadowMaster, this->GetKey()->GetUoid().GetObjectName()); return true; } diff --git a/Sources/Plasma/PubUtilLib/plInputCore/plInputInterfaceMgr.cpp b/Sources/Plasma/PubUtilLib/plInputCore/plInputInterfaceMgr.cpp index b8af1f3916..a875f853ed 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/plInputInterfaceMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plInputCore/plInputInterfaceMgr.cpp @@ -290,7 +290,7 @@ void plInputInterfaceMgr::IUpdateCursor( int32_t newCursor ) bool plInputInterfaceMgr::IEval( double secs, float del, uint32_t dirty ) { - const char *inputEval = "Eval"; + const ST::string inputEval = ST_LITERAL("Eval"); plProfile_BeginLap(Input, inputEval); @@ -420,7 +420,7 @@ bool plInputInterfaceMgr::MsgReceive( plMessage *msg ) plInputEventMsg *ieMsg = plInputEventMsg::ConvertNoRef( msg ); if (ieMsg != nullptr) { - const char *inputIEM = "InputEventMsg"; + const ST::string inputIEM = ST_LITERAL("InputEventMsg"); plProfile_BeginLap(Input, inputIEM); bool handled = false; size_t missedInputStartIdx = 0; diff --git a/Sources/Plasma/PubUtilLib/plMessage/plAvatarMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plAvatarMsg.h index 10a48e5a5a..cdf00f2b40 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plAvatarMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plAvatarMsg.h @@ -43,6 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plAvatarMsg_inc #define plAvatarMsg_inc +#include #include "hsBitVector.h" #include "pnMessage/plEventCallbackMsg.h" #include "plAvatar/plAvDefs.h" diff --git a/Sources/Plasma/PubUtilLib/plMessage/plConsoleMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plConsoleMsg.h index 1d99b8ea01..9d4bbdb34b 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plConsoleMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plConsoleMsg.h @@ -45,6 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plConsoleMsg_inc #define plConsoleMsg_inc +#include #include "pnMessage/plMessage.h" class plEventCallbackMsg; diff --git a/Sources/Plasma/PubUtilLib/plMessage/plLoadAvatarMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plLoadAvatarMsg.h index 8382b9444a..0193647af9 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plLoadAvatarMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plLoadAvatarMsg.h @@ -44,6 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plLoadAvatarMsg_INC #include "plLoadCloneMsg.h" +#include class plAvTask; class plKey; @@ -93,16 +94,16 @@ class plLoadAvatarMsg : public plLoadCloneMsg bool isPlayer, bool isLoading, const ST::string &userStr = {}); void SetIsPlayer(bool is) { fIsPlayer = is; } - bool GetIsPlayer() { return fIsPlayer; } + bool GetIsPlayer() const { return fIsPlayer; } void SetSpawnPoint(const plKey &spawnPoint) { fSpawnPoint = spawnPoint; } - plKey GetSpawnPoint() { return fSpawnPoint; } + plKey GetSpawnPoint() const { return fSpawnPoint; } void SetInitialTask(plAvTask *task) { fInitialTask = task; } - plAvTask * GetInitialTask() { return fInitialTask; } + plAvTask* GetInitialTask() const { return fInitialTask; } void SetUserStr(const ST::string &userStr) { fUserStr = userStr; } - ST::string GetUserStr() { return fUserStr; } + ST::string GetUserStr() const { return fUserStr; } CLASSNAME_REGISTER(plLoadAvatarMsg); GETINTERFACE_ANY(plLoadAvatarMsg, plLoadCloneMsg); diff --git a/Sources/Plasma/PubUtilLib/plMessage/plLoadCloneMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plLoadCloneMsg.cpp index 643e7e980f..c808bd4ca7 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plLoadCloneMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plLoadCloneMsg.cpp @@ -212,32 +212,27 @@ void plLoadCloneMsg::WriteVersion(hsStream* stream, hsResMgr* mgr) mgr->WriteCreatable(stream, fTriggerMsg); } -// GETCLONEKEY -plKey plLoadCloneMsg::GetCloneKey() +plKey plLoadCloneMsg::GetCloneKey() const { return fCloneKey; } -// GETREQUESTORKEY -plKey plLoadCloneMsg::GetRequestorKey() +plKey plLoadCloneMsg::GetRequestorKey() const { return fRequestorKey; } -// ISVALIDMESSAGE -bool plLoadCloneMsg::IsValidMessage() +bool plLoadCloneMsg::IsValidMessage() const { return fValidMsg; } -// GETUSERDATA -uint32_t plLoadCloneMsg::GetUserData() +uint32_t plLoadCloneMsg::GetUserData() const { return fUserData; } -// GETORIGINATINGPLAYERID -uint32_t plLoadCloneMsg::GetOriginatingPlayerID() +uint32_t plLoadCloneMsg::GetOriginatingPlayerID() const { return fOriginatingPlayerID; } @@ -247,7 +242,7 @@ void plLoadCloneMsg::SetOriginatingPlayerID(uint32_t playerId) fOriginatingPlayerID = playerId; } -bool plLoadCloneMsg::GetIsLoading() +bool plLoadCloneMsg::GetIsLoading() const { return fIsLoading; } @@ -261,7 +256,7 @@ void plLoadCloneMsg::SetTriggerMsg(plMessage *msg) fTriggerMsg = msg; } -plMessage *plLoadCloneMsg::GetTriggerMsg() +plMessage *plLoadCloneMsg::GetTriggerMsg() const { return fTriggerMsg; } diff --git a/Sources/Plasma/PubUtilLib/plMessage/plLoadCloneMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plLoadCloneMsg.h index 3252e48370..412d60ce80 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plLoadCloneMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plLoadCloneMsg.h @@ -104,15 +104,15 @@ class plLoadCloneMsg : public plMessage void ReadVersion(hsStream* stream, hsResMgr* mgr) override; void WriteVersion(hsStream* stream, hsResMgr* mgr) override; - plKey GetCloneKey(); - plKey GetRequestorKey(); - bool IsValidMessage(); - uint32_t GetUserData(); - uint32_t GetOriginatingPlayerID(); + plKey GetCloneKey() const; + plKey GetRequestorKey() const; + bool IsValidMessage() const; + uint32_t GetUserData() const; + uint32_t GetOriginatingPlayerID() const; void SetOriginatingPlayerID(uint32_t playerId); - bool GetIsLoading(); + bool GetIsLoading() const; void SetTriggerMsg(plMessage *msg); - plMessage *GetTriggerMsg(); + plMessage *GetTriggerMsg() const; protected: diff --git a/Sources/Plasma/PubUtilLib/plMessage/plMovieMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plMovieMsg.h index 9ad41e042d..a5b09efd33 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plMovieMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plMovieMsg.h @@ -45,9 +45,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include +#include "hsColorRGBA.h" +#include "hsPoint2.h" + #include "pnMessage/plMessage.h" #include "pnKeyedObject/plFixedKey.h" -#include "hsPoint2.h" class plMovieMsg : public plMessage { diff --git a/Sources/Plasma/PubUtilLib/plMessage/plOneShotCallbacks.h b/Sources/Plasma/PubUtilLib/plMessage/plOneShotCallbacks.h index cc107ce4e5..afa387b55d 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plOneShotCallbacks.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plOneShotCallbacks.h @@ -49,6 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnKeyedObject/plKey.h" #include +#include class hsStream; class hsResMgr; diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgScreener.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgScreener.cpp index 3ada9088bc..a82b373226 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgScreener.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgScreener.cpp @@ -46,10 +46,19 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnFactory/plFactory.h" #include "pnMessage/plMessage.h" +#include "pnMessage/plMessageWithCallbacks.h" #include "pnNetCommon/plNetApp.h" +#include "plAvatar/plAvBrain.h" +#include "plAvatar/plAvBrainCoop.h" +#include "plAvatar/plAvTaskBrain.h" #include "plAvatar/plAvatarMgr.h" #include "plAvatar/plArmatureMod.h" +#include "plAvatar/plCoopCoordinator.h" +#include "plMessage/plAvCoopMsg.h" +#include "plMessage/plAvatarMsg.h" +#include "plMessage/plLoadAvatarMsg.h" +#include "plMessage/plLoadCloneMsg.h" #include "plStatusLog/plStatusLog.h" #include "pfMessage/pfKIMsg.h" @@ -59,9 +68,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com /////////////////////////////////////////////////////////////// plNetClientMsgScreener::plNetClientMsgScreener() -{ - DebugMsg("created"); -} +{} // // For plLoggable base @@ -129,6 +136,69 @@ bool plNetClientMsgScreener::AllowOutgoingMessage(const plMessage* msg) const return true; } +bool plNetClientMsgScreener::IScreenIncomingBrain(const plArmatureBrain* brain) +{ + if (!brain) { + return true; + } + + const plAvBrainGeneric* brainGeneric; + switch (brain->ClassIndex()) { + case CLASS_INDEX_SCOPED(plAvBrainCoop): + case CLASS_INDEX_SCOPED(plAvBrainGeneric): + // These brains can contain nested messages, which need to be recursively screened. + brainGeneric = plAvBrainGeneric::ConvertNoRef(brain); + ASSERT(brainGeneric); + if (!IScreenIncoming(brainGeneric->GetStartMessage()) || !IScreenIncoming(brainGeneric->GetEndMessage())) { + return false; + } + return true; + + case CLASS_INDEX_SCOPED(plAvBrainClimb): + case CLASS_INDEX_SCOPED(plAvBrainCritter): + case CLASS_INDEX_SCOPED(plAvBrainDrive): + case CLASS_INDEX_SCOPED(plAvBrainHuman): + case CLASS_INDEX_SCOPED(plAvBrainSwim): + // The data for these brains can't contain anything scary. + return true; + + default: + // Don't know this type of brain! + return false; + } +} + +bool plNetClientMsgScreener::IScreenIncomingTask(const plAvTask* task) +{ + if (!task) { + return true; + } + + const plAvTaskBrain* taskBrain; + switch (task->ClassIndex()) { + case CLASS_INDEX_SCOPED(plAvTaskBrain): + // This task contains a brain, which needs to be recursively screened. + taskBrain = plAvTaskBrain::ConvertNoRef(task); + ASSERT(taskBrain); + if (!IScreenIncomingBrain(taskBrain->GetBrain())) { + return false; + } + return true; + + case CLASS_INDEX_SCOPED(plAvAnimTask): + case CLASS_INDEX_SCOPED(plAvOneShotTask): + case CLASS_INDEX_SCOPED(plAvOneShotLinkTask): + case CLASS_INDEX_SCOPED(plAvSeekTask): + case CLASS_INDEX_SCOPED(plAvTaskSeek): + // The data for these tasks can't contain anything scary. + return true; + + default: + // Don't know this type of task! + return false; + } +} + // // Return false for obvious hacked network messages // This is all because we cannot trust Cyan's servers @@ -145,8 +215,14 @@ bool plNetClientMsgScreener::AllowIncomingMessage(const plMessage* msg) const return result; } -bool plNetClientMsgScreener::IScreenIncoming(const plMessage* msg) const +bool plNetClientMsgScreener::IScreenIncoming(const plMessage* msg) { + if (!msg) { + // The top-level message cannot be nullptr (this is checked by AllowIncomingMessage). + // plMessage* fields within other messages are allowed to be nullptr though. + return true; + } + // Blacklist some obvious hacks here... switch (msg->ClassIndex()) { @@ -156,7 +232,7 @@ bool plNetClientMsgScreener::IScreenIncoming(const plMessage* msg) const // This message has a flawed read/write return false; case CLASS_INDEX_SCOPED(plConsoleMsg): - // Python remote code execution vunerability + // Python remote code execution vulnerability return false; case CLASS_INDEX_SCOPED(pfKIMsg): { @@ -171,7 +247,62 @@ bool plNetClientMsgScreener::IScreenIncoming(const plMessage* msg) const if (plFactory::DerivesFrom(CLASS_INDEX_SCOPED(plRefMsg), msg->ClassIndex())) return false; - // Default allow everything else, otherweise we + // Other clients have no business sending us inputs. + // Also mitigates another remote code execution risk: + // plControlEventMsg can run console commands. + if (plFactory::DerivesFrom(CLASS_INDEX_SCOPED(plInputEventMsg), msg->ClassIndex())) { + return false; + } + + // Recursively screen messages contained within other messages (directly or indirectly). + + if (auto msgWithCallbacks = plMessageWithCallbacks::ConvertNoRef(msg)) { + size_t numCallbacks = msgWithCallbacks->GetNumCallbacks(); + for (size_t i = 0; i < numCallbacks; i++) { + if (!IScreenIncoming(msgWithCallbacks->GetCallback(i))) { + return false; + } + } + } + + // Some avatar brains can contain messages and some avatar tasks contain brains, + // so we have to recursively screen all of those as well... + + if (auto loadCloneMsg = plLoadCloneMsg::ConvertNoRef(msg)) { + if (!IScreenIncoming(loadCloneMsg->GetTriggerMsg())) { + return false; + } + + if (auto loadAvatarMsg = plLoadAvatarMsg::ConvertNoRef(loadCloneMsg)) { + if (!IScreenIncomingTask(loadAvatarMsg->GetInitialTask())) { + return false; + } + } + } + + if (auto avCoopMsg = plAvCoopMsg::ConvertNoRef(msg)) { + if (avCoopMsg->fCoordinator && ( + !IScreenIncomingBrain(avCoopMsg->fCoordinator->fHostBrain) + || !IScreenIncomingBrain(avCoopMsg->fCoordinator->fGuestBrain) + || !IScreenIncoming(avCoopMsg->fCoordinator->fGuestAcceptMsg) + )) { + return false; + } + } + + if (auto avTaskMsg = plAvTaskMsg::ConvertNoRef(msg)) { + if (!IScreenIncomingTask(avTaskMsg->GetTask())) { + return false; + } + + if (auto avPushBrainMsg = plAvPushBrainMsg::ConvertNoRef(avTaskMsg)) { + if (!IScreenIncomingBrain(avPushBrainMsg->fBrain)) { + return false; + } + } + } + + // Default allow everything else, otherwise we // might break something that we really shouldn't... return true; } diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgScreener.h b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgScreener.h index 655d5a54db..3b379aae10 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgScreener.h +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgScreener.h @@ -44,6 +44,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plNetCommon/plNetMsgScreener.h" +class plArmatureBrain; +class plAvTask; + // // Client-side version // @@ -57,9 +60,12 @@ class plNetClientMsgScreener : public plNetMsgScreener bool IIsLocalArmatureModKey(const plKey& key, const plNetGameMember* gm) const override; bool IIsSenderCCR(const plNetGameMember* gm=nullptr) const override; bool IAmClient() const override { return true; } - bool IScreenIncoming(const plMessage* msg) const; -public: + static bool IScreenIncomingBrain(const plArmatureBrain* brain); + static bool IScreenIncomingTask(const plAvTask* task); + static bool IScreenIncoming(const plMessage* msg); + +public: plNetClientMsgScreener(); bool AllowOutgoingMessage(const plMessage* msg) const; diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plClientGuid.cpp b/Sources/Plasma/PubUtilLib/plNetCommon/plClientGuid.cpp index 37ffc701f5..a883148d9a 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plClientGuid.cpp +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plClientGuid.cpp @@ -43,6 +43,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plClientGuid.h" #include "plNetCommon.h" +#include + #include "hsStream.h" #include "pnMessage/plMessage.h" diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp index 455844f40e..440a9b6b33 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp @@ -44,6 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plNetCommon.h" #include +#include #include "hsStream.h" diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plSpawnPointInfo.cpp b/Sources/Plasma/PubUtilLib/plNetCommon/plSpawnPointInfo.cpp index 89938f13f3..2ad38763f6 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plSpawnPointInfo.cpp +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plSpawnPointInfo.cpp @@ -45,6 +45,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStream.h" #include "hsBitVector.h" +#include + #include "pnMessage/plMessage.h" const plSpawnPointInfo kDefaultSpawnPoint( kDefaultSpawnPtTitle, kDefaultSpawnPtName ); diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp index e2d1c66421..6797681c23 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp @@ -1254,6 +1254,7 @@ enum { kNumPerf }; +static NetMsgChannel* s_channel; static bool s_running; static std::recursive_mutex s_critsect; static CliAuConn* s_conn = nullptr; @@ -1378,7 +1379,7 @@ bool CliAuConn::AsyncNotifySocketConnectSuccess(AsyncSocket sock, const plNetAdd TransferRef("Connecting", "Connected"); cli = NetCliConnectAccept( sock, - kNetProtocolCli2Auth, + s_channel, false, [this](ENetError error) { if (IS_NET_SUCCESS(error)) { @@ -4577,9 +4578,9 @@ void NetAuthTrans::ReleaseConn () { //============================================================================ void AuthInitialize () { s_running = true; - NetMsgProtocolRegister( + ASSERT(!s_channel); + s_channel = NetMsgChannelCreate( kNetProtocolCli2Auth, - false, s_send, std::size(s_send), s_recv, std::size(s_recv), kAuthDhGValue, @@ -4604,11 +4605,11 @@ void AuthDestroy (bool wait) { NetTransCancelByProtocol( kNetProtocolCli2Auth, kNetErrRemoteShutdown - ); - NetMsgProtocolDestroy( - kNetProtocolCli2Auth, - false ); + if (s_channel != nullptr) { + NetMsgChannelDelete(s_channel); + s_channel = nullptr; + } { hsLockGuard(s_critsect); diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp index 56fc0d14d3..07df225b6e 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp @@ -1242,10 +1242,6 @@ void FileDestroy (bool wait) { NetTransCancelByProtocol( kNetProtocolCli2File, kNetErrRemoteShutdown - ); - NetMsgProtocolDestroy( - kNetProtocolCli2File, - false ); { diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp index 696a051492..a60a5b50e2 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp @@ -159,6 +159,7 @@ enum { kNumPerf }; +static NetMsgChannel* s_channel; static bool s_running; static std::recursive_mutex s_critsect; static CliGmConn* s_conn = nullptr; @@ -229,7 +230,7 @@ bool CliGmConn::AsyncNotifySocketConnectSuccess(AsyncSocket sock, const plNetAdd TransferRef("Connecting", "Connected"); cli = NetCliConnectAccept( sock, - kNetProtocolCli2Game, + s_channel, true, [this](ENetError error) { if (!s_perf[kPingDisabled]) { @@ -655,9 +656,9 @@ void NetGameTrans::ReleaseConn () { //============================================================================ void GameInitialize () { s_running = true; - NetMsgProtocolRegister( + ASSERT(!s_channel); + s_channel = NetMsgChannelCreate( kNetProtocolCli2Game, - false, s_send, std::size(s_send), s_recv, std::size(s_recv), kGameDhGValue, @@ -675,11 +676,11 @@ void GameDestroy (bool wait) { NetTransCancelByProtocol( kNetProtocolCli2Game, kNetErrRemoteShutdown - ); - NetMsgProtocolDestroy( - kNetProtocolCli2Game, - false ); + if (s_channel != nullptr) { + NetMsgChannelDelete(s_channel); + s_channel = nullptr; + } { hsLockGuard(s_critsect); diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp index 3618535380..156a725be6 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp @@ -187,6 +187,7 @@ enum { kNumPerf }; +static NetMsgChannel* s_channel; static bool s_running; static std::recursive_mutex s_critsect; static CliGkConn* s_conn = nullptr; @@ -259,7 +260,7 @@ bool CliGkConn::AsyncNotifySocketConnectSuccess(AsyncSocket sock, const plNetAdd TransferRef("Connecting", "Connected"); cli = NetCliConnectAccept( sock, - kNetProtocolCli2GateKeeper, + s_channel, false, [this](ENetError error) { if (IS_NET_SUCCESS(error)) { @@ -833,9 +834,9 @@ void NetGateKeeperTrans::ReleaseConn () { //============================================================================ void GateKeeperInitialize () { s_running = true; - NetMsgProtocolRegister( + ASSERT(!s_channel); + s_channel = NetMsgChannelCreate( kNetProtocolCli2GateKeeper, - false, s_send, std::size(s_send), s_recv, std::size(s_recv), kGateKeeperDhGValue, @@ -851,11 +852,11 @@ void GateKeeperDestroy (bool wait) { NetTransCancelByProtocol( kNetProtocolCli2GateKeeper, kNetErrRemoteShutdown - ); - NetMsgProtocolDestroy( - kNetProtocolCli2GateKeeper, - false ); + if (s_channel != nullptr) { + NetMsgChannelDelete(s_channel); + s_channel = nullptr; + } { hsLockGuard(s_critsect); diff --git a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEmitter.cpp b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEmitter.cpp index cd6ff83bd3..af59ad77b1 100644 --- a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEmitter.cpp +++ b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEmitter.cpp @@ -325,7 +325,7 @@ void plParticleEmitter::IUpdateParticles(float delta) if ((fGenerator != nullptr) && (fTimeToLive >= 0)) { - plProfile_BeginLap(ParticleGenerate, fSystem->GetKeyName().c_str()); + plProfile_BeginLap(ParticleGenerate, fSystem->GetKeyName()); if (!fGenerator->AddAutoParticles(this, delta)) { delete fGenerator; @@ -333,7 +333,7 @@ void plParticleEmitter::IUpdateParticles(float delta) } if( (fTimeToLive > 0) && ((fTimeToLive -= delta) <= 0) ) fTimeToLive = -1.f; - plProfile_EndLap(ParticleGenerate, fSystem->GetKeyName().c_str()); + plProfile_EndLap(ParticleGenerate, fSystem->GetKeyName()); } fTargetInfo.fContext = fSystem->fContext; diff --git a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleSystem.cpp b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleSystem.cpp index 4e0fb8841e..31178cba6d 100644 --- a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleSystem.cpp +++ b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleSystem.cpp @@ -485,9 +485,9 @@ bool plParticleSystem::MsgReceive(plMessage* msg) if ((rend = plRenderMsg::ConvertNoRef(msg))) { - plProfile_BeginLap(ParticleSys, this->GetKey()->GetUoid().GetObjectName().c_str()); + plProfile_BeginLap(ParticleSys, this->GetKey()->GetUoid().GetObjectName()); IHandleRenderMsg(rend->Pipeline()); - plProfile_EndLap(ParticleSys, this->GetKey()->GetUoid().GetObjectName().c_str()); + plProfile_EndLap(ParticleSys, this->GetKey()->GetUoid().GetObjectName()); return true; } else if ((refMsg = plGenRefMsg::ConvertNoRef(msg))) diff --git a/Sources/Plasma/PubUtilLib/plPhysX/plGenericPhysical.cpp b/Sources/Plasma/PubUtilLib/plPhysX/plGenericPhysical.cpp index a244f8e1c6..f3b1ed0573 100644 --- a/Sources/Plasma/PubUtilLib/plPhysX/plGenericPhysical.cpp +++ b/Sources/Plasma/PubUtilLib/plPhysX/plGenericPhysical.cpp @@ -500,7 +500,7 @@ void plPXPhysical::SendNewLocation(bool synchTransform, bool isSynchUpdate) if (!curl2w.Compare(fCachedLocal2World, .0001f)) { plProfile_Inc(LocationsSent); - plProfile_BeginLap(PhysicsUpdates, GetKeyName().c_str()); + plProfile_BeginLap(PhysicsUpdates, GetKeyName()); if (fCachedLocal2World.GetTranslate().fZ < kMaxNegativeZPos) { @@ -517,7 +517,7 @@ void plPXPhysical::SendNewLocation(bool synchTransform, bool isSynchUpdate) pCorrMsg->Send(); if (fProxyGen) fProxyGen->SetTransform(fCachedLocal2World, w2l); - plProfile_EndLap(PhysicsUpdates, GetKeyName().c_str()); + plProfile_EndLap(PhysicsUpdates, GetKeyName()); } } } diff --git a/Sources/Plasma/PubUtilLib/plPhysX/plLOSDispatch.h b/Sources/Plasma/PubUtilLib/plPhysX/plLOSDispatch.h index 790f38845e..6f685b1903 100644 --- a/Sources/Plasma/PubUtilLib/plPhysX/plLOSDispatch.h +++ b/Sources/Plasma/PubUtilLib/plPhysX/plLOSDispatch.h @@ -43,6 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plLOSDispatch_H #include +#include #include "hsGeometry3.h" diff --git a/Sources/Plasma/PubUtilLib/plPhysX/plPXCooking.cpp b/Sources/Plasma/PubUtilLib/plPhysX/plPXCooking.cpp index eb233d0a68..9fbc3985e6 100644 --- a/Sources/Plasma/PubUtilLib/plPhysX/plPXCooking.cpp +++ b/Sources/Plasma/PubUtilLib/plPhysX/plPXCooking.cpp @@ -43,6 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plPXCooking.h" #include "hsGeometry3.h" #include "hsStream.h" +#include // ========================================================================== diff --git a/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp b/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp index 61a3afda97..8049ef9c44 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp @@ -156,12 +156,12 @@ hsG3DDeviceRecord& hsG3DDeviceRecord::operator=(const hsG3DDeviceRecord& src) return *this; } -const char* hsG3DDeviceRecord::GetG3DDeviceTypeName() const +ST::string hsG3DDeviceRecord::GetG3DDeviceTypeName() const { - static const char* deviceNames[hsG3DDeviceSelector::kNumDevTypes] = { - "Unknown", - "Direct3D", - "OpenGL" + static const ST::string deviceNames[hsG3DDeviceSelector::kNumDevTypes] = { + ST_LITERAL("Unknown"), + ST_LITERAL("Direct3D"), + ST_LITERAL("OpenGL"), }; uint32_t devType = GetG3DDeviceType(); @@ -562,15 +562,13 @@ void hsG3DDeviceSelector::IFudgeDirectXDevice( hsG3DDeviceRecord &record, D3DEnum_RendererInfo *deviceInfo ) { uint32_t vendorID, deviceID; - char *szDriver, *szDesc; - + ST::string driverString; + ST::string descString; /// Send it off to each D3D device, respectively if( record.GetG3DDeviceType() == kDevTypeDirect3D ) { - if( !IGetD3DCardInfo( record, driverInfo, deviceInfo, &vendorID, &deviceID, &szDriver, &szDesc ) ) - { - // {} to make VC6 happy in release build + if (!IGetD3DCardInfo(record, driverInfo, deviceInfo, &vendorID, &deviceID, driverString, descString)) { hsAssert( false, "Trying to fudge D3D device but D3D support isn't in this EXE!" ); } } @@ -580,20 +578,20 @@ void hsG3DDeviceSelector::IFudgeDirectXDevice( hsG3DDeviceRecord &record, } /// So capitalization won't matter in our tests - ST::string desc = ST::string::from_latin_1(szDesc).to_lower(); + descString = descString.to_lower(); /// Detect ATI Radeon chipset // We will probably need to differentiate between different Radeons at some point in // the future, but not now. - ST_ssize_t radeon = desc.find("radeon"); - if (stricmp(szDriver, "ati2dvag.dll") == 0 || radeon >= 0) - { + ST_ssize_t radeon = descString.find("radeon"); + if (driverString.compare_i("ati2dvag.dll") == 0 || radeon >= 0) { int series = 0; if (radeon >= 0) { - const char* str = desc.c_str() + radeon + strlen("radeon"); - if( 1 == sscanf(str, "%d", &series) ) - { + ST::string str = descString.substr(radeon + strlen("radeon")).trim_left(); + ST::conversion_result res; + series = str.to_int(res, 10); + if (res.ok()) { if( (series >= 8000) && (series < 9000) ) { hsStatusMessage( "== Using fudge factors for ATI Radeon 8X00 chipset ==\n" ); @@ -620,15 +618,13 @@ void hsG3DDeviceSelector::IFudgeDirectXDevice( hsG3DDeviceRecord &record, //// Other Cards ////////////////////////////////////////////////////////// /// Detect Intel i810 chipset else if( deviceID == 0x00007125 && - ( stricmp( szDriver, "i81xdd.dll" ) == 0 - || ( desc.find("intel") >= 0 && desc.find("810") >= 0 ) ) ) - { + (driverString.compare_i("i81xdd.dll") == 0 + || (descString.find("intel") >= 0 && descString.find("810") >= 0))) { hsStatusMessage( "== Using fudge factors for an Intel i810 chipset ==\n" ); ISetFudgeFactors( kIntelI810Chipset, record ); } /// Detect for a GeForc FX card. We only need to nerf the really low end one. - else if( desc.find("nvidia") >= 0 && desc.find("geforce fx 5200") >= 0 ) - { + else if (descString.find("nvidia") >= 0 && descString.find("geforce fx 5200") >= 0) { hsStatusMessage( "== Using fudge factors for an NVidia GeForceFX-based chipset ==\n" ); ISetFudgeFactors( kNVidiaGeForceFXChipset, record ); } diff --git a/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h b/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h index 4fef83f979..3dfc1582fd 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h +++ b/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h @@ -185,7 +185,7 @@ class hsG3DDeviceRecord hsG3DDeviceRecord& operator=(const hsG3DDeviceRecord& src); uint32_t GetG3DDeviceType() const { return fG3DDeviceType; } - const char* GetG3DDeviceTypeName() const; + ST::string GetG3DDeviceTypeName() const; uint32_t GetG3DHALorHEL() const { return fG3DHALorHEL; } uint32_t GetMemoryBytes() const { return fMemoryBytes; } @@ -326,7 +326,6 @@ class hsG3DDeviceSelector : public hsRefCnt static std::list sEnumerators; std::vector fRecords; - char fErrorString[ 128 ]; void IClear(); void IRemoveDiscarded(); @@ -340,7 +339,7 @@ class hsG3DDeviceSelector : public hsRefCnt uint32_t IAdjustDirectXMemory( uint32_t cardMem ); bool IGetD3DCardInfo( hsG3DDeviceRecord &record, void *driverInfo, void *deviceInfo, - uint32_t *vendorID, uint32_t *deviceID, char **driverString, char **descString ); + uint32_t *vendorID, uint32_t *deviceID, ST::string& driverString, ST::string& descString); void ISetFudgeFactors( uint8_t chipsetID, hsG3DDeviceRecord &record ); diff --git a/Sources/Plasma/PubUtilLib/plPipeline/pl3DPipeline.h b/Sources/Plasma/PubUtilLib/plPipeline/pl3DPipeline.h index 4ff9486fdb..5827a1feb9 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/pl3DPipeline.h +++ b/Sources/Plasma/PubUtilLib/plPipeline/pl3DPipeline.h @@ -43,6 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define _pl3DPipeline_inc_ #include +#include #include #include "plPipeline.h" @@ -683,7 +684,8 @@ class pl3DPipeline : public plPipeline //virtual plMipmap* ExtractMipMap(plRenderTarget* targ) = 0; /** Return the current error string. */ - const char* GetErrorString() override { + ST::string GetErrorString() override + { return fDevice.GetErrorString(); } diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plCaptureRender.cpp b/Sources/Plasma/PubUtilLib/plPipeline/plCaptureRender.cpp index 749bb211cc..37329ea7cd 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plCaptureRender.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/plCaptureRender.cpp @@ -41,6 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "plCaptureRender.h" +#include #include "plPipeline.h" diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plNullPipeline.h b/Sources/Plasma/PubUtilLib/plPipeline/plNullPipeline.h index 25e23108b8..72c29391c0 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plNullPipeline.h +++ b/Sources/Plasma/PubUtilLib/plPipeline/plNullPipeline.h @@ -59,7 +59,7 @@ class plNullPipelineDevice void SetProjectionMatrix(const hsMatrix44& src) { } void SetWorldToCameraMatrix(const hsMatrix44& src) { } void SetLocalToWorldMatrix(const hsMatrix44& src) { } - const char* GetErrorString() const { return nullptr; } + ST::string GetErrorString() const { return {}; } }; class plNullPipeline : public pl3DPipeline diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plPlates.cpp b/Sources/Plasma/PubUtilLib/plPipeline/plPlates.cpp index 374d76f371..8fd044c8aa 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plPlates.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/plPlates.cpp @@ -47,6 +47,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plPlates.h" +#include + #include "plPipeline.h" #include "hsGDeviceRef.h" #include "plPipeDebugFlags.h" diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plRenderTarget.h b/Sources/Plasma/PubUtilLib/plPipeline/plRenderTarget.h index 5d97fd4548..2fc0bfff26 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plRenderTarget.h +++ b/Sources/Plasma/PubUtilLib/plPipeline/plRenderTarget.h @@ -53,6 +53,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef _plRenderTarget_h #define _plRenderTarget_h +#include + #include "plPipeResReq.h" #include "plGImage/plBitmap.h" diff --git a/Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp b/Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp index 011d3a8704..7989a3adb7 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp +++ b/Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp @@ -40,6 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "plKeyFinder.h" +#include #include "plCreatableIndex.h" #include "hsResMgr.h" diff --git a/Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp b/Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp index 1ff9f75795..77ee85f6d2 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp +++ b/Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp @@ -41,6 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "plRegistryNode.h" +#include #include "hsStream.h" #include "plRegistryHelpers.h" diff --git a/Sources/Plasma/PubUtilLib/plScene/plPageTreeMgr.cpp b/Sources/Plasma/PubUtilLib/plScene/plPageTreeMgr.cpp index 6bc73baf7d..331df41f2b 100644 --- a/Sources/Plasma/PubUtilLib/plScene/plPageTreeMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plScene/plPageTreeMgr.cpp @@ -212,7 +212,7 @@ size_t plPageTreeMgr::IRenderVisList(plPipeline* pipe, std::vectorGetKey()->GetUoid().GetObjectName().c_str()); + plProfile_BeginLap(DrawableTime, p->GetKey()->GetUoid().GetObjectName()); if( sortedDrawList[i].fDrawable->GetNativeProperty(plDrawable::kPropSortSpans) ) { @@ -230,7 +230,7 @@ size_t plPageTreeMgr::IRenderVisList(plPipeline* pipe, std::vectorGetKey()->GetUoid().GetObjectName().c_str()); + plProfile_EndLap(DrawableTime, p->GetKey()->GetUoid().GetObjectName()); } return numDrawn; diff --git a/Sources/Plasma/PubUtilLib/plScene/plPostEffectMod.cpp b/Sources/Plasma/PubUtilLib/plScene/plPostEffectMod.cpp index c43a317204..6a25afec3d 100644 --- a/Sources/Plasma/PubUtilLib/plScene/plPostEffectMod.cpp +++ b/Sources/Plasma/PubUtilLib/plScene/plPostEffectMod.cpp @@ -232,9 +232,9 @@ bool plPostEffectMod::MsgReceive(plMessage* msg) plRenderMsg* rend = plRenderMsg::ConvertNoRef(msg); if( rend && IIsEnabled() ) { - plProfile_BeginLap(PostEffect, this->GetKey()->GetUoid().GetObjectName().c_str()); + plProfile_BeginLap(PostEffect, this->GetKey()->GetUoid().GetObjectName()); ISubmitRequest(); - plProfile_EndLap(PostEffect, this->GetKey()->GetUoid().GetObjectName().c_str()); + plProfile_EndLap(PostEffect, this->GetKey()->GetUoid().GetObjectName()); return true; } diff --git a/Sources/Plasma/PubUtilLib/plStatGather/plAutoProfile.cpp b/Sources/Plasma/PubUtilLib/plStatGather/plAutoProfile.cpp index 4d63a5a30e..14fc37923b 100644 --- a/Sources/Plasma/PubUtilLib/plStatGather/plAutoProfile.cpp +++ b/Sources/Plasma/PubUtilLib/plStatGather/plAutoProfile.cpp @@ -73,7 +73,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plGImage/plMipmap.h" #include -#include +#include +#include class plAutoProfileImp : public plAutoProfile { @@ -83,7 +84,7 @@ class plAutoProfileImp : public plAutoProfile int fNextSpawnPoint; ST::string fLastSpawnPointName; // For profiling a single age - std::string fAgeName; + ST::string fAgeName; bool fLinkedToSingleAge; bool fJustLinkToAges; @@ -103,7 +104,7 @@ class plAutoProfileImp : public plAutoProfile : fNextAge(), fNextSpawnPoint(), fLinkedToSingleAge(), fJustLinkToAges(), fLinkTime() { } - void StartProfile(const char* ageName) override; + void StartProfile(ST::string ageName) override; void LinkToAllAges() override; bool MsgReceive(plMessage* msg) override; @@ -117,12 +118,9 @@ plAutoProfile* plAutoProfile::Instance() //////////////////////////////////////////////////////////////////////////////// -void plAutoProfileImp::StartProfile(const char* ageName) +void plAutoProfileImp::StartProfile(ST::string ageName) { - if (ageName) - fAgeName = ageName; - else - fAgeName = ""; + fAgeName = std::move(ageName); IInit(); @@ -241,22 +239,19 @@ void plAutoProfileImp::INextProfile() bool plAutoProfileImp::INextAge() { - const char* ageName = nullptr; + ST::string ageName; - if (fAgeName.length() > 0) - { + if (!fAgeName.empty()) { if (fLinkedToSingleAge) return false; fLinkedToSingleAge = true; - ageName = fAgeName.c_str(); - } - else - { + ageName = fAgeName; + } else { if (fNextAge >= fAges.size()) return false; - ageName = fAges[fNextAge].c_str(); + ageName = fAges[fNextAge]; } fNextAge++; diff --git a/Sources/Plasma/PubUtilLib/plStatGather/plAutoProfile.h b/Sources/Plasma/PubUtilLib/plStatGather/plAutoProfile.h index fa5f6e4a73..9393c0bf2d 100644 --- a/Sources/Plasma/PubUtilLib/plStatGather/plAutoProfile.h +++ b/Sources/Plasma/PubUtilLib/plStatGather/plAutoProfile.h @@ -44,6 +44,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnKeyedObject/hsKeyedObject.h" +namespace ST { class string; } + class plAutoProfile : public hsKeyedObject { public: @@ -52,8 +54,8 @@ class plAutoProfile : public hsKeyedObject static plAutoProfile* Instance(); - // If ageName is nil, do all ages - virtual void StartProfile(const char* ageName = nullptr) = 0; + // If ageName is empty, do all ages + virtual void StartProfile(ST::string ageName) = 0; // For when we just want to link to each age, for other reasons (profiling load times) virtual void LinkToAllAges()=0; diff --git a/Sources/Plasma/PubUtilLib/plStatGather/plCalculatedProfiles.cpp b/Sources/Plasma/PubUtilLib/plStatGather/plCalculatedProfiles.cpp index 4862cac597..fba2bfc78b 100644 --- a/Sources/Plasma/PubUtilLib/plStatGather/plCalculatedProfiles.cpp +++ b/Sources/Plasma/PubUtilLib/plStatGather/plCalculatedProfiles.cpp @@ -53,7 +53,7 @@ plProfile_CreateMemCounter("Allocated", "Memory", MemAllocated); plProfile_CreateMemCounter("Peak Alloc", "Memory", MemPeakAlloc); #endif -static plProfileVar gVarRFPS("RFPS", "General", plProfileVar::kDisplayTime | plProfileVar::kDisplayFPS); +static plProfileVar gVarRFPS(ST_LITERAL("RFPS"), ST_LITERAL("General"), plProfileVar::kDisplayTime | plProfileVar::kDisplayFPS); plProfile_Extern(DrawTriangles); plProfile_Extern(MatChange); @@ -99,10 +99,9 @@ static bool ICreateStdPlate(plGraphPlate** graph) return false; } -void CreateStandardGraphs(const char* groupName, bool create) +void CreateStandardGraphs(const ST::string& groupName, bool create) { - if (strcmp(groupName, "General") == 0) - { + if (groupName == "General") { if (create) { if (ICreateStdPlate(&fFPSPlate)) diff --git a/Sources/Plasma/PubUtilLib/plStatGather/plCalculatedProfiles.h b/Sources/Plasma/PubUtilLib/plStatGather/plCalculatedProfiles.h index dc843c1fb0..1b058112af 100644 --- a/Sources/Plasma/PubUtilLib/plStatGather/plCalculatedProfiles.h +++ b/Sources/Plasma/PubUtilLib/plStatGather/plCalculatedProfiles.h @@ -40,6 +40,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ +namespace ST { class string; } + void CalculateProfiles(); -void CreateStandardGraphs(const char* groupName, bool create); +void CreateStandardGraphs(const ST::string& groupName, bool create); void UpdateStandardGraphs(float xPos, float yPos); diff --git a/Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.cpp b/Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.cpp index 0a6cc0d280..357563c33c 100644 --- a/Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.cpp +++ b/Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.cpp @@ -73,11 +73,8 @@ void plProfileManagerFull::GetGroups(GroupSet& groups) groups.insert(fVars[i]->GetGroup()); } -void plProfileManagerFull::ShowGroup(const char* groupName) +void plProfileManagerFull::ShowGroup(const ST::string& groupName) { - if (!groupName) - groupName = "General"; - // If we're already showing this group, stop if (fShowGroups.find(groupName) != fShowGroups.end()) { @@ -87,10 +84,10 @@ void plProfileManagerFull::ShowGroup(const char* groupName) } else { - const char* shareGroupName = nullptr; + ST::string shareGroupName; for (int i = 0; i < fVars.size(); i++) { - if (stricmp(fVars[i]->GetGroup(), groupName) == 0) + if (fVars[i]->GetGroup().compare_i(groupName) == 0) { shareGroupName = fVars[i]->GetGroup(); } @@ -98,7 +95,7 @@ void plProfileManagerFull::ShowGroup(const char* groupName) // We do have a group with this name, so insert one of the variable's // pointers to the name into our list (we can hang on to those pointers) - if (shareGroupName) + if (!shareGroupName.empty()) { ISetActive(shareGroupName, true); CreateStandardGraphs(shareGroupName, true); @@ -119,7 +116,7 @@ void plProfileManagerFull::ShowNextGroup() ST::string nextGroup; if (!curGroup.empty()) { - CreateStandardGraphs(curGroup.c_str(), false); + CreateStandardGraphs(curGroup, false); GroupSet::iterator it = groups.find(curGroup); it++; @@ -127,7 +124,7 @@ void plProfileManagerFull::ShowNextGroup() { nextGroup = *it; } - ISetActive(curGroup.c_str(), false); + ISetActive(curGroup, false); } else { @@ -137,8 +134,8 @@ void plProfileManagerFull::ShowNextGroup() fShowGroups.clear(); if (!nextGroup.empty()) { - ISetActive(nextGroup.c_str(), true); - CreateStandardGraphs(nextGroup.c_str(), true); + ISetActive(nextGroup, true); + CreateStandardGraphs(nextGroup, true); fShowGroups.insert(nextGroup); } } @@ -198,7 +195,6 @@ static void PrintColumn(ProfileGroup& group, const ST::string& groupName, int co for (int i = 0; i < group.size(); i++) { - char buf[1024]; ST::string str; switch (column) @@ -220,16 +216,13 @@ static void PrintColumn(ProfileGroup& group, const ST::string& groupName, int co } break; case kColValue: - group[i]->PrintValue(buf); - str = buf; + str = group[i]->PrintValue(); break; case kColAvg: - group[i]->PrintAvg(buf); - str = buf; + str = group[i]->PrintAvg(); break; case kColMax: - group[i]->PrintMax(buf); - str = buf; + str = group[i]->PrintMax(); break; case kColIndex: str = ST::format("[{3d}]", i + off); @@ -304,16 +297,14 @@ void plProfileManagerFull::Update() int maxX = 0; int y = 10; - GroupSet::iterator it; - for (it = fShowGroups.begin(); it != fShowGroups.end(); it++) - { - ST::string groupName = *it; - + for (const ST::string& groupName : fShowGroups) { std::vector group; - for (int i = 0; i < fVars.size(); i++) - if (groupName.compare(fVars[i]->GetGroup()) == 0) + for (int i = 0; i < fVars.size(); i++) { + if (groupName == fVars[i]->GetGroup()) { group.push_back(fVars[i]); + } + } int x = 10; PrintGroup(group, groupName, x, y); @@ -398,21 +389,19 @@ void plProfileManagerFull::ActivateAllStats() } } -void plProfileManagerFull::IPrintGroup(hsStream* s, const char* groupName, bool printTitle) +void plProfileManagerFull::IPrintGroup(hsStream* s, const ST::string& groupName, bool printTitle) { - char buf[256]; - - for (int i = 0; i < fVars.size(); i++) - { + for (int i = 0; i < fVars.size(); i++) { plProfileVar* var = fVars[i]; - if (strcmp(var->GetGroup(), groupName) == 0) - { - if (printTitle) - sprintf(buf, "%s:%s", var->GetGroup(), var->GetName()); - else - var->PrintAvg(buf, false); + if (var->GetGroup() == groupName) { + ST::string str; + if (printTitle) { + str = ST::format("{}:{}", var->GetGroup(), var->GetName()); + } else { + str = var->PrintAvg(false); + } - s->Write(strlen(buf), buf); + s->WriteString(str); s->WriteByte((uint8_t)','); } } @@ -457,30 +446,22 @@ void plProfileManagerFull::ILogStats() GroupSet groups; GetGroups(groups); - GroupSet::iterator it; - if (!exists) { - static const char kSpawn[] = "Spawn"; - s.Write(strlen(kSpawn), kSpawn); - s.WriteByte((uint8_t)','); + s.WriteString(ST_LITERAL("Spawn,")); - for (it = groups.begin(); it != groups.end(); it++) - { - ST::string groupName = *it; - IPrintGroup(&s, groupName.c_str(), true); + for (const ST::string& groupName : groups) { + IPrintGroup(&s, groupName, true); } s.WriteByte((uint8_t)'\r'); s.WriteByte((uint8_t)'\n'); } - s.Write(fLogSpawnName.size(), fLogSpawnName.c_str()); + s.WriteString(fLogSpawnName); s.WriteByte((uint8_t)','); - for (it = groups.begin(); it != groups.end(); it++) - { - ST::string groupName = *it; - IPrintGroup(&s, groupName.c_str()); + for (const ST::string& groupName : groups) { + IPrintGroup(&s, groupName); } s.WriteByte((uint8_t)'\r'); s.WriteByte((uint8_t)'\n'); @@ -492,7 +473,7 @@ void plProfileManagerFull::ILogStats() } -void plProfileManagerFull::ShowLaps(const char* groupName, const char* varName) +void plProfileManagerFull::ShowLaps(const ST::string& groupName, const ST::string& varName) { plProfileVar* var = nullptr; @@ -502,11 +483,9 @@ void plProfileManagerFull::ShowLaps(const char* groupName, const char* varName) for (int i = 0; i < fVars.size(); i++) { - int j = 0; - while(fVars[i]->GetName()[j++] == ' ') {} - if (stricmp(&(fVars[i]->GetName()[j-1]), varName) == 0 && - stricmp(fVars[i]->GetGroup(), groupName) == 0) - { + if (fVars[i]->GetName().trim_left(" ").compare_i(varName) == 0 && + fVars[i]->GetGroup().compare_i(groupName) == 0 + ) { var = fVars[i]; break; } @@ -528,7 +507,7 @@ void plProfileManagerFull::ShowLaps(const char* groupName, const char* varName) fShowLaps->SetLapsActive(true); } -void plProfileManagerFull::CreateGraph(const char* varName, uint32_t min, uint32_t max) +void plProfileManagerFull::CreateGraph(const ST::string& varName, uint32_t min, uint32_t max) { // If the graph is already created, destroy it for (int i = 0; i < fGraphs.size(); i++) @@ -556,16 +535,16 @@ void plProfileManagerFull::CreateGraph(const char* varName, uint32_t min, uint32 void plProfileManagerFull::ResetDefaultDetailVars() { fDetailVars.clear(); - AddDetailVar("ApplyAnimation",0,50); - AddDetailVar("AnimatingPhysicals",0,50); - AddDetailVar("StoppedAnimPhysicals",0,50); - AddDetailVar("DrawableTime",0,50); - AddDetailVar("Polys",0,150000); - AddDetailVar("Step",0,50); - AddDetailVar("LineOfSight",0,50); - AddDetailVar(" PhysicsUpdates",0,50); - AddDetailVar("Stream Shove Time",0,50); - AddDetailVar("RenderSetup",0,50); + AddDetailVar(ST_LITERAL("ApplyAnimation"), 0, 50); + AddDetailVar(ST_LITERAL("AnimatingPhysicals"), 0, 50); + AddDetailVar(ST_LITERAL("StoppedAnimPhysicals"), 0, 50); + AddDetailVar(ST_LITERAL("DrawableTime"), 0, 50); + AddDetailVar(ST_LITERAL("Polys"), 0, 150000); + AddDetailVar(ST_LITERAL("Step"), 0, 50); + AddDetailVar(ST_LITERAL("LineOfSight"), 0, 50); + AddDetailVar(ST_LITERAL(" PhysicsUpdates"), 0, 50); + AddDetailVar(ST_LITERAL("Stream Shove Time"), 0, 50); + AddDetailVar(ST_LITERAL("RenderSetup"), 0, 50); } void plProfileManagerFull::ShowDetailGraph() @@ -593,13 +572,14 @@ void plProfileManagerFull::HideDetailGraph() } } -void plProfileManagerFull::AddDetailVar(const char* varName, uint32_t min, uint32_t max) +void plProfileManagerFull::AddDetailVar(const ST::string& varName, uint32_t min, uint32_t max) { int i=0; for (i=0; iGetName(), varName) == 0) + if (fDetailVars[i].var->GetName().compare_i(varName) == 0) { return; // don't add it again + } } plProfileVar* var = IFindTimer(varName); @@ -617,12 +597,12 @@ void plProfileManagerFull::AddDetailVar(const char* varName, uint32_t min, uint3 UpdateDetailLabels(); } -void plProfileManagerFull::RemoveDetailVar(const char* varName) +void plProfileManagerFull::RemoveDetailVar(const ST::string& varName) { int i=0; for (i=0; iGetName(), varName) == 0) + if (fDetailVars[i].var->GetName().compare_i(varName) == 0) { fDetailVars.erase(fDetailVars.begin()+i); } @@ -664,12 +644,11 @@ void plProfileManagerFull::ResetMax() fVars[i]->ResetMax(); } -void plProfileManagerFull::ISetActive(const char* groupName, bool active) +void plProfileManagerFull::ISetActive(const ST::string& groupName, bool active) { for (int i = 0; i < fVars.size(); i++) { - if (stricmp(fVars[i]->GetGroup(), groupName) == 0) - { + if (fVars[i]->GetGroup().compare_i(groupName) == 0) { fVars[i]->SetActive(active); } } diff --git a/Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.h b/Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.h index 1f8bf0dc68..025e01c000 100644 --- a/Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.h +++ b/Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.h @@ -83,12 +83,12 @@ class plProfileManagerFull plProfileVar* fShowLaps; uint32_t fMinLap; // For Display - void IPrintGroup(hsStream* s, const char* groupName, bool printTitle=false); + void IPrintGroup(hsStream* s, const ST::string& groupName, bool printTitle = false); void ILogStats(); plProfileVar* IFindTimer(const ST::string& name); - void ISetActive(const char* groupName, bool active); + void ISetActive(const ST::string& groupName, bool active); plProfileManagerFull(); @@ -99,24 +99,24 @@ class plProfileManagerFull void Update(); void GetGroups(GroupSet& groups); - void ShowGroup(const char* groupName); + void ShowGroup(const ST::string& groupName); void ShowNextGroup(); - struct LapPair { const char* group; const char* varName; }; + struct LapPair { ST::string group; ST::string varName; }; typedef std::vector LapNames; void GetLaps(LapNames& lapNames); - void ShowLaps(const char* groupName, const char* varName); + void ShowLaps(const ST::string& groupName, const ST::string& varName); void SetMinLap(int m) { fMinLap = m; }; void PageDownLaps() { fMinLap += 40; } void PageUpLaps() { fMinLap = (fMinLap < 40) ? 0 : fMinLap - 40;} - void CreateGraph(const char* varName, uint32_t min, uint32_t max); + void CreateGraph(const ST::string& varName, uint32_t min, uint32_t max); void ResetDefaultDetailVars(); void ShowDetailGraph(); void HideDetailGraph(); - void AddDetailVar(const char* varName, uint32_t min, uint32_t max); - void RemoveDetailVar(const char* varName); + void AddDetailVar(const ST::string& varName, uint32_t min, uint32_t max); + void RemoveDetailVar(const ST::string& varName); void UpdateDetailLabels(); void ResetMax(); diff --git a/Sources/Plasma/PubUtilLib/plSurface/hsGMaterial.cpp b/Sources/Plasma/PubUtilLib/plSurface/hsGMaterial.cpp index b22bfb3866..e344d3e19d 100644 --- a/Sources/Plasma/PubUtilLib/plSurface/hsGMaterial.cpp +++ b/Sources/Plasma/PubUtilLib/plSurface/hsGMaterial.cpp @@ -41,6 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include +#include #include "hsGMaterial.h" #include "HeadSpin.h" @@ -262,7 +263,7 @@ void hsGMaterial::Read(hsStream *stream, hsResMgr *group) void hsGMaterial::Eval(double secs, uint32_t frame) { - plProfile_BeginLap(MaterialAnims, GetKeyName().c_str()); + plProfile_BeginLap(MaterialAnims, GetKeyName()); for (size_t i = 0; i < GetNumLayers(); i++) { @@ -275,7 +276,7 @@ void hsGMaterial::Eval(double secs, uint32_t frame) fPiggyBacks[i]->Eval(secs, frame, 0); } - plProfile_EndLap(MaterialAnims, GetKeyName().c_str()); + plProfile_EndLap(MaterialAnims, GetKeyName()); } void hsGMaterial::Reset() diff --git a/Sources/Plasma/PubUtilLib/plSurface/plGrassShaderMod.cpp b/Sources/Plasma/PubUtilLib/plSurface/plGrassShaderMod.cpp index 76add24a8d..dc9e1b3641 100644 --- a/Sources/Plasma/PubUtilLib/plSurface/plGrassShaderMod.cpp +++ b/Sources/Plasma/PubUtilLib/plSurface/plGrassShaderMod.cpp @@ -40,6 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "plGrassShaderMod.h" +#include #include "plgDispatch.h" #include "hsResMgr.h" diff --git a/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp b/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp index 69baa5cbae..de580976fc 100644 --- a/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp +++ b/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp @@ -111,7 +111,10 @@ void plUnifiedTime::ToCurrentTime() { struct timespec ts; -#if defined(HS_BUILD_FOR_APPLE) +#if defined(__MINGW32__) + int res = clock_gettime(CLOCK_REALTIME, &ts); + hsAssert(res == 0, "clock_gettime failed"); +#elif defined(HS_BUILD_FOR_APPLE) #if defined(HAVE_BUILTIN_AVAILABLE) && MAC_OS_X_VERSION_MIN_REQUIRED >= 101500 if (__builtin_available(macOS 10.15, *)) { // timespec_get is only supported since macOS 10.15 diff --git a/Sources/Plasma/PubUtilLib/plVault/plDniCoordinateInfo.h b/Sources/Plasma/PubUtilLib/plVault/plDniCoordinateInfo.h index 4cad5bf076..003e8f007a 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plDniCoordinateInfo.h +++ b/Sources/Plasma/PubUtilLib/plVault/plDniCoordinateInfo.h @@ -49,7 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com class hsStream; class hsResMgr; - +namespace ST { class string; } class plDniCoordinateInfo : public plCreatable { diff --git a/Sources/Plasma/PubUtilLib/plWinDpi/plWinDpi.h b/Sources/Plasma/PubUtilLib/plWinDpi/plWinDpi.h index 3795d17980..eed4face68 100644 --- a/Sources/Plasma/PubUtilLib/plWinDpi/plWinDpi.h +++ b/Sources/Plasma/PubUtilLib/plWinDpi/plWinDpi.h @@ -47,7 +47,25 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include "hsWindows.h" -#include + +#ifdef HAVE_SHELLSCALINGAPI +# include +#else + typedef enum + { + PROCESS_DPI_UNAWARE = 0, + PROCESS_SYSTEM_DPI_AWARE = 1, + PROCESS_PER_MONITOR_DPI_AWARE = 2 + } PROCESS_DPI_AWARENESS; + + typedef enum + { + MDT_EFFECTIVE_DPI = 0, + MDT_ANGULAR_DPI = 1, + MDT_RAW_DPI = 2, + MDT_DEFAULT = MDT_EFFECTIVE_DPI + } MONITOR_DPI_TYPE; +#endif #include "plStatusLog/plStatusLog.h" diff --git a/Sources/Tools/MaxComponent/plResponderAnim.cpp b/Sources/Tools/MaxComponent/plResponderAnim.cpp index 3991749e4a..623b813645 100644 --- a/Sources/Tools/MaxComponent/plResponderAnim.cpp +++ b/Sources/Tools/MaxComponent/plResponderAnim.cpp @@ -118,7 +118,7 @@ enum kRespondRewindSound, kRespondFastForwardAnim, - kNumTypes = 16 + kNumTypes = 17 }; int plResponderCmdAnim::NumTypes() @@ -126,9 +126,9 @@ int plResponderCmdAnim::NumTypes() return kNumTypes; } -static int IndexToOldType(int idx) +static constexpr int IndexToOldType(int idx) { - static int oldTypes[] = + constexpr int oldTypes[] = { kRespondPlayAnim, kRespondStopAnim, @@ -152,6 +152,7 @@ static int IndexToOldType(int idx) kRespondFastForwardAnim, }; + static_assert(std::size(oldTypes) == kNumTypes, "ResponderAnim enumerations have differing lengths!"); hsAssert(idx < kNumTypes, "Bad index"); return oldTypes[idx]; } diff --git a/Sources/Tools/MaxComponent/plResponderComponent.cpp b/Sources/Tools/MaxComponent/plResponderComponent.cpp index 1a891fa857..e048c6b782 100644 --- a/Sources/Tools/MaxComponent/plResponderComponent.cpp +++ b/Sources/Tools/MaxComponent/plResponderComponent.cpp @@ -877,11 +877,18 @@ void plResponderProc::IDrawComboItem(DRAWITEMSTRUCT *dis) return; // The colors depend on whether the item is selected. - COLORREF clrForeground = SetTextColor(dis->hDC, - GetSysColor(dis->itemState & ODS_SELECTED ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT)); - - COLORREF clrBackground = SetBkColor(dis->hDC, - GetSysColor(dis->itemState & ODS_SELECTED ? COLOR_HIGHLIGHT : COLOR_WINDOW)); + bool selected = hsCheckBits(dis->itemState, ODS_SELECTED); + COLORREF maxForeground = selected ? kHilightText : kWindowText; + COLORREF maxBackground = selected ? kItemHilight : kWindow; + + COLORREF clrForeground = SetTextColor( + dis->hDC, + GetColorManager()->GetColor(maxForeground) + ); + COLORREF clrBackground = SetBkColor( + dis->hDC, + GetColorManager()->GetColor(maxBackground) + ); // Calculate the vertical and horizontal position. TEXTMETRIC tm; @@ -1072,7 +1079,6 @@ INT_PTR plResponderProc::DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT ms } return TRUE; -#ifdef CUSTOM_DRAW case WM_DRAWITEM: if (wParam == IDC_STATE_COMBO) { @@ -1080,7 +1086,6 @@ INT_PTR plResponderProc::DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT ms return TRUE; } break; -#endif case WM_SETCURSOR: { diff --git a/Sources/Tools/plLocalizationEditor/plEditDlg.cpp b/Sources/Tools/plLocalizationEditor/plEditDlg.cpp index 3a20c0be18..d27df8e407 100644 --- a/Sources/Tools/plLocalizationEditor/plEditDlg.cpp +++ b/Sources/Tools/plLocalizationEditor/plEditDlg.cpp @@ -52,6 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include #include +#include static void IAboutDialog(QWidget *parent) { @@ -204,9 +205,12 @@ void EditDialog::closeEvent(QCloseEvent *event) void EditDialog::OpenDataDirectory() { - QString path = QFileDialog::getExistingDirectory(this, + QSettings settings; + QString path = settings.value("dataDir", QDir::current().absolutePath()).toString(); + + path = QFileDialog::getExistingDirectory(this, tr("Select a localization data directory:"), - QDir::current().absolutePath(), + path, QFileDialog::ShowDirsOnly | QFileDialog::ReadOnly); if (!path.isEmpty()) @@ -217,6 +221,7 @@ void EditDialog::OpenDataDirectory() fCurrentSavePath = path; pfLocalizationMgr::Initialize(fCurrentSavePath.toUtf8().constData()); + settings.setValue("dataDir", path); fUI->fLocalizationTree->clear(); fUI->fLocalizationTree->LoadData(""); @@ -262,6 +267,9 @@ void EditDialog::SaveToDirectory() fCurrentSavePath = path; + QSettings settings; + settings.setValue("dataDir", path); + SetTitle(path); pfLocalizationDataMgr::Instance().WriteDatabaseToDisk(fCurrentSavePath.toUtf8().constData()); } diff --git a/Sources/Tools/plLocalizationEditor/plLocalizationEditor.cpp b/Sources/Tools/plLocalizationEditor/plLocalizationEditor.cpp index df92032f94..13f285249f 100644 --- a/Sources/Tools/plLocalizationEditor/plLocalizationEditor.cpp +++ b/Sources/Tools/plLocalizationEditor/plLocalizationEditor.cpp @@ -56,6 +56,7 @@ REGISTER_CREATABLE(plResMgrHelperMsg); int main(int argc, char *argv[]) { QApplication app(argc, argv); + app.setOrganizationName("Cyan Worlds"); app.setApplicationName("plLocalizationEditor"); app.setWindowIcon(QIcon(":/icon1.ico")); diff --git a/Sources/Tools/plNetLog/ChunkBuffer.cpp b/Sources/Tools/plNetLog/ChunkBuffer.cpp index 4b45e9d7d9..44b34e946d 100644 --- a/Sources/Tools/plNetLog/ChunkBuffer.cpp +++ b/Sources/Tools/plNetLog/ChunkBuffer.cpp @@ -184,7 +184,7 @@ QString ChunkBuffer::readSafeWString() return QString::fromUtf16(buffer.get(), length); } -void ChunkBuffer::waitOnData(QMutexLocker& lock) +void ChunkBuffer::waitOnData(qtMutexLocker& lock) { while (m_chunks.size() == 0) { // Give the buffer some time to fill diff --git a/Sources/Tools/plNetLog/ChunkBuffer.h b/Sources/Tools/plNetLog/ChunkBuffer.h index c5ca66020c..235ebc5033 100644 --- a/Sources/Tools/plNetLog/ChunkBuffer.h +++ b/Sources/Tools/plNetLog/ChunkBuffer.h @@ -50,6 +50,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +using qtMutexLocker = QMutexLocker; +#else +using qtMutexLocker = QMutexLocker; +#endif + class ChunkBuffer { ChunkBuffer(const ChunkBuffer&) = delete; @@ -149,7 +155,7 @@ class ChunkBuffer QMutex m_mutex; std::list m_chunks; - void waitOnData(QMutexLocker& lock); + void waitOnData(qtMutexLocker& lock); }; #endif diff --git a/Sources/Tools/plNetLog/plNetLog.cpp b/Sources/Tools/plNetLog/plNetLog.cpp index 624496b4af..681c1e57d1 100644 --- a/Sources/Tools/plNetLog/plNetLog.cpp +++ b/Sources/Tools/plNetLog/plNetLog.cpp @@ -176,7 +176,7 @@ plNetLogGUI::plNetLogGUI(QWidget* parent) m_autoscroll = new QCheckBox(tr("&Autoscroll"), searchBar); m_autoscroll->setChecked(true); QGridLayout* searchLayout = new QGridLayout(searchBar); - searchLayout->setMargin(0); + searchLayout->setContentsMargins(0, 0, 0, 0); searchLayout->setHorizontalSpacing(4); searchLayout->addWidget(m_searchText, 0, 0); searchLayout->addWidget(btnSearch, 0, 1); @@ -200,7 +200,7 @@ plNetLogGUI::plNetLogGUI(QWidget* parent) QLabel* lblPath = new QLabel(tr("MOULa &Client:"), pathSpec); lblPath->setBuddy(m_exePath); QGridLayout* pathLayout = new QGridLayout(pathSpec); - pathLayout->setMargin(0); + pathLayout->setContentsMargins(0, 0, 0, 0); pathLayout->setHorizontalSpacing(4); pathLayout->addWidget(lblPath, 0, 0); pathLayout->addWidget(m_exePath, 0, 1); @@ -211,14 +211,14 @@ plNetLogGUI::plNetLogGUI(QWidget* parent) QPushButton* loadAuth = new QPushButton(tr("Load Auth Log"), loadBar); QPushButton* loadGame = new QPushButton(tr("Load Game Log"), loadBar); QGridLayout* loadLayout = new QGridLayout(loadBar); - loadLayout->setMargin(0); + loadLayout->setContentsMargins(0, 0, 0, 0); loadLayout->setHorizontalSpacing(4); loadLayout->addWidget(loadGate, 0, 0); loadLayout->addWidget(loadAuth, 0, 1); loadLayout->addWidget(loadGame, 0, 2); QGridLayout* layout = new QGridLayout(window); - layout->setMargin(4); + layout->setContentsMargins(4, 4, 4, 4); layout->addWidget(btnClear, 0, 0); layout->addWidget(searchBar, 1, 0); layout->addWidget(m_logView, 2, 0); diff --git a/cmake/CompilerChecks.cmake b/cmake/CompilerChecks.cmake index 59b698dffc..677c0a62ac 100644 --- a/cmake/CompilerChecks.cmake +++ b/cmake/CompilerChecks.cmake @@ -40,6 +40,9 @@ CHECK_INCLUDE_FILE("pmmintrin.h" HAVE_SSE3) CHECK_INCLUDE_FILE("emmintrin.h" HAVE_SSE2) CHECK_INCLUDE_FILE("xmmintrin.h" HAVE_SSE1) +# Check for Windows Shell Scaling DPI support +CHECK_INCLUDE_FILE("ShellScalingApi.h" HAVE_SHELLSCALINGAPI) + # GCC requires us to set the -m flag for the source file using the intrinsics. # We can't do that project-wide or we'll just crash on launch with an illegal instruction on some # systems. So, we have another helper method... diff --git a/cmake/PlasmaTargets.cmake b/cmake/PlasmaTargets.cmake index 584dfa5e5b..662660dcb8 100644 --- a/cmake/PlasmaTargets.cmake +++ b/cmake/PlasmaTargets.cmake @@ -9,11 +9,17 @@ cmake_dependent_option( OFF ) +# CMake 3.28.2 breaks precompiled headers and unity builds. +# Debounce this known bad combination. +if(CMAKE_VERSION VERSION_EQUAL 3.28.2 AND PLASMA_USE_PCH AND CMAKE_GENERATOR MATCHES Ninja|Makefiles) + set(_UNITY_BROKEN TRUE) +endif() + cmake_dependent_option( PLASMA_UNITY_BUILD "Enable unity build?" ON - "CMAKE_VERSION VERSION_GREATER_EQUAL 3.16;ALLOW_BUILD_OPTIMIZATIONS" + "CMAKE_VERSION VERSION_GREATER_EQUAL 3.16;ALLOW_BUILD_OPTIMIZATIONS;NOT _UNITY_BROKEN" OFF ) diff --git a/cmake/PythonUtils.cmake b/cmake/PythonUtils.cmake index 249a812150..a2f28b4b57 100644 --- a/cmake/PythonUtils.cmake +++ b/cmake/PythonUtils.cmake @@ -23,12 +23,22 @@ function(python_test_modules) endif() if(_ptm_REQUIREMENTS_FILE) - message(STATUS "Installing Python modules from: ${_ptm_REQUIREMENTS_FILE}") - execute_process( - COMMAND "${Python3_EXECUTABLE}" -m pip install -r "${_ptm_REQUIREMENTS_FILE}" - RESULT_VARIABLE RETURNCODE - OUTPUT_QUIET ERROR_QUIET - ) + # Optimization: hash the requirements file and store it on success + # Then, we can avoid running expensive install operations on reconfigure. + file(SHA512 "${_ptm_REQUIREMENTS_FILE}" _REQUIREMENTS_FILE_HASH) + if(NOT _REQUIREMENTS_FILE_HASH IN_LIST _PLASMA_PIP_REQUIREMENTS_HASHES) + message(STATUS "Installing Python modules from: ${_ptm_REQUIREMENTS_FILE}") + execute_process( + COMMAND "${Python3_EXECUTABLE}" -m pip install -r "${_ptm_REQUIREMENTS_FILE}" + RESULT_VARIABLE RETURNCODE + OUTPUT_QUIET ERROR_QUIET + ) + if(RETURNCODE EQUAL 0) + set(_PLASMA_PIP_REQUIREMENTS_HASHES "${_PLASMA_PIP_REQUIREMENTS_HASHES}${_REQUIREMENTS_FILE_HASH};" CACHE INTERNAL "") + endif() + else() + message(STATUS "Already installed Python modules from: ${_ptm_REQUIREMENTS_FILE}") + endif() else() message(STATUS "Installing Python modules: ${_ptm_MODULES}") execute_process( diff --git a/cmake/hsConfig.h.cmake b/cmake/hsConfig.h.cmake index 19d66b4145..2950c86110 100644 --- a/cmake/hsConfig.h.cmake +++ b/cmake/hsConfig.h.cmake @@ -66,5 +66,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #cmakedefine HAVE_SYSCTL #cmakedefine HAVE_SYSDIR #cmakedefine HAVE_SYSINFO +#cmakedefine HAVE_SHELLSCALINGAPI #endif diff --git a/vcpkg b/vcpkg index a42af01b72..a34c873a97 160000 --- a/vcpkg +++ b/vcpkg @@ -1 +1 @@ -Subproject commit a42af01b72c28a8e1d7b48107b33e4f286a55ef6 +Subproject commit a34c873a9717a888f58dc05268dea15592c2f0ff diff --git a/vcpkg.json b/vcpkg.json index ddfe06d95e..f3d06c5d46 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -37,15 +37,15 @@ "zlib" ], "overrides": [ - { - "name": "openssl", - "version": "3.0.8#2", - "$comment": "OpenSSL 3.1.x has a bug on arm64 macOS that causes crashes in debug builds. Use 3.0.x for now." - }, { "name": "physx", "version": "4.1.2#6", "$comment": "Upstream vcpkg updated to PhysX 5, which drops support for several target platforms. Stick with 4.1.2 for now." + }, + { + "name": "liblzma", + "version": "5.4.4", + "$comment": "liblzma & xz were compromised upstream: CVE-2024-3094." } ], "features": { @@ -59,7 +59,7 @@ ] } }, - "builtin-baseline": "a42af01b72c28a8e1d7b48107b33e4f286a55ef6", + "builtin-baseline": "a34c873a9717a888f58dc05268dea15592c2f0ff", "vcpkg-configuration": { "overlay-ports": ["./Scripts/Ports"], "overlay-triplets": ["./Scripts/Triplets"]