From 7f821e8cfcb3d02c25adcc914606b39c798887f3 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 22 Jan 2006 01:00:06 +0000 Subject: [PATCH] CString -> RString --- stepmania/src/ActiveAttackList.cpp | 4 +- stepmania/src/Actor.cpp | 64 +++---- stepmania/src/Actor.h | 48 ++--- stepmania/src/ActorCommands.cpp | 8 +- stepmania/src/ActorCommands.h | 4 +- stepmania/src/ActorFrame.cpp | 10 +- stepmania/src/ActorFrame.h | 8 +- stepmania/src/ActorScroller.cpp | 8 +- stepmania/src/ActorScroller.h | 4 +- stepmania/src/ActorSound.cpp | 8 +- stepmania/src/ActorSound.h | 4 +- stepmania/src/ActorUtil.cpp | 86 ++++----- stepmania/src/ActorUtil.h | 54 +++--- stepmania/src/AnnouncerManager.cpp | 24 +-- stepmania/src/AnnouncerManager.h | 18 +- stepmania/src/Attack.cpp | 6 +- stepmania/src/Attack.h | 10 +- stepmania/src/AttackDisplay.cpp | 18 +- stepmania/src/AttackDisplay.h | 2 +- stepmania/src/AutoActor.cpp | 6 +- stepmania/src/AutoActor.h | 6 +- stepmania/src/AutoKeysounds.cpp | 6 +- stepmania/src/BGAnimation.cpp | 30 +-- stepmania/src/BGAnimation.h | 6 +- stepmania/src/BGAnimationLayer.cpp | 38 ++-- stepmania/src/BGAnimationLayer.h | 6 +- stepmania/src/BPMDisplay.cpp | 2 +- stepmania/src/Background.cpp | 60 +++--- stepmania/src/BackgroundUtil.cpp | 88 ++++----- stepmania/src/BackgroundUtil.h | 54 +++--- stepmania/src/Banner.cpp | 4 +- stepmania/src/Banner.h | 2 +- stepmania/src/BannerCache.cpp | 30 +-- stepmania/src/BannerCache.h | 10 +- stepmania/src/BeginnerHelper.cpp | 4 +- stepmania/src/BitmapText.cpp | 44 ++--- stepmania/src/BitmapText.h | 18 +- stepmania/src/Bookkeeper.cpp | 2 +- stepmania/src/CatalogXml.cpp | 20 +- stepmania/src/CatalogXml.h | 6 +- stepmania/src/Character.cpp | 50 ++--- stepmania/src/Character.h | 34 ++-- stepmania/src/CharacterManager.cpp | 6 +- stepmania/src/CharacterManager.h | 2 +- stepmania/src/CodeDetector.cpp | 12 +- stepmania/src/CodeDetector.h | 4 +- stepmania/src/CombinedLifeMeterTug.cpp | 6 +- stepmania/src/Combo.cpp | 2 +- stepmania/src/ComboGraph.cpp | 2 +- stepmania/src/ComboGraph.h | 2 +- stepmania/src/Command.cpp | 36 ++-- stepmania/src/Command.h | 20 +- stepmania/src/CommonMetrics.cpp | 50 ++--- stepmania/src/CommonMetrics.h | 22 +-- stepmania/src/Course.cpp | 26 +-- stepmania/src/Course.h | 40 ++-- stepmania/src/CourseContentsList.cpp | 2 +- stepmania/src/CourseContentsList.h | 2 +- stepmania/src/CourseEntryDisplay.cpp | 10 +- stepmania/src/CourseEntryDisplay.h | 6 +- stepmania/src/CourseLoaderCRS.cpp | 38 ++-- stepmania/src/CourseLoaderCRS.h | 10 +- stepmania/src/CourseUtil.cpp | 20 +- stepmania/src/CourseUtil.h | 12 +- stepmania/src/CourseWriterCRS.cpp | 16 +- stepmania/src/CourseWriterCRS.h | 4 +- stepmania/src/CryptHelpers.cpp | 6 +- stepmania/src/CryptHelpers.h | 6 +- stepmania/src/CryptManager.cpp | 70 +++---- stepmania/src/CryptManager.h | 18 +- stepmania/src/CsvFile.cpp | 2 +- stepmania/src/DancingCharacters.cpp | 4 +- stepmania/src/DateTime.cpp | 30 +-- stepmania/src/DateTime.h | 26 +-- stepmania/src/Difficulty.cpp | 8 +- stepmania/src/Difficulty.h | 12 +- stepmania/src/DifficultyIcon.cpp | 8 +- stepmania/src/DifficultyIcon.h | 4 +- stepmania/src/DifficultyList.cpp | 2 +- stepmania/src/DifficultyList.h | 2 +- stepmania/src/DifficultyMeter.cpp | 32 ++-- stepmania/src/DifficultyMeter.h | 10 +- stepmania/src/DualScrollBar.cpp | 2 +- stepmania/src/DualScrollBar.h | 2 +- stepmania/src/DynamicActorScroller.cpp | 4 +- stepmania/src/DynamicActorScroller.h | 2 +- stepmania/src/EditMenu.cpp | 18 +- stepmania/src/EditMenu.h | 18 +- stepmania/src/EnumHelper.cpp | 2 +- stepmania/src/EnumHelper.h | 18 +- stepmania/src/FadingBanner.cpp | 12 +- stepmania/src/FadingBanner.h | 4 +- stepmania/src/Font.cpp | 50 ++--- stepmania/src/Font.h | 20 +- stepmania/src/FontCharAliases.cpp | 12 +- stepmania/src/FontCharAliases.h | 4 +- stepmania/src/FontCharmaps.cpp | 6 +- stepmania/src/FontCharmaps.h | 2 +- stepmania/src/FontManager.cpp | 4 +- stepmania/src/FontManager.h | 2 +- stepmania/src/Foreground.cpp | 2 +- stepmania/src/Foreground.h | 2 +- stepmania/src/Game.cpp | 4 +- stepmania/src/Game.h | 4 +- stepmania/src/GameCommand.cpp | 20 +- stepmania/src/GameCommand.h | 24 +-- stepmania/src/GameConstantsAndTypes.cpp | 26 +-- stepmania/src/GameConstantsAndTypes.h | 72 ++++---- stepmania/src/GameInput.cpp | 12 +- stepmania/src/GameInput.h | 10 +- stepmania/src/GameLoop.cpp | 6 +- stepmania/src/GameManager.cpp | 20 +- stepmania/src/GameManager.h | 12 +- stepmania/src/GameSoundManager.cpp | 36 ++-- stepmania/src/GameSoundManager.h | 10 +- stepmania/src/GameState.cpp | 38 ++-- stepmania/src/GameState.h | 30 +-- stepmania/src/GhostArrowRow.cpp | 6 +- stepmania/src/Grade.cpp | 12 +- stepmania/src/Grade.h | 8 +- stepmania/src/GradeDisplay.cpp | 4 +- stepmania/src/GraphDisplay.cpp | 2 +- stepmania/src/GraphDisplay.h | 2 +- stepmania/src/GroupList.cpp | 2 +- stepmania/src/GroupList.h | 6 +- stepmania/src/HelpDisplay.cpp | 20 +- stepmania/src/HelpDisplay.h | 16 +- stepmania/src/HighScore.cpp | 32 ++-- stepmania/src/HighScore.h | 26 +-- stepmania/src/InputFilter.cpp | 6 +- stepmania/src/InputFilter.h | 4 +- stepmania/src/InputMapper.cpp | 34 ++-- stepmania/src/InputMapper.h | 2 +- stepmania/src/Inventory.cpp | 2 +- stepmania/src/LifeMeterBar.cpp | 6 +- stepmania/src/LifeMeterTime.cpp | 4 +- stepmania/src/LightsManager.cpp | 6 +- stepmania/src/LightsManager.h | 6 +- stepmania/src/LocalizedString.cpp | 2 +- stepmania/src/LuaBinding.cpp | 6 +- stepmania/src/LuaBinding.h | 6 +- stepmania/src/LuaExpressionTransform.cpp | 2 +- stepmania/src/LuaExpressionTransform.h | 2 +- stepmania/src/LuaFunctions.h | 4 +- stepmania/src/LuaManager.cpp | 66 +++---- stepmania/src/LuaManager.h | 34 ++-- stepmania/src/LyricsLoader.cpp | 10 +- stepmania/src/LyricsLoader.h | 2 +- stepmania/src/MemoryCardDisplay.cpp | 4 +- stepmania/src/MemoryCardDisplay.h | 2 +- stepmania/src/MemoryCardManager.cpp | 22 +-- stepmania/src/MemoryCardManager.h | 14 +- stepmania/src/MenuInput.h | 4 +- stepmania/src/MenuTimer.cpp | 8 +- stepmania/src/MessageManager.cpp | 16 +- stepmania/src/MessageManager.h | 16 +- stepmania/src/MeterDisplay.cpp | 8 +- stepmania/src/MeterDisplay.h | 4 +- stepmania/src/ModeSwitcher.cpp | 44 ++--- stepmania/src/ModeSwitcher.h | 6 +- stepmania/src/Model.cpp | 40 ++-- stepmania/src/Model.h | 22 +-- stepmania/src/ModelManager.cpp | 8 +- stepmania/src/ModelManager.h | 4 +- stepmania/src/ModelTypes.cpp | 20 +- stepmania/src/ModelTypes.h | 14 +- stepmania/src/MsdFile.cpp | 14 +- stepmania/src/MsdFile.h | 14 +- stepmania/src/MusicBannerWheel.cpp | 6 +- stepmania/src/MusicList.cpp | 6 +- stepmania/src/MusicList.h | 2 +- stepmania/src/MusicSortDisplay.cpp | 2 +- stepmania/src/MusicSortDisplay.h | 2 +- stepmania/src/MusicWheel.cpp | 32 ++-- stepmania/src/MusicWheel.h | 18 +- stepmania/src/MusicWheelItem.cpp | 10 +- stepmania/src/MusicWheelItem.h | 6 +- stepmania/src/NetworkSyncManager.cpp | 54 +++--- stepmania/src/NetworkSyncManager.h | 36 ++-- stepmania/src/NetworkSyncServer.cpp | 34 ++-- stepmania/src/NetworkSyncServer.h | 32 ++-- stepmania/src/NoteDataUtil.cpp | 14 +- stepmania/src/NoteDataUtil.h | 4 +- stepmania/src/NoteDisplay.cpp | 28 +-- stepmania/src/NoteDisplay.h | 8 +- stepmania/src/NoteField.cpp | 18 +- stepmania/src/NoteField.h | 6 +- stepmania/src/NoteSkinManager.cpp | 88 ++++----- stepmania/src/NoteSkinManager.h | 42 ++--- stepmania/src/NoteTypes.h | 6 +- stepmania/src/NotesLoader.cpp | 8 +- stepmania/src/NotesLoader.h | 8 +- stepmania/src/NotesLoaderBMS.cpp | 78 ++++---- stepmania/src/NotesLoaderBMS.h | 20 +- stepmania/src/NotesLoaderDWI.cpp | 48 ++--- stepmania/src/NotesLoaderDWI.h | 18 +- stepmania/src/NotesLoaderKSF.cpp | 42 ++--- stepmania/src/NotesLoaderKSF.h | 10 +- stepmania/src/NotesLoaderSM.cpp | 58 +++--- stepmania/src/NotesLoaderSM.h | 28 +-- stepmania/src/NotesWriterDWI.cpp | 20 +- stepmania/src/NotesWriterDWI.h | 10 +- stepmania/src/NotesWriterSM.cpp | 34 ++-- stepmania/src/NotesWriterSM.h | 8 +- stepmania/src/OptionIcon.cpp | 10 +- stepmania/src/OptionIcon.h | 4 +- stepmania/src/OptionIconRow.cpp | 12 +- stepmania/src/OptionIconRow.h | 2 +- stepmania/src/OptionRow.cpp | 38 ++-- stepmania/src/OptionRow.h | 32 ++-- stepmania/src/OptionRowHandler.cpp | 54 +++--- stepmania/src/OptionRowHandler.h | 6 +- stepmania/src/OptionsCursor.cpp | 6 +- stepmania/src/OptionsCursor.h | 4 +- stepmania/src/PaneDisplay.cpp | 12 +- stepmania/src/PaneDisplay.h | 4 +- stepmania/src/PercentageDisplay.cpp | 10 +- stepmania/src/PercentageDisplay.h | 6 +- stepmania/src/Player.cpp | 14 +- stepmania/src/Player.h | 6 +- stepmania/src/PlayerAI.cpp | 2 +- stepmania/src/PlayerNumber.h | 8 +- stepmania/src/PlayerOptions.cpp | 48 ++--- stepmania/src/PlayerOptions.h | 12 +- stepmania/src/Preference.cpp | 16 +- stepmania/src/Preference.h | 32 ++-- stepmania/src/PrefsManager.cpp | 52 +++--- stepmania/src/PrefsManager.h | 52 +++--- stepmania/src/Profile.cpp | 90 ++++----- stepmania/src/Profile.h | 56 +++--- stepmania/src/ProfileManager.cpp | 106 +++++------ stepmania/src/ProfileManager.h | 40 ++-- stepmania/src/Quad.cpp | 2 +- stepmania/src/Quad.h | 2 +- stepmania/src/RadarValues.cpp | 8 +- stepmania/src/RadarValues.h | 4 +- stepmania/src/RageBitmapTexture.cpp | 14 +- stepmania/src/RageDisplay.cpp | 20 +- stepmania/src/RageDisplay.h | 24 +-- stepmania/src/RageDisplay_D3D.cpp | 16 +- stepmania/src/RageDisplay_D3D.h | 6 +- stepmania/src/RageDisplay_Null.h | 4 +- stepmania/src/RageDisplay_OGL.cpp | 34 ++-- stepmania/src/RageDisplay_OGL.h | 8 +- stepmania/src/RageDisplay_OGL_Extensions.cpp | 4 +- stepmania/src/RageDisplay_OGL_Extensions.h | 2 +- stepmania/src/RageFileDriverDeflate.cpp | 8 +- stepmania/src/RageFileDriverDeflate.h | 6 +- stepmania/src/RageInput.cpp | 12 +- stepmania/src/RageInput.h | 6 +- stepmania/src/RageInputDevice.cpp | 12 +- stepmania/src/RageInputDevice.h | 12 +- stepmania/src/RageLog.cpp | 38 ++-- stepmania/src/RageLog.h | 10 +- stepmania/src/RageModelGeometry.cpp | 8 +- stepmania/src/RageModelGeometry.h | 2 +- stepmania/src/RageSound.cpp | 8 +- stepmania/src/RageSound.h | 16 +- stepmania/src/RageSoundManager.cpp | 20 +- stepmania/src/RageSoundManager.h | 8 +- stepmania/src/RageSoundReader.h | 4 +- stepmania/src/RageSoundReader_Chain.cpp | 16 +- stepmania/src/RageSoundReader_Chain.h | 6 +- stepmania/src/RageSoundReader_FileReader.cpp | 12 +- stepmania/src/RageSoundReader_FileReader.h | 6 +- stepmania/src/RageSoundReader_MP3.cpp | 2 +- stepmania/src/RageSoundReader_MP3.h | 4 +- stepmania/src/RageSoundReader_Vorbisfile.cpp | 8 +- stepmania/src/RageSoundReader_Vorbisfile.h | 4 +- stepmania/src/RageSoundReader_WAV.cpp | 16 +- stepmania/src/RageSoundReader_WAV.h | 4 +- stepmania/src/RageSurfaceUtils.cpp | 4 +- stepmania/src/RageSurfaceUtils.h | 4 +- stepmania/src/RageSurface_Load.cpp | 10 +- stepmania/src/RageSurface_Load.h | 2 +- stepmania/src/RageSurface_Load_BMP.cpp | 6 +- stepmania/src/RageSurface_Load_BMP.h | 2 +- stepmania/src/RageSurface_Load_GIF.cpp | 2 +- stepmania/src/RageSurface_Load_GIF.h | 2 +- stepmania/src/RageSurface_Load_JPEG.cpp | 2 +- stepmania/src/RageSurface_Load_JPEG.h | 2 +- stepmania/src/RageSurface_Load_PNG.cpp | 2 +- stepmania/src/RageSurface_Load_PNG.h | 2 +- stepmania/src/RageSurface_Load_XPM.cpp | 16 +- stepmania/src/RageSurface_Load_XPM.h | 2 +- stepmania/src/RageSurface_Save_BMP.cpp | 8 +- stepmania/src/RageTexture.cpp | 4 +- stepmania/src/RageTexture.h | 2 +- stepmania/src/RageTextureID.cpp | 2 +- stepmania/src/RageTextureID.h | 8 +- stepmania/src/RageTextureManager.cpp | 8 +- stepmania/src/RageTypes.h | 2 +- stepmania/src/RageUtil.cpp | 2 +- stepmania/src/RageUtil.h | 2 +- stepmania/src/RageUtil_BackgroundLoader.cpp | 32 ++-- stepmania/src/RageUtil_BackgroundLoader.h | 16 +- stepmania/src/RageUtil_CharConversions.cpp | 28 +-- stepmania/src/RageUtil_CharConversions.h | 2 +- stepmania/src/RageUtil_WorkerThread.cpp | 2 +- stepmania/src/RageUtil_WorkerThread.h | 4 +- stepmania/src/RandomSample.cpp | 8 +- stepmania/src/RandomSample.h | 6 +- stepmania/src/ReceptorArrow.cpp | 4 +- stepmania/src/RollingNumbers.cpp | 4 +- stepmania/src/RollingNumbers.h | 4 +- stepmania/src/RoomWheel.cpp | 12 +- stepmania/src/RoomWheel.h | 22 +-- stepmania/src/SDL_utils.cpp | 8 +- stepmania/src/SDL_utils.h | 4 +- stepmania/src/ScoreDisplayAliveTime.cpp | 6 +- stepmania/src/ScoreDisplayAliveTime.h | 4 +- stepmania/src/ScoreDisplayBattle.cpp | 4 +- stepmania/src/ScoreDisplayBattle.h | 2 +- stepmania/src/ScoreDisplayCalories.cpp | 6 +- stepmania/src/ScoreDisplayCalories.h | 6 +- stepmania/src/ScoreDisplayLifeTime.cpp | 14 +- stepmania/src/ScoreDisplayLifeTime.h | 2 +- stepmania/src/ScoreDisplayNormal.h | 2 +- stepmania/src/ScoreKeeperRave.cpp | 6 +- stepmania/src/Screen.cpp | 6 +- stepmania/src/Screen.h | 12 +- stepmania/src/ScreenAttract.cpp | 2 +- stepmania/src/ScreenAttract.h | 2 +- stepmania/src/ScreenBookkeeping.cpp | 14 +- stepmania/src/ScreenCenterImage.cpp | 6 +- stepmania/src/ScreenDebugOverlay.cpp | 174 +++++++++--------- stepmania/src/ScreenDemonstration.cpp | 4 +- stepmania/src/ScreenEdit.cpp | 54 +++--- stepmania/src/ScreenEditMenu.cpp | 12 +- stepmania/src/ScreenEnding.cpp | 22 +-- stepmania/src/ScreenEvaluation.cpp | 10 +- stepmania/src/ScreenEvaluationMultiplayer.cpp | 2 +- stepmania/src/ScreenExit.cpp | 2 +- stepmania/src/ScreenEz2SelectMusic.h | 4 +- stepmania/src/ScreenGameplay.cpp | 20 +- stepmania/src/ScreenGameplay.h | 8 +- stepmania/src/ScreenGameplayLesson.cpp | 6 +- stepmania/src/ScreenHowToPlay.cpp | 12 +- stepmania/src/ScreenJoinMultiplayer.h | 2 +- stepmania/src/ScreenJukebox.cpp | 2 +- stepmania/src/ScreenManager.cpp | 52 +++--- stepmania/src/ScreenManager.h | 26 +-- stepmania/src/ScreenMapControllers.cpp | 8 +- stepmania/src/ScreenMessage.cpp | 12 +- stepmania/src/ScreenMessage.h | 6 +- stepmania/src/ScreenMiniMenu.cpp | 2 +- stepmania/src/ScreenMiniMenu.h | 18 +- stepmania/src/ScreenMusicScroll.cpp | 4 +- stepmania/src/ScreenNameEntry.cpp | 2 +- stepmania/src/ScreenNameEntry.h | 2 +- stepmania/src/ScreenNameEntryTraditional.cpp | 12 +- stepmania/src/ScreenNetRoom.cpp | 6 +- stepmania/src/ScreenNetRoom.h | 16 +- stepmania/src/ScreenNetSelectBase.cpp | 2 +- stepmania/src/ScreenNetSelectBase.h | 6 +- stepmania/src/ScreenNetSelectMusic.cpp | 6 +- stepmania/src/ScreenNetworkOptions.cpp | 4 +- stepmania/src/ScreenOptions.cpp | 24 +-- stepmania/src/ScreenOptions.h | 6 +- stepmania/src/ScreenOptionsEditCourse.cpp | 2 +- .../src/ScreenOptionsEditCourseEntry.cpp | 12 +- stepmania/src/ScreenOptionsEditProfile.cpp | 2 +- stepmania/src/ScreenOptionsManageCourses.cpp | 10 +- .../src/ScreenOptionsManageEditSteps.cpp | 6 +- stepmania/src/ScreenOptionsManageProfiles.cpp | 32 ++-- stepmania/src/ScreenOptionsManageProfiles.h | 4 +- stepmania/src/ScreenOptionsMaster.cpp | 6 +- stepmania/src/ScreenOptionsMasterPrefs.cpp | 50 ++--- stepmania/src/ScreenOptionsMasterPrefs.h | 14 +- stepmania/src/ScreenOptionsMemoryCard.cpp | 8 +- stepmania/src/ScreenOptionsMemoryCard.h | 2 +- stepmania/src/ScreenPackages.cpp | 36 ++-- stepmania/src/ScreenPackages.h | 24 +-- stepmania/src/ScreenPlayerOptions.cpp | 2 +- stepmania/src/ScreenPrompt.cpp | 8 +- stepmania/src/ScreenPrompt.h | 4 +- stepmania/src/ScreenRanking.cpp | 14 +- stepmania/src/ScreenRanking.h | 6 +- stepmania/src/ScreenReloadSongs.cpp | 2 +- stepmania/src/ScreenSMOnlineLogin.cpp | 22 +-- stepmania/src/ScreenSMOnlineLogin.h | 4 +- stepmania/src/ScreenSaveSync.cpp | 6 +- stepmania/src/ScreenSelect.cpp | 10 +- stepmania/src/ScreenSelect.h | 4 +- stepmania/src/ScreenSelectGroup.cpp | 10 +- stepmania/src/ScreenSelectMaster.cpp | 24 +-- stepmania/src/ScreenSelectMaster.h | 6 +- stepmania/src/ScreenSelectMode.cpp | 10 +- stepmania/src/ScreenSelectMode.h | 2 +- stepmania/src/ScreenSelectMusic.cpp | 18 +- stepmania/src/ScreenSelectMusic.h | 18 +- stepmania/src/ScreenSelectStyle.cpp | 6 +- stepmania/src/ScreenServiceAction.cpp | 104 +++++------ stepmania/src/ScreenSetTime.cpp | 2 +- stepmania/src/ScreenStatsOverlay.cpp | 4 +- stepmania/src/ScreenStatsOverlay.h | 2 +- stepmania/src/ScreenSyncOverlay.cpp | 2 +- stepmania/src/ScreenSystemLayer.cpp | 12 +- stepmania/src/ScreenSystemLayer.h | 4 +- stepmania/src/ScreenTestFonts.cpp | 8 +- stepmania/src/ScreenTestFonts.h | 6 +- stepmania/src/ScreenTestInput.cpp | 16 +- stepmania/src/ScreenTestLights.cpp | 4 +- stepmania/src/ScreenTestSound.cpp | 4 +- stepmania/src/ScreenTextEntry.cpp | 36 ++-- stepmania/src/ScreenTextEntry.h | 16 +- stepmania/src/ScreenTitleMenu.cpp | 4 +- stepmania/src/ScreenTitleMenu.h | 2 +- stepmania/src/ScreenUnlock.cpp | 28 +-- stepmania/src/ScreenWithMenuElements.cpp | 6 +- stepmania/src/ScreenWithMenuElements.h | 2 +- stepmania/src/ScrollingList.cpp | 4 +- stepmania/src/ScrollingList.h | 4 +- stepmania/src/Song.cpp | 126 ++++++------- stepmania/src/SongCacheIndex.cpp | 14 +- stepmania/src/SongCacheIndex.h | 8 +- stepmania/src/SongManager.cpp | 136 +++++++------- stepmania/src/SongManager.h | 58 +++--- stepmania/src/SongOptions.cpp | 16 +- stepmania/src/SongOptions.h | 4 +- stepmania/src/SongUtil.cpp | 50 ++--- stepmania/src/SongUtil.h | 10 +- stepmania/src/Sprite.cpp | 22 +-- stepmania/src/Sprite.h | 6 +- stepmania/src/StageStats.cpp | 2 +- stepmania/src/StdString.h | 14 +- stepmania/src/StepMania.cpp | 72 ++++---- stepmania/src/StepMania.h | 2 +- stepmania/src/Steps.cpp | 12 +- stepmania/src/Steps.h | 22 +-- stepmania/src/StepsUtil.cpp | 8 +- stepmania/src/StepsUtil.h | 4 +- stepmania/src/StreamDisplay.cpp | 8 +- stepmania/src/StreamDisplay.h | 6 +- stepmania/src/StyleUtil.h | 4 +- stepmania/src/TextBanner.cpp | 20 +- stepmania/src/TextBanner.h | 10 +- stepmania/src/TimingData.h | 2 +- stepmania/src/TitleSubstitution.cpp | 24 +-- stepmania/src/TitleSubstitution.h | 16 +- stepmania/src/Trail.h | 2 +- stepmania/src/TrailUtil.cpp | 6 +- stepmania/src/TrailUtil.h | 2 +- stepmania/src/Transition.cpp | 4 +- stepmania/src/Transition.h | 4 +- stepmania/src/UnlockManager.cpp | 20 +- stepmania/src/UnlockManager.h | 6 +- stepmania/src/WheelBase.cpp | 6 +- stepmania/src/WheelBase.h | 6 +- stepmania/src/WheelItemBase.cpp | 6 +- stepmania/src/WheelItemBase.h | 8 +- .../src/arch/ArchHooks/ArchHooks_Unix.cpp | 12 +- stepmania/src/arch/ArchHooks/ArchHooks_Unix.h | 2 +- .../arch/ArchHooks/ArchHooks_Win32Static.cpp | 2 +- .../src/arch/ArchHooks/ArchHooks_Xbox.cpp | 2 +- stepmania/src/arch/ArchHooks/ArchHooks_Xbox.h | 2 +- .../src/arch/ArchHooks/ArchHooks_darwin.cpp | 8 +- .../src/arch/Dialog/DialogDriver_Cocoa.cpp | 10 +- .../src/arch/Dialog/DialogDriver_Cocoa.h | 8 +- .../src/arch/InputHandler/InputHandler.cpp | 2 +- .../src/arch/InputHandler/InputHandler.h | 4 +- .../arch/InputHandler/InputHandler_Carbon.cpp | 6 +- .../arch/InputHandler/InputHandler_Carbon.h | 2 +- .../InputHandler/InputHandler_DirectInput.cpp | 2 +- .../InputHandler/InputHandler_DirectInput.h | 2 +- .../InputHandler_Linux_Joystick.cpp | 2 +- .../InputHandler_Linux_Joystick.h | 4 +- .../InputHandler/InputHandler_Linux_tty.cpp | 2 +- .../InputHandler/InputHandler_Linux_tty.h | 2 +- .../InputHandler_MonkeyKeyboard.cpp | 2 +- .../InputHandler_MonkeyKeyboard.h | 2 +- .../arch/InputHandler/InputHandler_SDL.cpp | 2 +- .../src/arch/InputHandler/InputHandler_SDL.h | 2 +- .../InputHandler/InputHandler_Win32_MIDI.cpp | 4 +- .../InputHandler/InputHandler_Win32_MIDI.h | 2 +- .../InputHandler/InputHandler_Win32_Para.cpp | 2 +- .../InputHandler/InputHandler_Win32_Para.h | 2 +- .../InputHandler/InputHandler_Win32_Pump.cpp | 4 +- .../InputHandler/InputHandler_Win32_Pump.h | 4 +- .../arch/InputHandler/InputHandler_X11.cpp | 2 +- .../src/arch/InputHandler/InputHandler_X11.h | 2 +- .../arch/InputHandler/InputHandler_Xbox.cpp | 2 +- .../src/arch/InputHandler/InputHandler_Xbox.h | 2 +- .../Lights/LightsDriver_LinuxParallel.cpp | 2 +- .../Lights/LightsDriver_SystemMessage.cpp | 2 +- .../src/arch/LoadingWindow/LoadingWindow.h | 4 +- .../arch/LoadingWindow/LoadingWindow_Cocoa.h | 4 +- .../arch/LoadingWindow/LoadingWindow_Gtk.cpp | 4 +- .../arch/LoadingWindow/LoadingWindow_Gtk.h | 4 +- .../arch/LoadingWindow/LoadingWindow_Null.h | 2 +- .../LoadingWindow/LoadingWindow_Win32.cpp | 8 +- .../arch/LoadingWindow/LoadingWindow_Win32.h | 4 +- .../arch/LoadingWindow/LoadingWindow_Xbox.cpp | 18 +- .../arch/LoadingWindow/LoadingWindow_Xbox.h | 4 +- .../src/arch/LowLevelWindow/LowLevelWindow.h | 6 +- .../LowLevelWindow/LowLevelWindow_Cocoa.h | 4 +- .../LowLevelWindow/LowLevelWindow_SDL.cpp | 6 +- .../arch/LowLevelWindow/LowLevelWindow_SDL.h | 4 +- .../LowLevelWindow/LowLevelWindow_Win32.cpp | 12 +- .../LowLevelWindow/LowLevelWindow_Win32.h | 6 +- .../LowLevelWindow/LowLevelWindow_X11.cpp | 6 +- .../arch/LowLevelWindow/LowLevelWindow_X11.h | 6 +- .../src/arch/MemoryCard/MemoryCardDriver.cpp | 4 +- .../src/arch/MemoryCard/MemoryCardDriver.h | 22 +-- .../MemoryCardDriverThreaded_Linux.cpp | 36 ++-- .../MemoryCardDriverThreaded_Linux.h | 2 +- .../MemoryCardDriverThreaded_OSX.cpp | 22 +-- .../MemoryCardDriverThreaded_Windows.cpp | 8 +- .../src/arch/MovieTexture/MovieTexture.cpp | 6 +- .../src/arch/MovieTexture/MovieTexture.h | 4 +- .../arch/MovieTexture/MovieTexture_DShow.cpp | 24 +-- .../arch/MovieTexture/MovieTexture_DShow.h | 6 +- .../arch/MovieTexture/MovieTexture_FFMpeg.cpp | 12 +- .../MovieTexture/MovieTexture_Generic.cpp | 8 +- .../arch/MovieTexture/MovieTexture_Generic.h | 4 +- .../arch/MovieTexture/MovieTexture_Theora.cpp | 48 ++--- stepmania/src/arch/Sound/ALSA9Dynamic.cpp | 6 +- stepmania/src/arch/Sound/ALSA9Dynamic.h | 2 +- stepmania/src/arch/Sound/ALSA9Helpers.cpp | 14 +- stepmania/src/arch/Sound/ALSA9Helpers.h | 4 +- stepmania/src/arch/Sound/DSoundHelpers.cpp | 18 +- stepmania/src/arch/Sound/DSoundHelpers.h | 4 +- stepmania/src/arch/Sound/RageSoundDriver.h | 2 +- .../src/arch/Sound/RageSoundDriver_ALSA9.cpp | 10 +- .../src/arch/Sound/RageSoundDriver_ALSA9.h | 2 +- .../Sound/RageSoundDriver_ALSA9_Software.cpp | 6 +- .../Sound/RageSoundDriver_ALSA9_Software.h | 2 +- .../src/arch/Sound/RageSoundDriver_CA.cpp | 4 +- stepmania/src/arch/Sound/RageSoundDriver_CA.h | 2 +- .../src/arch/Sound/RageSoundDriver_DSound.cpp | 8 +- .../src/arch/Sound/RageSoundDriver_DSound.h | 2 +- .../Sound/RageSoundDriver_DSound_Software.cpp | 6 +- .../Sound/RageSoundDriver_DSound_Software.h | 2 +- .../src/arch/Sound/RageSoundDriver_OSS.cpp | 6 +- .../src/arch/Sound/RageSoundDriver_OSS.h | 4 +- .../arch/Sound/RageSoundDriver_WaveOut.cpp | 8 +- .../src/arch/Sound/RageSoundDriver_WaveOut.h | 2 +- stepmania/src/arch/arch.cpp | 40 ++-- stepmania/src/arch/arch.h | 6 +- .../src/archutils/Unix/AssertionHandler.cpp | 2 +- .../src/archutils/Unix/BacktraceNames.cpp | 16 +- stepmania/src/archutils/Unix/BacktraceNames.h | 6 +- stepmania/src/archutils/Unix/CrashHandler.cpp | 2 +- stepmania/src/archutils/Unix/CrashHandler.h | 2 +- .../src/archutils/Unix/CrashHandlerChild.cpp | 12 +- stepmania/src/archutils/Unix/GetSysInfo.cpp | 4 +- stepmania/src/archutils/Unix/GetSysInfo.h | 2 +- .../src/archutils/Unix/LinuxThreadHelpers.cpp | 2 +- .../src/archutils/Unix/LinuxThreadHelpers.h | 2 +- stepmania/src/archutils/Win32/Crash.cpp | 2 +- stepmania/src/archutils/Win32/Crash.h | 2 +- .../src/archutils/Win32/DebugInfoHunt.cpp | 26 +-- .../archutils/Win32/GetFileInformation.cpp | 16 +- .../src/archutils/Win32/GetFileInformation.h | 6 +- stepmania/src/archutils/Win32/GotoURL.cpp | 4 +- stepmania/src/archutils/Win32/GotoURL.h | 2 +- .../src/archutils/Win32/GraphicsWindow.cpp | 20 +- .../src/archutils/Win32/GraphicsWindow.h | 2 +- stepmania/src/archutils/Win32/SpecialDirs.cpp | 6 +- stepmania/src/archutils/Win32/USB.cpp | 10 +- stepmania/src/archutils/Win32/USB.h | 2 +- .../src/archutils/Win32/VideoDriverInfo.cpp | 18 +- .../src/archutils/Win32/VideoDriverInfo.h | 14 +- stepmania/src/archutils/Win32/WindowIcon.cpp | 4 +- stepmania/src/archutils/Win32/WindowIcon.h | 2 +- .../src/archutils/Xbox/GraphicsWindow.cpp | 4 +- stepmania/src/archutils/Xbox/GraphicsWindow.h | 2 +- stepmania/src/crypto/CryptRSA.cpp | 28 +-- stepmania/src/crypto/CryptRSA.h | 18 +- stepmania/src/crypto/CryptRand.cpp | 2 +- stepmania/src/crypto/CryptRand.h | 2 +- stepmania/src/ezsockets.h | 2 +- stepmania/src/global.h | 3 - stepmania/src/song.h | 78 ++++---- stepmania/src/tests/test_audio_readers.cpp | 2 +- stepmania/src/tests/test_file_errors.cpp | 40 ++-- stepmania/src/tests/test_file_readers.cpp | 32 ++-- stepmania/src/tests/test_misc.cpp | 4 +- 578 files changed, 3943 insertions(+), 3946 deletions(-) diff --git a/stepmania/src/ActiveAttackList.cpp b/stepmania/src/ActiveAttackList.cpp index 694c85d856..0bb3f39692 100644 --- a/stepmania/src/ActiveAttackList.cpp +++ b/stepmania/src/ActiveAttackList.cpp @@ -34,7 +34,7 @@ void ActiveAttackList::Refresh() { const AttackArray& attacks = m_pPlayerState->m_ActiveAttacks; - vector vsThemedMods; + vector vsThemedMods; for( unsigned i=0; iSetText( s ); // BitmapText will not rebuild vertices if these strings are the same. } diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 72a0b4706a..b587b83d6f 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -92,7 +92,7 @@ void Actor::InitDefaults() UnsubcribeAndClearCommands(); } -static bool GetMessageNameFromCommandName( const CString &sCommandName, CString &sMessageNameOut ) +static bool GetMessageNameFromCommandName( const RString &sCommandName, RString &sMessageNameOut ) { if( sCommandName.Right(7) == "Message" ) { @@ -107,7 +107,7 @@ static bool GetMessageNameFromCommandName( const CString &sCommandName, CString void Actor::UnsubcribeAndClearCommands() { - FOREACH_CONST( CString, m_vsSubscribedTo, s ) + FOREACH_CONST( RString, m_vsSubscribedTo, s ) MESSAGEMAN->Unsubscribe( this, *s ); m_vsSubscribedTo.clear(); } @@ -191,14 +191,14 @@ Actor::Actor( const Actor &cpy ): * initialization (eg. ActorFrame loading children). However, it * also loads input variables, which should happen first. The * former is more important. */ -void Actor::LoadFromNode( const CString& sDir, const XNode* pNode ) +void Actor::LoadFromNode( const RString& sDir, const XNode* pNode ) { FOREACH_CONST_Child( pNode, pChild ) { if( pChild->m_sName == "Input" ) { /* If parameters are specified here, save their values to the actor. */ - CString sName; + RString sName; if( !pChild->GetAttrValue( "Name", sName ) ) RageException::Throw( ssprintf("Input node in '%s' is missing the attribute 'Name'", sDir.c_str()) ); @@ -222,8 +222,8 @@ void Actor::LoadFromNode( const CString& sDir, const XNode* pNode ) FOREACH_CONST_Attr( pNode, pAttr ) { // Load Name, if any. - const CString &sKeyName = pAttr->first; - const CString &sValue = pAttr->second; + const RString &sKeyName = pAttr->first; + const RString &sValue = pAttr->second; if( sKeyName == "Name" ) { m_sName = sValue; @@ -244,7 +244,7 @@ void Actor::LoadFromNode( const CString& sDir, const XNode* pNode ) { apActorCommands apac( new ActorCommands( sValue ) ); - CString sCmdName = sKeyName.Left( sKeyName.size()-7 ); + RString sCmdName = sKeyName.Left( sKeyName.size()-7 ); AddCommand( sCmdName, apac ); } } @@ -254,14 +254,14 @@ void Actor::LoadFromNode( const CString& sDir, const XNode* pNode ) // FOREACH_CONST_Child( pNode, c ) { - CString sKeyName = c->m_sName; + RString sKeyName = c->m_sName; if( sKeyName != "Command" ) continue; /* not a command */ - CString sName; + RString sName; c->GetAttrValue( "Name", sName ); - CString sValue; + RString sValue; c->GetAttrValue( "Value", sValue ); LuaHelpers::RunAtExpressionS( sName ); @@ -277,7 +277,7 @@ void Actor::LoadFromNode( const CString& sDir, const XNode* pNode ) /* Like RTTI: return true if this actor is an sType (or derived from sType). * This uses the Lua binding check, so only works on bound types. */ -bool Actor::IsType( const CString &sType ) +bool Actor::IsType( const RString &sType ) { Lua *L = LUA->Get(); this->PushSelf( L ); @@ -744,7 +744,7 @@ void Actor::BeginTweening( float time, TweenType tt ) // recursing ActorCommand. if( m_Tweens.size() > 50 ) { - CString sError = ssprintf( "Tween overflow: size = %u. infinitely recursing ActorCommand?", unsigned(m_Tweens.size()) ); + RString sError = ssprintf( "Tween overflow: size = %u. infinitely recursing ActorCommand?", unsigned(m_Tweens.size()) ); LOG->Warn( sError ); Dialog::OK( sError ); FinishTweening(); @@ -837,7 +837,7 @@ void Actor::ScaleTo( const RectF &rect, StretchType st ) SetZoom( fNewZoom ); } -void Actor::SetHorizAlignString( const CString &s ) +void Actor::SetHorizAlignString( const RString &s ) { if (s.CompareNoCase("left")==0) this->SetHorizAlign( align_left ); /* call derived */ else if(s.CompareNoCase("center")==0) this->SetHorizAlign( align_center ); @@ -845,7 +845,7 @@ void Actor::SetHorizAlignString( const CString &s ) else ASSERT(0); } -void Actor::SetVertAlignString( const CString &s ) +void Actor::SetVertAlignString( const RString &s ) { if (s.CompareNoCase("top")==0) this->SetVertAlign( align_top ); /* call derived */ else if(s.CompareNoCase("middle")==0) this->SetVertAlign( align_middle ); @@ -853,7 +853,7 @@ void Actor::SetVertAlignString( const CString &s ) else ASSERT(0); } -void Actor::SetEffectClockString( const CString &s ) +void Actor::SetEffectClockString( const RString &s ) { if (s.CompareNoCase("timer")==0) this->SetEffectClock( CLOCK_TIMER ); else if(s.CompareNoCase("beat")==0) this->SetEffectClock( CLOCK_BGM_BEAT ); @@ -917,7 +917,7 @@ void Actor::SetEffectTiming( float fRampUp, float fAtHalf, float fRampDown, floa // effect "macros" -void Actor::SetEffectLua( const CString &sCommand ) +void Actor::SetEffectLua( const RString &sCommand ) { m_Effect = effect_lua; m_sEffectCommand = sCommand; @@ -1208,7 +1208,7 @@ void Actor::TweenState::MakeWeightedAverage( TweenState& average_out, const Twee average_out.aux = ts1.aux + (ts2.aux - ts1.aux )*fPercentBetween; } -void Actor::SetBlendModeString( const CString &s ) +void Actor::SetBlendModeString( const RString &s ) { if (s.CompareNoCase("normal")==0) this->SetBlendMode( BLEND_NORMAL ); else if(s.CompareNoCase("add")==0) this->SetBlendMode( BLEND_ADD ); @@ -1216,7 +1216,7 @@ void Actor::SetBlendModeString( const CString &s ) else ASSERT(0); } -void Actor::SetCullModeString( const CString &s ) +void Actor::SetCullModeString( const RString &s ) { if (s.CompareNoCase("back")==0) this->SetCullMode( CULL_BACK ); else if(s.CompareNoCase("front")==0) this->SetCullMode( CULL_FRONT ); @@ -1224,7 +1224,7 @@ void Actor::SetCullModeString( const CString &s ) else ASSERT(0); } -void Actor::SetZTestModeString( const CString &s ) +void Actor::SetZTestModeString( const RString &s ) { // for metrics backward compatibility if(s.CompareNoCase("off")==0) this->SetZTestMode( ZTEST_OFF ); @@ -1239,14 +1239,14 @@ void Actor::Sleep( float time ) BeginTweening( 0, TWEEN_LINEAR ); } -void Actor::QueueCommand( const CString& sCommandName ) +void Actor::QueueCommand( const RString& sCommandName ) { BeginTweening( 0, TWEEN_LINEAR ); TweenInfo &TI = m_Tweens.back()->info; TI.m_sCommandName = sCommandName; } -void Actor::QueueMessage( const CString& sMessageName ) +void Actor::QueueMessage( const RString& sMessageName ) { // Hack: use "!" as a marker to broadcast a command, instead of playing a // command, so we don't have to add yet another element to every tween @@ -1256,15 +1256,15 @@ void Actor::QueueMessage( const CString& sMessageName ) TI.m_sCommandName = "!" + sMessageName; } -void Actor::AddCommand( const CString &sCmdName, apActorCommands apac ) +void Actor::AddCommand( const RString &sCmdName, apActorCommands apac ) { if( HasCommand(sCmdName) ) { - CString sWarning = m_sName+"'s command '"+sCmdName+"' defined twice"; + RString sWarning = m_sName+"'s command '"+sCmdName+"' defined twice"; Dialog::OK( sWarning, "COMMAND_DEFINED_TWICE" ); } - CString sMessage; + RString sMessage; if( GetMessageNameFromCommandName(sCmdName, sMessage) ) { SubscribeToMessage( sMessage ); @@ -1276,22 +1276,22 @@ void Actor::AddCommand( const CString &sCmdName, apActorCommands apac ) } } -bool Actor::HasCommand( const CString &sCmdName ) +bool Actor::HasCommand( const RString &sCmdName ) { - map::const_iterator it = m_mapNameToCommands.find( sCmdName ); + map::const_iterator it = m_mapNameToCommands.find( sCmdName ); return it != m_mapNameToCommands.end(); } -const apActorCommands& Actor::GetCommand( const CString &sCommandName ) const +const apActorCommands& Actor::GetCommand( const RString &sCommandName ) const { - map::const_iterator it = m_mapNameToCommands.find( sCommandName ); + map::const_iterator it = m_mapNameToCommands.find( sCommandName ); ASSERT( it != m_mapNameToCommands.end() ); return it->second; } -void Actor::PlayCommand( const CString &sCommandName, Actor *pParent ) +void Actor::PlayCommand( const RString &sCommandName, Actor *pParent ) { - map::const_iterator it = m_mapNameToCommands.find( sCommandName ); + map::const_iterator it = m_mapNameToCommands.find( sCommandName ); if( it == m_mapNameToCommands.end() ) return; @@ -1299,12 +1299,12 @@ void Actor::PlayCommand( const CString &sCommandName, Actor *pParent ) RunCommands( *it->second ); } -void Actor::HandleMessage( const CString& sMessage ) +void Actor::HandleMessage( const RString& sMessage ) { PlayCommand( sMessage ); } -void Actor::SubscribeToMessage( const CString &sMessageName ) +void Actor::SubscribeToMessage( const RString &sMessageName ) { MESSAGEMAN->Subscribe( this, sMessageName ); m_vsSubscribedTo.push_back( sMessageName ); diff --git a/stepmania/src/Actor.h b/stepmania/src/Actor.h index 1b9d71cb65..18b4a184de 100644 --- a/stepmania/src/Actor.h +++ b/stepmania/src/Actor.h @@ -30,8 +30,8 @@ public: virtual ~Actor(); virtual Actor *Copy() const; void UnsubcribeAndClearCommands(); - virtual void LoadFromNode( const CString& sDir, const XNode* pNode ); - bool IsType( const CString &sType ); + virtual void LoadFromNode( const RString& sDir, const XNode* pNode ); + bool IsType( const RString &sType ); static void SetBGMTime( float fTime, float fBeat ); static void SetBGMLight( int iLightNumber, float fCabinetLights ); @@ -98,8 +98,8 @@ public: virtual void UpdateInternal( float fDeltaTime ); // override this void UpdateTweening( float fDeltaTime ); - const CString &GetName() const { return m_sName; } - virtual void SetName( const CString &sName ) { m_sName = sName; } + const RString &GetName() const { return m_sName; } + virtual void SetName( const RString &sName ) { m_sName = sName; } float GetX() const { return m_current.pos.x; }; float GetY() const { return m_current.pos.y; }; @@ -202,8 +202,8 @@ public: void BeginTweening( float time, TweenType tt = TWEEN_LINEAR ); void StopTweening(); void Sleep( float time ); - void QueueCommand( const CString& sCommandName ); - void QueueMessage( const CString& sMessageName ); + void QueueCommand( const RString& sCommandName ); + void QueueMessage( const RString& sMessageName ); virtual void FinishTweening(); virtual void HurryTweening( float factor ); // Let ActorFrame and BGAnimation override @@ -234,11 +234,11 @@ public: // enum HorizAlign { align_left, align_center, align_right }; virtual void SetHorizAlign( HorizAlign ha ) { m_HorizAlign = ha; } - virtual void SetHorizAlignString( const CString &s ); // convenience + virtual void SetHorizAlignString( const RString &s ); // convenience enum VertAlign { align_top, align_middle, align_bottom }; virtual void SetVertAlign( VertAlign va ) { m_VertAlign = va; } - virtual void SetVertAlignString( const CString &s ); // convenience + virtual void SetVertAlignString( const RString &s ); // convenience // @@ -256,12 +256,12 @@ public: void SetEffectTiming( float fRampUp, float fAtHalf, float fRampDown, float fAtZero ); void SetEffectOffset( float fTime ) { m_fEffectOffset = fTime; } void SetEffectClock( EffectClock c ) { m_EffectClock = c; } - void SetEffectClockString( const CString &s ); // convenience + void SetEffectClockString( const RString &s ); // convenience void SetEffectMagnitude( RageVector3 vec ) { m_vEffectMagnitude = vec; } RageVector3 GetEffectMagnitude() const { return m_vEffectMagnitude; } - void SetEffectLua( const CString &sCommand ); + void SetEffectLua( const RString &sCommand ); void SetEffectDiffuseBlink( float fEffectPeriodSeconds = 1.0f, RageColor c1 = RageColor(0.5f,0.5f,0.5f,1), @@ -320,16 +320,16 @@ public: // render states // void SetBlendMode( BlendMode mode ) { m_BlendMode = mode; } - void SetBlendModeString( const CString &s ); // convenience + void SetBlendModeString( const RString &s ); // convenience void SetTextureWrapping( bool b ) { m_bTextureWrapping = b; } void SetClearZBuffer( bool b ) { m_bClearZBuffer = b; } void SetUseZBuffer( bool b ) { SetZTestMode(b?ZTEST_WRITE_ON_PASS:ZTEST_OFF); SetZWrite(b); } virtual void SetZTestMode( ZTestMode mode ) { m_ZTestMode = mode; } - void SetZTestModeString( const CString &s ); // convenience + void SetZTestModeString( const RString &s ); // convenience virtual void SetZWrite( bool b ) { m_bZWrite = b; } void SetZBias( float f ) { m_fZBias = f; } virtual void SetCullMode( CullMode mode ) { m_CullMode = mode; } - void SetCullModeString( const CString &s ); // convenience + void SetCullModeString( const RString &s ); // convenience // // Lua @@ -339,10 +339,10 @@ public: // // Commands // - void AddCommand( const CString &sCmdName, apActorCommands apac ); - bool HasCommand( const CString &sCmdName ); - const apActorCommands& GetCommand( const CString &sCommandName ) const; - virtual void PlayCommand( const CString &sCommandName, Actor *pParent = NULL ); + void AddCommand( const RString &sCmdName, apActorCommands apac ); + bool HasCommand( const RString &sCmdName ); + const apActorCommands& GetCommand( const RString &sCommandName ) const; + virtual void PlayCommand( const RString &sCommandName, Actor *pParent = NULL ); virtual void RunCommands( const LuaReference& cmds, Actor *pParent = NULL ); void RunCommands( const apActorCommands& cmds, Actor *pParent = NULL ) { this->RunCommands( *cmds, pParent ); } // convenience // If we're a leaf, then execute this command. @@ -355,8 +355,8 @@ public: // Messages // void SubscribeToMessage( Message message ); // will automatically unsubscribe - void SubscribeToMessage( const CString &sMessageName ); // will automatically unsubscribe - virtual void HandleMessage( const CString& sMessage ); + void SubscribeToMessage( const RString &sMessageName ); // will automatically unsubscribe + virtual void HandleMessage( const RString& sMessage ); // @@ -371,7 +371,7 @@ public: HiddenPtr m_pLuaInstance; protected: - CString m_sName; + RString m_sName; struct TweenInfo { @@ -379,7 +379,7 @@ protected: TweenType m_TweenType; float m_fTimeLeftInTween; // how far into the tween are we? float m_fTweenTime; // seconds between Start and End positions/zooms - CString m_sCommandName; // command to execute when this TweenState goes into effect + RString m_sCommandName; // command to execute when this TweenState goes into effect }; @@ -416,7 +416,7 @@ protected: // Stuff for effects // Effect m_Effect; - CString m_sEffectCommand; // effect_lua + RString m_sEffectCommand; // effect_lua float m_fSecsIntoEffect, m_fEffectDelta; // units depend on m_EffectClock @@ -467,8 +467,8 @@ private: // // commands // - map m_mapNameToCommands; - vector m_vsSubscribedTo; + map m_mapNameToCommands; + vector m_vsSubscribedTo; }; #endif diff --git a/stepmania/src/ActorCommands.cpp b/stepmania/src/ActorCommands.cpp index e04aba17ef..90b0acbcdc 100644 --- a/stepmania/src/ActorCommands.cpp +++ b/stepmania/src/ActorCommands.cpp @@ -7,7 +7,7 @@ #include #include "LuaBinding.h" -ActorCommands::ActorCommands( const CString &sCommands ) +ActorCommands::ActorCommands( const RString &sCommands ) { if( sCommands.size() > 0 && sCommands[0] == '\033' ) { @@ -34,7 +34,7 @@ ActorCommands::ActorCommands( const CString &sCommands ) FOREACH_CONST( Command, cmds.v, c ) { const Command& cmd = (*c); - CString sName = cmd.GetName(); + RString sName = cmd.GetName(); TrimLeft( sName ); TrimRight( sName ); s << "\tself:" << sName << "("; @@ -52,7 +52,7 @@ ActorCommands::ActorCommands( const CString &sCommands ) for( unsigned i=1; i "200" if( sArg[0] == '+' ) @@ -95,7 +95,7 @@ void ActorCommands::Register() { Lua *L = LUA->Get(); - CString sError; + RString sError; if( !LuaHelpers::RunScript( L, m_sLuaFunction, "in", sError, 1 ) ) { FAIL_M( ssprintf("Compiling \"%s\": %s", m_sLuaFunction.c_str(), sError.c_str()) ); diff --git a/stepmania/src/ActorCommands.h b/stepmania/src/ActorCommands.h index 010e7710e0..73b4f76ded 100644 --- a/stepmania/src/ActorCommands.h +++ b/stepmania/src/ActorCommands.h @@ -11,11 +11,11 @@ class ActorCommands: public LuaReference { public: - ActorCommands( const CString &sCommands ); + ActorCommands( const RString &sCommands ); private: void Register(); - CString m_sLuaFunction; + RString m_sLuaFunction; }; typedef AutoPtrCopyOnWrite apActorCommands; diff --git a/stepmania/src/ActorFrame.cpp b/stepmania/src/ActorFrame.cpp index c0827b599f..b0ae805843 100644 --- a/stepmania/src/ActorFrame.cpp +++ b/stepmania/src/ActorFrame.cpp @@ -67,7 +67,7 @@ ActorFrame::ActorFrame( const ActorFrame &cpy ): } } -void ActorFrame::LoadFromNode( const CString& sDir, const XNode* pNode ) +void ActorFrame::LoadFromNode( const RString& sDir, const XNode* pNode ) { if( AutoLoadChildren() ) LoadChildrenFromNode( sDir, pNode ); @@ -77,7 +77,7 @@ void ActorFrame::LoadFromNode( const CString& sDir, const XNode* pNode ) pNode->GetAttrValue( "UpdateRate", m_fUpdateRate ); pNode->GetAttrValue( "FOV", m_fFOV ); - CString s; + RString s; if( pNode->GetAttrValue( "VanishX", s ) ) m_fVanishX = LuaHelpers::RunExpressionF( s ); if( pNode->GetAttrValue( "VanishY", s ) ) @@ -85,7 +85,7 @@ void ActorFrame::LoadFromNode( const CString& sDir, const XNode* pNode ) m_bOverrideLighting = pNode->GetAttrValue( "Lighting", m_bLighting ); } -void ActorFrame::LoadChildrenFromNode( const CString& sDir, const XNode* pNode ) +void ActorFrame::LoadChildrenFromNode( const RString& sDir, const XNode* pNode ) { // Shouldn't be calling this unless we're going to delete our children. ASSERT( m_bDeleteChildren ); @@ -127,7 +127,7 @@ void ActorFrame::RemoveChild( Actor* pActor ) m_SubActors.erase( iter ); } -Actor* ActorFrame::GetChild( const CString &sName ) +Actor* ActorFrame::GetChild( const RString &sName ) { FOREACH( Actor*, m_SubActors, a ) { @@ -340,7 +340,7 @@ void ActorFrame::SetPropagateCommands( bool b ) m_bPropagateCommands = b; } -void ActorFrame::PlayCommand( const CString &sCommandName, Actor* pParent ) +void ActorFrame::PlayCommand( const RString &sCommandName, Actor* pParent ) { Actor::PlayCommand( sCommandName, pParent ); diff --git a/stepmania/src/ActorFrame.h b/stepmania/src/ActorFrame.h index e52f4d1762..a7be826b58 100644 --- a/stepmania/src/ActorFrame.h +++ b/stepmania/src/ActorFrame.h @@ -12,12 +12,12 @@ public: ActorFrame( const ActorFrame &cpy ); virtual ~ActorFrame(); - void LoadFromNode( const CString& sDir, const XNode* pNode ); + void LoadFromNode( const RString& sDir, const XNode* pNode ); virtual Actor *Copy() const; virtual void AddChild( Actor* pActor ); virtual void RemoveChild( Actor* pActor ); - Actor* GetChild( const CString &sName ); + Actor* GetChild( const RString &sName ); int GetNumChildren() const { return m_SubActors.size(); } void RemoveAllChildren(); @@ -60,12 +60,12 @@ public: /* Amount of time until all tweens (and all children's tweens) have stopped: */ virtual float GetTweenTimeLeft() const; - virtual void PlayCommand( const CString &sCommandName, Actor* pParent = NULL ); + virtual void PlayCommand( const RString &sCommandName, Actor* pParent = NULL ); virtual void RunCommands( const LuaReference& cmds, Actor* pParent = NULL ); void RunCommands( const apActorCommands& cmds, Actor *pParent = NULL ) { this->RunCommands( *cmds, pParent ); } // convenience protected: - void LoadChildrenFromNode( const CString& sDir, const XNode* pNode ); + void LoadChildrenFromNode( const RString& sDir, const XNode* pNode ); vector m_SubActors; bool m_bPropagateCommands; diff --git a/stepmania/src/ActorScroller.cpp b/stepmania/src/ActorScroller.cpp index cb0a53e40e..2b3202eb1c 100644 --- a/stepmania/src/ActorScroller.cpp +++ b/stepmania/src/ActorScroller.cpp @@ -56,7 +56,7 @@ void ActorScroller::Load2( LUA->Release( L ); } -void ActorScroller::SetTransformFromExpression( const CString &sTransformFunction ) +void ActorScroller::SetTransformFromExpression( const RString &sTransformFunction ) { m_exprTransformFunction.SetFromExpression( sTransformFunction ); } @@ -96,20 +96,20 @@ float ActorScroller::GetSecondsForCompleteScrollThrough() const return fTotalItems * (m_fSecondsPerItem + m_fSecondsPauseBetweenItems ); } -void ActorScroller::LoadFromNode( const CString &sDir, const XNode *pNode ) +void ActorScroller::LoadFromNode( const RString &sDir, const XNode *pNode ) { ActorFrame::LoadFromNode( sDir, pNode ); #define GET_VALUE( szName, valueOut ) \ if( !pNode->GetAttrValue( szName, valueOut ) ) { \ - CString sError = ssprintf("ActorScroller in '%s' is missing the value Scroller::%s", sDir.c_str(), szName); \ + RString sError = ssprintf("ActorScroller in '%s' is missing the value Scroller::%s", sDir.c_str(), szName); \ LOG->Warn( sError ); \ Dialog::OK( sError ); \ } float fSecondsPerItem = 0; float fNumItemsToDraw = 0; - CString sTransformFunction; + RString sTransformFunction; int iSubdivisions = 1; GET_VALUE( "SecondsPerItem", fSecondsPerItem ); diff --git a/stepmania/src/ActorScroller.h b/stepmania/src/ActorScroller.h index 910d102728..a38c62452a 100644 --- a/stepmania/src/ActorScroller.h +++ b/stepmania/src/ActorScroller.h @@ -13,7 +13,7 @@ class ActorScroller : public ActorFrame public: ActorScroller(); - void SetTransformFromExpression( const CString &sTransformFunction ); + void SetTransformFromExpression( const RString &sTransformFunction ); void SetTransformFromHeight( float fItemHeight ); void Load2( @@ -28,7 +28,7 @@ public: void PositionItems(); - void LoadFromNode( const CString &sDir, const XNode *pNode ); + void LoadFromNode( const RString &sDir, const XNode *pNode ); virtual Actor *Copy() const; void SetDestinationItem( float fItemIndex ) { m_fDestinationItem = fItemIndex; } diff --git a/stepmania/src/ActorSound.cpp b/stepmania/src/ActorSound.cpp index a0c44a46de..8019dc04a9 100644 --- a/stepmania/src/ActorSound.cpp +++ b/stepmania/src/ActorSound.cpp @@ -8,7 +8,7 @@ REGISTER_ACTOR_CLASS_WITH_NAME( ActorSound, Sound ) -void ActorSound::Load( const CString &sPath ) +void ActorSound::Load( const RString &sPath ) { m_Sound.Load( sPath, true ); } @@ -18,17 +18,17 @@ void ActorSound::Play() SOUNDMAN->PlayCopyOfSound( m_Sound ); } -void ActorSound::LoadFromNode( const CString& sDir, const XNode* pNode ) +void ActorSound::LoadFromNode( const RString& sDir, const XNode* pNode ) { Actor::LoadFromNode( sDir, pNode ); - CString sFile; + RString sFile; if( pNode->GetAttrValue("File", sFile) || pNode->GetAttrValue("Path", sFile) ) /* Path deprecated */ { LuaHelpers::RunAtExpressionS( sFile ); FixSlashesInPlace( sFile ); - CString sNewPath = sFile.Left(1) == "/"? sFile : sDir+sFile; + RString sNewPath = sFile.Left(1) == "/"? sFile : sDir+sFile; ActorUtil::ResolvePath( sNewPath, sDir ); Load( sNewPath ); diff --git a/stepmania/src/ActorSound.h b/stepmania/src/ActorSound.h index f547d866e5..f6045564a5 100644 --- a/stepmania/src/ActorSound.h +++ b/stepmania/src/ActorSound.h @@ -12,9 +12,9 @@ public: virtual ~ActorSound() { } virtual Actor *Copy() const; - void Load( const CString &sPath ); + void Load( const RString &sPath ); void Play(); - void LoadFromNode( const CString& sDir, const XNode* pNode ); + void LoadFromNode( const RString& sDir, const XNode* pNode ); // // Lua diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index 1ea84352fe..55d02e86ef 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -17,27 +17,27 @@ // Actor registration -static map *g_pmapRegistrees = NULL; +static map *g_pmapRegistrees = NULL; -static bool IsRegistered( const CString& sClassName ) +static bool IsRegistered( const RString& sClassName ) { return g_pmapRegistrees->find( sClassName ) != g_pmapRegistrees->end(); } -void ActorUtil::Register( const CString& sClassName, CreateActorFn pfn ) +void ActorUtil::Register( const RString& sClassName, CreateActorFn pfn ) { if( g_pmapRegistrees == NULL ) - g_pmapRegistrees = new map; + g_pmapRegistrees = new map; - map::iterator iter = g_pmapRegistrees->find( sClassName ); + map::iterator iter = g_pmapRegistrees->find( sClassName ); ASSERT_M( iter == g_pmapRegistrees->end(), ssprintf("Actor class '%s' already registered.", sClassName.c_str()) ); (*g_pmapRegistrees)[sClassName] = pfn; } -Actor* ActorUtil::Create( const CString& sClassName, const CString& sDir, const XNode* pNode ) +Actor* ActorUtil::Create( const RString& sClassName, const RString& sDir, const XNode* pNode ) { - map::iterator iter = g_pmapRegistrees->find( sClassName ); + map::iterator iter = g_pmapRegistrees->find( sClassName ); ASSERT_M( iter != g_pmapRegistrees->end(), ssprintf("Actor '%s' is not registered.",sClassName.c_str()) ); CreateActorFn pfn = iter->second; @@ -45,9 +45,9 @@ Actor* ActorUtil::Create( const CString& sClassName, const CString& sDir, const } /* Return false to retry. */ -void ActorUtil::ResolvePath( CString &sPath, const CString &sName ) +void ActorUtil::ResolvePath( RString &sPath, const RString &sName ) { - const CString sOriginalPath( sPath ); + const RString sOriginalPath( sPath ); retry: CollapsePath( sPath ); @@ -57,12 +57,12 @@ retry: RageFileManager::FileType ft = FILEMAN->GetFileType( sPath ); if( ft != RageFileManager::TYPE_FILE && ft != RageFileManager::TYPE_DIR ) { - vector asPaths; + vector asPaths; GetDirListing( sPath + "*", asPaths, false, true ); // return path too if( asPaths.empty() ) { - CString sError = ssprintf( "A file in '%s' references a file '%s' which doesn't exist.", sName.c_str(), sPath.c_str() ); + RString sError = ssprintf( "A file in '%s' references a file '%s' which doesn't exist.", sName.c_str(), sPath.c_str() ); switch( Dialog::AbortRetryIgnore( sError, "BROKEN_FILE_REFERENCE" ) ) { case Dialog::abort: @@ -82,7 +82,7 @@ retry: } else if( asPaths.size() > 1 ) { - CString sError = ssprintf( "A file in '%s' references a file '%s' which has multiple matches.", sName.c_str(), sPath.c_str() ); + RString sError = ssprintf( "A file in '%s' references a file '%s' which has multiple matches.", sName.c_str(), sPath.c_str() ); switch( Dialog::AbortRetryIgnore( sError, "BROKEN_FILE_REFERENCE" ) ) { case Dialog::abort: @@ -121,7 +121,7 @@ static void PushParamsTable( Lua *L ) /* Set an input parameter to the first value on the stack. If pOld is non-NULL, * set it to the old value. The value used on the stack will be removed. */ -void ActorUtil::SetParamFromStack( Lua *L, CString sName, LuaReference *pOld ) +void ActorUtil::SetParamFromStack( Lua *L, RString sName, LuaReference *pOld ) { int iValue = lua_gettop(L); @@ -154,7 +154,7 @@ void ActorUtil::SetParamFromStack( Lua *L, CString sName, LuaReference *pOld ) } /* Look up a param set with SetParamFromStack, and push it on the stack. */ -void ActorUtil::GetParam( Lua *L, const CString &sName ) +void ActorUtil::GetParam( Lua *L, const RString &sName ) { /* Search the params table. */ PushParamsTable( L ); @@ -170,12 +170,12 @@ void ActorUtil::GetParam( Lua *L, const CString &sName ) } } -Actor* ActorUtil::LoadFromNode( const CString& sDir, const XNode* pNode ) +Actor* ActorUtil::LoadFromNode( const RString& sDir, const XNode* pNode ) { ASSERT( pNode ); { - CString expr; + RString expr; if( pNode->GetAttrValue("Condition",expr) ) { LuaHelpers::RunAtExpressionS( expr ); @@ -185,13 +185,13 @@ Actor* ActorUtil::LoadFromNode( const CString& sDir, const XNode* pNode ) } // Load Params - map setOldParams; + map setOldParams; { FOREACH_CONST_Child( pNode, pChild ) { if( pChild->m_sName == "Param" ) { - CString sName; + RString sName; if( !pChild->GetAttrValue( "Name", sName ) ) { RageException::Throw( ssprintf("Param node in '%s' is missing the attribute 'Name'", sDir.c_str()) ); @@ -199,7 +199,7 @@ Actor* ActorUtil::LoadFromNode( const CString& sDir, const XNode* pNode ) LuaHelpers::RunAtExpressionS( sName ); - CString s; + RString s; if( pChild->GetAttrValue( "Value", s ) ) { Lua *L = LUA->Get(); @@ -221,7 +221,7 @@ Actor* ActorUtil::LoadFromNode( const CString& sDir, const XNode* pNode ) // Element name is the type in XML. // Type= is the name in INI. // TODO: Remove the backward compat fallback - CString sClass = pNode->m_sName; + RString sClass = pNode->m_sName; bool bHasClass = pNode->GetAttrValue( "Class", sClass ); if( !bHasClass ) bHasClass = pNode->GetAttrValue( "Type", sClass ); // for backward compatibility @@ -229,7 +229,7 @@ Actor* ActorUtil::LoadFromNode( const CString& sDir, const XNode* pNode ) // backward compat hack if( !bHasClass ) { - CString sText; + RString sText; if( pNode->GetAttrValue( "Text", sText ) ) sClass = "BitmapText"; } @@ -243,7 +243,7 @@ Actor* ActorUtil::LoadFromNode( const CString& sDir, const XNode* pNode ) else // sClass is empty or garbage (e.g. "1" or "0 // 0==Sprite") { // automatically figure out the type - CString sFile; + RString sFile; pNode->GetAttrValue( "File", sFile ); LuaHelpers::RunAtExpressionS( sFile ); @@ -254,14 +254,14 @@ Actor* ActorUtil::LoadFromNode( const CString& sDir, const XNode* pNode ) * loading the layer we're in. */ if( sFile == "" ) { - CString sError = ssprintf( "An xml file in '%s' is missing the File attribute or has an invalid Class \"%s\"", + RString sError = ssprintf( "An xml file in '%s' is missing the File attribute or has an invalid Class \"%s\"", sDir.c_str(), sClass.c_str() ); Dialog::OK( sError ); pReturn = new Actor; // Return a dummy object so that we don't crash in AutoActor later. goto all_done; } - CString sNewPath = bIsAbsolutePath ? sFile : sDir+sFile; + RString sNewPath = bIsAbsolutePath ? sFile : sDir+sFile; ActorUtil::ResolvePath( sNewPath, sDir ); @@ -275,7 +275,7 @@ all_done: // Unload Params { Lua *L = LUA->Get(); - FOREACHM( CString, LuaReference, setOldParams, old ) + FOREACHM( RString, LuaReference, setOldParams, old ) { old->second.PushSelf( L ); SetParamFromStack( L, old->first, NULL ); @@ -310,10 +310,10 @@ static void MergeActorXML( XNode *pChild, const XNode *pParent ) if( p->first == "File" ) continue; - CString sOld; + RString sOld; if( pChild->GetChildValue(p->first, sOld) ) { - CString sWarning = + RString sWarning = ssprintf( "Overriding \"%s\" (\"%s\") in XML node \"%s\" with \"%s\" in XML node \"%s\"", p->first.c_str(), p->second.c_str(), @@ -330,19 +330,19 @@ static void MergeActorXML( XNode *pChild, const XNode *pParent ) * If pParent is non-NULL, it's the parent node when nesting XML, which is * used only by ActorUtil::LoadFromNode. */ -Actor* ActorUtil::MakeActor( const CString &sPath_, const XNode *pParent ) +Actor* ActorUtil::MakeActor( const RString &sPath_, const XNode *pParent ) { static const XNode dummy; if( pParent == NULL ) pParent = &dummy; - CString sPath( sPath_ ); + RString sPath( sPath_ ); /* If @ expressions are allowed through this path, we've already * evaluated them. Make sure we don't allow double-evaluation. */ ASSERT_M( sPath.empty() || sPath[0] != '@', sPath ); - CString sDir = Dirname( sPath ); + RString sDir = Dirname( sPath ); FileType ft = GetFileType( sPath ); switch( ft ) { @@ -397,7 +397,7 @@ Actor* ActorUtil::MakeActor( const CString &sPath_, const XNode *pParent ) } } -void ActorUtil::SetXY( Actor& actor, const CString &sType ) +void ActorUtil::SetXY( Actor& actor, const RString &sType ) { ASSERT( !actor.GetName().empty() ); @@ -420,17 +420,17 @@ void ActorUtil::SetXY( Actor& actor, const CString &sType ) actor.SetXY( fX, fY ); } -void ActorUtil::LoadCommand( Actor& actor, const CString &sType, const CString &sCommandName ) +void ActorUtil::LoadCommand( Actor& actor, const RString &sType, const RString &sCommandName ) { ActorUtil::LoadCommandFromName( actor, sType, sCommandName, actor.GetName() ); } -void ActorUtil::LoadCommandFromName( Actor& actor, const CString &sType, const CString &sCommandName, const CString &sName ) +void ActorUtil::LoadCommandFromName( Actor& actor, const RString &sType, const RString &sCommandName, const RString &sName ) { actor.AddCommand( sCommandName, THEME->GetMetricA(sType,sName+sCommandName+"Command") ); } -void ActorUtil::LoadAndPlayCommand( Actor& actor, const CString &sType, const CString &sCommandName, Actor* pParent ) +void ActorUtil::LoadAndPlayCommand( Actor& actor, const RString &sType, const RString &sCommandName, Actor* pParent ) { // HACK: It's very often that we command things to TweenOffScreen // that we aren't drawing. We know that an Actor is not being @@ -461,22 +461,22 @@ void ActorUtil::LoadAndPlayCommand( Actor& actor, const CString &sType, const CS actor.PlayCommand( sCommandName, pParent ); } -void ActorUtil::LoadAllCommands( Actor& actor, const CString &sType ) +void ActorUtil::LoadAllCommands( Actor& actor, const RString &sType ) { LoadAllCommandsFromName( actor, sType, actor.GetName() ); } -void ActorUtil::LoadAllCommandsFromName( Actor& actor, const CString &sType, const CString &sName ) +void ActorUtil::LoadAllCommandsFromName( Actor& actor, const RString &sType, const RString &sName ) { - set vsValueNames; + set vsValueNames; THEME->GetMetricsThatBeginWith( sType, sName, vsValueNames ); - FOREACHS_CONST( CString, vsValueNames, v ) + FOREACHS_CONST( RString, vsValueNames, v ) { - const CString &sv = *v; + const RString &sv = *v; if( sv.Right(7) == "Command" ) { - CString sCommandName( sv.begin()+sName.size(), sv.end()-7 ); + RString sCommandName( sv.begin()+sName.size(), sv.end()-7 ); LoadCommandFromName( actor, sType, sCommandName, sName ); } } @@ -502,9 +502,9 @@ static const char *FileTypeNames[] = { }; XToString( FileType, NUM_FileType ); -FileType ActorUtil::GetFileType( const CString &sPath ) +FileType ActorUtil::GetFileType( const RString &sPath ) { - CString sExt = GetExtension( sPath ); + RString sExt = GetExtension( sPath ); sExt.MakeLower(); if( sExt=="xml" ) return FT_Xml; @@ -525,7 +525,7 @@ FileType ActorUtil::GetFileType( const CString &sPath ) } /* Helper: set actor parameters, and return them to their original value when released. */ -ActorUtil::ActorParam::ActorParam( CString sName, CString sValue ) +ActorUtil::ActorParam::ActorParam( RString sName, RString sValue ) { m_pOld = new LuaReference; m_sName = sName; diff --git a/stepmania/src/ActorUtil.h b/stepmania/src/ActorUtil.h index 57fc289f36..0fc989b1fe 100644 --- a/stepmania/src/ActorUtil.h +++ b/stepmania/src/ActorUtil.h @@ -8,11 +8,11 @@ class XNode; -typedef Actor* (*CreateActorFn)(const CString& sDir, const XNode* pNode); +typedef Actor* (*CreateActorFn)(const RString& sDir, const XNode* pNode); // Each Actor class should have a REGISTER_ACTOR_CLASS in its CPP file. #define REGISTER_ACTOR_CLASS_WITH_NAME( className, externalClassName ) \ - Actor* Create##className(const CString& sDir, const XNode* pNode) { \ + Actor* Create##className(const RString& sDir, const XNode* pNode) { \ className *pRet = new className; \ pRet->LoadFromNode(sDir, pNode); \ return pRet; } \ @@ -35,57 +35,57 @@ enum FileType NUM_FileType, FT_Invalid }; -const CString& FileTypeToString( FileType ft ); +const RString& FileTypeToString( FileType ft ); namespace ActorUtil { // Every screen should register its class at program initialization. - void Register( const CString& sClassName, CreateActorFn pfn ); - Actor* Create( const CString& sClassName, const CString& sDir, const XNode* pNode ); + void Register( const RString& sClassName, CreateActorFn pfn ); + Actor* Create( const RString& sClassName, const RString& sDir, const XNode* pNode ); - void SetXY( Actor& actor, const CString &sType ); - void LoadCommand( Actor& actor, const CString &sType, const CString &sCommandName ); - void LoadCommandFromName( Actor& actor, const CString &sType, const CString &sCommandName, const CString &sName ); - void LoadAndPlayCommand( Actor& actor, const CString &sType, const CString &sCommandName, Actor* pParent = NULL ); - void LoadAllCommands( Actor& actor, const CString &sType ); - void LoadAllCommandsFromName( Actor& actor, const CString &sType, const CString &sName ); - inline void OnCommand( Actor& actor, const CString &sType, Actor* pParent = NULL ) { LoadAndPlayCommand( actor, sType, "On", pParent ); } - inline void OffCommand( Actor& actor, const CString &sType ) { LoadAndPlayCommand( actor, sType, "Off" ); } - inline void SetXYAndOnCommand( Actor& actor, const CString &sType, Actor* pParent = NULL ) + void SetXY( Actor& actor, const RString &sType ); + void LoadCommand( Actor& actor, const RString &sType, const RString &sCommandName ); + void LoadCommandFromName( Actor& actor, const RString &sType, const RString &sCommandName, const RString &sName ); + void LoadAndPlayCommand( Actor& actor, const RString &sType, const RString &sCommandName, Actor* pParent = NULL ); + void LoadAllCommands( Actor& actor, const RString &sType ); + void LoadAllCommandsFromName( Actor& actor, const RString &sType, const RString &sName ); + inline void OnCommand( Actor& actor, const RString &sType, Actor* pParent = NULL ) { LoadAndPlayCommand( actor, sType, "On", pParent ); } + inline void OffCommand( Actor& actor, const RString &sType ) { LoadAndPlayCommand( actor, sType, "Off" ); } + inline void SetXYAndOnCommand( Actor& actor, const RString &sType, Actor* pParent = NULL ) { SetXY( actor, sType ); OnCommand( actor, sType, pParent ); } /* convenience */ - inline void SetXY( Actor* pActor, const CString &sType ) { SetXY( *pActor, sType ); } - inline void LoadAndPlayCommand( Actor* pActor, const CString &sType, const CString &sCommandName, Actor* pParent = NULL ) { if(pActor) LoadAndPlayCommand( *pActor, sType, sCommandName, pParent ); } - inline void OnCommand( Actor* pActor, const CString &sType, Actor* pParent = NULL ) { if(pActor) OnCommand( *pActor, sType, pParent ); } - inline void OffCommand( Actor* pActor, const CString &sType ) { if(pActor) OffCommand( *pActor, sType ); } - inline void SetXYAndOnCommand( Actor* pActor, const CString &sType, Actor* pParent = NULL ) { if(pActor) SetXYAndOnCommand( *pActor, sType, pParent ); } + inline void SetXY( Actor* pActor, const RString &sType ) { SetXY( *pActor, sType ); } + inline void LoadAndPlayCommand( Actor* pActor, const RString &sType, const RString &sCommandName, Actor* pParent = NULL ) { if(pActor) LoadAndPlayCommand( *pActor, sType, sCommandName, pParent ); } + inline void OnCommand( Actor* pActor, const RString &sType, Actor* pParent = NULL ) { if(pActor) OnCommand( *pActor, sType, pParent ); } + inline void OffCommand( Actor* pActor, const RString &sType ) { if(pActor) OffCommand( *pActor, sType ); } + inline void SetXYAndOnCommand( Actor* pActor, const RString &sType, Actor* pParent = NULL ) { if(pActor) SetXYAndOnCommand( *pActor, sType, pParent ); } // Return a Sprite, BitmapText, or Model depending on the file type - Actor* LoadFromNode( const CString& sAniDir, const XNode* pNode ); - Actor* MakeActor( const CString &sPath, const XNode *pParent = NULL ); + Actor* LoadFromNode( const RString& sAniDir, const XNode* pNode ); + Actor* MakeActor( const RString &sPath, const XNode *pParent = NULL ); - void ResolvePath( CString &sPath, const CString &sName ); + void ResolvePath( RString &sPath, const RString &sName ); void SortByZPosition( vector &vActors ); - FileType GetFileType( const CString &sPath ); + FileType GetFileType( const RString &sPath ); - void SetParamFromStack( Lua *L, CString sName, LuaReference *pOld=NULL ); - void GetParam( Lua *L, const CString &sName ); + void SetParamFromStack( Lua *L, RString sName, LuaReference *pOld=NULL ); + void GetParam( Lua *L, const RString &sName ); struct ActorParam { - ActorParam( CString sName, CString sValue ); + ActorParam( RString sName, RString sValue ); ~ActorParam(); void Release(); private: - CString m_sName; + RString m_sName; LuaReference *m_pOld; }; }; diff --git a/stepmania/src/AnnouncerManager.cpp b/stepmania/src/AnnouncerManager.cpp index 93cba99661..c6c0e34c9a 100644 --- a/stepmania/src/AnnouncerManager.cpp +++ b/stepmania/src/AnnouncerManager.cpp @@ -7,15 +7,15 @@ AnnouncerManager* ANNOUNCER = NULL; // global object accessable from anywhere in the program -const CString EMPTY_ANNOUNCER_NAME = "Empty"; -const CString ANNOUNCERS_DIR = "Announcers/"; +const RString EMPTY_ANNOUNCER_NAME = "Empty"; +const RString ANNOUNCERS_DIR = "Announcers/"; AnnouncerManager::AnnouncerManager() { LOG->Trace("AnnouncerManager::AnnouncerManager()"); } -void AnnouncerManager::GetAnnouncerNames( vector& AddTo ) +void AnnouncerManager::GetAnnouncerNames( vector& AddTo ) { GetDirListing( ANNOUNCERS_DIR+"*", AddTo, true ); @@ -27,12 +27,12 @@ void AnnouncerManager::GetAnnouncerNames( vector& AddTo ) AddTo.erase(AddTo.begin()+i, AddTo.begin()+i+1 ); } -bool AnnouncerManager::DoesAnnouncerExist( CString sAnnouncerName ) +bool AnnouncerManager::DoesAnnouncerExist( RString sAnnouncerName ) { if( sAnnouncerName == "" ) return true; - vector asAnnouncerNames; + vector asAnnouncerNames; GetAnnouncerNames( asAnnouncerNames ); for( unsigned i=0; i as; + vector as; GetAnnouncerNames( as ); if( as.size()==0 ) return; diff --git a/stepmania/src/AnnouncerManager.h b/stepmania/src/AnnouncerManager.h index 4e7ed976c8..3f31baca97 100644 --- a/stepmania/src/AnnouncerManager.h +++ b/stepmania/src/AnnouncerManager.h @@ -6,20 +6,20 @@ class AnnouncerManager public: AnnouncerManager(); - void GetAnnouncerNames( vector& AddTo ); - bool DoesAnnouncerExist( CString sAnnouncerName ); - void SwitchAnnouncer( CString sNewAnnouncerName ); - CString GetCurAnnouncerName() { return m_sCurAnnouncerName; }; + void GetAnnouncerNames( vector& AddTo ); + bool DoesAnnouncerExist( RString sAnnouncerName ); + void SwitchAnnouncer( RString sNewAnnouncerName ); + RString GetCurAnnouncerName() { return m_sCurAnnouncerName; }; void NextAnnouncer(); - CString GetPathTo( CString sFolderName ); - bool HasSoundsFor( CString sFolderName ); + RString GetPathTo( RString sFolderName ); + bool HasSoundsFor( RString sFolderName ); protected: - static CString GetAnnouncerDirFromName( CString sAnnouncerName ); - CString GetPathTo( CString AnnouncerPath, CString sFolderName ); + static RString GetAnnouncerDirFromName( RString sAnnouncerName ); + RString GetPathTo( RString AnnouncerPath, RString sFolderName ); - CString m_sCurAnnouncerName; + RString m_sCurAnnouncerName; }; diff --git a/stepmania/src/Attack.cpp b/stepmania/src/Attack.cpp index 23414ccad4..81887e6d6e 100644 --- a/stepmania/src/Attack.cpp +++ b/stepmania/src/Attack.cpp @@ -55,7 +55,7 @@ bool Attack::ContainsTransformOrTurn() const return po.ContainsTransformOrTurn(); } -Attack Attack::FromGlobalCourseModifier( const CString &sModifiers ) +Attack Attack::FromGlobalCourseModifier( const RString &sModifiers ) { Attack a; a.fStartSecond = 0; @@ -66,9 +66,9 @@ Attack Attack::FromGlobalCourseModifier( const CString &sModifiers ) return a; } -CString Attack::GetTextDescription() const +RString Attack::GetTextDescription() const { - CString s = sModifiers + " " + ssprintf("(%.2f seconds)", fSecsRemaining); + RString s = sModifiers + " " + ssprintf("(%.2f seconds)", fSecsRemaining); return s; } diff --git a/stepmania/src/Attack.h b/stepmania/src/Attack.h index a36a2ac0e7..92e81eb1eb 100644 --- a/stepmania/src/Attack.h +++ b/stepmania/src/Attack.h @@ -11,7 +11,7 @@ struct Attack AttackLevel level; float fStartSecond; // -1 = now float fSecsRemaining; - CString sModifiers; + RString sModifiers; bool bOn; // set and used by GAMESTATE bool bGlobal; // true for song-wide course mods bool bShowInAttackList; @@ -21,7 +21,7 @@ struct Attack level = ATTACK_LEVEL_1; fStartSecond = -1; fSecsRemaining = 0; - sModifiers = CString(); + sModifiers = RString(); bOn = false; bGlobal = false; bShowInAttackList = true; @@ -31,7 +31,7 @@ struct Attack AttackLevel level_, float fStartSecond_, float fSecsRemaining_, - CString sModifiers_, + RString sModifiers_, bool bOn_, bool bGlobal_, bool bShowInAttackList_ = true ) @@ -49,8 +49,8 @@ struct Attack bool IsBlank() const { return sModifiers.empty(); } bool operator== ( const Attack &rhs ) const; bool ContainsTransformOrTurn() const; - static Attack FromGlobalCourseModifier( const CString &sModifiers ); - CString GetTextDescription() const; + static Attack FromGlobalCourseModifier( const RString &sModifiers ); + RString GetTextDescription() const; }; struct AttackArray : public vector diff --git a/stepmania/src/AttackDisplay.cpp b/stepmania/src/AttackDisplay.cpp index 26add2356e..17b21af258 100644 --- a/stepmania/src/AttackDisplay.cpp +++ b/stepmania/src/AttackDisplay.cpp @@ -9,9 +9,9 @@ #include "PlayerState.h" -CString GetAttackPieceName( const CString &sAttack ) +RString GetAttackPieceName( const RString &sAttack ) { - CString ret = ssprintf( "attack %s", sAttack.c_str() ); + RString ret = ssprintf( "attack %s", sAttack.c_str() ); /* 1.5x -> 1_5x. If we pass a period to THEME->GetPathTo, it'll think * we're looking for a specific file and not search. */ @@ -42,19 +42,19 @@ void AttackDisplay::Init( const PlayerState* pPlayerState ) GAMESTATE->m_PlayMode != PLAY_MODE_RAVE ) return; - set attacks; + set attacks; for( int al=0; alm_pCurCharacters[pn]; ASSERT( ch ); - const CString* asAttacks = ch->m_sAttacks[al]; + const RString* asAttacks = ch->m_sAttacks[al]; for( int att = 0; att < NUM_ATTACKS_PER_LEVEL; ++att ) attacks.insert( asAttacks[att] ); } - for( set::const_iterator it = attacks.begin(); it != attacks.end(); ++it ) + for( set::const_iterator it = attacks.begin(); it != attacks.end(); ++it ) { - const CString path = THEME->GetPathG( "AttackDisplay", GetAttackPieceName( *it ), true ); + const RString path = THEME->GetPathG( "AttackDisplay", GetAttackPieceName( *it ), true ); if( path == "" ) { LOG->Trace( "Couldn't find \"%s\"", GetAttackPieceName( *it ).c_str() ); @@ -96,9 +96,9 @@ void AttackDisplay::Update( float fDelta ) } } -void AttackDisplay::SetAttack( const CString &sText ) +void AttackDisplay::SetAttack( const RString &sText ) { - const CString path = THEME->GetPathG( "AttackDisplay", GetAttackPieceName(sText), true ); + const RString path = THEME->GetPathG( "AttackDisplay", GetAttackPieceName(sText), true ); if( path == "" ) return; @@ -108,7 +108,7 @@ void AttackDisplay::SetAttack( const CString &sText ) // TODO: Remove use of PlayerNumber. PlayerNumber pn = m_pPlayerState->m_PlayerNumber; - const CString sName = ssprintf( "%sP%i", sText.c_str(), pn+1 ); + const RString sName = ssprintf( "%sP%i", sText.c_str(), pn+1 ); m_sprAttack.RunCommands( THEME->GetMetricA("AttackDisplay", sName + "OnCommand") ); } diff --git a/stepmania/src/AttackDisplay.h b/stepmania/src/AttackDisplay.h index 8cbcb10522..ca9799b89d 100644 --- a/stepmania/src/AttackDisplay.h +++ b/stepmania/src/AttackDisplay.h @@ -14,7 +14,7 @@ public: AttackDisplay(); void Init( const PlayerState* pPlayerState ); - void SetAttack( const CString &mod ); + void SetAttack( const RString &mod ); virtual void Update( float fDelta ); diff --git a/stepmania/src/AutoActor.cpp b/stepmania/src/AutoActor.cpp index 1cdafc349e..c74ace529e 100644 --- a/stepmania/src/AutoActor.cpp +++ b/stepmania/src/AutoActor.cpp @@ -27,7 +27,7 @@ AutoActor &AutoActor::operator=( const AutoActor &cpy ) return *this; } -void AutoActor::Load( const CString &sPath ) +void AutoActor::Load( const RString &sPath ) { Unload(); m_pActor = ActorUtil::MakeActor( sPath ); @@ -37,14 +37,14 @@ void AutoActor::Load( const CString &sPath ) m_pActor = new Actor; } -void AutoActor::LoadFromNode( const CString &sDir, const XNode* pNode ) +void AutoActor::LoadFromNode( const RString &sDir, const XNode* pNode ) { Unload(); m_pActor = ActorUtil::LoadFromNode( sDir, pNode ); } -void AutoActor::LoadAndSetName( const CString &sScreenName, const CString &sActorName ) +void AutoActor::LoadAndSetName( const RString &sScreenName, const RString &sActorName ) { Load( THEME->GetPathG(sScreenName,sActorName) ); m_pActor->SetName( sActorName ); diff --git a/stepmania/src/AutoActor.h b/stepmania/src/AutoActor.h index e6dbdaf636..3040454d47 100644 --- a/stepmania/src/AutoActor.h +++ b/stepmania/src/AutoActor.h @@ -21,9 +21,9 @@ public: Actor *operator->() { return m_pActor; } void Unload(); bool IsLoaded() const { return m_pActor != NULL; } - void Load( const CString &sPath ); - void LoadFromNode( const CString &sDir, const XNode* pNode ); - void LoadAndSetName( const CString &sScreenName, const CString &sActorName ); + void Load( const RString &sPath ); + void LoadFromNode( const RString &sDir, const XNode* pNode ); + void LoadAndSetName( const RString &sScreenName, const RString &sActorName ); protected: Actor* m_pActor; diff --git a/stepmania/src/AutoKeysounds.cpp b/stepmania/src/AutoKeysounds.cpp index 0b499bca93..80a0ff6808 100644 --- a/stepmania/src/AutoKeysounds.cpp +++ b/stepmania/src/AutoKeysounds.cpp @@ -42,13 +42,13 @@ void AutoKeysounds::FinishLoading() // // Load sounds. // - CString sSongDir = pSong->GetSongDir(); + RString sSongDir = pSong->GetSongDir(); /* m_vKeysounds.clear(); m_vKeysounds.resize( pSong->m_vsKeysoundFile.size() ); for( unsigned i=0; im_vsKeysoundFile[i]; + RString sKeysoundFilePath = sSongDir + pSong->m_vsKeysoundFile[i]; RageSound& sound = m_vKeysounds[i]; sound.Load( sKeysoundFilePath ); @@ -106,7 +106,7 @@ void AutoKeysounds::FinishLoading() ASSERT( tn[pn].type == TapNote::autoKeysound ); if( tn[pn].bKeysound ) { - CString sKeysoundFilePath = sSongDir + pSong->m_vsKeysoundFile[tn[pn].iKeysoundIndex]; + RString sKeysoundFilePath = sSongDir + pSong->m_vsKeysoundFile[tn[pn].iKeysoundIndex]; float fSeconds = pSong->m_Timing.GetElapsedTimeFromBeat( NoteRowToBeat(iRow) ); float fPan = 0; diff --git a/stepmania/src/BGAnimation.cpp b/stepmania/src/BGAnimation.cpp index 1ed5a0b6e7..1698b0ce5c 100644 --- a/stepmania/src/BGAnimation.cpp +++ b/stepmania/src/BGAnimation.cpp @@ -17,7 +17,7 @@ BGAnimation::~BGAnimation() DeleteAllChildren(); } -static bool CompareLayerNames( const CString& s1, const CString& s2 ) +static bool CompareLayerNames( const RString& s1, const RString& s2 ) { int i1, i2; int ret; @@ -29,12 +29,12 @@ static bool CompareLayerNames( const CString& s1, const CString& s2 ) return i1 < i2; } -void BGAnimation::AddLayersFromAniDir( const CString &_sAniDir, const XNode *pNode ) +void BGAnimation::AddLayersFromAniDir( const RString &_sAniDir, const XNode *pNode ) { - const CString& sAniDir = _sAniDir; + const RString& sAniDir = _sAniDir; { - vector vsLayerNames; + vector vsLayerNames; FOREACH_CONST_Child( pNode, pLayer ) { if( strncmp(pLayer->m_sName, "Layer", 5) == 0 ) @@ -44,16 +44,16 @@ void BGAnimation::AddLayersFromAniDir( const CString &_sAniDir, const XNode *pNo sort( vsLayerNames.begin(), vsLayerNames.end(), CompareLayerNames ); - FOREACH_CONST( CString, vsLayerNames, s ) + FOREACH_CONST( RString, vsLayerNames, s ) { - const CString &sLayer = *s; + const RString &sLayer = *s; const XNode* pKey = pNode->GetChild( sLayer ); ASSERT( pKey ); - CString sImportDir; + RString sImportDir; if( pKey->GetAttrValue("Import", sImportDir) ) { - CString expr; + RString expr; if( pKey->GetAttrValue("Condition",expr) ) { if( !LuaHelpers::RunExpressionB( expr ) ) @@ -69,7 +69,7 @@ void BGAnimation::AddLayersFromAniDir( const CString &_sAniDir, const XNode *pNo ASSERT_M( IsADirectory(sImportDir), sImportDir + " isn't a directory" ); - CString sPathToIni = sImportDir + "BGAnimation.ini"; + RString sPathToIni = sImportDir + "BGAnimation.ini"; IniFile ini2; ini2.ReadFile( sPathToIni ); @@ -87,20 +87,20 @@ void BGAnimation::AddLayersFromAniDir( const CString &_sAniDir, const XNode *pNo } } -void BGAnimation::LoadFromAniDir( const CString &_sAniDir ) +void BGAnimation::LoadFromAniDir( const RString &_sAniDir ) { DeleteAllChildren(); if( _sAniDir.empty() ) return; - CString sAniDir = _sAniDir; + RString sAniDir = _sAniDir; if( sAniDir.Right(1) != "/" ) sAniDir += "/"; ASSERT_M( IsADirectory(sAniDir), sAniDir + " isn't a directory" ); - CString sPathToIni = sAniDir + "BGAnimation.ini"; + RString sPathToIni = sAniDir + "BGAnimation.ini"; if( DoesFileExist(sPathToIni) ) { @@ -123,7 +123,7 @@ void BGAnimation::LoadFromAniDir( const CString &_sAniDir ) // This is an old style BGAnimation (not using .ini) // loading a directory of layers - vector asImagePaths; + vector asImagePaths; ASSERT( sAniDir != "" ); GetDirListing( sAniDir+"*.png", asImagePaths, false, true ); @@ -137,7 +137,7 @@ void BGAnimation::LoadFromAniDir( const CString &_sAniDir ) for( unsigned i=0; im_pCurSong; - CString sSongBGPath; + RString sSongBGPath; if( pSong && pSong->HasBackground() ) sSongBGPath = pSong->GetBackgroundPath(); else @@ -103,7 +103,7 @@ void BGAnimationLayer::LoadFromAniLayerFile( const CString& sPath ) EFFECT_INVALID }; - const CString EFFECT_STRING[NUM_EFFECTS] = { + const RString EFFECT_STRING[NUM_EFFECTS] = { "center", "stretchstill", "stretchscrollleft", @@ -313,33 +313,33 @@ void BGAnimationLayer::LoadFromAniLayerFile( const CString& sPath ) } - CString sHint = sPath; + RString sHint = sPath; sHint.MakeLower(); - if( sHint.find("cyclecolor") != CString::npos ) + if( sHint.find("cyclecolor") != RString::npos ) for( unsigned i=0; iSetEffectRainbow( 5 ); - if( sHint.find("cyclealpha") != CString::npos ) + if( sHint.find("cyclealpha") != RString::npos ) for( unsigned i=0; iSetEffectDiffuseShift( 2, RageColor(1,1,1,1), RageColor(1,1,1,0) ); - if( sHint.find("startonrandomframe") != CString::npos ) + if( sHint.find("startonrandomframe") != RString::npos ) for( unsigned i=0; iSetState( rand()%m_SubActors[i]->GetNumStates() ); - if( sHint.find("dontanimate") != CString::npos ) + if( sHint.find("dontanimate") != RString::npos ) for( unsigned i=0; iStopAnimating(); - if( sHint.find("add") != CString::npos ) + if( sHint.find("add") != RString::npos ) for( unsigned i=0; iSetBlendMode( BLEND_ADD ); } -void BGAnimationLayer::LoadFromNode( const CString& sDir, const XNode* pNode ) +void BGAnimationLayer::LoadFromNode( const RString& sDir, const XNode* pNode ) { - CString sAniDir = sDir; + RString sAniDir = sDir; if( sAniDir.Right(1) != "/" ) sAniDir += "/"; @@ -349,7 +349,7 @@ void BGAnimationLayer::LoadFromNode( const CString& sDir, const XNode* pNode ) CHECKPOINT_M( ssprintf( "BGAnimationLayer::LoadFromIni \"%s\"", sAniDir.c_str() ) ); { - CString expr; + RString expr; if( pNode->GetAttrValue("Condition", expr) ) { if( !LuaHelpers::RunExpressionB(expr) ) @@ -359,7 +359,7 @@ void BGAnimationLayer::LoadFromNode( const CString& sDir, const XNode* pNode ) bool bStretch = false; { - CString type = "sprite"; + RString type = "sprite"; pNode->GetAttrValue( "Type", type ); type.MakeLower(); @@ -454,11 +454,11 @@ void BGAnimationLayer::LoadFromNode( const CString& sDir, const XNode* pNode ) break; case TYPE_PARTICLES: { - CString sFile; + RString sFile; pNode->GetAttrValue( "File", sFile ); FixSlashesInPlace( sFile ); - CString sPath = sAniDir+sFile; + RString sPath = sAniDir+sFile; CollapsePath( sPath ); @@ -485,11 +485,11 @@ void BGAnimationLayer::LoadFromNode( const CString& sDir, const XNode* pNode ) break; case TYPE_TILES: { - CString sFile; + RString sFile; pNode->GetAttrValue( "File", sFile ); FixSlashesInPlace( sFile ); - CString sPath = sAniDir+sFile; + RString sPath = sAniDir+sFile; CollapsePath( sPath ); AutoActor s; diff --git a/stepmania/src/BGAnimationLayer.h b/stepmania/src/BGAnimationLayer.h index 4236b49906..385f2d97d5 100644 --- a/stepmania/src/BGAnimationLayer.h +++ b/stepmania/src/BGAnimationLayer.h @@ -15,8 +15,8 @@ public: BGAnimationLayer(); ~BGAnimationLayer(); - void LoadFromAniLayerFile( const CString& sPath ); - void LoadFromNode( const CString& sDir, const XNode* pNode ); + void LoadFromAniLayerFile( const RString& sPath ); + void LoadFromNode( const RString& sDir, const XNode* pNode ); void UpdateInternal( float fDeltaTime ); bool EarlyAbortDraw() const; @@ -41,7 +41,7 @@ protected: // // common stuff - CString m_sDrawCond; + RString m_sDrawCond; // stretch stuff float m_fTexCoordVelocityX; diff --git a/stepmania/src/BPMDisplay.cpp b/stepmania/src/BPMDisplay.cpp index 38a2ec028b..f51dd1b28f 100644 --- a/stepmania/src/BPMDisplay.cpp +++ b/stepmania/src/BPMDisplay.cpp @@ -69,7 +69,7 @@ void BPMDisplay::Update( float fDeltaTime ) if(m_fBPMTo == -1) { m_fBPMFrom = -1; - m_textBPM.SetText( (RandomFloat(0,1)>0.90f) ? CString("xxx") : ssprintf("%03.0f",RandomFloat(0,600)) ); + m_textBPM.SetText( (RandomFloat(0,1)>0.90f) ? RString("xxx") : ssprintf("%03.0f",RandomFloat(0,600)) ); } else if(m_fBPMFrom == -1) { diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 785309d4cb..02453e7fc3 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -88,7 +88,7 @@ protected: bool m_bInitted; DancingCharacters* m_pDancingCharacters; const Song *m_pSong; - map m_mapNameToTransition; + map m_mapNameToTransition; deque m_RandomBGAnimations; // random background to choose from. These may or may not be loaded into m_BGAnimations. void LoadFromRandom( float fFirstBeat, float fEndBeat, const BackgroundChange &change ); @@ -103,10 +103,10 @@ protected: // return true if created and added to m_BGAnimations bool CreateBackground( const Song *pSong, const BackgroundDef &bd ); // return def of the background that was created and added to m_BGAnimations. calls CreateBackground - BackgroundDef CreateRandomBGA( const Song *pSong, const CString &sEffect, deque &RandomBGAnimations ); + BackgroundDef CreateRandomBGA( const Song *pSong, const RString &sEffect, deque &RandomBGAnimations ); int FindBGSegmentForBeat( float fBeat ) const; - void UpdateCurBGChange( const Song *pSong, float fLastMusicSeconds, float fCurrentTime, const map &mapNameToTransition ); + void UpdateCurBGChange( const Song *pSong, float fLastMusicSeconds, float fCurrentTime, const map &mapNameToTransition ); void ProcessMessages( float fDeltaTime ); map m_BGAnimations; @@ -174,24 +174,24 @@ void BackgroundImpl::Init() // load transitions { ASSERT( m_mapNameToTransition.empty() ); - vector vsPaths, vsNames; + vector vsPaths, vsNames; BackgroundUtil::GetBackgroundTransitions( "", vsPaths, vsNames ); for( unsigned i=0; iDeleteChildrenWhenDone(); const Song* pSong = GAMESTATE->m_pCurSong; - CString sSongBGPath = + RString sSongBGPath = (pSong && pSong->HasBackground()) ? pSong->GetBackgroundPath() : THEME->GetPathG("Common","fallback background"); Sprite* pSprite = new Sprite; @@ -287,7 +287,7 @@ Actor *MakeVisualization( const CString &sVisPath ) return pFrame; } -Actor *MakeMovie( const CString &sMoviePath ) +Actor *MakeMovie( const RString &sMoviePath ) { Sprite *pSprite = new Sprite; pSprite->LoadBG( sMoviePath ); @@ -301,17 +301,17 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun ASSERT( m_BGAnimations.find(bd) == m_BGAnimations.end() ); // Resolve the background names - vector vsToResolve; + vector vsToResolve; vsToResolve.push_back( bd.m_sFile1 ); vsToResolve.push_back( bd.m_sFile2 ); - vector vsResolved; + vector vsResolved; vsResolved.resize( vsToResolve.size() ); for( unsigned i=0; iSetGlobal( ssprintf("File%d",i+1), CString() ); + LUA->SetGlobal( ssprintf("File%d",i+1), RString() ); if( sToResolve.empty() ) { @@ -325,7 +325,7 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun // - song's dir // - RandomMovies dir // - BGAnimations dir. - vector vsPaths, vsThrowAway; + vector vsPaths, vsThrowAway; // Look for BGAnims in the song dir if( sToResolve == SONG_BACKGROUND_FILE ) @@ -336,7 +336,7 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun if( vsPaths.empty() ) BackgroundUtil::GetGlobalBGAnimations( pSong, sToResolve, vsPaths, vsThrowAway ); if( vsPaths.empty() ) BackgroundUtil::GetGlobalRandomMovies( pSong, sToResolve, vsPaths, vsThrowAway ); - CString &sResolved = vsResolved[i]; + RString &sResolved = vsResolved[i]; if( !vsPaths.empty() ) { @@ -356,7 +356,7 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun LUA->SetGlobal( ssprintf("File%d",i+1), sResolved ); } - CString sEffect = bd.m_sEffect; + RString sEffect = bd.m_sEffect; if( sEffect.empty() ) { FileType ft = ActorUtil::GetFileType(vsResolved[0]); @@ -379,15 +379,15 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun // Set Lua color globals - LUA->SetGlobal( "Color1", bd.m_sColor1.empty() ? CString("1,1,1,1") : bd.m_sColor1 ); - LUA->SetGlobal( "Color2", bd.m_sColor2.empty() ? CString("1,1,1,1") : bd.m_sColor2 ); + LUA->SetGlobal( "Color1", bd.m_sColor1.empty() ? RString("1,1,1,1") : bd.m_sColor1 ); + LUA->SetGlobal( "Color2", bd.m_sColor2.empty() ? RString("1,1,1,1") : bd.m_sColor2 ); // Resolve the effect file. - CString sEffectFile; + RString sEffectFile; for( int i=0; i<2; i++ ) { - vector vsPaths, vsThrowAway; + vector vsPaths, vsThrowAway; BackgroundUtil::GetBackgroundEffects( sEffect, vsPaths, vsThrowAway ); if( vsPaths.empty() ) { @@ -414,14 +414,14 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun m_BGAnimations[bd] = pActor; for( unsigned i=0; iSetGlobal( ssprintf("File%d",i+1), CString() ); + LUA->SetGlobal( ssprintf("File%d",i+1), RString() ); LUA->UnsetGlobal( "Color1" ); LUA->UnsetGlobal( "Color2" ); return true; } -BackgroundDef BackgroundImpl::Layer::CreateRandomBGA( const Song *pSong, const CString &sEffect, deque &RandomBGAnimations ) +BackgroundDef BackgroundImpl::Layer::CreateRandomBGA( const Song *pSong, const RString &sEffect, deque &RandomBGAnimations ) { if( PREFSMAN->m_RandomBackgroundMode == PrefsManager::BGMODE_OFF ) return BackgroundDef(); @@ -508,7 +508,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong ) // Choose a bunch of background that we'll use for the random file marker // { - vector vsThrowAway, vsNames; + vector vsThrowAway, vsNames; switch( PREFSMAN->m_RandomBackgroundMode ) { default: @@ -528,7 +528,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong ) int iSize = min( (int)PREFSMAN->m_iNumBackgrounds, (int)vsNames.size() ); vsNames.resize( iSize ); - FOREACH_CONST( CString, vsNames, s ) + FOREACH_CONST( RString, vsNames, s ) { BackgroundDef bd; bd.m_sFile1 = *s; @@ -745,7 +745,7 @@ int BackgroundImpl::Layer::FindBGSegmentForBeat( float fBeat ) const } /* If the BG segment has changed, move focus to it. Send Update() calls. */ -void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMusicSeconds, float fCurrentTime, const map &mapNameToTransition ) +void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMusicSeconds, float fCurrentTime, const map &mapNameToTransition ) { ASSERT( fCurrentTime != GameState::MUSIC_SECONDS_INVALID ); @@ -801,7 +801,7 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus if( !change.m_sTransition.empty() ) { - map::const_iterator iter = mapNameToTransition.find( change.m_sTransition ); + map::const_iterator iter = mapNameToTransition.find( change.m_sTransition ); ASSERT( iter != mapNameToTransition.end() ); const BackgroundTransition &bt = iter->second; m_pFadingBGA->RunCommandsOnLeaves( *bt.cmdLeaves ); @@ -813,8 +813,8 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus m_pCurrentBGA->SetUpdateRate( change.m_fRate ); // Set Lua color globals before calling Init and On - LUA->SetGlobal( "Color1", change.m_def.m_sColor1.empty() ? CString("1,1,1,1") : change.m_def.m_sColor1 ); - LUA->SetGlobal( "Color2", change.m_def.m_sColor2.empty() ? CString("1,1,1,1") : change.m_def.m_sColor2 ); + LUA->SetGlobal( "Color1", change.m_def.m_sColor1.empty() ? RString("1,1,1,1") : change.m_def.m_sColor1 ); + LUA->SetGlobal( "Color2", change.m_def.m_sColor2.empty() ? RString("1,1,1,1") : change.m_def.m_sColor2 ); m_pCurrentBGA->PlayCommand( "Init" ); m_pCurrentBGA->PlayCommand( "On" ); diff --git a/stepmania/src/BackgroundUtil.cpp b/stepmania/src/BackgroundUtil.cpp index 1d596fbafd..ba65665d60 100644 --- a/stepmania/src/BackgroundUtil.cpp +++ b/stepmania/src/BackgroundUtil.cpp @@ -51,9 +51,9 @@ XNode *BackgroundDef::CreateNode() const } -CString BackgroundChange::GetTextDescription() const +RString BackgroundChange::GetTextDescription() const { - vector vsParts; + vector vsParts; if( !m_def.m_sFile1.empty() ) vsParts.push_back( m_def.m_sFile1 ); if( !m_def.m_sFile2.empty() ) vsParts.push_back( m_def.m_sFile2 ); if( m_fRate!=1.0f ) vsParts.push_back( ssprintf("%.2f%%",m_fRate*100) ); @@ -65,29 +65,29 @@ CString BackgroundChange::GetTextDescription() const if( vsParts.empty() ) vsParts.push_back( "(empty)" ); - CString s = join( "\n", vsParts ); + RString s = join( "\n", vsParts ); return s; } -const CString BACKGROUND_EFFECTS_DIR = "BackgroundEffects/"; -const CString BACKGROUND_TRANSITIONS_DIR = "BackgroundTransitions/"; -const CString BG_ANIMS_DIR = "BGAnimations/"; -const CString VISUALIZATIONS_DIR = "Visualizations/"; -const CString RANDOMMOVIES_DIR = "RandomMovies/"; +const RString BACKGROUND_EFFECTS_DIR = "BackgroundEffects/"; +const RString BACKGROUND_TRANSITIONS_DIR = "BackgroundTransitions/"; +const RString BG_ANIMS_DIR = "BGAnimations/"; +const RString VISUALIZATIONS_DIR = "Visualizations/"; +const RString RANDOMMOVIES_DIR = "RandomMovies/"; -const CString RANDOM_BACKGROUND_FILE = "-random-"; -const CString NO_SONG_BG_FILE = "-nosongbg-"; -const CString SONG_BACKGROUND_FILE = "songbackground"; +const RString RANDOM_BACKGROUND_FILE = "-random-"; +const RString NO_SONG_BG_FILE = "-nosongbg-"; +const RString SONG_BACKGROUND_FILE = "songbackground"; -const CString SBE_UpperLeft = "UpperLeft"; -const CString SBE_Centered = "Centered"; -const CString SBE_StretchNormal = "StretchNormal"; -const CString SBE_StretchNoLoop = "StretchNoLoop"; -const CString SBE_StretchRewind = "StretchRewind"; -const CString SBT_CrossFade = "CrossFade"; +const RString SBE_UpperLeft = "UpperLeft"; +const RString SBE_Centered = "Centered"; +const RString SBE_StretchNormal = "StretchNormal"; +const RString SBE_StretchNoLoop = "StretchNoLoop"; +const RString SBE_StretchRewind = "StretchRewind"; +const RString SBT_CrossFade = "CrossFade"; -static void StripCvs( vector &vsPathsToStrip, vector &vsNamesToStrip ) +static void StripCvs( vector &vsPathsToStrip, vector &vsNamesToStrip ) { ASSERT( vsPathsToStrip.size() == vsNamesToStrip.size() ); for( unsigned i=0; i &vBack sort( vBackgroundChanges.begin(), vBackgroundChanges.end(), CompareBackgroundChanges ); } -void BackgroundUtil::GetBackgroundEffects( const CString &_sName, vector &vsPathsOut, vector &vsNamesOut ) +void BackgroundUtil::GetBackgroundEffects( const RString &_sName, vector &vsPathsOut, vector &vsNamesOut ) { - CString sName = _sName; + RString sName = _sName; if( sName == "" ) sName = "*"; @@ -120,15 +120,15 @@ void BackgroundUtil::GetBackgroundEffects( const CString &_sName, vector &vsPathsOut, vector &vsNamesOut ) +void BackgroundUtil::GetBackgroundTransitions( const RString &_sName, vector &vsPathsOut, vector &vsNamesOut ) { - CString sName = _sName; + RString sName = _sName; if( sName == "" ) sName = "*"; @@ -136,13 +136,13 @@ void BackgroundUtil::GetBackgroundTransitions( const CString &_sName, vector &vsPathsOut, vector &vsNamesOut ) +void BackgroundUtil::GetSongBGAnimations( const Song *pSong, const RString &sMatch, vector &vsPathsOut, vector &vsNamesOut ) { vsPathsOut.clear(); if( sMatch.empty() ) @@ -155,13 +155,13 @@ void BackgroundUtil::GetSongBGAnimations( const Song *pSong, const CString &sMat } vsNamesOut.clear(); - FOREACH_CONST( CString, vsPathsOut, s ) + FOREACH_CONST( RString, vsPathsOut, s ) vsNamesOut.push_back( Basename(*s) ); StripCvs( vsPathsOut, vsNamesOut ); } -void BackgroundUtil::GetSongMovies( const Song *pSong, const CString &sMatch, vector &vsPathsOut, vector &vsNamesOut ) +void BackgroundUtil::GetSongMovies( const Song *pSong, const RString &sMatch, vector &vsPathsOut, vector &vsNamesOut ) { vsPathsOut.clear(); if( sMatch.empty() ) @@ -176,13 +176,13 @@ void BackgroundUtil::GetSongMovies( const Song *pSong, const CString &sMatch, ve } vsNamesOut.clear(); - FOREACH_CONST( CString, vsPathsOut, s ) + FOREACH_CONST( RString, vsPathsOut, s ) vsNamesOut.push_back( Basename(*s) ); StripCvs( vsPathsOut, vsNamesOut ); } -void BackgroundUtil::GetSongBitmaps( const Song *pSong, const CString &sMatch, vector &vsPathsOut, vector &vsNamesOut ) +void BackgroundUtil::GetSongBitmaps( const Song *pSong, const RString &sMatch, vector &vsPathsOut, vector &vsNamesOut ) { vsPathsOut.clear(); if( sMatch.empty() ) @@ -198,13 +198,13 @@ void BackgroundUtil::GetSongBitmaps( const Song *pSong, const CString &sMatch, v } vsNamesOut.clear(); - FOREACH_CONST( CString, vsPathsOut, s ) + FOREACH_CONST( RString, vsPathsOut, s ) vsNamesOut.push_back( Basename(*s) ); StripCvs( vsPathsOut, vsNamesOut ); } -static void GetFilterToFileNames( const CString sBaseDir, const Song *pSong, set &vsPossibleFileNamesOut ) +static void GetFilterToFileNames( const RString sBaseDir, const Song *pSong, set &vsPossibleFileNamesOut ) { vsPossibleFileNamesOut.clear(); @@ -213,10 +213,10 @@ static void GetFilterToFileNames( const CString sBaseDir, const Song *pSong, set ASSERT( !pSong->m_sGroupName.empty() ); IniFile ini; - CString sPath = sBaseDir+pSong->m_sGroupName+"/"+"BackgroundMapping.ini"; + RString sPath = sBaseDir+pSong->m_sGroupName+"/"+"BackgroundMapping.ini"; ini.ReadFile( sPath ); - CString sSection; + RString sSection; bool bSuccess = ini.GetValue( "GenreToSection", pSong->m_sGenre, sSection ); if( !bSuccess ) { @@ -235,13 +235,13 @@ static void GetFilterToFileNames( const CString sBaseDir, const Song *pSong, set vsPossibleFileNamesOut.insert( p->first ); } -void BackgroundUtil::GetGlobalBGAnimations( const Song *pSong, const CString &sMatch, vector &vsPathsOut, vector &vsNamesOut ) +void BackgroundUtil::GetGlobalBGAnimations( const Song *pSong, const RString &sMatch, vector &vsPathsOut, vector &vsNamesOut ) { vsPathsOut.clear(); GetDirListing( BG_ANIMS_DIR+sMatch+"*", vsPathsOut, true, true ); vsNamesOut.clear(); - FOREACH_CONST( CString, vsPathsOut, s ) + FOREACH_CONST( RString, vsPathsOut, s ) vsNamesOut.push_back( Basename(*s) ); StripCvs( vsPathsOut, vsNamesOut ); @@ -249,9 +249,9 @@ void BackgroundUtil::GetGlobalBGAnimations( const Song *pSong, const CString &sM void BackgroundUtil::GetGlobalRandomMovies( const Song *pSong, - const CString &sMatch, - vector &vsPathsOut, - vector &vsNamesOut, + const RString &sMatch, + vector &vsPathsOut, + vector &vsNamesOut, bool bTryInsideOfSongGroupAndGenreFirst, bool bTryInsideOfSongGroupFirst ) { @@ -273,11 +273,11 @@ void BackgroundUtil::GetGlobalRandomMovies( // Search for the most appropriate background // { - set ssFileNameWhitelist; + set ssFileNameWhitelist; if( bTryInsideOfSongGroupAndGenreFirst && pSong && !pSong->m_sGenre.empty() ) GetFilterToFileNames( RANDOMMOVIES_DIR, pSong, ssFileNameWhitelist ); - vector vsDirsToTry; + vector vsDirsToTry; if( bTryInsideOfSongGroupFirst && pSong ) { ASSERT( !pSong->m_sGroupName.empty() ); @@ -285,7 +285,7 @@ void BackgroundUtil::GetGlobalRandomMovies( } vsDirsToTry.push_back( RANDOMMOVIES_DIR ); - FOREACH_CONST( CString, vsDirsToTry, sDir ) + FOREACH_CONST( RString, vsDirsToTry, sDir ) { GetDirListing( *sDir+"*.avi", vsPathsOut, false, true ); GetDirListing( *sDir+"*.mpg", vsPathsOut, false, true ); @@ -295,7 +295,7 @@ void BackgroundUtil::GetGlobalRandomMovies( { for( unsigned i=0; iRight( s->size() - RANDOMMOVIES_DIR.size() - 1 ); + RString sName = s->Right( s->size() - RANDOMMOVIES_DIR.size() - 1 ); vsNamesOut.push_back( sName ); } StripCvs( vsPathsOut, vsNamesOut ); diff --git a/stepmania/src/BackgroundUtil.h b/stepmania/src/BackgroundUtil.h index 5e2c4bb278..a6feba0c97 100644 --- a/stepmania/src/BackgroundUtil.h +++ b/stepmania/src/BackgroundUtil.h @@ -6,27 +6,27 @@ class Song; class XNode; -extern const CString RANDOM_BACKGROUND_FILE; -extern const CString NO_SONG_BG_FILE; -extern const CString SONG_BACKGROUND_FILE; +extern const RString RANDOM_BACKGROUND_FILE; +extern const RString NO_SONG_BG_FILE; +extern const RString SONG_BACKGROUND_FILE; -extern const CString SBE_UpperLeft; -extern const CString SBE_Centered; -extern const CString SBE_StretchNormal; -extern const CString SBE_StretchNoLoop; -extern const CString SBE_StretchRewind; -extern const CString SBT_CrossFade; +extern const RString SBE_UpperLeft; +extern const RString SBE_Centered; +extern const RString SBE_StretchNormal; +extern const RString SBE_StretchNoLoop; +extern const RString SBE_StretchRewind; +extern const RString SBT_CrossFade; struct BackgroundDef { bool operator<( const BackgroundDef &other ) const; bool operator==( const BackgroundDef &other ) const; bool IsEmpty() const { return m_sFile1.empty() && m_sFile2.empty(); } - CString m_sEffect; // "" == automatically choose - CString m_sFile1; // must not be "" - CString m_sFile2; // may be "" - CString m_sColor1; // "" == use default - CString m_sColor2; // "" == use default + RString m_sEffect; // "" == automatically choose + RString m_sFile1; // must not be "" + RString m_sFile2; // may be "" + RString m_sColor1; // "" == use default + RString m_sColor2; // "" == use default XNode *CreateNode() const; }; @@ -40,11 +40,11 @@ struct BackgroundChange } BackgroundChange( float s, - CString f1, - CString f2=CString(), + RString f1, + RString f2=RString(), float r=1.f, - CString e=SBE_Centered, - CString t=CString() + RString e=SBE_Centered, + RString t=RString() ) { m_fStartBeat=s; @@ -57,23 +57,23 @@ struct BackgroundChange BackgroundDef m_def; float m_fStartBeat; float m_fRate; - CString m_sTransition; + RString m_sTransition; - CString GetTextDescription() const; + RString GetTextDescription() const; }; namespace BackgroundUtil { void SortBackgroundChangesArray( vector &vBackgroundChanges ); - void GetBackgroundEffects( const CString &sName, vector &vsPathsOut, vector &vsNamesOut ); - void GetBackgroundTransitions( const CString &sName, vector &vsPathsOut, vector &vsNamesOut ); + void GetBackgroundEffects( const RString &sName, vector &vsPathsOut, vector &vsNamesOut ); + void GetBackgroundTransitions( const RString &sName, vector &vsPathsOut, vector &vsNamesOut ); - void GetSongBGAnimations( const Song *pSong, const CString &sMatch, vector &vsPathsOut, vector &vsNamesOut ); - void GetSongMovies( const Song *pSong, const CString &sMatch, vector &vsPathsOut, vector &vsNamesOut ); - void GetSongBitmaps( const Song *pSong, const CString &sMatch, vector &vsPathsOut, vector &vsNamesOut ); - void GetGlobalBGAnimations( const Song *pSong, const CString &sMatch, vector &vsPathsOut, vector &vsNamesOut ); - void GetGlobalRandomMovies( const Song *pSong, const CString &sMatch, vector &vsPathsOut, vector &vsNamesOut, bool bTryInsideOfSongGroupAndGenreFirst = true, bool bTryInsideOfSongGroupFirst = true ); + void GetSongBGAnimations( const Song *pSong, const RString &sMatch, vector &vsPathsOut, vector &vsNamesOut ); + void GetSongMovies( const Song *pSong, const RString &sMatch, vector &vsPathsOut, vector &vsNamesOut ); + void GetSongBitmaps( const Song *pSong, const RString &sMatch, vector &vsPathsOut, vector &vsNamesOut ); + void GetGlobalBGAnimations( const Song *pSong, const RString &sMatch, vector &vsPathsOut, vector &vsNamesOut ); + void GetGlobalRandomMovies( const Song *pSong, const RString &sMatch, vector &vsPathsOut, vector &vsNamesOut, bool bTryInsideOfSongGroupAndGenreFirst = true, bool bTryInsideOfSongGroupFirst = true ); void BakeAllBackgroundChanges( Song *pSong ); }; diff --git a/stepmania/src/Banner.cpp b/stepmania/src/Banner.cpp index dcee65d147..29a6ccecd5 100644 --- a/stepmania/src/Banner.cpp +++ b/stepmania/src/Banner.cpp @@ -94,9 +94,9 @@ void Banner::LoadMode() m_bScrolling = false; } -void Banner::LoadFromSongGroup( CString sSongGroup ) +void Banner::LoadFromSongGroup( RString sSongGroup ) { - CString sGroupBannerPath = SONGMAN->GetSongGroupBannerPath( sSongGroup ); + RString sGroupBannerPath = SONGMAN->GetSongGroupBannerPath( sSongGroup ); if( sGroupBannerPath != "" ) Load( sGroupBannerPath ); else LoadFallback(); m_bScrolling = false; diff --git a/stepmania/src/Banner.h b/stepmania/src/Banner.h index 4eaf76764d..321fad8131 100644 --- a/stepmania/src/Banner.h +++ b/stepmania/src/Banner.h @@ -23,7 +23,7 @@ public: void LoadFromSong( Song* pSong ); // NULL means no song void LoadAllMusic(); void LoadMode(); - void LoadFromSongGroup( CString sSongGroup ); + void LoadFromSongGroup( RString sSongGroup ); void LoadFromCourse( Course* pCourse ); void LoadCardFromCharacter( Character* pCharacter ); void LoadIconFromCharacter( Character* pCharacter ); diff --git a/stepmania/src/BannerCache.cpp b/stepmania/src/BannerCache.cpp index c0e1bd0067..39a2e03053 100644 --- a/stepmania/src/BannerCache.cpp +++ b/stepmania/src/BannerCache.cpp @@ -23,7 +23,7 @@ /* Neither a global or a file scope static can be used for this because * the order of initialization of nonlocal objects is unspecified. */ -//const CString BANNER_CACHE_INDEX = SpecialFiles::CACHE_DIR + "banners.cache"; +//const RString BANNER_CACHE_INDEX = SpecialFiles::CACHE_DIR + "banners.cache"; #define BANNER_CACHE_INDEX (SpecialFiles::CACHE_DIR + "banners.cache") /* Call CacheBanner to cache a banner by path. If the banner is already @@ -48,10 +48,10 @@ BannerCache *BANNERCACHE; -static map g_BannerPathToImage; +static map g_BannerPathToImage; static int g_iDemandRefcount = 0; -CString BannerCache::GetBannerCachePath( CString BannerPath ) +RString BannerCache::GetBannerCachePath( RString BannerPath ) { return SongCacheIndex::GetCacheFilePath( "Banners", BannerPath ); } @@ -70,12 +70,12 @@ void BannerCache::Demand() FOREACH_Child( &BannerData, p ) { - CString sBannerPath = p->m_sName; + RString sBannerPath = p->m_sName; if( g_BannerPathToImage.find(sBannerPath) != g_BannerPathToImage.end() ) continue; /* already loaded */ - const CString CachePath = GetBannerCachePath(sBannerPath); + const RString CachePath = GetBannerCachePath(sBannerPath); RageSurface *img = RageSurfaceUtils::LoadSurface( CachePath ); if( img == NULL ) { @@ -103,7 +103,7 @@ void BannerCache::Undemand() * the cache file if necessary. Unlike CacheBanner(), the original file will * not be examined unless the cached banner doesn't exist, so the banner will * not be updated if the original file changes, for efficiency. */ -void BannerCache::LoadBanner( CString BannerPath ) +void BannerCache::LoadBanner( RString BannerPath ) { if( BannerPath == "" ) return; // nothing to do @@ -112,7 +112,7 @@ void BannerCache::LoadBanner( CString BannerPath ) return; /* Load it. */ - const CString CachePath = GetBannerCachePath(BannerPath); + const RString CachePath = GetBannerCachePath(BannerPath); for( int tries = 0; tries < 2; ++tries ) { @@ -146,7 +146,7 @@ void BannerCache::LoadBanner( CString BannerPath ) void BannerCache::OutputStats() const { - map::const_iterator ban; + map::const_iterator ban; int total_size = 0; for( ban = g_BannerPathToImage.begin(); ban != g_BannerPathToImage.end(); ++ban ) { @@ -159,7 +159,7 @@ void BannerCache::OutputStats() const void BannerCache::UnloadAllBanners() { - map::iterator it; + map::iterator it; for( it = g_BannerPathToImage.begin(); it != g_BannerPathToImage.end(); ++it ) delete it->second; @@ -258,7 +258,7 @@ struct BannerTexture: public RageTexture }; /* If a banner is cached, get its ID for use. */ -RageTextureID BannerCache::LoadCachedBanner( CString BannerPath ) +RageTextureID BannerCache::LoadCachedBanner( RString BannerPath ) { RageTextureID ID( GetBannerCachePath(BannerPath) ); @@ -327,7 +327,7 @@ static inline int closest( int num, int n1, int n2 ) /* Create or update the banner cache file as necessary. If in preload mode, * load the cache file, too. (This is done at startup.) */ -void BannerCache::CacheBanner( CString BannerPath ) +void BannerCache::CacheBanner( RString BannerPath ) { if( PREFSMAN->m_BannerCache != PrefsManager::BNCACHE_LOW_RES_PRELOAD && PREFSMAN->m_BannerCache != PrefsManager::BNCACHE_LOW_RES_LOAD_ON_DEMAND ) @@ -337,7 +337,7 @@ void BannerCache::CacheBanner( CString BannerPath ) if( !DoesFileExist(BannerPath) ) return; - const CString CachePath = GetBannerCachePath(BannerPath); + const RString CachePath = GetBannerCachePath(BannerPath); /* Check the full file hash. If it's the loaded and identical, don't recache. */ if( DoesFileExist(CachePath) ) @@ -366,9 +366,9 @@ void BannerCache::CacheBanner( CString BannerPath ) CacheBannerInternal( BannerPath ); } -void BannerCache::CacheBannerInternal( CString BannerPath ) +void BannerCache::CacheBannerInternal( RString BannerPath ) { - CString error; + RString error; RageSurface *img = RageSurfaceUtils::LoadFile( BannerPath, error ); if( img == NULL ) { @@ -473,7 +473,7 @@ void BannerCache::CacheBannerInternal( CString BannerPath ) img = dst; } - const CString CachePath = GetBannerCachePath(BannerPath); + const RString CachePath = GetBannerCachePath(BannerPath); RageSurfaceUtils::SaveSurface( img, CachePath ); /* If an old image is loaded, free it. */ diff --git a/stepmania/src/BannerCache.h b/stepmania/src/BannerCache.h index 8263e3c349..9813978493 100644 --- a/stepmania/src/BannerCache.h +++ b/stepmania/src/BannerCache.h @@ -13,17 +13,17 @@ class BannerCache { IniFile BannerData; - static CString GetBannerCachePath( CString BannerPath ); + static RString GetBannerCachePath( RString BannerPath ); void UnloadAllBanners(); - void CacheBannerInternal( CString BannerPath ); + void CacheBannerInternal( RString BannerPath ); public: BannerCache(); ~BannerCache(); - RageTextureID LoadCachedBanner( CString BannerPath ); - void CacheBanner( CString BannerPath ); - void LoadBanner( CString BannerPath ); + RageTextureID LoadCachedBanner( RString BannerPath ); + void CacheBanner( RString BannerPath ); + void LoadBanner( RString BannerPath ); void Demand(); void Undemand(); diff --git a/stepmania/src/BeginnerHelper.cpp b/stepmania/src/BeginnerHelper.cpp index 0fec898fa1..f578c92991 100644 --- a/stepmania/src/BeginnerHelper.cpp +++ b/stepmania/src/BeginnerHelper.cpp @@ -51,9 +51,9 @@ static const char *anims[NUM_ANIMATIONS] = "BeginnerHelper_step-jumplr.bones.txt" }; -static CString GetAnimPath(Animation a) +static RString GetAnimPath(Animation a) { - return CString("Characters/") + anims[a]; + return RString("Characters/") + anims[a]; } BeginnerHelper::BeginnerHelper() diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index 62fc2cd43d..1b7526bc0d 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -93,17 +93,17 @@ BitmapText &BitmapText::operator =( const BitmapText &cpy ) return *this; } -void BitmapText::LoadFromNode( const CString& sDir, const XNode* pNode ) +void BitmapText::LoadFromNode( const RString& sDir, const XNode* pNode ) { - CString sText; + RString sText; pNode->GetAttrValue( "Text", sText ); - CString sAltText; + RString sAltText; pNode->GetAttrValue( "AltText", sAltText ); ThemeManager::EvaluateString( sText ); ThemeManager::EvaluateString( sAltText ); - CString sFont; + RString sFont; pNode->GetAttrValue( "Font", sFont ); if( sFont.empty() ) pNode->GetAttrValue("File", sFont ); // accept "File" for backward compatibility @@ -120,7 +120,7 @@ void BitmapText::LoadFromNode( const CString& sDir, const XNode* pNode ) } -bool BitmapText::LoadFromFont( const CString& sFontFilePath ) +bool BitmapText::LoadFromFont( const RString& sFontFilePath ) { CHECKPOINT_M( ssprintf("BitmapText::LoadFromFont(%s)", sFontFilePath.c_str()) ); @@ -138,7 +138,7 @@ bool BitmapText::LoadFromFont( const CString& sFontFilePath ) } -bool BitmapText::LoadFromTextureAndChars( const CString& sTexturePath, const CString& sChars ) +bool BitmapText::LoadFromTextureAndChars( const RString& sTexturePath, const RString& sChars ) { CHECKPOINT_M( ssprintf("BitmapText::LoadFromTextureAndChars(\"%s\",\"%s\")", sTexturePath.c_str(), sChars.c_str()) ); @@ -339,11 +339,11 @@ void BitmapText::DrawChars() /* sText is UTF-8. If not all of the characters in sText are available in the * font, sAlternateText will be used instead. If there are unavailable characters * in sAlternateText, too, just use sText. */ -void BitmapText::SetText( const CString& _sText, const CString& _sAlternateText, int iWrapWidthPixels ) +void BitmapText::SetText( const RString& _sText, const RString& _sAlternateText, int iWrapWidthPixels ) { ASSERT( m_pFont ); - CString sNewText = StringWillUseAlternate(_sText,_sAlternateText) ? _sAlternateText : _sText; + RString sNewText = StringWillUseAlternate(_sText,_sAlternateText) ? _sAlternateText : _sText; if( iWrapWidthPixels == -1 ) // wrap not specified iWrapWidthPixels = m_iWrapWidthPixels; @@ -372,20 +372,20 @@ void BitmapText::SetText( const CString& _sText, const CString& _sAlternateText, /* It doesn't. I can add Japanese wrapping, at least. We could handle hyphens * and soft hyphens and pretty easily, too. -glenn */ // TODO: Move this wrapping logic into Font - vector asLines; + vector asLines; split( m_sText, "\n", asLines, false ); for( unsigned line = 0; line < asLines.size(); ++line ) { - vector asWords; + vector asWords; split( asLines[line], " ", asWords ); - CString sCurLine; + RString sCurLine; int iCurLineWidth = 0; for( unsigned i=0; iGetLineWidthInSourcePixels( RStringToWstring(sWord) ); if( sCurLine.empty() ) @@ -395,7 +395,7 @@ void BitmapText::SetText( const CString& _sText, const CString& _sAlternateText, continue; } - CString sToAdd = " " + sWord; + RString sToAdd = " " + sWord; int iWidthToAdd = m_pFont->GetLineWidthInSourcePixels(L" ") + iWidthWord; if( iCurLineWidth + iWidthToAdd <= iWrapWidthPixels ) // will fit on current line { @@ -462,7 +462,7 @@ void BitmapText::UpdateBaseZoom() } } -bool BitmapText::StringWillUseAlternate( const CString& sText, const CString& sAlternateText ) const +bool BitmapText::StringWillUseAlternate( const RString& sText, const RString& sAlternateText ) const { ASSERT( m_pFont ); @@ -598,11 +598,11 @@ ColorBitmapText::ColorBitmapText( ) : BitmapText() m_vColors.clear(); } -void ColorBitmapText::SetText( const CString& _sText, const CString& _sAlternateText, int iWrapWidthPixels ) +void ColorBitmapText::SetText( const RString& _sText, const RString& _sAlternateText, int iWrapWidthPixels ) { ASSERT( m_pFont ); - CString sNewText = StringWillUseAlternate(_sText,_sAlternateText) ? _sAlternateText : _sText; + RString sNewText = StringWillUseAlternate(_sText,_sAlternateText) ? _sAlternateText : _sText; if( iWrapWidthPixels == -1 ) // wrap not specified iWrapWidthPixels = m_iWrapWidthPixels; @@ -621,10 +621,10 @@ void ColorBitmapText::SetText( const CString& _sText, const CString& _sAlternate m_wTextLines.clear(); - CString sCurrentLine = ""; + RString sCurrentLine = ""; int iLineWidth = 0; - CString sCurrentWord = ""; + RString sCurrentWord = ""; int iWordWidth = 0; int iGlyphsSoFar = 0; @@ -634,7 +634,7 @@ void ColorBitmapText::SetText( const CString& _sText, const CString& _sAlternate // First: Check for the special (color) case. - CString FirstThree = m_sText.substr( i, 3 ); + RString FirstThree = m_sText.substr( i, 3 ); if( FirstThree.CompareNoCase("|c0") == 0 && iCharsLeft > 8 ) { ColorChange change; @@ -652,7 +652,7 @@ void ColorBitmapText::SetText( const CString& _sText, const CString& _sAlternate continue; } - CString curCStr = m_sText.substr( i, 1 ); + RString curCStr = m_sText.substr( i, 1 ); char curChar = curCStr.c_str()[0]; int iCharLen = m_pFont->GetLineWidthInSourcePixels( RStringToWstring( curCStr ) ); @@ -723,7 +723,7 @@ void ColorBitmapText::SetText( const CString& _sText, const CString& _sAlternate UpdateBaseZoom(); } -void ColorBitmapText::SimpleAddLine( const CString &sAddition, const int iWidthPixels) +void ColorBitmapText::SimpleAddLine( const RString &sAddition, const int iWidthPixels) { m_wTextLines.push_back( RStringToWstring( sAddition ) ); m_iLineWidths.push_back( iWidthPixels ); @@ -851,7 +851,7 @@ public: static int maxheight( T* p, lua_State *L ) { p->SetMaxHeight( FArg(1) ); return 0; } static int settext( T* p, lua_State *L ) { - CString s = SArg(1); + RString s = SArg(1); // XXX: Lua strings should simply use "\n" natively. However, some // settext calls may be made from GetMetric() calls to other strings, // and it's confusing for :: to work in some strings and not others. diff --git a/stepmania/src/BitmapText.h b/stepmania/src/BitmapText.h index 29ad58be9f..927d6ce142 100644 --- a/stepmania/src/BitmapText.h +++ b/stepmania/src/BitmapText.h @@ -16,12 +16,12 @@ public: BitmapText &operator =( const BitmapText &cpy ); virtual ~BitmapText(); - virtual void LoadFromNode( const CString& sDir, const XNode* pNode ); + virtual void LoadFromNode( const RString& sDir, const XNode* pNode ); virtual Actor *Copy() const; - bool LoadFromFont( const CString& sFontName ); - bool LoadFromTextureAndChars( const CString& sTexturePath, const CString& sChars ); - void SetText( const CString& sText, const CString& sAlternateText = "", int iWrapWidthPixels = -1 ); + bool LoadFromFont( const RString& sFontName ); + bool LoadFromTextureAndChars( const RString& sTexturePath, const RString& sChars ); + void SetText( const RString& sText, const RString& sAlternateText = "", int iWrapWidthPixels = -1 ); void SetMaxWidth( float fMaxWidth ); void SetMaxHeight( float fMaxHeight ); void SetWrapWidthPixels( int iWrapWidthPixels ); @@ -38,9 +38,9 @@ public: void GetLines( vector &wTextLines ) { wTextLines = m_wTextLines; } - CString GetText() const { return m_sText; } + RString GetText() const { return m_sText; } /* Return true if the string 's' will use an alternate string, if available. */ - bool StringWillUseAlternate( const CString& sText, const CString& sAlternateText ) const; + bool StringWillUseAlternate( const RString& sText, const RString& sAlternateText ) const; // // Commands @@ -53,7 +53,7 @@ public: protected: // recalculate the items in SetText() - CString m_sText; + RString m_sText; vector m_wTextLines; vector m_iLineWidths; // in source pixels int m_iWrapWidthPixels; // -1 = no wrap @@ -74,10 +74,10 @@ class ColorBitmapText : public BitmapText { public: ColorBitmapText(); - void SetText( const CString &sText, const CString &sAlternateText = "", int iWrapWidthPixels = -1 ); + void SetText( const RString &sText, const RString &sAlternateText = "", int iWrapWidthPixels = -1 ); void DrawPrimitives(); void SetMaxLines( int iLines, bool bCutBottom = true ); //if bCutBottom = false then, it will crop the top - void SimpleAddLine( const CString &sAddition, int iWidthPixels ); + void SimpleAddLine( const RString &sAddition, int iWidthPixels ); void SetMaxLines( int iNumLines, int iDirection ); protected: struct ColorChange diff --git a/stepmania/src/Bookkeeper.cpp b/stepmania/src/Bookkeeper.cpp index bbac9ecfab..eb34ff8de1 100644 --- a/stepmania/src/Bookkeeper.cpp +++ b/stepmania/src/Bookkeeper.cpp @@ -13,7 +13,7 @@ Bookkeeper* BOOKKEEPER = NULL; // global and accessable from anywhere in our program -static const CString COINS_DAT = "Save/Coins.xml"; +static const RString COINS_DAT = "Save/Coins.xml"; Bookkeeper::Bookkeeper() { diff --git a/stepmania/src/CatalogXml.cpp b/stepmania/src/CatalogXml.cpp index c88d5ea7c0..29aa785ee4 100644 --- a/stepmania/src/CatalogXml.cpp +++ b/stepmania/src/CatalogXml.cpp @@ -31,9 +31,9 @@ #define FOOTER_TEXT THEME->GetMetric ("CatalogXml","FooterText") #define FOOTER_LINK THEME->GetMetric ("CatalogXml","FooterLink") -const CString CATALOG_XML = "Catalog.xml"; -const CString CATALOG_XSL = "Catalog.xsl"; -const CString CATALOG_XML_FILE = "Save/" + CATALOG_XML; +const RString CATALOG_XML = "Catalog.xml"; +const RString CATALOG_XSL = "Catalog.xsl"; +const RString CATALOG_XML_FILE = "Save/" + CATALOG_XML; static LocalizedString SAVING_CATALOG_XML( "CatalogXml", "Saving %s ..." ); void SaveCatalogXml( LoadingWindow *loading_window ) @@ -44,7 +44,7 @@ void SaveCatalogXml( LoadingWindow *loading_window ) if( loading_window ) loading_window->SetText( ssprintf(SAVING_CATALOG_XML.GetValue(),CATALOG_XML.c_str()) ); - CString fn = CATALOG_XML_FILE; + RString fn = CATALOG_XML_FILE; LOG->Trace( "Writing %s ...", fn.c_str() ); @@ -60,9 +60,9 @@ void SaveCatalogXml( LoadingWindow *loading_window ) int iTotalSongs = 0; int iTotalSteps = 0; - vector vsGroups; + vector vsGroups; SONGMAN->GetSongGroupNames( vsGroups ); - FOREACH_CONST( CString, vsGroups, sGroup ) + FOREACH_CONST( RString, vsGroups, sGroup ) { XNode* p1 = pNumSongsByGroup->AppendChild( "Group" ); p1->AppendAttr( "Name", *sGroup ); @@ -347,14 +347,14 @@ void SaveCatalogXml( LoadingWindow *loading_window ) { XNode* pNode2 = pNode->AppendChild( "Modifier" ); - vector modifiers; + vector modifiers; THEME->GetModifierNames( modifiers ); - FOREACH_CONST( CString, modifiers, iter ) + FOREACH_CONST( RString, modifiers, iter ) { PlayerOptions po; - CString s = *iter; + RString s = *iter; po.FromString( s, false ); - vector v; + vector v; po.GetThemedMods( v ); if( v.empty() ) continue; diff --git a/stepmania/src/CatalogXml.h b/stepmania/src/CatalogXml.h index 6c5f96246f..7af5586fec 100644 --- a/stepmania/src/CatalogXml.h +++ b/stepmania/src/CatalogXml.h @@ -5,9 +5,9 @@ class LoadingWindow; -extern const CString CATALOG_XML; -extern const CString CATALOG_XSL; -extern const CString CATALOG_XML_FILE; +extern const RString CATALOG_XML; +extern const RString CATALOG_XSL; +extern const RString CATALOG_XML_FILE; void SaveCatalogXml( LoadingWindow *ld ); diff --git a/stepmania/src/Character.cpp b/stepmania/src/Character.cpp index 0a21831d59..e63bb51565 100644 --- a/stepmania/src/Character.cpp +++ b/stepmania/src/Character.cpp @@ -9,7 +9,7 @@ Character::Character() m_iPreloadRefcount = 0; } -bool Character::Load( CString sCharDir ) +bool Character::Load( RString sCharDir ) { // Save character directory if( sCharDir.Right(1) != "/" ) @@ -19,13 +19,13 @@ bool Character::Load( CString sCharDir ) // save ID { - vector as; + vector as; split( sCharDir, "/", as ); m_sCharacterID = as.back(); } { - vector as; + vector as; GetDirListing( m_sCharDir+"card.png", as, false, true ); GetDirListing( m_sCharDir+"card.jpg", as, false, true ); GetDirListing( m_sCharDir+"card.gif", as, false, true ); @@ -37,7 +37,7 @@ bool Character::Load( CString sCharDir ) } { - vector as; + vector as; GetDirListing( m_sCharDir+"icon.png", as, false, true ); GetDirListing( m_sCharDir+"icon.jpg", as, false, true ); GetDirListing( m_sCharDir+"icon.gif", as, false, true ); @@ -65,45 +65,45 @@ bool Character::Load( CString sCharDir ) } -CString GetRandomFileInDir( CString sDir ) +RString GetRandomFileInDir( RString sDir ) { - vector asFiles; + vector asFiles; GetDirListing( sDir, asFiles, false, true ); if( asFiles.empty() ) - return CString(); + return RString(); else return asFiles[rand()%asFiles.size()]; } -CString Character::GetModelPath() const +RString Character::GetModelPath() const { - CString s = m_sCharDir + "model.txt"; + RString s = m_sCharDir + "model.txt"; if( DoesFileExist(s) ) return s; else - return CString(); + return RString(); } -CString Character::GetRestAnimationPath() const { return DerefRedir(GetRandomFileInDir(m_sCharDir + "Rest/")); } -CString Character::GetWarmUpAnimationPath() const { return DerefRedir(GetRandomFileInDir(m_sCharDir + "WarmUp/")); } -CString Character::GetDanceAnimationPath() const { return DerefRedir(GetRandomFileInDir(m_sCharDir + "Dance/")); } -CString Character::GetTakingABreakPath() const +RString Character::GetRestAnimationPath() const { return DerefRedir(GetRandomFileInDir(m_sCharDir + "Rest/")); } +RString Character::GetWarmUpAnimationPath() const { return DerefRedir(GetRandomFileInDir(m_sCharDir + "WarmUp/")); } +RString Character::GetDanceAnimationPath() const { return DerefRedir(GetRandomFileInDir(m_sCharDir + "Dance/")); } +RString Character::GetTakingABreakPath() const { - vector as; + vector as; GetDirListing( m_sCharDir+"break.png", as, false, true ); GetDirListing( m_sCharDir+"break.jpg", as, false, true ); GetDirListing( m_sCharDir+"break.gif", as, false, true ); GetDirListing( m_sCharDir+"break.bmp", as, false, true ); if( as.empty() ) - return CString(); + return RString(); else return as[0]; } -CString Character::GetSongSelectIconPath() const +RString Character::GetSongSelectIconPath() const { - vector as; + vector as; // first try and find an icon specific to the select music screen // so you can have different icons for music select / char select GetDirListing( m_sCharDir+"selectmusicicon.png", as, false, true ); @@ -119,7 +119,7 @@ CString Character::GetSongSelectIconPath() const GetDirListing( m_sCharDir+"icon.gif", as, false, true ); GetDirListing( m_sCharDir+"icon.bmp", as, false, true ); if( as.empty() ) - return CString(); + return RString(); else return as[0]; } @@ -127,9 +127,9 @@ CString Character::GetSongSelectIconPath() const return as[0]; } -CString Character::GetStageIconPath() const +RString Character::GetStageIconPath() const { - vector as; + vector as; // first try and find an icon specific to the select music screen // so you can have different icons for music select / char select GetDirListing( m_sCharDir+"stageicon.png", as, false, true ); @@ -145,7 +145,7 @@ CString Character::GetStageIconPath() const GetDirListing( m_sCharDir+"card.gif", as, false, true ); GetDirListing( m_sCharDir+"card.bmp", as, false, true ); if( as.empty() ) - return CString(); + return RString(); else return as[0]; } @@ -179,7 +179,7 @@ void Character::DemandGraphics() ++m_iPreloadRefcount; if( m_iPreloadRefcount == 1 ) { - CString s = GetIconPath(); + RString s = GetIconPath(); if( !s.empty() ) m_Preload.Load( s ); } @@ -205,8 +205,8 @@ public: static int GetSongSelectIconPath( T* p, lua_State *L ) { lua_pushstring(L, p->GetSongSelectIconPath() ); return 1; } static int GetStageIconPath( T* p, lua_State *L ) { lua_pushstring(L, p->GetStageIconPath() ); return 1; } - CString GetCardPath() const; - CString GetIconPath() const; + RString GetCardPath() const; + RString GetIconPath() const; static void Register( Lua *L ) { diff --git a/stepmania/src/Character.h b/stepmania/src/Character.h index 20b96886a4..13e686c966 100644 --- a/stepmania/src/Character.h +++ b/stepmania/src/Character.h @@ -15,18 +15,18 @@ public: Character(); ~Character() { } - bool Load( CString sCharDir ); // return true if success + bool Load( RString sCharDir ); // return true if success - CString GetTakingABreakPath() const; - CString GetCardPath() const { return m_sCardPath; } - CString GetIconPath() const { return m_sIconPath; } + RString GetTakingABreakPath() const; + RString GetCardPath() const { return m_sCardPath; } + RString GetIconPath() const { return m_sIconPath; } - CString GetModelPath() const; - CString GetRestAnimationPath() const; - CString GetWarmUpAnimationPath() const; - CString GetDanceAnimationPath() const; - CString GetSongSelectIconPath() const; - CString GetStageIconPath() const; + RString GetModelPath() const; + RString GetRestAnimationPath() const; + RString GetWarmUpAnimationPath() const; + RString GetDanceAnimationPath() const; + RString GetSongSelectIconPath() const; + RString GetStageIconPath() const; bool Has2DElems(); bool IsDefaultCharacter() const @@ -43,21 +43,21 @@ public: void PushSelf( Lua *L ); // smart accessor - const CString &GetDisplayName() { return !m_sDisplayName.empty() ? m_sDisplayName : m_sCharacterID; } + const RString &GetDisplayName() { return !m_sDisplayName.empty() ? m_sDisplayName : m_sCharacterID; } - CString m_sCharDir; - CString m_sCharacterID; + RString m_sCharDir; + RString m_sCharacterID; private: - CString m_sDisplayName; - CString m_sCardPath; - CString m_sIconPath; + RString m_sDisplayName; + RString m_sCardPath; + RString m_sIconPath; public: // All the stuff below will be filled in if this character is playable in Rave mode bool m_bUsableInRave; - CString m_sAttacks[NUM_ATTACK_LEVELS][NUM_ATTACKS_PER_LEVEL]; + RString m_sAttacks[NUM_ATTACK_LEVELS][NUM_ATTACKS_PER_LEVEL]; RageTexturePreloader m_Preload; int m_iPreloadRefcount; }; diff --git a/stepmania/src/CharacterManager.cpp b/stepmania/src/CharacterManager.cpp index 7b16e68d27..a1c461966b 100644 --- a/stepmania/src/CharacterManager.cpp +++ b/stepmania/src/CharacterManager.cpp @@ -14,14 +14,14 @@ CharacterManager::CharacterManager() SAFE_DELETE( m_pCharacters[i] ); m_pCharacters.clear(); - vector as; + vector as; GetDirListing( CHARACTERS_DIR "*", as, true, true ); StripCvs( as ); bool FoundDefault = false; for( unsigned i=0; iUndemandGraphics(); } -Character* CharacterManager::GetCharacterFromID( CString sCharacterID ) +Character* CharacterManager::GetCharacterFromID( RString sCharacterID ) { for( unsigned i=0; i &vpCharactersOut ); Character* GetRandomCharacter(); Character* GetDefaultCharacter(); - Character* GetCharacterFromID( CString sCharacterID ); + Character* GetCharacterFromID( RString sCharacterID ); void DemandGraphics(); void UndemandGraphics(); diff --git a/stepmania/src/CodeDetector.cpp b/stepmania/src/CodeDetector.cpp index a84f2bdfd6..ebaea719d6 100644 --- a/stepmania/src/CodeDetector.cpp +++ b/stepmania/src/CodeDetector.cpp @@ -89,12 +89,12 @@ bool CodeItem::EnteredCode( GameController controller ) const } } -bool CodeItem::Load( CString sButtonsNames ) +bool CodeItem::Load( RString sButtonsNames ) { buttons.clear(); const Game* pGame = GAMESTATE->GetCurrentGame(); - vector asButtonNames; + vector asButtonNames; bool bHasAPlus = sButtonsNames.find( '+' ) != string::npos; bool bHasADash = sButtonsNames.find( '-' ) != string::npos; @@ -124,7 +124,7 @@ bool CodeItem::Load( CString sButtonsNames ) for( unsigned i=0; iButtonNameToIndex( sButtonName ); @@ -166,15 +166,15 @@ bool CodeDetector::EnteredCode( GameController controller, Code code ) } -void CodeDetector::RefreshCacheItems( CString sClass ) +void CodeDetector::RefreshCacheItems( RString sClass ) { if( sClass == "" ) sClass = "CodeDetector"; FOREACH_Code( c ) { CodeItem& item = g_CodeItems[c]; - const CString sCodeName = CodeToString(c); - const CString sButtonsNames = THEME->GetMetric(sClass,sCodeName); + const RString sCodeName = CodeToString(c); + const RString sButtonsNames = THEME->GetMetric(sClass,sCodeName); item.Load( sButtonsNames ); } diff --git a/stepmania/src/CodeDetector.h b/stepmania/src/CodeDetector.h index e378f47047..e22cd4d45c 100644 --- a/stepmania/src/CodeDetector.h +++ b/stepmania/src/CodeDetector.h @@ -52,7 +52,7 @@ enum Code { struct CodeItem { public: - bool Load( CString sButtonsNames ); + bool Load( RString sButtonsNames ); bool EnteredCode( GameController controller ) const; private: @@ -70,7 +70,7 @@ private: class CodeDetector { public: - static void RefreshCacheItems( CString sClass="" ); // call this before checking codes, but call infrequently + static void RefreshCacheItems( RString sClass="" ); // call this before checking codes, but call infrequently static bool EnteredEasierDifficulty( GameController controller ); static bool EnteredHarderDifficulty( GameController controller ); static bool EnteredNextSort( GameController controller ); diff --git a/stepmania/src/CombinedLifeMeterTug.cpp b/stepmania/src/CombinedLifeMeterTug.cpp index 6ef8952b07..8bf504f285 100644 --- a/stepmania/src/CombinedLifeMeterTug.cpp +++ b/stepmania/src/CombinedLifeMeterTug.cpp @@ -8,7 +8,7 @@ ThemeMetric METER_WIDTH ("CombinedLifeMeterTug","MeterWidth"); -static void TugMeterPercentChangeInit( size_t /*ScoreEvent*/ i, CString &sNameOut, float &defaultValueOut ) +static void TugMeterPercentChangeInit( size_t /*ScoreEvent*/ i, RString &sNameOut, float &defaultValueOut ) { sNameOut = "TugMeterPercentChange" + ScoreEventToString( (ScoreEvent)i ); switch( i ) @@ -32,8 +32,8 @@ CombinedLifeMeterTug::CombinedLifeMeterTug() { FOREACH_PlayerNumber( p ) { - CString sStreamPath = THEME->GetPathG("CombinedLifeMeterTug",ssprintf("stream p%d",p+1)); - CString sTipPath = THEME->GetPathG("CombinedLifeMeterTug",ssprintf("tip p%d",p+1)); + RString sStreamPath = THEME->GetPathG("CombinedLifeMeterTug",ssprintf("stream p%d",p+1)); + RString sTipPath = THEME->GetPathG("CombinedLifeMeterTug",ssprintf("tip p%d",p+1)); m_Stream[p].Load( sStreamPath, METER_WIDTH, sTipPath ); this->AddChild( &m_Stream[p] ); } diff --git a/stepmania/src/Combo.cpp b/stepmania/src/Combo.cpp index 9acf9f9e34..65e5ce4bc9 100644 --- a/stepmania/src/Combo.cpp +++ b/stepmania/src/Combo.cpp @@ -99,7 +99,7 @@ void Combo::SetCombo( int iCombo, int iMisses ) m_sprMissesLabel->SetHidden( !bComboOfMisses ); m_textNumber.SetHidden( false ); - CString txt = ssprintf("%d", iNum); + RString txt = ssprintf("%d", iNum); // Do pulse even if the number isn't changing. diff --git a/stepmania/src/ComboGraph.cpp b/stepmania/src/ComboGraph.cpp index 2366b370e2..5bf51e32e0 100644 --- a/stepmania/src/ComboGraph.cpp +++ b/stepmania/src/ComboGraph.cpp @@ -19,7 +19,7 @@ ComboGraph::ComboGraph() m_pMaxComboText = NULL; } -void ComboGraph::LoadFromNode( const CString& sDir, const XNode* pNode ) +void ComboGraph::LoadFromNode( const RString& sDir, const XNode* pNode ) { ActorFrame::LoadFromNode( sDir, pNode ); diff --git a/stepmania/src/ComboGraph.h b/stepmania/src/ComboGraph.h index 84c7e622e6..35bebf77d5 100644 --- a/stepmania/src/ComboGraph.h +++ b/stepmania/src/ComboGraph.h @@ -12,7 +12,7 @@ class ComboGraph: public ActorFrame public: ComboGraph(); void Load( const StageStats &s, const PlayerStageStats &pss ); - virtual void LoadFromNode( const CString& sDir, const XNode* pNode ); + virtual void LoadFromNode( const RString& sDir, const XNode* pNode ); virtual Actor *Copy() const; virtual bool AutoLoadChildren() const { return true; } diff --git a/stepmania/src/Command.cpp b/stepmania/src/Command.cpp index 1512365ac7..96fc361dda 100644 --- a/stepmania/src/Command.cpp +++ b/stepmania/src/Command.cpp @@ -9,17 +9,17 @@ void IncorrectNumberArgsWarning( const Command &command, int iMaxIndexAccessed ) { - const CString sError = ssprintf( "Actor::HandleCommand: Wrong number of arguments in command '%s'. Expected %d but there are %u.", + const RString sError = ssprintf( "Actor::HandleCommand: Wrong number of arguments in command '%s'. Expected %d but there are %u.", command.GetOriginalCommandString().c_str(), iMaxIndexAccessed+1, unsigned(command.m_vsArgs.size()) ); LOG->Warn( sError ); Dialog::OK( sError ); } -CString Command::GetName() const +RString Command::GetName() const { if( m_vsArgs.empty() ) - return CString(); - CString s = m_vsArgs[0]; + return RString(); + RString s = m_vsArgs[0]; s.MakeLower(); return s; } @@ -32,46 +32,46 @@ Command::Arg Command::GetArg( unsigned index ) const return a; } -Command::Arg::operator CString () const +Command::Arg::operator RString () const { - CString sValue = s; + RString sValue = s; LuaHelpers::RunAtExpressionS( sValue ); return sValue; } Command::Arg::operator float () const { - CString sValue = s; + RString sValue = s; LuaHelpers::PrepareExpression( sValue ); // strip invalid chars return LuaHelpers::RunExpressionF( sValue ); } Command::Arg::operator int () const { - CString sValue = s; + RString sValue = s; LuaHelpers::PrepareExpression( sValue ); // strip invalid chars return (int) LuaHelpers::RunExpressionF( sValue ); } Command::Arg::operator bool () const { - CString sValue = s; + RString sValue = s; LuaHelpers::PrepareExpression( sValue ); // strip invalid chars return LuaHelpers::RunExpressionF( sValue ) != 0.0f; } -void Command::Load( const CString &sCommand ) +void Command::Load( const RString &sCommand ) { m_vsArgs.clear(); split( sCommand, ",", m_vsArgs, false ); // don't ignore empty } -CString Command::GetOriginalCommandString() const +RString Command::GetOriginalCommandString() const { return join( ",", m_vsArgs ); } -static void SplitWithQuotes( const CString sSource, const char Delimitor, vector &asOut, const bool bIgnoreEmpty ) +static void SplitWithQuotes( const RString sSource, const char Delimitor, vector &asOut, const bool bIgnoreEmpty ) { /* Short-circuit if the source is empty; we want to return an empty vector if * the string is empty, even if bIgnoreEmpty is true. */ @@ -107,7 +107,7 @@ static void SplitWithQuotes( const CString sSource, const char Delimitor, vector asOut.push_back( sSource ); else { - const CString AddCString = sSource.substr( startpos, pos-startpos ); + const RString AddCString = sSource.substr( startpos, pos-startpos ); asOut.push_back( AddCString ); } } @@ -116,17 +116,17 @@ static void SplitWithQuotes( const CString sSource, const char Delimitor, vector } while( startpos <= sSource.size() ); } -CString Commands::GetOriginalCommandString() const +RString Commands::GetOriginalCommandString() const { - CString s; + RString s; FOREACH_CONST( Command, v, c ) s += c->GetOriginalCommandString(); return s; } -void ParseCommands( const CString &sCommands, Commands &vCommandsOut ) +void ParseCommands( const RString &sCommands, Commands &vCommandsOut ) { - vector vsCommands; + vector vsCommands; SplitWithQuotes( sCommands, ';', vsCommands, true ); // do ignore empty vCommandsOut.v.resize( vsCommands.size() ); @@ -137,7 +137,7 @@ void ParseCommands( const CString &sCommands, Commands &vCommandsOut ) } } -Commands ParseCommands( const CString &sCommands ) +Commands ParseCommands( const RString &sCommands ) { Commands vCommands; ParseCommands( sCommands, vCommands ); diff --git a/stepmania/src/Command.h b/stepmania/src/Command.h index 0a8de2ca21..ebb7d644a4 100644 --- a/stepmania/src/Command.h +++ b/stepmania/src/Command.h @@ -8,25 +8,25 @@ class Command { public: - void Load( const CString &sCommand ); + void Load( const RString &sCommand ); - CString GetOriginalCommandString() const; // used when reporting an error in number of args + RString GetOriginalCommandString() const; // used when reporting an error in number of args - CString GetName() const; // the command name is the first argument in all-lowercase + RString GetName() const; // the command name is the first argument in all-lowercase void Clear() { m_vsArgs.clear(); } struct Arg { - CString s; - operator CString () const; + RString s; + operator RString () const; operator float () const; operator int () const; operator bool () const; }; Arg GetArg( unsigned index ) const; - vector m_vsArgs; + vector m_vsArgs; }; class Commands @@ -34,7 +34,7 @@ class Commands public: vector v; - CString GetOriginalCommandString() const; // used when reporting an error in number of args + RString GetOriginalCommandString() const; // used when reporting an error in number of args }; // Take a command list string and return pointers to each of the tokens in the @@ -42,13 +42,13 @@ public: // TODO: This is expensive to do during the game. Eventually, // move all calls to ParseCommands to happen during load, then execute // from the parsed Command structures. -void ParseCommands( const CString &sCmds, Commands &vCmdsOut ); -Commands ParseCommands( const CString &sCmds ); +void ParseCommands( const RString &sCmds, Commands &vCmdsOut ); +Commands ParseCommands( const RString &sCmds ); #define BeginHandleArgs int iMaxIndexAccessed = 0; #define GET_ARG(type,i) iMaxIndexAccessed = max( i, iMaxIndexAccessed ); command.GetArg##type( i ); -#define sArg(i) GetArg(command,i,iMaxIndexAccessed) +#define sArg(i) GetArg(command,i,iMaxIndexAccessed) #define fArg(i) GetArg(command,i,iMaxIndexAccessed) #define iArg(i) GetArg(command,i,iMaxIndexAccessed) #define bArg(i) GetArg(command,i,iMaxIndexAccessed) diff --git a/stepmania/src/CommonMetrics.cpp b/stepmania/src/CommonMetrics.cpp index 6ced410216..76b2b87635 100644 --- a/stepmania/src/CommonMetrics.cpp +++ b/stepmania/src/CommonMetrics.cpp @@ -8,12 +8,12 @@ #include "ProductInfo.h" -static CString PLAYER_COLOR_NAME( size_t p ) { return ssprintf("ColorP%dCommand",int(p+1)); } +static RString PLAYER_COLOR_NAME( size_t p ) { return ssprintf("ColorP%dCommand",int(p+1)); } -ThemeMetric CommonMetrics::INITIAL_SCREEN ("Common","InitialScreen", true); // always reevaluate metric -ThemeMetric CommonMetrics::FIRST_ATTRACT_SCREEN ("Common","FirstAttractScreen"); -ThemeMetric CommonMetrics::DEFAULT_MODIFIERS ("Common","DefaultModifiers" ); -ThemeMetric CommonMetrics::DEFAULT_CPU_MODIFIERS ("Common","DefaultCpuModifiers" ); +ThemeMetric CommonMetrics::INITIAL_SCREEN ("Common","InitialScreen", true); // always reevaluate metric +ThemeMetric CommonMetrics::FIRST_ATTRACT_SCREEN ("Common","FirstAttractScreen"); +ThemeMetric CommonMetrics::DEFAULT_MODIFIERS ("Common","DefaultModifiers" ); +ThemeMetric CommonMetrics::DEFAULT_CPU_MODIFIERS ("Common","DefaultCpuModifiers" ); ThemeMetric1D CommonMetrics::PLAYER_COLOR ("Common",PLAYER_COLOR_NAME,NUM_PLAYERS); LocalizedString CommonMetrics::WINDOW_TITLE ("Common","WindowTitle"); ThemeMetric CommonMetrics::MAX_COURSE_ENTRIES_BEFORE_VARIOUS("Common","MaxCourseEntriesBeforeShowVarious"); @@ -23,8 +23,8 @@ ThemeMetricCourseDifficultiesToShow CommonMetrics::COURSE_DIFFICULTIES_TO_SHOW ThemeMetricStepsTypesToShow CommonMetrics::STEPS_TYPES_TO_SHOW ("Common","StepsTypesToHide"); -ThemeMetricDifficultiesToShow::ThemeMetricDifficultiesToShow( const CString& sGroup, const CString& sName ) : - ThemeMetric(sGroup,sName) +ThemeMetricDifficultiesToShow::ThemeMetricDifficultiesToShow( const RString& sGroup, const RString& sName ) : + ThemeMetric(sGroup,sName) { // re-read because ThemeMetric::ThemeMetric calls ThemeMetric::Read, not the derived one if( IsLoaded() ) @@ -34,15 +34,15 @@ void ThemeMetricDifficultiesToShow::Read() { ASSERT( GetName().Right(6) == "ToShow" ); - ThemeMetric::Read(); + ThemeMetric::Read(); m_v.clear(); - vector v; - split( ThemeMetric::GetValue(), ",", v ); + vector v; + split( ThemeMetric::GetValue(), ",", v ); ASSERT( v.size() > 0 ); - FOREACH_CONST( CString, v, i ) + FOREACH_CONST( RString, v, i ) { Difficulty d = StringToDifficulty( *i ); if( d == DIFFICULTY_INVALID ) @@ -53,8 +53,8 @@ void ThemeMetricDifficultiesToShow::Read() const vector& ThemeMetricDifficultiesToShow::GetValue() { return m_v; } -ThemeMetricCourseDifficultiesToShow::ThemeMetricCourseDifficultiesToShow( const CString& sGroup, const CString& sName ) : - ThemeMetric(sGroup,sName) +ThemeMetricCourseDifficultiesToShow::ThemeMetricCourseDifficultiesToShow( const RString& sGroup, const RString& sName ) : + ThemeMetric(sGroup,sName) { // re-read because ThemeMetric::ThemeMetric calls ThemeMetric::Read, not the derived one if( IsLoaded() ) @@ -64,15 +64,15 @@ void ThemeMetricCourseDifficultiesToShow::Read() { ASSERT( GetName().Right(6) == "ToShow" ); - ThemeMetric::Read(); + ThemeMetric::Read(); m_v.clear(); - vector v; - split( ThemeMetric::GetValue(), ",", v ); + vector v; + split( ThemeMetric::GetValue(), ",", v ); ASSERT( v.size() > 0 ); - FOREACH_CONST( CString, v, i ) + FOREACH_CONST( RString, v, i ) { CourseDifficulty d = StringToCourseDifficulty( *i ); if( d == DIFFICULTY_INVALID ) @@ -83,14 +83,14 @@ void ThemeMetricCourseDifficultiesToShow::Read() const vector& ThemeMetricCourseDifficultiesToShow::GetValue() { return m_v; } -static void RemoveStepsTypes( vector& inout, CString sStepsTypesToRemove ) +static void RemoveStepsTypes( vector& inout, RString sStepsTypesToRemove ) { - vector v; + vector v; split( sStepsTypesToRemove, ",", v ); ASSERT( v.size() > 0 ); // subtract StepsTypes - FOREACH_CONST( CString, v, i ) + FOREACH_CONST( RString, v, i ) { StepsType st = GameManager::StringToStepsType(*i); if( st == STEPS_TYPE_INVALID ) @@ -101,8 +101,8 @@ static void RemoveStepsTypes( vector& inout, CString sStepsTypesToRem inout.erase( iter ); } } -ThemeMetricStepsTypesToShow::ThemeMetricStepsTypesToShow( const CString& sGroup, const CString& sName ) : - ThemeMetric(sGroup,sName) +ThemeMetricStepsTypesToShow::ThemeMetricStepsTypesToShow( const RString& sGroup, const RString& sName ) : + ThemeMetric(sGroup,sName) { // re-read because ThemeMetric::ThemeMetric calls ThemeMetric::Read, not the derived one if( IsLoaded() ) @@ -112,17 +112,17 @@ void ThemeMetricStepsTypesToShow::Read() { ASSERT( GetName().Right(6) == "ToHide" ); - ThemeMetric::Read(); + ThemeMetric::Read(); m_v.clear(); GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, m_v ); - RemoveStepsTypes( m_v, ThemeMetric::GetValue() ); + RemoveStepsTypes( m_v, ThemeMetric::GetValue() ); } const vector& ThemeMetricStepsTypesToShow::GetValue() { return m_v; } -CString CommonMetrics::ThemeOptionItem( CString s, bool bOptional ) +RString CommonMetrics::ThemeOptionItem( RString s, bool bOptional ) { if( bOptional && !THEME->HasMetric("OptionNames",s) ) return s; diff --git a/stepmania/src/CommonMetrics.h b/stepmania/src/CommonMetrics.h index 7ac143ed67..f4cc57464d 100644 --- a/stepmania/src/CommonMetrics.h +++ b/stepmania/src/CommonMetrics.h @@ -13,31 +13,31 @@ // // Types // -class ThemeMetricDifficultiesToShow : public ThemeMetric +class ThemeMetricDifficultiesToShow : public ThemeMetric { public: ThemeMetricDifficultiesToShow() { } - ThemeMetricDifficultiesToShow( const CString& sGroup, const CString& sName ); + ThemeMetricDifficultiesToShow( const RString& sGroup, const RString& sName ); void Read(); const vector &GetValue(); private: vector m_v; }; -class ThemeMetricCourseDifficultiesToShow : public ThemeMetric +class ThemeMetricCourseDifficultiesToShow : public ThemeMetric { public: ThemeMetricCourseDifficultiesToShow() { } - ThemeMetricCourseDifficultiesToShow( const CString& sGroup, const CString& sName ); + ThemeMetricCourseDifficultiesToShow( const RString& sGroup, const RString& sName ); void Read(); const vector &GetValue(); private: vector m_v; }; -class ThemeMetricStepsTypesToShow : public ThemeMetric +class ThemeMetricStepsTypesToShow : public ThemeMetric { public: ThemeMetricStepsTypesToShow() { } - ThemeMetricStepsTypesToShow( const CString& sGroup, const CString& sName ); + ThemeMetricStepsTypesToShow( const RString& sGroup, const RString& sName ); void Read(); const vector &GetValue(); private: @@ -50,10 +50,10 @@ private: // namespace CommonMetrics { - extern ThemeMetric INITIAL_SCREEN; - extern ThemeMetric FIRST_ATTRACT_SCREEN; - extern ThemeMetric DEFAULT_MODIFIERS; - extern ThemeMetric DEFAULT_CPU_MODIFIERS; + extern ThemeMetric INITIAL_SCREEN; + extern ThemeMetric FIRST_ATTRACT_SCREEN; + extern ThemeMetric DEFAULT_MODIFIERS; + extern ThemeMetric DEFAULT_CPU_MODIFIERS; extern ThemeMetric1D PLAYER_COLOR; extern LocalizedString WINDOW_TITLE; extern ThemeMetric MAX_COURSE_ENTRIES_BEFORE_VARIOUS; @@ -62,7 +62,7 @@ namespace CommonMetrics extern ThemeMetricCourseDifficultiesToShow COURSE_DIFFICULTIES_TO_SHOW; extern ThemeMetricStepsTypesToShow STEPS_TYPES_TO_SHOW; - CString ThemeOptionItem( CString s, bool bOptional ); + RString ThemeOptionItem( RString s, bool bOptional ); }; #endif diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index e97aab0857..384a7f85e7 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -58,9 +58,9 @@ const int MAX_BOTTOM_RANGE = 10; #define SORT_LEVEL5_COLOR THEME->GetMetricC("Course","SortLevel5Color") -CString CourseEntry::GetTextDescription() const +RString CourseEntry::GetTextDescription() const { - vector vsEntryDescription; + vector vsEntryDescription; if( pSong ) vsEntryDescription.push_back( pSong->GetTranslitFullTitle() ); else @@ -83,7 +83,7 @@ CString CourseEntry::GetTextDescription() const if( fGainSeconds != 0 ) vsEntryDescription.push_back( ssprintf("Low meter: %.0f", fGainSeconds) ); - CString s = join( ",", vsEntryDescription ); + RString s = join( ",", vsEntryDescription ); return s; } @@ -191,7 +191,7 @@ void Course::RevertFromDisk() CourseLoaderCRS::LoadFromCRSFile( m_sPath, *this ); } -CString Course::GetCacheFilePath() const +RString Course::GetCacheFilePath() const { return SongCacheIndex::GetCacheFilePath( "Courses", m_sPath ); } @@ -232,33 +232,33 @@ struct SortTrailEntry bool operator< ( const SortTrailEntry &rhs ) const { return SortMeter < rhs.SortMeter; } }; -CString Course::GetDisplayMainTitle() const +RString Course::GetDisplayMainTitle() const { if( !PREFSMAN->m_bShowNativeLanguage ) return GetTranslitMainTitle(); return m_sMainTitle; } -CString Course::GetDisplaySubTitle() const +RString Course::GetDisplaySubTitle() const { if( !PREFSMAN->m_bShowNativeLanguage ) return GetTranslitSubTitle(); return m_sSubTitle; } -CString Course::GetDisplayFullTitle() const +RString Course::GetDisplayFullTitle() const { - CString Title = GetDisplayMainTitle(); - CString SubTitle = GetDisplaySubTitle(); + RString Title = GetDisplayMainTitle(); + RString SubTitle = GetDisplaySubTitle(); if(!SubTitle.empty()) Title += " " + SubTitle; return Title; } -CString Course::GetTranslitFullTitle() const +RString Course::GetTranslitFullTitle() const { - CString Title = GetTranslitMainTitle(); - CString SubTitle = GetTranslitSubTitle(); + RString Title = GetTranslitMainTitle(); + RString SubTitle = GetTranslitSubTitle(); if(!SubTitle.empty()) Title += " " + SubTitle; return Title; @@ -843,7 +843,7 @@ void Course::UpdateCourseStats( StepsType st ) bool Course::IsRanking() const { - vector rankingsongs; + vector rankingsongs; split(THEME->GetMetric("ScreenRanking", "CoursesToShow"), ",", rankingsongs); diff --git a/stepmania/src/Course.h b/stepmania/src/Course.h index 4a61244d9d..7da4c4b369 100644 --- a/stepmania/src/Course.h +++ b/stepmania/src/Course.h @@ -30,8 +30,8 @@ enum CourseType NUM_CourseType }; #define FOREACH_CourseType( i ) FOREACH_ENUM( CourseType, NUM_CourseType, i ) -const CString& CourseTypeToString( CourseType i ); -const CString& CourseTypeToLocalizedString( CourseType i ); +const RString& CourseTypeToString( CourseType i ); +const RString& CourseTypeToLocalizedString( CourseType i ); inline PlayMode CourseTypeToPlayMode( CourseType ct ) { return (PlayMode)(PLAY_MODE_NONSTOP+ct); } inline CourseType PlayModeToCourseType( PlayMode pm ) { return (CourseType)(pm-PLAY_MODE_NONSTOP); } @@ -47,8 +47,8 @@ enum SongSort NUM_SongSort, }; #define FOREACH_SongSort( i ) FOREACH_ENUM( SongSort, NUM_SongSort, i ) -const CString& SongSortToString( SongSort ss ); -const CString& SongSortToLocalizedString( SongSort ss ); +const RString& SongSortToString( SongSort ss ); +const RString& SongSortToLocalizedString( SongSort ss ); class CourseEntry { @@ -58,7 +58,7 @@ public: // filter criteria, applied from top to bottom // TODO: change this to be a SongID Song* pSong; // don't filter if NULL - CString sSongGroup; // don't filter if empty + RString sSongGroup; // don't filter if empty Difficulty baseDifficulty; // don't filter if DIFFICULTY_INVALID bool bNoDifficult; // if true, CourseDifficulty doesn't affect this entry int iLowMeter; // don't filter if -1 @@ -67,7 +67,7 @@ public: SongSort songSort; // sort by this after filtering int iChooseIndex; // - CString sModifiers; // set player and song options using these + RString sModifiers; // set player and song options using these AttackArray attacks; // timed sModifiers float fGainSeconds; // time gained back at the beginning of the song. LifeMeterTime only. @@ -96,7 +96,7 @@ public: pSong == NULL; } - CString GetTextDescription() const; + RString GetTextDescription() const; int GetNumModChanges() const; // Lua @@ -111,16 +111,16 @@ public: Course(); bool m_bIsAutogen; // was this created by AutoGen? - CString m_sPath; + RString m_sPath; - CString m_sMainTitle, m_sMainTitleTranslit; - CString m_sSubTitle, m_sSubTitleTranslit; + RString m_sMainTitle, m_sMainTitleTranslit; + RString m_sSubTitle, m_sSubTitleTranslit; bool HasBanner() const; - CString m_sBannerPath; - CString m_sCDTitlePath; - CString m_sGroupName; + RString m_sBannerPath; + RString m_sCDTitlePath; + RString m_sGroupName; bool m_bRepeat; // repeat after last song? "Endless" bool m_bShuffle; // play the songs in a random order @@ -132,16 +132,16 @@ public: /* If PREFSMAN->m_bShowNative is off, these are the same as GetTranslit* below. * Otherwise, they return the main titles. */ - CString GetDisplayMainTitle() const; - CString GetDisplaySubTitle() const; + RString GetDisplayMainTitle() const; + RString GetDisplaySubTitle() const; /* Returns the transliterated titles, if any; otherwise returns the main titles. */ - CString GetTranslitMainTitle() const { return m_sMainTitleTranslit.size()? m_sMainTitleTranslit: m_sMainTitle; } - CString GetTranslitSubTitle() const { return m_sSubTitleTranslit.size()? m_sSubTitleTranslit: m_sSubTitle; } + RString GetTranslitMainTitle() const { return m_sMainTitleTranslit.size()? m_sMainTitleTranslit: m_sMainTitle; } + RString GetTranslitSubTitle() const { return m_sSubTitleTranslit.size()? m_sSubTitleTranslit: m_sSubTitle; } /* "title subtitle" */ - CString GetDisplayFullTitle() const; - CString GetTranslitFullTitle() const; + RString GetDisplayFullTitle() const; + RString GetTranslitFullTitle() const; // Dereferences course_entries and returns only the playable Songs and Steps Trail* GetTrail( StepsType st, CourseDifficulty cd=DIFFICULTY_MEDIUM ) const; @@ -186,7 +186,7 @@ public: void Invalidate( Song *pStaleSong ); void GetAllCachedTrails( vector &out ); - CString GetCacheFilePath() const; + RString GetCacheFilePath() const; const CourseEntry *FindFixedSong( const Song *pSong ) const; diff --git a/stepmania/src/CourseContentsList.cpp b/stepmania/src/CourseContentsList.cpp index 85574762e6..90ddd87654 100644 --- a/stepmania/src/CourseContentsList.cpp +++ b/stepmania/src/CourseContentsList.cpp @@ -44,7 +44,7 @@ void CourseContentsList::Load() } } -void CourseContentsList::LoadFromNode( const CString& sDir, const XNode* pNode ) +void CourseContentsList::LoadFromNode( const RString& sDir, const XNode* pNode ) { ActorScroller::LoadFromNode( sDir, pNode ); diff --git a/stepmania/src/CourseContentsList.h b/stepmania/src/CourseContentsList.h index 3d0c2c5467..6442a063a0 100644 --- a/stepmania/src/CourseContentsList.h +++ b/stepmania/src/CourseContentsList.h @@ -14,7 +14,7 @@ public: virtual Actor *Copy() const; void Load(); - void LoadFromNode( const CString& sDir, const XNode* pNode ); + void LoadFromNode( const RString& sDir, const XNode* pNode ); void SetFromGameState(); void TweenInAfterChangedCourse(); diff --git a/stepmania/src/CourseEntryDisplay.cpp b/stepmania/src/CourseEntryDisplay.cpp index bd4cd07c5b..a84b86d8f3 100644 --- a/stepmania/src/CourseEntryDisplay.cpp +++ b/stepmania/src/CourseEntryDisplay.cpp @@ -49,12 +49,12 @@ void CourseEntryDisplay::Load() if( !SEPARATE_COURSE_METERS && pn != GAMESTATE->m_MasterPlayerNumber ) continue; // skip - m_textFoot[pn].SetName( SEPARATE_COURSE_METERS? ssprintf("FootP%i", pn+1):CString("Foot") ); + m_textFoot[pn].SetName( SEPARATE_COURSE_METERS? ssprintf("FootP%i", pn+1):RString("Foot") ); m_textFoot[pn].LoadFromTextureAndChars( THEME->GetPathF("CourseEntryDisplay","difficulty"),"10" ); SET_XY_AND_ON_COMMAND( &m_textFoot[pn] ); this->AddChild( &m_textFoot[pn] ); - m_textDifficultyNumber[pn].SetName( SEPARATE_COURSE_METERS? ssprintf("DifficultyP%i", pn+1):CString("Difficulty") ); + m_textDifficultyNumber[pn].SetName( SEPARATE_COURSE_METERS? ssprintf("DifficultyP%i", pn+1):RString("Difficulty") ); m_textDifficultyNumber[pn].LoadFromFont( THEME->GetPathF("Common","normal") ); SET_XY_AND_ON_COMMAND( &m_textDifficultyNumber[pn] ); this->AddChild( &m_textDifficultyNumber[pn] ); @@ -66,14 +66,14 @@ void CourseEntryDisplay::Load() this->AddChild( &m_textModifiers ); } -void CourseEntryDisplay::LoadFromNode( const CString& sDir, const XNode* pNode ) +void CourseEntryDisplay::LoadFromNode( const RString& sDir, const XNode* pNode ) { ActorFrame::LoadFromNode( sDir, pNode ); Load(); } -void CourseEntryDisplay::SetDifficulty( PlayerNumber pn, const CString &text, Difficulty dc ) +void CourseEntryDisplay::SetDifficulty( PlayerNumber pn, const RString &text, Difficulty dc ) { if( !GAMESTATE->IsHumanPlayer(pn) ) return; // skip @@ -135,7 +135,7 @@ void CourseEntryDisplay::SetFromGameState( int iCourseEntryIndex ) bool bLowIsSet = iLow != -1; bool bHighIsSet = iHigh != -1; - CString s; + RString s; if( !bLowIsSet && !bHighIsSet ) { s = "?"; diff --git a/stepmania/src/CourseEntryDisplay.h b/stepmania/src/CourseEntryDisplay.h index 20b496d705..f7d6d61731 100644 --- a/stepmania/src/CourseEntryDisplay.h +++ b/stepmania/src/CourseEntryDisplay.h @@ -19,7 +19,7 @@ public: virtual Actor *Copy() const; void Load(); - void LoadFromNode( const CString& sDir, const XNode* pNode ); + void LoadFromNode( const RString& sDir, const XNode* pNode ); void SetFromGameState( int iCourseEntryIndex ); @@ -27,7 +27,7 @@ public: void PushSelf( lua_State *L ); private: - void SetDifficulty( PlayerNumber pn, const CString &text, Difficulty dc ); + void SetDifficulty( PlayerNumber pn, const RString &text, Difficulty dc ); Sprite m_sprFrame; BitmapText m_textNumber; @@ -37,7 +37,7 @@ private: BitmapText m_textModifiers; ThemeMetric SEPARATE_COURSE_METERS; - ThemeMetric TEXT_BANNER_TYPE; + ThemeMetric TEXT_BANNER_TYPE; }; #endif diff --git a/stepmania/src/CourseLoaderCRS.cpp b/stepmania/src/CourseLoaderCRS.cpp index de2bfc974e..f2157908fe 100644 --- a/stepmania/src/CourseLoaderCRS.cpp +++ b/stepmania/src/CourseLoaderCRS.cpp @@ -16,18 +16,18 @@ const int MAX_EDIT_COURSE_SIZE_BYTES = 30*1024; // 30KB -bool CourseLoaderCRS::LoadFromBuffer( const CString &sPath, const CString &sBuffer, Course &out ) +bool CourseLoaderCRS::LoadFromBuffer( const RString &sPath, const RString &sBuffer, Course &out ) { MsdFile msd; msd.ReadFromString( sBuffer ); return LoadFromMsd( sPath, msd, out, true ); } -bool CourseLoaderCRS::LoadFromMsd( const CString &sPath, const MsdFile &msd, Course &out, bool bFromCache ) +bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Course &out, bool bFromCache ) { - const CString sFName = SetExtension( out.m_sPath, "" ); + const RString sFName = SetExtension( out.m_sPath, "" ); - vector arrayPossibleBanners; + vector arrayPossibleBanners; GetDirListing( sFName + "*.png", arrayPossibleBanners, false, true ); GetDirListing( sFName + "*.jpg", arrayPossibleBanners, false, true ); GetDirListing( sFName + "*.bmp", arrayPossibleBanners, false, true ); @@ -39,7 +39,7 @@ bool CourseLoaderCRS::LoadFromMsd( const CString &sPath, const MsdFile &msd, Cou float fGainSeconds = 0; for( unsigned i=0; i sBits; + vector sBits; split( sParams[j], "=", sBits, false ); if( sBits.size() < 2 ) continue; @@ -147,9 +147,9 @@ bool CourseLoaderCRS::LoadFromMsd( const CString &sPath, const MsdFile &msd, Cou else if( sParams[1].Right(1) == "*" ) { //new_entry.bSecret = true; - CString sSong = sParams[1]; + RString sSong = sParams[1]; sSong.Replace( "\\", "/" ); - vector bits; + vector bits; split( sSong, "/", bits ); if( bits.size() == 2 ) { @@ -174,7 +174,7 @@ bool CourseLoaderCRS::LoadFromMsd( const CString &sPath, const MsdFile &msd, Cou } else { - CString sSong = sParams[1]; + RString sSong = sParams[1]; new_entry.pSong = SONGMAN->FindSong( sSong ); if( new_entry.pSong == NULL ) @@ -206,11 +206,11 @@ bool CourseLoaderCRS::LoadFromMsd( const CString &sPath, const MsdFile &msd, Cou { /* If "showcourse" or "noshowcourse" is in the list, force new_entry.secret * on or off. */ - vector mods; + vector mods; split( sParams[3], ",", mods, true ); for( int j = (int) mods.size()-1; j >= 0 ; --j ) { - CString &sMod = mods[j]; + RString &sMod = mods[j]; TrimLeft( sMod ); TrimRight( sMod ); if( !sMod.CompareNoCase("showcourse") ) @@ -268,9 +268,9 @@ bool CourseLoaderCRS::LoadFromMsd( const CString &sPath, const MsdFile &msd, Cou return true; } -bool CourseLoaderCRS::LoadFromCRSFile( const CString &_sPath, Course &out ) +bool CourseLoaderCRS::LoadFromCRSFile( const RString &_sPath, Course &out ) { - CString sPath = _sPath; + RString sPath = _sPath; out.Init(); @@ -278,7 +278,7 @@ bool CourseLoaderCRS::LoadFromCRSFile( const CString &_sPath, Course &out ) // save group name { - vector parts; + vector parts; split( sPath, "/", parts, false ); if( parts.size() >= 4 ) // e.g. "/Courses/blah/fun.cvs" out.m_sGroupName = parts[parts.size()-2]; @@ -301,7 +301,7 @@ bool CourseLoaderCRS::LoadFromCRSFile( const CString &_sPath, Course &out ) if( bUseCache ) { - CString sCacheFile = out.GetCacheFilePath(); + RString sCacheFile = out.GetCacheFilePath(); LOG->Trace( "CourseLoaderCRS::LoadFromCRSFile(\"%s\") (\"%s\")", sPath.c_str(), sCacheFile.c_str() ); sPath = sCacheFile.c_str(); } @@ -322,7 +322,7 @@ bool CourseLoaderCRS::LoadFromCRSFile( const CString &_sPath, Course &out ) /* If we have any cache data, write the cache file. */ if( out.m_RadarCache.size() ) { - CString sCachePath = out.GetCacheFilePath(); + RString sCachePath = out.GetCacheFilePath(); CourseWriterCRS::Write( out, sCachePath, true ); SONGINDEX->AddCacheIndex( out.m_sPath, GetHashForFile(out.m_sPath) ); @@ -332,7 +332,7 @@ bool CourseLoaderCRS::LoadFromCRSFile( const CString &_sPath, Course &out ) return true; } -bool CourseLoaderCRS::LoadEdit( const CString &sEditFilePath, ProfileSlot slot ) +bool CourseLoaderCRS::LoadEdit( const RString &sEditFilePath, ProfileSlot slot ) { LOG->Trace( "CourseLoaderCRS::LoadEdit(%s)", sEditFilePath.c_str() ); @@ -358,7 +358,7 @@ bool CourseLoaderCRS::LoadEdit( const CString &sEditFilePath, ProfileSlot slot ) return true; } -bool CourseLoaderCRS::LoadEditFromBuffer( const CString &sBuffer, const CString &sPath, ProfileSlot slot ) +bool CourseLoaderCRS::LoadEditFromBuffer( const RString &sBuffer, const RString &sPath, ProfileSlot slot ) { Course *pCourse = new Course; if( !LoadFromBuffer(sPath, sBuffer, *pCourse) ) diff --git a/stepmania/src/CourseLoaderCRS.h b/stepmania/src/CourseLoaderCRS.h index a099e7f4a2..f82ff6a932 100644 --- a/stepmania/src/CourseLoaderCRS.h +++ b/stepmania/src/CourseLoaderCRS.h @@ -10,11 +10,11 @@ class MsdFile; class CourseLoaderCRS { public: - static bool LoadFromCRSFile( const CString &sPath, Course &out ); - static bool LoadFromMsd( const CString &sPath, const MsdFile &msd, Course &out, bool bFromCache ); - static bool LoadFromBuffer( const CString &sPath, const CString &sBuffer, Course &out ); - static bool LoadEdit( const CString &sEditFilePath, ProfileSlot slot ); - static bool LoadEditFromBuffer( const CString &sBuffer, const CString &sPath, ProfileSlot slot ); + static bool LoadFromCRSFile( const RString &sPath, Course &out ); + static bool LoadFromMsd( const RString &sPath, const MsdFile &msd, Course &out, bool bFromCache ); + static bool LoadFromBuffer( const RString &sPath, const RString &sBuffer, Course &out ); + static bool LoadEdit( const RString &sEditFilePath, ProfileSlot slot ); + static bool LoadEditFromBuffer( const RString &sBuffer, const RString &sPath, ProfileSlot slot ); }; #endif diff --git a/stepmania/src/CourseUtil.cpp b/stepmania/src/CourseUtil.cpp index 11afe88114..f674c72e06 100644 --- a/stepmania/src/CourseUtil.cpp +++ b/stepmania/src/CourseUtil.cpp @@ -17,8 +17,8 @@ // static bool CompareCoursePointersByName( const Course* pCourse1, const Course* pCourse2 ) { - CString sName1 = pCourse1->GetDisplayFullTitle(); - CString sName2 = pCourse2->GetDisplayFullTitle(); + RString sName1 = pCourse1->GetDisplayFullTitle(); + RString sName2 = pCourse2->GetDisplayFullTitle(); return sName1.CompareNoCase( sName2 ) < 0; } @@ -119,7 +119,7 @@ void CourseUtil::MoveRandomToEnd( vector &vpCoursesInOut ) stable_sort( vpCoursesInOut.begin(), vpCoursesInOut.end(), CompareRandom ); } -static map course_sort_val; +static map course_sort_val; bool CompareCoursePointersBySortValueAscending( const Course *pSong1, const Course *pSong2 ) { @@ -181,7 +181,7 @@ void CourseUtil::SortByMostRecentlyPlayedForMachine( vector &vpCoursesI FOREACH_CONST( Course*, vpCoursesInOut, c ) { int iNumTimesPlayed = pProfile->GetCourseNumTimesPlayed( *c ); - CString val = iNumTimesPlayed ? pProfile->GetCourseLastPlayedDateTime(*c).GetString() : "9999999999999"; + RString val = iNumTimesPlayed ? pProfile->GetCourseLastPlayedDateTime(*c).GetString() : "9999999999999"; course_sort_val[*c] = val; } @@ -199,7 +199,7 @@ void CourseUtil::MakeDefaultEditCourseEntry( CourseEntry& out ) // Autogen ////////////////////////////////// -void CourseUtil::AutogenEndlessFromGroup( const CString &sGroupName, Difficulty diff, Course &out ) +void CourseUtil::AutogenEndlessFromGroup( const RString &sGroupName, Difficulty diff, Course &out ) { out.m_bIsAutogen = true; out.m_bRepeat = true; @@ -233,7 +233,7 @@ void CourseUtil::AutogenEndlessFromGroup( const CString &sGroupName, Difficulty out.m_vEntries.push_back( e ); } -void CourseUtil::AutogenNonstopFromGroup( const CString &sGroupName, Difficulty diff, Course &out ) +void CourseUtil::AutogenNonstopFromGroup( const RString &sGroupName, Difficulty diff, Course &out ) { AutogenEndlessFromGroup( sGroupName, diff, out ); @@ -248,7 +248,7 @@ void CourseUtil::AutogenNonstopFromGroup( const CString &sGroupName, Difficulty out.m_vEntries.pop_back(); } -void CourseUtil::AutogenOniFromArtist( const CString &sArtistName, CString sArtistNameTranslit, vector aSongs, Difficulty dc, Course &out ) +void CourseUtil::AutogenOniFromArtist( const RString &sArtistName, RString sArtistNameTranslit, vector aSongs, Difficulty dc, Course &out ) { out.m_bIsAutogen = true; out.m_bRepeat = false; @@ -329,7 +329,7 @@ Course *CourseID::ToCourse() const { // HACK for backwards compatibility: // Re-add the leading "/". 2005/05/21 file layer changes added a leading slash. - CString sPath2 = sPath; + RString sPath2 = sPath; if( sPath2.Left(1) != "/" ) sPath2 = "/" + sPath2; @@ -370,13 +370,13 @@ void CourseID::LoadFromNode( const XNode* pNode ) pNode->GetAttrValue("FullTitle", sFullTitle); } -CString CourseID::ToString() const +RString CourseID::ToString() const { if( !sPath.empty() ) return sPath; if( !sFullTitle.empty() ) return sFullTitle; - return CString(); + return RString(); } bool CourseID::IsValid() const diff --git a/stepmania/src/CourseUtil.h b/stepmania/src/CourseUtil.h index ce0291b374..c216fbb266 100644 --- a/stepmania/src/CourseUtil.h +++ b/stepmania/src/CourseUtil.h @@ -28,16 +28,16 @@ namespace CourseUtil void MakeDefaultEditCourseEntry( CourseEntry &out ); - void AutogenEndlessFromGroup( const CString &sGroupName, Difficulty dc, Course &out ); - void AutogenNonstopFromGroup( const CString &sGroupName, Difficulty dc, Course &out ); - void AutogenOniFromArtist( const CString &sArtistName, CString sArtistNameTranslit, vector aSongs, Difficulty dc, Course &out ); + void AutogenEndlessFromGroup( const RString &sGroupName, Difficulty dc, Course &out ); + void AutogenNonstopFromGroup( const RString &sGroupName, Difficulty dc, Course &out ); + void AutogenOniFromArtist( const RString &sArtistName, RString sArtistNameTranslit, vector aSongs, Difficulty dc, Course &out ); }; class CourseID { public: - CString sPath; - CString sFullTitle; + RString sPath; + RString sFullTitle; public: CourseID() { Unset(); } @@ -51,7 +51,7 @@ public: XNode* CreateNode() const; void LoadFromNode( const XNode* pNode ); - CString ToString() const; + RString ToString() const; bool IsValid() const; }; diff --git a/stepmania/src/CourseWriterCRS.cpp b/stepmania/src/CourseWriterCRS.cpp index b8d125be0b..cb5ba6b688 100644 --- a/stepmania/src/CourseWriterCRS.cpp +++ b/stepmania/src/CourseWriterCRS.cpp @@ -8,7 +8,7 @@ #include "RageFileDriverMemory.h" -bool CourseWriterCRS::Write( const Course &course, const CString &sPath, bool bSavingCache ) +bool CourseWriterCRS::Write( const Course &course, const RString &sPath, bool bSavingCache ) { RageFile f; if( !f.Open( sPath, RageFile::WRITE ) ) @@ -20,7 +20,7 @@ bool CourseWriterCRS::Write( const Course &course, const CString &sPath, bool bS return CourseWriterCRS::Write( course, f, bSavingCache ); } -void CourseWriterCRS::GetEditFileContents( const Course *pCourse, CString &sOut ) +void CourseWriterCRS::GetEditFileContents( const Course *pCourse, RString &sOut ) { RageFileObjMem mem; CourseWriterCRS::Write( *pCourse, mem, true ); @@ -58,11 +58,11 @@ bool CourseWriterCRS::Write( const Course &course, RageFileBasic &f, bool bSavin StepsType st = entry.first; CourseDifficulty cd = entry.second; - vector asRadarValues; + vector asRadarValues; const RadarValues &rv = it->second; for( int r=0; r < NUM_RadarCategory; r++ ) asRadarValues.push_back( ssprintf("%.3f", rv[r]) ); - CString sLine = ssprintf( "#RADAR:%i:%i:", st, cd ); + RString sLine = ssprintf( "#RADAR:%i:%i:", st, cd ); sLine += join( ",", asRadarValues ) + ";"; f.PutLine( sLine ); } @@ -103,12 +103,12 @@ bool CourseWriterCRS::Write( const Course &course, RageFileBasic &f, bool bSavin else if( entry.pSong ) { // strip off everything but the group name and song dir - vector as; + vector as; ASSERT( entry.pSong != NULL ); split( entry.pSong->GetSongDir(), "/", as ); ASSERT( as.size() >= 2 ); - CString sGroup = as[ as.size()-2 ]; - CString sSong = as[ as.size()-1 ]; + RString sGroup = as[ as.size()-2 ]; + RString sSong = as[ as.size()-1 ]; f.Write( "#SONG:" + sGroup + '/' + sSong ); } else if( !entry.sSongGroup.empty() ) @@ -127,7 +127,7 @@ bool CourseWriterCRS::Write( const Course &course, RageFileBasic &f, bool bSavin f.Write( ssprintf( "%d..%d", entry.iLowMeter, entry.iHighMeter ) ); f.Write( ":" ); - CString sModifiers = entry.sModifiers; + RString sModifiers = entry.sModifiers; bool bDefaultSecret = entry.IsRandomSong(); if( bDefaultSecret != entry.bSecret ) { diff --git a/stepmania/src/CourseWriterCRS.h b/stepmania/src/CourseWriterCRS.h index e740bb01cc..b95fdb2c36 100644 --- a/stepmania/src/CourseWriterCRS.h +++ b/stepmania/src/CourseWriterCRS.h @@ -10,8 +10,8 @@ class CourseWriterCRS { public: static bool Write( const Course &course, RageFileBasic &f, bool bSavingCache ); - static bool Write( const Course &course, const CString &sPath, bool bSavingCache ); - static void GetEditFileContents( const Course *pCourse, CString &sOut ); + static bool Write( const Course &course, const RString &sPath, bool bSavingCache ); + static void GetEditFileContents( const Course *pCourse, RString &sOut ); static void WriteEditFileToMachine( const Course *pCourse ); }; diff --git a/stepmania/src/CryptHelpers.cpp b/stepmania/src/CryptHelpers.cpp index db17577129..a85c76e655 100644 --- a/stepmania/src/CryptHelpers.cpp +++ b/stepmania/src/CryptHelpers.cpp @@ -190,7 +190,7 @@ unsigned int RageFileStore::CopyRangeTo2(BufferedTransformation &target, unsigne return 0; } -bool CryptHelpers::GenerateRSAKey( unsigned int keyLength, CString sSeed, CString &sPublicKey, CString &sPrivateKey ) +bool CryptHelpers::GenerateRSAKey( unsigned int keyLength, RString sSeed, RString &sPublicKey, RString &sPrivateKey ) { #ifdef _XBOX return false; @@ -217,7 +217,7 @@ bool CryptHelpers::GenerateRSAKey( unsigned int keyLength, CString sSeed, CStrin #endif } -bool CryptHelpers::SignFile( RageFileBasic &file, CString sPrivKey, CString &sSignatureOut, CString &sError ) +bool CryptHelpers::SignFile( RageFileBasic &file, RString sPrivKey, RString &sSignatureOut, RString &sError ) { #ifdef _XBOX return false; @@ -238,7 +238,7 @@ bool CryptHelpers::SignFile( RageFileBasic &file, CString sPrivKey, CString &sSi #endif } -bool CryptHelpers::VerifyFile( RageFileBasic &file, CString sSignature, CString sPublicKey, CString &sError ) +bool CryptHelpers::VerifyFile( RageFileBasic &file, RString sSignature, RString sPublicKey, RString &sError ) { try { StringSource pubFile( sPublicKey, true ); diff --git a/stepmania/src/CryptHelpers.h b/stepmania/src/CryptHelpers.h index 587897fdb7..7b71d6a80b 100644 --- a/stepmania/src/CryptHelpers.h +++ b/stepmania/src/CryptHelpers.h @@ -5,9 +5,9 @@ class RageFileBasic; namespace CryptHelpers { - bool GenerateRSAKey( unsigned int keyLength, CString sSeed, CString &sPublicKey, CString &sPrivateKey ); - bool SignFile( RageFileBasic &file, CString sPrivKey, CString &sSignatureOut, CString &sError ); - bool VerifyFile( RageFileBasic &file, CString sSignature, CString sPublicKey, CString &sError ); + bool GenerateRSAKey( unsigned int keyLength, RString sSeed, RString &sPublicKey, RString &sPrivateKey ); + bool SignFile( RageFileBasic &file, RString sPrivKey, RString &sSignatureOut, RString &sError ); + bool VerifyFile( RageFileBasic &file, RString sSignature, RString sPublicKey, RString &sError ); }; #endif diff --git a/stepmania/src/CryptManager.cpp b/stepmania/src/CryptManager.cpp index d9a2694c37..ccfca0a6be 100644 --- a/stepmania/src/CryptManager.cpp +++ b/stepmania/src/CryptManager.cpp @@ -9,22 +9,22 @@ CryptManager* CRYPTMAN = NULL; // global and accessable from anywhere in our program -static const CString PRIVATE_KEY_PATH = "Data/private.rsa"; -static const CString PUBLIC_KEY_PATH = "Data/public.rsa"; -static const CString ALTERNATE_PUBLIC_KEY_DIR = "Data/keys/"; +static const RString PRIVATE_KEY_PATH = "Data/private.rsa"; +static const RString PUBLIC_KEY_PATH = "Data/public.rsa"; +static const RString ALTERNATE_PUBLIC_KEY_DIR = "Data/keys/"; #if !defined(HAVE_CRYPTOPP) CryptManager::CryptManager() { } CryptManager::~CryptManager() { } -void CryptManager::GenerateRSAKey( unsigned int keyLength, CString privFilename, CString pubFilename, CString seed ) { } -void CryptManager::SignFileToFile( CString sPath, CString sSignatureFile ) { } -bool CryptManager::VerifyFileWithFile( CString sPath, CString sSignatureFile, CString sPublicKeyFile ) { return true; } -bool CryptManager::VerifyFileWithFile( CString sPath, CString sSignatureFile ) +void CryptManager::GenerateRSAKey( unsigned int keyLength, RString privFilename, RString pubFilename, RString seed ) { } +void CryptManager::SignFileToFile( RString sPath, RString sSignatureFile ) { } +bool CryptManager::VerifyFileWithFile( RString sPath, RString sSignatureFile, RString sPublicKeyFile ) { return true; } +bool CryptManager::VerifyFileWithFile( RString sPath, RString sSignatureFile ) { return true; } -bool CryptManager::Verify( CString sPath, CString sSignature ) +bool CryptManager::Verify( RString sPath, RString sSignature ) { return true; } @@ -58,7 +58,7 @@ CryptManager::~CryptManager() } -static bool WriteFile( CString sFile, CString sBuf ) +static bool WriteFile( RString sFile, RString sBuf ) { RageFile output; if( !output.Open(sFile, RageFile::WRITE) ) @@ -78,11 +78,11 @@ static bool WriteFile( CString sFile, CString sBuf ) return true; } -void CryptManager::GenerateRSAKey( unsigned int keyLength, CString privFilename, CString pubFilename, CString seed ) +void CryptManager::GenerateRSAKey( unsigned int keyLength, RString privFilename, RString pubFilename, RString seed ) { ASSERT( PREFSMAN->m_bSignProfileData ); - CString sPubKey, sPrivKey; + RString sPubKey, sPrivKey; if( !CryptHelpers::GenerateRSAKey(keyLength, seed, sPubKey, sPrivKey) ) return; @@ -97,16 +97,16 @@ void CryptManager::GenerateRSAKey( unsigned int keyLength, CString privFilename, } } -void CryptManager::SignFileToFile( CString sPath, CString sSignatureFile ) +void CryptManager::SignFileToFile( RString sPath, RString sSignatureFile ) { ASSERT( PREFSMAN->m_bSignProfileData ); - CString sPrivFilename = PRIVATE_KEY_PATH; - CString sMessageFilename = sPath; + RString sPrivFilename = PRIVATE_KEY_PATH; + RString sMessageFilename = sPath; if( sSignatureFile.empty() ) sSignatureFile = sPath + SIGNATURE_APPEND; - CString sPrivKey; + RString sPrivKey; if( !GetFileContents(sPrivFilename, sPrivKey) ) return; @@ -123,8 +123,8 @@ void CryptManager::SignFileToFile( CString sPath, CString sSignatureFile ) return; } - CString sSignature; - CString sError; + RString sSignature; + RString sError; if( !CryptHelpers::SignFile(file, sPrivKey, sSignature, sError) ) { LOG->Warn( "SignFileToFile failed: %s", sError.c_str() ); @@ -134,18 +134,18 @@ void CryptManager::SignFileToFile( CString sPath, CString sSignatureFile ) WriteFile( sSignatureFile, sSignature ); } -bool CryptManager::VerifyFileWithFile( CString sPath, CString sSignatureFile ) +bool CryptManager::VerifyFileWithFile( RString sPath, RString sSignatureFile ) { ASSERT( PREFSMAN->m_bSignProfileData ); if( VerifyFileWithFile(sPath, sSignatureFile, PUBLIC_KEY_PATH) ) return true; - vector asKeys; + vector asKeys; GetDirListing( ALTERNATE_PUBLIC_KEY_DIR, asKeys, false, true ); for( unsigned i = 0; i < asKeys.size(); ++i ) { - const CString &sKey = asKeys[i]; + const RString &sKey = asKeys[i]; LOG->Trace( "Trying alternate key \"%s\" ...", sKey.c_str() ); if( VerifyFileWithFile(sPath, sSignatureFile, sKey) ) @@ -155,15 +155,15 @@ bool CryptManager::VerifyFileWithFile( CString sPath, CString sSignatureFile ) return false; } -bool CryptManager::VerifyFileWithFile( CString sPath, CString sSignatureFile, CString sPublicKeyFile ) +bool CryptManager::VerifyFileWithFile( RString sPath, RString sSignatureFile, RString sPublicKeyFile ) { ASSERT( PREFSMAN->m_bSignProfileData ); - CString sMessageFilename = sPath; + RString sMessageFilename = sPath; if( sSignatureFile.empty() ) sSignatureFile = sPath + SIGNATURE_APPEND; - CString sPublicKey; + RString sPublicKey; if( !GetFileContents(sPublicKeyFile, sPublicKey) ) return false; @@ -171,7 +171,7 @@ bool CryptManager::VerifyFileWithFile( CString sPath, CString sSignatureFile, CS if( iBytes > MAX_SIGNATURE_SIZE_BYTES ) return false; - CString sSignature; + RString sSignature; if( !GetFileContents(sSignatureFile, sSignature) ) return false; @@ -182,7 +182,7 @@ bool CryptManager::VerifyFileWithFile( CString sPath, CString sSignatureFile, CS return false; } - CString sError; + RString sError; if( !CryptHelpers::VerifyFile(file, sSignature, sPublicKey, sError) ) { LOG->Warn( "VerifyFile(%s) failed: %s", sPath.c_str(), sError.c_str() ); @@ -192,14 +192,14 @@ bool CryptManager::VerifyFileWithFile( CString sPath, CString sSignatureFile, CS return true; } -bool CryptManager::Verify( CString sPath, CString sSignature ) +bool CryptManager::Verify( RString sPath, RString sSignature ) { ASSERT( PREFSMAN->m_bSignProfileData ); - CString sPublicKeyFile = PUBLIC_KEY_PATH; - CString sMessageFilename = sPath; + RString sPublicKeyFile = PUBLIC_KEY_PATH; + RString sMessageFilename = sPath; - CString sPublicKey; + RString sPublicKey; if( !GetFileContents(sPublicKeyFile, sPublicKey) ) return false; @@ -210,7 +210,7 @@ bool CryptManager::Verify( CString sPath, CString sSignature ) return false; } - CString sError; + RString sError; if( !CryptHelpers::VerifyFile(file, sSignature, sPublicKey, sError) ) { LOG->Warn( "Verify(%s) failed: %s", sPath.c_str(), sError.c_str() ); @@ -221,9 +221,9 @@ bool CryptManager::Verify( CString sPath, CString sSignature ) } #endif -static CString BinaryToHex( const unsigned char *string, int iNumBytes ) +static RString BinaryToHex( const unsigned char *string, int iNumBytes ) { - CString s; + RString s; for( int i=0; iWarn( "GetMD5: Failed to open file '%s'", fn.c_str() ); - return CString(); + return RString(); } MD5Init(&md5c); @@ -257,7 +257,7 @@ CString CryptManager::GetMD5( CString fn ) return BinaryToHex( digest, sizeof(digest) ); } -CString CryptManager::GetPublicKeyFileName() +RString CryptManager::GetPublicKeyFileName() { ASSERT( PREFSMAN->m_bSignProfileData ); diff --git a/stepmania/src/CryptManager.h b/stepmania/src/CryptManager.h index 8c600eaa29..053af62cb9 100644 --- a/stepmania/src/CryptManager.h +++ b/stepmania/src/CryptManager.h @@ -3,7 +3,7 @@ class RageFileBasic; -const CString SIGNATURE_APPEND = ".sig"; +const RString SIGNATURE_APPEND = ".sig"; class CryptManager { @@ -11,17 +11,17 @@ public: CryptManager(); ~CryptManager(); - static void GenerateRSAKey( unsigned int keyLength, CString privFilename, CString pubFilename, CString seed ); - static void SignFileToFile( CString sPath, CString sSignatureFile = "" ); - static bool VerifyFileWithFile( CString sPath, CString sSignatureFile = "" ); - static bool VerifyFileWithFile( CString sPath, CString sSignatureFile, CString sPublicKeyFile ); + static void GenerateRSAKey( unsigned int keyLength, RString privFilename, RString pubFilename, RString seed ); + static void SignFileToFile( RString sPath, RString sSignatureFile = "" ); + static bool VerifyFileWithFile( RString sPath, RString sSignatureFile = "" ); + static bool VerifyFileWithFile( RString sPath, RString sSignatureFile, RString sPublicKeyFile ); - static CString Sign( CString sPath ); - static bool Verify( CString sPath, CString sSignature ); + static RString Sign( RString sPath ); + static bool Verify( RString sPath, RString sSignature ); - static CString GetMD5( CString fn ); // in Hex + static RString GetMD5( RString fn ); // in Hex - static CString GetPublicKeyFileName(); + static RString GetPublicKeyFileName(); }; extern CryptManager* CRYPTMAN; // global and accessable from anywhere in our program diff --git a/stepmania/src/CsvFile.cpp b/stepmania/src/CsvFile.cpp index ac38a1fb80..eb0baabf7a 100644 --- a/stepmania/src/CsvFile.cpp +++ b/stepmania/src/CsvFile.cpp @@ -115,7 +115,7 @@ bool CsvFile::WriteFile( RageFileBasic &f ) const { FOREACH_CONST( StringVector, m_vvs, line ) { - CString sLine; + RString sLine; FOREACH_CONST( RString, *line, value ) { RString sVal = *value; diff --git a/stepmania/src/DancingCharacters.cpp b/stepmania/src/DancingCharacters.cpp index 7b491b00e7..73cacf7ad2 100644 --- a/stepmania/src/DancingCharacters.cpp +++ b/stepmania/src/DancingCharacters.cpp @@ -52,8 +52,8 @@ DancingCharacters::DancingCharacters() continue; // load in any potential 2D stuff - CString sCharacterDirectory = pChar->m_sCharDir; - CString sCurrentAnim; + RString sCharacterDirectory = pChar->m_sCharDir; + RString sCurrentAnim; sCurrentAnim = sCharacterDirectory + "2DIdle"; if( DoesFileExist(sCurrentAnim + "/BGAnimation.ini") ) // check 2D Idle BGAnim exists { diff --git a/stepmania/src/DateTime.cpp b/stepmania/src/DateTime.cpp index 609568091f..bb9dacc48d 100644 --- a/stepmania/src/DateTime.cpp +++ b/stepmania/src/DateTime.cpp @@ -76,9 +76,9 @@ void DateTime::StripTime() // // Common SQL/XML format: "YYYY-MM-DD HH:MM:SS" // -CString DateTime::GetString() const +RString DateTime::GetString() const { - CString s = ssprintf( "%d-%02d-%02d", + RString s = ssprintf( "%d-%02d-%02d", tm_year+1900, tm_mon+1, tm_mday ); @@ -96,7 +96,7 @@ CString DateTime::GetString() const return s; } -bool DateTime::FromString( const CString sDateTime ) +bool DateTime::FromString( const RString sDateTime ) { Init(); @@ -129,12 +129,12 @@ success: -CString DayInYearToString( int iDayInYear ) +RString DayInYearToString( int iDayInYear ) { return ssprintf("DayInYear%03d",iDayInYear); } -int StringToDayInYear( CString sDayInYear ) +int StringToDayInYear( RString sDayInYear ) { int iDayInYear; if( sscanf( sDayInYear, "DayInYear%d", &iDayInYear ) != 1 ) @@ -142,7 +142,7 @@ int StringToDayInYear( CString sDayInYear ) return iDayInYear; } -static const CString LAST_DAYS_NAME[NUM_LAST_DAYS] = +static const RString LAST_DAYS_NAME[NUM_LAST_DAYS] = { "Today", "Yesterday", @@ -153,7 +153,7 @@ static const CString LAST_DAYS_NAME[NUM_LAST_DAYS] = "Day6Ago", }; -CString LastDayToString( int iLastDayIndex ) +RString LastDayToString( int iLastDayIndex ) { return LAST_DAYS_NAME[iLastDayIndex]; } @@ -169,12 +169,12 @@ static const char *DAY_OF_WEEK_TO_NAME[DAYS_IN_WEEK] = "Saturday", }; -CString DayOfWeekToString( int iDayOfWeekIndex ) +RString DayOfWeekToString( int iDayOfWeekIndex ) { return DAY_OF_WEEK_TO_NAME[iDayOfWeekIndex]; } -CString HourInDayToString( int iHourInDayIndex ) +RString HourInDayToString( int iHourInDayIndex ) { return ssprintf("Hour%02d", iHourInDayIndex); } @@ -197,7 +197,7 @@ static const char *MonthNames[] = XToString( Month, NUM_Month ); XToLocalizedString( Month ); -CString LastWeekToString( int iLastWeekIndex ) +RString LastWeekToString( int iLastWeekIndex ) { switch( iLastWeekIndex ) { @@ -207,23 +207,23 @@ CString LastWeekToString( int iLastWeekIndex ) } } -CString LastDayToLocalizedString( int iLastDayIndex ) +RString LastDayToLocalizedString( int iLastDayIndex ) { - CString s = LastDayToString( iLastDayIndex ); + RString s = LastDayToString( iLastDayIndex ); s.Replace( "Day", "" ); s.Replace( "Ago", " Ago" ); return s; } -CString LastWeekToLocalizedString( int iLastWeekIndex ) +RString LastWeekToLocalizedString( int iLastWeekIndex ) { - CString s = LastWeekToString( iLastWeekIndex ); + RString s = LastWeekToString( iLastWeekIndex ); s.Replace( "Week", "" ); s.Replace( "Ago", " Ago" ); return s; } -CString HourInDayToLocalizedString( int iHourIndex ) +RString HourInDayToLocalizedString( int iHourIndex ) { int iBeginHour = iHourIndex; iBeginHour--; diff --git a/stepmania/src/DateTime.h b/stepmania/src/DateTime.h index a65e76bd53..9c97e22fad 100644 --- a/stepmania/src/DateTime.h +++ b/stepmania/src/DateTime.h @@ -10,17 +10,17 @@ const int HOURS_IN_DAY = 24; const int DAYS_IN_WEEK = 7; enum Month { NUM_Month = 12 }; -CString DayInYearToString( int iDayInYearIndex ); -CString LastDayToString( int iLastDayIndex ); -CString LastDayToLocalizedString( int iLastDayIndex ); -CString DayOfWeekToString( int iDayOfWeekIndex ); -CString DayOfWeekToLocalizedString( int iDayOfWeekIndex ); -CString HourInDayToString( int iHourIndex ); -CString HourInDayToLocalizedString( int iHourIndex ); -const CString &MonthToString( Month month ); -const CString &MonthToLocalizedString( Month month ); -CString LastWeekToString( int iLastWeekIndex ); -CString LastWeekToLocalizedString( int iLastWeekIndex ); +RString DayInYearToString( int iDayInYearIndex ); +RString LastDayToString( int iLastDayIndex ); +RString LastDayToLocalizedString( int iLastDayIndex ); +RString DayOfWeekToString( int iDayOfWeekIndex ); +RString DayOfWeekToLocalizedString( int iDayOfWeekIndex ); +RString HourInDayToString( int iHourIndex ); +RString HourInDayToLocalizedString( int iHourIndex ); +const RString &MonthToString( Month month ); +const RString &MonthToLocalizedString( Month month ); +RString LastWeekToString( int iLastWeekIndex ); +RString LastWeekToLocalizedString( int iLastWeekIndex ); tm AddDays( tm start, int iDaysToMove ); tm GetYesterday( tm start ); @@ -51,8 +51,8 @@ struct DateTime void StripTime(); - CString GetString() const; - bool FromString( const CString sDateTime ); + RString GetString() const; + bool FromString( const RString sDateTime ); }; diff --git a/stepmania/src/Difficulty.cpp b/stepmania/src/Difficulty.cpp index 2da0374b8f..502f2fb8e6 100644 --- a/stepmania/src/Difficulty.cpp +++ b/stepmania/src/Difficulty.cpp @@ -22,9 +22,9 @@ LuaFunction( DifficultyToLocalizedString, DifficultyToLocalizedString((Difficult /* We prefer the above names; recognize a number of others, too. (They'l * get normalized when written to SMs, etc.) */ -Difficulty StringToDifficulty( const CString& sDC ) +Difficulty StringToDifficulty( const RString& sDC ) { - CString s2 = sDC; + RString s2 = sDC; s2.MakeLower(); if( s2 == "beginner" ) return DIFFICULTY_BEGINNER; else if( s2 == "easy" ) return DIFFICULTY_EASY; @@ -51,7 +51,7 @@ static void LuaDifficulty(lua_State* L) { FOREACH_Difficulty( d ) { - CString s = DifficultyToString(d); + RString s = DifficultyToString(d); s.MakeUpper(); LUA->SetGlobal( "DIFFICULTY_"+s, d ); } @@ -90,7 +90,7 @@ static void LuaCourseDifficulty(lua_State* L) { FOREACH_CourseDifficulty( d ) { - CString s = CourseDifficultyToString(d); + RString s = CourseDifficultyToString(d); s.MakeUpper(); LUA->SetGlobal( "COURSE_DIFFICULTY_"+s, d ); } diff --git a/stepmania/src/Difficulty.h b/stepmania/src/Difficulty.h index 144924e34f..a73fcc75aa 100644 --- a/stepmania/src/Difficulty.h +++ b/stepmania/src/Difficulty.h @@ -18,9 +18,9 @@ enum Difficulty DIFFICULTY_INVALID }; #define FOREACH_Difficulty( dc ) FOREACH_ENUM( Difficulty, NUM_Difficulty, dc ) -const CString& DifficultyToString( Difficulty dc ); -const CString& DifficultyToLocalizedString( Difficulty dc ); -Difficulty StringToDifficulty( const CString& sDC ); +const RString& DifficultyToString( Difficulty dc ); +const RString& DifficultyToLocalizedString( Difficulty dc ); +Difficulty StringToDifficulty( const RString& sDC ); typedef Difficulty CourseDifficulty; @@ -28,9 +28,9 @@ typedef Difficulty CourseDifficulty; #define FOREACH_CourseDifficulty FOREACH_Difficulty #define FOREACH_ShownCourseDifficulty( cd ) for( Difficulty cd=GetNextShownCourseDifficulty((CourseDifficulty)-1); cd!=DIFFICULTY_INVALID; cd=GetNextShownCourseDifficulty(cd) ) -const CString& CourseDifficultyToString( Difficulty dc ); -const CString& CourseDifficultyToLocalizedString( Difficulty dc ); -Difficulty StringToCourseDifficulty( const CString& sDC ); +const RString& CourseDifficultyToString( Difficulty dc ); +const RString& CourseDifficultyToLocalizedString( Difficulty dc ); +Difficulty StringToCourseDifficulty( const RString& sDC ); Difficulty GetNextShownCourseDifficulty( Difficulty pn ); diff --git a/stepmania/src/DifficultyIcon.cpp b/stepmania/src/DifficultyIcon.cpp index 398689f361..6c74bda6ad 100644 --- a/stepmania/src/DifficultyIcon.cpp +++ b/stepmania/src/DifficultyIcon.cpp @@ -18,7 +18,7 @@ DifficultyIcon::DifficultyIcon() m_bBlank = false; } -bool DifficultyIcon::Load( CString sPath ) +bool DifficultyIcon::Load( RString sPath ) { Sprite::Load( sPath ); int iStates = GetNumStates(); @@ -27,7 +27,7 @@ bool DifficultyIcon::Load( CString sPath ) bWarn = false; if( bWarn ) { - CString sError = ssprintf( + RString sError = ssprintf( "The difficulty icon graphic '%s' must have %d or %d frames. It has %d states.", sPath.c_str(), NUM_Difficulty, @@ -39,9 +39,9 @@ bool DifficultyIcon::Load( CString sPath ) return true; } -void DifficultyIcon::LoadFromNode( const CString& sDir, const XNode* pNode ) +void DifficultyIcon::LoadFromNode( const RString& sDir, const XNode* pNode ) { - CString sFile; + RString sFile; if( !pNode->GetAttrValue( "File", sFile ) ) RageException::Throw( "MeterDisplay in " + sDir + " missing File attribute" ); diff --git a/stepmania/src/DifficultyIcon.h b/stepmania/src/DifficultyIcon.h index ed5040bc5e..8609631309 100644 --- a/stepmania/src/DifficultyIcon.h +++ b/stepmania/src/DifficultyIcon.h @@ -17,8 +17,8 @@ public: DifficultyIcon(); virtual bool EarlyAbortDraw() const { return m_bBlank || Sprite::EarlyAbortDraw(); } - bool Load( CString sFilePath ); - virtual void LoadFromNode( const CString& sDir, const XNode* pNode ); + bool Load( RString sFilePath ); + virtual void LoadFromNode( const RString& sDir, const XNode* pNode ); virtual Actor *Copy() const; void SetFromSteps( PlayerNumber pn, const Steps* pSteps ); diff --git a/stepmania/src/DifficultyList.cpp b/stepmania/src/DifficultyList.cpp index d3b503c4d8..2dd17a3d12 100644 --- a/stepmania/src/DifficultyList.cpp +++ b/stepmania/src/DifficultyList.cpp @@ -25,7 +25,7 @@ DifficultyList::~DifficultyList() { } -void DifficultyList::SetName( const CString &sName ) +void DifficultyList::SetName( const RString &sName ) { ActorFrame::SetName( sName ); diff --git a/stepmania/src/DifficultyList.h b/stepmania/src/DifficultyList.h index 72309d1f54..91dda1ef86 100644 --- a/stepmania/src/DifficultyList.h +++ b/stepmania/src/DifficultyList.h @@ -16,7 +16,7 @@ class DifficultyList: public ActorFrame public: DifficultyList(); virtual ~DifficultyList(); - virtual void SetName( const CString &sName ); + virtual void SetName( const RString &sName ); void Load(); void SetFromGameState(); diff --git a/stepmania/src/DifficultyMeter.cpp b/stepmania/src/DifficultyMeter.cpp index 06740ab6ec..08a4b3c1e5 100644 --- a/stepmania/src/DifficultyMeter.cpp +++ b/stepmania/src/DifficultyMeter.cpp @@ -19,9 +19,9 @@ DifficultyMeter::DifficultyMeter() { } -static CString GetDifficultyCommandName( Difficulty d ) { return "Set"+DifficultyToString(d); } -static CString GetCourseDifficultyCommandName( CourseDifficulty d ) { return "Set"+CourseDifficultyToString(d)+"Course"; } -static const CString DIFFICULTY_COMMAND_NAME_NONE = "SetNone"; +static RString GetDifficultyCommandName( Difficulty d ) { return "Set"+DifficultyToString(d); } +static RString GetCourseDifficultyCommandName( CourseDifficulty d ) { return "Set"+CourseDifficultyToString(d)+"Course"; } +static const RString DIFFICULTY_COMMAND_NAME_NONE = "SetNone"; /* sID experiment: * @@ -45,9 +45,9 @@ static const CString DIFFICULTY_COMMAND_NAME_NONE = "SetNone"; * so I'm trying it first in only this object. */ -void DifficultyMeter::Load( const CString &sType ) +void DifficultyMeter::Load( const RString &sType ) { - /* We can't use global ThemeMetrics, because we can have multiple + /* We can't use global ThemeMetrics, because we can have multiple * DifficultyMeters on screen at once, with different names. */ m_iNumFeetInMeter.Load(sType,"NumFeetInMeter"); m_iMaxFeetInMeter.Load(sType,"MaxFeetInMeter"); @@ -61,7 +61,7 @@ void DifficultyMeter::Load( const CString &sType ) if( m_bShowFeet ) { m_textFeet.SetName( "Feet" ); - CString Feet; + RString Feet; if( !m_bAutoColorFeet ) { for( unsigned i = 0; i < NUM_Difficulty; ++i ) @@ -118,11 +118,11 @@ void DifficultyMeter::Load( const CString &sType ) Unset(); } -void DifficultyMeter::LoadFromNode( const CString& sDir, const XNode* pNode ) +void DifficultyMeter::LoadFromNode( const RString& sDir, const XNode* pNode ) { ActorFrame::LoadFromNode( sDir, pNode ); - CString s; + RString s; pNode->GetAttrValue( "Type", s ); ASSERT( s.size() ); Load( s ); @@ -157,7 +157,7 @@ void DifficultyMeter::SetFromSteps( const Steps* pSteps ) } Difficulty dc = pSteps->GetDifficulty(); - SetInternal( pSteps->GetMeter(), dc, GetDifficultyCommandName(dc), dc == DIFFICULTY_EDIT ? pSteps->GetDescription() : CString() ); + SetInternal( pSteps->GetMeter(), dc, GetDifficultyCommandName(dc), dc == DIFFICULTY_EDIT ? pSteps->GetDescription() : RString() ); } void DifficultyMeter::SetFromTrail( const Trail* pTrail ) @@ -169,25 +169,25 @@ void DifficultyMeter::SetFromTrail( const Trail* pTrail ) } CourseDifficulty cd = pTrail->m_CourseDifficulty; - SetInternal( pTrail->GetMeter(), cd, GetCourseDifficultyCommandName( cd ), CString() ); + SetInternal( pTrail->GetMeter(), cd, GetCourseDifficultyCommandName( cd ), RString() ); } void DifficultyMeter::Unset() { - SetInternal( 0, DIFFICULTY_EDIT, DIFFICULTY_COMMAND_NAME_NONE, CString() ); + SetInternal( 0, DIFFICULTY_EDIT, DIFFICULTY_COMMAND_NAME_NONE, RString() ); } void DifficultyMeter::SetFromMeterAndDifficulty( int iMeter, Difficulty dc ) { - SetInternal( 0, dc, GetDifficultyCommandName(dc), CString() ); + SetInternal( 0, dc, GetDifficultyCommandName(dc), RString() ); } void DifficultyMeter::SetFromMeterAndCourseDifficulty( int iMeter, CourseDifficulty cd ) { - SetInternal( 0, cd, GetCourseDifficultyCommandName(cd), CString() ); + SetInternal( 0, cd, GetCourseDifficultyCommandName(cd), RString() ); } -void DifficultyMeter::SetInternal( int iMeter, Difficulty dc, const CString &sDifficultyCommand, const CString &sDescription ) +void DifficultyMeter::SetInternal( int iMeter, Difficulty dc, const RString &sDifficultyCommand, const RString &sDescription ) { if( m_bShowFeet ) { @@ -196,7 +196,7 @@ void DifficultyMeter::SetInternal( int iMeter, Difficulty dc, const CString &sDi if( !m_bAutoColorFeet ) on = char(dc + '0'); - CString sNewText; + RString sNewText; int iNumOn = min( (int)m_iMaxFeetInMeter, iMeter ); sNewText.insert( sNewText.end(), iNumOn, on ); int iNumOff = max( 0, m_iNumFeetInMeter-iNumOn ); @@ -221,7 +221,7 @@ void DifficultyMeter::SetInternal( int iMeter, Difficulty dc, const CString &sDi } else { - const CString sMeter = ssprintf( "%i", iMeter ); + const RString sMeter = ssprintf( "%i", iMeter ); m_textMeter.SetText( sMeter ); } diff --git a/stepmania/src/DifficultyMeter.h b/stepmania/src/DifficultyMeter.h index 03cb1fae12..6052d98eda 100644 --- a/stepmania/src/DifficultyMeter.h +++ b/stepmania/src/DifficultyMeter.h @@ -20,9 +20,9 @@ class DifficultyMeter: public ActorFrame public: DifficultyMeter(); - void Load( const CString &sType ); + void Load( const RString &sType ); - void LoadFromNode( const CString& sDir, const XNode* pNode ); + void LoadFromNode( const RString& sDir, const XNode* pNode ); virtual Actor *Copy() const; void SetFromGameState( PlayerNumber pn ); @@ -36,10 +36,10 @@ public: void PushSelf( lua_State *L ); private: - void SetInternal( int iMeter, Difficulty dc, const CString &sDifficultyCommand, const CString &sDescription ); + void SetInternal( int iMeter, Difficulty dc, const RString &sDifficultyCommand, const RString &sDescription ); BitmapText m_textFeet; // bar - CString m_sCurDifficultyCommand; + RString m_sCurDifficultyCommand; AutoActor m_Difficulty; /* "easy", "hard" */ BitmapText m_textMeter; /* 3, 9 */ BitmapText m_textEditDescription; @@ -51,7 +51,7 @@ private: ThemeMetric m_bShowMeter; ThemeMetric m_bShowEditDescription; ThemeMetric m_bAutoColorFeet; - ThemeMetric m_sZeroMeterString; + ThemeMetric m_sZeroMeterString; }; #endif diff --git a/stepmania/src/DualScrollBar.cpp b/stepmania/src/DualScrollBar.cpp index 051b65782c..0f68172ac7 100644 --- a/stepmania/src/DualScrollBar.cpp +++ b/stepmania/src/DualScrollBar.cpp @@ -9,7 +9,7 @@ DualScrollBar::DualScrollBar() m_fBarTime = 1; } -void DualScrollBar::Load( const CString &sType ) +void DualScrollBar::Load( const RString &sType ) { FOREACH_PlayerNumber( pn ) { diff --git a/stepmania/src/DualScrollBar.h b/stepmania/src/DualScrollBar.h index d00e456cb0..1ac979cfd2 100644 --- a/stepmania/src/DualScrollBar.h +++ b/stepmania/src/DualScrollBar.h @@ -12,7 +12,7 @@ class DualScrollBar: public ActorFrame public: DualScrollBar(); - void Load( const CString &sType ); + void Load( const RString &sType ); void SetBarHeight( float fHeight ) { m_fBarHeight = fHeight; } void SetBarTime( float fTime ) { m_fBarTime = fTime; } void SetPercentage( PlayerNumber pn, float fPercent ); diff --git a/stepmania/src/DynamicActorScroller.cpp b/stepmania/src/DynamicActorScroller.cpp index 647e949892..ea748bb996 100644 --- a/stepmania/src/DynamicActorScroller.cpp +++ b/stepmania/src/DynamicActorScroller.cpp @@ -8,7 +8,7 @@ Actor *DynamicActorScroller::Copy() const { return new DynamicActorScroller(*this); } -void DynamicActorScroller::LoadFromNode( const CString &sDir, const XNode *pNode ) +void DynamicActorScroller::LoadFromNode( const RString &sDir, const XNode *pNode ) { ActorScroller::LoadFromNode( sDir, pNode ); @@ -30,7 +30,7 @@ void DynamicActorScroller::LoadFromNode( const CString &sDir, const XNode *pNode this->AddChild( pCopy ); } - CString sLoadFunction; + RString sLoadFunction; pNode->GetAttrValue( "LoadFunction", sLoadFunction ); m_LoadFunction.SetFromExpression( sLoadFunction ); diff --git a/stepmania/src/DynamicActorScroller.h b/stepmania/src/DynamicActorScroller.h index a89672122b..4f8c5f7fea 100644 --- a/stepmania/src/DynamicActorScroller.h +++ b/stepmania/src/DynamicActorScroller.h @@ -10,7 +10,7 @@ class DynamicActorScroller: public ActorScroller { public: virtual Actor *Copy() const; - void LoadFromNode( const CString &sDir, const XNode *pNode ); + void LoadFromNode( const RString &sDir, const XNode *pNode ); protected: virtual void ShiftSubActors( int iDist ); diff --git a/stepmania/src/EditMenu.cpp b/stepmania/src/EditMenu.cpp index dbfad4ab9f..861bb6079a 100644 --- a/stepmania/src/EditMenu.cpp +++ b/stepmania/src/EditMenu.cpp @@ -37,12 +37,12 @@ XToString( EditMenuAction, NUM_EditMenuAction ); XToLocalizedString( EditMenuAction ); StringToX( EditMenuAction ); -static CString ARROWS_X_NAME( size_t i ) { return ssprintf("Arrows%dX",int(i+1)); } -static CString ROW_VALUE_X_NAME( size_t i ) { return ssprintf("RowValue%dX",int(i+1)); } -static CString ROW_Y_NAME( size_t i ) { return ssprintf("Row%dY",int(i+1)); } +static RString ARROWS_X_NAME( size_t i ) { return ssprintf("Arrows%dX",int(i+1)); } +static RString ROW_VALUE_X_NAME( size_t i ) { return ssprintf("RowValue%dX",int(i+1)); } +static RString ROW_Y_NAME( size_t i ) { return ssprintf("Row%dY",int(i+1)); } -void EditMenu::GetSongsToShowForGroup( const CString &sGroup, vector &vpSongsOut ) +void EditMenu::GetSongsToShowForGroup( const RString &sGroup, vector &vpSongsOut ) { vpSongsOut.clear(); if( !SHOW_GROUPS.GetValue() ) @@ -68,7 +68,7 @@ void EditMenu::GetSongsToShowForGroup( const CString &sGroup, vector &vpS SongUtil::SortSongPointerArrayByTitle( vpSongsOut ); } -void EditMenu::GetGroupsToShow( vector &vsGroupsOut ) +void EditMenu::GetGroupsToShow( vector &vsGroupsOut ) { vsGroupsOut.clear(); if( !SHOW_GROUPS.GetValue() ) @@ -77,7 +77,7 @@ void EditMenu::GetGroupsToShow( vector &vsGroupsOut ) SONGMAN->GetSongGroupNames( vsGroupsOut ); for( int i = vsGroupsOut.size()-1; i>=0; i-- ) { - const CString &sGroup = vsGroupsOut[i]; + const RString &sGroup = vsGroupsOut[i]; vector vpSongs; GetSongsToShowForGroup( sGroup, vpSongs ); // strip groups that have no unlocked songs @@ -95,7 +95,7 @@ EditMenu::~EditMenu() BANNERCACHE->Undemand(); } -void EditMenu::Load( const CString &sType ) +void EditMenu::Load( const RString &sType ) { LOG->Trace( "EditMenu::Load" ); @@ -430,7 +430,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row ) // fall through case ROW_STEPS: { - CString s; + RString s; Steps *pSteps = GetSelectedSteps(); if( pSteps && GetSelectedDifficulty() == DIFFICULTY_EDIT ) { @@ -497,7 +497,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row ) m_textLabel[ROW_SOURCE_STEPS].SetHidden( GetSelectedSteps() ? true : false ); m_textValue[ROW_SOURCE_STEPS].SetHidden( GetSelectedSteps() ? true : false ); { - CString s; + RString s; Steps *pSourceSteps = GetSelectedSourceSteps(); if( GetSelectedSourceDifficulty() == DIFFICULTY_INVALID ) s = BLANK; diff --git a/stepmania/src/EditMenu.h b/stepmania/src/EditMenu.h index 4e719a342a..9a5a24d7ac 100644 --- a/stepmania/src/EditMenu.h +++ b/stepmania/src/EditMenu.h @@ -26,8 +26,8 @@ enum EditMenuRow NUM_EditMenuRow }; #define FOREACH_EditMenuRow( r ) FOREACH_ENUM( EditMenuRow, NUM_EditMenuRow, r ) -const CString& EditMenuRowToString( EditMenuRow r ); -const CString& EditMenuRowToLocalizedString( EditMenuRow r ); +const RString& EditMenuRowToString( EditMenuRow r ); +const RString& EditMenuRowToLocalizedString( EditMenuRow r ); enum EditMenuAction { @@ -38,8 +38,8 @@ enum EditMenuAction NUM_EditMenuAction }; #define FOREACH_EditMenuAction( ema ) FOREACH_ENUM( EditMenuAction, NUM_EditMenuAction, ema ) -const CString& EditMenuActionToString( EditMenuAction ema ); -const CString& EditMenuActionToLocalizedString( EditMenuAction ema ); +const RString& EditMenuActionToString( EditMenuAction ema ); +const RString& EditMenuActionToLocalizedString( EditMenuAction ema ); const int NUM_ARROWS = 2; @@ -48,7 +48,7 @@ class EditMenu: public ActorFrame public: EditMenu(); ~EditMenu(); - void Load( const CString &sType ); + void Load( const RString &sType ); bool CanGoUp(); bool CanGoDown(); @@ -62,7 +62,7 @@ public: void RefreshAll(); - CString GetSelectedGroup() const { if( !SHOW_GROUPS.GetValue() ) return GROUP_ALL; ASSERT(m_iSelection[ROW_GROUP] < (int)m_sGroups.size()); return m_sGroups[m_iSelection[ROW_GROUP]]; } + RString GetSelectedGroup() const { if( !SHOW_GROUPS.GetValue() ) return GROUP_ALL; ASSERT(m_iSelection[ROW_GROUP] < (int)m_sGroups.size()); return m_sGroups[m_iSelection[ROW_GROUP]]; } Song* GetSelectedSong() const { ASSERT(m_iSelection[ROW_SONG] < (int)m_pSongs.size()); return m_pSongs[m_iSelection[ROW_SONG]]; } StepsType GetSelectedStepsType() const { ASSERT(m_iSelection[ROW_STEPS_TYPE] < (int)m_StepsTypes.size()); return m_StepsTypes[m_iSelection[ROW_STEPS_TYPE]]; } Steps* GetSelectedSteps() const { ASSERT(m_iSelection[ROW_STEPS] < (int)m_vpSteps.size()); return m_vpSteps[m_iSelection[ROW_STEPS]].pSteps; } @@ -75,8 +75,8 @@ public: EditMenuRow GetSelectedRow() const { return m_SelectedRow; } private: - void GetSongsToShowForGroup( const CString &sGroup, vector &vpSongsOut ); - void GetGroupsToShow( vector &vsGroupsOut ); + void GetSongsToShowForGroup( const RString &sGroup, vector &vpSongsOut ); + void GetGroupsToShow( vector &vsGroupsOut ); void UpdateArrows(); Sprite m_sprArrows[NUM_ARROWS]; @@ -102,7 +102,7 @@ private: Difficulty dc; }; - vector m_sGroups; + vector m_sGroups; vector m_pSongs; vector m_StepsTypes; vector m_vpSteps; diff --git a/stepmania/src/EnumHelper.cpp b/stepmania/src/EnumHelper.cpp index 42da6f9414..127ab856d6 100644 --- a/stepmania/src/EnumHelper.cpp +++ b/stepmania/src/EnumHelper.cpp @@ -3,7 +3,7 @@ #include "EnumHelper.h" #include "ThemeManager.h" -CString GetThemedString( const CString &sClass, const CString &sValue ) +RString GetThemedString( const RString &sClass, const RString &sValue ) { return THEME->GetString( sClass, sValue ); } diff --git a/stepmania/src/EnumHelper.h b/stepmania/src/EnumHelper.h index 189d414033..b2bc02ac2b 100644 --- a/stepmania/src/EnumHelper.h +++ b/stepmania/src/EnumHelper.h @@ -43,21 +43,21 @@ static inline T enum_add2( T val, int iAmt ) #define FOREACH_ENUM2( e, var ) for( e var=(e)0; var( var, +1 ) ) -static const CString EMPTY_STRING; +static const RString EMPTY_STRING; // TypeName[] must be an array of const char *, not RString, to // avoid initialization order problems when calling XToString. // Use Check##X##ToStringParamType to enforce that. #define XToString(X, CNT) \ static void Check##X##ToStringParamType( const char **p ) { } \ - const CString& X##ToString( X x ) \ + const RString& X##ToString( X x ) \ { \ Check##X##ToStringParamType( X##Names ); \ - static auto_ptr as_##X##Name[CNT]; \ + static auto_ptr as_##X##Name[CNT]; \ if( as_##X##Name[0].get() == NULL ) { \ for( unsigned i = 0; i < CNT; ++i ) \ { \ - auto_ptr ap( new CString( X##Names[i] ) ); \ + auto_ptr ap( new RString( X##Names[i] ) ); \ as_##X##Name[i] = ap; \ } \ } \ @@ -69,7 +69,7 @@ static const CString EMPTY_STRING; } #define XToLocalizedString(X) \ - const CString &X##ToLocalizedString( X x ) \ + const RString &X##ToLocalizedString( X x ) \ { \ static auto_ptr g_##X##Name[NUM_##X]; \ if( g_##X##Name[0].get() == NULL ) { \ @@ -83,9 +83,9 @@ static const CString EMPTY_STRING; } #define StringToX(X) \ - X StringTo##X( const CString& s ) \ + X StringTo##X( const RString& s ) \ { \ - CString s2 = s; \ + RString s2 = s; \ s2.MakeLower(); \ unsigned i; \ for( i = 0; i < ARRAYSIZE(X##Names); ++i ) \ @@ -105,11 +105,11 @@ static void Lua##X(lua_State* L) \ { \ FOREACH_ENUM( X, CNT, i ) \ { \ - CString s = X##Names[i]; \ + RString s = X##Names[i]; \ s.MakeUpper(); \ LUA->SetGlobal( Prefix+s, i ); \ } \ - CString sType = "NUM" #X "S" ; \ + RString sType = "NUM" #X "S" ; \ if( bCapitalize ) \ sType.MakeUpper(); \ LUA->SetGlobal( sType, CNT ); \ diff --git a/stepmania/src/FadingBanner.cpp b/stepmania/src/FadingBanner.cpp index cce66c11d8..d893cadb04 100644 --- a/stepmania/src/FadingBanner.cpp +++ b/stepmania/src/FadingBanner.cpp @@ -79,7 +79,7 @@ void FadingBanner::Load( RageTextureID ID, bool bLowResToHighRes ) * corresponding high-res banner. */ void FadingBanner::BeforeChange( bool bLowResToHighRes ) { - CString sCommand; + RString sCommand; if( bLowResToHighRes ) sCommand = "FadeFromCached"; else @@ -98,7 +98,7 @@ void FadingBanner::BeforeChange( bool bLowResToHighRes ) /* If this returns true, a low-resolution banner was loaded, and the full-res * banner should be loaded later. */ -bool FadingBanner::LoadFromCachedBanner( const CString &path ) +bool FadingBanner::LoadFromCachedBanner( const RString &path ) { /* If we're already on the given banner, don't fade again. */ if( path != "" && m_Banner[m_iIndexLatest].GetTexturePath() == path ) @@ -160,7 +160,7 @@ void FadingBanner::LoadFromSong( const Song* pSong ) /* Don't call HasBanner. That'll do disk access and cause the music wheel * to skip. */ - CString sPath = pSong->GetBannerPath(); + RString sPath = pSong->GetBannerPath(); if( sPath.empty() ) LoadFallback(); else @@ -179,9 +179,9 @@ void FadingBanner::LoadMode() m_Banner[m_iIndexLatest].LoadMode(); } -void FadingBanner::LoadFromSongGroup( CString sSongGroup ) +void FadingBanner::LoadFromSongGroup( RString sSongGroup ) { - const CString sGroupBannerPath = SONGMAN->GetSongGroupBannerPath( sSongGroup ); + const RString sGroupBannerPath = SONGMAN->GetSongGroupBannerPath( sSongGroup ); LoadFromCachedBanner( sGroupBannerPath ); } @@ -195,7 +195,7 @@ void FadingBanner::LoadFromCourse( const Course* pCourse ) /* Don't call HasBanner. That'll do disk access and cause the music wheel * to skip. */ - CString sPath = pCourse->m_sBannerPath; + RString sPath = pCourse->m_sBannerPath; if( sPath.empty() ) LoadCourseFallback(); else diff --git a/stepmania/src/FadingBanner.h b/stepmania/src/FadingBanner.h index bf21d1bee5..9718d159c9 100644 --- a/stepmania/src/FadingBanner.h +++ b/stepmania/src/FadingBanner.h @@ -21,7 +21,7 @@ public: void LoadFromSong( const Song* pSong ); // NULL means no song void LoadAllMusic(); void LoadMode(); - void LoadFromSongGroup( CString sSongGroup ); + void LoadFromSongGroup( RString sSongGroup ); void LoadFromCourse( const Course* pCourse ); void LoadIconFromCharacter( Character* pCharacter ); void LoadRoulette(); @@ -29,7 +29,7 @@ public: void LoadFallback(); void LoadCourseFallback(); - bool LoadFromCachedBanner( const CString &path ); + bool LoadFromCachedBanner( const RString &path ); void SetMovingFast( bool fast ) { m_bMovingFast=fast; } virtual void Update( float fDeltaTime ); diff --git a/stepmania/src/Font.cpp b/stepmania/src/Font.cpp index a2695f5538..98d89e09a9 100644 --- a/stepmania/src/Font.cpp +++ b/stepmania/src/Font.cpp @@ -330,10 +330,10 @@ void Font::SetDefaultGlyph( FontPage *pPage ) /* Given the INI for a font, find all of the texture pages for the font. */ -void Font::GetFontPaths( const CString &sFontIniPath, vector &asTexturePathsOut ) +void Font::GetFontPaths( const RString &sFontIniPath, vector &asTexturePathsOut ) { - CString sPrefix = SetExtension( sFontIniPath, "" ); - vector asFiles; + RString sPrefix = SetExtension( sFontIniPath, "" ); + vector asFiles; GetDirListing( sPrefix + "*", asFiles, false, true ); for( unsigned i = 0; i < asFiles.size(); ++i ) @@ -343,7 +343,7 @@ void Font::GetFontPaths( const CString &sFontIniPath, vector &asTexture } } -CString Font::GetPageNameFromFileName( const CString &sFilename ) +RString Font::GetPageNameFromFileName( const RString &sFilename ) { size_t begin = sFilename.find_first_of( '[' ); if( begin == string::npos ) @@ -360,7 +360,7 @@ CString Font::GetPageNameFromFileName( const CString &sFilename ) return sFilename.substr( begin, end-begin+1 ); } -void Font::LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const CString &sTexturePath, const CString &sPageName, CString sChars ) +void Font::LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const RString &sTexturePath, const RString &sPageName, RString sChars ) { cfg.m_sTexturePath = sTexturePath; @@ -396,8 +396,8 @@ void Font::LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const CStr { FOREACH_CONST_Attr( pNode, pAttr ) { - CString sName = pAttr->first; - const CString &sValue = pAttr->second; + RString sName = pAttr->first; + const RString &sValue = pAttr->second; sName.MakeUpper(); @@ -421,7 +421,7 @@ void Font::LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const CStr * map 1=2 is the same as * range unicode #1-1=2 */ - CString sCodepoint = sName.substr(4); /* "CODEPOINT" */ + RString sCodepoint = sName.substr(4); /* "CODEPOINT" */ const Game* pGame = NULL; @@ -429,7 +429,7 @@ void Font::LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const CStr { /* There's a space; the first word should be a game type. Split it. */ unsigned pos = sCodepoint.find_first_of( ' ' ); - CString gamename = sCodepoint.substr( 0, pos ); + RString gamename = sCodepoint.substr( 0, pos ); sCodepoint = sCodepoint.substr( pos+1 ); pGame = GameManager::StringToGameType(gamename); @@ -483,7 +483,7 @@ void Font::LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const CStr * Map hiragana to 0-84: * range Unicode #3041-3094=0 */ - vector asMatches; + vector asMatches; static Regex parse("^RANGE ([A-Z\\-]+)( ?#([0-9A-F]+)-([0-9A-F]+))?$"); bool bMatch = parse.Compare( sName, asMatches ); @@ -509,7 +509,7 @@ void Font::LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const CStr iCount = iLast - iFirst + 1; } - CString sRet = cfg.MapRange( asMatches[0], iFirst, atoi(sValue), iCount ); + RString sRet = cfg.MapRange( asMatches[0], iFirst, atoi(sValue), iCount ); if( !sRet.empty() ) RageException::Throw( "Font definition '%s' has an invalid range '%s': %s.", ini.GetPath().c_str(), sName.c_str(), sRet.c_str() ); @@ -525,7 +525,7 @@ void Font::LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const CStr * * This lets us assign characters very compactly and readably. */ - CString sRowStr = sName.substr(5); + RString sRowStr = sName.substr(5); ASSERT( IsAnInt(sRowStr) ); const int iRow = atoi( sRowStr.c_str() ); const int iFirstFrame = iRow * iNumFramesWide; @@ -568,7 +568,7 @@ void Font::LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const CStr cfg.CharToGlyphNo[0x00A0] = cfg.CharToGlyphNo[' ']; } -CString FontPageSettings::MapRange( CString sMapping, int iMapOffset, int iGlyphNo, int iCount ) +RString FontPageSettings::MapRange( RString sMapping, int iMapOffset, int iGlyphNo, int iCount ) { if( !sMapping.CompareNoCase("Unicode") ) { @@ -591,7 +591,7 @@ CString FontPageSettings::MapRange( CString sMapping, int iMapOffset, int iGlyph iCount--; } - return CString(); + return RString(); } const wchar_t *pMapping = FontCharmaps::get_char_map( sMapping ); @@ -622,10 +622,10 @@ CString FontPageSettings::MapRange( CString sMapping, int iMapOffset, int iGlyph if( iCount ) return "Map overflow"; /* there aren't enough characters in the map */ - return CString(); + return RString(); } -static vector LoadStack; +static vector LoadStack; /* * A font set is a set of files, eg: @@ -645,7 +645,7 @@ static vector LoadStack; * However, if it doesn't, we don't know what it is and the font will receive * no default mapping. A font isn't useful with no characters mapped. */ -void Font::Load( const CString &sIniPath, CString sChars ) +void Font::Load( const RString &sIniPath, RString sChars ) { ASSERT_M( !GetExtension(sIniPath).CompareNoCase("ini"), sIniPath ); @@ -654,7 +654,7 @@ void Font::Load( const CString &sIniPath, CString sChars ) { if( LoadStack[i] == sIniPath ) { - CString str = join("\n", LoadStack); + RString str = join("\n", LoadStack); str += "\n" + sIniPath; RageException::Throw("Font import recursion detected\n%s", str.c_str()); } @@ -668,7 +668,7 @@ void Font::Load( const CString &sIniPath, CString sChars ) m_sChars = sChars; /* Get the filenames associated with this font. */ - vector asTexturePaths; + vector asTexturePaths; GetFontPaths( sIniPath, asTexturePaths ); bool bCapitalsOnly = false; @@ -685,19 +685,19 @@ void Font::Load( const CString &sIniPath, CString sChars ) { /* If this is a top-level font (not a subfont), load the default font first. */ - vector ImportList; + vector ImportList; if( LoadStack.size() == 1 ) ImportList.push_back("Common default"); /* Check to see if we need to import any other fonts. Do this * before loading this font, so any characters in this font * override imported characters. */ - CString imports; + RString imports; ini.GetValue( "main", "import", imports ); split(imports, ",", ImportList, true); for(unsigned i = 0; i < ImportList.size(); ++i) { - CString path = THEME->GetPathF( "", ImportList[i], true ); + RString path = THEME->GetPathF( "", ImportList[i], true ); if( path == "" ) { LOG->Warn("Font \"%s\" imports a font \"%s\" that doesn't exist", sIniPath.c_str(), ImportList[i].c_str()); @@ -713,12 +713,12 @@ void Font::Load( const CString &sIniPath, CString sChars ) /* Load each font page. */ for( unsigned i = 0; i < asTexturePaths.size(); ++i ) { - const CString &sTexturePath = asTexturePaths[i]; + const RString &sTexturePath = asTexturePaths[i]; FontPage *pPage = new FontPage; /* Grab the page name, eg "foo" from "Normal [foo].png". */ - CString sPagename = GetPageNameFromFileName( sTexturePath ); + RString sPagename = GetPageNameFromFileName( sTexturePath ); /* Load settings for this page from the INI. */ FontPageSettings cfg; @@ -736,7 +736,7 @@ void Font::Load( const CString &sIniPath, CString sChars ) { if( it->second < pPage->m_pTexture->GetNumFrames() ) continue; /* OK */ - CString sError = ssprintf( "The font '%s' maps %s to frame %i, but the font only has %i frames.", + RString sError = ssprintf( "The font '%s' maps %s to frame %i, but the font only has %i frames.", sTexturePath.c_str(), WcharDisplayText(wchar_t(it->first)).c_str(), it->second, pPage->m_pTexture->GetNumFrames() ); RageException::Throw( sError ); } diff --git a/stepmania/src/Font.h b/stepmania/src/Font.h index 6e7af9d5f2..2ead44d94d 100644 --- a/stepmania/src/Font.h +++ b/stepmania/src/Font.h @@ -33,7 +33,7 @@ struct glyph struct FontPageSettings { - CString m_sTexturePath; + RString m_sTexturePath; int m_iDrawExtraPixelsLeft, m_iDrawExtraPixelsRight, @@ -44,7 +44,7 @@ struct FontPageSettings m_iDefaultWidth, m_iAdvanceExtraPixels; float m_fScaleAllWidthsBy; - CString m_sTextureHints; + RString m_sTextureHints; map CharToGlyphNo; /* If a value is missing, the width of the texture frame is used. */ @@ -64,7 +64,7 @@ struct FontPageSettings /* Map a range from a character map to glyphs. If cnt is -1, map the * whole map. Returns "" or an error message. */ - CString MapRange( CString sMapping, int iMapOffset, int iGlyphOffset, int iCount ); + RString MapRange( RString sMapping, int iMapOffset, int iGlyphOffset, int iCount ); }; class FontPage @@ -87,7 +87,7 @@ public: RageTexture* m_pTexture; // XXX remove? - CString m_sTexturePath; + RString m_sTexturePath; /* All glyphs in this list will point to m_pTexture. */ vector m_aGlyphs; @@ -103,7 +103,7 @@ class Font { public: int m_iRefCount; - CString path; + RString path; Font(); ~Font(); @@ -121,7 +121,7 @@ public: /* Steal all of a font's pages. */ void MergeFont(Font &f); - void Load(const CString &sFontOrTextureFilePath, CString sChars); + void Load(const RString &sFontOrTextureFilePath, RString sChars); void Unload(); void Reload(); @@ -154,11 +154,11 @@ private: bool m_bRightToLeft; /* We keep this around only for reloading. */ - CString m_sChars; + RString m_sChars; - void LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const CString &sTexturePath, const CString &PageName, CString sChars ); - static void GetFontPaths( const CString &sFontOrTextureFilePath, vector &sTexturePaths ); - CString GetPageNameFromFileName( const CString &sFilename ); + void LoadFontPageSettings( FontPageSettings &cfg, IniFile &ini, const RString &sTexturePath, const RString &PageName, RString sChars ); + static void GetFontPaths( const RString &sFontOrTextureFilePath, vector &sTexturePaths ); + RString GetPageNameFromFileName( const RString &sFilename ); }; /* Last private-use Unicode character: */ diff --git a/stepmania/src/FontCharAliases.cpp b/stepmania/src/FontCharAliases.cpp index a55190966c..1fc4151c35 100644 --- a/stepmania/src/FontCharAliases.cpp +++ b/stepmania/src/FontCharAliases.cpp @@ -7,9 +7,9 @@ #include /* Map from "&foo;" to a UTF-8 string. */ -typedef map aliasmap; +typedef map aliasmap; static aliasmap CharAliases; -static map CharAliasRepl; +static map CharAliasRepl; /* Editing this file in VC6 will be rather ugly, since it contains a lot of UTF-8. * Just don't change anything you can't read. :) */ @@ -322,15 +322,15 @@ static void InitCharAliases() for(aliasmap::const_iterator i = CharAliases.begin(); i != CharAliases.end(); ++i) { - CString from = i->first; - CString to = WcharToUTF8(i->second); + RString from = i->first; + RString to = WcharToUTF8(i->second); from.MakeLower(); CharAliasRepl[from] = to; } } /* Replace all &markers; and &#NNNN;s with UTF-8. */ -void FontCharAliases::ReplaceMarkers( CString &sText ) +void FontCharAliases::ReplaceMarkers( RString &sText ) { InitCharAliases(); ReplaceEntityText( sText, CharAliasRepl ); @@ -338,7 +338,7 @@ void FontCharAliases::ReplaceMarkers( CString &sText ) } /* Replace all &markers; and &#NNNN;s with UTF-8. */ -bool FontCharAliases::GetChar( CString &codepoint, wchar_t &ch ) +bool FontCharAliases::GetChar( RString &codepoint, wchar_t &ch ) { InitCharAliases(); aliasmap::const_iterator i = CharAliases.find(codepoint); diff --git a/stepmania/src/FontCharAliases.h b/stepmania/src/FontCharAliases.h index 347214e440..e1af46d210 100644 --- a/stepmania/src/FontCharAliases.h +++ b/stepmania/src/FontCharAliases.h @@ -3,8 +3,8 @@ namespace FontCharAliases { - void ReplaceMarkers( CString &sText ); - bool GetChar( CString &codepoint, wchar_t &ch ); + void ReplaceMarkers( RString &sText ); + bool GetChar( RString &codepoint, wchar_t &ch ); }; #endif diff --git a/stepmania/src/FontCharmaps.cpp b/stepmania/src/FontCharmaps.cpp index 79bd864408..0b2f2c9bc3 100644 --- a/stepmania/src/FontCharmaps.cpp +++ b/stepmania/src/FontCharmaps.cpp @@ -5,7 +5,7 @@ const wchar_t FontCharmaps::M_SKIP = 0xFEFF; -static map charmaps; +static map charmaps; using namespace FontCharmaps; @@ -159,13 +159,13 @@ static void Init() charmaps["numbers"] = map_numbers; } -const wchar_t *FontCharmaps::get_char_map(CString name) +const wchar_t *FontCharmaps::get_char_map(RString name) { Init(); name.MakeLower(); - map::const_iterator i = charmaps.find(name); + map::const_iterator i = charmaps.find(name); if(i == charmaps.end()) return NULL; diff --git a/stepmania/src/FontCharmaps.h b/stepmania/src/FontCharmaps.h index eb2ef4d87b..debb4c17d1 100644 --- a/stepmania/src/FontCharmaps.h +++ b/stepmania/src/FontCharmaps.h @@ -4,7 +4,7 @@ namespace FontCharmaps { extern const wchar_t M_SKIP; - const wchar_t *get_char_map(CString name); + const wchar_t *get_char_map(RString name); }; #endif diff --git a/stepmania/src/FontManager.cpp b/stepmania/src/FontManager.cpp index 7b2e172d2b..064116f85c 100644 --- a/stepmania/src/FontManager.cpp +++ b/stepmania/src/FontManager.cpp @@ -10,7 +10,7 @@ FontManager* FONT = NULL; // global and accessable from anywhere in our program // map from file name to a texture holder -typedef pair FontName; +typedef pair FontName; static map g_mapPathToFont; FontManager::FontManager() @@ -38,7 +38,7 @@ void FontManager::ReloadFonts() } } -Font* FontManager::LoadFont( const CString &sFontOrTextureFilePath, CString sChars ) +Font* FontManager::LoadFont( const RString &sFontOrTextureFilePath, RString sChars ) { // Convert the path to lowercase so that we don't load duplicates. // Really, this does not solve the duplicate problem. We could have two copies diff --git a/stepmania/src/FontManager.h b/stepmania/src/FontManager.h index 5fe9afad6f..a786c777ba 100644 --- a/stepmania/src/FontManager.h +++ b/stepmania/src/FontManager.h @@ -12,7 +12,7 @@ public: FontManager(); ~FontManager(); - Font* LoadFont( const CString &sFontOrTextureFilePath, CString sChars = "" ); + Font* LoadFont( const RString &sFontOrTextureFilePath, RString sChars = "" ); Font *CopyFont( Font *pFont ); void UnloadFont( Font *fp ); diff --git a/stepmania/src/Foreground.cpp b/stepmania/src/Foreground.cpp index 4aea387730..68cde9553f 100644 --- a/stepmania/src/Foreground.cpp +++ b/stepmania/src/Foreground.cpp @@ -33,7 +33,7 @@ void Foreground::LoadFromSong( const Song *pSong ) FOREACH_CONST( BackgroundChange, pSong->GetForegroundChanges(), bgc ) { const BackgroundChange &change = *bgc; - CString sBGName = change.m_def.m_sFile1; + RString sBGName = change.m_def.m_sFile1; LoadedBGA bga; bga.m_bga = ActorUtil::MakeActor( pSong->GetSongDir() + sBGName ); diff --git a/stepmania/src/Foreground.h b/stepmania/src/Foreground.h index 716b9cea0b..2c76db2549 100644 --- a/stepmania/src/Foreground.h +++ b/stepmania/src/Foreground.h @@ -17,7 +17,7 @@ public: virtual void Update( float fDeltaTime ); protected: - void LoadFromAniDir( CString sAniDir ); + void LoadFromAniDir( RString sAniDir ); struct LoadedBGA { Actor *m_bga; diff --git a/stepmania/src/Game.cpp b/stepmania/src/Game.cpp index 9de89b5e19..7b5bbfd487 100644 --- a/stepmania/src/Game.cpp +++ b/stepmania/src/Game.cpp @@ -15,7 +15,7 @@ int Game::GetNumGameplayButtons() const return iIndexOfStart; } -GameButton Game::ButtonNameToIndex( const CString &sButtonName ) const +GameButton Game::ButtonNameToIndex( const RString &sButtonName ) const { for( int i=0; iGetCurrentStyle(); const char *pzColumnName = pStyle->m_ColumnInfo[PLAYER_1][col].pzName; diff --git a/stepmania/src/Game.h b/stepmania/src/Game.h index 49f9fc71f3..46d228795e 100644 --- a/stepmania/src/Game.h +++ b/stepmania/src/Game.h @@ -52,10 +52,10 @@ public: GameButton m_SecondaryMenuButton[NUM_MenuButton]; DeviceButton m_iDefaultKeyboardKey[MAX_GAME_CONTROLLERS][MAX_GAME_BUTTONS]; // default keyboard keys only have an effect the current game is this game - GameButton ButtonNameToIndex( const CString &sButtonName ) const; + GameButton ButtonNameToIndex( const RString &sButtonName ) const; MenuInput GameInputToMenuInput( GameInput GameI ) const; // looks up current style in GAMESTATE. Yuck. void MenuInputToGameInput( MenuInput MenuI, GameInput GameIout[4] ) const; // looks up current style in GAMESTATE. Yuck. - CString ColToButtonName( int col ) const; // looks up current style. Yuck. + RString ColToButtonName( int col ) const; // looks up current style. Yuck. TapNoteScore MapTapNoteScore( TapNoteScore tns ) const; TapNoteScore m_mapW1To; diff --git a/stepmania/src/GameCommand.cpp b/stepmania/src/GameCommand.cpp index 43aea8ad7e..5379c98921 100644 --- a/stepmania/src/GameCommand.cpp +++ b/stepmania/src/GameCommand.cpp @@ -143,16 +143,16 @@ void GameCommand::Load( int iIndex, const Commands& cmds ) void GameCommand::LoadOne( const Command& cmd ) { - CString sName = cmd.GetName(); + RString sName = cmd.GetName(); if( sName.empty() ) return; - CString sValue; + RString sValue; for( unsigned i = 1; i < cmd.m_vsArgs.size(); ++i ) { if( i > 1 ) sValue += ","; - sValue += (CString) cmd.GetArg(i); + sValue += (RString) cmd.GetArg(i); } if( sName == "game" ) @@ -236,7 +236,7 @@ void GameCommand::LoadOne( const Command& cmd ) else if( sName == "steps" ) { - CString sSteps = sValue; + RString sSteps = sValue; /* This must be processed after "song" and "style" commands. */ if( !m_bInvalid ) @@ -271,7 +271,7 @@ void GameCommand::LoadOne( const Command& cmd ) else if( sName == "trail" ) { - CString sTrail = sValue; + RString sTrail = sValue; /* This must be processed after "course" and "style" commands. */ if( !m_bInvalid ) @@ -366,7 +366,7 @@ void GameCommand::LoadOne( const Command& cmd ) else { - CString sWarning = ssprintf( "Command '%s' is not valid.", cmd.GetOriginalCommandString().c_str() ); + RString sWarning = ssprintf( "Command '%s' is not valid.", cmd.GetOriginalCommandString().c_str() ); LOG->Warn( sWarning ); Dialog::OK( sWarning, "INVALID_GAME_COMMAND" ); } @@ -416,7 +416,7 @@ static bool AreStyleAndPlayModeCompatible( const Style *style, PlayMode pm ) // This is correct for dance (ie, no rave for solo and doubles), // and should be okay for pump .. not sure about other game types. // Techno Motion scales down versus arrows, though, so allow this. - if( style->m_iColsPerPlayer >= 6 && CString(GAMESTATE->m_pCurGame->m_szName) != "techno" ) + if( style->m_iColsPerPlayer >= 6 && RString(GAMESTATE->m_pCurGame->m_szName) != "techno" ) return false; /* Don't allow battle modes if the style takes both sides. */ @@ -427,7 +427,7 @@ static bool AreStyleAndPlayModeCompatible( const Style *style, PlayMode pm ) return true; } -bool GameCommand::IsPlayable( CString *why ) const +bool GameCommand::IsPlayable( RString *why ) const { if( m_bInvalid ) { @@ -673,7 +673,7 @@ void GameCommand::ApplySelf( const vector &vpns ) const if( m_pCharacter ) FOREACH_CONST( PlayerNumber, vpns, pn ) GAMESTATE->m_pCurCharacters[*pn] = m_pCharacter; - for( map::const_iterator i = m_SetEnv.begin(); i != m_SetEnv.end(); i++ ) + for( map::const_iterator i = m_SetEnv.begin(); i != m_SetEnv.end(); i++ ) { Lua *L = LUA->Get(); GAMESTATE->m_Environment->PushSelf(L); @@ -709,7 +709,7 @@ void GameCommand::ApplySelf( const vector &vpns ) const if( m_bStopMusic ) SOUND->StopMusic(); - FOREACH_CONST( CString, m_vsScreensToPrepare, s ) + FOREACH_CONST( RString, m_vsScreensToPrepare, s ) SCREENMAN->PrepareScreen( *s ); if( m_bInsertCredit ) diff --git a/stepmania/src/GameCommand.h b/stepmania/src/GameCommand.h index a8d3c20b20..7e972776cb 100644 --- a/stepmania/src/GameCommand.h +++ b/stepmania/src/GameCommand.h @@ -37,7 +37,7 @@ public: bool DescribesCurrentMode( PlayerNumber pn ) const; bool DescribesCurrentModeForAllPlayers() const; - bool IsPlayable( CString *why = NULL ) const; + bool IsPlayable( RString *why = NULL ) const; bool IsZero() const; /* If true, Apply() will apply m_sScreen. If false, it won't, and you need @@ -48,10 +48,10 @@ public: // so that we know the order of commands when it comes time to Apply. Commands m_Commands; - CString m_sName; // choice name - CString m_sText; // display text + RString m_sName; // choice name + RString m_sText; // display text bool m_bInvalid; - CString m_sInvalidReason; + RString m_sInvalidReason; int m_iIndex; MultiPlayer m_MultiPlayer; const Game* m_pGame; @@ -59,25 +59,25 @@ public: PlayMode m_pm; Difficulty m_dc; CourseDifficulty m_CourseDifficulty; - CString m_sAnnouncer; - CString m_sModifiers; - CString m_sScreen; + RString m_sAnnouncer; + RString m_sModifiers; + RString m_sScreen; LuaExpression m_LuaFunction; Song* m_pSong; Steps* m_pSteps; Course* m_pCourse; Trail* m_pTrail; Character* m_pCharacter; - std::map m_SetEnv; - CString m_sSongGroup; + std::map m_SetEnv; + RString m_sSongGroup; SortOrder m_SortOrder; int m_iUnlockIndex; // -1 for no unlock - CString m_sSoundPath; // "" for no sound - vector m_vsScreensToPrepare; + RString m_sSoundPath; // "" for no sound + vector m_vsScreensToPrepare; int m_iWeightPounds; // -1 == none specified int m_iGoalCalories; // -1 == none specified GoalType m_GoalType; - CString m_sProfileID; + RString m_sProfileID; bool m_bInsertCredit; bool m_bStopMusic; diff --git a/stepmania/src/GameConstantsAndTypes.cpp b/stepmania/src/GameConstantsAndTypes.cpp index ba6aab32de..6e927ad024 100644 --- a/stepmania/src/GameConstantsAndTypes.cpp +++ b/stepmania/src/GameConstantsAndTypes.cpp @@ -12,9 +12,9 @@ #include "LuaFunctions.h" #include "LocalizedString.h" -const CString RANKING_TO_FILL_IN_MARKER[NUM_PLAYERS] = {"#P1#","#P2#"}; +const RString RANKING_TO_FILL_IN_MARKER[NUM_PLAYERS] = {"#P1#","#P2#"}; -extern const CString GROUP_ALL = "---Group All---"; +extern const RString GROUP_ALL = "---Group All---"; static const char *RadarCategoryNames[] = { "Stream", @@ -37,7 +37,7 @@ static void LuaRadarCategory(lua_State* L) { FOREACH_RadarCategory( rc ) { - CString s = RadarCategoryToString( rc ); + RString s = RadarCategoryToString( rc ); LUA->SetGlobal( "RadarCategory_"+s, rc ); } } @@ -47,7 +47,7 @@ static void LuaStepsType(lua_State* L) { FOREACH_StepsType( st ) { - CString s = GAMEMAN->StepsTypeToString( st ); + RString s = GAMEMAN->StepsTypeToString( st ); s.MakeUpper(); s.Replace('-','_'); LUA->SetGlobal( "STEPS_TYPE_"+s, st ); @@ -110,7 +110,7 @@ static void LuaCoinMode(lua_State* L) { FOREACH_CoinMode( i ) { - CString s = CoinModeNames[i]; + RString s = CoinModeNames[i]; s.MakeUpper(); LUA->SetGlobal( "COIN_MODE_"+s, i ); } @@ -128,7 +128,7 @@ static void LuaPremium(lua_State* L) { FOREACH_Premium( i ) { - CString s = PremiumNames[i]; + RString s = PremiumNames[i]; s.MakeUpper(); LUA->SetGlobal( "PREMIUM_"+s, i ); } @@ -163,7 +163,7 @@ static void LuaSortOrder(lua_State* L) { FOREACH_SortOrder( so ) { - CString s = SortOrderToString( so ); + RString s = SortOrderToString( so ); // [uppercase] -> _[uppercase] for( unsigned i=0; iSetGlobal( "TNS_"+s, i ); } } @@ -235,7 +235,7 @@ static const char *HoldNoteScoreNames[] = { "Held", }; XToString( HoldNoteScore, NUM_HoldNoteScore ); -HoldNoteScore StringToHoldNoteScore( const CString &s ) +HoldNoteScore StringToHoldNoteScore( const RString &s ) { // for backward compatibility if ( s == "NG" ) return HNS_LetGo; @@ -253,7 +253,7 @@ static void LuaHoldNoteScores( lua_State* L ) { FOREACH_HoldNoteScore( i ) { - CString s = HoldNoteScoreNames[i]; + RString s = HoldNoteScoreNames[i]; LUA->SetGlobal( "HNS_"+s, i ); } } @@ -400,7 +400,7 @@ static void LuaGoalType(lua_State* L) { FOREACH_GoalType( gt ) { - CString s = GoalTypeNames[gt]; + RString s = GoalTypeNames[gt]; s.MakeUpper(); LUA->SetGlobal( "GOAL_"+s, gt ); } @@ -429,7 +429,7 @@ static void LuaStage(lua_State* L) { FOREACH_Stage( st ) { - CString s = StageNames[st]; + RString s = StageNames[st]; s.MakeUpper(); LUA->SetGlobal( "STAGE_"+s, st ); } diff --git a/stepmania/src/GameConstantsAndTypes.h b/stepmania/src/GameConstantsAndTypes.h index a954a8180d..d337937cfc 100644 --- a/stepmania/src/GameConstantsAndTypes.h +++ b/stepmania/src/GameConstantsAndTypes.h @@ -32,8 +32,8 @@ enum RadarCategory NUM_RadarCategory // leave this at the end }; #define FOREACH_RadarCategory( rc ) FOREACH_ENUM( RadarCategory, NUM_RadarCategory, rc ) -const CString& RadarCategoryToString( RadarCategory cat ); -const CString& RadarCategoryToLocalizedString( RadarCategory cat ); +const RString& RadarCategoryToString( RadarCategory cat ); +const RString& RadarCategoryToLocalizedString( RadarCategory cat ); enum StepsType @@ -86,9 +86,9 @@ enum PlayMode PLAY_MODE_INVALID }; #define FOREACH_PlayMode( pm ) FOREACH_ENUM( PlayMode, NUM_PlayMode, pm ) -const CString& PlayModeToString( PlayMode pm ); -const CString& PlayModeToLocalizedString( PlayMode pm ); -PlayMode StringToPlayMode( const CString& s ); +const RString& PlayModeToString( PlayMode pm ); +const RString& PlayModeToLocalizedString( PlayMode pm ); +PlayMode StringToPlayMode( const RString& s ); @@ -118,8 +118,8 @@ enum SortOrder }; const SortOrder MAX_SELECTABLE_SORT = (SortOrder)(SORT_ROULETTE-1); #define FOREACH_SortOrder( so ) FOREACH_ENUM( SortOrder, NUM_SORT_ORDERS, so ) -const CString& SortOrderToString( SortOrder so ); -SortOrder StringToSortOrder( const CString& str ); +const RString& SortOrderToString( SortOrder so ); +SortOrder StringToSortOrder( const RString& str ); inline bool IsSongSort( SortOrder so ) { return so >= SORT_PREFERRED && so <= SORT_CHALLENGE_METER; } @@ -141,9 +141,9 @@ enum TapNoteScore { TNS_INVALID, }; #define FOREACH_TapNoteScore( tns ) FOREACH_ENUM( TapNoteScore, NUM_TapNoteScore, tns ) -const CString& TapNoteScoreToString( TapNoteScore tns ); -const CString& TapNoteScoreToLocalizedString( TapNoteScore tns ); -TapNoteScore StringToTapNoteScore( const CString& str ); +const RString& TapNoteScoreToString( TapNoteScore tns ); +const RString& TapNoteScoreToLocalizedString( TapNoteScore tns ); +TapNoteScore StringToTapNoteScore( const RString& str ); enum HoldNoteScore @@ -155,9 +155,9 @@ enum HoldNoteScore HNS_INVALID, }; #define FOREACH_HoldNoteScore( hns ) FOREACH_ENUM( HoldNoteScore, NUM_HoldNoteScore, hns ) -const CString& HoldNoteScoreToString( HoldNoteScore hns ); -const CString& HoldNoteScoreToLocalizedString( HoldNoteScore hns ); -HoldNoteScore StringToHoldNoteScore( const CString& str ); +const RString& HoldNoteScoreToString( HoldNoteScore hns ); +const RString& HoldNoteScoreToLocalizedString( HoldNoteScore hns ); +HoldNoteScore StringToHoldNoteScore( const RString& str ); enum TimingWindow @@ -173,7 +173,7 @@ enum TimingWindow TW_Roll, NUM_TimingWindow }; -const CString& TimingWindowToString( TimingWindow tw ); +const RString& TimingWindowToString( TimingWindow tw ); enum ScoreEvent @@ -189,7 +189,7 @@ enum ScoreEvent SE_LetGo, NUM_ScoreEvent }; -const CString& ScoreEventToString( ScoreEvent se ); +const RString& ScoreEventToString( ScoreEvent se ); // @@ -218,7 +218,7 @@ enum MemoryCardState MemoryCardState_INVALID, }; -const CString& MemoryCardStateToString( MemoryCardState mcs ); +const RString& MemoryCardStateToString( MemoryCardState mcs ); // @@ -234,18 +234,18 @@ enum RankingCategory RANKING_INVALID }; #define FOREACH_RankingCategory( rc ) FOREACH_ENUM( RankingCategory, NUM_RANKING_CATEGORIES, rc ) -const CString& RankingCategoryToString( RankingCategory rc ); -RankingCategory StringToRankingCategory( const CString& rc ); +const RString& RankingCategoryToString( RankingCategory rc ); +RankingCategory StringToRankingCategory( const RString& rc ); -extern const CString RANKING_TO_FILL_IN_MARKER[NUM_PLAYERS]; -inline bool IsRankingToFillIn( const CString& sName ) { return !sName.empty() && sName[0]=='#'; } +extern const RString RANKING_TO_FILL_IN_MARKER[NUM_PLAYERS]; +inline bool IsRankingToFillIn( const RString& sName ) { return !sName.empty() && sName[0]=='#'; } RankingCategory AverageMeterToRankingCategory( int iAverageMeter ); // // Group stuff // -extern const CString GROUP_ALL; +extern const RString GROUP_ALL; // @@ -258,7 +258,7 @@ enum PlayerController PC_CPU, NUM_PlayerController }; -const CString& PlayerControllerToString( PlayerController pc ); +const RString& PlayerControllerToString( PlayerController pc ); const int MIN_SKILL = 0; const int MAX_SKILL = 10; @@ -300,7 +300,7 @@ enum CoinMode NUM_COIN_MODES }; #define FOREACH_CoinMode( i ) FOREACH_ENUM( CoinMode, NUM_COIN_MODES, i ) -const CString& CoinModeToString( CoinMode cm ); +const RString& CoinModeToString( CoinMode cm ); // @@ -314,7 +314,7 @@ enum Premium NUM_PREMIUMS }; #define FOREACH_Premium( i ) FOREACH_ENUM( Premium, NUM_PREMIUMS, i ) -const CString& PremiumToString( Premium p ); +const RString& PremiumToString( Premium p ); // @@ -337,9 +337,9 @@ enum PerDifficultyAward PER_DIFFICULTY_AWARD_INVALID, }; #define FOREACH_PerDifficultyAward( pma ) FOREACH_ENUM( PerDifficultyAward, NUM_PerDifficultyAward, pma ) -const CString& PerDifficultyAwardToString( PerDifficultyAward pma ); -const CString& PerDifficultyAwardToLocalizedString( PerDifficultyAward pma ); -PerDifficultyAward StringToPerDifficultyAward( const CString& pma ); +const RString& PerDifficultyAwardToString( PerDifficultyAward pma ); +const RString& PerDifficultyAwardToLocalizedString( PerDifficultyAward pma ); +PerDifficultyAward StringToPerDifficultyAward( const RString& pma ); enum PeakComboAward @@ -358,9 +358,9 @@ enum PeakComboAward PEAK_COMBO_AWARD_INVALID, }; #define FOREACH_PeakComboAward( pca ) FOREACH_ENUM( PeakComboAward, NUM_PeakComboAward, pca ) -const CString& PeakComboAwardToString( PeakComboAward pma ); -const CString& PeakComboAwardToLocalizedString( PeakComboAward pma ); -PeakComboAward StringToPeakComboAward( const CString& pma ); +const RString& PeakComboAwardToString( PeakComboAward pma ); +const RString& PeakComboAwardToLocalizedString( PeakComboAward pma ); +PeakComboAward StringToPeakComboAward( const RString& pma ); struct DisplayBpms @@ -381,8 +381,8 @@ enum StyleType NUM_STYLE_TYPES, STYLE_TYPE_INVALID }; -const CString& StyleTypeToString( StyleType s ); -StyleType StringToStyleType( const CString& s ); +const RString& StyleTypeToString( StyleType s ); +StyleType StringToStyleType( const RString& s ); enum MenuDir @@ -395,7 +395,7 @@ enum MenuDir NUM_MENU_DIRS }; #define FOREACH_MenuDir( md ) FOREACH_ENUM( MenuDir, NUM_MENU_DIRS, md ) -const CString& MenuDirToString( MenuDir md ); +const RString& MenuDirToString( MenuDir md ); enum GoalType @@ -407,8 +407,8 @@ enum GoalType GOAL_INVALID, }; #define FOREACH_GoalType( md ) FOREACH_ENUM( GoalType, NUM_GOAL_TYPES, gt ) -const CString& GoalTypeToString( GoalType gt ); -GoalType StringToGoalType( const CString& s ); +const RString& GoalTypeToString( GoalType gt ); +GoalType StringToGoalType( const RString& s ); enum EditMode @@ -441,7 +441,7 @@ enum Stage STAGE_INVALID, }; #define FOREACH_Stage( s ) FOREACH_ENUM( Stage, NUM_STAGES, s ) -const CString& StageToString( Stage s ); +const RString& StageToString( Stage s ); enum ProfileLoadResult diff --git a/stepmania/src/GameInput.cpp b/stepmania/src/GameInput.cpp index 5761a01b62..525592f1ab 100644 --- a/stepmania/src/GameInput.cpp +++ b/stepmania/src/GameInput.cpp @@ -14,17 +14,17 @@ XToString( GameController, MAX_GAME_CONTROLLERS ); StringToX( GameController ); -CString GameButtonToString( const Game* pGame, GameButton i ) +RString GameButtonToString( const Game* pGame, GameButton i ) { return pGame->m_szButtonNames[i]; } -CString GameButtonToLocalizedString( const Game* pGame, GameButton i ) +RString GameButtonToLocalizedString( const Game* pGame, GameButton i ) { return THEME->GetString( "GameButton", GameButtonToString(pGame,i) ); } -GameButton StringToGameButton( const Game* pGame, const CString& s ) +GameButton StringToGameButton( const Game* pGame, const RString& s ) { for( int i=0; im_iButtonsPerController; i++ ) { @@ -35,12 +35,12 @@ GameButton StringToGameButton( const Game* pGame, const CString& s ) } -CString GameInput::toString( const Game* pGame ) +RString GameInput::toString( const Game* pGame ) { - return GameControllerToString(controller) + CString("_") + GameButtonToString(pGame,button); + return GameControllerToString(controller) + RString("_") + GameButtonToString(pGame,button); } -bool GameInput::fromString( const Game* pGame, CString s ) +bool GameInput::fromString( const Game* pGame, RString s ) { char szController[32] = ""; char szButton[32] = ""; diff --git a/stepmania/src/GameInput.h b/stepmania/src/GameInput.h index dbbb29fc18..33e79733de 100644 --- a/stepmania/src/GameInput.h +++ b/stepmania/src/GameInput.h @@ -17,9 +17,9 @@ enum GameController #define FOREACH_GameController( gc ) FOREACH_ENUM( GameController, MAX_GAME_CONTROLLERS, gc ) typedef int GameButton; -CString GameButtonToString( const Game* pGame, GameButton i ); -CString GameButtonToLocalizedString( const Game* pGame, GameButton i ); -GameButton StringToGameButton( const Game* pGame, const CString& s ); +RString GameButtonToString( const Game* pGame, GameButton i ); +RString GameButtonToLocalizedString( const Game* pGame, GameButton i ); +GameButton StringToGameButton( const Game* pGame, const RString& s ); const GameButton MAX_GAME_BUTTONS = 20; const GameButton GAME_BUTTON_INVALID = MAX_GAME_BUTTONS+1; @@ -265,8 +265,8 @@ struct GameInput inline bool IsValid() const { return controller != GAME_CONTROLLER_INVALID; }; inline void MakeInvalid() { controller = GAME_CONTROLLER_INVALID; button = GAME_BUTTON_INVALID; }; - CString toString( const Game* pGame ); - bool fromString( const Game* pGame, CString s ); + RString toString( const Game* pGame ); + bool fromString( const Game* pGame, RString s ); }; #endif diff --git a/stepmania/src/GameLoop.cpp b/stepmania/src/GameLoop.cpp index b89a7ec685..d281b225f5 100644 --- a/stepmania/src/GameLoop.cpp +++ b/stepmania/src/GameLoop.cpp @@ -72,13 +72,13 @@ static bool ChangeAppPri() if( g_BoostAppPriority == BOOST_AUTO ) { vector vDevices; - vector vDescriptions; + vector vDescriptions; // This can get called before INPUTMAN is constructed. if( INPUTMAN ) { INPUTMAN->GetDevicesAndDescriptions(vDevices,vDescriptions); - CString sInputDevices = join( ",", vDescriptions ); + RString sInputDevices = join( ",", vDescriptions ); if( sInputDevices.find("NTPAD") != string::npos ) { LOG->Trace( "Using NTPAD. Don't boost priority." ); @@ -171,7 +171,7 @@ void GameLoop() { INPUTFILTER->Reset(); // fix "buttons stuck" if button held while unplugged INPUTMAN->LoadDrivers(); - CString sMessage; + RString sMessage; if( INPUTMAPPER->CheckForChangedInputDevicesAndRemap(sMessage) ) SCREENMAN->SystemMessage( sMessage ); } diff --git a/stepmania/src/GameManager.cpp b/stepmania/src/GameManager.cpp index 46cbaf0200..584695c6fa 100644 --- a/stepmania/src/GameManager.cpp +++ b/stepmania/src/GameManager.cpp @@ -2712,7 +2712,7 @@ const Game* GameManager::GetGameFromIndex( int index ) const bool GameManager::IsGameEnabled( const Game *pGame ) const { - vector asNoteSkins; + vector asNoteSkins; NOTESKIN->GetNoteSkinNames( pGame, asNoteSkins, false ); /* don't omit default */ return asNoteSkins.size() > 0; } @@ -2723,7 +2723,7 @@ int GameManager::StepsTypeToNumTracks( StepsType st ) return StepsTypes[st].NumTracks; } -StepsType GameManager::StringToStepsType( CString sStepsType ) +StepsType GameManager::StringToStepsType( RString sStepsType ) { sStepsType.MakeLower(); @@ -2744,24 +2744,24 @@ StepsType GameManager::StringToStepsType( CString sStepsType ) return STEPS_TYPE_DANCE_SINGLE; } -CString GameManager::StepsTypeToString( StepsType st ) +RString GameManager::StepsTypeToString( StepsType st ) { ASSERT_M( st < NUM_STEPS_TYPES, ssprintf("%i", st) ); return StepsTypes[st].name; } -CString GameManager::StepsTypeToLocalizedString( StepsType st ) +RString GameManager::StepsTypeToLocalizedString( StepsType st ) { - CString s = StepsTypeToString( st ); + RString s = StepsTypeToString( st ); if( THEME->HasMetric( "StepsType", s ) ) return THEME->GetString( "StepsType", s ); else return s; } -CString GameManager::StyleToLocalizedString( const Style* style ) +RString GameManager::StyleToLocalizedString( const Style* style ) { - CString s = style->m_szName; + RString s = style->m_szName; s = Capitalize( s ); if( THEME->HasMetric( "Style", s ) ) return THEME->GetString( "Style", s ); @@ -2769,7 +2769,7 @@ CString GameManager::StyleToLocalizedString( const Style* style ) return s; } -const Game* GameManager::StringToGameType( CString sGameType ) +const Game* GameManager::StringToGameType( RString sGameType ) { for( int i=0; i g_SoundsToPlayOnce; -vector g_SoundsToPlayOnceFromDir; -vector g_SoundsToPlayOnceFromAnnouncer; +vector g_SoundsToPlayOnce; +vector g_SoundsToPlayOnceFromDir; +vector g_SoundsToPlayOnceFromAnnouncer; struct MusicToPlay { - CString file, timing_file; + RString file, timing_file; bool HasTiming; TimingData timing_data; NoteData lights_data; @@ -252,7 +252,7 @@ static void StartMusic( MusicToPlay &ToPlay ) g_Playing = NewMusic; } -static void DoPlayOnceFromDir( CString sPath ) +static void DoPlayOnceFromDir( RString sPath ) { if( sPath == "" ) return; @@ -261,7 +261,7 @@ static void DoPlayOnceFromDir( CString sPath ) if( sPath.Right(1) != "/" ) sPath += "/"; - vector arraySoundFiles; + vector arraySoundFiles; GetDirListing( sPath + "*.mp3", arraySoundFiles ); GetDirListing( sPath + "*.wav", arraySoundFiles ); GetDirListing( sPath + "*.ogg", arraySoundFiles ); @@ -285,11 +285,11 @@ static bool SoundWaiting() static void StartQueuedSounds() { g_Mutex->Lock(); - vector aSoundsToPlayOnce = g_SoundsToPlayOnce; + vector aSoundsToPlayOnce = g_SoundsToPlayOnce; g_SoundsToPlayOnce.clear(); - vector aSoundsToPlayOnceFromDir = g_SoundsToPlayOnceFromDir; + vector aSoundsToPlayOnceFromDir = g_SoundsToPlayOnceFromDir; g_SoundsToPlayOnceFromDir.clear(); - vector aSoundsToPlayOnceFromAnnouncer = g_SoundsToPlayOnceFromAnnouncer; + vector aSoundsToPlayOnceFromAnnouncer = g_SoundsToPlayOnceFromAnnouncer; g_SoundsToPlayOnceFromAnnouncer.clear(); vector aMusicsToPlay = g_MusicsToPlay; g_MusicsToPlay.clear(); @@ -304,7 +304,7 @@ static void StartQueuedSounds() for( unsigned i = 0; i < aSoundsToPlayOnceFromAnnouncer.size(); ++i ) { - CString sPath = aSoundsToPlayOnceFromAnnouncer[i]; + RString sPath = aSoundsToPlayOnceFromAnnouncer[i]; if( sPath != "" ) { sPath = ANNOUNCER->GetPathTo( sPath ); @@ -512,8 +512,8 @@ void GameSoundManager::Update( float fDeltaTime ) const float fSoundTimePassed = fSeconds - GAMESTATE->m_fMusicSeconds; const float fDiff = fExpectedTimePassed - fSoundTimePassed; - static CString sLastFile = ""; - const CString ThisFile = g_Playing->m_Music->GetLoadedFilePath(); + static RString sLastFile = ""; + const RString ThisFile = g_Playing->m_Music->GetLoadedFilePath(); /* If fSoundTimePassed < 0, the sound has probably looped. */ if( sLastFile == ThisFile && fSoundTimePassed >= 0 && fabsf(fDiff) > 0.003f ) @@ -615,14 +615,14 @@ done_with_cabinet_light: } -CString GameSoundManager::GetMusicPath() const +RString GameSoundManager::GetMusicPath() const { LockMut( *g_Mutex ); return g_Playing->m_Music->GetLoadedFilePath(); } void GameSoundManager::PlayMusic( - const CString &file, + const RString &file, const TimingData *pTiming, bool force_loop, float start_sec, @@ -679,7 +679,7 @@ void GameSoundManager::HandleSongTimer( bool on ) g_UpdatingTimer = on; } -void GameSoundManager::PlayOnce( CString sPath ) +void GameSoundManager::PlayOnce( RString sPath ) { /* Add the sound to the g_SoundsToPlayOnce queue. */ g_Mutex->Lock(); @@ -688,7 +688,7 @@ void GameSoundManager::PlayOnce( CString sPath ) g_Mutex->Unlock(); } -void GameSoundManager::PlayOnceFromDir( CString sPath ) +void GameSoundManager::PlayOnceFromDir( RString sPath ) { /* Add the path to the g_SoundsToPlayOnceFromDir queue. */ g_Mutex->Lock(); @@ -697,7 +697,7 @@ void GameSoundManager::PlayOnceFromDir( CString sPath ) g_Mutex->Unlock(); } -void GameSoundManager::PlayOnceFromAnnouncer( CString sPath ) +void GameSoundManager::PlayOnceFromAnnouncer( RString sPath ) { /* Add the path to the g_SoundsToPlayOnceFromDir queue. */ g_Mutex->Lock(); @@ -735,7 +735,7 @@ public: p->DimMusic( fVolume, fDurationSeconds ); return 0; } - static int PlayOnce( T* p, lua_State *L ) { CString sPath = SArg(1); p->PlayOnce( sPath ); return 0; } + static int PlayOnce( T* p, lua_State *L ) { RString sPath = SArg(1); p->PlayOnce( sPath ); return 0; } static void Register(lua_State *L) { diff --git a/stepmania/src/GameSoundManager.h b/stepmania/src/GameSoundManager.h index f693740e89..f0945778c1 100644 --- a/stepmania/src/GameSoundManager.h +++ b/stepmania/src/GameSoundManager.h @@ -18,7 +18,7 @@ public: void Update( float fDeltaTime ); void PlayMusic( - const CString &file, + const RString &file, const TimingData *pTiming = NULL, bool force_loop = false, float start_sec = 0, @@ -27,12 +27,12 @@ public: bool align_beat = true ); void StopMusic() { PlayMusic(""); } void DimMusic( float fVolume, float fDurationSeconds ); - CString GetMusicPath() const; + RString GetMusicPath() const; void Flush(); - void PlayOnce( CString sPath ); - void PlayOnceFromDir( CString sDir ); - void PlayOnceFromAnnouncer( CString sFolderName ); + void PlayOnce( RString sPath ); + void PlayOnceFromDir( RString sDir ); + void PlayOnceFromAnnouncer( RString sFolderName ); float GetPlayLatency() const; void HandleSongTimer( bool on=true ); diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index be0c03830a..decb3f41d5 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -46,12 +46,12 @@ GameState* GAMESTATE = NULL; // global and accessable from anywhere in our progr ThemeMetric USE_NAME_BLACKLIST("GameState","UseNameBlacklist"); -ThemeMetric DEFAULT_SORT ("GameState","DefaultSort"); +ThemeMetric DEFAULT_SORT ("GameState","DefaultSort"); SortOrder GetDefaultSort() { return StringToSortOrder( DEFAULT_SORT ); } -ThemeMetric DEFAULT_SONG ("GameState","DefaultSong"); +ThemeMetric DEFAULT_SONG ("GameState","DefaultSong"); Song* GameState::GetDefaultSong() const { SongID sid; @@ -127,12 +127,12 @@ GameState::~GameState() SAFE_DELETE( m_pTimingDataOriginal ); } -void GameState::ApplyGameCommand( const CString &sCommand, PlayerNumber pn ) +void GameState::ApplyGameCommand( const RString &sCommand, PlayerNumber pn ) { GameCommand m; m.Load( 0, ParseCommands(sCommand) ); - CString sWhy; + RString sWhy; if( !m.IsPlayable(&sWhy) ) RageException::Throw( "Can't apply mode \"%s\": %s", sCommand.c_str(), sWhy.c_str() ); @@ -145,7 +145,7 @@ void GameState::ApplyGameCommand( const CString &sCommand, PlayerNumber pn ) void GameState::ApplyCmdline() { /* We need to join players before we can set the style. */ - CString sPlayer; + RString sPlayer; for( int i = 0; GetCommandlineArgument( "player", &sPlayer, i ); ++i ) { int pn = atoi( sPlayer )-1; @@ -155,7 +155,7 @@ void GameState::ApplyCmdline() this->JoinPlayer( (PlayerNumber) pn ); } - CString sMode; + RString sMode; for( int i = 0; GetCommandlineArgument( "mode", &sMode, i ); ++i ) { ApplyGameCommand( sMode ); @@ -357,7 +357,7 @@ void GameState::PlayersFinalized() Profile* pProfile = PROFILEMAN->GetProfile(pn); - CString sModifiers; + RString sModifiers; if( pProfile->GetDefaultModifiers( this->m_pCurGame, sModifiers ) ) { /* We don't save negative preferences (eg. "no reverse"). If the theme @@ -578,7 +578,7 @@ void GameState::Update( float fDelta ) void GameState::SetCurGame( const Game *pGame ) { m_pCurGame.Set( pGame ); - CString sGame = pGame ? CString(pGame->m_szName) : CString(); + RString sGame = pGame ? RString(pGame->m_szName) : RString(); PREFSMAN->SetCurrentGame( sGame ); } @@ -764,7 +764,7 @@ int GameState::GetCourseSongIndex() const static LocalizedString PLAYER1 ("GameState","Player 1"); static LocalizedString PLAYER2 ("GameState","Player 2"); static LocalizedString CPU ("GameState","CPU"); -CString GameState::GetPlayerDisplayName( PlayerNumber pn ) const +RString GameState::GetPlayerDisplayName( PlayerNumber pn ) const { ASSERT( IsPlayerEnabled(pn) ); const LocalizedString *pDefaultNames[] = { &PLAYER1, &PLAYER2 }; @@ -1030,7 +1030,7 @@ void GameState::GetDefaultSongOptions( SongOptions &so ) so.FromString( CommonMetrics::DEFAULT_MODIFIERS ); } -void GameState::ApplyModifiers( PlayerNumber pn, CString sModifiers ) +void GameState::ApplyModifiers( PlayerNumber pn, RString sModifiers ) { m_pPlayerState[pn]->m_PlayerOptions.FromString( sModifiers ); m_SongOptions.FromString( sModifiers ); @@ -1095,7 +1095,7 @@ bool GameState::IsDisqualified( PlayerNumber pn ) } } -void GameState::GetAllUsedNoteSkins( vector &out ) const +void GameState::GetAllUsedNoteSkins( vector &out ) const { FOREACH_EnabledPlayer( pn ) { @@ -1453,7 +1453,7 @@ bool GameState::AnyPlayerHasRankingFeats() const return false; } -void GameState::StoreRankingName( PlayerNumber pn, CString sName ) +void GameState::StoreRankingName( PlayerNumber pn, RString sName ) { sName.MakeUpper(); @@ -1462,7 +1462,7 @@ void GameState::StoreRankingName( PlayerNumber pn, CString sName ) RageFile file; if( file.Open(NAME_BLACKLIST_FILE) ) { - CString sLine; + RString sLine; while( !file.AtEOF() ) { @@ -1575,7 +1575,7 @@ bool GameState::IsTimeToPlayAttractSounds() const return false; } -void GameState::VisitAttractScreen( const CString sScreenName ) +void GameState::VisitAttractScreen( const RString sScreenName ) { if( sScreenName == CommonMetrics::FIRST_ATTRACT_SCREEN.GetValue() ) m_iNumTimesThroughAttract++; @@ -1743,7 +1743,7 @@ float GameState::GetGoalPercentComplete( PlayerNumber pn ) return fActual / fGoal; } -bool GameState::PlayerIsUsingModifier( PlayerNumber pn, const CString &sModifier ) +bool GameState::PlayerIsUsingModifier( PlayerNumber pn, const RString &sModifier ) { PlayerOptions po = GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions; SongOptions so = GAMESTATE->m_SongOptions; @@ -1985,7 +1985,7 @@ public: for( unsigned i=0; iGetDifficulty() ); + RString sDifficulty = DifficultyToLocalizedString( pSteps->GetDifficulty() ); // HACK: reset capitalization sDifficulty.MakeLower(); @@ -2090,14 +2090,14 @@ LuaFunction_NoArgs( IsFinalStage, GAMESTATE->IsFinalStage() ) LuaFunction_NoArgs( IsExtraStage, GAMESTATE->IsExtraStage() ) LuaFunction_NoArgs( IsExtraStage2, GAMESTATE->IsExtraStage2() ) LuaFunction_NoArgs( CourseSongIndex, GAMESTATE->GetCourseSongIndex() ) -LuaFunction_NoArgs( CurStyleName, CString( GAMESTATE->m_pCurStyle == NULL ? "none": GAMESTATE->GetCurrentStyle()->m_szName ) ) +LuaFunction_NoArgs( CurStyleName, RString( GAMESTATE->m_pCurStyle == NULL ? "none": GAMESTATE->GetCurrentStyle()->m_szName ) ) LuaFunction_NoArgs( GetNumPlayersEnabled, GAMESTATE->GetNumPlayersEnabled() ) LuaFunction_NoArgs( GetEasiestNotesDifficulty, GAMESTATE->GetEasiestStepsDifficulty() ) -CString GetStageText() +RString GetStageText() { // all lowercase or compatibility with scripts - CString s = StageToString( GAMESTATE->GetCurrentStage() ); + RString s = StageToString( GAMESTATE->GetCurrentStage() ); s.MakeLower(); return s; } diff --git a/stepmania/src/GameState.h b/stepmania/src/GameState.h index ade46b5331..c610818413 100644 --- a/stepmania/src/GameState.h +++ b/stepmania/src/GameState.h @@ -38,7 +38,7 @@ public: ~GameState(); void Reset(); void ApplyCmdline(); // called by Reset - void ApplyGameCommand( const CString &sCommand, PlayerNumber pn=PLAYER_INVALID ); + void ApplyGameCommand( const RString &sCommand, PlayerNumber pn=PLAYER_INVALID ); void BeginGame(); // called when first player joins void JoinPlayer( PlayerNumber pn ); void PlayersFinalized(); // called after a style is chosen, which means the number of players is finalized @@ -102,9 +102,9 @@ public: bool ShowW1() const; - CString m_sLoadingMessage; // used in loading screen - BroadcastOnChange m_sPreferredSongGroup; // GROUP_ALL denotes no preferred group - BroadcastOnChange m_sPreferredCourseGroup; // GROUP_ALL denotes no preferred group + RString m_sLoadingMessage; // used in loading screen + BroadcastOnChange m_sPreferredSongGroup; // GROUP_ALL denotes no preferred group + BroadcastOnChange m_sPreferredCourseGroup; // GROUP_ALL denotes no preferred group bool m_bChangedFailTypeOnScreenSongOptions; // true if FailType was changed in the song options screen BroadcastOnChange1D m_PreferredDifficulty; BroadcastOnChange1D m_PreferredCourseDifficulty;// used in nonstop @@ -129,7 +129,7 @@ public: Stage GetCurrentStage() const; bool IsStagePossible( Stage s ) const; int GetCourseSongIndex() const; - CString GetPlayerDisplayName( PlayerNumber pn ) const; + RString GetPlayerDisplayName( PlayerNumber pn ) const; // @@ -163,7 +163,7 @@ public: RageTimer m_LastBeatUpdate; // time of last m_fSongBeat, etc. update BroadcastOnChange m_bGameplayLeadIn; - void GetAllUsedNoteSkins( vector &out ) const; + void GetAllUsedNoteSkins( vector &out ) const; static const float MUSIC_SECONDS_INVALID; @@ -207,14 +207,14 @@ public: void GetDefaultPlayerOptions( PlayerOptions &po ); void GetDefaultSongOptions( SongOptions &so ); - void ApplyModifiers( PlayerNumber pn, CString sModifiers ); + void ApplyModifiers( PlayerNumber pn, RString sModifiers ); void StoreSelectedOptions(); void RestoreSelectedOptions(); void RestoreStageOptions(); void ResetCurrentOptions(); bool IsDisqualified( PlayerNumber pn ); - bool PlayerIsUsingModifier( PlayerNumber pn, const CString &sModifier ); + bool PlayerIsUsingModifier( PlayerNumber pn, const RString &sModifier ); SongOptions::FailType GetPlayerFailType( const PlayerState *pPlayerState ) const; @@ -237,15 +237,15 @@ public: Grade grade; int iScore; float fPercentDP; - CString Banner; - CString Feat; - CString *pStringToFill; + RString Banner; + RString Feat; + RString *pStringToFill; }; void GetRankingFeats( PlayerNumber pn, vector &vFeatsOut ) const; bool AnyPlayerHasRankingFeats() const; - void StoreRankingName( PlayerNumber pn, CString name ); // Called by name entry screens - vector m_vpsNamesThatWereFilled; // filled on StoreRankingName, + void StoreRankingName( PlayerNumber pn, RString name ); // Called by name entry screens + vector m_vpsNamesThatWereFilled; // filled on StoreRankingName, // @@ -261,7 +261,7 @@ public: // int m_iNumTimesThroughAttract; // negative means play regardless of m_iAttractSoundFrequency setting bool IsTimeToPlayAttractSounds() const; - void VisitAttractScreen( const CString sScreenName ); + void VisitAttractScreen( const RString sScreenName ); // // PlayerState @@ -286,7 +286,7 @@ public: BroadcastOnChangePtr m_pEditSourceSteps; BroadcastOnChange m_stEditSource; BroadcastOnChange m_iEditCourseEntryIndex; - BroadcastOnChange m_sEditLocalProfileID; + BroadcastOnChange m_sEditLocalProfileID; Profile* GetEditLocalProfile(); // Workout stuff diff --git a/stepmania/src/GhostArrowRow.cpp b/stepmania/src/GhostArrowRow.cpp index 9ad2326266..4b05ec3a54 100644 --- a/stepmania/src/GhostArrowRow.cpp +++ b/stepmania/src/GhostArrowRow.cpp @@ -26,7 +26,7 @@ void GhostArrowRow::Load( const PlayerState* pPlayerState, float fYReverseOffset // init arrows for( int c=0; cm_iColsPerPlayer; c++ ) { - const CString &sButton = GAMESTATE->GetCurrentGame()->ColToButtonName( c ); + const RString &sButton = GAMESTATE->GetCurrentGame()->ColToButtonName( c ); m_bHoldIsActive.push_back( false ); m_bHoldWasActive.push_back( false ); @@ -92,7 +92,7 @@ void GhostArrowRow::DidTapNote( int iCol, TapNoteScore tns, bool bBright ) m_Ghost[iCol]->PlayCommand( "Bright" ); else m_Ghost[iCol]->PlayCommand( "Dim" ); - CString sJudge = TapNoteScoreToString( tns ); + RString sJudge = TapNoteScoreToString( tns ); m_Ghost[iCol]->PlayCommand( Capitalize(sJudge) ); } @@ -104,7 +104,7 @@ void GhostArrowRow::DidHoldNote( int iCol, HoldNoteScore hns, bool bBright ) m_Ghost[iCol]->PlayCommand( "Bright" ); else m_Ghost[iCol]->PlayCommand( "Dim" ); - CString sJudge = HoldNoteScoreToString( hns ); + RString sJudge = HoldNoteScoreToString( hns ); m_Ghost[iCol]->PlayCommand( Capitalize(sJudge) ); } diff --git a/stepmania/src/Grade.cpp b/stepmania/src/Grade.cpp index 4b2d91c940..a68f3cf0f4 100644 --- a/stepmania/src/Grade.cpp +++ b/stepmania/src/Grade.cpp @@ -9,15 +9,15 @@ LuaFunction( GradeToString, GradeToString((Grade)IArg(1)) ) -CString GradeToLocalizedString( Grade g ) +RString GradeToLocalizedString( Grade g ) { - CString s = GradeToString(g); + RString s = GradeToString(g); if( !THEME->HasMetric("Grade",s) ) return "???"; return THEME->GetString( "Grade",s ); } -CString GradeToOldString( Grade g ) +RString GradeToOldString( Grade g ) { // string is meant to be human readable switch( g ) @@ -35,9 +35,9 @@ CString GradeToOldString( Grade g ) } }; -Grade StringToGrade( const CString &sGrade ) +Grade StringToGrade( const RString &sGrade ) { - CString s = sGrade; + RString s = sGrade; s.MakeUpper(); // new style @@ -54,7 +54,7 @@ static void LuaGrade(lua_State* L) { FOREACH_Grade( g ) { - CString s = GradeToString(g); + RString s = GradeToString(g); LUA->SetGlobal( "Grade_"+s, g ); } LUA->SetGlobal( "NUM_Grade", NUM_Grade ); diff --git a/stepmania/src/Grade.h b/stepmania/src/Grade.h index 94647cbecd..7d4919b010 100644 --- a/stepmania/src/Grade.h +++ b/stepmania/src/Grade.h @@ -35,7 +35,7 @@ enum Grade /* This is in the header so the test sets don't require Grade.cpp (through PrefsManager), * since that pulls in ThemeManager. */ -static inline CString GradeToString( Grade g ) +static inline RString GradeToString( Grade g ) { ASSERT_M( (g >= 0 && gGetMetricI("PlayerStageStats","NumGradeTiersUsed"), g ) diff --git a/stepmania/src/GradeDisplay.cpp b/stepmania/src/GradeDisplay.cpp index 7ecec18c74..bd267a8734 100644 --- a/stepmania/src/GradeDisplay.cpp +++ b/stepmania/src/GradeDisplay.cpp @@ -30,11 +30,11 @@ void GradeDisplay::Load( RageTextureID ID ) Sprite::StopAnimating(); bool bWarn = Sprite::GetNumStates() != 8 && Sprite::GetNumStates() != 16; - if( ID.filename.find("_blank") != CString::npos ) + if( ID.filename.find("_blank") != RString::npos ) bWarn = false; if( bWarn ) { - CString sError = ssprintf( "The grade graphic '%s' must have either 8 or 16 frames.", ID.filename.c_str() ); + RString sError = ssprintf( "The grade graphic '%s' must have either 8 or 16 frames.", ID.filename.c_str() ); LOG->Warn( sError ); Dialog::OK( sError ); } diff --git a/stepmania/src/GraphDisplay.cpp b/stepmania/src/GraphDisplay.cpp index dc88e50881..26218a91f7 100644 --- a/stepmania/src/GraphDisplay.cpp +++ b/stepmania/src/GraphDisplay.cpp @@ -151,7 +151,7 @@ GraphDisplay::~GraphDisplay() SAFE_DELETE( m_pGraphBody ); } -void GraphDisplay::LoadFromNode( const CString& sDir, const XNode* pNode ) +void GraphDisplay::LoadFromNode( const RString& sDir, const XNode* pNode ) { ActorFrame::LoadFromNode( sDir, pNode ); diff --git a/stepmania/src/GraphDisplay.h b/stepmania/src/GraphDisplay.h index 697d976fe8..9f03789162 100644 --- a/stepmania/src/GraphDisplay.h +++ b/stepmania/src/GraphDisplay.h @@ -14,7 +14,7 @@ public: GraphDisplay(); ~GraphDisplay(); virtual Actor *Copy() const; - virtual void LoadFromNode( const CString& sDir, const XNode* pNode ); + virtual void LoadFromNode( const RString& sDir, const XNode* pNode ); void LoadFromStageStats( const StageStats &ss, const PlayerStageStats &s ); diff --git a/stepmania/src/GroupList.cpp b/stepmania/src/GroupList.cpp index 64861353da..74754d88e3 100644 --- a/stepmania/src/GroupList.cpp +++ b/stepmania/src/GroupList.cpp @@ -44,7 +44,7 @@ bool GroupList::ItemIsOnScreen( int n ) const return offset >= 0 && offset < MAX_GROUPS_ONSCREEN; } -void GroupList::Load( const vector& asGroupNames ) +void GroupList::Load( const vector& asGroupNames ) { m_asLabels = asGroupNames; diff --git a/stepmania/src/GroupList.h b/stepmania/src/GroupList.h index a44f2c71d6..e65f4227b7 100644 --- a/stepmania/src/GroupList.h +++ b/stepmania/src/GroupList.h @@ -11,7 +11,7 @@ class GroupList: public ActorFrame vector m_sprButtons; vector m_textLabels; vector m_ButtonFrames; - vector m_asLabels; + vector m_asLabels; vector m_bHidden; @@ -31,10 +31,10 @@ public: void SetSelection(unsigned sel); int GetSelection() const { return m_iSelection; } - CString GetSelectionName() const { return m_asLabels[m_iSelection]; } + RString GetSelectionName() const { return m_asLabels[m_iSelection]; } void Up(); void Down(); - void Load( const vector& asGroupNames ); + void Load( const vector& asGroupNames ); void TweenOffScreen(); void TweenOnScreen(); }; diff --git a/stepmania/src/HelpDisplay.cpp b/stepmania/src/HelpDisplay.cpp index e40f64bc19..f4133a3343 100644 --- a/stepmania/src/HelpDisplay.cpp +++ b/stepmania/src/HelpDisplay.cpp @@ -13,7 +13,7 @@ HelpDisplay::HelpDisplay() m_fSecsUntilSwitch = 0; } -void HelpDisplay::Load( const CString &sType ) +void HelpDisplay::Load( const RString &sType ) { TIP_SHOW_TIME.Load( sType, "TipShowTime" ); @@ -24,17 +24,17 @@ void HelpDisplay::Load( const CString &sType ) m_fSecsUntilSwitch = TIP_SHOW_TIME; } -void HelpDisplay::LoadFromNode( const CString& sDir, const XNode* pNode ) +void HelpDisplay::LoadFromNode( const RString& sDir, const XNode* pNode ) { BitmapText::LoadFromNode( sDir, pNode ); } -void HelpDisplay::SetName( const CString &sName ) +void HelpDisplay::SetName( const RString &sName ) { BitmapText::SetName( sName ); } -void HelpDisplay::SetTips( const vector &arrayTips, const vector &arrayTipsAlt ) +void HelpDisplay::SetTips( const vector &arrayTips, const vector &arrayTipsAlt ) { ASSERT( arrayTips.size() == arrayTipsAlt.size() ); @@ -84,14 +84,14 @@ public: { luaL_checktype( L, 1, LUA_TTABLE ); lua_pushvalue( L, 1 ); - vector arrayTips; + vector arrayTips; LuaHelpers::ReadArrayFromTable( arrayTips, L ); lua_pop( L, 1 ); for( unsigned i = 0; i < arrayTips.size(); ++i ) FontCharAliases::ReplaceMarkers( arrayTips[i] ); if( lua_gettop(L) > 1 && !lua_isnil( L, 2 ) ) { - vector arrayTipsAlt; + vector arrayTipsAlt; luaL_checktype( L, 2, LUA_TTABLE ); lua_pushvalue( L, 2 ); LuaHelpers::ReadArrayFromTable( arrayTipsAlt, L ); @@ -109,7 +109,7 @@ public: static int gettips( T* p, lua_State *L ) { - vector arrayTips, arrayTipsAlt; + vector arrayTips, arrayTipsAlt; p->GetTips( arrayTips, arrayTipsAlt ); LuaHelpers::CreateTableFromArray( arrayTips, L ); @@ -148,11 +148,11 @@ GenreDisplay::~GenreDisplay() { } -void GenreDisplay::PlayCommand( const CString &sCommandName, Actor* pParent ) +void GenreDisplay::PlayCommand( const RString &sCommandName, Actor* pParent ) { if( sCommandName == MessageToString(Message_CurrentSongChanged) ) { - vector m_Artists, m_AltArtists; + vector m_Artists, m_AltArtists; Song* pSong = GAMESTATE->m_pCurSong; ASSERT( pSong ); @@ -164,7 +164,7 @@ void GenreDisplay::PlayCommand( const CString &sCommandName, Actor* pParent ) } else if( sCommandName == MessageToString(Message_CurrentCourseChanged) ) { - vector m_Artists, m_AltArtists; + vector m_Artists, m_AltArtists; Course* pCourse = GAMESTATE->m_pCurCourse; StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType; diff --git a/stepmania/src/HelpDisplay.h b/stepmania/src/HelpDisplay.h index 8264b635f8..e1a32708d2 100644 --- a/stepmania/src/HelpDisplay.h +++ b/stepmania/src/HelpDisplay.h @@ -13,17 +13,17 @@ class HelpDisplay : public BitmapText { public: HelpDisplay(); - void Load( const CString &sType ); + void Load( const RString &sType ); - void LoadFromNode( const CString& sDir, const XNode* pNode ); + void LoadFromNode( const RString& sDir, const XNode* pNode ); virtual Actor *Copy() const; - void SetTips( const vector &arrayTips ) { SetTips( arrayTips, arrayTips ); } - void SetTips( const vector &arrayTips, const vector &arrayTipsAlt ); - void GetTips( vector &arrayTipsOut, vector &arrayTipsAltOut ) const { arrayTipsOut = m_arrayTips; arrayTipsAltOut = m_arrayTipsAlt; } + void SetTips( const vector &arrayTips ) { SetTips( arrayTips, arrayTips ); } + void SetTips( const vector &arrayTips, const vector &arrayTipsAlt ); + void GetTips( vector &arrayTipsOut, vector &arrayTipsAltOut ) const { arrayTipsOut = m_arrayTips; arrayTipsAltOut = m_arrayTipsAlt; } virtual void Update( float fDeltaTime ); - virtual void SetName( const CString &sName ); + virtual void SetName( const RString &sName ); // Lua virtual void PushSelf( lua_State *L ); @@ -31,7 +31,7 @@ public: protected: ThemeMetric TIP_SHOW_TIME; - vector m_arrayTips, m_arrayTipsAlt; + vector m_arrayTips, m_arrayTipsAlt; int m_iCurTipIndex; float m_fSecsUntilSwitch; @@ -42,7 +42,7 @@ class GenreDisplay : public HelpDisplay public: GenreDisplay(); ~GenreDisplay(); - void PlayCommand( const CString &sCommandName, Actor* pParent ); + void PlayCommand( const RString &sCommandName, Actor* pParent ); virtual Actor *Copy() const; }; diff --git a/stepmania/src/HighScore.cpp b/stepmania/src/HighScore.cpp index c09a0fc048..d3abf4bcde 100644 --- a/stepmania/src/HighScore.cpp +++ b/stepmania/src/HighScore.cpp @@ -11,15 +11,15 @@ struct HighScoreImpl { - CString sName; // name that shows in the machine's ranking screen + RString sName; // name that shows in the machine's ranking screen Grade grade; int iScore; float fPercentDP; float fSurviveSeconds; - CString sModifiers; + RString sModifiers; DateTime dateTime; // return value of time() when screenshot was taken - CString sPlayerGuid; // who made this high score - CString sMachineGuid; // where this high score was made + RString sPlayerGuid; // who made this high score + RString sMachineGuid; // where this high score was made int iProductID; int iTapNoteScores[NUM_TapNoteScore]; int iHoldNoteScores[NUM_HoldNoteScore]; @@ -82,7 +82,7 @@ XNode *HighScoreImpl::CreateNode() const pNode->m_sName = "HighScore"; // TRICKY: Don't write "name to fill in" markers. - pNode->AppendChild( "Name", IsRankingToFillIn(sName) ? CString("") : sName ); + pNode->AppendChild( "Name", IsRankingToFillIn(sName) ? RString("") : sName ); pNode->AppendChild( "Grade", GradeToString(grade) ); pNode->AppendChild( "Score", iScore ); pNode->AppendChild( "PercentDP", fPercentDP ); @@ -110,7 +110,7 @@ void HighScoreImpl::LoadFromNode( const XNode *pNode ) { ASSERT( pNode->m_sName == "HighScore" ); - CString s; + RString s; pNode->GetChildValue( "Name", sName ); pNode->GetChildValue( "Grade", s ); @@ -152,31 +152,31 @@ void HighScore::Unset() m_Impl = new HighScoreImpl; } -CString HighScore::GetName() const { return m_Impl->sName; } +RString HighScore::GetName() const { return m_Impl->sName; } Grade HighScore::GetGrade() const { return m_Impl->grade; } int HighScore::GetScore() const { return m_Impl->iScore; } float HighScore::GetPercentDP() const { return m_Impl->fPercentDP; } float HighScore::GetSurviveSeconds() const { return m_Impl->fSurviveSeconds; } float HighScore::GetSurvivalSeconds() const { return GetSurviveSeconds() + GetLifeRemainingSeconds(); } -CString HighScore::GetModifiers() const { return m_Impl->sModifiers; } +RString HighScore::GetModifiers() const { return m_Impl->sModifiers; } DateTime HighScore::GetDateTime() const { return m_Impl->dateTime; } -CString HighScore::GetPlayerGuid() const { return m_Impl->sPlayerGuid; } -CString HighScore::GetMachineGuid() const { return m_Impl->sMachineGuid; } +RString HighScore::GetPlayerGuid() const { return m_Impl->sPlayerGuid; } +RString HighScore::GetMachineGuid() const { return m_Impl->sMachineGuid; } int HighScore::GetProductID() const { return m_Impl->iProductID; } int HighScore::GetTapNoteScore( TapNoteScore tns ) const { return m_Impl->iTapNoteScores[tns]; } int HighScore::GetHoldNoteScore( HoldNoteScore hns ) const { return m_Impl->iHoldNoteScores[hns]; } const RadarValues &HighScore::GetRadarValues() const { return m_Impl->radarValues; } float HighScore::GetLifeRemainingSeconds() const { return m_Impl->fLifeRemainingSeconds; } -void HighScore::SetName( const CString &sName ) { m_Impl->sName = sName; } +void HighScore::SetName( const RString &sName ) { m_Impl->sName = sName; } void HighScore::SetGrade( Grade g ) { m_Impl->grade = g; } void HighScore::SetScore( int iScore ) { m_Impl->iScore = iScore; } void HighScore::SetPercentDP( float f ) { m_Impl->fPercentDP = f; } void HighScore::SetSurviveSeconds( float f ) { m_Impl->fSurviveSeconds = f; } -void HighScore::SetModifiers( CString s ) { m_Impl->sModifiers = s; } +void HighScore::SetModifiers( RString s ) { m_Impl->sModifiers = s; } void HighScore::SetDateTime( DateTime d ) { m_Impl->dateTime = d; } -void HighScore::SetPlayerGuid( CString s ) { m_Impl->sPlayerGuid = s; } -void HighScore::SetMachineGuid( CString s ) { m_Impl->sMachineGuid = s; } +void HighScore::SetPlayerGuid( RString s ) { m_Impl->sPlayerGuid = s; } +void HighScore::SetMachineGuid( RString s ) { m_Impl->sMachineGuid = s; } void HighScore::SetProductID( int i ) { m_Impl->iProductID = i; } void HighScore::SetTapNoteScore( TapNoteScore tns, int i ) { m_Impl->iTapNoteScores[tns] = i; } void HighScore::SetHoldNoteScore( HoldNoteScore hns, int i ) { m_Impl->iHoldNoteScores[hns] = i; } @@ -186,7 +186,7 @@ void HighScore::SetLifeRemainingSeconds( float f ) { m_Impl->fLifeRemainingSecon /* We normally don't give direct access to the members. We need this one * for NameToFillIn; use a special accessor so it's easy to find where this * is used. */ -CString *HighScore::GetNameMutable() { return &m_Impl->sName; } +RString *HighScore::GetNameMutable() { return &m_Impl->sName; } bool HighScore::operator>=( const HighScore& other ) const { @@ -221,7 +221,7 @@ void HighScore::LoadFromNode( const XNode* pNode ) m_Impl->LoadFromNode( pNode ); } -CString HighScore::GetDisplayName() const +RString HighScore::GetDisplayName() const { if( GetName().empty() ) return EMPTY_NAME; diff --git a/stepmania/src/HighScore.h b/stepmania/src/HighScore.h index 2d016fad55..0cecc2e43c 100644 --- a/stepmania/src/HighScore.h +++ b/stepmania/src/HighScore.h @@ -16,39 +16,39 @@ struct HighScore { HighScore(); - CString GetName() const; + RString GetName() const; Grade GetGrade() const; int GetScore() const; float GetPercentDP() const; float GetSurviveSeconds() const; float GetSurvivalSeconds() const; - CString GetModifiers() const; + RString GetModifiers() const; DateTime GetDateTime() const; - CString GetPlayerGuid() const; - CString GetMachineGuid() const; + RString GetPlayerGuid() const; + RString GetMachineGuid() const; int GetProductID() const; int GetTapNoteScore( TapNoteScore tns ) const; int GetHoldNoteScore( HoldNoteScore tns ) const; const RadarValues &GetRadarValues() const; float GetLifeRemainingSeconds() const; - void SetName( const CString &sName ); + void SetName( const RString &sName ); void SetGrade( Grade g ); void SetScore( int iScore ); void SetPercentDP( float f ); void SetSurviveSeconds( float f ); - void SetModifiers( CString s ); + void SetModifiers( RString s ); void SetDateTime( DateTime d ); - void SetPlayerGuid( CString s ); - void SetMachineGuid( CString s ); + void SetPlayerGuid( RString s ); + void SetMachineGuid( RString s ); void SetProductID( int i ); void SetTapNoteScore( TapNoteScore tns, int i ); void SetHoldNoteScore( HoldNoteScore tns, int i ); void SetRadarValues( const RadarValues &rv ); void SetLifeRemainingSeconds( float f ); - CString *GetNameMutable(); - const CString *GetNameMutable() const { return const_cast (const_cast(this)->GetNameMutable()); } + RString *GetNameMutable(); + const RString *GetNameMutable() const { return const_cast (const_cast(this)->GetNameMutable()); } void Unset(); @@ -58,7 +58,7 @@ struct HighScore XNode* CreateNode() const; void LoadFromNode( const XNode* pNode ); - CString GetDisplayName() const; + RString GetDisplayName() const; private: HiddenPtr m_Impl; }; @@ -100,8 +100,8 @@ private: struct Screenshot { - CString sFileName; // no directory part - just the file name - CString sMD5; // MD5 hash of the screenshot file + RString sFileName; // no directory part - just the file name + RString sMD5; // MD5 hash of the screenshot file HighScore highScore; XNode* CreateNode() const; diff --git a/stepmania/src/InputFilter.cpp b/stepmania/src/InputFilter.cpp index cda24b465a..eadbb126d8 100644 --- a/stepmania/src/InputFilter.cpp +++ b/stepmania/src/InputFilter.cpp @@ -13,7 +13,7 @@ struct ButtonState ButtonState(); bool m_BeingHeld; // actual current state bool m_bLastReportedHeld; // last state reported by Update() - CString m_sComment; + RString m_sComment; float m_fSecsHeld; float m_Level, m_LastLevel; @@ -136,7 +136,7 @@ void InputFilter::ButtonPressed( const DeviceInput &di, bool Down ) } } -void InputFilter::SetButtonComment( const DeviceInput &di, const CString &sComment ) +void InputFilter::SetButtonComment( const DeviceInput &di, const RString &sComment ) { LockMut(*queuemutex); ButtonState &bs = GetButtonState( di.device, di.button ); @@ -277,7 +277,7 @@ float InputFilter::GetSecsHeld( const DeviceInput &di ) return GetButtonState(di.device, di.button).m_fSecsHeld; } -CString InputFilter::GetButtonComment( const DeviceInput &di ) const +RString InputFilter::GetButtonComment( const DeviceInput &di ) const { LockMut(*queuemutex); return GetButtonState(di.device, di.button).m_sComment; diff --git a/stepmania/src/InputFilter.h b/stepmania/src/InputFilter.h index f5f2543462..ccfe469a0c 100644 --- a/stepmania/src/InputFilter.h +++ b/stepmania/src/InputFilter.h @@ -43,7 +43,7 @@ class InputFilter { public: void ButtonPressed( const DeviceInput &di, bool Down ); - void SetButtonComment( const DeviceInput &di, const CString &sComment = "" ); + void SetButtonComment( const DeviceInput &di, const RString &sComment = "" ); void ResetDevice( InputDevice dev ); InputFilter(); @@ -57,7 +57,7 @@ public: bool IsBeingPressed( const DeviceInput &di ); float GetSecsHeld( const DeviceInput &di ); - CString GetButtonComment( const DeviceInput &di ) const; + RString GetButtonComment( const DeviceInput &di ) const; void GetInputEvents( InputEventArray &array ); void GetPressedButtons( vector &array ); diff --git a/stepmania/src/InputMapper.cpp b/stepmania/src/InputMapper.cpp index f5009823c9..c2d3cea01e 100644 --- a/stepmania/src/InputMapper.cpp +++ b/stepmania/src/InputMapper.cpp @@ -13,7 +13,7 @@ #include "SpecialFiles.h" #include "LocalizedString.h" -static Preference g_sLastSeenInputDevices( "LastSeenInputDevices", "" ); +static Preference g_sLastSeenInputDevices( "LastSeenInputDevices", "" ); static Preference g_bAutoMapOnJoyChange( "AutoMapOnJoyChange", true ); namespace @@ -408,7 +408,7 @@ void InputMapper::ApplyMapping( const Mapping *maps, GameController gc, InputDev void InputMapper::AutoMapJoysticksForCurrentGame() { vector vDevices; - vector vDescriptions; + vector vDescriptions; INPUTMAN->GetDevicesAndDescriptions(vDevices,vDescriptions); int iNumJoysticksMapped = 0; @@ -418,7 +418,7 @@ void InputMapper::AutoMapJoysticksForCurrentGame() for( unsigned i=0; iStringToGameType(mapping.szGame) ) continue; // games don't match - CString sDriverRegex = mapping.szDriverRegex; + RString sDriverRegex = mapping.szDriverRegex; Regex regex( sDriverRegex ); if( !regex.Compare(sDescription) ) continue; // driver names don't match @@ -448,7 +448,7 @@ void InputMapper::AutoMapJoysticksForCurrentGame() } } -static const CString DEVICE_INPUT_SEPARATOR = ":"; // this isn't used in any key names +static const RString DEVICE_INPUT_SEPARATOR = ":"; // this isn't used in any key names void InputMapper::ReadMappingsFromDisk() { @@ -469,13 +469,13 @@ void InputMapper::ReadMappingsFromDisk() { FOREACH_CONST_Attr( Key, i ) { - const CString &name = i->first; - const CString &value = i->second; + const RString &name = i->first; + const RString &value = i->second; GameInput GameI; GameI.fromString( pGame, name ); - vector sDeviceInputStrings; + vector sDeviceInputStrings; split( value, DEVICE_INPUT_SEPARATOR, sDeviceInputStrings, false ); for( unsigned i=0; im_iButtonsPerController; j++ ) { GameInput GameI( i, (GameButton)j ); - CString sNameString = GameI.toString( pGame ); + RString sNameString = GameI.toString( pGame ); - vector asValues; + vector asValues; for( int slot = 0; slot < NUM_GAME_TO_DEVICE_SLOTS; ++slot ) asValues.push_back( m_GItoDI[i][j][slot].ToString() ); while( asValues.size() && asValues.back() == "" ) asValues.erase( asValues.begin()+asValues.size()-1 ); - CString sValueString = join( DEVICE_INPUT_SEPARATOR, asValues ); + RString sValueString = join( DEVICE_INPUT_SEPARATOR, asValues ); ini.SetValue( pGame->m_szName, sNameString, sValueString ); } @@ -528,26 +528,26 @@ void InputMapper::SaveMappingsToDisk() static LocalizedString CONNECTED ( "InputMapper", "Connected" ); static LocalizedString DISCONNECTED ( "InputMapper", "Disconnected" ); static LocalizedString REMAPPING_ALL_JOYSTICKS ( "InputMapper", "Remapping all joysticks." ); -bool InputMapper::CheckForChangedInputDevicesAndRemap( CString &sMessage ) +bool InputMapper::CheckForChangedInputDevicesAndRemap( RString &sMessage ) { // // update last seen joysticks // vector vDevices; - vector vsDescriptions; + vector vsDescriptions; INPUTMAN->GetDevicesAndDescriptions( vDevices, vsDescriptions ); - CString sInputDevices = join( ",", vsDescriptions ); + RString sInputDevices = join( ",", vsDescriptions ); if( g_sLastSeenInputDevices.Get() == sInputDevices ) return false; - vector vsLastSeen; + vector vsLastSeen; split( g_sLastSeenInputDevices, ",", vsLastSeen ); - vector vsConnects, vsDisconnects; + vector vsConnects, vsDisconnects; GetConnectsDisconnects( vsLastSeen, vsDescriptions, vsDisconnects, vsConnects ); - sMessage = CString(); + sMessage = RString(); if( !vsConnects.empty() ) sMessage += CONNECTED.GetValue()+": " + join( "\n", vsConnects ) + "\n"; if( !vsDisconnects.empty() ) diff --git a/stepmania/src/InputMapper.h b/stepmania/src/InputMapper.h index a0f0bbe741..9495b16e02 100644 --- a/stepmania/src/InputMapper.h +++ b/stepmania/src/InputMapper.h @@ -28,7 +28,7 @@ public: void AddDefaultMappingsForCurrentGameIfUnmapped(); void AutoMapJoysticksForCurrentGame(); - bool CheckForChangedInputDevicesAndRemap( CString &sMessageOut ); + bool CheckForChangedInputDevicesAndRemap( RString &sMessageOut ); bool IsMapped( const DeviceInput &DeviceI ); bool IsMapped( const GameInput &GameI ); diff --git a/stepmania/src/Inventory.cpp b/stepmania/src/Inventory.cpp index 2f7e7835f9..eec054294a 100644 --- a/stepmania/src/Inventory.cpp +++ b/stepmania/src/Inventory.cpp @@ -25,7 +25,7 @@ struct Item { AttackLevel level; int iCombo; - CString sModifier; + RString sModifier; }; static vector g_Items; diff --git a/stepmania/src/LifeMeterBar.cpp b/stepmania/src/LifeMeterBar.cpp index 5110ff7c5e..ec44dfd196 100644 --- a/stepmania/src/LifeMeterBar.cpp +++ b/stepmania/src/LifeMeterBar.cpp @@ -16,7 +16,7 @@ #include "Steps.h" -static void LifePercentChangeInit( size_t /*ScoreEvent*/ i, CString &sNameOut, float &defaultValueOut ) +static void LifePercentChangeInit( size_t /*ScoreEvent*/ i, RString &sNameOut, float &defaultValueOut ) { sNameOut = "LifePercentChange" + ScoreEventToString( (ScoreEvent)i ); switch( i ) @@ -61,7 +61,7 @@ LifeMeterBar::LifeMeterBar() default: ASSERT(0); } - const CString sType = "LifeMeterBar"; + const RString sType = "LifeMeterBar"; m_fPassingAlpha = 0; m_fHotAlpha = 0; @@ -93,7 +93,7 @@ LifeMeterBar::LifeMeterBar() m_pStream = new StreamDisplay; bool bExtra = GAMESTATE->IsExtraStage()||GAMESTATE->IsExtraStage2(); - CString sExtra = bExtra ? "extra " : ""; + RString sExtra = bExtra ? "extra " : ""; m_pStream->Load( METER_WIDTH, METER_HEIGHT, diff --git a/stepmania/src/LifeMeterTime.cpp b/stepmania/src/LifeMeterTime.cpp index 1532918252..5af711a9ca 100644 --- a/stepmania/src/LifeMeterTime.cpp +++ b/stepmania/src/LifeMeterTime.cpp @@ -28,7 +28,7 @@ void LifeMeterTime::Load( const PlayerState *pPlayerState, PlayerStageStats *pPl { LifeMeter::Load( pPlayerState, pPlayerStageStats ); - const CString sType = "LifeMeterTime"; + const RString sType = "LifeMeterTime"; m_sprBackground.Load( THEME->GetPathG(sType,"background") ); m_sprBackground->SetName( "Background" ); @@ -46,7 +46,7 @@ void LifeMeterTime::Load( const PlayerState *pPlayerState, PlayerStageStats *pPl m_pStream = new StreamDisplay; bool bExtra = GAMESTATE->IsExtraStage()||GAMESTATE->IsExtraStage2(); - CString sExtra = bExtra ? "extra " : ""; + RString sExtra = bExtra ? "extra " : ""; m_pStream->Load( METER_WIDTH, METER_HEIGHT, diff --git a/stepmania/src/LightsManager.cpp b/stepmania/src/LightsManager.cpp index ed7b940a34..fae6ba696a 100644 --- a/stepmania/src/LightsManager.cpp +++ b/stepmania/src/LightsManager.cpp @@ -17,8 +17,8 @@ #include "arch/arch.h" -const CString DEFAULT_LIGHTS_DRIVER = "Null"; -static Preference g_sLightsDriver( "LightsDriver", "" ); // "" == DEFAULT_LIGHTS_DRIVER +const RString DEFAULT_LIGHTS_DRIVER = "Null"; +static Preference g_sLightsDriver( "LightsDriver", "" ); // "" == DEFAULT_LIGHTS_DRIVER Preference g_fLightsFalloffSeconds( "LightsFalloffSeconds", 0.1f ); Preference g_fLightsAheadSeconds( "LightsAheadSeconds", 0.05f ); @@ -88,7 +88,7 @@ LightsManager::LightsManager() ZERO( m_fSecsLeftInActorLightBlink ); m_LightsMode = LIGHTSMODE_JOINING; - CString sDriver = g_sLightsDriver.Get(); + RString sDriver = g_sLightsDriver.Get(); if( sDriver.empty() ) sDriver = DEFAULT_LIGHTS_DRIVER; MakeLightsDrivers( sDriver, m_vpDrivers ); diff --git a/stepmania/src/LightsManager.h b/stepmania/src/LightsManager.h index 7282328663..50227206a6 100644 --- a/stepmania/src/LightsManager.h +++ b/stepmania/src/LightsManager.h @@ -25,8 +25,8 @@ enum CabinetLight LIGHT_INVALID }; #define FOREACH_CabinetLight( i ) FOREACH_ENUM( CabinetLight, NUM_CABINET_LIGHTS, i ) -const CString& CabinetLightToString( CabinetLight cl ); -CabinetLight StringToCabinetLight( const CString& s); +const RString& CabinetLightToString( CabinetLight cl ); +CabinetLight StringToCabinetLight( const RString& s); enum LightsMode { @@ -41,7 +41,7 @@ enum LightsMode LIGHTSMODE_TEST_MANUAL_CYCLE, NUM_LIGHTS_MODES }; -const CString& LightsModeToString( LightsMode lm ); +const RString& LightsModeToString( LightsMode lm ); struct LightsState { diff --git a/stepmania/src/LocalizedString.cpp b/stepmania/src/LocalizedString.cpp index c64c4c84bc..bca6844c3a 100644 --- a/stepmania/src/LocalizedString.cpp +++ b/stepmania/src/LocalizedString.cpp @@ -19,7 +19,7 @@ public: const RString &GetLocalized() const { return m_sValue; } private: - CString m_sValue; + RString m_sValue; }; static LocalizedString::MakeLocalizer g_pMakeLocalizedStringImpl = LocalizedStringImplDefault::Create; diff --git a/stepmania/src/LuaBinding.cpp b/stepmania/src/LuaBinding.cpp index c406034358..a7be560567 100644 --- a/stepmania/src/LuaBinding.cpp +++ b/stepmania/src/LuaBinding.cpp @@ -8,7 +8,7 @@ // types (eg. "Actor.x(GAMESTATE, 10)"), which will crash or cause corruption. // #define FAST_LUA -void LuaBinding::CreateMethodsTable( lua_State *L, const CString &sName ) +void LuaBinding::CreateMethodsTable( lua_State *L, const RString &sName ) { lua_pushlstring( L, sName.data(), sName.size() ); lua_rawget( L, LUA_GLOBALSINDEX ); @@ -99,7 +99,7 @@ static bool GetGlobalTable( Lua *L, bool bCreate ) /* The object is on the stack. It's either a table or a userdata. * If needed, associate the metatable; if a table, also add it to * the userdata table. */ -void LuaBinding::ApplyDerivedType( Lua *L, const CString &sClassName, void *pSelf ) +void LuaBinding::ApplyDerivedType( Lua *L, const RString &sClassName, void *pSelf ) { int iTable = lua_gettop( L ); @@ -261,7 +261,7 @@ void LuaClass::Register() LUA->Release( L ); /* To conserve memory, clear the class name. We only need it while restoring. */ - m_sClassName = CString(); + m_sClassName = RString(); m_pSelf = NULL; } } diff --git a/stepmania/src/LuaBinding.h b/stepmania/src/LuaBinding.h index dd1eb9c332..385671d836 100644 --- a/stepmania/src/LuaBinding.h +++ b/stepmania/src/LuaBinding.h @@ -8,10 +8,10 @@ class LuaReference; namespace LuaBinding { - void CreateMethodsTable( lua_State *L, const CString &szName ); + void CreateMethodsTable( lua_State *L, const RString &szName ); bool CheckLuaObjectType( lua_State *L, int narg, const char *szType, bool bOptional=false ); void *GetUserdataFromGlobalTable( Lua *L, const char *szType, int iArg ); - void ApplyDerivedType( Lua *L, const CString &sClassname, void *pSelf ); + void ApplyDerivedType( Lua *L, const RString &sClassname, void *pSelf ); }; template @@ -222,7 +222,7 @@ protected: void *m_pSelf; - CString m_sClassName; + RString m_sClassName; }; /* Only a base class has to indicate that it's instanced (has a per-object diff --git a/stepmania/src/LuaExpressionTransform.cpp b/stepmania/src/LuaExpressionTransform.cpp index b51034c475..5906891450 100644 --- a/stepmania/src/LuaExpressionTransform.cpp +++ b/stepmania/src/LuaExpressionTransform.cpp @@ -10,7 +10,7 @@ LuaExpressionTransform::LuaExpressionTransform() m_iNumSubdivisions = 1; } -void LuaExpressionTransform::SetFromExpression( const CString &sExpression ) +void LuaExpressionTransform::SetFromExpression( const RString &sExpression ) { m_pexprTransformFunction->SetFromExpression( sExpression ); } diff --git a/stepmania/src/LuaExpressionTransform.h b/stepmania/src/LuaExpressionTransform.h index 51b57031c8..6370ea7af7 100644 --- a/stepmania/src/LuaExpressionTransform.h +++ b/stepmania/src/LuaExpressionTransform.h @@ -12,7 +12,7 @@ class LuaExpressionTransform public: LuaExpressionTransform(); - void SetFromExpression( const CString &sExpression ); + void SetFromExpression( const RString &sExpression ); void SetNumSubdivisions( int iNumSubdivisions ) { ASSERT( iNumSubdivisions > 0 ); m_iNumSubdivisions = iNumSubdivisions; } void PositionItem( Actor *pActor, float fPositionOffsetFromCenter, int iItemIndex, int iNumItems ); diff --git a/stepmania/src/LuaFunctions.h b/stepmania/src/LuaFunctions.h index 5b070c312b..850c040b1a 100644 --- a/stepmania/src/LuaFunctions.h +++ b/stepmania/src/LuaFunctions.h @@ -6,8 +6,8 @@ /* Linked list of functions we make available to Lua. */ struct LuaFunctionList { - LuaFunctionList( CString name, lua_CFunction func ); - CString name; + LuaFunctionList( RString name, lua_CFunction func ); + RString name; lua_CFunction func; LuaFunctionList *next; }; diff --git a/stepmania/src/LuaManager.cpp b/stepmania/src/LuaManager.cpp index 061b84301c..e2e233b4c1 100644 --- a/stepmania/src/LuaManager.cpp +++ b/stepmania/src/LuaManager.cpp @@ -35,7 +35,7 @@ static LuaFunctionList *g_LuaFunctions = NULL; struct ChunkReaderData { - const CString *buf; + const RString *buf; bool done; ChunkReaderData() { buf = NULL; done = false; } }; @@ -54,7 +54,7 @@ const char *ChunkReaderString( lua_State *L, void *ptr, size_t *size ) return ret; } -void LuaManager::SetGlobal( const CString &sName, int val ) +void LuaManager::SetGlobal( const RString &sName, int val ) { Lua *L = LUA->Get(); LuaHelpers::PushStack( val, L ); @@ -62,7 +62,7 @@ void LuaManager::SetGlobal( const CString &sName, int val ) LUA->Release(L); } -void LuaManager::SetGlobal( const CString &sName, float val ) +void LuaManager::SetGlobal( const RString &sName, float val ) { Lua *L = LUA->Get(); LuaHelpers::PushStack( val, L ); @@ -70,7 +70,7 @@ void LuaManager::SetGlobal( const CString &sName, float val ) LUA->Release(L); } -void LuaManager::SetGlobal( const CString &sName, bool val ) +void LuaManager::SetGlobal( const RString &sName, bool val ) { Lua *L = LUA->Get(); LuaHelpers::PushStack( val, L ); @@ -78,7 +78,7 @@ void LuaManager::SetGlobal( const CString &sName, bool val ) LUA->Release(L); } -void LuaManager::SetGlobal( const CString &sName, const CString &val ) +void LuaManager::SetGlobal( const RString &sName, const RString &val ) { Lua *L = LUA->Get(); LuaHelpers::PushStack( val, L ); @@ -86,7 +86,7 @@ void LuaManager::SetGlobal( const CString &sName, const CString &val ) LUA->Release(L); } -void LuaManager::SetGlobalFromExpression( const CString &sName, const CString &expr ) +void LuaManager::SetGlobalFromExpression( const RString &sName, const RString &expr ) { Lua *L = LUA->Get(); if( !LuaHelpers::RunScript(L, "return " + expr, "", 1) ) @@ -100,7 +100,7 @@ void LuaManager::SetGlobalFromExpression( const CString &sName, const CString &e LUA->Release(L); } -void LuaManager::UnsetGlobal( const CString &sName ) +void LuaManager::UnsetGlobal( const RString &sName ) { Lua *L = LUA->Get(); lua_pushnil( L ); @@ -112,12 +112,12 @@ void LuaManager::UnsetGlobal( const CString &sName ) void LuaHelpers::Push( const bool &Object, lua_State *L ) { lua_pushboolean( L, Object ); } void LuaHelpers::Push( const float &Object, lua_State *L ) { lua_pushnumber( L, Object ); } void LuaHelpers::Push( const int &Object, lua_State *L ) { lua_pushnumber( L, Object ); } -void LuaHelpers::Push( const CString &Object, lua_State *L ) { lua_pushlstring( L, Object.data(), Object.size() ); } +void LuaHelpers::Push( const RString &Object, lua_State *L ) { lua_pushlstring( L, Object.data(), Object.size() ); } bool LuaHelpers::FromStack( bool &Object, int iOffset, lua_State *L ) { Object = !!lua_toboolean( L, iOffset ); return true; } bool LuaHelpers::FromStack( float &Object, int iOffset, lua_State *L ) { Object = (float)lua_tonumber( L, iOffset ); return true; } bool LuaHelpers::FromStack( int &Object, int iOffset, lua_State *L ) { Object = (int) lua_tonumber( L, iOffset ); return true; } -bool LuaHelpers::FromStack( CString &Object, int iOffset, lua_State *L ) +bool LuaHelpers::FromStack( RString &Object, int iOffset, lua_State *L ) { const char *pStr = lua_tostring( L, iOffset ); if( pStr != NULL ) @@ -152,7 +152,7 @@ void LuaHelpers::ReadArrayFromTableB( Lua *L, vector &aOut ) static int LuaPanic( lua_State *L ) { - CString sErr; + RString sErr; LuaHelpers::PopStack( sErr, L ); RageException::Throw( "%s", sErr.c_str() ); @@ -264,7 +264,7 @@ void LuaManager::ResetState() m_pLock->Unlock(); } -void LuaHelpers::PrepareExpression( CString &sInOut ) +void LuaHelpers::PrepareExpression( RString &sInOut ) { // HACK: Many metrics have "// foo" and "# foo" comments that Lua fails to parse. // Replace them with Lua-style comments. @@ -277,27 +277,27 @@ void LuaHelpers::PrepareExpression( CString &sInOut ) sInOut.erase( 0, 1 ); } -bool LuaHelpers::RunScriptFile( const CString &sFile ) +bool LuaHelpers::RunScriptFile( const RString &sFile ) { RageFile f; if( !f.Open( sFile ) ) { - CString sError = ssprintf( "Couldn't open Lua script \"%s\": %s", sFile.c_str(), f.GetError().c_str() ); + RString sError = ssprintf( "Couldn't open Lua script \"%s\": %s", sFile.c_str(), f.GetError().c_str() ); Dialog::OK( sError, "LUA_ERROR" ); return false; } - CString sScript; + RString sScript; if( f.Read( sScript ) == -1 ) { - CString sError = ssprintf( "Error reading Lua script \"%s\": %s", sFile.c_str(), f.GetError().c_str() ); + RString sError = ssprintf( "Error reading Lua script \"%s\": %s", sFile.c_str(), f.GetError().c_str() ); Dialog::OK( sError, "LUA_ERROR" ); return false; } Lua *L = LUA->Get(); - CString sError; + RString sError; if( !LuaHelpers::RunScript( L, sScript, sFile, sError, 0 ) ) { LUA->Release(L); @@ -310,7 +310,7 @@ bool LuaHelpers::RunScriptFile( const CString &sFile ) return true; } -bool LuaHelpers::RunScript( Lua *L, const CString &sScript, const CString &sName, CString &sError, int iReturnValues ) +bool LuaHelpers::RunScript( Lua *L, const RString &sScript, const RString &sName, RString &sError, int iReturnValues ) { // load string { @@ -339,10 +339,10 @@ bool LuaHelpers::RunScript( Lua *L, const CString &sScript, const CString &sName } -bool LuaHelpers::RunScript( Lua *L, const CString &sExpression, const CString &sName, int iReturnValues ) +bool LuaHelpers::RunScript( Lua *L, const RString &sExpression, const RString &sName, int iReturnValues ) { - CString sError; - if( !LuaHelpers::RunScript( L, sExpression, sName.size()? sName:CString("in"), sError, iReturnValues ) ) + RString sError; + if( !LuaHelpers::RunScript( L, sExpression, sName.size()? sName:RString("in"), sError, iReturnValues ) ) { sError = ssprintf( "Lua runtime error parsing \"%s\": %s", sName.size()? sName.c_str():sExpression.c_str(), sError.c_str() ); Dialog::OK( sError, "LUA_ERROR" ); @@ -352,7 +352,7 @@ bool LuaHelpers::RunScript( Lua *L, const CString &sExpression, const CString &s return true; } -bool LuaHelpers::RunExpressionB( const CString &str ) +bool LuaHelpers::RunExpressionB( const RString &str ) { Lua *L = LUA->Get(); @@ -373,7 +373,7 @@ bool LuaHelpers::RunExpressionB( const CString &str ) return result; } -float LuaHelpers::RunExpressionF( const CString &str ) +float LuaHelpers::RunExpressionF( const RString &str ) { Lua *L = LUA->Get(); if( !LuaHelpers::RunScript(L, "return " + str, "", 1) ) @@ -393,12 +393,12 @@ float LuaHelpers::RunExpressionF( const CString &str ) return result; } -int LuaHelpers::RunExpressionI( const CString &str ) +int LuaHelpers::RunExpressionI( const RString &str ) { return (int) LuaHelpers::RunExpressionF(str); } -bool LuaHelpers::RunExpressionS( const CString &str, CString &sOut ) +bool LuaHelpers::RunExpressionS( const RString &str, RString &sOut ) { Lua *L = LUA->Get(); if( !LuaHelpers::RunScript(L, "return " + str, "", 1) ) @@ -418,7 +418,7 @@ bool LuaHelpers::RunExpressionS( const CString &str, CString &sOut ) return true; } -bool LuaHelpers::RunAtExpressionS( CString &sStr ) +bool LuaHelpers::RunAtExpressionS( RString &sStr ) { if( sStr.size() == 0 || sStr[0] != '@' ) return false; @@ -426,7 +426,7 @@ bool LuaHelpers::RunAtExpressionS( CString &sStr ) /* Erase "@". */ sStr.erase( 0, 1 ); - CString sOut; + RString sOut; LuaHelpers::RunExpressionS( sStr, sOut ); sStr = sOut; return true; @@ -434,7 +434,7 @@ bool LuaHelpers::RunAtExpressionS( CString &sStr ) /* Like luaL_typerror, but without the special case for argument 1 being "self" * in method calls, so we give a correct error message after we remove self. */ -CString GetLuaBindingType( Lua *L, int iArgNo ) +RString GetLuaBindingType( Lua *L, int iArgNo ) { if( lua_isnil(L, iArgNo) ) return "nil"; @@ -449,7 +449,7 @@ CString GetLuaBindingType( Lua *L, int iArgNo ) int iMetatable = lua_gettop(L); lua_pushstring( L, "type" ); lua_rawget( L, iMetatable ); - CString sActualType = lua_tostring( L, -1 ); + RString sActualType = lua_tostring( L, -1 ); lua_settop( L, iTop ); return sActualType; @@ -459,7 +459,7 @@ CString GetLuaBindingType( Lua *L, int iArgNo ) * in method calls, so we give a correct error message after we remove self. */ int LuaHelpers::TypeError( Lua *L, int iArgNo, const char *szName ) { - CString sType = GetLuaBindingType( L, iArgNo ); + RString sType = GetLuaBindingType( L, iArgNo ); lua_Debug debug; if( !lua_getstack( L, 0, &debug ) ) @@ -476,7 +476,7 @@ int LuaHelpers::TypeError( Lua *L, int iArgNo, const char *szName ) } -LuaFunctionList::LuaFunctionList( CString name_, lua_CFunction func_ ) +LuaFunctionList::LuaFunctionList( RString name_, lua_CFunction func_ ) { name = name_; func = func_; @@ -485,7 +485,7 @@ LuaFunctionList::LuaFunctionList( CString name_, lua_CFunction func_ ) } -static bool Trace( const CString &sString ) +static bool Trace( const RString &sString ) { LOG->Trace( "%s", sString.c_str() ); return true; @@ -494,7 +494,7 @@ static bool Trace( const CString &sString ) LuaFunction( Trace, Trace(SArg(1)) ); #include "ProductInfo.h" -LuaFunction( ProductVersion, (CString) PRODUCT_VER ); +LuaFunction( ProductVersion, (RString) PRODUCT_VER ); static float scale( float x, float l1, float h1, float l2, float h2 ) { @@ -507,7 +507,7 @@ LuaFunction( clamp, clamp(FArg(1), FArg(2), FArg(3)) ); #include "RageTypes.h" int LuaFunc_color( lua_State *L ) { - CString sColor = SArg(1); + RString sColor = SArg(1); RageColor c; c.FromString( sColor ); diff --git a/stepmania/src/LuaManager.h b/stepmania/src/LuaManager.h index 2ac082df2c..ba832457f1 100644 --- a/stepmania/src/LuaManager.h +++ b/stepmania/src/LuaManager.h @@ -31,12 +31,12 @@ public: /* Reset the environment, freeing any globals left over by previously executed scripts. */ void ResetState(); - void SetGlobal( const CString &sName, int val ); - void SetGlobal( const CString &sName, float val ); - void SetGlobal( const CString &sName, bool val ); - void SetGlobal( const CString &sName, const CString &val ); - void SetGlobalFromExpression( const CString &sName, const CString &expr ); - void UnsetGlobal( const CString &sName ); + void SetGlobal( const RString &sName, int val ); + void SetGlobal( const RString &sName, float val ); + void SetGlobal( const RString &sName, bool val ); + void SetGlobal( const RString &sName, const RString &val ); + void SetGlobalFromExpression( const RString &sName, const RString &expr ); + void UnsetGlobal( const RString &sName ); private: lua_State *L; @@ -52,16 +52,16 @@ namespace LuaHelpers { /* Run a script with the given name. Return values are left on the Lua stack. * Returns false on error, with sError set. */ - bool RunScript( Lua *L, const CString &sScript, const CString &sName, CString &sError, int iReturnValues = 0 ); + bool RunScript( Lua *L, const RString &sScript, const RString &sName, RString &sError, int iReturnValues = 0 ); /* Convenience: run a script with one return value, displaying an error on failure. * The return value is left on the Lua stack. */ - bool RunScript( Lua *L, const CString &sExpression, const CString &sName = "", int iReturnValues = 0 ); + bool RunScript( Lua *L, const RString &sExpression, const RString &sName = "", int iReturnValues = 0 ); - bool RunScriptFile( const CString &sFile ); + bool RunScriptFile( const RString &sFile ); /* Strip "//" comments and "+". */ - void PrepareExpression( CString &sInOut ); + void PrepareExpression( RString &sInOut ); /* Create a Lua array (a table with indices starting at 1) of the given vector, * and push it on the stack. */ @@ -71,13 +71,13 @@ namespace LuaHelpers void ReadArrayFromTableB( Lua *L, vector &aOut ); /* Run an expression in the global environment, returning the given type. */ - bool RunExpressionB( const CString &str ); - float RunExpressionF( const CString &str ); - int RunExpressionI( const CString &str ); - bool RunExpressionS( const CString &str, CString &sOut ); + bool RunExpressionB( const RString &str ); + float RunExpressionF( const RString &str ); + int RunExpressionI( const RString &str ); + bool RunExpressionS( const RString &str, RString &sOut ); /* If sStr begins with @, evaluate the rest as an expression and store the result over sStr. */ - bool RunAtExpressionS( CString &sStr ); + bool RunAtExpressionS( RString &sStr ); template void Push( T *pObject, Lua *L ); @@ -85,12 +85,12 @@ namespace LuaHelpers void Push( const bool &Object, Lua *L ); void Push( const float &Object, Lua *L ); void Push( const int &Object, Lua *L ); - void Push( const CString &Object, Lua *L ); + void Push( const RString &Object, Lua *L ); bool FromStack( bool &Object, int iOffset, Lua *L ); bool FromStack( float &Object, int iOffset, Lua *L ); bool FromStack( int &Object, int iOffset, Lua *L ); - bool FromStack( CString &Object, int iOffset, Lua *L ); + bool FromStack( RString &Object, int iOffset, Lua *L ); template void PushStack( const T &val, Lua *L ); diff --git a/stepmania/src/LyricsLoader.cpp b/stepmania/src/LyricsLoader.cpp index 34ab006bfc..4cfc21ea68 100644 --- a/stepmania/src/LyricsLoader.cpp +++ b/stepmania/src/LyricsLoader.cpp @@ -16,7 +16,7 @@ static int CompareLyricSegments(const LyricSegment &seg1, const LyricSegment &se return seg1.m_fStartTime < seg2.m_fStartTime; } -bool LyricsLoader::LoadFromLRCFile(const CString& sPath, Song& out) +bool LyricsLoader::LoadFromLRCFile(const RString& sPath, Song& out) { LOG->Trace( "LyricsLoader::LoadFromLRCFile(%s)", sPath.c_str() ); @@ -33,7 +33,7 @@ bool LyricsLoader::LoadFromLRCFile(const CString& sPath, Song& out) while( 1 ) { - CString line; + RString line; int ret = input.GetLine( line ); if( ret == 0 ) break; @@ -51,13 +51,13 @@ bool LyricsLoader::LoadFromLRCFile(const CString& sPath, Song& out) /* "[data1] data2". Ignore whitespace at the beginning of the line. */ static Regex x("^ *\\[([^]]+)\\] *(.*)$"); - vector matches; + vector matches; if(!x.Compare(line, matches)) continue; ASSERT( matches.size() == 2 ); - CString &sValueName = matches[0]; - CString &sValueData = matches[1]; + RString &sValueName = matches[0]; + RString &sValueData = matches[1]; StripCrnl(sValueData); // handle the data diff --git a/stepmania/src/LyricsLoader.h b/stepmania/src/LyricsLoader.h index 208d8bbb7f..94da54139c 100644 --- a/stepmania/src/LyricsLoader.h +++ b/stepmania/src/LyricsLoader.h @@ -8,7 +8,7 @@ class Song; class LyricsLoader { public: - bool LoadFromLRCFile( const CString& sPath, Song &out ); + bool LoadFromLRCFile( const RString& sPath, Song &out ); }; #endif diff --git a/stepmania/src/MemoryCardDisplay.cpp b/stepmania/src/MemoryCardDisplay.cpp index 86ae5fb93d..52aa2fcd14 100644 --- a/stepmania/src/MemoryCardDisplay.cpp +++ b/stepmania/src/MemoryCardDisplay.cpp @@ -21,14 +21,14 @@ void MemoryCardDisplay::Load( PlayerNumber pn ) for( int i=0; iGetPathG("MemoryCardDisplay",ssprintf("%s p%d",sState.c_str(),pn+1)) ); m_spr[i].SetHidden( true ); this->AddChild( &m_spr[i] ); } } -void MemoryCardDisplay::LoadFromNode( const CString& sDir, const XNode* pNode ) +void MemoryCardDisplay::LoadFromNode( const RString& sDir, const XNode* pNode ) { PlayerNumber pn; pNode->GetAttrValue("PlayerNumber", (int&) pn ); diff --git a/stepmania/src/MemoryCardDisplay.h b/stepmania/src/MemoryCardDisplay.h index 6b6c55c8b1..4797d74336 100644 --- a/stepmania/src/MemoryCardDisplay.h +++ b/stepmania/src/MemoryCardDisplay.h @@ -12,7 +12,7 @@ class MemoryCardDisplay : public ActorFrame public: MemoryCardDisplay(); void Load( PlayerNumber pn ); - void LoadFromNode( const CString& sDir, const XNode* pNode ); + void LoadFromNode( const RString& sDir, const XNode* pNode ); virtual Actor *Copy() const; void Update( float fDelta ); diff --git a/stepmania/src/MemoryCardManager.cpp b/stepmania/src/MemoryCardManager.cpp index 7e533cfb38..3530216a40 100644 --- a/stepmania/src/MemoryCardManager.cpp +++ b/stepmania/src/MemoryCardManager.cpp @@ -15,47 +15,47 @@ MemoryCardManager* MEMCARDMAN = NULL; // global and accessable from anywhere in our program -static void MemoryCardOsMountPointInit( size_t /*PlayerNumber*/ i, CString &sNameOut, CString &defaultValueOut ) +static void MemoryCardOsMountPointInit( size_t /*PlayerNumber*/ i, RString &sNameOut, RString &defaultValueOut ) { sNameOut = ssprintf( "MemoryCardOsMountPointP%d", int(i+1) ); defaultValueOut = ""; } -static void MemoryCardUsbBusInit( size_t /*PlayerNumber*/ i, CString &sNameOut, int &defaultValueOut ) +static void MemoryCardUsbBusInit( size_t /*PlayerNumber*/ i, RString &sNameOut, int &defaultValueOut ) { sNameOut = ssprintf( "MemoryCardUsbBusP%d", int(i+1) ); defaultValueOut = -1; } -static void MemoryCardUsbPortInit( size_t /*PlayerNumber*/ i, CString &sNameOut, int &defaultValueOut ) +static void MemoryCardUsbPortInit( size_t /*PlayerNumber*/ i, RString &sNameOut, int &defaultValueOut ) { sNameOut = ssprintf( "MemoryCardUsbPortP%d",int(i+1) ); defaultValueOut = -1; } -static void MemoryCardUsbLevelInit( size_t /*PlayerNumber*/ i, CString &sNameOut, int &defaultValueOut ) +static void MemoryCardUsbLevelInit( size_t /*PlayerNumber*/ i, RString &sNameOut, int &defaultValueOut ) { sNameOut = ssprintf( "MemoryCardUsbLevelP%d", int(i+1) ); defaultValueOut = -1; } // if set, always use the device that mounts to this point -Preference1D MemoryCardManager::m_sMemoryCardOsMountPoint( MemoryCardOsMountPointInit, NUM_PLAYERS ); +Preference1D MemoryCardManager::m_sMemoryCardOsMountPoint( MemoryCardOsMountPointInit, NUM_PLAYERS ); // Look for this level, bus, port when assigning cards. -1 = match any Preference1D MemoryCardManager::m_iMemoryCardUsbBus( MemoryCardUsbBusInit, NUM_PLAYERS ); Preference1D MemoryCardManager::m_iMemoryCardUsbPort( MemoryCardUsbPortInit, NUM_PLAYERS ); Preference1D MemoryCardManager::m_iMemoryCardUsbLevel( MemoryCardUsbLevelInit, NUM_PLAYERS ); -Preference MemoryCardManager::m_sEditorMemoryCardOsMountPoint( "EditorMemoryCardOsMountPoint", "" ); +Preference MemoryCardManager::m_sEditorMemoryCardOsMountPoint( "EditorMemoryCardOsMountPoint", "" ); -const CString MEM_CARD_MOUNT_POINT[NUM_PLAYERS] = +const RString MEM_CARD_MOUNT_POINT[NUM_PLAYERS] = { /* @ is importast; see RageFileManager LoadedDriver::GetPath */ "/@mc1/", "/@mc2/", }; -static const CString MEM_CARD_MOUNT_POINT_INTERNAL[NUM_PLAYERS] = +static const RString MEM_CARD_MOUNT_POINT_INTERNAL[NUM_PLAYERS] = { /* @ is importast; see RageFileManager LoadedDriver::GetPath */ "/@mc1int/", @@ -381,7 +381,7 @@ void MemoryCardManager::CheckStateChanges() UsbStorageDevice &new_device = m_Device[p]; MemoryCardState state = MemoryCardState_INVALID; - CString sError; + RString sError; if( m_bCardsLocked ) { @@ -619,7 +619,7 @@ void MemoryCardManager::UnmountCard( PlayerNumber pn ) this->UnPauseMountingThread(); } -bool MemoryCardManager::PathIsMemCard( CString sDir ) const +bool MemoryCardManager::PathIsMemCard( RString sDir ) const { FOREACH_PlayerNumber( p ) if( !sDir.Left(MEM_CARD_MOUNT_POINT[p].size()).CompareNoCase( MEM_CARD_MOUNT_POINT[p] ) ) @@ -632,7 +632,7 @@ bool MemoryCardManager::IsNameAvailable( PlayerNumber pn ) const return m_Device[pn].bIsNameAvailable; } -CString MemoryCardManager::GetName( PlayerNumber pn ) const +RString MemoryCardManager::GetName( PlayerNumber pn ) const { return m_Device[pn].sName; } diff --git a/stepmania/src/MemoryCardManager.h b/stepmania/src/MemoryCardManager.h index 96f760f5b4..b96a060cec 100644 --- a/stepmania/src/MemoryCardManager.h +++ b/stepmania/src/MemoryCardManager.h @@ -8,7 +8,7 @@ #include "Preference.h" -extern const CString MEM_CARD_MOUNT_POINT[NUM_PLAYERS]; +extern const RString MEM_CARD_MOUNT_POINT[NUM_PLAYERS]; class MemoryCardManager { @@ -19,7 +19,7 @@ public: void Update( float fDelta ); MemoryCardState GetCardState( PlayerNumber pn ) const { return m_State[pn]; } - CString GetCardError( PlayerNumber pn ) const { return m_sError[pn]; } + RString GetCardError( PlayerNumber pn ) const { return m_sError[pn]; } void LockCards(); // prevent removing or changing of memory cards void UnlockCards(); @@ -35,19 +35,19 @@ public: bool GetCardsLocked() const { return m_bCardsLocked; } - bool PathIsMemCard( CString sDir ) const; + bool PathIsMemCard( RString sDir ) const; bool IsNameAvailable( PlayerNumber pn ) const; - CString GetName( PlayerNumber pn ) const; + RString GetName( PlayerNumber pn ) const; const vector &GetStorageDevices() { return m_vStorageDevices; } - static Preference1D m_sMemoryCardOsMountPoint; + static Preference1D m_sMemoryCardOsMountPoint; static Preference1D m_iMemoryCardUsbBus; static Preference1D m_iMemoryCardUsbPort; static Preference1D m_iMemoryCardUsbLevel; - static Preference m_sEditorMemoryCardOsMountPoint; + static Preference m_sEditorMemoryCardOsMountPoint; protected: void CheckStateChanges(); @@ -61,7 +61,7 @@ protected: UsbStorageDevice m_FinalDevice[NUM_PLAYERS]; // device in the memory card slot when we finalized, blank if none MemoryCardState m_State[NUM_PLAYERS]; - CString m_sError[NUM_PLAYERS]; // if MemoryCardState_Error + RString m_sError[NUM_PLAYERS]; // if MemoryCardState_Error RageSound m_soundReady; RageSound m_soundError; diff --git a/stepmania/src/MenuInput.h b/stepmania/src/MenuInput.h index 4802ed419c..9d16a58b03 100644 --- a/stepmania/src/MenuInput.h +++ b/stepmania/src/MenuInput.h @@ -21,8 +21,8 @@ enum MenuButton }; #define FOREACH_MenuButton( m ) FOREACH_ENUM( MenuButton, NUM_MenuButton, m ) -const CString &MenuButtonToString( MenuButton mb ); -const CString &MenuButtonToLocalizedString( MenuButton mb ); +const RString &MenuButtonToString( MenuButton mb ); +const RString &MenuButtonToLocalizedString( MenuButton mb ); struct MenuInput { diff --git a/stepmania/src/MenuTimer.cpp b/stepmania/src/MenuTimer.cpp index 5475045812..4ab2180507 100644 --- a/stepmania/src/MenuTimer.cpp +++ b/stepmania/src/MenuTimer.cpp @@ -10,13 +10,13 @@ #include "ThemeMetric.h" #include "ActorUtil.h" -CString WARNING_COMMAND_NAME( size_t i ) { return ssprintf("WarningCommand%d",int(i)); } +RString WARNING_COMMAND_NAME( size_t i ) { return ssprintf("WarningCommand%d",int(i)); } static const ThemeMetric WARNING_START ("MenuTimer","WarningStart"); static const ThemeMetric WARNING_BEEP_START ("MenuTimer","WarningBeepStart"); static const ThemeMetric MAX_STALL_SECONDS ("MenuTimer","MaxStallSeconds"); -static const ThemeMetric TEXT1_FORMAT_FUNCTION ("MenuTimer","Text1FormatFunction"); -static const ThemeMetric TEXT2_FORMAT_FUNCTION ("MenuTimer","Text2FormatFunction"); +static const ThemeMetric TEXT1_FORMAT_FUNCTION ("MenuTimer","Text1FormatFunction"); +static const ThemeMetric TEXT2_FORMAT_FUNCTION ("MenuTimer","Text2FormatFunction"); static const float TIMER_PAUSE_SECONDS = 99.99f; @@ -170,7 +170,7 @@ void MenuTimer::SetText( float fSeconds ) // call function with 1 argument and 1 result lua_call(L, 1, 1); - CString sText; + RString sText; LuaHelpers::PopStack( sText, L ); m_text[i].SetText( sText ); diff --git a/stepmania/src/MessageManager.cpp b/stepmania/src/MessageManager.cpp index 722d3740eb..a41c6d12ca 100644 --- a/stepmania/src/MessageManager.cpp +++ b/stepmania/src/MessageManager.cpp @@ -71,7 +71,7 @@ XToString( Message, NUM_Message ); static RageMutex g_Mutex( "MessageManager" ); typedef set SubscribersSet; -static map g_MessageToSubscribers; +static map g_MessageToSubscribers; MessageManager::MessageManager() { @@ -81,7 +81,7 @@ MessageManager::~MessageManager() { } -void MessageManager::Subscribe( IMessageSubscriber* pSubscriber, const CString& sMessage ) +void MessageManager::Subscribe( IMessageSubscriber* pSubscriber, const RString& sMessage ) { LockMut(g_Mutex); @@ -98,7 +98,7 @@ void MessageManager::Subscribe( IMessageSubscriber* pSubscriber, Message m ) Subscribe( pSubscriber, MessageToString(m) ); } -void MessageManager::Unsubscribe( IMessageSubscriber* pSubscriber, const CString& sMessage ) +void MessageManager::Unsubscribe( IMessageSubscriber* pSubscriber, const RString& sMessage ) { LockMut(g_Mutex); @@ -113,13 +113,13 @@ void MessageManager::Unsubscribe( IMessageSubscriber* pSubscriber, Message m ) Unsubscribe( pSubscriber, MessageToString(m) ); } -void MessageManager::Broadcast( const CString& sMessage ) const +void MessageManager::Broadcast( const RString& sMessage ) const { ASSERT( !sMessage.empty() ); LockMut(g_Mutex); - map::const_iterator iter = g_MessageToSubscribers.find( sMessage ); + map::const_iterator iter = g_MessageToSubscribers.find( sMessage ); if( iter == g_MessageToSubscribers.end() ) return; @@ -135,7 +135,7 @@ void MessageManager::Broadcast( Message m ) const Broadcast( MessageToString(m) ); } -void IMessageSubscriber::ClearMessages( const CString sMessage ) +void IMessageSubscriber::ClearMessages( const RString sMessage ) { LockMut(g_Mutex); @@ -150,7 +150,7 @@ void IMessageSubscriber::ClearMessages( const CString sMessage ) m_aMessages.erase( m_aMessages.begin()+i ); } -void IMessageSubscriber::HandleMessageInternal( const CString& sMessage ) +void IMessageSubscriber::HandleMessageInternal( const RString& sMessage ) { QueuedMessage QM; QM.sMessage = sMessage; @@ -175,7 +175,7 @@ void IMessageSubscriber::ProcessMessages( float fDeltaTime ) for( unsigned i = 0; i < m_aMessages.size(); ++i ) { /* Remove the message from the list. */ - const CString sMessage = m_aMessages[i].sMessage; + const RString sMessage = m_aMessages[i].sMessage; m_aMessages.erase( m_aMessages.begin()+i ); --i; diff --git a/stepmania/src/MessageManager.h b/stepmania/src/MessageManager.h index a09398e75a..86cb4925ce 100644 --- a/stepmania/src/MessageManager.h +++ b/stepmania/src/MessageManager.h @@ -7,17 +7,17 @@ class IMessageSubscriber { public: virtual ~IMessageSubscriber() { } - virtual void HandleMessage( const CString& sMessage ) = 0; + virtual void HandleMessage( const RString& sMessage ) = 0; virtual void ProcessMessages( float fDeltaTime ); - void ClearMessages( const CString sMessage = "" ); + void ClearMessages( const RString sMessage = "" ); private: struct QueuedMessage { - CString sMessage; + RString sMessage; float fDelayRemaining; }; - void HandleMessageInternal( const CString& sMessage ); + void HandleMessageInternal( const RString& sMessage ); vector m_aMessages; friend class MessageManager; @@ -83,7 +83,7 @@ enum Message NUM_Message, // leave this at the end Message_Invalud }; -const CString& MessageToString( Message m ); +const RString& MessageToString( Message m ); class MessageManager { @@ -91,11 +91,11 @@ public: MessageManager(); ~MessageManager(); - void Subscribe( IMessageSubscriber* pSubscriber, const CString& sMessage ); + void Subscribe( IMessageSubscriber* pSubscriber, const RString& sMessage ); void Subscribe( IMessageSubscriber* pSubscriber, Message m ); - void Unsubscribe( IMessageSubscriber* pSubscriber, const CString& sMessage ); + void Unsubscribe( IMessageSubscriber* pSubscriber, const RString& sMessage ); void Unsubscribe( IMessageSubscriber* pSubscriber, Message m ); - void Broadcast( const CString& sMessage ) const; + void Broadcast( const RString& sMessage ) const; void Broadcast( Message m ) const; // Lua diff --git a/stepmania/src/MeterDisplay.cpp b/stepmania/src/MeterDisplay.cpp index cd49fb1997..747f8115c0 100644 --- a/stepmania/src/MeterDisplay.cpp +++ b/stepmania/src/MeterDisplay.cpp @@ -15,7 +15,7 @@ MeterDisplay::MeterDisplay() { } -void MeterDisplay::Load( CString sStreamPath, float fStreamWidth, CString sTipPath ) +void MeterDisplay::Load( RString sStreamPath, float fStreamWidth, RString sTipPath ) { m_fStreamWidth = fStreamWidth; @@ -29,17 +29,17 @@ void MeterDisplay::Load( CString sStreamPath, float fStreamWidth, CString sTipPa SetPercent( 0.5f ); } -void MeterDisplay::LoadFromNode( const CString& sDir, const XNode* pNode ) +void MeterDisplay::LoadFromNode( const RString& sDir, const XNode* pNode ) { LOG->Trace( "MeterDisplay::LoadFromNode(%s,node)", sDir.c_str() ); - CString sExpr; + RString sExpr; if( !pNode->GetAttrValue( "StreamWidth", sExpr ) ) RageException::Throw( "MeterDisplay in " + sDir + " missing StreamWidth attribute" ); m_fStreamWidth = LuaHelpers::RunExpressionF( sExpr ); { - CString sStreamPath; + RString sStreamPath; if( !pNode->GetAttrValue( "StreamPath", sStreamPath ) ) RageException::Throw( "MeterDisplay in " + sDir + " missing StreamPath attribute" ); diff --git a/stepmania/src/MeterDisplay.h b/stepmania/src/MeterDisplay.h index c6521080ee..06799a05ab 100644 --- a/stepmania/src/MeterDisplay.h +++ b/stepmania/src/MeterDisplay.h @@ -9,8 +9,8 @@ class MeterDisplay : public ActorFrame { public: MeterDisplay(); - void Load( CString sStreamPath, float fStreamWidth, CString sTipPath ); - virtual void LoadFromNode( const CString& sDir, const XNode* pNode ); + void Load( RString sStreamPath, float fStreamWidth, RString sTipPath ); + virtual void LoadFromNode( const RString& sDir, const XNode* pNode ); virtual Actor *Copy() const; void SetPercent( float fPercent ); diff --git a/stepmania/src/ModeSwitcher.cpp b/stepmania/src/ModeSwitcher.cpp index 9bd1827791..a4fb463754 100644 --- a/stepmania/src/ModeSwitcher.cpp +++ b/stepmania/src/ModeSwitcher.cpp @@ -58,10 +58,10 @@ ModeSwitcher::~ModeSwitcher() } -CString ModeSwitcher::GetStyleName() +RString ModeSwitcher::GetStyleName() { - CString sStyleName; - CString sDiff[NUM_PLAYERS]; + RString sStyleName; + RString sDiff[NUM_PLAYERS]; sStyleName = GAMESTATE->m_pCurStyle->m_szName; sStyleName.MakeUpper(); @@ -75,7 +75,7 @@ CString ModeSwitcher::GetStyleName() case DIFFICULTY_BEGINNER: sDiff[i] = "Beginner\n"; break; case DIFFICULTY_EASY: { - if(GAMESTATE->m_pCurGame->m_szName == CString("pump")) + if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) { sDiff[i] = "Normal\n"; break; } @@ -86,7 +86,7 @@ CString ModeSwitcher::GetStyleName() } case DIFFICULTY_MEDIUM: { - if(GAMESTATE->m_pCurGame->m_szName == CString("pump")) + if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) { sDiff[i] = "Hard\n"; break; } @@ -97,7 +97,7 @@ CString ModeSwitcher::GetStyleName() } case DIFFICULTY_HARD: { - if(GAMESTATE->m_pCurGame->m_szName == CString("pump")) + if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) { sDiff[i] = "Crazy\n"; break; } @@ -115,15 +115,15 @@ CString ModeSwitcher::GetStyleName() sDiff[i] = ""; } } - CString returnval; + RString returnval; returnval = sStyleName + sDiff[0] + sDiff[1]; return returnval; } -CString ModeSwitcher::GetNextStyleName() +RString ModeSwitcher::GetNextStyleName() { - CString sStyleName[NUM_PLAYERS]; - CString sDiff[NUM_PLAYERS]; + RString sStyleName[NUM_PLAYERS]; + RString sDiff[NUM_PLAYERS]; FOREACH_PlayerNumber(i) { @@ -138,7 +138,7 @@ CString ModeSwitcher::GetNextStyleName() { case DIFFICULTY_BEGINNER: { - if(GAMESTATE->m_pCurGame->m_szName == CString("pump")) + if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) { sDiff[i] = "Normal\n"; break; } @@ -149,7 +149,7 @@ CString ModeSwitcher::GetNextStyleName() } case DIFFICULTY_EASY: { - if(GAMESTATE->m_pCurGame->m_szName == CString("pump")) + if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) { sDiff[i] = "Hard\n"; break; } @@ -160,7 +160,7 @@ CString ModeSwitcher::GetNextStyleName() } case DIFFICULTY_MEDIUM: { - if(GAMESTATE->m_pCurGame->m_szName == CString("pump")) + if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) { sDiff[i] = "Crazy\n"; break; } @@ -188,15 +188,15 @@ CString ModeSwitcher::GetNextStyleName() sDiff[i] = ""; } } - CString returnval; + RString returnval; returnval = sStyleName[0] + sDiff[0] + sStyleName[1] + sDiff[1]; return returnval; } -CString ModeSwitcher::GetPrevStyleName() +RString ModeSwitcher::GetPrevStyleName() { - CString sStyleName[NUM_PLAYERS]; - CString sDiff[NUM_PLAYERS]; + RString sStyleName[NUM_PLAYERS]; + RString sDiff[NUM_PLAYERS]; FOREACH_PlayerNumber(i) { @@ -211,7 +211,7 @@ CString ModeSwitcher::GetPrevStyleName() { case DIFFICULTY_CHALLENGE: { - if(GAMESTATE->m_pCurGame->m_szName == CString("pump")) + if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) { sDiff[i] = "Crazy\n"; break; } @@ -223,7 +223,7 @@ CString ModeSwitcher::GetPrevStyleName() case DIFFICULTY_EASY: sDiff[i] = "Beginner\n"; break; case DIFFICULTY_MEDIUM: { - if(GAMESTATE->m_pCurGame->m_szName == CString("pump")) + if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) { sDiff[i] = "Normal\n"; break; } @@ -234,7 +234,7 @@ CString ModeSwitcher::GetPrevStyleName() } case DIFFICULTY_HARD: { - if(GAMESTATE->m_pCurGame->m_szName == CString("pump")) + if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) { sDiff[i] = "Hard\n"; break; } @@ -261,14 +261,14 @@ CString ModeSwitcher::GetPrevStyleName() sDiff[i] = ""; } } - CString returnval; + RString returnval; returnval = sStyleName[0] + sDiff[0] + sStyleName[1] + sDiff[1]; return returnval; } void ModeSwitcher::ChangeMode(PlayerNumber pn, int dir) { - if(GAMESTATE->m_pCurGame->m_szName == CString("pump")) + if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) { if(GAMESTATE->IsPlayerEnabled(pn)) { diff --git a/stepmania/src/ModeSwitcher.h b/stepmania/src/ModeSwitcher.h index 0b339fba68..e5c6f326fb 100644 --- a/stepmania/src/ModeSwitcher.h +++ b/stepmania/src/ModeSwitcher.h @@ -27,9 +27,9 @@ private: BitmapText m_Prevmode; Sprite m_NextIcon; Sprite m_PrevIcon; - CString GetStyleName(); - CString GetNextStyleName(); - CString GetPrevStyleName(); + RString GetStyleName(); + RString GetNextStyleName(); + RString GetPrevStyleName(); }; #endif diff --git a/stepmania/src/Model.cpp b/stepmania/src/Model.cpp index b78c2b8f29..dc75ef71e3 100644 --- a/stepmania/src/Model.cpp +++ b/stepmania/src/Model.cpp @@ -17,7 +17,7 @@ REGISTER_ACTOR_CLASS( Model ) static const float FRAMES_PER_SECOND = 30; -static const CString DEFAULT_ANIMATION_NAME = "default"; +static const RString DEFAULT_ANIMATION_NAME = "default"; Model::Model() { @@ -53,11 +53,11 @@ void Model::Clear() DISPLAY->DeleteCompiledGeometry( m_pTempGeometry ); } -void Model::Load( CString sFile ) +void Model::Load( RString sFile ) { if( sFile == "" ) return; - CString sExt = GetExtension(sFile); + RString sExt = GetExtension(sFile); sExt.MakeLower(); if( sExt=="txt" ) LoadMilkshapeAscii( sFile ); @@ -65,12 +65,12 @@ void Model::Load( CString sFile ) #define THROW RageException::Throw( "Parse error in \"%s\" at line %d: '%s'", sPath.c_str(), iLineNum, sLine.c_str() ) -void Model::LoadMilkshapeAscii( CString sPath ) +void Model::LoadMilkshapeAscii( RString sPath ) { LoadPieces( sPath, sPath, sPath ); } -void Model::LoadPieces( CString sMeshesPath, CString sMaterialsPath, CString sBonesPath ) +void Model::LoadPieces( RString sMeshesPath, RString sMaterialsPath, RString sBonesPath ) { Clear(); @@ -106,11 +106,11 @@ void Model::LoadPieces( CString sMeshesPath, CString sMaterialsPath, CString sBo } } -void Model::LoadFromNode( const CString& sDir, const XNode* pNode ) +void Model::LoadFromNode( const RString& sDir, const XNode* pNode ) { Actor::LoadFromNode( sDir, pNode ); - CString s1, s2, s3; + RString s1, s2, s3; pNode->GetAttrValue( "Meshes", s1 ); pNode->GetAttrValue( "Materials", s2 ); pNode->GetAttrValue( "Bones", s3 ); @@ -134,16 +134,16 @@ void Model::LoadFromNode( const CString& sDir, const XNode* pNode ) } -void Model::LoadMaterialsFromMilkshapeAscii( CString sPath ) +void Model::LoadMaterialsFromMilkshapeAscii( RString sPath ) { FixSlashesInPlace(sPath); - const CString sDir = Dirname( sPath ); + const RString sDir = Dirname( sPath ); RageFile f; if( !f.Open( sPath ) ) RageException::Throw( "Model::LoadMilkshapeAscii Could not open \"%s\": %s", sPath.c_str(), f.GetError().c_str() ); - CString sLine; + RString sLine; int iLineNum = 0; while( f.GetLine( sLine ) > 0 ) @@ -241,18 +241,18 @@ void Model::LoadMaterialsFromMilkshapeAscii( CString sPath ) THROW; strcpy( szName, "" ); sscanf( sLine, "\"%[^\"]\"", szName ); - CString sDiffuseTexture = szName; + RString sDiffuseTexture = szName; if( sDiffuseTexture != "" ) { - CString sTexturePath = sDir + sDiffuseTexture; + RString sTexturePath = sDir + sDiffuseTexture; FixSlashesInPlace( sTexturePath ); CollapsePath( sTexturePath ); if( IsAFile(sTexturePath) ) Material.diffuse.Load( sTexturePath ); else { - CString sError = ssprintf( "'%s' references a texture '%s' that does not exist", sPath.c_str(), sTexturePath.c_str() ); + RString sError = ssprintf( "'%s' references a texture '%s' that does not exist", sPath.c_str(), sTexturePath.c_str() ); RageException::Throw( sError ); } } @@ -262,18 +262,18 @@ void Model::LoadMaterialsFromMilkshapeAscii( CString sPath ) THROW; strcpy( szName, "" ); sscanf( sLine, "\"%[^\"]\"", szName ); - CString sAlphaTexture = szName; + RString sAlphaTexture = szName; if( sAlphaTexture != "" ) { - CString sTexturePath = sDir + sAlphaTexture; + RString sTexturePath = sDir + sAlphaTexture; FixSlashesInPlace( sTexturePath ); CollapsePath( sTexturePath ); if( IsAFile(sTexturePath) ) Material.alpha.Load( sTexturePath ); else { - CString sError = ssprintf( "'%s' references a texture '%s' that does not exist", sPath.c_str(), sTexturePath.c_str() ); + RString sError = ssprintf( "'%s' references a texture '%s' that does not exist", sPath.c_str(), sTexturePath.c_str() ); RageException::Throw( sError ); } } @@ -284,7 +284,7 @@ void Model::LoadMaterialsFromMilkshapeAscii( CString sPath ) f.Close(); } -bool Model::LoadMilkshapeAsciiBones( CString sAniName, CString sPath ) +bool Model::LoadMilkshapeAsciiBones( RString sAniName, RString sPath ) { m_mapNameToAnimation[sAniName] = msAnimation(); msAnimation &Animation = m_mapNameToAnimation[sAniName]; @@ -497,13 +497,13 @@ void Model::DrawMesh( int i ) const DISPLAY->PopMatrix(); } -void Model::SetDefaultAnimation( CString sAnimation, float fPlayRate ) +void Model::SetDefaultAnimation( RString sAnimation, float fPlayRate ) { m_sDefaultAnimation = sAnimation; m_fDefaultAnimationRate = fPlayRate; } -void Model::PlayAnimation( CString sAniName, float fPlayRate ) +void Model::PlayAnimation( RString sAniName, float fPlayRate ) { if( m_mapNameToAnimation.find(sAniName) == m_mapNameToAnimation.end() ) return; @@ -788,7 +788,7 @@ void Model::HandleCommand( const Command &command ) { BeginHandleArgs; - const CString& sName = command.GetName(); + const RString& sName = command.GetName(); if( sName=="play" ) { PlayAnimation( sArg(1),fArg(2) ); diff --git a/stepmania/src/Model.h b/stepmania/src/Model.h index 91f3b227e3..a6486fc7cb 100644 --- a/stepmania/src/Model.h +++ b/stepmania/src/Model.h @@ -20,16 +20,16 @@ public: virtual Actor *Copy() const; void Clear(); - void Load( CString sFile ); + void Load( RString sFile ); - void LoadPieces( CString sMeshesPath, CString sMaterialsPath, CString sBomesPath ); - void LoadMilkshapeAscii( CString sFile ); - void LoadMaterialsFromMilkshapeAscii( CString sPath ); - bool LoadMilkshapeAsciiBones( CString sAniName, CString sPath ); + void LoadPieces( RString sMeshesPath, RString sMaterialsPath, RString sBomesPath ); + void LoadMilkshapeAscii( RString sFile ); + void LoadMaterialsFromMilkshapeAscii( RString sPath ); + bool LoadMilkshapeAsciiBones( RString sAniName, RString sPath ); - void LoadFromNode( const CString& sDir, const XNode* pNode ); + void LoadFromNode( const RString& sDir, const XNode* pNode ); - void PlayAnimation( CString sAniName, float fPlayRate = 1 ); + void PlayAnimation( RString sAniName, float fPlayRate = 1 ); virtual void Update( float fDelta ); virtual bool EarlyAbortDraw() const; @@ -42,8 +42,8 @@ public: virtual float GetAnimationLengthSeconds() const; virtual void SetSecondsIntoAnimation( float fSeconds ); - CString GetDefaultAnimation() const { return m_sDefaultAnimation; }; - void SetDefaultAnimation( CString sAnimation, float fPlayRate = 1 ); + RString GetDefaultAnimation() const { return m_sDefaultAnimation; }; + void SetDefaultAnimation( RString sAnimation, float fPlayRate = 1 ); bool m_bRevertToDefaultAnimation; bool MaterialsNeedNormals() const; @@ -57,7 +57,7 @@ private: RageModelGeometry *m_pGeometry; vector m_Materials; - map m_mapNameToAnimation; + map m_mapNameToAnimation; const msAnimation* m_pCurAnimation; static void SetBones( const msAnimation* pAnimation, float fFrame, vector &vpBones ); @@ -77,7 +77,7 @@ private: void AdvanceFrame( float fDeltaTime ); float m_fCurFrame; - CString m_sDefaultAnimation; + RString m_sDefaultAnimation; float m_fDefaultAnimationRate; float m_fCurAnimationRate; diff --git a/stepmania/src/ModelManager.cpp b/stepmania/src/ModelManager.cpp index ce492bcc2b..64c6104b12 100644 --- a/stepmania/src/ModelManager.cpp +++ b/stepmania/src/ModelManager.cpp @@ -15,7 +15,7 @@ ModelManager::ModelManager() ModelManager::~ModelManager() { - for( std::map::iterator i = m_mapFileToGeometry.begin(); + for( std::map::iterator i = m_mapFileToGeometry.begin(); i != m_mapFileToGeometry.end(); ++i ) { @@ -26,9 +26,9 @@ ModelManager::~ModelManager() } } -RageModelGeometry* ModelManager::LoadMilkshapeAscii( const CString& sFile, bool bNeedNormals ) +RageModelGeometry* ModelManager::LoadMilkshapeAscii( const RString& sFile, bool bNeedNormals ) { - std::map::iterator p = m_mapFileToGeometry.find( sFile ); + std::map::iterator p = m_mapFileToGeometry.find( sFile ); if( p != m_mapFileToGeometry.end() ) { /* Found the geometry. Just increase the refcount and return it. */ @@ -52,7 +52,7 @@ void ModelManager::UnloadModel( RageModelGeometry *m ) if( m->m_iRefCount ) return; /* Can't unload models that are still referenced. */ - for( std::map::iterator i = m_mapFileToGeometry.begin(); + for( std::map::iterator i = m_mapFileToGeometry.begin(); i != m_mapFileToGeometry.end(); ++i ) { diff --git a/stepmania/src/ModelManager.h b/stepmania/src/ModelManager.h index d96ec0738c..d165b504ce 100644 --- a/stepmania/src/ModelManager.h +++ b/stepmania/src/ModelManager.h @@ -32,7 +32,7 @@ public: ModelManager(); ~ModelManager(); - RageModelGeometry* LoadMilkshapeAscii( const CString& sFile, bool bNeedNormals ); + RageModelGeometry* LoadMilkshapeAscii( const RString& sFile, bool bNeedNormals ); void UnloadModel( RageModelGeometry *m ); // void ReloadAll(); @@ -41,7 +41,7 @@ public: protected: - std::map m_mapFileToGeometry; + std::map m_mapFileToGeometry; ModelManagerPrefs m_Prefs; }; diff --git a/stepmania/src/ModelTypes.cpp b/stepmania/src/ModelTypes.cpp index 935e3628dc..5a1921b7f0 100644 --- a/stepmania/src/ModelTypes.cpp +++ b/stepmania/src/ModelTypes.cpp @@ -27,11 +27,11 @@ AnimatedTexture::~AnimatedTexture() Unload(); } -void AnimatedTexture::Load( CString sTexOrIniPath ) +void AnimatedTexture::Load( RString sTexOrIniPath ) { ASSERT( vFrames.empty() ); // don't load more than once - m_bSphereMapped = sTexOrIniPath.find("sphere") != CString::npos; + m_bSphereMapped = sTexOrIniPath.find("sphere") != RString::npos; if( sTexOrIniPath.find("add") != string::npos ) m_BlendMode = BLEND_ADD; else @@ -54,16 +54,16 @@ void AnimatedTexture::Load( CString sTexOrIniPath ) for( int i=0; i<1000; i++ ) { - CString sFileKey = ssprintf( "Frame%04d", i ); - CString sDelayKey = ssprintf( "Delay%04d", i ); + RString sFileKey = ssprintf( "Frame%04d", i ); + RString sDelayKey = ssprintf( "Delay%04d", i ); - CString sFileName; + RString sFileName; float fDelay = 0; if( pAnimatedTexture->GetAttrValue( sFileKey, sFileName ) && pAnimatedTexture->GetAttrValue( sDelayKey, fDelay ) ) { - CString sTranslateXKey = ssprintf( "TranslateX%04d", i ); - CString sTranslateYKey = ssprintf( "TranslateY%04d", i ); + RString sTranslateXKey = ssprintf( "TranslateX%04d", i ); + RString sTranslateYKey = ssprintf( "TranslateY%04d", i ); RageVector2 vOffset(0,0); pAnimatedTexture->GetAttrValue( sTranslateXKey, vOffset.x ); @@ -214,16 +214,16 @@ msMesh::~msMesh() #define THROW RageException::Throw( "Parse error in \"%s\" at line %d: '%s'", sPath.c_str(), iLineNum, sLine.c_str() ) -bool msAnimation::LoadMilkshapeAsciiBones( CString sAniName, CString sPath ) +bool msAnimation::LoadMilkshapeAsciiBones( RString sAniName, RString sPath ) { FixSlashesInPlace(sPath); - const CString sDir = Dirname( sPath ); + const RString sDir = Dirname( sPath ); RageFile f; if ( !f.Open(sPath) ) RageException::Throw( "Model:: Could not open \"%s\": %s", sPath.c_str(), f.GetError().c_str() ); - CString sLine; + RString sLine; int iLineNum = 0; msAnimation &Animation = *this; diff --git a/stepmania/src/ModelTypes.h b/stepmania/src/ModelTypes.h index 3cd68f56fa..db6b8e3168 100644 --- a/stepmania/src/ModelTypes.h +++ b/stepmania/src/ModelTypes.h @@ -16,7 +16,7 @@ struct msMesh msMesh(); ~msMesh(); - CString sName; + RString sName; char nMaterialIndex; vector Vertices; @@ -38,7 +38,7 @@ public: AnimatedTexture(); ~AnimatedTexture(); - void Load( CString sTexOrIniFile ); + void Load( RString sTexOrIniFile ); void Unload(); void Update( float fDelta ); @@ -85,7 +85,7 @@ private: struct msMaterial { int nFlags; - CString sName; + RString sName; RageColor Ambient; RageColor Diffuse; RageColor Specular; @@ -115,8 +115,8 @@ struct msRotationKey struct msBone { int nFlags; - CString sName; - CString sParentName; + RString sName; + RString sParentName; RageVector3 Position; RageVector3 Rotation; @@ -131,7 +131,7 @@ struct msAnimation { vector Bones; - int FindBoneByName( const CString &sName ) const + int FindBoneByName( const RString &sName ) const { for( unsigned i=0; i= GetNumValues()) return CString(); - if(par >= GetNumParams(val)) return CString(); + if(val >= GetNumValues()) return RString(); + if(par >= GetNumParams(val)) return RString(); return values[val].params[par]; } diff --git a/stepmania/src/MsdFile.h b/stepmania/src/MsdFile.h index 99eb9b5321..3b69a2dc05 100644 --- a/stepmania/src/MsdFile.h +++ b/stepmania/src/MsdFile.h @@ -9,23 +9,23 @@ public: /* #param:param:param:param; <- one whole value */ struct value_t { - vector params; + vector params; - CString operator[](unsigned i) const { if(i >= params.size()) return CString(); return params[i]; } + RString operator[](unsigned i) const { if(i >= params.size()) return RString(); return params[i]; } }; virtual ~MsdFile() { } // Returns true if successful, false otherwise. - bool ReadFile( CString sFilePath ); - void ReadFromString( const CString &sString ); + bool ReadFile( RString sFilePath ); + void ReadFromString( const RString &sString ); - CString GetError() const { return error; } + RString GetError() const { return error; } unsigned GetNumValues() const { return values.size(); } unsigned GetNumParams(unsigned val) const { if(val >= GetNumValues()) return 0; return values[val].params.size(); } const value_t &GetValue(unsigned val) const { ASSERT(val < GetNumValues()); return values[val]; } - CString GetParam(unsigned val, unsigned par) const; + RString GetParam(unsigned val, unsigned par) const; private: @@ -34,7 +34,7 @@ private: void AddValue(); vector values; - CString error; + RString error; }; #endif diff --git a/stepmania/src/MusicBannerWheel.cpp b/stepmania/src/MusicBannerWheel.cpp index 8314052f31..e15d20e0cc 100644 --- a/stepmania/src/MusicBannerWheel.cpp +++ b/stepmania/src/MusicBannerWheel.cpp @@ -126,7 +126,7 @@ works only if there are 5 banners in the scrolling list. void MusicBannerWheel::InsertNewBanner(int direction) { Song* pSong = NULL; - CString sGraphicPath; + RString sGraphicPath; int elementtoreplace=0; if( direction == GOINGLEFT) @@ -215,7 +215,7 @@ and once only. void MusicBannerWheel::LoadSongData() { Song* pSong = NULL; - vector asGraphicPaths; + vector asGraphicPaths; if(MAXSONGSINBUFFER >= arraySongs.size() && SingleLoad != 1) // less than the MAXSONGSINBUFFER means we can get away with loading the lot in one go { @@ -308,7 +308,7 @@ void MusicBannerWheel::ScanToNextGroup() int startingPos = localPos; Song* pSong; pSong = arraySongs[currentPos]; - CString currentGroupName = pSong->m_sGroupName; + RString currentGroupName = pSong->m_sGroupName; localPos++; while(localPos != startingPos) { diff --git a/stepmania/src/MusicList.cpp b/stepmania/src/MusicList.cpp index c8f9b6e80c..5ffad10769 100644 --- a/stepmania/src/MusicList.cpp +++ b/stepmania/src/MusicList.cpp @@ -45,7 +45,7 @@ void MusicList::AddSongsToGroup(const vector &Songs) for( int c=0; c &Songs) continue; } - CString sTitle = Songs[iIndex]->GetDisplayFullTitle(); + RString sTitle = Songs[iIndex]->GetDisplayFullTitle(); // TODO: Move this crop threshold into a theme metric or make automatic based on column width if( sTitle.size() > 40 ) sTitle = sTitle.Left( 37 ) + "..."; - CString sTrTitle = Songs[iIndex]->GetTranslitFullTitle(); + RString sTrTitle = Songs[iIndex]->GetTranslitFullTitle(); if( sTrTitle.size() > 40 ) sTrTitle = sTrTitle.Left( 37 ) + "..."; diff --git a/stepmania/src/MusicList.h b/stepmania/src/MusicList.h index b8d2ed427b..47dea6f702 100644 --- a/stepmania/src/MusicList.h +++ b/stepmania/src/MusicList.h @@ -12,7 +12,7 @@ class MusicList : public ActorFrame BitmapText m_textTitles[MAX_MLIST_COLUMNS]; struct group { - CString ContentsText[MAX_MLIST_COLUMNS]; + RString ContentsText[MAX_MLIST_COLUMNS]; int m_iNumSongsInGroup; }; diff --git a/stepmania/src/MusicSortDisplay.cpp b/stepmania/src/MusicSortDisplay.cpp index 6eae25c6a2..e2496e7e71 100644 --- a/stepmania/src/MusicSortDisplay.cpp +++ b/stepmania/src/MusicSortDisplay.cpp @@ -22,7 +22,7 @@ void MusicSortDisplay::Set( SortOrder so ) Load( THEME->GetPathG("MusicSortDisplay",SortOrderToString(so)) ); } -void MusicSortDisplay::HandleMessage( const CString& sMessage ) +void MusicSortDisplay::HandleMessage( const RString& sMessage ) { if( sMessage == "SortOrderChanged" ) Set( GAMESTATE->m_SortOrder ); diff --git a/stepmania/src/MusicSortDisplay.h b/stepmania/src/MusicSortDisplay.h index 5b1b181b0b..74b0d57a4e 100644 --- a/stepmania/src/MusicSortDisplay.h +++ b/stepmania/src/MusicSortDisplay.h @@ -12,7 +12,7 @@ public: MusicSortDisplay(); virtual Actor *Copy() const; void Set( SortOrder so ); - virtual void HandleMessage( const CString& sMessage ); + virtual void HandleMessage( const RString& sMessage ); protected: diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 5efa6bd838..92a9d49f40 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -25,8 +25,8 @@ #define NUM_WHEEL_ITEMS ((int)ceil(NUM_WHEEL_ITEMS_TO_DRAW+2)) #define WHEEL_TEXT(s) THEME->GetString( "MusicWheel", ssprintf("%sText",s.c_str()) ); -static CString SECTION_COLORS_NAME( size_t i ) { return ssprintf("SectionColor%d",int(i+1)); } -static CString CHOICE_NAME( CString s ) { return ssprintf("Choice%s",s.c_str()); } +static RString SECTION_COLORS_NAME( size_t i ) { return ssprintf("SectionColor%d",int(i+1)); } +static RString CHOICE_NAME( RString s ) { return ssprintf("Choice%s",s.c_str()); } AutoScreenMessage( SM_SongChanged ) // TODO: Replace this with a Message and MESSAGEMAN AutoScreenMessage( SM_SortOrderChanging ); @@ -73,7 +73,7 @@ static SortOrder ForceAppropriateSort( PlayMode pm, SortOrder so ) } -void MusicWheel::Load( CString sType ) +void MusicWheel::Load( RString sType ) { LOG->Trace( "MusicWheel::Load('%s')", sType.c_str() ); @@ -149,7 +149,7 @@ void MusicWheel::Load( CString sType ) SONGMAN->SortSongs(); RageTimer timer; - CString times; + RString times; /* Build all of the wheel item data. Do this after selecting * the extra stage, so it knows to always display it. */ FOREACH_SortOrder( so ) @@ -192,7 +192,7 @@ void MusicWheel::Load( CString sType ) RebuildAllMusicWheelItems(); } -void MusicWheel::LoadFromMetrics( CString sType ) +void MusicWheel::LoadFromMetrics( RString sType ) { WheelBase::LoadFromMetrics(sType); @@ -207,7 +207,7 @@ void MusicWheel::LoadFromMetrics( CString sType ) RANDOM_PICKS_LOCKED_SONGS .Load(sType,"RandomPicksLockedSongs"); MOST_PLAYED_SONGS_TO_SHOW .Load(sType,"MostPlayedSongsToShow"); MODE_MENU_CHOICE_NAMES .Load(sType,"ModeMenuChoiceNames"); - vector vsModeChoiceNames; + vector vsModeChoiceNames; split( MODE_MENU_CHOICE_NAMES, ",", vsModeChoiceNames ); CHOICE .Load(sType,CHOICE_NAME,vsModeChoiceNames); SECTION_COLORS .Load(sType,SECTION_COLORS_NAME,NUM_SECTION_COLORS); @@ -248,7 +248,7 @@ bool MusicWheel::SelectSongOrCourse() return false; } -bool MusicWheel::SelectSection( const CString & SectionName ) +bool MusicWheel::SelectSection( const RString & SectionName ) { unsigned int i; for( i=0; i &arraySongs, SortOrder so, CString sPreferredGroup ) +void MusicWheel::GetSongList(vector &arraySongs, SortOrder so, RString sPreferredGroup ) { vector apAllSongs; // if( so==SORT_PREFERRED && GAMESTATE->m_sPreferredGroup!=GROUP_ALL) @@ -415,7 +415,7 @@ void MusicWheel::BuildWheelItemDatas( vector &arrayWheelItemDatas case SORT_MODE_MENU: { arrayWheelItemDatas.clear(); // clear out the previous wheel items - vector vsNames; + vector vsNames; split( MODE_MENU_CHOICE_NAMES, ",", vsNames ); for( unsigned i=0; i &arrayWheelItemDatas } // make WheelItemDatas with sections - CString sLastSection = ""; + RString sLastSection = ""; int iSectionColorIndex = 0; for( unsigned i=0; i< arraySongs.size(); i++ ) { Song* pSong = arraySongs[i]; if( bUseSections ) { - CString sThisSection = SongUtil::GetSectionNameFromSongAndSort( pSong, so ); + RString sThisSection = SongUtil::GetSectionNameFromSongAndSort( pSong, so ); if( sThisSection != sLastSection ) { @@ -657,7 +657,7 @@ void MusicWheel::BuildWheelItemDatas( vector &arrayWheelItemDatas arrayWheelItemDatas.clear(); // clear out the previous wheel items - CString sLastSection = ""; + RString sLastSection = ""; int iSectionColorIndex = 0; for( unsigned i=0; i &arrayWheelItemDatas if ( UNLOCKMAN->CourseIsLocked(pCourse) ) continue; - CString sThisSection = ""; + RString sThisSection = ""; if( so == SORT_ALL_COURSES ) { switch( pCourse->GetPlayMode() ) @@ -1066,7 +1066,7 @@ bool MusicWheel::Select() // return true if this selection ends the screen { case TYPE_SECTION: { - CString sThisItemSectionName = m_CurWheelItemData[m_iSelection]->m_sText; + RString sThisItemSectionName = m_CurWheelItemData[m_iSelection]->m_sText; if( m_sExpandedSectionName == sThisItemSectionName ) // already expanded m_sExpandedSectionName = ""; // collapse it else // already collapsed @@ -1139,7 +1139,7 @@ void MusicWheel::StartRandom() RebuildAllMusicWheelItems(); } -void MusicWheel::SetOpenGroup(CString group, SortOrder so) +void MusicWheel::SetOpenGroup(RString group, SortOrder so) { if( so != SORT_INVALID ) GAMESTATE->m_SortOrder.Set( so ); @@ -1297,7 +1297,7 @@ Song *MusicWheel::GetPreferredSelectionForRandomOrPortal() vDifficultiesToRequire.push_back( GAMESTATE->m_PreferredDifficulty[p] ); } - CString sPreferredGroup = m_sExpandedSectionName; + RString sPreferredGroup = m_sExpandedSectionName; vector &wid = m_WheelItemDatas[GAMESTATE->m_SortOrder]; StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType; diff --git a/stepmania/src/MusicWheel.h b/stepmania/src/MusicWheel.h index 787fa233ea..95df80df94 100644 --- a/stepmania/src/MusicWheel.h +++ b/stepmania/src/MusicWheel.h @@ -27,7 +27,7 @@ class MusicWheel : public WheelBase public: MusicWheel(); ~MusicWheel(); - virtual void Load( CString sType ); + virtual void Load( RString sType ); virtual void DrawItem( int index ); @@ -43,7 +43,7 @@ public: WheelItemType GetSelectedType() { return m_CurWheelItemData[m_iSelection]->m_Type; } Song* GetSelectedSong(); Course* GetSelectedCourse() { return m_CurWheelItemData[m_iSelection]->m_pCourse; } - CString GetSelectedSection(){ return m_CurWheelItemData[m_iSelection]->m_sText; } + RString GetSelectedSection(){ return m_CurWheelItemData[m_iSelection]->m_sText; } void RebuildAllMusicWheelItems(); void RebuildMusicWheelItems( int dist ); @@ -51,16 +51,16 @@ public: Song *GetPreferredSelectionForRandomOrPortal(); bool SelectSong( Song *p ); - bool SelectSection( const CString & SectionName ); - void SetOpenGroup(CString group, SortOrder so = SORT_INVALID); + bool SelectSection( const RString & SectionName ); + void SetOpenGroup(RString group, SortOrder so = SORT_INVALID); SortOrder GetSortOrder() const { return m_SortOrder; } virtual void ChangeMusic(int dist); /* +1 or -1 */ //CHECK THIS void FinishChangingSorts(); protected: - virtual void LoadFromMetrics( CString sType ); + virtual void LoadFromMetrics( RString sType ); virtual bool MoveSpecific(int n); - void GetSongList(vector &arraySongs, SortOrder so, CString sPreferredGroup ); + void GetSongList(vector &arraySongs, SortOrder so, RString sPreferredGroup ); void BuildWheelItemDatas( vector &arrayWheelItems, SortOrder so ); bool SelectSongOrCourse(); bool SelectCourse( Course *p ); @@ -77,7 +77,7 @@ protected: vector m_CurWheelItemData; vector m_MusicWheelItems; - CString m_sLastModeMenuItem; + RString m_sLastModeMenuItem; SortOrder m_SortOrder; RageSound m_soundChangeSort; @@ -94,8 +94,8 @@ protected: ThemeMetric SHOW_PORTAL; ThemeMetric RANDOM_PICKS_LOCKED_SONGS; ThemeMetric MOST_PLAYED_SONGS_TO_SHOW; - ThemeMetric MODE_MENU_CHOICE_NAMES; - ThemeMetricMap CHOICE; + ThemeMetric MODE_MENU_CHOICE_NAMES; + ThemeMetricMap CHOICE; ThemeMetric1D SECTION_COLORS; }; diff --git a/stepmania/src/MusicWheelItem.cpp b/stepmania/src/MusicWheelItem.cpp index 005d491ed7..7af4fd5362 100644 --- a/stepmania/src/MusicWheelItem.cpp +++ b/stepmania/src/MusicWheelItem.cpp @@ -15,8 +15,8 @@ #include "ThemeMetric.h" #include "HighScore.h" -static CString GRADE_X_NAME( size_t p ) { return ssprintf("GradeP%dX",int(p+1)); } -static CString GRADE_Y_NAME( size_t p ) { return ssprintf("GradeP%dY",int(p+1)); } +static RString GRADE_X_NAME( size_t p ) { return ssprintf("GradeP%dX",int(p+1)); } +static RString GRADE_Y_NAME( size_t p ) { return ssprintf("GradeP%dY",int(p+1)); } static ThemeMetric ICON_X ("MusicWheelItem","IconX"); static ThemeMetric ICON_Y ("MusicWheelItem","IconY"); @@ -34,7 +34,7 @@ static ThemeMetric1D GRADE_X ("MusicWheelItem",GRADE_X_NAME,NUM_PLA static ThemeMetric1D GRADE_Y ("MusicWheelItem",GRADE_Y_NAME,NUM_PLAYERS); -WheelItemData::WheelItemData( WheelItemType wit, Song* pSong, CString sSectionName, Course* pCourse, RageColor color ): +WheelItemData::WheelItemData( WheelItemType wit, Song* pSong, RString sSectionName, Course* pCourse, RageColor color ): WheelItemBaseData(wit, sSectionName, color) { m_pSong = pSong; @@ -42,7 +42,7 @@ WheelItemData::WheelItemData( WheelItemType wit, Song* pSong, CString sSectionNa } -MusicWheelItem::MusicWheelItem( CString sType ): +MusicWheelItem::MusicWheelItem( RString sType ): WheelItemBase( sType ) { data = NULL; @@ -175,7 +175,7 @@ void MusicWheelItem::LoadFromWheelItemData( WheelItemData* pWID, bool bExpanded case TYPE_COURSE: case TYPE_SORT: { - CString sDisplayName, sTranslitName; + RString sDisplayName, sTranslitName; BitmapText *bt = NULL; switch( pWID->m_Type ) { diff --git a/stepmania/src/MusicWheelItem.h b/stepmania/src/MusicWheelItem.h index 8c12a6baf9..a3361f33e5 100644 --- a/stepmania/src/MusicWheelItem.h +++ b/stepmania/src/MusicWheelItem.h @@ -20,7 +20,7 @@ struct WheelItemData; class MusicWheelItem : public WheelItemBase { public: - MusicWheelItem(CString sType = "MusicWheelItem"); + MusicWheelItem(RString sType = "MusicWheelItem"); MusicWheelItem( const MusicWheelItem &cpy ); virtual ~MusicWheelItem(); @@ -47,13 +47,13 @@ private: struct WheelItemData : public WheelItemBaseData { WheelItemData() {} - WheelItemData( WheelItemType wit, Song* pSong, CString sSectionName, Course* pCourse, RageColor color ); + WheelItemData( WheelItemType wit, Song* pSong, RString sSectionName, Course* pCourse, RageColor color ); Course* m_pCourse; Song* m_pSong; // for TYPE_SORT - CString m_sLabel; + RString m_sLabel; GameCommand m_Action; }; diff --git a/stepmania/src/NetworkSyncManager.cpp b/stepmania/src/NetworkSyncManager.cpp index 2ca6f9c4ab..fcf84e8117 100644 --- a/stepmania/src/NetworkSyncManager.cpp +++ b/stepmania/src/NetworkSyncManager.cpp @@ -12,9 +12,9 @@ NetworkSyncManager *NSMAN; NetworkSyncManager::NetworkSyncManager( LoadingWindow *ld ) { useSMserver=false; isSMOnline = false; } NetworkSyncManager::~NetworkSyncManager () { } void NetworkSyncManager::CloseConnection() { } -void NetworkSyncManager::PostStartUp(const CString& ServerIP ) { } -bool NetworkSyncManager::Connect(const CString& addy, unsigned short port) { return false; } -CString NetworkSyncManager::GetServerName() { return CString(); } +void NetworkSyncManager::PostStartUp(const RString& ServerIP ) { } +bool NetworkSyncManager::Connect(const RString& addy, unsigned short port) { return false; } +RString NetworkSyncManager::GetServerName() { return RString(); } void NetworkSyncManager::ReportNSSOnOff(int i) { } void NetworkSyncManager::ReportTiming(float offset, int PlayerNumber) { } void NetworkSyncManager::ReportScore(int playerID, int step, int score, int combo) { } @@ -24,9 +24,9 @@ void NetworkSyncManager::StartRequest(short position) { } void NetworkSyncManager::DisplayStartupStatus() { } void NetworkSyncManager::Update( float fDeltaTime ) { } bool NetworkSyncManager::ChangedScoreboard(int Column) { return false; } -void NetworkSyncManager::SendChat(const CString& message) { } +void NetworkSyncManager::SendChat(const RString& message) { } void NetworkSyncManager::SelectUserSong() { } -CString NetworkSyncManager::MD5Hex( const CString &sInput ) { return CString(); } +RString NetworkSyncManager::MD5Hex( const RString &sInput ) { return RString(); } int NetworkSyncManager::GetSMOnlineSalt() { return 0; } void NetworkSyncManager::GetListOfLANServers( vector& AllServers ) { } #else @@ -123,13 +123,13 @@ void NetworkSyncManager::CloseConnection() NetPlayerClient->close(); } -void NetworkSyncManager::PostStartUp(const CString& ServerIP) +void NetworkSyncManager::PostStartUp(const RString& ServerIP) { - CString sAddress; + RString sAddress; short iPort; size_t cLoc = ServerIP.find( ':' ); - if( ServerIP.find( ':' ) != CString::npos ) + if( ServerIP.find( ':' ) != RString::npos ) { iPort = (short) atoi( ServerIP.substr( cLoc + 1 ).c_str() ); sAddress = ServerIP.substr( 0, cLoc ); @@ -178,7 +178,7 @@ void NetworkSyncManager::PostStartUp(const CString& ServerIP) m_packet.Write1(NETPROTOCOLVERSION); - m_packet.WriteNT(CString(PRODUCT_NAME_VER)); + m_packet.WriteNT(RString(PRODUCT_NAME_VER)); //Block until responce is received //Move mode to blocking in order to give CPU back to the @@ -228,7 +228,7 @@ void NetworkSyncManager::PostStartUp(const CString& ServerIP) void NetworkSyncManager::StartUp() { - CString ServerIP; + RString ServerIP; if( isLanServer ) if (!LANserver->ServerStart()) @@ -253,7 +253,7 @@ void NetworkSyncManager::StartUp() } -bool NetworkSyncManager::Connect(const CString& addy, unsigned short port) +bool NetworkSyncManager::Connect(const RString& addy, unsigned short port) { LOG->Info("Beginning to connect"); @@ -297,7 +297,7 @@ void NetworkSyncManager::ReportNSSOnOff(int i) NetPlayerClient->SendPack((char*)m_packet.Data, m_packet.Position); } -CString NetworkSyncManager::GetServerName() +RString NetworkSyncManager::GetServerName() { return m_ServerName; } @@ -445,7 +445,7 @@ void NetworkSyncManager::StartRequest(short position) if (GAMESTATE->m_pCurCourse != NULL) m_packet.WriteNT(GAMESTATE->m_pCurCourse->GetDisplayFullTitle()); else - m_packet.WriteNT(CString("")); + m_packet.WriteNT(RString("")); //Send Player (and song) Options m_packet.WriteNT(GAMESTATE->m_SongOptions.GetString()); @@ -509,7 +509,7 @@ static LocalizedString CONNECTION_SUCCESSFUL( "NetworkSyncManager", "Connection static LocalizedString CONNECTION_FAILED ( "NetworkSyncManager", "Connection failed." ); void NetworkSyncManager::DisplayStartupStatus() { - CString sMessage(""); + RString sMessage(""); switch (m_startupStatus) { @@ -642,7 +642,7 @@ void NetworkSyncManager::ProcessInput() { //Ease scope int ColumnNumber=m_packet.Read1(); int NumberPlayers=m_packet.Read1(); - CString ColumnData; + RString ColumnData; switch (ColumnNumber) { @@ -686,7 +686,7 @@ void NetworkSyncManager::ProcessInput() break; case NSCSU: //System message from server { - CString SysMSG = m_packet.ReadNT(); + RString SysMSG = m_packet.ReadNT(); SCREENMAN->SystemMessage( SysMSG ); } break; @@ -731,7 +731,7 @@ void NetworkSyncManager::ProcessInput() break; case NSCSMS: { - CString StyleName, GameName; + RString StyleName, GameName; GameName = m_packet.ReadNT(); StyleName = m_packet.ReadNT(); @@ -762,7 +762,7 @@ bool NetworkSyncManager::ChangedScoreboard(int Column) return true; } -void NetworkSyncManager::SendChat(const CString& message) +void NetworkSyncManager::SendChat(const RString& message) { m_packet.ClearPacket(); m_packet.Write1( NSCCM ); @@ -830,10 +830,10 @@ uint32_t PacketFunctions::Read4() return ntohl(Temp); } -CString PacketFunctions::ReadNT() +RString PacketFunctions::ReadNT() { //int Orig=Packet.Position; - CString TempStr; + RString TempStr; while ((Position& AllServers AllServers = m_vAllLANServers; } -static bool ConnectToServer( const CString &t ) +static bool ConnectToServer( const RString &t ) { NSMAN->PostStartUp( t ); NSMAN->DisplayStartupStatus(); return true; } -extern Preference g_sLastServer; +extern Preference g_sLastServer; -LuaFunction( ConnectToServer, ConnectToServer( ( CString(SArg(1)).length()==0 ) ? CString(g_sLastServer) : CString(SArg(1) ) ) ) +LuaFunction( ConnectToServer, ConnectToServer( ( RString(SArg(1)).length()==0 ) ? RString(g_sLastServer) : RString(SArg(1) ) ) ) #endif diff --git a/stepmania/src/NetworkSyncManager.h b/stepmania/src/NetworkSyncManager.h index c7e917f66f..9bc84542d8 100644 --- a/stepmania/src/NetworkSyncManager.h +++ b/stepmania/src/NetworkSyncManager.h @@ -40,7 +40,7 @@ struct EndOfGame_PlayerData int grade; Difficulty difficulty; int tapScores[NETNUMTAPSCORES]; //This will be a const soon enough - CString playerOptions; + RString playerOptions; }; enum NSScoreBoardColumn @@ -54,8 +54,8 @@ enum NSScoreBoardColumn struct NetServerInfo { - CString Name; - CString Address; + RString Name; + RString Address; }; class EzSockets; @@ -73,12 +73,12 @@ public: uint8_t Read1(); uint16_t Read2(); uint32_t Read4(); - CString ReadNT(); + RString ReadNT(); void Write1(uint8_t Data); void Write2(uint16_t Data); void Write4(uint32_t Data); - void WriteNT(const CString& Data); + void WriteNT(const RString& Data); void ClearPacket(); }; @@ -96,14 +96,14 @@ public: void ReportStyle(); //Report to server the style, players, and names void ReportNSSOnOff(int i); //Report song selection screen on/off void StartRequest(short position); //Request a start. Block until granted. - CString GetServerName(); + RString GetServerName(); //SMOnline stuff void SendSMOnline( ); - bool Connect(const CString& addy, unsigned short port); // Connect to SM Server + bool Connect(const RString& addy, unsigned short port); // Connect to SM Server - void PostStartUp(const CString& ServerIP); + void PostStartUp(const RString& ServerIP); void CloseConnection(); @@ -120,30 +120,30 @@ public: vector m_PlayerStatus; int m_ActivePlayers; vector m_ActivePlayer; - vector m_PlayerNames; + vector m_PlayerNames; //Used for ScreenNetEvaluation vector m_EvalPlayerData; //Used togeather for bool ChangedScoreboard(int Column); //If scoreboard changed since this function last called, then true. - CString m_Scoreboard[NUM_NSSB_CATEGORIES]; + RString m_Scoreboard[NUM_NSSB_CATEGORIES]; //Used for chatting - void SendChat(const CString& message); - CString m_WaitingChat; + void SendChat(const RString& message); + RString m_WaitingChat; //Used for options void ReportPlayerOptions(); //Used for song checking/changing - CString m_sMainTitle; - CString m_sArtist; - CString m_sSubTitle; + RString m_sMainTitle; + RString m_sArtist; + RString m_sSubTitle; int m_iSelectMode; void SelectUserSong(); - CString m_sChatText; + RString m_sChatText; PacketFunctions m_SMOnlinePacket; @@ -152,7 +152,7 @@ public: int GetSMOnlineSalt(); - CString MD5Hex( const CString &sInput ); + RString MD5Hex( const RString &sInput ); void GetListOfLANServers( vector< NetServerInfo > & AllServers ); private: @@ -175,7 +175,7 @@ private: bool m_scoreboardchange[NUM_NSSB_CATEGORIES]; - CString m_ServerName; + RString m_ServerName; EzSockets *NetPlayerClient; EzSockets *BroadcastReception; diff --git a/stepmania/src/NetworkSyncServer.cpp b/stepmania/src/NetworkSyncServer.cpp index 1b13f297a2..4ca5061346 100644 --- a/stepmania/src/NetworkSyncServer.cpp +++ b/stepmania/src/NetworkSyncServer.cpp @@ -210,7 +210,7 @@ void StepManiaLanServer::ParseData(PacketFunctions& Packet, const unsigned int c void StepManiaLanServer::Hello(PacketFunctions& Packet, const unsigned int clientNum) { int ClientVersion = Packet.Read1(); - CString build = Packet.ReadNT(); + RString build = Packet.ReadNT(); Client[clientNum]->SetClientVersion(ClientVersion, build); @@ -238,7 +238,7 @@ void GameClient::StyleUpdate(PacketFunctions& Packet) } } -void GameClient::SetClientVersion(int ver, const CString& b) +void GameClient::SetClientVersion(int ver, const RString& b) { version = ver; build = b; @@ -602,10 +602,10 @@ void StepManiaLanServer::SendValue(uint8_t value, const unsigned int clientNum) void StepManiaLanServer::AnalizeChat(PacketFunctions &Packet, const unsigned int clientNum) { - CString message = Packet.ReadNT(); + RString message = Packet.ReadNT(); if (message.at(0) == '/') { - CString command = message.substr(1, message.find(" ")-1); + RString command = message.substr(1, message.find(" ")-1); if ((command.compare("list") == 0)||(command.compare("have") == 0)) { if (command.compare("list") == 0) @@ -635,12 +635,12 @@ void StepManiaLanServer::AnalizeChat(PacketFunctions &Packet, const unsigned int ForceStart(); if (command.compare("kick") == 0) { - CString name = message.substr(message.find(" ")+1); + RString name = message.substr(message.find(" ")+1); Kick(name); } if (command.compare("ban") == 0) { - CString name = message.substr(message.find(" ")+1); + RString name = message.substr(message.find(" ")+1); Ban(name); } } @@ -657,10 +657,10 @@ void StepManiaLanServer::AnalizeChat(PacketFunctions &Packet, const unsigned int RelayChat(message, clientNum); } -void StepManiaLanServer::RelayChat(CString &passedmessage, const unsigned int clientNum) +void StepManiaLanServer::RelayChat(RString &passedmessage, const unsigned int clientNum) { Reply.ClearPacket(); - CString message = ""; + RString message = ""; message += Client[clientNum]->Player[0].name; @@ -680,7 +680,7 @@ void StepManiaLanServer::RelayChat(CString &passedmessage, const unsigned int cl void StepManiaLanServer::SelectSong(PacketFunctions& Packet, unsigned int clientNum) { int use = Packet.Read1(); - CString message; + RString message; if (use == 2) { @@ -807,9 +807,9 @@ void StepManiaLanServer::SendToAllClients(PacketFunctions& Packet) SendNetPacket(x, Packet); } -void StepManiaLanServer::ServerChat(const CString& message) +void StepManiaLanServer::ServerChat(const RString& message) { - CString x = servername + ": " + message; + RString x = servername + ": " + message; Reply.ClearPacket(); Reply.Write1(NSCCM + NSServerOffset); Reply.WriteNT(x); @@ -853,7 +853,7 @@ void StepManiaLanServer::SendUserList() void StepManiaLanServer::ScreenNetMusicSelectStatus(PacketFunctions& Packet, unsigned int clientNum) { - CString message = ""; + RString message = ""; int EntExitCode = Packet.Read1(); message += Client[clientNum]->Player[0].name; @@ -897,9 +897,9 @@ void StepManiaLanServer::ScreenNetMusicSelectStatus(PacketFunctions& Packet, uns SendUserList (); } -CString StepManiaLanServer::ListPlayers() +RString StepManiaLanServer::ListPlayers() { - CString list= "Player List:\n"; + RString list= "Player List:\n"; for (unsigned int x = 0; x < Client.size(); ++x) if (Client[x]->inNetMusicSelect) for (int y = 0; y < 2; ++y) @@ -908,7 +908,7 @@ CString StepManiaLanServer::ListPlayers() return list; } -void StepManiaLanServer::Kick(CString &name) +void StepManiaLanServer::Kick(RString &name) { bool kicked = false; for (unsigned int x = 0; x < Client.size(); ++x) @@ -921,7 +921,7 @@ void StepManiaLanServer::Kick(CString &name) } } -void StepManiaLanServer::Ban(CString &name) +void StepManiaLanServer::Ban(RString &name) { bool kicked = false; for (unsigned int x = 0; x < Client.size(); ++x) @@ -935,7 +935,7 @@ void StepManiaLanServer::Ban(CString &name) } } -bool StepManiaLanServer::IsBanned(CString &ip) +bool StepManiaLanServer::IsBanned(RString &ip) { for (unsigned int x = 0; x < bannedIPs.size(); ++x) if (ip == bannedIPs[x]) diff --git a/stepmania/src/NetworkSyncServer.h b/stepmania/src/NetworkSyncServer.h index af2acc6707..d0347a3946 100644 --- a/stepmania/src/NetworkSyncServer.h +++ b/stepmania/src/NetworkSyncServer.h @@ -10,7 +10,7 @@ class LanPlayer { public: - CString name; + RString name; long score; int health; int feet; @@ -23,17 +23,17 @@ public: double offset; int PlayerID; int diff; - CString options; + RString options; LanPlayer(); }; class GameInfo { public: - CString title; - CString subtitle; - CString artist; - CString course; + RString title; + RString subtitle; + RString artist; + RString course; }; class GameClient @@ -42,7 +42,7 @@ public: bool GotStartRequest; EzSockets clientSocket; void UpdateStats(PacketFunctions &Packet); - void SetClientVersion(int ver, const CString& b); + void SetClientVersion(int ver, const RString& b); void StartRequest(PacketFunctions &Packet); int GetData(PacketFunctions &Packet); GameClient(); @@ -82,8 +82,8 @@ public: void ServerUpdate(); StepManiaLanServer(); ~StepManiaLanServer(); - CString servername; - CString lastError; + RString servername; + RString lastError; int lastErrorCode; private: @@ -100,7 +100,7 @@ private: GameInfo CurrentSongInfo; GameInfo LastSongInfo; bool SecondSameSelect; - vector bannedIPs; + vector bannedIPs; void Hello(PacketFunctions& Packet, const unsigned int clientNum); void UpdateClients(); @@ -115,9 +115,9 @@ private: void StatsNameColumn(PacketFunctions& data, vector &playresPtr); void SendNetPacket(const unsigned int clientNum, PacketFunctions &Packet); int SortStats(vector &playresPtr); - void RelayChat(CString &passedmessage, const unsigned int clientNum); + void RelayChat(RString &passedmessage, const unsigned int clientNum); void SelectSong(PacketFunctions& Packet, const unsigned int clientNum); - void ServerChat(const CString& message); + void ServerChat(const RString& message); void SendToAllClients(PacketFunctions& Packet); bool CheckHasSongState(); void ClearHasSong(); @@ -126,10 +126,10 @@ private: void GameOver(PacketFunctions& Packet, const unsigned int clientNum); void ScreenNetMusicSelectStatus(PacketFunctions& Packet, const unsigned int clientNum); void AnalizeChat(PacketFunctions &Packet, const unsigned int clientNum); - CString StepManiaLanServer::ListPlayers(); - void Kick(CString &name); - void Ban(CString &name); - bool IsBanned(CString &ip); + RString StepManiaLanServer::ListPlayers(); + void Kick(RString &name); + void Ban(RString &name); + bool IsBanned(RString &ip); void ForceStart(); void CheckLowerJudge(const unsigned int clientNum); bool CheckConnection(const unsigned int clientNum); diff --git a/stepmania/src/NoteDataUtil.cpp b/stepmania/src/NoteDataUtil.cpp index 81b75e1316..3fadfc650e 100644 --- a/stepmania/src/NoteDataUtil.cpp +++ b/stepmania/src/NoteDataUtil.cpp @@ -46,7 +46,7 @@ NoteType NoteDataUtil::GetSmallestNoteTypeForMeasure( const NoteData &n, int iMe return nt; } -void NoteDataUtil::LoadFromSMNoteDataString( NoteData &out, CString sSMNoteData ) +void NoteDataUtil::LoadFromSMNoteDataString( NoteData &out, RString sSMNoteData ) { // // Load note data @@ -68,20 +68,20 @@ void NoteDataUtil::LoadFromSMNoteDataString( NoteData &out, CString sSMNoteData sSMNoteData.erase( iIndexCommentStart, iIndexCommentEnd-iIndexCommentStart ); } - vector asMeasures; + vector asMeasures; split( sSMNoteData, ",", asMeasures, true ); // ignore empty is important for( unsigned m=0; m asMeasureLines; + vector asMeasureLines; split( sMeasureString, "\n", asMeasureLines, true ); // ignore empty is important for( unsigned l=0; lGetMetricB(sButton,"DrawHoldHeadForTapsOnSameRow"); FOREACH_NotePart( p ) { - const CString s = NotePartToString(p); + const RString s = NotePartToString(p); m_fAnimationLengthInBeats[p] = NOTESKIN->GetMetricF(sButton,s+"AnimationLengthInBeats"); m_bAnimationIsVivid[p] = NOTESKIN->GetMetricB(sButton,s+"AnimationIsVivid"); m_fNoteColorTextureCoordSpacing[p].x = NOTESKIN->GetMetricF(sButton,s+"NoteColorTextureCoordSpacingX"); @@ -79,9 +79,9 @@ void NoteMetricCache_t::Load( const CString &sButton ) struct NoteSkinAndPath { - NoteSkinAndPath( const CString sNoteSkin_, const CString sPath_ ) { sNoteSkin = sNoteSkin_; sPath = sPath_; } - CString sNoteSkin; - CString sPath; + NoteSkinAndPath( const RString sNoteSkin_, const RString sPath_ ) { sNoteSkin = sNoteSkin_; sPath = sPath_; } + RString sNoteSkin; + RString sPath; bool operator<( const NoteSkinAndPath &other ) const { int cmp = strcmp(sNoteSkin, other.sNoteSkin); @@ -114,9 +114,9 @@ struct NoteResource static map g_NoteResource; -static NoteResource *MakeNoteResource( const CString &sButton, const CString &sElement, bool bSpriteOnly ) +static NoteResource *MakeNoteResource( const RString &sButton, const RString &sElement, bool bSpriteOnly ) { - CString sElementAndType = sElement; + RString sElementAndType = sElement; NoteSkinAndPath nsap( NOTESKIN->GetCurrentNoteSkin(), NOTESKIN->GetPath(sButton, sElementAndType) ); map::iterator it = g_NoteResource.find( nsap ); @@ -176,13 +176,13 @@ static void DeleteNoteResource( const Actor *pActor ) delete pRes; } -Actor *MakeRefcountedActor( const CString &sButton, const CString &sElement ) +Actor *MakeRefcountedActor( const RString &sButton, const RString &sElement ) { NoteResource *pRes = MakeNoteResource( sButton, sElement, false ); return pRes->m_pActor; } -Sprite *MakeRefcountedSprite( const CString &sButton, const CString &sElement ) +Sprite *MakeRefcountedSprite( const RString &sButton, const RString &sElement ) { NoteResource *pRes = MakeNoteResource( sButton, sElement, true ); return (Sprite *) pRes->m_pActor; /* XXX ick */ @@ -199,7 +199,7 @@ NoteColorActor::~NoteColorActor() DeleteNoteResource( m_p ); } -void NoteColorActor::Load( const CString &sButton, const CString &sElement ) +void NoteColorActor::Load( const RString &sButton, const RString &sElement ) { m_p = MakeRefcountedActor( sButton, sElement ); } @@ -216,7 +216,7 @@ NoteColorSprite::~NoteColorSprite() DeleteNoteResource( m_p ); } -void NoteColorSprite::Load( const CString &sButton, const CString &sElement ) +void NoteColorSprite::Load( const RString &sButton, const RString &sElement ) { m_p = MakeRefcountedSprite( sButton, sElement ); } @@ -251,7 +251,7 @@ void NoteDisplay::Load( int iColNum, const PlayerState* pPlayerState, float fYRe m_pPlayerState = pPlayerState; m_fYReverseOffsetPixels = fYReverseOffsetPixels; - const CString &sButton = GAMESTATE->GetCurrentGame()->ColToButtonName( iColNum ); + const RString &sButton = GAMESTATE->GetCurrentGame()->ColToButtonName( iColNum ); cache->Load( sButton ); diff --git a/stepmania/src/NoteDisplay.h b/stepmania/src/NoteDisplay.h index 68bc23e577..1e20c84618 100644 --- a/stepmania/src/NoteDisplay.h +++ b/stepmania/src/NoteDisplay.h @@ -28,7 +28,7 @@ struct NoteColorActor { NoteColorActor(); ~NoteColorActor(); - void Load( const CString &sButton, const CString &sElement ); + void Load( const RString &sButton, const RString &sElement ); Actor* Get() { return m_p; } private: Actor* m_p; @@ -38,7 +38,7 @@ struct NoteColorSprite { NoteColorSprite(); ~NoteColorSprite(); - void Load( const CString &sButton, const CString &sElement ); + void Load( const RString &sButton, const RString &sElement ); Sprite* Get() { return m_p; } private: Sprite* m_p; @@ -51,7 +51,7 @@ enum HoldType NUM_HOLD_TYPES }; #define FOREACH_HoldType( i ) FOREACH_ENUM( HoldType, NUM_HOLD_TYPES, i ) -const CString &HoldTypeToString( HoldType ht ); +const RString &HoldTypeToString( HoldType ht ); enum ActiveType { @@ -60,7 +60,7 @@ enum ActiveType NUM_ACTIVE_TYPES }; #define FOREACH_ActiveType( i ) FOREACH_ENUM( ActiveType, NUM_ACTIVE_TYPES, i ) -const CString &ActiveTypeToString( ActiveType at ); +const RString &ActiveTypeToString( ActiveType at ); class NoteDisplay diff --git a/stepmania/src/NoteField.cpp b/stepmania/src/NoteField.cpp index 548fe0895b..86eccf7190 100644 --- a/stepmania/src/NoteField.cpp +++ b/stepmania/src/NoteField.cpp @@ -48,16 +48,16 @@ NoteField::~NoteField() void NoteField::Unload() { - for( map::iterator it = m_NoteDisplays.begin(); + for( map::iterator it = m_NoteDisplays.begin(); it != m_NoteDisplays.end(); ++it ) delete it->second; m_NoteDisplays.clear(); m_pCurDisplay = NULL; } -void NoteField::CacheNoteSkin( const CString &sNoteSkin_ ) +void NoteField::CacheNoteSkin( const RString &sNoteSkin_ ) { - CString sNoteSkin = sNoteSkin_; + RString sNoteSkin = sNoteSkin_; sNoteSkin.ToLower(); if( m_NoteDisplays.find(sNoteSkin) != m_NoteDisplays.end() ) @@ -79,11 +79,11 @@ void NoteField::CacheAllUsedNoteSkins() { /* Cache all note skins that we might need for the whole song, course or battle * play, so we don't have to load them later (such as between course songs). */ - vector skins; + vector skins; GAMESTATE->GetAllUsedNoteSkins( skins ); for( unsigned i=0; i < skins.size(); ++i ) CacheNoteSkin( skins[i] ); - CString sNoteSkin = m_pPlayerState->m_PlayerOptions.m_sNoteSkin; + RString sNoteSkin = m_pPlayerState->m_PlayerOptions.m_sNoteSkin; CacheNoteSkin( sNoteSkin ); } @@ -112,7 +112,7 @@ void NoteField::Load( ssprintf("%d = %d",m_pNoteData->GetNumTracks(), GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer) ); // The note skin may have changed at the beginning of a new course song. - map::iterator it = m_NoteDisplays.find( m_pPlayerState->m_PlayerOptions.m_sNoteSkin ); + map::iterator it = m_NoteDisplays.find( m_pPlayerState->m_PlayerOptions.m_sNoteSkin ); ASSERT_M( it != m_NoteDisplays.end(), m_pPlayerState->m_PlayerOptions.m_sNoteSkin ); m_pCurDisplay = it->second; } @@ -293,7 +293,7 @@ void NoteField::DrawAttackText( const float fBeat, const Attack &attack ) m_textMeasureNumber.Draw(); } -void NoteField::DrawBGChangeText( const float fBeat, const CString sNewBGName ) +void NoteField::DrawBGChangeText( const float fBeat, const RString sNewBGName ) { const float fYOffset = ArrowEffects::GetYOffset( m_pPlayerState, 0, fBeat ); const float fYPos = ArrowEffects::GetYPos( m_pPlayerState, 0, fYOffset, m_fYReverseOffsetPixels ); @@ -550,12 +550,12 @@ void NoteField::DrawPrimitives() if( IS_ON_SCREEN(fLowestBeat) ) { - vector vsBGChanges; + vector vsBGChanges; FOREACH_CONST( BackgroundLayer, viLowestIndex, i ) { ASSERT( iter[*i] != GAMESTATE->m_pCurSong->GetBackgroundChanges(*i).end() ); const BackgroundChange& change = *iter[*i]; - CString s = change.GetTextDescription(); + RString s = change.GetTextDescription(); if( *i!=0 ) s = ssprintf("%d: ",*i) + s; vsBGChanges.push_back( s ); diff --git a/stepmania/src/NoteField.h b/stepmania/src/NoteField.h index 56a718f5dd..3cf91e85f8 100644 --- a/stepmania/src/NoteField.h +++ b/stepmania/src/NoteField.h @@ -31,7 +31,7 @@ public: int m_iBeginMarker, m_iEndMarker; // only used with MODE_EDIT void FadeToFail(); - void CacheNoteSkin( const CString &sNoteSkin ); + void CacheNoteSkin( const RString &sNoteSkin ); void Step( int iCol, TapNoteScore score ); void SetPressed( int iCol ); @@ -51,7 +51,7 @@ protected: void DrawBPMText( const float fBeat, const float fBPM ); void DrawFreezeText( const float fBeat, const float fBPM ); void DrawAttackText( const float fBeat, const Attack &attack ); - void DrawBGChangeText( const float fBeat, const CString sNewBGName ); + void DrawBGChangeText( const float fBeat, const RString sNewBGName ); float GetWidth(); const NoteData *m_pNoteData; @@ -74,7 +74,7 @@ protected: }; /* All loaded note displays, mapped by their name. */ - map m_NoteDisplays; + map m_NoteDisplays; NoteDisplayCols *m_pCurDisplay; // used in MODE_EDIT diff --git a/stepmania/src/NoteSkinManager.cpp b/stepmania/src/NoteSkinManager.cpp index 61d2970002..11edea975d 100644 --- a/stepmania/src/NoteSkinManager.cpp +++ b/stepmania/src/NoteSkinManager.cpp @@ -16,10 +16,10 @@ NoteSkinManager* NOTESKIN = NULL; // global object accessable from anywhere in the program -const CString NOTESKINS_DIR = "NoteSkins/"; -const CString GAME_BASE_NOTESKIN_NAME = "default"; -const CString GLOBAL_BASE_NOTESKIN_DIR = NOTESKINS_DIR + "common/default/"; -static map g_PathCache; +const RString NOTESKINS_DIR = "NoteSkins/"; +const RString GAME_BASE_NOTESKIN_NAME = "default"; +const RString GLOBAL_BASE_NOTESKIN_DIR = NOTESKINS_DIR + "common/default/"; +static map g_PathCache; NoteSkinManager::NoteSkinManager() { @@ -39,8 +39,8 @@ void NoteSkinManager::RefreshNoteSkinData( const Game* pGame ) // clear path cache g_PathCache.clear(); - CString sBaseSkinFolder = NOTESKINS_DIR + pGame->m_szName + "/"; - vector asNoteSkinNames; + RString sBaseSkinFolder = NOTESKINS_DIR + pGame->m_szName + "/"; + vector asNoteSkinNames; GetDirListing( sBaseSkinFolder + "*", asNoteSkinNames, true ); StripCvs( asNoteSkinNames ); @@ -48,14 +48,14 @@ void NoteSkinManager::RefreshNoteSkinData( const Game* pGame ) m_mapNameToData.clear(); for( unsigned j=0; j &AddTo ) +void NoteSkinManager::GetNoteSkinNames( vector &AddTo ) { GetNoteSkinNames( GAMESTATE->m_pCurGame, AddTo ); } -void NoteSkinManager::GetNoteSkinNames( const Game* pGame, vector &AddTo, bool bFilterDefault ) +void NoteSkinManager::GetNoteSkinNames( const Game* pGame, vector &AddTo, bool bFilterDefault ) { if( pGame == m_pCurGame ) { /* Faster: */ - for( map::const_iterator iter = m_mapNameToData.begin(); + for( map::const_iterator iter = m_mapNameToData.begin(); iter != m_mapNameToData.end(); ++iter ) { AddTo.push_back( iter->second.sName ); @@ -114,14 +114,14 @@ void NoteSkinManager::GetNoteSkinNames( const Game* pGame, vector &AddT } else { - CString sBaseSkinFolder = NOTESKINS_DIR + pGame->m_szName + "/"; + RString sBaseSkinFolder = NOTESKINS_DIR + pGame->m_szName + "/"; GetDirListing( sBaseSkinFolder + "*", AddTo, true ); StripCvs( AddTo ); } /* Move "default" to the front if it exists. */ { - vector::iterator iter = find( AddTo.begin(), AddTo.end(), "default" ); + vector::iterator iter = find( AddTo.begin(), AddTo.end(), "default" ); if( iter != AddTo.end() ) { AddTo.erase( iter ); @@ -132,9 +132,9 @@ void NoteSkinManager::GetNoteSkinNames( const Game* pGame, vector &AddT } -bool NoteSkinManager::DoesNoteSkinExist( const CString &sSkinName ) +bool NoteSkinManager::DoesNoteSkinExist( const RString &sSkinName ) { - vector asSkinNames; + vector asSkinNames; GetNoteSkinNames( asSkinNames ); for( unsigned i=0; im_szName; + RString sGame = m_pCurGame->m_szName; return NOTESKINS_DIR + sGame + "/" + sSkinName + "/"; } -CString NoteSkinManager::GetMetric( const CString &sButtonName, const CString &sValue ) +RString NoteSkinManager::GetMetric( const RString &sButtonName, const RString &sValue ) { ASSERT( !m_sCurrentNoteSkin.empty() ); - CString sNoteSkinName = m_sCurrentNoteSkin; + RString sNoteSkinName = m_sCurrentNoteSkin; sNoteSkinName.MakeLower(); - map::const_iterator it = m_mapNameToData.find(sNoteSkinName); + map::const_iterator it = m_mapNameToData.find(sNoteSkinName); ASSERT_M( it != m_mapNameToData.end(), sNoteSkinName ); // this NoteSkin doesn't exist! const NoteSkinData& data = it->second; - CString sReturn; + RString sReturn; if( data.metrics.GetValue( sButtonName, sValue, sReturn ) ) return sReturn; if( !data.metrics.GetValue( "NoteDisplay", sValue, sReturn ) ) { - CString sError = ssprintf( + RString sError = ssprintf( "Could not read metric '[%s] %s' or '[NoteDisplay] %s' in '%s'", sButtonName.c_str(), sValue.c_str(), sValue.c_str(), sNoteSkinName.c_str() ); RageException::Throw( sError ); @@ -171,40 +171,40 @@ CString NoteSkinManager::GetMetric( const CString &sButtonName, const CString &s return sReturn; } -int NoteSkinManager::GetMetricI( const CString &sButtonName, const CString &sValueName ) +int NoteSkinManager::GetMetricI( const RString &sButtonName, const RString &sValueName ) { return atoi( GetMetric(sButtonName,sValueName) ); } -float NoteSkinManager::GetMetricF( const CString &sButtonName, const CString &sValueName ) +float NoteSkinManager::GetMetricF( const RString &sButtonName, const RString &sValueName ) { return strtof( GetMetric(sButtonName,sValueName), NULL ); } -bool NoteSkinManager::GetMetricB( const CString &sButtonName, const CString &sValueName ) +bool NoteSkinManager::GetMetricB( const RString &sButtonName, const RString &sValueName ) { return atoi( GetMetric(sButtonName,sValueName) ) != 0; } -apActorCommands NoteSkinManager::GetMetricA( const CString &sButtonName, const CString &sValueName ) +apActorCommands NoteSkinManager::GetMetricA( const RString &sButtonName, const RString &sValueName ) { return apActorCommands( new ActorCommands( GetMetric(sButtonName,sValueName) ) ); } -CString NoteSkinManager::GetPath( const CString &sButtonName, const CString &sElement ) +RString NoteSkinManager::GetPath( const RString &sButtonName, const RString &sElement ) { try_again: - const CString CacheString = m_sCurrentNoteSkin + "/" + sButtonName + "/" + sElement; - map::iterator it = g_PathCache.find( CacheString ); + const RString CacheString = m_sCurrentNoteSkin + "/" + sButtonName + "/" + sElement; + map::iterator it = g_PathCache.find( CacheString ); if( it != g_PathCache.end() ) return it->second; - map::const_iterator iter = m_mapNameToData.find( m_sCurrentNoteSkin ); + map::const_iterator iter = m_mapNameToData.find( m_sCurrentNoteSkin ); ASSERT( iter != m_mapNameToData.end() ); const NoteSkinData &data = iter->second; - CString sPath; // fill this in below - FOREACHD_CONST( CString, data.vsDirSearchOrder, iter ) + RString sPath; // fill this in below + FOREACHD_CONST( RString, data.vsDirSearchOrder, iter ) { if( sButtonName.empty() ) sPath = GetPathFromDirAndFile( *iter, sElement ); @@ -218,7 +218,7 @@ try_again: if( sPath.empty() ) { - CString message = ssprintf( + RString message = ssprintf( "The NoteSkin element '%s %s' could not be found in '%s', '%s', or '%s'.", sButtonName.c_str(), sElement.c_str(), GetNoteSkinDir(m_sCurrentNoteSkin).c_str(), @@ -241,11 +241,11 @@ try_again: iLevel++; ASSERT_M( iLevel < 100, ssprintf("Infinite recursion while looking up %s - %s", sButtonName.c_str(), sElement.c_str()) ); - CString sNewFileName; + RString sNewFileName; GetFileContents( sPath, sNewFileName, true ); - CString sRealPath; + RString sRealPath; - FOREACHD_CONST( CString, data.vsDirSearchOrder, iter ) + FOREACHD_CONST( RString, data.vsDirSearchOrder, iter ) { sRealPath = GetPathFromDirAndFile( *iter, sNewFileName ); if( !sRealPath.empty() ) @@ -254,7 +254,7 @@ try_again: if( sRealPath == "" ) { - CString message = ssprintf( + RString message = ssprintf( "NoteSkinManager: The redirect '%s' points to the file '%s', which does not exist. " "Verify that this redirect is correct.", sPath.c_str(), sNewFileName.c_str()); @@ -276,18 +276,18 @@ try_again: return sPath; } -CString NoteSkinManager::GetPathFromDirAndFile( const CString &sDir, const CString &sFileName ) +RString NoteSkinManager::GetPathFromDirAndFile( const RString &sDir, const RString &sFileName ) { - vector matches; // fill this with the possible files + vector matches; // fill this with the possible files GetDirListing( sDir+sFileName+"*", matches, false, true ); if( matches.empty() ) - return CString(); + return RString(); if( matches.size() > 1 ) { - CString sError = "Multiple files match '"+sDir+sFileName+"'. Please remove all but one of these files."; + RString sError = "Multiple files match '"+sDir+sFileName+"'. Please remove all but one of these files."; Dialog::OK( sError ); } diff --git a/stepmania/src/NoteSkinManager.h b/stepmania/src/NoteSkinManager.h index a53b35c095..142a6d245a 100644 --- a/stepmania/src/NoteSkinManager.h +++ b/stepmania/src/NoteSkinManager.h @@ -19,40 +19,40 @@ public: ~NoteSkinManager(); void RefreshNoteSkinData( const Game* game ); - void GetNoteSkinNames( const Game* game, vector &AddTo, bool bFilterDefault=true ); - void GetNoteSkinNames( vector &AddTo ); // looks up current const Game* in GAMESTATE - bool DoesNoteSkinExist( const CString &sNoteSkin ); // looks up current const Game* in GAMESTATE + void GetNoteSkinNames( const Game* game, vector &AddTo, bool bFilterDefault=true ); + void GetNoteSkinNames( vector &AddTo ); // looks up current const Game* in GAMESTATE + bool DoesNoteSkinExist( const RString &sNoteSkin ); // looks up current const Game* in GAMESTATE - void SetCurrentNoteSkin( const CString &sNoteSkin ) { m_sCurrentNoteSkin = sNoteSkin; } - const CString &GetCurrentNoteSkin() { return m_sCurrentNoteSkin; } + void SetCurrentNoteSkin( const RString &sNoteSkin ) { m_sCurrentNoteSkin = sNoteSkin; } + const RString &GetCurrentNoteSkin() { return m_sCurrentNoteSkin; } - CString GetPath( const CString &sButtonName, const CString &sElement ); + RString GetPath( const RString &sButtonName, const RString &sElement ); - CString GetMetric( const CString &sButtonName, const CString &sValue ); - int GetMetricI( const CString &sButtonName, const CString &sValueName ); - float GetMetricF( const CString &sButtonName, const CString &sValueName ); - bool GetMetricB( const CString &sButtonName, const CString &sValueName ); - apActorCommands GetMetricA( const CString &sButtonName, const CString &sValueName ); + RString GetMetric( const RString &sButtonName, const RString &sValue ); + int GetMetricI( const RString &sButtonName, const RString &sValueName ); + float GetMetricF( const RString &sButtonName, const RString &sValueName ); + bool GetMetricB( const RString &sButtonName, const RString &sValueName ); + apActorCommands GetMetricA( const RString &sButtonName, const RString &sValueName ); // Lua void PushSelf( lua_State *L ); protected: - CString GetNoteSkinDir( const CString &sSkinName ); - CString GetPathFromDirAndFile( const CString &sDir, const CString &sFileName ); + RString GetNoteSkinDir( const RString &sSkinName ); + RString GetPathFromDirAndFile( const RString &sDir, const RString &sFileName ); struct NoteSkinData { - CString sName; + RString sName; IniFile metrics; // When looking for an element, search these dirs from head to tail. - deque vsDirSearchOrder; + deque vsDirSearchOrder; }; - void LoadNoteSkinData( const CString &sNoteSkinName, NoteSkinData& data_out ); - void LoadNoteSkinDataRecursive( const CString &sNoteSkinName, NoteSkinData& data_out ); - CString m_sCurrentNoteSkin; - map m_mapNameToData; + void LoadNoteSkinData( const RString &sNoteSkinName, NoteSkinData& data_out ); + void LoadNoteSkinDataRecursive( const RString &sNoteSkinName, NoteSkinData& data_out ); + RString m_sCurrentNoteSkin; + map m_mapNameToData; const Game* m_pCurGame; }; @@ -63,8 +63,8 @@ extern NoteSkinManager* NOTESKIN; // global and accessable from anywhere in our class LockNoteSkin { public: - LockNoteSkin( const CString &sNoteSkin ) { ASSERT( NOTESKIN->GetCurrentNoteSkin().empty() ); NOTESKIN->SetCurrentNoteSkin( sNoteSkin ); } - ~LockNoteSkin() { NOTESKIN->SetCurrentNoteSkin( CString() ); } + LockNoteSkin( const RString &sNoteSkin ) { ASSERT( NOTESKIN->GetCurrentNoteSkin().empty() ); NOTESKIN->SetCurrentNoteSkin( sNoteSkin ); } + ~LockNoteSkin() { NOTESKIN->SetCurrentNoteSkin( RString() ); } }; diff --git a/stepmania/src/NoteTypes.h b/stepmania/src/NoteTypes.h index 98334c92b3..9d5fa404a2 100644 --- a/stepmania/src/NoteTypes.h +++ b/stepmania/src/NoteTypes.h @@ -95,7 +95,7 @@ struct TapNote } source; // Only valid if type == attack. - CString sAttackModifiers; + RString sAttackModifiers; float fAttackDurationSeconds; bool bKeysound; // true if this note plays a keysound when hit @@ -122,7 +122,7 @@ struct TapNote Type type_, SubType subType_, Source source_, - CString sAttackModifiers_, + RString sAttackModifiers_, float fAttackDurationSeconds_, bool bKeysound_, int iKeysoundIndex_ ) @@ -196,7 +196,7 @@ enum NoteType NUM_NOTE_TYPES, NOTE_TYPE_INVALID }; -const CString& NoteTypeToString( NoteType nt ); +const RString& NoteTypeToString( NoteType nt ); float NoteTypeToBeat( NoteType nt ); NoteType GetNoteType( int row ); NoteType BeatToNoteType( float fBeat ); diff --git a/stepmania/src/NotesLoader.cpp b/stepmania/src/NotesLoader.cpp index 2306bf426d..c87f876641 100644 --- a/stepmania/src/NotesLoader.cpp +++ b/stepmania/src/NotesLoader.cpp @@ -3,16 +3,16 @@ #include "NoteTypes.h" #include "GameManager.h" -bool NotesLoader::Loadable( CString sPath ) +bool NotesLoader::Loadable( RString sPath ) { - vector list; + vector list; GetApplicableFiles( sPath, list ); return !list.empty(); } -void NotesLoader::GetMainAndSubTitlesFromFullTitle( const CString sFullTitle, CString &sMainTitleOut, CString &sSubTitleOut ) +void NotesLoader::GetMainAndSubTitlesFromFullTitle( const RString sFullTitle, RString &sMainTitleOut, RString &sSubTitleOut ) { - const CString sLeftSeps[] = { " -", " ~", " (", " [", "\t" }; + const RString sLeftSeps[] = { " -", " ~", " (", " [", "\t" }; for( unsigned i=0; i &out )=0; + virtual void GetApplicableFiles( RString sPath, vector &out )=0; set BlacklistedImages; public: virtual ~NotesLoader() { } const set &GetBlacklistedImages() const { return BlacklistedImages; } - static void GetMainAndSubTitlesFromFullTitle( const CString sFullTitle, CString &sMainTitleOut, CString &sSubTitleOut ); - virtual bool LoadFromDir( CString sPath, Song &out ) = 0; + static void GetMainAndSubTitlesFromFullTitle( const RString sFullTitle, RString &sMainTitleOut, RString &sSubTitleOut ); + virtual bool LoadFromDir( RString sPath, Song &out ) = 0; virtual void TidyUpData( Song &song, bool cache ) { } - bool Loadable( CString sPath ); + bool Loadable( RString sPath ); }; #endif diff --git a/stepmania/src/NotesLoaderBMS.cpp b/stepmania/src/NotesLoaderBMS.cpp index c5ec8d29ed..645ba05eb9 100644 --- a/stepmania/src/NotesLoaderBMS.cpp +++ b/stepmania/src/NotesLoaderBMS.cpp @@ -119,7 +119,7 @@ static bool ConvertRawTrackToTapNote( int iRawTrack, BmsTrack &bmsTrackOut, bool } // Find the largest common substring at the start of both strings. -static CString FindLargestInitialSubstring( CString string1, CString string2 ) +static RString FindLargestInitialSubstring( RString string1, RString string2 ) { // First see if the whole first string matches an appropriately-sized // substring of the second, then keep chopping off the last character of @@ -228,7 +228,7 @@ int BMSLoader::GetMeasureStartRow( const MeasureToTimeSig_t &sigs, int iMeasureN } -void BMSLoader::SearchForDifficulty( CString sTag, Steps *pOut ) +void BMSLoader::SearchForDifficulty( RString sTag, Steps *pOut ) { sTag.ToLower(); @@ -250,7 +250,7 @@ void BMSLoader::SearchForDifficulty( CString sTag, Steps *pOut ) LOG->Trace( "Tag \"%s\" is %s", sTag.c_str(), DifficultyToString(pOut->GetDifficulty()).c_str() ); } -bool BMSLoader::LoadFromBMSFile( const CString &sPath, const NameToData_t &mapNameToData, Steps &out ) +bool BMSLoader::LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameToData, Steps &out ) { LOG->Trace( "Steps::LoadFromBMSFile( '%s' )", sPath.c_str() ); @@ -258,7 +258,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, const NameToData_t &mapNa // BMS player code. Fill in below and use to determine StepsType. int iPlayer = -1; - CString sData; + RString sData; if( GetTagFromMap( mapNameToData, "#player", sData ) ) iPlayer = atoi(sData); if( GetTagFromMap( mapNameToData, "#playlevel", sData ) ) @@ -290,7 +290,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, const NameToData_t &mapNa NameToData_t::const_iterator it; for( it = mapNameToData.lower_bound("#00000"); it != mapNameToData.end(); ++it ) { - const CString &sName = it->first; + const RString &sName = it->first; if( sName.size() != 6 || sName[0] != '#' || !IsAnInt( sName.substr(1,5) ) ) continue; @@ -299,16 +299,16 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, const NameToData_t &mapNa int iRawTrackNum = atoi( sName.substr(4,2).c_str() ); int iRowNo = GetMeasureStartRow( mapMeasureToTimeSig, iMeasureNo ); float fBeatsPerMeasure = GetBeatsPerMeasure( mapMeasureToTimeSig, iMeasureNo ); - const CString &sNoteData = it->second; + const RString &sNoteData = it->second; vector vTapNotes; for( size_t i=0; i+1::const_iterator it = m_mapWavIdToKeysoundIndex.find(sNoteId); + map::const_iterator it = m_mapWavIdToKeysoundIndex.find(sNoteId); if( it != m_mapWavIdToKeysoundIndex.end() ) { tn.bKeysound = true; @@ -512,20 +512,20 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, const NameToData_t &mapNa return true; } -void BMSLoader::GetApplicableFiles( CString sPath, vector &out ) +void BMSLoader::GetApplicableFiles( RString sPath, vector &out ) { - GetDirListing( sPath + CString("*.bms"), out ); - GetDirListing( sPath + CString("*.bme"), out ); + GetDirListing( sPath + RString("*.bms"), out ); + GetDirListing( sPath + RString("*.bme"), out ); } -bool BMSLoader::ReadBMSFile( const CString &sPath, NameToData_t &mapNameToData ) +bool BMSLoader::ReadBMSFile( const RString &sPath, NameToData_t &mapNameToData ) { RageFile file; if( !file.Open(sPath) ) RageException::Throw( "Failed to open \"%s\" for reading: %s", sPath.c_str(), file.GetError().c_str() ); while( !file.AtEOF() ) { - CString line; + RString line; if( file.GetLine( line ) == -1 ) { LOG->Warn( "Error reading \"%s\": %s", sPath.c_str(), file.GetError().c_str() ); @@ -536,8 +536,8 @@ bool BMSLoader::ReadBMSFile( const CString &sPath, NameToData_t &mapNameToData ) // BMS value names can be separated by a space or a colon. size_t iIndexOfSeparator = line.find_first_of( ": " ); - CString value_name = line.substr( 0, iIndexOfSeparator ); - CString value_data; + RString value_name = line.substr( 0, iIndexOfSeparator ); + RString value_data; if( iIndexOfSeparator != line.npos ) value_data = line.substr( iIndexOfSeparator+1 ); @@ -548,7 +548,7 @@ bool BMSLoader::ReadBMSFile( const CString &sPath, NameToData_t &mapNameToData ) return true; } -bool BMSLoader::GetTagFromMap( const NameToData_t &mapNameToData, const CString &sName, CString &sOut ) +bool BMSLoader::GetTagFromMap( const NameToData_t &mapNameToData, const RString &sName, RString &sOut ) { NameToData_t::const_iterator it; it = mapNameToData.find( sName ); @@ -562,12 +562,12 @@ bool BMSLoader::GetTagFromMap( const NameToData_t &mapNameToData, const CString /* Finds the longest common match for the given tag in all files. If the given tag * was found in at least one file, returns true; otherwise returns false. */ -bool BMSLoader::GetCommonTagFromMapList( const vector &aBMSData, const CString &sName, CString &sCommonTag ) +bool BMSLoader::GetCommonTagFromMapList( const vector &aBMSData, const RString &sName, RString &sCommonTag ) { bool bFoundOne = false; for( unsigned i=0; i < aBMSData.size(); i++ ) { - CString sTag; + RString sTag; if( !GetTagFromMap( aBMSData[i], sName, sTag ) ) continue; @@ -593,7 +593,7 @@ enum void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out ) { - CString sData; + RString sData; if( GetTagFromMap( mapNameToData, "#title", sData ) ) GetMainAndSubTitlesFromFullTitle( sData, out.m_sMainTitle, out.m_sSubTitle ); @@ -612,14 +612,14 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out ) NameToData_t::const_iterator it; for( it = mapNameToData.lower_bound("#wav"); it != mapNameToData.end(); ++it ) { - const CString &sName = it->first; + const RString &sName = it->first; if( sName.size() != 6 || sName.Left(4) != "#wav" ) continue; // this is keysound file name. Looks like "#WAV1A" - CString sData = it->second; - CString sWavID = sName.Right(2); + RString sData = it->second; + RString sWavID = sName.Right(2); /* Due to bugs in some programs, many BMS files have a "WAV" extension * on files in the BMS for files that actually have some other extension. @@ -630,7 +630,7 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out ) const char *exts[] = { "ogg", "wav", "mp3", NULL }; // XXX: stop duplicating these everywhere for( unsigned i = 0; exts[i] != NULL; ++i ) { - CString fn = SetExtension( sData, exts[i] ); + RString fn = SetExtension( sData, exts[i] ); if( IsAFile(out.GetSongDir()+fn) ) { sData = fn; @@ -654,7 +654,7 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out ) for( it = mapNameToData.lower_bound("#00000"); it != mapNameToData.end(); ++it ) { - const CString &sName = it->first; + const RString &sName = it->first; if( sName.size() != 6 || sName[0] != '#' || !IsAnInt( sName.substr(1,5) ) ) continue; // this is step or offset data. Looks like "#00705" @@ -664,11 +664,11 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out ) float fBeatsPerMeasure = GetBeatsPerMeasure( mapMeasureToTimeSig, iMeasureNo ); int iRowsPerMeasure = BeatToNoteRow( fBeatsPerMeasure ); - CString sData = it->second; + RString sData = it->second; int totalPairs = sData.size() / 2; for( int i = 0; i < totalPairs; ++i ) { - CString sPair = sData.substr(i*2,2); + RString sPair = sData.substr(i*2,2); int iVal = 0; if( sscanf( sPair, "%x", &iVal ) == 0 || iVal == 0 ) @@ -686,8 +686,8 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out ) case BMS_TRACK_BPM_REF: { - CString sTagToLookFor = ssprintf( "#bpm%02x", iVal ); - CString sBPM; + RString sTagToLookFor = ssprintf( "#bpm%02x", iVal ); + RString sBPM; if( GetTagFromMap( mapNameToData, sTagToLookFor, sBPM ) ) { float fBPM = strtof( sBPM, NULL ); @@ -704,8 +704,8 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out ) } case BMS_TRACK_STOP: { - CString sTagToLookFor = ssprintf( "#stop%02x", iVal ); - CString sBeats; + RString sTagToLookFor = ssprintf( "#stop%02x", iVal ); + RString sBeats; if( GetTagFromMap( mapNameToData, sTagToLookFor, sBeats ) ) { // find the BPM at the time of this freeze @@ -732,8 +732,8 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out ) int iBPMNo; sscanf( sData, "%x", &iBPMNo ); // data is in hexadecimal - CString sBPM; - CString sTagToLookFor = ssprintf( "#bpm%02x", iBPMNo ); + RString sBPM; + RString sTagToLookFor = ssprintf( "#bpm%02x", iBPMNo ); if( GetTagFromMap( mapNameToData, sTagToLookFor, sBPM ) ) { float fBPM = strtof( sBPM, NULL ); @@ -761,12 +761,12 @@ void BMSLoader::ReadTimeSigs( const NameToData_t &mapNameToData, MeasureToTimeSi NameToData_t::const_iterator it; for( it = mapNameToData.lower_bound("#00000"); it != mapNameToData.end(); ++it ) { - const CString &sName = it->first; + const RString &sName = it->first; if( sName.size() != 6 || sName[0] != '#' || !IsAnInt( sName.substr(1,5) ) ) continue; // this is step or offset data. Looks like "#00705" - const CString &sData = it->second; + const RString &sData = it->second; int iMeasureNo = atoi( sName.substr(1,3).c_str() ); int iBMSTrackNo = atoi( sName.substr(4,2).c_str() ); if( iBMSTrackNo == BMS_TRACK_TIME_SIG ) @@ -845,14 +845,14 @@ void BMSLoader::SetTimeSigAdjustments( const MeasureToTimeSig_t &sigs, Song *pOu } } -bool BMSLoader::LoadFromDir( CString sDir, Song &out ) +bool BMSLoader::LoadFromDir( RString sDir, Song &out ) { LOG->Trace( "Song::LoadFromBMSDir(%s)", sDir.c_str() ); ASSERT( out.m_vsKeysoundFile.empty() ); m_sDir = sDir; - vector arrayBMSFileNames; + vector arrayBMSFileNames; GetApplicableFiles( sDir, arrayBMSFileNames ); /* We should have at least one; if we had none, we shouldn't have been @@ -867,7 +867,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out ) ReadBMSFile( out.GetSongDir() + arrayBMSFileNames[i], aBMSData.back() ); } - CString commonSubstring; + RString commonSubstring; GetCommonTagFromMapList( aBMSData, "#title", commonSubstring ); if( commonSubstring == "" ) @@ -888,7 +888,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out ) { Steps *pSteps = apSteps[i]; pSteps->SetDifficulty( DIFFICULTY_MEDIUM ); - CString sTag; + RString sTag; if( GetTagFromMap( aBMSData[i], "#title", sTag ) && sTag.size() != commonSubstring.size() ) { sTag = sTag.substr( commonSubstring.size(), sTag.size() - commonSubstring.size() ); @@ -935,7 +935,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out ) // XXX: Is this really effective if Common Substring parsing failed? Steps *pSteps = apSteps[i]; pSteps->SetDifficulty( DIFFICULTY_MEDIUM ); - CString sTag; + RString sTag; if( GetTagFromMap( aBMSData[i], "#title", sTag ) ) SearchForDifficulty( sTag, pSteps ); if( GetTagFromMap( aBMSData[i], "#genre", sTag ) ) diff --git a/stepmania/src/NotesLoaderBMS.h b/stepmania/src/NotesLoaderBMS.h index c830a12261..84657de954 100644 --- a/stepmania/src/NotesLoaderBMS.h +++ b/stepmania/src/NotesLoaderBMS.h @@ -13,13 +13,13 @@ class BMSLoader: public NotesLoader { void SlideDuplicateDifficulties( Song &p ); - typedef multimap NameToData_t; - bool ReadBMSFile( const CString &sPath, BMSLoader::NameToData_t &mapNameToData ); - bool LoadFromBMSFile( const CString &sPath, const NameToData_t &mapNameToData, Steps &out1 ); + typedef multimap NameToData_t; + bool ReadBMSFile( const RString &sPath, BMSLoader::NameToData_t &mapNameToData ); + bool LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameToData, Steps &out1 ); void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out ); - static bool GetTagFromMap( const BMSLoader::NameToData_t &mapNameToData, const CString &sName, CString &sOut ); - static bool GetCommonTagFromMapList( const vector &aBMSData, const CString &sName, CString &out ); - void SearchForDifficulty( CString sTag, Steps *pOut ); + static bool GetTagFromMap( const BMSLoader::NameToData_t &mapNameToData, const RString &sName, RString &sOut ); + static bool GetCommonTagFromMapList( const vector &aBMSData, const RString &sName, RString &out ); + void SearchForDifficulty( RString sTag, Steps *pOut ); typedef map MeasureToTimeSig_t; void ReadTimeSigs( const NameToData_t &mapNameToData, MeasureToTimeSig_t &out ); @@ -28,12 +28,12 @@ class BMSLoader: public NotesLoader void SetTimeSigAdjustments( const MeasureToTimeSig_t &sigs, Song *pOut ); MeasureToTimeSig_t m_TimeSigAdjustments; - CString m_sDir; - map m_mapWavIdToKeysoundIndex; + RString m_sDir; + map m_mapWavIdToKeysoundIndex; public: - void GetApplicableFiles( CString sPath, vector &out ); - bool LoadFromDir( CString sDir, Song &out ); + void GetApplicableFiles( RString sPath, vector &out ); + bool LoadFromDir( RString sDir, Song &out ); }; #endif diff --git a/stepmania/src/NotesLoaderDWI.cpp b/stepmania/src/NotesLoaderDWI.cpp index 8a83493928..a36db285de 100644 --- a/stepmania/src/NotesLoaderDWI.cpp +++ b/stepmania/src/NotesLoaderDWI.cpp @@ -100,7 +100,7 @@ void DWILoader::DWIcharToNoteCol( char c, GameController i, int &col1Out, int &c * 1/192nds. So, we have to do a check to figure out what it really * means. If it contains 0s, it's most likely 192nds; otherwise, * it's most likely a jump. Search for a 0 before the next >: */ -bool DWILoader::Is192( const CString &sStepData, size_t pos ) +bool DWILoader::Is192( const RString &sStepData, size_t pos ) { while( pos < sStepData.size() ) { @@ -115,11 +115,11 @@ bool DWILoader::Is192( const CString &sStepData, size_t pos ) } bool DWILoader::LoadFromDWITokens( - CString sMode, - CString sDescription, - CString sNumFeet, - CString sStepData1, - CString sStepData2, + RString sMode, + RString sDescription, + RString sNumFeet, + RString sStepData1, + RString sStepData2, Steps &out) { CHECKPOINT_M( "DWILoader::LoadFromDWITokens()" ); @@ -179,7 +179,7 @@ bool DWILoader::LoadFromDWITokens( for( int pad=0; pad<2; pad++ ) // foreach pad { - CString sStepData; + RString sStepData; switch( pad ) { case 0: @@ -337,7 +337,7 @@ bool DWILoader::LoadFromDWITokens( /* This value can be in either "HH:MM:SS.sssss", "MM:SS.sssss", "SSS.sssss" * or milliseconds. */ -float DWILoader::ParseBrokenDWITimestamp(const CString &arg1, const CString &arg2, const CString &arg3) +float DWILoader::ParseBrokenDWITimestamp(const RString &arg1, const RString &arg2, const RString &arg3) { if(arg1.empty()) return 0; @@ -359,7 +359,7 @@ float DWILoader::ParseBrokenDWITimestamp(const CString &arg1, const CString &arg return HHMMSSToSeconds( arg1+":"+arg2+":"+arg3 ); } -bool DWILoader::LoadFromDWIFile( CString sPath, Song &out ) +bool DWILoader::LoadFromDWIFile( RString sPath, Song &out ) { LOG->Trace( "Song::LoadFromDWIFile(%s)", sPath.c_str() ); m_sLoadingFile = sPath; @@ -372,7 +372,7 @@ bool DWILoader::LoadFromDWIFile( CString sPath, Song &out ) { int iNumParams = msd.GetNumParams(i); const MsdFile::value_t &sParams = msd.GetValue(i); - CString sValueName = sParams[0]; + RString sValueName = sParams[0]; if(iNumParams < 1) { @@ -442,12 +442,12 @@ bool DWILoader::LoadFromDWIFile( CString sPath, Song &out ) else if( 0==stricmp(sValueName,"FREEZE") ) { - vector arrayFreezeExpressions; + vector arrayFreezeExpressions; split( sParams[1], ",", arrayFreezeExpressions ); for( unsigned f=0; f arrayFreezeValues; + vector arrayFreezeValues; split( arrayFreezeExpressions[f], "=", arrayFreezeValues ); if( arrayFreezeValues.size() != 2 ) { @@ -464,12 +464,12 @@ bool DWILoader::LoadFromDWIFile( CString sPath, Song &out ) else if( 0==stricmp(sValueName,"CHANGEBPM") || 0==stricmp(sValueName,"BPMCHANGE") ) { - vector arrayBPMChangeExpressions; + vector arrayBPMChangeExpressions; split( sParams[1], ",", arrayBPMChangeExpressions ); for( unsigned b=0; b arrayBPMChangeValues; + vector arrayBPMChangeValues; split( arrayBPMChangeExpressions[b], "=", arrayBPMChangeValues ); if( arrayBPMChangeValues.size() != 2 ) { @@ -495,7 +495,7 @@ bool DWILoader::LoadFromDWIFile( CString sPath, Song &out ) sParams[1], sParams[2], sParams[3], - (iNumParams==5) ? sParams[4] : CString(""), + (iNumParams==5) ? sParams[4] : RString(""), *pNewNotes ); if(pNewNotes->m_StepsType != STEPS_TYPE_INVALID) @@ -508,20 +508,20 @@ bool DWILoader::LoadFromDWIFile( CString sPath, Song &out ) { /* We don't want to support these tags. However, we don't want * to pick up images used here as song images (eg. banners). */ - CString param = sParams[1]; + RString param = sParams[1]; /* "{foo} ... {foo2}" */ size_t pos = 0; - while( pos < CString::npos ) + while( pos < RString::npos ) { size_t startpos = param.find('{', pos); - if( startpos == CString::npos ) + if( startpos == RString::npos ) break; size_t endpos = param.find('}', startpos); - if( endpos == CString::npos ) + if( endpos == RString::npos ) break; - CString sub = param.substr( startpos+1, endpos-startpos-1 ); + RString sub = param.substr( startpos+1, endpos-startpos-1 ); pos = endpos + 1; @@ -536,14 +536,14 @@ bool DWILoader::LoadFromDWIFile( CString sPath, Song &out ) return true; } -void DWILoader::GetApplicableFiles( CString sPath, vector &out ) +void DWILoader::GetApplicableFiles( RString sPath, vector &out ) { - GetDirListing( sPath + CString("*.dwi"), out ); + GetDirListing( sPath + RString("*.dwi"), out ); } -bool DWILoader::LoadFromDir( CString sPath, Song &out ) +bool DWILoader::LoadFromDir( RString sPath, Song &out ) { - vector aFileNames; + vector aFileNames; GetApplicableFiles( sPath, aFileNames ); if( aFileNames.size() > 1 ) diff --git a/stepmania/src/NotesLoaderDWI.h b/stepmania/src/NotesLoaderDWI.h index 054925a927..da4c6e1f2a 100644 --- a/stepmania/src/NotesLoaderDWI.h +++ b/stepmania/src/NotesLoaderDWI.h @@ -15,20 +15,20 @@ class DWILoader: public NotesLoader void DWIcharToNoteCol( char c, GameController i, int &col1Out, int &col2Out ); bool LoadFromDWITokens( - CString sMode, CString sDescription, CString sNumFeet, CString sStepData1, - CString sStepData2, + RString sMode, RString sDescription, RString sNumFeet, RString sStepData1, + RString sStepData2, Steps &out ); - bool LoadFromDWIFile( CString sPath, Song &out ); + bool LoadFromDWIFile( RString sPath, Song &out ); - static float ParseBrokenDWITimestamp(const CString &arg1, const CString &arg2, const CString &arg3); - static bool Is192( const CString &str, size_t pos ); - CString m_sLoadingFile; + static float ParseBrokenDWITimestamp(const RString &arg1, const RString &arg2, const RString &arg3); + static bool Is192( const RString &str, size_t pos ); + RString m_sLoadingFile; public: - void GetApplicableFiles( CString sPath, vector &out ); - bool Loadable( CString sPath ); - bool LoadFromDir( CString sPath, Song &out ); + void GetApplicableFiles( RString sPath, vector &out ); + bool Loadable( RString sPath ); + bool LoadFromDir( RString sPath, Song &out ); }; #endif diff --git a/stepmania/src/NotesLoaderKSF.cpp b/stepmania/src/NotesLoaderKSF.cpp index 7d08d41404..cd0b7b1047 100644 --- a/stepmania/src/NotesLoaderKSF.cpp +++ b/stepmania/src/NotesLoaderKSF.cpp @@ -59,7 +59,7 @@ void KSFLoader::RemoveHoles( NoteData &out, const Song &song ) } #endif -bool KSFLoader::LoadFromKSFFile( const CString &sPath, Steps &out, const Song &song ) +bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &song ) { LOG->Trace( "Steps::LoadFromKSFFile( '%s' )", sPath.c_str() ); @@ -68,12 +68,12 @@ bool KSFLoader::LoadFromKSFFile( const CString &sPath, Steps &out, const Song &s RageException::Throw( "Error opening file '%s'.", sPath.c_str() ); int iTickCount = -1; // this is the value we read for TICKCOUNT - vector asRows; + vector asRows; for( unsigned i=0; i &out ) +void KSFLoader::GetApplicableFiles( RString sPath, vector &out ) { - GetDirListing( sPath + CString("*.ksf"), out ); + GetDirListing( sPath + RString("*.ksf"), out ); } -void KSFLoader::LoadTags( const CString &str, Song &out ) +void KSFLoader::LoadTags( const RString &str, Song &out ) { /* str is either a #TITLE or a directory component. Fill in missing information. * str is either "title", "artist - title", or "artist - title - difficulty". */ - vector asBits; + vector asBits; split( str, " - ", asBits, false ); /* Ignore the difficulty, since we get that elsewhere. */ if( asBits.size() == 3 && @@ -242,7 +242,7 @@ void KSFLoader::LoadTags( const CString &str, Song &out ) asBits.erase(asBits.begin()+2, asBits.begin()+3); } - CString title, artist; + RString title, artist; if( asBits.size() == 2 ) { artist = asBits[0]; @@ -265,7 +265,7 @@ void KSFLoader::LoadTags( const CString &str, Song &out ) out.m_sArtist = artist; } -bool KSFLoader::LoadGlobalData( const CString &sPath, Song &out ) +bool KSFLoader::LoadGlobalData( const RString &sPath, Song &out ) { MsdFile msd; if( !msd.ReadFile( sPath ) ) @@ -276,7 +276,7 @@ bool KSFLoader::LoadGlobalData( const CString &sPath, Song &out ) for( unsigned i=0; i < msd.GetNumValues(); i++ ) { const MsdFile::value_t &sParams = msd.GetValue(i); - CString sValueName = sParams[0]; + RString sValueName = sParams[0]; // handle the data if( 0==stricmp(sValueName,"TITLE") ) @@ -323,7 +323,7 @@ bool KSFLoader::LoadGlobalData( const CString &sPath, Song &out ) /* Try to fill in missing bits of information from the pathname. */ { - vector asBits; + vector asBits; split( sPath, "/", asBits, true); ASSERT(asBits.size() > 1); @@ -331,10 +331,10 @@ bool KSFLoader::LoadGlobalData( const CString &sPath, Song &out ) } // search for music with song in the file name - vector arrayPossibleMusic; - GetDirListing( out.GetSongDir() + CString("song.mp3"), arrayPossibleMusic ); - GetDirListing( out.GetSongDir() + CString("song.ogg"), arrayPossibleMusic ); - GetDirListing( out.GetSongDir() + CString("song.wav"), arrayPossibleMusic ); + vector arrayPossibleMusic; + GetDirListing( out.GetSongDir() + RString("song.mp3"), arrayPossibleMusic ); + GetDirListing( out.GetSongDir() + RString("song.ogg"), arrayPossibleMusic ); + GetDirListing( out.GetSongDir() + RString("song.wav"), arrayPossibleMusic ); if( !arrayPossibleMusic.empty() ) // we found a match out.m_sMusicFile = arrayPossibleMusic[0]; @@ -342,12 +342,12 @@ bool KSFLoader::LoadGlobalData( const CString &sPath, Song &out ) return true; } -bool KSFLoader::LoadFromDir( CString sDir, Song &out ) +bool KSFLoader::LoadFromDir( RString sDir, Song &out ) { LOG->Trace( "Song::LoadFromKSFDir(%s)", sDir.c_str() ); - vector arrayKSFFileNames; - GetDirListing( sDir + CString("*.ksf"), arrayKSFFileNames ); + vector arrayKSFFileNames; + GetDirListing( sDir + RString("*.ksf"), arrayKSFFileNames ); /* We shouldn't have been called to begin with if there were no KSFs. */ if( arrayKSFFileNames.empty() ) diff --git a/stepmania/src/NotesLoaderKSF.h b/stepmania/src/NotesLoaderKSF.h index cbd0628faa..316c779c10 100644 --- a/stepmania/src/NotesLoaderKSF.h +++ b/stepmania/src/NotesLoaderKSF.h @@ -11,14 +11,14 @@ class NoteData; class KSFLoader: public NotesLoader { - bool LoadFromKSFFile( const CString &sPath, Steps &out, const Song &song ); - bool LoadGlobalData( const CString &sPath, Song &out ); + bool LoadFromKSFFile( const RString &sPath, Steps &out, const Song &song ); + bool LoadGlobalData( const RString &sPath, Song &out ); void RemoveHoles( NoteData &out, const Song &song ); - void LoadTags( const CString &str, Song &out ); + void LoadTags( const RString &str, Song &out ); public: - void GetApplicableFiles( CString sPath, vector &out ); - bool LoadFromDir( CString sDir, Song &out ); + void GetApplicableFiles( RString sPath, vector &out ); + bool LoadFromDir( RString sDir, Song &out ); }; diff --git a/stepmania/src/NotesLoaderSM.cpp b/stepmania/src/NotesLoaderSM.cpp index c56c82df05..54acaa9858 100644 --- a/stepmania/src/NotesLoaderSM.cpp +++ b/stepmania/src/NotesLoaderSM.cpp @@ -15,12 +15,12 @@ const int MAX_EDIT_STEPS_SIZE_BYTES = 30*1024; // 30KB void SMLoader::LoadFromSMTokens( - CString sStepsType, - CString sDescription, - CString sDifficulty, - CString sMeter, - CString sRadarValues, - CString sNoteData, + RString sStepsType, + RString sDescription, + RString sDifficulty, + RString sMeter, + RString sRadarValues, + RString sNoteData, Steps &out ) { @@ -47,7 +47,7 @@ void SMLoader::LoadFromSMTokens( out.SetDifficulty( DIFFICULTY_CHALLENGE ); out.SetMeter(atoi(sMeter)); - vector saValues; + vector saValues; split( sRadarValues, ",", saValues, true ); if( saValues.size() == NUM_RadarCategory ) { @@ -62,12 +62,12 @@ void SMLoader::LoadFromSMTokens( out.TidyUpData(); } -void SMLoader::GetApplicableFiles( CString sPath, vector &out ) +void SMLoader::GetApplicableFiles( RString sPath, vector &out ) { - GetDirListing( sPath + CString("*.sm"), out ); + GetDirListing( sPath + RString("*.sm"), out ); } -bool SMLoader::LoadTimingFromFile( const CString &fn, TimingData &out ) +bool SMLoader::LoadTimingFromFile( const RString &fn, TimingData &out ) { MsdFile msd; if( !msd.ReadFile( fn ) ) @@ -90,7 +90,7 @@ void SMLoader::LoadTimingFromSMFile( const MsdFile &msd, TimingData &out ) for( unsigned i=0; i arrayFreezeExpressions; + vector arrayFreezeExpressions; split( sParams[1], ",", arrayFreezeExpressions ); for( unsigned f=0; f arrayFreezeValues; + vector arrayFreezeValues; split( arrayFreezeExpressions[f], "=", arrayFreezeValues ); /* XXX: Once we have a way to display warnings that the user actually * cares about (unlike most warnings), this should be one of them. */ @@ -130,12 +130,12 @@ void SMLoader::LoadTimingFromSMFile( const MsdFile &msd, TimingData &out ) else if( sValueName=="BPMS" ) { - vector arrayBPMChangeExpressions; + vector arrayBPMChangeExpressions; split( sParams[1], ",", arrayBPMChangeExpressions ); for( unsigned b=0; b arrayBPMChangeValues; + vector arrayBPMChangeValues; split( arrayBPMChangeExpressions[b], "=", arrayBPMChangeValues ); /* XXX: Once we have a way to display warnings that the user actually * cares about (unlike most warnings), this should be one of them. */ @@ -159,9 +159,9 @@ void SMLoader::LoadTimingFromSMFile( const MsdFile &msd, TimingData &out ) } } -bool LoadFromBGChangesString( BackgroundChange &change, const CString &sBGChangeExpression ) +bool LoadFromBGChangesString( BackgroundChange &change, const RString &sBGChangeExpression ) { - vector aBGChangeValues; + vector aBGChangeValues; split( sBGChangeExpression, "=", aBGChangeValues, false ); aBGChangeValues.resize( min((int)aBGChangeValues.size(),11) ); @@ -225,7 +225,7 @@ bool LoadFromBGChangesString( BackgroundChange &change, const CString &sBGChange return aBGChangeValues.size() >= 2; } -bool SMLoader::LoadFromSMFile( CString sPath, Song &out ) +bool SMLoader::LoadFromSMFile( RString sPath, Song &out ) { LOG->Trace( "Song::LoadFromSMFile(%s)", sPath.c_str() ); @@ -243,7 +243,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out ) { int iNumParams = msd.GetNumParams(i); const MsdFile::value_t &sParams = msd.GetValue(i); - CString sValueName = sParams[0]; + RString sValueName = sParams[0]; sValueName.MakeUpper(); // handle the data @@ -377,7 +377,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out ) } else { - vector aBGChangeExpressions; + vector aBGChangeExpressions; split( sParams[1], ",", aBGChangeExpressions ); for( unsigned b=0; b aFGChangeExpressions; + vector aFGChangeExpressions; split( sParams[1], ",", aFGChangeExpressions ); for( unsigned b=0; b aKeysoundFiles; + vector aKeysoundFiles; split( sParams[1], ",", aKeysoundFiles ); for( unsigned k=0; k aFileNames; + vector aFileNames; GetApplicableFiles( sPath, aFileNames ); if( aFileNames.size() > 1 ) @@ -462,7 +462,7 @@ bool SMLoader::LoadFromDir( CString sPath, Song &out ) return LoadFromSMFile( sPath + aFileNames[0], out ); } -bool SMLoader::LoadEdit( CString sEditFilePath, ProfileSlot slot ) +bool SMLoader::LoadEdit( RString sEditFilePath, ProfileSlot slot ) { LOG->Trace( "SMLoader::LoadEdit(%s)", sEditFilePath.c_str() ); @@ -483,14 +483,14 @@ bool SMLoader::LoadEdit( CString sEditFilePath, ProfileSlot slot ) return LoadEditFromMsd( msd, sEditFilePath, slot ); } -bool SMLoader::LoadEditFromBuffer( const CString &sBuffer, CString sEditFilePath, ProfileSlot slot ) +bool SMLoader::LoadEditFromBuffer( const RString &sBuffer, RString sEditFilePath, ProfileSlot slot ) { MsdFile msd; msd.ReadFromString( sBuffer ); return LoadEditFromMsd( msd, sEditFilePath, slot ); } -bool SMLoader::LoadEditFromMsd( const MsdFile &msd, CString sEditFilePath, ProfileSlot slot ) +bool SMLoader::LoadEditFromMsd( const MsdFile &msd, RString sEditFilePath, ProfileSlot slot ) { Song* pSong = NULL; @@ -498,7 +498,7 @@ bool SMLoader::LoadEditFromMsd( const MsdFile &msd, CString sEditFilePath, Profi { int iNumParams = msd.GetNumParams(i); const MsdFile::value_t &sParams = msd.GetValue(i); - CString sValueName = sParams[0]; + RString sValueName = sParams[0]; sValueName.MakeUpper(); // handle the data @@ -510,7 +510,7 @@ bool SMLoader::LoadEditFromMsd( const MsdFile &msd, CString sEditFilePath, Profi return false; } - CString sSongFullTitle = sParams[1]; + RString sSongFullTitle = sParams[1]; sSongFullTitle.Replace( '\\', '/' ); pSong = SONGMAN->FindSong( sSongFullTitle ); diff --git a/stepmania/src/NotesLoaderSM.h b/stepmania/src/NotesLoaderSM.h index b397928b89..8019f683cf 100644 --- a/stepmania/src/NotesLoaderSM.h +++ b/stepmania/src/NotesLoaderSM.h @@ -14,34 +14,34 @@ class TimingData; class SMLoader: public NotesLoader { static void LoadFromSMTokens( - CString sStepsType, - CString sDescription, - CString sDifficulty, - CString sMeter, - CString sRadarValues, - CString sNoteData, + RString sStepsType, + RString sDescription, + RString sDifficulty, + RString sMeter, + RString sRadarValues, + RString sNoteData, Steps &out); bool FromCache; public: SMLoader() { FromCache = false; } - bool LoadFromSMFile( CString sPath, Song &out ); - bool LoadFromSMFile( CString sPath, Song &out, bool cache ) + bool LoadFromSMFile( RString sPath, Song &out ); + bool LoadFromSMFile( RString sPath, Song &out, bool cache ) { FromCache=cache; return LoadFromSMFile( sPath, out ); } - void GetApplicableFiles( CString sPath, vector &out ); - bool LoadFromDir( CString sPath, Song &out ); + void GetApplicableFiles( RString sPath, vector &out ); + bool LoadFromDir( RString sPath, Song &out ); void TidyUpData( Song &song, bool cache ); - static bool LoadTimingFromFile( const CString &fn, TimingData &out ); + static bool LoadTimingFromFile( const RString &fn, TimingData &out ); static void LoadTimingFromSMFile( const MsdFile &msd, TimingData &out ); - static bool LoadEdit( CString sEditFilePath, ProfileSlot slot ); - static bool LoadEditFromBuffer( const CString &sBuffer, CString sEditFilePath, ProfileSlot slot ); + static bool LoadEdit( RString sEditFilePath, ProfileSlot slot ); + static bool LoadEditFromBuffer( const RString &sBuffer, RString sEditFilePath, ProfileSlot slot ); private: - static bool LoadEditFromMsd( const MsdFile &msd, CString sEditFilePath, ProfileSlot slot ); + static bool LoadEditFromMsd( const MsdFile &msd, RString sEditFilePath, ProfileSlot slot ); }; #endif diff --git a/stepmania/src/NotesWriterDWI.cpp b/stepmania/src/NotesWriterDWI.cpp index a64826ddbb..0cf3c4abd6 100644 --- a/stepmania/src/NotesWriterDWI.cpp +++ b/stepmania/src/NotesWriterDWI.cpp @@ -11,10 +11,10 @@ #include "Steps.h" /* Output is an angle bracket expression without angle brackets, eg. "468". */ -CString NotesWriterDWI::NotesToDWIString( const TapNote tnCols[6] ) +RString NotesWriterDWI::NotesToDWIString( const TapNote tnCols[6] ) { const char dirs[] = { '4', 'C', '2', '8', 'D', '6' }; - CString taps, holds, ret; + RString taps, holds, ret; for( int col = 0; col < 6; ++col ) { switch( tnCols[col].type ) @@ -33,7 +33,7 @@ CString NotesWriterDWI::NotesToDWIString( const TapNote tnCols[6] ) if( holds.size() + taps.size() == 0 ) return "0"; -// CString combine = taps; +// RString combine = taps; // for( unsigned i = 0; i < holds.size(); ++i ) // combine += ssprintf("%c!%c", holds[i], holds[i]); @@ -83,7 +83,7 @@ CString NotesWriterDWI::NotesToDWIString( const TapNote tnCols[6] ) return '0';*/ } -CString NotesWriterDWI::NotesToDWIString( TapNote tnCol1, TapNote tnCol2, TapNote tnCol3, TapNote tnCol4, TapNote tnCol5, TapNote tnCol6 ) +RString NotesWriterDWI::NotesToDWIString( TapNote tnCol1, TapNote tnCol2, TapNote tnCol3, TapNote tnCol4, TapNote tnCol5, TapNote tnCol6 ) { TapNote tnCols[6]; tnCols[0] = tnCol1; @@ -95,7 +95,7 @@ CString NotesWriterDWI::NotesToDWIString( TapNote tnCol1, TapNote tnCol2, TapNot return NotesToDWIString( tnCols ); } -CString NotesWriterDWI::NotesToDWIString( TapNote tnCol1, TapNote tnCol2, TapNote tnCol3, TapNote tnCol4 ) +RString NotesWriterDWI::NotesToDWIString( TapNote tnCol1, TapNote tnCol2, TapNote tnCol3, TapNote tnCol4 ) { return NotesToDWIString( tnCol1, TAP_EMPTY, tnCol2, tnCol3, TAP_EMPTY, tnCol4 ); } @@ -135,7 +135,7 @@ char NotesWriterDWI::OptimizeDWIPair( char c1, char c2 ) return it->second; } -CString NotesWriterDWI::OptimizeDWIString( CString holds, CString taps ) +RString NotesWriterDWI::OptimizeDWIString( RString holds, RString taps ) { /* First, sort the holds and taps in ASCII order. This puts 2468 first. * This way 1379 combinations will always be found first, so we'll always @@ -144,7 +144,7 @@ CString NotesWriterDWI::OptimizeDWIString( CString holds, CString taps ) sort( taps.begin(), taps.end() ); /* Combine characters as much as possible. */ - CString comb_taps, comb_holds; + RString comb_taps, comb_holds; /* 24 -> 1 */ while( taps.size() > 1 ) @@ -175,7 +175,7 @@ CString NotesWriterDWI::OptimizeDWIString( CString holds, CString taps ) /* Now we have at most one single tap and one hold remaining, and any * number of taps and holds in comb_taps and comb_holds. */ - CString ret; + RString ret; ret += taps; ret += comb_taps; if( holds.size() == 1 ) @@ -240,7 +240,7 @@ void NotesWriterDWI::WriteDWINotesField( RageFile &f, const Steps &out, int star { int row = BeatToNoteRow( (float)b ); - CString str; + RString str; switch( out.m_StepsType ) { case STEPS_TYPE_DANCE_SINGLE: @@ -343,7 +343,7 @@ bool NotesWriterDWI::WriteDWINotesTag( RageFile &f, const Steps &out ) return true; } -bool NotesWriterDWI::Write( CString sPath, const Song &out ) +bool NotesWriterDWI::Write( RString sPath, const Song &out ) { RageFile f; if( !f.Open( sPath, RageFile::WRITE ) ) diff --git a/stepmania/src/NotesWriterDWI.h b/stepmania/src/NotesWriterDWI.h index d747be59e5..62e5bb248a 100644 --- a/stepmania/src/NotesWriterDWI.h +++ b/stepmania/src/NotesWriterDWI.h @@ -10,16 +10,16 @@ class Song; class Steps; class NotesWriterDWI { - CString NotesToDWIString( TapNote cNoteCol1, TapNote cNoteCol2, TapNote cNoteCol3, TapNote cNoteCol4, TapNote cNoteCol5, TapNote cNoteCol6 ); - CString NotesToDWIString( TapNote cNoteCol1, TapNote cNoteCol2, TapNote cNoteCol3, TapNote cNoteCol4 ); + RString NotesToDWIString( TapNote cNoteCol1, TapNote cNoteCol2, TapNote cNoteCol3, TapNote cNoteCol4, TapNote cNoteCol5, TapNote cNoteCol6 ); + RString NotesToDWIString( TapNote cNoteCol1, TapNote cNoteCol2, TapNote cNoteCol3, TapNote cNoteCol4 ); void WriteDWINotesField( RageFile &f, const Steps &out, int start ); bool WriteDWINotesTag( RageFile &f, const Steps &out ); - CString NotesToDWIString( const TapNote cNoteCols[6] ); - CString OptimizeDWIString( CString holds, CString taps ); + RString NotesToDWIString( const TapNote cNoteCols[6] ); + RString OptimizeDWIString( RString holds, RString taps ); char OptimizeDWIPair( char c1, char c2 ); public: - bool Write( CString sPath, const Song &out ); + bool Write( RString sPath, const Song &out ); }; #endif diff --git a/stepmania/src/NotesWriterSM.cpp b/stepmania/src/NotesWriterSM.cpp index 58b8a7926f..30c38ae56d 100644 --- a/stepmania/src/NotesWriterSM.cpp +++ b/stepmania/src/NotesWriterSM.cpp @@ -15,9 +15,9 @@ #include "ProfileManager.h" #include "Profile.h" -static CString BackgroundChangeToString( const BackgroundChange &bgc ) +static RString BackgroundChangeToString( const BackgroundChange &bgc ) { - CString s = ssprintf( + RString s = ssprintf( "%.3f=%s=%.3f=%d=%d=%d=%s=%s=%s=%s=%s", bgc.m_fStartBeat, bgc.m_def.m_sFile1.c_str(), @@ -143,7 +143,7 @@ void NotesWriterSM::WriteGlobalTags( RageFile &f, const Song &out ) f.PutLine( ";" ); } -static CString JoinLineList( vector &lines ) +static RString JoinLineList( vector &lines ) { for( unsigned i = 0; i < lines.size(); ++i ) TrimRight( lines[i] ); @@ -156,9 +156,9 @@ static CString JoinLineList( vector &lines ) return join( "\r\n", lines.begin()+j, lines.end() ); } -CString NotesWriterSM::GetSMNotesTag( const Song &song, const Steps &in, bool bSavingCache ) +RString NotesWriterSM::GetSMNotesTag( const Song &song, const Steps &in, bool bSavingCache ) { - vector lines; + vector lines; lines.push_back( "" ); lines.push_back( ssprintf("//---------------%s - %s----------------", @@ -170,7 +170,7 @@ CString NotesWriterSM::GetSMNotesTag( const Song &song, const Steps &in, bool bS lines.push_back( ssprintf( " %d:", in.GetMeter() ) ); int MaxRadar = bSavingCache? NUM_RadarCategory:5; - vector asRadarValues; + vector asRadarValues; for( int r=0; r < MaxRadar; r++ ) asRadarValues.push_back( ssprintf("%.3f", in.GetRadarValues()[r]) ); /* Don't append a newline here; it's added in NoteDataUtil::GetSMNoteDataString. @@ -178,7 +178,7 @@ CString NotesWriterSM::GetSMNotesTag( const Song &song, const Steps &in, bool bS * newline and they'll accumulate. */ lines.push_back( ssprintf( " %s:", join(",",asRadarValues).c_str() ) ); - CString sNoteData; + RString sNoteData; in.GetSMNoteData( sNoteData ); split( sNoteData, "\n", lines, true ); @@ -187,7 +187,7 @@ CString NotesWriterSM::GetSMNotesTag( const Song &song, const Steps &in, bool bS return JoinLineList( lines ); } -bool NotesWriterSM::Write(CString sPath, const Song &out, bool bSavingCache) +bool NotesWriterSM::Write(RString sPath, const Song &out, bool bSavingCache) { /* Flush dir cache when writing steps, so the old size isn't cached. */ FILEMAN->FlushDirCache( Dirname(sPath) ); @@ -234,20 +234,20 @@ bool NotesWriterSM::Write(CString sPath, const Song &out, bool bSavingCache) if( pSteps->WasLoadedFromProfile() ) continue; - CString sTag = GetSMNotesTag( out, *pSteps, bSavingCache ); + RString sTag = GetSMNotesTag( out, *pSteps, bSavingCache ); f.PutLine( sTag ); } return true; } -void NotesWriterSM::GetEditFileContents( const Song *pSong, const Steps *pSteps, CString &sOut ) +void NotesWriterSM::GetEditFileContents( const Song *pSong, const Steps *pSteps, RString &sOut ) { sOut = ""; - CString sDir = pSong->GetSongDir(); + RString sDir = pSong->GetSongDir(); /* "Songs/foo/bar"; strip off "Songs/". */ - vector asParts; + vector asParts; split( sDir, "/", asParts ); if( asParts.size() ) sDir = join( "/", asParts.begin()+1, asParts.end() ); @@ -255,12 +255,12 @@ void NotesWriterSM::GetEditFileContents( const Song *pSong, const Steps *pSteps, sOut += GetSMNotesTag( *pSong, *pSteps, false ); } -CString NotesWriterSM::GetEditFileName( const Song *pSong, const Steps *pSteps ) +RString NotesWriterSM::GetEditFileName( const Song *pSong, const Steps *pSteps ) { /* Try to make a unique name. This isn't guaranteed. Edit descriptions are * case-sensitive, filenames on disk are usually not, and we decimate certain * characters for FAT filesystems. */ - CString sFile = pSong->GetTranslitFullTitle() + " - " + pSteps->GetDescription(); + RString sFile = pSong->GetTranslitFullTitle() + " - " + pSteps->GetDescription(); // HACK: if( pSteps->m_StepsType == STEPS_TYPE_DANCE_DOUBLE ) @@ -274,9 +274,9 @@ CString NotesWriterSM::GetEditFileName( const Song *pSong, const Steps *pSteps ) bool NotesWriterSM::WriteEditFileToMachine( const Song *pSong, Steps *pSteps ) { - CString sDir = PROFILEMAN->GetProfileDir( ProfileSlot_Machine ) + EDIT_STEPS_SUBDIR; + RString sDir = PROFILEMAN->GetProfileDir( ProfileSlot_Machine ) + EDIT_STEPS_SUBDIR; - CString sPath = sDir + GetEditFileName(pSong,pSteps); + RString sPath = sDir + GetEditFileName(pSong,pSteps); /* Flush dir cache when writing steps, so the old size isn't cached. */ FILEMAN->FlushDirCache( Dirname(sPath) ); @@ -290,7 +290,7 @@ bool NotesWriterSM::WriteEditFileToMachine( const Song *pSong, Steps *pSteps ) return false; } - CString sTag; + RString sTag; GetEditFileContents( pSong, pSteps, sTag ); if( f.PutLine(sTag) == -1 || f.Flush() == -1 ) { diff --git a/stepmania/src/NotesWriterSM.h b/stepmania/src/NotesWriterSM.h index 7a3aa37d31..e946bf053c 100644 --- a/stepmania/src/NotesWriterSM.h +++ b/stepmania/src/NotesWriterSM.h @@ -9,12 +9,12 @@ class RageFile; class NotesWriterSM { void WriteGlobalTags( RageFile &f, const Song &out ); - static CString GetSMNotesTag( const Song &song, const Steps &in, bool bSavingCache ); + static RString GetSMNotesTag( const Song &song, const Steps &in, bool bSavingCache ); public: - bool Write( CString sPath, const Song &out, bool bSavingCache ); - static void GetEditFileContents( const Song *pSong, const Steps *pSteps, CString &sOut ); - CString GetEditFileName( const Song *pSong, const Steps *pSteps ); + bool Write( RString sPath, const Song &out, bool bSavingCache ); + static void GetEditFileContents( const Song *pSong, const Steps *pSteps, RString &sOut ); + RString GetEditFileName( const Song *pSong, const Steps *pSteps ); bool WriteEditFileToMachine( const Song *pSong, Steps *pSteps ); }; diff --git a/stepmania/src/OptionIcon.cpp b/stepmania/src/OptionIcon.cpp index 556ccb4db7..f1d1687bb4 100644 --- a/stepmania/src/OptionIcon.cpp +++ b/stepmania/src/OptionIcon.cpp @@ -27,7 +27,7 @@ OptionIcon::OptionIcon( const OptionIcon &cpy ): this->AddChild( &m_text ); } -void OptionIcon::Load( CString sType ) +void OptionIcon::Load( RString sType ) { m_spr.Load( THEME->GetPathG(sType,"icon 3x2") ); m_spr.StopAnimating(); @@ -42,11 +42,11 @@ void OptionIcon::Load( CString sType ) this->AddChild( &m_text ); } -void OptionIcon::Set( PlayerNumber pn, const CString &_sText, bool bHeader ) +void OptionIcon::Set( PlayerNumber pn, const RString &_sText, bool bHeader ) { - CString sText = _sText; + RString sText = _sText; - static const CString sStopWords[] = + static const RString sStopWords[] = { "1X", "DEFAULT", @@ -67,7 +67,7 @@ void OptionIcon::Set( PlayerNumber pn, const CString &_sText, bool bHeader ) int iState = pn*3 + (bHeader?0:(bVacant?1:2)); m_spr.SetState( iState ); - m_text.SetText( bHeader ? CString("") : sText ); + m_text.SetText( bHeader ? RString("") : sText ); m_text.SetZoom( TEXT_ZOOM ); m_text.CropToWidth( TEXT_WIDTH ); } diff --git a/stepmania/src/OptionIcon.h b/stepmania/src/OptionIcon.h index 5961d48faa..cd4ff9f8f0 100644 --- a/stepmania/src/OptionIcon.h +++ b/stepmania/src/OptionIcon.h @@ -14,8 +14,8 @@ class OptionIcon : public ActorFrame public: OptionIcon(); OptionIcon( const OptionIcon &cpy ); - void Load( CString sType ); - void Set( PlayerNumber pn, const CString &sText, bool bHeader = false ); + void Load( RString sType ); + void Set( PlayerNumber pn, const RString &sText, bool bHeader = false ); protected: BitmapText m_text; diff --git a/stepmania/src/OptionIconRow.cpp b/stepmania/src/OptionIconRow.cpp index 12a181c26b..4d18d766d5 100644 --- a/stepmania/src/OptionIconRow.cpp +++ b/stepmania/src/OptionIconRow.cpp @@ -24,7 +24,7 @@ OptionIconRow::OptionIconRow() } } -void OptionIconRow::LoadFromNode( const CString& sDir, const XNode* pNode ) +void OptionIconRow::LoadFromNode( const RString& sDir, const XNode* pNode ) { Load(); @@ -74,7 +74,7 @@ static const OptionColumnEntry g_OptionColumnEntries[] = {"Distant", 6}, }; -int OptionToPreferredColumn( CString sOptionText ) +int OptionToPreferredColumn( RString sOptionText ) { /* Speedups always go in column 0. digit ... x */ if( sOptionText.size() > 1 && @@ -103,17 +103,17 @@ void OptionIconRow::SetFromGameState( PlayerNumber pn ) { // init - CString sOptions = GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetString(); - vector asOptions; + RString sOptions = GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetString(); + vector asOptions; split( sOptions, ", ", asOptions, true ); - CString asTabs[NUM_OPTION_COLS-1]; // fill these with what will be displayed on the tabs + RString asTabs[NUM_OPTION_COLS-1]; // fill these with what will be displayed on the tabs // for each option, look for the best column to place it in for( unsigned i=0; iGetString("OptionTitles",s) : s; } -CString ITEMS_LONG_ROW_X_NAME( size_t p ) { return ssprintf("ItemsLongRowP%dX",int(p+1)); } -CString ICONS_X_NAME( size_t p ) { return ssprintf("IconsP%dX",int(p+1)); } +RString ITEMS_LONG_ROW_X_NAME( size_t p ) { return ssprintf("ItemsLongRowP%dX",int(p+1)); } +RString ICONS_X_NAME( size_t p ) { return ssprintf("IconsP%dX",int(p+1)); } OptionRow::OptionRow( const OptionRowType *pSource ) { @@ -105,7 +105,7 @@ void OptionRow::Clear() if( m_pHand != NULL ) { - FOREACH_CONST( CString, m_pHand->m_vsReloadRowMessages, m ) + FOREACH_CONST( RString, m_pHand->m_vsReloadRowMessages, m ) MESSAGEMAN->Unsubscribe( this, *m ); } SAFE_DELETE( m_pHand ); @@ -115,7 +115,7 @@ void OptionRow::Clear() ZERO( m_iChoiceInRowWithFocus ); } -void OptionRowType::Load( const CString &sType ) +void OptionRowType::Load( const RString &sType ) { m_sType = sType; @@ -159,7 +159,7 @@ void OptionRow::LoadNormal( OptionRowHandler *pHand, bool bFirstItemGoesDown ) m_pHand = pHand; m_bFirstItemGoesDown = bFirstItemGoesDown; - FOREACH_CONST( CString, m_pHand->m_vsReloadRowMessages, m ) + FOREACH_CONST( RString, m_pHand->m_vsReloadRowMessages, m ) MESSAGEMAN->Subscribe( this, *m ); ChoicesChanged(); @@ -211,10 +211,10 @@ void OptionRow::ChoicesChanged() m_textTitle->SetText( GetRowTitle() ); } -CString OptionRow::GetRowTitle() const +RString OptionRow::GetRowTitle() const { - CString sLineName = m_pHand->m_Def.m_sName; - CString sTitle = OptionTitle(sLineName); + RString sLineName = m_pHand->m_Def.m_sName; + RString sTitle = OptionTitle(sLineName); // HACK: tack the BPM onto the name of the speed line if( sLineName.CompareNoCase("speed")==0 ) @@ -308,7 +308,7 @@ void OptionRow::InitText() for( unsigned c=0; cm_Def.m_vsChoices.size(); c++ ) { - CString sText = m_pHand->m_Def.m_vsChoices[c]; + RString sText = m_pHand->m_Def.m_vsChoices[c]; PrepareItemText( sText ); bt.SetText( sText ); @@ -373,7 +373,7 @@ void OptionRow::InitText() // init text BitmapText *bt = new BitmapText( m_pParentType->m_textItemParent ); m_textItems.push_back( bt ); - CString sText = m_pHand->m_Def.m_vsChoices[c]; + RString sText = m_pHand->m_Def.m_vsChoices[c]; PrepareItemText( sText ); bt->SetText( sText ); bt->RunCommands( m_pParentType->ITEMS_ON_COMMAND ); @@ -537,7 +537,7 @@ void OptionRow::UpdateText( PlayerNumber p ) if( iChoiceWithFocus == -1 ) break; - CString sText = m_pHand->m_Def.m_vsChoices[iChoiceWithFocus]; + RString sText = m_pHand->m_Def.m_vsChoices[iChoiceWithFocus]; PrepareItemText( sText ); // If player_no is 2 and there is no player 1: @@ -699,7 +699,7 @@ void OptionRow::UpdateEnabledDisabled() } } -void OptionRow::SetOptionIcon( PlayerNumber pn, const CString &sText, GameCommand &gc ) +void OptionRow::SetOptionIcon( PlayerNumber pn, const RString &sText, GameCommand &gc ) { // update bullet Lua *L = LUA->Get(); @@ -782,7 +782,7 @@ void OptionRow::SetOneSharedSelection( int iChoice ) SetOneSelection( pn, iChoice ); } -void OptionRow::SetOneSharedSelectionIfPresent( const CString &sChoice ) +void OptionRow::SetOneSharedSelectionIfPresent( const RString &sChoice ) { for( unsigned i=0; im_Def.m_vsChoices.size(); i++ ) { @@ -870,7 +870,7 @@ void OptionRow::SetSelected( PlayerNumber pn, int iChoice, bool b ) m_vbSelected[pn][iChoice] = b; } -void OptionRow::SetExitText( CString sExitText ) +void OptionRow::SetExitText( RString sExitText ) { BitmapText *bt = m_textItems.back(); bt->SetText( sExitText ); @@ -909,7 +909,7 @@ void OptionRow::Reload() UpdateEnabledDisabled(); } -void OptionRow::HandleMessage( const CString& sMessage ) +void OptionRow::HandleMessage( const RString& sMessage ) { Reload(); } diff --git a/stepmania/src/OptionRow.h b/stepmania/src/OptionRow.h index 35379f7d78..8a7847c748 100644 --- a/stepmania/src/OptionRow.h +++ b/stepmania/src/OptionRow.h @@ -21,8 +21,8 @@ enum SelectType NUM_SELECT_TYPES, SELECT_INVALID }; -const CString& SelectTypeToString( SelectType pm ); -SelectType StringToSelectType( const CString& s ); +const RString& SelectTypeToString( SelectType pm ); +SelectType StringToSelectType( const RString& s ); enum LayoutType { @@ -31,17 +31,17 @@ enum LayoutType NUM_LAYOUT_TYPES, LAYOUT_INVALID }; -const CString& LayoutTypeToString( LayoutType pm ); -LayoutType StringToLayoutType( const CString& s ); +const RString& LayoutTypeToString( LayoutType pm ); +LayoutType StringToLayoutType( const RString& s ); struct OptionRowDefinition { - CString m_sName; - CString m_sExplanationName; + RString m_sName; + RString m_sExplanationName; bool m_bOneChoiceForAllPlayers; SelectType m_selectType; LayoutType m_layoutType; - vector m_vsChoices; + vector m_vsChoices; set m_vEnabledForPlayers; // only players in this set may change focus to this row bool m_bExportOnChange; bool m_bAllowThemeItems; // Should be true for dynamic strings. @@ -87,10 +87,10 @@ struct OptionRowDefinition class OptionRowType { public: - void Load( const CString &sType ); + void Load( const RString &sType ); private: - CString m_sType; + RString m_sType; BitmapText m_textItemParent; OptionsCursor m_UnderlineParent; @@ -137,7 +137,7 @@ public: void LoadNormal( OptionRowHandler *pHand, bool bFirstItemGoesDown ); void LoadExit(); - void SetOptionIcon( PlayerNumber pn, const CString &sText, GameCommand &gc ); + void SetOptionIcon( PlayerNumber pn, const RString &sText, GameCommand &gc ); void ImportOptions( const vector &vpns ); int ExportOptions( const vector &vpns, bool bRowHasFocus[NUM_PLAYERS] ); @@ -156,7 +156,7 @@ public: int GetOneSharedSelection( bool bAllowFail=false ) const; void SetOneSelection( PlayerNumber pn, int iChoice ); void SetOneSharedSelection( int iChoice ); - void SetOneSharedSelectionIfPresent( const CString &sChoice ); + void SetOneSharedSelectionIfPresent( const RString &sChoice ); int GetChoiceInRowWithFocus( PlayerNumber pn ) const; int GetChoiceInRowWithFocusShared() const; @@ -186,20 +186,20 @@ public: unsigned GetTextItemsSize() const { return m_textItems.size(); } bool GetFirstItemGoesDown() const { return m_bFirstItemGoesDown; } - void PrepareItemText( CString &s ) const; - CString OptionTitle( CString s ) const; + void PrepareItemText( RString &s ) const; + RString OptionTitle( RString s ) const; - void SetExitText( CString sExitText ); + void SetExitText( RString sExitText ); void Reload(); // // Messages // - virtual void HandleMessage( const CString& sMessage ); + virtual void HandleMessage( const RString& sMessage ); protected: - CString GetRowTitle() const; + RString GetRowTitle() const; const OptionRowType *m_pParentType; RowType m_RowType; diff --git a/stepmania/src/OptionRowHandler.cpp b/stepmania/src/OptionRowHandler.cpp index e263510f66..3d7cf221fb 100644 --- a/stepmania/src/OptionRowHandler.cpp +++ b/stepmania/src/OptionRowHandler.cpp @@ -25,7 +25,7 @@ #define ENTRY_MODE(s,i) THEME->GetMetric ("ScreenOptionsMaster",ssprintf("%s,%i",(s).c_str(),(i+1))) #define ENTRY_DEFAULT(s) THEME->GetMetric ("ScreenOptionsMaster",(s) + "Default") -void OptionRowHandler::GetIconTextAndGameCommand( int iFirstSelection, CString &sIconTextOut, GameCommand &gcOut ) const +void OptionRowHandler::GetIconTextAndGameCommand( int iFirstSelection, RString &sIconTextOut, GameCommand &gcOut ) const { sIconTextOut = ""; gcOut.Init(); @@ -62,7 +62,7 @@ public: vector m_aListEntries; GameCommand m_Default; bool m_bUseModNameForIcon; - vector m_vsBroadcastOnExport; + vector m_vsBroadcastOnExport; OptionRowHandlerList() { Init(); } virtual void Init() @@ -77,7 +77,7 @@ public: { ASSERT( cmds.v.size() == 1 ); const Command &command = cmds.v[0]; - CString sParam = command.GetArg(1); + RString sParam = command.GetArg(1); ASSERT( command.m_vsArgs.size() == 2 ); ASSERT( sParam.size() ); @@ -98,7 +98,7 @@ public: for( unsigned i=1; i= 0 && pn < NUM_PLAYERS ); m_Def.m_vEnabledForPlayers.insert( pn ); @@ -150,8 +150,8 @@ public: m_aListEntries.push_back( mc ); - CString sName = mc.m_sName; - CString sChoice = mc.m_sName; + RString sName = mc.m_sName; + RString sChoice = mc.m_sName; m_Def.m_vsChoices.push_back( sChoice ); } } @@ -210,7 +210,7 @@ public: { if( iFallbackOption == -1 ) { - CString s = ssprintf("No options in row \"%s\" were selected, and no fallback row found; selected entry 0", m_cmds.v[0].GetName().c_str()); + RString s = ssprintf("No options in row \"%s\" were selected, and no fallback row found; selected entry 0", m_cmds.v[0].GetName().c_str()); LOG->Warn( s ); CHECKPOINT_M( s ); iFallbackOption = 0; @@ -237,12 +237,12 @@ public: m_aListEntries[i].Apply( p ); } } - FOREACH_CONST( CString, m_vsBroadcastOnExport, s ) + FOREACH_CONST( RString, m_vsBroadcastOnExport, s ) MESSAGEMAN->Broadcast( *s ); return 0; } - virtual void GetIconTextAndGameCommand( int iFirstSelection, CString &sIconTextOut, GameCommand &gcOut ) const + virtual void GetIconTextAndGameCommand( int iFirstSelection, RString &sIconTextOut, GameCommand &gcOut ) const { sIconTextOut = m_bUseModNameForIcon ? m_aListEntries[iFirstSelection].m_sModifiers : @@ -265,7 +265,7 @@ class OptionRowHandlerListNoteSkins : public OptionRowHandlerList m_Def.m_bOneChoiceForAllPlayers = false; m_Def.m_bAllowThemeItems = false; // we theme the text ourself - vector arraySkinNames; + vector arraySkinNames; NOTESKIN->GetNoteSkinNames( arraySkinNames ); for( unsigned skin=0; skinm_CourseDifficulty ); + RString s = CourseDifficultyToLocalizedString( pTrail->m_CourseDifficulty ); s += ssprintf( " %d", pTrail->GetMeter() ); m_Def.m_vsChoices.push_back( s ); GameCommand mc; @@ -331,7 +331,7 @@ class OptionRowHandlerListSteps : public OptionRowHandlerList { Steps* pSteps = vpSteps[i]; - CString s; + RString s; if( pSteps->GetDifficulty() == DIFFICULTY_EDIT ) s = pSteps->GetDescription(); else @@ -379,7 +379,7 @@ public: { ASSERT( cmds.v.size() == 1 ); const Command &command = cmds.v[0]; - CString sParam = command.GetArg(1); + RString sParam = command.GetArg(1); ASSERT( command.m_vsArgs.size() == 2 ); ASSERT( sParam.size() ); @@ -437,7 +437,7 @@ public: Steps* pSteps = m_vSteps[i]; Difficulty dc = m_vDifficulties[i]; - CString s; + RString s; if( dc == DIFFICULTY_EDIT ) { if( pSteps ) @@ -540,7 +540,7 @@ class OptionRowHandlerListCharacters: public OptionRowHandlerList for( unsigned i=0; iGetDisplayName(); + RString s = pCharacter->GetDisplayName(); s.MakeUpper(); m_Def.m_vsChoices.push_back( s ); @@ -583,7 +583,7 @@ class OptionRowHandlerListGroups: public OptionRowHandlerList m_Def.m_sName = "Group"; m_Default.m_sSongGroup = GROUP_ALL; - vector vSongGroups; + vector vSongGroups; SONGMAN->GetSongGroupNames( vSongGroups ); ASSERT( vSongGroups.size() ); @@ -594,7 +594,7 @@ class OptionRowHandlerListGroups: public OptionRowHandlerList m_aListEntries.push_back( mc ); } - FOREACH_CONST( CString, vSongGroups, g ) + FOREACH_CONST( RString, vSongGroups, g ) { m_Def.m_vsChoices.push_back( *g ); GameCommand mc; @@ -622,7 +622,7 @@ class OptionRowHandlerListDifficulties: public OptionRowHandlerList FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), d ) { - CString s = DifficultyToLocalizedString( *d ); + RString s = DifficultyToLocalizedString( *d ); m_Def.m_vsChoices.push_back( s ); GameCommand mc; @@ -675,7 +675,7 @@ public: ASSERT( cmds.v.size() == 1 ); const Command &command = cmds.v[0]; ASSERT( command.m_vsArgs.size() == 2 ); - CString sLuaFunction = command.m_vsArgs[1]; + RString sLuaFunction = command.m_vsArgs[1]; ASSERT( sLuaFunction.size() ); m_Def.m_bAllowThemeItems = false; // Lua options are always dynamic and can theme themselves. @@ -824,7 +824,7 @@ public: /* Run the Lua expression. It should return a table. */ const Command &command = m_cmds.v[0]; - CString sName = command.m_vsArgs[0]; + RString sName = command.m_vsArgs[0]; m_pLuaTable->SetFromExpression( sName ); if( m_pLuaTable->GetLuaType() != LUA_TTABLE ) @@ -989,7 +989,7 @@ public: { ASSERT( cmds.v.size() == 1 ); const Command &command = cmds.v[0]; - CString sParam = command.GetArg(1); + RString sParam = command.GetArg(1); ASSERT( command.m_vsArgs.size() == 2 ); ASSERT( sParam.size() ); @@ -1069,7 +1069,7 @@ public: { ASSERT( cmds.v.size() == 1 ); const Command &command = cmds.v[0]; - CString sParam = command.GetArg(1); + RString sParam = command.GetArg(1); ASSERT( command.m_vsArgs.size() == 2 ); ASSERT( sParam.size() ); @@ -1102,7 +1102,7 @@ public: m_Def.m_vsChoices.clear(); FOREACH_CONST( StepsType, m_vStepsTypesToShow, st ) { - CString s = GAMEMAN->StepsTypeToLocalizedString( *st ); + RString s = GAMEMAN->StepsTypeToLocalizedString( *st ); m_Def.m_vsChoices.push_back( s ); } @@ -1182,7 +1182,7 @@ public: m_gc.ApplyToAllPlayers(); return 0; } - virtual void GetIconTextAndGameCommand( int iFirstSelection, CString &sIconTextOut, GameCommand &gcOut ) const + virtual void GetIconTextAndGameCommand( int iFirstSelection, RString &sIconTextOut, GameCommand &gcOut ) const { sIconTextOut = ""; gcOut = m_gc; @@ -1216,7 +1216,7 @@ OptionRowHandler* OptionRowHandlerUtil::Make( const Commands &cmds ) { OptionRowHandler* pHand = NULL; - const CString &name = cmds.v[0].GetName(); + const RString &name = cmds.v[0].GetName(); #define MAKE( type ) { type *p = new type; p->Load( cmds ); pHand = p; } @@ -1225,7 +1225,7 @@ OptionRowHandler* OptionRowHandlerUtil::Make( const Commands &cmds ) { ASSERT( cmds.v.size() == 1 ); const Command &command = cmds.v[0]; - CString sParam = command.GetArg(1); + RString sParam = command.GetArg(1); ASSERT( command.m_vsArgs.size() == 2 ); ASSERT( sParam.size() ); diff --git a/stepmania/src/OptionRowHandler.h b/stepmania/src/OptionRowHandler.h index a875f817f7..d4d0ff52e4 100644 --- a/stepmania/src/OptionRowHandler.h +++ b/stepmania/src/OptionRowHandler.h @@ -15,7 +15,7 @@ class OptionRowHandler public: Commands m_cmds; OptionRowDefinition m_Def; - vector m_vsReloadRowMessages; // refresh this row on on these messages + vector m_vsReloadRowMessages; // refresh this row on on these messages OptionRowHandler::OptionRowHandler() { Init(); } virtual ~OptionRowHandler() { } @@ -48,7 +48,7 @@ public: virtual void ImportOption( const vector &vpns, vector vbSelectedOut[NUM_PLAYERS] ) const = 0; /* Returns an OPT mask. */ virtual int ExportOption( const vector &vpns, const vector vbSelected[NUM_PLAYERS] ) const = 0; - virtual void GetIconTextAndGameCommand( int iFirstSelection, CString &sIconTextOut, GameCommand &gcOut ) const; + virtual void GetIconTextAndGameCommand( int iFirstSelection, RString &sIconTextOut, GameCommand &gcOut ) const; virtual RString GetScreen( int iChoice ) const { return RString(); } }; @@ -62,7 +62,7 @@ namespace OptionRowHandlerUtil int GetOneSelection( const vector &vbSelected ); } -inline void VerifySelected( SelectType st, const vector &vbSelected, const CString &sName ) +inline void VerifySelected( SelectType st, const vector &vbSelected, const RString &sName ) { int iNumSelected = 0; if( st == SELECT_ONE ) diff --git a/stepmania/src/OptionsCursor.cpp b/stepmania/src/OptionsCursor.cpp index 8f6ea15a65..2ff5b31127 100644 --- a/stepmania/src/OptionsCursor.cpp +++ b/stepmania/src/OptionsCursor.cpp @@ -38,9 +38,9 @@ OptionsCursorPlus::OptionsCursorPlus( const OptionsCursorPlus &cpy ): this->AddChild( m_sprCanGoRight ); } -void OptionsCursor::Load( const CString &sType, Element elem ) +void OptionsCursor::Load( const RString &sType, Element elem ) { - CString sPath = THEME->GetPathG( sType, ssprintf("%s 3x2",elem==cursor?"cursor":"underline") ); + RString sPath = THEME->GetPathG( sType, ssprintf("%s 3x2",elem==cursor?"cursor":"underline") ); m_sprMiddle.Load( sPath ); m_sprLeft.Load( sPath ); @@ -51,7 +51,7 @@ void OptionsCursor::Load( const CString &sType, Element elem ) m_sprRight.StopAnimating(); } -void OptionsCursorPlus::Load( const CString &sType, Element elem ) +void OptionsCursorPlus::Load( const RString &sType, Element elem ) { OptionsCursor::Load( sType, elem ); diff --git a/stepmania/src/OptionsCursor.h b/stepmania/src/OptionsCursor.h index 594ff03a7e..0d48d98744 100644 --- a/stepmania/src/OptionsCursor.h +++ b/stepmania/src/OptionsCursor.h @@ -16,7 +16,7 @@ public: OptionsCursor( const OptionsCursor &cpy ); enum Element { cursor, underline }; - void Load( const CString &sType, Element elem ); + void Load( const RString &sType, Element elem ); void Set( PlayerNumber pn ); void StopTweening(); @@ -37,7 +37,7 @@ public: OptionsCursorPlus(); OptionsCursorPlus( const OptionsCursorPlus &cpy ); - void Load( const CString &sType, Element elem ); + void Load( const RString &sType, Element elem ); void StopTweening(); void BeginTweening( float fSecs ); diff --git a/stepmania/src/PaneDisplay.cpp b/stepmania/src/PaneDisplay.cpp index 686a7cb3f9..924502817b 100644 --- a/stepmania/src/PaneDisplay.cpp +++ b/stepmania/src/PaneDisplay.cpp @@ -56,7 +56,7 @@ PaneDisplay::PaneDisplay() m_CurPane = PANE_INVALID; } -void PaneDisplay::Load( const CString &sMetricsGroup, PlayerNumber pn ) +void PaneDisplay::Load( const RString &sMetricsGroup, PlayerNumber pn ) { m_PlayerNumber = pn; @@ -79,7 +79,7 @@ void PaneDisplay::Load( const CString &sMetricsGroup, PlayerNumber pn ) ActorUtil::SetXYAndOnCommand( m_textContents[p], sMetricsGroup, this ); m_ContentsFrame.AddChild( &m_textContents[p] ); - m_Labels[p].Load( THEME->GetPathG(sMetricsGroup,CString(g_Contents[p].name)+" label") ); + m_Labels[p].Load( THEME->GetPathG(sMetricsGroup,RString(g_Contents[p].name)+" label") ); m_Labels[p]->SetName( ssprintf("%sLabel", g_Contents[p].name) ); ActorUtil::SetXYAndOnCommand( m_Labels[p], sMetricsGroup, this ); m_ContentsFrame.AddChild( m_Labels[p] ); @@ -101,17 +101,17 @@ void PaneDisplay::Load( const CString &sMetricsGroup, PlayerNumber pn ) m_CurPane = PANE_INVALID; } -void PaneDisplay::LoadFromNode( const CString &sDir, const XNode *pNode ) +void PaneDisplay::LoadFromNode( const RString &sDir, const XNode *pNode ) { ActorFrame::LoadFromNode( sDir, pNode ); bool b; - CString sMetricsGroup; + RString sMetricsGroup; b = pNode->GetAttrValue( "MetricsGroup", sMetricsGroup ); ASSERT( b ); - CString sPlayerNumber; + RString sPlayerNumber; b = pNode->GetAttrValue( "PlayerNumber", sPlayerNumber ); ASSERT( b ); PlayerNumber pn = (PlayerNumber) LuaHelpers::RunExpressionI(sPlayerNumber); @@ -121,7 +121,7 @@ void PaneDisplay::LoadFromNode( const CString &sDir, const XNode *pNode ) void PaneDisplay::SetContent( PaneContents c ) { - CString str = "?"; // fill this in + RString str = "?"; // fill this in float val = 0; // fill this in const Song *pSong = GAMESTATE->m_pCurSong; diff --git a/stepmania/src/PaneDisplay.h b/stepmania/src/PaneDisplay.h index fd09168229..a3669d3e61 100644 --- a/stepmania/src/PaneDisplay.h +++ b/stepmania/src/PaneDisplay.h @@ -53,10 +53,10 @@ public: PaneDisplay(); virtual Actor *Copy() const; - void Load( const CString &sMetricsGroup, PlayerNumber pn ); + void Load( const RString &sMetricsGroup, PlayerNumber pn ); void SetFromGameState( SortOrder so ); - void LoadFromNode( const CString &sDir, const XNode *pNode ); + void LoadFromNode( const RString &sDir, const XNode *pNode ); // Lua void PushSelf( lua_State *L ); diff --git a/stepmania/src/PercentageDisplay.cpp b/stepmania/src/PercentageDisplay.cpp index da07be4a42..18b3d032fb 100644 --- a/stepmania/src/PercentageDisplay.cpp +++ b/stepmania/src/PercentageDisplay.cpp @@ -25,7 +25,7 @@ PercentageDisplay::PercentageDisplay() m_LastMax = -1; } -void PercentageDisplay::LoadFromNode( const CString& sDir, const XNode* pNode ) +void PercentageDisplay::LoadFromNode( const RString& sDir, const XNode* pNode ) { ActorFrame::LoadFromNode( sDir, pNode ); @@ -58,7 +58,7 @@ void PercentageDisplay::Load( const PlayerState *pPlayerState, const PlayerStage Refresh(); } -void PercentageDisplay::Load( const PlayerState *pPlayerState, const PlayerStageStats *pPlayerStageStats, const CString &sMetricsGroup, bool bAutoRefresh ) +void PercentageDisplay::Load( const PlayerState *pPlayerState, const PlayerStageStats *pPlayerStageStats, const RString &sMetricsGroup, bool bAutoRefresh ) { m_pPlayerState = pPlayerState; m_pPlayerStageStats = pPlayerStageStats; @@ -111,7 +111,7 @@ void PercentageDisplay::Refresh() m_Last = iActualDancePoints; m_LastMax = iCurPossibleDancePoints; - CString sNumToDisplay; + RString sNumToDisplay; if( PREFSMAN->m_bDancePointsForOni ) { @@ -163,7 +163,7 @@ void PercentageDisplay::Refresh() m_textPercent.SetText( sNumToDisplay ); } -CString PercentageDisplay::FormatPercentScore( float fPercentDancePoints ) +RString PercentageDisplay::FormatPercentScore( float fPercentDancePoints ) { // TRICKY: printf will round, but we want to truncate. Otherwise, we may display a percent // score that's too high and doesn't match up with the calculated grade. @@ -175,7 +175,7 @@ CString PercentageDisplay::FormatPercentScore( float fPercentDancePoints ) fPercentDancePoints = ftruncf( fPercentDancePoints, fTruncInterval ); - CString s = ssprintf( "%*.*f%%", (int)PERCENT_TOTAL_SIZE, (int)PERCENT_DECIMAL_PLACES, fPercentDancePoints*100 ); + RString s = ssprintf( "%*.*f%%", (int)PERCENT_TOTAL_SIZE, (int)PERCENT_DECIMAL_PLACES, fPercentDancePoints*100 ); return s; } diff --git a/stepmania/src/PercentageDisplay.h b/stepmania/src/PercentageDisplay.h index b58eb76c99..4b36220019 100644 --- a/stepmania/src/PercentageDisplay.h +++ b/stepmania/src/PercentageDisplay.h @@ -16,12 +16,12 @@ class PercentageDisplay: public ActorFrame public: PercentageDisplay(); void Load( const PlayerState *pPlayerState, const PlayerStageStats *pPlayerStageStats ); - void Load( const PlayerState *pPlayerState, const PlayerStageStats *pPlayerStageStats, const CString &sMetricsGroup, bool bAutoRefresh ); + void Load( const PlayerState *pPlayerState, const PlayerStageStats *pPlayerStageStats, const RString &sMetricsGroup, bool bAutoRefresh ); void Update( float fDeltaTime ); - virtual void LoadFromNode( const CString& sDir, const XNode* pNode ); + virtual void LoadFromNode( const RString& sDir, const XNode* pNode ); virtual Actor *Copy() const; - static CString FormatPercentScore( float fPercentDancePoints ); + static RString FormatPercentScore( float fPercentDancePoints ); // // Lua diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 14b2deab8a..56fcfda5f0 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -44,8 +44,8 @@ #include "GameCommand.h" #include "LocalizedString.h" -CString COMBO_X_NAME( size_t p, size_t both_sides ) { return "ComboXOffset" + (both_sides ? CString("BothSides") : ssprintf("OneSideP%d",int(p+1)) ); } -CString ATTACK_DISPLAY_X_NAME( size_t p, size_t both_sides ){ return "AttackDisplayXOffset" + (both_sides ? CString("BothSides") : ssprintf("OneSideP%d",int(p+1)) ); } +RString COMBO_X_NAME( size_t p, size_t both_sides ) { return "ComboXOffset" + (both_sides ? RString("BothSides") : ssprintf("OneSideP%d",int(p+1)) ); } +RString ATTACK_DISPLAY_X_NAME( size_t p, size_t both_sides ){ return "AttackDisplayXOffset" + (both_sides ? RString("BothSides") : ssprintf("OneSideP%d",int(p+1)) ); } /* Distance to search for a note in Step(), in seconds. */ static const float StepSearchDistance = 1.0f; @@ -134,7 +134,7 @@ Player::~Player() /* Init() does the expensive stuff: load sounds and note skins. Load() just loads a NoteData. */ void Player::Init( - const CString &sType, + const RString &sType, PlayerState* pPlayerState, PlayerStageStats* pPlayerStageStats, LifeMeter* pLM, @@ -431,14 +431,14 @@ void Player::Load( const NoteData& noteData ) // fade on the copy. // const Song* pSong = GAMESTATE->m_pCurSong; - CString sSongDir = pSong->GetSongDir(); + RString sSongDir = pSong->GetSongDir(); m_vKeysounds.resize( pSong->m_vsKeysoundFile.size() ); RageSoundParams p; GameSoundManager::SetPlayerBalance( pn, p ); for( unsigned i=0; im_vsKeysoundFile[i]; + RString sKeysoundFilePath = sSongDir + pSong->m_vsKeysoundFile[i]; RageSound& sound = m_vKeysounds[i]; if( sound.GetLoadedFilePath() != sKeysoundFilePath ) sound.Load( sKeysoundFilePath, true ); @@ -1344,7 +1344,7 @@ void Player::HandleAutosync(float fNoteOffset) const float mean = calc_mean( m_fOffset, m_fOffset+SAMPLE_COUNT ); const float stddev = calc_stddev( m_fOffset, m_fOffset+SAMPLE_COUNT ); - CString sAutosyncType; + RString sAutosyncType; switch( GAMESTATE->m_SongOptions.m_AutosyncType ) { case SongOptions::AUTOSYNC_SONG: @@ -1855,7 +1855,7 @@ bool Player::IsPlayingBeginner() const return pSteps && pSteps->GetDifficulty() == DIFFICULTY_BEGINNER; } -void Player::HandleMessage( const CString& sMessage ) +void Player::HandleMessage( const RString& sMessage ) { // Reset autosync samples when toggling if( sMessage == MessageToString(Message_AutosyncChanged) ) diff --git a/stepmania/src/Player.h b/stepmania/src/Player.h index 5fe5cba54a..64d7084ce1 100644 --- a/stepmania/src/Player.h +++ b/stepmania/src/Player.h @@ -33,10 +33,10 @@ public: virtual void Update( float fDeltaTime ); virtual void ProcessMessages( float fDeltaTime ); virtual void DrawPrimitives(); - virtual void HandleMessage( const CString& sMessage ); + virtual void HandleMessage( const RString& sMessage ); void Init( - const CString &sType, + const RString &sType, PlayerState* pPlayerState, PlayerStageStats* pPlayerStageStats, LifeMeter* pLM, @@ -119,7 +119,7 @@ protected: vector m_vKeysounds; - CString m_sMessageToSendOnStep; + RString m_sMessageToSendOnStep; ThemeMetric GRAY_ARROWS_Y_STANDARD; ThemeMetric GRAY_ARROWS_Y_REVERSE; diff --git a/stepmania/src/PlayerAI.cpp b/stepmania/src/PlayerAI.cpp index fff3cdbd23..5e9026db91 100644 --- a/stepmania/src/PlayerAI.cpp +++ b/stepmania/src/PlayerAI.cpp @@ -38,7 +38,7 @@ void PlayerAI::InitFromDisk() for( int i=0; i &AddTo, float level, CString name ) +static void AddPart( vector &AddTo, float level, RString name ) { if( level == 0 ) return; - const CString LevelStr = (level == 1)? CString(""): ssprintf( "%i%% ", (int) roundf(level*100) ); + const RString LevelStr = (level == 1)? RString(""): ssprintf( "%i%% ", (int) roundf(level*100) ); AddTo.push_back( LevelStr + name ); } -CString PlayerOptions::GetString() const +RString PlayerOptions::GetString() const { - vector v; + vector v; GetMods( v ); return join( ", ", v ); } -void PlayerOptions::GetMods( vector &AddTo ) const +void PlayerOptions::GetMods( vector &AddTo ) const { - CString sReturn; + RString sReturn; if( !m_fTimeSpacing ) { if( m_bSetScrollSpeed || m_fScrollSpeed != 1 ) { /* -> 1.00 */ - CString s = ssprintf( "%2.2f", m_fScrollSpeed ); + RString s = ssprintf( "%2.2f", m_fScrollSpeed ); if( s[s.size()-1] == '0' ) { /* -> 1.0 */ @@ -106,7 +106,7 @@ void PlayerOptions::GetMods( vector &AddTo ) const } else { - CString s = ssprintf( "C%.0f", m_fScrollBPM ); + RString s = ssprintf( "C%.0f", m_fScrollBPM ); AddTo.push_back( s ); } @@ -194,7 +194,7 @@ void PlayerOptions::GetMods( vector &AddTo ) const if( !m_sNoteSkin.empty() && m_sNoteSkin.CompareNoCase("default")!=0 ) { - CString s = m_sNoteSkin; + RString s = m_sNoteSkin; Capitalize( s ); AddTo.push_back( s ); } @@ -202,17 +202,17 @@ void PlayerOptions::GetMods( vector &AddTo ) const /* Options are added to the current settings; call Init() beforehand if * you don't want this. */ -void PlayerOptions::FromString( CString sOptions, bool bWarnOnInvalid ) +void PlayerOptions::FromString( RString sOptions, bool bWarnOnInvalid ) { ASSERT( NOTESKIN ); // Init(); sOptions.MakeLower(); - vector asBits; + vector asBits; split( sOptions, ",", asBits, true ); - FOREACH( CString, asBits, bit ) + FOREACH( RString, asBits, bit ) { - CString& sBit = *bit; + RString& sBit = *bit; TrimLeft(sBit); TrimRight(sBit); @@ -223,10 +223,10 @@ void PlayerOptions::FromString( CString sOptions, bool bWarnOnInvalid ) float level = 1; float speed = 1; - vector asParts; + vector asParts; split( sBit, " ", asParts, true ); - FOREACH_CONST( CString, asParts, s ) + FOREACH_CONST( RString, asParts, s ) { if( *s == "no" ) { @@ -254,7 +254,7 @@ void PlayerOptions::FromString( CString sOptions, bool bWarnOnInvalid ) const bool on = (level > 0.5f); static Regex mult("^([0-9]+(\\.[0-9]+)?)x$"); - vector matches; + vector matches; if( mult.Compare(sBit, matches) ) { char *p = NULL; @@ -342,7 +342,7 @@ void PlayerOptions::FromString( CString sOptions, bool bWarnOnInvalid ) { if( bWarnOnInvalid ) { - CString sWarning = ssprintf( "The options string '%s' contains an invalid mod name '%s'", sOptions.c_str(), sBit.c_str() ); + RString sWarning = ssprintf( "The options string '%s' contains an invalid mod name '%s'", sOptions.c_str(), sBit.c_str() ); LOG->Warn( "%s", sWarning.c_str() ); Dialog::OK( sWarning, "INVALID_PLAYER_OPTION_WARNING" ); } @@ -616,17 +616,17 @@ bool PlayerOptions::IsEasierForCourseAndTrail( Course* pCourse, Trail* pTrail ) return false; } -void PlayerOptions::GetThemedMods( vector &AddTo ) const +void PlayerOptions::GetThemedMods( vector &AddTo ) const { - vector vMods; + vector vMods; GetMods( vMods ); - FOREACH_CONST( CString, vMods, s ) + FOREACH_CONST( RString, vMods, s ) { - const CString& sOneMod = *s; + const RString& sOneMod = *s; ASSERT( !sOneMod.empty() ); - vector asTokens; + vector asTokens; split( sOneMod, " ", asTokens ); if( asTokens.empty() ) @@ -643,7 +643,7 @@ void PlayerOptions::GetThemedMods( vector &AddTo ) const * characters might use modifiers that don't exist in the theme. */ asTokens.back() = CommonMetrics::ThemeOptionItem( asTokens.back(), true ); - CString sThemedMod = join( " ", asTokens ); + RString sThemedMod = join( " ", asTokens ); AddTo.push_back( sThemedMod ); } @@ -664,7 +664,7 @@ bool PlayerOptions::ContainsTransformOrTurn() const return false; } -CString PlayerOptions::GetSavedPrefsString() const +RString PlayerOptions::GetSavedPrefsString() const { PlayerOptions po_prefs; #define SAVE(x) po_prefs.x = this->x; diff --git a/stepmania/src/PlayerOptions.h b/stepmania/src/PlayerOptions.h index 80ee20067a..ca9a3a1dc9 100644 --- a/stepmania/src/PlayerOptions.h +++ b/stepmania/src/PlayerOptions.h @@ -16,12 +16,12 @@ public: PlayerOptions() { Init(); }; void Init(); void Approach( const PlayerOptions& other, float fDeltaSeconds ); - CString GetString() const; - CString GetSavedPrefsString() const; // only the basic options that players would want for every song + RString GetString() const; + RString GetSavedPrefsString() const; // only the basic options that players would want for every song void ResetSavedPrefs(); - void GetMods( vector &AddTo ) const; - void GetThemedMods( vector &AddTo ) const; - void FromString( CString sOptions, bool bWarnOnInvalid = false ); + void GetMods( vector &AddTo ) const; + void GetThemedMods( vector &AddTo ) const; + void FromString( RString sOptions, bool bWarnOnInvalid = false ); void ChooseRandomModifiers(); bool ContainsTransformOrTurn() const; @@ -134,7 +134,7 @@ public: bool m_bTransforms[NUM_TRANSFORMS]; ScoreDisplay m_ScoreDisplay; - CString m_sNoteSkin; + RString m_sNoteSkin; void NextAccel(); void NextEffect(); diff --git a/stepmania/src/Preference.cpp b/stepmania/src/Preference.cpp index dbb53f3e2a..bdf0d47e18 100644 --- a/stepmania/src/Preference.cpp +++ b/stepmania/src/Preference.cpp @@ -9,7 +9,7 @@ static SubscriptionManager m_Subscribers; -IPreference::IPreference( const CString& sName ): +IPreference::IPreference( const RString& sName ): m_sName( sName ) { m_Subscribers.Subscribe( this ); @@ -20,7 +20,7 @@ IPreference::~IPreference() m_Subscribers.Unsubscribe( this ); } -IPreference *IPreference::GetPreferenceByName( const CString &sName ) +IPreference *IPreference::GetPreferenceByName( const RString &sName ) { FOREACHS( IPreference*, *m_Subscribers.m_pSubscribers, p ) { @@ -75,11 +75,11 @@ void IPreference::SetFromStack( lua_State *L ) lua_pop( L, 1 ); } #define READFROM_AND_WRITETO( type ) \ - template<> CString PrefToString( const type &v ) \ + template<> RString PrefToString( const type &v ) \ { \ return ::ToString( v ); \ } \ - template<> void PrefFromString( const CString &s, type &v ) \ + template<> void PrefFromString( const RString &s, type &v ) \ { \ ::FromString( s, v ); \ } \ @@ -95,11 +95,11 @@ void IPreference::SetFromStack( lua_State *L ) READFROM_AND_WRITETO( int ) READFROM_AND_WRITETO( float ) READFROM_AND_WRITETO( bool ) -READFROM_AND_WRITETO( CString ) +READFROM_AND_WRITETO( RString ) void IPreference::ReadFrom( const XNode* pNode ) { - CString sVal; + RString sVal; if( pNode->GetAttrValue(m_sName, sVal) ) FromString( sVal ); } @@ -112,13 +112,13 @@ void IPreference::WriteTo( XNode* pNode ) const /* Load our value from the node, and make it the new default. */ void IPreference::ReadDefaultFrom( const XNode* pNode ) { - CString sVal; + RString sVal; if( !pNode->GetAttrValue(m_sName, sVal) ) return; SetDefaultFromString( sVal ); } -void BroadcastPreferenceChanged( const CString& sPreferenceName ) +void BroadcastPreferenceChanged( const RString& sPreferenceName ) { if( MESSAGEMAN ) MESSAGEMAN->Broadcast( sPreferenceName+"Changed" ); diff --git a/stepmania/src/Preference.h b/stepmania/src/Preference.h index 089739a5a3..0b06953f34 100644 --- a/stepmania/src/Preference.h +++ b/stepmania/src/Preference.h @@ -11,37 +11,37 @@ struct lua_State; class IPreference { public: - IPreference( const CString& sName ); + IPreference( const RString& sName ); virtual ~IPreference(); void ReadFrom( const XNode* pNode ); void WriteTo( XNode* pNode ) const; void ReadDefaultFrom( const XNode* pNode ); virtual void LoadDefault() = 0; - virtual void SetDefaultFromString( const CString &s ) = 0; + virtual void SetDefaultFromString( const RString &s ) = 0; - virtual CString ToString() const = 0; - virtual void FromString( const CString &s ) = 0; + virtual RString ToString() const = 0; + virtual void FromString( const RString &s ) = 0; virtual void SetFromStack( lua_State *L ); virtual void PushValue( lua_State *L ) const; - const CString &GetName() const { return m_sName; } + const RString &GetName() const { return m_sName; } - static IPreference *GetPreferenceByName( const CString &sName ); + static IPreference *GetPreferenceByName( const RString &sName ); static void LoadAllDefaults(); static void ReadAllPrefsFromNode( const XNode* pNode ); static void SavePrefsToNode( XNode* pNode ); static void ReadAllDefaultsFromNode( const XNode* pNode ); protected: - CString m_sName; + RString m_sName; }; -void BroadcastPreferenceChanged( const CString& sPreferenceName ); +void BroadcastPreferenceChanged( const RString& sPreferenceName ); -template CString PrefToString( const BasicType &v ); -template void PrefFromString( const CString &s, BasicType &v ); +template RString PrefToString( const BasicType &v ); +template void PrefFromString( const RString &s, BasicType &v ); template void PrefSetFromStack( lua_State *L, BasicType &v ); template void PrefPushValue( lua_State *L, const BasicType &v ); @@ -49,7 +49,7 @@ template class Preference : public IPreference { public: - Preference( const CString& sName, const T& defaultValue ): + Preference( const RString& sName, const T& defaultValue ): IPreference( sName ), m_currentValue( defaultValue ), m_defaultValue( defaultValue ) @@ -57,8 +57,8 @@ public: LoadDefault(); } - CString ToString() const { return PrefToString( (const BasicType &) m_currentValue ); } - void FromString( const CString &s ) { PrefFromString( s, (BasicType &)m_currentValue ); } + RString ToString() const { return PrefToString( (const BasicType &) m_currentValue ); } + void FromString( const RString &s ) { PrefFromString( s, (BasicType &)m_currentValue ); } void SetFromStack( lua_State *L ) { PrefSetFromStack( L, (BasicType &)m_currentValue ); } void PushValue( lua_State *L ) const { PrefPushValue( L, (BasicType &)m_currentValue ); } @@ -66,7 +66,7 @@ public: { m_currentValue = m_defaultValue; } - void SetDefaultFromString( const CString &s ) + void SetDefaultFromString( const RString &s ) { PrefFromString( s, (BasicType &)m_defaultValue ); } @@ -99,11 +99,11 @@ class Preference1D vector m_v; public: - Preference1D( void pfn(size_t i, CString &sNameOut, T &defaultValueOut ), size_t N ) + Preference1D( void pfn(size_t i, RString &sNameOut, T &defaultValueOut ), size_t N ) { for( size_t i=0; i(sName, defaultValue) ); diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index 333153bc58..198b90c083 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -10,11 +10,11 @@ #include "RageLog.h" -const CString DEFAULTS_INI_PATH = "Data/Defaults.ini"; // these can be overridden +const RString DEFAULTS_INI_PATH = "Data/Defaults.ini"; // these can be overridden //PREFERENCES_INI_PATH // overlay on Defaults.ini, contains the user's choices #include "SpecialFiles.h" -const CString STATIC_INI_PATH = "Data/Static.ini"; // overlay on the 2 above, can't be overridden -const CString TYPE_TXT_FILE = "Data/Type.txt"; +const RString STATIC_INI_PATH = "Data/Static.ini"; // overlay on the 2 above, can't be overridden +const RString TYPE_TXT_FILE = "Data/Type.txt"; PrefsManager* PREFSMAN = NULL; // global and accessable from anywhere in our program @@ -53,7 +53,7 @@ bool g_bAutoRestart = false; # define TRUE_IF_DEBUG false #endif -void TimingWindowSecondsInit( size_t /*TimingWindow*/ i, CString &sNameOut, float &defaultValueOut ) +void TimingWindowSecondsInit( size_t /*TimingWindow*/ i, RString &sNameOut, float &defaultValueOut ) { sNameOut = "TimingWindowSeconds" + TimingWindowToString( (TimingWindow)i ); switch( i ) @@ -71,7 +71,7 @@ void TimingWindowSecondsInit( size_t /*TimingWindow*/ i, CString &sNameOut, floa } } -void PercentScoreWeightInit( size_t /*ScoreEvent*/ i, CString &sNameOut, int &defaultValueOut ) +void PercentScoreWeightInit( size_t /*ScoreEvent*/ i, RString &sNameOut, int &defaultValueOut ) { sNameOut = "PercentScoreWeight" + ScoreEventToString( (ScoreEvent)i ); switch( i ) @@ -89,7 +89,7 @@ void PercentScoreWeightInit( size_t /*ScoreEvent*/ i, CString &sNameOut, int &de } } -void GradeWeightInit( size_t /*ScoreEvent*/ i, CString &sNameOut, int &defaultValueOut ) +void GradeWeightInit( size_t /*ScoreEvent*/ i, RString &sNameOut, int &defaultValueOut ) { sNameOut = "GradeWeight" + ScoreEventToString( (ScoreEvent)i ); switch( i ) @@ -107,7 +107,7 @@ void GradeWeightInit( size_t /*ScoreEvent*/ i, CString &sNameOut, int &defaultVa } } -void SuperMeterPercentChangeInit( size_t /*ScoreEvent*/ i, CString &sNameOut, float &defaultValueOut ) +void SuperMeterPercentChangeInit( size_t /*ScoreEvent*/ i, RString &sNameOut, float &defaultValueOut ) { sNameOut = "SuperMeterPercentChange" + ScoreEventToString( (ScoreEvent)i ); switch( i ) @@ -125,7 +125,7 @@ void SuperMeterPercentChangeInit( size_t /*ScoreEvent*/ i, CString &sNameOut, fl } } -void TimeMeterSecondsChangeInit( size_t /*ScoreEvent*/ i, CString &sNameOut, float &defaultValueOut ) +void TimeMeterSecondsChangeInit( size_t /*ScoreEvent*/ i, RString &sNameOut, float &defaultValueOut ) { sNameOut = "TimeMeterSecondsChange" + ScoreEventToString( (ScoreEvent)i ); switch( i ) @@ -334,7 +334,7 @@ PrefsManager::~PrefsManager() { } -void PrefsManager::SetCurrentGame( const CString &sGame ) +void PrefsManager::SetCurrentGame( const RString &sGame ) { if( m_sCurrentGame.Get() == sGame ) return; // redundant @@ -364,7 +364,7 @@ void PrefsManager::RestoreGamePrefs() // load prefs GamePrefs gp; - map::const_iterator iter = m_mapGameNameToGamePrefs.find( m_sCurrentGame ); + map::const_iterator iter = m_mapGameNameToGamePrefs.find( m_sCurrentGame ); if( iter != m_mapGameNameToGamePrefs.end() ) gp = iter->second; @@ -399,7 +399,7 @@ void PrefsManager::ResetToFactoryDefaults() SavePrefsToDisk(); } -void PrefsManager::ReadPrefsFromFile( const CString &sIni, const CString &sSection ) +void PrefsManager::ReadPrefsFromFile( const RString &sIni, const RString &sSection ) { IniFile ini; if( !ini.ReadFile(sIni) ) @@ -408,13 +408,13 @@ void PrefsManager::ReadPrefsFromFile( const CString &sIni, const CString &sSecti ReadPrefsFromIni( ini, sSection ); } -static const CString GAME_SECTION_PREFIX = "Game-"; +static const RString GAME_SECTION_PREFIX = "Game-"; -void PrefsManager::ReadPrefsFromIni( const IniFile &ini, const CString &sSection ) +void PrefsManager::ReadPrefsFromIni( const IniFile &ini, const RString &sSection ) { // Apply our fallback recursively (if any) before applying ourself. // TODO: detect circular? - CString sFallback; + RString sFallback; if( ini.GetValue(sSection,"Fallback",sFallback) ) { ReadPrefsFromIni( ini, sFallback ); @@ -435,7 +435,7 @@ void PrefsManager::ReadPrefsFromIni( const IniFile &ini, const CString &sSection m_RandomBackgroundMode.Set( (RandomBackgroundMode)clamp((int)m_RandomBackgroundMode.Get(),0,(int)NUM_RandomBackgroundMode-1) ); } -void PrefsManager::ReadGamePrefsFromIni( const CString &sIni ) +void PrefsManager::ReadGamePrefsFromIni( const RString &sIni ) { IniFile ini; if( !ini.ReadFile(sIni) ) @@ -446,7 +446,7 @@ void PrefsManager::ReadGamePrefsFromIni( const CString &sIni ) if( !BeginsWith(section->m_sName, GAME_SECTION_PREFIX) ) continue; - CString sGame = section->m_sName.Right( section->m_sName.length() - GAME_SECTION_PREFIX.length() ); + RString sGame = section->m_sName.Right( section->m_sName.length() - GAME_SECTION_PREFIX.length() ); GamePrefs &gp = m_mapGameNameToGamePrefs[ sGame ]; ini.GetValue( section->m_sName, "Announcer", gp.m_sAnnouncer ); @@ -455,7 +455,7 @@ void PrefsManager::ReadGamePrefsFromIni( const CString &sIni ) } } -void PrefsManager::ReadDefaultsFromFile( const CString &sIni, const CString &sSection ) +void PrefsManager::ReadDefaultsFromFile( const RString &sIni, const RString &sSection ) { IniFile ini; if( !ini.ReadFile(sIni) ) @@ -464,11 +464,11 @@ void PrefsManager::ReadDefaultsFromFile( const CString &sIni, const CString &sSe ReadDefaultsFromIni( ini, sSection ); } -void PrefsManager::ReadDefaultsFromIni( const IniFile &ini, const CString &sSection ) +void PrefsManager::ReadDefaultsFromIni( const IniFile &ini, const RString &sSection ) { // Apply our fallback recursively (if any) before applying ourself. // TODO: detect circular? - CString sFallback; + RString sFallback; if( ini.GetValue(sSection,"Fallback",sFallback) ) ReadDefaultsFromIni( ini, sFallback ); @@ -492,9 +492,9 @@ void PrefsManager::SavePrefsToIni( IniFile &ini ) pNode = ini.AppendChild( "Options" ); IPreference::SavePrefsToNode( pNode ); - FOREACHM_CONST( CString, GamePrefs, m_mapGameNameToGamePrefs, iter ) + FOREACHM_CONST( RString, GamePrefs, m_mapGameNameToGamePrefs, iter ) { - CString sSection = "Game-" + CString( iter->first ); + RString sSection = "Game-" + RString( iter->first ); ini.SetValue( sSection, "Announcer", iter->second.m_sAnnouncer ); ini.SetValue( sSection, "Theme", iter->second.m_sTheme ); @@ -503,9 +503,9 @@ void PrefsManager::SavePrefsToIni( IniFile &ini ) } -CString PrefsManager::GetPreferencesSection() const +RString PrefsManager::GetPreferencesSection() const { - CString sSection = "Preferences"; + RString sSection = "Preferences"; // OK if this fails GetFileContents( TYPE_TXT_FILE, sSection, true ); @@ -534,7 +534,7 @@ public: static int GetPreference( T* p, lua_State *L ) { - CString sName = SArg(1); + RString sName = SArg(1); IPreference *pPref = IPreference::GetPreferenceByName( sName ); if( pPref == NULL ) { @@ -548,7 +548,7 @@ public: } static int SetPreference( T* p, lua_State *L ) { - CString sName = SArg(1); + RString sName = SArg(1); IPreference *pPref = IPreference::GetPreferenceByName( sName ); if( pPref == NULL ) @@ -563,7 +563,7 @@ public: } static int SetPreferenceToDefault( T* p, lua_State *L ) { - CString sName = SArg(1); + RString sName = SArg(1); IPreference *pPref = IPreference::GetPreferenceByName( sName ); if( pPref == NULL ) diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index c3ddfb876d..4f22b9fd97 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -18,26 +18,26 @@ public: void Init(); - void SetCurrentGame( const CString &sGame ); - CString GetCurrentGame() { return m_sCurrentGame; } + void SetCurrentGame( const RString &sGame ); + RString GetCurrentGame() { return m_sCurrentGame; } protected: - Preference m_sCurrentGame; + Preference m_sCurrentGame; public: // Game-specific prefs. Copy these off and save them every time the game changes - Preference m_sAnnouncer; - Preference m_sTheme; - Preference m_sDefaultModifiers; + Preference m_sAnnouncer; + Preference m_sTheme; + Preference m_sDefaultModifiers; protected: void StoreGamePrefs(); void RestoreGamePrefs(); struct GamePrefs { - CString m_sAnnouncer; - CString m_sTheme; - CString m_sDefaultModifiers; + RString m_sAnnouncer; + RString m_sTheme; + RString m_sDefaultModifiers; }; - map m_mapGameNameToGamePrefs; + map m_mapGameNameToGamePrefs; public: Preference m_bWindowed; @@ -158,8 +158,8 @@ public: Preference m_iProgressiveNonstopLifebar; Preference m_bShowBeginnerHelper; Preference m_bDisableScreenSaver; - Preference m_sLanguage; - Preference m_sMemoryCardProfileSubdir; // the directory on a memory card to look in for a profile + Preference m_sLanguage; + Preference m_sMemoryCardProfileSubdir; // the directory on a memory card to look in for a profile Preference m_iProductID; // Saved in HighScore to track what software version a score came from. Preference m_bMemoryCards; Preference m_iCenterImageTranslateX; @@ -206,17 +206,17 @@ public: enum ScoringType { SCORING_NEW, SCORING_OLD }; Preference m_ScoringType; - Preference m_sAdditionalSongFolders; - Preference m_sAdditionalFolders; + Preference m_sAdditionalSongFolders; + Preference m_sAdditionalFolders; - Preference m_sLastSeenVideoDriver; - Preference m_sVideoRenderers; // StepMania.cpp sets these on first run based on the card + Preference m_sLastSeenVideoDriver; + Preference m_sVideoRenderers; // StepMania.cpp sets these on first run based on the card Preference m_bSmoothLines; Preference m_fSoundVolume; Preference m_iSoundWriteAhead; - Preference m_iSoundDevice; + Preference m_iSoundDevice; Preference m_iSoundPreferredSampleRate; - Preference m_sLightsStepsDifficulty; + Preference m_sLightsStepsDifficulty; Preference m_bBlinkGameplayButtonLightsOnNote; Preference m_bAllowUnacceleratedRenderer; Preference m_bThreadedInput; @@ -224,8 +224,8 @@ public: Preference m_bScreenTestMode; Preference m_bDebugLights; Preference m_bMonkeyInput; - Preference m_sMachineName; - Preference m_sCoursesToShowRanking; + Preference m_sMachineName; + Preference m_sCoursesToShowRanking; /* Debug: */ Preference m_bLogToDisk; @@ -245,9 +245,9 @@ public: float GetSoundVolume(); - void ReadPrefsFromIni( const IniFile &ini, const CString &sSection ); - void ReadGamePrefsFromIni( const CString &sIni ); - void ReadDefaultsFromIni( const IniFile &ini, const CString &sSection ); + void ReadPrefsFromIni( const IniFile &ini, const RString &sSection ); + void ReadGamePrefsFromIni( const RString &sIni ); + void ReadDefaultsFromIni( const IniFile &ini, const RString &sSection ); void SavePrefsToIni( IniFile &ini ); void ReadPrefsFromDisk(); @@ -255,14 +255,14 @@ public: void ResetToFactoryDefaults(); - CString GetPreferencesSection() const; + RString GetPreferencesSection() const; // Lua void PushSelf( lua_State *L ); protected: - void ReadPrefsFromFile( const CString &sIni, const CString &sSection ); - void ReadDefaultsFromFile( const CString &sIni, const CString &sSection ); + void ReadPrefsFromFile( const RString &sIni, const RString &sSection ); + void ReadDefaultsFromFile( const RString &sIni, const RString &sSection ); }; diff --git a/stepmania/src/Profile.cpp b/stepmania/src/Profile.cpp index 385979d8d7..c4571dd8f7 100644 --- a/stepmania/src/Profile.cpp +++ b/stepmania/src/Profile.cpp @@ -26,15 +26,15 @@ #include "CharacterManager.h" #include "Character.h" -const CString STATS_XSL = "Stats.xsl"; -const CString COMMON_XSL = "Common.xsl"; -const CString STATS_XML = "Stats.xml"; -const CString EDITABLE_INI = "Editable.ini"; -const CString DONT_SHARE_SIG = "DontShare.sig"; -const CString PUBLIC_KEY_FILE = "public.key"; -const CString SCREENSHOTS_SUBDIR = "Screenshots/"; -const CString EDIT_STEPS_SUBDIR = "Edits/"; -const CString EDIT_COURSES_SUBDIR = "EditCourses/"; +const RString STATS_XSL = "Stats.xsl"; +const RString COMMON_XSL = "Common.xsl"; +const RString STATS_XML = "Stats.xml"; +const RString EDITABLE_INI = "Editable.ini"; +const RString DONT_SHARE_SIG = "DontShare.sig"; +const RString PUBLIC_KEY_FILE = "public.key"; +const RString SCREENSHOTS_SUBDIR = "Screenshots/"; +const RString EDIT_STEPS_SUBDIR = "Edits/"; +const RString EDIT_COURSES_SUBDIR = "EditCourses/"; #define GUID_SIZE_BYTES 8 @@ -81,13 +81,13 @@ void Profile::InitEditableData() m_iWeightPounds = 0; } -CString Profile::MakeGuid() +RString Profile::MakeGuid() { // Does the RNG need to be inited and seeded every time? random_init(); random_add_noise( "ai8049ujr3odusj" ); - CString s; + RString s; for( unsigned i=0; iGetDefaultCharacter(); } -static CString FormatCalories( float fCals ) +static RString FormatCalories( float fCals ) { return Commify((int)fCals) + " Cal"; } @@ -213,12 +213,12 @@ int Profile::GetCalculatedWeightPounds() const return m_iWeightPounds; } -CString Profile::GetDisplayTotalCaloriesBurned() const +RString Profile::GetDisplayTotalCaloriesBurned() const { return FormatCalories( m_fTotalCaloriesBurned ); } -CString Profile::GetDisplayTotalCaloriesBurnedToday() const +RString Profile::GetDisplayTotalCaloriesBurnedToday() const { float fCals = GetCaloriesBurnedToday(); return FormatCalories( fCals ); @@ -514,9 +514,9 @@ int Profile::GetSongNumTimesPlayed( const SongID& songID ) const * In practice, we get the default modifiers from the theme the first time a game * is played, and from the profile every time thereafter. */ -bool Profile::GetDefaultModifiers( const Game* pGameType, CString &sModifiersOut ) const +bool Profile::GetDefaultModifiers( const Game* pGameType, RString &sModifiersOut ) const { - map::const_iterator it; + map::const_iterator it; it = m_sDefaultModifiers.find( pGameType->m_szName ); if( it == m_sDefaultModifiers.end() ) return false; @@ -524,7 +524,7 @@ bool Profile::GetDefaultModifiers( const Game* pGameType, CString &sModifiersOut return true; } -void Profile::SetDefaultModifiers( const Game* pGameType, const CString &sModifiers ) +void Profile::SetDefaultModifiers( const Game* pGameType, const RString &sModifiers ) { if( sModifiers == "" ) m_sDefaultModifiers.erase( pGameType->m_szName ); @@ -805,7 +805,7 @@ void Profile::IncrementCategoryPlayCount( StepsType st, RankingCategory rc ) if( X==NULL ) LOG->Warn("Failed to read section " #X); \ else Load##X##FromNode(X); } -ProfileLoadResult Profile::LoadAllFromDir( CString sDir, bool bRequireSignature ) +ProfileLoadResult Profile::LoadAllFromDir( RString sDir, bool bRequireSignature ) { CHECKPOINT; @@ -819,7 +819,7 @@ ProfileLoadResult Profile::LoadAllFromDir( CString sDir, bool bRequireSignature LoadEditableDataFromDir( sDir ); // Check for the existance of stats.xml - CString fn = sDir + STATS_XML; + RString fn = sDir + STATS_XML; if( !IsAFile(fn) ) return ProfileLoadResult_FailedNoProfile; @@ -838,8 +838,8 @@ ProfileLoadResult Profile::LoadAllFromDir( CString sDir, bool bRequireSignature if( bRequireSignature ) { - CString sStatsXmlSigFile = fn+SIGNATURE_APPEND; - CString sDontShareFile = sDir + DONT_SHARE_SIG; + RString sStatsXmlSigFile = fn+SIGNATURE_APPEND; + RString sDontShareFile = sDir + DONT_SHARE_SIG; LOG->Trace( "Verifying don't share signature" ); // verify the stats.xml signature with the "don't share" file @@ -884,9 +884,9 @@ ProfileLoadResult Profile::LoadStatsXmlFromNode( const XNode *xml, bool bIgnoreE /* These are loaded from Editable, so we usually want to ignore them * here. */ - CString sName = m_sDisplayName; - CString sCharacterID = m_sCharacterID; - CString sLastUsedHighScoreName = m_sLastUsedHighScoreName; + RString sName = m_sDisplayName; + RString sCharacterID = m_sCharacterID; + RString sLastUsedHighScoreName = m_sLastUsedHighScoreName; int iWeightPounds = m_iWeightPounds; LOAD_NODE( GeneralData ); @@ -909,7 +909,7 @@ ProfileLoadResult Profile::LoadStatsXmlFromNode( const XNode *xml, bool bIgnoreE return ProfileLoadResult_Success; } -bool Profile::SaveAllToDir( CString sDir, bool bSignData ) const +bool Profile::SaveAllToDir( RString sDir, bool bSignData ) const { m_sLastPlayedMachineGuid = PROFILEMAN->GetMachineProfile()->m_sGuid; m_LastPlayedDate = DateTime::GetNowDate(); @@ -950,12 +950,12 @@ XNode *Profile::SaveStatsXmlCreateNode() const return xml; } -bool Profile::SaveStatsXmlToDir( CString sDir, bool bSignData ) const +bool Profile::SaveStatsXmlToDir( RString sDir, bool bSignData ) const { XNode *xml = SaveStatsXmlCreateNode(); // Save stats.xml - CString fn = sDir + STATS_XML; + RString fn = sDir + STATS_XML; DISP_OPT opts; opts.stylesheet = STATS_XSL; @@ -969,21 +969,21 @@ bool Profile::SaveStatsXmlToDir( CString sDir, bool bSignData ) const if( bSaved && bSignData ) { - CString sStatsXmlSigFile = fn+SIGNATURE_APPEND; + RString sStatsXmlSigFile = fn+SIGNATURE_APPEND; CryptManager::SignFileToFile(fn, sStatsXmlSigFile); // Update file cache, or else IsAFile in CryptManager won't see sStatsXmlSigFile. FILEMAN->FlushDirCache( sDir ); // Save the "don't share" file - CString sDontShareFile = sDir + DONT_SHARE_SIG; + RString sDontShareFile = sDir + DONT_SHARE_SIG; CryptManager::SignFileToFile(sStatsXmlSigFile, sDontShareFile); } return bSaved; } -void Profile::SaveEditableDataToDir( CString sDir ) const +void Profile::SaveEditableDataToDir( RString sDir ) const { IniFile ini; @@ -1044,7 +1044,7 @@ XNode* Profile::SaveGeneralDataCreateNode() const { XNode* pDefaultModifiers = pGeneralDataNode->AppendChild("DefaultModifiers"); - FOREACHM_CONST( CString, CString, m_sDefaultModifiers, it ) + FOREACHM_CONST( RString, RString, m_sDefaultModifiers, it ) pDefaultModifiers->AppendChild( it->first, it->second ); } @@ -1125,9 +1125,9 @@ XNode* Profile::SaveGeneralDataCreateNode() const return pGeneralDataNode; } -ProfileLoadResult Profile::LoadEditableDataFromDir( CString sDir ) +ProfileLoadResult Profile::LoadEditableDataFromDir( RString sDir ) { - CString fn = sDir + EDITABLE_INI; + RString fn = sDir + EDITABLE_INI; // // Don't load unreasonably large editable.xml files. @@ -1166,7 +1166,7 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode ) { ASSERT( pNode->m_sName == "GeneralData" ); - CString s; + RString s; const XNode* pTemp; pNode->GetChildValue( "DisplayName", m_sDisplayName ); @@ -1201,7 +1201,7 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode ) pNode->GetChildValue( "TotalHands", m_iTotalHands ); { - CString sData; + RString sData; if( pNode->GetChildValue( "Data", sData ) ) { m_SavedLuaData.LoadFromString( sData ); @@ -1468,13 +1468,13 @@ void Profile::LoadCourseScoresFromNode( const XNode* pCourseScores ) Course *pC = courseID.ToCourse(); if( pC == NULL ) { - CString sDir, sFName, sExt; + RString sDir, sFName, sExt; splitpath( courseID.sPath, sDir, sFName, sExt ); - CString sFullFileName = sFName + sExt; + RString sFullFileName = sFName + sExt; FOREACH_CONST( Course*, vpAllCourses, c ) { - CString sOther = (*c)->m_sPath.Right(sFullFileName.size()); + RString sOther = (*c)->m_sPath.Right(sFullFileName.size()); if( sFullFileName.CompareNoCase(sOther) == 0 ) { @@ -1555,7 +1555,7 @@ void Profile::LoadCategoryScoresFromNode( const XNode* pCategoryScores ) if( pStepsType->m_sName != "StepsType" ) continue; - CString str; + RString str; if( !pStepsType->GetAttrValue( "Type", str ) ) WARN_AND_CONTINUE; StepsType st = GameManager::StringToStepsType( str ); @@ -1583,7 +1583,7 @@ void Profile::LoadCategoryScoresFromNode( const XNode* pCategoryScores ) } } -void Profile::SaveStatsWebPageToDir( CString sDir ) const +void Profile::SaveStatsWebPageToDir( RString sDir ) const { ASSERT( PROFILEMAN ); @@ -1593,7 +1593,7 @@ void Profile::SaveStatsWebPageToDir( CString sDir ) const FileCopy( CATALOG_XML_FILE, sDir+CATALOG_XML ); } -void Profile::SaveMachinePublicKeyToDir( CString sDir ) const +void Profile::SaveMachinePublicKeyToDir( RString sDir ) const { if( PREFSMAN->m_bSignProfileData && IsAFile(CRYPTMAN->GetPublicKeyFileName()) ) FileCopy( CRYPTMAN->GetPublicKeyFileName(), sDir+PUBLIC_KEY_FILE ); @@ -1649,7 +1649,7 @@ void Profile::LoadCalorieDataFromNode( const XNode* pCalorieData ) if( pCaloriesBurned->m_sName != "CaloriesBurned" ) WARN_AND_CONTINUE_M( pCaloriesBurned->m_sName ); - CString sDate; + RString sDate; if( !pCaloriesBurned->GetAttrValue("Date",sDate) ) WARN_AND_CONTINUE; DateTime date; @@ -1924,7 +1924,7 @@ XNode* Profile::SaveCoinDataCreateNode() const return pNode; } -void Profile::MoveBackupToDir( CString sFromDir, CString sToDir ) +void Profile::MoveBackupToDir( RString sFromDir, RString sToDir ) { FILEMAN->Move( sFromDir+EDITABLE_INI, sToDir+EDITABLE_INI ); FILEMAN->Move( sFromDir+STATS_XML, sToDir+STATS_XML ); diff --git a/stepmania/src/Profile.h b/stepmania/src/Profile.h index 0f9b441df3..80085fdeaa 100644 --- a/stepmania/src/Profile.h +++ b/stepmania/src/Profile.h @@ -24,15 +24,15 @@ class Character; // // Current file versions // -extern const CString STATS_XML; +extern const RString STATS_XML; -extern const CString EDITABLE_INI; +extern const RString EDITABLE_INI; // Editable data is an INI because the default INI file association on Windows // systems will open the ini file in an editor. The default association for // XML will open in IE. Users have a much better chance of discovering how to // edit this data if they don't have to fight against the file associations. -extern const CString DONT_SHARE_SIG; +extern const RString DONT_SHARE_SIG; // The "don't share" file is something that the user should always keep private. // They can safely share STATS_XML with STATS_XML's signature so that others @@ -41,11 +41,11 @@ extern const CString DONT_SHARE_SIG; // share" file. DontShare contains a piece of information that we can // construct using STATS_XML but the user can't construct using STATS_XML. // The file contains a signature of the STATS_XML's signature. -extern const CString PUBLIC_KEY_FILE; -extern const CString SCREENSHOTS_SUBDIR; -extern const CString EDIT_STEPS_SUBDIR; -extern const CString EDIT_COURSES_SUBDIR; -extern const CString LASTGOOD_SUBDIR; +extern const RString PUBLIC_KEY_FILE; +extern const RString SCREENSHOTS_SUBDIR; +extern const RString EDIT_STEPS_SUBDIR; +extern const RString EDIT_COURSES_SUBDIR; +extern const RString LASTGOOD_SUBDIR; const unsigned int PROFILE_MAX_DISPLAY_NAME_LENGTH = 12; @@ -68,10 +68,10 @@ public: // // smart accessors // - CString GetDisplayNameOrHighScoreName() const; + RString GetDisplayNameOrHighScoreName() const; Character *GetCharacter() const; - CString GetDisplayTotalCaloriesBurned() const; // remove me and use Lua instead - CString GetDisplayTotalCaloriesBurnedToday() const; // remove me and use Lua instead + RString GetDisplayTotalCaloriesBurned() const; // remove me and use Lua instead + RString GetDisplayTotalCaloriesBurnedToday() const; // remove me and use Lua instead int GetCalculatedWeightPounds() const; // returns a default value if m_iWeightPounds isn't set float GetCaloriesBurnedToday() const; int GetTotalNumSongsPassed() const; @@ -84,8 +84,8 @@ public: float GetSongsPercentComplete( StepsType st, Difficulty dc ) const; float GetCoursesPercentComplete( StepsType st, CourseDifficulty cd ) const; float GetSongsAndCoursesPercentCompleteAllDifficulties( StepsType st ) const; - bool GetDefaultModifiers( const Game* pGameType, CString &sModifiersOut ) const; - void SetDefaultModifiers( const Game* pGameType, const CString &sModifiers ); + bool GetDefaultModifiers( const Game* pGameType, RString &sModifiersOut ) const; + void SetDefaultModifiers( const Game* pGameType, const RString &sModifiers ); bool IsCodeUnlocked( int iCode ) const; Song *GetMostPopularSong() const; Course *GetMostPopularCourse() const; @@ -97,18 +97,18 @@ public: // // Editable data // - CString m_sDisplayName; - CString m_sCharacterID; - CString m_sLastUsedHighScoreName; // this doesn't really belong in "editable", but we need it in the smaller editable file so that it can be ready quickly. + RString m_sDisplayName; + RString m_sCharacterID; + RString m_sLastUsedHighScoreName; // this doesn't really belong in "editable", but we need it in the smaller editable file so that it can be ready quickly. int m_iWeightPounds; // 0 == not set // // General data // - static CString MakeGuid(); + static RString MakeGuid(); - CString m_sGuid; - map m_sDefaultModifiers; + RString m_sGuid; + map m_sDefaultModifiers; SortOrder m_SortOrder; Difficulty m_LastDifficulty; CourseDifficulty m_LastCourseDifficulty; @@ -133,7 +133,7 @@ public: int m_iTotalMines; int m_iTotalHands; set m_UnlockedSongs; - mutable CString m_sLastPlayedMachineGuid; // mutable because we overwrite this on save, and I don't want to remove const from the whole save chain. -Chris + mutable RString m_sLastPlayedMachineGuid; // mutable because we overwrite this on save, and I don't want to remove const from the whole save chain. -Chris mutable DateTime m_LastPlayedDate; /* These stats count twice in the machine profile if two players are playing; * that's the only approach that makes sense for ByDifficulty and ByMeter. */ @@ -301,10 +301,10 @@ public: // // Loading and saving // - ProfileLoadResult LoadAllFromDir( CString sDir, bool bRequireSignature ); - bool SaveAllToDir( CString sDir, bool bSignData ) const; + ProfileLoadResult LoadAllFromDir( RString sDir, bool bRequireSignature ); + bool SaveAllToDir( RString sDir, bool bSignData ) const; - ProfileLoadResult LoadEditableDataFromDir( CString sDir ); + ProfileLoadResult LoadEditableDataFromDir( RString sDir ); ProfileLoadResult LoadStatsXmlFromNode( const XNode* pNode, bool bIgnoreEditable = true ); void LoadGeneralDataFromNode( const XNode* pNode ); void LoadSongScoresFromNode( const XNode* pNode ); @@ -315,8 +315,8 @@ public: void LoadRecentSongScoresFromNode( const XNode* pNode ); void LoadRecentCourseScoresFromNode( const XNode* pNode ); - void SaveEditableDataToDir( CString sDir ) const; - bool SaveStatsXmlToDir( CString sDir, bool bSignData ) const; + void SaveEditableDataToDir( RString sDir ) const; + bool SaveStatsXmlToDir( RString sDir, bool bSignData ) const; XNode* SaveStatsXmlCreateNode() const; XNode* SaveGeneralDataCreateNode() const; XNode* SaveSongScoresCreateNode() const; @@ -329,10 +329,10 @@ public: XNode* SaveCoinDataCreateNode() const; - void SaveStatsWebPageToDir( CString sDir ) const; - void SaveMachinePublicKeyToDir( CString sDir ) const; + void SaveStatsWebPageToDir( RString sDir ) const; + void SaveMachinePublicKeyToDir( RString sDir ) const; - static void MoveBackupToDir( CString sFromDir, CString sToDir ); + static void MoveBackupToDir( RString sFromDir, RString sToDir ); // Lua void PushSelf( lua_State *L ); diff --git a/stepmania/src/ProfileManager.cpp b/stepmania/src/ProfileManager.cpp index 7785ab2325..c34a160cc7 100644 --- a/stepmania/src/ProfileManager.cpp +++ b/stepmania/src/ProfileManager.cpp @@ -27,30 +27,30 @@ ProfileManager* PROFILEMAN = NULL; // global and accessable from anywhere in our program -static void DefaultLocalProfileIDInit( size_t /*PlayerNumber*/ i, CString &sNameOut, CString &defaultValueOut ) +static void DefaultLocalProfileIDInit( size_t /*PlayerNumber*/ i, RString &sNameOut, RString &defaultValueOut ) { sNameOut = ssprintf( "DefaultLocalProfileIDP%d", int(i+1) ); defaultValueOut = ""; } -Preference1D ProfileManager::m_sDefaultLocalProfileID( DefaultLocalProfileIDInit, NUM_PLAYERS ); +Preference1D ProfileManager::m_sDefaultLocalProfileID( DefaultLocalProfileIDInit, NUM_PLAYERS ); #define NEW_MEM_CARD_NAME "" #define USER_PROFILES_DIR "/Save/LocalProfiles/" #define MACHINE_PROFILE_DIR "/Save/MachineProfile/" -const CString LAST_GOOD_SUBDIR = "LastGood/"; +const RString LAST_GOOD_SUBDIR = "LastGood/"; // Directories to search for a profile if m_sMemoryCardProfileSubdir doesn't // exist, separated by ";": -static Preference g_sMemoryCardProfileImportSubdirs( "MemoryCardProfileImportSubdirs", "" ); +static Preference g_sMemoryCardProfileImportSubdirs( "MemoryCardProfileImportSubdirs", "" ); -static CString LocalProfileIDToDir( const CString &sProfileID ) { return USER_PROFILES_DIR + sProfileID + "/"; } -static CString LocalProfileDirToID( const CString &sDir ) { return Basename( sDir ); } +static RString LocalProfileIDToDir( const RString &sProfileID ) { return USER_PROFILES_DIR + sProfileID + "/"; } +static RString LocalProfileDirToID( const RString &sDir ) { return Basename( sDir ); } struct DirAndProfile { - CString sDir; + RString sDir; Profile profile; }; static vector g_vLocalProfile; @@ -97,10 +97,10 @@ void ProfileManager::Init() for( int i=g_vLocalProfile.size(); iGetCharacterFromID( sCharacterID ); ASSERT_M( pCharacter, sCharacterID ); - CString sProfileID; + RString sProfileID; bool b = CreateLocalProfile( pCharacter->GetDisplayName(), sProfileID ); ASSERT( b ); Profile* pProfile = GetLocalProfile( sProfileID ); @@ -118,7 +118,7 @@ bool ProfileManager::FixedProfiles() const return FIXED_PROFILES; } -ProfileLoadResult ProfileManager::LoadProfile( PlayerNumber pn, CString sProfileDir, bool bIsMemCard ) +ProfileLoadResult ProfileManager::LoadProfile( PlayerNumber pn, RString sProfileDir, bool bIsMemCard ) { LOG->Trace( "LoadingProfile P%d, %s, %d", pn+1, sProfileDir.c_str(), bIsMemCard ); @@ -134,7 +134,7 @@ ProfileLoadResult ProfileManager::LoadProfile( PlayerNumber pn, CString sProfile // Try to load the original, non-backup data. ProfileLoadResult lr = GetProfile(pn)->LoadAllFromDir( m_sProfileDir[pn], PREFSMAN->m_bSignProfileData ); - CString sBackupDir = m_sProfileDir[pn] + LAST_GOOD_SUBDIR; + RString sBackupDir = m_sProfileDir[pn] + LAST_GOOD_SUBDIR; if( lr == ProfileLoadResult_Success ) { @@ -169,7 +169,7 @@ ProfileLoadResult ProfileManager::LoadProfile( PlayerNumber pn, CString sProfile bool ProfileManager::LoadLocalProfileFromMachine( PlayerNumber pn ) { - CString sProfileID = m_sDefaultLocalProfileID[pn]; + RString sProfileID = m_sDefaultLocalProfileID[pn]; if( sProfileID.empty() ) { m_sProfileDir[pn] = ""; @@ -189,7 +189,7 @@ bool ProfileManager::LoadLocalProfileFromMachine( PlayerNumber pn ) return true; } -void ProfileManager::GetMemoryCardProfileDirectoriesToTry( vector &asDirsToTry ) const +void ProfileManager::GetMemoryCardProfileDirectoriesToTry( vector &asDirsToTry ) const { /* Try to load the preferred profile. */ asDirsToTry.push_back( PREFSMAN->m_sMemoryCardProfileSubdir ); @@ -206,13 +206,13 @@ bool ProfileManager::LoadProfileFromMemoryCard( PlayerNumber pn ) if( MEMCARDMAN->GetCardState(pn) != MemoryCardState_Ready ) return false; - vector asDirsToTry; + vector asDirsToTry; GetMemoryCardProfileDirectoriesToTry( asDirsToTry ); for( unsigned i = 0; i < asDirsToTry.size(); ++i ) { - const CString &sSubdir = asDirsToTry[i]; - CString sDir = MEM_CARD_MOUNT_POINT[pn] + sSubdir + "/"; + const RString &sSubdir = asDirsToTry[i]; + RString sDir = MEM_CARD_MOUNT_POINT[pn] + sSubdir + "/"; /* If the load fails with ProfileLoadResult_FailedNoProfile, keep searching. However, * if it fails with failed_tampered, data existed but couldn't be loaded; @@ -238,13 +238,13 @@ bool ProfileManager::LoadProfileFromMemoryCard( PlayerNumber pn ) /* If we imported a profile fallback directory, change the memory card * directory back to the preferred directory: never write over imported * scores. */ - m_sProfileDir[pn] = MEM_CARD_MOUNT_POINT[pn] + (CString)PREFSMAN->m_sMemoryCardProfileSubdir + "/"; + m_sProfileDir[pn] = MEM_CARD_MOUNT_POINT[pn] + (RString)PREFSMAN->m_sMemoryCardProfileSubdir + "/"; /* Load edits from all fallback directories, newest first. */ for( unsigned i = 0; i < asDirsToTry.size(); ++i ) { - const CString &sSubdir = asDirsToTry[i]; - CString sDir = MEM_CARD_MOUNT_POINT[pn] + sSubdir + "/"; + const RString &sSubdir = asDirsToTry[i]; + RString sDir = MEM_CARD_MOUNT_POINT[pn] + sSubdir + "/"; SONGMAN->LoadAllFromProfileDir( sDir, (ProfileSlot) pn ); } @@ -264,15 +264,15 @@ bool ProfileManager::LoadFirstAvailableProfile( PlayerNumber pn ) } -bool ProfileManager::FastLoadProfileNameFromMemoryCard( CString sRootDir, CString &sName ) const +bool ProfileManager::FastLoadProfileNameFromMemoryCard( RString sRootDir, RString &sName ) const { - vector asDirsToTry; + vector asDirsToTry; GetMemoryCardProfileDirectoriesToTry( asDirsToTry ); for( unsigned i = 0; i < asDirsToTry.size(); ++i ) { - const CString &sSubdir = asDirsToTry[i]; - CString sDir = sRootDir + sSubdir + "/"; + const RString &sSubdir = asDirsToTry[i]; + RString sDir = sRootDir + sSubdir + "/"; Profile profile; ProfileLoadResult res = profile.LoadEditableDataFromDir( sDir ); @@ -316,7 +316,7 @@ bool ProfileManager::SaveProfile( PlayerNumber pn ) const if( m_bNeedToBackUpLastLoad[pn] ) { m_bNeedToBackUpLastLoad[pn] = false; - CString sBackupDir = m_sProfileDir[pn] + LAST_GOOD_SUBDIR; + RString sBackupDir = m_sProfileDir[pn] + LAST_GOOD_SUBDIR; Profile::MoveBackupToDir( m_sProfileDir[pn], sBackupDir ); } @@ -325,11 +325,11 @@ bool ProfileManager::SaveProfile( PlayerNumber pn ) const return b; } -bool ProfileManager::SaveLocalProfile( CString sProfileID ) +bool ProfileManager::SaveLocalProfile( RString sProfileID ) { Profile *pProfile = GetLocalProfile( sProfileID ); ASSERT( pProfile != NULL ); - CString sDir = LocalProfileIDToDir( sProfileID ); + RString sDir = LocalProfileIDToDir( sProfileID ); bool b = pProfile->SaveAllToDir( sDir, PREFSMAN->m_bSignProfileData ); return b; } @@ -361,15 +361,15 @@ const Profile* ProfileManager::GetProfile( PlayerNumber pn ) const } else { - CString sProfileID = LocalProfileDirToID( m_sProfileDir[pn] ); + RString sProfileID = LocalProfileDirToID( m_sProfileDir[pn] ); return GetLocalProfile( sProfileID ); } } -CString ProfileManager::GetPlayerName( PlayerNumber pn ) const +RString ProfileManager::GetPlayerName( PlayerNumber pn ) const { const Profile *prof = GetProfile( pn ); - return prof ? prof->GetDisplayNameOrHighScoreName() : CString(); + return prof ? prof->GetDisplayNameOrHighScoreName() : RString(); } @@ -382,9 +382,9 @@ void ProfileManager::RefreshLocalProfilesFromDisk() { UnloadAllLocalProfiles(); - vector vsProfileID; + vector vsProfileID; GetDirListing( USER_PROFILES_DIR "*", vsProfileID, true, true ); - FOREACH_CONST( CString, vsProfileID, p ) + FOREACH_CONST( RString, vsProfileID, p ) { g_vLocalProfile.push_back( DirAndProfile() ); DirAndProfile &dap = g_vLocalProfile.back(); @@ -393,12 +393,12 @@ void ProfileManager::RefreshLocalProfilesFromDisk() } } -const Profile *ProfileManager::GetLocalProfile( const CString &sProfileID ) const +const Profile *ProfileManager::GetLocalProfile( const RString &sProfileID ) const { - CString sDir = LocalProfileIDToDir( sProfileID ); + RString sDir = LocalProfileIDToDir( sProfileID ); FOREACH_CONST( DirAndProfile, g_vLocalProfile, dap ) { - const CString &sOther = dap->sDir; + const RString &sOther = dap->sDir; if( sOther == sDir ) return &dap->profile; } @@ -406,7 +406,7 @@ const Profile *ProfileManager::GetLocalProfile( const CString &sProfileID ) cons return NULL; } -bool ProfileManager::CreateLocalProfile( CString sName, CString &sProfileIDOut ) +bool ProfileManager::CreateLocalProfile( RString sName, RString &sProfileIDOut ) { ASSERT( !sName.empty() ); @@ -415,13 +415,13 @@ bool ProfileManager::CreateLocalProfile( CString sName, CString &sProfileIDOut ) // existing numbers. This preserves the "order by create date". // int iMaxProfileNumber = -1; - vector vs; + vector vs; GetLocalProfileIDs( vs ); - FOREACH_CONST( CString, vs, s ) + FOREACH_CONST( RString, vs, s ) iMaxProfileNumber = atoi( *s ); int iProfileNumber = iMaxProfileNumber + 1; - CString sProfileID = ssprintf( "%08d", iProfileNumber ); + RString sProfileID = ssprintf( "%08d", iProfileNumber ); // // Create the new profile. @@ -433,7 +433,7 @@ bool ProfileManager::CreateLocalProfile( CString sName, CString &sProfileIDOut ) // // Save it to disk. // - CString sProfileDir = LocalProfileIDToDir( sProfileID ); + RString sProfileDir = LocalProfileIDToDir( sProfileID ); if( !pProfile->SaveAllToDir(sProfileDir, PREFSMAN->m_bSignProfileData) ) { delete pProfile; @@ -447,7 +447,7 @@ bool ProfileManager::CreateLocalProfile( CString sName, CString &sProfileIDOut ) return true; } -void ProfileManager::AddLocalProfileByID( Profile *pProfile, CString sProfileID ) +void ProfileManager::AddLocalProfileByID( Profile *pProfile, RString sProfileID ) { // make sure this id doesn't already exist ASSERT_M( GetLocalProfile(sProfileID) == NULL, @@ -461,7 +461,7 @@ void ProfileManager::AddLocalProfileByID( Profile *pProfile, CString sProfileID dap.profile = *pProfile; } -bool ProfileManager::RenameLocalProfile( CString sProfileID, CString sNewName ) +bool ProfileManager::RenameLocalProfile( RString sProfileID, RString sNewName ) { ASSERT( !sProfileID.empty() ); @@ -469,15 +469,15 @@ bool ProfileManager::RenameLocalProfile( CString sProfileID, CString sNewName ) ASSERT( pProfile ); pProfile->m_sDisplayName = sNewName; - CString sProfileDir = LocalProfileIDToDir( sProfileID ); + RString sProfileDir = LocalProfileIDToDir( sProfileID ); return pProfile->SaveAllToDir( sProfileDir, PREFSMAN->m_bSignProfileData ); } -bool ProfileManager::DeleteLocalProfile( CString sProfileID ) +bool ProfileManager::DeleteLocalProfile( RString sProfileID ) { Profile *pProfile = ProfileManager::GetLocalProfile( sProfileID ); ASSERT( pProfile ); - CString sProfileDir = LocalProfileIDToDir( sProfileID ); + RString sProfileDir = LocalProfileIDToDir( sProfileID ); FOREACH( DirAndProfile, g_vLocalProfile, i ) { @@ -540,7 +540,7 @@ bool ProfileManager::LastLoadWasFromLastGood( PlayerNumber pn ) const return !m_sProfileDir[pn].empty() && m_bLastLoadWasFromLastGood[pn]; } -CString ProfileManager::GetProfileDir( ProfileSlot slot ) const +RString ProfileManager::GetProfileDir( ProfileSlot slot ) const { switch( slot ) { @@ -554,7 +554,7 @@ CString ProfileManager::GetProfileDir( ProfileSlot slot ) const } } -CString ProfileManager::GetProfileDirImportedFrom( ProfileSlot slot ) const +RString ProfileManager::GetProfileDirImportedFrom( ProfileSlot slot ) const { switch( slot ) { @@ -760,26 +760,26 @@ bool ProfileManager::IsPersistentProfile( ProfileSlot slot ) const } } -void ProfileManager::GetLocalProfileIDs( vector &vsProfileIDsOut ) const +void ProfileManager::GetLocalProfileIDs( vector &vsProfileIDsOut ) const { vsProfileIDsOut.clear(); FOREACH_CONST( DirAndProfile, g_vLocalProfile, i) { - CString sID = LocalProfileDirToID( i->sDir ); + RString sID = LocalProfileDirToID( i->sDir ); vsProfileIDsOut.push_back( sID ); } } -void ProfileManager::GetLocalProfileDisplayNames( vector &vsProfileDisplayNamesOut ) const +void ProfileManager::GetLocalProfileDisplayNames( vector &vsProfileDisplayNamesOut ) const { vsProfileDisplayNamesOut.clear(); FOREACH_CONST( DirAndProfile, g_vLocalProfile, i) vsProfileDisplayNamesOut.push_back( i->profile.m_sDisplayName ); } -int ProfileManager::GetLocalProfileIndexFromID( CString sProfileID ) const +int ProfileManager::GetLocalProfileIndexFromID( RString sProfileID ) const { - CString sDir = LocalProfileIDToDir( sProfileID ); + RString sDir = LocalProfileIDToDir( sProfileID ); FOREACH_CONST( DirAndProfile, g_vLocalProfile, i ) { if( i->sDir == sProfileID ) @@ -788,9 +788,9 @@ int ProfileManager::GetLocalProfileIndexFromID( CString sProfileID ) const return -1; } -CString ProfileManager::GetLocalProfileIDFromIndex( int iIndex ) +RString ProfileManager::GetLocalProfileIDFromIndex( int iIndex ) { - CString sID = LocalProfileDirToID( g_vLocalProfile[iIndex].sDir ); + RString sID = LocalProfileDirToID( g_vLocalProfile[iIndex].sDir ); return sID; } diff --git a/stepmania/src/ProfileManager.h b/stepmania/src/ProfileManager.h index cf226a5bb9..681d72c9aa 100644 --- a/stepmania/src/ProfileManager.h +++ b/stepmania/src/ProfileManager.h @@ -30,28 +30,28 @@ public: // local profiles void UnloadAllLocalProfiles(); void RefreshLocalProfilesFromDisk(); - const Profile *GetLocalProfile( const CString &sProfileID ) const; - Profile *GetLocalProfile( const CString &sProfileID ) { return (Profile*) ((const ProfileManager *) this)->GetLocalProfile(sProfileID); } + const Profile *GetLocalProfile( const RString &sProfileID ) const; + Profile *GetLocalProfile( const RString &sProfileID ) { return (Profile*) ((const ProfileManager *) this)->GetLocalProfile(sProfileID); } Profile *GetLocalProfileFromIndex( int iIndex ); - CString GetLocalProfileIDFromIndex( int iIndex ); + RString GetLocalProfileIDFromIndex( int iIndex ); - bool CreateLocalProfile( CString sName, CString &sProfileIDOut ); - void AddLocalProfileByID( Profile *pProfile, CString sProfileID ); // transfers ownership of pProfile - bool RenameLocalProfile( CString sProfileID, CString sNewName ); - bool DeleteLocalProfile( CString sProfileID ); - void GetLocalProfileIDs( vector &vsProfileIDsOut ) const; - void GetLocalProfileDisplayNames( vector &vsProfileDisplayNamesOut ) const; - int GetLocalProfileIndexFromID( CString sProfileID ) const; + bool CreateLocalProfile( RString sName, RString &sProfileIDOut ); + void AddLocalProfileByID( Profile *pProfile, RString sProfileID ); // transfers ownership of pProfile + bool RenameLocalProfile( RString sProfileID, RString sNewName ); + bool DeleteLocalProfile( RString sProfileID ); + void GetLocalProfileIDs( vector &vsProfileIDsOut ) const; + void GetLocalProfileDisplayNames( vector &vsProfileDisplayNamesOut ) const; + int GetLocalProfileIndexFromID( RString sProfileID ) const; int GetNumLocalProfiles() const; bool LoadFirstAvailableProfile( PlayerNumber pn ); // memory card or local profile bool LoadLocalProfileFromMachine( PlayerNumber pn ); bool LoadProfileFromMemoryCard( PlayerNumber pn ); - bool FastLoadProfileNameFromMemoryCard( CString sRootDir, CString &sName ) const; + bool FastLoadProfileNameFromMemoryCard( RString sRootDir, RString &sName ) const; void SaveAllProfiles() const; bool SaveProfile( PlayerNumber pn ) const; - bool SaveLocalProfile( CString sProfileID ); + bool SaveLocalProfile( RString sProfileID ); void UnloadProfile( PlayerNumber pn ); // @@ -76,12 +76,12 @@ public: const Profile* GetProfile( ProfileSlot slot ) const; Profile* GetProfile( ProfileSlot slot ) { return (Profile*) ((const ProfileManager *) this)->GetProfile(slot); } - CString GetProfileDir( ProfileSlot slot ) const; - CString GetProfileDirImportedFrom( ProfileSlot slot ) const; + RString GetProfileDir( ProfileSlot slot ) const; + RString GetProfileDirImportedFrom( ProfileSlot slot ) const; Profile* GetMachineProfile() { return m_pMachineProfile; } - CString GetPlayerName( PlayerNumber pn ) const; + RString GetPlayerName( PlayerNumber pn ) const; bool ProfileWasLoadedFromMemoryCard( PlayerNumber pn ) const; bool LastLoadWasTamperedOrCorrupt( PlayerNumber pn ) const; bool LastLoadWasFromLastGood( PlayerNumber pn ) const; @@ -112,18 +112,18 @@ public: // Lua void PushSelf( lua_State *L ); - static Preference1D m_sDefaultLocalProfileID; + static Preference1D m_sDefaultLocalProfileID; private: - ProfileLoadResult LoadProfile( PlayerNumber pn, CString sProfileDir, bool bIsMemCard ); - void GetMemoryCardProfileDirectoriesToTry( vector &asDirsToTry ) const; + ProfileLoadResult LoadProfile( PlayerNumber pn, RString sProfileDir, bool bIsMemCard ); + void GetMemoryCardProfileDirectoriesToTry( vector &asDirsToTry ) const; // Directory that contains the profile. Either on local machine or // on a memory card. - CString m_sProfileDir[NUM_PLAYERS]; + RString m_sProfileDir[NUM_PLAYERS]; // MemoryCardProfileImportSubdirs name, if the profile was imported. - CString m_sProfileDirImportedFrom[NUM_PLAYERS]; + RString m_sProfileDirImportedFrom[NUM_PLAYERS]; bool m_bWasLoadedFromMemoryCard[NUM_PLAYERS]; bool m_bLastLoadWasTamperedOrCorrupt[NUM_PLAYERS]; // true if Stats.xml was present, but failed to load (probably because of a signature failure) diff --git a/stepmania/src/Quad.cpp b/stepmania/src/Quad.cpp index daaae86f13..b532a850a3 100644 --- a/stepmania/src/Quad.cpp +++ b/stepmania/src/Quad.cpp @@ -5,7 +5,7 @@ REGISTER_ACTOR_CLASS( Quad ) -void Quad::LoadFromNode( const CString& sDir, const XNode* pNode ) +void Quad::LoadFromNode( const RString& sDir, const XNode* pNode ) { // HACK: Bypass Sprite's texture loading. Sprite should really derive from Quad. Actor::LoadFromNode( sDir, pNode ); diff --git a/stepmania/src/Quad.h b/stepmania/src/Quad.h index facf3f5ba0..a19048cea6 100644 --- a/stepmania/src/Quad.h +++ b/stepmania/src/Quad.h @@ -14,7 +14,7 @@ public: m_bDrawIfTextureNull = true; } - void LoadFromNode( const CString& sDir, const XNode* pNode ); + void LoadFromNode( const RString& sDir, const XNode* pNode ); virtual Actor *Copy() const; }; diff --git a/stepmania/src/RadarValues.cpp b/stepmania/src/RadarValues.cpp index d9ba618bb5..feedda9298 100644 --- a/stepmania/src/RadarValues.cpp +++ b/stepmania/src/RadarValues.cpp @@ -60,22 +60,22 @@ void RadarValues::LoadFromNode( const XNode* pNode ) /* iMaxValues is only used for writing compatibility fields in non-cache * SM files; they're never actually read. */ -CString RadarValues::ToString( int iMaxValues ) const +RString RadarValues::ToString( int iMaxValues ) const { if( iMaxValues == -1 ) iMaxValues = NUM_RadarCategory; iMaxValues = min( iMaxValues, (int)NUM_RadarCategory ); - vector asRadarValues; + vector asRadarValues; for( int r=0; r < iMaxValues; r++ ) asRadarValues.push_back( ssprintf("%.3f", m_Values.f[r]) ); return join( ",",asRadarValues ); } -void RadarValues::FromString( CString sRadarValues ) +void RadarValues::FromString( RString sRadarValues ) { - vector saValues; + vector saValues; split( sRadarValues, ",", saValues, true ); if( saValues.size() != NUM_RadarCategory ) diff --git a/stepmania/src/RadarValues.h b/stepmania/src/RadarValues.h index 179d71feb9..6e9273c380 100644 --- a/stepmania/src/RadarValues.h +++ b/stepmania/src/RadarValues.h @@ -61,8 +61,8 @@ struct RadarValues XNode* CreateNode() const; void LoadFromNode( const XNode* pNode ); - CString ToString( int iMaxValues = -1 ) const; // default = all - void FromString( CString sValues ); + RString ToString( int iMaxValues = -1 ) const; // default = all + void FromString( RString sValues ); }; diff --git a/stepmania/src/RageBitmapTexture.cpp b/stepmania/src/RageBitmapTexture.cpp index 8a63c2cc63..1f2cde48e5 100644 --- a/stepmania/src/RageBitmapTexture.cpp +++ b/stepmania/src/RageBitmapTexture.cpp @@ -12,7 +12,7 @@ #include "RageSurface_Load.h" #include "arch/Dialog/Dialog.h" -static void GetResolutionFromFileName( CString sPath, int &iWidth, int &iHeight ) +static void GetResolutionFromFileName( RString sPath, int &iWidth, int &iHeight ) { /* Match: * Foo (res 512x128).png @@ -22,7 +22,7 @@ static void GetResolutionFromFileName( CString sPath, int &iWidth, int &iHeight * Be careful that this doesn't get mixed up with frame dimensions. */ static Regex re( "\\([^\\)]*res ([0-9]+)x([0-9]+).*\\)" ); - vector asMatches; + vector asMatches; if( !re.Compare(sPath, asMatches) ) return; @@ -64,13 +64,13 @@ void RageBitmapTexture::Create() ASSERT( actualID.filename != "" ); /* Load the image into a RageSurface. */ - CString error; + RString error; RageSurface *pImg = RageSurfaceUtils::LoadFile( actualID.filename, error ); /* Tolerate corrupt/unknown images. */ if( pImg == NULL ) { - CString sWarning = ssprintf( "RageBitmapTexture: Couldn't load %s: %s", actualID.filename.c_str(), error.c_str() ); + RString sWarning = ssprintf( "RageBitmapTexture: Couldn't load %s: %s", actualID.filename.c_str(), error.c_str() ); Dialog::OK( sWarning ); pImg = RageSurfaceUtils::MakeDummySurface( 64, 64 ); ASSERT( pImg != NULL ); @@ -90,7 +90,7 @@ void RageBitmapTexture::Create() } // look in the file name for a format hints - CString sHintString = GetID().filename + actualID.AdditionalTextureHints; + RString sHintString = GetID().filename + actualID.AdditionalTextureHints; sHintString.MakeLower(); if( sHintString.find("32bpp") != string::npos ) actualID.iColorDepth = 32; @@ -263,7 +263,7 @@ void RageBitmapTexture::Create() float fBetterSourceHeight = this->GetFramesHigh() * fBetterFrameHeight; if( fFrameWidth!=fBetterFrameWidth || fFrameHeight!=fBetterFrameHeight ) { - CString sWarning = ssprintf( + RString sWarning = ssprintf( "The graphic '%s' has frame dimensions that aren't even numbers.\n\n" "The entire image is %dx%d and frame size is %.1fx%.1f.\n\n" "Image quality will be much improved if you resize the graphic to %.0fx%.0f, which is a frame size of %.0fx%.0f.", @@ -285,7 +285,7 @@ void RageBitmapTexture::Create() GetResolutionFromFileName( actualID.filename, m_iSourceWidth, m_iSourceHeight ); - CString sProperties; + RString sProperties; sProperties += PixelFormatToString( pixfmt ) + " "; if( actualID.iAlphaBits == 0 ) sProperties += "opaque "; if( actualID.iAlphaBits == 1 ) sProperties += "matte "; diff --git a/stepmania/src/RageDisplay.cpp b/stepmania/src/RageDisplay.cpp index e42369b64f..6045cfd771 100644 --- a/stepmania/src/RageDisplay.cpp +++ b/stepmania/src/RageDisplay.cpp @@ -50,25 +50,25 @@ XToString( PixelFormat, NUM_PixelFormat ); /* bNeedReloadTextures is set to true if the device was re-created and we need * to reload textures. On failure, an error message is returned. * XXX: the renderer itself should probably be the one to try fallback modes */ -CString RageDisplay::SetVideoMode( VideoModeParams p, bool &bNeedReloadTextures ) +RString RageDisplay::SetVideoMode( VideoModeParams p, bool &bNeedReloadTextures ) { - CString err; + RString err; err = this->TryVideoMode(p,bNeedReloadTextures); if( err == "" ) - return CString(); + return RString(); LOG->Trace( "TryVideoMode failed: %s", err.c_str() ); // fall back p.windowed = true; if( this->TryVideoMode(p,bNeedReloadTextures) == "" ) - return CString(); + return RString(); p.bpp = 16; if( this->TryVideoMode(p,bNeedReloadTextures) == "" ) - return CString(); + return RString(); p.width = 640; p.height = 480; if( this->TryVideoMode(p,bNeedReloadTextures) == "" ) - return CString(); + return RString(); return ssprintf( "SetVideoMode failed: %s", err.c_str() ); } @@ -88,7 +88,7 @@ void RageDisplay::ProcessStatsOnFlip() g_iFramesRenderedSinceLastCheck = g_iVertsRenderedSinceLastCheck = 0; if( LOG_FPS ) { - CString sStats = GetStats(); + RString sStats = GetStats(); sStats.Replace( "\n", ", " ); LOG->Trace( "%s", sStats.c_str() ); } @@ -104,9 +104,9 @@ void RageDisplay::ResetStats() g_LastCheckTimer.GetDeltaTime(); } -CString RageDisplay::GetStats() const +RString RageDisplay::GetStats() const { - CString s; + RString s; /* If FPS == 0, we don't have stats yet. */ if( !GetFPS() ) s = "-- FPS\n-- av FPS\n-- VPF"; @@ -637,7 +637,7 @@ void RageDisplay::UpdateCentering() RageMatrixMultiply( &m_Centering, &m1, &m2 ); } -bool RageDisplay::SaveScreenshot( CString sPath, GraphicsFileFormat format ) +bool RageDisplay::SaveScreenshot( RString sPath, GraphicsFileFormat format ) { RageSurface* surface = this->CreateScreenshot(); diff --git a/stepmania/src/RageDisplay.h b/stepmania/src/RageDisplay.h index 0f6328594b..d2a760ac6b 100644 --- a/stepmania/src/RageDisplay.h +++ b/stepmania/src/RageDisplay.h @@ -62,7 +62,7 @@ enum PixelFormat NUM_PixelFormat, PixelFormat_INVALID }; -const CString& PixelFormatToString( PixelFormat i ); +const RString& PixelFormatToString( PixelFormat i ); class VideoModeParams { @@ -80,8 +80,8 @@ public: bool bSmoothLines_, bool bTrilinearFiltering_, bool bAnisotropicFiltering_, - CString sWindowTitle_, - CString sIconFile_, + RString sWindowTitle_, + RString sIconFile_, bool PAL_, float fDisplayAspectRatio_ ) @@ -115,8 +115,8 @@ public: bool interlaced; bool PAL; float fDisplayAspectRatio; - CString sWindowTitle; - CString sIconFile; + RString sWindowTitle; + RString sIconFile; }; class RageDisplay @@ -135,13 +135,13 @@ public: /* This is needed or the overridden classes' dtors will not be called. */ virtual ~RageDisplay() { } - virtual CString GetApiDescription() const = 0; + virtual RString GetApiDescription() const = 0; virtual void GetDisplayResolutions( DisplayResolutions &out ) const = 0; // Don't override this. Override TryVideoMode() instead. // This will set the video mode to be as close as possible to params. // Return true if device was re-created and we need to reload textures. - CString SetVideoMode( VideoModeParams p, bool &bNeedReloadTextures ); + RString SetVideoMode( VideoModeParams p, bool &bNeedReloadTextures ); /* Call this when the resolution has been changed externally: */ virtual void ResolutionChanged(); @@ -239,9 +239,9 @@ public: SAVE_LOSSY_LOW_QUAL, // jpg SAVE_LOSSY_HIGH_QUAL // jpg }; - bool SaveScreenshot( CString sPath, GraphicsFileFormat format ); + bool SaveScreenshot( RString sPath, GraphicsFileFormat format ); - virtual CString GetTextureDiagnostics( unsigned id ) const { return CString(); } + virtual RString GetTextureDiagnostics( unsigned id ) const { return RString(); } virtual RageSurface* CreateScreenshot() = 0; // allocates a surface. Caller must delete it. protected: @@ -254,10 +254,10 @@ protected: virtual void DrawLineStripInternal( const RageSpriteVertex v[], int iNumVerts, float LineWidth ); virtual void DrawCircleInternal( const RageSpriteVertex &v, float radius ); - // return CString() if mode change was successful, an error message otherwise. + // return RString() if mode change was successful, an error message otherwise. // bNewDeviceOut is set true if a new device was created and textures // need to be reloaded. - virtual CString TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ) = 0; + virtual RString TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ) = 0; void DrawPolyLine( const RageSpriteVertex &p1, const RageSpriteVertex &p2, float LineWidth ); @@ -271,7 +271,7 @@ public: int GetCumFPS() const; /* average FPS since last reset */ virtual void ResetStats(); virtual void ProcessStatsOnFlip(); - virtual CString GetStats() const; + virtual RString GetStats() const; void StatsAddVerts( int iNumVertsRendered ); /* World matrix stack functions. */ diff --git a/stepmania/src/RageDisplay_D3D.cpp b/stepmania/src/RageDisplay_D3D.cpp index cdc168daad..a94e4c71c6 100644 --- a/stepmania/src/RageDisplay_D3D.cpp +++ b/stepmania/src/RageDisplay_D3D.cpp @@ -37,7 +37,7 @@ #include -CString GetErrorString( HRESULT hr ) +RString GetErrorString( HRESULT hr ) { char szError[1024] = ""; D3DXGetErrorString( hr, szError, sizeof(szError) ); @@ -207,7 +207,7 @@ RageDisplay_D3D::RageDisplay_D3D() "DirectX 8.1 or greater is not installed. You can download it from:\n" \ "http://www.microsoft.com/downloads/details.aspx?FamilyID=a19bed22-0b25-4e5d-a584-6389d8a3dad0&displaylang=en" -CString RageDisplay_D3D::Init( VideoModeParams p ) +RString RageDisplay_D3D::Init( VideoModeParams p ) { GraphicsWindow::Initialize( true ); @@ -370,7 +370,7 @@ D3DFORMAT FindBackBufferType(bool bWindowed, int iBPP) return D3DFMT_UNKNOWN; } -CString SetD3DParams( bool &bNewDeviceOut ) +RString SetD3DParams( bool &bNewDeviceOut ) { if( g_pd3dDevice == NULL ) // device is not yet created. We need to create it { @@ -410,7 +410,7 @@ CString SetD3DParams( bool &bNewDeviceOut ) /* Palettes were lost by Reset(), so mark them unloaded. */ g_TexResourceToPaletteIndex.clear(); - return CString(); + return RString(); } /* If the given parameters have failed, try to lower them. */ @@ -549,7 +549,7 @@ static void SetPresentParametersFromVideoModeParams( const VideoModeParams &p, D } /* Set the video mode. */ -CString RageDisplay_D3D::TryVideoMode( const VideoModeParams &_p, bool &bNewDeviceOut ) +RString RageDisplay_D3D::TryVideoMode( const VideoModeParams &_p, bool &bNewDeviceOut ) { VideoModeParams p = _p; @@ -579,7 +579,7 @@ CString RageDisplay_D3D::TryVideoMode( const VideoModeParams &_p, bool &bNewDevi while( 1 ) { /* Try the video mode. */ - CString sErr = SetD3DParams( bNewDeviceOut ); + RString sErr = SetD3DParams( bNewDeviceOut ); if( sErr.empty() ) break; @@ -607,7 +607,7 @@ CString RageDisplay_D3D::TryVideoMode( const VideoModeParams &_p, bool &bNewDevi this->SetDefaultRenderStates(); - return CString(); // mode change successful + return RString(); // mode change successful } void RageDisplay_D3D::ResolutionChanged() @@ -641,7 +641,7 @@ bool RageDisplay_D3D::BeginFrame() case D3DERR_DEVICENOTRESET: { bool bIgnore = false; - CString sError = SetD3DParams( bIgnore ); + RString sError = SetD3DParams( bIgnore ); if( sError != "" ) RageException::Throw( sError ); diff --git a/stepmania/src/RageDisplay_D3D.h b/stepmania/src/RageDisplay_D3D.h index 1d970f6926..42de05cf54 100644 --- a/stepmania/src/RageDisplay_D3D.h +++ b/stepmania/src/RageDisplay_D3D.h @@ -8,9 +8,9 @@ class RageDisplay_D3D: public RageDisplay public: RageDisplay_D3D(); virtual ~RageDisplay_D3D(); - CString Init( VideoModeParams p ); + RString Init( VideoModeParams p ); - virtual CString GetApiDescription() const { return "D3D"; } + virtual RString GetApiDescription() const { return "D3D"; } virtual void GetDisplayResolutions( DisplayResolutions &out ) const; void ResolutionChanged(); const PixelFormatDesc *GetPixelFormatDesc(PixelFormat pf) const; @@ -78,7 +78,7 @@ protected: void DrawTrianglesInternal( const RageSpriteVertex v[], int iNumVerts ); void DrawCompiledGeometryInternal( const RageCompiledGeometry *p, int iMeshIndex ); - CString TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ); + RString TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ); RageSurface* CreateScreenshot(); RageMatrix GetOrthoMatrix( float l, float r, float b, float t, float zn, float zf ); diff --git a/stepmania/src/RageDisplay_Null.h b/stepmania/src/RageDisplay_Null.h index 026e6504c8..9c22ba5b21 100644 --- a/stepmania/src/RageDisplay_Null.h +++ b/stepmania/src/RageDisplay_Null.h @@ -8,7 +8,7 @@ class RageDisplay_Null: public RageDisplay public: RageDisplay_Null( VideoModeParams p ); - virtual CString GetApiDescription() const { return "Null"; } + virtual RString GetApiDescription() const { return "Null"; } virtual void GetDisplayResolutions( DisplayResolutions &out ) const; const PixelFormatDesc *GetPixelFormatDesc(PixelFormat pf) const; @@ -76,7 +76,7 @@ protected: void DrawLineStripInternal( const RageSpriteVertex v[], int iNumVerts, float LineWidth ) { } VideoModeParams m_Params; - CString TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ) { m_Params = p; return CString(); } + RString TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ) { m_Params = p; return RString(); } RageSurface* CreateScreenshot(); RageMatrix GetOrthoMatrix( float l, float r, float b, float t, float zn, float zf ); bool SupportsSurfaceFormat( PixelFormat pixfmt ) { return true; } diff --git a/stepmania/src/RageDisplay_OGL.cpp b/stepmania/src/RageDisplay_OGL.cpp index 37caa480b7..5c6d837eb9 100644 --- a/stepmania/src/RageDisplay_OGL.cpp +++ b/stepmania/src/RageDisplay_OGL.cpp @@ -143,7 +143,7 @@ static RageDisplay::PixelFormatDesc PIXEL_FORMAT_DESC[NUM_PixelFormat] = { } }; -static map g_Strings; +static map g_Strings; static void InitStringMap() { static bool Initialized = false; @@ -159,7 +159,7 @@ static void InitStringMap() X(GL_STACK_OVERFLOW); X(GL_STACK_UNDERFLOW); X(GL_OUT_OF_MEMORY); } -static CString GLToString( GLenum e ) +static RString GLToString( GLenum e ) { if( g_Strings.find(e) != g_Strings.end() ) return g_Strings[e]; @@ -295,21 +295,21 @@ RageDisplay_OGL::RageDisplay_OGL() g_bTextureMatrixShader = 0; } -CString GetInfoLog( GLhandleARB h ) +RString GetInfoLog( GLhandleARB h ) { GLint iLength; GLExt.glGetObjectParameterivARB( h, GL_OBJECT_INFO_LOG_LENGTH_ARB, &iLength ); if( !iLength ) - return CString(); + return RString(); GLcharARB *pInfoLog = new GLcharARB[iLength]; GLExt.glGetInfoLogARB( h, iLength, &iLength, pInfoLog ); - CString sRet = pInfoLog; + RString sRet = pInfoLog; delete [] pInfoLog; return sRet; } -GLhandleARB CompileShader( GLenum ShaderType, CString sBuffer ) +GLhandleARB CompileShader( GLenum ShaderType, RString sBuffer ) { GLhandleARB VertexShader = GLExt.glCreateShaderObjectARB( GL_VERTEX_SHADER_ARB ); const GLcharARB *pData = sBuffer.data(); @@ -387,12 +387,12 @@ void InitScalingScript() GLExt.glVertexAttrib2fARB( ATTRIB_TEXTURE_MATRIX_SCALE, 1, 1 ); } -CString RageDisplay_OGL::Init( VideoModeParams p, bool bAllowUnacceleratedRenderer ) +RString RageDisplay_OGL::Init( VideoModeParams p, bool bAllowUnacceleratedRenderer ) { g_pWind = MakeLowLevelWindow(); bool bIgnore = false; - CString sError = SetVideoMode( p, bIgnore ); + RString sError = SetVideoMode( p, bIgnore ); if( sError != "" ) return sError; @@ -428,7 +428,7 @@ CString RageDisplay_OGL::Init( VideoModeParams p, bool bAllowUnacceleratedRender InitScalingScript(); - return CString(); + return RString(); } RageDisplay_OGL::~RageDisplay_OGL() @@ -444,7 +444,7 @@ void RageDisplay_OGL::GetDisplayResolutions( DisplayResolutions &out ) const static void CheckPalettedTextures() { - CString sError; + RString sError; do { if( !GLExt.HasExtension("GL_EXT_paletted_texture") ) @@ -613,11 +613,11 @@ void RageDisplay_OGL::ResolutionChanged() // Return true if mode change was successful. // bNewDeviceOut is set true if a new device was created and textures // need to be reloaded. -CString RageDisplay_OGL::TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ) +RString RageDisplay_OGL::TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ) { //LOG->Warn( "RageDisplay_OGL::TryVideoMode( %d, %d, %d, %d, %d, %d )", p.windowed, p.width, p.height, p.bpp, p.rate, p.vsync ); - CString err; + RString err; err = g_pWind->TryVideoMode( p, bNewDeviceOut ); if( err != "" ) return err; // failed to set video mode @@ -648,7 +648,7 @@ CString RageDisplay_OGL::TryVideoMode( const VideoModeParams &p, bool &bNewDevic ResolutionChanged(); - return CString(); // successfully set mode + return RString(); // successfully set mode } int RageDisplay_OGL::GetMaxTextureSize() const @@ -844,7 +844,7 @@ public: /* for( int i=0; i<4; i++ ) { - CString s; + RString s; for( int j=0; j<4; j++ ) s += ssprintf( "%f ", mat.m[i][j] ); LOG->Trace( s ); @@ -1168,7 +1168,7 @@ void RageCompiledGeometryHWOGL::Draw( int iMeshIndex ) const /* for( int i=0; i<4; i++ ) { - CString s; + RString s; for( int j=0; j<4; j++ ) s += ssprintf( "%f ", mat.m[i][j] ); LOG->Trace( s ); @@ -1906,9 +1906,9 @@ void RageDisplay_OGL::SetLineWidth( float fWidth ) glLineWidth( fWidth ); } -CString RageDisplay_OGL::GetTextureDiagnostics( unsigned id ) const +RString RageDisplay_OGL::GetTextureDiagnostics( unsigned id ) const { - return CString(); + return RString(); } void RageDisplay_OGL::SetAlphaTest( bool b ) diff --git a/stepmania/src/RageDisplay_OGL.h b/stepmania/src/RageDisplay_OGL.h index 112b7ce30a..2643421ab9 100644 --- a/stepmania/src/RageDisplay_OGL.h +++ b/stepmania/src/RageDisplay_OGL.h @@ -8,9 +8,9 @@ class RageDisplay_OGL: public RageDisplay public: RageDisplay_OGL(); virtual ~RageDisplay_OGL(); - CString Init( VideoModeParams p, bool bAllowUnacceleratedRenderer ); + RString Init( VideoModeParams p, bool bAllowUnacceleratedRenderer ); - virtual CString GetApiDescription() const { return "OpenGL"; } + virtual RString GetApiDescription() const { return "OpenGL"; } virtual void GetDisplayResolutions( DisplayResolutions &out ) const; void ResolutionChanged(); const PixelFormatDesc *GetPixelFormatDesc(PixelFormat pf) const; @@ -77,7 +77,7 @@ public: virtual void SetPolygonMode( PolygonMode pm ); virtual void SetLineWidth( float fWidth ); - CString GetTextureDiagnostics( unsigned id ) const; + RString GetTextureDiagnostics( unsigned id ) const; protected: void DrawQuadsInternal( const RageSpriteVertex v[], int iNumVerts ); @@ -88,7 +88,7 @@ protected: void DrawCompiledGeometryInternal( const RageCompiledGeometry *p, int iMeshIndex ); void DrawLineStripInternal( const RageSpriteVertex v[], int iNumVerts, float LineWidth ); - CString TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ); + RString TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ); RageSurface* CreateScreenshot(); PixelFormat GetImgPixelFormat( RageSurface* &img, bool &FreeImg, int width, int height, bool bPalettedTexture ); bool SupportsSurfaceFormat( PixelFormat pixfmt ); diff --git a/stepmania/src/RageDisplay_OGL_Extensions.cpp b/stepmania/src/RageDisplay_OGL_Extensions.cpp index d453058885..60597ba95d 100644 --- a/stepmania/src/RageDisplay_OGL_Extensions.cpp +++ b/stepmania/src/RageDisplay_OGL_Extensions.cpp @@ -29,7 +29,7 @@ GLExt_t GLExt; /* Available extensions: */ static set g_glExts; -bool GLExt_t::HasExtension( const CString &sExt ) const +bool GLExt_t::HasExtension( const RString &sExt ) const { return g_glExts.find(sExt) != g_glExts.end(); } @@ -69,7 +69,7 @@ static void GetGLExtensions( set &ext ) { const char *szBuf = (const char *) glGetString( GL_EXTENSIONS ); - vector asList; + vector asList; split( szBuf, " ", asList ); for( unsigned i = 0; i < asList.size(); ++i ) diff --git a/stepmania/src/RageDisplay_OGL_Extensions.h b/stepmania/src/RageDisplay_OGL_Extensions.h index ed040cd24d..b4a9afa841 100644 --- a/stepmania/src/RageDisplay_OGL_Extensions.h +++ b/stepmania/src/RageDisplay_OGL_Extensions.h @@ -52,7 +52,7 @@ struct GLExt_t void Load( LowLevelWindow *pWind ); - bool HasExtension( const CString &sExt ) const; + bool HasExtension( const RString &sExt ) const; }; extern GLExt_t GLExt; diff --git a/stepmania/src/RageFileDriverDeflate.cpp b/stepmania/src/RageFileDriverDeflate.cpp index c59ae5c67d..fc040e0496 100644 --- a/stepmania/src/RageFileDriverDeflate.cpp +++ b/stepmania/src/RageFileDriverDeflate.cpp @@ -312,7 +312,7 @@ int RageFileObjDeflate::FlushInternal() * Parse a .gz file, check the header CRC16 if present, and return the data * CRC32 and a decompressor. */ -RageFileBasic *GunzipFile( RageFileBasic &file, CString &sError, uint32_t *iCRC32 ) +RageFileBasic *GunzipFile( RageFileBasic &file, RString &sError, uint32_t *iCRC32 ) { sError = ""; @@ -511,7 +511,7 @@ int RageFileObjGzip::Finish() #include "RageFileDriverMemory.h" -void GzipString( const CString &sIn, CString &sOut ) +void GzipString( const RString &sIn, RString &sOut ) { /* Gzip it. */ RageFileObjMem mem; @@ -523,12 +523,12 @@ void GzipString( const CString &sIn, CString &sOut ) sOut = mem.GetString(); } -bool GunzipString( const CString &sIn, CString &sOut ) +bool GunzipString( const RString &sIn, RString &sOut ) { RageFileObjMem mem; mem.PutString( sIn ); - CString sError; + RString sError; uint32_t iCRC32; RageFileBasic *pFile = GunzipFile( mem, sError, &iCRC32 ); if( pFile == NULL ) diff --git a/stepmania/src/RageFileDriverDeflate.h b/stepmania/src/RageFileDriverDeflate.h index 44fc3ca156..e28e8a738a 100644 --- a/stepmania/src/RageFileDriverDeflate.h +++ b/stepmania/src/RageFileDriverDeflate.h @@ -66,11 +66,11 @@ private: int m_iDataStartOffset; }; -RageFileBasic *GunzipFile( RageFileBasic &file, CString &sError, uint32_t *iCRC32 ); +RageFileBasic *GunzipFile( RageFileBasic &file, RString &sError, uint32_t *iCRC32 ); /* Quick helpers: */ -void GzipString( const CString &sIn, CString &sOut ); -bool GunzipString( const CString &sIn, CString &sOut ); // returns false on CRC, etc. error +void GzipString( const RString &sIn, RString &sOut ); +bool GunzipString( const RString &sIn, RString &sOut ); // returns false on CRC, etc. error #endif diff --git a/stepmania/src/RageInput.cpp b/stepmania/src/RageInput.cpp index 66feb0cc5b..fac9af9268 100644 --- a/stepmania/src/RageInput.cpp +++ b/stepmania/src/RageInput.cpp @@ -10,7 +10,7 @@ RageInput* INPUTMAN = NULL; // globally accessable input device -static Preference g_sInputDrivers( "InputDrivers", "" ); // "" == DEFAULT_INPUT_DRIVER_LIST +static Preference g_sInputDrivers( "InputDrivers", "" ); // "" == DEFAULT_INPUT_DRIVER_LIST RageInput::RageInput() { @@ -62,7 +62,7 @@ bool RageInput::DevicesChanged() return false; } -void RageInput::GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ) +void RageInput::GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ) { for( unsigned i = 0; i < m_pDevices.size(); ++i ) m_pDevices[i]->GetDevicesAndDescriptions( vDevicesOut, vDescriptionsOut ); @@ -80,12 +80,12 @@ void RageInput::AddHandler( InputHandler *pHandler ) m_pDevices.push_back( pHandler ); } -CString RageInput::GetDeviceSpecificInputString( const DeviceInput &di ) +RString RageInput::GetDeviceSpecificInputString( const DeviceInput &di ) { FOREACH( InputHandler*, m_pDevices, i ) { vector vDevices; - vector vDescriptions; + vector vDescriptions; (*i)->GetDevicesAndDescriptions( vDevices, vDescriptions ); bool bMatch = find(vDevices.begin(), vDevices.end(), di.device) != vDevices.end(); @@ -101,7 +101,7 @@ InputDeviceState RageInput::GetInputDeviceState( InputDevice id ) FOREACH( InputHandler*, m_pDevices, i ) { vector vDevices; - vector vDescriptions; + vector vDescriptions; (*i)->GetDevicesAndDescriptions( vDevices, vDescriptions ); bool bMatch = find(vDevices.begin(), vDevices.end(), id) != vDevices.end(); @@ -124,7 +124,7 @@ public: static int GetDescriptions( T* p, lua_State *L ) { vector vDevices; - vector vsDescriptions; + vector vsDescriptions; p->GetDevicesAndDescriptions( vDevices, vsDescriptions ); LuaHelpers::CreateTableFromArray( vsDescriptions, L ); return 1; diff --git a/stepmania/src/RageInput.h b/stepmania/src/RageInput.h index 42816ca966..0658887167 100644 --- a/stepmania/src/RageInput.h +++ b/stepmania/src/RageInput.h @@ -17,10 +17,10 @@ public: void LoadDrivers(); void Update(); bool DevicesChanged(); - void GetDevicesAndDescriptions( vector& vDevicesOut, vector& vsDescriptionsOut ); + void GetDevicesAndDescriptions( vector& vDevicesOut, vector& vsDescriptionsOut ); void WindowReset(); void AddHandler( InputHandler *pHandler ); - CString GetDeviceSpecificInputString( const DeviceInput &di ); + RString GetDeviceSpecificInputString( const DeviceInput &di ); InputDeviceState GetInputDeviceState( InputDevice id ); // Lua @@ -28,7 +28,7 @@ public: private: vector m_pDevices; - CString m_sDriverList; + RString m_sDriverList; }; extern RageInput* INPUTMAN; // global and accessable from anywhere in our program diff --git a/stepmania/src/RageInputDevice.cpp b/stepmania/src/RageInputDevice.cpp index 7e06dbd674..35a79fa976 100644 --- a/stepmania/src/RageInputDevice.cpp +++ b/stepmania/src/RageInputDevice.cpp @@ -121,7 +121,7 @@ static void InitNames() g_mapStringToNames[m->second] = m->first; } -CString DeviceButtonToString( DeviceButton key ) +RString DeviceButtonToString( DeviceButton key ) { InitNames(); @@ -146,7 +146,7 @@ CString DeviceButtonToString( DeviceButton key ) return "unknown"; } -DeviceButton StringToDeviceButton( const CString& s ) +DeviceButton StringToDeviceButton( const RString& s ) { InitNames(); @@ -196,16 +196,16 @@ static const char *InputDeviceNames[] = { XToString( InputDevice, NUM_INPUT_DEVICES ); StringToX( InputDevice ); -CString DeviceInput::ToString() const +RString DeviceInput::ToString() const { if( device == DEVICE_NONE ) - return CString(); + return RString(); - CString s = InputDeviceToString(device) + "_" + DeviceButtonToString(button); + RString s = InputDeviceToString(device) + "_" + DeviceButtonToString(button); return s; } -bool DeviceInput::FromString( const CString &s ) +bool DeviceInput::FromString( const RString &s ) { char szDevice[32] = ""; char szButton[32] = ""; diff --git a/stepmania/src/RageInputDevice.h b/stepmania/src/RageInputDevice.h index f8fa4399ce..56d9d737f2 100644 --- a/stepmania/src/RageInputDevice.h +++ b/stepmania/src/RageInputDevice.h @@ -34,8 +34,8 @@ enum InputDevice DEVICE_NONE // means this is NULL }; #define FOREACH_InputDevice( i ) FOREACH_ENUM( InputDevice, NUM_INPUT_DEVICES, i ) -const CString& InputDeviceToString( InputDevice i ); -InputDevice StringToInputDevice( const CString& s ); +const RString& InputDeviceToString( InputDevice i ); +InputDevice StringToInputDevice( const RString& s ); enum InputDeviceState @@ -255,8 +255,8 @@ enum DeviceButton DeviceButton_Invalid }; -CString DeviceButtonToString( DeviceButton i ); -DeviceButton StringToDeviceButton( const CString& s ); +RString DeviceButtonToString( DeviceButton i ); +DeviceButton StringToDeviceButton( const RString& s ); struct DeviceInput { @@ -294,8 +294,8 @@ public: return button < other.button; }; - CString ToString() const; - bool FromString( const CString &s ); + RString ToString() const; + bool FromString( const RString &s ); bool IsValid() const { return device != DEVICE_NONE; }; void MakeInvalid() { device = DEVICE_NONE; }; diff --git a/stepmania/src/RageLog.cpp b/stepmania/src/RageLog.cpp index 95b87d251e..7a1ff1737a 100644 --- a/stepmania/src/RageLog.cpp +++ b/stepmania/src/RageLog.cpp @@ -52,7 +52,7 @@ RageLog* LOG; // global and accessable from anywhere in the program * * The identifier is never displayed, so we can use a simple local object to * map/unmap, using any mechanism to generate unique IDs. */ -static map LogMaps; +static map LogMaps; #define LOG_PATH "log.txt" #define INFO_PATH "info.txt" @@ -94,8 +94,8 @@ RageLog::RageLog() RageLog::~RageLog() { /* Add the mapped log data to info.txt. */ - const CString AdditionalLog = GetAdditionalLog(); - vector AdditionalLogLines; + const RString AdditionalLog = GetAdditionalLog(); + vector AdditionalLogLines; split( AdditionalLog, "\n", AdditionalLogLines ); for( unsigned i = 0; i < AdditionalLogLines.size(); ++i ) { @@ -183,7 +183,7 @@ void RageLog::Trace( const char *fmt, ...) { va_list va; va_start(va, fmt); - CString sBuff = vssprintf( fmt, va ); + RString sBuff = vssprintf( fmt, va ); va_end(va); Write(0, sBuff); @@ -195,7 +195,7 @@ void RageLog::Info( const char *fmt, ...) { va_list va; va_start(va, fmt); - CString sBuff = vssprintf( fmt, va ); + RString sBuff = vssprintf( fmt, va ); va_end(va); Write(WRITE_TO_INFO, sBuff); @@ -205,31 +205,31 @@ void RageLog::Warn( const char *fmt, ...) { va_list va; va_start(va, fmt); - CString sBuff = vssprintf( fmt, va ); + RString sBuff = vssprintf( fmt, va ); va_end(va); Write( WRITE_TO_INFO | WRITE_LOUD, sBuff ); } -void RageLog::Write( int where, const CString &line ) +void RageLog::Write( int where, const RString &line ) { LockMut( *g_Mutex ); - vector lines; + vector lines; split( line, "\n", lines, false ); if( m_bLogToDisk && g_fileLog->IsOpen() && (where & WRITE_LOUD) ) g_fileLog->PutLine( "/////////////////////////////////////////" ); if( where & WRITE_LOUD ) printf( "/////////////////////////////////////////\n" ); - CString sTimestamp = SecondsToMMSSMsMsMs(RageTimer::GetTimeSinceStart()) + ": "; - CString sWarning; + RString sTimestamp = SecondsToMMSSMsMsMs(RageTimer::GetTimeSinceStart()) + ": "; + RString sWarning; if( where & WRITE_LOUD ) sWarning = "WARNING: "; for( unsigned i = 0; i < lines.size(); ++i ) { - CString &str = lines[i]; + RString &str = lines[i]; if( sWarning.size() ) str.insert( 0, sWarning ); @@ -283,7 +283,7 @@ void RageLog::Flush() static char staticlog[1024*32]=""; static unsigned staticlog_size = 0; -void RageLog::AddToInfo( const CString &str ) +void RageLog::AddToInfo( const RString &str ) { static bool limit_reached = false; if( limit_reached ) @@ -292,7 +292,7 @@ void RageLog::AddToInfo( const CString &str ) unsigned len = str.size() + strlen(NEWLINE); if( staticlog_size + len > sizeof(staticlog) ) { - const CString txt( NEWLINE "Staticlog limit reached" NEWLINE ); + const RString txt( NEWLINE "Staticlog limit reached" NEWLINE ); const unsigned pos = min( staticlog_size, sizeof(staticlog) - txt.size() ); memcpy( staticlog+pos, txt.data(), txt.size() ); @@ -315,7 +315,7 @@ const char *RageLog::GetInfo() static const int BACKLOG_LINES = 10; static char backlog[BACKLOG_LINES][1024]; static int backlog_start=0, backlog_cnt=0; -void RageLog::AddToRecentLogs( const CString &str ) +void RageLog::AddToRecentLogs( const RString &str ) { unsigned len = str.size(); if(len > sizeof(backlog[backlog_start])-1) @@ -352,8 +352,8 @@ static int g_AdditionalLogSize = 0; void RageLog::UpdateMappedLog() { - CString str; - for(map::const_iterator i = LogMaps.begin(); i != LogMaps.end(); ++i) + RString str; + for(map::const_iterator i = LogMaps.begin(); i != LogMaps.end(); ++i) str += ssprintf("%s" NEWLINE, i->second.c_str()); g_AdditionalLogSize = min( sizeof(g_AdditionalLogStr), str.size()+1 ); @@ -368,9 +368,9 @@ const char *RageLog::GetAdditionalLog() return g_AdditionalLogStr; } -void RageLog::MapLog(const CString &key, const char *fmt, ...) +void RageLog::MapLog(const RString &key, const char *fmt, ...) { - CString s; + RString s; va_list va; va_start(va, fmt); @@ -381,7 +381,7 @@ void RageLog::MapLog(const CString &key, const char *fmt, ...) UpdateMappedLog(); } -void RageLog::UnmapLog(const CString &key) +void RageLog::UnmapLog(const RString &key) { LogMaps.erase(key); UpdateMappedLog(); diff --git a/stepmania/src/RageLog.h b/stepmania/src/RageLog.h index 606b86ae0e..37a70bba52 100644 --- a/stepmania/src/RageLog.h +++ b/stepmania/src/RageLog.h @@ -14,8 +14,8 @@ public: void Info( const char *fmt, ...) PRINTF(2,3); void Flush(); - void MapLog( const CString &key, const char *fmt, ... ) PRINTF(3,4); - void UnmapLog( const CString &key ); + void MapLog( const RString &key, const char *fmt, ... ) PRINTF(3,4); + void UnmapLog( const RString &key ); static const char *GetAdditionalLog(); static const char *GetInfo(); @@ -32,10 +32,10 @@ private: bool m_bInfoToDisk; bool m_bFlush; bool m_bShowLogOutput; - void Write( int, const CString &str ); + void Write( int, const RString &str ); void UpdateMappedLog(); - void AddToInfo( const CString &buf ); - void AddToRecentLogs( const CString &buf ); + void AddToInfo( const RString &buf ); + void AddToRecentLogs( const RString &buf ); }; extern RageLog* LOG; // global and accessable from anywhere in our program diff --git a/stepmania/src/RageModelGeometry.cpp b/stepmania/src/RageModelGeometry.cpp index 3695ad6618..ea86493d1d 100644 --- a/stepmania/src/RageModelGeometry.cpp +++ b/stepmania/src/RageModelGeometry.cpp @@ -90,17 +90,17 @@ bool RageModelGeometry::HasAnyPerVertexBones() const #define THROW RageException::Throw( "Parse error in \"%s\" at line %d: '%s'", sPath.c_str(), iLineNum, sLine.c_str() ) -void RageModelGeometry::LoadMilkshapeAscii( const CString& _sPath, bool bNeedsNormals ) +void RageModelGeometry::LoadMilkshapeAscii( const RString& _sPath, bool bNeedsNormals ) { - CString sPath = _sPath; + RString sPath = _sPath; FixSlashesInPlace(sPath); - const CString sDir = Dirname( sPath ); + const RString sDir = Dirname( sPath ); RageFile f; if( !f.Open( sPath ) ) RageException::Throw( "RageModelGeometry::LoadMilkshapeAscii Could not open \"%s\": %s", sPath.c_str(), f.GetError().c_str() ); - CString sLine; + RString sLine; int iLineNum = 0; char szName[MS_MAX_NAME]; int nFlags, nIndex; diff --git a/stepmania/src/RageModelGeometry.h b/stepmania/src/RageModelGeometry.h index ae79ce0c50..2cc7c0f73d 100644 --- a/stepmania/src/RageModelGeometry.h +++ b/stepmania/src/RageModelGeometry.h @@ -15,7 +15,7 @@ public: RageModelGeometry (); virtual ~RageModelGeometry (); - void LoadMilkshapeAscii( const CString& sMilkshapeAsciiFile, bool bNeedsNormals ); + void LoadMilkshapeAscii( const RString& sMilkshapeAsciiFile, bool bNeedsNormals ); void OptimizeBones(); void MergeMeshes( int iFromIndex, int iToIndex ); bool HasAnyPerVertexBones() const; diff --git a/stepmania/src/RageSound.cpp b/stepmania/src/RageSound.cpp index 27c58f24d7..8a8cbdf044 100644 --- a/stepmania/src/RageSound.cpp +++ b/stepmania/src/RageSound.cpp @@ -142,7 +142,7 @@ bool RageSound::IsLoaded() const return m_pSource != NULL; } -void RageSound::Fail( CString sReason ) +void RageSound::Fail( RString sReason ) { LOG->Warn( "Decoding %s failed: %s", GetLoadedFilePath().c_str(), sReason.c_str() ); @@ -163,14 +163,14 @@ public: }; -bool RageSound::Load( CString sSoundFilePath ) +bool RageSound::Load( RString sSoundFilePath ) { /* Automatically determine whether to precache */ /* TODO: Hook this up to a pref? */ return Load( sSoundFilePath, false ); } -bool RageSound::Load( CString sSoundFilePath, bool bPrecache ) +bool RageSound::Load( RString sSoundFilePath, bool bPrecache ) { LOG->Trace( "RageSound::LoadSound( '%s', %d )", sSoundFilePath.c_str(), bPrecache ); @@ -179,7 +179,7 @@ bool RageSound::Load( CString sSoundFilePath, bool bPrecache ) SoundReader *pSound = SOUNDMAN->GetLoadedSound( sSoundFilePath ); if( pSound == NULL ) { - CString error; + RString error; pSound = SoundReader_FileReader::OpenFile( sSoundFilePath, error ); if( pSound == NULL ) { diff --git a/stepmania/src/RageSound.h b/stepmania/src/RageSound.h index 411b35f9de..b457fd7f4b 100644 --- a/stepmania/src/RageSound.h +++ b/stepmania/src/RageSound.h @@ -23,7 +23,7 @@ public: virtual RageTimer GetStartTime() const { return RageZeroTimer; } virtual float GetAbsoluteVolume() const = 0; virtual int GetID() const = 0; - virtual CString GetLoadedFilePath() const = 0; + virtual RString GetLoadedFilePath() const = 0; virtual bool IsStreamingFromDisk() const = 0; }; @@ -98,13 +98,13 @@ public: * they can be ignored most of the time, so we continue to work if a file * is broken or missing. */ - bool Load( CString sFile, bool bPrecache ); + bool Load( RString sFile, bool bPrecache ); /* * Using this version means the "don't care" about caching. Currently, * this always will not cache the sound; this may become a preference. */ - bool Load( CString sFile ); + bool Load( RString sFile ); /* Load a SoundReader that you've set up yourself. Sample rate conversion will * be set up only if needed. Doesn't fail. */ @@ -115,7 +115,7 @@ public: void StartPlaying(); void StopPlaying(); - CString GetError() const { return m_sError; } + RString GetError() const { return m_sError; } RageSound *Play( const RageSoundParams *params=NULL ); void Stop(); @@ -129,7 +129,7 @@ public: int GetSampleRate() const; bool IsStreamingFromDisk() const; bool SetPositionSeconds( float fSeconds ); - CString GetLoadedFilePath() const { return m_sFilePath; } + RString GetLoadedFilePath() const { return m_sFilePath; } bool IsPlaying() const { return m_bPlaying; } float GetPlaybackRate() const; @@ -149,7 +149,7 @@ private: /* We keep track of sound blocks we've sent out recently through GetDataToPlay. */ pos_map_queue m_PositionMapping; - CString m_sFilePath; + RString m_sFilePath; RageSoundParams m_Param; @@ -172,12 +172,12 @@ private: /* Unique ID number for this instance of RageSound. */ int m_iID; - CString m_sError; + RString m_sError; int64_t GetPositionSecondsInternal( bool *bApproximate=NULL ) const; bool SetPositionFrames( int frames = -1 ); int GetData( char *pBuffer, int iSize ); - void Fail( CString sReason ); + void Fail( RString sReason ); int Bytes_Available() const; RageSoundParams::StopMode_t GetStopMode() const; /* resolves M_AUTO */ diff --git a/stepmania/src/RageSoundManager.cpp b/stepmania/src/RageSoundManager.cpp index 363fc573b9..82c9bfc066 100644 --- a/stepmania/src/RageSoundManager.cpp +++ b/stepmania/src/RageSoundManager.cpp @@ -35,7 +35,7 @@ */ static RageMutex g_SoundManMutex("SoundMan"); -static Preference g_sSoundDrivers( "SoundDrivers", "" ); // "" == DEFAULT_SOUND_DRIVER_LIST +static Preference g_sSoundDrivers( "SoundDrivers", "" ); // "" == DEFAULT_SOUND_DRIVER_LIST RageSoundManager *SOUNDMAN = NULL; @@ -49,7 +49,7 @@ RageSoundManager::RageSoundManager() static LocalizedString COULDNT_FIND_SOUND_DRIVER( "RageSoundManager", "Couldn't find a sound driver that works" ); void RageSoundManager::Init() { - CString sDrivers = g_sSoundDrivers; + RString sDrivers = g_sSoundDrivers; if( sDrivers.empty() ) sDrivers = DEFAULT_SOUND_DRIVER_LIST; @@ -119,7 +119,7 @@ void RageSoundManager::Update( float fDeltaTime ) /* Scan m_mapPreloadedSounds for sounds that are no longer loaded, and delete them. */ g_SoundManMutex.Lock(); /* lock for access to m_mapPreloadedSounds, owned_sounds */ { - map::iterator it, next; + map::iterator it, next; it = m_mapPreloadedSounds.begin(); while( it != m_mapPreloadedSounds.end() ) @@ -296,13 +296,13 @@ void RageSoundManager::DeleteSoundWhenFinished( RageSound *pSound ) /* If the given path is loaded, return a copy; otherwise return NULL. * It's the caller's responsibility to delete the result. */ -SoundReader *RageSoundManager::GetLoadedSound( const CString &sPath_ ) +SoundReader *RageSoundManager::GetLoadedSound( const RString &sPath_ ) { LockMut(g_SoundManMutex); /* lock for access to m_mapPreloadedSounds */ - CString sPath(sPath_); + RString sPath(sPath_); sPath.MakeLower(); - map::const_iterator it; + map::const_iterator it; it = m_mapPreloadedSounds.find( sPath ); if( it == m_mapPreloadedSounds.end() ) return NULL; @@ -313,15 +313,15 @@ SoundReader *RageSoundManager::GetLoadedSound( const CString &sPath_ ) /* Add the sound to the set of loaded sounds that can be copied for reuse. * The sound will be kept in memory as long as there are any other references * to it; once we hold the last one, we'll release it. */ -void RageSoundManager::AddLoadedSound( const CString &sPath_, RageSoundReader_Preload *pSound ) +void RageSoundManager::AddLoadedSound( const RString &sPath_, RageSoundReader_Preload *pSound ) { LockMut(g_SoundManMutex); /* lock for access to m_mapPreloadedSounds */ /* Don't AddLoadedSound a sound that's already registered. It should have been * used in GetLoadedSound. */ - CString sPath(sPath_); + RString sPath(sPath_); sPath.MakeLower(); - map::const_iterator it; + map::const_iterator it; it = m_mapPreloadedSounds.find( sPath ); ASSERT_M( it == m_mapPreloadedSounds.end(), sPath ); @@ -331,7 +331,7 @@ void RageSoundManager::AddLoadedSound( const CString &sPath_, RageSoundReader_Pr /* Don't hold the lock when we don't have to. We call this function from other * threads, to avoid stalling the gameplay thread. */ -void RageSoundManager::PlayOnce( CString sPath ) +void RageSoundManager::PlayOnce( RString sPath ) { /* We want this to start quickly, so don't try to prebuffer it. */ RageSound *pSound = new RageSound; diff --git a/stepmania/src/RageSoundManager.h b/stepmania/src/RageSoundManager.h index 11e41e6ccf..8575e61b1d 100644 --- a/stepmania/src/RageSoundManager.h +++ b/stepmania/src/RageSoundManager.h @@ -50,10 +50,10 @@ public: void DeleteSound( RageSound *pSound ); void DeleteSoundWhenFinished( RageSound *pSound ); - SoundReader *GetLoadedSound( const CString &sPath ); - void AddLoadedSound( const CString &sPath, RageSoundReader_Preload *pSound ); + SoundReader *GetLoadedSound( const RString &sPath ); + void AddLoadedSound( const RString &sPath, RageSoundReader_Preload *pSound ); - void PlayOnce( CString sPath ); + void PlayOnce( RString sPath ); RageSound *PlaySound( RageSound &snd, const RageSoundParams *params = NULL ); RageSound *PlayCopyOfSound( RageSound &snd, const RageSoundParams *params = NULL ); @@ -66,7 +66,7 @@ private: /* A list of all sounds that currently exist, by ID. */ map all_sounds; - map m_mapPreloadedSounds; + map m_mapPreloadedSounds; RageSoundDriver *m_pDriver; diff --git a/stepmania/src/RageSoundReader.h b/stepmania/src/RageSoundReader.h index 7d68665645..dedcf565b0 100644 --- a/stepmania/src/RageSoundReader.h +++ b/stepmania/src/RageSoundReader.h @@ -20,10 +20,10 @@ public: string GetError() const { return m_sError; } protected: - void SetError( CString sError ) const { m_sError = sError; } + void SetError( RString sError ) const { m_sError = sError; } private: - mutable CString m_sError; + mutable RString m_sError; }; #endif diff --git a/stepmania/src/RageSoundReader_Chain.cpp b/stepmania/src/RageSoundReader_Chain.cpp index 227b498de9..eb3718ab76 100644 --- a/stepmania/src/RageSoundReader_Chain.cpp +++ b/stepmania/src/RageSoundReader_Chain.cpp @@ -31,7 +31,7 @@ RageSoundReader_Chain::~RageSoundReader_Chain() while( !m_apActiveSounds.empty() ) ReleaseSound( 0 ); - map::iterator it; + map::iterator it; for( it = m_apLoadedSounds.begin(); it != m_apLoadedSounds.end(); ++it ) delete it->second; } @@ -45,15 +45,15 @@ SoundReader *RageSoundReader_Chain::Copy() const /* The same sound may be used several times, and by several different chains. Avoid * loading the same sound multiple times. We need to make a Copy() if we need to * read it more than once at a time. */ -bool RageSoundReader_Chain::AddSound( CString sPath, float fOffsetSecs, float fPan ) +bool RageSoundReader_Chain::AddSound( RString sPath, float fOffsetSecs, float fPan ) { sPath.ToLower(); - map::const_iterator it; + map::const_iterator it; it = m_apLoadedSounds.find( sPath ); if( it == m_apLoadedSounds.end() ) { - CString error; + RString error; SoundReader *pReader = SoundReader_FileReader::OpenFile( sPath, error ); if( pReader == NULL ) { @@ -80,7 +80,7 @@ int RageSoundReader_Chain::GetSampleRateInternal() const if( m_apLoadedSounds.empty() ) return m_iPreferredSampleRate; - map::const_iterator it; + map::const_iterator it; int iRate = -1; for( it = m_apLoadedSounds.begin(); it != m_apLoadedSounds.end(); ++it ) { @@ -99,7 +99,7 @@ void RageSoundReader_Chain::Finish() { sound &sound = m_Sounds[i]; - map::iterator it = m_apLoadedSounds.find( sound.sPath ); + map::iterator it = m_apLoadedSounds.find( sound.sPath ); if( it == m_apLoadedSounds.end() ) { m_Sounds.erase( m_Sounds.begin()+i ); @@ -111,7 +111,7 @@ void RageSoundReader_Chain::Finish() /* Figure out how many channels we have. */ m_iChannels = 1; - map::iterator it; + map::iterator it; for( it = m_apLoadedSounds.begin(); it != m_apLoadedSounds.end(); ++it ) m_iChannels = max( m_iChannels, it->second->GetNumChannels() ); @@ -219,7 +219,7 @@ void RageSoundReader_Chain::ReleaseSound( unsigned n ) bool RageSoundReader_Chain::IsStreamingFromDisk() const { - map::const_iterator it; + map::const_iterator it; for( it = m_apLoadedSounds.begin(); it != m_apLoadedSounds.end(); ++it ) if( it->second->IsStreamingFromDisk() ) return true; diff --git a/stepmania/src/RageSoundReader_Chain.h b/stepmania/src/RageSoundReader_Chain.h index 2cdc0bc300..50742e693e 100644 --- a/stepmania/src/RageSoundReader_Chain.h +++ b/stepmania/src/RageSoundReader_Chain.h @@ -21,7 +21,7 @@ public: /* Add the given sound to play after fOffsetSecs seconds. Takes ownership * of pSound. */ - bool AddSound( CString sPath, float fOffsetSecs, float fPan ); + bool AddSound( RString sPath, float fOffsetSecs, float fPan ); /* Finish adding sounds. */ void Finish(); @@ -45,11 +45,11 @@ private: int m_iActualSampleRate; unsigned m_iChannels; - map m_apLoadedSounds; + map m_apLoadedSounds; struct sound { - CString sPath; + RString sPath; int iOffsetMS; float fPan; int GetOffsetFrame( int iSampleRate ) const { return int( int64_t(iOffsetMS) * iSampleRate / 1000 ); } diff --git a/stepmania/src/RageSoundReader_FileReader.cpp b/stepmania/src/RageSoundReader_FileReader.cpp index 4a84605b43..08f5f2c37f 100644 --- a/stepmania/src/RageSoundReader_FileReader.cpp +++ b/stepmania/src/RageSoundReader_FileReader.cpp @@ -16,7 +16,7 @@ #include "RageSoundReader_Vorbisfile.h" #endif -SoundReader_FileReader *SoundReader_FileReader::TryOpenFile( CString filename, CString &error, CString format, bool &bKeepTrying ) +SoundReader_FileReader *SoundReader_FileReader::TryOpenFile( RString filename, RString &error, RString format, bool &bKeepTrying ) { SoundReader_FileReader *Sample = NULL; @@ -41,7 +41,7 @@ SoundReader_FileReader *SoundReader_FileReader::TryOpenFile( CString filename, C if( ret == OPEN_OK ) return Sample; - CString err = Sample->GetError(); + RString err = Sample->GetError(); delete Sample; LOG->Trace( "Format %s failed: %s", format.c_str(), err.c_str() ); @@ -82,7 +82,7 @@ SoundReader_FileReader *SoundReader_FileReader::TryOpenFile( CString filename, C return NULL; } -SoundReader *SoundReader_FileReader::OpenFile( CString filename, CString &error ) +SoundReader *SoundReader_FileReader::OpenFile( RString filename, RString &error ) { { RageFile TestOpen; @@ -93,12 +93,12 @@ SoundReader *SoundReader_FileReader::OpenFile( CString filename, CString &error } } - set FileTypes; + set FileTypes; FileTypes.insert("ogg"); FileTypes.insert("mp3"); FileTypes.insert("wav"); - CString format = GetExtension(filename); + RString format = GetExtension(filename); format.MakeLower(); error = ""; @@ -114,7 +114,7 @@ SoundReader *SoundReader_FileReader::OpenFile( CString filename, CString &error FileTypes.erase( format ); } - for( set::iterator it = FileTypes.begin(); bKeepTrying && it != FileTypes.end(); ++it ) + for( set::iterator it = FileTypes.begin(); bKeepTrying && it != FileTypes.end(); ++it ) { SoundReader_FileReader *NewSample = TryOpenFile( filename, error, *it, bKeepTrying ); if( NewSample ) diff --git a/stepmania/src/RageSoundReader_FileReader.h b/stepmania/src/RageSoundReader_FileReader.h index 985235cade..a3d8e32eb1 100644 --- a/stepmania/src/RageSoundReader_FileReader.h +++ b/stepmania/src/RageSoundReader_FileReader.h @@ -22,13 +22,13 @@ public: OPEN_UNKNOWN_FILE_FORMAT=1, OPEN_FATAL_ERROR=2, }; - virtual OpenResult Open(CString filename) = 0; + virtual OpenResult Open(RString filename) = 0; virtual bool IsStreamingFromDisk() const { return true; } - static SoundReader *OpenFile( CString filename, CString &error ); + static SoundReader *OpenFile( RString filename, RString &error ); private: - static SoundReader_FileReader *TryOpenFile( CString filename, CString &error, CString format, bool &bKeepTrying ); + static SoundReader_FileReader *TryOpenFile( RString filename, RString &error, RString format, bool &bKeepTrying ); }; #endif diff --git a/stepmania/src/RageSoundReader_MP3.cpp b/stepmania/src/RageSoundReader_MP3.cpp index dda1450d88..addc015b0f 100644 --- a/stepmania/src/RageSoundReader_MP3.cpp +++ b/stepmania/src/RageSoundReader_MP3.cpp @@ -624,7 +624,7 @@ RageSoundReader_MP3::~RageSoundReader_MP3() delete mad; } -SoundReader_FileReader::OpenResult RageSoundReader_MP3::Open( CString filename_ ) +SoundReader_FileReader::OpenResult RageSoundReader_MP3::Open( RString filename_ ) { filename = filename_; if( !file.Open( filename ) ) diff --git a/stepmania/src/RageSoundReader_MP3.h b/stepmania/src/RageSoundReader_MP3.h index 25409ec65e..d44ebc2250 100644 --- a/stepmania/src/RageSoundReader_MP3.h +++ b/stepmania/src/RageSoundReader_MP3.h @@ -11,7 +11,7 @@ struct madlib_t; class RageSoundReader_MP3: public SoundReader_FileReader { public: - OpenResult Open(CString filename); + OpenResult Open(RString filename); void Close(); int GetLength() const { return GetLengthConst(false); } int GetLength_Fast() const { return GetLengthConst(true); } @@ -29,7 +29,7 @@ private: int SampleRate; int Channels; - CString filename; + RString filename; RageFile file; madlib_t *mad; diff --git a/stepmania/src/RageSoundReader_Vorbisfile.cpp b/stepmania/src/RageSoundReader_Vorbisfile.cpp index 13e90d6ee4..5484cd04a5 100644 --- a/stepmania/src/RageSoundReader_Vorbisfile.cpp +++ b/stepmania/src/RageSoundReader_Vorbisfile.cpp @@ -44,14 +44,14 @@ static long OggRageFile_tell_func( void *datasource ) return f->Tell(); } -static CString ov_ssprintf( int err, const char *fmt, ...) +static RString ov_ssprintf( int err, const char *fmt, ...) { va_list va; va_start(va, fmt); - CString s = vssprintf( fmt, va ); + RString s = vssprintf( fmt, va ); va_end(va); - CString errstr; + RString errstr; switch( err ) { /* XXX: In the case of OV_EREAD, can we snoop at errno? */ @@ -72,7 +72,7 @@ static CString ov_ssprintf( int err, const char *fmt, ...) return s + ssprintf( " (%s)", errstr.c_str() ); } -SoundReader_FileReader::OpenResult RageSoundReader_Vorbisfile::Open(CString filename_) +SoundReader_FileReader::OpenResult RageSoundReader_Vorbisfile::Open(RString filename_) { filename=filename_; diff --git a/stepmania/src/RageSoundReader_Vorbisfile.h b/stepmania/src/RageSoundReader_Vorbisfile.h index 3655d3b803..dfeb1ff61e 100644 --- a/stepmania/src/RageSoundReader_Vorbisfile.h +++ b/stepmania/src/RageSoundReader_Vorbisfile.h @@ -11,7 +11,7 @@ class RageFileBasic; class RageSoundReader_Vorbisfile: public SoundReader_FileReader { public: - OpenResult Open(CString filename); + OpenResult Open(RString filename); OpenResult Open( RageFileBasic *f ); int GetLength() const; @@ -30,7 +30,7 @@ private: bool eof; int SetPosition( int ms, bool accurate ); bool FillBuf(); - CString filename; + RString filename; int read_offset; unsigned channels; }; diff --git a/stepmania/src/RageSoundReader_WAV.cpp b/stepmania/src/RageSoundReader_WAV.cpp index 2b5c60c5c8..97c6dd0646 100644 --- a/stepmania/src/RageSoundReader_WAV.cpp +++ b/stepmania/src/RageSoundReader_WAV.cpp @@ -46,12 +46,12 @@ struct WavReader virtual int GetLength() const = 0; virtual bool Init() = 0; virtual int SetPosition( int iMS ) = 0; - CString GetError() const { return m_sError; } + RString GetError() const { return m_sError; } protected: RageFile &m_File; const RageSoundReader_WAV::WavData &m_WavData; - CString m_sError; + RString m_sError; }; struct WavReaderPCM: public WavReader @@ -354,12 +354,12 @@ public: } }; -CString ReadString( RageFile &f, int iSize, CString &sError ) +RString ReadString( RageFile &f, int iSize, RString &sError ) { if( sError.size() != 0 ) - return CString(); + return RString(); - CString sBuf; + RString sBuf; char *pBuf = sBuf.GetBuffer( iSize ); FileReading::ReadBytes( f, pBuf, iSize, sError ); sBuf.ReleaseBuffer( iSize ); @@ -373,11 +373,11 @@ CString ReadString( RageFile &f, int iSize, CString &sError ) return OPEN_FATAL_ERROR; \ } -SoundReader_FileReader::OpenResult RageSoundReader_WAV::Open( CString filename_ ) +SoundReader_FileReader::OpenResult RageSoundReader_WAV::Open( RString filename_ ) { m_sFilename = filename_; - CString sError; + RString sError; if( !m_File.Open( m_sFilename ) ) FATAL_ERROR( ssprintf("wav: opening \"%s\" failed: %s", m_sFilename.c_str(), m_File.GetError().c_str()) ); @@ -401,7 +401,7 @@ SoundReader_FileReader::OpenResult RageSoundReader_WAV::Open( CString filename_ bool bGotFormatChunk = false, bGotDataChunk = false; while( !bGotFormatChunk || !bGotDataChunk ) { - CString ChunkID = ReadString( m_File, 4, sError ); + RString ChunkID = ReadString( m_File, 4, sError ); int32_t iChunkSize = FileReading::read_32_le( m_File, sError ); if( sError.size() != 0 ) diff --git a/stepmania/src/RageSoundReader_WAV.h b/stepmania/src/RageSoundReader_WAV.h index fb8a318520..9f93a75ec4 100644 --- a/stepmania/src/RageSoundReader_WAV.h +++ b/stepmania/src/RageSoundReader_WAV.h @@ -10,7 +10,7 @@ struct WavReader; class RageSoundReader_WAV: public SoundReader_FileReader { public: - OpenResult Open( CString m_sFilename ); + OpenResult Open( RString m_sFilename ); void Close(); int GetLength() const; int GetLength_Fast() const { return GetLength(); } @@ -32,7 +32,7 @@ public: private: RageFile m_File; - CString m_sFilename; + RString m_sFilename; WavData m_WavData; WavReader *m_pImpl; diff --git a/stepmania/src/RageSurfaceUtils.cpp b/stepmania/src/RageSurfaceUtils.cpp index 2633b52aea..2125c525ef 100644 --- a/stepmania/src/RageSurfaceUtils.cpp +++ b/stepmania/src/RageSurfaceUtils.cpp @@ -747,7 +747,7 @@ struct SurfaceHeader }; /* Save and load RageSurfaces to disk, in a very fast, nonportable way. */ -bool RageSurfaceUtils::SaveSurface( const RageSurface *img, CString file ) +bool RageSurfaceUtils::SaveSurface( const RageSurface *img, RString file ) { RageFile f; if( !f.Open( file, RageFile::WRITE ) ) @@ -778,7 +778,7 @@ bool RageSurfaceUtils::SaveSurface( const RageSurface *img, CString file ) return true; } -RageSurface *RageSurfaceUtils::LoadSurface( CString file ) +RageSurface *RageSurfaceUtils::LoadSurface( RString file ) { RageFile f; if( !f.Open( file ) ) diff --git a/stepmania/src/RageSurfaceUtils.h b/stepmania/src/RageSurfaceUtils.h index 1fbd71d041..fb1211c810 100644 --- a/stepmania/src/RageSurfaceUtils.h +++ b/stepmania/src/RageSurfaceUtils.h @@ -50,8 +50,8 @@ namespace RageSurfaceUtils void Blit( const RageSurface *src, RageSurface *dst, int width = -1, int height = -1 ); void CorrectBorderPixels( RageSurface *img, int width, int height ); - bool SaveSurface( const RageSurface *img, CString file ); - RageSurface *LoadSurface( CString file ); + bool SaveSurface( const RageSurface *img, RString file ); + RageSurface *LoadSurface( RString file ); /* Quickly palettize to an gray/alpha texture. */ RageSurface *PalettizeToGrayscale( const RageSurface *src_surf, int GrayBits, int AlphaBits ); diff --git a/stepmania/src/RageSurface_Load.cpp b/stepmania/src/RageSurface_Load.cpp index 59544ae8d3..0dd3494f72 100644 --- a/stepmania/src/RageSurface_Load.cpp +++ b/stepmania/src/RageSurface_Load.cpp @@ -10,7 +10,7 @@ #include -static RageSurface *TryOpenFile( CString sPath, bool bHeaderOnly, CString &error, CString format, bool &bKeepTrying ) +static RageSurface *TryOpenFile( RString sPath, bool bHeaderOnly, RString &error, RString format, bool &bKeepTrying ) { RageSurface *ret = NULL; RageSurfaceUtils::OpenResult result; @@ -72,7 +72,7 @@ static RageSurface *TryOpenFile( CString sPath, bool bHeaderOnly, CString &error return NULL; } -RageSurface *RageSurfaceUtils::LoadFile( const CString &sPath, CString &error, bool bHeaderOnly ) +RageSurface *RageSurfaceUtils::LoadFile( const RString &sPath, RString &error, bool bHeaderOnly ) { { RageFile TestOpen; @@ -83,13 +83,13 @@ RageSurface *RageSurfaceUtils::LoadFile( const CString &sPath, CString &error, b } } - set FileTypes; + set FileTypes; FileTypes.insert("png"); FileTypes.insert("jpg"); FileTypes.insert("gif"); FileTypes.insert("bmp"); - CString format = GetExtension(sPath); + RString format = GetExtension(sPath); format.MakeLower(); bool bKeepTrying = true; @@ -103,7 +103,7 @@ RageSurface *RageSurfaceUtils::LoadFile( const CString &sPath, CString &error, b FileTypes.erase( format ); } - for( set::iterator it = FileTypes.begin(); bKeepTrying && it != FileTypes.end(); ++it ) + for( set::iterator it = FileTypes.begin(); bKeepTrying && it != FileTypes.end(); ++it ) { RageSurface *ret = TryOpenFile( sPath, bHeaderOnly, error, *it, bKeepTrying ); if( ret ) diff --git a/stepmania/src/RageSurface_Load.h b/stepmania/src/RageSurface_Load.h index dc326041f3..3cfda3f21c 100644 --- a/stepmania/src/RageSurface_Load.h +++ b/stepmania/src/RageSurface_Load.h @@ -13,7 +13,7 @@ namespace RageSurfaceUtils /* If bHeaderOnly is true, the loader is only required to return a surface * with the width and height set (but may return a complete surface). */ - RageSurface *LoadFile( const CString &sPath, CString &error, bool bHeaderOnly=false ); + RageSurface *LoadFile( const RString &sPath, RString &error, bool bHeaderOnly=false ); } #endif diff --git a/stepmania/src/RageSurface_Load_BMP.cpp b/stepmania/src/RageSurface_Load_BMP.cpp index a743ec4d1c..64fc660740 100644 --- a/stepmania/src/RageSurface_Load_BMP.cpp +++ b/stepmania/src/RageSurface_Load_BMP.cpp @@ -24,7 +24,7 @@ enum return RageSurfaceUtils::OPEN_FATAL_ERROR; \ } -static RageSurfaceUtils::OpenResult LoadBMP( RageFile &f, RageSurface *&img, CString &sError ) +static RageSurfaceUtils::OpenResult LoadBMP( RageFile &f, RageSurface *&img, RString &sError ) { char magic[2]; ReadBytes( f, magic, 2, sError ); @@ -156,7 +156,7 @@ static RageSurfaceUtils::OpenResult LoadBMP( RageFile &f, RageSurface *&img, CSt for( int y = (int) iHeight-1; y >= 0; --y ) { uint8_t *pRow = img->pixels + img->pitch*y; - CString buf; + RString buf; f.Read( buf, iFilePitch ); @@ -188,7 +188,7 @@ static RageSurfaceUtils::OpenResult LoadBMP( RageFile &f, RageSurface *&img, CSt return sError.size() != 0? RageSurfaceUtils::OPEN_FATAL_ERROR: RageSurfaceUtils::OPEN_OK; } -RageSurfaceUtils::OpenResult RageSurface_Load_BMP( const CString &sPath, RageSurface *&img, bool bHeaderOnly, CString &error ) +RageSurfaceUtils::OpenResult RageSurface_Load_BMP( const RString &sPath, RageSurface *&img, bool bHeaderOnly, RString &error ) { RageFile f; diff --git a/stepmania/src/RageSurface_Load_BMP.h b/stepmania/src/RageSurface_Load_BMP.h index 1ff191bca6..b4857f3e9f 100644 --- a/stepmania/src/RageSurface_Load_BMP.h +++ b/stepmania/src/RageSurface_Load_BMP.h @@ -4,7 +4,7 @@ #define RAGE_SURFACE_LOAD_BMP_H #include "RageSurface_Load.h" -RageSurfaceUtils::OpenResult RageSurface_Load_BMP( const CString &sPath, RageSurface *&ret, bool bHeaderOnly, CString &error ); +RageSurfaceUtils::OpenResult RageSurface_Load_BMP( const RString &sPath, RageSurface *&ret, bool bHeaderOnly, RString &error ); #endif diff --git a/stepmania/src/RageSurface_Load_GIF.cpp b/stepmania/src/RageSurface_Load_GIF.cpp index 41fed613a4..a75d28bedf 100644 --- a/stepmania/src/RageSurface_Load_GIF.cpp +++ b/stepmania/src/RageSurface_Load_GIF.cpp @@ -58,7 +58,7 @@ static int GetDataBlock( RageFile &f, unsigned char *buf ) } -RageSurfaceUtils::OpenResult RageSurface_Load_GIF( const CString &sPath, RageSurface *&ret, bool bHeaderOnly, CString &error ) +RageSurfaceUtils::OpenResult RageSurface_Load_GIF( const RString &sPath, RageSurface *&ret, bool bHeaderOnly, RString &error ) { unsigned char buf[256]; int imageCount = 0; diff --git a/stepmania/src/RageSurface_Load_GIF.h b/stepmania/src/RageSurface_Load_GIF.h index b8bed4d6f6..8b39d483bd 100644 --- a/stepmania/src/RageSurface_Load_GIF.h +++ b/stepmania/src/RageSurface_Load_GIF.h @@ -2,7 +2,7 @@ #define RAGE_SURFACE_LOAD_GIF_H #include "RageSurface_Load.h" -RageSurfaceUtils::OpenResult RageSurface_Load_GIF( const CString &sPath, RageSurface *&ret, bool bHeaderOnly, CString &error ); +RageSurfaceUtils::OpenResult RageSurface_Load_GIF( const RString &sPath, RageSurface *&ret, bool bHeaderOnly, RString &error ); #endif diff --git a/stepmania/src/RageSurface_Load_JPEG.cpp b/stepmania/src/RageSurface_Load_JPEG.cpp index df9016383e..353921e740 100644 --- a/stepmania/src/RageSurface_Load_JPEG.cpp +++ b/stepmania/src/RageSurface_Load_JPEG.cpp @@ -207,7 +207,7 @@ static RageSurface *RageSurface_Load_JPEG( RageFile *f, const char *fn, char err } -RageSurfaceUtils::OpenResult RageSurface_Load_JPEG( const CString &sPath, RageSurface *&ret, bool bHeaderOnly, CString &error ) +RageSurfaceUtils::OpenResult RageSurface_Load_JPEG( const RString &sPath, RageSurface *&ret, bool bHeaderOnly, RString &error ) { RageFile f; if( !f.Open( sPath ) ) diff --git a/stepmania/src/RageSurface_Load_JPEG.h b/stepmania/src/RageSurface_Load_JPEG.h index 8c88d7298a..00b131c5e4 100644 --- a/stepmania/src/RageSurface_Load_JPEG.h +++ b/stepmania/src/RageSurface_Load_JPEG.h @@ -2,7 +2,7 @@ #define RAGE_SURFACE_LOAD_JPEG_H #include "RageSurface_Load.h" -RageSurfaceUtils::OpenResult RageSurface_Load_JPEG( const CString &sPath, RageSurface *&ret, bool bHeaderOnly, CString &error ); +RageSurfaceUtils::OpenResult RageSurface_Load_JPEG( const RString &sPath, RageSurface *&ret, bool bHeaderOnly, RString &error ); #endif diff --git a/stepmania/src/RageSurface_Load_PNG.cpp b/stepmania/src/RageSurface_Load_PNG.cpp index cbcdaa34d2..eabc93d957 100644 --- a/stepmania/src/RageSurface_Load_PNG.cpp +++ b/stepmania/src/RageSurface_Load_PNG.cpp @@ -288,7 +288,7 @@ static RageSurface *RageSurface_Load_PNG( RageFile *f, const char *fn, char erro }; -RageSurfaceUtils::OpenResult RageSurface_Load_PNG( const CString &sPath, RageSurface *&ret, bool bHeaderOnly, CString &error ) +RageSurfaceUtils::OpenResult RageSurface_Load_PNG( const RString &sPath, RageSurface *&ret, bool bHeaderOnly, RString &error ) { RageFile f; if( !f.Open( sPath ) ) diff --git a/stepmania/src/RageSurface_Load_PNG.h b/stepmania/src/RageSurface_Load_PNG.h index bf4f340bf4..3c4188bbc8 100644 --- a/stepmania/src/RageSurface_Load_PNG.h +++ b/stepmania/src/RageSurface_Load_PNG.h @@ -2,7 +2,7 @@ #define RAGE_SURFACE_LOAD_PNG_H #include "RageSurface_Load.h" -RageSurfaceUtils::OpenResult RageSurface_Load_PNG( const CString &sPath, RageSurface *&ret, bool bHeaderOnly, CString &error ); +RageSurfaceUtils::OpenResult RageSurface_Load_PNG( const RString &sPath, RageSurface *&ret, bool bHeaderOnly, RString &error ); #endif diff --git a/stepmania/src/RageSurface_Load_XPM.cpp b/stepmania/src/RageSurface_Load_XPM.cpp index a562fad449..432db598f7 100644 --- a/stepmania/src/RageSurface_Load_XPM.cpp +++ b/stepmania/src/RageSurface_Load_XPM.cpp @@ -14,7 +14,7 @@ return NULL; \ } -RageSurface *RageSurface_Load_XPM( char * const *xpm, CString &error ) +RageSurface *RageSurface_Load_XPM( char * const *xpm, RString &error ) { int line = 0; @@ -35,24 +35,24 @@ RageSurface *RageSurface_Load_XPM( char * const *xpm, CString &error ) vector colors; - map name_to_color; + map name_to_color; for( int i = 0; i < num_colors; ++i ) { CheckLine(); /* "id c #AABBCC"; id is color_length long. id may contain spaces. */ - CString color = xpm[line++]; + RString color = xpm[line++]; if( color_length+4 > (int) color.size() ) continue; - CString name; + RString name; name = color.substr( 0, color_length ); if( color.substr( color_length, 4 ) != " c #") continue; - CString clr = color.substr( color_length+4 ); + RString clr = color.substr( color_length+4 ); int r, g, b; if( sscanf( clr, "%2x%2x%2x", &r, &g, &b ) != 3 ) continue; @@ -80,7 +80,7 @@ RageSurface *RageSurface_Load_XPM( char * const *xpm, CString &error ) for( int y = 0; y < height; ++y ) { CheckLine(); - const CString row = xpm[line++]; + const RString row = xpm[line++]; if( (int) row.size() != width*color_length ) { error = ssprintf( "row %i is not expected length (%i != %i)", y, int(row.size()), width*color_length ); @@ -93,8 +93,8 @@ RageSurface *RageSurface_Load_XPM( char * const *xpm, CString &error ) int32_t *p32 = (int32_t *) p; for( int x = 0; x < width; ++x ) { - CString color_name = row.substr( x*color_length, color_length ); - map::const_iterator it; + RString color_name = row.substr( x*color_length, color_length ); + map::const_iterator it; it = name_to_color.find( color_name ); if( it == name_to_color.end() ) { diff --git a/stepmania/src/RageSurface_Load_XPM.h b/stepmania/src/RageSurface_Load_XPM.h index 5cd7a32192..7e55864c52 100644 --- a/stepmania/src/RageSurface_Load_XPM.h +++ b/stepmania/src/RageSurface_Load_XPM.h @@ -2,7 +2,7 @@ #define RAGE_SURFACE_LOAD_XPM_H struct RageSurface; -RageSurface *RageSurface_Load_XPM( char * const *xpm, CString &error ); +RageSurface *RageSurface_Load_XPM( char * const *xpm, RString &error ); #endif diff --git a/stepmania/src/RageSurface_Save_BMP.cpp b/stepmania/src/RageSurface_Save_BMP.cpp index 2f70c0860b..e8eb45807a 100644 --- a/stepmania/src/RageSurface_Save_BMP.cpp +++ b/stepmania/src/RageSurface_Save_BMP.cpp @@ -5,7 +5,7 @@ #include "RageUtil.h" #include "RageFile.h" -static void WriteBytes( RageFile &f, CString &sError, const void *buf, int size ) +static void WriteBytes( RageFile &f, RString &sError, const void *buf, int size ) { if( sError.size() != 0 ) return; @@ -15,13 +15,13 @@ static void WriteBytes( RageFile &f, CString &sError, const void *buf, int size sError = f.GetError(); } -static void write_le16( RageFile &f, CString &sError, uint16_t val ) +static void write_le16( RageFile &f, RString &sError, uint16_t val ) { val = Swap16LE( val ); WriteBytes( f, sError, &val, sizeof(uint16_t) ); } -static void write_le32( RageFile &f, CString &sError, uint32_t val ) +static void write_le32( RageFile &f, RString &sError, uint32_t val ) { val = Swap32LE( val ); WriteBytes( f, sError, &val, sizeof(uint32_t) ); @@ -35,7 +35,7 @@ bool RageSurfaceUtils::SaveBMP( RageSurface *surface, RageFile &f ) Swap24LE( 0xFF0000 ), Swap24LE( 0x00FF00 ), Swap24LE( 0x0000FF ), 0 ); RageSurfaceUtils::CopySurface( surface, converted_surface ); - CString sError; + RString sError; int iFilePitch = converted_surface->pitch; iFilePitch = (iFilePitch+3) & ~3; // round up a multiple of 4 diff --git a/stepmania/src/RageTexture.cpp b/stepmania/src/RageTexture.cpp index 797a725462..2d0fb22a6b 100644 --- a/stepmania/src/RageTexture.cpp +++ b/stepmania/src/RageTexture.cpp @@ -49,10 +49,10 @@ void RageTexture::CreateFrameRects() } } -void RageTexture::GetFrameDimensionsFromFileName( CString sPath, int* piFramesWide, int* piFramesHigh ) +void RageTexture::GetFrameDimensionsFromFileName( RString sPath, int* piFramesWide, int* piFramesHigh ) { static Regex match( " ([0-9]+)x([0-9]+)([\\. ]|$)" ); - vector asMatch; + vector asMatch; if( !match.Compare(sPath, asMatch) ) { *piFramesWide = *piFramesHigh = 1; diff --git a/stepmania/src/RageTexture.h b/stepmania/src/RageTexture.h index bef3b8682b..7c2623f283 100644 --- a/stepmania/src/RageTexture.h +++ b/stepmania/src/RageTexture.h @@ -57,7 +57,7 @@ public: /* The ID that we were asked to load: */ const RageTextureID &GetID() const { return m_ID; } - static void GetFrameDimensionsFromFileName( CString sPath, int* puFramesWide, int* puFramesHigh ); + static void GetFrameDimensionsFromFileName( RString sPath, int* puFramesWide, int* puFramesHigh ); private: /* We might change settings when loading (due to hints, hardware diff --git a/stepmania/src/RageTextureID.cpp b/stepmania/src/RageTextureID.cpp index 8bd7e18e59..32a20f8881 100644 --- a/stepmania/src/RageTextureID.cpp +++ b/stepmania/src/RageTextureID.cpp @@ -52,7 +52,7 @@ bool RageTextureID::operator==(const RageTextureID &rhs) const // EQUAL(Policy); // don't do this } -void RageTextureID::SetFilename( const CString &fn ) +void RageTextureID::SetFilename( const RString &fn ) { filename = fn; CollapsePath( filename ); diff --git a/stepmania/src/RageTextureID.h b/stepmania/src/RageTextureID.h index 22c901e438..a5aacf08e1 100644 --- a/stepmania/src/RageTextureID.h +++ b/stepmania/src/RageTextureID.h @@ -9,7 +9,7 @@ * of these. */ struct RageTextureID { - CString filename; + RString filename; /* Maximum size of the texture, per dimension. */ int iMaxSize; @@ -46,7 +46,7 @@ struct RageTextureID bool bHotPinkColorKey; /* #FF00FF */ /* These hints will be used in addition to any in the filename. */ - CString AdditionalTextureHints; + RString AdditionalTextureHints; bool operator< (const RageTextureID &rhs) const; bool operator== (const RageTextureID &rhs) const; @@ -60,8 +60,8 @@ struct RageTextureID void Init(); RageTextureID() { Init(); } - RageTextureID( const CString &fn ) { Init(); SetFilename(fn); } - void SetFilename( const CString &fn ); + RageTextureID( const RString &fn ) { Init(); SetFilename(fn); } + void SetFilename( const RString &fn ); }; #endif diff --git a/stepmania/src/RageTextureManager.cpp b/stepmania/src/RageTextureManager.cpp index 295cb66bad..5df42ee0e6 100644 --- a/stepmania/src/RageTextureManager.cpp +++ b/stepmania/src/RageTextureManager.cpp @@ -111,7 +111,7 @@ RageTexture* RageTextureManager::LoadTextureInternal( RageTextureID ID ) } // The texture is not already loaded. Load it. - CString sExt = GetExtension( ID.filename ); + RString sExt = GetExtension( ID.filename ); sExt.MakeLower(); RageTexture* pTexture; @@ -205,7 +205,7 @@ void RageTextureManager::GarbageCollect( GCType type ) std::map::iterator j = i; i++; - CString sPath = j->first.filename; + RString sPath = j->first.filename; RageTexture* t = j->second; if( t->m_iRefCount ) @@ -295,8 +295,8 @@ void RageTextureManager::DiagnosticOutput() const const RageTextureID &ID = i->first; const RageTexture *pTex = i->second; - CString sDiags = DISPLAY->GetTextureDiagnostics( pTex->GetTexHandle() ); - CString sStr = ssprintf( "%3ix%3i (%2i)", pTex->GetTextureHeight(), pTex->GetTextureWidth(), + RString sDiags = DISPLAY->GetTextureDiagnostics( pTex->GetTexHandle() ); + RString sStr = ssprintf( "%3ix%3i (%2i)", pTex->GetTextureHeight(), pTex->GetTextureWidth(), pTex->m_iRefCount ); if( sDiags != "" ) diff --git a/stepmania/src/RageTypes.h b/stepmania/src/RageTypes.h index 2ccc13610b..e99cf31517 100644 --- a/stepmania/src/RageTypes.h +++ b/stepmania/src/RageTypes.h @@ -128,7 +128,7 @@ public: bool operator == ( const RageColor& other ) const { return r==other.r && g==other.g && b==other.b && a==other.a; } bool operator != ( const RageColor& other ) const { return !operator==(other); } - bool FromString( const CString &str ) + bool FromString( const RString &str ) { int result = sscanf( str, "%f,%f,%f,%f", &r, &g, &b, &a ); if( result == 3 ) diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index 7d4ca68a1e..841f3b22e4 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -708,7 +708,7 @@ RString GetFileNameWithoutExtension( const RString &sPath ) return sFName; } -void MakeValidFilename( CString &sName ) +void MakeValidFilename( RString &sName ) { wstring wsName = RStringToWstring( sName ); wstring wsInvalid = L"/\\:*?\"<>|"; diff --git a/stepmania/src/RageUtil.h b/stepmania/src/RageUtil.h index b2c3024ec0..319400c29f 100644 --- a/stepmania/src/RageUtil.h +++ b/stepmania/src/RageUtil.h @@ -262,7 +262,7 @@ void splitpath( const RString &Path, RString &Dir, RString &Filename, RString &E RString SetExtension( const RString &path, const RString &ext ); RString GetExtension( const RString &sPath ); RString GetFileNameWithoutExtension( const RString &sPath ); -void MakeValidFilename( CString &sName ); +void MakeValidFilename( RString &sName ); typedef int longchar; extern const wchar_t INVALID_CHAR; diff --git a/stepmania/src/RageUtil_BackgroundLoader.cpp b/stepmania/src/RageUtil_BackgroundLoader.cpp index 6d2a82c7da..51cccb9ef2 100644 --- a/stepmania/src/RageUtil_BackgroundLoader.cpp +++ b/stepmania/src/RageUtil_BackgroundLoader.cpp @@ -31,9 +31,9 @@ BackgroundLoader::BackgroundLoader(): m_LoadThread.Create( LoadThread_Start, this ); } -static void DeleteEmptyDirectories( CString sDir ) +static void DeleteEmptyDirectories( RString sDir ) { - vector asNewDirs; + vector asNewDirs; GetDirListing( sDir + "/*", asNewDirs, false, true ); for( unsigned i = 0; i < asNewDirs.size(); ++i ) { @@ -56,7 +56,7 @@ BackgroundLoader::~BackgroundLoader() m_LoadThread.Wait(); /* Delete all leftover cached files. */ - map::iterator it; + map::iterator it; for( it = m_FinishedRequests.begin(); it != m_FinishedRequests.end(); ++it ) FILEMAN->Remove( GetCachePath( it->first ) ); @@ -66,22 +66,22 @@ BackgroundLoader::~BackgroundLoader() } /* Pull a request out of m_CacheRequests. */ -CString BackgroundLoader::GetRequest() +RString BackgroundLoader::GetRequest() { if( !g_bEnableBackgroundLoading ) - return CString(); + return RString(); LockMut( m_Mutex ); if( !m_CacheRequests.size() ) - return CString(); + return RString(); - CString ret; + RString ret; ret = m_CacheRequests.front(); m_CacheRequests.erase( m_CacheRequests.begin(), m_CacheRequests.begin()+1 ); return ret; } -CString BackgroundLoader::GetCachePath( CString sPath ) const +RString BackgroundLoader::GetCachePath( RString sPath ) const { return m_sCachePathPrefix + sPath; } @@ -94,14 +94,14 @@ void BackgroundLoader::LoadThread() * fail on timeout. */ m_StartSem.Wait( false ); - CString sFile = GetRequest(); + RString sFile = GetRequest(); if( sFile.empty() ) continue; { /* If the file already exists, short circuit. */ LockMut( m_Mutex ); - map::iterator it; + map::iterator it; it = m_FinishedRequests.find( sFile ); if( it != m_FinishedRequests.end() ) { @@ -115,7 +115,7 @@ void BackgroundLoader::LoadThread() LOG->Trace("XXX: reading %s", sFile.c_str()); - CString sCachePath = GetCachePath( sFile ); + RString sCachePath = GetCachePath( sFile ); /* Open the file and read it. */ RageFile src; @@ -161,7 +161,7 @@ void BackgroundLoader::LoadThread() } } -void BackgroundLoader::CacheFile( const CString &sFile ) +void BackgroundLoader::CacheFile( const RString &sFile ) { if( !g_bEnableBackgroundLoading ) return; @@ -174,7 +174,7 @@ void BackgroundLoader::CacheFile( const CString &sFile ) m_StartSem.Post(); } -bool BackgroundLoader::IsCacheFileFinished( const CString &sFile, CString &sActualPath ) +bool BackgroundLoader::IsCacheFileFinished( const RString &sFile, RString &sActualPath ) { if( !g_bEnableBackgroundLoading ) { @@ -190,7 +190,7 @@ bool BackgroundLoader::IsCacheFileFinished( const CString &sFile, CString &sActu return true; } - map::iterator it; + map::iterator it; it = m_FinishedRequests.find( sFile ); if( it == m_FinishedRequests.end() ) return false; @@ -204,7 +204,7 @@ bool BackgroundLoader::IsCacheFileFinished( const CString &sFile, CString &sActu return true; } -void BackgroundLoader::FinishedWithCachedFile( CString sFile ) +void BackgroundLoader::FinishedWithCachedFile( RString sFile ) { if( !g_bEnableBackgroundLoading ) return; @@ -212,7 +212,7 @@ void BackgroundLoader::FinishedWithCachedFile( CString sFile ) if( sFile == "" ) return; - map::iterator it; + map::iterator it; it = m_FinishedRequests.find( sFile ); ASSERT_M( it != m_FinishedRequests.end(), sFile ); diff --git a/stepmania/src/RageUtil_BackgroundLoader.h b/stepmania/src/RageUtil_BackgroundLoader.h index 1a5932fbd6..36b0a142f5 100644 --- a/stepmania/src/RageUtil_BackgroundLoader.h +++ b/stepmania/src/RageUtil_BackgroundLoader.h @@ -18,14 +18,14 @@ public: ~BackgroundLoader(); /* Read the file in a background thread. Files will be read in the order requested. */ - void CacheFile( const CString &file ); + void CacheFile( const RString &file ); /* Return true if the requested CacheFile request has finished. If true is returned, * the cached file can be read using the path returned in sActualPath. */ - bool IsCacheFileFinished( const CString &sFile, CString &sActualPath ); + bool IsCacheFileFinished( const RString &sFile, RString &sActualPath ); /* Call this when finished with a cached file, to release any resources. */ - void FinishedWithCachedFile( CString sFile ); + void FinishedWithCachedFile( RString sFile ); /* Abort all loads. */ void Abort(); @@ -36,10 +36,10 @@ private: void LoadThread(); static int LoadThread_Start( void *p ) { ((BackgroundLoader *) p)->LoadThread(); return 0; } - CString GetRequest(); + RString GetRequest(); - CString GetCachePath( CString sPath ) const; - CString m_sCachePathPrefix; + RString GetCachePath( RString sPath ) const; + RString m_sCachePathPrefix; RageSemaphore m_StartSem; @@ -47,10 +47,10 @@ private: * while doing expensive operations, like reading files. */ RageMutex m_Mutex; - vector m_CacheRequests; + vector m_CacheRequests; /* Filename to number of completed requests */ - map m_FinishedRequests; + map m_FinishedRequests; bool m_sThreadIsActive; bool m_sThreadShouldAbort; diff --git a/stepmania/src/RageUtil_CharConversions.cpp b/stepmania/src/RageUtil_CharConversions.cpp index c97a4262de..e43bbe41bd 100644 --- a/stepmania/src/RageUtil_CharConversions.cpp +++ b/stepmania/src/RageUtil_CharConversions.cpp @@ -9,7 +9,7 @@ #include "windows.h" /* Convert from the given codepage to UTF-8. Return true if successful. */ -static bool CodePageConvert(CString &txt, int cp) +static bool CodePageConvert(RString &txt, int cp) { if( txt.size() == 0 ) return true; @@ -31,15 +31,15 @@ static bool CodePageConvert(CString &txt, int cp) return true; } -static bool AttemptEnglishConversion( CString &txt ) { return CodePageConvert( txt, 1252 ); } -static bool AttemptKoreanConversion( CString &txt ) { return CodePageConvert( txt, 949 ); } -static bool AttemptJapaneseConversion( CString &txt ) { return CodePageConvert( txt, 932 ); } +static bool AttemptEnglishConversion( RString &txt ) { return CodePageConvert( txt, 1252 ); } +static bool AttemptKoreanConversion( RString &txt ) { return CodePageConvert( txt, 949 ); } +static bool AttemptJapaneseConversion( RString &txt ) { return CodePageConvert( txt, 932 ); } #elif defined(HAVE_ICONV) #include #include -static bool ConvertFromCharset( CString &txt, const char *charset ) +static bool ConvertFromCharset( RString &txt, const char *charset ) { if ( txt.size() == 0 ) return true; @@ -56,7 +56,7 @@ static bool ConvertFromCharset( CString &txt, const char *charset ) size_t inleft = txt.size(); /* Create a new string with enough room for the new conversion */ - CString buf; + RString buf; buf.resize( txt.size() * 5 ); char *txtout = const_cast( buf.data() ); @@ -86,22 +86,22 @@ static bool ConvertFromCharset( CString &txt, const char *charset ) return true; } -static bool AttemptEnglishConversion( CString &txt ) { return ConvertFromCharset( txt, "CP1252" ); } -static bool AttemptKoreanConversion( CString &txt ) { return ConvertFromCharset( txt, "CP949" ); } -static bool AttemptJapaneseConversion( CString &txt ) { return ConvertFromCharset( txt, "CP932" ); } +static bool AttemptEnglishConversion( RString &txt ) { return ConvertFromCharset( txt, "CP1252" ); } +static bool AttemptKoreanConversion( RString &txt ) { return ConvertFromCharset( txt, "CP949" ); } +static bool AttemptJapaneseConversion( RString &txt ) { return ConvertFromCharset( txt, "CP932" ); } #else /* No converters are available, so all fail--we only accept UTF-8. */ -static bool AttemptEnglishConversion( CString &txt ) { return false; } -static bool AttemptKoreanConversion( CString &txt ) { return false; } -static bool AttemptJapaneseConversion( CString &txt ) { return false; } +static bool AttemptEnglishConversion( RString &txt ) { return false; } +static bool AttemptKoreanConversion( RString &txt ) { return false; } +static bool AttemptJapaneseConversion( RString &txt ) { return false; } #endif -bool ConvertString(CString &str, const CString &encodings) +bool ConvertString(RString &str, const RString &encodings) { - vector lst; + vector lst; split(encodings, ",", lst); for(unsigned i = 0; i < lst.size(); ++i) diff --git a/stepmania/src/RageUtil_CharConversions.h b/stepmania/src/RageUtil_CharConversions.h index 5216f7cb0f..57c34c0a34 100644 --- a/stepmania/src/RageUtil_CharConversions.h +++ b/stepmania/src/RageUtil_CharConversions.h @@ -7,6 +7,6 @@ * separated list of encodings. The only valid strings are "japanese" and "korean". * Return true if the conversion was successful (or a no-op). Return false and * leave the string unchanged if the conversion was unsuccessful. */ -bool ConvertString(CString &str, const CString &encodings); +bool ConvertString(RString &str, const RString &encodings); #endif diff --git a/stepmania/src/RageUtil_WorkerThread.cpp b/stepmania/src/RageUtil_WorkerThread.cpp index 3c78dda84e..f28888ee66 100644 --- a/stepmania/src/RageUtil_WorkerThread.cpp +++ b/stepmania/src/RageUtil_WorkerThread.cpp @@ -3,7 +3,7 @@ #include "RageUtil.h" #include "RageLog.h" -RageWorkerThread::RageWorkerThread( const CString &sName ): +RageWorkerThread::RageWorkerThread( const RString &sName ): m_WorkerEvent( "\"" + sName + "\" worker event" ), m_HeartbeatEvent( "\"" + sName + "\" heartbeat event" ) { diff --git a/stepmania/src/RageUtil_WorkerThread.h b/stepmania/src/RageUtil_WorkerThread.h index aaac344585..faef9dc7c8 100644 --- a/stepmania/src/RageUtil_WorkerThread.h +++ b/stepmania/src/RageUtil_WorkerThread.h @@ -9,7 +9,7 @@ class RageWorkerThread { public: - RageWorkerThread( const CString &sName ); + RageWorkerThread( const RString &sName ); virtual ~RageWorkerThread(); /* Call SetTimeout(10) to start a timeout period of 10 seconds. This is not a @@ -55,7 +55,7 @@ private: enum { REQ_SHUTDOWN = -1, REQ_NONE = -2 }; RageThread m_WorkerThread; RageEvent m_WorkerEvent; - CString m_sName; + RString m_sName; int m_iRequest; bool m_bRequestFinished; bool m_bTimedOut; diff --git a/stepmania/src/RandomSample.cpp b/stepmania/src/RandomSample.cpp index 7c3baca2b2..110e6e7766 100644 --- a/stepmania/src/RandomSample.cpp +++ b/stepmania/src/RandomSample.cpp @@ -17,7 +17,7 @@ RandomSample::~RandomSample() UnloadAll(); } -bool RandomSample::Load( CString sFilePath, int iMaxToLoad ) +bool RandomSample::Load( RString sFilePath, int iMaxToLoad ) { if( GetExtension(sFilePath) == "" ) return LoadSoundDir( sFilePath, iMaxToLoad ); @@ -32,7 +32,7 @@ void RandomSample::UnloadAll() m_pSamples.clear(); } -bool RandomSample::LoadSoundDir( CString sDir, int iMaxToLoad ) +bool RandomSample::LoadSoundDir( RString sDir, int iMaxToLoad ) { if( sDir == "" ) return true; @@ -51,7 +51,7 @@ bool RandomSample::LoadSoundDir( CString sDir, int iMaxToLoad ) sDir += "/"; #endif - vector arraySoundFiles; + vector arraySoundFiles; GetDirListing( sDir + "*.mp3", arraySoundFiles ); GetDirListing( sDir + "*.ogg", arraySoundFiles ); GetDirListing( sDir + "*.wav", arraySoundFiles ); @@ -65,7 +65,7 @@ bool RandomSample::LoadSoundDir( CString sDir, int iMaxToLoad ) return true; } -bool RandomSample::LoadSound( CString sSoundFilePath ) +bool RandomSample::LoadSound( RString sSoundFilePath ) { LOG->Trace( "RandomSample::LoadSound( %s )", sSoundFilePath.c_str() ); diff --git a/stepmania/src/RandomSample.h b/stepmania/src/RandomSample.h index dc362ec62c..6d1b26461f 100644 --- a/stepmania/src/RandomSample.h +++ b/stepmania/src/RandomSample.h @@ -11,15 +11,15 @@ public: RandomSample(); virtual ~RandomSample(); - bool Load( CString sFilePath, int iMaxToLoad = 1000 /*load all*/ ); + bool Load( RString sFilePath, int iMaxToLoad = 1000 /*load all*/ ); void UnloadAll(); void PlayRandom(); void PlayCopyOfRandom(); void Stop(); private: - bool LoadSoundDir( CString sDir, int iMaxToLoad ); - bool LoadSound( CString sSoundFilePath ); + bool LoadSoundDir( RString sDir, int iMaxToLoad ); + bool LoadSound( RString sSoundFilePath ); int GetNextToPlay(); vector m_pSamples; diff --git a/stepmania/src/ReceptorArrow.cpp b/stepmania/src/ReceptorArrow.cpp index e6a7b6ab1e..2c55171a04 100644 --- a/stepmania/src/ReceptorArrow.cpp +++ b/stepmania/src/ReceptorArrow.cpp @@ -19,7 +19,7 @@ void ReceptorArrow::Load( const PlayerState* pPlayerState, int iColNo ) m_pPlayerState = pPlayerState; m_iColNo = iColNo; - CString sButton = GAMESTATE->GetCurrentGame()->ColToButtonName( iColNo ); + RString sButton = GAMESTATE->GetCurrentGame()->ColToButtonName( iColNo ); m_pReceptor.Load( NOTESKIN->GetPath(sButton,"receptor") ); this->AddChild( m_pReceptor ); @@ -57,7 +57,7 @@ void ReceptorArrow::Step( TapNoteScore score ) { m_bIsPressed = true; - CString sJudge = TapNoteScoreToString( score ); + RString sJudge = TapNoteScoreToString( score ); m_pReceptor->PlayCommand( Capitalize(sJudge) ); m_pReceptor->PlayCommand( "Press" ); diff --git a/stepmania/src/RollingNumbers.cpp b/stepmania/src/RollingNumbers.cpp index 5149fec358..eff113be36 100644 --- a/stepmania/src/RollingNumbers.cpp +++ b/stepmania/src/RollingNumbers.cpp @@ -16,14 +16,14 @@ RollingNumbers::RollingNumbers() m_fScoreVelocity = 0; } -void RollingNumbers::LoadFromNode( const CString& sDir, const XNode* pNode ) +void RollingNumbers::LoadFromNode( const RString& sDir, const XNode* pNode ) { BitmapText::LoadFromNode( sDir, pNode ); pNode->GetAttrValue( "Format", m_sFormat ); pNode->GetAttrValue( "ApproachSeconds", m_fApproachSeconds ); - CString sTargetNumber; + RString sTargetNumber; if( pNode->GetAttrValue( "TargetNumber", sTargetNumber ) ) { float fTargetNumber = LuaHelpers::RunExpressionF(sTargetNumber); diff --git a/stepmania/src/RollingNumbers.h b/stepmania/src/RollingNumbers.h index fc493f5eb3..4b3c5799a7 100644 --- a/stepmania/src/RollingNumbers.h +++ b/stepmania/src/RollingNumbers.h @@ -10,7 +10,7 @@ class RollingNumbers : public BitmapText public: RollingNumbers(); - void LoadFromNode( const CString& sDir, const XNode* pNode ); + void LoadFromNode( const RString& sDir, const XNode* pNode ); virtual Actor *Copy() const; virtual void Update( float fDeltaTime ); @@ -30,7 +30,7 @@ private: // Time between the call to SetTargetNumber and m_fCurrentNumber == // m_fTargetNumber. Used to calculate m_fScoreVelocity. float m_fApproachSeconds; - CString m_sFormat; + RString m_sFormat; // // Calculated diff --git a/stepmania/src/RoomWheel.cpp b/stepmania/src/RoomWheel.cpp index e8a8b3120e..d3da3b27a3 100644 --- a/stepmania/src/RoomWheel.cpp +++ b/stepmania/src/RoomWheel.cpp @@ -8,7 +8,7 @@ AutoScreenMessage( SM_BackFromRoomName ) -void RoomWheel::Load( CString sType ) +void RoomWheel::Load( RString sType ) { SetName( sType ); m_offset = 0; @@ -35,20 +35,20 @@ void RoomWheel::Load( CString sType ) RebuildWheelItems(); } -RoomWheelData::RoomWheelData( WheelItemType wit, CString sTitle, CString sDesc, RageColor color ): +RoomWheelData::RoomWheelData( WheelItemType wit, RString sTitle, RString sDesc, RageColor color ): WheelItemBaseData( wit, sTitle, color ) { m_sDesc = sDesc; } -RoomWheelItem::RoomWheelItem( CString sType ): +RoomWheelItem::RoomWheelItem( RString sType ): WheelItemBase(sType) { SetName( sType ); Load( sType ); } -void RoomWheelItem::Load(CString sType) +void RoomWheelItem::Load(RString sType) { DESC_X .Load(sType,"DescX"); DESC_Y .Load(sType,"DescY"); @@ -163,7 +163,7 @@ void RoomInfoDisplay::RetractInfoBox() m_state = LOCKED; } -void RoomInfoDisplay::Load( CString sType ) +void RoomInfoDisplay::Load( RString sType ) { SetName(sType); DEPLOY_DELAY.Load(sType, "DeployDelay"); @@ -253,7 +253,7 @@ void RoomInfoDisplay::Update( float fDeltaTime ) ActorFrame::Update(fDeltaTime); } -void RoomInfoDisplay::RequestRoomInfo(const CString& name) +void RoomInfoDisplay::RequestRoomInfo(const RString& name) { NSMAN->m_SMOnlinePacket.ClearPacket(); NSMAN->m_SMOnlinePacket.Write1((uint8_t)3); //Request Room Info diff --git a/stepmania/src/RoomWheel.h b/stepmania/src/RoomWheel.h index 6cb789736b..9594fb6c61 100644 --- a/stepmania/src/RoomWheel.h +++ b/stepmania/src/RoomWheel.h @@ -11,18 +11,18 @@ struct RoomWheelData : public WheelItemBaseData { RoomWheelData() { WheelItemBaseData::WheelItemBaseData(); } - RoomWheelData( WheelItemType wit, CString title, CString SubTitle, RageColor color ); + RoomWheelData( WheelItemType wit, RString title, RString SubTitle, RageColor color ); - CString m_sDesc; + RString m_sDesc; WheelNotifyIcon::Flags m_Flags; }; class RoomWheelItem : public WheelItemBase { public: - RoomWheelItem(CString sType = "RoomWheelItem"); + RoomWheelItem(RString sType = "RoomWheelItem"); RoomWheelData* data; - void Load( CString sType ); + void Load( RString sType ); virtual void LoadFromWheelItemBaseData(WheelItemBaseData* pWID); BitmapText m_Desc; @@ -36,26 +36,26 @@ private: struct RoomInfo { - CString songTitle; - CString songSubTitle; - CString songArtist; + RString songTitle; + RString songSubTitle; + RString songArtist; int numPlayers; int maxPlayers; - vector players; + vector players; }; class RoomInfoDisplay : public ActorFrame { public: ~RoomInfoDisplay(); - virtual void Load( CString sType ); + virtual void Load( RString sType ); virtual void Update( float fDeltaTime ); void SetRoom( const RoomWheelData* roomData ); void SetRoomInfo( const RoomInfo& info); void DeployInfoBox(); void RetractInfoBox(); private: - void RequestRoomInfo(const CString& name); + void RequestRoomInfo(const RString& name); enum RoomInfoDisplayState { OPEN = 0, @@ -90,7 +90,7 @@ private: class RoomWheel : public WheelBase { public: - virtual void Load( CString sType ); + virtual void Load( RString sType ); virtual void BuildWheelItemsData( vector &arrayWheelItemDatas ); virtual unsigned int GetNumItems() const; virtual void RemoveItem( int index ); diff --git a/stepmania/src/SDL_utils.cpp b/stepmania/src/SDL_utils.cpp index f0b8f5cbdb..b7bda9b126 100644 --- a/stepmania/src/SDL_utils.cpp +++ b/stepmania/src/SDL_utils.cpp @@ -81,16 +81,16 @@ uint8_t mySDL_EventState( uint8_t type, int state ) /* SDL sometimes fails to set an error, in which case we get the null string. We * sometimes use that as a sentinel return value. This function returns "(none)" * if no error is set. */ -CString mySDL_GetError() +RString mySDL_GetError() { - CString error = SDL_GetError(); + RString error = SDL_GetError(); if( error == "" ) return "(none)"; /* SDL sometimes fails to set an error */ return error; } -void mySDL_WM_SetIcon( CString sIconFile ) +void mySDL_WM_SetIcon( RString sIconFile ) { #if !defined(MACOSX) if( sIconFile.empty() ) @@ -99,7 +99,7 @@ void mySDL_WM_SetIcon( CString sIconFile ) return; } - CString error; + RString error; RageSurface *srf = RageSurfaceUtils::LoadFile( sIconFile, error ); if( srf == NULL ) return; diff --git a/stepmania/src/SDL_utils.h b/stepmania/src/SDL_utils.h index 4d6fc95174..9722b7d744 100644 --- a/stepmania/src/SDL_utils.h +++ b/stepmania/src/SDL_utils.h @@ -21,9 +21,9 @@ uint8_t mySDL_EventState(uint8_t type, int state); void mySDL_GetAllEvents(vector &events); void mySDL_PushEvents(vector &events); -CString mySDL_GetError(); +RString mySDL_GetError(); -void mySDL_WM_SetIcon( CString sIconFile ); +void mySDL_WM_SetIcon( RString sIconFile ); SDL_Surface *SDLSurfaceFromRageSurface( RageSurface *surf ); RageSurface *RageSurfaceFromSDLSurface( SDL_Surface *surf ); diff --git a/stepmania/src/ScoreDisplayAliveTime.cpp b/stepmania/src/ScoreDisplayAliveTime.cpp index 95d2b7ce84..2680cfcf87 100644 --- a/stepmania/src/ScoreDisplayAliveTime.cpp +++ b/stepmania/src/ScoreDisplayAliveTime.cpp @@ -20,12 +20,12 @@ ScoreDisplayAliveTime::~ScoreDisplayAliveTime() { } -void ScoreDisplayAliveTime::LoadFromNode( const CString& sDir, const XNode* pNode ) +void ScoreDisplayAliveTime::LoadFromNode( const RString& sDir, const XNode* pNode ) { BitmapText::LoadFromNode( sDir, pNode ); { - CString sPlayerNumber; + RString sPlayerNumber; bool b = pNode->GetAttrValue( "PlayerNumber", sPlayerNumber ); ASSERT( b ); m_PlayerNumber = (PlayerNumber) LuaHelpers::RunExpressionI(sPlayerNumber); @@ -39,7 +39,7 @@ void ScoreDisplayAliveTime::Update( float fDelta ) BitmapText::Update( fDelta ); } -void ScoreDisplayAliveTime::PlayCommand( const CString &sCommandName, Actor* pParent ) +void ScoreDisplayAliveTime::PlayCommand( const RString &sCommandName, Actor* pParent ) { // TODO: Add handling of GoalComplete message diff --git a/stepmania/src/ScoreDisplayAliveTime.h b/stepmania/src/ScoreDisplayAliveTime.h index 9daaea1aa9..190b907820 100644 --- a/stepmania/src/ScoreDisplayAliveTime.h +++ b/stepmania/src/ScoreDisplayAliveTime.h @@ -16,10 +16,10 @@ public: virtual void Update( float fDelta ); - void LoadFromNode( const CString& sDir, const XNode* pNode ); + void LoadFromNode( const RString& sDir, const XNode* pNode ); virtual Actor *Copy() const; - void PlayCommand( const CString &sCommandName, Actor* pParent ); + void PlayCommand( const RString &sCommandName, Actor* pParent ); void UpdateNumber(); diff --git a/stepmania/src/ScoreDisplayBattle.cpp b/stepmania/src/ScoreDisplayBattle.cpp index 13f254d71d..258c93934c 100644 --- a/stepmania/src/ScoreDisplayBattle.cpp +++ b/stepmania/src/ScoreDisplayBattle.cpp @@ -25,7 +25,7 @@ ScoreDisplayBattle::ScoreDisplayBattle() this->AddChild( &m_ItemIcon[i] ); } - vector asIconPaths; + vector asIconPaths; GetDirListing( THEME->GetCurThemeDir()+"Graphic/ScoreDisplayBattle icon*", asIconPaths ); for( unsigned j=0; jm_Inventory[s]; - CString sNewModifier = attack.sModifiers; + RString sNewModifier = attack.sModifiers; if( sNewModifier != m_iLastSeenInventory[s] ) { diff --git a/stepmania/src/ScoreDisplayBattle.h b/stepmania/src/ScoreDisplayBattle.h index e8cab67c7c..610de7d9e8 100644 --- a/stepmania/src/ScoreDisplayBattle.h +++ b/stepmania/src/ScoreDisplayBattle.h @@ -21,7 +21,7 @@ protected: Sprite m_sprFrame; Sprite m_ItemIcon[NUM_INVENTORY_SLOTS]; - CString m_iLastSeenInventory[NUM_INVENTORY_SLOTS]; + RString m_iLastSeenInventory[NUM_INVENTORY_SLOTS]; RageTexturePreloader m_TexturePreload; }; diff --git a/stepmania/src/ScoreDisplayCalories.cpp b/stepmania/src/ScoreDisplayCalories.cpp index a41aee46b3..7739ff404e 100644 --- a/stepmania/src/ScoreDisplayCalories.cpp +++ b/stepmania/src/ScoreDisplayCalories.cpp @@ -22,12 +22,12 @@ ScoreDisplayCalories::~ScoreDisplayCalories() MESSAGEMAN->Unsubscribe( this, m_sMessageOnStep ); } -void ScoreDisplayCalories::LoadFromNode( const CString& sDir, const XNode* pNode ) +void ScoreDisplayCalories::LoadFromNode( const RString& sDir, const XNode* pNode ) { RollingNumbers::LoadFromNode( sDir, pNode ); { - CString sPlayerNumber; + RString sPlayerNumber; bool b = pNode->GetAttrValue( "PlayerNumber", sPlayerNumber ); ASSERT( b ); m_PlayerNumber = (PlayerNumber) LuaHelpers::RunExpressionI(sPlayerNumber); @@ -48,7 +48,7 @@ void ScoreDisplayCalories::Update( float fDelta ) RollingNumbers::Update( fDelta ); } -void ScoreDisplayCalories::PlayCommand( const CString &sCommandName, Actor* pParent ) +void ScoreDisplayCalories::PlayCommand( const RString &sCommandName, Actor* pParent ) { if( sCommandName == m_sMessageOnStep ) { diff --git a/stepmania/src/ScoreDisplayCalories.h b/stepmania/src/ScoreDisplayCalories.h index 0c9111b270..36fd536fe5 100644 --- a/stepmania/src/ScoreDisplayCalories.h +++ b/stepmania/src/ScoreDisplayCalories.h @@ -15,10 +15,10 @@ public: virtual void Update( float fDelta ); - void LoadFromNode( const CString& sDir, const XNode* pNode ); + void LoadFromNode( const RString& sDir, const XNode* pNode ); virtual Actor *Copy() const; - void PlayCommand( const CString &sCommandName, Actor* pParent ); + void PlayCommand( const RString &sCommandName, Actor* pParent ); void UpdateNumber(); @@ -29,7 +29,7 @@ public: private: PlayerNumber m_PlayerNumber; - CString m_sMessageOnStep; + RString m_sMessageOnStep; }; #endif diff --git a/stepmania/src/ScoreDisplayLifeTime.cpp b/stepmania/src/ScoreDisplayLifeTime.cpp index 9b73a3f1ca..609d1f03ee 100644 --- a/stepmania/src/ScoreDisplayLifeTime.cpp +++ b/stepmania/src/ScoreDisplayLifeTime.cpp @@ -11,7 +11,7 @@ #include "ActorUtil.h" #include "Course.h" -static const CString GAIN_LIFE_COMMAND_NAME = "GainLife"; +static const RString GAIN_LIFE_COMMAND_NAME = "GainLife"; ScoreDisplayLifeTime::ScoreDisplayLifeTime() { @@ -22,7 +22,7 @@ void ScoreDisplayLifeTime::Init( const PlayerState* pPlayerState, const PlayerSt { ScoreDisplay::Init( pPlayerState, pPlayerStageStats ); - const CString sType = "ScoreDisplayLifeTime"; + const RString sType = "ScoreDisplayLifeTime"; // TODO: Remove use of PlayerNumber. PlayerNumber pn = pPlayerState->m_PlayerNumber; @@ -45,13 +45,13 @@ void ScoreDisplayLifeTime::Init( const PlayerState* pPlayerState, const PlayerSt FOREACH_TapNoteScore( tns ) { - const CString &sCommand = TapNoteScoreToString(tns); + const RString &sCommand = TapNoteScoreToString(tns); if( !m_textDeltaSeconds.HasCommand( sCommand ) ) ActorUtil::LoadCommand( m_textDeltaSeconds, sType, sCommand ); } FOREACH_HoldNoteScore( hns ) { - const CString &sCommand = HoldNoteScoreToString(hns); + const RString &sCommand = HoldNoteScoreToString(hns); if( !m_textDeltaSeconds.HasCommand( sCommand ) ) ActorUtil::LoadCommand( m_textDeltaSeconds, sType, sCommand ); } @@ -67,7 +67,7 @@ void ScoreDisplayLifeTime::Update( float fDelta ) float fSecs = m_pPlayerStageStats->fLifeRemainingSeconds; - CString s = SecondsToMSSMsMs(fSecs); + RString s = SecondsToMSSMsMs(fSecs); m_textTimeRemaining.SetText( s ); } @@ -124,9 +124,9 @@ void ScoreDisplayLifeTime::OnJudgment( HoldNoteScore hns, TapNoteScore tns ) PlayGainLoss( HoldNoteScoreToString(hns), fMeterChange ); } -void ScoreDisplayLifeTime::PlayGainLoss( const CString &sCommand, float fDeltaLifeSecs ) +void ScoreDisplayLifeTime::PlayGainLoss( const RString &sCommand, float fDeltaLifeSecs ) { - CString s; + RString s; if( fDeltaLifeSecs != 0 ) s = ssprintf( "%+1.1fs", fDeltaLifeSecs); m_textDeltaSeconds.SetText( s ); diff --git a/stepmania/src/ScoreDisplayLifeTime.h b/stepmania/src/ScoreDisplayLifeTime.h index ea5963459b..ed1a4de6b3 100644 --- a/stepmania/src/ScoreDisplayLifeTime.h +++ b/stepmania/src/ScoreDisplayLifeTime.h @@ -22,7 +22,7 @@ public: virtual void OnJudgment( HoldNoteScore score, TapNoteScore tscore ); protected: - void PlayGainLoss( const CString &sCommand, float fDeltaLifeSecs ); + void PlayGainLoss( const RString &sCommand, float fDeltaLifeSecs ); AutoActor m_sprFrame; BitmapText m_textTimeRemaining; diff --git a/stepmania/src/ScoreDisplayNormal.h b/stepmania/src/ScoreDisplayNormal.h index bb42004840..d4ab30faf0 100644 --- a/stepmania/src/ScoreDisplayNormal.h +++ b/stepmania/src/ScoreDisplayNormal.h @@ -15,7 +15,7 @@ public: virtual void Init( const PlayerState* pPlayerState, const PlayerStageStats* pPlayerStageStats ); virtual void SetScore( int iNewScore ); - virtual void SetText( CString s ) { m_text.SetText(s); } + virtual void SetText( RString s ) { m_text.SetText(s); } protected: Sprite m_sprFrame; diff --git a/stepmania/src/ScoreKeeperRave.cpp b/stepmania/src/ScoreKeeperRave.cpp index c8145b03ee..b1de1d66c3 100644 --- a/stepmania/src/ScoreKeeperRave.cpp +++ b/stepmania/src/ScoreKeeperRave.cpp @@ -127,15 +127,15 @@ void ScoreKeeperRave::LaunchAttack( AttackLevel al ) { PlayerNumber pn = m_pPlayerState->m_PlayerNumber; - CString* asAttacks = GAMESTATE->m_pCurCharacters[pn]->m_sAttacks[al]; // [NUM_ATTACKS_PER_LEVEL] - CString sAttackToGive; + RString* asAttacks = GAMESTATE->m_pCurCharacters[pn]->m_sAttacks[al]; // [NUM_ATTACKS_PER_LEVEL] + RString sAttackToGive; if (GAMESTATE->m_pCurCharacters[pn] != NULL) sAttackToGive = asAttacks[ rand()%NUM_ATTACKS_PER_LEVEL ]; else { /* If you add any note skins here, you need to make sure they're cached, too. */ - CString DefaultAttacks[8] = { "1.5x", "2.0x", "0.5x", "reverse", "sudden", "boost", "brake", "wave" }; + RString DefaultAttacks[8] = { "1.5x", "2.0x", "0.5x", "reverse", "sudden", "boost", "brake", "wave" }; sAttackToGive = DefaultAttacks[ rand()%8 ]; } diff --git a/stepmania/src/Screen.cpp b/stepmania/src/Screen.cpp index c7626ba4a2..d7455fb5b1 100644 --- a/stepmania/src/Screen.cpp +++ b/stepmania/src/Screen.cpp @@ -48,7 +48,7 @@ void Screen::Init() this->PlayCommand( "Init" ); - vector asList; + vector asList; split( PREPARE_SCREENS, ",", asList ); for( unsigned i = 0; i < asList.size(); ++i ) { @@ -229,14 +229,14 @@ void Screen::HandleScreenMessage( const ScreenMessage SM ) } } -CString Screen::GetNextScreen() const +RString Screen::GetNextScreen() const { if( !m_sNextScreen.empty() ) return m_sNextScreen; return NEXT_SCREEN; } -CString Screen::GetPrevScreen() const +RString Screen::GetPrevScreen() const { if( !m_sPrevScreen.empty() ) return m_sPrevScreen; diff --git a/stepmania/src/Screen.h b/stepmania/src/Screen.h index f9074bb3b8..27f920b97c 100644 --- a/stepmania/src/Screen.h +++ b/stepmania/src/Screen.h @@ -12,12 +12,12 @@ class InputEventPlus; struct MenuInput; class Screen; -typedef Screen* (*CreateScreenFn)(const CString& sClassName); -void RegisterScreenClass( const CString& sClassName, CreateScreenFn pfn ); +typedef Screen* (*CreateScreenFn)(const RString& sClassName); +void RegisterScreenClass( const RString& sClassName, CreateScreenFn pfn ); // Each Screen class should have a REGISTER_SCREEN_CLASS in its CPP file. #define REGISTER_SCREEN_CLASS( className ) \ - static Screen* Create##className( const CString &sName ) { Screen *pRet = new className; pRet->SetName( sName ); Screen::InitScreen( pRet ); return pRet; } \ + static Screen* Create##className( const RString &sName ) { Screen *pRet = new className; pRet->SetName( sName ); Screen::InitScreen( pRet ); return pRet; } \ struct Register##className { \ Register##className() { RegisterScreenClass( #className,Create##className); } \ }; \ @@ -75,11 +75,11 @@ protected: ThemeMetric ALLOW_OPERATOR_MENU_BUTTON; - CString GetNextScreen() const; - CString GetPrevScreen() const; + RString GetNextScreen() const; + RString GetPrevScreen() const; // If these are left blank, the NextScreen and PrevScreen metrics will be used. - CString m_sNextScreen, m_sPrevScreen; + RString m_sNextScreen, m_sPrevScreen; ScreenMessage m_smSendOnPop; public: diff --git a/stepmania/src/ScreenAttract.cpp b/stepmania/src/ScreenAttract.cpp index 3e04de88f0..20ea9a21df 100644 --- a/stepmania/src/ScreenAttract.cpp +++ b/stepmania/src/ScreenAttract.cpp @@ -137,7 +137,7 @@ void ScreenAttract::HandleScreenMessage( const ScreenMessage SM ) ScreenWithMenuElements::HandleScreenMessage( SM ); } -void ScreenAttract::GoToStartScreen( CString sScreenName ) +void ScreenAttract::GoToStartScreen( RString sScreenName ) { SCREENMAN->SetNewScreen( START_SCREEN(sScreenName) ); } diff --git a/stepmania/src/ScreenAttract.h b/stepmania/src/ScreenAttract.h index d7329960d8..04b50513e5 100644 --- a/stepmania/src/ScreenAttract.h +++ b/stepmania/src/ScreenAttract.h @@ -14,7 +14,7 @@ public: virtual void Init(); static void AttractInput( const InputEventPlus &input, ScreenWithMenuElements *pScreen ); - static void GoToStartScreen( CString sScreenName ); + static void GoToStartScreen( RString sScreenName ); virtual void Input( const InputEventPlus &input ); virtual void HandleScreenMessage( const ScreenMessage SM ); diff --git a/stepmania/src/ScreenBookkeeping.cpp b/stepmania/src/ScreenBookkeeping.cpp index 8f0dccfb80..59d587d998 100644 --- a/stepmania/src/ScreenBookkeeping.cpp +++ b/stepmania/src/ScreenBookkeeping.cpp @@ -111,7 +111,7 @@ void ScreenBookkeeping::ChangeView( View newView ) { - CString s; + RString s; s += ALL_TIME.GetValue(); s += ssprintf( " %i\n", BOOKKEEPER->GetCoinsTotal() ); m_textAllTime.SetText( s ); @@ -127,7 +127,7 @@ void ScreenBookkeeping::ChangeView( View newView ) BOOKKEEPER->GetCoinsLastDays( coins ); int iTotalLast = 0; - CString sTitle, sData; + RString sTitle, sData; for( int i=0; iGetCoinsLastWeeks( coins ); - CString sTitle, sData; + RString sTitle, sData; for( int col=0; col<4; col++ ) { - CString sTemp; + RString sTemp; for( int row=0; row<52/4; row++ ) { int week = row*4+col; @@ -175,7 +175,7 @@ void ScreenBookkeeping::ChangeView( View newView ) int coins[DAYS_IN_WEEK]; BOOKKEEPER->GetCoinsByDayOfWeek( coins ); - CString sTitle, sData; + RString sTitle, sData; for( int i=0; iGetCoinsByHour( coins ); - CString sTitle1, sData1; + RString sTitle1, sData1; for( int i=0; i strArray; - CString text("Use the left analog stick to translate the screen and right right analog stick to scale"); + vector strArray; + RString text("Use the left analog stick to translate the screen and right right analog stick to scale"); strArray.push_back(text); m_textHelp->SetTips(strArray); #endif @@ -173,7 +173,7 @@ void ScreenCenterImage::Move( Axis axis, float fDelta ) PREFSMAN->m_fCenterImageAddWidth, PREFSMAN->m_fCenterImageAddHeight ); - CString sMessage = + RString sMessage = ssprintf( CENTERING.GetValue(), PREFSMAN->m_iCenterImageTranslateX.Get(), PREFSMAN->m_iCenterImageTranslateY.Get(), diff --git a/stepmania/src/ScreenDebugOverlay.cpp b/stepmania/src/ScreenDebugOverlay.cpp index 45f39af451..aa6ce439ef 100644 --- a/stepmania/src/ScreenDebugOverlay.cpp +++ b/stepmania/src/ScreenDebugOverlay.cpp @@ -46,13 +46,13 @@ public: g_pvpSubscribers->push_back( this ); } virtual ~IDebugLine() { } - virtual CString GetDescription() = 0; - virtual CString GetValue() = 0; + virtual RString GetDescription() = 0; + virtual RString GetValue() = 0; virtual bool IsEnabled() = 0; - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { - CString s1 = GetDescription(); - CString s2 = GetValue(); + RString s1 = GetDescription(); + RString s2 = GetValue(); if( !s2.empty() ) s1 += " - "; sMessageOut = s1 + s2; @@ -102,9 +102,9 @@ static MapDebugToDI g_Mappings; static LocalizedString IN_GAMEPLAY( "ScreenDebugOverlay", "%s in gameplay" ); static LocalizedString OR( "ScreenDebugOverlay", "or" ); -static CString GetDebugButtonName( int i ) +static RString GetDebugButtonName( int i ) { - vector v; + vector v; if( g_Mappings.debugButton[i].IsValid() ) v.push_back( INPUTMAN->GetDeviceSpecificInputString(g_Mappings.debugButton[i]) ); if( g_Mappings.gameplayButton[i].IsValid() ) @@ -233,15 +233,15 @@ void ScreenDebugOverlay::UpdateText() txt2.SetY( SCALE(i, 0, NUM_DEBUG_LINES-1, SCREEN_TOP+60, SCREEN_BOTTOM-40) ); txt2.SetZoom( 0.7f ); - CString s1 = (*p)->GetDescription(); - CString s2 = (*p)->GetValue(); + RString s1 = (*p)->GetDescription(); + RString s2 = (*p)->GetValue(); bool bOn = (*p)->IsEnabled(); txt1.SetDiffuse( bOn ? on:off ); txt2.SetDiffuse( bOn ? on:off ); - CString sButton = GetDebugButtonName(i); + RString sButton = GetDebugButtonName(i); if( !sButton.empty() ) sButton += ": "; txt1.SetText( sButton ); @@ -294,7 +294,7 @@ bool ScreenDebugOverlay::OverlayInput( const InputEventPlus &input ) txt1.BeginTweening( 0.2f, Actor::TWEEN_LINEAR ); txt1.SetZoom( fZoom ); - CString sMessage; + RString sMessage; (*p)->Do( sMessage ); if( !sMessage.empty() ) SCREENMAN->SystemMessage( sMessage ); @@ -383,19 +383,19 @@ static LocalizedString MACHINE ( "ScreenDebugOverlay", "Machine" ); class DebugLineAutoplay : public IDebugLine { - virtual CString GetDescription() { return AUTO_PLAY.GetValue(); } - virtual CString GetValue() + virtual RString GetDescription() { return AUTO_PLAY.GetValue(); } + virtual RString GetValue() { switch( PREFSMAN->m_AutoPlay ) { case PC_HUMAN: return OFF.GetValue(); break; case PC_AUTOPLAY: return ON.GetValue(); break; case PC_CPU: return CPU.GetValue(); break; - default: ASSERT(0); return CString(); + default: ASSERT(0); return RString(); } } virtual bool IsEnabled() { return PREFSMAN->m_AutoPlay.Get() != PC_HUMAN; } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { PlayerController pc = (PlayerController)(PREFSMAN->m_AutoPlay+1); wrap( (int&)pc, NUM_PlayerController ); @@ -410,10 +410,10 @@ class DebugLineAutoplay : public IDebugLine class DebugLineAssistTick : public IDebugLine { - virtual CString GetDescription() { return ASSIST_TICK.GetValue(); } - virtual CString GetValue() { return IsEnabled() ? ON.GetValue():OFF.GetValue(); } + virtual RString GetDescription() { return ASSIST_TICK.GetValue(); } + virtual RString GetValue() { return IsEnabled() ? ON.GetValue():OFF.GetValue(); } virtual bool IsEnabled() { return GAMESTATE->m_SongOptions.m_bAssistTick; } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { GAMESTATE->m_SongOptions.m_bAssistTick = !GAMESTATE->m_SongOptions.m_bAssistTick; // Store this change, so it sticks if we change songs @@ -425,8 +425,8 @@ class DebugLineAssistTick : public IDebugLine class DebugLineAutosync : public IDebugLine { - virtual CString GetDescription() { return AUTOSYNC.GetValue(); } - virtual CString GetValue() + virtual RString GetDescription() { return AUTOSYNC.GetValue(); } + virtual RString GetValue() { switch( GAMESTATE->m_SongOptions.m_AutosyncType ) { @@ -437,7 +437,7 @@ class DebugLineAutosync : public IDebugLine } } virtual bool IsEnabled() { return GAMESTATE->m_SongOptions.m_AutosyncType!=SongOptions::AUTOSYNC_OFF; } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { SongOptions::AutosyncType as = (SongOptions::AutosyncType)(GAMESTATE->m_SongOptions.m_AutosyncType+1); wrap( (int&)as, SongOptions::NUM_AUTOSYNC_TYPES ); @@ -449,10 +449,10 @@ class DebugLineAutosync : public IDebugLine class DebugLineCoinMode : public IDebugLine { - virtual CString GetDescription() { return COIN_MODE.GetValue(); } - virtual CString GetValue() { return CoinModeToString(PREFSMAN->m_CoinMode); } + virtual RString GetDescription() { return COIN_MODE.GetValue(); } + virtual RString GetValue() { return CoinModeToString(PREFSMAN->m_CoinMode); } virtual bool IsEnabled() { return true; } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { CoinMode cm = (CoinMode)(PREFSMAN->m_CoinMode+1); wrap( (int&)cm, NUM_COIN_MODES ); @@ -464,10 +464,10 @@ class DebugLineCoinMode : public IDebugLine class DebugLineSlow : public IDebugLine { - virtual CString GetDescription() { return SLOW.GetValue(); } - virtual CString GetValue() { return IsEnabled() ? ON.GetValue():OFF.GetValue(); } + virtual RString GetDescription() { return SLOW.GetValue(); } + virtual RString GetValue() { return IsEnabled() ? ON.GetValue():OFF.GetValue(); } virtual bool IsEnabled() { return g_bIsSlow; } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { g_bIsSlow = !g_bIsSlow; SetSpeed(); @@ -477,10 +477,10 @@ class DebugLineSlow : public IDebugLine class DebugLineHalt : public IDebugLine { - virtual CString GetDescription() { return HALT.GetValue(); } - virtual CString GetValue() { return IsEnabled() ? ON.GetValue():OFF.GetValue(); } + virtual RString GetDescription() { return HALT.GetValue(); } + virtual RString GetValue() { return IsEnabled() ? ON.GetValue():OFF.GetValue(); } virtual bool IsEnabled() { return g_bIsHalt; } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { g_bIsHalt = !g_bIsHalt; g_HaltTimer.Touch(); @@ -491,10 +491,10 @@ class DebugLineHalt : public IDebugLine class DebugLineLightsDebug : public IDebugLine { - virtual CString GetDescription() { return LIGHTS_DEBUG.GetValue(); } - virtual CString GetValue() { return IsEnabled() ? ON.GetValue():OFF.GetValue(); } + virtual RString GetDescription() { return LIGHTS_DEBUG.GetValue(); } + virtual RString GetValue() { return IsEnabled() ? ON.GetValue():OFF.GetValue(); } virtual bool IsEnabled() { return PREFSMAN->m_bDebugLights.Get(); } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { PREFSMAN->m_bDebugLights.Set( !PREFSMAN->m_bDebugLights ); IDebugLine::Do( sMessageOut ); @@ -503,10 +503,10 @@ class DebugLineLightsDebug : public IDebugLine class DebugLineMonkeyInput : public IDebugLine { - virtual CString GetDescription() { return MONKEY_INPUT.GetValue(); } - virtual CString GetValue() { return IsEnabled() ? ON.GetValue():OFF.GetValue(); } + virtual RString GetDescription() { return MONKEY_INPUT.GetValue(); } + virtual RString GetValue() { return IsEnabled() ? ON.GetValue():OFF.GetValue(); } virtual bool IsEnabled() { return PREFSMAN->m_bMonkeyInput.Get(); } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { PREFSMAN->m_bMonkeyInput.Set( !PREFSMAN->m_bMonkeyInput ); IDebugLine::Do( sMessageOut ); @@ -515,10 +515,10 @@ class DebugLineMonkeyInput : public IDebugLine class DebugLineStats : public IDebugLine { - virtual CString GetDescription() { return RENDERING_STATS.GetValue(); } - virtual CString GetValue() { return IsEnabled() ? ON.GetValue():OFF.GetValue(); } + virtual RString GetDescription() { return RENDERING_STATS.GetValue(); } + virtual RString GetValue() { return IsEnabled() ? ON.GetValue():OFF.GetValue(); } virtual bool IsEnabled() { return PREFSMAN->m_bShowStats.Get(); } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { PREFSMAN->m_bShowStats.Set( !PREFSMAN->m_bShowStats ); IDebugLine::Do( sMessageOut ); @@ -527,10 +527,10 @@ class DebugLineStats : public IDebugLine class DebugLineVsync : public IDebugLine { - virtual CString GetDescription() { return VSYNC.GetValue(); } - virtual CString GetValue() { return IsEnabled() ? ON.GetValue():OFF.GetValue(); } + virtual RString GetDescription() { return VSYNC.GetValue(); } + virtual RString GetValue() { return IsEnabled() ? ON.GetValue():OFF.GetValue(); } virtual bool IsEnabled() { return PREFSMAN->m_bVsync.Get(); } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { PREFSMAN->m_bVsync.Set( !PREFSMAN->m_bVsync ); StepMania::ApplyGraphicOptions(); @@ -540,10 +540,10 @@ class DebugLineVsync : public IDebugLine class DebugLineAllowMultitexture : public IDebugLine { - virtual CString GetDescription() { return MULTITEXTURE.GetValue(); } - virtual CString GetValue() { return IsEnabled() ? ON.GetValue():OFF.GetValue(); } + virtual RString GetDescription() { return MULTITEXTURE.GetValue(); } + virtual RString GetValue() { return IsEnabled() ? ON.GetValue():OFF.GetValue(); } virtual bool IsEnabled() { return PREFSMAN->m_bAllowMultitexture.Get(); } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { PREFSMAN->m_bAllowMultitexture.Set( !PREFSMAN->m_bAllowMultitexture ); IDebugLine::Do( sMessageOut ); @@ -552,10 +552,10 @@ class DebugLineAllowMultitexture : public IDebugLine class DebugLineScreenTestMode : public IDebugLine { - virtual CString GetDescription() { return SCREEN_TEST_MODE.GetValue(); } - virtual CString GetValue() { return IsEnabled() ? ON.GetValue():OFF.GetValue(); } + virtual RString GetDescription() { return SCREEN_TEST_MODE.GetValue(); } + virtual RString GetValue() { return IsEnabled() ? ON.GetValue():OFF.GetValue(); } virtual bool IsEnabled() { return PREFSMAN->m_bScreenTestMode.Get(); } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { PREFSMAN->m_bScreenTestMode.Set( !PREFSMAN->m_bScreenTestMode ); IDebugLine::Do( sMessageOut ); @@ -564,10 +564,10 @@ class DebugLineScreenTestMode : public IDebugLine class DebugLineClearMachineStats : public IDebugLine { - virtual CString GetDescription() { return CLEAR_MACHINE_STATS.GetValue(); } - virtual CString GetValue() { return CString(); } + virtual RString GetDescription() { return CLEAR_MACHINE_STATS.GetValue(); } + virtual RString GetValue() { return RString(); } virtual bool IsEnabled() { return true; } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { GameCommand gc; gc.Load( 0, ParseCommands("ClearMachineStats") ); @@ -649,10 +649,10 @@ static void FillProfile( Profile *pProfile ) class DebugLineFillMachineStats : public IDebugLine { - virtual CString GetDescription() { return FILL_MACHINE_STATS.GetValue(); } - virtual CString GetValue() { return CString(); } + virtual RString GetDescription() { return FILL_MACHINE_STATS.GetValue(); } + virtual RString GetValue() { return RString(); } virtual bool IsEnabled() { return true; } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { Profile* pProfile = PROFILEMAN->GetMachineProfile(); FillProfile( pProfile ); @@ -663,10 +663,10 @@ class DebugLineFillMachineStats : public IDebugLine class DebugLineSendNotesEnded : public IDebugLine { - virtual CString GetDescription() { return SEND_NOTES_ENDED.GetValue(); } - virtual CString GetValue() { return CString(); } + virtual RString GetDescription() { return SEND_NOTES_ENDED.GetValue(); } + virtual RString GetValue() { return RString(); } virtual bool IsEnabled() { return true; } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { SCREENMAN->PostMessageToTopScreen( SM_NotesEnded, 0 ); IDebugLine::Do( sMessageOut ); @@ -675,10 +675,10 @@ class DebugLineSendNotesEnded : public IDebugLine class DebugLineReloadCurrentScreen : public IDebugLine { - virtual CString GetDescription() { return RELOAD.GetValue(); } - virtual CString GetValue() { return SCREENMAN ? SCREENMAN->GetTopScreen()->GetName() : CString(); } + virtual RString GetDescription() { return RELOAD.GetValue(); } + virtual RString GetValue() { return SCREENMAN ? SCREENMAN->GetTopScreen()->GetName() : RString(); } virtual bool IsEnabled() { return true; } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { SOUND->StopMusic(); StepMania::ResetGame(); @@ -690,10 +690,10 @@ class DebugLineReloadCurrentScreen : public IDebugLine class DebugLineReloadTheme : public IDebugLine { - virtual CString GetDescription() { return RELOAD_THEME_AND_TEXTURES.GetValue(); } - virtual CString GetValue() { return CString(); } + virtual RString GetDescription() { return RELOAD_THEME_AND_TEXTURES.GetValue(); } + virtual RString GetValue() { return RString(); } virtual bool IsEnabled() { return true; } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { THEME->ReloadMetrics(); TEXTUREMAN->ReloadAll(); @@ -707,10 +707,10 @@ class DebugLineReloadTheme : public IDebugLine class DebugLineWriteProfiles : public IDebugLine { - virtual CString GetDescription() { return WRITE_PROFILES.GetValue(); } - virtual CString GetValue() { return CString(); } + virtual RString GetDescription() { return WRITE_PROFILES.GetValue(); } + virtual RString GetValue() { return RString(); } virtual bool IsEnabled() { return true; } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { // Also save bookkeeping and profile info for debugging // so we don't have to play through a whole song to get new output. @@ -734,10 +734,10 @@ class DebugLineWriteProfiles : public IDebugLine class DebugLineWritePreferences : public IDebugLine { - virtual CString GetDescription() { return WRITE_PREFERENCES.GetValue(); } - virtual CString GetValue() { return CString(); } + virtual RString GetDescription() { return WRITE_PREFERENCES.GetValue(); } + virtual RString GetValue() { return RString(); } virtual bool IsEnabled() { return true; } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { PREFSMAN->SavePrefsToDisk(); IDebugLine::Do( sMessageOut ); @@ -746,10 +746,10 @@ class DebugLineWritePreferences : public IDebugLine class DebugLineMenuTimer : public IDebugLine { - virtual CString GetDescription() { return MENU_TIMER.GetValue(); } - virtual CString GetValue() { return CString(); } + virtual RString GetDescription() { return MENU_TIMER.GetValue(); } + virtual RString GetValue() { return RString(); } virtual bool IsEnabled() { return PREFSMAN->m_bMenuTimer.Get(); } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { PREFSMAN->m_bMenuTimer.Set( !PREFSMAN->m_bMenuTimer ); IDebugLine::Do( sMessageOut ); @@ -758,10 +758,10 @@ class DebugLineMenuTimer : public IDebugLine class DebugLineFlushLog : public IDebugLine { - virtual CString GetDescription() { return FLUSH_LOG.GetValue(); } - virtual CString GetValue() { return CString(); } + virtual RString GetDescription() { return FLUSH_LOG.GetValue(); } + virtual RString GetValue() { return RString(); } virtual bool IsEnabled() { return true; } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { LOG->Flush(); IDebugLine::Do( sMessageOut ); @@ -770,10 +770,10 @@ class DebugLineFlushLog : public IDebugLine class DebugLinePullBackCamera : public IDebugLine { - virtual CString GetDescription() { return PULL_BACK_CAMERA.GetValue(); } - virtual CString GetValue() { return CString(); } + virtual RString GetDescription() { return PULL_BACK_CAMERA.GetValue(); } + virtual RString GetValue() { return RString(); } virtual bool IsEnabled() { return g_fImageScaleDestination != 1; } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { if( g_fImageScaleDestination == 1 ) g_fImageScaleDestination = 0.5f; @@ -785,10 +785,10 @@ class DebugLinePullBackCamera : public IDebugLine class DebugLineVolumeUp : public IDebugLine { - virtual CString GetDescription() { return VOLUME_UP.GetValue(); } - virtual CString GetValue() { return ssprintf("%.0f%%",PREFSMAN->m_fSoundVolume.Get()*100); } + virtual RString GetDescription() { return VOLUME_UP.GetValue(); } + virtual RString GetValue() { return ssprintf("%.0f%%",PREFSMAN->m_fSoundVolume.Get()*100); } virtual bool IsEnabled() { return true; } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { ChangeVolume( +0.1f ); IDebugLine::Do( sMessageOut ); @@ -797,10 +797,10 @@ class DebugLineVolumeUp : public IDebugLine class DebugLineVolumeDown : public IDebugLine { - virtual CString GetDescription() { return VOLUME_DOWN.GetValue(); } - virtual CString GetValue() { return CString(); } + virtual RString GetDescription() { return VOLUME_DOWN.GetValue(); } + virtual RString GetValue() { return RString(); } virtual bool IsEnabled() { return true; } - virtual void Do( CString &sMessageOut ) + virtual void Do( RString &sMessageOut ) { ChangeVolume( -0.1f ); IDebugLine::Do( sMessageOut ); @@ -809,10 +809,10 @@ class DebugLineVolumeDown : public IDebugLine class DebugLineUptime : public IDebugLine { - virtual CString GetDescription() { return UPTIME.GetValue(); } - virtual CString GetValue() { return SecondsToMMSSMsMsMs(RageTimer::GetTimeSinceStart()); } + virtual RString GetDescription() { return UPTIME.GetValue(); } + virtual RString GetValue() { return SecondsToMMSSMsMsMs(RageTimer::GetTimeSinceStart()); } virtual bool IsEnabled() { return false; } - virtual void Do( CString &sMessageOut ) {} + virtual void Do( RString &sMessageOut ) {} }; /* #ifdef out the lines below if you don't want them to appear on certain diff --git a/stepmania/src/ScreenDemonstration.cpp b/stepmania/src/ScreenDemonstration.cpp index 7a4f0ccaab..cff28978af 100644 --- a/stepmania/src/ScreenDemonstration.cpp +++ b/stepmania/src/ScreenDemonstration.cpp @@ -26,10 +26,10 @@ void ScreenDemonstration::Init() { // Choose a Style { - vector v; + vector v; split( ALLOW_STYLE_TYPES, ",", v ); vector vStyleTypeAllow; - FOREACH_CONST( CString, v, s ) + FOREACH_CONST( RString, v, s ) { StyleType st = StringToStyleType( *s ); ASSERT( st != STYLE_TYPE_INVALID ); diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 73ff0945ff..be3c69b61d 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -84,7 +84,7 @@ static const char *EditStateNames[] = { }; XToString( EditState, NUM_EDIT_STATES ); -const CString INPUT_TIPS_TEXT = +const RString INPUT_TIPS_TEXT = #if defined(XBOX) "Up/Down:\n change beat\n" "Left/Right:\n change snap\n" @@ -571,10 +571,10 @@ static bool EnabledIfSet2GlobalMovie() { return ScreenMiniMenu::s_viLastAnswer static bool EnabledIfSet2GlobalMovieSongGroup() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file2_type] == global_movie_song_group && !g_BackgroundChange.rows[ScreenEdit::file2_global_movie_song_group].choices.empty(); } static bool EnabledIfSet2GlobalMovieSongGroupAndGenre() { return ScreenMiniMenu::s_viLastAnswers[ScreenEdit::file2_type] == global_movie_song_group_and_genre && !g_BackgroundChange.rows[ScreenEdit::file2_global_movie_song_group_and_genre].choices.empty(); } -static CString GetOneBakedRandomFile( Song *pSong, bool bTryGenre = true ) +static RString GetOneBakedRandomFile( Song *pSong, bool bTryGenre = true ) { - vector vsPathsOut; - vector vsNamesOut; + vector vsPathsOut; + vector vsNamesOut; BackgroundUtil::GetGlobalRandomMovies( pSong, "", @@ -584,7 +584,7 @@ static CString GetOneBakedRandomFile( Song *pSong, bool bTryGenre = true ) if( !vsNamesOut.empty() ) return vsNamesOut[rand()%vsNamesOut.size()]; else - return CString(); + return RString(); } static MenuDef g_InsertTapAttack( @@ -966,9 +966,9 @@ void ScreenEdit::UpdateTextInfo() m_bTextInfoNeedsUpdate = false; - CString sNoteType = NoteTypeToString(m_SnapDisplay.GetNoteType()) + " notes"; + RString sNoteType = NoteTypeToString(m_SnapDisplay.GetNoteType()) + " notes"; - CString sText; + RString sText; sText += ssprintf( "Current beat:\n %.3f\n", GAMESTATE->m_fSongBeat ); sText += ssprintf( "Current sec:\n %.3f\n", m_pSong->GetElapsedTimeFromBeat(GAMESTATE->m_fSongBeat) ); switch( EDIT_MODE.GetValue() ) @@ -1370,7 +1370,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) m_pSteps = pSteps; pSteps->GetNoteData( m_NoteDataEdit ); - CString s = ssprintf( + RString s = ssprintf( SWITCHED_TO.GetValue() + " %s %s '%s' (%d of %d)", GAMEMAN->StepsTypeToString( pSteps->m_StepsType ).c_str(), DifficultyToString( pSteps->GetDifficulty() ).c_str(), @@ -1521,7 +1521,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) // // Fill in option names // - vector vThrowAway; + vector vThrowAway; g_BackgroundChange.rows[layer].choices[0] = ssprintf("%d",g_CurrentBGChangeLayer); BackgroundUtil::GetBackgroundTransitions( "", vThrowAway, g_BackgroundChange.rows[transition].choices ); @@ -1665,7 +1665,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) case EDIT_BUTTON_BAKE_RANDOM_FROM_SONG_GROUP_AND_GENRE: { bool bTryGenre = EditB == EDIT_BUTTON_BAKE_RANDOM_FROM_SONG_GROUP_AND_GENRE; - CString sName = GetOneBakedRandomFile(m_pSong, bTryGenre); + RString sName = GetOneBakedRandomFile(m_pSong, bTryGenre); if( sName.empty() ) { SCREENMAN->PlayInvalidSound(); @@ -2247,7 +2247,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) GAMESTATE->m_pCurCourse.Set( NULL ); if( num != 0 ) { - const CString name = g_CourseMode.rows[0].choices[num]; + const RString name = g_CourseMode.rows[0].choices[num]; Course *pCourse = SONGMAN->FindCourse( name ); GAMESTATE->m_pCurCourse.Set( pCourse ); ASSERT( GAMESTATE->m_pCurCourse ); @@ -2270,7 +2270,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) else if( SM == SM_BackFromInsertTapAttackPlayerOptions ) { PlayerOptions poChosen = GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions; - CString sMods = poChosen.GetString(); + RString sMods = poChosen.GetString(); const int row = BeatToNoteRow( GAMESTATE->m_fSongBeat ); TapNote tn( @@ -2312,7 +2312,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) else if( SM == SM_BackFromInsertCourseAttackPlayerOptions ) { PlayerOptions poChosen = GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions; - CString sMods = poChosen.GetString(); + RString sMods = poChosen.GetString(); Course *pCourse = GAMESTATE->m_pCurCourse; CourseEntry &ce = pCourse->m_vEntries[GAMESTATE->m_iEditCourseEntryIndex]; @@ -2433,7 +2433,7 @@ void ScreenEdit::OnSnapModeChange() // Begin helper functions for InputEdit -static void ChangeDescription( const CString &sNew ) +static void ChangeDescription( const RString &sNew ) { Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1]; @@ -2444,7 +2444,7 @@ static void ChangeDescription( const CString &sNew ) pSteps->SetDescription(sNew); } -static bool ValidateDescription( const CString &sAnswer, CString &sErrorOut ) +static bool ValidateDescription( const RString &sAnswer, RString &sErrorOut ) { if( sAnswer.empty() ) return true; @@ -2474,43 +2474,43 @@ static bool ValidateDescription( const CString &sAnswer, CString &sErrorOut ) return false; } -static void ChangeMainTitle( const CString &sNew ) +static void ChangeMainTitle( const RString &sNew ) { Song* pSong = GAMESTATE->m_pCurSong; pSong->m_sMainTitle = sNew; } -static void ChangeSubTitle( const CString &sNew ) +static void ChangeSubTitle( const RString &sNew ) { Song* pSong = GAMESTATE->m_pCurSong; pSong->m_sSubTitle = sNew; } -static void ChangeArtist( const CString &sNew ) +static void ChangeArtist( const RString &sNew ) { Song* pSong = GAMESTATE->m_pCurSong; pSong->m_sArtist = sNew; } -static void ChangeCredit( const CString &sNew ) +static void ChangeCredit( const RString &sNew ) { Song* pSong = GAMESTATE->m_pCurSong; pSong->m_sCredit = sNew; } -static void ChangeMainTitleTranslit( const CString &sNew ) +static void ChangeMainTitleTranslit( const RString &sNew ) { Song* pSong = GAMESTATE->m_pCurSong; pSong->m_sMainTitleTranslit = sNew; } -static void ChangeSubTitleTranslit( const CString &sNew ) +static void ChangeSubTitleTranslit( const RString &sNew ) { Song* pSong = GAMESTATE->m_pCurSong; pSong->m_sSubTitleTranslit = sNew; } -static void ChangeArtistTranslit( const CString &sNew ) +static void ChangeArtistTranslit( const RString &sNew ) { Song* pSong = GAMESTATE->m_pCurSong; pSong->m_sArtistTranslit = sNew; @@ -2611,7 +2611,7 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector &iAns HandleScreenMessage( SM_SaveSuccessful ); /* FIXME - CString s; + RString s; switch( c ) { case save: s = "ScreenMemcardSaveEditsAfterSave"; break; @@ -2925,7 +2925,7 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, const vector &iAns HandleAreaMenuChoice( paste_at_begin_marker ); const vector sIter = m_pSong->GetAllSteps(); - CString sTempStyle, sTempDiff; + RString sTempStyle, sTempDiff; for( unsigned i = 0; i < sIter.size(); i++ ) { if( sIter[i]->IsAutogen() ) @@ -3207,7 +3207,7 @@ void ScreenEdit::RevertFromDisk() if( GAMESTATE->m_pCurSteps[PLAYER_1] ) id.FromSteps( GAMESTATE->m_pCurSteps[PLAYER_1] ); - CString sSongDir = GAMESTATE->m_pCurSong->GetSongDir(); + RString sSongDir = GAMESTATE->m_pCurSong->GetSongDir(); GAMESTATE->m_pCurSong->LoadFromSongDir( sSongDir ); if( id.IsValid() ) @@ -3265,7 +3265,7 @@ void ScreenEdit::CheckNumberOfNotesAndUndo() { Undo(); m_bHasUndo = false; - CString sError = ssprintf( CREATES_MORE_THAN_NOTES.GetValue() + "\n\n" + MORE_THAN_NOTES.GetValue(), MAX_NOTES_PER_MEASURE, MAX_NOTES_PER_MEASURE ); + RString sError = ssprintf( CREATES_MORE_THAN_NOTES.GetValue() + "\n\n" + MORE_THAN_NOTES.GetValue(), MAX_NOTES_PER_MEASURE, MAX_NOTES_PER_MEASURE ); ScreenPrompt::Prompt( SM_None, sError ); return; } @@ -3283,7 +3283,7 @@ void ScreenEdit::CheckNumberOfNotesAndUndo() { Undo(); m_bHasUndo = false; - CString sError = CREATES_NOTES_PAST_END.GetValue() + "\n\n" + CHANGE_REVERTED.GetValue(); + RString sError = CREATES_NOTES_PAST_END.GetValue() + "\n\n" + CHANGE_REVERTED.GetValue(); ScreenPrompt::Prompt( SM_None, sError ); return; } diff --git a/stepmania/src/ScreenEditMenu.cpp b/stepmania/src/ScreenEditMenu.cpp index 769c9a9ec6..75e49908cb 100644 --- a/stepmania/src/ScreenEditMenu.cpp +++ b/stepmania/src/ScreenEditMenu.cpp @@ -129,9 +129,9 @@ void ScreenEditMenu::MenuRight( const InputEventPlus &input ) } } -static CString GetCopyDescription( const Steps *pSourceSteps ) +static RString GetCopyDescription( const Steps *pSourceSteps ) { - CString s; + RString s; if( pSourceSteps->GetDifficulty() == DIFFICULTY_EDIT ) s = pSourceSteps->GetDescription(); else @@ -141,7 +141,7 @@ static CString GetCopyDescription( const Steps *pSourceSteps ) static LocalizedString YOU_MUST_SUPPLY_NAME ( "ScreenEditMenu", "You must supply a name for your new edit." ); static LocalizedString EDIT_NAME_CONFLICTS ( "ScreenEditMenu", "The name you chose conflicts with another edit. Please use a different name." ); -static bool ValidateCurrentStepsDescription( const CString &s, CString &sErrorOut ) +static bool ValidateCurrentStepsDescription( const RString &s, RString &sErrorOut ) { ASSERT( GAMESTATE->m_pCurSteps[0]->GetDifficulty() == DIFFICULTY_EDIT ); @@ -160,7 +160,7 @@ static bool ValidateCurrentStepsDescription( const CString &s, CString &sErrorOu return true; } -static void SetCurrentStepsDescription( const CString &s ) +static void SetCurrentStepsDescription( const RString &s ) { GAMESTATE->m_pCurSteps[0]->SetDescription( s ); } @@ -244,7 +244,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn ) break; } - CString sEditName; + RString sEditName; if( pSourceSteps ) { pSteps->CopyFrom( pSourceSteps, st, pSong->m_fMusicLengthSeconds ); @@ -327,7 +327,7 @@ void ScreenEditMenu::RefreshExplanationText() void ScreenEditMenu::RefreshNumStepsLoadedFromProfile() { - CString s = ssprintf( "edits used: %d", SONGMAN->GetNumStepsLoadedFromProfile() ); + RString s = ssprintf( "edits used: %d", SONGMAN->GetNumStepsLoadedFromProfile() ); m_textNumStepsLoadedFromProfile.SetText( s ); } diff --git a/stepmania/src/ScreenEnding.cpp b/stepmania/src/ScreenEnding.cpp index 08f0ab1e79..dd19e4c1d1 100644 --- a/stepmania/src/ScreenEnding.cpp +++ b/stepmania/src/ScreenEnding.cpp @@ -21,7 +21,7 @@ #include "InputEventPlus.h" -CString GetStatsLineTitle( PlayerNumber pn, EndingStatsLine line ) +RString GetStatsLineTitle( PlayerNumber pn, EndingStatsLine line ) { switch( line ) { @@ -30,8 +30,8 @@ CString GetStatsLineTitle( PlayerNumber pn, EndingStatsLine line ) case PERCENT_COMPLETE: { StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType; - CString sStepsType = GAMEMAN->StepsTypeToLocalizedString(st); - CString sType = GAMESTATE->IsCourseMode() ? "Courses" : "Songs"; + RString sStepsType = GAMEMAN->StepsTypeToLocalizedString(st); + RString sType = GAMESTATE->IsCourseMode() ? "Courses" : "Songs"; return ssprintf( "%s %s %%", sStepsType.c_str(), sType.c_str() ); } case PERCENT_COMPLETE_EASY: @@ -44,7 +44,7 @@ CString GetStatsLineTitle( PlayerNumber pn, EndingStatsLine line ) CourseDifficulty cd = (CourseDifficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY); ASSERT( cd >= 0 && cd < NUM_CourseDifficulty ); if( !GAMESTATE->IsCourseDifficultyShown(cd) ) - return CString(); + return RString(); return CourseDifficultyToLocalizedString(cd); } else @@ -54,11 +54,11 @@ CString GetStatsLineTitle( PlayerNumber pn, EndingStatsLine line ) return DifficultyToLocalizedString(dc); } } - default: ASSERT(0); return CString(); + default: ASSERT(0); return RString(); } } -CString GetStatsLineValue( PlayerNumber pn, EndingStatsLine line ) +RString GetStatsLineValue( PlayerNumber pn, EndingStatsLine line ) { CHECKPOINT_M( ssprintf("GetStatsLineValue(%d,%d)",pn,line) ); @@ -101,27 +101,27 @@ CString GetStatsLineValue( PlayerNumber pn, EndingStatsLine line ) case PERCENT_COMPLETE_CHALLENGE: // Ugly... { - CString sStepsType = GAMEMAN->StepsTypeToLocalizedString(st); + RString sStepsType = GAMEMAN->StepsTypeToLocalizedString(st); float fPercent = 0; if( GAMESTATE->IsCourseMode() ) { CourseDifficulty cd = (CourseDifficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY); ASSERT( cd >= 0 && cd < NUM_CourseDifficulty ); if( !GAMESTATE->IsCourseDifficultyShown(cd) ) - return CString(); - CString sDifficulty = CourseDifficultyToLocalizedString(cd); + return RString(); + RString sDifficulty = CourseDifficultyToLocalizedString(cd); fPercent = pProfile->GetCoursesPercentComplete(st,cd); } else { Difficulty dc = (Difficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY); ASSERT( dc >= 0 && dc < NUM_Difficulty ); - CString sDifficulty = DifficultyToLocalizedString(dc); + RString sDifficulty = DifficultyToLocalizedString(dc); fPercent = pProfile->GetSongsPercentComplete(st,dc); } return ssprintf( "%05.2f%%", fPercent*100 ); } - default: ASSERT(0); return CString(); + default: ASSERT(0); return RString(); } } diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index c9e4afb56e..efd889aa2b 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -330,9 +330,9 @@ void ScreenEvaluation::Init() m_textPlayerOptions[p].LoadFromFont( THEME->GetPathF(m_sName,"PlayerOptions") ); m_textPlayerOptions[p].SetName( ssprintf("PlayerOptionsP%d",p+1) ); SET_XY_AND_ON_COMMAND( m_textPlayerOptions[p] ); - vector v; + vector v; GAMESTATE->m_pPlayerState[p]->m_PlayerOptions.GetThemedMods( v ); - CString sPO = join( PLAYER_OPTIONS_SEPARATOR, v ); + RString sPO = join( PLAYER_OPTIONS_SEPARATOR, v ); m_textPlayerOptions[p].SetText( sPO ); this->AddChild( &m_textPlayerOptions[p] ); } @@ -862,10 +862,10 @@ void ScreenEvaluation::Input( const InputEventPlus &input ) MEMCARDMAN->MountCard( pn ); Profile* pProfile = PROFILEMAN->GetProfile(pn); - CString sDir = PROFILEMAN->GetProfileDir((ProfileSlot)pn) + "Screenshots/"; + RString sDir = PROFILEMAN->GetProfileDir((ProfileSlot)pn) + "Screenshots/"; int iScreenshotIndex = pProfile->GetNextScreenshotIndex(); - CString sFileName = StepMania::SaveScreenshot( sDir, true, true, iScreenshotIndex ); - CString sPath = sDir+sFileName; + RString sFileName = StepMania::SaveScreenshot( sDir, true, true, iScreenshotIndex ); + RString sPath = sDir+sFileName; if( !sFileName.empty() ) { diff --git a/stepmania/src/ScreenEvaluationMultiplayer.cpp b/stepmania/src/ScreenEvaluationMultiplayer.cpp index ed1e25128f..ea5057e16d 100644 --- a/stepmania/src/ScreenEvaluationMultiplayer.cpp +++ b/stepmania/src/ScreenEvaluationMultiplayer.cpp @@ -93,7 +93,7 @@ public: case MultiplayerJudgeLine_Held: iVal = pPlayerStageStats->iHoldNoteScores[HNS_Held];break; } - CString s = ssprintf( "%3d", iVal ); + RString s = ssprintf( "%3d", iVal ); text.SetText( s ); PositionItem( expr, &text, i, NUM_MultiplayerJudgeLine ); diff --git a/stepmania/src/ScreenExit.cpp b/stepmania/src/ScreenExit.cpp index ead78a4e82..e53454b20f 100644 --- a/stepmania/src/ScreenExit.cpp +++ b/stepmania/src/ScreenExit.cpp @@ -42,7 +42,7 @@ void ScreenExit::Update( float fDelta ) if( !DoQuit && m_ShutdownTimer.PeekDeltaTime() > 3 ) { DoQuit = true; - CString warn = ssprintf("ScreenExit: %i sound%s failed to finish playing quickly: ", + RString warn = ssprintf("ScreenExit: %i sound%s failed to finish playing quickly: ", (int) PlayingSounds.size(), (PlayingSounds.size()==1?"":"s") ); for( set::const_iterator i = PlayingSounds.begin(); i != PlayingSounds.end(); ++i ) diff --git a/stepmania/src/ScreenEz2SelectMusic.h b/stepmania/src/ScreenEz2SelectMusic.h index 91778abc0e..15de012024 100644 --- a/stepmania/src/ScreenEz2SelectMusic.h +++ b/stepmania/src/ScreenEz2SelectMusic.h @@ -34,8 +34,8 @@ protected: void UpdateOptions( PlayerNumber pn, int nosound ); - CString sOptions; - vector asOptions; + RString sOptions; + vector asOptions; void TweenOffScreen(); diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 3eec20d6a1..ec14c50ec2 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -1002,7 +1002,7 @@ void ScreenGameplay::LoadCourseSongNumber( int iSongNumber ) { if( !GAMESTATE->IsCourseMode() ) return; - const CString path = THEME->GetPathG( m_sName, ssprintf("course song %i",iSongNumber+1), true ); + const RString path = THEME->GetPathG( m_sName, ssprintf("course song %i",iSongNumber+1), true ); if( path != "" ) m_sprCourseSongNumber.Load( path ); else @@ -1285,8 +1285,8 @@ void ScreenGameplay::LoadLights() // // No explicit lights. Create autogen lights. // - CString sDifficulty = PREFSMAN->m_sLightsStepsDifficulty; - vector asDifficulties; + RString sDifficulty = PREFSMAN->m_sLightsStepsDifficulty; + vector asDifficulties; split( sDifficulty, ",", asDifficulties ); Difficulty d1 = DIFFICULTY_INVALID; @@ -1424,7 +1424,7 @@ void ScreenGameplay::PlayTicks() } /* Play announcer "type" if it's been at least fSeconds since the last announcer. */ -void ScreenGameplay::PlayAnnouncer( CString type, float fSeconds ) +void ScreenGameplay::PlayAnnouncer( RString type, float fSeconds ) { if( GAMESTATE->m_fOpponentHealthPercent == 0 ) return; // Shut the announcer up @@ -2013,8 +2013,8 @@ void ScreenGameplay::SendCrossedMessages() { StyleInput si( pn, t ); const Game* pGame = GAMESTATE->GetCurrentGame(); - CString sButton = pGame->ColToButtonName( t ); - CString sMessageName = "NoteCrossed" + sButton; + RString sButton = pGame->ColToButtonName( t ); + RString sMessageName = "NoteCrossed" + sButton; MESSAGEMAN->Broadcast( sMessageName ); } } @@ -2023,7 +2023,7 @@ void ScreenGameplay::SendCrossedMessages() MESSAGEMAN->Broadcast( (Message)(Message_NoteCrossed + i) ); if( i == 0 && iNumTracksWithTapOrHoldHead >= 2 ) { - CString sMessageName = "NoteCrossedJump"; + RString sMessageName = "NoteCrossedJump"; MESSAGEMAN->Broadcast( sMessageName ); } } @@ -2649,7 +2649,7 @@ void ScreenGameplay::SaveRecordedResults() // FlushDirCache(); - vector files; + vector files; GetDirListing( "Save/recording*", files, false, false ); sort( files.begin(), files.end() ); @@ -2659,7 +2659,7 @@ void ScreenGameplay::SaveRecordedResults() for( int i = files.size()-1; i >= 0; --i ) { static Regex re( "^recording([0-9]{5})\\....$" ); - vector matches; + vector matches; if( !re.Compare( files[i], matches ) ) continue; @@ -2668,7 +2668,7 @@ void ScreenGameplay::SaveRecordedResults() break; } - CString sFileName = ssprintf( "recording%05d.xml", iIndex ); + RString sFileName = ssprintf( "recording%05d.xml", iIndex ); p->SaveToFile( "Save/"+sFileName, opt ); SAFE_DELETE( p ); diff --git a/stepmania/src/ScreenGameplay.h b/stepmania/src/ScreenGameplay.h index 156999328e..421aa54cb6 100644 --- a/stepmania/src/ScreenGameplay.h +++ b/stepmania/src/ScreenGameplay.h @@ -53,7 +53,7 @@ public: PlayerNumber GetStepsAndTrailIndex() { return m_pn == PLAYER_INVALID ? PLAYER_1 : m_pn; } bool IsEnabled(); bool IsMultiPlayer() const { return m_mp != MultiPlayer_INVALID; } - CString GetName() const + RString GetName() const { if( m_bIsDummy ) return "Dummy"; @@ -117,7 +117,7 @@ public: Song *GetNextCourseSong() const; protected: - ThemeMetric PLAYER_TYPE; + ThemeMetric PLAYER_TYPE; LocalizedString GIVE_UP_TEXT; LocalizedString GIVE_UP_ABORTED_TEXT; ThemeMetric MUSIC_FADE_OUT_SECONDS; @@ -127,7 +127,7 @@ protected: ThemeMetric GIVING_UP_GOES_TO_NEXT_SCREEN; ThemeMetric FAIL_AFTER_30_MISSES; ThemeMetric USE_FORCED_MODIFIERS_IN_BEGINNER; - ThemeMetric FORCED_MODIFIERS_IN_BEGINNER; + ThemeMetric FORCED_MODIFIERS_IN_BEGINNER; void TweenOnScreen(); void TweenOffScreen(); @@ -140,7 +140,7 @@ protected: float StartPlayingSong(float MinTimeToNotes, float MinTimeToMusic); void LoadLights(); void PauseGame( bool bPause, GameController gc = GAME_CONTROLLER_INVALID ); - void PlayAnnouncer( CString type, float fSeconds ); + void PlayAnnouncer( RString type, float fSeconds ); void UpdateLights(); void SendCrossedMessages(); void BeginBackingOutFromGameplay(); diff --git a/stepmania/src/ScreenGameplayLesson.cpp b/stepmania/src/ScreenGameplayLesson.cpp index bacb8655db..11ff7eca39 100644 --- a/stepmania/src/ScreenGameplayLesson.cpp +++ b/stepmania/src/ScreenGameplayLesson.cpp @@ -29,11 +29,11 @@ void ScreenGameplayLesson::Init() // Load pages Song *pSong = GAMESTATE->m_pCurSong; - CString sDir = pSong->GetSongDir(); - vector vs; + RString sDir = pSong->GetSongDir(); + vector vs; GetDirListing( sDir+"Page*", vs, true, true ); m_vPages.resize( vs.size() ); - FOREACH( CString, vs, s ) + FOREACH( RString, vs, s ) { int i = s - vs.begin(); AutoActor &aa = m_vPages[i]; diff --git a/stepmania/src/ScreenHowToPlay.cpp b/stepmania/src/ScreenHowToPlay.cpp index af2534610e..38f8d4cd0e 100644 --- a/stepmania/src/ScreenHowToPlay.cpp +++ b/stepmania/src/ScreenHowToPlay.cpp @@ -20,7 +20,7 @@ #include "CharacterManager.h" #include "StatsManager.h" -static const ThemeMetric STEPFILE ("ScreenHowToPlay","Stepfile"); +static const ThemeMetric STEPFILE ("ScreenHowToPlay","Stepfile"); static const ThemeMetric NUM_W2S ("ScreenHowToPlay","NumW2s"); static const ThemeMetric NUM_MISSES ("ScreenHowToPlay","NumMisses"); static const ThemeMetric USELIFEBAR ("ScreenHowToPlay","UseLifeMeterBar"); @@ -40,7 +40,7 @@ enum Animation NUM_ANIMATIONS }; -static const CString anims[NUM_ANIMATIONS] = +static const RString anims[NUM_ANIMATIONS] = { "DancePad.txt", "DancePads.txt", @@ -52,9 +52,9 @@ static const CString anims[NUM_ANIMATIONS] = }; -static CString GetAnimPath( Animation a ) +static RString GetAnimPath( Animation a ) { - return CString("Characters/") + anims[a]; + return RString("Characters/") + anims[a]; } static bool HaveAllCharAnimations() @@ -98,7 +98,7 @@ void ScreenHowToPlay::Init() { Character* rndchar = CHARMAN->GetRandomCharacter(); - CString sModelPath = rndchar->GetModelPath(); + RString sModelPath = rndchar->GetModelPath(); if( sModelPath != "" ) { m_pmCharacter = new Model; @@ -109,7 +109,7 @@ void ScreenHowToPlay::Init() m_pmCharacter->LoadMilkshapeAsciiBones( "Step-UP", GetAnimPath( ANIM_UP ) ); m_pmCharacter->LoadMilkshapeAsciiBones( "Step-RIGHT", GetAnimPath( ANIM_RIGHT ) ); m_pmCharacter->LoadMilkshapeAsciiBones( "Step-JUMPLR", GetAnimPath( ANIM_JUMPLR ) ); - CString sRestFile = rndchar->GetRestAnimationPath(); + RString sRestFile = rndchar->GetRestAnimationPath(); ASSERT( !sRestFile.empty() ); m_pmCharacter->LoadMilkshapeAsciiBones( "rest",rndchar->GetRestAnimationPath() ); m_pmCharacter->SetDefaultAnimation( "rest" ); diff --git a/stepmania/src/ScreenJoinMultiplayer.h b/stepmania/src/ScreenJoinMultiplayer.h index 772ffa7fd5..c903bcb3ba 100644 --- a/stepmania/src/ScreenJoinMultiplayer.h +++ b/stepmania/src/ScreenJoinMultiplayer.h @@ -14,7 +14,7 @@ enum MultiPlayerStatus NUM_MultiPlayerStatus, MultiPlayerStatus_INVALID }; -const CString& MultiPlayerStatusToString( MultiPlayerStatus i ); +const RString& MultiPlayerStatusToString( MultiPlayerStatus i ); class ScreenJoinMultiplayer : public ScreenWithMenuElements diff --git a/stepmania/src/ScreenJukebox.cpp b/stepmania/src/ScreenJukebox.cpp index 0a15bd8986..54f73ded8a 100644 --- a/stepmania/src/ScreenJukebox.cpp +++ b/stepmania/src/ScreenJukebox.cpp @@ -126,7 +126,7 @@ void ScreenJukebox::SetSong() aAttacks.push_back( Attack::FromGlobalCourseModifier( pEntry->sModifiers ) ); FOREACH_CONST( Attack, aAttacks, a ) { - CString s = a->sModifiers; + RString s = a->sModifiers; s.MakeLower(); if( s.find("dark") != string::npos || s.find("stealth") != string::npos ) diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index ed9c4bdac7..bcc5a63bf1 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -81,7 +81,7 @@ ScreenManager* SCREENMAN = NULL; // global and accessable from anywhere in our p static Preference g_bConcurrentLoading( "ConcurrentLoading", false ); // Screen registration -static map *g_pmapRegistrees = NULL; +static map *g_pmapRegistrees = NULL; namespace { @@ -109,8 +109,8 @@ namespace Actor *g_pSharedBGA; // BGA object that's persistent between screens vector g_ScreenStack; // bottommost to topmost vector g_OverlayScreens; - set g_setGroupedScreens; - set g_setPersistantScreens; + set g_setGroupedScreens; + set g_setPersistantScreens; vector g_vPreparedScreens; vector g_vPreparedBackgrounds; @@ -133,7 +133,7 @@ namespace SCREENMAN->PostMessageToTopScreen( SM_GainFocus, 0 ); } - bool ScreenIsPrepped( const CString &sScreenName ) + bool ScreenIsPrepped( const RString &sScreenName ) { FOREACH( LoadedScreen, g_vPreparedScreens, s ) { @@ -145,7 +145,7 @@ namespace /* If the named screen is loaded, remove it from the prepared list and * return it in ls. */ - bool GetPreppedScreen( const CString &sScreenName, LoadedScreen &ls ) + bool GetPreppedScreen( const RString &sScreenName, LoadedScreen &ls ) { FOREACH( LoadedScreen, g_vPreparedScreens, s ) { @@ -210,12 +210,12 @@ namespace } }; -void RegisterScreenClass( const CString& sClassName, CreateScreenFn pfn ) +void RegisterScreenClass( const RString& sClassName, CreateScreenFn pfn ) { if( g_pmapRegistrees == NULL ) - g_pmapRegistrees = new map; + g_pmapRegistrees = new map; - map::iterator iter = g_pmapRegistrees->find( sClassName ); + map::iterator iter = g_pmapRegistrees->find( sClassName ); ASSERT_M( iter == g_pmapRegistrees->end(), ssprintf("Screen class '%s' already registered.", sClassName.c_str()) ); (*g_pmapRegistrees)[sClassName] = pfn; @@ -263,8 +263,8 @@ void ScreenManager::ThemeChanged() SAFE_DELETE( g_OverlayScreens[i] ); g_OverlayScreens.clear(); - CString sOverlays = THEME->GetMetric( "Common","OverlayScreens" ); - vector asOverlays; + RString sOverlays = THEME->GetMetric( "Common","OverlayScreens" ); + vector asOverlays; split( sOverlays, ",", asOverlays ); for( unsigned i=0; iTrace( "Loading screen name '%s'", sScreenName.c_str() ); - CString sClassName = THEME->GetMetric(sScreenName,"Class"); + RString sClassName = THEME->GetMetric(sScreenName,"Class"); - map::iterator iter = g_pmapRegistrees->find( sClassName ); + map::iterator iter = g_pmapRegistrees->find( sClassName ); ASSERT_M( iter != g_pmapRegistrees->end(), ssprintf("Screen '%s' has an invalid class '%s'",sScreenName.c_str(),sClassName.c_str()) ); this->ZeroNextUpdate(); @@ -496,7 +496,7 @@ Screen* ScreenManager::MakeNewScreen( const CString &sScreenName ) return ret; } -void ScreenManager::PrepareScreen( const CString &sScreenName ) +void ScreenManager::PrepareScreen( const RString &sScreenName ) { // If the screen is already prepared, stop. if( ScreenIsPrepped(sScreenName) ) @@ -514,7 +514,7 @@ void ScreenManager::PrepareScreen( const CString &sScreenName ) /* Don't delete previously prepared versions of the screen's background, * and only prepare it if it's different than the current background * and not already loaded. */ - CString sNewBGA; + RString sNewBGA; if( pNewScreen->UsesBackground() ) sNewBGA = THEME->GetPathB(sScreenName,"background"); @@ -544,17 +544,17 @@ void ScreenManager::PrepareScreen( const CString &sScreenName ) TEXTUREMAN->DiagnosticOutput(); } -void ScreenManager::GroupScreen( const CString &sScreenName ) +void ScreenManager::GroupScreen( const RString &sScreenName ) { g_setGroupedScreens.insert( sScreenName ); } -void ScreenManager::PersistantScreen( const CString &sScreenName ) +void ScreenManager::PersistantScreen( const RString &sScreenName ) { g_setPersistantScreens.insert( sScreenName ); } -bool ScreenManager::ConcurrentlyPrepareScreen( const CString &sScreenName, ScreenMessage SM ) +bool ScreenManager::ConcurrentlyPrepareScreen( const RString &sScreenName, ScreenMessage SM ) { ASSERT_M( m_sDelayedConcurrentPrepare == "", m_sDelayedConcurrentPrepare ); @@ -574,7 +574,7 @@ void ScreenManager::RunConcurrentlyPrepareScreen() /* Don't call BackgroundPrepareScreen() from within another background load. */ ASSERT( !IsConcurrentlyLoading() ); - CString sScreenName = m_sDelayedConcurrentPrepare; + RString sScreenName = m_sDelayedConcurrentPrepare; m_sDelayedConcurrentPrepare = ""; ScreenMessage SM = m_OnDonePreparingScreen; @@ -615,7 +615,7 @@ void ScreenManager::PushScreen( Screen *pNewScreen, bool bDeleteWhenDone, Screen PushLoadedScreen( ls ); } -void ScreenManager::SetNewScreen( const CString &sScreenName ) +void ScreenManager::SetNewScreen( const RString &sScreenName ) { ASSERT( sScreenName != "" ); m_sDelayedScreen = sScreenName; @@ -625,7 +625,7 @@ void ScreenManager::LoadDelayedScreen() { const bool bWasOnSystemMenu = !g_ScreenStack.empty() && g_ScreenStack.back().m_pScreen->GetScreenType() == system_menu; - CString sScreenName = m_sDelayedScreen; + RString sScreenName = m_sDelayedScreen; m_sDelayedScreen = ""; // Pop the top screen, if any. @@ -681,7 +681,7 @@ void ScreenManager::LoadDelayedScreen() } // Find the prepared shared background (if any), and activate it. - CString sNewBGA; + RString sNewBGA; if( ls.m_pScreen->UsesBackground() ) sNewBGA = THEME->GetPathB(sScreenName,"background"); if( sNewBGA != g_pSharedBGA->GetName() ) @@ -733,7 +733,7 @@ void ScreenManager::LoadDelayedScreen() SendMessageToTopScreen( SM ); } -void ScreenManager::AddNewScreenToTop( const CString &sScreenName, ScreenMessage SendOnPop ) +void ScreenManager::AddNewScreenToTop( const RString &sScreenName, ScreenMessage SendOnPop ) { // Load the screen, if it's not already prepared. PrepareScreen( sScreenName ); @@ -789,14 +789,14 @@ void ScreenManager::SendMessageToTopScreen( ScreenMessage SM ) } -void ScreenManager::SystemMessage( const CString &sMessage ) +void ScreenManager::SystemMessage( const RString &sMessage ) { m_sSystemMessage = sMessage; LOG->Trace( "%s", sMessage.c_str() ); MESSAGEMAN->Broadcast( "SystemMessage" ); } -void ScreenManager::SystemMessageNoAnimate( const CString &sMessage ) +void ScreenManager::SystemMessageNoAnimate( const RString &sMessage ) { // LOG->Trace( "%s", sMessage.c_str() ); // don't log because the caller is likely calling us every frame m_sSystemMessage = sMessage; @@ -814,7 +814,7 @@ void ScreenManager::RefreshCreditsMessages() MESSAGEMAN->Broadcast( "RefreshCreditText" ); /* This is called when GAMESTATE->m_bSideIsJoined changes. */ - CString joined; + RString joined; FOREACH_HumanPlayer( pn ) { if( joined != "" ) diff --git a/stepmania/src/ScreenManager.h b/stepmania/src/ScreenManager.h index 2e83ce27ab..418625b0f8 100644 --- a/stepmania/src/ScreenManager.h +++ b/stepmania/src/ScreenManager.h @@ -30,24 +30,24 @@ public: void Input( const InputEventPlus &input ); // Main screen stack management - void SetNewScreen( const CString &sName ); - void AddNewScreenToTop( const CString &sName, ScreenMessage SendOnPop=SM_None ); - void PrepareScreen( const CString &sScreenName ); // creates and caches screen so that the next call to SetNewScreen for the prep'd screen will be very quick. - void GroupScreen( const CString &sScreenName ); - void PersistantScreen( const CString &sScreenName ); - bool ConcurrentlyPrepareScreen( const CString &sScreenName, ScreenMessage send_when_done = SM_None ); + void SetNewScreen( const RString &sName ); + void AddNewScreenToTop( const RString &sName, ScreenMessage SendOnPop=SM_None ); + void PrepareScreen( const RString &sScreenName ); // creates and caches screen so that the next call to SetNewScreen for the prep'd screen will be very quick. + void GroupScreen( const RString &sScreenName ); + void PersistantScreen( const RString &sScreenName ); + bool ConcurrentlyPrepareScreen( const RString &sScreenName, ScreenMessage send_when_done = SM_None ); bool IsConcurrentlyLoading() const; void PushScreen( Screen *pNewScreen, bool bDeleteWhenDone=false, ScreenMessage SendOnPop=SM_None ); void PopTopScreen( ScreenMessage SM ); void PopAllScreens(); - Screen* MakeNewScreen( const CString &sName ); + Screen* MakeNewScreen( const RString &sName ); Screen *GetTopScreen(); // System messages - void SystemMessage( const CString &sMessage ); - void SystemMessageNoAnimate( const CString &sMessage ); + void SystemMessage( const RString &sMessage ); + void SystemMessageNoAnimate( const RString &sMessage ); void HideSystemMessage(); - CString GetCurrentSystemMessage() const { return m_sSystemMessage; } + RString GetCurrentSystemMessage() const { return m_sSystemMessage; } // Screen messages void PostMessageToTopScreen( ScreenMessage SM, float fDelay ); @@ -70,11 +70,11 @@ public: private: Screen *m_pInputFocus; // NULL = top of m_ScreenStack - CString m_sSystemMessage; + RString m_sSystemMessage; // Screen loads, removals, and concurrent prepares are delayed until the next update. - CString m_sDelayedScreen; - CString m_sDelayedConcurrentPrepare; + RString m_sDelayedScreen; + RString m_sDelayedConcurrentPrepare; ScreenMessage m_OnDonePreparingScreen; ScreenMessage m_PopTopScreen; diff --git a/stepmania/src/ScreenMapControllers.cpp b/stepmania/src/ScreenMapControllers.cpp index 25508faa7b..5b298bc47f 100644 --- a/stepmania/src/ScreenMapControllers.cpp +++ b/stepmania/src/ScreenMapControllers.cpp @@ -32,7 +32,7 @@ void ScreenMapControllers::Init() m_soundChange.Load( THEME->GetPathS(m_sName,"change"), true ); m_soundDelete.Load( THEME->GetPathS(m_sName,"delete"), true ); - CString sButtons = BUTTONS_TO_MAP; + RString sButtons = BUTTONS_TO_MAP; if( sButtons.empty() ) { /* Map all buttons for this game. */ @@ -46,7 +46,7 @@ void ScreenMapControllers::Init() else { /* Map the specified buttons. */ - vector asBits; + vector asBits; split( sButtons, ",", asBits ); for( unsigned i=0; iSetName( "Title" ); pName->LoadFromFont( THEME->GetPathF("Common","title") ); - CString sText = GameButtonToLocalizedString( GAMESTATE->GetCurrentGame(), pKey->m_GameButton ); + RString sText = GameButtonToLocalizedString( GAMESTATE->GetCurrentGame(), pKey->m_GameButton ); pName->SetText( sText ); ActorUtil::LoadAllCommands( *pName, m_sName ); m_Line[b].AddChild( pName ); @@ -408,7 +408,7 @@ void ScreenMapControllers::Refresh() BitmapText *pText = pKey->m_textMappedTo[p][s]; GameInput cur_gi( p, pKey->m_GameButton ); DeviceInput di; - CString sText = "-----------"; + RString sText = "-----------"; if( INPUTMAPPER->GameToDevice( cur_gi, s, di ) ) sText = INPUTMAN->GetDeviceSpecificInputString( di ); pText->SetText( sText ); diff --git a/stepmania/src/ScreenMessage.cpp b/stepmania/src/ScreenMessage.cpp index 27dc3967d1..6e2fc00fb8 100644 --- a/stepmania/src/ScreenMessage.cpp +++ b/stepmania/src/ScreenMessage.cpp @@ -4,12 +4,12 @@ ASMHClass AutoScreenMessageHandler; -ScreenMessage ASMHClass::ToMessageNumber( const CString &Name ) +ScreenMessage ASMHClass::ToMessageNumber( const RString &Name ) { //If uninitilized, initilize the map. We KNOW it will be NULL if ( m_pScreenMessages == NULL ) { - m_pScreenMessages = new map < CString, ScreenMessage >; + m_pScreenMessages = new map < RString, ScreenMessage >; m_iCurScreenMessage = SM_User; } @@ -25,7 +25,7 @@ ScreenMessage ASMHClass::ToMessageNumber( const CString &Name ) void ASMHClass::LogMessageNumbers( ) { - map < CString, ScreenMessage >::iterator iter; + map < RString, ScreenMessage >::iterator iter; //Log all ScreenMessages currently in the map @@ -34,9 +34,9 @@ void ASMHClass::LogMessageNumbers( ) LOG->Trace( "ScreenMessage: %3d: %s", iter->second, (*iter).first.c_str() ); } -CString ASMHClass::NumberToString( ScreenMessage SM ) +RString ASMHClass::NumberToString( ScreenMessage SM ) { - map < CString, ScreenMessage >::iterator iter; + map < RString, ScreenMessage >::iterator iter; //Log all ScreenMessages currently in the map @@ -45,7 +45,7 @@ CString ASMHClass::NumberToString( ScreenMessage SM ) if ( SM == iter->second ) return (*iter).first; - return CString(); + return RString(); } /* diff --git a/stepmania/src/ScreenMessage.h b/stepmania/src/ScreenMessage.h index 6871ed6754..8b7ce3f7db 100644 --- a/stepmania/src/ScreenMessage.h +++ b/stepmania/src/ScreenMessage.h @@ -50,11 +50,11 @@ enum ScreenMessage { class ASMHClass { public: - ScreenMessage ToMessageNumber( const CString & Name ); - CString NumberToString( ScreenMessage SM ); + ScreenMessage ToMessageNumber( const RString & Name ); + RString NumberToString( ScreenMessage SM ); void LogMessageNumbers(); private: - map < CString, ScreenMessage > *m_pScreenMessages; + map < RString, ScreenMessage > *m_pScreenMessages; ScreenMessage m_iCurScreenMessage; }; diff --git a/stepmania/src/ScreenMiniMenu.cpp b/stepmania/src/ScreenMiniMenu.cpp index 5149af822e..2e95fcb7b0 100644 --- a/stepmania/src/ScreenMiniMenu.cpp +++ b/stepmania/src/ScreenMiniMenu.cpp @@ -76,7 +76,7 @@ void ScreenMiniMenu::LoadMenu( const MenuDef* pDef ) pHand->m_Def.m_bAllowThemeItems = mr.bThemeItems; - FOREACH( CString, pHand->m_Def.m_vsChoices, c ) + FOREACH( RString, pHand->m_Def.m_vsChoices, c ) FontCharAliases::ReplaceMarkers( *c ); // Allow special characters vHands.push_back( pHand ); diff --git a/stepmania/src/ScreenMiniMenu.h b/stepmania/src/ScreenMiniMenu.h index 2f2e56ff64..256f173005 100644 --- a/stepmania/src/ScreenMiniMenu.h +++ b/stepmania/src/ScreenMiniMenu.h @@ -11,16 +11,16 @@ typedef bool (*MenuRowUpdateEnabled)(); struct MenuRowDef { int iRowCode; - CString sName; + RString sName; bool bEnabled; MenuRowUpdateEnabled pfnEnabled; // if ! NULL, used to fill bEnabled EditMode emShowIn; int iDefaultChoice; - vector choices; + vector choices; bool bThemeItems; MenuRowDef() {} - MenuRowDef( int r, CString n, MenuRowUpdateEnabled pe, EditMode s, bool b, int d, const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL ) + MenuRowDef( int r, RString n, MenuRowUpdateEnabled pe, EditMode s, bool b, int d, const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL ) { iRowCode = r; sName = n; @@ -33,7 +33,7 @@ struct MenuRowDef PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5);PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11);PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17);PUSH(c18);PUSH(c19); #undef PUSH } - MenuRowDef( int r, CString n, bool e, EditMode s, bool b, int d, const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL ) + MenuRowDef( int r, RString n, bool e, EditMode s, bool b, int d, const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL ) { iRowCode = r; sName = n; @@ -47,16 +47,16 @@ struct MenuRowDef #undef PUSH } - void SetOneUnthemedChoice( const CString &sChoice ) + void SetOneUnthemedChoice( const RString &sChoice ) { choices.resize(1); choices[0] = "|" + sChoice; } - bool SetDefaultChoiceIfPresent( CString sChoice ) + bool SetDefaultChoiceIfPresent( RString sChoice ) { iDefaultChoice = 0; - FOREACH_CONST( CString, choices, s ) + FOREACH_CONST( RString, choices, s ) { if( sChoice == *s ) { @@ -70,10 +70,10 @@ struct MenuRowDef struct MenuDef { - CString sClassName; + RString sClassName; vector rows; - MenuDef( CString c, MenuRowDef r0=MenuRowDef(), MenuRowDef r1=MenuRowDef(), MenuRowDef r2=MenuRowDef(), MenuRowDef r3=MenuRowDef(), MenuRowDef r4=MenuRowDef(), MenuRowDef r5=MenuRowDef(), MenuRowDef r6=MenuRowDef(), MenuRowDef r7=MenuRowDef(), MenuRowDef r8=MenuRowDef(), MenuRowDef r9=MenuRowDef(), MenuRowDef r10=MenuRowDef(), MenuRowDef r11=MenuRowDef(), MenuRowDef r12=MenuRowDef(), MenuRowDef r13=MenuRowDef(), MenuRowDef r14=MenuRowDef(), MenuRowDef r15=MenuRowDef(), MenuRowDef r16=MenuRowDef(), MenuRowDef r17=MenuRowDef(), MenuRowDef r18=MenuRowDef(), MenuRowDef r19=MenuRowDef(), MenuRowDef r20=MenuRowDef(), MenuRowDef r21=MenuRowDef(), MenuRowDef r22=MenuRowDef(), MenuRowDef r23=MenuRowDef(), MenuRowDef r24=MenuRowDef(), MenuRowDef r25=MenuRowDef(), MenuRowDef r26=MenuRowDef(), MenuRowDef r27=MenuRowDef(), MenuRowDef r28=MenuRowDef(), MenuRowDef r29=MenuRowDef() ) + MenuDef( RString c, MenuRowDef r0=MenuRowDef(), MenuRowDef r1=MenuRowDef(), MenuRowDef r2=MenuRowDef(), MenuRowDef r3=MenuRowDef(), MenuRowDef r4=MenuRowDef(), MenuRowDef r5=MenuRowDef(), MenuRowDef r6=MenuRowDef(), MenuRowDef r7=MenuRowDef(), MenuRowDef r8=MenuRowDef(), MenuRowDef r9=MenuRowDef(), MenuRowDef r10=MenuRowDef(), MenuRowDef r11=MenuRowDef(), MenuRowDef r12=MenuRowDef(), MenuRowDef r13=MenuRowDef(), MenuRowDef r14=MenuRowDef(), MenuRowDef r15=MenuRowDef(), MenuRowDef r16=MenuRowDef(), MenuRowDef r17=MenuRowDef(), MenuRowDef r18=MenuRowDef(), MenuRowDef r19=MenuRowDef(), MenuRowDef r20=MenuRowDef(), MenuRowDef r21=MenuRowDef(), MenuRowDef r22=MenuRowDef(), MenuRowDef r23=MenuRowDef(), MenuRowDef r24=MenuRowDef(), MenuRowDef r25=MenuRowDef(), MenuRowDef r26=MenuRowDef(), MenuRowDef r27=MenuRowDef(), MenuRowDef r28=MenuRowDef(), MenuRowDef r29=MenuRowDef() ) { sClassName = c; #define PUSH( r ) if(!r.sName.empty()) rows.push_back(r); diff --git a/stepmania/src/ScreenMusicScroll.cpp b/stepmania/src/ScreenMusicScroll.cpp index 08907c1792..f4f221583c 100644 --- a/stepmania/src/ScreenMusicScroll.cpp +++ b/stepmania/src/ScreenMusicScroll.cpp @@ -14,11 +14,11 @@ #define TEXT_ZOOM THEME->GetMetricF("ScreenMusicScroll","TextZoom") -const CString CREDIT_LINES[] = +const RString CREDIT_LINES[] = { "" }; -const unsigned NUM_CREDIT_LINES = sizeof(CREDIT_LINES) / sizeof(CString); +const unsigned NUM_CREDIT_LINES = sizeof(CREDIT_LINES) / sizeof(RString); REGISTER_SCREEN_CLASS( ScreenMusicScroll ); diff --git a/stepmania/src/ScreenNameEntry.cpp b/stepmania/src/ScreenNameEntry.cpp index 1e26698639..86f364a289 100644 --- a/stepmania/src/ScreenNameEntry.cpp +++ b/stepmania/src/ScreenNameEntry.cpp @@ -225,7 +225,7 @@ void ScreenNameEntry::Init() m_textCategory[p].SetX( fPlayerX ); m_textCategory[p].SetY( CATEGORY_Y ); m_textCategory[p].SetZoom( CATEGORY_ZOOM ); - CString joined; + RString joined; for( unsigned j = 0; j < aFeats[p].size(); ++j ) { if( j ) diff --git a/stepmania/src/ScreenNameEntry.h b/stepmania/src/ScreenNameEntry.h index e0baae0a12..81999e6cb8 100644 --- a/stepmania/src/ScreenNameEntry.h +++ b/stepmania/src/ScreenNameEntry.h @@ -40,7 +40,7 @@ private: RageSound m_soundStep; float m_fFakeBeat; - CString m_sSelectedName[NUM_PLAYERS]; + RString m_sSelectedName[NUM_PLAYERS]; bool m_bStillEnteringName[NUM_PLAYERS]; vector m_ColToStringIndex[NUM_PLAYERS]; diff --git a/stepmania/src/ScreenNameEntryTraditional.cpp b/stepmania/src/ScreenNameEntryTraditional.cpp index de684f22f1..08ad920596 100644 --- a/stepmania/src/ScreenNameEntryTraditional.cpp +++ b/stepmania/src/ScreenNameEntryTraditional.cpp @@ -107,7 +107,7 @@ void HighScoreWheel::Load( const HighScoreList& hsl, int iIndexToFocus ) if( m_iIndexToFocus >= 0 && m_iIndexToFocus < int(hsl.vHighScores.size()) ) m_Items[m_iIndexToFocus].ShowFocus(); - CString sTransformFunction = + RString sTransformFunction = "function(self,offset,itemIndex,numItems) " " local degrees=18*offset; " " local radians=degrees*math.pi/180; " @@ -230,7 +230,7 @@ void ScreenNameEntryTraditional::Init() this->AddChild( &m_Keyboard[p] ); /* Add letters to m_Keyboard. */ - const CString fontpath = THEME->GetPathF(m_sName,"letters"); + const RString fontpath = THEME->GetPathF(m_sName,"letters"); const wstring Chars = RStringToWstring(KEYBOARD_LETTERS); for( unsigned ch = 0; ch < Chars.size(); ++ch ) { @@ -250,7 +250,7 @@ void ScreenNameEntryTraditional::Init() BitmapText *Letter = new BitmapText; Letter->SetName( ssprintf("LetterP%i",p+1) ); Letter->LoadFromFont( fontpath ); - CString text = "←"; + RString text = "←"; FontCharAliases::ReplaceMarkers( text ); Letter->SetText( text ); m_textAlphabet[p].push_back( Letter ); @@ -265,7 +265,7 @@ void ScreenNameEntryTraditional::Init() BitmapText *Letter = new BitmapText; Letter->SetName( ssprintf("LetterP%i",p+1) ); Letter->LoadFromFont( fontpath ); - CString text = "&ok;"; + RString text = "&ok;"; FontCharAliases::ReplaceMarkers( text ); Letter->SetText( text ); m_textAlphabet[p].push_back( Letter ); @@ -369,7 +369,7 @@ void ScreenNameEntryTraditional::Init() SET_ON( display.m_Wheel ); this->AddChild( &display.m_Wheel ); - CString sBanner; + RString sBanner; if( GAMESTATE->IsCourseMode() ) sBanner = pCourse->m_sBannerPath; else @@ -576,7 +576,7 @@ void ScreenNameEntryTraditional::Finish( PlayerNumber pn ) UpdateSelectionText( pn ); /* hide NAME_ cursor */ - CString selection = WStringToRString( m_sSelection[pn] ); + RString selection = WStringToRString( m_sSelection[pn] ); // save last used ranking name Profile* pProfile = PROFILEMAN->GetProfile(pn); diff --git a/stepmania/src/ScreenNetRoom.cpp b/stepmania/src/ScreenNetRoom.cpp index 5b36e54ce1..123d4dc8cc 100644 --- a/stepmania/src/ScreenNetRoom.cpp +++ b/stepmania/src/ScreenNetRoom.cpp @@ -94,13 +94,13 @@ void ScreenNetRoom::HandleScreenMessage( const ScreenMessage SM ) { case 0: //Room title Change { - CString titleSub; + RString titleSub; titleSub = NSMAN->m_SMOnlinePacket.ReadNT() + "\n"; titleSub += NSMAN->m_SMOnlinePacket.ReadNT(); m_textTitle.SetText( titleSub ); if ( NSMAN->m_SMOnlinePacket.Read1() != 0 ) { - CString SMOnlineSelectScreen; + RString SMOnlineSelectScreen; THEME->GetMetric( m_sName, "MusicSelectScreen", SMOnlineSelectScreen ); SCREENMAN->SetNewScreen( SMOnlineSelectScreen ); } @@ -278,7 +278,7 @@ void ScreenNetRoom::UpdateRoomsList() m_RoomWheel.RebuildWheelItems(); } -void ScreenNetRoom::CreateNewRoom( const CString& rName, const CString& rDesc ) { +void ScreenNetRoom::CreateNewRoom( const RString& rName, const RString& rDesc ) { NSMAN->m_SMOnlinePacket.ClearPacket(); NSMAN->m_SMOnlinePacket.Write1((uint8_t)2); //Create room command NSMAN->m_SMOnlinePacket.Write1(1); //Type game room diff --git a/stepmania/src/ScreenNetRoom.h b/stepmania/src/ScreenNetRoom.h index 1006f74ae0..be56c6d1d4 100644 --- a/stepmania/src/ScreenNetRoom.h +++ b/stepmania/src/ScreenNetRoom.h @@ -10,15 +10,15 @@ class RoomData { public: - void SetName( const CString& name ) { m_name = name; } - void SetDescription( const CString& desc ) { m_description = desc; } + void SetName( const RString& name ) { m_name = name; } + void SetDescription( const RString& desc ) { m_description = desc; } void SetState(unsigned int state) { m_state = state; } - inline CString Name() { return m_name; } - inline CString Description() { return m_description; } + inline RString Name() { return m_name; } + inline RString Description() { return m_description; } inline unsigned int State() { return m_state; } private: - CString m_name; - CString m_description; + RString m_name; + RString m_description; unsigned int m_state; }; @@ -42,7 +42,7 @@ private: void UpdateRoomsList(); void MenuLeft( const InputEventPlus &input ); void MenuRight( const InputEventPlus &input ); - void CreateNewRoom( const CString& rName, const CString& rDesc ); + void CreateNewRoom( const RString& rName, const RString& rDesc ); RageSound m_soundChangeSel; @@ -53,7 +53,7 @@ private: vector < RoomData > m_Rooms; int m_iRoomPlace; - CString m_newRoomName, m_newRoomDesc; + RString m_newRoomName, m_newRoomDesc; RoomWheel m_RoomWheel; }; diff --git a/stepmania/src/ScreenNetSelectBase.cpp b/stepmania/src/ScreenNetSelectBase.cpp index 5168da0dec..5b0674d174 100644 --- a/stepmania/src/ScreenNetSelectBase.cpp +++ b/stepmania/src/ScreenNetSelectBase.cpp @@ -247,7 +247,7 @@ void ScreenNetSelectBase::UpdateUsers() } } -void UtilSetQuadInit( Actor& actor, const CString &sClassName ) +void UtilSetQuadInit( Actor& actor, const RString &sClassName ) { ActorUtil::SetXYAndOnCommand( actor, sClassName ); actor.RunCommands( THEME->GetMetricA( sClassName, actor.GetName() + "Command" ) ); diff --git a/stepmania/src/ScreenNetSelectBase.h b/stepmania/src/ScreenNetSelectBase.h index ced1179d3c..0022ea1aa2 100644 --- a/stepmania/src/ScreenNetSelectBase.h +++ b/stepmania/src/ScreenNetSelectBase.h @@ -25,8 +25,8 @@ private: ColorBitmapText m_textChatOutput; Sprite m_sprChatInputBox; Sprite m_sprChatOutputBox; - CString m_sTextInput; - CString m_actualText; + RString m_sTextInput; + RString m_actualText; //Users Rect Quad m_rectUsersBG; @@ -35,7 +35,7 @@ private: //Eventually we won't be using quads in this method. #define SET_QUAD_INIT( actor ) UtilSetQuadInit( actor, m_sName ); -void UtilSetQuadInit( Actor& actor, const CString &sClassName ); +void UtilSetQuadInit( Actor& actor, const RString &sClassName ); #endif diff --git a/stepmania/src/ScreenNetSelectMusic.cpp b/stepmania/src/ScreenNetSelectMusic.cpp index dec037d72e..0847dc4dc1 100644 --- a/stepmania/src/ScreenNetSelectMusic.cpp +++ b/stepmania/src/ScreenNetSelectMusic.cpp @@ -32,7 +32,7 @@ AutoScreenMessage( SM_SongChanged ) AutoScreenMessage( SM_UsersUpdate ) AutoScreenMessage( SM_BackFromPlayerOptions ) -const CString AllGroups = "[ALL MUSIC]"; +const RString AllGroups = "[ALL MUSIC]"; #define DIFFBG_WIDTH THEME->GetMetricF(m_sName,"DiffBGWidth") #define DIFFBG_HEIGHT THEME->GetMetricF(m_sName,"DiffBGHeight") @@ -287,12 +287,12 @@ void ScreenNetSelectMusic::HandleScreenMessage( const ScreenMessage SM ) { case 0: //Room title Change { - CString titleSub; + RString titleSub; titleSub = NSMAN->m_SMOnlinePacket.ReadNT() + "\n"; titleSub += NSMAN->m_SMOnlinePacket.ReadNT(); if ( NSMAN->m_SMOnlinePacket.Read1() != 1 ) { - CString SMOnlineSelectScreen; + RString SMOnlineSelectScreen; THEME->GetMetric( m_sName, "RoomSelectScreen", SMOnlineSelectScreen ); SCREENMAN->SetNewScreen( SMOnlineSelectScreen ); } diff --git a/stepmania/src/ScreenNetworkOptions.cpp b/stepmania/src/ScreenNetworkOptions.cpp index 4ea3c3daca..8b2f3c0592 100644 --- a/stepmania/src/ScreenNetworkOptions.cpp +++ b/stepmania/src/ScreenNetworkOptions.cpp @@ -36,7 +36,7 @@ enum AutoScreenMessage( SM_DoneConnecting ) AutoScreenMessage( SM_ServerNameEnter ) -Preference g_sLastServer( "LastConnectedServer", "" ); +Preference g_sLastServer( "LastConnectedServer", "" ); REGISTER_SCREEN_CLASS( ScreenNetworkOptions ); @@ -98,7 +98,7 @@ void ScreenNetworkOptions::HandleScreenMessage( const ScreenMessage SM ) { if( !ScreenTextEntry::s_bCancelledLast ) { - CString sNewName = ScreenTextEntry::s_sLastAnswer; + RString sNewName = ScreenTextEntry::s_sLastAnswer; NSMAN->PostStartUp(sNewName); NSMAN->DisplayStartupStatus(); UpdateConnectStatus( ); diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index d58e06a8b4..4b1a2f4e65 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -63,11 +63,11 @@ * in player options menus, but it should in the options menu. */ -static CString EXPLANATION_X_NAME( size_t p ) { return ssprintf("ExplanationP%dX",int(p+1)); } -static CString EXPLANATION_Y_NAME( size_t p ) { return ssprintf("ExplanationP%dY",int(p+1)); } -static CString EXPLANATION_ON_COMMAND_NAME( size_t p ) { return ssprintf("ExplanationP%dOnCommand",int(p+1)); } +static RString EXPLANATION_X_NAME( size_t p ) { return ssprintf("ExplanationP%dX",int(p+1)); } +static RString EXPLANATION_Y_NAME( size_t p ) { return ssprintf("ExplanationP%dY",int(p+1)); } +static RString EXPLANATION_ON_COMMAND_NAME( size_t p ) { return ssprintf("ExplanationP%dOnCommand",int(p+1)); } -static CString OPTION_EXPLANATION( CString s ) +static RString OPTION_EXPLANATION( RString s ) { return THEME->GetString("OptionExplanations",s); } @@ -353,16 +353,16 @@ ScreenOptions::~ScreenOptions() SAFE_DELETE( m_pRows[i] ); } -CString ScreenOptions::GetExplanationText( int iRow ) const +RString ScreenOptions::GetExplanationText( int iRow ) const { const OptionRow &row = *m_pRows[iRow]; bool bAllowExplanation = row.GetRowDef().m_bAllowExplanation; bool bShowExplanations = bAllowExplanation && SHOW_EXPLANATIONS.GetValue(); if( !bShowExplanations ) - return CString(); + return RString(); - CString sExplanationName = row.GetRowDef().m_sExplanationName; + RString sExplanationName = row.GetRowDef().m_sExplanationName; if( sExplanationName.empty() ) sExplanationName = row.GetRowDef().m_sName; ASSERT( !sExplanationName.empty() ); @@ -393,7 +393,7 @@ void ScreenOptions::RefreshIcons( int iRow, PlayerNumber pn ) int iFirstSelection = row.GetOneSelection( pn, true ); // set icon name and bullet - CString sIcon; + RString sIcon; GameCommand gc; if( iFirstSelection == -1 ) @@ -555,7 +555,7 @@ void ScreenOptions::HandleScreenMessage( const ScreenMessage SM ) return; /* already transitioning */ /* If the selected option sets a screen, honor it. */ - CString sThisScreen = GetNextScreenForSelection( GAMESTATE->m_MasterPlayerNumber ); + RString sThisScreen = GetNextScreenForSelection( GAMESTATE->m_MasterPlayerNumber ); if( sThisScreen != "" ) m_sNextScreen = sThisScreen; @@ -750,7 +750,7 @@ void ScreenOptions::AfterChangeValueOrRow( PlayerNumber pn ) } } - const CString text = GetExplanationText( iCurRow ); + const RString text = GetExplanationText( iCurRow ); BitmapText *pText = NULL; switch( m_InputMode ) @@ -841,7 +841,7 @@ void ScreenOptions::ProcessMenuStart( const InputEventPlus &input ) { /* In NAV_THREE_KEY_MENU mode, if a row doesn't set a screen, it does * something. Apply it now, and don't go to the next screen. */ - CString sScreen = GetNextScreenForSelection( input.MenuI.player ); + RString sScreen = GetNextScreenForSelection( input.MenuI.player ); if( sScreen.empty() ) { vector vpns; @@ -963,7 +963,7 @@ void ScreenOptions::StoreFocus( PlayerNumber pn ) m_iCurrentRow[pn], row.GetChoiceInRowWithFocus(pn), m_iFocusX[pn]); } -CString ScreenOptions::GetNextScreenForSelection( PlayerNumber pn ) const +RString ScreenOptions::GetNextScreenForSelection( PlayerNumber pn ) const { int iCurRow = this->GetCurrentRow( pn ); ASSERT( iCurRow >= 0 && iCurRow < (int)m_pRows.size() ); diff --git a/stepmania/src/ScreenOptions.h b/stepmania/src/ScreenOptions.h index 782d629a41..69f3efa169 100644 --- a/stepmania/src/ScreenOptions.h +++ b/stepmania/src/ScreenOptions.h @@ -23,7 +23,7 @@ enum InputMode NUM_InputMode, InputMode_Invalid }; -InputMode StringToInputMode( const CString& str ); +InputMode StringToInputMode( const RString& str ); #define FOREACH_OptionsPlayer( pn ) \ for( PlayerNumber pn=GetNextHumanPlayer((PlayerNumber)-1); pn!=PLAYER_INVALID && (m_InputMode==INPUTMODE_INDIVIDUAL || pn==0); pn=GetNextHumanPlayer(pn) ) @@ -48,7 +48,7 @@ protected: virtual void ExportOptions( int iRow, const vector &vpns ) = 0; void GetWidthXY( PlayerNumber pn, int iRow, int iChoiceOnRow, int &iWidthOut, int &iXOut, int &iYOut ) const; - CString GetExplanationText( int iRow ) const; + RString GetExplanationText( int iRow ) const; void PositionIcons(); void RefreshIcons( int iRow, PlayerNumber pn ); void RefreshAllIcons(); @@ -60,7 +60,7 @@ protected: void StoreFocus( PlayerNumber pn ); void BeginFadingOut(); - CString GetNextScreenForSelection( PlayerNumber pn ) const; + RString GetNextScreenForSelection( PlayerNumber pn ) const; void ChangeValueInRowRelative( int iRow, PlayerNumber pn, int iDelta, bool bRepeat ); void ChangeValueInRowAbsolute( int iRow, PlayerNumber pn, int iChoiceIndex, bool bRepeat ); diff --git a/stepmania/src/ScreenOptionsEditCourse.cpp b/stepmania/src/ScreenOptionsEditCourse.cpp index 55e15e76a5..1381450a7d 100644 --- a/stepmania/src/ScreenOptionsEditCourse.cpp +++ b/stepmania/src/ScreenOptionsEditCourse.cpp @@ -115,7 +115,7 @@ static bool AreEntriesFull() if( pCourse->m_vEntries.size() >= size_t(MAX_ENTRIES_PER_COURSE) ) { - CString sError = ssprintf(MAXIMUM_COURSE_ENTRIES.GetValue(), MAX_ENTRIES_PER_COURSE, pCourse->m_vEntries.size() ); + RString sError = ssprintf(MAXIMUM_COURSE_ENTRIES.GetValue(), MAX_ENTRIES_PER_COURSE, pCourse->m_vEntries.size() ); ScreenPrompt::Prompt( SM_None, sError ); return true; } diff --git a/stepmania/src/ScreenOptionsEditCourseEntry.cpp b/stepmania/src/ScreenOptionsEditCourseEntry.cpp index 89ed82a107..80672e0a42 100644 --- a/stepmania/src/ScreenOptionsEditCourseEntry.cpp +++ b/stepmania/src/ScreenOptionsEditCourseEntry.cpp @@ -25,7 +25,7 @@ enum EditCourseEntryRow }; #define FOREACH_EditCourseEntryRow( i ) FOREACH_ENUM( EditCourseEntryRow, NUM_EditCourseEntryRow, i ) -static void FillSongsAndChoices( const CString &sSongGroup, vector &vpSongsOut, vector &vsChoicesOut ) +static void FillSongsAndChoices( const RString &sSongGroup, vector &vpSongsOut, vector &vsChoicesOut ) { vpSongsOut.clear(); vsChoicesOut.clear(); @@ -51,7 +51,7 @@ class OptionRowHandlerSongChoices: public OptionRowHandler public: // corresponds with m_vsChoices: vector m_vpDisplayedSongs; - CString m_sSongGroup; + RString m_sSongGroup; OptionRowHandlerSongChoices() { Init(); } void Init() @@ -99,10 +99,10 @@ void ScreenOptionsEditCourseEntry::Init() pHand->m_Def.m_layoutType = LAYOUT_SHOW_ONE_IN_ROW; pHand->m_Def.m_bExportOnChange = true; pHand->m_Def.m_vsChoices.clear(); - vector vsSongGroups; + vector vsSongGroups; SONGMAN->GetSongGroupNames( vsSongGroups ); pHand->m_Def.m_vsChoices.push_back( "(any)" ); - FOREACH_CONST( CString, vsSongGroups, song ) + FOREACH_CONST( RString, vsSongGroups, song ) pHand->m_Def.m_vsChoices.push_back( *song ); vHands.push_back( pHand ); @@ -185,7 +185,7 @@ void ScreenOptionsEditCourseEntry::BeginScreen() m_pSongHandler->m_sSongGroup = ce.sSongGroup; - CString s = ssprintf( "%d mod changes", ce.GetNumModChanges() ); + RString s = ssprintf( "%d mod changes", ce.GetNumModChanges() ); m_pModChangesHandler->m_Def.m_vsChoices[0] = s; ScreenOptions::BeginScreen(); @@ -289,7 +289,7 @@ void ScreenOptionsEditCourseEntry::ImportOptions( int iRow, const vector= 0 ) sValue = row.GetRowDef().m_vsChoices[ iIndex ]; diff --git a/stepmania/src/ScreenOptionsManageCourses.cpp b/stepmania/src/ScreenOptionsManageCourses.cpp index 441ffcad18..236f6282b9 100644 --- a/stepmania/src/ScreenOptionsManageCourses.cpp +++ b/stepmania/src/ScreenOptionsManageCourses.cpp @@ -104,7 +104,7 @@ static MenuDef g_TempMenu( static LocalizedString EDIT_NAME_CONFLICTS ( "ScreenOptionsManageCourses", "The name you chose conflicts with another edit. Please use a different name." ); -static bool ValidateEditCourseName( const CString &sAnswer, CString &sErrorOut ) +static bool ValidateEditCourseName( const RString &sAnswer, RString &sErrorOut ) { if( sAnswer.empty() ) return false; @@ -256,7 +256,7 @@ void ScreenOptionsManageCourses::HandleScreenMessage( const ScreenMessage SM ) { ASSERT( ScreenTextEntry::s_sLastAnswer != "" ); // validate should have assured this - CString sNewName = ScreenTextEntry::s_sLastAnswer; + RString sNewName = ScreenTextEntry::s_sLastAnswer; // create Course *pCourse = new Course; @@ -349,15 +349,15 @@ void ScreenOptionsManageCourses::ProcessMenuStart( const InputEventPlus &input ) { if( SONGMAN->GetNumEditCourses(ProfileSlot_Machine) >= MAX_EDIT_COURSES_PER_PROFILE ) { - CString s = ssprintf( + RString s = ssprintf( YOU_HAVE_MAXIMUM_EDITS_ALLOWED.GetValue() + "\n\n" + YOU_MUST_DELETE.GetValue(), MAX_EDIT_COURSES_PER_PROFILE ); ScreenPrompt::Prompt( SM_None, s ); return; } - CString sDefaultName; - CString sThrowAway; + RString sDefaultName; + RString sThrowAway; for( int i=1; i<=9999; i++ ) { sDefaultName = ssprintf( "NewCourse%04d", i ); diff --git a/stepmania/src/ScreenOptionsManageEditSteps.cpp b/stepmania/src/ScreenOptionsManageEditSteps.cpp index 72df4da82d..e6acc30415 100644 --- a/stepmania/src/ScreenOptionsManageEditSteps.cpp +++ b/stepmania/src/ScreenOptionsManageEditSteps.cpp @@ -38,7 +38,7 @@ static MenuDef g_TempMenu( ); -static bool ValidateEditStepsDescription( const CString &sAnswer, CString &sErrorOut ) +static bool ValidateEditStepsDescription( const RString &sAnswer, RString &sErrorOut ) { if( sAnswer.empty() ) { @@ -100,7 +100,7 @@ void ScreenOptionsManageEditSteps::BeginScreen() def.m_bAllowThemeTitle = false; // not themable def.m_sExplanationName = "Edit Steps"; def.m_vsChoices.clear(); - CString sType = GAMEMAN->StepsTypeToLocalizedString( (*s)->m_StepsType ); + RString sType = GAMEMAN->StepsTypeToLocalizedString( (*s)->m_StepsType ); def.m_vsChoices.push_back( sType ); def.m_bAllowThemeItems = false; // already themed iIndex++; @@ -245,7 +245,7 @@ void ScreenOptionsManageEditSteps::ProcessMenuStart( const InputEventPlus &input SONGMAN->GetStepsLoadedFromProfile( v, ProfileSlot_Machine ); if( v.size() >= size_t(MAX_EDIT_STEPS_PER_PROFILE) ) { - CString s = ssprintf( YOU_HAVE_MAX_STEP_EDITS.GetValue()+"\n\n"+YOU_MUST_DELETE.GetValue(), MAX_EDIT_STEPS_PER_PROFILE ); + RString s = ssprintf( YOU_HAVE_MAX_STEP_EDITS.GetValue()+"\n\n"+YOU_MUST_DELETE.GetValue(), MAX_EDIT_STEPS_PER_PROFILE ); ScreenPrompt::Prompt( SM_None, s ); return; } diff --git a/stepmania/src/ScreenOptionsManageProfiles.cpp b/stepmania/src/ScreenOptionsManageProfiles.cpp index dd264a2ceb..7af0220206 100644 --- a/stepmania/src/ScreenOptionsManageProfiles.cpp +++ b/stepmania/src/ScreenOptionsManageProfiles.cpp @@ -50,7 +50,7 @@ static MenuDef g_TempMenu( static LocalizedString PROFILE_NAME_BLANK ( "ScreenEditMenu", "Profile name cannot be blank." ); static LocalizedString PROFILE_NAME_CONFLICTS ( "ScreenEditMenu", "The name you chose conflicts with another profile. Please use a different name." ); -static bool ValidateLocalProfileName( const CString &sAnswer, CString &sErrorOut ) +static bool ValidateLocalProfileName( const RString &sAnswer, RString &sErrorOut ) { if( sAnswer == "" ) { @@ -62,7 +62,7 @@ static bool ValidateLocalProfileName( const CString &sAnswer, CString &sErrorOut if( pProfile != NULL && sAnswer == pProfile->m_sDisplayName ) return true; // unchanged - vector vsProfileNames; + vector vsProfileNames; PROFILEMAN->GetLocalProfileDisplayNames( vsProfileNames ); bool bAlreadyAProfileWithThisName = find( vsProfileNames.begin(), vsProfileNames.end(), sAnswer ) != vsProfileNames.end(); if( bAlreadyAProfileWithThisName ) @@ -113,12 +113,12 @@ void ScreenOptionsManageProfiles::BeginScreen() PROFILEMAN->GetLocalProfileIDs( m_vsLocalProfileID ); - FOREACH_CONST( CString, m_vsLocalProfileID, s ) + FOREACH_CONST( RString, m_vsLocalProfileID, s ) { Profile *pProfile = PROFILEMAN->GetLocalProfile( *s ); ASSERT( pProfile ); - CString sCommand = ssprintf( "gamecommand;screen,ScreenOptionsEditProfile;profileid,%s;name,%s", s->c_str(), pProfile->m_sDisplayName.c_str() ); + RString sCommand = ssprintf( "gamecommand;screen,ScreenOptionsEditProfile;profileid,%s;name,%s", s->c_str(), pProfile->m_sDisplayName.c_str() ); OptionRowHandler *pHand = OptionRowHandlerUtil::Make( ParseCommands(sCommand) ); pHand->m_Def.m_layoutType = LAYOUT_SHOW_ALL_IN_ROW; pHand->m_Def.m_bAllowThemeTitle = false; @@ -137,7 +137,7 @@ void ScreenOptionsManageProfiles::BeginScreen() // select the last chosen profile if( !GAMESTATE->m_sEditLocalProfileID.Get().empty() ) { - vector::const_iterator iter = find( m_vsLocalProfileID.begin(), m_vsLocalProfileID.end(), GAMESTATE->m_sEditLocalProfileID.Get() ); + vector::const_iterator iter = find( m_vsLocalProfileID.begin(), m_vsLocalProfileID.end(), GAMESTATE->m_sEditLocalProfileID.Get() ); if( iter != m_vsLocalProfileID.end() ) { int iIndex = iter - m_vsLocalProfileID.begin(); @@ -174,11 +174,11 @@ void ScreenOptionsManageProfiles::HandleScreenMessage( const ScreenMessage SM ) { ASSERT( ScreenTextEntry::s_sLastAnswer != "" ); // validate should have assured this - CString sNewName = ScreenTextEntry::s_sLastAnswer; + RString sNewName = ScreenTextEntry::s_sLastAnswer; ASSERT( GAMESTATE->m_sEditLocalProfileID.Get().empty() ); // create - CString sProfileID; + RString sProfileID; PROFILEMAN->CreateLocalProfile( ScreenTextEntry::s_sLastAnswer, sProfileID ); GAMESTATE->m_sEditLocalProfileID.Set( sProfileID ); @@ -191,7 +191,7 @@ void ScreenOptionsManageProfiles::HandleScreenMessage( const ScreenMessage SM ) { ASSERT( ScreenTextEntry::s_sLastAnswer != "" ); // validate should have assured this - CString sNewName = ScreenTextEntry::s_sLastAnswer; + RString sNewName = ScreenTextEntry::s_sLastAnswer; PROFILEMAN->RenameLocalProfile( GAMESTATE->m_sEditLocalProfileID, sNewName ); SCREENMAN->SetNewScreen( this->m_sName ); // reload @@ -203,7 +203,7 @@ void ScreenOptionsManageProfiles::HandleScreenMessage( const ScreenMessage SM ) { // Select the profile nearest to the one that was just deleted. int iIndex = -1; - vector::const_iterator iter = find( m_vsLocalProfileID.begin(), m_vsLocalProfileID.end(), GAMESTATE->m_sEditLocalProfileID.Get() ); + vector::const_iterator iter = find( m_vsLocalProfileID.begin(), m_vsLocalProfileID.end(), GAMESTATE->m_sEditLocalProfileID.Get() ); if( iter != m_vsLocalProfileID.end() ) iIndex = iter - m_vsLocalProfileID.begin(); CLAMP( iIndex, 0, m_vsLocalProfileID.size()-1 ); @@ -269,15 +269,15 @@ void ScreenOptionsManageProfiles::HandleScreenMessage( const ScreenMessage SM ) break; case ProfileAction_Delete: { - CString sTitle = pProfile->m_sDisplayName; - CString sMessage = ssprintf( CONFIRM_DELETE_PROFILE.GetValue(), sTitle.c_str() ); + RString sTitle = pProfile->m_sDisplayName; + RString sMessage = ssprintf( CONFIRM_DELETE_PROFILE.GetValue(), sTitle.c_str() ); ScreenPrompt::Prompt( SM_BackFromDeleteConfirm, sMessage, PROMPT_YES_NO ); } break; case ProfileAction_Clear: { - CString sTitle = pProfile->m_sDisplayName; - CString sMessage = ssprintf( CONFIRM_CLEAR_PROFILE.GetValue(), sTitle.c_str() ); + RString sTitle = pProfile->m_sDisplayName; + RString sMessage = ssprintf( CONFIRM_CLEAR_PROFILE.GetValue(), sTitle.c_str() ); ScreenPrompt::Prompt( SM_BackFromClearConfirm, sMessage, PROMPT_YES_NO ); } break; @@ -302,10 +302,10 @@ void ScreenOptionsManageProfiles::ProcessMenuStart( const InputEventPlus &input if( SHOW_CREATE_NEW && iCurRow == 0 ) // "create new" { - vector vsUsedNames; + vector vsUsedNames; PROFILEMAN->GetLocalProfileDisplayNames( vsUsedNames ); - CString sPotentialName; + RString sPotentialName; for( int i=1; i<1000; i++ ) { sPotentialName = ssprintf( "%s%04d", NEW_PROFILE_DEFAULT_NAME.GetValue().c_str(), i ); @@ -381,7 +381,7 @@ int ScreenOptionsManageProfiles::GetLocalProfileIndexWithFocus() const return iIndex; } -CString ScreenOptionsManageProfiles::GetLocalProfileIDWithFocus() const +RString ScreenOptionsManageProfiles::GetLocalProfileIDWithFocus() const { int iIndex = GetLocalProfileIndexWithFocus(); if( iIndex == -1 ) diff --git a/stepmania/src/ScreenOptionsManageProfiles.h b/stepmania/src/ScreenOptionsManageProfiles.h index 7d138ef661..22486792c0 100644 --- a/stepmania/src/ScreenOptionsManageProfiles.h +++ b/stepmania/src/ScreenOptionsManageProfiles.h @@ -24,9 +24,9 @@ protected: virtual void ProcessMenuStart( const InputEventPlus &input ); int GetLocalProfileIndexWithFocus() const; - CString GetLocalProfileIDWithFocus() const; + RString GetLocalProfileIDWithFocus() const; - vector m_vsLocalProfileID; + vector m_vsLocalProfileID; ScreenMiniMenu *m_pContextMenu; }; diff --git a/stepmania/src/ScreenOptionsMaster.cpp b/stepmania/src/ScreenOptionsMaster.cpp index 105dd42e63..68d8dbbaad 100644 --- a/stepmania/src/ScreenOptionsMaster.cpp +++ b/stepmania/src/ScreenOptionsMaster.cpp @@ -27,7 +27,7 @@ REGISTER_SCREEN_CLASS( ScreenOptionsMaster ); void ScreenOptionsMaster::Init() { - vector asLineNames; + vector asLineNames; split( LINE_NAMES, ",", asLineNames ); if( asLineNames.empty() ) RageException::Throw( "%s::LineNames is empty.", m_sName.c_str() ); @@ -52,8 +52,8 @@ void ScreenOptionsMaster::Init() vector OptionRowHandlers; for( unsigned i = 0; i < asLineNames.size(); ++i ) { - CString sLineName = asLineNames[i]; - CString sRowCommands = LINE(sLineName); + RString sLineName = asLineNames[i]; + RString sRowCommands = LINE(sLineName); Commands cmds; ParseCommands( sRowCommands, cmds ); diff --git a/stepmania/src/ScreenOptionsMasterPrefs.cpp b/stepmania/src/ScreenOptionsMasterPrefs.cpp index 2af3ad667a..9bb33da6b9 100644 --- a/stepmania/src/ScreenOptionsMasterPrefs.cpp +++ b/stepmania/src/ScreenOptionsMasterPrefs.cpp @@ -25,7 +25,7 @@ static void GetPrefsDefaultModifiers( PlayerOptions &po, SongOptions &so ) static void SetPrefsDefaultModifiers( const PlayerOptions &po, const SongOptions &so ) { - vector as; + vector as; if( po.GetString() != "" ) as.push_back( po.GetString() ); if( so.GetString() != "" ) @@ -81,14 +81,14 @@ static void MoveMap( int &sel, IPreference &opt, bool ToSel, const T *mapping, u { if( ToSel ) { - CString sOpt = opt.ToString(); + RString sOpt = opt.ToString(); /* This should really be T, but we can't FromString an enum. */ float val; FromString( sOpt, val ); sel = FindClosestEntry( val, mapping, cnt ); } else { /* sel -> opt */ - CString sOpt = ToString( mapping[sel] ); + RString sOpt = ToString( mapping[sel] ); opt.FromString( sOpt ); } } @@ -110,35 +110,35 @@ static void MovePref( int &iSel, bool bToSel, const ConfOption *pConfOption ) if( bToSel ) { - CString sOpt = pPref->ToString(); + RString sOpt = pPref->ToString(); FromString( sOpt, iSel ); } else { - CString sOpt = ToString( iSel ); + RString sOpt = ToString( iSel ); pPref->FromString( sOpt ); } } -static void GameChoices( vector &out ) +static void GameChoices( vector &out ) { vector aGames; GAMEMAN->GetEnabledGames( aGames ); FOREACH( const Game*, aGames, g ) { - CString sGameName = (*g)->m_szName; + RString sGameName = (*g)->m_szName; out.push_back( sGameName ); } } static void GameSel( int &sel, bool ToSel, const ConfOption *pConfOption ) { - vector choices; + vector choices; pConfOption->MakeOptionsList( choices ); if( ToSel ) { - const CString sCurGameName = GAMESTATE->m_pCurGame->m_szName; + const RString sCurGameName = GAMESTATE->m_pCurGame->m_szName; sel = 0; for(unsigned i = 0; i < choices.size(); ++i) @@ -151,14 +151,14 @@ static void GameSel( int &sel, bool ToSel, const ConfOption *pConfOption ) } } -static void LanguageChoices( vector &out ) +static void LanguageChoices( vector &out ) { THEME->GetLanguages( out ); } static void Language( int &sel, bool ToSel, const ConfOption *pConfOption ) { - vector choices; + vector choices; pConfOption->MakeOptionsList( choices ); if( ToSel ) @@ -168,33 +168,33 @@ static void Language( int &sel, bool ToSel, const ConfOption *pConfOption ) if( !stricmp(choices[i], THEME->GetCurLanguage()) ) sel = i; } else { - const CString sNewLanguage = choices[sel]; + const RString sNewLanguage = choices[sel]; if( THEME->GetCurLanguage() != sNewLanguage ) THEME->SwitchThemeAndLanguage( THEME->GetCurThemeName(), sNewLanguage, PREFSMAN->m_bPseudoLocalize ); } } -static void ThemeChoices( vector &out ) +static void ThemeChoices( vector &out ) { THEME->GetThemeNames( out ); } -static void DisplayResolutionChoices( vector &out ) +static void DisplayResolutionChoices( vector &out ) { DisplayResolutions d; DISPLAY->GetDisplayResolutions( d ); FOREACHS_CONST( DisplayResolution, d.s, iter ) { - CString s = ssprintf("%dx%d", iter->iWidth, iter->iHeight); + RString s = ssprintf("%dx%d", iter->iWidth, iter->iHeight); out.push_back( s ); } } static void Theme( int &sel, bool ToSel, const ConfOption *pConfOption ) { - vector choices; + vector choices; pConfOption->MakeOptionsList( choices ); if( ToSel ) @@ -204,14 +204,14 @@ static void Theme( int &sel, bool ToSel, const ConfOption *pConfOption ) if( !stricmp(choices[i], THEME->GetCurThemeName()) ) sel = i; } else { - const CString sNewTheme = choices[sel]; + const RString sNewTheme = choices[sel]; if( THEME->GetCurThemeName() != sNewTheme ) THEME->SwitchThemeAndLanguage( sNewTheme, THEME->GetCurLanguage(), PREFSMAN->m_bPseudoLocalize ); } } static LocalizedString OFF ("ScreenOptionsMasterPrefs","Off"); -static void AnnouncerChoices( vector &out ) +static void AnnouncerChoices( vector &out ) { ANNOUNCER->GetAnnouncerNames( out ); out.insert( out.begin(), OFF ); @@ -219,7 +219,7 @@ static void AnnouncerChoices( vector &out ) static void Announcer( int &sel, bool ToSel, const ConfOption *pConfOption ) { - vector choices; + vector choices; pConfOption->MakeOptionsList( choices ); if( ToSel ) @@ -229,19 +229,19 @@ static void Announcer( int &sel, bool ToSel, const ConfOption *pConfOption ) if( !stricmp(choices[i], ANNOUNCER->GetCurAnnouncerName()) ) sel = i; } else { - const CString sNewAnnouncer = sel? choices[sel]:CString(""); + const RString sNewAnnouncer = sel? choices[sel]:RString(""); ANNOUNCER->SwitchAnnouncer( sNewAnnouncer ); } } -static void DefaultNoteSkinChoices( vector &out ) +static void DefaultNoteSkinChoices( vector &out ) { NOTESKIN->GetNoteSkinNames( out ); } static void DefaultNoteSkin( int &sel, bool ToSel, const ConfOption *pConfOption ) { - vector choices; + vector choices; pConfOption->MakeOptionsList( choices ); if( ToSel ) @@ -645,13 +645,13 @@ int ConfOption::GetEffects() const return m_iEffects | OPT_SAVE_PREFERENCES; } -ConfOption *ConfOption::Find( CString name ) +ConfOption *ConfOption::Find( RString name ) { InitializeConfOptions(); for( unsigned i = 0; i < g_ConfOptions.size(); ++i ) { ConfOption *opt = &g_ConfOptions[i]; - CString match(opt->name); + RString match(opt->name); if( match.CompareNoCase(name) ) continue; return opt; @@ -669,7 +669,7 @@ void ConfOption::UpdateAvailableOptions() } } -void ConfOption::MakeOptionsList( vector &out ) const +void ConfOption::MakeOptionsList( vector &out ) const { out = names; } diff --git a/stepmania/src/ScreenOptionsMasterPrefs.h b/stepmania/src/ScreenOptionsMasterPrefs.h index 9de3fec01b..592a9dd99f 100644 --- a/stepmania/src/ScreenOptionsMasterPrefs.h +++ b/stepmania/src/ScreenOptionsMasterPrefs.h @@ -12,11 +12,11 @@ static const int MAX_OPTIONS=16; struct ConfOption { - static ConfOption *Find( CString name ); + static ConfOption *Find( RString name ); /* Name of this option. It's helpful to delimit this with newlines, as it'll * be the default display title. */ - CString name; + RString name; typedef void (*MoveData_t)( int &sel, bool ToSel, const ConfOption *pConfOption ); MoveData_t MoveData; int m_iEffects; @@ -28,7 +28,7 @@ struct ConfOption /* Return the list of available selections; Get() and Put() use indexes into this * array. UpdateAvailableOptions() should be called before using this. */ - void MakeOptionsList( vector &out ) const; + void MakeOptionsList( vector &out ) const; inline int Get() const { int sel; MoveData( sel, true, this ); return sel; } inline void Put( int sel ) const { MoveData( sel, false, this ); } @@ -45,11 +45,11 @@ struct ConfOption #define PUSH( c ) if(c) names.push_back(c); PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5);PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11);PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17);PUSH(c18);PUSH(c19); } - void AddOption( const CString &sName ) { PUSH(sName); } + void AddOption( const RString &sName ) { PUSH(sName); } #undef PUSH ConfOption( const char *n, MoveData_t m, - void (*lst)( vector &out ) ) + void (*lst)( vector &out ) ) { name = n; MoveData = m; @@ -60,8 +60,8 @@ struct ConfOption // private: - vector names; - void (*MakeOptionsListCB)( vector &out ); + vector names; + void (*MakeOptionsListCB)( vector &out ); }; #endif diff --git a/stepmania/src/ScreenOptionsMemoryCard.cpp b/stepmania/src/ScreenOptionsMemoryCard.cpp index d8d660b87c..36f64b5419 100644 --- a/stepmania/src/ScreenOptionsMemoryCard.cpp +++ b/stepmania/src/ScreenOptionsMemoryCard.cpp @@ -22,7 +22,7 @@ void ScreenOptionsMemoryCard::Init() { // TODO: Make these string themable - vector vs; + vector vs; if( iter->sOsMountDir.empty() ) vs.push_back( "(no mount dir)" ); else @@ -39,7 +39,7 @@ void ScreenOptionsMemoryCard::Init() vHands.push_back( OptionRowHandlerUtil::MakeNull() ); OptionRowDefinition &def = vHands.back()->m_Def; - CString sDescription = join(", ", vs); + RString sDescription = join(", ", vs); def.m_sName = sDescription; def.m_vsChoices.push_back( "" ); def.m_sExplanationName = "Memory Card"; @@ -81,7 +81,7 @@ void ScreenOptionsMemoryCard::HandleScreenMessage( const ScreenMessage SM ) ScreenOptions::HandleScreenMessage( SM ); } -void ScreenOptionsMemoryCard::HandleMessage( const CString& sMessage ) +void ScreenOptionsMemoryCard::HandleMessage( const RString& sMessage ) { if( sMessage == MessageToString(Message_StorageDevicesChanged) ) { @@ -131,7 +131,7 @@ void ScreenOptionsMemoryCard::ProcessMenuStart( const InputEventPlus &input ) } else { - CString s = ssprintf(ERROR_MOUNTING_CARD.GetValue(), MEMCARDMAN->GetCardError(PLAYER_1).c_str() ); + RString s = ssprintf(ERROR_MOUNTING_CARD.GetValue(), MEMCARDMAN->GetCardError(PLAYER_1).c_str() ); ScreenPrompt::Prompt( SM_None, s ); } } diff --git a/stepmania/src/ScreenOptionsMemoryCard.h b/stepmania/src/ScreenOptionsMemoryCard.h index 6a315088ae..8e90de199a 100644 --- a/stepmania/src/ScreenOptionsMemoryCard.h +++ b/stepmania/src/ScreenOptionsMemoryCard.h @@ -15,7 +15,7 @@ private: void ImportOptions( int iRow, const vector &vpns ); void ExportOptions( int iRow, const vector &vpns ); - void HandleMessage( const CString& sMessage ); + void HandleMessage( const RString& sMessage ); void ProcessMenuStart( const InputEventPlus &input ); }; diff --git a/stepmania/src/ScreenPackages.cpp b/stepmania/src/ScreenPackages.cpp index 4726b57465..99cf2e5dd9 100644 --- a/stepmania/src/ScreenPackages.cpp +++ b/stepmania/src/ScreenPackages.cpp @@ -292,7 +292,7 @@ void ScreenPackages::RefreshPackages() void ScreenPackages::UpdatePackagesList() { - CString TempText=""; + RString TempText=""; int min = m_iPackagesPos-NUM_PACKAGES_SHOW; int max = m_iPackagesPos+NUM_PACKAGES_SHOW; for (int i=min; i= m_LinkTitles.size() ) m_iLinksPos = m_LinkTitles.size() - 1; int min = m_iLinksPos-NUM_LINKS_SHOW; @@ -365,11 +365,11 @@ void ScreenPackages::HTMLParse() if ( j < l ) k = j; - CString TempLink = StripOutContainers( m_sBUFFER.substr(m+1,k-m-1) ); + RString TempLink = StripOutContainers( m_sBUFFER.substr(m+1,k-m-1) ); if ( TempLink.substr(0,7).compare("http://") != 0 ) TempLink = m_sBaseAddress + TempLink; - CString TempTitle = m_sBUFFER.substr( k+1, l-k-1 ); + RString TempTitle = m_sBUFFER.substr( k+1, l-k-1 ); m_Links.push_back( TempLink ); m_LinkTitles.push_back( TempTitle ); @@ -385,10 +385,10 @@ void ScreenPackages::HTMLParse() UpdateLinksList(); } -CString ScreenPackages::URLEncode( const CString &URL ) +RString ScreenPackages::URLEncode( const RString &URL ) { - CString Input = StripOutContainers( URL ); - CString Output; + RString Input = StripOutContainers( URL ); + RString Output; for( unsigned k = 0; k < Input.size(); k++ ) { @@ -403,10 +403,10 @@ CString ScreenPackages::URLEncode( const CString &URL ) return Output; } -CString ScreenPackages::StripOutContainers( const CString & In ) +RString ScreenPackages::StripOutContainers( const RString & In ) { if( In.size() == 0 ) - return CString(); + return RString(); unsigned i = 0; char t = In.at(i); @@ -460,12 +460,12 @@ void ScreenPackages::CancelDownload( ) if( !FILEMAN->Remove( "Packages/" + m_sEndName ) ) SCREENMAN->SystemMessage( "Packages/" + m_sEndName ); } -void ScreenPackages::EnterURL( const CString & sURL ) +void ScreenPackages::EnterURL( const RString & sURL ) { - CString Proto; - CString Server; + RString Proto; + RString Server; int Port=80; - CString sAddress; + RString sAddress; if( !ParseHTTPAddress( sURL, Proto, Server, Port, sAddress ) ) { @@ -505,7 +505,7 @@ void ScreenPackages::EnterURL( const CString & sURL ) //if we are not talking about a file, let's not worry if( m_sEndName != "" && m_bIsPackage ) { - vector AddTo; + vector AddTo; GetDirListing( "Packages/"+m_sEndName, AddTo, false, false ); if ( AddTo.size() > 0 ) { @@ -542,7 +542,7 @@ void ScreenPackages::EnterURL( const CString & sURL ) //Produce HTTP header - CString Header=""; + RString Header=""; Header = "GET "+sAddress+" HTTP/1.0\r\n"; Header+= "Host: " + Server + "\r\n"; @@ -558,7 +558,7 @@ void ScreenPackages::EnterURL( const CString & sURL ) return; } -static size_t FindEndOfHeaders( const CString &buf ) +static size_t FindEndOfHeaders( const RString &buf ) { size_t iPos1 = buf.find( "\n\n" ); size_t iPos2 = buf.find( "\r\n\r\n" ); @@ -667,7 +667,7 @@ void ScreenPackages::HTTPUpdate() } } -bool ScreenPackages::ParseHTTPAddress( const CString &URL, CString &sProto, CString &sServer, int &iPort, CString &sAddress ) +bool ScreenPackages::ParseHTTPAddress( const RString &URL, RString &sProto, RString &sServer, int &iPort, RString &sAddress ) { // [PROTO://]SERVER[:PORT][/URL] @@ -676,7 +676,7 @@ bool ScreenPackages::ParseHTTPAddress( const CString &URL, CString &sProto, CStr "([^/:]+)" // [1]: a.b.com "(:([0-9]+))?" // [2], [3]: :1234 (optional, default 80) "(/(.*))?$"); // [4], [5]: /foo.html (optional) - vector asMatches; + vector asMatches; if( !re.Compare( URL, asMatches ) ) return false; ASSERT( asMatches.size() == 6 ); diff --git a/stepmania/src/ScreenPackages.h b/stepmania/src/ScreenPackages.h index d0290faa95..fae5301718 100644 --- a/stepmania/src/ScreenPackages.h +++ b/stepmania/src/ScreenPackages.h @@ -33,8 +33,8 @@ private: void HTMLParse(); - CString URLEncode( const CString &URL ); //Encode any string in URL-style - CString StripOutContainers( const CString & In ); //Strip off "'s and ''s + RString URLEncode( const RString &URL ); //Encode any string in URL-style + RString StripOutContainers( const RString & In ); //Strip off "'s and ''s Sprite m_sprExistingBG; Sprite m_sprWebBG; @@ -44,10 +44,10 @@ private: BitmapText m_textPackages; BitmapText m_textWeb; - vector m_Packages; + vector m_Packages; - vector m_Links; - vector m_LinkTitles; + vector m_Links; + vector m_LinkTitles; BitmapText m_textURL; int m_iPackagesPos; @@ -58,11 +58,11 @@ private: //HTTP portion void CancelDownload( ); - void EnterURL( const CString & sURL ); + void EnterURL( const RString & sURL ); void HTTPUpdate( ); //True if proper string, false if improper - bool ParseHTTPAddress( const CString & URL, CString & Proto, CString & Server, int & Port, CString & Addy ); + bool ParseHTTPAddress( const RString & URL, RString & Proto, RString & Server, int & Port, RString & Addy ); Sprite m_sprDL; Sprite m_sprDLBG; @@ -72,7 +72,7 @@ private: float m_fLastUpdate; long m_bytesLastUpdate; - CString m_sStatus; + RString m_sStatus; BitmapText m_textStatus; EzSockets m_wSocket; @@ -80,19 +80,19 @@ private: bool m_bGotHeader; RageFile m_fOutputFile; - CString m_sEndName; + RString m_sEndName; bool m_bIsPackage; - CString m_sBaseAddress; + RString m_sBaseAddress; //HTTP Header information responce long m_iTotalBytes; long m_iDownloaded; long m_iResponseCode; - CString m_sResponseName; + RString m_sResponseName; //Raw HTTP Buffer - CString m_sBUFFER; + RString m_sBUFFER; }; #endif diff --git a/stepmania/src/ScreenPlayerOptions.cpp b/stepmania/src/ScreenPlayerOptions.cpp index e39c9bda19..1e4500cbfa 100644 --- a/stepmania/src/ScreenPlayerOptions.cpp +++ b/stepmania/src/ScreenPlayerOptions.cpp @@ -56,7 +56,7 @@ void ScreenPlayerOptions::Init() m_bAcceptedChoices = false; m_bGoToOptions = ( PREFSMAN->m_ShowSongOptions == PrefsManager::YES ); - CString sPath = THEME->GetPathS( m_sName,"cancel all", true ); + RString sPath = THEME->GetPathS( m_sName,"cancel all", true ); if( sPath != "" ) m_CancelAll.Load( sPath, true ); diff --git a/stepmania/src/ScreenPrompt.cpp b/stepmania/src/ScreenPrompt.cpp index 20b06f46fd..30214b0ae4 100644 --- a/stepmania/src/ScreenPrompt.cpp +++ b/stepmania/src/ScreenPrompt.cpp @@ -18,7 +18,7 @@ bool ScreenPrompt::s_bCancelledLast = false; /* Settings: */ namespace { - CString g_sText; + RString g_sText; PromptType g_PromptType; PromptAnswer g_defaultAnswer; void(*g_pOnYes)(void*); @@ -26,7 +26,7 @@ namespace void *g_pCallbackData; }; -void ScreenPrompt::SetPromptSettings( const CString &sText, PromptType type, PromptAnswer defaultAnswer, void(*OnYes)(void*), void(*OnNo)(void*), void* pCallbackData ) +void ScreenPrompt::SetPromptSettings( const RString &sText, PromptType type, PromptAnswer defaultAnswer, void(*OnYes)(void*), void(*OnNo)(void*), void* pCallbackData ) { g_sText = sText; g_PromptType = type; @@ -36,7 +36,7 @@ void ScreenPrompt::SetPromptSettings( const CString &sText, PromptType type, Pro g_pCallbackData = pCallbackData; } -void ScreenPrompt::Prompt( ScreenMessage smSendOnPop, const CString &sText, PromptType type, PromptAnswer defaultAnswer, void(*OnYes)(void*), void(*OnNo)(void*), void* pCallbackData ) +void ScreenPrompt::Prompt( ScreenMessage smSendOnPop, const RString &sText, PromptType type, PromptAnswer defaultAnswer, void(*OnYes)(void*), void(*OnNo)(void*), void* pCallbackData ) { SetPromptSettings( sText, type, defaultAnswer, OnYes, OnNo, pCallbackData ); @@ -82,7 +82,7 @@ void ScreenPrompt::BeginScreen() for( int i=0; i<=g_PromptType; i++ ) { - CString sElem = ssprintf("Answer%dOf%d", i+1, g_PromptType+1); + RString sElem = ssprintf("Answer%dOf%d", i+1, g_PromptType+1); m_textAnswer[i].SetName( sElem ); m_textAnswer[i].SetText( ANSWER_TEXT(sElem) ); SET_XY_AND_ON_COMMAND( m_textAnswer[i] ); diff --git a/stepmania/src/ScreenPrompt.h b/stepmania/src/ScreenPrompt.h index 83bb5bf028..bb09d2e185 100644 --- a/stepmania/src/ScreenPrompt.h +++ b/stepmania/src/ScreenPrompt.h @@ -25,8 +25,8 @@ enum PromptAnswer class ScreenPrompt : public ScreenWithMenuElements { public: - static void SetPromptSettings( const CString &sText, PromptType type = PROMPT_OK, PromptAnswer defaultAnswer = ANSWER_NO, void(*OnYes)(void*) = NULL, void(*OnNo)(void*) = NULL, void* pCallbackData = NULL ); - static void Prompt( ScreenMessage smSendOnPop, const CString &sText, PromptType type = PROMPT_OK, PromptAnswer defaultAnswer = ANSWER_NO, void(*OnYes)(void*) = NULL, void(*OnNo)(void*) = NULL, void* pCallbackData = NULL ); + static void SetPromptSettings( const RString &sText, PromptType type = PROMPT_OK, PromptAnswer defaultAnswer = ANSWER_NO, void(*OnYes)(void*) = NULL, void(*OnNo)(void*) = NULL, void* pCallbackData = NULL ); + static void Prompt( ScreenMessage smSendOnPop, const RString &sText, PromptType type = PROMPT_OK, PromptAnswer defaultAnswer = ANSWER_NO, void(*OnYes)(void*) = NULL, void(*OnNo)(void*) = NULL, void* pCallbackData = NULL ); virtual void Init(); virtual void BeginScreen(); diff --git a/stepmania/src/ScreenRanking.cpp b/stepmania/src/ScreenRanking.cpp index 1b9df3f02c..9fcb0a9e81 100644 --- a/stepmania/src/ScreenRanking.cpp +++ b/stepmania/src/ScreenRanking.cpp @@ -82,7 +82,7 @@ static void GetAllCoursesToShow( vector &vpOut, CourseType ct, bool bSh } -static CString STEPS_TYPE_COLOR_NAME( size_t i ) { return ssprintf("StepsTypeColor%d",int(i+1)); } +static RString STEPS_TYPE_COLOR_NAME( size_t i ) { return ssprintf("StepsTypeColor%d",int(i+1)); } REGISTER_SCREEN_CLASS( ScreenRanking ); REGISTER_SCREEN_CLASS( ScreenRankingScroller ); @@ -327,7 +327,7 @@ void ScoreScroller::LoadCourses( CourseType ct, bool bOnlyRecentScores, int iNum } void ScoreScroller::Load( - CString sClassName, + RString sClassName, const vector &DifficultiesToShow, float fItemHeight ) { @@ -441,7 +441,7 @@ void ScoreScroller::SetScoreFromHighScoreList( BitmapText *pTextStepsScore, cons if( !hsl.vHighScores.empty() ) { hs = hsl.GetTopScore(); - const CString *psName = hsl.GetTopScore().GetNameMutable(); + const RString *psName = hsl.GetTopScore().GetNameMutable(); bRecentHighScore = find( GAMESTATE->m_vpsNamesThatWereFilled.begin(), GAMESTATE->m_vpsNamesThatWereFilled.end(), psName ) != GAMESTATE->m_vpsNamesThatWereFilled.end(); } else @@ -449,7 +449,7 @@ void ScoreScroller::SetScoreFromHighScoreList( BitmapText *pTextStepsScore, cons hs.SetName( NO_SCORE_NAME ); } - CString s = hs.GetDisplayName() + "\n" + PercentageDisplay::FormatPercentScore( hs.GetPercentDP() ); + RString s = hs.GetDisplayName() + "\n" + PercentageDisplay::FormatPercentScore( hs.GetPercentDP() ); if( SHOW_SURVIVAL_TIME ) s += " " + SecondsToMSSMsMs(hs.GetSurvivalSeconds()); pTextStepsScore->SetText( s ); @@ -527,7 +527,7 @@ void ScreenRankingLines::Init() m_textCourseTitle.SetShadowLength( 0 ); this->AddChild( &m_textCourseTitle ); - vector asCoursePaths; + vector asCoursePaths; split( COURSES_TO_SHOW, ",", asCoursePaths, true ); for( unsigned i=0; im_vpsNamesThatWereFilled.begin(), GAMESTATE->m_vpsNamesThatWereFilled.end(), psName ) != GAMESTATE->m_vpsNamesThatWereFilled.end(); } else @@ -674,7 +674,7 @@ float ScreenRankingLines::SetPage( const PageToShow &pts ) if( l < (int)hsl.vHighScores.size() ) { hs = hsl.vHighScores[l]; - const CString *psName = hsl.vHighScores[l].GetNameMutable(); + const RString *psName = hsl.vHighScores[l].GetNameMutable(); bRecentHighScore = find( GAMESTATE->m_vpsNamesThatWereFilled.begin(), GAMESTATE->m_vpsNamesThatWereFilled.end(), psName ) != GAMESTATE->m_vpsNamesThatWereFilled.end(); } else diff --git a/stepmania/src/ScreenRanking.h b/stepmania/src/ScreenRanking.h index fb9259576e..0ae8736e16 100644 --- a/stepmania/src/ScreenRanking.h +++ b/stepmania/src/ScreenRanking.h @@ -29,8 +29,8 @@ enum PageType NUM_PAGE_TYPES }; #define FOREACH_PageType( pt ) FOREACH_ENUM( PageType, NUM_PAGE_TYPES, pt ) -const CString& PageTypeToString( PageType pt ); -PageType StringToPageType( const CString& s ); +const RString& PageTypeToString( PageType pt ); +PageType StringToPageType( const RString& s ); class ScreenRanking : public ScreenAttract { @@ -94,7 +94,7 @@ public: void LoadSongs( bool bOnlyRecentScores, int iNumRecentScores ); void LoadCourses( CourseType ct, bool bOnlyRecentScores, int iNumRecentScores ); void Load( - CString sClassName, + RString sClassName, const vector &DifficultiesToShow, float fItemHeight ); void SetStepsType( StepsType st, RageColor color ); diff --git a/stepmania/src/ScreenReloadSongs.cpp b/stepmania/src/ScreenReloadSongs.cpp index 1ea312af18..bb20fd96cf 100644 --- a/stepmania/src/ScreenReloadSongs.cpp +++ b/stepmania/src/ScreenReloadSongs.cpp @@ -22,7 +22,7 @@ public: { } - void SetText( CString str ) + void SetText( RString str ) { m_BitmapText.SetText( str ); Paint(); diff --git a/stepmania/src/ScreenSMOnlineLogin.cpp b/stepmania/src/ScreenSMOnlineLogin.cpp index 64e0b05b67..369f36d9e5 100644 --- a/stepmania/src/ScreenSMOnlineLogin.cpp +++ b/stepmania/src/ScreenSMOnlineLogin.cpp @@ -56,12 +56,12 @@ void ScreenSMOnlineLogin::ImportOptions( int iRow, const vector &v { case 0: { - vector vsProfiles; + vector vsProfiles; PROFILEMAN->GetLocalProfileIDs( vsProfiles ); FOREACH_PlayerNumber( pn ) { - vector::iterator iter = find(vsProfiles.begin(), vsProfiles.end(), ProfileManager::m_sDefaultLocalProfileID[pn].Get() ); + vector::iterator iter = find(vsProfiles.begin(), vsProfiles.end(), ProfileManager::m_sDefaultLocalProfileID[pn].Get() ); if( iter != vsProfiles.end() ) m_pRows[0]->SetOneSelection((PlayerNumber) pn, iter - vsProfiles.begin()); } @@ -76,7 +76,7 @@ void ScreenSMOnlineLogin::ExportOptions( int iRow, const vector &v { case 0: { - vector vsProfiles; + vector vsProfiles; PROFILEMAN->GetLocalProfileIDs( vsProfiles ); FOREACH_EnabledPlayer( pn ) @@ -92,7 +92,7 @@ static LocalizedString ENTER_YOUR_PASSWORD ( "ScreenSMOnlineLogin", "Enter your void ScreenSMOnlineLogin::HandleScreenMessage(const ScreenMessage SM) { - CString sLoginQuestion; + RString sLoginQuestion; if( GAMESTATE->IsPlayerEnabled((PlayerNumber) m_iPlayer) ) sLoginQuestion = YOU_ARE_LOGGING_ON_AS.GetValue() + "\n" + GAMESTATE->GetPlayerDisplayName((PlayerNumber) m_iPlayer) + "\n" + ENTER_YOUR_PASSWORD.GetValue(); @@ -124,7 +124,7 @@ void ScreenSMOnlineLogin::HandleScreenMessage(const ScreenMessage SM) } else { - CString Responce = NSMAN->m_SMOnlinePacket.ReadNT(); + RString Responce = NSMAN->m_SMOnlinePacket.ReadNT(); ScreenTextEntry::Password( SM_PasswordDone, Responce + "\n\n"+sLoginQuestion, NULL ); } } @@ -166,23 +166,23 @@ void ScreenSMOnlineLogin::MenuStart( const InputEventPlus &input ) ScreenOptions::MenuStart( input ); } -CString ScreenSMOnlineLogin::GetSelectedProfileID() +RString ScreenSMOnlineLogin::GetSelectedProfileID() { - vector vsProfiles; + vector vsProfiles; PROFILEMAN->GetLocalProfileIDs( vsProfiles ); const OptionRow &row = *m_pRows[GetCurrentRow()]; const int Selection = row.GetOneSharedSelection(); if( !Selection ) - return CString(); + return RString(); return vsProfiles[ Selection-1 ]; } -void ScreenSMOnlineLogin::SendLogin(CString sPassword) +void ScreenSMOnlineLogin::SendLogin(RString sPassword) { - CString PlayerName = GAMESTATE->GetPlayerDisplayName((PlayerNumber) m_iPlayer); + RString PlayerName = GAMESTATE->GetPlayerDisplayName((PlayerNumber) m_iPlayer); - CString HashedName = NSMAN->MD5Hex( sPassword ); + RString HashedName = NSMAN->MD5Hex( sPassword ); int authMethod = 0; if ( NSMAN->GetSMOnlineSalt() != 0 ) diff --git a/stepmania/src/ScreenSMOnlineLogin.h b/stepmania/src/ScreenSMOnlineLogin.h index 2129cd1a3e..1061fe5210 100644 --- a/stepmania/src/ScreenSMOnlineLogin.h +++ b/stepmania/src/ScreenSMOnlineLogin.h @@ -9,12 +9,12 @@ public: virtual void Init(); virtual void HandleScreenMessage(const ScreenMessage SM); virtual void MenuStart( const InputEventPlus &input ); - void SendLogin(CString sPassword); + void SendLogin(RString sPassword); private: void ImportOptions( int iRow, const vector &vpns ); void ExportOptions( int iRow, const vector &vpns ); - CString GetSelectedProfileID(); + RString GetSelectedProfileID(); int m_iPlayer; }; diff --git a/stepmania/src/ScreenSaveSync.cpp b/stepmania/src/ScreenSaveSync.cpp index a2977a8ff6..94d138801c 100644 --- a/stepmania/src/ScreenSaveSync.cpp +++ b/stepmania/src/ScreenSaveSync.cpp @@ -15,9 +15,9 @@ static LocalizedString CHANGED_STOP ("ScreenSaveSync","The stop segment #%d c static LocalizedString CHANGED_TIMING_OF ("ScreenSaveSync","You have changed the timing of"); static LocalizedString WOULD_YOU_LIKE_TO_SAVE ("ScreenSaveSync","Would you like to save these changes?"); static LocalizedString CHOOSING_NO_WILL_DISCARD ("ScreenSaveSync","Choosing NO will discard your changes."); -static CString GetPromptText() +static RString GetPromptText() { - CString s; + RString s; { float fOld = GAMESTATE->m_fGlobalOffsetSecondsOriginal; @@ -35,7 +35,7 @@ static CString GetPromptText() } } - vector vsSongChanges; + vector vsSongChanges; { float fOld = GAMESTATE->m_pTimingDataOriginal->m_fBeat0OffsetInSeconds; diff --git a/stepmania/src/ScreenSelect.cpp b/stepmania/src/ScreenSelect.cpp index 7c031b2cd3..eee2b18ebd 100644 --- a/stepmania/src/ScreenSelect.cpp +++ b/stepmania/src/ScreenSelect.cpp @@ -42,12 +42,12 @@ void ScreenSelect::Init() // element in the list is a choice name. This level of indirection // makes it easier to add or remove items without having to change a bunch // of indices. - vector asChoiceNames; + vector asChoiceNames; split( CHOICE_NAMES, ",", asChoiceNames, true ); for( unsigned c=0; c vsCodeNames; + vector vsCodeNames; split( CODE_NAMES, ",", vsCodeNames, true ); for( unsigned c=0; cUpdateSelectableChoices(); diff --git a/stepmania/src/ScreenSelect.h b/stepmania/src/ScreenSelect.h index 2f9b1c5cf1..2727c9fa0e 100644 --- a/stepmania/src/ScreenSelect.h +++ b/stepmania/src/ScreenSelect.h @@ -19,7 +19,7 @@ public: virtual void DrawPrimitives(); virtual void Input( const InputEventPlus &input ); virtual void HandleScreenMessage( const ScreenMessage SM ); - virtual void HandleMessage( const CString &sMessage ); + virtual void HandleMessage( const RString &sMessage ); virtual void MenuBack( PlayerNumber pn ); @@ -31,7 +31,7 @@ protected: vector m_aCodes; vector m_aCodeChoices; - vector m_asSubscribedMessages; + vector m_asSubscribedMessages; RageTimer m_timerIdleComment; // count up to time between idle comment announcer sounds RageTimer m_timerIdleTimeout; // count up to go to the timeout screen diff --git a/stepmania/src/ScreenSelectGroup.cpp b/stepmania/src/ScreenSelectGroup.cpp index 365c1cb6c6..f6fdd837bf 100644 --- a/stepmania/src/ScreenSelectGroup.cpp +++ b/stepmania/src/ScreenSelectGroup.cpp @@ -50,17 +50,17 @@ void ScreenSelectGroup::Init() } // Add all group names to a map. - map mapGroupNames; + map mapGroupNames; for( unsigned i=0; im_sGroupName; + const RString& sGroupName = aAllSongs[i]->m_sGroupName; mapGroupNames[ sGroupName ] = ""; // group name maps to nothing } // copy group names into a vector - vector asGroupNames; + vector asGroupNames; asGroupNames.push_back( ALL_MUSIC_STRING ); // special group - for( map::const_iterator iter = mapGroupNames.begin(); iter != mapGroupNames.end(); ++iter ) + for( map::const_iterator iter = mapGroupNames.begin(); iter != mapGroupNames.end(); ++iter ) asGroupNames.push_back( iter->first ); // Add songs to the MusicList. @@ -152,7 +152,7 @@ void ScreenSelectGroup::AfterChange() int sel = m_GroupList.GetSelection(); m_MusicList.SetGroupNo(sel); - CString sSelectedGroupName = m_GroupList.GetSelectionName(); + RString sSelectedGroupName = m_GroupList.GetSelectionName(); if( sSelectedGroupName == ALL_MUSIC_STRING.GetValue() ) m_Banner.LoadAllMusic(); else diff --git a/stepmania/src/ScreenSelectMaster.cpp b/stepmania/src/ScreenSelectMaster.cpp index eaa802d5d4..b1d40bfe73 100644 --- a/stepmania/src/ScreenSelectMaster.cpp +++ b/stepmania/src/ScreenSelectMaster.cpp @@ -16,10 +16,10 @@ AutoScreenMessage( SM_PlayPostSwitchPage ) -CString CURSOR_OFFSET_X_FROM_ICON_NAME( size_t p ) { return ssprintf("CursorP%dOffsetXFromIcon",int(p+1)); } -CString CURSOR_OFFSET_Y_FROM_ICON_NAME( size_t p ) { return ssprintf("CursorP%dOffsetYFromIcon",int(p+1)); } +RString CURSOR_OFFSET_X_FROM_ICON_NAME( size_t p ) { return ssprintf("CursorP%dOffsetXFromIcon",int(p+1)); } +RString CURSOR_OFFSET_Y_FROM_ICON_NAME( size_t p ) { return ssprintf("CursorP%dOffsetYFromIcon",int(p+1)); } /* e.g. "OptionOrderLeft=0:1,1:2,2:3,3:4" */ -CString OPTION_ORDER_NAME( size_t dir ) { return "OptionOrder"+MenuDirToString((MenuDir)dir); } +RString OPTION_ORDER_NAME( size_t dir ) { return "OptionOrder"+MenuDirToString((MenuDir)dir); } REGISTER_SCREEN_CLASS( ScreenSelectMaster ); @@ -62,15 +62,15 @@ void ScreenSelectMaster::Init() vpns.push_back( p ); } -#define PLAYER_APPEND_WITH_SPACE(p) (SHARED_SELECTION ? CString() : ssprintf(" P%d",(p)+1)) -#define PLAYER_APPEND_NO_SPACE(p) (SHARED_SELECTION ? CString() : ssprintf("P%d",(p)+1)) +#define PLAYER_APPEND_WITH_SPACE(p) (SHARED_SELECTION ? RString() : ssprintf(" P%d",(p)+1)) +#define PLAYER_APPEND_NO_SPACE(p) (SHARED_SELECTION ? RString() : ssprintf("P%d",(p)+1)) // init cursor if( SHOW_CURSOR ) { FOREACH( PlayerNumber, vpns, p ) { - CString sElement = "Cursor" + PLAYER_APPEND_WITH_SPACE(*p); + RString sElement = "Cursor" + PLAYER_APPEND_WITH_SPACE(*p); m_sprCursor[*p].Load( THEME->GetPathG(m_sName,sElement) ); sElement.Replace( " ", "" ); m_sprCursor[*p]->SetName( sElement ); @@ -96,7 +96,7 @@ void ScreenSelectMaster::Init() // init icon if( SHOW_ICON ) { - CString sElement = ssprintf( "Icon Choice%s", mc.m_sName.c_str() ); + RString sElement = ssprintf( "Icon Choice%s", mc.m_sName.c_str() ); m_vsprIcon[c].Load( THEME->GetPathG(m_sName,sElement) ); sElement.Replace( " ", "" ); m_vsprIcon[c]->SetName( sElement ); @@ -108,7 +108,7 @@ void ScreenSelectMaster::Init() { FOREACH( PlayerNumber, vpns, p ) { - CString sElement = ssprintf( "Scroll Choice%s", mc.m_sName.c_str() ) + PLAYER_APPEND_WITH_SPACE(*p); + RString sElement = ssprintf( "Scroll Choice%s", mc.m_sName.c_str() ) + PLAYER_APPEND_WITH_SPACE(*p); m_vsprScroll[*p][c].Load( THEME->GetPathG(m_sName,sElement) ); sElement.Replace( " ", "" ); m_vsprScroll[*p][c]->SetName( sElement ); @@ -157,8 +157,8 @@ void ScreenSelectMaster::Init() // init m_Next order info FOREACH_MenuDir( dir ) { - const CString order = OPTION_ORDER.GetValue( dir ); - vector parts; + const RString order = OPTION_ORDER.GetValue( dir ); + vector parts; split( order, ",", parts, true ); for( unsigned part = 0; part < parts.size(); ++part ) @@ -211,7 +211,7 @@ void ScreenSelectMaster::BeginScreen() for( unsigned c=0; c LOCK_INPUT_SECONDS; ThemeMetric PRE_SWITCH_PAGE_SECONDS; ThemeMetric POST_SWITCH_PAGE_SECONDS; - ThemeMetric1D OPTION_ORDER; + ThemeMetric1D OPTION_ORDER; ThemeMetric WRAP_CURSOR; ThemeMetric WRAP_SCROLLER; ThemeMetric LOOP_SCROLLER; ThemeMetric ALLOW_REPEATING_INPUT; ThemeMetric SCROLLER_SECONDS_PER_ITEM; ThemeMetric SCROLLER_NUM_ITEMS_TO_DRAW; - ThemeMetric SCROLLER_TRANSFORM; + ThemeMetric SCROLLER_TRANSFORM; ThemeMetric SCROLLER_SUBDIVISIONS; - ThemeMetric DEFAULT_CHOICE; + ThemeMetric DEFAULT_CHOICE; map m_mapCurrentChoiceToNextChoice[NUM_MENU_DIRS]; diff --git a/stepmania/src/ScreenSelectMode.cpp b/stepmania/src/ScreenSelectMode.cpp index 90d489c8cd..38bb896a47 100644 --- a/stepmania/src/ScreenSelectMode.cpp +++ b/stepmania/src/ScreenSelectMode.cpp @@ -63,7 +63,7 @@ void ScreenSelectMode::Init() // // Load Sprite // - CString sElementPath = THEME->GetPathG("ScreenSelectMode",mc.m_sName); + RString sElementPath = THEME->GetPathG("ScreenSelectMode",mc.m_sName); arrayLocations.push_back( sElementPath ); @@ -90,13 +90,13 @@ void ScreenSelectMode::Init() m_bCharsAvailable = true; if(vpCharacters[i]->Has2DElems()) { - CString mpath = vpCharacters[i]->GetSongSelectIconPath(); + RString mpath = vpCharacters[i]->GetSongSelectIconPath(); LOG->Trace("Char: %d, %s, 2D: true",i,mpath.c_str()); m_b2DAvailable = true; } else { - CString mpath = vpCharacters[i]->GetSongSelectIconPath(); + RString mpath = vpCharacters[i]->GetSongSelectIconPath(); LOG->Trace("Char: %d, %s, 2D: false",i,mpath.c_str()); } } @@ -184,14 +184,14 @@ void ScreenSelectMode::MenuRight( PlayerNumber pn ) void ScreenSelectMode::UpdateSelectableChoices() { - vector GraphicPaths; + vector GraphicPaths; m_iNumChoices = 0; unsigned i=0; unsigned j=0; for( i=0; i arrayLocations; + vector arrayLocations; ScrollingList m_ScrollingList; Sprite m_ChoiceListFrame; Sprite m_ChoiceListHighlight; diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index f2b641a34c..6c2d6b501f 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -42,10 +42,10 @@ AutoScreenMessage( SM_SongChanged ) AutoScreenMessage( SM_SortOrderChanging ) AutoScreenMessage( SM_SortOrderChanged ) -static CString g_sCDTitlePath; +static RString g_sCDTitlePath; static bool g_bWantFallbackCdTitle; static bool g_bCDTitleWaiting = false; -static CString g_sBannerPath; +static RString g_sBannerPath; static bool g_bBannerWaiting = false; static bool g_bSampleMusicWaiting = false; static RageTimer g_StartedLoadingAt(RageZeroTimer); @@ -568,15 +568,15 @@ void ScreenSelectMusic::CheckBackgroundRequests() if( g_bCDTitleWaiting ) { /* The CDTitle is normally very small, so we don't bother waiting to display it. */ - CString sPath; + RString sPath; if( m_BackgroundLoader.IsCacheFileFinished(g_sCDTitlePath, sPath) ) { g_bCDTitleWaiting = false; - CString sCDTitlePath = sPath; + RString sCDTitlePath = sPath; if( sCDTitlePath.empty() || !IsAFile(sCDTitlePath) ) - sCDTitlePath = g_bWantFallbackCdTitle? m_sFallbackCDTitlePath:CString(""); + sCDTitlePath = g_bWantFallbackCdTitle? m_sFallbackCDTitlePath:RString(""); if( !sCDTitlePath.empty() ) { @@ -605,7 +605,7 @@ void ScreenSelectMusic::CheckBackgroundRequests() if( m_Banner.GetTweenTimeLeft() > 0 ) return; - CString sPath; + RString sPath; bool bFreeCache = false; if( TEXTUREMAN->IsTextureRegistered( Sprite::SongBannerTexture(g_sBannerPath) ) ) { @@ -1429,8 +1429,8 @@ void ScreenSelectMusic::AfterMusicChange() m_Banner.SetMovingFast( !!m_MusicWheel.IsMoving() ); - CString SampleMusicToPlay, SampleMusicTimingData; - vector m_Artists, m_AltArtists; + RString SampleMusicToPlay, SampleMusicTimingData; + vector m_Artists, m_AltArtists; m_MachineRank.SetText( "" ); @@ -1453,7 +1453,7 @@ void ScreenSelectMusic::AfterMusicChange() case TYPE_SECTION: case TYPE_SORT: { - CString sGroup = m_MusicWheel.GetSelectedSection(); + RString sGroup = m_MusicWheel.GetSelectedSection(); FOREACH_PlayerNumber( p ) m_iSelection[p] = -1; diff --git a/stepmania/src/ScreenSelectMusic.h b/stepmania/src/ScreenSelectMusic.h index a4af409eaa..ece352cb8b 100644 --- a/stepmania/src/ScreenSelectMusic.h +++ b/stepmania/src/ScreenSelectMusic.h @@ -86,18 +86,18 @@ protected: ThemeMetric SHOW_COURSE_CONTENTS; ThemeMetric DO_ROULETTE_ON_MENU_TIMER; ThemeMetric ALIGN_MUSIC_BEATS; - ThemeMetric CODES; - ThemeMetric MUSIC_WHEEL_TYPE; + ThemeMetric CODES; + ThemeMetric MUSIC_WHEEL_TYPE; ThemeMetric OPTIONS_MENU_AVAILABLE; DynamicThemeMetric SELECT_MENU_AVAILABLE; DynamicThemeMetric MODE_MENU_AVAILABLE; - CString m_sSectionMusicPath; - CString m_sSortMusicPath; - CString m_sRouletteMusicPath; - CString m_sRandomMusicPath; - CString m_sCourseMusicPath; - CString m_sFallbackCDTitlePath; + RString m_sSectionMusicPath; + RString m_sSortMusicPath; + RString m_sRouletteMusicPath; + RString m_sRandomMusicPath; + RString m_sCourseMusicPath; + RString m_sFallbackCDTitlePath; Sprite m_sprBannerMask; FadingBanner m_Banner; @@ -129,7 +129,7 @@ protected: bool m_bMadeChoice; bool m_bGoToOptions; - CString m_sSampleMusicToPlay; + RString m_sSampleMusicToPlay; TimingData *m_pSampleMusicTimingData; float m_fSampleStartSeconds, m_fSampleLengthSeconds; bool m_bAllowOptionsMenu, m_bAllowOptionsMenuRepeat; diff --git a/stepmania/src/ScreenSelectStyle.cpp b/stepmania/src/ScreenSelectStyle.cpp index fe3192d7ee..ee68a2a050 100644 --- a/stepmania/src/ScreenSelectStyle.cpp +++ b/stepmania/src/ScreenSelectStyle.cpp @@ -36,7 +36,7 @@ void ScreenSelectStyle::Init() // // Load icon // - CString sIconPath = THEME->GetPathG(m_sName,ssprintf("icon%d",i+1)); + RString sIconPath = THEME->GetPathG(m_sName,ssprintf("icon%d",i+1)); m_textIcon[i].SetName( ssprintf("Icon%d",i+1) ); m_sprIcon[i].SetName( ssprintf("Icon%d",i+1) ); @@ -58,7 +58,7 @@ void ScreenSelectStyle::Init() // // Load Picture // - CString sPicturePath = THEME->GetPathG(m_sName, ssprintf("picture%d",i+1)); + RString sPicturePath = THEME->GetPathG(m_sName, ssprintf("picture%d",i+1)); if( sPicturePath != "" ) { m_sprPicture[i].SetName( "Picture" ); @@ -71,7 +71,7 @@ void ScreenSelectStyle::Init() // // Load info // - CString sInfoPath = THEME->GetPathG(m_sName,ssprintf("info%d",i+1)); + RString sInfoPath = THEME->GetPathG(m_sName,ssprintf("info%d",i+1)); if( sInfoPath != "" ) { m_sprInfo[i].SetName( "Info" ); diff --git a/stepmania/src/ScreenServiceAction.cpp b/stepmania/src/ScreenServiceAction.cpp index 8a61ca8b52..92f2931cf9 100644 --- a/stepmania/src/ScreenServiceAction.cpp +++ b/stepmania/src/ScreenServiceAction.cpp @@ -16,7 +16,7 @@ #include "LocalizedString.h" static LocalizedString BOOKKEEPING_DATA_CLEARED( "ScreenServiceAction", "Bookkeeping data cleared." ); -static CString ClearBookkeepingData() +static RString ClearBookkeepingData() { BOOKKEEPER->ClearAll(); BOOKKEEPER->WriteToDisk(); @@ -24,11 +24,11 @@ static CString ClearBookkeepingData() } static LocalizedString MACHINE_STATS_CLEARED( "ScreenServiceAction", "Machine stats cleared." ); -static CString ClearMachineStats() +static RString ClearMachineStats() { Profile* pProfile = PROFILEMAN->GetMachineProfile(); // don't reset the Guid - CString sGuid = pProfile->m_sGuid; + RString sGuid = pProfile->m_sGuid; pProfile->InitAll(); pProfile->m_sGuid = sGuid; PROFILEMAN->SaveMachineProfile(); @@ -36,15 +36,15 @@ static CString ClearMachineStats() } static LocalizedString MACHINE_EDITS_CLEARED( "ScreenServiceAction", "%d edits cleared, %d errors." ); -static CString ClearMachineEdits() +static RString ClearMachineEdits() { int iNumAttempted = 0; int iNumSuccessful = 0; - vector vsEditFiles; + vector vsEditFiles; GetDirListing( PROFILEMAN->GetProfileDir(ProfileSlot_Machine)+EDIT_STEPS_SUBDIR+"*.edit", vsEditFiles, false, true ); GetDirListing( PROFILEMAN->GetProfileDir(ProfileSlot_Machine)+EDIT_COURSES_SUBDIR+"*.crs", vsEditFiles, false, true ); - FOREACH_CONST( CString, vsEditFiles, i ) + FOREACH_CONST( RString, vsEditFiles, i ) { iNumAttempted++; bool bSuccess = FILEMAN->Remove( *i ); @@ -77,7 +77,7 @@ static PlayerNumber GetFirstReadyMemoryCard() static LocalizedString MEMORY_CARD_EDITS_NOT_CLEARED( "ScreenServiceAction", "Edits not cleared - No memory cards ready." ); static LocalizedString EDITS_CLEARED ( "ScreenServiceAction", "%d edits cleared, %d errors." ); -static CString ClearMemoryCardEdits() +static RString ClearMemoryCardEdits() { PlayerNumber pn = GetFirstReadyMemoryCard(); if( pn == PLAYER_INVALID ) @@ -89,11 +89,11 @@ static CString ClearMemoryCardEdits() if( !MEMCARDMAN->IsMounted(pn) ) MEMCARDMAN->MountCard(pn); - CString sDir = MEM_CARD_MOUNT_POINT[pn] + (CString)PREFSMAN->m_sMemoryCardProfileSubdir + "/"; - vector vsEditFiles; + RString sDir = MEM_CARD_MOUNT_POINT[pn] + (RString)PREFSMAN->m_sMemoryCardProfileSubdir + "/"; + vector vsEditFiles; GetDirListing( sDir+EDIT_STEPS_SUBDIR+"*.edit", vsEditFiles, false, true ); GetDirListing( sDir+EDIT_COURSES_SUBDIR+"*.crs", vsEditFiles, false, true ); - FOREACH_CONST( CString, vsEditFiles, i ) + FOREACH_CONST( RString, vsEditFiles, i ) { iNumAttempted++; bool bSuccess = FILEMAN->Remove( *i ); @@ -110,7 +110,7 @@ static CString ClearMemoryCardEdits() static LocalizedString STATS_NOT_SAVED ( "ScreenServiceAction", "Stats not saved - No memory cards ready." ); static LocalizedString MACHINE_STATS_SAVED ( "ScreenServiceAction", "Machine stats saved to P%d card." ); static LocalizedString ERROR_SAVING_MACHINE_STATS ( "ScreenServiceAction", "Error saving machine stats to P%d card." ); -static CString TransferStatsMachineToMemoryCard() +static RString TransferStatsMachineToMemoryCard() { PlayerNumber pn = GetFirstReadyMemoryCard(); if( pn == PLAYER_INVALID ) @@ -119,7 +119,7 @@ static CString TransferStatsMachineToMemoryCard() if( !MEMCARDMAN->IsMounted(pn) ) MEMCARDMAN->MountCard(pn); - CString sDir = MEM_CARD_MOUNT_POINT[pn]; + RString sDir = MEM_CARD_MOUNT_POINT[pn]; sDir += "MachineProfile/"; bool bSaved = PROFILEMAN->GetMachineProfile()->SaveAllToDir( sDir, PREFSMAN->m_bSignProfileData ); @@ -136,7 +136,7 @@ static LocalizedString STATS_NOT_LOADED ( "ScreenServiceAction", "Stats not loa static LocalizedString MACHINE_STATS_LOADED ( "ScreenServiceAction", "Machine stats loaded from P%d card." ); static LocalizedString THERE_IS_NO_PROFILE ( "ScreenServiceAction", "There is no machine profile on P%d card." ); static LocalizedString PROFILE_CORRUPT ( "ScreenServiceAction", "The profile on P%d card contains corrupt or tampered data." ); -static CString TransferStatsMemoryCardToMachine() +static RString TransferStatsMemoryCardToMachine() { PlayerNumber pn = GetFirstReadyMemoryCard(); if( pn == PLAYER_INVALID ) @@ -145,13 +145,13 @@ static CString TransferStatsMemoryCardToMachine() if( !MEMCARDMAN->IsMounted(pn) ) MEMCARDMAN->MountCard(pn); - CString sDir = MEM_CARD_MOUNT_POINT[pn]; + RString sDir = MEM_CARD_MOUNT_POINT[pn]; sDir += "MachineProfile/"; Profile backup = *PROFILEMAN->GetMachineProfile(); ProfileLoadResult lr = PROFILEMAN->GetMachineProfile()->LoadAllFromDir( sDir, PREFSMAN->m_bSignProfileData ); - CString s; + RString s; switch( lr ) { case ProfileLoadResult_Success: @@ -174,19 +174,19 @@ static CString TransferStatsMemoryCardToMachine() return s; } -static void CopyEdits( const CString &sFrom, const CString &sTo, int &iNumAttempted, int &iNumSuccessful, int &iNumOverwritten ) +static void CopyEdits( const RString &sFrom, const RString &sTo, int &iNumAttempted, int &iNumSuccessful, int &iNumOverwritten ) { iNumAttempted = 0; iNumSuccessful = 0; iNumOverwritten = 0; { - CString sFromDir = sFrom + EDIT_STEPS_SUBDIR; - CString sToDir = sTo + EDIT_STEPS_SUBDIR; + RString sFromDir = sFrom + EDIT_STEPS_SUBDIR; + RString sToDir = sTo + EDIT_STEPS_SUBDIR; - vector vsFiles; + vector vsFiles; GetDirListing( sFromDir+"*.edit", vsFiles, false, false ); - FOREACH_CONST( CString, vsFiles, i ) + FOREACH_CONST( RString, vsFiles, i ) { iNumAttempted++; if( DoesFileExist(sToDir+*i) ) @@ -198,12 +198,12 @@ static void CopyEdits( const CString &sFrom, const CString &sTo, int &iNumAttemp } { - CString sFromDir = sFrom + EDIT_COURSES_SUBDIR; - CString sToDir = sTo + EDIT_COURSES_SUBDIR; + RString sFromDir = sFrom + EDIT_COURSES_SUBDIR; + RString sToDir = sTo + EDIT_COURSES_SUBDIR; - vector vsFiles; + vector vsFiles; GetDirListing( sFromDir+"*.crs", vsFiles, false, false ); - FOREACH_CONST( CString, vsFiles, i ) + FOREACH_CONST( RString, vsFiles, i ) { iNumAttempted++; if( DoesFileExist(sToDir+*i) ) @@ -215,20 +215,20 @@ static void CopyEdits( const CString &sFrom, const CString &sTo, int &iNumAttemp } } -static void SyncFiles( const CString &sFromDir, const CString &sToDir, const CString &sMask, int &iNumAdded, int &iNumDeleted, int &iNumOverwritten, int &iNumFailed ) +static void SyncFiles( const RString &sFromDir, const RString &sToDir, const RString &sMask, int &iNumAdded, int &iNumDeleted, int &iNumOverwritten, int &iNumFailed ) { - vector vsFilesSource; + vector vsFilesSource; GetDirListing( sFromDir+sMask, vsFilesSource, false, false ); - vector vsFilesDest; + vector vsFilesDest; GetDirListing( sToDir+sMask, vsFilesDest, false, false ); - vector vsToDelete; + vector vsToDelete; GetAsNotInBs( vsFilesDest, vsFilesSource, vsToDelete ); for( unsigned i = 0; i < vsToDelete.size(); ++i ) { - CString sFile = sToDir + vsToDelete[i]; + RString sFile = sToDir + vsToDelete[i]; LOG->Trace( "Delete \"%s\"", sFile.c_str() ); if( FILEMAN->Remove(sFile) ) @@ -239,8 +239,8 @@ static void SyncFiles( const CString &sFromDir, const CString &sToDir, const CSt for( unsigned i = 0; i < vsFilesSource.size(); ++i ) { - CString sFileFrom = sFromDir + vsFilesSource[i]; - CString sFileTo = sToDir + vsFilesSource[i]; + RString sFileFrom = sFromDir + vsFilesSource[i]; + RString sFileTo = sToDir + vsFilesSource[i]; LOG->Trace( "Copy \"%s\"", sFileFrom.c_str() ); bool bOverwrite = DoesFileExist( sFileTo ); bool bSuccess = FileCopy( sFileFrom, sFileTo ); @@ -256,7 +256,7 @@ static void SyncFiles( const CString &sFromDir, const CString &sToDir, const CSt } } -static void SyncEdits( const CString &sFromDir, const CString &sToDir, int &iNumAdded, int &iNumDeleted, int &iNumOverwritten, int &iNumFailed ) +static void SyncEdits( const RString &sFromDir, const RString &sToDir, int &iNumAdded, int &iNumDeleted, int &iNumOverwritten, int &iNumFailed ) { iNumAdded = 0; iNumDeleted = 0; @@ -273,7 +273,7 @@ static LocalizedString COPIED_AND_OVERWRITTEN( "ScreenServiceAction", "%d copied static LocalizedString ADDED_AND_OVERWRITTEN( "ScreenServiceAction", "%d added, %d overwritten" ); static LocalizedString FAILED( "ScreenServiceAction", "%d failed" ); static LocalizedString DELETED( "ScreenServiceAction", "%d deleted" ); -static CString CopyEditsMachineToMemoryCard() +static RString CopyEditsMachineToMemoryCard() { PlayerNumber pn = GetFirstReadyMemoryCard(); if( pn == PLAYER_INVALID ) @@ -285,21 +285,21 @@ static CString CopyEditsMachineToMemoryCard() int iNumAttempted = 0; int iNumSuccessful = 0; int iNumOverwritten = 0; - CString sFromDir = PROFILEMAN->GetProfileDir(ProfileSlot_Machine); - CString sToDir = MEM_CARD_MOUNT_POINT[pn] + (CString)PREFSMAN->m_sMemoryCardProfileSubdir + "/"; + RString sFromDir = PROFILEMAN->GetProfileDir(ProfileSlot_Machine); + RString sToDir = MEM_CARD_MOUNT_POINT[pn] + (RString)PREFSMAN->m_sMemoryCardProfileSubdir + "/"; CopyEdits( sFromDir, sToDir, iNumAttempted, iNumSuccessful, iNumOverwritten ); MEMCARDMAN->UnmountCard(pn); - CString sRet = ssprintf( COPIED_TO_CARD.GetValue(), pn+1 ) + " "; + RString sRet = ssprintf( COPIED_TO_CARD.GetValue(), pn+1 ) + " "; sRet += ssprintf( COPIED_AND_OVERWRITTEN.GetValue(), iNumSuccessful, iNumOverwritten ); if( iNumSuccessful < iNumAttempted ) - sRet += CString("; ") + ssprintf( FAILED.GetValue(), iNumAttempted-iNumSuccessful ); + sRet += RString("; ") + ssprintf( FAILED.GetValue(), iNumAttempted-iNumSuccessful ); return sRet; } -static CString SyncEditsMachineToMemoryCard() +static RString SyncEditsMachineToMemoryCard() { PlayerNumber pn = GetFirstReadyMemoryCard(); if( pn == PLAYER_INVALID ) @@ -313,23 +313,23 @@ static CString SyncEditsMachineToMemoryCard() int iNumOverwritten = 0; int iNumFailed = 0; - CString sFromDir = PROFILEMAN->GetProfileDir(ProfileSlot_Machine); - CString sToDir = MEM_CARD_MOUNT_POINT[pn] + (CString)PREFSMAN->m_sMemoryCardProfileSubdir + "/"; + RString sFromDir = PROFILEMAN->GetProfileDir(ProfileSlot_Machine); + RString sToDir = MEM_CARD_MOUNT_POINT[pn] + (RString)PREFSMAN->m_sMemoryCardProfileSubdir + "/"; SyncEdits( sFromDir, sToDir, iNumAdded, iNumDeleted, iNumOverwritten, iNumFailed ); MEMCARDMAN->UnmountCard(pn); - CString sRet = ssprintf( COPIED_TO_CARD.GetValue(), pn+1 ) + " "; + RString sRet = ssprintf( COPIED_TO_CARD.GetValue(), pn+1 ) + " "; sRet += ssprintf( ADDED_AND_OVERWRITTEN.GetValue(), iNumAdded, iNumOverwritten ); if( iNumDeleted ) - sRet += CString(" ") + ssprintf( DELETED.GetValue(), iNumDeleted ); + sRet += RString(" ") + ssprintf( DELETED.GetValue(), iNumDeleted ); if( iNumFailed ) - sRet += CString("; ") + ssprintf( FAILED.GetValue(), iNumFailed ); + sRet += RString("; ") + ssprintf( FAILED.GetValue(), iNumFailed ); return sRet; } static LocalizedString COPIED_FROM_CARD( "ScreenServiceAction", "Copied from P%d card:" ); -static CString CopyEditsMemoryCardToMachine() +static RString CopyEditsMemoryCardToMachine() { PlayerNumber pn = GetFirstReadyMemoryCard(); if( pn == PLAYER_INVALID ) @@ -341,8 +341,8 @@ static CString CopyEditsMemoryCardToMachine() int iNumAttempted = 0; int iNumSuccessful = 0; int iNumOverwritten = 0; - CString sFromDir = MEM_CARD_MOUNT_POINT[pn] + (CString)PREFSMAN->m_sMemoryCardProfileSubdir + "/"; - CString sToDir = PROFILEMAN->GetProfileDir(ProfileSlot_Machine); + RString sFromDir = MEM_CARD_MOUNT_POINT[pn] + (RString)PREFSMAN->m_sMemoryCardProfileSubdir + "/"; + RString sToDir = PROFILEMAN->GetProfileDir(ProfileSlot_Machine); CopyEdits( sFromDir, sToDir, iNumAttempted, iNumSuccessful, iNumOverwritten ); @@ -352,15 +352,15 @@ static CString CopyEditsMemoryCardToMachine() PROFILEMAN->SaveMachineProfile(); PROFILEMAN->LoadMachineProfile(); - CString sRet = ssprintf( COPIED_FROM_CARD.GetValue(), pn+1 ) + " "; + RString sRet = ssprintf( COPIED_FROM_CARD.GetValue(), pn+1 ) + " "; sRet += ssprintf( COPIED_AND_OVERWRITTEN.GetValue(), iNumSuccessful, iNumOverwritten ); if( iNumSuccessful < iNumAttempted ) - sRet += CString("; ") + ssprintf( FAILED.GetValue(), iNumAttempted-iNumSuccessful ); + sRet += RString("; ") + ssprintf( FAILED.GetValue(), iNumAttempted-iNumSuccessful ); return sRet; } static LocalizedString PREFERENCES_RESET( "ScreenServiceAction", "Preferences reset." ); -static CString ResetPreferences() +static RString ResetPreferences() { PREFSMAN->ResetToFactoryDefaults(); return PREFERENCES_RESET.GetValue(); @@ -373,9 +373,9 @@ void ScreenServiceAction::Init() { ScreenPrompt::Init(); - CString sAction = THEME->GetMetric(m_sName,"Action"); + RString sAction = THEME->GetMetric(m_sName,"Action"); - CString (*pfn)() = NULL; + RString (*pfn)() = NULL; if( sAction == "ClearBookkeepingData" ) pfn = ClearBookkeepingData; else if( sAction == "ClearMachineStats" ) pfn = ClearMachineStats; @@ -390,7 +390,7 @@ void ScreenServiceAction::Init() ASSERT_M( pfn, sAction ); - CString s = pfn(); + RString s = pfn(); ScreenPrompt::SetPromptSettings( s, PROMPT_OK ); } diff --git a/stepmania/src/ScreenSetTime.cpp b/stepmania/src/ScreenSetTime.cpp index d8f96b9683..84a41a4ca2 100644 --- a/stepmania/src/ScreenSetTime.cpp +++ b/stepmania/src/ScreenSetTime.cpp @@ -93,7 +93,7 @@ void ScreenSetTime::Update( float fDelta ) int iPrettyHour = now.tm_hour%12; if( iPrettyHour == 0 ) iPrettyHour = 12; - CString sPrettyHour = ssprintf( "%d %s", iPrettyHour, now.tm_hour>=12 ? "pm" : "am" ); + RString sPrettyHour = ssprintf( "%d %s", iPrettyHour, now.tm_hour>=12 ? "pm" : "am" ); m_textValue[hour] .SetText( sPrettyHour ); m_textValue[minute] .SetText( ssprintf("%02d",now.tm_min) ); diff --git a/stepmania/src/ScreenStatsOverlay.cpp b/stepmania/src/ScreenStatsOverlay.cpp index 63b56a66cf..fa593a31f3 100644 --- a/stepmania/src/ScreenStatsOverlay.cpp +++ b/stepmania/src/ScreenStatsOverlay.cpp @@ -79,7 +79,7 @@ void ScreenStatsOverlay::Update( float fDeltaTime ) } } -void ScreenStatsOverlay::AddTimestampLine( const CString &txt, const RageColor &color ) +void ScreenStatsOverlay::AddTimestampLine( const RString &txt, const RageColor &color ) { m_textSkips[m_LastSkip].SetText( txt ); m_textSkips[m_LastSkip].StopTweening(); @@ -121,7 +121,7 @@ void ScreenStatsOverlay::UpdateSkips() if( skip ) { - CString time(SecondsToMMSSMsMs(RageTimer::GetTimeSinceStartFast())); + RString time(SecondsToMMSSMsMs(RageTimer::GetTimeSinceStartFast())); static const RageColor colors[] = { diff --git a/stepmania/src/ScreenStatsOverlay.h b/stepmania/src/ScreenStatsOverlay.h index ddbbd34eaa..7903d12628 100644 --- a/stepmania/src/ScreenStatsOverlay.h +++ b/stepmania/src/ScreenStatsOverlay.h @@ -17,7 +17,7 @@ public: void Update( float fDeltaTime ); private: - void AddTimestampLine( const CString &txt, const RageColor &color ); + void AddTimestampLine( const RString &txt, const RageColor &color ); void UpdateSkips(); BitmapText m_textStats; diff --git a/stepmania/src/ScreenSyncOverlay.cpp b/stepmania/src/ScreenSyncOverlay.cpp index 0ad8d18da4..971f7f01db 100644 --- a/stepmania/src/ScreenSyncOverlay.cpp +++ b/stepmania/src/ScreenSyncOverlay.cpp @@ -82,7 +82,7 @@ static LocalizedString SONG_OFFSET_FROM ( "ScreenSyncOverlay", "Song offset fro static LocalizedString TEMPO_SEGMENT_FROM ( "ScreenSyncOverlay", "%s tempo segment from %+.3f BPM to %+.3f BPM." ); void ScreenSyncOverlay::UpdateText() { - vector vs; + vector vs; switch( PREFSMAN->m_AutoPlay ) { diff --git a/stepmania/src/ScreenSystemLayer.cpp b/stepmania/src/ScreenSystemLayer.cpp index c31330b15a..89b27ccc71 100644 --- a/stepmania/src/ScreenSystemLayer.cpp +++ b/stepmania/src/ScreenSystemLayer.cpp @@ -81,10 +81,10 @@ void ScreenSystemLayer::ReloadCreditsText() this->SortByDrawOrder(); } -CString ScreenSystemLayer::GetCreditsMessage( PlayerNumber pn ) const +RString ScreenSystemLayer::GetCreditsMessage( PlayerNumber pn ) const { if( (bool)CREDITS_JOIN_ONLY && !GAMESTATE->PlayersCanJoin() ) - return CString(); + return RString(); bool bShowCreditsMessage; if( SCREENMAN && SCREENMAN->GetTopScreen() && SCREENMAN->GetTopScreen()->GetScreenType() == system_menu ) @@ -112,7 +112,7 @@ CString ScreenSystemLayer::GetCreditsMessage( PlayerNumber pn ) const else if( GAMESTATE->PlayersCanJoin() ) return CREDITS_INSERT_CARD.GetValue(); else - return CString(); + return RString(); case MemoryCardState_Error: return THEME->GetMetric( m_sName, "CreditsCard" + MEMCARDMAN->GetCardError(pn) ); case MemoryCardState_TooLate: return CREDITS_CARD_TOO_LATE.GetValue(); @@ -127,7 +127,7 @@ CString ScreenSystemLayer::GetCreditsMessage( PlayerNumber pn ) const // If there is a local profile loaded, prefer it over the name of the memory card. if( PROFILEMAN->IsPersistentProfile(pn) ) { - CString s = pProfile->GetDisplayNameOrHighScoreName(); + RString s = pProfile->GetDisplayNameOrHighScoreName(); if( s.empty() ) s = CREDITS_CARD_NO_NAME.GetValue(); if( PROFILEMAN->LastLoadWasFromLastGood(pn) ) @@ -159,7 +159,7 @@ CString ScreenSystemLayer::GetCreditsMessage( PlayerNumber pn ) const { int Credits = GAMESTATE->m_iCoins / PREFSMAN->m_iCoinsPerCredit; int Coins = GAMESTATE->m_iCoins % PREFSMAN->m_iCoinsPerCredit; - CString sCredits = CREDITS_CREDITS; + RString sCredits = CREDITS_CREDITS; if( Credits > 0 || PREFSMAN->m_iCoinsPerCredit == 1 ) sCredits += ssprintf(" %d", Credits); if( PREFSMAN->m_iCoinsPerCredit > 1 ) @@ -178,7 +178,7 @@ CString ScreenSystemLayer::GetCreditsMessage( PlayerNumber pn ) const } } -void ScreenSystemLayer::HandleMessage( const CString &sMessage ) +void ScreenSystemLayer::HandleMessage( const RString &sMessage ) { if( sMessage == "RefreshCreditText" ) { diff --git a/stepmania/src/ScreenSystemLayer.h b/stepmania/src/ScreenSystemLayer.h index ffdfe2fe06..fedf1e9ecb 100644 --- a/stepmania/src/ScreenSystemLayer.h +++ b/stepmania/src/ScreenSystemLayer.h @@ -14,7 +14,7 @@ class ScreenSystemLayer : public Screen { public: virtual void Init(); - void HandleMessage( const CString &sCommandName ); + void HandleMessage( const RString &sCommandName ); void ReloadCreditsText(); void Update( float fDeltaTime ); @@ -25,7 +25,7 @@ private: BitmapText m_textCredits[NUM_PLAYERS]; Quad m_quadBrightnessAdd; - CString GetCreditsMessage( PlayerNumber pn ) const; + RString GetCreditsMessage( PlayerNumber pn ) const; LocalizedString CREDITS_PRESS_START; LocalizedString CREDITS_INSERT_CARD; diff --git a/stepmania/src/ScreenTestFonts.cpp b/stepmania/src/ScreenTestFonts.cpp index 0462a26a9f..5cef217c09 100644 --- a/stepmania/src/ScreenTestFonts.cpp +++ b/stepmania/src/ScreenTestFonts.cpp @@ -15,9 +15,9 @@ static const float LineHeight = 50; #define FONT( i ) THEME->GetMetric (m_sName,ssprintf("Font%i",i)) #define TEXT( i ) THEME->GetMetric (m_sName,ssprintf("Text%i",i)) -static CString g_sCustomText; +static RString g_sCustomText; -static void ChangeText( const CString &sText ) +static void ChangeText( const RString &sText ) { g_sCustomText = sText; } @@ -57,7 +57,7 @@ void ScreenTestFonts::Init() SetText( "Foo" ); } -void ScreenTestFonts::SetText( CString sText ) +void ScreenTestFonts::SetText( RString sText ) { txt.SetShadowLength( 0 ); txt.SetText( "" ); /* force it */ @@ -65,7 +65,7 @@ void ScreenTestFonts::SetText( CString sText ) m_sCurText = sText; } -void ScreenTestFonts::SetFont( CString sFont ) +void ScreenTestFonts::SetFont( RString sFont ) { m_sFont = sFont; diff --git a/stepmania/src/ScreenTestFonts.h b/stepmania/src/ScreenTestFonts.h index 7cd35fbe9c..16c9e2fd19 100644 --- a/stepmania/src/ScreenTestFonts.h +++ b/stepmania/src/ScreenTestFonts.h @@ -17,10 +17,10 @@ public: void HandleScreenMessage( const ScreenMessage SM ); private: - void SetText( CString sText ); - void SetFont( CString sFont ); + void SetText( RString sText ); + void SetFont( RString sFont ); - CString m_sCurText, m_sFont; + RString m_sCurText, m_sFont; BitmapText txt, font; Quad Vline, Hline; }; diff --git a/stepmania/src/ScreenTestInput.cpp b/stepmania/src/ScreenTestInput.cpp index daffc80a76..f382db9e58 100644 --- a/stepmania/src/ScreenTestInput.cpp +++ b/stepmania/src/ScreenTestInput.cpp @@ -56,13 +56,13 @@ void ScreenTestInput::Update( float fDeltaTime ) // { vector vDevices; - vector vDescriptions; - vector vs; + vector vDescriptions; + vector vs; INPUTMAN->GetDevicesAndDescriptions( vDevices, vDescriptions ); ASSERT( vDevices.size() == vDescriptions.size() ); for( unsigned i=0; i asInputs; + vector asInputs; DeviceInput di; vector DeviceInputs; INPUTFILTER->GetPressedButtons( DeviceInputs ); FOREACH( DeviceInput, DeviceInputs, di ) { - CString sTemp; + RString sTemp; sTemp += INPUTMAN->GetDeviceSpecificInputString(*di); GameInput gi; if( INPUTMAPPER->DeviceToGame(*di,gi) ) { - CString sName = GameButtonToLocalizedString( GAMESTATE->GetCurrentGame(), gi.button ); + RString sName = GameButtonToLocalizedString( GAMESTATE->GetCurrentGame(), gi.button ); sTemp += ssprintf(" - "+CONTROLLER.GetValue()+" %d %s", gi.controller+1, sName.c_str() ); if( !PREFSMAN->m_bOnlyDedicatedMenuButtons ) @@ -102,7 +102,7 @@ void ScreenTestInput::Update( float fDeltaTime ) sTemp += " - "+NOT_MAPPED.GetValue(); } - CString sComment = INPUTFILTER->GetButtonComment( *di ); + RString sComment = INPUTFILTER->GetButtonComment( *di ); if( sComment != "" ) sTemp += " - " + sComment; @@ -115,7 +115,7 @@ void ScreenTestInput::Update( float fDeltaTime ) void ScreenTestInput::Input( const InputEventPlus &input ) { - CString sMessage = input.DeviceI.ToString(); + RString sMessage = input.DeviceI.ToString(); switch( input.type ) { case IET_FIRST_PRESS: diff --git a/stepmania/src/ScreenTestLights.cpp b/stepmania/src/ScreenTestLights.cpp index 336e217293..e5bb3fbd4f 100644 --- a/stepmania/src/ScreenTestLights.cpp +++ b/stepmania/src/ScreenTestLights.cpp @@ -56,7 +56,7 @@ void ScreenTestLights::Update( float fDeltaTime ) GameButton gb; LIGHTSMAN->GetFirstLitGameButtonLight( gc, gb ); - CString s; + RString s; switch( LIGHTSMAN->GetLightsMode() ) { @@ -79,7 +79,7 @@ void ScreenTestLights::Update( float fDeltaTime ) } else { - CString sGameButton = GameButtonToLocalizedString( GAMESTATE->GetCurrentGame(), gb ); + RString sGameButton = GameButtonToLocalizedString( GAMESTATE->GetCurrentGame(), gb ); PlayerNumber pn = (PlayerNumber)(gc+1); s += ssprintf( CONTROLLER_LIGHT.GetValue()+": %s %d %s\n", PlayerNumberToString(pn).c_str(), gb, sGameButton.c_str() ); } diff --git a/stepmania/src/ScreenTestSound.cpp b/stepmania/src/ScreenTestSound.cpp index f04cad9394..4e84f823ed 100644 --- a/stepmania/src/ScreenTestSound.cpp +++ b/stepmania/src/ScreenTestSound.cpp @@ -74,11 +74,11 @@ ScreenTestSound::~ScreenTestSound() void ScreenTestSound::UpdateText(int n) { - CString fn = Basename( s[n].s.GetLoadedFilePath() ); + RString fn = Basename( s[n].s.GetLoadedFilePath() ); vector &snds = m_sSoundCopies[n]; - CString pos; + RString pos; for(unsigned p = 0; p < snds.size(); ++p) { if(p) pos += ", "; diff --git a/stepmania/src/ScreenTextEntry.cpp b/stepmania/src/ScreenTextEntry.cpp index 4076f953f3..78b3a57114 100644 --- a/stepmania/src/ScreenTextEntry.cpp +++ b/stepmania/src/ScreenTextEntry.cpp @@ -26,27 +26,27 @@ static const char* g_szKeys[NUM_KEYBOARD_ROWS][KEYS_PER_ROW] = static Preference g_bAllowOldKeyboardInput( "AllowOldKeyboardInput", true ); -CString ScreenTextEntry::s_sLastAnswer = ""; +RString ScreenTextEntry::s_sLastAnswer = ""; /* Settings: */ namespace { - CString g_sQuestion; - CString g_sInitialAnswer; + RString g_sQuestion; + RString g_sInitialAnswer; int g_iMaxInputLength; - bool(*g_pValidate)(const CString &sAnswer,CString &sErrorOut); - void(*g_pOnOK)(const CString &sAnswer); + bool(*g_pValidate)(const RString &sAnswer,RString &sErrorOut); + void(*g_pOnOK)(const RString &sAnswer); void(*g_pOnCancel)(); bool g_bPassword; }; void ScreenTextEntry::TextEntry( ScreenMessage smSendOnPop, - CString sQuestion, - CString sInitialAnswer, + RString sQuestion, + RString sInitialAnswer, int iMaxInputLength, - bool(*Validate)(const CString &sAnswer,CString &sErrorOut), - void(*OnOK)(const CString &sAnswer), + bool(*Validate)(const RString &sAnswer,RString &sErrorOut), + void(*OnOK)(const RString &sAnswer), void(*OnCancel)(), bool bPassword ) @@ -165,7 +165,7 @@ void ScreenTextEntry::UpdateKeyboardText() { for( int x=0; xGetString( "ScreenTextEntry", s ); BitmapText &bt = *m_ptextKeys[r][x]; @@ -176,7 +176,7 @@ void ScreenTextEntry::UpdateKeyboardText() void ScreenTextEntry::UpdateAnswerText() { - CString s; + RString s; if( g_bPassword ) s = RString( m_sAnswer.size(), '*' ); else @@ -279,7 +279,7 @@ void ScreenTextEntry::Input( const InputEventPlus &input ) void ScreenTextEntry::MoveX( int iDir ) { - CString sKey; + RString sKey; do { m_iFocusX += iDir; @@ -295,7 +295,7 @@ void ScreenTextEntry::MoveX( int iDir ) void ScreenTextEntry::MoveY( int iDir ) { - CString sKey; + RString sKey; do { m_iFocusY = (KeyboardRow)(m_iFocusY + iDir); @@ -325,7 +325,7 @@ void ScreenTextEntry::MoveY( int iDir ) PositionCursor(); } -void ScreenTextEntry::AppendToAnswer( CString s ) +void ScreenTextEntry::AppendToAnswer( RString s ) { wstring sNewAnswer = m_sAnswer+RStringToWstring(s); if( (int)sNewAnswer.length() > g_iMaxInputLength ) @@ -392,8 +392,8 @@ void ScreenTextEntry::End( bool bCancelled ) } else { - CString sAnswer = WStringToRString(m_sAnswer); - CString sError; + RString sAnswer = WStringToRString(m_sAnswer); + RString sError; if ( g_pValidate != NULL ) { bool bValidAnswer = g_pValidate( sAnswer, sError ); @@ -406,7 +406,7 @@ void ScreenTextEntry::End( bool bCancelled ) if( g_pOnOK ) { - CString ret = WStringToRString(m_sAnswer); + RString ret = WStringToRString(m_sAnswer); FontCharAliases::ReplaceMarkers(ret); g_pOnOK( ret ); } @@ -421,7 +421,7 @@ void ScreenTextEntry::End( bool bCancelled ) OFF_COMMAND( m_sprCursor ); s_bCancelledLast = bCancelled; - s_sLastAnswer = bCancelled ? CString("") : WStringToRString(m_sAnswer); + s_sLastAnswer = bCancelled ? RString("") : WStringToRString(m_sAnswer); } void ScreenTextEntry::MenuBack( PlayerNumber pn ) diff --git a/stepmania/src/ScreenTextEntry.h b/stepmania/src/ScreenTextEntry.h index 5071c94006..7c2c0d274e 100644 --- a/stepmania/src/ScreenTextEntry.h +++ b/stepmania/src/ScreenTextEntry.h @@ -25,17 +25,17 @@ class ScreenTextEntry : public ScreenWithMenuElements public: static void TextEntry( ScreenMessage smSendOnPop, - CString sQuestion, - CString sInitialAnswer, + RString sQuestion, + RString sInitialAnswer, int iMaxInputLength, - bool(*Validate)(const CString &sAnswer,CString &sErrorOut) = NULL, - void(*OnOK)(const CString &sAnswer) = NULL, + bool(*Validate)(const RString &sAnswer,RString &sErrorOut) = NULL, + void(*OnOK)(const RString &sAnswer) = NULL, void(*OnCanel)() = NULL, bool bPassword = false ); static void Password( ScreenMessage smSendOnPop, - const CString &sQuestion, - void(*OnOK)(const CString &sPassword) = NULL, + const RString &sQuestion, + void(*OnOK)(const RString &sPassword) = NULL, void(*OnCanel)() = NULL ) { TextEntry( smSendOnPop, sQuestion, "", 255, NULL, OnOK, OnCanel, true ); @@ -48,14 +48,14 @@ public: virtual void Update( float fDelta ); virtual void Input( const InputEventPlus &input ); - static CString s_sLastAnswer; + static RString s_sLastAnswer; static bool s_bCancelledLast; protected: void MoveX( int iDir ); void MoveY( int iDir ); - void AppendToAnswer( CString s ); + void AppendToAnswer( RString s ); void BackspaceInAnswer(); void End( bool bCancelled ); diff --git a/stepmania/src/ScreenTitleMenu.cpp b/stepmania/src/ScreenTitleMenu.cpp index d17f628d2f..be59895e9c 100644 --- a/stepmania/src/ScreenTitleMenu.cpp +++ b/stepmania/src/ScreenTitleMenu.cpp @@ -84,7 +84,7 @@ void ScreenTitleMenu::Input( const InputEventPlus &input ) CodeDetector::EnteredCode(input.GameI.controller,CODE_NEXT_ANNOUNCER2) ) { ANNOUNCER->NextAnnouncer(); - CString sName = ANNOUNCER->GetCurAnnouncerName(); + RString sName = ANNOUNCER->GetCurAnnouncerName(); if( sName=="" ) sName = "(none)"; SCREENMAN->SystemMessage( ANNOUNCER_.GetValue()+": "+sName ); SCREENMAN->SetNewScreen( m_sName ); @@ -94,7 +94,7 @@ void ScreenTitleMenu::Input( const InputEventPlus &input ) ScreenSelectMaster::Input( input ); } -void ScreenTitleMenu::HandleMessage( const CString& sMessage ) +void ScreenTitleMenu::HandleMessage( const RString& sMessage ) { if( sMessage == PREFSMAN->m_CoinMode.GetName()+"Changed" ) { diff --git a/stepmania/src/ScreenTitleMenu.h b/stepmania/src/ScreenTitleMenu.h index 14287cb36f..1cb74b6e7d 100644 --- a/stepmania/src/ScreenTitleMenu.h +++ b/stepmania/src/ScreenTitleMenu.h @@ -14,7 +14,7 @@ public: virtual void Input( const InputEventPlus &input ); - virtual void HandleMessage( const CString& sMessage ); + virtual void HandleMessage( const RString& sMessage ); protected: RageSound m_soundSelectPressed; diff --git a/stepmania/src/ScreenUnlock.cpp b/stepmania/src/ScreenUnlock.cpp index 5ef7b33b08..4bb1490e8d 100644 --- a/stepmania/src/ScreenUnlock.cpp +++ b/stepmania/src/ScreenUnlock.cpp @@ -107,8 +107,8 @@ void ScreenUnlock::Init() const Song *pSong = entry.m_pSong; ASSERT( pSong ); - CString title = pSong->GetDisplayMainTitle(); - CString subtitle = pSong->GetDisplaySubTitle(); + RString title = pSong->GetDisplayMainTitle(); + RString subtitle = pSong->GetDisplaySubTitle(); if( subtitle != "" ) title = title + "\n" + subtitle; text->SetMaxWidth( MaxWidth ); @@ -156,12 +156,12 @@ void ScreenUnlock::Init() float SecondCycleTime = (6 + TargetRow) * SECS_PER_CYCLE - FirstCycleTime; LOG->Trace("Target Row: %f", TargetRow); LOG->Trace("command for icon %d: %s", i, ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime * 2, ScrollingTextEndY).c_str() ); - CString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime, ScrollingTextEndY); + RString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime, ScrollingTextEndY); text->RunCommands( ActorCommands(sCommand) ); } else { - CString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), SECS_PER_CYCLE * (ScrollingTextRows), ScrollingTextEndY); + RString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), SECS_PER_CYCLE * (ScrollingTextRows), ScrollingTextEndY); text->RunCommands( ActorCommands(sCommand) ); } @@ -188,12 +188,12 @@ void ScreenUnlock::Init() float SecondCycleTime = (6 + TargetRow) * SECS_PER_CYCLE - FirstCycleTime; LOG->Trace("Target Row: %f", TargetRow); LOG->Trace("command for icon %d: %s", i, ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime * 2, ScrollingTextEndY).c_str() ); - CString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime, ScrollingTextEndY); + RString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime, ScrollingTextEndY); IconCount->RunCommands( ActorCommands(sCommand) ); } else { - CString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), SECS_PER_CYCLE * (ScrollingTextRows), ScrollingTextEndY); + RString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), SECS_PER_CYCLE * (ScrollingTextRows), ScrollingTextEndY); IconCount->RunCommands( ActorCommands(sCommand) ); } @@ -237,8 +237,8 @@ void ScreenUnlock::Init() NewText->LoadFromFont( THEME->GetPathF("ScreenUnlock","text") ); NewText->SetHorizAlign( Actor::align_left ); - CString title = pSong->GetDisplayMainTitle(); - CString subtitle = pSong->GetDisplaySubTitle(); + RString title = pSong->GetDisplayMainTitle(); + RString subtitle = pSong->GetDisplaySubTitle(); if( subtitle != "" ) title = title + "\n" + subtitle; @@ -251,7 +251,7 @@ void ScreenUnlock::Init() NewText->SetXY(ScrollingTextX, ScrollingTextStartY); { - CString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;", SECS_PER_CYCLE * (NumUnlocks + 2 * i - 2), SECS_PER_CYCLE * ((ScrollingTextRows - i) * 2 + 1 ), (ScrollingTextStartY + (ScrollingTextEndY - ScrollingTextStartY) * (ScrollingTextRows - i + 0.5) / ScrollingTextRows )); + RString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;", SECS_PER_CYCLE * (NumUnlocks + 2 * i - 2), SECS_PER_CYCLE * ((ScrollingTextRows - i) * 2 + 1 ), (ScrollingTextStartY + (ScrollingTextEndY - ScrollingTextStartY) * (ScrollingTextRows - i + 0.5) / ScrollingTextRows )); NewText->RunCommands( ActorCommands(sCommand) ); } @@ -262,7 +262,7 @@ void ScreenUnlock::Init() NewIcon->SetHeight(UNLOCK_TEXT_SCROLL_ICON_SIZE); NewIcon->SetWidth(UNLOCK_TEXT_SCROLL_ICON_SIZE); { - CString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;", SECS_PER_CYCLE * (NumUnlocks + 2 * i - 2), SECS_PER_CYCLE * ((ScrollingTextRows - i) * 2 + 1 ), (ScrollingTextStartY + (ScrollingTextEndY - ScrollingTextStartY) * (ScrollingTextRows - i + 0.5) / ScrollingTextRows )); + RString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;", SECS_PER_CYCLE * (NumUnlocks + 2 * i - 2), SECS_PER_CYCLE * ((ScrollingTextRows - i) * 2 + 1 ), (ScrollingTextStartY + (ScrollingTextEndY - ScrollingTextStartY) * (ScrollingTextRows - i + 0.5) / ScrollingTextRows )); NewIcon->RunCommands( ActorCommands(sCommand) ); } @@ -285,16 +285,16 @@ void ScreenUnlock::Init() PointsUntilNextUnlock.SetName( "PointsDisplay" ); - CString PointDisplay = TYPE_TO_DISPLAY; + RString PointDisplay = TYPE_TO_DISPLAY; if (PointDisplay == "DP" || PointDisplay == "Dance") { - CString sDP = ssprintf( "%d", (int)UNLOCKMAN->DancePointsUntilNextUnlock() ); + RString sDP = ssprintf( "%d", (int)UNLOCKMAN->DancePointsUntilNextUnlock() ); PointsUntilNextUnlock.SetText( sDP ); } else if (PointDisplay == "AP" || PointDisplay == "Arcade") { - CString sAP = ssprintf( "%d", (int)UNLOCKMAN->ArcadePointsUntilNextUnlock() ); + RString sAP = ssprintf( "%d", (int)UNLOCKMAN->ArcadePointsUntilNextUnlock() ); PointsUntilNextUnlock.SetText( sAP ); } else if (PointDisplay == "SP" || PointDisplay == "Song") { - CString sSP = ssprintf( "%d", (int)UNLOCKMAN->SongPointsUntilNextUnlock() ); + RString sSP = ssprintf( "%d", (int)UNLOCKMAN->SongPointsUntilNextUnlock() ); PointsUntilNextUnlock.SetText( sSP ); } diff --git a/stepmania/src/ScreenWithMenuElements.cpp b/stepmania/src/ScreenWithMenuElements.cpp index dd5801a017..a2d020fc26 100644 --- a/stepmania/src/ScreenWithMenuElements.cpp +++ b/stepmania/src/ScreenWithMenuElements.cpp @@ -49,7 +49,7 @@ void ScreenWithMenuElements::Init() if( STYLE_ICON && GAMESTATE->m_pCurStyle ) { m_sprStyleIcon.SetName( "StyleIcon" ); - m_sprStyleIcon.Load( THEME->GetPathG("MenuElements",CString("icon ")+GAMESTATE->GetCurrentStyle()->m_szName) ); + m_sprStyleIcon.Load( THEME->GetPathG("MenuElements",RString("icon ")+GAMESTATE->GetCurrentStyle()->m_szName) ); m_sprStyleIcon.StopAnimating(); m_sprStyleIcon.SetState( GAMESTATE->m_MasterPlayerNumber ); SET_XY( m_sprStyleIcon ); @@ -193,8 +193,8 @@ ScreenWithMenuElements::~ScreenWithMenuElements() void ScreenWithMenuElements::LoadHelpText() { - vector vs; - CString s = THEME->GetString(m_sName,"HelpText"); + vector vs; + RString s = THEME->GetString(m_sName,"HelpText"); split( s, "::", vs ); m_textHelp->SetTips( vs ); diff --git a/stepmania/src/ScreenWithMenuElements.h b/stepmania/src/ScreenWithMenuElements.h index 2526b167aa..7c7452f7ec 100644 --- a/stepmania/src/ScreenWithMenuElements.h +++ b/stepmania/src/ScreenWithMenuElements.h @@ -63,7 +63,7 @@ protected: ThemeMetric TIMER_SECONDS; private: - CString m_sPathToMusic; + RString m_sPathToMusic; }; #endif diff --git a/stepmania/src/ScrollingList.cpp b/stepmania/src/ScrollingList.cpp index 1ad20d03dc..dd1a3ac29d 100644 --- a/stepmania/src/ScrollingList.cpp +++ b/stepmania/src/ScrollingList.cpp @@ -143,7 +143,7 @@ void ScrollingList::StopBouncing() Allows us to create a graphic element in the scrolling list *************************************/ -void ScrollingList::Load( const vector& asGraphicPaths ) +void ScrollingList::Load( const vector& asGraphicPaths ) { Unload(); if(m_iSpriteType == SPRITE_TYPE_SPRITE) @@ -384,7 +384,7 @@ void ScrollingList::Update( float fDeltaTime ) } } -void ScrollingList::Replace(CString sGraphicPath, int ElementNumber) +void ScrollingList::Replace(RString sGraphicPath, int ElementNumber) { if(m_iSpriteType == SPRITE_TYPE_SPRITE) { diff --git a/stepmania/src/ScrollingList.h b/stepmania/src/ScrollingList.h index e0e33c7257..47629a3b68 100644 --- a/stepmania/src/ScrollingList.h +++ b/stepmania/src/ScrollingList.h @@ -13,13 +13,13 @@ public: ScrollingList(); ~ScrollingList(); - void Load( const vector& asGraphicPaths ); + void Load( const vector& asGraphicPaths ); void Unload(); // delete all items. Called automatically on Load() virtual void Update( float fDeltaTime ); virtual void DrawPrimitives(); - void Replace(CString sGraphicPath, int ElementNumber); + void Replace(RString sGraphicPath, int ElementNumber); void SetSelection( int iIndex ); int GetSelection(); diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 42ad0ce0af..3a02f7c7f6 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -151,20 +151,20 @@ const BackgroundChange &Song::GetBackgroundAtBeat( BackgroundLayer iLayer, float } -CString Song::GetCacheFilePath() const +RString Song::GetCacheFilePath() const { return SongCacheIndex::GetCacheFilePath( "Songs", m_sSongDir ); } /* Get a path to the SM containing data for this song. It might * be a cache file. */ -const CString &Song::GetSongFilePath() const +const RString &Song::GetSongFilePath() const { ASSERT( !m_sSongFileName.empty() ); return m_sSongFileName; } -NotesLoader *Song::MakeLoader( CString sDir ) const +NotesLoader *Song::MakeLoader( RString sDir ) const { NotesLoader *ret; @@ -201,7 +201,7 @@ static set BlacklistedImages; * * If true, check the directory hash and reload the song from scratch if it's changed. */ -bool Song::LoadFromSongDir( CString sDir ) +bool Song::LoadFromSongDir( RString sDir ) { // LOG->Trace( "Song::LoadFromSongDir(%s)", sDir.c_str() ); ASSERT( sDir != "" ); @@ -214,7 +214,7 @@ bool Song::LoadFromSongDir( CString sDir ) m_sSongDir = sDir; // save group name - vector sDirectoryParts; + vector sDirectoryParts; split( m_sSongDir, "/", sDirectoryParts, false ); ASSERT( sDirectoryParts.size() >= 4 ); /* e.g. "/Songs/Slow/Taps/" */ m_sGroupName = sDirectoryParts[sDirectoryParts.size()-3]; // second from last item @@ -265,7 +265,7 @@ bool Song::LoadFromSongDir( CString sDir ) { LOG->Warn( "Couldn't find any SM, DWI, BMS, or KSF files in '%s'.", sDir.c_str() ); - vector vs; + vector vs; GetDirListing( sDir + "*.mp3", vs, false, false ); GetDirListing( sDir + "*.ogg", vs, false, false ); bool bHasMusic = !vs.empty(); @@ -311,7 +311,7 @@ bool Song::LoadFromSongDir( CString sDir ) return true; // do load this song } -static void GetImageDirListing( CString sPath, vector &AddTo, bool bReturnPathToo=false ) +static void GetImageDirListing( RString sPath, vector &AddTo, bool bReturnPathToo=false ) { GetDirListing( sPath + ".png", AddTo, false, bReturnPathToo ); GetDirListing( sPath + ".jpg", AddTo, false, bReturnPathToo ); @@ -319,7 +319,7 @@ static void GetImageDirListing( CString sPath, vector &AddTo, bool bRet GetDirListing( sPath + ".gif", AddTo, false, bReturnPathToo ); } -static CString RemoveInitialWhitespace( CString s ) +static RString RemoveInitialWhitespace( RString s ) { size_t i = s.find_first_not_of(" \t\r\n"); if( i != s.npos ) @@ -348,9 +348,9 @@ void Song::DeleteDuplicateSteps( vector &vSteps ) if( s1->GetMeter() != s2->GetMeter() ) continue; /* Compare, ignoring whitespace. */ - CString sSMNoteData1; + RString sSMNoteData1; s1->GetSMNoteData( sSMNoteData1 ); - CString sSMNoteData2; + RString sSMNoteData2; s2->GetSMNoteData( sSMNoteData2 ); if( RemoveInitialWhitespace(sSMNoteData1) != RemoveInitialWhitespace(sSMNoteData2) ) continue; @@ -416,7 +416,7 @@ void Song::AdjustDuplicateSteps() if( vSteps[k]->GetDescription() == "" ) { /* "Hard Edit" */ - CString EditName = Capitalize( DifficultyToString(dc) ) + " Edit"; + RString EditName = Capitalize( DifficultyToString(dc) ) + " Edit"; vSteps[k]->SetDescription( EditName ); } } @@ -430,7 +430,7 @@ void Song::AdjustDuplicateSteps() /* Fix up song paths. If there's a leading "./", be sure to keep it: it's * a signal that the path is from the root directory, not the song directory. * Other than a leading "./", song paths must never contain "." or "..". */ -void FixupPath( CString &path, const CString &sSongPath ) +void FixupPath( RString &path, const RString &sSongPath ) { /* Replace backslashes with slashes in all paths. */ FixSlashesInPlace( path ); @@ -456,10 +456,10 @@ void Song::TidyUpData() if( !HasMusic() ) { - vector arrayPossibleMusic; - GetDirListing( m_sSongDir + CString("*.mp3"), arrayPossibleMusic ); - GetDirListing( m_sSongDir + CString("*.ogg"), arrayPossibleMusic ); - GetDirListing( m_sSongDir + CString("*.wav"), arrayPossibleMusic ); + vector arrayPossibleMusic; + GetDirListing( m_sSongDir + RString("*.mp3"), arrayPossibleMusic ); + GetDirListing( m_sSongDir + RString("*.ogg"), arrayPossibleMusic ); + GetDirListing( m_sSongDir + RString("*.wav"), arrayPossibleMusic ); if( !arrayPossibleMusic.empty() ) { @@ -478,7 +478,7 @@ void Song::TidyUpData() /* This must be done before radar calculation. */ if( HasMusic() ) { - CString error; + RString error; SoundReader *Sample = SoundReader_FileReader::OpenFile( GetMusicPath(), error ); /* XXX: Checking if the music file exists eliminates a warning originating from BMS files * (which have no music file, per se) but it's something of a hack. */ @@ -588,7 +588,7 @@ void Song::TidyUpData() // m_sBannerFile = ""; // find an image with "banner" in the file name - vector arrayPossibleBanners; + vector arrayPossibleBanners; GetImageDirListing( m_sSongDir + "*banner*", arrayPossibleBanners ); /* Some people do things differently for the sake of being different. Don't @@ -604,7 +604,7 @@ void Song::TidyUpData() // m_sBackgroundFile = ""; // find an image with "bg" or "background" in the file name - vector arrayPossibleBGs; + vector arrayPossibleBGs; GetImageDirListing( m_sSongDir + "*bg*", arrayPossibleBGs ); GetImageDirListing( m_sSongDir + "*background*", arrayPossibleBGs ); if( !arrayPossibleBGs.empty() ) @@ -614,7 +614,7 @@ void Song::TidyUpData() if( !HasCDTitle() ) { // find an image with "cdtitle" in the file name - vector arrayPossibleCDTitles; + vector arrayPossibleCDTitles; GetImageDirListing( m_sSongDir + "*cdtitle*", arrayPossibleCDTitles ); if( !arrayPossibleCDTitles.empty() ) m_sCDTitleFile = arrayPossibleCDTitles[0]; @@ -623,8 +623,8 @@ void Song::TidyUpData() if( !HasLyrics() ) { // Check if there is a lyric file in here - vector arrayLyricFiles; - GetDirListing(m_sSongDir + CString("*.lrc"), arrayLyricFiles ); + vector arrayLyricFiles; + GetDirListing(m_sSongDir + RString("*.lrc"), arrayLyricFiles ); if( !arrayLyricFiles.empty() ) m_sLyricsFile = arrayLyricFiles[0]; } @@ -632,7 +632,7 @@ void Song::TidyUpData() // // Now, For the images we still haven't found, look at the image dimensions of the remaining unclassified images. // - vector arrayImages; + vector arrayImages; GetImageDirListing( m_sSongDir + "*", arrayImages ); for( unsigned i=0; i arrayPossibleMovies; - GetDirListing( m_sSongDir + CString("*.avi"), arrayPossibleMovies ); - GetDirListing( m_sSongDir + CString("*.mpg"), arrayPossibleMovies ); - GetDirListing( m_sSongDir + CString("*.mpeg"), arrayPossibleMovies ); + vector arrayPossibleMovies; + GetDirListing( m_sSongDir + RString("*.avi"), arrayPossibleMovies ); + GetDirListing( m_sSongDir + RString("*.mpg"), arrayPossibleMovies ); + GetDirListing( m_sSongDir + RString("*.mpeg"), arrayPossibleMovies ); /* Use this->GetBeatFromElapsedTime(0) instead of 0 to start when the * music starts. */ if( arrayPossibleMovies.size() == 1 ) @@ -762,7 +762,7 @@ void Song::TidyUpData() * filename, and should always be the title of the song (unlike KSFs). */ m_sSongFileName = m_sSongDir; - vector asFileNames; + vector asFileNames; GetDirListing( m_sSongDir+"*.sm", asFileNames ); if( !asFileNames.empty() ) m_sSongFileName += asFileNames[0]; @@ -839,7 +839,7 @@ void Song::GetSteps( Difficulty dc, int iMeterLow, int iMeterHigh, - const CString &sDescription, + const RString &sDescription, bool bIncludeAutoGen, unsigned uHash, int iMaxToGet @@ -882,7 +882,7 @@ Steps* Song::GetOneSteps( Difficulty dc, int iMeterLow, int iMeterHigh, - const CString &sDescription, + const RString &sDescription, unsigned uHash, bool bIncludeAutoGen ) const @@ -931,7 +931,7 @@ Steps* Song::GetStepsByMeter( StepsType st, int iMeterLow, int iMeterHigh ) cons return NULL; } -Steps* Song::GetStepsByDescription( StepsType st, CString sDescription ) const +Steps* Song::GetStepsByDescription( StepsType st, RString sDescription ) const { vector vNotes; GetSteps( vNotes, st, DIFFICULTY_INVALID, -1, -1, sDescription ); @@ -999,14 +999,14 @@ void Song::Save() /* We've safely written our files and created backups. Rename non-SM and non-DWI * files to avoid confusion. */ - vector arrayOldFileNames; + vector arrayOldFileNames; GetDirListing( m_sSongDir + "*.bms", arrayOldFileNames ); GetDirListing( m_sSongDir + "*.ksf", arrayOldFileNames ); for( unsigned i=0; iTrace( "Song::SaveToSMFile('%s')", sPath.c_str() ); @@ -1038,7 +1038,7 @@ void Song::SaveToCacheFile() void Song::SaveToDWIFile() { - const CString sPath = SetExtension( GetSongFilePath(), "dwi" ); + const RString sPath = SetExtension( GetSongFilePath(), "dwi" ); LOG->Trace( "Song::SaveToDWIFile(%s)", sPath.c_str() ); /* If the file exists, make a backup. */ @@ -1248,10 +1248,10 @@ vector &Song::GetForegroundChanges() } -CString GetSongAssetPath( CString sPath, const CString &sSongPath ) +RString GetSongAssetPath( RString sPath, const RString &sSongPath ) { if( sPath == "" ) - return CString(); + return RString(); /* If there's no path in the file, the file is in the same directory * as the song. (This is the preferred configuration.) */ @@ -1270,7 +1270,7 @@ CString GetSongAssetPath( CString sPath, const CString &sSongPath ) /* If the path still begins with "../", then there were an unreasonable number * of them at the beginning of the path. Ignore the path entirely. */ if( sPath.Left(3) == "../" ) - return CString(); + return RString(); return sPath; } @@ -1278,63 +1278,63 @@ CString GetSongAssetPath( CString sPath, const CString &sSongPath ) /* Note that supplying a path relative to the top-level directory is only for compatibility * with DWI. We prefer paths relative to the song directory. */ -CString Song::GetMusicPath() const +RString Song::GetMusicPath() const { return GetSongAssetPath( m_sMusicFile, m_sSongDir ); } -CString Song::GetBannerPath() const +RString Song::GetBannerPath() const { return GetSongAssetPath( m_sBannerFile, m_sSongDir ); } -CString Song::GetLyricsPath() const +RString Song::GetLyricsPath() const { return GetSongAssetPath( m_sLyricsFile, m_sSongDir ); } -CString Song::GetCDTitlePath() const +RString Song::GetCDTitlePath() const { return GetSongAssetPath( m_sCDTitleFile, m_sSongDir ); } -CString Song::GetBackgroundPath() const +RString Song::GetBackgroundPath() const { return GetSongAssetPath( m_sBackgroundFile, m_sSongDir ); } -CString Song::GetDisplayMainTitle() const +RString Song::GetDisplayMainTitle() const { if(!PREFSMAN->m_bShowNativeLanguage) return GetTranslitMainTitle(); return m_sMainTitle; } -CString Song::GetDisplaySubTitle() const +RString Song::GetDisplaySubTitle() const { if(!PREFSMAN->m_bShowNativeLanguage) return GetTranslitSubTitle(); return m_sSubTitle; } -CString Song::GetDisplayArtist() const +RString Song::GetDisplayArtist() const { if(!PREFSMAN->m_bShowNativeLanguage) return GetTranslitArtist(); return m_sArtist; } -CString Song::GetDisplayFullTitle() const +RString Song::GetDisplayFullTitle() const { - CString Title = GetDisplayMainTitle(); - CString SubTitle = GetDisplaySubTitle(); + RString Title = GetDisplayMainTitle(); + RString SubTitle = GetDisplaySubTitle(); if(!SubTitle.empty()) Title += " " + SubTitle; return Title; } -CString Song::GetTranslitFullTitle() const +RString Song::GetTranslitFullTitle() const { - CString Title = GetTranslitMainTitle(); - CString SubTitle = GetTranslitSubTitle(); + RString Title = GetTranslitMainTitle(); + RString SubTitle = GetTranslitSubTitle(); if(!SubTitle.empty()) Title += " " + SubTitle; return Title; @@ -1379,17 +1379,17 @@ void Song::DeleteSteps( const Steps* pSteps ) AddAutoGenNotes(); } -bool Song::Matches(CString sGroup, CString sSong) const +bool Song::Matches(RString sGroup, RString sSong) const { if( sGroup.size() && sGroup.CompareNoCase(this->m_sGroupName) != 0) return false; - CString sDir = this->GetSongDir(); + RString sDir = this->GetSongDir(); sDir.Replace("\\","/"); - vector bits; + vector bits; split( sDir, "/", bits ); ASSERT(bits.size() >= 2); /* should always have at least two parts */ - const CString &sLastBit = bits[bits.size()-1]; + const RString &sLastBit = bits[bits.size()-1]; // match on song dir or title (ala DWI) if( !sSong.CompareNoCase(sLastBit) ) @@ -1483,7 +1483,7 @@ float Song::GetStepsSeconds() const return GetElapsedTimeFromBeat( m_fLastBeat ) - GetElapsedTimeFromBeat( m_fFirstBeat ); } -bool Song::IsEditDescriptionUnique( StepsType st, CString sPreferredDescription, const Steps *pExclude ) const +bool Song::IsEditDescriptionUnique( StepsType st, RString sPreferredDescription, const Steps *pExclude ) const { FOREACH_CONST( Steps*, m_vpSteps, s ) { @@ -1501,17 +1501,17 @@ bool Song::IsEditDescriptionUnique( StepsType st, CString sPreferredDescription, return true; } -void Song::MakeUniqueEditDescription( StepsType st, CString &sPreferredDescriptionInOut ) const +void Song::MakeUniqueEditDescription( StepsType st, RString &sPreferredDescriptionInOut ) const { if( IsEditDescriptionUnique( st, sPreferredDescriptionInOut, NULL ) ) return; - CString sTemp; + RString sTemp; for( int i=0; i<1000; i++ ) { // make name "My Edit" -> "My Edit2" - CString sNum = ssprintf("%d", i+1); + RString sNum = ssprintf("%d", i+1); sTemp = sPreferredDescriptionInOut.Left( MAX_EDIT_STEPS_DESCRIPTION_LENGTH - sNum.size() ) + sNum; if( IsEditDescriptionUnique(st, sTemp, NULL) ) diff --git a/stepmania/src/SongCacheIndex.cpp b/stepmania/src/SongCacheIndex.cpp index 56e302e251..58bb40568c 100644 --- a/stepmania/src/SongCacheIndex.cpp +++ b/stepmania/src/SongCacheIndex.cpp @@ -29,7 +29,7 @@ SongCacheIndex *SONGINDEX; -CString SongCacheIndex::GetCacheFilePath( const CString &sGroup, const CString &sPath ) +RString SongCacheIndex::GetCacheFilePath( const RString &sGroup, const RString &sPath ) { /* Use GetHashForString, not ForFile, since we don't want to spend time * checking the file size and date. */ @@ -46,11 +46,11 @@ SongCacheIndex::~SongCacheIndex() } -static void EmptyDir( CString dir ) +static void EmptyDir( RString dir ) { ASSERT(dir[dir.size()-1] == '/'); - vector asCacheFileNames; + vector asCacheFileNames; GetDirListing( dir, asCacheFileNames ); for( unsigned i=0; i arrayFiles; + vector arrayFiles; GetDirListing( sDir + "/*.mp3", arrayFiles ); GetDirListing( sDir + "/*.ogg", arrayFiles ); GetDirListing( sDir + "/*.wav", arrayFiles ); @@ -117,7 +117,7 @@ void SongManager::SanityCheckGroupDir( CString sDir ) const RageException::Throw( FOLDER_CONTAINS_MUSIC_FILES.GetValue(), sDir.c_str() ); } -void SongManager::AddGroup( CString sDir, CString sGroupDirName ) +void SongManager::AddGroup( RString sDir, RString sGroupDirName ) { unsigned j; for(j = 0; j < m_sSongGroupNames.size(); ++j) @@ -127,13 +127,13 @@ void SongManager::AddGroup( CString sDir, CString sGroupDirName ) return; /* the group is already added */ // Look for a group banner in this group folder - vector arrayGroupBanners; + vector arrayGroupBanners; GetDirListing( sDir+sGroupDirName+"/*.png", arrayGroupBanners ); GetDirListing( sDir+sGroupDirName+"/*.jpg", arrayGroupBanners ); GetDirListing( sDir+sGroupDirName+"/*.gif", arrayGroupBanners ); GetDirListing( sDir+sGroupDirName+"/*.bmp", arrayGroupBanners ); - CString sBannerPath; + RString sBannerPath; if( !arrayGroupBanners.empty() ) sBannerPath = sDir+sGroupDirName+"/"+arrayGroupBanners[0] ; else @@ -154,26 +154,26 @@ void SongManager::AddGroup( CString sDir, CString sGroupDirName ) } static LocalizedString LOADING_SONGS ( "SongManager", "Loading songs..." ); -void SongManager::LoadStepManiaSongDir( CString sDir, LoadingWindow *ld ) +void SongManager::LoadStepManiaSongDir( RString sDir, LoadingWindow *ld ) { /* Make sure sDir has a trailing slash. */ if( sDir.Right(1) != "/" ) sDir += "/"; // Find all group directories in "Songs" folder - vector arrayGroupDirs; + vector arrayGroupDirs; GetDirListing( sDir+"*", arrayGroupDirs, true ); SortRStringArray( arrayGroupDirs ); StripCvs( arrayGroupDirs ); - FOREACH_CONST( CString, arrayGroupDirs, s ) // foreach dir in /Songs/ + FOREACH_CONST( RString, arrayGroupDirs, s ) // foreach dir in /Songs/ { - CString sGroupDirName = *s; + RString sGroupDirName = *s; SanityCheckGroupDir(sDir+sGroupDirName); // Find all Song folders in this group directory - vector arraySongDirs; + vector arraySongDirs; GetDirListing( sDir+sGroupDirName + "/*", arraySongDirs, true, true ); StripCvs( arraySongDirs ); SortRStringArray( arraySongDirs ); @@ -184,7 +184,7 @@ void SongManager::LoadStepManiaSongDir( CString sDir, LoadingWindow *ld ) for( unsigned j=0; j< arraySongDirs.size(); ++j ) // for each song dir { - CString sSongDirName = arraySongDirs[j]; + RString sSongDirName = arraySongDirs[j]; // this is a song directory. Load a new song! if( ld ) @@ -224,17 +224,17 @@ void SongManager::LoadStepManiaSongDir( CString sDir, LoadingWindow *ld ) // Instead of "symlinks", songs should have membership in multiple groups. // -Chris -void SongManager::LoadGroupSymLinks(CString sDir, CString sGroupFolder) +void SongManager::LoadGroupSymLinks(RString sDir, RString sGroupFolder) { // Find all symlink files in this folder - vector arraySymLinks; + vector arraySymLinks; GetDirListing( sDir+sGroupFolder+"/*.include", arraySymLinks, false ); SortRStringArray( arraySymLinks ); for( unsigned s=0; s< arraySymLinks.size(); s++ ) // for each symlink in this dir, add it in as a song. { MsdFile msdF; msdF.ReadFile( sDir+sGroupFolder+"/"+arraySymLinks[s].c_str() ); - CString sSymDestination = msdF.GetParam(0,1); // Should only be 1 vale¶m...period. + RString sSymDestination = msdF.GetParam(0,1); // Should only be 1 vale¶m...period. Song* pNewSong = new Song; if( !pNewSong->LoadFromSongDir( sSymDestination ) ) @@ -306,7 +306,7 @@ void SongManager::FreeSongs() m_pShuffledSongs.clear(); } -CString SongManager::GetSongGroupBannerPath( CString sSongGroup ) +RString SongManager::GetSongGroupBannerPath( RString sSongGroup ) { for( unsigned i = 0; i < m_sSongGroupNames.size(); ++i ) { @@ -314,20 +314,20 @@ CString SongManager::GetSongGroupBannerPath( CString sSongGroup ) return m_sSongGroupBannerPaths[i]; } - return CString(); + return RString(); } -void SongManager::GetSongGroupNames( vector &AddTo ) +void SongManager::GetSongGroupNames( vector &AddTo ) { AddTo.insert(AddTo.end(), m_sSongGroupNames.begin(), m_sSongGroupNames.end() ); } -bool SongManager::DoesSongGroupExist( CString sSongGroup ) +bool SongManager::DoesSongGroupExist( RString sSongGroup ) { return find( m_sSongGroupNames.begin(), m_sSongGroupNames.end(), sSongGroup ) != m_sSongGroupNames.end(); } -RageColor SongManager::GetSongGroupColor( const CString &sSongGroup ) +RageColor SongManager::GetSongGroupColor( const RString &sSongGroup ) { for( unsigned i=0; im_sGroupName ); } -CString SongManager::GetCourseGroupBannerPath( const CString &sCourseGroup ) +RString SongManager::GetCourseGroupBannerPath( const RString &sCourseGroup ) { - map::const_iterator iter = m_mapCourseGroupToInfo.find( sCourseGroup ); + map::const_iterator iter = m_mapCourseGroupToInfo.find( sCourseGroup ); if( iter == m_mapCourseGroupToInfo.end() ) { ASSERT_M( 0, ssprintf("requested banner for course group '%s' that doesn't exist",sCourseGroup.c_str()) ); - return CString(); + return RString(); } else { @@ -391,21 +391,21 @@ CString SongManager::GetCourseGroupBannerPath( const CString &sCourseGroup ) } } -void SongManager::GetCourseGroupNames( vector &AddTo ) +void SongManager::GetCourseGroupNames( vector &AddTo ) { - FOREACHM_CONST( CString, CourseGroupInfo, m_mapCourseGroupToInfo, iter ) + FOREACHM_CONST( RString, CourseGroupInfo, m_mapCourseGroupToInfo, iter ) AddTo.push_back( iter->first ); } -bool SongManager::DoesCourseGroupExist( const CString &sCourseGroup ) +bool SongManager::DoesCourseGroupExist( const RString &sCourseGroup ) { return m_mapCourseGroupToInfo.find( sCourseGroup ) != m_mapCourseGroupToInfo.end(); } -RageColor SongManager::GetCourseGroupColor( const CString &sCourseGroup ) +RageColor SongManager::GetCourseGroupColor( const RString &sCourseGroup ) { int iIndex = 0; - FOREACHM_CONST( CString, CourseGroupInfo, m_mapCourseGroupToInfo, iter ) + FOREACHM_CONST( RString, CourseGroupInfo, m_mapCourseGroupToInfo, iter ) { if( iter->first == sCourseGroup ) return SONG_GROUP_COLOR.GetValue( iIndex%NUM_SONG_GROUP_COLORS ); @@ -421,7 +421,7 @@ RageColor SongManager::GetCourseColor( const Course* pCourse ) return GetCourseGroupColor( pCourse->m_sGroupName ); } -static void GetSongsFromVector( const vector &Songs, vector &AddTo, CString sGroupName, int iMaxStages ) +static void GetSongsFromVector( const vector &Songs, vector &AddTo, RString sGroupName, int iMaxStages ) { AddTo.clear(); @@ -431,12 +431,12 @@ static void GetSongsFromVector( const vector &Songs, vector &AddTo AddTo.push_back( Songs[i] ); } -void SongManager::GetSongs( vector &AddTo, CString sGroupName, int iMaxStages ) const +void SongManager::GetSongs( vector &AddTo, RString sGroupName, int iMaxStages ) const { GetSongsFromVector( m_pSongs, AddTo, sGroupName, iMaxStages ); } -void SongManager::GetBestSongs( vector &AddTo, CString sGroupName, int iMaxStages, ProfileSlot slot ) const +void SongManager::GetBestSongs( vector &AddTo, RString sGroupName, int iMaxStages, ProfileSlot slot ) const { GetSongsFromVector( m_pBestSongs[slot], AddTo, sGroupName, iMaxStages ); } @@ -472,7 +472,7 @@ int SongManager::GetNumEditCourses( ProfileSlot slot ) const return iNum; } -CString SongManager::ShortenGroupName( CString sLongGroupName ) +RString SongManager::ShortenGroupName( RString sLongGroupName ) { static TitleSubst tsub("Groups"); @@ -503,7 +503,7 @@ void SongManager::InitCoursesFromDisk( LoadingWindow *ld ) // Load courses from in Courses dir // { - vector saCourseFiles; + vector saCourseFiles; GetDirListing( COURSES_DIR+"*.crs", saCourseFiles, false, true ); for( unsigned i=0; i vsCourseGroupNames; + vector vsCourseGroupNames; GetDirListing( COURSES_DIR+"*", vsCourseGroupNames, true ); StripCvs( vsCourseGroupNames ); SortRStringArray( vsCourseGroupNames ); - FOREACH( CString, vsCourseGroupNames, sCourseGroup ) // for each dir in /Courses/ + FOREACH( RString, vsCourseGroupNames, sCourseGroup ) // for each dir in /Courses/ { // Find all CRS files in this group directory - vector vsCoursePaths; + vector vsCoursePaths; GetDirListing( COURSES_DIR + *sCourseGroup + "/*.crs", vsCoursePaths, false, true ); SortRStringArray( vsCoursePaths ); - FOREACH_CONST( CString, vsCoursePaths, sCoursePath ) + FOREACH_CONST( RString, vsCoursePaths, sCoursePath ) { if( ld ) { @@ -561,12 +561,12 @@ void SongManager::InitAutogenCourses() // // Create group courses for Endless and Nonstop // - vector saGroupNames; + vector saGroupNames; this->GetSongGroupNames( saGroupNames ); Course* pCourse; for( unsigned g=0; g apGroupSongs; GetSongs( apGroupSongs, sGroupName ); @@ -596,15 +596,15 @@ void SongManager::InitAutogenCourses() vector apSongs = this->GetAllSongs(); SongUtil::SortSongPointerArrayByDisplayArtist( apSongs ); - CString sCurArtist = ""; - CString sCurArtistTranslit = ""; + RString sCurArtist = ""; + RString sCurArtistTranslit = ""; int iCurArtistCount = 0; vector aSongs; unsigned i = 0; do { - CString sArtist = i >= apSongs.size()? CString(""): apSongs[i]->GetDisplayArtist(); - CString sTranslitArtist = i >= apSongs.size()? CString(""): apSongs[i]->GetTranslitArtist(); + RString sArtist = i >= apSongs.size()? RString(""): apSongs[i]->GetDisplayArtist(); + RString sTranslitArtist = i >= apSongs.size()? RString(""): apSongs[i]->GetTranslitArtist(); if( i < apSongs.size() && !sCurArtist.CompareNoCase(sArtist) ) { aSongs.push_back( apSongs[i] ); @@ -812,7 +812,7 @@ void SongManager::RevertFromDisk( Song *pSong, bool bAllowNotesLoss ) // // Reload the song // - const CString dir = pSong->GetSongDir(); + const RString dir = pSong->GetSongDir(); FILEMAN->FlushDirCache( dir ); /* Erase existing data and reload. */ @@ -915,7 +915,7 @@ void SongManager::GetCourses( CourseType ct, vector &AddTo, bool bInclu AddTo.push_back( m_pCourses[i] ); } -void SongManager::GetCoursesInGroup( vector &AddTo, const CString &sCourseGroup, bool bIncludeAutogen ) +void SongManager::GetCoursesInGroup( vector &AddTo, const RString &sCourseGroup, bool bIncludeAutogen ) { for( unsigned i=0; im_sGroupName == sCourseGroup ) @@ -923,11 +923,11 @@ void SongManager::GetCoursesInGroup( vector &AddTo, const CString &sCou AddTo.push_back( m_pCourses[i] ); } -bool SongManager::GetExtraStageInfoFromCourse( bool bExtra2, CString sPreferredGroup, +bool SongManager::GetExtraStageInfoFromCourse( bool bExtra2, RString sPreferredGroup, Song*& pSongOut, Steps*& pStepsOut, PlayerOptions *pPlayerOptionsOut, SongOptions *pSongOptionsOut ) { - const CString sCourseSuffix = sPreferredGroup + "/" + (bExtra2 ? "extra2" : "extra1") + ".crs"; - CString sCoursePath = SONGS_DIR + sCourseSuffix; + const RString sCourseSuffix = sPreferredGroup + "/" + (bExtra2 ? "extra2" : "extra1") + ".crs"; + RString sCoursePath = SONGS_DIR + sCourseSuffix; /* Couldn't find course in DWI path or alternative song folders */ if( !DoesFileExist(sCoursePath) ) @@ -978,7 +978,7 @@ bool CompareNotesPointersForExtra(const Steps *n1, const Steps *n2) void SongManager::GetExtraStageInfo( bool bExtra2, const Style *sd, Song*& pSongOut, Steps*& pStepsOut, PlayerOptions *pPlayerOptionsOut, SongOptions *pSongOptionsOut ) { - CString sGroup = GAMESTATE->m_sPreferredSongGroup; + RString sGroup = GAMESTATE->m_sPreferredSongGroup; if( sGroup == GROUP_ALL ) { if( GAMESTATE->m_pCurSong == NULL ) @@ -1109,7 +1109,7 @@ Course* SongManager::GetRandomCourse() return NULL; } -Song* SongManager::GetSongFromDir( CString sDir ) +Song* SongManager::GetSongFromDir( RString sDir ) { if( sDir.Right(1) != "/" ) sDir += "/"; @@ -1123,7 +1123,7 @@ Song* SongManager::GetSongFromDir( CString sDir ) return NULL; } -Course* SongManager::GetCourseFromPath( CString sPath ) +Course* SongManager::GetCourseFromPath( RString sPath ) { if( sPath == "" ) return NULL; @@ -1137,7 +1137,7 @@ Course* SongManager::GetCourseFromPath( CString sPath ) return NULL; } -Course* SongManager::GetCourseFromName( CString sName ) +Course* SongManager::GetCourseFromName( RString sName ) { if( sName == "" ) return NULL; @@ -1167,10 +1167,10 @@ Course* SongManager::GetCourseFromName( CString sName ) * songs in "Songs"; we don't want that. */ -Song *SongManager::FindSong( CString sPath ) +Song *SongManager::FindSong( RString sPath ) { sPath.Replace( '\\', '/' ); - vector bits; + vector bits; split( sPath, "/", bits ); if( bits.size() == 1 ) @@ -1181,7 +1181,7 @@ Song *SongManager::FindSong( CString sPath ) return NULL; } -Song *SongManager::FindSong( CString sGroup, CString sSong ) +Song *SongManager::FindSong( RString sGroup, RString sSong ) { // foreach song for( unsigned i = 0; i < m_pSongs.size(); i++ ) @@ -1193,7 +1193,7 @@ Song *SongManager::FindSong( CString sGroup, CString sSong ) return NULL; } -Course *SongManager::FindCourse( CString sName ) +Course *SongManager::FindCourse( RString sName ) { for( unsigned i = 0; i < m_pCourses.size(); i++ ) { @@ -1269,7 +1269,7 @@ void SongManager::UpdateRankingCourses() { /* Updating the ranking courses data is fairly expensive * since it involves comparing strings. Do so sparingly. */ - vector RankingCourses; + vector RankingCourses; split( THEME->GetMetric("ScreenRanking","CoursesToShow"),",", RankingCourses); for( unsigned i=0; i < m_pCourses.size(); i++ ) @@ -1295,20 +1295,20 @@ void SongManager::RefreshCourseGroupInfo() } // TODO: Search for course group banners - FOREACHM( CString, CourseGroupInfo, m_mapCourseGroupToInfo, iter ) + FOREACHM( RString, CourseGroupInfo, m_mapCourseGroupToInfo, iter ) { } } -void SongManager::LoadAllFromProfileDir( const CString &sProfileDir, ProfileSlot slot ) +void SongManager::LoadAllFromProfileDir( const RString &sProfileDir, ProfileSlot slot ) { { // // Load all edit steps // - CString sDir = sProfileDir + EDIT_STEPS_SUBDIR; + RString sDir = sProfileDir + EDIT_STEPS_SUBDIR; - vector vsFiles; + vector vsFiles; GetDirListing( sDir+"*.edit", vsFiles, false, true ); int iNumEditsLoaded = GetNumEditsLoadedFromProfile( slot ); @@ -1316,7 +1316,7 @@ void SongManager::LoadAllFromProfileDir( const CString &sProfileDir, ProfileSlot for( int i=0; i vsFiles; + vector vsFiles; GetDirListing( sDir+"*.crs", vsFiles, false, true ); int iNumEditsLoaded = GetNumEditsLoadedFromProfile( slot ); @@ -1336,7 +1336,7 @@ void SongManager::LoadAllFromProfileDir( const CString &sProfileDir, ProfileSlot for( int i=0; i &AddTo ); - bool DoesSongGroupExist( CString sSongGroup ); - RageColor GetSongGroupColor( const CString &sSongGroupName ); + RString GetSongGroupBannerPath( RString sSongGroup ); + void GetSongGroupNames( vector &AddTo ); + bool DoesSongGroupExist( RString sSongGroup ); + RageColor GetSongGroupColor( const RString &sSongGroupName ); RageColor GetSongColor( const Song* pSong ); - CString GetCourseGroupBannerPath( const CString &sCourseGroup ); - void GetCourseGroupNames( vector &AddTo ); - bool DoesCourseGroupExist( const CString &sCourseGroup ); - RageColor GetCourseGroupColor( const CString &sCourseGroupName ); + RString GetCourseGroupBannerPath( const RString &sCourseGroup ); + void GetCourseGroupNames( vector &AddTo ); + bool DoesCourseGroupExist( const RString &sCourseGroup ); + RageColor GetCourseGroupColor( const RString &sCourseGroupName ); RageColor GetCourseColor( const Course* pCourse ); - static CString ShortenGroupName( CString sLongGroupName ); + static RString ShortenGroupName( RString sLongGroupName ); static int GetNumStagesForSong( const Song* pSong ); // LongVer songs take 2 stages, MarathonVer take 3 // Lookup const vector &GetAllSongs() const { return m_pSongs; } - void GetBestSongs( vector &AddTo, CString sGroupName, int iMaxStages = INT_MAX, ProfileSlot slot=ProfileSlot_Machine ) const; + void GetBestSongs( vector &AddTo, RString sGroupName, int iMaxStages = INT_MAX, ProfileSlot slot=ProfileSlot_Machine ) const; const vector &GetBestSongs( ProfileSlot slot=ProfileSlot_Machine ) const { return m_pBestSongs[slot]; } const vector &GetBestCourses( CourseType ct, ProfileSlot slot=ProfileSlot_Machine ) const { return m_pBestCourses[slot][ct]; } - void GetSongs( vector &AddTo, CString sGroupName, int iMaxStages = INT_MAX ) const; + void GetSongs( vector &AddTo, RString sGroupName, int iMaxStages = INT_MAX ) const; void GetSongs( vector &AddTo, int iMaxStages ) const { GetSongs(AddTo,GROUP_ALL,iMaxStages); } void GetSongs( vector &AddTo ) const { GetSongs(AddTo,GROUP_ALL,INT_MAX); } - Song *FindSong( CString sPath ); - Course *FindCourse( CString sName ); + Song *FindSong( RString sPath ); + Course *FindCourse( RString sName ); int GetNumSongs() const; int GetNumSongGroups() const; int GetNumCourses() const; @@ -96,13 +96,13 @@ public: void GetAllCourses( vector &AddTo, bool bIncludeAutogen ); void GetCourses( CourseType ct, vector &AddTo, bool bIncludeAutogen ); - void GetCoursesInGroup( vector &AddTo, const CString &sCourseGroup, bool bIncludeAutogen ); + void GetCoursesInGroup( vector &AddTo, const RString &sCourseGroup, bool bIncludeAutogen ); void GetExtraStageInfo( bool bExtra2, const Style *s, Song*& pSongOut, Steps*& pStepsOut, PlayerOptions *pPlayerOptionsOut, SongOptions *pSongOptionsOut ); - Song* GetSongFromDir( CString sDir ); - Course* GetCourseFromPath( CString sPath ); // path to .crs file, or path to song group dir - Course* GetCourseFromName( CString sName ); + Song* GetSongFromDir( RString sDir ); + Course* GetCourseFromPath( RString sPath ); // path to .crs file, or path to song group dir + Course* GetCourseFromName( RString sName ); void UpdateBest(); // update Players Best @@ -116,30 +116,30 @@ public: void PushSelf( lua_State *L ); protected: - void LoadStepManiaSongDir( CString sDir, LoadingWindow *ld ); - void LoadDWISongDir( CString sDir ); - bool GetExtraStageInfoFromCourse( bool bExtra2, CString sPreferredGroup, + void LoadStepManiaSongDir( RString sDir, LoadingWindow *ld ); + void LoadDWISongDir( RString sDir ); + bool GetExtraStageInfoFromCourse( bool bExtra2, RString sPreferredGroup, Song*& pSongOut, Steps*& pStepsOut, PlayerOptions *pPlayerOptionsOut, SongOptions *pSongOptionsOut ); - void SanityCheckGroupDir( CString sDir ) const; - void AddGroup( CString sDir, CString sGroupDirName ); + void SanityCheckGroupDir( RString sDir ) const; + void AddGroup( RString sDir, RString sGroupDirName ); int GetNumEditsLoadedFromProfile( ProfileSlot slot ) const; - Song *FindSong( CString sGroup, CString sSong ); + Song *FindSong( RString sGroup, RString sSong ); vector m_pSongs; // all songs that can be played vector m_pBestSongs[NUM_ProfileSlot]; vector m_pShuffledSongs; // used by GetRandomSong - vector m_sSongGroupNames; - vector m_sSongGroupBannerPaths; // each song group may have a banner associated with it + vector m_sSongGroupNames; + vector m_sSongGroupBannerPaths; // each song group may have a banner associated with it vector m_pCourses; vector m_pBestCourses[NUM_ProfileSlot][NUM_CourseType]; vector m_pShuffledCourses; // used by GetRandomCourse struct CourseGroupInfo { - CString m_sBannerPath; + RString m_sBannerPath; }; - map m_mapCourseGroupToInfo; + map m_mapCourseGroupToInfo; RageTexturePreloader m_TexturePreload; diff --git a/stepmania/src/SongOptions.cpp b/stepmania/src/SongOptions.cpp index d5afad494c..8d84982f14 100644 --- a/stepmania/src/SongOptions.cpp +++ b/stepmania/src/SongOptions.cpp @@ -15,9 +15,9 @@ void SongOptions::Init() m_bSaveScore = true; } -CString SongOptions::GetString() const +RString SongOptions::GetString() const { - CString sReturn; + RString sReturn; switch( m_LifeType ) { @@ -49,7 +49,7 @@ CString SongOptions::GetString() const if( m_fMusicRate != 1 ) { - CString s = ssprintf( "%2.2f", m_fMusicRate ); + RString s = ssprintf( "%2.2f", m_fMusicRate ); if( s[s.size()-1] == '0' ) s.erase( s.size()-1 ); sReturn += s + "xMusic, "; @@ -70,21 +70,21 @@ CString SongOptions::GetString() const /* Options are added to the current settings; call Init() beforehand if * you don't want this. */ -void SongOptions::FromString( CString sOptions ) +void SongOptions::FromString( RString sOptions ) { // Init(); sOptions.MakeLower(); - vector asBits; + vector asBits; split( sOptions, ",", asBits, true ); for( unsigned i=0; i matches; + vector matches; if( mult.Compare(sBit, matches) ) { char *p = NULL; @@ -100,7 +100,7 @@ void SongOptions::FromString( CString sOptions ) ASSERT( ret == 1 ); } - vector asParts; + vector asParts; split( sBit, " ", asParts, true ); bool on = true; if( asParts.size() > 1 ) diff --git a/stepmania/src/SongOptions.h b/stepmania/src/SongOptions.h index 72ab4494c9..cc6685cf5e 100644 --- a/stepmania/src/SongOptions.h +++ b/stepmania/src/SongOptions.h @@ -40,8 +40,8 @@ public: SongOptions() { Init(); }; void Init(); - CString GetString() const; - void FromString( CString sOptions ); + RString GetString() const; + void FromString( RString sOptions ); bool operator==( const SongOptions &other ) const; bool operator!=( const SongOptions &other ) const { return !operator==(other); } diff --git a/stepmania/src/SongUtil.cpp b/stepmania/src/SongUtil.cpp index 06370917b6..4ffa00163d 100644 --- a/stepmania/src/SongUtil.cpp +++ b/stepmania/src/SongUtil.cpp @@ -23,7 +23,7 @@ static LocalizedString SORT_OTHER ( "Sort", "Other" ); /* Just calculating GetNumTimesPlayed within the sort is pretty slow, so let's precompute * it. (This could be generalized with a template.) */ -static map g_mapSongSortVal; +static map g_mapSongSortVal; static bool CompareSongPointersBySortValueAscending( const Song *pSong1, const Song *pSong2 ) { @@ -36,7 +36,7 @@ static bool CompareSongPointersBySortValueDescending( const Song *pSong1, const } -CString SongUtil::MakeSortString( CString s ) +RString SongUtil::MakeSortString( RString s ) { s.MakeUpper(); @@ -55,8 +55,8 @@ CString SongUtil::MakeSortString( CString s ) static bool CompareSongPointersByTitle( const Song *pSong1, const Song *pSong2 ) { // Prefer transliterations to full titles - CString s1 = pSong1->GetTranslitMainTitle(); - CString s2 = pSong2->GetTranslitMainTitle(); + RString s1 = pSong1->GetTranslitMainTitle(); + RString s2 = pSong2->GetTranslitMainTitle(); if( s1 == s2 ) { s1 = pSong1->GetTranslitSubTitle(); @@ -99,7 +99,7 @@ void SongUtil::SortSongPointerArrayByBPM( vector &vpSongsInOut ) sort( vpSongsInOut.begin(), vpSongsInOut.end(), CompareSongPointersByBPM ); } -void AppendOctal( int n, int digits, CString &out ) +void AppendOctal( int n, int digits, RString &out ) { for( int p = digits-1; p >= 0; --p ) { @@ -109,11 +109,11 @@ void AppendOctal( int n, int digits, CString &out ) } } -static bool CompDescending( const pair &a, const pair &b ) +static bool CompDescending( const pair &a, const pair &b ) { return a.second > b.second; } -static bool CompAscending( const pair &a, const pair &b ) +static bool CompAscending( const pair &a, const pair &b ) { return a.second < b.second; } @@ -122,7 +122,7 @@ void SongUtil::SortSongPointerArrayByGrades( vector &vpSongsInOut, bool b { /* Optimize by pre-writing a string to compare, since doing GetNumNotesWithGrade * inside the sort is too slow. */ - typedef pair< Song *, CString > val; + typedef pair< Song *, RString > val; vector vals; vals.reserve( vpSongsInOut.size() ); @@ -136,7 +136,7 @@ void SongUtil::SortSongPointerArrayByGrades( vector &vpSongsInOut, bool b StepsType st = pStyle->m_StepsType; pProfile->GetGrades( pSong, st, iCounts ); - CString foo; + RString foo; foo.reserve(256); for( int g=Grade_Tier01; g<=Grade_NoData; ++g ) AppendOctal( iCounts[g], 3, foo ); @@ -183,8 +183,8 @@ int SongUtil::CompareSongPointersByGroup(const Song *pSong1, const Song *pSong2) static int CompareSongPointersByGroupAndTitle( const Song *pSong1, const Song *pSong2 ) { - const CString &sGroup1 = pSong1->m_sGroupName; - const CString &sGroup2 = pSong2->m_sGroupName; + const RString &sGroup1 = pSong1->m_sGroupName; + const RString &sGroup2 = pSong2->m_sGroupName; if( sGroup1 < sGroup2 ) return true; @@ -217,22 +217,22 @@ void SongUtil::SortSongPointerArrayByNumPlays( vector &vpSongsInOut, cons g_mapSongSortVal.clear(); } -CString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so ) +RString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so ) { if( pSong == NULL ) - return CString(); + return RString(); switch( so ) { case SORT_PREFERRED: - return CString(); + return RString(); case SORT_GROUP: // guaranteed not empty return pSong->m_sGroupName; case SORT_TITLE: case SORT_ARTIST: { - CString s; + RString s; switch( so ) { case SORT_TITLE: s = pSong->GetTranslitMainTitle(); break; @@ -242,7 +242,7 @@ CString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so s = MakeSortString(s); // resulting string will be uppercase if( s.empty() ) - return CString(); + return RString(); else if( s[0] >= '0' && s[0] <= '9' ) return "0-9"; else if( s[0] < 'A' || s[0] > 'Z') @@ -264,7 +264,7 @@ CString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so return ssprintf("%03d-%03d",iMaxBPM-(iBPMGroupSize-1), iMaxBPM); } case SORT_POPULARITY: - return CString(); + return RString(); case SORT_TOP_GRADES: { int iCounts[NUM_Grade]; @@ -307,23 +307,23 @@ CString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so return SORT_NOT_AVAILABLE.GetValue(); } case SORT_MODE_MENU: - return CString(); + return RString(); case SORT_ALL_COURSES: case SORT_NONSTOP_COURSES: case SORT_ONI_COURSES: case SORT_ENDLESS_COURSES: default: ASSERT(0); - return CString(); + return RString(); } } void SongUtil::SortSongPointerArrayBySectionName( vector &vpSongsInOut, SortOrder so ) { - CString sOther = SORT_OTHER.GetValue(); + RString sOther = SORT_OTHER.GetValue(); for(unsigned i = 0; i < vpSongsInOut.size(); ++i) { - CString val = GetSectionNameFromSongAndSort( vpSongsInOut[i], so ); + RString val = GetSectionNameFromSongAndSort( vpSongsInOut[i], so ); /* Make sure 0-9 comes first and OTHER comes last. */ if( val == "0-9" ) val = "0"; @@ -344,7 +344,7 @@ void SongUtil::SortSongPointerArrayByMeter( vector &vpSongsInOut, Difficu { /* Ignore locked steps. */ const Steps* pSteps = vpSongsInOut[i]->GetClosestNotes( GAMESTATE->GetCurrentStyle()->m_StepsType, dc, true ); - CString &s = g_mapSongSortVal[vpSongsInOut[i]]; + RString &s = g_mapSongSortVal[vpSongsInOut[i]]; s = ssprintf("%03d", pSteps ? pSteps->GetMeter() : 0); /* Hack: always put tutorial songs first. */ @@ -375,7 +375,7 @@ void SongUtil::SortByMostRecentlyPlayedForMachine( vector &vpSongsInOut ) FOREACH_CONST( Song*, vpSongsInOut, s ) { int iNumTimesPlayed = pProfile->GetSongNumTimesPlayed( *s ); - CString val = iNumTimesPlayed ? pProfile->GetSongLastPlayedDateTime(*s).GetString() : "0"; + RString val = iNumTimesPlayed ? pProfile->GetSongLastPlayedDateTime(*s).GetString() : "0"; g_mapSongSortVal[*s] = val; } @@ -404,7 +404,7 @@ Song *SongID::ToSong() const { // HACK for backwards compatibility: // Re-add the leading "/". 2005/05/21 file layer changes added a leading slash. - CString sDir2 = sDir; + RString sDir2 = sDir; if( sDir2.Left(1) != "/" ) sDir2 = "/" + sDir2; @@ -427,7 +427,7 @@ void SongID::LoadFromNode( const XNode* pNode ) pNode->GetAttrValue("Dir", sDir); } -CString SongID::ToString() const +RString SongID::ToString() const { return sDir; } diff --git a/stepmania/src/SongUtil.h b/stepmania/src/SongUtil.h index f606d59983..e36b0e0422 100644 --- a/stepmania/src/SongUtil.h +++ b/stepmania/src/SongUtil.h @@ -12,7 +12,7 @@ class XNode; namespace SongUtil { - CString MakeSortString( CString s ); + RString MakeSortString( RString s ); void SortSongPointerArrayByTitle( vector &vpSongsInOut ); void SortSongPointerArrayByBPM( vector &vpSongsInOut ); void SortSongPointerArrayByGrades( vector &vpSongsInOut, bool bDescending ); @@ -23,7 +23,7 @@ namespace SongUtil void SortSongPointerArrayByNumPlays( vector &vpSongsInOut, ProfileSlot slot, bool bDescending ); void SortSongPointerArrayByNumPlays( vector &vpSongsInOut, const Profile* pProfile, bool bDescending ); void SortSongPointerArrayByMeter( vector &vpSongsInOut, Difficulty dc ); - CString GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so ); + RString GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so ); void SortSongPointerArrayBySectionName( vector &vpSongsInOut, SortOrder so ); void SortByMostRecentlyPlayedForMachine( vector &vpSongsInOut ); @@ -32,7 +32,7 @@ namespace SongUtil class SongID { - CString sDir; + RString sDir; public: SongID() { Unset(); } @@ -46,8 +46,8 @@ public: XNode* CreateNode() const; void LoadFromNode( const XNode* pNode ); - void LoadFromDir( CString _sDir ) { sDir = _sDir; } - CString ToString() const; + void LoadFromDir( RString _sDir ) { sDir = _sDir; } + RString ToString() const; bool IsValid() const; }; diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index 6f77defc15..91945e85d3 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -114,12 +114,12 @@ void Sprite::Load( RageTextureID ID ) LoadFromTexture( ID ); }; -void Sprite::LoadFromNode( const CString& sDir, const XNode* pNode ) +void Sprite::LoadFromNode( const RString& sDir, const XNode* pNode ) { retry: - CString sTextureFile; - CString sPath; + RString sTextureFile; + RString sPath; if( pNode->GetAttrValue( "Texture", sTextureFile ) ) { sPath = sDir + sTextureFile; @@ -133,11 +133,11 @@ retry: if( !sPath.empty() ) { - vector asElementPaths; + vector asElementPaths; GetDirListing( sPath + "*", asElementPaths, false, true ); if( asElementPaths.size() == 0 ) { - CString sMessage = ssprintf( "A xml Sprite in '%s' points to a texture '%s' which doesn't exist.", sDir.c_str(), sPath.c_str() ); + RString sMessage = ssprintf( "A xml Sprite in '%s' points to a texture '%s' which doesn't exist.", sDir.c_str(), sPath.c_str() ); switch( Dialog::AbortRetryIgnore(sMessage) ) { case Dialog::abort: @@ -152,7 +152,7 @@ retry: } if( asElementPaths.size() > 1 ) { - CString message = ssprintf( + RString message = ssprintf( "There is more than one file that matches " "'%s'. Please remove all but one of these matches.", sPath.c_str() ); @@ -171,8 +171,8 @@ retry: // frames and delays created during LoadFromTexture(). for( int i=0; true; i++ ) { - CString sFrameKey = ssprintf( "Frame%04d", i ); - CString sDelayKey = ssprintf( "Delay%04d", i ); + RString sFrameKey = ssprintf( "Frame%04d", i ); + RString sDelayKey = ssprintf( "Delay%04d", i ); State newState; if( !pNode->GetAttrValue(sFrameKey, newState.iFrameIndex) ) @@ -688,7 +688,7 @@ void Sprite::SetState( int iNewState ) // Don't warn about number of states in "_blank". if( !m_pTexture || m_pTexture->GetID().filename.find("_blank") == string::npos ) { - CString sError; + RString sError; if( m_pTexture ) sError = ssprintf("A Sprite '%s' (\"%s\") tried to set state index %d, but it has only %u states.", m_pTexture->GetID().filename.c_str(), this->m_sName.c_str(), iNewState, unsigned(m_States.size())); @@ -719,10 +719,10 @@ void Sprite::SetSecondsIntoAnimation( float fSeconds ) UpdateAnimationState(); } -CString Sprite::GetTexturePath() const +RString Sprite::GetTexturePath() const { if( m_pTexture==NULL ) - return CString(); + return RString(); return m_pTexture->GetID().filename; } diff --git a/stepmania/src/Sprite.h b/stepmania/src/Sprite.h index 415be6a5b5..bff3ca7c00 100644 --- a/stepmania/src/Sprite.h +++ b/stepmania/src/Sprite.h @@ -15,7 +15,7 @@ public: Sprite( const Sprite &cpy ); virtual ~Sprite(); - void LoadFromNode( const CString& sDir, const XNode* pNode ); + void LoadFromNode( const RString& sDir, const XNode* pNode ); virtual Actor *Copy() const; virtual bool EarlyAbortDraw() const; @@ -45,7 +45,7 @@ public: virtual float GetAnimationLengthSeconds() const; virtual void SetSecondsIntoAnimation( float fSeconds ); - CString GetTexturePath() const; + RString GetTexturePath() const; void SetCustomTextureRect( const RectF &new_texcoord_frect ); void SetCustomTextureCoords( float fTexCoords[8] ); @@ -77,7 +77,7 @@ protected: void DrawTexture( const TweenState *state ); - CString m_sSpritePath; + RString m_sSpritePath; RageTexture* m_pTexture; bool m_bDrawIfTextureNull; diff --git a/stepmania/src/StageStats.cpp b/stepmania/src/StageStats.cpp index 543deed35f..4f9a813c9b 100644 --- a/stepmania/src/StageStats.cpp +++ b/stepmania/src/StageStats.cpp @@ -174,7 +174,7 @@ void StageStats::CommitScores( bool bSummary ) hs.SetSurviveSeconds( m_player[p].fAliveSeconds ); hs.SetModifiers( GAMESTATE->m_pPlayerState[p]->m_PlayerOptions.GetString() ); hs.SetDateTime( DateTime::GetNowDateTime() ); - hs.SetPlayerGuid( PROFILEMAN->IsPersistentProfile(p) ? PROFILEMAN->GetProfile(p)->m_sGuid : CString("") ); + hs.SetPlayerGuid( PROFILEMAN->IsPersistentProfile(p) ? PROFILEMAN->GetProfile(p)->m_sGuid : RString("") ); hs.SetMachineGuid( PROFILEMAN->GetMachineProfile()->m_sGuid ); hs.SetProductID( PREFSMAN->m_iProductID ); FOREACH_TapNoteScore( tns ) diff --git a/stepmania/src/StdString.h b/stepmania/src/StdString.h index 6fd004a473..f989d66753 100644 --- a/stepmania/src/StdString.h +++ b/stepmania/src/StdString.h @@ -7,7 +7,7 @@ // This header file declares the CStdStr template. This template derives // the Standard C++ Library basic_string<> template and add to it the // the following conveniences: -// - The full MFC CString set of functions (including implicit cast) +// - The full MFC RString set of functions (including implicit cast) // - writing to/reading from COM IStream interfaces // - Functional objects for use in STL algorithms // @@ -29,7 +29,7 @@ // this class. OK, this is a long list but in my own defense, this code // has undergone two major rewrites. Many of the improvements became // necessary after I rewrote the code as a template. Others helped me -// improve the CString facade. +// improve the RString facade. // // Anyway, these people are (in chronological order): // @@ -304,11 +304,11 @@ inline void ssadd(std::string& sDst, PCSTR pA) // template class CStdStr : public std::basic_string // // REMARKS: -// This template derives from basic_string and adds some MFC CString- +// This template derives from basic_string and adds some MFC RString- // like functionality // // Basically, this is my attempt to make Standard C++ library strings as -// easy to use as the MFC CString class. +// easy to use as the MFC RString class. // // Note that although this is a template, it makes the assumption that the // template argument (CT, the character type) is either char or wchar_t. @@ -652,7 +652,7 @@ public: // // DESCRIPTION: // This function does sprintf/wsprintf style formatting on CStdStringA - // objects. It looks a lot like MFC's CString::Format. Some people + // objects. It looks a lot like MFC's RString::Format. Some people // might even call this identical. Fortunately, these people are now // dead. // @@ -777,10 +777,10 @@ public: // ------------------------------------------------------------------------- - // CString Facade Functions: + // RString Facade Functions: // // The following methods are intended to allow you to use this class as a - // drop-in replacement for CString. + // drop-in replacement for RString. // ------------------------------------------------------------------------- int CompareNoCase(PCMYSTR szThat) const { diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 91fef1d3da..de256331aa 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -127,8 +127,8 @@ static void StoreActualGraphicOptions( bool initial ) PREFSMAN->m_iRefreshRate .Set( params.rate ); PREFSMAN->m_bVsync .Set( params.vsync ); - CString sFormat = "%s %s %dx%d %d "+COLOR.GetValue()+" %d "+TEXTURE.GetValue()+" %dHz %s %s"; - CString log = ssprintf( sFormat, + RString sFormat = "%s %s %dx%d %d "+COLOR.GetValue()+" %d "+TEXTURE.GetValue()+" %dHz %s %s"; + RString log = ssprintf( sFormat, DISPLAY->GetApiDescription().c_str(), (PREFSMAN->m_bWindowed ? WINDOWED : FULLSCREEN).GetValue().c_str(), (int)PREFSMAN->m_iDisplayWidth, @@ -186,7 +186,7 @@ void StepMania::ApplyGraphicOptions() VideoModeParams params; GetPreferredVideoModeParams( params ); - CString sError = DISPLAY->SetVideoMode( params, bNeedReload ); + RString sError = DISPLAY->SetVideoMode( params, bNeedReload ); if( sError != "" ) RageException::Throw( sError ); @@ -289,7 +289,7 @@ void StepMania::ResetGame() if( !THEME->DoesThemeExist( THEME->GetCurThemeName() ) ) { - CString sGameName = GAMESTATE->GetCurrentGame()->m_szName; + RString sGameName = GAMESTATE->GetCurrentGame()->m_szName; if( !THEME->DoesThemeExist(sGameName) ) sGameName = "default"; THEME->SwitchThemeAndLanguage( sGameName, THEME->GetCurLanguage(), PREFSMAN->m_bPseudoLocalize ); @@ -356,8 +356,8 @@ static void CheckSettings() struct VideoCardDefaults { - CString sDriverRegex; - CString sVideoRenderers; + RString sDriverRegex; + RString sVideoRenderers; int iWidth; int iHeight; int iDisplayColor; @@ -368,8 +368,8 @@ struct VideoCardDefaults VideoCardDefaults() {} VideoCardDefaults( - CString sDriverRegex_, - CString sVideoRenderers_, + RString sDriverRegex_, + RString sVideoRenderers_, int iWidth_, int iHeight_, int iDisplayColor_, @@ -568,7 +568,7 @@ struct VideoCardDefaults }; -static CString GetVideoDriverName() +static RString GetVideoDriverName() { #if defined(_WINDOWS) return GetPrimaryVideoDriverName(); @@ -582,7 +582,7 @@ static CString GetVideoDriverName() static void CheckVideoDefaultSettings() { // Video card changed since last run - CString sVideoDriver = GetVideoDriverName(); + RString sVideoDriver = GetVideoDriverName(); LOG->Trace( "Last seen video driver: " + PREFSMAN->m_sLastSeenVideoDriver.Get() ); @@ -592,7 +592,7 @@ static void CheckVideoDefaultSettings() { defaults = g_VideoCardDefaults[i]; - CString sDriverRegex = defaults.sDriverRegex; + RString sDriverRegex = defaults.sDriverRegex; Regex regex( sDriverRegex ); if( regex.Compare(sVideoDriver) ) { @@ -677,12 +677,12 @@ RageDisplay *CreateDisplay() VideoModeParams params; StepMania::GetPreferredVideoModeParams( params ); - CString error = ERROR_INITIALIZING_CARD.GetValue()+"\n\n"+ + RString error = ERROR_INITIALIZING_CARD.GetValue()+"\n\n"+ ERROR_DONT_FILE_BUG.GetValue()+"\n\n" VIDEO_TROUBLESHOOTING_URL "\n\n"+ ssprintf(ERROR_VIDEO_DRIVER.GetValue(), GetVideoDriverName().c_str())+"\n\n"; - vector asRenderers; + vector asRenderers; split( PREFSMAN->m_sVideoRenderers, ",", asRenderers, true ); if( asRenderers.empty() ) @@ -690,13 +690,13 @@ RageDisplay *CreateDisplay() for( unsigned i=0; iInit( params, PREFSMAN->m_bAllowUnacceleratedRenderer ); + RString sError = pRet->Init( params, PREFSMAN->m_bAllowUnacceleratedRenderer ); if( sError == "" ) return pRet; error += ssprintf(ERROR_INITIALIZING.GetValue(),"OpenGL")+"\n" + sError; @@ -707,7 +707,7 @@ RageDisplay *CreateDisplay() { #if defined(SUPPORT_D3D) RageDisplay_D3D *pRet = new RageDisplay_D3D; - CString sError = pRet->Init( params ); + RString sError = pRet->Init( params ); if( sError == "" ) return pRet; error += ssprintf(ERROR_INITIALIZING.GetValue(),"Direct3D")+"\n" + sError; @@ -729,7 +729,7 @@ RageDisplay *CreateDisplay() RageException::Throw( error ); } -extern const CString STATIC_INI_PATH; +extern const RString STATIC_INI_PATH; void StepMania::ChangeCurrentGame( const Game* g ) { @@ -754,7 +754,7 @@ void ReadGamePrefsFromDisk( bool bSwitchToLastPlayedGame ) if( bSwitchToLastPlayedGame ) { ASSERT( GAMEMAN != NULL ); - CString sGame = PREFSMAN->GetCurrentGame(); + RString sGame = PREFSMAN->GetCurrentGame(); if( !sGame.empty() ) { const Game *pGame = GAMEMAN->StringToGameType(sGame); @@ -782,9 +782,9 @@ void ReadGamePrefsFromDisk( bool bSwitchToLastPlayedGame ) if( !GAMEMAN->IsGameEnabled( GAMESTATE->m_pCurGame ) ) RageException::Throw( "Default NoteSkin for \"%s\" missing", GAMESTATE->m_pCurGame->m_szName ); - CString sGameName = GAMESTATE->GetCurrentGame()->m_szName; - CString sAnnouncer = sGameName; - CString sTheme = sGameName; + RString sGameName = GAMESTATE->GetCurrentGame()->m_szName; + RString sAnnouncer = sGameName; + RString sTheme = sGameName; // if these calls fail, the three strings will keep the initial values set above. if( !PREFSMAN->m_sAnnouncer.Get().empty() ) @@ -798,14 +798,14 @@ void ReadGamePrefsFromDisk( bool bSwitchToLastPlayedGame ) } -static void MountTreeOfZips( const CString &dir ) +static void MountTreeOfZips( const RString &dir ) { - vector dirs; + vector dirs; dirs.push_back( dir ); while( dirs.size() ) { - CString path = dirs.back(); + RString path = dirs.back(); dirs.pop_back(); #if !defined(XBOX) @@ -814,7 +814,7 @@ static void MountTreeOfZips( const CString &dir ) continue; #endif - vector zips; + vector zips; GetDirListing( path + "/*.zip", zips, false, true ); GetDirListing( path + "/*.smzip", zips, false, true ); @@ -855,7 +855,7 @@ static void WriteLogHeader() if( g_argc > 1 ) { - CString args; + RString args; for( int i = 1; i < g_argc; ++i ) { if( i>1 ) @@ -938,14 +938,14 @@ int main(int argc, char* argv[]) /* Set up alternative filesystem trees. */ if( PREFSMAN->m_sAdditionalFolders.Get() != "" ) { - vector dirs; + vector dirs; split( PREFSMAN->m_sAdditionalFolders, ",", dirs, true ); for( unsigned i=0; i < dirs.size(); i++) FILEMAN->Mount( "dir", dirs[i], "/" ); } if( PREFSMAN->m_sAdditionalSongFolders.Get() != "" ) { - vector dirs; + vector dirs; split( PREFSMAN->m_sAdditionalSongFolders, ",", dirs, true ); for( unsigned i=0; i < dirs.size(); i++) FILEMAN->Mount( "dir", dirs[i], "/Songs" ); @@ -1001,7 +1001,7 @@ int main(int argc, char* argv[]) { /* Now that THEME is loaded, load the icon for the current theme into the * loading window. */ - CString sError; + RString sError; RageSurface *pIcon = RageSurfaceUtils::LoadFile( THEME->GetPathG( "Common", "window icon" ), sError ); if( pIcon ) loading_window->SetIcon( pIcon ); @@ -1071,7 +1071,7 @@ int main(int argc, char* argv[]) SCREENMAN->SetNewScreen( CommonMetrics::INITIAL_SCREEN ); // Do this after ThemeChanged so that we can show a system message - CString sMessage; + RString sMessage; if( INPUTMAPPER->CheckForChangedInputDevicesAndRemap(sMessage) ) SCREENMAN->SystemMessage( sMessage ); @@ -1105,14 +1105,14 @@ int main(int argc, char* argv[]) return 0; } -CString StepMania::SaveScreenshot( CString sDir, bool bSaveCompressed, bool bMakeSignature, int iIndex ) +RString StepMania::SaveScreenshot( RString sDir, bool bSaveCompressed, bool bMakeSignature, int iIndex ) { // // Find a file name for the screenshot // FlushDirCache(); - vector files; + vector files; GetDirListing( sDir + "screen*", files, false, false ); sort( files.begin(), files.end() ); @@ -1128,7 +1128,7 @@ CString StepMania::SaveScreenshot( CString sDir, bool bSaveCompressed, bool bMak for( int i = files.size()-1; i >= 0; --i ) { static Regex re( "^screen([0-9]{5})\\....$" ); - vector matches; + vector matches; if( !re.Compare( files[i], matches ) ) continue; @@ -1150,13 +1150,13 @@ CString StepMania::SaveScreenshot( CString sDir, bool bSaveCompressed, bool bMak else fmt = RageDisplay::SAVE_LOSSLESS; - CString sFileName = ssprintf( "screen%05d.%s",iIndex,bSaveCompressed ? "jpg" : "bmp" ); - CString sPath = sDir+sFileName; + RString sFileName = ssprintf( "screen%05d.%s",iIndex,bSaveCompressed ? "jpg" : "bmp" ); + RString sPath = sDir+sFileName; bool bResult = DISPLAY->SaveScreenshot( sPath, fmt ); if( !bResult ) { SCREENMAN->PlayInvalidSound(); - return CString(); + return RString(); } SCREENMAN->PlayScreenshotSound(); diff --git a/stepmania/src/StepMania.h b/stepmania/src/StepMania.h index 408d410387..c30b504af8 100644 --- a/stepmania/src/StepMania.h +++ b/stepmania/src/StepMania.h @@ -18,7 +18,7 @@ namespace StepMania void ChangeCurrentGame( const Game* g ); // If successful, return filename of screenshot in sDir, else return "" - CString SaveScreenshot( CString sDir, bool bSaveCompressed, bool bMakeSignature, int iIndex = -1 ); + RString SaveScreenshot( RString sDir, bool bSaveCompressed, bool bMakeSignature, int iIndex = -1 ); void InsertCoin( int iNum = 1, const RageTimer *pTime = NULL ); void InsertCredit(); diff --git a/stepmania/src/Steps.cpp b/stepmania/src/Steps.cpp index 2b768b895a..fc2196a114 100644 --- a/stepmania/src/Steps.cpp +++ b/stepmania/src/Steps.cpp @@ -73,7 +73,7 @@ void Steps::GetNoteData( NoteData& noteDataOut ) const } } -void Steps::SetSMNoteData( const CString ¬es_comp_ ) +void Steps::SetSMNoteData( const RString ¬es_comp_ ) { m_pNoteData->Init(); m_bNoteDataIsFilled = false; @@ -83,7 +83,7 @@ void Steps::SetSMNoteData( const CString ¬es_comp_ ) } /* XXX: this function should pull data from m_sFilename, like Decompress() */ -void Steps::GetSMNoteData( CString ¬es_comp_out ) const +void Steps::GetSMNoteData( RString ¬es_comp_out ) const { if( m_sNoteDataCompressed.empty() ) { @@ -233,7 +233,7 @@ void Steps::Compress() const /* Always leave lights data uncompressed. */ if( this->m_StepsType == STEPS_TYPE_LIGHTS_CABINET && m_bNoteDataIsFilled ) { - m_sNoteDataCompressed = CString(""); + m_sNoteDataCompressed = RString(""); return; } @@ -245,7 +245,7 @@ void Steps::Compress() const /* Be careful; 'x = ""', m_sNoteDataCompressed.clear() and m_sNoteDataCompressed.reserve(0) * don't always free the alocated memory. */ - m_sNoteDataCompressed = CString(""); + m_sNoteDataCompressed = RString(""); return; } @@ -320,7 +320,7 @@ bool Steps::IsAutogen() const return parent != NULL; } -void Steps::SetDifficultyAndDescription( Difficulty dc, CString sDescription ) +void Steps::SetDifficultyAndDescription( Difficulty dc, RString sDescription ) { DeAutogen(); m_Difficulty = dc; @@ -329,7 +329,7 @@ void Steps::SetDifficultyAndDescription( Difficulty dc, CString sDescription ) MakeValidEditDescription( m_sDescription ); } -bool Steps::MakeValidEditDescription( CString &sPreferredDescription ) +bool Steps::MakeValidEditDescription( RString &sPreferredDescription ) { if( int(sPreferredDescription.size()) > MAX_EDIT_STEPS_DESCRIPTION_LENGTH ) { diff --git a/stepmania/src/Steps.h b/stepmania/src/Steps.h index 1a587ee496..50bc55add8 100644 --- a/stepmania/src/Steps.h +++ b/stepmania/src/Steps.h @@ -36,19 +36,19 @@ public: bool WasLoadedFromProfile() const { return m_LoadedFromProfile != ProfileSlot_INVALID; } ProfileSlot GetLoadedFromProfileSlot() const { return m_LoadedFromProfile; } unsigned GetHash() const { return Real()->m_uHash; } - CString GetDescription() const { return Real()->m_sDescription; } + RString GetDescription() const { return Real()->m_sDescription; } Difficulty GetDifficulty() const { return Real()->m_Difficulty; } int GetMeter() const { return Real()->m_iMeter; } const RadarValues& GetRadarValues() const { return Real()->m_CachedRadarValues; } - void SetFilename( CString fn ) { m_sFilename = fn; } - CString GetFilename() const { return m_sFilename; } + void SetFilename( RString fn ) { m_sFilename = fn; } + RString GetFilename() const { return m_sFilename; } void SetSavedToDisk( bool b ) { m_bSavedToDisk = b; } bool GetSavedToDisk() const { return m_bSavedToDisk; } - void SetDifficultyAndDescription( Difficulty dc, CString sDescription ); + void SetDifficultyAndDescription( Difficulty dc, RString sDescription ); void SetDifficulty( Difficulty dc ) { SetDifficultyAndDescription( dc, this->GetDescription() ); } - void SetDescription( CString sDescription ) { SetDifficultyAndDescription( this->GetDifficulty(), sDescription ); } - static bool MakeValidEditDescription( CString &sPreferredDescription ); // return true if was modified + void SetDescription( RString sDescription ) { SetDifficultyAndDescription( this->GetDifficulty(), sDescription ); } + static bool MakeValidEditDescription( RString &sPreferredDescription ); // return true if was modified void SetLoadedFromProfile( ProfileSlot slot ) { m_LoadedFromProfile = slot; } void SetMeter(int meter); @@ -60,8 +60,8 @@ public: void GetNoteData( NoteData& noteDataOut ) const; void SetNoteData( const NoteData& noteDataNew ); - void SetSMNoteData( const CString ¬es_comp ); - void GetSMNoteData( CString ¬es_comp_out ) const; + void SetSMNoteData( const RString ¬es_comp ); + void GetSMNoteData( RString ¬es_comp_out ) const; void TidyUpData(); void CalculateRadarValues( float fMusicLengthSeconds ); @@ -79,17 +79,17 @@ protected: * these is transparent. */ mutable HiddenPtr m_pNoteData; mutable bool m_bNoteDataIsFilled; - mutable CString m_sNoteDataCompressed; + mutable RString m_sNoteDataCompressed; const Steps *Real() const; - CString m_sFilename; + RString m_sFilename; bool m_bSavedToDisk; // true if this was loaded from disk or has been saved to disk. /* These values are pulled from the autogen source first, if there is one. */ ProfileSlot m_LoadedFromProfile; // ProfileSlot_INVALID if wasn't loaded from a profile unsigned m_uHash; // only used if m_Difficulty == DIFFICULTY_EDIT - CString m_sDescription; // Step author, edit name, or something meaningful + RString m_sDescription; // Step author, edit name, or something meaningful Difficulty m_Difficulty; // difficulty classification int m_iMeter; // difficulty rating from MIN_METER to MAX_METER RadarValues m_CachedRadarValues; diff --git a/stepmania/src/StepsUtil.cpp b/stepmania/src/StepsUtil.cpp index e8aa9dc95b..7da5fd86c5 100644 --- a/stepmania/src/StepsUtil.cpp +++ b/stepmania/src/StepsUtil.cpp @@ -12,7 +12,7 @@ // // Sorting stuff // -map steps_sort_val; +map steps_sort_val; bool CompareStepsPointersBySortValueAscending(const Steps *pSteps1, const Steps *pSteps2) { @@ -233,7 +233,7 @@ void StepsID::LoadFromNode( const XNode* pNode ) { ASSERT( pNode->m_sName == "Steps" ); - CString sTemp; + RString sTemp; pNode->GetAttrValue("StepsType", sTemp); st = GameManager::StringToStepsType( sTemp ); @@ -253,9 +253,9 @@ void StepsID::LoadFromNode( const XNode* pNode ) } } -CString StepsID::ToString() const +RString StepsID::ToString() const { - CString s = GameManager::StepsTypeToString(st); + RString s = GameManager::StepsTypeToString(st); s += " " + DifficultyToString(dc); if( dc == DIFFICULTY_EDIT ) { diff --git a/stepmania/src/StepsUtil.h b/stepmania/src/StepsUtil.h index 9f5f29d3bd..97c4c44ce9 100644 --- a/stepmania/src/StepsUtil.h +++ b/stepmania/src/StepsUtil.h @@ -28,7 +28,7 @@ class StepsID { StepsType st; Difficulty dc; - CString sDescription; + RString sDescription; unsigned uHash; public: @@ -41,7 +41,7 @@ public: XNode* CreateNode() const; void LoadFromNode( const XNode* pNode ); - CString ToString() const; + RString ToString() const; bool IsValid() const; static void ClearCache(); diff --git a/stepmania/src/StreamDisplay.cpp b/stepmania/src/StreamDisplay.cpp index 927d1fe4a0..87aa75c71b 100644 --- a/stepmania/src/StreamDisplay.cpp +++ b/stepmania/src/StreamDisplay.cpp @@ -22,9 +22,9 @@ void StreamDisplay::Load( float fMeterHeight, int iNumStrips, int iNumChambers, - const CString &sNormalPath, - const CString &sHotPath, - const CString &sPassingPath, + const RString &sNormalPath, + const RString &sHotPath, + const RString &sPassingPath, const apActorCommands &acNormalOnCommand, const apActorCommands &acHotOnCommand, const apActorCommands &acPassingOnCommand @@ -40,7 +40,7 @@ void StreamDisplay::Load( m_quadMask.SetBlendMode( BLEND_NO_EFFECT ); m_quadMask.SetUseZBuffer( true ); - CString sGraphicPath; + RString sGraphicPath; RageTextureID ID; ID.bStretch = true; diff --git a/stepmania/src/StreamDisplay.h b/stepmania/src/StreamDisplay.h index 6afe19d2fa..9e5ce52624 100644 --- a/stepmania/src/StreamDisplay.h +++ b/stepmania/src/StreamDisplay.h @@ -16,9 +16,9 @@ public: float fMeterHeight, int iNumStrips, int iNumChambers, - const CString &sNormalPath, - const CString &sHotPath, - const CString &sPassingPath, + const RString &sNormalPath, + const RString &sHotPath, + const RString &sPassingPath, const apActorCommands &acNormalOnCommand, const apActorCommands &acHotOnCommand, const apActorCommands &acPassingOnCommand diff --git a/stepmania/src/StyleUtil.h b/stepmania/src/StyleUtil.h index 3503a4d514..f2a93b4cf8 100644 --- a/stepmania/src/StyleUtil.h +++ b/stepmania/src/StyleUtil.h @@ -7,8 +7,8 @@ class XNode; class StyleID { - CString sGame; - CString sStyle; + RString sGame; + RString sStyle; public: StyleID() { Unset(); } diff --git a/stepmania/src/TextBanner.cpp b/stepmania/src/TextBanner.cpp index 9e473e1429..b61e931486 100644 --- a/stepmania/src/TextBanner.cpp +++ b/stepmania/src/TextBanner.cpp @@ -10,7 +10,7 @@ #include "Command.h" -void TextBanner::Load( CString sType ) +void TextBanner::Load( RString sType ) { m_bInitted = true; @@ -64,9 +64,9 @@ TextBanner::TextBanner( const TextBanner &cpy ): } void TextBanner::LoadFromString( - const CString &sDisplayTitle, const CString &sTranslitTitle, - const CString &sDisplaySubTitle, const CString &sTranslitSubTitle, - const CString &sDisplayArtist, const CString &sTranslitArtist ) + const RString &sDisplayTitle, const RString &sTranslitTitle, + const RString &sDisplaySubTitle, const RString &sTranslitSubTitle, + const RString &sDisplayArtist, const RString &sTranslitArtist ) { ASSERT( m_bInitted ); @@ -94,12 +94,12 @@ void TextBanner::LoadFromSong( const Song* pSong ) { ASSERT( m_bInitted ); - CString sDisplayTitle = pSong ? pSong->GetDisplayMainTitle() : CString(""); - CString sTranslitTitle = pSong ? pSong->GetTranslitMainTitle() : CString(""); - CString sDisplaySubTitle = pSong ? pSong->GetDisplaySubTitle() : CString(""); - CString sTranslitSubTitle = pSong ? pSong->GetTranslitSubTitle() : CString(""); - CString sDisplayArtist = pSong ? (CString)ARTIST_PREPEND_STRING + pSong->GetDisplayArtist() : CString(""); - CString sTranslitArtist = pSong ? (CString)ARTIST_PREPEND_STRING + pSong->GetTranslitArtist() : CString(""); + RString sDisplayTitle = pSong ? pSong->GetDisplayMainTitle() : RString(""); + RString sTranslitTitle = pSong ? pSong->GetTranslitMainTitle() : RString(""); + RString sDisplaySubTitle = pSong ? pSong->GetDisplaySubTitle() : RString(""); + RString sTranslitSubTitle = pSong ? pSong->GetTranslitSubTitle() : RString(""); + RString sDisplayArtist = pSong ? (RString)ARTIST_PREPEND_STRING + pSong->GetDisplayArtist() : RString(""); + RString sTranslitArtist = pSong ? (RString)ARTIST_PREPEND_STRING + pSong->GetTranslitArtist() : RString(""); LoadFromString( sDisplayTitle, sTranslitTitle, diff --git a/stepmania/src/TextBanner.h b/stepmania/src/TextBanner.h index 4bc571d9ea..a2ce284bd5 100644 --- a/stepmania/src/TextBanner.h +++ b/stepmania/src/TextBanner.h @@ -13,19 +13,19 @@ class TextBanner : public ActorFrame public: TextBanner(); TextBanner( const TextBanner &cpy ); - void Load( CString sType ); // load metrics + void Load( RString sType ); // load metrics void LoadFromSong( const Song* pSong ); void LoadFromString( - const CString &sDisplayTitle, const CString &sTranslitTitle, - const CString &sDisplaySubTitle, const CString &sTranslitSubTitle, - const CString &sDisplayArtist, const CString &sTranslitArtist ); + const RString &sDisplayTitle, const RString &sTranslitTitle, + const RString &sDisplaySubTitle, const RString &sTranslitSubTitle, + const RString &sDisplayArtist, const RString &sTranslitArtist ); private: bool m_bInitted; BitmapText m_textTitle, m_textSubTitle, m_textArtist; - ThemeMetric ARTIST_PREPEND_STRING; + ThemeMetric ARTIST_PREPEND_STRING; ThemeMetric TWO_LINES_TITLE_COMMAND; ThemeMetric TWO_LINES_SUBTITLE_COMMAND; ThemeMetric TWO_LINES_ARTIST_COMMAND; diff --git a/stepmania/src/TimingData.h b/stepmania/src/TimingData.h index 7a463b16a1..e6566aa3ad 100644 --- a/stepmania/src/TimingData.h +++ b/stepmania/src/TimingData.h @@ -89,7 +89,7 @@ public: void InsertRows( int iStartRow, int iRowsToAdd ); void DeleteRows( int iStartRow, int iRowsToDelete ); - CString m_sFile; // informational only + RString m_sFile; // informational only vector m_BPMSegments; // this must be sorted before gameplay vector m_StopSegments; // this must be sorted before gameplay float m_fBeat0OffsetInSeconds; diff --git a/stepmania/src/TitleSubstitution.cpp b/stepmania/src/TitleSubstitution.cpp index a01c803ba9..a2cca161a4 100644 --- a/stepmania/src/TitleSubstitution.cpp +++ b/stepmania/src/TitleSubstitution.cpp @@ -9,8 +9,8 @@ #include "XmlFile.h" #include "XmlFileUtil.h" -static const CString TRANSLATIONS_PATH = "Data/Translations.xml"; -static const CString ERASE_MARKER = "-erase-"; +static const RString TRANSLATIONS_PATH = "Data/Translations.xml"; +static const RString ERASE_MARKER = "-erase-"; struct TitleTrans { @@ -49,8 +49,8 @@ void TitleTrans::LoadFromNode( const XNode* pNode ) { /* Surround each regex with ^(...)$, to force all comparisons to default * to being a full-line match. (Add ".*" manually if this isn't wanted.) */ - const CString &sKeyName = attr->first; - const CString &sValue = attr->second; + const RString &sKeyName = attr->first; + const RString &sValue = attr->second; if( sKeyName == "DontTransliterate" ) translit = false; else if( sKeyName == "TitleFrom" ) TitleFrom = "^(" + sValue + ")$"; else if( sKeyName == "ArtistFrom" ) ArtistFrom = "^(" + sValue + ")$"; @@ -87,21 +87,21 @@ void TitleSubst::Subst( TitleFields &tf ) { if( tt->translit ) tf.TitleTranslit = tf.Title; - tf.Title = (tt->Replacement.Title != ERASE_MARKER)? to.Title : CString(); + tf.Title = (tt->Replacement.Title != ERASE_MARKER)? to.Title : RString(); FontCharAliases::ReplaceMarkers( tf.Title ); } if( !tt->Replacement.Subtitle.empty() && tf.Subtitle != tt->Replacement.Subtitle ) { if( tt->translit ) tf.SubtitleTranslit = tf.Subtitle; - tf.Subtitle = (tt->Replacement.Subtitle != ERASE_MARKER)? to.Subtitle : CString(); + tf.Subtitle = (tt->Replacement.Subtitle != ERASE_MARKER)? to.Subtitle : RString(); FontCharAliases::ReplaceMarkers( tf.Subtitle ); } if( !tt->Replacement.Artist.empty() && tf.Artist != tt->Replacement.Artist ) { if( tt->translit ) tf.ArtistTranslit = tf.Artist; - tf.Artist = (tt->Replacement.Artist != ERASE_MARKER)? to.Artist : CString(); + tf.Artist = (tt->Replacement.Artist != ERASE_MARKER)? to.Artist : RString(); FontCharAliases::ReplaceMarkers( tf.Artist ); } @@ -109,17 +109,17 @@ void TitleSubst::Subst( TitleFields &tf ) * correct data. Should be used sparingly. */ if( !tt->Replacement.TitleTranslit.empty() ) { - tf.TitleTranslit = (tt->Replacement.TitleTranslit != ERASE_MARKER)? tt->Replacement.TitleTranslit : CString(); + tf.TitleTranslit = (tt->Replacement.TitleTranslit != ERASE_MARKER)? tt->Replacement.TitleTranslit : RString(); FontCharAliases::ReplaceMarkers( tf.TitleTranslit ); } if( !tt->Replacement.SubtitleTranslit.empty() ) { - tf.SubtitleTranslit = (tt->Replacement.SubtitleTranslit != ERASE_MARKER)? tt->Replacement.SubtitleTranslit : CString(); + tf.SubtitleTranslit = (tt->Replacement.SubtitleTranslit != ERASE_MARKER)? tt->Replacement.SubtitleTranslit : RString(); FontCharAliases::ReplaceMarkers( tf.SubtitleTranslit ); } if( !tt->Replacement.ArtistTranslit.empty() ) { - tf.ArtistTranslit = (tt->Replacement.ArtistTranslit != ERASE_MARKER)? tt->Replacement.ArtistTranslit : CString(); + tf.ArtistTranslit = (tt->Replacement.ArtistTranslit != ERASE_MARKER)? tt->Replacement.ArtistTranslit : RString(); FontCharAliases::ReplaceMarkers( tf.ArtistTranslit ); } @@ -128,12 +128,12 @@ void TitleSubst::Subst( TitleFields &tf ) } -TitleSubst::TitleSubst(const CString §ion) +TitleSubst::TitleSubst(const RString §ion) { Load( TRANSLATIONS_PATH, section); } -void TitleSubst::Load(const CString &filename, const CString §ion) +void TitleSubst::Load(const RString &filename, const RString §ion) { XNode xml; if( !XmlFileUtil::LoadFromFileShowErrors(xml,filename) ) diff --git a/stepmania/src/TitleSubstitution.h b/stepmania/src/TitleSubstitution.h index ad1a416120..a5781d925a 100644 --- a/stepmania/src/TitleSubstitution.h +++ b/stepmania/src/TitleSubstitution.h @@ -6,8 +6,8 @@ struct TitleFields { void SaveToStrings( - CString &sTitle, CString &sSubtitle, CString &sArtist, - CString &sTitleTranslit, CString &sSubtitleTranslit, CString &sArtistTranslit ) const + RString &sTitle, RString &sSubtitle, RString &sArtist, + RString &sTitleTranslit, RString &sSubtitleTranslit, RString &sArtistTranslit ) const { sTitle = Title; sSubtitle = Subtitle; @@ -18,8 +18,8 @@ struct TitleFields } void LoadFromStrings( - CString sTitle, CString sSubtitle, CString sArtist, - CString sTitleTranslit, CString sSubtitleTranslit, CString sArtistTranslit ) + RString sTitle, RString sSubtitle, RString sArtist, + RString sTitleTranslit, RString sSubtitleTranslit, RString sArtistTranslit ) { Title = sTitle; Subtitle = sSubtitle; @@ -28,8 +28,8 @@ struct TitleFields SubtitleTranslit = sSubtitleTranslit; ArtistTranslit = sArtistTranslit; } - CString Title, Subtitle, Artist; - CString TitleTranslit, SubtitleTranslit, ArtistTranslit; + RString Title, Subtitle, Artist; + RString TitleTranslit, SubtitleTranslit, ArtistTranslit; }; struct TitleTrans; @@ -39,10 +39,10 @@ class TitleSubst void AddTrans(const TitleTrans &tr); public: - TitleSubst(const CString §ion); + TitleSubst(const RString §ion); ~TitleSubst(); - void Load(const CString &filename, const CString §ion); + void Load(const RString &filename, const RString §ion); void Subst( TitleFields &tf ); }; diff --git a/stepmania/src/Trail.h b/stepmania/src/Trail.h index fa443f3d9e..4d809c2f0f 100644 --- a/stepmania/src/Trail.h +++ b/stepmania/src/Trail.h @@ -26,7 +26,7 @@ struct TrailEntry Song* pSong; Steps* pSteps; - CString Modifiers; + RString Modifiers; AttackArray Attacks; bool bSecret; // show "???" diff --git a/stepmania/src/TrailUtil.cpp b/stepmania/src/TrailUtil.cpp index 672e8d279c..58540183de 100644 --- a/stepmania/src/TrailUtil.cpp +++ b/stepmania/src/TrailUtil.cpp @@ -49,7 +49,7 @@ void TrailID::LoadFromNode( const XNode* pNode ) { ASSERT( pNode->m_sName == "Trail" ); - CString sTemp; + RString sTemp; pNode->GetAttrValue("StepsType", sTemp); st = GameManager::StringToStepsType( sTemp ); @@ -58,9 +58,9 @@ void TrailID::LoadFromNode( const XNode* pNode ) cd = StringToCourseDifficulty( sTemp ); } -CString TrailID::ToString() const +RString TrailID::ToString() const { - CString s = GameManager::StepsTypeToString(st); + RString s = GameManager::StepsTypeToString(st); s += " " + CourseDifficultyToString(cd); return s; } diff --git a/stepmania/src/TrailUtil.h b/stepmania/src/TrailUtil.h index baff31ef41..2eb33b5c55 100644 --- a/stepmania/src/TrailUtil.h +++ b/stepmania/src/TrailUtil.h @@ -24,7 +24,7 @@ public: XNode* CreateNode() const; void LoadFromNode( const XNode* pNode ); - CString ToString() const; + RString ToString() const; bool IsValid() const; static void Invalidate( Song* pStaleSong ); }; diff --git a/stepmania/src/Transition.cpp b/stepmania/src/Transition.cpp index 30c1c32b83..b5d9587422 100644 --- a/stepmania/src/Transition.cpp +++ b/stepmania/src/Transition.cpp @@ -17,7 +17,7 @@ Transition::Transition() m_State = waiting; } -void Transition::Load( CString sBGAniDir ) +void Transition::Load( RString sBGAniDir ) { this->RemoveAllChildren(); @@ -66,7 +66,7 @@ bool Transition::EarlyAbortDraw() const /* Our parent might send us OnCommand. We do that ourself, because * we sometimes want to know GetLengthSeconds before StartTransitioning. * Make sure we don't process OnCommand twice. */ -void Transition::PlayCommand( const CString &sCommandName, Actor *pParent ) +void Transition::PlayCommand( const RString &sCommandName, Actor *pParent ) { if( sCommandName == "On" ) return; diff --git a/stepmania/src/Transition.h b/stepmania/src/Transition.h index f802c40566..dc07820875 100644 --- a/stepmania/src/Transition.h +++ b/stepmania/src/Transition.h @@ -13,10 +13,10 @@ class Transition : public ActorFrame public: Transition(); - void Load( CString sBGAniDir ); + void Load( RString sBGAniDir ); virtual void UpdateInternal( float fDeltaTime ); - virtual void PlayCommand( const CString &sCommandName, Actor *pParent = NULL ); + virtual void PlayCommand( const RString &sCommandName, Actor *pParent = NULL ); virtual void StartTransitioning( ScreenMessage send_when_done = SM_None ); virtual bool EarlyAbortDraw() const; diff --git a/stepmania/src/UnlockManager.cpp b/stepmania/src/UnlockManager.cpp index e0536cb192..66c5e72e20 100644 --- a/stepmania/src/UnlockManager.cpp +++ b/stepmania/src/UnlockManager.cpp @@ -50,7 +50,7 @@ void UnlockManager::UnlockSong( const Song *song ) UnlockCode( p->m_iCode ); } -int UnlockManager::FindCode( const CString &sName ) const +int UnlockManager::FindCode( const RString &sName ) const { const UnlockEntry *pEntry = NULL; @@ -127,7 +127,7 @@ bool UnlockManager::StepsIsLocked( const Song *pSong, const Steps *pSteps ) cons return p->IsLocked(); } -bool UnlockManager::ModifierIsLocked( const CString &sOneMod ) const +bool UnlockManager::ModifierIsLocked( const RString &sOneMod ) const { if( !PREFSMAN->m_bUseUnlockSystem ) return false; @@ -164,7 +164,7 @@ const UnlockEntry *UnlockManager::FindCourse( const Course *pCourse ) const return NULL; } -const UnlockEntry *UnlockManager::FindModifier( const CString &sOneMod ) const +const UnlockEntry *UnlockManager::FindModifier( const RString &sOneMod ) const { FOREACH_CONST( UnlockEntry, m_UnlockEntries, e ) if( e->m_cmd.GetArg(1).s.CompareNoCase(sOneMod) == 0 ) @@ -295,15 +295,15 @@ void UnlockManager::Load() { LOG->Trace( "UnlockManager::Load()" ); - vector asUnlockNames; + vector asUnlockNames; split( UNLOCK_NAMES, ",", asUnlockNames ); if( asUnlockNames.empty() ) return; for( unsigned i = 0; i < asUnlockNames.size(); ++i ) { - const CString &sUnlockName = asUnlockNames[i]; - CString sUnlock = UNLOCK(sUnlockName); + const RString &sUnlockName = asUnlockNames[i]; + RString sUnlock = UNLOCK(sUnlockName); Commands vCommands; ParseCommands( sUnlock, vCommands ); @@ -314,7 +314,7 @@ void UnlockManager::Load() for( unsigned j = 0; j < vCommands.v.size(); ++j ) { const Command &cmd = vCommands.v[j]; - CString sName = cmd.GetName(); + RString sName = cmd.GetName(); if( sName == "song" ) { @@ -341,7 +341,7 @@ void UnlockManager::Load() // Hack: Lua only has a floating point type, and codes may be big enough // that converting them from string to float to int introduces rounding // error. Convert directly to int. - current.m_iCode = atoi( (CString) cmd.GetArg(1) ); + current.m_iCode = atoi( (RString) cmd.GetArg(1) ); } else if( sName == "roulette" ) { @@ -365,7 +365,7 @@ void UnlockManager::Load() FOREACH_CONST( UnlockEntry, m_UnlockEntries, e ) { - CString str = ssprintf( "Unlock: %s; ", join("\n",e->m_cmd.m_vsArgs).c_str() ); + RString str = ssprintf( "Unlock: %s; ", join("\n",e->m_cmd.m_vsArgs).c_str() ); FOREACH_UnlockType(j) if( e->m_fRequired[j] ) str += ssprintf( "%s = %f; ", UnlockTypeToString(j).c_str(), e->m_fRequired[j] ); @@ -510,7 +510,7 @@ class LunaUnlockManager: public Luna public: LunaUnlockManager() { LUA->Register( Register ); } - static int FindCode( T* p, lua_State *L ) { CString sName = SArg(1); int i = p->FindCode(sName); if( i == -1 ) lua_pushnil(L); else lua_pushnumber(L, i); return 1; } + static int FindCode( T* p, lua_State *L ) { RString sName = SArg(1); int i = p->FindCode(sName); if( i == -1 ) lua_pushnil(L); else lua_pushnumber(L, i); return 1; } static int UnlockCode( T* p, lua_State *L ) { int iCode = IArg(1); p->UnlockCode(iCode); return 0; } static int PreferUnlockCode( T* p, lua_State *L ) { int iCode = IArg(1); p->PreferUnlockCode(iCode); return 0; } static int GetNumUnlocks( T* p, lua_State *L ) { lua_pushnumber( L, p->GetNumUnlocks() ); return 1; } diff --git a/stepmania/src/UnlockManager.h b/stepmania/src/UnlockManager.h index b60aaf6775..38affee702 100644 --- a/stepmania/src/UnlockManager.h +++ b/stepmania/src/UnlockManager.h @@ -74,7 +74,7 @@ public: bool SongIsRouletteOnly( const Song *song ) const; bool StepsIsLocked( const Song *pSong, const Steps *pSteps ) const; bool CourseIsLocked( const Course *course ) const; - bool ModifierIsLocked( const CString &sOneMod ) const; + bool ModifierIsLocked( const RString &sOneMod ) const; // Gets number of unlocks for title screen int GetNumUnlocks() const; @@ -94,7 +94,7 @@ public: void UnlockSong( const Song *song ); // Return the associated code. - int FindCode( const CString &sName ) const; + int FindCode( const RString &sName ) const; // All locked songs are stored here vector m_UnlockEntries; @@ -116,7 +116,7 @@ private: const UnlockEntry *FindSong( const Song *pSong ) const; const UnlockEntry *FindSteps( const Song *pSong, const Steps *pSteps ) const; const UnlockEntry *FindCourse( const Course *pCourse ) const; - const UnlockEntry *FindModifier( const CString &sOneMod ) const; + const UnlockEntry *FindModifier( const RString &sOneMod ) const; set m_RouletteCodes; // "codes" which are available in roulette and which unlock if rouletted }; diff --git a/stepmania/src/WheelBase.cpp b/stepmania/src/WheelBase.cpp index eb645d37fe..028488b1f8 100644 --- a/stepmania/src/WheelBase.cpp +++ b/stepmania/src/WheelBase.cpp @@ -36,7 +36,7 @@ WheelBase::~WheelBase() m_LastSelection = NULL; } -void WheelBase::Load( CString sType ) +void WheelBase::Load( RString sType ) { LOG->Trace( "WheelBase::Load('%s')", sType.c_str() ); @@ -57,7 +57,7 @@ void WheelBase::Load( CString sType ) RebuildWheelItems(); } -void WheelBase::LoadFromMetrics( CString sType ) +void WheelBase::LoadFromMetrics( RString sType ) { SWITCH_SECONDS .Load(sType,"SwitchSeconds"); LOCKED_INITIAL_VELOCITY .Load(sType,"LockedInitialVelocity"); @@ -373,7 +373,7 @@ bool WheelBase::Select() // return true if this selection ends the screen return false; case TYPE_SECTION: { - CString sThisItemSectionName = m_WheelBaseItemsData[m_iSelection]->m_sText; + RString sThisItemSectionName = m_WheelBaseItemsData[m_iSelection]->m_sText; if( m_sExpandedSectionName == sThisItemSectionName ) // already expanded m_sExpandedSectionName = ""; // collapse it else // already collapsed diff --git a/stepmania/src/WheelBase.h b/stepmania/src/WheelBase.h index 813f81b367..02c0dbb45b 100644 --- a/stepmania/src/WheelBase.h +++ b/stepmania/src/WheelBase.h @@ -20,7 +20,7 @@ class WheelBase : public ActorFrame public: WheelBase(); virtual ~WheelBase(); - virtual void Load( CString sType ); + virtual void Load( RString sType ); virtual void Update( float fDeltaTime ); virtual void DrawPrimitives(); @@ -56,7 +56,7 @@ public: WheelItemBaseData* LastSelected(); protected: - void LoadFromMetrics( CString sType ); + void LoadFromMetrics( RString sType ); void LoadVariables(); virtual void UpdateSwitch(); virtual void UpdateItems(float fDeltaTime); @@ -76,7 +76,7 @@ protected: bool m_isEmpty; int m_iSelection; // index into m_CurWheelItemBaseData - CString m_sExpandedSectionName; + RString m_sExpandedSectionName; int m_iSwitchesLeftInSpinDown; diff --git a/stepmania/src/WheelItemBase.cpp b/stepmania/src/WheelItemBase.cpp index 96e063ca87..115cc5438e 100644 --- a/stepmania/src/WheelItemBase.cpp +++ b/stepmania/src/WheelItemBase.cpp @@ -1,7 +1,7 @@ #include "global.h" #include "WheelItemBase.h" -WheelItemBaseData::WheelItemBaseData( WheelItemType wit, CString sText, RageColor color ) +WheelItemBaseData::WheelItemBaseData( WheelItemType wit, RString sText, RageColor color ) { m_Type = wit; m_sText = sText; @@ -26,14 +26,14 @@ WheelItemBase::WheelItemBase( const WheelItemBase &cpy ): } } -WheelItemBase::WheelItemBase(CString sType) +WheelItemBase::WheelItemBase(RString sType) { SetName( sType ); m_pBar = NULL; Load(sType); } -void WheelItemBase::Load( CString sType ) +void WheelItemBase::Load( RString sType ) { TEXT_X .Load(sType,"TextX"); TEXT_Y .Load(sType,"TextY"); diff --git a/stepmania/src/WheelItemBase.h b/stepmania/src/WheelItemBase.h index 1dc0470923..2bcc133315 100644 --- a/stepmania/src/WheelItemBase.h +++ b/stepmania/src/WheelItemBase.h @@ -26,11 +26,11 @@ enum WheelItemType class WheelItemBase : public ActorFrame { public: - WheelItemBase( CString sType = "WheelItemBase" ); + WheelItemBase( RString sType = "WheelItemBase" ); WheelItemBase( const WheelItemBase &cpy ); virtual void DrawPrimitives(); - void Load( CString sType ); + void Load( RString sType ); void DrawGrayBar( Actor& bar ); virtual void LoadFromWheelItemBaseData( WheelItemBaseData* pWID ); @@ -57,10 +57,10 @@ protected: struct WheelItemBaseData { WheelItemBaseData() {} - WheelItemBaseData( WheelItemType wit, CString sText, RageColor color ); + WheelItemBaseData( WheelItemType wit, RString sText, RageColor color ); WheelItemType m_Type; - CString m_sText; + RString m_sText; RageColor m_color; // either text color or section background color WheelNotifyIcon::Flags m_Flags; }; diff --git a/stepmania/src/arch/ArchHooks/ArchHooks_Unix.cpp b/stepmania/src/arch/ArchHooks/ArchHooks_Unix.cpp index 163c667d87..f68bd41cc2 100644 --- a/stepmania/src/arch/ArchHooks/ArchHooks_Unix.cpp +++ b/stepmania/src/arch/ArchHooks/ArchHooks_Unix.cpp @@ -176,7 +176,7 @@ ArchHooks_Unix::ArchHooks_Unix() #define _CS_GNU_LIBC_VERSION 2 #endif -static CString LibcVersion() +static RString LibcVersion() { char buf[1024] = "(error)"; int ret = confstr( _CS_GNU_LIBC_VERSION, buf, sizeof(buf) ); @@ -188,7 +188,7 @@ static CString LibcVersion() void ArchHooks_Unix::DumpDebugInfo() { - CString sys; + RString sys; int vers; GetKernel( sys, vers ); LOG->Info( "OS: %s ver %06i", sys.c_str(), vers ); @@ -207,7 +207,7 @@ void ArchHooks_Unix::DumpDebugInfo() void ArchHooks_Unix::SetTime( tm newtime ) { - CString sCommand = ssprintf( "date %02d%02d%02d%02d%04d.%02d", + RString sCommand = ssprintf( "date %02d%02d%02d%02d%04d.%02d", newtime.tm_mon+1, newtime.tm_mday, newtime.tm_hour, @@ -225,7 +225,7 @@ void ArchHooks_Unix::SetTime( tm newtime ) #include static LocalizedString COULDNT_FIND_SONGS( "ArchHooks_Unix", "Couldn't find 'Songs'" ); -void ArchHooks::MountInitialFilesystems( const CString &sDirOfExecutable ) +void ArchHooks::MountInitialFilesystems( const RString &sDirOfExecutable ) { #if defined(LINUX) /* Mount the root filesystem, so we can read files in /proc, /etc, and so on. @@ -240,7 +240,7 @@ void ArchHooks::MountInitialFilesystems( const CString &sDirOfExecutable ) * scores. It would need to handle permissions properly. */ /* RageFileManager::Mount( "dir", "/var/lib/games/stepmania", "/Save/Profiles" ); */ - // CString Home = getenv( "HOME" ) + "/" + PRODUCT_NAME; + // RString Home = getenv( "HOME" ) + "/" + PRODUCT_NAME; /* * Next: path to write general mutable user data. If the above path fails (eg. @@ -258,7 +258,7 @@ void ArchHooks::MountInitialFilesystems( const CString &sDirOfExecutable ) /* Search for a directory with "Songs" in it. Be careful: the CWD is likely to * be ~, and it's possible that some users will have a ~/Songs/ directory that * has nothing to do with us, so check the initial directory last. */ - CString Root = ""; + RString Root = ""; struct stat st; if( Root == "" && !stat( sDirOfExecutable + "/Songs", &st ) && st.st_mode&S_IFDIR ) Root = sDirOfExecutable; diff --git a/stepmania/src/arch/ArchHooks/ArchHooks_Unix.h b/stepmania/src/arch/ArchHooks/ArchHooks_Unix.h index a6930ad5ef..f89ea8ca65 100644 --- a/stepmania/src/arch/ArchHooks/ArchHooks_Unix.h +++ b/stepmania/src/arch/ArchHooks/ArchHooks_Unix.h @@ -11,7 +11,7 @@ public: void SetTime( tm newtime ); int64_t GetMicrosecondsSinceStart(); - void MountInitialFilesystems( const CString &sDirOfExecutable ); + void MountInitialFilesystems( const RString &sDirOfExecutable ); }; #ifdef ARCH_HOOKS diff --git a/stepmania/src/arch/ArchHooks/ArchHooks_Win32Static.cpp b/stepmania/src/arch/ArchHooks/ArchHooks_Win32Static.cpp index db22ad0206..442e83575a 100644 --- a/stepmania/src/arch/ArchHooks/ArchHooks_Win32Static.cpp +++ b/stepmania/src/arch/ArchHooks/ArchHooks_Win32Static.cpp @@ -61,7 +61,7 @@ void ArchHooks::MountInitialFilesystems( const RString &sDirOfExecutable ) FILEMAN->Mount( "dir", sDesktopDir, "/Desktop" ); } -static CString LangIdToString( LANGID l ) +static RString LangIdToString( LANGID l ) { switch( PRIMARYLANGID(l) ) { diff --git a/stepmania/src/arch/ArchHooks/ArchHooks_Xbox.cpp b/stepmania/src/arch/ArchHooks/ArchHooks_Xbox.cpp index 88f452cccf..713c9844b2 100644 --- a/stepmania/src/arch/ArchHooks/ArchHooks_Xbox.cpp +++ b/stepmania/src/arch/ArchHooks/ArchHooks_Xbox.cpp @@ -135,7 +135,7 @@ ArchHooks_Xbox::~ArchHooks_Xbox() #include "RageFileManager.h" -void ArchHooks_Xbox::MountInitialFilesystems( const CString &sDirOfExecutable ) +void ArchHooks_Xbox::MountInitialFilesystems( const RString &sDirOfExecutable ) { FILEMAN->Mount( "dir", "D:\\", "/" ); } diff --git a/stepmania/src/arch/ArchHooks/ArchHooks_Xbox.h b/stepmania/src/arch/ArchHooks/ArchHooks_Xbox.h index e0abcdad87..580cb67576 100644 --- a/stepmania/src/arch/ArchHooks/ArchHooks_Xbox.h +++ b/stepmania/src/arch/ArchHooks/ArchHooks_Xbox.h @@ -10,7 +10,7 @@ public: ArchHooks_Xbox(); ~ArchHooks_Xbox(); - void MountInitialFilesystems( const CString &sDirOfExecutable ); + void MountInitialFilesystems( const RString &sDirOfExecutable ); }; // Read a 64 bit MSR register diff --git a/stepmania/src/arch/ArchHooks/ArchHooks_darwin.cpp b/stepmania/src/arch/ArchHooks/ArchHooks_darwin.cpp index 45656943d0..a9ed36903a 100644 --- a/stepmania/src/arch/ArchHooks/ArchHooks_darwin.cpp +++ b/stepmania/src/arch/ArchHooks/ArchHooks_darwin.cpp @@ -122,7 +122,7 @@ ArchHooks_darwin::~ArchHooks_darwin() void ArchHooks_darwin::DumpDebugInfo() { - CString systemVersion; + RString systemVersion; OSErr err; long code; @@ -162,7 +162,7 @@ void ArchHooks_darwin::DumpDebugInfo() } /* Get processor information */ - CString processor; + RString processor; int numProcessors; struct host_basic_info info; mach_port_t host = mach_host_self(); @@ -218,7 +218,7 @@ extern "C" RString ArchHooks::GetPreferredLanguage() { char *lang = ::GetPreferredLanguage(); - CString ret = lang; + RString ret = lang; free(lang); return ret.ToUpper(); @@ -290,7 +290,7 @@ int64_t ArchHooks::GetMicrosecondsSinceStart( bool bAccurate ) #include "RageFileManager.h" -void ArchHooks::MountInitialFilesystems( const CString &sDirOfExecutable ) +void ArchHooks::MountInitialFilesystems( const RString &sDirOfExecutable ) { CFBundleRef bundle = CFBundleGetMainBundle(); CFURLRef bundleURL = CFBundleCopyBundleURL( bundle ); diff --git a/stepmania/src/arch/Dialog/DialogDriver_Cocoa.cpp b/stepmania/src/arch/Dialog/DialogDriver_Cocoa.cpp index 651009cdc7..d3b4b6fa38 100644 --- a/stepmania/src/arch/Dialog/DialogDriver_Cocoa.cpp +++ b/stepmania/src/arch/Dialog/DialogDriver_Cocoa.cpp @@ -5,7 +5,7 @@ #include "ProductInfo.h" #include -static CFOptionFlags ShowAlert( CFOptionFlags flags, const CString& sMessage, CFStringRef OK, +static CFOptionFlags ShowAlert( CFOptionFlags flags, const RString& sMessage, CFStringRef OK, CFStringRef alt = NULL, CFStringRef other = NULL) { CFOptionFlags result; @@ -17,7 +17,7 @@ static CFOptionFlags ShowAlert( CFOptionFlags flags, const CString& sMessage, CF return result; } -void DialogDriver_Cocoa::OK( CString sMessage, CString sID ) +void DialogDriver_Cocoa::OK( RString sMessage, RString sID ) { CFOptionFlags result = ShowAlert( kCFUserNotificationNoteAlertLevel, sMessage, CFSTR("OK"), CFSTR("Don't show again") ); @@ -26,12 +26,12 @@ void DialogDriver_Cocoa::OK( CString sMessage, CString sID ) Dialog::IgnoreMessage( sID ); } -void DialogDriver_Cocoa::Error( CString sError, CString sID ) +void DialogDriver_Cocoa::Error( RString sError, RString sID ) { ShowAlert( kCFUserNotificationStopAlertLevel, sError, CFSTR("OK") ); } -Dialog::Result DialogDriver_Cocoa::AbortRetryIgnore( CString sMessage, CString sID ) +Dialog::Result DialogDriver_Cocoa::AbortRetryIgnore( RString sMessage, RString sID ) { CFOptionFlags result = ShowAlert( kCFUserNotificationNoteAlertLevel, sMessage, CFSTR("Ignore"), CFSTR("Retry"), CFSTR("Abort") ); @@ -50,7 +50,7 @@ Dialog::Result DialogDriver_Cocoa::AbortRetryIgnore( CString sMessage, CString s } } -Dialog::Result DialogDriver_Cocoa::AbortRetry( CString sMessage, CString sID ) +Dialog::Result DialogDriver_Cocoa::AbortRetry( RString sMessage, RString sID ) { CFOptionFlags result = ShowAlert( kCFUserNotificationNoteAlertLevel, sMessage, CFSTR("Abort"), CFSTR("Retry") ); diff --git a/stepmania/src/arch/Dialog/DialogDriver_Cocoa.h b/stepmania/src/arch/Dialog/DialogDriver_Cocoa.h index 4d41b3a8d0..3c11ad4c3c 100644 --- a/stepmania/src/arch/Dialog/DialogDriver_Cocoa.h +++ b/stepmania/src/arch/Dialog/DialogDriver_Cocoa.h @@ -6,10 +6,10 @@ class DialogDriver_Cocoa: public DialogDriver { public: - void Error( CString sError, CString sID ); - void OK( CString sMessage, CString sID ); - Dialog::Result AbortRetryIgnore( CString sMessage, CString sID ); - Dialog::Result AbortRetry( CString sMessage, CString sID ); + void Error( RString sError, RString sID ); + void OK( RString sMessage, RString sID ); + Dialog::Result AbortRetryIgnore( RString sMessage, RString sID ); + Dialog::Result AbortRetry( RString sMessage, RString sID ); }; #define USE_DIALOG_DRIVER_COCOA diff --git a/stepmania/src/arch/InputHandler/InputHandler.cpp b/stepmania/src/arch/InputHandler/InputHandler.cpp index 85b1ccda31..6b49c80bd6 100644 --- a/stepmania/src/arch/InputHandler/InputHandler.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler.cpp @@ -38,7 +38,7 @@ void InputHandler::ButtonPressed( DeviceInput di, bool Down ) } } -CString InputHandler::GetDeviceSpecificInputString( const DeviceInput &di ) +RString InputHandler::GetDeviceSpecificInputString( const DeviceInput &di ) { if( di.device == DEVICE_KEYBOARD ) { diff --git a/stepmania/src/arch/InputHandler/InputHandler.h b/stepmania/src/arch/InputHandler/InputHandler.h index b6692d8bb0..ca437ab211 100644 --- a/stepmania/src/arch/InputHandler/InputHandler.h +++ b/stepmania/src/arch/InputHandler/InputHandler.h @@ -29,10 +29,10 @@ public: virtual ~InputHandler() { } virtual void Update() { } virtual bool DevicesChanged() { return false; } - virtual void GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ) = 0; + virtual void GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ) = 0; // Override to return a pretty string that's specific to the controller type. - virtual CString GetDeviceSpecificInputString( const DeviceInput &di ); + virtual RString GetDeviceSpecificInputString( const DeviceInput &di ); // Override to find out whether the controller is currently plugged in. // Not all InputHandlers will support this. Not applicable to all InputHandlers. diff --git a/stepmania/src/arch/InputHandler/InputHandler_Carbon.cpp b/stepmania/src/arch/InputHandler/InputHandler_Carbon.cpp index 6f71f5575a..82dadb7562 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_Carbon.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_Carbon.cpp @@ -71,7 +71,7 @@ private: IOHIDDeviceInterface **mInterface; IOHIDQueueInterface **mQueue; bool mRunning; - CString mDescription; + RString mDescription; static void AddLogicalDevice( const void *value, void *context ); static void AddElement( const void *value, void *context ); @@ -91,7 +91,7 @@ public: bool Open( io_object_t device ); void StartQueue( CFRunLoopRef loopRef, IOHIDCallbackFunction callback, void *target, int refCon ); - inline const CString& GetDescription() const { return mDescription; } + inline const RString& GetDescription() const { return mDescription; } }; Device::Device() : mInterface( NULL ), mQueue( NULL ), mRunning( false ) @@ -840,7 +840,7 @@ InputHandler_Carbon::InputHandler_Carbon() : mSem( "Input thread started" ) } } -void InputHandler_Carbon::GetDevicesAndDescriptions( vector& dev, vector& desc ) +void InputHandler_Carbon::GetDevicesAndDescriptions( vector& dev, vector& desc ) { dev.push_back( DEVICE_KEYBOARD ); desc.push_back( "Keyboard" ); diff --git a/stepmania/src/arch/InputHandler/InputHandler_Carbon.h b/stepmania/src/arch/InputHandler/InputHandler_Carbon.h index fc2ded0146..a7e3dd8e85 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_Carbon.h +++ b/stepmania/src/arch/InputHandler/InputHandler_Carbon.h @@ -23,7 +23,7 @@ public: InputHandler_Carbon(); ~InputHandler_Carbon(); - void GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ); + void GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ); static void QueueCallBack( void *target, int result, void *refcon, void *sender ); }; diff --git a/stepmania/src/arch/InputHandler/InputHandler_DirectInput.cpp b/stepmania/src/arch/InputHandler/InputHandler_DirectInput.cpp index 3a8052e84e..ae8edf777e 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_DirectInput.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_DirectInput.cpp @@ -576,7 +576,7 @@ void InputHandler_DInput::InputThreadMain() CloseHandle(Handle); } -void InputHandler_DInput::GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ) +void InputHandler_DInput::GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ) { for( unsigned i=0; i < Devices.size(); ++i ) { diff --git a/stepmania/src/arch/InputHandler/InputHandler_DirectInput.h b/stepmania/src/arch/InputHandler/InputHandler_DirectInput.h index 1331f2d506..87efb8a46e 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_DirectInput.h +++ b/stepmania/src/arch/InputHandler/InputHandler_DirectInput.h @@ -10,7 +10,7 @@ class InputHandler_DInput: public InputHandler public: InputHandler_DInput(); ~InputHandler_DInput(); - void GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ); + void GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ); void Update(); bool DevicesChanged(); void WindowReset(); diff --git a/stepmania/src/arch/InputHandler/InputHandler_Linux_Joystick.cpp b/stepmania/src/arch/InputHandler/InputHandler_Linux_Joystick.cpp index 8b870387ab..c44242fe78 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_Linux_Joystick.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_Linux_Joystick.cpp @@ -179,7 +179,7 @@ void InputHandler_Linux_Joystick::InputThread() InputHandler::UpdateTimer(); } -void InputHandler_Linux_Joystick::GetDevicesAndDescriptions(vector& vDevicesOut, vector& vDescriptionsOut) +void InputHandler_Linux_Joystick::GetDevicesAndDescriptions(vector& vDevicesOut, vector& vDescriptionsOut) { for(int i = 0; i < NUM_JOYSTICKS; ++i) { diff --git a/stepmania/src/arch/InputHandler/InputHandler_Linux_Joystick.h b/stepmania/src/arch/InputHandler/InputHandler_Linux_Joystick.h index 74d75a3fc5..6de5117b9e 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_Linux_Joystick.h +++ b/stepmania/src/arch/InputHandler/InputHandler_Linux_Joystick.h @@ -11,14 +11,14 @@ public: enum { NUM_JOYSTICKS = 4 }; InputHandler_Linux_Joystick(); ~InputHandler_Linux_Joystick(); - void GetDevicesAndDescriptions(vector& vDevicesOut, vector& vDescriptionsOut); + void GetDevicesAndDescriptions(vector& vDevicesOut, vector& vDescriptionsOut); private: static int InputThread_Start( void *p ); void InputThread(); int fds[NUM_JOYSTICKS]; - CString m_sDescription[NUM_JOYSTICKS]; + RString m_sDescription[NUM_JOYSTICKS]; RageThread m_InputThread; bool m_bShutdown; }; diff --git a/stepmania/src/arch/InputHandler/InputHandler_Linux_tty.cpp b/stepmania/src/arch/InputHandler/InputHandler_Linux_tty.cpp index 2113414789..9cc98a3193 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_Linux_tty.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_Linux_tty.cpp @@ -189,7 +189,7 @@ void InputHandler_Linux_tty::Update() InputHandler::UpdateTimer(); } -void InputHandler_Linux_tty::GetDevicesAndDescriptions(vector& vDevicesOut, vector& vDescriptionsOut) +void InputHandler_Linux_tty::GetDevicesAndDescriptions(vector& vDevicesOut, vector& vDescriptionsOut) { vDevicesOut.push_back( InputDevice(DEVICE_KEYBOARD) ); vDescriptionsOut.push_back( "Keyboard" ); diff --git a/stepmania/src/arch/InputHandler/InputHandler_Linux_tty.h b/stepmania/src/arch/InputHandler/InputHandler_Linux_tty.h index 3f4bd2fc3a..0d663b103a 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_Linux_tty.h +++ b/stepmania/src/arch/InputHandler/InputHandler_Linux_tty.h @@ -12,7 +12,7 @@ public: void Update(); InputHandler_Linux_tty(); ~InputHandler_Linux_tty(); - void GetDevicesAndDescriptions(vector& vDevicesOut, vector& vDescriptionsOut); + void GetDevicesAndDescriptions(vector& vDevicesOut, vector& vDescriptionsOut); }; #define USE_INPUT_HANDLER_LINUX_TTY diff --git a/stepmania/src/arch/InputHandler/InputHandler_MonkeyKeyboard.cpp b/stepmania/src/arch/InputHandler/InputHandler_MonkeyKeyboard.cpp index 66bbbc0335..fd2a8d64b7 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_MonkeyKeyboard.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_MonkeyKeyboard.cpp @@ -12,7 +12,7 @@ InputHandler_MonkeyKeyboard::~InputHandler_MonkeyKeyboard() { } -void InputHandler_MonkeyKeyboard::GetDevicesAndDescriptions(vector& vDevicesOut, vector& vDescriptionsOut) +void InputHandler_MonkeyKeyboard::GetDevicesAndDescriptions(vector& vDevicesOut, vector& vDescriptionsOut) { vDevicesOut.push_back( InputDevice(DEVICE_KEYBOARD) ); vDescriptionsOut.push_back( "MonkeyKeyboard" ); diff --git a/stepmania/src/arch/InputHandler/InputHandler_MonkeyKeyboard.h b/stepmania/src/arch/InputHandler/InputHandler_MonkeyKeyboard.h index 5d300b928d..848d165e18 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_MonkeyKeyboard.h +++ b/stepmania/src/arch/InputHandler/InputHandler_MonkeyKeyboard.h @@ -11,7 +11,7 @@ public: void Update(); InputHandler_MonkeyKeyboard(); ~InputHandler_MonkeyKeyboard(); - void GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ); + void GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ); private: RageTimer m_timerPressButton; diff --git a/stepmania/src/arch/InputHandler/InputHandler_SDL.cpp b/stepmania/src/arch/InputHandler/InputHandler_SDL.cpp index acf76c864b..0545e7c3b3 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_SDL.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_SDL.cpp @@ -248,7 +248,7 @@ void InputHandler_SDL::Update() } -void InputHandler_SDL::GetDevicesAndDescriptions(vector& vDevicesOut, vector& vDescriptionsOut) +void InputHandler_SDL::GetDevicesAndDescriptions(vector& vDevicesOut, vector& vDescriptionsOut) { vDevicesOut.push_back( DEVICE_KEYBOARD ); vDescriptionsOut.push_back( "Keyboard" ); diff --git a/stepmania/src/arch/InputHandler/InputHandler_SDL.h b/stepmania/src/arch/InputHandler/InputHandler_SDL.h index 19f999e813..30b3f383a8 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_SDL.h +++ b/stepmania/src/arch/InputHandler/InputHandler_SDL.h @@ -14,7 +14,7 @@ public: void Update(); InputHandler_SDL(); ~InputHandler_SDL(); - void GetDevicesAndDescriptions(vector& vDevicesOut, vector& vDescriptionsOut); + void GetDevicesAndDescriptions(vector& vDevicesOut, vector& vDescriptionsOut); }; #define USE_INPUT_HANDLER_SDL diff --git a/stepmania/src/arch/InputHandler/InputHandler_Win32_MIDI.cpp b/stepmania/src/arch/InputHandler/InputHandler_Win32_MIDI.cpp index 4a84823125..81073c03d4 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_Win32_MIDI.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_Win32_MIDI.cpp @@ -11,7 +11,7 @@ static HMIDIIN g_device; static void CALLBACK midiCallback(HMIDIIN g_device, UINT status, DWORD instancePtr, DWORD data, DWORD timestamp); -static CString GetMidiError( MMRESULT result ) +static RString GetMidiError( MMRESULT result ) { char szError[256]; midiOutGetErrorText( result, szError, 256 ); @@ -65,7 +65,7 @@ InputHandler_Win32_MIDI::~InputHandler_Win32_MIDI() } } -void InputHandler_Win32_MIDI::GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ) +void InputHandler_Win32_MIDI::GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ) { if( m_bFoundDevice ) { diff --git a/stepmania/src/arch/InputHandler/InputHandler_Win32_MIDI.h b/stepmania/src/arch/InputHandler/InputHandler_Win32_MIDI.h index 37414e8da7..9ea8d30250 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_Win32_MIDI.h +++ b/stepmania/src/arch/InputHandler/InputHandler_Win32_MIDI.h @@ -10,7 +10,7 @@ public: InputHandler_Win32_MIDI(); ~InputHandler_Win32_MIDI(); - void GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ); + void GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ); void SetDev( DeviceInput key, bool pressed ) { ButtonPressed( key, pressed ); } diff --git a/stepmania/src/arch/InputHandler/InputHandler_Win32_Para.cpp b/stepmania/src/arch/InputHandler/InputHandler_Win32_Para.cpp index ceb8be94e0..b02e47f4d1 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_Win32_Para.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_Win32_Para.cpp @@ -37,7 +37,7 @@ InputHandler_Win32_Para::InputHandler_Win32_Para() SAFE_DELETE( dev ); } -void InputHandler_Win32_Para::GetDevicesAndDescriptions(vector& vDevicesOut, vector& vDescriptionsOut) +void InputHandler_Win32_Para::GetDevicesAndDescriptions(vector& vDevicesOut, vector& vDescriptionsOut) { // The device appears as a HID joystick } diff --git a/stepmania/src/arch/InputHandler/InputHandler_Win32_Para.h b/stepmania/src/arch/InputHandler/InputHandler_Win32_Para.h index 6e1cb04ba3..3a9fb48bf5 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_Win32_Para.h +++ b/stepmania/src/arch/InputHandler/InputHandler_Win32_Para.h @@ -9,7 +9,7 @@ class InputHandler_Win32_Para: public InputHandler { public: InputHandler_Win32_Para(); - void GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ); + void GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ); }; #define USE_INPUT_HANDLER_WIN32_PARA diff --git a/stepmania/src/arch/InputHandler/InputHandler_Win32_Pump.cpp b/stepmania/src/arch/InputHandler/InputHandler_Win32_Pump.cpp index 8e2ea9ce29..2d4437e444 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_Win32_Pump.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_Win32_Pump.cpp @@ -67,7 +67,7 @@ void InputHandler_Win32_Pump::HandleInput( int iDevice, int iEvent ) } } -CString InputHandler_Win32_Pump::GetDeviceSpecificInputString( const DeviceInput &di ) +RString InputHandler_Win32_Pump::GetDeviceSpecificInputString( const DeviceInput &di ) { switch( di.button ) { @@ -87,7 +87,7 @@ CString InputHandler_Win32_Pump::GetDeviceSpecificInputString( const DeviceInput return InputHandler::GetDeviceSpecificInputString( di ); } -void InputHandler_Win32_Pump::GetDevicesAndDescriptions(vector& vDevicesOut, vector& vDescriptionsOut) +void InputHandler_Win32_Pump::GetDevicesAndDescriptions(vector& vDevicesOut, vector& vDescriptionsOut) { for(int i = 0; i < NUM_PUMPS; ++i) { diff --git a/stepmania/src/arch/InputHandler/InputHandler_Win32_Pump.h b/stepmania/src/arch/InputHandler/InputHandler_Win32_Pump.h index c87cb5dfe5..0b74464b18 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_Win32_Pump.h +++ b/stepmania/src/arch/InputHandler/InputHandler_Win32_Pump.h @@ -11,8 +11,8 @@ public: void Update(); InputHandler_Win32_Pump(); ~InputHandler_Win32_Pump(); - CString GetDeviceSpecificInputString( const DeviceInput &di ); - void GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ); + RString GetDeviceSpecificInputString( const DeviceInput &di ); + void GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ); private: USBDevice *m_pDevice; diff --git a/stepmania/src/arch/InputHandler/InputHandler_X11.cpp b/stepmania/src/arch/InputHandler/InputHandler_X11.cpp index a5dea1c65d..1cb9e147f7 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_X11.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_X11.cpp @@ -170,7 +170,7 @@ void InputHandler_X11::Update() } -void InputHandler_X11::GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ) +void InputHandler_X11::GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ) { vDevicesOut.push_back( DEVICE_KEYBOARD ); vDescriptionsOut.push_back( "Keyboard" ); diff --git a/stepmania/src/arch/InputHandler/InputHandler_X11.h b/stepmania/src/arch/InputHandler/InputHandler_X11.h index f6152188ee..a28a901466 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_X11.h +++ b/stepmania/src/arch/InputHandler/InputHandler_X11.h @@ -11,7 +11,7 @@ public: InputHandler_X11(); ~InputHandler_X11(); void Update(); - void GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ); + void GetDevicesAndDescriptions( vector& vDevicesOut, vector& vDescriptionsOut ); }; #define USE_INPUT_HANDLER_X11 diff --git a/stepmania/src/arch/InputHandler/InputHandler_Xbox.cpp b/stepmania/src/arch/InputHandler/InputHandler_Xbox.cpp index ed342ed872..0b7a0174a1 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_Xbox.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_Xbox.cpp @@ -161,7 +161,7 @@ void InputHandler_Xbox::Update() InputHandler::UpdateTimer(); } -void InputHandler_Xbox::GetDevicesAndDescriptions(vector& vDevicesOut, vector& vDescriptionsOut) +void InputHandler_Xbox::GetDevicesAndDescriptions(vector& vDevicesOut, vector& vDescriptionsOut) { for( int i=0; i& vDevicesOut, vector& vDescriptionsOut); + void GetDevicesAndDescriptions(vector& vDevicesOut, vector& vDescriptionsOut); private: void getHandles(); diff --git a/stepmania/src/arch/Lights/LightsDriver_LinuxParallel.cpp b/stepmania/src/arch/Lights/LightsDriver_LinuxParallel.cpp index 8433027b53..a8e05a4f83 100644 --- a/stepmania/src/arch/Lights/LightsDriver_LinuxParallel.cpp +++ b/stepmania/src/arch/Lights/LightsDriver_LinuxParallel.cpp @@ -32,7 +32,7 @@ LightsDriver_LinuxParallel::~LightsDriver_LinuxParallel() void LightsDriver_LinuxParallel::Set( const LightsState *ls ) { // Set LightState to port - CString s; + RString s; // Prepare Screen Output too for debugging s += "LinuxParallel Lights Driver Debug\n"; diff --git a/stepmania/src/arch/Lights/LightsDriver_SystemMessage.cpp b/stepmania/src/arch/Lights/LightsDriver_SystemMessage.cpp index 90d6b78518..254204415e 100644 --- a/stepmania/src/arch/Lights/LightsDriver_SystemMessage.cpp +++ b/stepmania/src/arch/Lights/LightsDriver_SystemMessage.cpp @@ -19,7 +19,7 @@ void LightsDriver_SystemMessage::Set( const LightsState *ls ) if( !PREFSMAN->m_bDebugLights ) return; - CString s; + RString s; s += LightsModeToString(LIGHTSMAN->GetLightsMode()) + "\n"; diff --git a/stepmania/src/arch/LoadingWindow/LoadingWindow.h b/stepmania/src/arch/LoadingWindow/LoadingWindow.h index 8cf760295b..7b9612d669 100644 --- a/stepmania/src/arch/LoadingWindow/LoadingWindow.h +++ b/stepmania/src/arch/LoadingWindow/LoadingWindow.h @@ -7,11 +7,11 @@ struct RageSurface; class LoadingWindow { public: - virtual CString Init() { return CString(); } + virtual RString Init() { return RString(); } virtual ~LoadingWindow() { } virtual void Paint() = 0; - virtual void SetText(CString str) { } + virtual void SetText(RString str) { } virtual void SetIcon( const RageSurface *pIcon ) { } }; diff --git a/stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.h b/stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.h index a63f109eb0..57d6c8df40 100644 --- a/stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.h +++ b/stepmania/src/arch/LoadingWindow/LoadingWindow_Cocoa.h @@ -19,7 +19,7 @@ public: LoadingWindow_Cocoa() { RageFile f; - CString data; + RString data; if( f.Open("Data/splash.png") ) f.Read( data ); @@ -28,7 +28,7 @@ public: ~LoadingWindow_Cocoa() { DisposeOfCocoaWindow(); } void Paint() { } /* Not needed but pure virtual*/ - void SetText( CString str ) { SetCocoaWindowText( str ); } + void SetText( RString str ) { SetCocoaWindowText( str ); } }; #define USE_LOADING_WINDOW_COCOA diff --git a/stepmania/src/arch/LoadingWindow/LoadingWindow_Gtk.cpp b/stepmania/src/arch/LoadingWindow/LoadingWindow_Gtk.cpp index 82c8f4a23a..c27a6f3cb2 100644 --- a/stepmania/src/arch/LoadingWindow/LoadingWindow_Gtk.cpp +++ b/stepmania/src/arch/LoadingWindow/LoadingWindow_Gtk.cpp @@ -16,7 +16,7 @@ LoadingWindow_Gtk::LoadingWindow_Gtk() { } -CString LoadingWindow_Gtk::Init() +RString LoadingWindow_Gtk::Init() { ASSERT( Handle == NULL ); @@ -51,7 +51,7 @@ LoadingWindow_Gtk::~LoadingWindow_Gtk() Handle = NULL; } -void LoadingWindow_Gtk::SetText( CString s ) +void LoadingWindow_Gtk::SetText( RString s ) { Module_SetText( s ); } diff --git a/stepmania/src/arch/LoadingWindow/LoadingWindow_Gtk.h b/stepmania/src/arch/LoadingWindow/LoadingWindow_Gtk.h index 07c3473286..99dda78ab2 100644 --- a/stepmania/src/arch/LoadingWindow/LoadingWindow_Gtk.h +++ b/stepmania/src/arch/LoadingWindow/LoadingWindow_Gtk.h @@ -9,10 +9,10 @@ class LoadingWindow_Gtk: public LoadingWindow { public: LoadingWindow_Gtk(); - CString Init(); + RString Init(); ~LoadingWindow_Gtk(); - void SetText(CString str); + void SetText(RString str); void Paint() { } }; #define USE_LOADING_WINDOW_GTK diff --git a/stepmania/src/arch/LoadingWindow/LoadingWindow_Null.h b/stepmania/src/arch/LoadingWindow/LoadingWindow_Null.h index a774a925f9..e6d21f9dda 100644 --- a/stepmania/src/arch/LoadingWindow/LoadingWindow_Null.h +++ b/stepmania/src/arch/LoadingWindow/LoadingWindow_Null.h @@ -8,7 +8,7 @@ public: LoadingWindow_Null() { } ~LoadingWindow_Null() { } - void SetText(CString str) { } + void SetText(RString str) { } void Paint() { } }; #define USE_LOADING_WINDOW_NULL diff --git a/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.cpp b/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.cpp index 1bcbaeff98..6ac7d17360 100644 --- a/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.cpp +++ b/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.cpp @@ -43,9 +43,9 @@ static HBITMAP LoadWin32Surface( RageSurface *&s ) return bitmap; } -static HBITMAP LoadWin32Surface( CString sFile, HWND hWnd ) +static HBITMAP LoadWin32Surface( RString sFile, HWND hWnd ) { - CString error; + RString error; RageSurface *pSurface = RageSurfaceUtils::LoadFile( sFile, error ); if( pSurface == NULL ) return NULL; @@ -135,9 +135,9 @@ void LoadingWindow_Win32::Paint() } } -void LoadingWindow_Win32::SetText( CString sText ) +void LoadingWindow_Win32::SetText( RString sText ) { - vector asMessageLines; + vector asMessageLines; split( sText, "\n", asMessageLines, false ); while( asMessageLines.size() < 3 ) asMessageLines.push_back( "" ); diff --git a/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.h b/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.h index 52c0d17981..f490392acb 100644 --- a/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.h +++ b/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.h @@ -13,14 +13,14 @@ public: LoadingWindow_Win32(); ~LoadingWindow_Win32(); - void SetText( CString sText ); + void SetText( RString sText ); void Paint(); void SetIcon( const RageSurface *pIcon ); private: AppInstance handle; HWND hwnd; - CString text[3]; + RString text[3]; HICON m_hIcon; static BOOL CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ); diff --git a/stepmania/src/arch/LoadingWindow/LoadingWindow_Xbox.cpp b/stepmania/src/arch/LoadingWindow/LoadingWindow_Xbox.cpp index 640fac2c1a..1e6b7edf73 100644 --- a/stepmania/src/arch/LoadingWindow/LoadingWindow_Xbox.cpp +++ b/stepmania/src/arch/LoadingWindow/LoadingWindow_Xbox.cpp @@ -52,7 +52,7 @@ LoadingWindow_Xbox::LoadingWindow_Xbox() if(!useImage) LOG->Trace("Error loading splash.png - %i", result); - SetText(CString("Loading songs")); + SetText(RString("Loading songs")); } LoadingWindow_Xbox::~LoadingWindow_Xbox() @@ -90,7 +90,7 @@ void LoadingWindow_Xbox::Paint() { // Lo-fi version: print the product name and version at the top of the screen font->SetTextColor(D3DCOLOR_XRGB(255, 0, 0)); - CString title = "Version "; + RString title = "Version "; title = title + PRODUCT_VER; WCHAR wc_title[200] = {0}; swprintf(wc_title, L"%S", title.c_str()); @@ -105,7 +105,7 @@ void LoadingWindow_Xbox::Paint() basic_string ::size_type newLineIndex = text.find("\n", 0); int y = 240; - if(newLineIndex == CString.npos) + if(newLineIndex == RString.npos) { WCHAR wc_text[200] = {0}; swprintf(wc_text, L"%S", text.c_str()); @@ -116,10 +116,10 @@ void LoadingWindow_Xbox::Paint() { int start = 0; - while(start != CString.npos) + while(start != RString.npos) { - CString toPrint; - if(newLineIndex != CString.npos) + RString toPrint; + if(newLineIndex != RString.npos) toPrint = text.substr(start, newLineIndex - start); else toPrint = text.substr(start); @@ -133,10 +133,10 @@ void LoadingWindow_Xbox::Paint() } y = y + font->GetTextHeight() + 10; - if(newLineIndex != CString.npos) + if(newLineIndex != RString.npos) start = newLineIndex + 1; else - start = CString.npos; + start = RString.npos; newLineIndex = text.find("\n", start); } @@ -148,7 +148,7 @@ void LoadingWindow_Xbox::Paint() g_pD3DDevice->Present(NULL, NULL, NULL, NULL); } -void LoadingWindow_Xbox::SetText(CString str) +void LoadingWindow_Xbox::SetText(RString str) { text = str ; } diff --git a/stepmania/src/arch/LoadingWindow/LoadingWindow_Xbox.h b/stepmania/src/arch/LoadingWindow/LoadingWindow_Xbox.h index 9e6232bba8..956bef0157 100644 --- a/stepmania/src/arch/LoadingWindow/LoadingWindow_Xbox.h +++ b/stepmania/src/arch/LoadingWindow/LoadingWindow_Xbox.h @@ -14,10 +14,10 @@ public: ~LoadingWindow_Xbox(); void Paint(); - void SetText(CString str); + void SetText(RString str); protected: - CString text ; + RString text ; XFONT* font; bool useImage; }; diff --git a/stepmania/src/arch/LowLevelWindow/LowLevelWindow.h b/stepmania/src/arch/LowLevelWindow/LowLevelWindow.h index 1bbd69a845..4d8f3823be 100644 --- a/stepmania/src/arch/LowLevelWindow/LowLevelWindow.h +++ b/stepmania/src/arch/LowLevelWindow/LowLevelWindow.h @@ -11,15 +11,15 @@ class LowLevelWindow public: virtual ~LowLevelWindow() { } - virtual void *GetProcAddress( CString s ) = 0; + virtual void *GetProcAddress( RString s ) = 0; // Return "" if mode change was successful, otherwise an error message. // bNewDeviceOut is set true if a new device was created and textures // need to be reloaded. - virtual CString TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ) = 0; + virtual RString TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ) = 0; virtual void GetDisplayResolutions( DisplayResolutions &out ) const = 0; - virtual bool IsSoftwareRenderer( CString &sError ) { return false; } + virtual bool IsSoftwareRenderer( RString &sError ) { return false; } virtual void SwapBuffers() = 0; virtual void Update() { } diff --git a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_Cocoa.h b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_Cocoa.h index f8a3250d78..51c032341a 100644 --- a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_Cocoa.h +++ b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_Cocoa.h @@ -18,8 +18,8 @@ class LowLevelWindow_Cocoa : public LowLevelWindow public: LowLevelWindow_Cocoa(); ~LowLevelWindow_Cocoa(); - void *GetProcAddress( CString s ); - CString TryVideoMode( const VideoModeParams& p, bool& newDeviceOut ); + void *GetProcAddress( RString s ); + RString TryVideoMode( const VideoModeParams& p, bool& newDeviceOut ); void GetDisplayResolutions( DisplayResolutions &dr ) const; void SwapBuffers(); void Update(); diff --git a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_SDL.cpp b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_SDL.cpp index f891a12d9a..32d538ced0 100644 --- a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_SDL.cpp +++ b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_SDL.cpp @@ -29,12 +29,12 @@ LowLevelWindow_SDL::~LowLevelWindow_SDL() mySDL_EventState( SDL_QUIT, SDL_IGNORE ); } -void *LowLevelWindow_SDL::GetProcAddress(CString s) +void *LowLevelWindow_SDL::GetProcAddress(RString s) { return SDL_GL_GetProcAddress(s); } -CString LowLevelWindow_SDL::TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ) +RString LowLevelWindow_SDL::TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ) { bool wasWindowed = CurrentParams.windowed; @@ -70,7 +70,7 @@ CString LowLevelWindow_SDL::TryVideoMode( const VideoModeParams &p, bool &bNewDe if( SDL_InitSubSystem(SDL_INIT_VIDEO) == -1 ) { - const CString err = mySDL_GetError(); + const RString err = mySDL_GetError(); /* Check for a confusing SDL error message. */ if( !err.CompareNoCase( "X11 driver not configured with OpenGL" ) ) diff --git a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_SDL.h b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_SDL.h index 4b4a767729..7725be9352 100644 --- a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_SDL.h +++ b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_SDL.h @@ -9,8 +9,8 @@ class LowLevelWindow_SDL: public LowLevelWindow public: LowLevelWindow_SDL(); ~LowLevelWindow_SDL(); - void *GetProcAddress(CString s); - CString TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ); + void *GetProcAddress(RString s); + RString TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ); virtual void GetDisplayResolutions( DisplayResolutions &out ) const; void SwapBuffers(); diff --git a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_Win32.cpp b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_Win32.cpp index a54f2d6526..558bc21977 100644 --- a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_Win32.cpp +++ b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_Win32.cpp @@ -31,7 +31,7 @@ static void DestroyGraphicsWindowAndOpenGLContext() GraphicsWindow::DestroyGraphicsWindow(); } -void *LowLevelWindow_Win32::GetProcAddress( CString s ) +void *LowLevelWindow_Win32::GetProcAddress( RString s ) { void *pRet = wglGetProcAddress( s ); if( pRet != NULL ) @@ -77,7 +77,7 @@ int ChooseWindowPixelFormat( const VideoModeParams &p, PIXELFORMATDESCRIPTOR *Pi void DumpPixelFormat( const PIXELFORMATDESCRIPTOR &pfd ) { - CString str = ssprintf( "Mode: " ); + RString str = ssprintf( "Mode: " ); bool bInvalidFormat = false; if( pfd.dwFlags & PFD_GENERIC_FORMAT ) @@ -110,7 +110,7 @@ void DumpPixelFormat( const PIXELFORMATDESCRIPTOR &pfd ) /* This function does not reset the video mode if it fails, because we might be trying * yet another video mode, so we'd just thrash the display. On fatal error, * LowLevelWindow_Win32::~LowLevelWindow_Win32 will call GraphicsWindow::Shutdown(). */ -CString LowLevelWindow_Win32::TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ) +RString LowLevelWindow_Win32::TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ) { //LOG->Warn( "LowLevelWindow_Win32::TryVideoMode" ); @@ -138,7 +138,7 @@ CString LowLevelWindow_Win32::TryVideoMode( const VideoModeParams &p, bool &bNew /* Set the display mode: switch to a fullscreen mode or revert to windowed mode. */ LOG->Trace("SetScreenMode ..."); - CString sErr = GraphicsWindow::SetScreenMode( p ); + RString sErr = GraphicsWindow::SetScreenMode( p ); if( !sErr.empty() ) return sErr; @@ -237,7 +237,7 @@ CString LowLevelWindow_Win32::TryVideoMode( const VideoModeParams &p, bool &bNew return hr_ssprintf( GetLastError(), "wglCreateContext" ); } } - return CString(); // we set the video mode successfully + return RString(); // we set the video mode successfully } bool LowLevelWindow_Win32::SupportsThreadedRendering() @@ -259,7 +259,7 @@ void LowLevelWindow_Win32::EndConcurrentRendering() wglMakeCurrent( NULL, NULL ); } -bool LowLevelWindow_Win32::IsSoftwareRenderer( CString &sError ) +bool LowLevelWindow_Win32::IsSoftwareRenderer( RString &sError ) { if( strcmp((const char*)glGetString(GL_VENDOR),"Microsoft Corporation") && strcmp((const char*)glGetString(GL_RENDERER),"GDI Generic") ) diff --git a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_Win32.h b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_Win32.h index b6fd084043..ff96ebfbc9 100644 --- a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_Win32.h +++ b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_Win32.h @@ -8,10 +8,10 @@ class LowLevelWindow_Win32: public LowLevelWindow public: LowLevelWindow_Win32(); ~LowLevelWindow_Win32(); - void *GetProcAddress( CString s ); - CString TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ); + void *GetProcAddress( RString s ); + RString TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ); void GetDisplayResolutions( DisplayResolutions &out ) const; - bool IsSoftwareRenderer( CString &sError ); + bool IsSoftwareRenderer( RString &sError ); void SwapBuffers(); void Update(); bool SupportsThreadedRendering(); diff --git a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_X11.cpp b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_X11.cpp index 9a32447368..dd28737135 100644 --- a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_X11.cpp +++ b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_X11.cpp @@ -59,7 +59,7 @@ LowLevelWindow_X11::~LowLevelWindow_X11() X11Helper::Stop(); // Xlib cleans up the window for us } -void *LowLevelWindow_X11::GetProcAddress( CString s ) +void *LowLevelWindow_X11::GetProcAddress( RString s ) { // XXX: We should check whether glXGetProcAddress or // glXGetProcAddressARB is available, and go by that, instead of @@ -67,7 +67,7 @@ void *LowLevelWindow_X11::GetProcAddress( CString s ) return (void*) glXGetProcAddressARB( (const GLubyte*) s.c_str() ); } -CString LowLevelWindow_X11::TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ) +RString LowLevelWindow_X11::TryVideoMode( const VideoModeParams &p, bool &bNewDeviceOut ) { #if defined(LINUX) /* @@ -237,7 +237,7 @@ CString LowLevelWindow_X11::TryVideoMode( const VideoModeParams &p, bool &bNewDe return ""; // Success } -bool LowLevelWindow_X11::IsSoftwareRenderer( CString &sError ) +bool LowLevelWindow_X11::IsSoftwareRenderer( RString &sError ) { if( glXIsDirect( X11Helper::Dpy, glXGetCurrentContext() ) ) return false; diff --git a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_X11.h b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_X11.h index b496794156..1c69719da6 100644 --- a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_X11.h +++ b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_X11.h @@ -12,9 +12,9 @@ public: LowLevelWindow_X11(); ~LowLevelWindow_X11(); - void *GetProcAddress(CString s); - CString TryVideoMode(const VideoModeParams &p, bool &bNewDeviceOut); - bool IsSoftwareRenderer( CString &sError ); + void *GetProcAddress(RString s); + RString TryVideoMode(const VideoModeParams &p, bool &bNewDeviceOut); + bool IsSoftwareRenderer( RString &sError ); void SwapBuffers(); const VideoModeParams &GetActualVideoModeParams() const { return CurrentParams; } diff --git a/stepmania/src/arch/MemoryCard/MemoryCardDriver.cpp b/stepmania/src/arch/MemoryCard/MemoryCardDriver.cpp index 22ebf13b79..3c7352cc08 100644 --- a/stepmania/src/arch/MemoryCard/MemoryCardDriver.cpp +++ b/stepmania/src/arch/MemoryCard/MemoryCardDriver.cpp @@ -7,7 +7,7 @@ #include "Selector_MemoryCardDriver.h" -static const CString TEMP_MOUNT_POINT = "/@mctemptimeout/"; +static const RString TEMP_MOUNT_POINT = "/@mctemptimeout/"; bool UsbStorageDevice::operator==(const UsbStorageDevice& other) const { @@ -23,7 +23,7 @@ bool UsbStorageDevice::operator==(const UsbStorageDevice& other) const #undef COMPARE } -void UsbStorageDevice::SetOsMountDir( const CString &s ) +void UsbStorageDevice::SetOsMountDir( const RString &s ) { sOsMountDir = s; } diff --git a/stepmania/src/arch/MemoryCard/MemoryCardDriver.h b/stepmania/src/arch/MemoryCard/MemoryCardDriver.h index 727523d59c..0cf915141d 100644 --- a/stepmania/src/arch/MemoryCard/MemoryCardDriver.h +++ b/stepmania/src/arch/MemoryCard/MemoryCardDriver.h @@ -29,10 +29,10 @@ struct UsbStorageDevice int iPort; int iLevel; int iRefNum; - CString sSerial; - CString sDevice; - CString sOsMountDir; // WITHOUT trailing slash - CString sSysPath; // Linux: /sys/block name + RString sSerial; + RString sDevice; + RString sOsMountDir; // WITHOUT trailing slash + RString sSysPath; // Linux: /sys/block name enum State { /* Empty device. This is used only by MemoryCardManager. */ @@ -52,21 +52,21 @@ struct UsbStorageDevice STATE_READY, }; State m_State; - CString m_sError; + RString m_sError; - void SetError( const CString &sError ) { m_State = STATE_ERROR; m_sError = sError; } + void SetError( const RString &sError ) { m_State = STATE_ERROR; m_sError = sError; } bool bIsNameAvailable; // Name in the profile on the memory card. - CString sName; // Name in the profile on the memory card. + RString sName; // Name in the profile on the memory card. int idVendor; int idProduct; - CString sVendor; - CString sProduct; - CString sVolumeLabel; + RString sVendor; + RString sProduct; + RString sVolumeLabel; int iVolumeSizeMB; bool IsBlank() const { return m_State == STATE_NONE; } - void SetOsMountDir( const CString &s ); + void SetOsMountDir( const RString &s ); bool operator==(const UsbStorageDevice& other) const; }; diff --git a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp index fea7cd3928..7fa64fe5d7 100644 --- a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp +++ b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp @@ -19,7 +19,7 @@ bool MemoryCardDriverThreaded_Linux::TestWrite( UsbStorageDevice* pDevice ) return true; } -static bool ExecuteCommand( const CString &sCommand ) +static bool ExecuteCommand( const RString &sCommand ) { LOG->Trace( "executing '%s'", sCommand.c_str() ); int ret = system(sCommand); @@ -29,7 +29,7 @@ static bool ExecuteCommand( const CString &sCommand ) return ret == 0; } -static bool ReadFile( const CString &sPath, CString &sBuf ) +static bool ReadFile( const RString &sPath, RString &sBuf ) { sBuf.clear(); @@ -60,7 +60,7 @@ static bool ReadFile( const CString &sPath, CString &sBuf ) return true; } -static void GetFileList( const CString &sPath, vector &out ) +static void GetFileList( const RString &sPath, vector &out ) { out.clear(); @@ -76,13 +76,13 @@ static void GetFileList( const CString &sPath, vector &out ) bool MemoryCardDriverThreaded_Linux::USBStorageDevicesChanged() { - CString sThisDevices; + RString sThisDevices; /* If a device is removed and reinserted, the inode of the /sys/block entry * will change. */ - CString sDevicePath = "/sys/block/"; + RString sDevicePath = "/sys/block/"; - vector asDevices; + vector asDevices; GetFileList( sDevicePath, asDevices ); for( unsigned i = 0; i < asDevices.size(); ++i ) @@ -108,23 +108,23 @@ void MemoryCardDriverThreaded_Linux::GetUSBStorageDevices( vector asDevices; - CString sBlockDevicePath = "/sys/block/"; + vector asDevices; + RString sBlockDevicePath = "/sys/block/"; GetFileList( sBlockDevicePath, asDevices ); for( unsigned i = 0; i < asDevices.size(); ++i ) { - const CString &sDevice = asDevices[i]; + const RString &sDevice = asDevices[i]; if( sDevice == "." || sDevice == ".." ) continue; UsbStorageDevice usbd; - CString sPath = sBlockDevicePath + sDevice + "/"; + RString sPath = sBlockDevicePath + sDevice + "/"; usbd.sSysPath = sPath; /* Ignore non-removable devices. */ - CString sBuf; + RString sBuf; if( !ReadFile( sPath + "removable", sBuf ) ) continue; // already warned if( atoi(sBuf) != 1 ) @@ -165,12 +165,12 @@ void MemoryCardDriverThreaded_Linux::GetUSBStorageDevices( vector asBits; + vector asBits; split( szLink, "/", asBits ); if( strstr( szLink, "usb" ) != NULL ) { - CString sHostPort = asBits[asBits.size()-2]; + RString sHostPort = asBits[asBits.size()-2]; sHostPort.Replace( "-", "." ); asBits.clear(); split( sHostPort, ".", asBits ); @@ -216,7 +216,7 @@ void MemoryCardDriverThreaded_Linux::GetUSBStorageDevices( vectorsDevice.empty() ); - CString sCommand = "mount " + pDevice->sDevice; + RString sCommand = "mount " + pDevice->sDevice; bool bMountedSuccessfully = ExecuteCommand( sCommand ); return bMountedSuccessfully; @@ -304,7 +304,7 @@ void MemoryCardDriverThreaded_Linux::Unmount( UsbStorageDevice* pDevice ) * by new devices until those are closed. Without this, if something * causes the device to not unmount here, we'll never unmount it; that * causes a device name leak, eventually running us out of mountpoints. */ - CString sCommand = "sync; umount -l \"" + pDevice->sDevice + "\""; + RString sCommand = "sync; umount -l \"" + pDevice->sDevice + "\""; ExecuteCommand( sCommand ); } diff --git a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.h b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.h index 95bd5311e3..165f71864c 100644 --- a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.h +++ b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.h @@ -14,7 +14,7 @@ protected: bool USBStorageDevicesChanged(); bool TestWrite( UsbStorageDevice* pDevice ); - CString m_sLastDevices; + RString m_sLastDevices; }; #ifdef ARCH_MEMORY_CARD_DRIVER diff --git a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_OSX.cpp b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_OSX.cpp index 3285a0ec9a..10caba4dcd 100644 --- a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_OSX.cpp +++ b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_OSX.cpp @@ -83,20 +83,20 @@ static int GetIntProperty( io_registry_entry_t entry, CFStringRef key ) return num; } -static CString GetStringProperty( io_registry_entry_t entry, CFStringRef key ) +static RString GetStringProperty( io_registry_entry_t entry, CFStringRef key ) { CFTypeRef t = IORegistryEntryCreateCFProperty( entry, key, NULL, 0 ); if( !t ) - return CString(); + return RString(); if( CFGetTypeID( t ) != CFStringGetTypeID() ) { CFRelease( t ); - return CString(); + return RString(); } CFStringRef s = CFStringRef( t ); - CString ret; + RString ret; const size_t len = CFStringGetMaximumSizeForEncoding( CFStringGetLength(s), kCFStringEncodingUTF8 ); char *buf = new char[len + 1]; @@ -125,8 +125,8 @@ void MemoryCardDriverThreaded_OSX::GetUSBStorageDevices( vector= 0. pos = sRegistryPath.rfind( '/', pos - 1 ); - if( pos == CString::npos ) + if( pos == RString::npos ) continue; // Something is horribly wrong at this point. path[pos] = '\0'; @@ -196,7 +196,7 @@ void MemoryCardDriverThreaded_OSX::GetUSBStorageDevices( vector 0x7E ) str[i] = '?'; } -bool RageMovieTexture::GetFourCC( CString fn, CString &handler, CString &type ) +bool RageMovieTexture::GetFourCC( RString fn, RString &handler, RString &type ) { - CString ignore, ext; + RString ignore, ext; splitpath( fn, ignore, ignore, ext); if( !ext.CompareNoCase(".mpg") || !ext.CompareNoCase(".mpeg") || diff --git a/stepmania/src/arch/MovieTexture/MovieTexture.h b/stepmania/src/arch/MovieTexture/MovieTexture.h index fed2378543..b01c4addc8 100644 --- a/stepmania/src/arch/MovieTexture/MovieTexture.h +++ b/stepmania/src/arch/MovieTexture/MovieTexture.h @@ -8,7 +8,7 @@ class RageMovieTexture : public RageTexture public: RageMovieTexture( RageTextureID ID ): RageTexture(ID) { } virtual ~RageMovieTexture() { } - virtual CString Init() { return CString(); } + virtual RString Init() { return RString(); } virtual void Update(float fDeltaTime) { } virtual void Reload() = 0; @@ -19,7 +19,7 @@ public: bool IsAMovie() const { return true; } - static bool GetFourCC( CString fn, CString &handler, CString &type ); + static bool GetFourCC( RString fn, RString &handler, RString &type ); }; #endif diff --git a/stepmania/src/arch/MovieTexture/MovieTexture_DShow.cpp b/stepmania/src/arch/MovieTexture/MovieTexture_DShow.cpp index b767d0cbd9..27b0a185e5 100644 --- a/stepmania/src/arch/MovieTexture/MovieTexture_DShow.cpp +++ b/stepmania/src/arch/MovieTexture/MovieTexture_DShow.cpp @@ -28,7 +28,7 @@ #pragma comment(lib, "vfw32.lib") #endif -static CString FourCCToString( int fcc ) +static RString FourCCToString( int fcc ) { char c[4]; c[0] = char((fcc >> 0) & 0xFF); @@ -36,14 +36,14 @@ static CString FourCCToString( int fcc ) c[2] = char((fcc >> 16) & 0xFF); c[3] = char((fcc >> 24) & 0xFF); - CString s; + RString s; for( int i = 0; i < 4; ++i ) s += clamp( c[i], '\x20', '\x7e' ); return s; } -static void CheckCodecVersion( CString codec, CString desc ) +static void CheckCodecVersion( RString codec, RString desc ) { if( !codec.CompareNoCase("DIVX") ) { @@ -141,9 +141,9 @@ MovieTexture_DShow::MovieTexture_DShow( RageTextureID ID ) : buffer = NULL; } -CString MovieTexture_DShow::Init() +RString MovieTexture_DShow::Init() { - CString sError = Create(); + RString sError = Create(); if( sError != "" ) return sError; @@ -152,7 +152,7 @@ CString MovieTexture_DShow::Init() // flip all frame rects because movies are upside down for( unsigned i=0; iEnumFilters(&pEnum); @@ -321,7 +321,7 @@ CString MovieTexture_DShow::GetActiveFilterList() return ret; } -CString MovieTexture_DShow::Create() +RString MovieTexture_DShow::Create() { RageTextureID actualID = GetID(); @@ -408,7 +408,7 @@ CString MovieTexture_DShow::Create() // Start the graph running Play(); - return CString(); + return RString(); } diff --git a/stepmania/src/arch/MovieTexture/MovieTexture_DShow.h b/stepmania/src/arch/MovieTexture/MovieTexture_DShow.h index caed11982e..7b8a02106c 100644 --- a/stepmania/src/arch/MovieTexture/MovieTexture_DShow.h +++ b/stepmania/src/arch/MovieTexture/MovieTexture_DShow.h @@ -34,7 +34,7 @@ class MovieTexture_DShow : public RageMovieTexture public: MovieTexture_DShow( RageTextureID ID ); virtual ~MovieTexture_DShow(); - CString Init(); + RString Init(); /* only called by RageTextureManager::InvalidateTextures */ void Invalidate() { m_uTexHandle = 0; } @@ -55,13 +55,13 @@ private: const char *buffer; RageSemaphore buffer_lock, buffer_finished; - CString Create(); + RString Create(); void CreateTexture(); void SkipUpdates(); void StopSkippingUpdates(); void CheckFrame(); - CString GetActiveFilterList(); + RString GetActiveFilterList(); unsigned GetTexHandle() const { return m_uTexHandle; } unsigned m_uTexHandle; diff --git a/stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp b/stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp index 249bdf2241..70c28ddea1 100644 --- a/stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp +++ b/stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp @@ -161,7 +161,7 @@ public: MovieDecoder_FFMpeg(); ~MovieDecoder_FFMpeg(); - CString Open( CString sFile ); + RString Open( RString sFile ); void Close(); int GetFrame( RageSurface *pOut, float fTargetTime ); @@ -432,16 +432,16 @@ static avcodec::AVStream *FindVideoStream( avcodec::AVFormatContext *m_fctx ) } -static CString averr_ssprintf( int err, const char *fmt, ... ) +static RString averr_ssprintf( int err, const char *fmt, ... ) { ASSERT( err < 0 ); va_list va; va_start(va, fmt); - CString s = vssprintf( fmt, va ); + RString s = vssprintf( fmt, va ); va_end(va); - CString Error; + RString Error; switch( err ) { case AVERROR_IO: Error = "I/O error"; break; @@ -533,7 +533,7 @@ void MovieTexture_FFMpeg::RegisterProtocols() avcodec::register_protocol( &RageProtocol ); } -CString MovieDecoder_FFMpeg::Open( CString sFile ) +RString MovieDecoder_FFMpeg::Open( RString sFile ) { MovieTexture_FFMpeg::RegisterProtocols(); @@ -565,7 +565,7 @@ CString MovieDecoder_FFMpeg::Open( CString sFile ) LOG->Trace( "Bitrate: %i", m_pStream->codec.bit_rate ); LOG->Trace( "Codec pixel format: %s", avcodec::avcodec_get_pix_fmt_name(m_pStream->codec.pix_fmt) ); - return CString(); + return RString(); } void MovieDecoder_FFMpeg::Close() diff --git a/stepmania/src/arch/MovieTexture/MovieTexture_Generic.cpp b/stepmania/src/arch/MovieTexture/MovieTexture_Generic.cpp index da78b5f5d4..59a2000f01 100644 --- a/stepmania/src/arch/MovieTexture/MovieTexture_Generic.cpp +++ b/stepmania/src/arch/MovieTexture/MovieTexture_Generic.cpp @@ -32,9 +32,9 @@ MovieTexture_Generic::MovieTexture_Generic( RageTextureID ID, MovieDecoder *pDec m_bThreaded = PREFSMAN->m_bThreadedMovieDecode.Get(); } -CString MovieTexture_Generic::Init() +RString MovieTexture_Generic::Init() { - CString sError = m_pDecoder->Open( GetID().filename ); + RString sError = m_pDecoder->Open( GetID().filename ); if( sError != "" ) return sError; @@ -63,7 +63,7 @@ CString MovieTexture_Generic::Init() StartThread(); - return CString(); + return RString(); } MovieTexture_Generic::~MovieTexture_Generic() @@ -187,7 +187,7 @@ bool MovieTexture_Generic::DecodeFrame() /* Restart. */ m_pDecoder->Close(); - CString sError = m_pDecoder->Open( GetID().filename ); + RString sError = m_pDecoder->Open( GetID().filename ); if( sError != "" ) RageException::Throw( "Error rewinding stream %s: %s", GetID().filename.c_str(), sError.c_str() ); diff --git a/stepmania/src/arch/MovieTexture/MovieTexture_Generic.h b/stepmania/src/arch/MovieTexture/MovieTexture_Generic.h index a5dfe4b2c8..7032a20ca7 100644 --- a/stepmania/src/arch/MovieTexture/MovieTexture_Generic.h +++ b/stepmania/src/arch/MovieTexture/MovieTexture_Generic.h @@ -12,7 +12,7 @@ class MovieDecoder public: virtual ~MovieDecoder() { } - virtual CString Open( CString sFile ) = 0; + virtual RString Open( RString sFile ) = 0; virtual void Close() = 0; /* @@ -60,7 +60,7 @@ class MovieTexture_Generic: public RageMovieTexture public: MovieTexture_Generic( RageTextureID ID, MovieDecoder *pDecoder ); virtual ~MovieTexture_Generic(); - CString Init(); + RString Init(); /* only called by RageTextureManager::InvalidateTextures */ void Invalidate() { m_uTexHandle = 0; } diff --git a/stepmania/src/arch/MovieTexture/MovieTexture_Theora.cpp b/stepmania/src/arch/MovieTexture/MovieTexture_Theora.cpp index ab3f840bf0..7b2e6453ba 100644 --- a/stepmania/src/arch/MovieTexture/MovieTexture_Theora.cpp +++ b/stepmania/src/arch/MovieTexture/MovieTexture_Theora.cpp @@ -28,7 +28,7 @@ public: MovieDecoder_Theora(); ~MovieDecoder_Theora(); - CString Open( CString sFile ); + RString Open( RString sFile ); void Close(); int GetFrame( RageSurface *pOut, float fTargetTime ); @@ -43,8 +43,8 @@ public: private: void Init(); - CString ProcessHeaders(); - int ReadPage( ogg_page *pOggPage, CString &sError, bool bInitializing ); + RString ProcessHeaders(); + int ReadPage( ogg_page *pOggPage, RString &sError, bool bInitializing ); void ConvertToSurface( RageSurface *pSurface ) const; RageFile m_File; @@ -83,7 +83,7 @@ void MovieDecoder_Theora::Init() ogg_sync_init( &m_OggSync ); } -int MovieDecoder_Theora::ReadPage( ogg_page *pOggPage, CString &sError, bool bInitializing ) +int MovieDecoder_Theora::ReadPage( ogg_page *pOggPage, RString &sError, bool bInitializing ) { while(1) { @@ -119,13 +119,13 @@ int MovieDecoder_Theora::ReadPage( ogg_page *pOggPage, CString &sError, bool bIn } } -CString MovieDecoder_Theora::ProcessHeaders() +RString MovieDecoder_Theora::ProcessHeaders() { int iTheoraPacketsProcessed = 0; while(1) { ogg_page OggPage; - CString sError; + RString sError; int ret = ReadPage( &OggPage, sError, true ); if( ret == 0 ) return ssprintf( "error opening %s: EOF while searching for codec headers", m_File.GetPath().c_str() ); @@ -172,7 +172,7 @@ CString MovieDecoder_Theora::ProcessHeaders() * headers. We must have at least three header packets. */ if( iTheoraPacketsProcessed < 3 ) return ssprintf( "error opening %s: error parsing Theora stream headers", m_File.GetPath().c_str() ); - return CString(); + return RString(); } ret = theora_decode_header( &m_TheoraInfo, &m_TheoraComment, &op); @@ -185,20 +185,20 @@ CString MovieDecoder_Theora::ProcessHeaders() } } -CString MovieDecoder_Theora::Open( CString sFile ) +RString MovieDecoder_Theora::Open( RString sFile ) { if( !m_File.Open(sFile) ) return ssprintf( "error opening %s: %s", sFile.c_str(), m_File.GetError().c_str() ); Init(); - CString sError = ProcessHeaders(); + RString sError = ProcessHeaders(); if( !sError.empty() ) return sError; theora_decode_init( &m_TheoraState, &m_TheoraInfo ); - CString sOutput = ssprintf( "MovieDecoder_Theora: Opened \"%s\". Serial: 0x%08lx, FPS: %.02f", + RString sOutput = ssprintf( "MovieDecoder_Theora: Opened \"%s\". Serial: 0x%08lx, FPS: %.02f", m_File.GetPath().c_str(), m_OggStream.serialno, 1/GetFrameDuration() ); #if 1 @@ -224,7 +224,7 @@ CString MovieDecoder_Theora::Open( CString sFile ) #endif LOG->Trace( "%s", sOutput.c_str() ); - return CString(); + return RString(); } int MovieDecoder_Theora::GetFrame( RageSurface *pOut, float fTargetTime ) @@ -251,7 +251,7 @@ int MovieDecoder_Theora::GetFrame( RageSurface *pOut, float fTargetTime ) /* Read more data. */ ogg_page OggPage; - CString sError; + RString sError; int ret = ReadPage( &OggPage, sError, false ); if( ret == 0 ) return 0; @@ -343,7 +343,7 @@ public: MovieDecoder_Theora(); ~MovieDecoder_Theora(); - CString Open( CString sFile ); + RString Open( RString sFile ); void Close(); int GetFrame( RageSurface *pOut, float fTargetTime ); @@ -358,8 +358,8 @@ public: private: void Init(); - CString ProcessHeaders( theora_setup_info **pTheoraSetupInfo ); - int ReadPage( ogg_page *pOggPage, CString &sError, bool bInitializing ); + RString ProcessHeaders( theora_setup_info **pTheoraSetupInfo ); + int ReadPage( ogg_page *pOggPage, RString &sError, bool bInitializing ); static void DecodeStripeStub( void *pCtx, theora_ycbcr_buffer yuv, int yfrag0, int yfrag_end ); void DecodeStripe( theora_ycbcr_buffer yuv, int yfrag0, int yfrag_end ); @@ -402,7 +402,7 @@ void MovieDecoder_Theora::Init() ogg_sync_init( &m_OggSync ); } -int MovieDecoder_Theora::ReadPage( ogg_page *pOggPage, CString &sError, bool bInitializing ) +int MovieDecoder_Theora::ReadPage( ogg_page *pOggPage, RString &sError, bool bInitializing ) { while(1) { @@ -438,13 +438,13 @@ int MovieDecoder_Theora::ReadPage( ogg_page *pOggPage, CString &sError, bool bIn } } -CString MovieDecoder_Theora::ProcessHeaders( theora_setup_info **pTheoraSetupInfo ) +RString MovieDecoder_Theora::ProcessHeaders( theora_setup_info **pTheoraSetupInfo ) { int iTheoraPacketsProcessed = 0; while(1) { ogg_page OggPage; - CString sError; + RString sError; int ret = ReadPage( &OggPage, sError, true ); if( ret == 0 ) return ssprintf( "error opening %s: EOF while searching for codec headers", m_File.GetPath().c_str() ); @@ -491,7 +491,7 @@ CString MovieDecoder_Theora::ProcessHeaders( theora_setup_info **pTheoraSetupInf * headers. We must have at least three header packets. */ if( iTheoraPacketsProcessed < 3 ) return ssprintf( "error opening %s: error parsing Theora stream headers", m_File.GetPath().c_str() ); - return CString(); + return RString(); } ret = theora_decode_headerin( &m_TheoraInfo, &m_TheoraComment, pTheoraSetupInfo, &op ); @@ -504,7 +504,7 @@ CString MovieDecoder_Theora::ProcessHeaders( theora_setup_info **pTheoraSetupInf } } -CString MovieDecoder_Theora::Open( CString sFile ) +RString MovieDecoder_Theora::Open( RString sFile ) { if( !m_File.Open(sFile) ) return ssprintf( "error opening %s: %s", sFile.c_str(), m_File.GetError().c_str() ); @@ -512,7 +512,7 @@ CString MovieDecoder_Theora::Open( CString sFile ) Init(); theora_setup_info *pTheoraSetupInfo = NULL; - CString sError = ProcessHeaders( &pTheoraSetupInfo ); + RString sError = ProcessHeaders( &pTheoraSetupInfo ); if( !sError.empty() ) { theora_setup_free( pTheoraSetupInfo ); @@ -522,7 +522,7 @@ CString MovieDecoder_Theora::Open( CString sFile ) m_TheoraState = theora_decode_alloc( &m_TheoraInfo, pTheoraSetupInfo ); theora_setup_free( pTheoraSetupInfo ); - CString sOutput = ssprintf( "MovieDecoder_Theora: Opened \"%s\". Serial: 0x%08lx, FPS: %.02f", + RString sOutput = ssprintf( "MovieDecoder_Theora: Opened \"%s\". Serial: 0x%08lx, FPS: %.02f", m_File.GetPath().c_str(), m_OggStream.serialno, 1/GetFrameDuration() ); #if 1 @@ -555,7 +555,7 @@ CString MovieDecoder_Theora::Open( CString sFile ) theora_decode_ctl( m_TheoraState, OC_DECCTL_SET_STRIPE_CB, &cb, sizeof(cb) ); } - return CString(); + return RString(); } int MovieDecoder_Theora::GetFrame( RageSurface *pOut, float fTargetTime ) @@ -588,7 +588,7 @@ int MovieDecoder_Theora::GetFrame( RageSurface *pOut, float fTargetTime ) /* Read more data. */ ogg_page OggPage; - CString sError; + RString sError; int ret = ReadPage( &OggPage, sError, false ); if( ret == 0 ) return 0; diff --git a/stepmania/src/arch/Sound/ALSA9Dynamic.cpp b/stepmania/src/arch/Sound/ALSA9Dynamic.cpp index 239a71e28d..d8b4780db7 100644 --- a/stepmania/src/arch/Sound/ALSA9Dynamic.cpp +++ b/stepmania/src/arch/Sound/ALSA9Dynamic.cpp @@ -16,8 +16,8 @@ static void *Handle = NULL; #include "ALSA9Functions.h" #undef FUNC -static const CString lib = "libasound.so.2"; -CString LoadALSA() +static const RString lib = "libasound.so.2"; +RString LoadALSA() { /* If /proc/asound/ doesn't exist, chances are we're on an OSS system. We shouldn't * touch ALSA at all, since many OSS systems have old, broken versions of ALSA lying @@ -37,7 +37,7 @@ CString LoadALSA() if( Handle == NULL ) return ssprintf("dlopen(%s): %s", lib.c_str(), dlerror()); - CString error; + RString error; /* Eww. The "new" HW and SW API functions are really prefixed by __, * eg. __snd_pcm_hw_params_set_rate_near. */ #define FUNC(ret, name, proto) \ diff --git a/stepmania/src/arch/Sound/ALSA9Dynamic.h b/stepmania/src/arch/Sound/ALSA9Dynamic.h index d664ea76cf..e661ccf578 100644 --- a/stepmania/src/arch/Sound/ALSA9Dynamic.h +++ b/stepmania/src/arch/Sound/ALSA9Dynamic.h @@ -18,7 +18,7 @@ #define dsnd_ctl_card_info_alloca(ptr) { assert(ptr); *ptr = (snd_ctl_card_info_t *) alloca(dsnd_ctl_card_info_sizeof()); memset(*ptr, 0, dsnd_ctl_card_info_sizeof()); } #define dsnd_pcm_status_alloca(ptr) do { assert(ptr); *ptr = (snd_pcm_status_t *) alloca(dsnd_pcm_status_sizeof()); memset(*ptr, 0, dsnd_pcm_status_sizeof()); } while (0) -CString LoadALSA(); +RString LoadALSA(); void UnloadALSA(); #endif diff --git a/stepmania/src/arch/Sound/ALSA9Helpers.cpp b/stepmania/src/arch/Sound/ALSA9Helpers.cpp index e6b0edad2a..e58f24f75b 100644 --- a/stepmania/src/arch/Sound/ALSA9Helpers.cpp +++ b/stepmania/src/arch/Sound/ALSA9Helpers.cpp @@ -136,7 +136,7 @@ void Alsa9Buf::ErrorHandler(const char *file, int line, const char *function, in { va_list va; va_start( va, fmt ); - CString str = vssprintf(fmt, va); + RString str = vssprintf(fmt, va); va_end( va ); if( err ) @@ -153,7 +153,7 @@ void Alsa9Buf::InitializeErrorHandler() dsnd_lib_error_set_handler( ErrorHandler ); } -static CString DeviceName() +static RString DeviceName() { if( !PREFSMAN->m_iSoundDevice.Get().empty() ) return PREFSMAN->m_iSoundDevice; @@ -169,7 +169,7 @@ void Alsa9Buf::GetSoundCardDebugInfo() if( DoesFileExist("/rootfs/proc/asound/version") ) { - CString sVersion; + RString sVersion; GetFileContents( "/rootfs/proc/asound/version", sVersion, true ); LOG->Info( "ALSA: %s", sVersion.c_str() ); } @@ -179,7 +179,7 @@ void Alsa9Buf::GetSoundCardDebugInfo() int card = -1; while( dsnd_card_next( &card ) >= 0 && card >= 0 ) { - const CString id = ssprintf( "hw:%d", card ); + const RString id = ssprintf( "hw:%d", card ); snd_ctl_t *handle; int err; err = dsnd_ctl_open( &handle, id, 0 ); @@ -243,7 +243,7 @@ Alsa9Buf::Alsa9Buf() pcm = NULL; } -CString Alsa9Buf::Init( hw hardware, int channels_ ) +RString Alsa9Buf::Init( hw hardware, int channels_ ) { channels = channels_; @@ -442,7 +442,7 @@ void Alsa9Buf::SetSampleRate(int hz) SetSWParams(); } -CString Alsa9Buf::GetHardwareID( CString name ) +RString Alsa9Buf::GetHardwareID( RString name ) { InitializeErrorHandler(); @@ -461,7 +461,7 @@ CString Alsa9Buf::GetHardwareID( CString name ) snd_ctl_card_info_t *info; dsnd_ctl_card_info_alloca(&info); err = dsnd_ctl_card_info( handle, info ); - CString ret = dsnd_ctl_card_info_get_id( info ); + RString ret = dsnd_ctl_card_info_get_id( info ); dsnd_ctl_close(handle); return ret; diff --git a/stepmania/src/arch/Sound/ALSA9Helpers.h b/stepmania/src/arch/Sound/ALSA9Helpers.h index ebb05145b4..e1ee3c6d55 100644 --- a/stepmania/src/arch/Sound/ALSA9Helpers.h +++ b/stepmania/src/arch/Sound/ALSA9Helpers.h @@ -27,13 +27,13 @@ private: public: static void InitializeErrorHandler(); static void GetSoundCardDebugInfo(); - static CString GetHardwareID( CString name="" ); + static RString GetHardwareID( RString name="" ); enum hw { HW_HARDWARE, HW_SOFTWARE, HW_DONT_CARE }; /* Call SetSampleRate before you use the sample. */ Alsa9Buf(); - CString Init( hw hardware, int channels ); + RString Init( hw hardware, int channels ); ~Alsa9Buf(); int GetNumFramesToFill(); diff --git a/stepmania/src/arch/Sound/DSoundHelpers.cpp b/stepmania/src/arch/Sound/DSoundHelpers.cpp index 38376d675c..588eb45ca3 100644 --- a/stepmania/src/arch/Sound/DSoundHelpers.cpp +++ b/stepmania/src/arch/Sound/DSoundHelpers.cpp @@ -16,16 +16,16 @@ BOOL CALLBACK DSound::EnumCallback( LPGUID lpGuid, LPCSTR lpcstrDescription, LPCSTR lpcstrModule, LPVOID lpContext ) { - CString sLine = ssprintf( "DirectSound Driver: %s", lpcstrDescription ); + RString sLine = ssprintf( "DirectSound Driver: %s", lpcstrDescription ); if( lpcstrModule[0] ) { sLine += ssprintf( " %s", lpcstrModule ); #ifndef _XBOX - CString sPath = FindSystemFile( lpcstrModule ); + RString sPath = FindSystemFile( lpcstrModule ); if( sPath != "" ) { - CString sVersion; + RString sVersion; if( GetFileVersion(sPath, sVersion) ) sLine += ssprintf( " %s", sVersion.c_str() ); } @@ -106,7 +106,7 @@ DSound::DSound() m_pDS = NULL; } -CString DSound::Init() +RString DSound::Init() { HRESULT hr; if( FAILED( hr = DirectSoundCreate(NULL, &m_pDS, NULL) ) ) @@ -139,7 +139,7 @@ CString DSound::Init() SetPrimaryBufferMode(); - return CString(); + return RString(); } DSound::~DSound() @@ -176,7 +176,7 @@ DSoundBuf::DSoundBuf() m_pTempBuffer = NULL; } -CString DSoundBuf::Init( DSound &ds, DSoundBuf::hw hardware, +RString DSoundBuf::Init( DSound &ds, DSoundBuf::hw hardware, int iChannels, int iSampleRate, int iSampleBits, int iWriteAhead ) { m_iChannels = iChannels; @@ -294,7 +294,7 @@ CString DSoundBuf::Init( DSound &ds, DSoundBuf::hw hardware, m_pTempBuffer = new char[m_iBufferSize]; - return CString(); + return RString(); } void DSoundBuf::SetSampleRate( int hz ) @@ -429,7 +429,7 @@ void DSoundBuf::CheckUnderrun( int iCursorStart, int iCursorEnd ) int iMissedBy = iCursorEnd - m_iWriteCursor; wrap( iMissedBy, m_iBufferSize ); - CString s = ssprintf( "underrun: %i..%i (%i) filled but cursor at %i..%i; missed it by %i", + RString s = ssprintf( "underrun: %i..%i (%i) filled but cursor at %i..%i; missed it by %i", iFirstByteFilled, m_iWriteCursor, m_iBufferBytesFilled, iCursorStart, iCursorEnd, iMissedBy ); if( m_iExtraWriteahead ) @@ -522,7 +522,7 @@ bool DSoundBuf::get_output_buf( char **pBuffer, unsigned *pBufferSize, int iChun if( m_iExtraWriteahead ) { int used = min( m_iExtraWriteahead, bytes_played ); - CString s = ssprintf("used %i of %i (%i..%i)", used, m_iExtraWriteahead, iCursorStart, iCursorEnd ); + RString s = ssprintf("used %i of %i (%i..%i)", used, m_iExtraWriteahead, iCursorStart, iCursorEnd ); s += "; last: "; for( int i = 0; i < 4; ++i ) s += ssprintf( "%i, %i; ", m_iLastCursors[i][0], m_iLastCursors[i][1] ); diff --git a/stepmania/src/arch/Sound/DSoundHelpers.h b/stepmania/src/arch/Sound/DSoundHelpers.h index 00210f3f81..de0956955d 100644 --- a/stepmania/src/arch/Sound/DSoundHelpers.h +++ b/stepmania/src/arch/Sound/DSoundHelpers.h @@ -17,7 +17,7 @@ public: DSound(); ~DSound(); - CString Init(); + RString Init(); private: IDirectSound *m_pDS; @@ -36,7 +36,7 @@ public: enum { DYNAMIC_SAMPLERATE = -1 }; DSoundBuf(); - CString Init( DSound &ds, hw hardware, + RString Init( DSound &ds, hw hardware, int iChannels, int iSampleRate, int iSampleBits, int iWriteAhead ); bool get_output_buf( char **pBuffer, unsigned *iBuffersize, int iChunksize ); diff --git a/stepmania/src/arch/Sound/RageSoundDriver.h b/stepmania/src/arch/Sound/RageSoundDriver.h index 5a4972f4bf..d31efc8684 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver.h +++ b/stepmania/src/arch/Sound/RageSoundDriver.h @@ -8,7 +8,7 @@ public: friend class RageSoundManager; /* Initialize. On failure, an error message is returned. */ - virtual CString Init() { return CString(); } + virtual RString Init() { return RString(); } /* A RageSound calls this to request to be played. * XXX: define what we should do when it can't be played (eg. out of diff --git a/stepmania/src/arch/Sound/RageSoundDriver_ALSA9.cpp b/stepmania/src/arch/Sound/RageSoundDriver_ALSA9.cpp index 47cdf999a1..babc73a5da 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_ALSA9.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_ALSA9.cpp @@ -294,10 +294,10 @@ int RageSound_ALSA9::GetSampleRate( int rate ) const return str->pcm->FindSampleRate( rate ); } -static CString CheckMixingBlacklist() +static RString CheckMixingBlacklist() { - CString sID = Alsa9Buf::GetHardwareID(); - const CString blacklist[] = { + RString sID = Alsa9Buf::GetHardwareID(); + const RString blacklist[] = { /* ALSA Driver: 0: Aureal Vortex au8830 [au8830], device 0: AU88x0 ADB [adb], 32/32 subdevices avail * ALSA segfaults after creating about ten subdevices. */ "au8830", @@ -315,9 +315,9 @@ RageSound_ALSA9::RageSound_ALSA9(): shutdown = false; } -CString RageSound_ALSA9::Init() +RString RageSound_ALSA9::Init() { - CString sError = LoadALSA(); + RString sError = LoadALSA(); if( sError != "" ) return ssprintf( "Driver unusable: %s", sError.c_str() ); diff --git a/stepmania/src/arch/Sound/RageSoundDriver_ALSA9.h b/stepmania/src/arch/Sound/RageSoundDriver_ALSA9.h index 968c3094ab..d08e87ee25 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_ALSA9.h +++ b/stepmania/src/arch/Sound/RageSoundDriver_ALSA9.h @@ -20,7 +20,7 @@ public: void Update(float delta); RageSound_ALSA9(); - CString Init(); + RString Init(); ~RageSound_ALSA9(); private: diff --git a/stepmania/src/arch/Sound/RageSoundDriver_ALSA9_Software.cpp b/stepmania/src/arch/Sound/RageSoundDriver_ALSA9_Software.cpp index f2f82ec7a7..f13534c665 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_ALSA9_Software.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_ALSA9_Software.cpp @@ -82,14 +82,14 @@ RageSound_ALSA9_Software::RageSound_ALSA9_Software() m_bShutdown = false; } -CString RageSound_ALSA9_Software::Init() +RString RageSound_ALSA9_Software::Init() { - CString sError = LoadALSA(); + RString sError = LoadALSA(); if( sError != "" ) return ssprintf( "Driver unusable: %s", sError.c_str() ); g_iMaxWriteahead = safe_writeahead; - CString sys; + RString sys; int vers; GetKernel( sys, vers ); LOG->Trace( "OS: %s ver %06i", sys.c_str(), vers ); diff --git a/stepmania/src/arch/Sound/RageSoundDriver_ALSA9_Software.h b/stepmania/src/arch/Sound/RageSoundDriver_ALSA9_Software.h index d0520a3d7f..0836b6e7e9 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_ALSA9_Software.h +++ b/stepmania/src/arch/Sound/RageSoundDriver_ALSA9_Software.h @@ -12,7 +12,7 @@ class RageSound_ALSA9_Software: public RageSound_Generic_Software public: RageSound_ALSA9_Software(); ~RageSound_ALSA9_Software(); - CString Init(); + RString Init(); /* virtuals: */ int64_t GetPosition( const RageSoundBase *pSound ) const; diff --git a/stepmania/src/arch/Sound/RageSoundDriver_CA.cpp b/stepmania/src/arch/Sound/RageSoundDriver_CA.cpp index 65005aa00b..1733f03326 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_CA.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_CA.cpp @@ -38,7 +38,7 @@ RageSound_CA::RageSound_CA() m_pNotificationThread = NULL; } -CString RageSound_CA::Init() +RString RageSound_CA::Init() { try { @@ -302,7 +302,7 @@ OSStatus RageSound_CA::OverloadListener( AudioDeviceID inDevice, { if( isInput ) return noErr; - CString Output; + RString Output; for( int i = NUM_MIX_TIMES-1; i >= 0; --i ) { int pos = (g_iLastMixTimePos+i) % NUM_MIX_TIMES; diff --git a/stepmania/src/arch/Sound/RageSoundDriver_CA.h b/stepmania/src/arch/Sound/RageSoundDriver_CA.h index f94c9b8c96..3ba34255ef 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_CA.h +++ b/stepmania/src/arch/Sound/RageSoundDriver_CA.h @@ -14,7 +14,7 @@ class RageSound_CA : public RageSound_Generic_Software { public: RageSound_CA(); - CString Init(); + RString Init(); ~RageSound_CA(); float GetPlayLatency() const { return m_fLatency; } int GetSampleRate( int rate ) const { return m_iSampleRate; } diff --git a/stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp b/stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp index d55278408b..d95cf94853 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_DSound.cpp @@ -205,9 +205,9 @@ RageSound_DSound::RageSound_DSound(): shutdown = false; } -CString RageSound_DSound::Init() +RString RageSound_DSound::Init() { - CString sError = ds.Init(); + RString sError = ds.Init(); if( sError != "" ) return sError; @@ -220,7 +220,7 @@ CString RageSound_DSound::Init() for( int i = 0; i < 32; ++i ) { DSoundBuf *newbuf = new DSoundBuf; - CString sError = newbuf->Init( ds, DSoundBuf::HW_HARDWARE, + RString sError = newbuf->Init( ds, DSoundBuf::HW_HARDWARE, channels, DSoundBuf::DYNAMIC_SAMPLERATE, 16, buffersize ); if( sError != "" ) { @@ -251,7 +251,7 @@ CString RageSound_DSound::Init() MixingThread.SetName("Mixer thread"); MixingThread.Create( MixerThread_start, this ); - return CString(); + return RString(); } RageSound_DSound::~RageSound_DSound() diff --git a/stepmania/src/arch/Sound/RageSoundDriver_DSound.h b/stepmania/src/arch/Sound/RageSoundDriver_DSound.h index 33975c3eac..95afb3c251 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_DSound.h +++ b/stepmania/src/arch/Sound/RageSoundDriver_DSound.h @@ -14,7 +14,7 @@ class RageSound_DSound: public RageSoundDriver public: RageSound_DSound(); ~RageSound_DSound(); - CString Init(); + RString Init(); private: /* The only place that takes sounds out of INACTIVE is StartMixing; this mutex diff --git a/stepmania/src/arch/Sound/RageSoundDriver_DSound_Software.cpp b/stepmania/src/arch/Sound/RageSoundDriver_DSound_Software.cpp index 41448d4cb1..d8f22ab4cd 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_DSound_Software.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_DSound_Software.cpp @@ -61,9 +61,9 @@ RageSound_DSound_Software::RageSound_DSound_Software() m_pPCM = NULL; } -CString RageSound_DSound_Software::Init() +RString RageSound_DSound_Software::Init() { - CString sError = ds.Init(); + RString sError = ds.Init(); if( sError != "" ) return sError; @@ -103,7 +103,7 @@ CString RageSound_DSound_Software::Init() m_MixingThread.SetName("Mixer thread"); m_MixingThread.Create( MixerThread_start, this ); - return CString(); + return RString(); } RageSound_DSound_Software::~RageSound_DSound_Software() diff --git a/stepmania/src/arch/Sound/RageSoundDriver_DSound_Software.h b/stepmania/src/arch/Sound/RageSoundDriver_DSound_Software.h index e9ae6cbc71..1aa78f9623 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_DSound_Software.h +++ b/stepmania/src/arch/Sound/RageSoundDriver_DSound_Software.h @@ -10,7 +10,7 @@ class RageSound_DSound_Software: public RageSound_Generic_Software public: RageSound_DSound_Software(); virtual ~RageSound_DSound_Software(); - CString Init(); + RString Init(); int64_t GetPosition( const RageSoundBase *pSound ) const; float GetPlayLatency() const; diff --git a/stepmania/src/arch/Sound/RageSoundDriver_OSS.cpp b/stepmania/src/arch/Sound/RageSoundDriver_OSS.cpp index d15b84dd45..cf1fcc60fe 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_OSS.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_OSS.cpp @@ -96,7 +96,7 @@ int64_t RageSound_OSS::GetPosition(const RageSoundBase *snd) const return last_cursor_pos - (delay / bytes_per_frame); } -CString RageSound_OSS::CheckOSSVersion( int fd ) +RString RageSound_OSS::CheckOSSVersion( int fd ) { int version = 0; @@ -154,13 +154,13 @@ RageSound_OSS::RageSound_OSS() last_cursor_pos = 0; } -CString RageSound_OSS::Init() +RString RageSound_OSS::Init() { fd = open("/dev/dsp", O_WRONLY|O_NONBLOCK); if( fd == -1 ) return ssprintf( "RageSound_OSS: Couldn't open /dev/dsp: %s", strerror(errno) ); - CString sError = CheckOSSVersion( fd ); + RString sError = CheckOSSVersion( fd ); if( sError != "" ) return sError; diff --git a/stepmania/src/arch/Sound/RageSoundDriver_OSS.h b/stepmania/src/arch/Sound/RageSoundDriver_OSS.h index 99662f6357..73b7675df1 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_OSS.h +++ b/stepmania/src/arch/Sound/RageSoundDriver_OSS.h @@ -17,7 +17,7 @@ class RageSound_OSS: public RageSound_Generic_Software void MixerThread(); RageThread MixingThread; - static CString CheckOSSVersion( int fd ); + static RString CheckOSSVersion( int fd ); public: bool GetData(); @@ -29,7 +29,7 @@ public: void SetupDecodingThread(); RageSound_OSS(); - CString Init(); + RString Init(); ~RageSound_OSS(); }; #define USE_RAGE_SOUND_OSS diff --git a/stepmania/src/arch/Sound/RageSoundDriver_WaveOut.cpp b/stepmania/src/arch/Sound/RageSoundDriver_WaveOut.cpp index e0e6be3936..42ba0fef06 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_WaveOut.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_WaveOut.cpp @@ -21,14 +21,14 @@ const int num_chunks = 8; const int chunksize_frames = buffersize_frames / num_chunks; const int chunksize = buffersize / num_chunks; /* in bytes */ -static CString wo_ssprintf( MMRESULT err, const char *szFmt, ...) +static RString wo_ssprintf( MMRESULT err, const char *szFmt, ...) { char szBuf[MAXERRORLENGTH]; waveOutGetErrorText( err, szBuf, MAXERRORLENGTH ); va_list va; va_start( va, szFmt ); - CString s = vssprintf( szFmt, va ); + RString s = vssprintf( szFmt, va ); va_end( va ); return s += ssprintf( "(%s)", szBuf ); @@ -106,7 +106,7 @@ RageSound_WaveOut::RageSound_WaveOut() m_hWaveOut = NULL; } -CString RageSound_WaveOut::Init() +RString RageSound_WaveOut::Init() { WAVEFORMATEX fmt; fmt.wFormatTag = WAVE_FORMAT_PCM; @@ -143,7 +143,7 @@ CString RageSound_WaveOut::Init() MixingThread.SetName( "Mixer thread" ); MixingThread.Create( MixerThread_start, this ); - return CString(); + return RString(); } RageSound_WaveOut::~RageSound_WaveOut() diff --git a/stepmania/src/arch/Sound/RageSoundDriver_WaveOut.h b/stepmania/src/arch/Sound/RageSoundDriver_WaveOut.h index 383ad8abe1..103b675671 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_WaveOut.h +++ b/stepmania/src/arch/Sound/RageSoundDriver_WaveOut.h @@ -11,7 +11,7 @@ class RageSound_WaveOut: public RageSound_Generic_Software public: RageSound_WaveOut(); ~RageSound_WaveOut(); - CString Init(); + RString Init(); int64_t GetPosition( const RageSoundBase *pSound ) const; float GetPlayLatency() const; diff --git a/stepmania/src/arch/arch.cpp b/stepmania/src/arch/arch.cpp index fcca3dcc59..c705cab042 100644 --- a/stepmania/src/arch/arch.cpp +++ b/stepmania/src/arch/arch.cpp @@ -14,17 +14,17 @@ #include "InputHandler/Selector_InputHandler.h" static LocalizedString INPUT_HANDLERS_EMPTY( "Arch", "Input Handlers cannot be empty." ); -void MakeInputHandlers( const CString &drivers, vector &Add ) +void MakeInputHandlers( const RString &drivers, vector &Add ) { - vector DriversToTry; + vector DriversToTry; split( drivers, ",", DriversToTry, true ); if( DriversToTry.empty() ) RageException::Throw( INPUT_HANDLERS_EMPTY.GetValue() ); - CString Driver; + RString Driver; - FOREACH_CONST( CString, DriversToTry, s ) + FOREACH_CONST( RString, DriversToTry, s ) { InputHandler *ret = NULL; @@ -71,7 +71,7 @@ void MakeInputHandlers( const CString &drivers, vector &Add ) } #include "Lights/Selector_LightsDriver.h" -void MakeLightsDrivers( const CString &driver, vector &Add ) +void MakeLightsDrivers( const RString &driver, vector &Add ) { LOG->Trace( "Initializing lights driver: %s", driver.c_str() ); @@ -102,13 +102,13 @@ LoadingWindow *MakeLoadingWindow() return new LoadingWindow_Null; /* Don't load NULL by default. */ - const CString drivers = "xbox,win32,cocoa,gtk"; - vector DriversToTry; + const RString drivers = "xbox,win32,cocoa,gtk"; + vector DriversToTry; split( drivers, ",", DriversToTry, true ); ASSERT( DriversToTry.size() != 0 ); - CString Driver; + RString Driver; LoadingWindow *ret = NULL; for( unsigned i = 0; ret == NULL && i < DriversToTry.size(); ++i ) @@ -135,7 +135,7 @@ LoadingWindow *MakeLoadingWindow() if( ret == NULL ) continue; - CString sError = ret->Init(); + RString sError = ret->Init(); if( sError != "" ) { LOG->Info( "Couldn't load driver %s: %s", DriversToTry[i].c_str(), sError.c_str() ); @@ -176,9 +176,9 @@ MemoryCardDriver *MakeMemoryCardDriver() return ret; } -static Preference g_sMovieDrivers( "MovieDrivers", "" ); // "" == default +static Preference g_sMovieDrivers( "MovieDrivers", "" ); // "" == default #include "MovieTexture/Selector_MovieTexture.h" -static void DumpAVIDebugInfo( const CString& fn ); +static void DumpAVIDebugInfo( const RString& fn ); /* Try drivers in order of preference until we find one that works. */ static LocalizedString MOVIE_DRIVERS_EMPTY ( "Arch", "Movie Drivers cannot be empty." ); static LocalizedString COULDNT_CREATE_MOVIE_DRIVER ( "Arch", "Couldn't create a movie driver." ); @@ -190,13 +190,13 @@ RageMovieTexture *MakeRageMovieTexture( RageTextureID ID ) if( sDrivers.empty() ) sDrivers = DEFAULT_MOVIE_DRIVER_LIST; - vector DriversToTry; + vector DriversToTry; split( sDrivers, ",", DriversToTry, true ); if( DriversToTry.empty() ) RageException::Throw( MOVIE_DRIVERS_EMPTY.GetValue() ); - CString Driver; + RString Driver; RageMovieTexture *ret = NULL; for( unsigned i=0; ret==NULL && iInit(); + RString sError = ret->Init(); if( sError != "" ) { LOG->Info( "Couldn't load driver %s: %s", Driver.c_str(), sError.c_str() ); @@ -238,15 +238,15 @@ RageMovieTexture *MakeRageMovieTexture( RageTextureID ID ) #include "Sound/Selector_RageSoundDriver.h" static LocalizedString SOUND_DRIVERS_CANNOT_EMPTY( "Arch", "Sound Drivers cannot be empty." ); -RageSoundDriver *MakeRageSoundDriver( const CString &drivers ) +RageSoundDriver *MakeRageSoundDriver( const RString &drivers ) { - vector DriversToTry; + vector DriversToTry; split( drivers, ",", DriversToTry, true ); if( DriversToTry.empty() ) RageException::Throw( SOUND_DRIVERS_CANNOT_EMPTY.GetValue() ); - CString Driver; + RString Driver; RageSoundDriver *ret = NULL; for( unsigned i = 0; ret == NULL && i < DriversToTry.size(); ++i ) @@ -285,7 +285,7 @@ RageSoundDriver *MakeRageSoundDriver( const CString &drivers ) continue; } - CString sError = ret->Init(); + RString sError = ret->Init(); if( sError != "" ) { LOG->Info( "Couldn't load driver %s: %s", DriversToTry[i].c_str(), sError.c_str() ); @@ -300,9 +300,9 @@ RageSoundDriver *MakeRageSoundDriver( const CString &drivers ) } // Helper for MakeRageMovieTexture() -static void DumpAVIDebugInfo( const CString& fn ) +static void DumpAVIDebugInfo( const RString& fn ) { - CString type, handler; + RString type, handler; if( !RageMovieTexture::GetFourCC( fn, handler, type ) ) return; diff --git a/stepmania/src/arch/arch.h b/stepmania/src/arch/arch.h index 35dc7a4fb5..d67ae97b1e 100644 --- a/stepmania/src/arch/arch.h +++ b/stepmania/src/arch/arch.h @@ -21,10 +21,10 @@ class DialogDriver; DialogDriver *MakeDialogDriver(); class InputHandler; -void MakeInputHandlers( const CString &drivers, vector &Add ); +void MakeInputHandlers( const RString &drivers, vector &Add ); class LightsDriver; -void MakeLightsDrivers( const CString &drivers, vector &Add ); +void MakeLightsDrivers( const RString &drivers, vector &Add ); class LoadingWindow; LoadingWindow *MakeLoadingWindow(); @@ -41,7 +41,7 @@ class RageMovieTexture; RageMovieTexture *MakeRageMovieTexture( RageTextureID ID ); class RageSoundDriver; -RageSoundDriver *MakeRageSoundDriver( const CString &drivers ); +RageSoundDriver *MakeRageSoundDriver( const RString &drivers ); #endif diff --git a/stepmania/src/archutils/Unix/AssertionHandler.cpp b/stepmania/src/archutils/Unix/AssertionHandler.cpp index 33f4967ff2..5ed28f227a 100644 --- a/stepmania/src/archutils/Unix/AssertionHandler.cpp +++ b/stepmania/src/archutils/Unix/AssertionHandler.cpp @@ -53,7 +53,7 @@ void UnexpectedExceptionHandler() int iStatus = -1; char *pDem = abi::__cxa_demangle( pName, 0, 0, &iStatus ); - const CString error = ssprintf("Unhandled exception: %s", iStatus? pName:pDem); + const RString error = ssprintf("Unhandled exception: %s", iStatus? pName:pDem); #if defined(CRASH_HANDLER) sm_crash( error ); #else diff --git a/stepmania/src/archutils/Unix/BacktraceNames.cpp b/stepmania/src/archutils/Unix/BacktraceNames.cpp index 4861956304..2a975da4b3 100644 --- a/stepmania/src/archutils/Unix/BacktraceNames.cpp +++ b/stepmania/src/archutils/Unix/BacktraceNames.cpp @@ -71,19 +71,19 @@ void BacktraceNames::Demangle() { } #endif -CString BacktraceNames::Format() const +RString BacktraceNames::Format() const { - CString ShortenedPath = File; + RString ShortenedPath = File; if( ShortenedPath != "" ) { /* Abbreviate the module name. */ size_t slash = ShortenedPath.rfind('/'); if( slash != ShortenedPath.npos ) ShortenedPath = ShortenedPath.substr(slash+1); - ShortenedPath = CString("(") + ShortenedPath + ")"; + ShortenedPath = RString("(") + ShortenedPath + ")"; } - CString ret = ssprintf( "%0*lx: ", int(sizeof(void*)*2), (long) Address ); + RString ret = ssprintf( "%0*lx: ", int(sizeof(void*)*2), (long) Address ); if( Symbol != "" ) ret += Symbol + " "; ret += ShortenedPath; @@ -304,10 +304,10 @@ void BacktraceNames::FromAddr( const void *p ) } /* "path(mangled name+offset) [address]" */ -void BacktraceNames::FromString( CString s ) +void BacktraceNames::FromString( RString s ) { /* Hacky parser. I don't want to use regexes in the crash handler. */ - CString MangledAndOffset, sAddress; + RString MangledAndOffset, sAddress; unsigned pos = 0; while( pos < s.size() && s[pos] != '(' && s[pos] != '[' ) File += s[pos++]; @@ -333,7 +333,7 @@ void BacktraceNames::FromString( CString s ) else { Symbol = MangledAndOffset.substr(0, plus); - CString str = MangledAndOffset.substr(plus); + RString str = MangledAndOffset.substr(plus); if( sscanf(str, "%i", &Offset) != 1 ) Offset=0; } @@ -397,7 +397,7 @@ void BacktraceNames::FromAddr( const void *p ) fprintf(stderr, "FromAddr read() failed: %s\n", strerror(errno)); return; } - vector mangledAndFile; + vector mangledAndFile; split(f, " ", mangledAndFile, true); if (mangledAndFile.size() == 0) diff --git a/stepmania/src/archutils/Unix/BacktraceNames.h b/stepmania/src/archutils/Unix/BacktraceNames.h index b53d4e9d8e..124519585b 100644 --- a/stepmania/src/archutils/Unix/BacktraceNames.h +++ b/stepmania/src/archutils/Unix/BacktraceNames.h @@ -3,13 +3,13 @@ struct BacktraceNames { - CString Symbol, File; + RString Symbol, File; intptr_t Address; int Offset; void FromAddr( const void *p ); - void FromString( CString str ); + void FromString( RString str ); void Demangle(); - CString Format() const; + RString Format() const; BacktraceNames(): Address(0), Offset(0) { } }; diff --git a/stepmania/src/archutils/Unix/CrashHandler.cpp b/stepmania/src/archutils/Unix/CrashHandler.cpp index 1c26d39f38..3a13a6efc0 100644 --- a/stepmania/src/archutils/Unix/CrashHandler.cpp +++ b/stepmania/src/archutils/Unix/CrashHandler.cpp @@ -387,7 +387,7 @@ void CrashHandler::ForceCrash( const char *reason ) RunCrashHandler( &crash ); } -void CrashHandler::ForceDeadlock( CString reason, uint64_t iID ) +void CrashHandler::ForceDeadlock( RString reason, uint64_t iID ) { CrashData crash; memset( &crash, 0, sizeof(crash) ); diff --git a/stepmania/src/archutils/Unix/CrashHandler.h b/stepmania/src/archutils/Unix/CrashHandler.h index 622afa9238..1f05a3acfe 100644 --- a/stepmania/src/archutils/Unix/CrashHandler.h +++ b/stepmania/src/archutils/Unix/CrashHandler.h @@ -11,7 +11,7 @@ namespace CrashHandler void InitializeCrashHandler(); void CrashSignalHandler( int signal, siginfo_t *si, const ucontext_t *uc ); void ForceCrash( const char *reason ); - void ForceDeadlock( CString reason, uint64_t CrashHandle ); + void ForceDeadlock( RString reason, uint64_t CrashHandle ); } #endif diff --git a/stepmania/src/archutils/Unix/CrashHandlerChild.cpp b/stepmania/src/archutils/Unix/CrashHandlerChild.cpp index 75da364af1..e4dd2525c5 100644 --- a/stepmania/src/archutils/Unix/CrashHandlerChild.cpp +++ b/stepmania/src/archutils/Unix/CrashHandlerChild.cpp @@ -186,7 +186,7 @@ bool child_read( int fd, void *p, int size ) } /* Once we get here, we should be * safe to do whatever we want; -* heavyweights like malloc and CString are OK. (Don't crash!) */ +* heavyweights like malloc and RString are OK. (Don't crash!) */ static void child_process() { /* 1. Read the CrashData. */ @@ -232,7 +232,7 @@ static void child_process() if( !child_read(3, temp, size) ) return; - vector Checkpoints; + vector Checkpoints; split(temp, "$$", Checkpoints); delete [] temp; @@ -242,7 +242,7 @@ static void child_process() temp = new char [size]; if( !child_read(3, temp, size) ) return; - const CString CrashedThread(temp); + const RString CrashedThread(temp); delete[] temp; /* Wait for the child to either finish cleaning up or die. XXX: @@ -263,7 +263,7 @@ static void child_process() } const char *home = getenv( "HOME" ); - CString sCrashInfoPath = "/tmp"; + RString sCrashInfoPath = "/tmp"; if( home ) sCrashInfoPath = home; sCrashInfoPath += "/crashinfo.txt"; @@ -283,12 +283,12 @@ static void child_process() fprintf( CrashDump, "--------------------------------------\n" ); fprintf( CrashDump, "\n" ); - CString reason; + RString reason; switch( crash.type ) { case CrashData::SIGNAL: { - CString Signal = SignalName( crash.signal ); + RString Signal = SignalName( crash.signal ); #if !defined(MACOSX) reason = ssprintf( "%s - %s", Signal.c_str(), SignalCodeName(crash.signal, crash.si.si_code) ); diff --git a/stepmania/src/archutils/Unix/GetSysInfo.cpp b/stepmania/src/archutils/Unix/GetSysInfo.cpp index e3162ac098..1d3e995d50 100644 --- a/stepmania/src/archutils/Unix/GetSysInfo.cpp +++ b/stepmania/src/archutils/Unix/GetSysInfo.cpp @@ -4,7 +4,7 @@ #include -void GetKernel( CString &sys, int &vers ) +void GetKernel( RString &sys, int &vers ) { utsname uts; uname( &uts ); @@ -15,7 +15,7 @@ void GetKernel( CString &sys, int &vers ) if( sys == "Linux" ) { static Regex ver( "([0-9]+)\\.([0-9]+)\\.([0-9]+)" ); - vector matches; + vector matches; if( ver.Compare(uts.release, matches) ) { ASSERT( matches.size() >= 2 ); diff --git a/stepmania/src/archutils/Unix/GetSysInfo.h b/stepmania/src/archutils/Unix/GetSysInfo.h index 47a6690c47..6f1385ae2d 100644 --- a/stepmania/src/archutils/Unix/GetSysInfo.h +++ b/stepmania/src/archutils/Unix/GetSysInfo.h @@ -1,6 +1,6 @@ #ifndef GET_SYS_INFO_H -void GetKernel( CString &sys, int &vers ); +void GetKernel( RString &sys, int &vers ); #endif diff --git a/stepmania/src/archutils/Unix/LinuxThreadHelpers.cpp b/stepmania/src/archutils/Unix/LinuxThreadHelpers.cpp index 1a694443a1..023335f0c2 100644 --- a/stepmania/src/archutils/Unix/LinuxThreadHelpers.cpp +++ b/stepmania/src/archutils/Unix/LinuxThreadHelpers.cpp @@ -36,7 +36,7 @@ static _syscall0(pid_t,gettid) #endif -CString ThreadsVersion() +RString ThreadsVersion() { char buf[1024] = "(error)"; int ret = confstr( _CS_GNU_LIBPTHREAD_VERSION, buf, sizeof(buf) ); diff --git a/stepmania/src/archutils/Unix/LinuxThreadHelpers.h b/stepmania/src/archutils/Unix/LinuxThreadHelpers.h index 7bf3264425..956ca6998d 100644 --- a/stepmania/src/archutils/Unix/LinuxThreadHelpers.h +++ b/stepmania/src/archutils/Unix/LinuxThreadHelpers.h @@ -1,7 +1,7 @@ #ifndef PID_THREAD_HELPERS_H #define PID_THREAD_HELPERS_H -CString ThreadsVersion(); +RString ThreadsVersion(); /* Get the current thread's ThreadID. */ uint64_t GetCurrentThreadId(); diff --git a/stepmania/src/archutils/Win32/Crash.cpp b/stepmania/src/archutils/Win32/Crash.cpp index 270d8c464d..952612c025 100644 --- a/stepmania/src/archutils/Win32/Crash.cpp +++ b/stepmania/src/archutils/Win32/Crash.cpp @@ -958,7 +958,7 @@ static void NORETURN debug_crash() /* Get a stack trace of the current thread and the specified thread. If * iID == GetInvalidThreadId(), then output a stack trace for every thread. */ -void CrashHandler::ForceDeadlock( CString reason, uint64_t iID ) +void CrashHandler::ForceDeadlock( RString reason, uint64_t iID ) { strncpy( g_CrashInfo.m_CrashReason, reason, sizeof(g_CrashInfo.m_CrashReason) ); g_CrashInfo.m_CrashReason[ sizeof(g_CrashInfo.m_CrashReason)-1 ] = 0; diff --git a/stepmania/src/archutils/Win32/Crash.h b/stepmania/src/archutils/Win32/Crash.h index 1a7da93888..f367810e57 100644 --- a/stepmania/src/archutils/Win32/Crash.h +++ b/stepmania/src/archutils/Win32/Crash.h @@ -10,7 +10,7 @@ namespace CrashHandler void do_backtrace( const void **buf, size_t size, HANDLE hProcess, HANDLE hThread, const CONTEXT *pContext ); void SymLookup( const void *ptr, char *buf ); void ForceCrash( const char *reason ); - void ForceDeadlock( CString reason, uint64_t iID ); + void ForceDeadlock( RString reason, uint64_t iID ); /* Inform the crash handler of a foreground window that may be fullscreen. If * set, the crash handler will attempt to hide the window or reset the video diff --git a/stepmania/src/archutils/Win32/DebugInfoHunt.cpp b/stepmania/src/archutils/Win32/DebugInfoHunt.cpp index 653b3a7431..b77ed68dbe 100644 --- a/stepmania/src/archutils/Win32/DebugInfoHunt.cpp +++ b/stepmania/src/archutils/Win32/DebugInfoHunt.cpp @@ -27,7 +27,7 @@ static void GetMemoryDebugInfo() static void GetDisplayDriverDebugInfo() { - CString sPrimaryDeviceName = GetPrimaryVideoName(); + RString sPrimaryDeviceName = GetPrimaryVideoName(); if( sPrimaryDeviceName == "" ) LOG->Info( "Primary display driver could not be determined." ); @@ -67,14 +67,14 @@ static void GetDisplayDriverDebugInfo() } } -static CString wo_ssprintf( MMRESULT err, const char *fmt, ...) +static RString wo_ssprintf( MMRESULT err, const char *fmt, ...) { char buf[MAXERRORLENGTH]; waveOutGetErrorText(err, buf, MAXERRORLENGTH); va_list va; va_start(va, fmt); - CString s = vssprintf( fmt, va ); + RString s = vssprintf( fmt, va ); va_end(va); return s += ssprintf( "(%s)", buf ); @@ -90,19 +90,19 @@ static void GetDriveDebugInfo9x() * DMACurrentlyUsed 0 or 1 * DeviceDesc "GENERIC IDE DISK TYPE01" */ - vector Drives; + vector Drives; if( !RegistryAccess::GetRegSubKeys( "HKEY_LOCAL_MACHINE\\Enum\\ESDI", Drives ) ) return; for( unsigned drive = 0; drive < Drives.size(); ++drive ) { - vector IDs; + vector IDs; if( !RegistryAccess::GetRegSubKeys( Drives[drive], IDs ) ) continue; for( unsigned id = 0; id < IDs.size(); ++id ) { - CString DeviceDesc; + RString DeviceDesc; RegistryAccess::GetRegValue( IDs[id], "DeviceDesc", DeviceDesc ); TrimRight( DeviceDesc ); @@ -129,7 +129,7 @@ static void GetDriveDebugInfoNT() * Identifier "WDC WD1200JB-75CRA0" * Type "DiskPeripheral" */ - vector Ports; + vector Ports; if( !RegistryAccess::GetRegSubKeys( "HKEY_LOCAL_MACHINE\\HARDWARE\\DEVICEMAP\\Scsi", Ports ) ) return; @@ -138,28 +138,28 @@ static void GetDriveDebugInfoNT() int DMAEnabled = -1; RegistryAccess::GetRegValue( Ports[i], "DMAEnabled", DMAEnabled ); - CString Driver; + RString Driver; RegistryAccess::GetRegValue( Ports[i], "Driver", Driver ); - vector Busses; + vector Busses; if( !RegistryAccess::GetRegSubKeys( Ports[i], Busses, "Scsi Bus .*" ) ) continue; for( unsigned bus = 0; bus < Busses.size(); ++bus ) { - vector TargetIDs; + vector TargetIDs; if( !RegistryAccess::GetRegSubKeys( Busses[bus], TargetIDs, "Target Id .*" ) ) continue; for( unsigned tid = 0; tid < TargetIDs.size(); ++tid ) { - vector LUIDs; + vector LUIDs; if( !RegistryAccess::GetRegSubKeys( TargetIDs[tid], LUIDs, "Logical Unit Id .*" ) ) continue; for( unsigned luid = 0; luid < LUIDs.size(); ++luid ) { - CString Identifier; + RString Identifier; RegistryAccess::GetRegValue( LUIDs[luid], "Identifier", Identifier ); TrimRight( Identifier ); LOG->Info( "Drive: \"%s\" Driver: %s DMA: %s", @@ -200,7 +200,7 @@ static void GetWindowsVersionDebugInfo() return; } - CString Ver = ssprintf("Windows %i.%i (", ovi.dwMajorVersion, ovi.dwMinorVersion); + RString Ver = ssprintf("Windows %i.%i (", ovi.dwMajorVersion, ovi.dwMinorVersion); if(ovi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { if(ovi.dwMinorVersion == 0) diff --git a/stepmania/src/archutils/Win32/GetFileInformation.cpp b/stepmania/src/archutils/Win32/GetFileInformation.cpp index 4745fe3c7f..8bb1a9fa7e 100644 --- a/stepmania/src/archutils/Win32/GetFileInformation.cpp +++ b/stepmania/src/archutils/Win32/GetFileInformation.cpp @@ -10,7 +10,7 @@ #pragma comment(lib, "version.lib") #endif -bool GetFileVersion( CString sFile, CString &sOut ) +bool GetFileVersion( RString sFile, RString &sOut ) { do { /* Cast away const to work around header bug in VC6. */ @@ -19,7 +19,7 @@ bool GetFileVersion( CString sFile, CString &sOut ) if( !iSize ) break; - CString VersionBuffer( iSize, ' ' ); + RString VersionBuffer( iSize, ' ' ); /* Also VC6: */ if( !GetFileVersionInfo( const_cast(sFile.c_str()), NULL, iSize, VersionBuffer.GetBuf() ) ) break; @@ -37,13 +37,13 @@ bool GetFileVersion( CString sFile, CString &sOut ) char *str; UINT len; - CString sRes = ssprintf( "\\StringFileInfo\\%04x%04x\\FileVersion", + RString sRes = ssprintf( "\\StringFileInfo\\%04x%04x\\FileVersion", iTrans[0], iTrans[1] ); if( !VerQueryValue( (void *) VersionBuffer.c_str(), (char *) sRes.c_str(), (void **) &str, &len ) || len < 1) break; - sOut = CString( str, len-1 ); + sOut = RString( str, len-1 ); } while(0); /* Get the size and date. */ @@ -60,7 +60,7 @@ bool GetFileVersion( CString sFile, CString &sOut ) return true; } -CString FindSystemFile( CString sFile ) +RString FindSystemFile( RString sFile ) { char szWindowsPath[MAX_PATH]; GetWindowsDirectory( szWindowsPath, MAX_PATH ); @@ -77,18 +77,18 @@ CString FindSystemFile( CString sFile ) for( int i = 0; szPaths[i]; ++i ) { - CString sPath = ssprintf( "%s%s%s", szWindowsPath, szPaths[i], sFile.c_str() ); + RString sPath = ssprintf( "%s%s%s", szWindowsPath, szPaths[i], sFile.c_str() ); struct stat buf; if( !stat(sPath, &buf) ) return sPath; } - return CString(); + return RString(); } /* Get the full path of the process running in iProcessID. On error, false is * returned and an error message is placed in sName. */ -bool GetProcessFileName( uint32_t iProcessID, CString &sName ) +bool GetProcessFileName( uint32_t iProcessID, RString &sName ) { /* This method works in everything except for NT4, and only uses kernel32.lib functions. */ do { diff --git a/stepmania/src/archutils/Win32/GetFileInformation.h b/stepmania/src/archutils/Win32/GetFileInformation.h index 55a8f5096c..920da1eee2 100644 --- a/stepmania/src/archutils/Win32/GetFileInformation.h +++ b/stepmania/src/archutils/Win32/GetFileInformation.h @@ -3,9 +3,9 @@ #ifndef GET_FILE_INFORMATION_H #define GET_FILE_INFORMATION_H -bool GetFileVersion( CString fsFile, CString &sOut ); -CString FindSystemFile( CString sFile ); -bool GetProcessFileName( uint32_t iProcessID, CString &sName ); +bool GetFileVersion( RString fsFile, RString &sOut ); +RString FindSystemFile( RString sFile ); +bool GetProcessFileName( uint32_t iProcessID, RString &sName ); #endif diff --git a/stepmania/src/archutils/Win32/GotoURL.cpp b/stepmania/src/archutils/Win32/GotoURL.cpp index 713aa5ad1f..a3dd1d0b77 100644 --- a/stepmania/src/archutils/Win32/GotoURL.cpp +++ b/stepmania/src/archutils/Win32/GotoURL.cpp @@ -5,7 +5,7 @@ /* This is called from the crash handler; don't use RegistryAccess, since it's * not crash-conditions safe. */ -static LONG GetRegKey( HKEY key, CString subkey, LPTSTR retdata ) +static LONG GetRegKey( HKEY key, RString subkey, LPTSTR retdata ) { HKEY hKey; LONG iRet = RegOpenKeyEx( key, subkey, 0, KEY_QUERY_VALUE, &hKey ); @@ -23,7 +23,7 @@ static LONG GetRegKey( HKEY key, CString subkey, LPTSTR retdata ) } -bool GotoURL( CString sUrl ) +bool GotoURL( RString sUrl ) { // First try ShellExecute() int iRet = (int) ShellExecute( NULL, "open", sUrl, NULL, NULL, SW_SHOWDEFAULT ); diff --git a/stepmania/src/archutils/Win32/GotoURL.h b/stepmania/src/archutils/Win32/GotoURL.h index 31b963e11e..4f4d098e0d 100644 --- a/stepmania/src/archutils/Win32/GotoURL.h +++ b/stepmania/src/archutils/Win32/GotoURL.h @@ -1,7 +1,7 @@ #ifndef GOTO_URL_H #define GOTO_URL_H -bool GotoURL( CString sUrl ); +bool GotoURL( RString sUrl ); #endif diff --git a/stepmania/src/archutils/Win32/GraphicsWindow.cpp b/stepmania/src/archutils/Win32/GraphicsWindow.cpp index 037a38703c..0207be7b32 100644 --- a/stepmania/src/archutils/Win32/GraphicsWindow.cpp +++ b/stepmania/src/archutils/Win32/GraphicsWindow.cpp @@ -14,7 +14,7 @@ #include -static const CString g_sClassName = PRODUCT_NAME; +static const RString g_sClassName = PRODUCT_NAME; static HWND g_hWndMain; static HDC g_HDC; @@ -31,7 +31,7 @@ static bool g_bRecreatingVideoMode = false; static UINT g_iQueryCancelAutoPlayMessage = 0; -static CString GetNewWindow() +static RString GetNewWindow() { HWND h = GetForegroundWindow(); if( h == NULL ) @@ -40,7 +40,7 @@ static CString GetNewWindow() DWORD iProcessID; GetWindowThreadProcessId( h, &iProcessID ); - CString sName; + RString sName; GetProcessFileName( iProcessID, sName ); sName = Basename(sName); @@ -65,11 +65,11 @@ static LRESULT CALLBACK GraphicsWindow_WndProc( HWND hWnd, UINT msg, WPARAM wPar LOG->Trace( "WM_ACTIVATE (%i, %i): %s", bInactive, bMinimized, g_bHasFocus? "has focus":"doesn't have focus" ); if( !g_bHasFocus ) { - CString sName = GetNewWindow(); - static set sLostFocusTo; + RString sName = GetNewWindow(); + static set sLostFocusTo; sLostFocusTo.insert( sName ); - CString sStr; - for( set::const_iterator it = sLostFocusTo.begin(); it != sLostFocusTo.end(); ++it ) + RString sStr; + for( set::const_iterator it = sLostFocusTo.begin(); it != sLostFocusTo.end(); ++it ) sStr += (sStr.size()?", ":"") + *it; LOG->MapLog( "LOST_FOCUS", "Lost focus to: %s", sStr.c_str() ); @@ -215,14 +215,14 @@ static void AdjustVideoModeParams( VideoModeParams &p ) /* Set the display mode to the given size, bit depth and refresh. The refresh * setting may be ignored. */ -CString GraphicsWindow::SetScreenMode( const VideoModeParams &p ) +RString GraphicsWindow::SetScreenMode( const VideoModeParams &p ) { if( p.windowed ) { /* We're going windowed. If we were previously fullscreen, reset. */ ChangeDisplaySettings( NULL, 0 ); - return CString(); + return RString(); } DEVMODE DevMode; @@ -252,7 +252,7 @@ CString GraphicsWindow::SetScreenMode( const VideoModeParams &p ) return "Couldn't set screen mode"; g_FullScreenDevMode = DevMode; - return CString(); + return RString(); } static int GetWindowStyle( bool bWindowed ) diff --git a/stepmania/src/archutils/Win32/GraphicsWindow.h b/stepmania/src/archutils/Win32/GraphicsWindow.h index 1a095209ab..62a921bee2 100644 --- a/stepmania/src/archutils/Win32/GraphicsWindow.h +++ b/stepmania/src/archutils/Win32/GraphicsWindow.h @@ -15,7 +15,7 @@ namespace GraphicsWindow /* Shut down completely. */ void Shutdown(); - CString SetScreenMode( const VideoModeParams &p ); + RString SetScreenMode( const VideoModeParams &p ); void CreateGraphicsWindow( const VideoModeParams &p, bool bForceRecreateWindow = false ); void DestroyGraphicsWindow(); diff --git a/stepmania/src/archutils/Win32/SpecialDirs.cpp b/stepmania/src/archutils/Win32/SpecialDirs.cpp index 0d86244f79..32698d41d8 100644 --- a/stepmania/src/archutils/Win32/SpecialDirs.cpp +++ b/stepmania/src/archutils/Win32/SpecialDirs.cpp @@ -5,7 +5,7 @@ RString SpecialDirs::GetMyDocumentsDir() { - CString sMyDocumentsDir; + RString sMyDocumentsDir; bool bSuccess = RegistryAccess::GetRegValue( "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Personal", sMyDocumentsDir ); ASSERT( bSuccess ); sMyDocumentsDir.Replace( '\\', '/' ); @@ -15,7 +15,7 @@ RString SpecialDirs::GetMyDocumentsDir() RString SpecialDirs::GetApplicationDataDir() { - CString sDir; + RString sDir; TCHAR szDir[MAX_PATH] = ""; BOOL bResult = SHGetSpecialFolderPath( NULL, szDir, CSIDL_APPDATA, FALSE ); ASSERT( bResult ); @@ -26,7 +26,7 @@ RString SpecialDirs::GetApplicationDataDir() RString SpecialDirs::GetDesktopDir() { - CString sDir; + RString sDir; TCHAR szDir[MAX_PATH] = ""; BOOL bResult = SHGetSpecialFolderPath( NULL, szDir, CSIDL_DESKTOP, FALSE ); ASSERT( bResult ); diff --git a/stepmania/src/archutils/Win32/USB.cpp b/stepmania/src/archutils/Win32/USB.cpp index df792548c3..ae47498280 100644 --- a/stepmania/src/archutils/Win32/USB.cpp +++ b/stepmania/src/archutils/Win32/USB.cpp @@ -14,7 +14,7 @@ extern "C" { #include "archutils/Win32/ddk/hidsdi.h" } -static CString GetUSBDevicePath( int iNum ) +static RString GetUSBDevicePath( int iNum ) { GUID guid; HidD_GetHidGuid( &guid ); @@ -28,7 +28,7 @@ static CString GetUSBDevicePath( int iNum ) NULL, &guid, iNum, &DeviceInterface) ) { SetupDiDestroyDeviceInfoList( DeviceInfo ); - return CString(); + return RString(); } unsigned long iSize; @@ -37,7 +37,7 @@ static CString GetUSBDevicePath( int iNum ) PSP_INTERFACE_DEVICE_DETAIL_DATA DeviceDetail = (PSP_INTERFACE_DEVICE_DETAIL_DATA) malloc( iSize ); DeviceDetail->cbSize = sizeof(SP_INTERFACE_DEVICE_DETAIL_DATA); - CString sRet; + RString sRet; if( SetupDiGetDeviceInterfaceDetail(DeviceInfo, &DeviceInterface, DeviceDetail, iSize, &iSize, NULL) ) sRet = DeviceDetail->DevicePath; @@ -51,7 +51,7 @@ bool USBDevice::Open( int iVID, int iPID, int iBlockSize, int iNum, void (*pfnIn { DWORD iIndex = 0; - CString path; + RString path; while( (path = GetUSBDevicePath(iIndex++)) != "" ) { HANDLE h = CreateFile( path, GENERIC_READ, @@ -124,7 +124,7 @@ WindowsFileIO::~WindowsFileIO() delete[] m_pBuffer; } -bool WindowsFileIO::Open( CString path, int iBlockSize ) +bool WindowsFileIO::Open( RString path, int iBlockSize ) { LOG->Trace( "WindowsFileIO::open(%s)", path.c_str() ); m_iBlockSize = iBlockSize; diff --git a/stepmania/src/archutils/Win32/USB.h b/stepmania/src/archutils/Win32/USB.h index a51e557497..730c63369a 100644 --- a/stepmania/src/archutils/Win32/USB.h +++ b/stepmania/src/archutils/Win32/USB.h @@ -11,7 +11,7 @@ class WindowsFileIO public: WindowsFileIO(); ~WindowsFileIO(); - bool Open( CString sPath, int iBlockSize ); + bool Open( RString sPath, int iBlockSize ); bool IsOpen() const; /* Nonblocking read. size must always be the same. Returns the number of bytes diff --git a/stepmania/src/archutils/Win32/VideoDriverInfo.cpp b/stepmania/src/archutils/Win32/VideoDriverInfo.cpp index 2e1410f1e7..6bf698e0fa 100644 --- a/stepmania/src/archutils/Win32/VideoDriverInfo.cpp +++ b/stepmania/src/archutils/Win32/VideoDriverInfo.cpp @@ -6,7 +6,7 @@ #include // this will not work on 95 and NT because of EnumDisplayDevices -CString GetPrimaryVideoName() +RString GetPrimaryVideoName() { typedef BOOL (WINAPI* pfnEnumDisplayDevices)(PVOID,DWORD,PDISPLAY_DEVICE,DWORD); pfnEnumDisplayDevices EnumDisplayDevices; @@ -14,17 +14,17 @@ CString GetPrimaryVideoName() hInstUser32 = LoadLibrary( "User32.DLL" ); if( !hInstUser32 ) - return CString(); + return RString(); // VC6 don't have a stub to static link with, so link dynamically. EnumDisplayDevices = (pfnEnumDisplayDevices)GetProcAddress(hInstUser32,"EnumDisplayDevicesA"); if( EnumDisplayDevices == NULL ) { FreeLibrary(hInstUser32); - return CString(); + return RString(); } - CString sPrimaryDeviceName; + RString sPrimaryDeviceName; for( int i=0; true; ++i ) { DISPLAY_DEVICE dd; @@ -43,9 +43,9 @@ CString GetPrimaryVideoName() return sPrimaryDeviceName; } -CString GetPrimaryVideoDriverName() +RString GetPrimaryVideoDriverName() { - const CString sPrimaryDeviceName = GetPrimaryVideoName(); + const RString sPrimaryDeviceName = GetPrimaryVideoName(); if( sPrimaryDeviceName != "" ) return sPrimaryDeviceName; @@ -67,12 +67,12 @@ bool GetVideoDriverInfo( int iCardno, VideoDriverInfo &info ) const bool bIsWin9x = version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS; static bool bInitialized=false; - static vector lst; + static vector lst; if( !bInitialized ) { bInitialized = true; - const CString sTopKey = bIsWin9x? + const RString sTopKey = bIsWin9x? "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Class\\Display": "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E968-E325-11CE-BFC1-08002BE10318}"; @@ -99,7 +99,7 @@ bool GetVideoDriverInfo( int iCardno, VideoDriverInfo &info ) while( iCardno < (int)lst.size() ) { - const CString sKey = lst[iCardno]; + const RString sKey = lst[iCardno]; if( !RegistryAccess::GetRegValue( sKey, "DriverDesc", info.sDescription ) ) { diff --git a/stepmania/src/archutils/Win32/VideoDriverInfo.h b/stepmania/src/archutils/Win32/VideoDriverInfo.h index 00c232b08d..64484c67e5 100644 --- a/stepmania/src/archutils/Win32/VideoDriverInfo.h +++ b/stepmania/src/archutils/Win32/VideoDriverInfo.h @@ -5,16 +5,16 @@ struct VideoDriverInfo { - CString sProvider; - CString sDescription; - CString sVersion; - CString sDate; - CString sDeviceID; + RString sProvider; + RString sDescription; + RString sVersion; + RString sDate; + RString sDeviceID; }; -CString GetPrimaryVideoName(); +RString GetPrimaryVideoName(); bool GetVideoDriverInfo( int iCardno, VideoDriverInfo &info ); -CString GetPrimaryVideoDriverName(); +RString GetPrimaryVideoDriverName(); #endif diff --git a/stepmania/src/archutils/Win32/WindowIcon.cpp b/stepmania/src/archutils/Win32/WindowIcon.cpp index 2393517fcb..86057c5838 100644 --- a/stepmania/src/archutils/Win32/WindowIcon.cpp +++ b/stepmania/src/archutils/Win32/WindowIcon.cpp @@ -88,9 +88,9 @@ HICON IconFromSurface( const RageSurface *pSrcImg ) return icon; } -HICON IconFromFile( const CString &sIconFile ) +HICON IconFromFile( const RString &sIconFile ) { - CString sError; + RString sError; RageSurface *pImg = RageSurfaceUtils::LoadFile( sIconFile, sError ); if( pImg == NULL ) { diff --git a/stepmania/src/archutils/Win32/WindowIcon.h b/stepmania/src/archutils/Win32/WindowIcon.h index d41fa36c47..a1b10cee33 100644 --- a/stepmania/src/archutils/Win32/WindowIcon.h +++ b/stepmania/src/archutils/Win32/WindowIcon.h @@ -6,7 +6,7 @@ struct RageSurface; HICON IconFromSurface( const RageSurface *pImg ); -HICON IconFromFile( const CString &sIconFile ); +HICON IconFromFile( const RString &sIconFile ); #endif diff --git a/stepmania/src/archutils/Xbox/GraphicsWindow.cpp b/stepmania/src/archutils/Xbox/GraphicsWindow.cpp index e18e3b6d2d..907d6122fa 100644 --- a/stepmania/src/archutils/Xbox/GraphicsWindow.cpp +++ b/stepmania/src/archutils/Xbox/GraphicsWindow.cpp @@ -4,7 +4,7 @@ #include "RageLog.h" #include "RageUtil.h" -static const CString g_sClassName = CString(PRODUCT_NAME) + " LowLevelWindow_Win32"; +static const RString g_sClassName = RString(PRODUCT_NAME) + " LowLevelWindow_Win32"; static VideoModeParams g_CurrentParams; static bool g_bResolutionChanged = false; @@ -34,7 +34,7 @@ void GraphicsWindow::Update() void GraphicsWindow::Initialize( bool bD3D ) { } void GraphicsWindow::Shutdown() { } -CString GraphicsWindow::SetScreenMode( const VideoModeParams &p ) { return ""; } +RString GraphicsWindow::SetScreenMode( const VideoModeParams &p ) { return ""; } void GraphicsWindow::CreateGraphicsWindow( const VideoModeParams &p ) { } void GraphicsWindow::RecreateGraphicsWindow( const VideoModeParams &p ) { } void GraphicsWindow::DestroyGraphicsWindow() { } diff --git a/stepmania/src/archutils/Xbox/GraphicsWindow.h b/stepmania/src/archutils/Xbox/GraphicsWindow.h index f534b37997..d3288d65c3 100644 --- a/stepmania/src/archutils/Xbox/GraphicsWindow.h +++ b/stepmania/src/archutils/Xbox/GraphicsWindow.h @@ -11,7 +11,7 @@ namespace GraphicsWindow void Initialize( bool bD3D ); void Shutdown(); void SetVideoModeParams( const VideoModeParams &p ); - CString SetScreenMode( const VideoModeParams &p ); + RString SetScreenMode( const VideoModeParams &p ); void CreateGraphicsWindow( const VideoModeParams &p ); void RecreateGraphicsWindow( const VideoModeParams &p ); void DestroyGraphicsWindow(); diff --git a/stepmania/src/crypto/CryptRSA.cpp b/stepmania/src/crypto/CryptRSA.cpp index f6c6eccc18..af33c112fa 100644 --- a/stepmania/src/crypto/CryptRSA.cpp +++ b/stepmania/src/crypto/CryptRSA.cpp @@ -229,7 +229,7 @@ static Bignum rsa_privkey_op(Bignum input, const RSAKey *key) return ret; } -bool RSAKey::Encrypt( CString &buf ) const +bool RSAKey::Encrypt( RString &buf ) const { Bignum bn = bignum_from_bytes( (unsigned char *) buf.data(), buf.size() ); Bignum encrypted_bn = Encrypt( bn ); @@ -237,13 +237,13 @@ bool RSAKey::Encrypt( CString &buf ) const int len; unsigned char *bytes = bignum_to_buffer( encrypted_bn, &len ); - buf = CString( (const char *) bytes, len ); + buf = RString( (const char *) bytes, len ); delete [] encrypted_bn; return true; } -bool RSAKey::Decrypt( CString &buf ) const +bool RSAKey::Decrypt( RString &buf ) const { Bignum bn = bignum_from_buffer( (unsigned char *) buf.data(), buf.size() ); if( bn == NULL ) @@ -254,7 +254,7 @@ bool RSAKey::Decrypt( CString &buf ) const int len; unsigned char *bytes = bignum_to_bytes( decrypted_bn, &len ); - buf = CString( (const char *) bytes, len ); + buf = RString( (const char *) bytes, len ); delete [] decrypted_bn; return true; @@ -428,7 +428,7 @@ static Bignum getmp(const char **data, int *datalen) return b; } -bool RSAKey::LoadFromPublicBlob( const CString &str ) +bool RSAKey::LoadFromPublicBlob( const RString &str ) { int len = str.size(); const char *data = str.data(); @@ -456,7 +456,7 @@ char *RSAKey::FmtKey() const return p; } -void RSAKey::PublicBlob( CString &out ) const +void RSAKey::PublicBlob( RString &out ) const { int elen, mlen, bloblen; int i; @@ -486,10 +486,10 @@ void RSAKey::PublicBlob( CString &out ) const *p++ = bignum_byte(this->modulus, i); ASSERT(p == blob + bloblen); - out = CString( (const char *) blob, bloblen ); + out = RString( (const char *) blob, bloblen ); } -void RSAKey::PrivateBlob( CString &out ) const +void RSAKey::PrivateBlob( RString &out ) const { int i; unsigned char *blob, *p; @@ -535,10 +535,10 @@ void RSAKey::PrivateBlob( CString &out ) const *p++ = bignum_byte(this->iqmp, i); ASSERT(p == blob + bloblen); - out = CString( (const char *) blob, bloblen ); + out = RString( (const char *) blob, bloblen ); } -bool RSAKey::LoadFromPrivateBlob( const CString &str ) +bool RSAKey::LoadFromPrivateBlob( const RString &str ) { int len = str.size(); const char *data = str.data(); @@ -606,7 +606,7 @@ static int rsa2_openssh_fmtkey( struct RSAKey *rsa, unsigned char *blob, int len return bloblen; } */ -int rsa2_pubkey_bits( const CString &blob ) +int rsa2_pubkey_bits( const RString &blob ) { RSAKey rsa; if( !rsa.LoadFromPublicBlob( blob ) ) @@ -649,7 +649,7 @@ char *rsa2_fingerprint( struct RSAKey *rsa ) return ret; } -bool RSAKey::Verify( const CString &data, const CString &sig ) const +bool RSAKey::Verify( const RString &data, const RString &sig ) const { Bignum in, out; int bytes, i, j; @@ -691,7 +691,7 @@ bool RSAKey::Verify( const CString &data, const CString &sig ) const return ret; } -void RSAKey::Sign( const CString &data, CString &out ) const +void RSAKey::Sign( const RString &data, RString &out ) const { Bignum in; { @@ -716,7 +716,7 @@ void RSAKey::Sign( const CString &data, CString &out ) const unsigned char *bytes = bignum_to_bytes( outnum, &siglen ); delete [] outnum; - out = CString( (const char *) bytes, siglen ); + out = RString( (const char *) bytes, siglen ); delete [] bytes; } diff --git a/stepmania/src/crypto/CryptRSA.h b/stepmania/src/crypto/CryptRSA.h index 30dad86f53..8c4c6bf3f8 100644 --- a/stepmania/src/crypto/CryptRSA.h +++ b/stepmania/src/crypto/CryptRSA.h @@ -15,15 +15,15 @@ struct RSAKey Bignum p; Bignum q; Bignum iqmp; - CString comment; + RString comment; int Generate( int bits ); void Fingerprint( char *str, int len ) const; - void Sign( const CString &data, CString &out ) const; - bool Verify( const CString &data, const CString &sig ) const; + void Sign( const RString &data, RString &out ) const; + bool Verify( const RString &data, const RString &sig ) const; - bool Encrypt( CString &buf ) const; - bool Decrypt( CString &buf ) const; + bool Encrypt( RString &buf ) const; + bool Decrypt( RString &buf ) const; Bignum Encrypt( const Bignum input ) const; Bignum Decrypt( const Bignum input ) const; @@ -32,10 +32,10 @@ struct RSAKey void StrFmt( char *str ) const; char *FmtKey() const; - void PublicBlob( CString &out ) const; - void PrivateBlob( CString &out ) const; - bool LoadFromPublicBlob( const CString &PublicBlob ); - bool LoadFromPrivateBlob( const CString &PrivateBlob ); + void PublicBlob( RString &out ) const; + void PrivateBlob( RString &out ) const; + bool LoadFromPublicBlob( const RString &PublicBlob ); + bool LoadFromPrivateBlob( const RString &PrivateBlob ); }; #endif diff --git a/stepmania/src/crypto/CryptRand.cpp b/stepmania/src/crypto/CryptRand.cpp index b601814c8b..5620039947 100644 --- a/stepmania/src/crypto/CryptRand.cpp +++ b/stepmania/src/crypto/CryptRand.cpp @@ -113,7 +113,7 @@ static void random_stir(void) pool.poolpos = sizeof(pool.incoming); } -void random_add_noise( const CString &noise ) +void random_add_noise( const RString &noise ) { unsigned char *p = (unsigned char *) noise.data(); int i; diff --git a/stepmania/src/crypto/CryptRand.h b/stepmania/src/crypto/CryptRand.h index d0e7d337a4..ad82257288 100644 --- a/stepmania/src/crypto/CryptRand.h +++ b/stepmania/src/crypto/CryptRand.h @@ -2,7 +2,7 @@ #define SSH_RAND_H void random_init(); -void random_add_noise( const CString &noise ); +void random_add_noise( const RString &noise ); unsigned char random_byte(); void random_get_savedata( char **data, int *len ); diff --git a/stepmania/src/ezsockets.h b/stepmania/src/ezsockets.h index 3ef4242b42..d240701821 100644 --- a/stepmania/src/ezsockets.h +++ b/stepmania/src/ezsockets.h @@ -127,7 +127,7 @@ public: int lastCode; //Used for debugging purposes - CString address; + RString address; private: diff --git a/stepmania/src/global.h b/stepmania/src/global.h index 97877bab6e..722d5e239b 100644 --- a/stepmania/src/global.h +++ b/stepmania/src/global.h @@ -137,9 +137,6 @@ void ShowWarning( const char *file, int line, const char *message ); // don't pu /* Use CStdString: */ #include "StdString.h" typedef StdString::CStdString RString; -#if !defined(CO_EXIST_WITH_MFC) -typedef StdString::CStdString CString; -#endif #include "RageException.h" diff --git a/stepmania/src/song.h b/stepmania/src/song.h index 8a5d009abe..c67458500f 100644 --- a/stepmania/src/song.h +++ b/stepmania/src/song.h @@ -35,13 +35,13 @@ enum BackgroundLayer struct LyricSegment { float m_fStartTime; - CString m_sLyric; + RString m_sLyric; RageColor m_Color; }; class Song { - CString m_sSongDir; + RString m_sSongDir; public: /* Set when this song should be displayed in the music wheel: */ @@ -57,64 +57,64 @@ public: void Reset(); void DetachSteps(); - NotesLoader *MakeLoader( CString sDir ) const; + NotesLoader *MakeLoader( RString sDir ) const; - bool LoadFromSongDir( CString sDir ); + bool LoadFromSongDir( RString sDir ); void TidyUpData(); // call after loading to clean up invalid data void ReCalculateRadarValuesAndLastBeat(); // called by TidyUpData, and after saving void TranslateTitles(); // called by TidyUpData - void SaveToSMFile( CString sPath, bool bSavingCache ); + void SaveToSMFile( RString sPath, bool bSavingCache ); void Save(); // saves SM and DWI void SaveToCacheFile(); void SaveToDWIFile(); - const CString &GetSongFilePath() const; - CString GetCacheFilePath() const; + const RString &GetSongFilePath() const; + RString GetCacheFilePath() const; void AddAutoGenNotes(); void AutoGen( StepsType ntTo, StepsType ntFrom ); // create Steps of type ntTo from Steps of type ntFrom void RemoveAutoGenNotes(); /* Directory this song data came from: */ - const CString &GetSongDir() const { return m_sSongDir; } + const RString &GetSongDir() const { return m_sSongDir; } /* Filename associated with this file. This will always have * an .SM extension. If we loaded an .SM, this will point to * it, but if we loaded any other type, this will point to a * generated .SM filename. */ - CString m_sSongFileName; + RString m_sSongFileName; - CString m_sGroupName; + RString m_sGroupName; ProfileSlot m_LoadedFromProfile; // ProfileSlot_INVALID if wasn't loaded from a profile bool m_bIsSymLink; - CString m_sMainTitle, m_sSubTitle, m_sArtist; - CString m_sMainTitleTranslit, m_sSubTitleTranslit, m_sArtistTranslit; + RString m_sMainTitle, m_sSubTitle, m_sArtist; + RString m_sMainTitleTranslit, m_sSubTitleTranslit, m_sArtistTranslit; /* If PREFSMAN->m_bShowNative is off, these are the same as GetTranslit* below. * Otherwise, they return the main titles. */ - CString GetDisplayMainTitle() const; - CString GetDisplaySubTitle() const; - CString GetDisplayArtist() const; + RString GetDisplayMainTitle() const; + RString GetDisplaySubTitle() const; + RString GetDisplayArtist() const; /* Returns the transliterated titles, if any; otherwise returns the main titles. */ - CString GetTranslitMainTitle() const { return m_sMainTitleTranslit.size()? m_sMainTitleTranslit: m_sMainTitle; } - CString GetTranslitSubTitle() const { return m_sSubTitleTranslit.size()? m_sSubTitleTranslit: m_sSubTitle; } - CString GetTranslitArtist() const { return m_sArtistTranslit.size()? m_sArtistTranslit:m_sArtist; } + RString GetTranslitMainTitle() const { return m_sMainTitleTranslit.size()? m_sMainTitleTranslit: m_sMainTitle; } + RString GetTranslitSubTitle() const { return m_sSubTitleTranslit.size()? m_sSubTitleTranslit: m_sSubTitle; } + RString GetTranslitArtist() const { return m_sArtistTranslit.size()? m_sArtistTranslit:m_sArtist; } /* "title subtitle" */ - CString GetDisplayFullTitle() const; - CString GetTranslitFullTitle() const; + RString GetDisplayFullTitle() const; + RString GetTranslitFullTitle() const; - CString m_sGenre; + RString m_sGenre; /* This is read and saved, but never actually used. */ - CString m_sCredit; + RString m_sCredit; - CString m_sMusicFile; + RString m_sMusicFile; float m_fMusicLengthSeconds; float m_fFirstBeat; // beat of first note float m_fLastBeat; // beat of last note @@ -124,16 +124,16 @@ public: float m_fSpecifiedBPMMin; float m_fSpecifiedBPMMax; // if a range, then Min != Max - CString m_sBannerFile; - CString m_sLyricsFile; - CString m_sBackgroundFile; - CString m_sCDTitleFile; + RString m_sBannerFile; + RString m_sLyricsFile; + RString m_sBackgroundFile; + RString m_sCDTitleFile; - CString GetMusicPath() const; - CString GetBannerPath() const; - CString GetLyricsPath() const; - CString GetBackgroundPath() const; - CString GetCDTitlePath() const; + RString GetMusicPath() const; + RString GetBannerPath() const; + RString GetLyricsPath() const; + RString GetBackgroundPath() const; + RString GetCDTitlePath() const; /* For loading only: */ bool m_bHasMusic, m_bHasBanner; @@ -146,7 +146,7 @@ public: bool HasBGChanges() const; bool HasLyrics() const; - bool Matches(CString sGroup, CString sSong) const; + bool Matches(RString sGroup, RString sSong) const; TimingData m_Timing; @@ -192,7 +192,7 @@ public: Difficulty dc = DIFFICULTY_INVALID, int iMeterLow = -1, int iMeterHigh = -1, - const CString &sDescription = "", + const RString &sDescription = "", bool bIncludeAutoGen = true, unsigned uHash = 0, int iMaxToGet = -1 @@ -202,13 +202,13 @@ public: Difficulty dc = DIFFICULTY_INVALID, int iMeterLow = -1, int iMeterHigh = -1, - const CString &sDescription = "", + const RString &sDescription = "", unsigned uHash = 0, bool bIncludeAutoGen = true ) const; Steps* GetStepsByDifficulty( StepsType st, Difficulty dc, bool bIncludeAutoGen = true ) const; Steps* GetStepsByMeter( StepsType st, int iMeterLow, int iMeterHigh ) const; - Steps* GetStepsByDescription( StepsType st, CString sDescription ) const; + Steps* GetStepsByDescription( StepsType st, RString sDescription ) const; Steps* GetClosestNotes( StepsType st, Difficulty dc, bool bIgnoreLocked=false ) const; bool IsEasy( StepsType st ) const; bool IsTutorial() const; @@ -228,15 +228,15 @@ public: int GetNumStepsLoadedFromProfile( ProfileSlot slot ) const; bool IsEditAlreadyLoaded( Steps* pSteps ) const; - bool IsEditDescriptionUnique( StepsType st, CString sPreferredDescription, const Steps *pExclude ) const; - void MakeUniqueEditDescription( StepsType st, CString &sPreferredDescriptionInOut ) const; + bool IsEditDescriptionUnique( StepsType st, RString sPreferredDescription, const Steps *pExclude ) const; + void MakeUniqueEditDescription( StepsType st, RString &sPreferredDescriptionInOut ) const; // An array of keysound file names (e.g. "beep.wav"). // The index in this array corresponds to the index in TapNote. If you // change the index in here, you must change all NoteData too. // Any note that doesn't have a value in the range of this array // means "this note doens't have a keysound". - vector m_vsKeysoundFile; + vector m_vsKeysoundFile; // Lua void PushSelf( lua_State *L ); diff --git a/stepmania/src/tests/test_audio_readers.cpp b/stepmania/src/tests/test_audio_readers.cpp index 46d10cdb91..0cb0ea9cde 100644 --- a/stepmania/src/tests/test_audio_readers.cpp +++ b/stepmania/src/tests/test_audio_readers.cpp @@ -501,7 +501,7 @@ bool test_file( const TestFile &tf, int filters ) const char *fn = tf.fn; LOG->Trace("Testing: %s", fn ); - CString error; + RString error; SoundReader *s = SoundReader_FileReader::OpenFile( fn, error ); s = ApplyFilters( s, filters ); diff --git a/stepmania/src/tests/test_file_errors.cpp b/stepmania/src/tests/test_file_errors.cpp index a96f19e813..27265fbd46 100644 --- a/stepmania/src/tests/test_file_errors.cpp +++ b/stepmania/src/tests/test_file_errors.cpp @@ -9,8 +9,8 @@ #include -static CString g_TestFile; -static CString g_TestFilename; +static RString g_TestFile; +static RString g_TestFilename; static int g_BytesUntilError = 6; /* @@ -22,26 +22,26 @@ static int g_BytesUntilError = 6; class RageFileDriverTest: public RageFileDriver { public: - RageFileDriverTest( CString root ); + RageFileDriverTest( RString root ); - RageFileObj *Open( const CString &path, int mode, RageFile &p, int &err ); - bool Remove( const CString &sPath ) { return false; } + RageFileObj *Open( const RString &path, int mode, RageFile &p, int &err ); + bool Remove( const RString &sPath ) { return false; } bool Ready() { return true; } private: - CString root; + RString root; }; static struct FileDriverEntry_TEST: public FileDriverEntry { FileDriverEntry_TEST(): FileDriverEntry( "TEST" ) { } - RageFileDriver *Create( CString Root ) const { return new RageFileDriverTest( Root ); } + RageFileDriver *Create( RString Root ) const { return new RageFileDriverTest( Root ); } } const g_RegisterDriver; class TestFilenameDB: public FilenameDB { protected: - virtual void PopulateFileSet( FileSet &fs, const CString &sPath ) + virtual void PopulateFileSet( FileSet &fs, const RString &sPath ) { if( sPath != "." ) return; @@ -58,10 +58,10 @@ protected: fs.files.insert(f); } - CString root; + RString root; public: - TestFilenameDB( CString root_ ) + TestFilenameDB( RString root_ ) { root = root_; if( root == "./" ) @@ -73,7 +73,7 @@ public: class RageFileObjTest: public RageFileObj { public: - RageFileObjTest( const CString &path, RageFile &p ); + RageFileObjTest( const RString &path, RageFile &p ); int Read(void *buffer, size_t bytes); int Write(const void *buffer, size_t bytes); int Flush(); @@ -84,16 +84,16 @@ public: return pos; } RageFileObj *Copy( RageFile &p ) const; - CString GetDisplayPath() const { return path; } + RString GetDisplayPath() const { return path; } int GetFileSize() { return g_TestFile.size(); } private: - CString path; /* for Copy */ + RString path; /* for Copy */ int pos; }; -RageFileDriverTest::RageFileDriverTest( CString root_ ): +RageFileDriverTest::RageFileDriverTest( RString root_ ): RageFileDriver( new TestFilenameDB(root_) ), root(root_) { @@ -102,7 +102,7 @@ RageFileDriverTest::RageFileDriverTest( CString root_ ): } -RageFileObj *RageFileDriverTest::Open( const CString &path, int mode, RageFile &p, int &err ) +RageFileObj *RageFileDriverTest::Open( const RString &path, int mode, RageFile &p, int &err ) { if( path != g_TestFilename ) { @@ -123,7 +123,7 @@ RageFileObj *RageFileObjTest::Copy( RageFile &p ) const } static const unsigned int BUFSIZE = 1024*64; -RageFileObjTest::RageFileObjTest( const CString &path_, RageFile &p ): +RageFileObjTest::RageFileObjTest( const RString &path_, RageFile &p ): RageFileObj( p ) { path = path_; @@ -204,7 +204,7 @@ void SanityCheck() if( !test.Open("test/file", RageFile::READ ) ) Fail( "Sanity check Open() failed: %s", test.GetError().c_str() ); - CString str; + RString str; int got = test.GetLine( str ); if( got <= 0 ) Fail( "Sanity check GetLine(): got %i", got ); @@ -223,7 +223,7 @@ void SanityCheck() if( !test.Open("test/file", RageFile::READ ) ) Fail( "Sanity check 2 Open() failed: %s", test.GetError().c_str() ); - CString str; + RString str; int got = test.Read( str, 5 ); if( got != 5 ) Fail( "Sanity check 2 Read(): got %i", got ); @@ -278,7 +278,7 @@ void IniTest() if( !test.ReadFile( "test/file" ) ) Fail( "INI: ReadFile failed: %s", test.GetError().c_str() ); - CString sStr; + RString sStr; if( !test.GetValue( "test", "abc", sStr ) ) Fail( "INI: GetValue failed" ); if( sStr != "def" ) @@ -334,7 +334,7 @@ void MsdTest() Fail( "MSD: GetNumValues: expected 1, got %i", test.GetNumValues() ); if( test.GetNumParams(0) != 1 ) Fail( "MSD: GetNumParams(0): expected 1, got %i", test.GetNumParams(0) ); - CString sStr = test.GetValue(0)[0]; + RString sStr = test.GetValue(0)[0]; if( sStr != "FOO" ) Fail( "MSD: GetValue failed: expected \"FOO\", got \"%s\"", sStr.c_str() ); } while(false); diff --git a/stepmania/src/tests/test_file_readers.cpp b/stepmania/src/tests/test_file_readers.cpp index 4324a0c660..bca6d73a32 100644 --- a/stepmania/src/tests/test_file_readers.cpp +++ b/stepmania/src/tests/test_file_readers.cpp @@ -17,7 +17,7 @@ void CreateBinaryTestFile( RageFile &f, int size ) } } -void CreateBinaryTestFile( CString fn, int size ) +void CreateBinaryTestFile( RString fn, int size ) { RageFile f; f.Open( fn, RageFile::WRITE ); @@ -36,7 +36,7 @@ void CreateBinaryTestFile( CString fn, int size ) } -bool CheckData( const CString &buf, int offset ) +bool CheckData( const RString &buf, int offset ) { char c = offset%256; @@ -62,7 +62,7 @@ int TestBinaryRead( RageFile &test, int size, bool AllowEOF, int ExpectedFilePos return -1; } - if( !CheckData( CString(buf, ret), TestDataPos ) ) + if( !CheckData( RString(buf, ret), TestDataPos ) ) { LOG->Warn("TestBinaryRead: check failed (size %i, %i,%i)", size, ExpectedFilePos, TestDataPos ); @@ -77,14 +77,14 @@ int TestBinaryRead( RageFile &test, int size, bool AllowEOF, int ExpectedFilePos return 1; } -CString MakeTextTestLine( int line, int size ) +RString MakeTextTestLine( int line, int size ) { - CString ret = ssprintf( "%02i", line ); - ret.append( CString( size-ret.size(), 'x' ) ); + RString ret = ssprintf( "%02i", line ); + ret.append( RString( size-ret.size(), 'x' ) ); return ret; } -bool CheckTextData( const CString &buf, int LineSize, int size ) +bool CheckTextData( const RString &buf, int LineSize, int size ) { return buf == MakeTextTestLine( LineSize, size ); } @@ -93,7 +93,7 @@ void TestText( int LineSize, bool DOS ) { const unsigned NumLines = 50; - CString filename = "test.text"; + RString filename = "test.text"; if( DOS ) filename += ".DOS"; filename += ssprintf( ".%i", LineSize ); @@ -104,7 +104,7 @@ void TestText( int LineSize, bool DOS ) for( unsigned line = 0; line < NumLines; ++line ) { - const CString TestLine = MakeTextTestLine( line, LineSize ); + const RString TestLine = MakeTextTestLine( line, LineSize ); f.Write( TestLine ); if( DOS ) f.Write( "\r" ); @@ -130,7 +130,7 @@ void TestText( int LineSize, bool DOS ) int ExpectedPos = 0; for( unsigned line = 0; line < NumLines; ++line ) { - CString buf; + RString buf; if( test.GetLine( buf ) <= 0 ) { LOG->Warn("Text read failure, line %i, size %i, DOS %i", @@ -171,7 +171,7 @@ void TestText( int LineSize, bool DOS ) TestBinaryRead( test, 1024, true, test.Tell(), 1024*3 ); { - CString buf; + RString buf; if( test.GetLine( buf ) <= 0 ) { LOG->Warn( "Unexpected EOF in final line read, DOS %i", DOS ); @@ -192,7 +192,7 @@ void TestText( int LineSize, bool DOS ) } { - CString buf; + RString buf; if( test.GetLine( buf ) != 0 ) { LOG->Warn( "Expected EOF in final text read, but didn't get it" ); @@ -234,11 +234,11 @@ void TestText() void TestSeek( bool relative ) { - const CString TestLine = "Hello World\n"; + const RString TestLine = "Hello World\n"; /* Print a couple kb of text. Make sure this is big enough that the binary * test data after it won't start in the buffer; if that happens, the seek * will be optimized out. */ - CString junk; + RString junk; for( int lines = 0; lines < 128; ++lines ) junk += "XXXXXXXXX\n"; @@ -258,7 +258,7 @@ void TestSeek( bool relative ) * read into the buffer. */ RageFile test; test.Open("test.seek"); - CString line; + RString line; test.GetLine( line ); /* Run the absolute seek test twice. */ @@ -332,7 +332,7 @@ void CheckDeflate( RageFileObjMem &data, int iSize, unsigned iInputCRC, int iBlo { data.Seek(0); - CString foo2; + RString foo2; RageFileObjInflate infl( &data, iSize ); infl.EnableCRC32(); diff --git a/stepmania/src/tests/test_misc.cpp b/stepmania/src/tests/test_misc.cpp index e4111f541d..147b0fdafa 100644 --- a/stepmania/src/tests/test_misc.cpp +++ b/stepmania/src/tests/test_misc.cpp @@ -7,9 +7,9 @@ #include "arch/arch.h" #include "arch/ArchHooks/ArchHooks.h" -CString g_Driver = "dir", g_Root = "."; +RString g_Driver = "dir", g_Root = "."; -CString argv0; +RString argv0; void test_handle_args( int argc, char *argv[] ) {