mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-10-29 23:36:02 +03:00
Merge branch 'development' into feature/character
# Conflicts: # src/client/Client.cpp # src/console/Device.cpp # src/console/Line.cpp # src/console/Line.hpp # src/db/Db.cpp # src/db/Db.hpp # src/db/StaticDb.cpp # src/db/StaticDb.hpp # src/db/rec/Achievement_CategoryRec.cpp # src/db/rec/Achievement_CategoryRec.hpp # src/db/rec/Achievement_CriteriaRec.cpp # src/db/rec/Achievement_CriteriaRec.hpp # src/db/rec/AnimKitBoneSetAliasRec.cpp # src/db/rec/AnimKitBoneSetAliasRec.hpp # src/db/rec/AnimKitBoneSetRec.cpp # src/db/rec/AnimKitBoneSetRec.hpp # src/db/rec/AnimKitConfigBoneSetRec.cpp # src/db/rec/AnimKitConfigBoneSetRec.hpp # src/db/rec/AnimKitConfigRec.cpp # src/db/rec/AnimKitConfigRec.hpp # src/db/rec/AnimKitPriorityRec.cpp # src/db/rec/AnimKitPriorityRec.hpp # src/db/rec/AnimKitRec.cpp # src/db/rec/AnimKitRec.hpp # src/db/rec/AnimKitSegmentRec.cpp # src/db/rec/AnimKitSegmentRec.hpp # src/db/rec/AnimReplacementRec.cpp # src/db/rec/AnimReplacementRec.hpp # src/db/rec/AnimReplacementSetRec.cpp # src/db/rec/AnimReplacementSetRec.hpp # src/db/rec/AnimationDataRec.cpp # src/db/rec/AnimationDataRec.hpp # src/db/rec/AreaAssignmentRec.cpp # src/db/rec/AreaAssignmentRec.hpp # src/db/rec/AreaGroupRec.cpp # src/db/rec/AreaGroupRec.hpp # src/db/rec/AreaPOIRec.cpp # src/db/rec/AreaPOIRec.hpp # src/db/rec/AreaTableRec.cpp # src/db/rec/AreaTableRec.hpp # src/db/rec/AreaTriggerRec.cpp # src/db/rec/AreaTriggerRec.hpp # src/db/rec/ArmorLocationRec.cpp # src/db/rec/ArmorLocationRec.hpp # src/db/rec/AttackAnimKitsRec.cpp # src/db/rec/AttackAnimKitsRec.hpp # src/db/rec/AttackAnimTypesRec.cpp # src/db/rec/AttackAnimTypesRec.hpp # src/db/rec/AuctionHouseRec.cpp # src/db/rec/AuctionHouseRec.hpp # src/db/rec/BankBagSlotPricesRec.cpp # src/db/rec/BankBagSlotPricesRec.hpp # src/db/rec/BarberShopStyleRec.cpp # src/db/rec/BarberShopStyleRec.hpp # src/db/rec/BattlemasterListRec.cpp # src/db/rec/BattlemasterListRec.hpp # src/db/rec/CameraModeRec.cpp # src/db/rec/CameraModeRec.hpp # src/db/rec/CameraShakesRec.cpp # src/db/rec/CameraShakesRec.hpp # src/db/rec/CharBaseInfoRec.cpp # src/db/rec/CharBaseInfoRec.hpp # src/db/rec/CharHairGeosetsRec.cpp # src/db/rec/CharHairGeosetsRec.hpp # src/db/rec/CharHairTexturesRec.cpp # src/db/rec/CharHairTexturesRec.hpp # src/db/rec/CharSectionsRec.cpp # src/db/rec/CharSectionsRec.hpp # src/db/rec/CharStartOutfitRec.cpp # src/db/rec/CharStartOutfitRec.hpp # src/db/rec/CharTitlesRec.cpp # src/db/rec/CharTitlesRec.hpp # src/db/rec/CharVariationsRec.cpp # src/db/rec/CharVariationsRec.hpp # src/db/rec/CharacterFacialHairStylesRec.cpp # src/db/rec/CharacterFacialHairStylesRec.hpp # src/db/rec/ChatChannelsRec.cpp # src/db/rec/ChatChannelsRec.hpp # src/db/rec/ChatProfanityRec.cpp # src/db/rec/ChatProfanityRec.hpp # src/db/rec/ChrClassesRec.cpp # src/db/rec/ChrClassesRec.hpp # src/db/rec/CinematicCameraRec.cpp # src/db/rec/CinematicCameraRec.hpp # src/db/rec/CinematicSequencesRec.cpp # src/db/rec/CinematicSequencesRec.hpp # src/db/rec/CreatureDisplayInfoExtraRec.cpp # src/db/rec/CreatureDisplayInfoExtraRec.hpp # src/db/rec/CreatureDisplayInfoRec.cpp # src/db/rec/CreatureDisplayInfoRec.hpp # src/db/rec/CreatureFamilyRec.cpp # src/db/rec/CreatureFamilyRec.hpp # src/db/rec/CreatureModelDataRec.cpp # src/db/rec/CreatureModelDataRec.hpp # src/db/rec/CreatureMovementInfoRec.cpp # src/db/rec/CreatureMovementInfoRec.hpp # src/db/rec/CreatureSoundDataRec.cpp # src/db/rec/CreatureSoundDataRec.hpp # src/db/rec/CreatureSpellDataRec.cpp # src/db/rec/CreatureSpellDataRec.hpp # src/db/rec/CreatureTypeRec.cpp # src/db/rec/CreatureTypeRec.hpp # src/db/rec/CurrencyCategoryRec.cpp # src/db/rec/CurrencyCategoryRec.hpp # src/db/rec/CurrencyTypesRec.cpp # src/db/rec/CurrencyTypesRec.hpp # src/db/rec/DanceMovesRec.cpp # src/db/rec/DanceMovesRec.hpp # src/db/rec/DeathThudLookupsRec.cpp # src/db/rec/DeathThudLookupsRec.hpp # src/db/rec/DeclinedWordCasesRec.cpp # src/db/rec/DeclinedWordCasesRec.hpp # src/db/rec/DeclinedWordRec.cpp # src/db/rec/DeclinedWordRec.hpp # src/db/rec/DestructibleModelDataRec.cpp # src/db/rec/DestructibleModelDataRec.hpp # src/db/rec/DungeonEncounterRec.cpp # src/db/rec/DungeonEncounterRec.hpp # src/db/rec/DungeonMapChunkRec.cpp # src/db/rec/DungeonMapChunkRec.hpp # src/db/rec/DungeonMapRec.cpp # src/db/rec/DungeonMapRec.hpp # src/db/rec/DurabilityCostsRec.cpp # src/db/rec/DurabilityCostsRec.hpp # src/db/rec/DurabilityQualityRec.cpp # src/db/rec/DurabilityQualityRec.hpp # src/db/rec/EmotesRec.cpp # src/db/rec/EmotesRec.hpp # src/db/rec/EmotesTextDataRec.cpp # src/db/rec/EmotesTextDataRec.hpp # src/db/rec/EmotesTextRec.cpp # src/db/rec/EmotesTextRec.hpp # src/db/rec/EmotesTextSoundRec.cpp # src/db/rec/EmotesTextSoundRec.hpp # src/db/rec/EnvironmentalDamageRec.cpp # src/db/rec/EnvironmentalDamageRec.hpp # src/db/rec/ExhaustionRec.cpp # src/db/rec/ExhaustionRec.hpp # src/db/rec/FactionGroupRec.cpp # src/db/rec/FactionGroupRec.hpp # src/db/rec/FactionRec.cpp # src/db/rec/FactionRec.hpp # src/db/rec/FactionTemplateRec.cpp # src/db/rec/FactionTemplateRec.hpp # src/db/rec/FileDataRec.cpp # src/db/rec/FileDataRec.hpp # src/db/rec/FootprintTexturesRec.cpp # src/db/rec/FootprintTexturesRec.hpp # src/db/rec/FootstepTerrainLookupRec.cpp # src/db/rec/FootstepTerrainLookupRec.hpp # src/db/rec/GMSurveyAnswersRec.cpp # src/db/rec/GMSurveyAnswersRec.hpp # src/db/rec/GMSurveyCurrentSurveyRec.cpp # src/db/rec/GMSurveyCurrentSurveyRec.hpp # src/db/rec/GMSurveyQuestionsRec.cpp # src/db/rec/GMSurveyQuestionsRec.hpp # src/db/rec/GMSurveySurveysRec.cpp # src/db/rec/GMSurveySurveysRec.hpp # src/db/rec/GMTicketCategoryRec.cpp # src/db/rec/GMTicketCategoryRec.hpp # src/db/rec/GameObjectArtKitRec.cpp # src/db/rec/GameObjectArtKitRec.hpp # src/db/rec/GameObjectDisplayInfoRec.cpp # src/db/rec/GameObjectDisplayInfoRec.hpp # src/db/rec/GameTablesRec.cpp # src/db/rec/GameTablesRec.hpp # src/db/rec/GameTipsRec.cpp # src/db/rec/GameTipsRec.hpp # src/db/rec/GemPropertiesRec.cpp # src/db/rec/GemPropertiesRec.hpp # src/db/rec/GlueScreenEmoteRec.cpp # src/db/rec/GlueScreenEmoteRec.hpp # src/db/rec/GlyphPropertiesRec.cpp # src/db/rec/GlyphPropertiesRec.hpp # src/db/rec/GlyphSlotRec.cpp # src/db/rec/GlyphSlotRec.hpp # src/db/rec/GroundEffectDoodadRec.cpp # src/db/rec/GroundEffectDoodadRec.hpp # src/db/rec/GroundEffectTextureRec.cpp # src/db/rec/GroundEffectTextureRec.hpp # src/db/rec/GuildPerkSpellsRec.cpp # src/db/rec/GuildPerkSpellsRec.hpp # src/db/rec/HelmetGeosetVisDataRec.cpp # src/db/rec/HelmetGeosetVisDataRec.hpp # src/db/rec/HolidayDescriptionsRec.cpp # src/db/rec/HolidayDescriptionsRec.hpp # src/db/rec/HolidayNamesRec.cpp # src/db/rec/HolidayNamesRec.hpp # src/db/rec/HolidaysRec.cpp # src/db/rec/HolidaysRec.hpp # src/db/rec/ItemArmorQualityRec.cpp # src/db/rec/ItemArmorQualityRec.hpp # src/db/rec/ItemArmorShieldRec.cpp # src/db/rec/ItemArmorShieldRec.hpp # src/db/rec/ItemArmorTotalRec.cpp # src/db/rec/ItemArmorTotalRec.hpp # src/db/rec/ItemBagFamilyRec.cpp # src/db/rec/ItemBagFamilyRec.hpp # src/db/rec/ItemClassRec.cpp # src/db/rec/ItemClassRec.hpp # src/db/rec/ItemCondExtCostsRec.cpp # src/db/rec/ItemCondExtCostsRec.hpp # src/db/rec/ItemDamageAmmoRec.cpp # src/db/rec/ItemDamageAmmoRec.hpp # src/db/rec/ItemDamageOneHandCasterRec.cpp # src/db/rec/ItemDamageOneHandCasterRec.hpp # src/db/rec/ItemDamageOneHandRec.cpp # src/db/rec/ItemDamageOneHandRec.hpp # src/db/rec/ItemDamageRangedRec.cpp # src/db/rec/ItemDamageRangedRec.hpp # src/db/rec/ItemDamageThrownRec.cpp # src/db/rec/ItemDamageThrownRec.hpp # src/db/rec/ItemDamageTwoHandCasterRec.cpp # src/db/rec/ItemDamageTwoHandCasterRec.hpp # src/db/rec/ItemDamageTwoHandRec.cpp # src/db/rec/ItemDamageTwoHandRec.hpp # src/db/rec/ItemDamageWandRec.cpp # src/db/rec/ItemDamageWandRec.hpp # src/db/rec/ItemDisplayInfoRec.cpp # src/db/rec/ItemDisplayInfoRec.hpp # src/db/rec/ItemExtendedCostRec.cpp # src/db/rec/ItemExtendedCostRec.hpp # src/db/rec/ItemGroupSoundsRec.cpp # src/db/rec/ItemGroupSoundsRec.hpp # src/db/rec/ItemLimitCategoryRec.cpp # src/db/rec/ItemLimitCategoryRec.hpp # src/db/rec/ItemPetFoodRec.cpp # src/db/rec/ItemPetFoodRec.hpp # src/db/rec/ItemPurchaseGroupRec.cpp # src/db/rec/ItemPurchaseGroupRec.hpp # src/db/rec/ItemRandomPropertiesRec.cpp # src/db/rec/ItemRandomPropertiesRec.hpp # src/db/rec/ItemRandomSuffixRec.cpp # src/db/rec/ItemRandomSuffixRec.hpp # src/db/rec/ItemRec.cpp # src/db/rec/ItemRec.hpp # src/db/rec/ItemReforgeRec.cpp # src/db/rec/ItemReforgeRec.hpp # src/db/rec/ItemSetRec.cpp # src/db/rec/ItemSetRec.hpp # src/db/rec/ItemSubClassMaskRec.cpp # src/db/rec/ItemSubClassMaskRec.hpp # src/db/rec/ItemSubClassRec.cpp # src/db/rec/ItemSubClassRec.hpp # src/db/rec/ItemVisualEffectsRec.cpp # src/db/rec/ItemVisualEffectsRec.hpp # src/db/rec/ItemVisualsRec.cpp # src/db/rec/ItemVisualsRec.hpp # src/db/rec/LanguageWordsRec.cpp # src/db/rec/LanguageWordsRec.hpp # src/db/rec/LanguagesRec.cpp # src/db/rec/LanguagesRec.hpp # src/db/rec/LightFloatBandRec.cpp # src/db/rec/LightFloatBandRec.hpp # src/db/rec/LightIntBandRec.cpp # src/db/rec/LightIntBandRec.hpp # src/db/rec/LightParamsRec.cpp # src/db/rec/LightParamsRec.hpp # src/db/rec/LightRec.cpp # src/db/rec/LightRec.hpp # src/db/rec/LightSkyboxRec.cpp # src/db/rec/LightSkyboxRec.hpp # src/db/rec/LiquidMaterialRec.cpp # src/db/rec/LiquidMaterialRec.hpp # src/db/rec/LiquidObjectRec.cpp # src/db/rec/LiquidObjectRec.hpp # src/db/rec/LiquidTypeRec.cpp # src/db/rec/LiquidTypeRec.hpp # src/db/rec/LoadingScreenTaxiSplinesRec.cpp # src/db/rec/LoadingScreenTaxiSplinesRec.hpp # src/db/rec/LoadingScreensRec.cpp # src/db/rec/LoadingScreensRec.hpp # src/db/rec/LockRec.cpp # src/db/rec/LockRec.hpp # src/db/rec/LockTypeRec.cpp # src/db/rec/LockTypeRec.hpp # src/db/rec/MailTemplateRec.cpp # src/db/rec/MailTemplateRec.hpp # src/db/rec/MapDifficultyRec.cpp # src/db/rec/MapDifficultyRec.hpp # src/db/rec/MapRec.cpp # src/db/rec/MapRec.hpp # src/db/rec/MaterialRec.cpp # src/db/rec/MaterialRec.hpp # src/db/rec/MountTypeRec.cpp # src/db/rec/MountTypeRec.hpp # src/db/rec/MovieFileDataRec.cpp # src/db/rec/MovieFileDataRec.hpp # src/db/rec/MovieRec.cpp # src/db/rec/MovieRec.hpp # src/db/rec/MovieVariationRec.cpp # src/db/rec/MovieVariationRec.hpp # src/db/rec/NPCSoundsRec.cpp # src/db/rec/NPCSoundsRec.hpp # src/db/rec/NameGenRec.cpp # src/db/rec/NameGenRec.hpp # src/db/rec/NamesProfanityRec.cpp # src/db/rec/NamesProfanityRec.hpp # src/db/rec/NamesReservedRec.cpp # src/db/rec/NamesReservedRec.hpp # src/db/rec/ObjectEffectGroupRec.cpp # src/db/rec/ObjectEffectGroupRec.hpp # src/db/rec/ObjectEffectModifierRec.cpp # src/db/rec/ObjectEffectModifierRec.hpp # src/db/rec/ObjectEffectPackageElemRec.cpp # src/db/rec/ObjectEffectPackageElemRec.hpp # src/db/rec/ObjectEffectPackageRec.cpp # src/db/rec/ObjectEffectPackageRec.hpp # src/db/rec/ObjectEffectRec.cpp # src/db/rec/ObjectEffectRec.hpp # src/db/rec/OverrideSpellDataRec.cpp # src/db/rec/OverrideSpellDataRec.hpp # src/db/rec/PackageRec.cpp # src/db/rec/PackageRec.hpp # src/db/rec/PageTextMaterialRec.cpp # src/db/rec/PageTextMaterialRec.hpp # src/db/rec/PaperDollItemFrameRec.cpp # src/db/rec/PaperDollItemFrameRec.hpp # src/db/rec/ParticleColorRec.cpp # src/db/rec/ParticleColorRec.hpp # src/db/rec/PetPersonalityRec.cpp # src/db/rec/PetPersonalityRec.hpp # src/db/rec/PetitionTypeRec.cpp # src/db/rec/PetitionTypeRec.hpp # src/db/rec/PhaseRec.cpp # src/db/rec/PhaseRec.hpp # src/db/rec/PhaseShiftZoneSoundsRec.cpp # src/db/rec/PhaseShiftZoneSoundsRec.hpp # src/db/rec/PhaseXPhaseGroupRec.cpp # src/db/rec/PhaseXPhaseGroupRec.hpp # src/db/rec/PowerDisplayRec.cpp # src/db/rec/PowerDisplayRec.hpp # src/db/rec/QuestFactionRewardRec.cpp # src/db/rec/QuestFactionRewardRec.hpp # src/db/rec/QuestInfoRec.cpp # src/db/rec/QuestInfoRec.hpp # src/db/rec/QuestSortRec.cpp # src/db/rec/QuestSortRec.hpp # src/db/rec/QuestXPRec.cpp # src/db/rec/QuestXPRec.hpp # src/db/rec/RandPropPointsRec.cpp # src/db/rec/RandPropPointsRec.hpp # src/db/rec/ResearchBranchRec.cpp # src/db/rec/ResearchBranchRec.hpp # src/db/rec/ResistancesRec.cpp # src/db/rec/ResistancesRec.hpp # src/db/rec/ScalingStatDistributionRec.cpp # src/db/rec/ScalingStatDistributionRec.hpp # src/db/rec/ScalingStatValuesRec.cpp # src/db/rec/ScalingStatValuesRec.hpp # src/db/rec/ScreenEffectRec.cpp # src/db/rec/ScreenEffectRec.hpp # src/db/rec/ServerMessagesRec.cpp # src/db/rec/ServerMessagesRec.hpp # src/db/rec/SheatheSoundLookupsRec.cpp # src/db/rec/SheatheSoundLookupsRec.hpp # src/db/rec/SkillCostsDataRec.cpp # src/db/rec/SkillCostsDataRec.hpp # src/db/rec/SkillLineAbilityRec.cpp # src/db/rec/SkillLineAbilityRec.hpp # src/db/rec/SkillLineCategoryRec.cpp # src/db/rec/SkillLineCategoryRec.hpp # src/db/rec/SkillLineRec.cpp # src/db/rec/SkillLineRec.hpp # src/db/rec/SkillRaceClassInfoRec.cpp # src/db/rec/SkillRaceClassInfoRec.hpp # src/db/rec/SkillTiersRec.cpp # src/db/rec/SkillTiersRec.hpp # src/db/rec/SoundAmbienceRec.cpp # src/db/rec/SoundAmbienceRec.hpp # src/db/rec/SoundEmittersRec.cpp # src/db/rec/SoundEmittersRec.hpp # src/db/rec/SoundEntriesAdvancedRec.cpp # src/db/rec/SoundEntriesAdvancedRec.hpp # src/db/rec/SoundEntriesRec.cpp # src/db/rec/SoundEntriesRec.hpp # src/db/rec/SoundFilterElemRec.cpp # src/db/rec/SoundFilterElemRec.hpp # src/db/rec/SoundFilterRec.cpp # src/db/rec/SoundFilterRec.hpp # src/db/rec/SoundProviderPreferencesRec.cpp # src/db/rec/SoundProviderPreferencesRec.hpp # src/db/rec/SoundSamplePreferencesRec.cpp # src/db/rec/SoundSamplePreferencesRec.hpp # src/db/rec/SoundWaterTypeRec.cpp # src/db/rec/SoundWaterTypeRec.hpp # src/db/rec/SpamMessagesRec.cpp # src/db/rec/SpamMessagesRec.hpp # src/db/rec/SpellAuraOptionsRec.cpp # src/db/rec/SpellAuraOptionsRec.hpp # src/db/rec/SpellAuraRestrictionsRec.cpp # src/db/rec/SpellAuraRestrictionsRec.hpp # src/db/rec/SpellCastTimesRec.cpp # src/db/rec/SpellCastTimesRec.hpp # src/db/rec/SpellCastingRequirementsRec.cpp # src/db/rec/SpellCastingRequirementsRec.hpp # src/db/rec/SpellCategoriesRec.cpp # src/db/rec/SpellCategoriesRec.hpp # src/db/rec/SpellCategoryRec.cpp # src/db/rec/SpellCategoryRec.hpp # src/db/rec/SpellChainEffectsRec.cpp # src/db/rec/SpellChainEffectsRec.hpp # src/db/rec/SpellClassOptionsRec.cpp # src/db/rec/SpellClassOptionsRec.hpp # src/db/rec/SpellCooldownsRec.cpp # src/db/rec/SpellCooldownsRec.hpp # src/db/rec/SpellDescriptionVariablesRec.cpp # src/db/rec/SpellDescriptionVariablesRec.hpp # src/db/rec/SpellDifficultyRec.cpp # src/db/rec/SpellDifficultyRec.hpp # src/db/rec/SpellDispelTypeRec.cpp # src/db/rec/SpellDispelTypeRec.hpp # src/db/rec/SpellDurationRec.cpp # src/db/rec/SpellDurationRec.hpp # src/db/rec/SpellEffectCameraShakesRec.cpp # src/db/rec/SpellEffectCameraShakesRec.hpp # src/db/rec/SpellEffectRec.cpp # src/db/rec/SpellEffectRec.hpp # src/db/rec/SpellEquippedItemsRec.cpp # src/db/rec/SpellEquippedItemsRec.hpp # src/db/rec/SpellFocusObjectRec.cpp # src/db/rec/SpellFocusObjectRec.hpp # src/db/rec/SpellIconRec.cpp # src/db/rec/SpellIconRec.hpp # src/db/rec/SpellInterruptsRec.cpp # src/db/rec/SpellInterruptsRec.hpp # src/db/rec/SpellItemEnchantmentConditionRec.cpp # src/db/rec/SpellItemEnchantmentConditionRec.hpp # src/db/rec/SpellItemEnchantmentRec.cpp # src/db/rec/SpellItemEnchantmentRec.hpp # src/db/rec/SpellLevelsRec.cpp # src/db/rec/SpellLevelsRec.hpp # src/db/rec/SpellMechanicRec.cpp # src/db/rec/SpellMechanicRec.hpp # src/db/rec/SpellMissileMotionRec.cpp # src/db/rec/SpellMissileMotionRec.hpp # src/db/rec/SpellMissileRec.cpp # src/db/rec/SpellMissileRec.hpp # src/db/rec/SpellPowerRec.cpp # src/db/rec/SpellPowerRec.hpp # src/db/rec/SpellRadiusRec.cpp # src/db/rec/SpellRadiusRec.hpp # src/db/rec/SpellRangeRec.cpp # src/db/rec/SpellRangeRec.hpp # src/db/rec/SpellReagentsRec.cpp # src/db/rec/SpellReagentsRec.hpp # src/db/rec/SpellRec.cpp # src/db/rec/SpellRec.hpp # src/db/rec/SpellRuneCostRec.cpp # src/db/rec/SpellRuneCostRec.hpp # src/db/rec/SpellScalingRec.cpp # src/db/rec/SpellScalingRec.hpp # src/db/rec/SpellShapeshiftFormRec.cpp # src/db/rec/SpellShapeshiftFormRec.hpp # src/db/rec/SpellShapeshiftRec.cpp # src/db/rec/SpellShapeshiftRec.hpp # src/db/rec/SpellTargetRestrictionsRec.cpp # src/db/rec/SpellTargetRestrictionsRec.hpp # src/db/rec/SpellTotemsRec.cpp # src/db/rec/SpellTotemsRec.hpp # src/db/rec/SpellVisualEffectNameRec.cpp # src/db/rec/SpellVisualEffectNameRec.hpp # src/db/rec/SpellVisualKitAreaModelRec.cpp # src/db/rec/SpellVisualKitAreaModelRec.hpp # src/db/rec/SpellVisualKitModelAttachRec.cpp # src/db/rec/SpellVisualKitModelAttachRec.hpp # src/db/rec/SpellVisualKitRec.cpp # src/db/rec/SpellVisualKitRec.hpp # src/db/rec/SpellVisualPrecastTransitionsRec.cpp # src/db/rec/SpellVisualPrecastTransitionsRec.hpp # src/db/rec/SpellVisualRec.cpp # src/db/rec/SpellVisualRec.hpp # src/db/rec/StableSlotPricesRec.cpp # src/db/rec/StableSlotPricesRec.hpp # src/db/rec/Startup_StringsRec.cpp # src/db/rec/Startup_StringsRec.hpp # src/db/rec/StationeryRec.cpp # src/db/rec/StationeryRec.hpp # src/db/rec/StringLookupsRec.cpp # src/db/rec/StringLookupsRec.hpp # src/db/rec/SummonPropertiesRec.cpp # src/db/rec/SummonPropertiesRec.hpp # src/db/rec/TalentRec.cpp # src/db/rec/TalentRec.hpp # src/db/rec/TalentTabRec.cpp # src/db/rec/TalentTabRec.hpp # src/db/rec/TaxiNodesRec.cpp # src/db/rec/TaxiNodesRec.hpp # src/db/rec/TaxiPathNodeRec.cpp # src/db/rec/TaxiPathNodeRec.hpp # src/db/rec/TaxiPathRec.cpp # src/db/rec/TaxiPathRec.hpp # src/db/rec/TeamContributionPointsRec.cpp # src/db/rec/TeamContributionPointsRec.hpp # src/db/rec/TerrainMaterialRec.cpp # src/db/rec/TerrainMaterialRec.hpp # src/db/rec/TerrainTypeRec.cpp # src/db/rec/TerrainTypeRec.hpp # src/db/rec/TerrainTypeSoundsRec.cpp # src/db/rec/TerrainTypeSoundsRec.hpp # src/db/rec/TotemCategoryRec.cpp # src/db/rec/TotemCategoryRec.hpp # src/db/rec/TransportAnimationRec.cpp # src/db/rec/TransportAnimationRec.hpp # src/db/rec/TransportPhysicsRec.cpp # src/db/rec/TransportPhysicsRec.hpp # src/db/rec/TransportRotationRec.cpp # src/db/rec/TransportRotationRec.hpp # src/db/rec/UISoundLookupsRec.cpp # src/db/rec/UISoundLookupsRec.hpp # src/db/rec/UnitBloodLevelsRec.cpp # src/db/rec/UnitBloodLevelsRec.hpp # src/db/rec/UnitBloodRec.cpp # src/db/rec/UnitBloodRec.hpp # src/db/rec/VehicleRec.cpp # src/db/rec/VehicleRec.hpp # src/db/rec/VehicleSeatRec.cpp # src/db/rec/VehicleSeatRec.hpp # src/db/rec/VehicleUIIndSeatRec.cpp # src/db/rec/VehicleUIIndSeatRec.hpp # src/db/rec/VehicleUIIndicatorRec.cpp # src/db/rec/VehicleUIIndicatorRec.hpp # src/db/rec/VideoHardwareRec.cpp # src/db/rec/VideoHardwareRec.hpp # src/db/rec/VocalUISoundsRec.cpp # src/db/rec/VocalUISoundsRec.hpp # src/db/rec/WMOAreaTableRec.cpp # src/db/rec/WMOAreaTableRec.hpp # src/db/rec/WeaponImpactSoundsRec.cpp # src/db/rec/WeaponImpactSoundsRec.hpp # src/db/rec/WeaponSwingSounds2Rec.cpp # src/db/rec/WeaponSwingSounds2Rec.hpp # src/db/rec/WeatherRec.cpp # src/db/rec/WeatherRec.hpp # src/db/rec/WorldChunkSoundsRec.cpp # src/db/rec/WorldChunkSoundsRec.hpp # src/db/rec/WorldMapAreaRec.cpp # src/db/rec/WorldMapAreaRec.hpp # src/db/rec/WorldMapContinentRec.cpp # src/db/rec/WorldMapContinentRec.hpp # src/db/rec/WorldMapOverlayRec.cpp # src/db/rec/WorldMapOverlayRec.hpp # src/db/rec/WorldMapTransformsRec.cpp # src/db/rec/WorldMapTransformsRec.hpp # src/db/rec/WorldSafeLocsRec.cpp # src/db/rec/WorldSafeLocsRec.hpp # src/db/rec/WorldStateUIRec.cpp # src/db/rec/WorldStateUIRec.hpp # src/db/rec/WorldStateZoneSoundsRec.cpp # src/db/rec/WorldStateZoneSoundsRec.hpp # src/db/rec/WowError_StringsRec.cpp # src/db/rec/WowError_StringsRec.hpp # src/db/rec/ZoneIntroMusicTableRec.cpp # src/db/rec/ZoneIntroMusicTableRec.hpp # src/db/rec/ZoneLightPointRec.cpp # src/db/rec/ZoneLightPointRec.hpp # src/db/rec/ZoneLightRec.cpp # src/db/rec/ZoneLightRec.hpp # src/db/rec/ZoneMusicRec.cpp # src/db/rec/ZoneMusicRec.hpp # src/db/rec/gtBarberShopCostBaseRec.cpp # src/db/rec/gtBarberShopCostBaseRec.hpp # src/db/rec/gtChanceToMeleeCritBaseRec.cpp # src/db/rec/gtChanceToMeleeCritBaseRec.hpp # src/db/rec/gtChanceToMeleeCritRec.cpp # src/db/rec/gtChanceToMeleeCritRec.hpp # src/db/rec/gtChanceToSpellCritBaseRec.cpp # src/db/rec/gtChanceToSpellCritBaseRec.hpp # src/db/rec/gtChanceToSpellCritRec.cpp # src/db/rec/gtChanceToSpellCritRec.hpp # src/db/rec/gtCombatRatingsRec.cpp # src/db/rec/gtCombatRatingsRec.hpp # src/db/rec/gtNPCManaCostScalerRec.cpp # src/db/rec/gtNPCManaCostScalerRec.hpp # src/db/rec/gtOCTClassCombatRatingScalarRec.cpp # src/db/rec/gtOCTClassCombatRatingScalarRec.hpp # src/db/rec/gtOCTRegenHPRec.cpp # src/db/rec/gtOCTRegenHPRec.hpp # src/db/rec/gtOCTRegenMPRec.cpp # src/db/rec/gtOCTRegenMPRec.hpp # src/db/rec/gtRegenHPPerSptRec.cpp # src/db/rec/gtRegenHPPerSptRec.hpp # src/db/rec/gtRegenMPPerSptRec.cpp # src/db/rec/gtRegenMPPerSptRec.hpp # src/db/rec/gtSpellScalingRec.cpp # src/db/rec/gtSpellScalingRec.hpp # src/gx/CGxDevice.cpp # src/gx/Device.cpp # src/gx/Device.hpp # src/gx/d3d/CGxDeviceD3d.cpp # src/ui/FrameScript.cpp
This commit is contained in:
commit
fc11867aaf
@ -30,6 +30,18 @@ include(lib/system/cmake/system.cmake)
|
||||
|
||||
# Build options
|
||||
|
||||
set(WHOA_VERSION_BUILD 12340)
|
||||
set(WHOA_VERSION_MAJOR 3)
|
||||
set(WHOA_VERSION_MINOR 3)
|
||||
set(WHOA_VERSION_PATCH 5)
|
||||
set(WHOA_VERSION_HOTFIX a)
|
||||
|
||||
add_definitions(-DWHOA_VERSION_BUILD="${WHOA_VERSION_BUILD}")
|
||||
add_definitions(-DWHOA_VERSION_MAJOR="${WHOA_VERSION_MAJOR}")
|
||||
add_definitions(-DWHOA_VERSION_MINOR="${WHOA_VERSION_MINOR}")
|
||||
add_definitions(-DWHOA_VERSION_PATCH="${WHOA_VERSION_PATCH}")
|
||||
add_definitions(-DWHOA_VERSION_HOTFIX="${WHOA_VERSION_HOTFIX}")
|
||||
|
||||
# UBsan
|
||||
set(WHOA_UB_SAN_HELP_TEXT "Disable/Enable the Undefined Behavior Sanitizer. This is turned on by default in Debug build types. Has no effect when using MSVC.")
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit 9a3b3aeafd7e48194d0a5a3fbe459b965f5d12fa
|
||||
Subproject commit 7fa49919037fe35eae3ff7908dbe00b56cfac212
|
||||
@ -1 +1 @@
|
||||
Subproject commit af834cafa755de27a87b3400adb89b205e567166
|
||||
Subproject commit 12ab8f77215e07fc0e505b56760536883276d2cb
|
||||
@ -1 +1 @@
|
||||
Subproject commit 328613d0e8ebc0ed46af63a1248d213be4fbf601
|
||||
Subproject commit 2e824bfdc3e4a97057751d4ff7403d08de39745f
|
||||
@ -12,6 +12,7 @@ add_subdirectory(gx)
|
||||
add_subdirectory(math)
|
||||
add_subdirectory(model)
|
||||
add_subdirectory(net)
|
||||
add_subdirectory(os)
|
||||
add_subdirectory(sound)
|
||||
add_subdirectory(ui)
|
||||
add_subdirectory(util)
|
||||
|
||||
@ -8,7 +8,9 @@
|
||||
#include "console/Device.hpp"
|
||||
#include "console/Screen.hpp"
|
||||
#include "console/Command.hpp"
|
||||
#include "console/Console.hpp"
|
||||
#include "db/Db.hpp"
|
||||
#include "db/Startup_Strings.hpp"
|
||||
#include "glue/CGlueMgr.hpp"
|
||||
#include "gameui/CGGameUI.hpp"
|
||||
#include "gx/Screen.hpp"
|
||||
@ -22,10 +24,14 @@
|
||||
#include <bc/Debug.hpp>
|
||||
#include <common/Prop.hpp>
|
||||
#include <common/Time.hpp>
|
||||
#include <common/Processor.hpp>
|
||||
#include <storm/Error.hpp>
|
||||
#include <storm/Log.hpp>
|
||||
#include <storm/Registry.hpp>
|
||||
#include <storm/Option.hpp>
|
||||
#include <bc/os/Path.hpp>
|
||||
#include <bc/File.hpp>
|
||||
#include <cstdio>
|
||||
|
||||
CVar* Client::g_accountNameVar;
|
||||
CVar* Client::g_accountListVar;
|
||||
@ -40,13 +46,14 @@ HEVENTCONTEXT Client::g_clientEventContext;
|
||||
char Client::g_currentLocaleName[5] = {};
|
||||
|
||||
|
||||
static uint8_t s_expansionLevel = 0;
|
||||
static bool g_hasIsoLocale[12] = {};
|
||||
static char* s_localeArray[12] = {
|
||||
static uint8_t s_expansionLevel;
|
||||
static bool g_hasIsoLocale[12];
|
||||
static const char* s_localeArray[12] = {
|
||||
"deDE", "enGB", "enUS", "esES", "frFR", "koKR",
|
||||
"zhCN", "zhTW", "enCN", "enTW", "esMX", "ruRU"
|
||||
};
|
||||
|
||||
static int32_t s_timeTestError;
|
||||
|
||||
int32_t CCommand_ReloadUI(const char*, const char*) {
|
||||
CGlueMgr::m_reload = 1;
|
||||
@ -58,6 +65,21 @@ int32_t CCommand_Perf(const char*, const char*) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if defined(WHOA_SYSTEM_WIN)
|
||||
|
||||
int32_t CCommand_TimingInfo(const char* command, const char* arguments) {
|
||||
auto desiredTimingMethod = static_cast<TimingMethod>(CVar::LookupRegistered("timingMethod")->GetInt());
|
||||
auto timingTestError = CVar::LookupRegistered("timingTestError")->GetInt();
|
||||
auto selectedTimingMethod = OsTimeGetTimingMethod();
|
||||
|
||||
ConsolePrintf("Timing method desired: %d - %s", desiredTimingMethod, OsTimeGetTimingMethodName(desiredTimingMethod));
|
||||
ConsolePrintf("Timing method selected: %d - %s", selectedTimingMethod, OsTimeGetTimingMethodName(selectedTimingMethod));
|
||||
|
||||
ConsolePrintf("Timing test error: %d", timingTestError);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void AsyncFileInitialize() {
|
||||
// TODO
|
||||
@ -73,19 +95,90 @@ void ClientMiscInitialize() {
|
||||
}
|
||||
|
||||
void ClientRegisterConsoleCommands() {
|
||||
ConsoleCommandRegister("reloadUI", &CCommand_ReloadUI, CATEGORY::GRAPHICS, nullptr);
|
||||
ConsoleCommandRegister("perf", &CCommand_Perf, CATEGORY::DEBUG, nullptr);
|
||||
ConsoleCommandRegister("reloadUI", CCommand_ReloadUI, GRAPHICS, nullptr);
|
||||
ConsoleCommandRegister("perf", CCommand_Perf, DEBUG, nullptr);
|
||||
|
||||
const auto game = CATEGORY::GAME;
|
||||
Client::g_accountNameVar = CVar::Register(
|
||||
"accountName",
|
||||
"Saved account name",
|
||||
64,
|
||||
"",
|
||||
nullptr,
|
||||
GAME,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
Client::g_accountNameVar = CVar::Register("accountName", "Saved account name", 64, "", nullptr, game);
|
||||
Client::g_accountListVar = CVar::Register("accountList", "List of wow accounts for saved Blizzard account", 0, "", nullptr, game);
|
||||
Client::g_accountUsesTokenVar = CVar::Register("g_accountUsesToken", "Saved whether uses authenticator", 0, "0", nullptr, game);
|
||||
Client::g_movieVar = CVar::Register("movie", "Show movie on startup", 0, "1", nullptr, game);
|
||||
Client::g_expansionMovieVar = CVar::Register("expansionMovie", "Show expansion movie on startup", 0, "1", nullptr, game);
|
||||
Client::g_movieSubtitleVar = CVar::Register("movieSubtitle", "Show movie subtitles", 0, "0", nullptr, game);
|
||||
Client::g_lastCharacterIndex = CVar::Register("lastCharacterIndex", "Last character selected", 0, "0", nullptr, game);
|
||||
Client::g_accountListVar = CVar::Register(
|
||||
"accountList",
|
||||
"List of wow accounts for saved Blizzard account",
|
||||
0,
|
||||
"",
|
||||
nullptr,
|
||||
GAME,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
Client::g_accountUsesTokenVar = CVar::Register(
|
||||
"g_accountUsesToken",
|
||||
"Saved whether uses authenticator",
|
||||
0,
|
||||
"0",
|
||||
nullptr,
|
||||
GAME,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
Client::g_movieVar = CVar::Register(
|
||||
"movie",
|
||||
"Show movie on startup",
|
||||
0,
|
||||
"1",
|
||||
nullptr,
|
||||
GAME,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
Client::g_expansionMovieVar = CVar::Register(
|
||||
"expansionMovie",
|
||||
"Show expansion movie on startup",
|
||||
0,
|
||||
"1",
|
||||
nullptr,
|
||||
GAME,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
Client::g_movieSubtitleVar = CVar::Register(
|
||||
"movieSubtitle",
|
||||
"Show movie subtitles",
|
||||
0,
|
||||
"0",
|
||||
nullptr,
|
||||
GAME,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
Client::g_lastCharacterIndex = CVar::Register(
|
||||
"lastCharacterIndex",
|
||||
"Last character selected",
|
||||
0,
|
||||
"0",
|
||||
nullptr,
|
||||
GAME,
|
||||
false,
|
||||
nullptr,
|
||||
false);
|
||||
// TODO
|
||||
}
|
||||
|
||||
@ -96,7 +189,6 @@ void ClientPostClose(int32_t a1) {
|
||||
|
||||
int32_t DestroyEngineCallback(const void* a1, void* a2) {
|
||||
// TODO
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -318,6 +410,34 @@ bool LocaleChangedCallback(CVar*, const char*, const char* value, void*) {
|
||||
return true;
|
||||
}
|
||||
|
||||
#if defined(WHOA_SYSTEM_WIN)
|
||||
|
||||
bool TimingMethodCallback(CVar* h, const char* oldValue, const char* newValue, void* param) {
|
||||
auto cv = static_cast<CVar*>(param);
|
||||
auto newMethod = static_cast<TimingMethod>(atol(newValue));
|
||||
if (newMethod < TimingMethods) {
|
||||
if (oldValue) {
|
||||
auto oldMethod = static_cast<TimingMethod>(atol(oldValue));
|
||||
if ((newMethod != oldMethod) && cv->GetInt()) {
|
||||
cv->SetReadOnly(false);
|
||||
cv->Set("0", true, false, false, true);
|
||||
cv->SetReadOnly(true);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
ConsolePrintf("\'%s\' is not a valid timing method. Valid methods are:", newValue);
|
||||
auto method = Timing_BestAvailable;
|
||||
while (method < TimingMethods) {
|
||||
ConsolePrintf(" %d - %s", method, OsTimeGetTimingMethodName(method));
|
||||
method = static_cast<TimingMethod>(static_cast<int32_t>(method) + 1);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int32_t InitializeGlobal() {
|
||||
ProcessCommandLine();
|
||||
SetPaths();
|
||||
@ -445,68 +565,55 @@ int32_t InitializeGlobal() {
|
||||
|
||||
EventInitialize(1, 0);
|
||||
|
||||
// CVar* v6 = CVar::Register(
|
||||
// "timingTestError",
|
||||
// "Error reported by the timing validation system",
|
||||
// 6,
|
||||
// "0",
|
||||
// 0,
|
||||
// 5,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0
|
||||
// );
|
||||
// v7 = v6;
|
||||
#if defined(WHOA_SYSTEM_WIN)
|
||||
|
||||
// CVar* v8 = CVar::Register(
|
||||
// "timingMethod",
|
||||
// "Desired method for game timing",
|
||||
// 2,
|
||||
// "0",
|
||||
// &sub_403200,
|
||||
// 5,
|
||||
// 0,
|
||||
// v6,
|
||||
// 0
|
||||
// );
|
||||
auto cvTimingTestError = CVar::Register(
|
||||
"timingTestError",
|
||||
"Error reported by the timing validation system",
|
||||
0x2 | 0x4,
|
||||
"0",
|
||||
0,
|
||||
DEFAULT,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
auto cvTimingMethod = CVar::Register(
|
||||
"timingMethod",
|
||||
"Desired method for game timing",
|
||||
0x2,
|
||||
"0",
|
||||
TimingMethodCallback,
|
||||
DEFAULT,
|
||||
false,
|
||||
cvTimingTestError,
|
||||
false
|
||||
);
|
||||
OsTimeStartup(static_cast<TimingMethod>(cvTimingMethod->GetInt()));
|
||||
ConsoleCommandRegister("timingInfo", CCommand_TimingInfo, DEBUG, nullptr);
|
||||
s_timeTestError = OsTimeGetTestError();
|
||||
if (s_timeTestError != cvTimingTestError->GetInt()) {
|
||||
char value[16];
|
||||
sprintf(value, "%d", s_timeTestError);
|
||||
cvTimingTestError->SetReadOnly(false);
|
||||
cvTimingTestError->Set(value, true, false, false, true);
|
||||
cvTimingTestError->Update();
|
||||
cvTimingTestError->SetReadOnly(true);
|
||||
ConsolePrintf("Timing test error: %d", s_timeTestError);
|
||||
}
|
||||
|
||||
// sub_86D430(v8->m_intValue);
|
||||
OsTimeStartup(Timing_QueryPerformanceCounter);
|
||||
#else
|
||||
|
||||
// ConsoleCommandRegister("timingInfo", (int)sub_4032A0, 0, 0);
|
||||
OsTimeStartup(Timing_BestAvailable);
|
||||
|
||||
// v9 = sub_86AD50();
|
||||
#endif
|
||||
|
||||
// v10 = v9 == v7->m_intValue;
|
||||
|
||||
// dword_B2F9D8 = v9;
|
||||
|
||||
// if (!v10) {
|
||||
// sprintf(&v17, "%d", v9);
|
||||
// CVar::SetReadOnly((int)v7, 0);
|
||||
// CVar::Set(v7, &v17, 1, 0, 0, 1);
|
||||
// CVar::Update((int)v7);
|
||||
// CVar::SetReadOnly((int)v7, 1);
|
||||
// ConsolePrintf("Timing test error: %d", (int)v7);
|
||||
// }
|
||||
|
||||
// WowClientDB<Startup_StringsRec>::Load(&g_Startup_StringsDB, 0, ".\\Client.cpp", 0x12E3u);
|
||||
// Startup_StringsRec* v11 = g_Startup_StringsDB.GetRecordByIndex(1);
|
||||
// const char* v12;
|
||||
|
||||
// if (v11) {
|
||||
// v12 = v11->m_text;
|
||||
// } else {
|
||||
// v12 = "World of Warcraft";
|
||||
// }
|
||||
|
||||
// TODO
|
||||
// - replace with above logic for loading from Startup_Strings.dbc
|
||||
const char* v12 = "World of Warcraft";
|
||||
g_Startup_StringsDB.Load(__FILE__, __LINE__);
|
||||
|
||||
auto titleRecord = g_Startup_StringsDB.GetRecord(MSG_TITLE_WOW);
|
||||
auto title = titleRecord ? titleRecord->m_message : "World of Warcraft";
|
||||
char v15[260];
|
||||
|
||||
SStrCopy(v15, v12, 0x7FFFFFFF);
|
||||
SStrCopy(v15, title, 0x7FFFFFFF);
|
||||
|
||||
ConsoleDeviceInitialize(v15);
|
||||
|
||||
@ -526,24 +633,48 @@ int32_t InitializeGlobal() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
void DestroyGlobal() {
|
||||
// TODO
|
||||
|
||||
OsTimeShutdown();
|
||||
EventDestroy();
|
||||
ConsoleDeviceDestroy();
|
||||
CVar::Destroy();
|
||||
|
||||
// TODO
|
||||
}
|
||||
|
||||
void StormDestroy() {
|
||||
// TODO
|
||||
|
||||
SRegDestroy();
|
||||
}
|
||||
|
||||
void CommonMain() {
|
||||
StormInitialize();
|
||||
|
||||
// TODO:
|
||||
// SErrCatchUnhandledExceptions();
|
||||
// OsSystemInitialize("Blizzard Entertainment World of Warcraft", 0);
|
||||
// int option = 1;
|
||||
// StormSetOption(10, &option, sizeof(option));
|
||||
// StormSetOption(11, &option, sizeof(option));
|
||||
// OsSystemEnableCpuLog();
|
||||
int32_t option = 1;
|
||||
StormSetOption(10, &option, sizeof(option));
|
||||
StormSetOption(11, &option, sizeof(option));
|
||||
|
||||
// QoL: enable debug logs
|
||||
#if !defined(NDEBUG)
|
||||
option = 1;
|
||||
StormSetOption(5, &option, sizeof(option));
|
||||
#endif
|
||||
|
||||
OsSystemEnableCpuLog();
|
||||
|
||||
// SetPaths() moved into InitializeGlobal()
|
||||
|
||||
// int sendErrorLogs = 1;
|
||||
// if (!SRegLoadValue("World of Warcraft\\Client", "SendErrorLogs", 0, &sendErrorLogs)) {
|
||||
// sendErrorLogs = 1;
|
||||
// SRegSaveValue("World of Warcraft\\Client", "SendErrorLogs", 0, sendErrorLogs);
|
||||
// }
|
||||
uint32_t sendErrorLogs = 1;
|
||||
if (!SRegLoadValue("World of Warcraft\\Client", "SendErrorLogs", 0, &sendErrorLogs)) {
|
||||
sendErrorLogs = 1;
|
||||
SRegSaveValue("World of Warcraft\\Client", "SendErrorLogs", 0, sendErrorLogs);
|
||||
}
|
||||
|
||||
// SErrSetLogTitleString("World of WarCraft (build 12340)");
|
||||
// SErrSetLogTitleCallback(WowLogHeader);
|
||||
@ -553,11 +684,12 @@ void CommonMain() {
|
||||
|
||||
if (InitializeGlobal()) {
|
||||
EventDoMessageLoop();
|
||||
// TODO: DestroyGlobal();
|
||||
DestroyGlobal();
|
||||
}
|
||||
|
||||
StormDestroy();
|
||||
|
||||
// TODO:
|
||||
// StormDestroy();
|
||||
// Misc Cleanup
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
#include <storm/Error.hpp>
|
||||
#include <common/DataStore.hpp>
|
||||
|
||||
#include "console/Line.hpp"
|
||||
#include "console/Console.hpp"
|
||||
#include "world/World.hpp"
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ void ProcessCommandLine() {
|
||||
}
|
||||
|
||||
const char* CmdLineGetString(CMDOPT opt) {
|
||||
static char buffer[260] = {0};
|
||||
static char buffer[260];
|
||||
|
||||
SCmdGetString(opt, buffer, 260);
|
||||
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
#ifndef CLIENT_GUI_HPP
|
||||
#define CLIENT_GUI_HPP
|
||||
|
||||
#include "client/gui/OsGui.hpp"
|
||||
|
||||
#endif
|
||||
@ -1,14 +0,0 @@
|
||||
#ifndef CLIENT_GUI_OS_GUI_HPP
|
||||
#define CLIENT_GUI_OS_GUI_HPP
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
void* OsGuiGetWindow(int32_t type);
|
||||
|
||||
bool OsGuiIsModifierKeyDown(int32_t key);
|
||||
|
||||
int32_t OsGuiProcessMessage(void* message);
|
||||
|
||||
void OsGuiSetGxWindow(void* window);
|
||||
|
||||
#endif
|
||||
@ -1,25 +0,0 @@
|
||||
#include "client/gui/OsGui.hpp"
|
||||
|
||||
static void* s_GxDevWindow = nullptr;
|
||||
|
||||
void* OsGuiGetWindow(int32_t type) {
|
||||
switch (type) {
|
||||
case 0:
|
||||
return s_GxDevWindow;
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
bool OsGuiIsModifierKeyDown(int32_t key) {
|
||||
// TODO
|
||||
return false;
|
||||
}
|
||||
|
||||
int32_t OsGuiProcessMessage(void* message) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OsGuiSetGxWindow(void* window) {
|
||||
s_GxDevWindow = window;
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
#include "client/gui/OsGui.hpp"
|
||||
|
||||
void* OsGuiGetWindow(int32_t type) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool OsGuiIsModifierKeyDown(int32_t key) {
|
||||
// TODO
|
||||
return false;
|
||||
}
|
||||
|
||||
int32_t OsGuiProcessMessage(void* message) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OsGuiSetGxWindow(void* window) {
|
||||
// TODO
|
||||
}
|
||||
@ -1,31 +0,0 @@
|
||||
#include "client/gui/OsGui.hpp"
|
||||
#include <windows.h>
|
||||
|
||||
static void* s_GxDevWindow;
|
||||
|
||||
void* OsGuiGetWindow(int32_t type) {
|
||||
switch (type) {
|
||||
case 0:
|
||||
return s_GxDevWindow;
|
||||
case 1:
|
||||
return GetActiveWindow();
|
||||
case 2:
|
||||
return GetForegroundWindow();
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
bool OsGuiIsModifierKeyDown(int32_t key) {
|
||||
// TODO
|
||||
return false;
|
||||
}
|
||||
|
||||
int32_t OsGuiProcessMessage(void* message) {
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OsGuiSetGxWindow(void* window) {
|
||||
s_GxDevWindow = window;
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
file(GLOB PRIVATE_SOURCES
|
||||
"*.cpp"
|
||||
"command/*/*.cpp"
|
||||
"cvar/*.cpp"
|
||||
)
|
||||
|
||||
add_library(console STATIC
|
||||
@ -14,7 +15,6 @@ target_include_directories(console
|
||||
|
||||
target_link_libraries(console
|
||||
PUBLIC
|
||||
bc
|
||||
common
|
||||
gx
|
||||
storm
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
#include "console/CVar.hpp"
|
||||
#include "console/Command.hpp"
|
||||
#include "console/Types.hpp"
|
||||
#include "console/Line.hpp"
|
||||
#include "console/Console.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
#include <bc/os/File.hpp>
|
||||
@ -9,6 +8,7 @@
|
||||
|
||||
const char* s_filename = nullptr;
|
||||
bool CVar::m_needsSave;
|
||||
bool CVar::m_initialized;
|
||||
TSHashTable<CVar, HASHKEY_STRI> CVar::s_registeredCVars;
|
||||
|
||||
CVar* CVar::Lookup(const char* name) {
|
||||
@ -17,68 +17,89 @@ CVar* CVar::Lookup(const char* name) {
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
CVar* CVar::Register(const char* name, const char* help, uint32_t flags, const char* value, bool (*fcn)(CVar*, const char*, const char*, void*), uint32_t category, bool setCommand, void* arg, bool a9) {
|
||||
CVar* var = CVar::s_registeredCVars.Ptr(name);
|
||||
CVar* CVar::LookupRegistered(const char* name) {
|
||||
if (!name) {
|
||||
return nullptr;
|
||||
}
|
||||
auto cv = s_registeredCVars.Ptr(name);
|
||||
if (!cv) {
|
||||
return nullptr;
|
||||
}
|
||||
if (cv->m_flags & 0x80000000) {
|
||||
return cv;
|
||||
}
|
||||
if (cv->m_flags & 0x80) {
|
||||
return cv;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (var) {
|
||||
bool setReset = var->m_resetValue.GetString() == nullptr;
|
||||
bool setDefault = var->m_defaultValue.GetString() == nullptr;
|
||||
CVar* CVar::Register(const char* name, const char* help, uint32_t flags, const char* value, HANDLER_FUNC fcn, uint32_t category, bool a7, void* arg, bool a9) {
|
||||
if (!name || !*name || !value) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
var->m_flags |= (var->m_flags & 0xFFFFFFCF);
|
||||
auto cv = s_registeredCVars.Ptr(name);
|
||||
|
||||
var->m_callback = fcn;
|
||||
var->m_arg = arg;
|
||||
if (cv) {
|
||||
bool setReset = cv->m_resetValue.GetString() == nullptr;
|
||||
bool setDefault = cv->m_defaultValue.GetString() == nullptr;
|
||||
|
||||
cv->m_flags |= (cv->m_flags & 0xFFFFFFCF);
|
||||
|
||||
cv->m_callback = fcn;
|
||||
cv->m_arg = arg;
|
||||
|
||||
bool setValue = false;
|
||||
if (fcn && !fcn(var, var->GetString(), var->GetString(), arg)) {
|
||||
if (fcn && !fcn(cv, cv->GetString(), cv->GetString(), arg)) {
|
||||
setValue = true;
|
||||
}
|
||||
|
||||
var->Set(value, setValue, setReset, setDefault, false);
|
||||
cv->Set(value, setValue, setReset, setDefault, false);
|
||||
|
||||
if (!setCommand) {
|
||||
var->m_flags |= 0x80000000;
|
||||
if (!a7) {
|
||||
cv->m_flags |= 0x80000000;
|
||||
}
|
||||
|
||||
if (a9 && var->m_flags) {
|
||||
var->m_flags |= 0x80;
|
||||
if (a9 && cv->m_flags) {
|
||||
cv->m_flags |= 0x80;
|
||||
}
|
||||
} else {
|
||||
var = CVar::s_registeredCVars.New(name, 0, 0);
|
||||
cv = s_registeredCVars.New(name, 0, 0);
|
||||
|
||||
var->m_stringValue.Copy(nullptr);
|
||||
var->m_floatValue = 0.0f;
|
||||
var->m_intValue = 0;
|
||||
var->m_modified = 0;
|
||||
var->m_category = category;
|
||||
var->m_defaultValue.Copy(nullptr);
|
||||
var->m_resetValue.Copy(nullptr);
|
||||
var->m_latchedValue.Copy(nullptr);
|
||||
var->m_callback = fcn;
|
||||
var->m_flags = 0;
|
||||
var->m_arg = arg;
|
||||
var->m_help.Copy(help);
|
||||
cv->m_stringValue.Copy(nullptr);
|
||||
cv->m_floatValue = 0.0f;
|
||||
cv->m_intValue = 0;
|
||||
cv->m_modified = 0;
|
||||
cv->m_category = category;
|
||||
cv->m_defaultValue.Copy(nullptr);
|
||||
cv->m_resetValue.Copy(nullptr);
|
||||
cv->m_latchedValue.Copy(nullptr);
|
||||
cv->m_callback = fcn;
|
||||
cv->m_flags = 0;
|
||||
cv->m_arg = arg;
|
||||
cv->m_help.Copy(help);
|
||||
|
||||
if (setCommand) {
|
||||
var->Set(value, true, true, false, false);
|
||||
if (a7) {
|
||||
cv->Set(value, true, true, false, false);
|
||||
} else {
|
||||
var->Set(value, true, false, true, false);
|
||||
cv->Set(value, true, false, true, false);
|
||||
}
|
||||
|
||||
var->m_flags = flags | 0x1;
|
||||
cv->m_flags = flags | 0x1;
|
||||
|
||||
if (!setCommand) {
|
||||
var->m_flags |= 0x8000000;
|
||||
if (!a7) {
|
||||
cv->m_flags |= 0x8000000;
|
||||
}
|
||||
|
||||
if (a9 && var->m_flags) {
|
||||
var->m_flags |= 0x80;
|
||||
if (a9 && cv->m_flags) {
|
||||
cv->m_flags |= 0x80;
|
||||
}
|
||||
|
||||
ConsoleCommandRegister(name, CvarCommandHandler, CATEGORY(category), help);
|
||||
}
|
||||
|
||||
return var;
|
||||
return cv;
|
||||
}
|
||||
|
||||
CVar::CVar() : TSHashObject<CVar, HASHKEY_STRI>() {
|
||||
@ -153,6 +174,14 @@ bool CVar::Set(const char* value, bool setValue, bool setReset, bool setDefault,
|
||||
return true;
|
||||
}
|
||||
|
||||
void CVar::SetReadOnly(bool readonly) {
|
||||
if (readonly) {
|
||||
this->m_flags |= 0x4;
|
||||
} else {
|
||||
this->m_flags &= ~(0x4);
|
||||
}
|
||||
}
|
||||
|
||||
bool CVar::Reset() {
|
||||
auto value = this->m_resetValue;
|
||||
if (value.GetString() == nullptr) {
|
||||
@ -193,53 +222,44 @@ static int32_t s_CreatePathDirectories(const char* szPath) {
|
||||
}
|
||||
|
||||
int32_t CVar::Load(HOSFILE file) {
|
||||
char fastData[2048] = {0};
|
||||
char line[2048] = {0};
|
||||
char fastData[CONSOLE_CVAR_MAX_LINE];
|
||||
char line[CONSOLE_CVAR_MAX_LINE];
|
||||
uint32_t bytesRead;
|
||||
|
||||
auto size = OsGetFileSize(file);
|
||||
|
||||
char* data = nullptr;
|
||||
|
||||
if (0x1fff < size) {
|
||||
data = reinterpret_cast<char*>(SMemAlloc(size + 1, __FILE__, __LINE__, 0));
|
||||
} else {
|
||||
data = fastData;
|
||||
}
|
||||
|
||||
auto grown = 0x1fff < size;
|
||||
|
||||
int32_t result = 0;
|
||||
uint32_t bytesRead = 0;
|
||||
|
||||
if (OsReadFile(file, data, size, &bytesRead) == 0) {
|
||||
result = 0;
|
||||
} else {
|
||||
data[size] = '\0';
|
||||
const char* curr = data;
|
||||
|
||||
// Skip over UTF-8 byte order mark
|
||||
if ((((data != nullptr) && (2 < bytesRead)) && (data[0] == 0xef)) && ((data[1] == 0xbb && (data[2] == 0xbf)))) {
|
||||
curr = data + 3;
|
||||
auto data = size >= CONSOLE_CVAR_MAX_LINE ? reinterpret_cast<char*>(ALLOC(size + 1)) : fastData;
|
||||
if (!OsReadFile(file, data, size, &bytesRead)) {
|
||||
if (fastData != data) {
|
||||
FREE(data);
|
||||
}
|
||||
|
||||
do {
|
||||
SStrTokenize(&curr, line, 0x800, "\r\n", 0);
|
||||
|
||||
// Do not execute commands other than "set ..."
|
||||
if (SStrCmpI(line, "SET ", 4) == 0) {
|
||||
// Execute without adding to history
|
||||
ConsoleCommandExecute(line, 0);
|
||||
}
|
||||
|
||||
result = 1;
|
||||
} while ((curr != nullptr) && (*curr != '\0'));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (grown) {
|
||||
SMemFree(data, __FILE__, __LINE__, 0);
|
||||
const char* curr = data;
|
||||
|
||||
data[size] = '\0';
|
||||
// Skip over UTF-8 byte order mark
|
||||
if (data && bytesRead >= 3) {
|
||||
if (data[0] == '\xEF' && data[1] == '\xBB' && data[2] == '\xBF') {
|
||||
curr += 3;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
do {
|
||||
SStrTokenize(&curr, line, CONSOLE_CVAR_MAX_LINE, "\r\n", 0);
|
||||
|
||||
// Do not execute commands other than "set ..."
|
||||
if (SStrCmpI(line, "SET ", 4) == 0) {
|
||||
// Execute without adding to history
|
||||
ConsoleCommandExecute(line, 0);
|
||||
}
|
||||
} while (curr && *curr);
|
||||
|
||||
if (fastData != data) {
|
||||
FREE(data);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t CVar::Load(const char* filename) {
|
||||
@ -265,6 +285,7 @@ int32_t CVar::Load(const char* filename) {
|
||||
void CVar::Initialize(const char* filename) {
|
||||
STORM_ASSERT(filename);
|
||||
s_filename = filename;
|
||||
m_initialized = 1;
|
||||
|
||||
// Get data path
|
||||
char path[STORM_MAX_PATH] = {0};
|
||||
@ -273,18 +294,80 @@ void CVar::Initialize(const char* filename) {
|
||||
|
||||
s_CreatePathDirectories(path);
|
||||
|
||||
static ConsoleCommandList baseCommands[] = {
|
||||
{ "set", SetCommandHandler, "Set the value of a CVar" },
|
||||
{ "cvar_reset", CvarResetCommandHandler, "Set the value of a CVar to it's startup value" },
|
||||
{ "cvar_default", CvarDefaultCommandHandler, "Set the value of a CVar to it's coded default value" },
|
||||
{ "cvarlist", CvarListCommandHandler, "List cvars" }
|
||||
};
|
||||
|
||||
CONSOLE_REGISTER_LIST(DEFAULT, baseCommands);
|
||||
ConsoleCommandRegister("set", SetCommandHandler, DEFAULT, "Set the value of a CVar");
|
||||
ConsoleCommandRegister("cvar_reset", CvarResetCommandHandler, DEFAULT, "Set the value of a CVar to it's startup value");
|
||||
ConsoleCommandRegister("cvar_default", CvarDefaultCommandHandler, DEFAULT, "Set the value of a CVar to it's coded default value");
|
||||
ConsoleCommandRegister("cvarlist", CvarListCommandHandler, DEFAULT, "List cvars");
|
||||
|
||||
CVar::Load(s_filename);
|
||||
}
|
||||
|
||||
int32_t CVar::IterateForArchive(uint32_t a1, uint32_t a2, ITERATE_FUNC cb, void* param) {
|
||||
auto cvar = s_registeredCVars.Head();
|
||||
|
||||
while (cvar) {
|
||||
if (cvar->m_flags & 0x1) {
|
||||
if (!(cvar->m_flags & 0x80) && (cvar->m_flags & 0x30) == a1 && (cvar->m_flags & a2) == 0) {
|
||||
const char* value;
|
||||
if ((value = cvar->m_latchedValue.GetString()) ||
|
||||
(value = cvar->m_stringValue.GetString()) ||
|
||||
(value = cvar->m_defaultValue.GetString())) {
|
||||
auto defaultvalue = cvar->m_defaultValue.GetString();
|
||||
if (!defaultvalue || SStrCmp(value, defaultvalue, STORM_MAX_STR)) {
|
||||
if (!cb(cvar->m_key.m_str, value, param)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cvar = s_registeredCVars.Next(cvar);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool CVar::SaveCvar(const char* key, const char* value, void* param) {
|
||||
char buffer[STORM_MAX_PATH];
|
||||
SStrPrintf(buffer, sizeof(buffer), "SET %s \"%s\"\n", key, value);
|
||||
uint32_t byteswritten = 0;
|
||||
OsWriteFile(static_cast<HOSFILE>(param), buffer, SStrLen(buffer), &byteswritten);
|
||||
return byteswritten != 0;
|
||||
}
|
||||
|
||||
int32_t CVarSaveFile() {
|
||||
if (!CVar::m_needsSave) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
char name[STORM_MAX_PATH];
|
||||
|
||||
CVar::m_needsSave = false;
|
||||
SStrCopy(name, "WTF\\", sizeof(name));
|
||||
SStrPack(name, s_filename, sizeof(name));
|
||||
|
||||
int32_t result = 0;
|
||||
|
||||
auto file = OsCreateFile(name, OS_GENERIC_WRITE, 0, OS_CREATE_ALWAYS, OS_FILE_ATTRIBUTE_NORMAL, OS_FILE_TYPE_DEFAULT);
|
||||
if (file != HOSFILE_INVALID) {
|
||||
result = CVar::IterateForArchive(0, 0, CVar::SaveCvar, file);
|
||||
OsCloseFile(file);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void CVar::Destroy() {
|
||||
m_initialized = 0;
|
||||
CVarSaveFile();
|
||||
ConsoleCommandUnregister("set");
|
||||
ConsoleCommandUnregister("cvar_reset");
|
||||
ConsoleCommandUnregister("cvar_default");
|
||||
ConsoleCommandUnregister("cvarlist");
|
||||
s_registeredCVars.Clear();
|
||||
}
|
||||
|
||||
int32_t CvarResetCommandHandler(const char* command, const char* arguments) {
|
||||
char cvarName[256] = {0};
|
||||
auto string = arguments;
|
||||
@ -369,11 +452,33 @@ int32_t SetCommandHandler(const char* command, const char* arguments) {
|
||||
SStrTokenize(&str, cvarName, sizeof(cvarName), " ,;\t\"\r\n", nullptr);
|
||||
SStrTokenize(&str, cvarValue, sizeof(cvarValue), " ,;\t\"\r\n", nullptr);
|
||||
|
||||
auto var = CVar::Lookup(cvarName);
|
||||
if (var) {
|
||||
var->Set(cvarValue, true, false, false, true);
|
||||
} else {
|
||||
auto cvar = CVar::s_registeredCVars.Ptr(cvarName);
|
||||
|
||||
if (!cvar) {
|
||||
CVar::Register(cvarName, "", 0, cvarValue, nullptr, DEFAULT, true, nullptr, false);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (cvar->m_callback) {
|
||||
// FUN_0086b5a0(cv->m_callback);
|
||||
if (!cvar->m_callback(cvar, cvar->GetString(), cvarValue, cvar->m_arg)) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
cvar->m_modified++;
|
||||
if ((cvar->m_flags & 0x2)) {
|
||||
cvar->m_latchedValue.Copy(cvarValue);
|
||||
CVar::m_needsSave = true;
|
||||
} else if (!(cvar->m_flags & 0x4)) {
|
||||
if (cvar->GetString() && !SStrCmpI(cvarValue, cvar->GetString(), STORM_MAX_STR)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
cvar->m_stringValue.Copy(cvarValue);
|
||||
cvar->m_intValue = SStrToInt(cvarValue);
|
||||
cvar->m_floatValue = SStrToFloat(cvarValue);
|
||||
CVar::m_needsSave = true;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
@ -1,38 +1,36 @@
|
||||
#ifndef CONSOLE_C_VAR_HPP
|
||||
#define CONSOLE_C_VAR_HPP
|
||||
#ifndef CONSOLE_CVAR_HPP
|
||||
#define CONSOLE_CVAR_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include <common/String.hpp>
|
||||
#include <storm/Hash.hpp>
|
||||
#include <bc/os/File.hpp>
|
||||
#include <common/String.hpp>
|
||||
#include <cstdint>
|
||||
#include <storm/Hash.hpp>
|
||||
|
||||
#include "console/Types.hpp"
|
||||
#define CONSOLE_CVAR_MAX_LINE 2048
|
||||
|
||||
class CVar : public TSHashObject<CVar, HASHKEY_STRI> {
|
||||
public:
|
||||
typedef bool (*ITERATE_FUNC)(const char*, const char*, void*);
|
||||
typedef bool (*HANDLER_FUNC)(CVar*, const char*, const char*, void*);
|
||||
|
||||
// Static variables
|
||||
static TSHashTable<CVar, HASHKEY_STRI> s_registeredCVars;
|
||||
static bool m_needsSave;
|
||||
static bool m_initialized;
|
||||
|
||||
// Static functions
|
||||
static CVar* Lookup(const char* name);
|
||||
static CVar* Register(
|
||||
const char* name,
|
||||
const char* help,
|
||||
uint32_t flags,
|
||||
const char* value,
|
||||
bool (*fcn)(CVar*, const char*, const char*, void*) = nullptr,
|
||||
uint32_t category = CATEGORY::DEFAULT,
|
||||
bool setCommand = false,
|
||||
void* arg = nullptr,
|
||||
bool a9 = false
|
||||
);
|
||||
static void Initialize(const char* filename);
|
||||
static CVar* LookupRegistered(const char* name);
|
||||
static CVar* Register(const char* name, const char* help, uint32_t flags, const char* value, HANDLER_FUNC fcn, uint32_t category, bool a7, void* arg, bool a9);
|
||||
static void Initialize(const char* filename);
|
||||
static int32_t IterateForArchive(uint32_t a1, uint32_t a2, ITERATE_FUNC cb, void* param);
|
||||
static void Destroy();
|
||||
static int32_t Load(const char* filename);
|
||||
static int32_t Load(HOSFILE fileHandle);
|
||||
static bool SaveCvar(const char* key, const char* value, void* param);
|
||||
// Member variables
|
||||
uint32_t m_category = 0;
|
||||
uint32_t m_flags = 0;
|
||||
uint32_t m_flags = 0;
|
||||
RCString m_stringValue;
|
||||
float m_floatValue = 0.0;
|
||||
int32_t m_intValue = 0;
|
||||
@ -42,20 +40,20 @@ class CVar : public TSHashObject<CVar, HASHKEY_STRI> {
|
||||
RCString m_latchedValue;
|
||||
RCString m_help;
|
||||
bool (*m_callback)(CVar*, const char*, const char*, void*) = nullptr;
|
||||
void* m_arg = nullptr;
|
||||
void* m_arg = nullptr;
|
||||
|
||||
// Member functions
|
||||
CVar();
|
||||
int32_t GetInt();
|
||||
const char* GetString(void);
|
||||
void InternalSet(const char*, bool, bool, bool, bool);
|
||||
bool Set(const char* value, bool setValue, bool setReset, bool setDefault, bool a6);
|
||||
bool Set(const char*, bool, bool, bool, bool);
|
||||
void SetReadOnly(bool readonly);
|
||||
bool Reset();
|
||||
bool Default();
|
||||
int32_t Update();
|
||||
};
|
||||
|
||||
|
||||
int32_t SetCommandHandler(const char* command, const char* arguments);
|
||||
int32_t CvarResetCommandHandler(const char* command, const char* arguments);
|
||||
int32_t CvarDefaultCommandHandler(const char* command, const char* arguments);
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#include "console/Client.hpp"
|
||||
#include "console/Command.hpp"
|
||||
#include "console/CVar.hpp"
|
||||
#include "console/Console.hpp"
|
||||
|
||||
void ConsoleInitializeClientCommand() {
|
||||
ConsoleCommandInitialize();
|
||||
@ -15,3 +16,7 @@ void ConsoleInitializeClientCVar(const char* a1) {
|
||||
int32_t ConsoleLoadClientCVar(const char* a1) {
|
||||
return CVar::Load(a1);
|
||||
}
|
||||
|
||||
void ConsoleDestroyClientCommand() {
|
||||
ConsoleCommandDestroy();
|
||||
}
|
||||
|
||||
@ -9,4 +9,6 @@ void ConsoleInitializeClientCVar(const char* a1);
|
||||
|
||||
int32_t ConsoleLoadClientCVar(const char* a1);
|
||||
|
||||
void ConsoleDestroyClientCommand();
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,11 +1,26 @@
|
||||
#include "console/Command.hpp"
|
||||
#include "console/Console.hpp"
|
||||
#include "console/Line.hpp"
|
||||
|
||||
#include "console/Types.hpp"
|
||||
#include "console/command/Commands.hpp"
|
||||
#include <cctype>
|
||||
#include <storm/Error.hpp>
|
||||
#include <storm/Unicode.hpp>
|
||||
|
||||
#include <cctype>
|
||||
#include <algorithm>
|
||||
int32_t s_completionMode = 0;
|
||||
const char* s_completedCmd = nullptr;
|
||||
char s_partial[256];
|
||||
|
||||
char s_repeatBuffer[64];
|
||||
uint32_t s_repeatCount = 0;
|
||||
|
||||
TSHashTable<CONSOLECOMMAND, HASHKEY_STRI> g_consoleCommandHash;
|
||||
|
||||
char g_commandHistory[CONSOLE_COMMAND_HISTORY_DEPTH][CONSOLE_COMMAND_BUFFER_SIZE];
|
||||
uint32_t g_commandHistoryIndex;
|
||||
|
||||
char g_ExecBuffer[CONSOLE_COMMAND_EXEC_BUFFER_SIZE] = { 0 };
|
||||
EXECMODE g_ExecCreateMode = EM_NOTACTIVE;
|
||||
|
||||
int32_t ValidateFileName(const char* filename) {
|
||||
if (SStrStr(filename, "..") || SStrStr(filename, "\\")) {
|
||||
@ -25,12 +40,6 @@ int32_t ValidateFileName(const char* filename) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
TSHashTable<CONSOLECOMMAND, HASHKEY_STRI> g_consoleCommandHash;
|
||||
char g_commandHistory[CONSOLE_HISTORY_DEPTH][CONSOLE_CMD_BUFFER_SIZE];
|
||||
uint32_t g_commandHistoryIndex;
|
||||
char g_ExecBuffer[CONSOLE_EXEC_BUFFER_SIZE] = {0};
|
||||
EXECMODE g_ExecCreateMode = EM_NOTACTIVE;
|
||||
|
||||
int32_t AddLineToExecFile(const char* currentLine) {
|
||||
char stringToWrite[STORM_MAX_PATH];
|
||||
|
||||
@ -45,7 +54,7 @@ int32_t AddLineToExecFile(const char* currentLine) {
|
||||
|
||||
SStrPrintf(stringToWrite, sizeof(stringToWrite), "%s\n", currentLine);
|
||||
|
||||
if (((sizeof(g_ExecBuffer)-1) - SStrLen(g_ExecBuffer)) != SStrLen(stringToWrite)){
|
||||
if (((CONSOLE_COMMAND_EXEC_BUFFER_SIZE - 1) - SStrLen(g_ExecBuffer)) != SStrLen(stringToWrite)) {
|
||||
SStrPack(g_ExecBuffer, stringToWrite, sizeof(g_ExecBuffer));
|
||||
}
|
||||
|
||||
@ -64,37 +73,89 @@ int32_t AddLineToExecFile(const char* currentLine) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// TODO
|
||||
ConsoleWrite("Begin Typing the commands", ECHO_COLOR);
|
||||
g_ExecCreateMode = EM_RECORDING;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
CONSOLECOMMAND* ParseCommand(const char* commandLine, const char** command, char* arguments, size_t argsize) {
|
||||
STORM_ASSERT(commandLine);
|
||||
|
||||
auto string = commandLine;
|
||||
|
||||
static char cmd[32] = { 0 };
|
||||
auto cmdptr = &cmd[0];
|
||||
|
||||
int32_t i = 0;
|
||||
while (i < CONSOLE_COMMAND_MAX_LENGTH) {
|
||||
int32_t chars;
|
||||
|
||||
auto code = SUniSGetUTF8(reinterpret_cast<const uint8_t*>(string), &chars);
|
||||
if (code == -1 || code == ' ' || chars > CONSOLE_COMMAND_MAX_LENGTH) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (chars) {
|
||||
for (size_t j = 0; j < chars; j++) {
|
||||
*cmdptr++ = *string++;
|
||||
}
|
||||
}
|
||||
|
||||
i += chars;
|
||||
}
|
||||
|
||||
*cmdptr = '\0';
|
||||
|
||||
if (command) {
|
||||
*command = cmd;
|
||||
}
|
||||
|
||||
auto argptr = arguments;
|
||||
if (argptr) {
|
||||
int32_t chars;
|
||||
|
||||
auto code = SUniSGetUTF8(reinterpret_cast<const uint8_t*>(string), &chars);
|
||||
|
||||
// Discard space
|
||||
while (code != -1 && code == ' ') {
|
||||
string += chars;
|
||||
code = SUniSGetUTF8(reinterpret_cast<const uint8_t*>(string), &chars);
|
||||
}
|
||||
|
||||
SStrCopy(argptr, string, argsize);
|
||||
auto len = SStrLen(argptr);
|
||||
while (len > 0 && (argptr[len - 1] == ' ')) {
|
||||
len--;
|
||||
argptr[len] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
return g_consoleCommandHash.Ptr(cmd);
|
||||
}
|
||||
|
||||
void ConsoleCommandDestroy() {
|
||||
g_consoleCommandHash.Clear();
|
||||
}
|
||||
|
||||
char* ConsoleCommandHistory(uint32_t index) {
|
||||
// Return a pointer to the buffer at the specified index
|
||||
return g_commandHistory[((g_commandHistoryIndex + (CONSOLE_HISTORY_DEPTH - 1) - index) & (CONSOLE_HISTORY_DEPTH - 1))];
|
||||
const char* ConsoleCommandHistory(uint32_t index) {
|
||||
return g_commandHistory[((g_commandHistoryIndex - index) - 1) & (CONSOLE_COMMAND_HISTORY_DEPTH - 1)];
|
||||
}
|
||||
|
||||
void AddToHistory(const char* command) {
|
||||
SStrCopy(g_commandHistory[g_commandHistoryIndex], command, CONSOLE_LINE_LENGTH);
|
||||
g_commandHistoryIndex = (g_commandHistoryIndex + 1) & (CONSOLE_HISTORY_DEPTH-1);
|
||||
g_commandHistoryIndex = (g_commandHistoryIndex + 1) & (CONSOLE_COMMAND_HISTORY_DEPTH - 1);
|
||||
}
|
||||
|
||||
uint32_t ConsoleCommandHistoryDepth() {
|
||||
return CONSOLE_HISTORY_DEPTH;
|
||||
return CONSOLE_COMMAND_HISTORY_DEPTH;
|
||||
}
|
||||
|
||||
int32_t ConsoleCommandRegister(const char* command, COMMANDHANDLER handler, CATEGORY category, const char* helpText) {
|
||||
STORM_ASSERT(command);
|
||||
STORM_ASSERT(handler);
|
||||
|
||||
if (SStrLen(command) > (CONSOLE_MAX_CMD_LENGTH - 1) || g_consoleCommandHash.Ptr(command)) {
|
||||
// The command name exceeds CONSOLE_MAX_CMD_LENGTH, minus the null terminator
|
||||
// or it has already been registered
|
||||
if (SStrLen(command) >= CONSOLE_COMMAND_MAX_LENGTH || g_consoleCommandHash.Ptr(command)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -116,106 +177,21 @@ void ConsoleCommandUnregister(const char* command) {
|
||||
}
|
||||
}
|
||||
|
||||
CONSOLECOMMAND* ParseCommand(const char* commandLine, const char** command, char* arguments, size_t argsize) {
|
||||
STORM_ASSERT(commandLine);
|
||||
|
||||
auto string = commandLine;
|
||||
|
||||
static char cmd[32] = { 0 };
|
||||
|
||||
auto cmdptr = &cmd[0];
|
||||
|
||||
int32_t end = CONSOLE_MAX_CMD_LENGTH;
|
||||
int32_t i = 0;
|
||||
|
||||
while (i < end) {
|
||||
int32_t chars;
|
||||
|
||||
auto code = SUniSGetUTF8(reinterpret_cast<const uint8_t*>(string), &chars);
|
||||
|
||||
if (code == -1 || code == ' ' || chars > CONSOLE_MAX_CMD_LENGTH) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (chars) {
|
||||
for (size_t c = 0; c < chars; c++) {
|
||||
*cmdptr = *string;
|
||||
cmdptr += chars;
|
||||
string += chars;
|
||||
}
|
||||
}
|
||||
|
||||
i += chars;
|
||||
}
|
||||
|
||||
*cmdptr = '\0';
|
||||
|
||||
if (command) {
|
||||
*command = cmd;
|
||||
}
|
||||
|
||||
auto argptr = arguments;
|
||||
|
||||
if (arguments) {
|
||||
int32_t chars;
|
||||
|
||||
auto code = SUniSGetUTF8(reinterpret_cast<const uint8_t*>(string), &chars);
|
||||
|
||||
// Discard space
|
||||
while (code != -1 && code == ' ') {
|
||||
string += chars;
|
||||
code = SUniSGetUTF8(reinterpret_cast<const uint8_t*>(string), &chars);
|
||||
}
|
||||
|
||||
SStrCopy(argptr, string, argsize);
|
||||
|
||||
auto len = SStrLen(argptr);
|
||||
|
||||
while (len > 0 && (argptr[len-1] == ' ')) {
|
||||
len--;
|
||||
argptr[len] = '\0';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return g_consoleCommandHash.Ptr(cmd);
|
||||
}
|
||||
|
||||
void MakeCommandCurrent(CONSOLELINE* lineptr, char* command) {
|
||||
auto len = lineptr->inputstart;
|
||||
lineptr->inputpos = len;
|
||||
lineptr->chars = len;
|
||||
lineptr->buffer[len] = '\0';
|
||||
|
||||
len = SStrLen(command);
|
||||
ReserveInputSpace(lineptr, len);
|
||||
|
||||
SStrCopy(lineptr->buffer + lineptr->inputpos, command, STORM_MAX_STR);
|
||||
|
||||
len = lineptr->inputpos + len;
|
||||
lineptr->inputpos = len;
|
||||
lineptr->chars = len;
|
||||
}
|
||||
|
||||
void ConsoleCommandExecute(char* commandLine, int32_t addToHistory) {
|
||||
void ConsoleCommandExecute(const char* commandLine, int32_t addToHistory) {
|
||||
auto em = g_ExecCreateMode;
|
||||
|
||||
if (em == EM_RECORDING || em == EM_PROMPTOVERWRITE || em == EM_APPEND) {
|
||||
AddLineToExecFile(commandLine);
|
||||
return;
|
||||
}
|
||||
|
||||
auto history = ConsoleCommandHistory(0);
|
||||
|
||||
if (addToHistory && (history == nullptr || SStrCmp(commandLine, history, STORM_MAX_STR))) {
|
||||
AddToHistory(commandLine);
|
||||
}
|
||||
|
||||
const char* command = nullptr;
|
||||
auto arguments = reinterpret_cast<char*>(SMemAlloc(CONSOLE_CMD_BUFFER_SIZE, __FILE__, __LINE__, 0));
|
||||
|
||||
auto cmd = ParseCommand(commandLine, &command, arguments, CONSOLE_CMD_BUFFER_SIZE);
|
||||
auto arguments = reinterpret_cast<char*>(ALLOC(CONSOLE_COMMAND_BUFFER_SIZE));
|
||||
|
||||
auto cmd = ParseCommand(commandLine, &command, arguments, CONSOLE_COMMAND_BUFFER_SIZE);
|
||||
if (cmd) {
|
||||
cmd->m_handler(command, arguments);
|
||||
} else {
|
||||
@ -223,45 +199,25 @@ void ConsoleCommandExecute(char* commandLine, int32_t addToHistory) {
|
||||
}
|
||||
|
||||
if (arguments) {
|
||||
SMemFree(arguments, __FILE__, __LINE__, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static ConsoleCommandList s_consoleSpecificCommands[] = {
|
||||
{ "fontcolor", ConsoleCommand_FontColor, "[ColorClassName] [Red 0-255] [Green 0-255] [Blue 0-255]" },
|
||||
{ "bgcolor", ConsoleCommand_BackGroundColor, "[alpha 0-255] [Red 0-255] [Green 0-255] [Blue 0-255]" },
|
||||
{ "highlightcolor", ConsoleCommand_HighLightColor, "[alpha 0-255] [Red 0-255] [Green 0-255] [Blue 0-255]" },
|
||||
{ "fontsize", ConsoleCommand_FontSize, "[15-50] arbitrary font size" },
|
||||
{ "font", ConsoleCommand_Font, "[fontname] make sure to use the .ttf file name" },
|
||||
{ "consolelines", ConsoleCommand_BufferSize, "[number] number of lines to show in the console" },
|
||||
{ "clear", ConsoleCommand_ClearConsole, "Clears the console buffer" },
|
||||
{ "proportionaltext", ConsoleCommand_Proportional, "Toggles fixed-width text characters" },
|
||||
{ "spacing", ConsoleCommand_CharSpacing, "[float] specifies inter-character spacing, in pixels" },
|
||||
{ "settings", ConsoleCommand_CurrentSettings, "Shows current font and console settings" },
|
||||
{ "default", ConsoleCommand_DefaultSettings, "Resets all the font and console settings" },
|
||||
{ "closeconsole", ConsoleCommand_CloseConsole, "Closes the Console window" },
|
||||
{ "repeat", ConsoleCommand_RepeatHandler, "Repeats a command" },
|
||||
{ "AppendLogToFile", ConsoleCommand_AppendLogToFile, "[filename = ConsoleLogs/Log<Timestamp>.txt] [numLines = all]" }
|
||||
};
|
||||
|
||||
static ConsoleCommandList s_commonCommands[] = {
|
||||
{ "quit", ConsoleCommand_Quit, nullptr },
|
||||
{ "ver", ConsoleCommand_Ver, nullptr },
|
||||
{ "setmap", ConsoleCommand_SetMap, nullptr }
|
||||
};
|
||||
|
||||
void RegisterConsoleCommandList(CATEGORY category, ConsoleCommandList list[], size_t count) {
|
||||
size_t i = 0;
|
||||
|
||||
while (i < count) {
|
||||
auto& cmd = list[i];
|
||||
ConsoleCommandRegister(cmd.m_command, cmd.m_handler, category, cmd.m_helpText);
|
||||
i++;
|
||||
FREE(arguments);
|
||||
}
|
||||
}
|
||||
|
||||
void ConsoleInitializeScreenCommand() {
|
||||
CONSOLE_REGISTER_LIST(CONSOLE, s_consoleSpecificCommands);
|
||||
ConsoleCommandRegister("fontcolor", ConsoleCommand_FontColor, CONSOLE, "[ColorClassName] [Red 0-255] [Green 0-255] [Blue 0-255]");
|
||||
ConsoleCommandRegister("bgcolor", ConsoleCommand_BackGroundColor, CONSOLE, "[alpha 0-255] [Red 0-255] [Green 0-255] [Blue 0-255]");
|
||||
ConsoleCommandRegister("highlightcolor", ConsoleCommand_HighLightColor, CONSOLE, "[alpha 0-255] [Red 0-255] [Green 0-255] [Blue 0-255]");
|
||||
ConsoleCommandRegister("fontsize", ConsoleCommand_FontSize, CONSOLE, "[15-50] arbitrary font size");
|
||||
ConsoleCommandRegister("font", ConsoleCommand_Font, CONSOLE, "[fontname] make sure to use the .ttf file name");
|
||||
ConsoleCommandRegister("consolelines", ConsoleCommand_BufferSize, CONSOLE, "[number] number of lines to show in the console");
|
||||
ConsoleCommandRegister("clear", ConsoleCommand_ClearConsole, CONSOLE, "Clears the console buffer");
|
||||
ConsoleCommandRegister("proportionaltext", ConsoleCommand_Proportional, CONSOLE, "Toggles fixed-width text characters");
|
||||
ConsoleCommandRegister("spacing", ConsoleCommand_CharSpacing, CONSOLE, "[float] specifies inter-character spacing, in pixels");
|
||||
ConsoleCommandRegister("settings", ConsoleCommand_CurrentSettings, CONSOLE, "Shows current font and console settings");
|
||||
ConsoleCommandRegister("default", ConsoleCommand_DefaultSettings, CONSOLE, "Resets all the font and console settings");
|
||||
ConsoleCommandRegister("closeconsole", ConsoleCommand_CloseConsole, CONSOLE, "Closes the Console window");
|
||||
ConsoleCommandRegister("repeat", ConsoleCommand_RepeatHandler, CONSOLE, "Repeats a command");
|
||||
ConsoleCommandRegister("AppendLogToFile", ConsoleCommand_AppendLogToFile, CONSOLE, "[filename = ConsoleLogs/Log<Timestamp>.txt] [numLines = all]");
|
||||
}
|
||||
|
||||
void ConsoleCommandInitialize() {
|
||||
@ -269,9 +225,36 @@ void ConsoleCommandInitialize() {
|
||||
}
|
||||
|
||||
void ConsoleInitializeCommonCommand() {
|
||||
CONSOLE_REGISTER_LIST(DEFAULT, s_commonCommands);
|
||||
ConsoleCommandRegister("quit", ConsoleCommand_Quit, DEFAULT, nullptr);
|
||||
ConsoleCommandRegister("ver", ConsoleCommand_Ver, DEFAULT, nullptr);
|
||||
ConsoleCommandRegister("setmap", ConsoleCommand_SetMap, DEFAULT, nullptr);
|
||||
}
|
||||
|
||||
void ConsoleInitializeDebugCommand() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
int32_t ConsoleCommandComplete(const char* partial, const char** previous, int32_t direction) {
|
||||
auto current = g_consoleCommandHash.Head();
|
||||
|
||||
if (*previous) {
|
||||
auto cmd = g_consoleCommandHash.Ptr(*previous);
|
||||
if (!cmd) {
|
||||
return 0;
|
||||
}
|
||||
// TODO: double check this
|
||||
current = g_consoleCommandHash.Next(direction ? cmd : cmd->m_linktoslot.Prev());
|
||||
}
|
||||
|
||||
auto len = SStrLen(partial);
|
||||
while (current) {
|
||||
// console command found
|
||||
if (SStrCmpI(partial, current->m_key.m_str, len) == 0) {
|
||||
*previous = current->m_key.m_str;
|
||||
return 1;
|
||||
}
|
||||
current = g_consoleCommandHash.Next(current);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2,67 +2,41 @@
|
||||
#define CONSOLE_COMMAND_HPP
|
||||
|
||||
#include "console/Types.hpp"
|
||||
|
||||
#include <storm/Hash.hpp>
|
||||
#include <cstdint>
|
||||
#include <storm/Hash.hpp>
|
||||
|
||||
#define CONSOLE_REGISTER_LIST(category, list) RegisterConsoleCommandList(category, list, sizeof(list) / sizeof(ConsoleCommandList))
|
||||
#define CONSOLE_COMMAND_EXEC_BUFFER_SIZE 8192
|
||||
#define CONSOLE_COMMAND_BUFFER_SIZE 1024
|
||||
#define CONSOLE_COMMAND_MAX_LENGTH 64
|
||||
#define CONSOLE_COMMAND_HISTORY_DEPTH 32
|
||||
|
||||
#define CONSOLE_EXEC_BUFFER_SIZE 8192
|
||||
#define CONSOLE_CMD_BUFFER_SIZE 1024
|
||||
#define CONSOLE_MAX_CMD_LENGTH 64
|
||||
#define CONSOLE_HISTORY_DEPTH 32
|
||||
#define CONSOLE_NOHELP nullptr
|
||||
class CONSOLECOMMAND : public TSHashObject<CONSOLECOMMAND, HASHKEY_STRI> {
|
||||
public:
|
||||
COMMANDHANDLER m_handler;
|
||||
const char* m_helpText;
|
||||
CATEGORY m_category;
|
||||
};
|
||||
|
||||
extern int32_t s_completionMode;
|
||||
extern const char* s_completedCmd;
|
||||
extern char s_partial[256];
|
||||
extern char s_repeatBuffer[64];
|
||||
extern uint32_t s_repeatCount;
|
||||
|
||||
extern TSHashTable<CONSOLECOMMAND, HASHKEY_STRI> g_consoleCommandHash;
|
||||
extern char g_commandHistory[CONSOLE_HISTORY_DEPTH][CONSOLE_CMD_BUFFER_SIZE];
|
||||
extern uint32_t g_commandHistoryIndex;
|
||||
extern char g_ExecBuffer[CONSOLE_EXEC_BUFFER_SIZE];
|
||||
|
||||
void ConsoleCommandDestroy();
|
||||
|
||||
char* ConsoleCommandHistory(uint32_t index);
|
||||
|
||||
uint32_t ConsoleCommandHistoryDepth();
|
||||
|
||||
int32_t ConsoleCommandRegister(const char* command, COMMANDHANDLER handler, CATEGORY category, const char* helpText);
|
||||
|
||||
void ConsoleCommandInitialize();
|
||||
|
||||
const char* ConsoleCommandHistory(uint32_t index);
|
||||
|
||||
uint32_t ConsoleCommandHistoryDepth();
|
||||
|
||||
void ConsoleInitializeCommonCommand();
|
||||
|
||||
void ConsoleInitializeDebugCommand();
|
||||
|
||||
void ConsoleInitializeScreenCommand();
|
||||
|
||||
void RegisterConsoleCommandList(CATEGORY category, ConsoleCommandList list[], size_t count);
|
||||
|
||||
void ConsoleCommandUnregister(const char* command);
|
||||
|
||||
void ConsoleCommandExecute(char* commandLine, int32_t addToHistory);
|
||||
|
||||
void MakeCommandCurrent(CONSOLELINE* lineptr, char* command);
|
||||
|
||||
// Commands
|
||||
|
||||
int32_t ConsoleCommand_Quit(const char* command, const char* arguments);
|
||||
int32_t ConsoleCommand_Ver(const char* command, const char* arguments);
|
||||
int32_t ConsoleCommand_SetMap(const char* command, const char* arguments);
|
||||
|
||||
int32_t ConsoleCommand_Help(const char* command, const char* arguments);
|
||||
int32_t ConsoleCommand_FontColor(const char* command, const char* arguments);
|
||||
int32_t ConsoleCommand_BackGroundColor(const char* command, const char* arguments);
|
||||
int32_t ConsoleCommand_HighLightColor(const char* command, const char* arguments);
|
||||
int32_t ConsoleCommand_FontSize(const char* command, const char* arguments);
|
||||
int32_t ConsoleCommand_Font(const char* command, const char* arguments);
|
||||
int32_t ConsoleCommand_BufferSize(const char* command, const char* arguments);
|
||||
int32_t ConsoleCommand_ClearConsole(const char* command, const char* arguments);
|
||||
int32_t ConsoleCommand_Proportional(const char* command, const char* arguments);
|
||||
int32_t ConsoleCommand_CharSpacing(const char* command, const char* arguments);
|
||||
int32_t ConsoleCommand_CurrentSettings(const char* command, const char* arguments);
|
||||
int32_t ConsoleCommand_DefaultSettings(const char* command, const char* arguments);
|
||||
int32_t ConsoleCommand_CloseConsole(const char* command, const char* arguments);
|
||||
int32_t ConsoleCommand_RepeatHandler(const char* command, const char* arguments);
|
||||
int32_t ConsoleCommand_AppendLogToFile(const char* command, const char* arguments);
|
||||
int32_t ConsoleCommandComplete(const char* partial, const char** previous, int32_t direction);
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,13 +1,9 @@
|
||||
#include "console/Console.hpp"
|
||||
#include "event/Context.hpp"
|
||||
#include "event/Event.hpp"
|
||||
|
||||
static int32_t s_active;
|
||||
static int32_t s_consoleAccessEnabled;
|
||||
static KEY s_consoleKey = KEY_TILDE;
|
||||
static float s_consoleLines = 10.0f;
|
||||
static float s_fontHeight = 0.02f;
|
||||
static float s_consoleHeight = s_consoleLines * s_fontHeight;
|
||||
static CONSOLERESIZESTATE s_consoleResizeState = CS_NONE;
|
||||
|
||||
int32_t ConsoleAccessGetEnabled() {
|
||||
@ -22,18 +18,6 @@ int32_t ConsoleGetActive() {
|
||||
return s_active;
|
||||
}
|
||||
|
||||
float ConsoleGetFontHeight() {
|
||||
return s_fontHeight;
|
||||
}
|
||||
|
||||
float ConsoleGetHeight() {
|
||||
return s_consoleHeight;
|
||||
}
|
||||
|
||||
float ConsoleGetLines() {
|
||||
return s_consoleLines;
|
||||
}
|
||||
|
||||
KEY ConsoleGetHotKey() {
|
||||
return s_consoleKey;
|
||||
}
|
||||
@ -50,14 +34,6 @@ void ConsoleSetHotKey(KEY hotkey) {
|
||||
s_consoleKey = hotkey;
|
||||
}
|
||||
|
||||
void ConsoleSetResizeState(CONSOLERESIZESTATE state) {
|
||||
s_consoleResizeState = state;
|
||||
}
|
||||
|
||||
void ConsoleSetHeight(float height) {
|
||||
s_consoleHeight = height;
|
||||
}
|
||||
|
||||
void ConsolePostClose() {
|
||||
EventPostCloseEx(EventGetCurrentContext());
|
||||
EventPostClose();
|
||||
}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
#ifndef CONSOLE_CONSOLE_HPP
|
||||
#define CONSOLE_CONSOLE_HPP
|
||||
|
||||
#include "console/Line.hpp"
|
||||
#include "console/Types.hpp"
|
||||
#include "event/Types.hpp"
|
||||
#include <cstdint>
|
||||
@ -12,24 +11,28 @@ void ConsoleAccessSetEnabled(int32_t enable);
|
||||
|
||||
int32_t ConsoleGetActive();
|
||||
|
||||
float ConsoleGetFontHeight();
|
||||
|
||||
float ConsoleGetLines();
|
||||
|
||||
float ConsoleGetHeight();
|
||||
|
||||
KEY ConsoleGetHotKey();
|
||||
|
||||
CONSOLERESIZESTATE ConsoleGetResizeState();
|
||||
|
||||
void ConsoleSetActive(int32_t active);
|
||||
|
||||
void ConsoleSetHotKey(KEY hotkey);
|
||||
|
||||
void ConsoleSetHeight(float height);
|
||||
void ConsoleCommandDestroy();
|
||||
|
||||
void ConsoleSetResizeState(CONSOLERESIZESTATE state);
|
||||
int32_t ConsoleCommandRegister(const char* command, COMMANDHANDLER handler, CATEGORY category, const char* helpText);
|
||||
|
||||
void ConsoleCommandUnregister(const char* command);
|
||||
|
||||
void ConsoleCommandExecute(const char* commandLine, int32_t addToHistory);
|
||||
|
||||
void ConsolePostClose();
|
||||
|
||||
#endif // ifndef CONSOLE_CONSOLE_HPP
|
||||
void ConsoleWrite(const char* str, COLOR_T color);
|
||||
|
||||
void ConsolePrintf(const char* str, ...);
|
||||
|
||||
void ConsoleWriteA(const char* str, COLOR_T color, ...);
|
||||
|
||||
void ConsoleClear();
|
||||
|
||||
#endif
|
||||
|
||||
467
src/console/Detect.cpp
Normal file
467
src/console/Detect.cpp
Normal file
@ -0,0 +1,467 @@
|
||||
#include "console/Detect.hpp"
|
||||
#include "db/Db.hpp"
|
||||
#include "db/Startup_Strings.hpp"
|
||||
#include "gx/CGxFormat.hpp"
|
||||
#include "gx/Device.hpp"
|
||||
#include "os/Debug.hpp"
|
||||
#include "os/Gui.hpp"
|
||||
#include <common/Processor.hpp>
|
||||
#include <storm/Registry.hpp>
|
||||
|
||||
#if defined(WHOA_SYSTEM_MAC)
|
||||
#include <OpenGL/gl.h>
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
WowClientDB<VideoHardwareRec> g_videoHardwareDB;
|
||||
|
||||
CGxFormat s_formats[7] = {
|
||||
{ 0, { 640, 480 }, CGxFormat::Fmt_Rgb565, CGxFormat::Fmt_Ds160, 60, 1, true, false, true, true, false },
|
||||
{ 0, { 800, 600 }, CGxFormat::Fmt_Rgb565, CGxFormat::Fmt_Ds160, 60, 1, true, false, true, true, false },
|
||||
{ 0, { 640, 480 }, CGxFormat::Fmt_ArgbX888, CGxFormat::Fmt_Ds24X, 60, 1, true, false, true, true, false },
|
||||
{ 0, { 800, 600 }, CGxFormat::Fmt_ArgbX888, CGxFormat::Fmt_Ds24X, 60, 1, true, false, true, true, false },
|
||||
{ 0, { 1024, 768 }, CGxFormat::Fmt_ArgbX888, CGxFormat::Fmt_Ds24X, 60, 1, true, false, true, true, false },
|
||||
{ 0, { 1280, 1024 }, CGxFormat::Fmt_ArgbX888, CGxFormat::Fmt_Ds24X, 60, 1, true, false, true, true, false },
|
||||
{ 0, { 1600, 1200 }, CGxFormat::Fmt_ArgbX888, CGxFormat::Fmt_Ds24X, 60, 1, true, false, true, true, false }
|
||||
};
|
||||
|
||||
CpuHardware s_cpuHwSettings[2] = {
|
||||
{ 0, 0, 0, 0, 0, 0 },
|
||||
{ 1, 1, 1, 1, 1, 1 }
|
||||
};
|
||||
|
||||
SoundHardware s_soundHwSettings[1] = {
|
||||
{ 1, false }
|
||||
};
|
||||
|
||||
uint32_t s_detailDoodadDensity[4] = {
|
||||
8,
|
||||
12,
|
||||
16,
|
||||
24
|
||||
};
|
||||
|
||||
bool s_animatingDoodads[2][2] = {
|
||||
{ false, false },
|
||||
{ false, true }
|
||||
};
|
||||
|
||||
uint32_t s_waterLOD[2][2] = {
|
||||
{ 0, 0 },
|
||||
{ 0, 1 }
|
||||
};
|
||||
|
||||
float s_particleDensity[4][2] = {
|
||||
{ 0.3f, 0.4f },
|
||||
{ 0.5f, 0.6f },
|
||||
{ 0.9f, 1.0f },
|
||||
{ 1.0f, 1.0f }
|
||||
};
|
||||
|
||||
float s_unitDrawDist[4][2] = {
|
||||
{ 35.0f, 50.0f },
|
||||
{ 50.0f, 75.0f },
|
||||
{ 75.0f, 300.0f },
|
||||
{ 300.0f, 300.0f }
|
||||
};
|
||||
|
||||
float s_smallCull[4][2] = {
|
||||
{ 0.08f, 0.08f },
|
||||
{ 0.07f, 0.07f },
|
||||
{ 0.07f, 0.07f },
|
||||
{ 0.04f, 0.04f }
|
||||
};
|
||||
|
||||
float s_distCull[4][2] = {
|
||||
{ 350.0f, 350.0f },
|
||||
{ 400.0f, 400.0f },
|
||||
{ 450.0f, 450.0f },
|
||||
{ 500.0f, 500.0f },
|
||||
};
|
||||
|
||||
float s_farClip[5][2] = {
|
||||
{ 200.0f, 277.0f },
|
||||
{ 300.0f, 350.0f },
|
||||
{ 350.0f, 400.0f },
|
||||
{ 450.0f, 550.0f },
|
||||
{ 450.0f, 777.0f }
|
||||
};
|
||||
|
||||
void AddResolution(TSGrowableArray<C2iVector>& resolutions, const C2iVector& resolution) {
|
||||
resolutions.Add(1, &resolution);
|
||||
}
|
||||
|
||||
void ConsoleDetectGetResolutions(TSGrowableArray<C2iVector>& resolutions, int32_t widescreen) {
|
||||
if (widescreen) {
|
||||
TSGrowableArray<CGxMonitorMode> modes;
|
||||
GxAdapterMonitorModes(modes);
|
||||
|
||||
C2iVector prev = { 0, 0 };
|
||||
|
||||
for (uint32_t i = 0; i < modes.Count(); i++) {
|
||||
auto& mode = modes[i];
|
||||
if ((static_cast<float>(mode.size.x) / static_cast<float>(mode.size.y)) > 1.248f &&
|
||||
mode.size.x >= 640 &&
|
||||
mode.size.y >= 480 &&
|
||||
mode.size.x != prev.x && mode.size.y != prev.y) {
|
||||
AddResolution(resolutions, mode.size);
|
||||
prev = mode.size;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!resolutions.Count() || !widescreen) {
|
||||
// Add generic 4:3 fallback resolutions
|
||||
AddResolution(resolutions, { 640, 480 });
|
||||
AddResolution(resolutions, { 800, 600 });
|
||||
AddResolution(resolutions, { 1024, 768 });
|
||||
AddResolution(resolutions, { 1152, 864 });
|
||||
AddResolution(resolutions, { 1280, 960 });
|
||||
AddResolution(resolutions, { 1280, 1024 });
|
||||
AddResolution(resolutions, { 1600, 1200 });
|
||||
}
|
||||
}
|
||||
|
||||
void ConsoleDetectSaveHardware(Hardware& hardware, bool& hwChanged) {
|
||||
uint32_t cpuIdx;
|
||||
uint32_t memIdx;
|
||||
uint32_t videoID;
|
||||
uint32_t soundIdx;
|
||||
|
||||
if (!SRegLoadValue("World of Warcraft\\Client", "HWCpuIdx", 0, &cpuIdx)) {
|
||||
cpuIdx = hardware.cpuIdx;
|
||||
}
|
||||
if (!SRegLoadValue("World of Warcraft\\Client", "HWMemIdx", 0, &memIdx)) {
|
||||
memIdx = hardware.memIdx;
|
||||
}
|
||||
if (!SRegLoadValue("World of Warcraft\\Client", "HWVideoID", 0, &videoID)) {
|
||||
videoID = hardware.videoID;
|
||||
}
|
||||
if (!SRegLoadValue("World of Warcraft\\Client", "HWSoundIdx", 0, &soundIdx)) {
|
||||
soundIdx = hardware.soundIdx;
|
||||
}
|
||||
|
||||
bool v2 = (((videoID == 1 || videoID == 168) || (videoID == 169)) || videoID == 170);
|
||||
if (hardware.cpuIdx == cpuIdx && hardware.memIdx == memIdx && (v2 || hardware.videoID == videoID) && hardware.soundIdx == soundIdx) {
|
||||
hwChanged = false;
|
||||
} else {
|
||||
#if defined(WHOA_SYSTEM_WIN) || defined(WHOA_SYSTEM_LINUX)
|
||||
auto titleRecord = g_Startup_StringsDB.GetRecord(MSG_TITLE_WOW);
|
||||
auto title = titleRecord ? titleRecord->m_message : "World of Warcraft";
|
||||
auto hwChangedMessageRecord = g_Startup_StringsDB.GetRecord(MSG_HW_CHANGED);
|
||||
auto message = hwChangedMessageRecord ? hwChangedMessageRecord->m_message : "Hardware changed. Reload default settings?";
|
||||
|
||||
hwChanged = !OsGuiMessageBox(OsGuiGetWindow(2), 2, message, title);
|
||||
#endif
|
||||
#if defined(WHOA_SYSTEM_MAC)
|
||||
hwChanged = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
SRegSaveValue("World of Warcraft\\Client", "HWCpuIdx", 0, hardware.cpuIdx);
|
||||
SRegSaveValue("World of Warcraft\\Client", "HWMemIdx", 0, hardware.memIdx);
|
||||
SRegSaveValue("World of Warcraft\\Client", "HWVideoID", 0, hardware.videoID);
|
||||
SRegSaveValue("World of Warcraft\\Client", "HWSoundIdx", 0, hardware.soundIdx);
|
||||
}
|
||||
|
||||
[[noreturn]] void PrintStartupError(int32_t messageID, const char* fallbackMessage) {
|
||||
auto titleRecord = g_Startup_StringsDB.GetRecord(MSG_TITLE_WOW);
|
||||
auto title = titleRecord ? titleRecord->m_message : "World of Warcraft";
|
||||
auto messageRecord = g_Startup_StringsDB.GetRecord(messageID);
|
||||
auto message = messageRecord ? messageRecord->m_message : fallbackMessage;
|
||||
|
||||
OsGuiMessageBox(OsGuiGetWindow(2), 0, message, title);
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void SetVideoIdx(Hardware& hardware) {
|
||||
int32_t index = 1;
|
||||
|
||||
while (index < g_videoHardwareDB.m_numRecords) {
|
||||
auto videoHw = g_videoHardwareDB.GetRecordByIndex(index);
|
||||
if (hardware.videoDevice.vendorID == videoHw->m_vendorID &&
|
||||
hardware.videoDevice.deviceID == videoHw->m_deviceID) {
|
||||
hardware.videoID = videoHw->m_ID;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(WHOA_SYSTEM_WIN) || defined(WHOA_SYSTEM_LINUX)
|
||||
|
||||
void ConsoleDetectDetectHardware(Hardware& hardware, bool& hwChanged) {
|
||||
// anti-feature
|
||||
|
||||
// if (OsIsRemoteSession()) {
|
||||
// PrintStartupError(12, "Running World of Warcraft through a Remote Desktop connection is not supported. Exiting program.");
|
||||
// }
|
||||
|
||||
//
|
||||
|
||||
g_videoHardwareDB.Load(__FILE__, __LINE__);
|
||||
|
||||
hardware.cpuIdx = (static_cast<float>(OsGetProcessorTicksPerSecond()) * 0.000001f) > 1500.0f;
|
||||
hardware.memIdx = 0;
|
||||
hardware.videoID = 0;
|
||||
|
||||
if (GxAdapterID(hardware.videoDevice.vendorID,
|
||||
hardware.videoDevice.deviceID,
|
||||
hardware.videoDevice.driverVersionHi,
|
||||
hardware.videoDevice.driverVersionLo)) {
|
||||
SetVideoIdx(hardware);
|
||||
}
|
||||
|
||||
if (!hardware.videoID) {
|
||||
hardware.videoDevice.vendorID = 0xFFFF;
|
||||
if (GxAdapterInfer(hardware.videoDevice.deviceID)) {
|
||||
SetVideoIdx(hardware);
|
||||
}
|
||||
|
||||
if (!hardware.videoID) {
|
||||
PrintStartupError(MSG_GX_NO_DEVICE, "Failed to find a suitable display device. Exiting program.");
|
||||
}
|
||||
}
|
||||
|
||||
hardware.cpuHw = &s_cpuHwSettings[hardware.cpuIdx];
|
||||
hardware.videoHw = g_videoHardwareDB.GetRecord(hardware.videoID);
|
||||
hardware.soundHw = &s_soundHwSettings[hardware.soundIdx];
|
||||
|
||||
ConsoleDetectSaveHardware(hardware, hwChanged);
|
||||
|
||||
char str[1024];
|
||||
GxLog("ConsoleDetectDetectHardware():");
|
||||
SStrPrintf(str, 1024, "\tcpuIdx: %d", hardware.cpuIdx);
|
||||
GxLog(str);
|
||||
SStrPrintf(str, 1024, "\tvideoID: %d", hardware.videoID);
|
||||
GxLog(str);
|
||||
SStrPrintf(str, 1024, "\tsoundIdx: %d", hardware.soundIdx);
|
||||
GxLog(str);
|
||||
SStrPrintf(str, 1024, "\tmemIdx: %d", hardware.memIdx);
|
||||
GxLog(str);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(WHOA_SYSTEM_MAC)
|
||||
|
||||
uint32_t FindVRAMSize() {
|
||||
CGDirectDisplayID activeDisplays[32];
|
||||
uint32_t displayCount;
|
||||
if (CGGetActiveDisplayList(32, activeDisplays, &displayCount)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
CGLRendererInfoObj rend;
|
||||
GLint nrend;
|
||||
GLint accelerated;
|
||||
GLint vram_size;
|
||||
|
||||
auto display_mask = CGDisplayIDToOpenGLDisplayMask(activeDisplays[0]);
|
||||
if (!CGLQueryRendererInfo(display_mask, &rend, &nrend)) {
|
||||
CGLDescribeRenderer(rend, 0, kCGLRPRendererCount, &nrend);
|
||||
for (int32_t i = 0; i < nrend; i++) {
|
||||
CGLDescribeRenderer(rend, i, kCGLRPAccelerated, &accelerated);
|
||||
if (accelerated) {
|
||||
CGLDescribeRenderer(rend, i, kCGLRPVideoMemory, &vram_size);
|
||||
CGLDestroyRendererInfo(rend);
|
||||
return static_cast<uint32_t>(vram_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CGLDestroyRendererInfo(rend);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ConsoleDetectDetectHardware(Hardware& hardware, bool& hwChanged) {
|
||||
g_videoHardwareDB.Load(__FILE__, __LINE__);
|
||||
|
||||
if (GxAdapterID(hardware.videoDevice.vendorID,
|
||||
hardware.videoDevice.deviceID,
|
||||
hardware.videoDevice.driverVersionHi,
|
||||
hardware.videoDevice.driverVersionLo)) {
|
||||
SetVideoIdx(hardware);
|
||||
}
|
||||
|
||||
if (!hardware.videoIdx) {
|
||||
hardware.videoDevice.vendorID = 0xFFFF;
|
||||
if (GxAdapterInfer(hardware.videoDevice.deviceID)) {
|
||||
SetVideoIdx(hardware);
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t hw_cputype = 0;
|
||||
uint32_t hw_cpusubtype = 0;
|
||||
uint32_t hw_ncpu = 0;
|
||||
uint64_t hw_cpufrequency_max = 0;
|
||||
uint64_t hw_busfrequency_max = 0;
|
||||
uint64_t hw_l2cachesize = 0;
|
||||
uint64_t hw_l3cachesize = 0;
|
||||
|
||||
size_t size32 = sizeof(uint32_t);
|
||||
size_t size64 = sizeof(uint64_t);
|
||||
|
||||
uint32_t hw_cputype;
|
||||
auto hw_cputype_error = sysctlbyname("hw.cputype", &hw_cputype, &size32, nullptr, 0);
|
||||
if (hw_cputype_error) {
|
||||
OsOutputDebugString("[Mac sys detect] ! error %d reading hw.cputype\n", hw_cputype_error);
|
||||
}
|
||||
|
||||
auto hw_cpusubtype_error = sysctlbyname("hw.cpusubtype", &hw_cpusubtype, &size32, nullptr, 0);
|
||||
if (hw_cpusubtype_error) {
|
||||
OsOutputDebugString("[Mac sys detect] ! error %d reading hw.cpusubtype\n", hw_cpusubtype_error);
|
||||
}
|
||||
|
||||
auto hw_ncpu_error = sysctlbyname("hw.ncpu", &hw_ncpu, &size32, nullptr, 0);
|
||||
if (hw_ncpu_error) {
|
||||
OsOutputDebugString("[Mac sys detect] ! error %d reading hw.ncpu\n", hw_ncpu_error);
|
||||
}
|
||||
|
||||
auto hw_cpufrequency_max_error = sysctlbyname("hw.cpufrequency_max", &hw_cpufrequency_max, &size64, nullptr, 0);
|
||||
if (hw_cpufrequency_max_error) {
|
||||
OsOutputDebugString("[Mac sys detect] ! error %d reading hw.cpufrequency_max\n", hw_cpufrequency_max_error);
|
||||
}
|
||||
|
||||
auto hw_busfrequency_max_error = sysctlbyname("hw.busfrequency_max", hw_busfrequency_max, &size64, nullptr, 0);
|
||||
if (hw_busfrequency_max_error) {
|
||||
OsOutputDebugString("[Mac sys detect] ! error %d reading hw.busfrequency_max\n", iVar6);
|
||||
}
|
||||
|
||||
auto hw_l2cachesize_error = sysctlbyname("hw.l2cachesize", &hw_l2cachesize, &size64, nullptr, 0);
|
||||
if (hw_l2cachesize_error) {
|
||||
hw_l2cachesize_error = 0;
|
||||
OsOutputDebugString("[Mac sys detect] ! error %d reading hw.l2cachesize\n", hw_l2cachesize_error);
|
||||
}
|
||||
auto hw_l3cachesize_error = sysctlbyname("hw.l3cachesize", &hw_l3cachesize, &size64, nullptr, 0);
|
||||
if (hw_l3cachesize_error) {
|
||||
hw_l3cachesize_error = 0;
|
||||
OsOutputDebugString("[Mac sys detect] ! error %d reading hw.l3cachesize\n", iVar8);
|
||||
}
|
||||
|
||||
auto hw_memsize_error = sysctlbyname("hw.memsize", &hw_memsize, &size64, nullptr, 0);
|
||||
if (hw_memsize_error) {
|
||||
OsOutputDebugString("[Mac sys detect] ! error %d reading hw.memsize\n", hw_memsize_error);
|
||||
}
|
||||
|
||||
auto vram_size = FindVRAMSize();
|
||||
|
||||
bool ddr_ram;
|
||||
if (hw_busfrequency_max > 110000000 && (hw_busfrequency_max > 140000000 || h2_l3cachesize > 0xFFFFF && hw_l2cachesize > 0x7FFFF)) {
|
||||
OsOutputDebugString("[Mac sys detect] - DDR RAM\n");
|
||||
ddr_ram = true;
|
||||
} else {
|
||||
OsOutputDebugString("[Mac sys detect] - non DDR RAM\n");
|
||||
ddr_ram = false;
|
||||
}
|
||||
|
||||
uint32_t cpuIdx;
|
||||
uint32_t macTier;
|
||||
|
||||
if (hw_cpusubtype_error || hw_cputype_error || hw_ncpu_error || hw_cpufrequency_max_error || hw_busfrequency_max_error || hw_l2cachesize_error || hw_l3cachesize_error || hw_memsize_error) {
|
||||
OsOutputDebugString("[Mac sys detect] ! error reading specs, down to tier 0\n", v27);
|
||||
cpuIdx = 0;
|
||||
macTier = 0;
|
||||
} else {
|
||||
macTier = 3;
|
||||
if (hw_ncpu < 2) {
|
||||
OsOutputDebugString("[Mac sys detect] - non dual proc, down to tier 2\n");
|
||||
macTier = 2;
|
||||
}
|
||||
if (hw_busfrequency_max < 500000000) {
|
||||
OsOutputDebugString("[Mac sys detect] - sub 500MHz FSB, down to tier 2\n");
|
||||
macTier = 2;
|
||||
}
|
||||
if (hw_memsize < 0x30000000) {
|
||||
OsOutputDebugString("[Mac sys detect] - under 768MB RAM, down to tier 2\n");
|
||||
macTier = 2;
|
||||
}
|
||||
if (hw_cpufrequency_max < 1100000000) {
|
||||
OsOutputDebugString("[Mac sys detect] - under 1.1GHz CPU, down to tier 1\n");
|
||||
macTier = 1;
|
||||
}
|
||||
if (vram_size < 0x4000000) {
|
||||
OsOutputDebugString("[Mac sys detect] - < 64MB VRAM, down to tier 1\n");
|
||||
macTier = 1;
|
||||
}
|
||||
if (hw_cputype == 18 && hw_cpusubtype < 11) {
|
||||
OsOutputDebugString("[Mac sys detect] - G3 or G4, down to tier 0\n");
|
||||
macTier = 0;
|
||||
}
|
||||
if (vram_size <= 0x2000000) {
|
||||
OsOutputDebugString("[Mac sys detect] - <= 32 MB VRAM, down to tier 0\n");
|
||||
macTier = 0;
|
||||
}
|
||||
if (!ddr_ram) {
|
||||
OsOutputDebugString("[Mac sys detect] - no DDR RAM, down to tier 0\n");
|
||||
macTier = 0;
|
||||
}
|
||||
if (hw_l2cachesize <= 0x40000 && hw_l3cachesize <= 0xFFFFF) {
|
||||
OsOutputDebugString("[Mac sys detect] - L2 <= 256K and L3 <= 1MB, down to tier 0\n");
|
||||
macTier = 0;
|
||||
}
|
||||
if (hw_memsize < 0x20000000) {
|
||||
OsOutputDebugString("[Mac sys detect] - < 512MB RAM, down to tier 0\n");
|
||||
cpuIdx = 0;
|
||||
macTier = 0;
|
||||
} else {
|
||||
cpuIdx = macTier / 2;
|
||||
}
|
||||
}
|
||||
|
||||
hardware.cpuIdx = cpuIdx;
|
||||
hardware.memIdx = 0;
|
||||
hardware.soundIdx = 0;
|
||||
hardware.macTierIdx = macTier;
|
||||
hardware.macVramMB = vram_size / 0x100000;
|
||||
|
||||
hardware.cpuHw = s_cpuHwSettings[cpuIdx];
|
||||
hardware.videoHw = g_videoHardwareDB.GetRecord(hardware.videoID);
|
||||
hardware.soundHw = s_soundHwSettings[hardware.soundIdx];
|
||||
|
||||
ConsoleDetectSaveHardware(hardware, hwChanged);
|
||||
|
||||
char str[1024];
|
||||
GxLog("ConsoleDetectDetectHardware [Mac] ():");
|
||||
SStrPrintf(str, 1024, "\tcpuIdx: %d", hardware.cpuIdx);
|
||||
GxLog(str);
|
||||
SStrPrintf(str, 1024, "\tvideoID: %d", hardware.videoIdx);
|
||||
GxLog(str);
|
||||
SStrPrintf(str, 1024, "\tsoundIdx: %d", hardware.soundIdx);
|
||||
GxLog(str);
|
||||
SStrPrintf(str, 1024, "\tmemIdx: %d", hardware.memIdx);
|
||||
GxLog(str);
|
||||
SStrPrintf(str, 1024, "\tmacTierIdx: %d", hardware.macTierIdx);
|
||||
GxLog(str);
|
||||
SStrPrintf(str, 1024, "\tmacVramMB: %d", hardware.macVramMB);
|
||||
GxLog(str);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void ConsoleDetectSetDefaultsFormat(DefaultSettings& defaults, const Hardware& hardware) {
|
||||
defaults.format = &s_formats[hardware.videoHw->m_resolutionIdx];
|
||||
}
|
||||
|
||||
void ConsoleDetectSetDefaults(DefaultSettings& defaults, const Hardware& hw) {
|
||||
defaults.farClip = s_farClip[hw.videoHw->m_farclipIdx][hw.cpuHw->farclipIdx];
|
||||
defaults.terrainShadowLOD = hw.videoHw->m_terrainShadowLod;
|
||||
defaults.detailDoodadDensity = s_detailDoodadDensity[hw.videoHw->m_detailDoodadDensityIdx];
|
||||
defaults.detailDoodadAlpha = hw.videoHw->m_detailDoodadAlpha;
|
||||
defaults.animatingDoodads = s_animatingDoodads[hw.videoHw->m_animatingDoodadIdx][hw.cpuHw->animatingDoodadIdx];
|
||||
defaults.trilinear = hw.videoHw->m_trilinear != 0;
|
||||
defaults.numLights = hw.videoHw->m_numLights;
|
||||
auto specularity = hw.videoHw->m_specularity != 0;
|
||||
defaults.unk1A = specularity;
|
||||
defaults.specularity = specularity;
|
||||
defaults.waterLOD = s_waterLOD[hw.videoHw->m_waterLodidx][hw.cpuHw->waterLODIdx];
|
||||
defaults.particleDensity = s_particleDensity[hw.videoHw->m_particleDensityIdx][hw.cpuHw->particleDensityIdx];
|
||||
defaults.unitDrawDist = s_unitDrawDist[hw.videoHw->m_unitDrawDistIdx][hw.cpuHw->unitDrawDistIdx];
|
||||
defaults.smallCull = s_smallCull[hw.videoHw->m_smallCullDistIdx][hw.cpuHw->smallCullDistIdx];
|
||||
defaults.distCull = s_distCull[hw.videoHw->m_smallCullDistIdx][hw.cpuHw->smallCullDistIdx];
|
||||
defaults.format = s_formats + hw.videoHw->m_resolutionIdx;
|
||||
defaults.baseMipLevel = hw.videoHw->m_baseMipLevel;
|
||||
defaults.unk19 = true;
|
||||
defaults.numChannels = 0;
|
||||
defaults.fivePointOne = false;
|
||||
}
|
||||
74
src/console/Detect.hpp
Normal file
74
src/console/Detect.hpp
Normal file
@ -0,0 +1,74 @@
|
||||
#ifndef CONSOLE_DETECT_HPP
|
||||
#define CONSOLE_DETECT_HPP
|
||||
|
||||
#include <storm/Array.hpp>
|
||||
#include <tempest/Vector.hpp>
|
||||
|
||||
#include "gx/CGxFormat.hpp"
|
||||
|
||||
#include "db/rec/VideoHardwareRec.hpp"
|
||||
|
||||
struct CpuHardware {
|
||||
uint32_t farclipIdx;
|
||||
uint32_t animatingDoodadIdx;
|
||||
uint32_t waterLODIdx;
|
||||
uint32_t particleDensityIdx;
|
||||
uint32_t smallCullDistIdx;
|
||||
uint32_t unitDrawDistIdx;
|
||||
};
|
||||
|
||||
struct SoundHardware {
|
||||
uint32_t numChannels;
|
||||
bool fivePointOne;
|
||||
};
|
||||
|
||||
struct Hardware {
|
||||
struct Device {
|
||||
uint16_t vendorID;
|
||||
uint16_t deviceID;
|
||||
uint32_t driverVersionHi;
|
||||
uint32_t driverVersionLo;
|
||||
};
|
||||
|
||||
Device videoDevice;
|
||||
Device soundDevice;
|
||||
uint32_t cpuIdx;
|
||||
uint32_t videoID;
|
||||
uint32_t soundIdx;
|
||||
uint32_t memIdx;
|
||||
VideoHardwareRec* videoHw;
|
||||
CpuHardware* cpuHw;
|
||||
SoundHardware* soundHw;
|
||||
};
|
||||
|
||||
struct DefaultSettings {
|
||||
float farClip;
|
||||
uint32_t terrainShadowLOD;
|
||||
uint32_t detailDoodadDensity;
|
||||
uint32_t detailDoodadAlpha;
|
||||
bool animatingDoodads;
|
||||
bool trilinear;
|
||||
uint32_t numLights;
|
||||
bool specularity;
|
||||
bool unk19;
|
||||
bool unk1A;
|
||||
uint32_t waterLOD;
|
||||
float particleDensity;
|
||||
float unitDrawDist;
|
||||
float smallCull;
|
||||
float distCull;
|
||||
CGxFormat* format;
|
||||
uint32_t baseMipLevel;
|
||||
uint32_t numChannels;
|
||||
bool fivePointOne;
|
||||
};
|
||||
|
||||
void ConsoleDetectGetResolutions(TSGrowableArray<C2iVector>& list, int32_t widescreen);
|
||||
|
||||
void ConsoleDetectDetectHardware(Hardware& hardware, bool& hwChanged);
|
||||
|
||||
void ConsoleDetectSetDefaultsFormat(DefaultSettings& defaults, const Hardware& hardware);
|
||||
|
||||
void ConsoleDetectSetDefaults(DefaultSettings& defaults, const Hardware& hw);
|
||||
|
||||
#endif
|
||||
@ -1,445 +1,345 @@
|
||||
#include "console/Device.hpp"
|
||||
#include "client/CmdLine.hpp"
|
||||
#include "client/Gui.hpp"
|
||||
#include "console/Console.hpp"
|
||||
#include "os/Gui.hpp"
|
||||
#include "console/CVar.hpp"
|
||||
#include "console/Command.hpp"
|
||||
#include "event/Input.hpp"
|
||||
#include "gx/Gx.hpp"
|
||||
#include "console/Console.hpp"
|
||||
#include "console/Detect.hpp"
|
||||
#include "console/Gx.hpp"
|
||||
#include "console/cvar/Gx.hpp"
|
||||
#include "os/Input.hpp"
|
||||
#include "gx/CGxFormat.hpp"
|
||||
#include "gx/Device.hpp"
|
||||
#include <cstring>
|
||||
#include "gx/Types.hpp"
|
||||
#include "console/command/Commands.hpp"
|
||||
#include "db/Startup_Strings.hpp"
|
||||
#include <storm/String.hpp>
|
||||
#include <tempest/Vector.hpp>
|
||||
#include <cstdio>
|
||||
|
||||
#include <cstring>
|
||||
|
||||
CVar* s_cvHwDetect;
|
||||
CVar* s_cvGxFixedFunction;
|
||||
CVar* s_cvGxWindowResizeLock;
|
||||
CVar* s_cvGxVideoOptionsVersion;
|
||||
CVar* s_cvGxMaxFPSBk;
|
||||
CVar* s_cvGxMaxFPS;
|
||||
CVar* s_cvGxOverride;
|
||||
CVar* s_cvGxStereoEnabled;
|
||||
CVar* s_cvGxFixLag;
|
||||
CVar* s_cvGxMultisampleQuality;
|
||||
CVar* s_cvGxMultisample;
|
||||
CVar* s_cvGxCursor;
|
||||
CVar* s_cvGxAspect;
|
||||
CVar* s_cvGxVSync;
|
||||
CVar* s_cvGxTripleBuffer;
|
||||
CVar* s_cvGxRefresh;
|
||||
CVar* s_cvGxDepthBits;
|
||||
CVar* s_cvGxColorBits;
|
||||
CVar* s_cvGxMaximize;
|
||||
CVar* s_cvGxResolution;
|
||||
CVar* s_cvGxWidescreen;
|
||||
CVar* s_cvGxWindow;
|
||||
CVar* s_cvGxApi;
|
||||
DefaultSettings s_defaults;
|
||||
bool s_hwDetect;
|
||||
Hardware s_hardware;
|
||||
bool s_hardwareDetected;
|
||||
bool s_hwChanged;
|
||||
bool s_hwDetect;
|
||||
TSGrowableArray<CGxMonitorMode> s_gxMonitorModes;
|
||||
CGxDevice* s_device;
|
||||
char s_windowTitle[256];
|
||||
CGxFormat s_requestedFormat;
|
||||
CGxFormat s_fallbackFormat = { 0, { 640, 480 }, CGxFormat::Fmt_Rgb565, CGxFormat::Fmt_Ds160, 60, true, true, false, true, true, false };
|
||||
CGxFormat s_lastGoodFormat;
|
||||
CGxFormat s_desktopFormat = { 0, { 800, 600 }, CGxFormat::Fmt_Rgb565, CGxFormat::Fmt_Ds24X, 60, true, true, false, true, true, false };
|
||||
|
||||
const char* g_gxApiNames[GxApis_Last] = {
|
||||
"OpenGL", // GxApi_OpenGl
|
||||
"D3D9", // GxApi_D3d9
|
||||
"D3D9Ex", // GxApi_D3d9Ex
|
||||
"D3D10", // GxApi_D3d10
|
||||
"D3D11", // GxApi_D3d11
|
||||
"GLL", // GxApi_GLL
|
||||
"GLSDL" // GxApi_GLSDL
|
||||
uint32_t s_FormatTobpp[4] = {
|
||||
16,
|
||||
32,
|
||||
32,
|
||||
32
|
||||
};
|
||||
|
||||
EGxApi g_gxApiSupported[] = {
|
||||
#if defined(WHOA_SYSTEM_WIN)
|
||||
GxApi_D3d9,
|
||||
#endif
|
||||
|
||||
#if defined(WHOA_SYSTEM_MAC)
|
||||
GxApi_GLL,
|
||||
#endif
|
||||
|
||||
#if defined(WHOA_BUILD_GLSDL)
|
||||
GxApi_GLSDL,
|
||||
#endif
|
||||
};
|
||||
|
||||
size_t g_numGxApiSupported = sizeof(g_gxApiSupported) / sizeof(EGxApi);
|
||||
|
||||
|
||||
bool CVGxWindowResizeLockCallback(CVar*, const char*, const char*, void*) {
|
||||
// TODO
|
||||
return true;
|
||||
void OnGxStereoChanged() {
|
||||
// ???
|
||||
}
|
||||
|
||||
bool GxVideoOptionsVersionCallback(CVar*, const char*, const char*, void*) {
|
||||
return true;
|
||||
}
|
||||
void ValidateFormatMonitor(CGxFormat& fmt) {
|
||||
static C2iVector standardSizes[] = {
|
||||
{ 1600, 1200 },
|
||||
{ 1280, 1024 },
|
||||
{ 1280, 960 },
|
||||
{ 1152, 864 },
|
||||
{ 1024, 768 },
|
||||
{ 800, 600 },
|
||||
{ 640, 480 }
|
||||
};
|
||||
|
||||
bool CVGxMaxFPSBkCallback(CVar*, const char*, const char*, void*) {
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
auto fmtbpp = s_FormatTobpp[fmt.colorFormat];
|
||||
|
||||
bool CVGxMaxFPSCallback(CVar*, const char*, const char*, void*) {
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
int32_t lowRate = 9999;
|
||||
|
||||
bool CVGxOverrideCallback(CVar*, const char*, const char*, void*) {
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
int32_t i = 0;
|
||||
while (i < s_gxMonitorModes.Count()) {
|
||||
auto& size = s_gxMonitorModes[i].size;
|
||||
|
||||
bool CVGxStereoEnabledCallback(CVar*, const char*, const char*, void*) {
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxFixLagCallback(CVar*, const char*, const char*, void*) {
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxMultisampleQualityCallback(CVar*, const char*, const char*, void*) {
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxMultisampleCallback(CVar*, const char*, const char*, void*) {
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxCursorCallback(CVar*, const char*, const char* value, void*) {
|
||||
s_requestedFormat.hwCursor = SStrToInt(value) != 0;
|
||||
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxAspectCallback(CVar*, const char*, const char*, void*) {
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxVSyncCallback(CVar*, const char*, const char*, void*) {
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxTripleBufferCallback(CVar*, const char*, const char*, void*) {
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxRefreshCallback(CVar*, const char*, const char*, void*) {
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxDepthBitsCallback(CVar*, const char*, const char*, void*) {
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxColorBitsCallback(CVar*, const char*, const char*, void*) {
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxMaximizeCallback(CVar*, const char*, const char*, void*) {
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxResolutionCallback(CVar*, const char*, const char*, void*) {
|
||||
// static C2iVector legalSizes[] = {
|
||||
// {}
|
||||
// }
|
||||
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxWindowCallback(CVar*, const char*, const char*, void*) {
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxApiCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
for (size_t api = 0; api < g_numGxApiSupported; api++) {
|
||||
auto apiString = g_gxApiNames[g_gxApiSupported[api]];
|
||||
if (SStrCmpI(newValue, apiString, STORM_MAX_STR) == 0) {
|
||||
// New gxApi is supported, pass
|
||||
ConsoleWrite("GxApi set pending gxRestart", DEFAULT_COLOR);
|
||||
return true;
|
||||
if (fmt.size.x == size.x && fmt.size.y == size.y && fmtbpp == s_gxMonitorModes[i].bpp) {
|
||||
uint32_t refreshRate = s_gxMonitorModes[i].refreshRate;
|
||||
if (refreshRate < lowRate) {
|
||||
lowRate = refreshRate;
|
||||
}
|
||||
if (fmt.refreshRate == refreshRate) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
// Supported gxApi not supplied, show available apis
|
||||
constexpr size_t msgsize = 1024;
|
||||
char msg[msgsize] = {0};
|
||||
SStrPack(msg, "unsupported api, must be one of ", msgsize);
|
||||
|
||||
for (size_t api = 0; api < g_numGxApiSupported; api++) {
|
||||
if (api > 0) {
|
||||
SStrPack(msg, ", ", msgsize);
|
||||
}
|
||||
auto apiString = g_gxApiNames[g_gxApiSupported[api]];
|
||||
SStrPack(msg, "'", msgsize);
|
||||
SStrPack(msg, apiString, msgsize);
|
||||
SStrPack(msg, "'", msgsize);
|
||||
auto rate = lowRate;
|
||||
if (lowRate == 9999) {
|
||||
GxLog("ValidateFormatMonitor(): unable to find monitor refresh");
|
||||
rate = 60;
|
||||
}
|
||||
|
||||
ConsoleWrite(msg, DEFAULT_COLOR);
|
||||
return false;
|
||||
GxLog("ValidateFormatMonitor(): invalid refresh rate %d, set to %d", fmt.refreshRate, rate);
|
||||
fmt.refreshRate = rate;
|
||||
}
|
||||
|
||||
int32_t CCGxRestart(const char*, const char*) {
|
||||
// TODO
|
||||
return 1;
|
||||
}
|
||||
void ConsoleDeviceStereoInitialize() {
|
||||
s_cvGxStereoConvergence = CVar::Register(
|
||||
"gxStereoConvergence",
|
||||
"Set stereoscopic rendering convergence depth",
|
||||
0x1,
|
||||
"1",
|
||||
CVGxStereoConvergenceCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
s_cvGxStereoSeparation = CVar::Register(
|
||||
"gxStereoSeparation",
|
||||
"Set stereoscopic rendering separation percentage",
|
||||
0x1,
|
||||
"25",
|
||||
CVGxStereoSeparationCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
void RegisterGxCVars() {
|
||||
const auto& format = s_defaults.format;
|
||||
|
||||
// TODO: bool isChinese = s_currentLocaleIndex == 4 (zhCN)
|
||||
bool isChinese = false;
|
||||
|
||||
const uint32_t graphics = CATEGORY::GRAPHICS;
|
||||
|
||||
s_cvGxWidescreen = CVar::Register("widescreen", "Allow widescreen support", 0x0, "1", nullptr, graphics);
|
||||
s_cvGxWindow = CVar::Register("gxWindow", "toggle fullscreen/window", 0x1 | 0x2, isChinese ? "1" : "0", &CVGxWindowCallback, graphics);
|
||||
s_cvGxMaximize = CVar::Register("gxMaximize", "maximize game window", 0x1 | 0x2, isChinese ? "1" : "0", &CVGxMaximizeCallback, graphics);
|
||||
|
||||
char value[260] = {};
|
||||
SStrPrintf(value, sizeof(value), "%s", CGxFormat::formatToColorBitsString[format.colorFormat]);
|
||||
s_cvGxColorBits = CVar::Register("gxColorBits", "color bits", 0x1 | 0x2, value, &CVGxColorBitsCallback, graphics);
|
||||
|
||||
SStrPrintf(value, sizeof(value), "%s", CGxFormat::formatToColorBitsString[format.depthFormat]);
|
||||
s_cvGxDepthBits = CVar::Register("gxDepthBits", "depth bits", 0x1 | 0x2, value, &CVGxDepthBitsCallback, graphics);
|
||||
|
||||
SStrPrintf(value, 260, "%dx%d", format.size.x, format.size.y);
|
||||
s_cvGxResolution = CVar::Register("gxResolution", "resolution", 0x1 | 0x2, value, &CVGxResolutionCallback, graphics);
|
||||
|
||||
s_cvGxRefresh = CVar::Register("gxRefresh", "refresh rate", 0x1 | 0x2, "75", &CVGxRefreshCallback, graphics);
|
||||
s_cvGxTripleBuffer = CVar::Register("gxTripleBuffer", "triple buffer", 0x1 | 0x2, "0", &CVGxTripleBufferCallback, graphics);
|
||||
s_cvGxApi = CVar::Register("gxApi", "graphics api", 0x1 | 0x2, g_gxApiNames[GxApiDefault()], &CVGxApiCallback, graphics);
|
||||
|
||||
s_cvGxVSync = CVar::Register("gxVSync", "vsync on or off", 0x1 | 0x2, "1", &CVGxVSyncCallback, graphics);
|
||||
s_cvGxAspect = CVar::Register("gxAspect", "constrain window aspect", 0x1 | 0x2, "1", &CVGxAspectCallback, graphics);
|
||||
|
||||
s_cvGxCursor = CVar::Register("gxCursor", "toggle hardware cursor", 0x1 | 0x2, "1", &CVGxCursorCallback, graphics);
|
||||
|
||||
// TODO: v10 = *(_DWORD*)(dword_CABB60 + 84);
|
||||
int v10 = 0;
|
||||
SStrPrintf(value, sizeof(value), "%d", v10);
|
||||
s_cvGxMultisample = CVar::Register("gxMultisample", "multisample", 0x1 | 0x2, value, &CVGxMultisampleCallback, graphics);
|
||||
s_cvGxMultisampleQuality = CVar::Register("gxMultisampleQuality", "multisample quality", 0x1 | 0x2, "0.0", &CVGxMultisampleQualityCallback, graphics);
|
||||
|
||||
// TODO: v10 = *(_DWORD*)(dword_CABB60 + 80);
|
||||
SStrPrintf(value, sizeof(value), "%d", v10);
|
||||
s_cvGxFixLag = CVar::Register("gxFixLag", "prevent cursor lag", 0x1 | 0x2, value, &CVGxFixLagCallback, graphics);
|
||||
s_cvGxStereoEnabled = CVar::Register("gxStereoEnabled", "Enable stereoscopic rendering", 0x1, "0", &CVGxStereoEnabledCallback, graphics);
|
||||
s_cvGxOverride = CVar::Register("gxOverride", "gx overrides", 0x1, "", &CVGxOverrideCallback, graphics);
|
||||
s_cvGxMaxFPS = CVar::Register("maxFPS", "Set FPS limit", 0x1, "200", &CVGxMaxFPSCallback, graphics);
|
||||
s_cvGxMaxFPSBk = CVar::Register("maxFPSBk", "Set background FPS limit", 0x1, "30", &CVGxMaxFPSBkCallback, graphics);
|
||||
s_cvGxVideoOptionsVersion = CVar::Register("videoOptionsVersion", "Video options version", 0x1 | 0x2, "0", &GxVideoOptionsVersionCallback, graphics);
|
||||
s_cvGxWindowResizeLock = CVar::Register("windowResizeLock", "prevent resizing in windowed mode", 1, "0", &CVGxWindowResizeLockCallback, graphics);
|
||||
s_cvGxFixedFunction = CVar::Register("fixedFunction", "Force fixed function rendering", 0x1 | 0x2, "0", 0, graphics);
|
||||
}
|
||||
|
||||
void UpdateGxCVars() {
|
||||
s_cvGxColorBits->Update();
|
||||
s_cvGxDepthBits->Update();
|
||||
s_cvGxWindow->Update();
|
||||
s_cvGxResolution->Update();
|
||||
s_cvGxRefresh->Update();
|
||||
s_cvGxTripleBuffer->Update();
|
||||
s_cvGxApi->Update();
|
||||
s_cvGxVSync->Update();
|
||||
s_cvGxAspect->Update();
|
||||
s_cvGxMaximize->Update();
|
||||
s_cvGxCursor->Update();
|
||||
s_cvGxMultisample->Update();
|
||||
s_cvGxMultisampleQuality->Update();
|
||||
s_cvGxFixLag->Update();
|
||||
}
|
||||
|
||||
void SetGxCVars(const CGxFormat& format) {
|
||||
char value[1024] = {};
|
||||
|
||||
s_cvGxColorBits->Set(CGxFormat::formatToColorBitsString[format.colorFormat], true, false, false, true);
|
||||
s_cvGxDepthBits->Set(CGxFormat::formatToColorBitsString[format.depthFormat], true, false, false, true);
|
||||
|
||||
SStrPrintf(value, sizeof(value), "%d", format.window);
|
||||
s_cvGxWindow->Set(value, true, false, false, true);
|
||||
|
||||
SStrPrintf(value, sizeof(value), "%dx%d", format.size.x, format.size.y);
|
||||
s_cvGxResolution->Set(value, true, false, false, true);
|
||||
|
||||
SStrPrintf(value, sizeof(value), "%d", format.refreshRate);
|
||||
s_cvGxRefresh->Set(value, true, false, false, true);
|
||||
|
||||
// TODO: (format + 28) > 1
|
||||
s_cvGxTripleBuffer->Set("0", true, false, false, true);
|
||||
|
||||
SStrPrintf(value, sizeof(value), "%d", format.vsync);
|
||||
s_cvGxVSync->Set(value, true, false, false, true);
|
||||
|
||||
// TODO: format.aspectRatio
|
||||
SStrPrintf(value, sizeof(value), "%d", 0);
|
||||
s_cvGxAspect->Set(value, true, false, false, true);
|
||||
|
||||
SStrPrintf(value, sizeof(value), "%d", format.maximize);
|
||||
s_cvGxMaximize->Set(value, true, false, false, true);
|
||||
|
||||
SStrPrintf(value, sizeof(value), "%d", format.hwCursor);
|
||||
s_cvGxCursor->Set(value, true, false, false, true);
|
||||
|
||||
SStrPrintf(value, sizeof(value), "%d", format.sampleCount);
|
||||
s_cvGxMultisample->Set(value, true, false, false, true);
|
||||
|
||||
// TODO: format.multisampleQuality
|
||||
SStrPrintf(value, sizeof(value), "%f", 0.0f);
|
||||
s_cvGxMultisampleQuality->Set(value, true, false, false, true);
|
||||
|
||||
SStrPrintf(value, sizeof(value), "%d", format.fixLag);
|
||||
s_cvGxFixLag->Set(value, true, false, false, true);
|
||||
|
||||
UpdateGxCVars();
|
||||
// g_theGxDevicePtr->AddStereoChangedCallback(nullsub_3);
|
||||
GxAddStereoChangedCallback(OnGxStereoChanged);
|
||||
}
|
||||
|
||||
void ConsoleDeviceInitialize(const char* title) {
|
||||
GxLogOpen();
|
||||
|
||||
s_cvHwDetect = CVar::Register("hwDetect", "do hardware detection", 0x1, "1", nullptr, CATEGORY::GRAPHICS);
|
||||
s_cvHwDetect = CVar::Register(
|
||||
"hwDetect",
|
||||
"do hardware detection",
|
||||
0x1,
|
||||
"1",
|
||||
nullptr,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
// TODO: sub_76BA30(&unk_CABB38, &byte_CABCBD); << ConsoleDetect
|
||||
// TODO: byte_CABCBC = 1;
|
||||
ConsoleDetectDetectHardware(s_hardware, s_hwChanged);
|
||||
s_hardwareDetected = true;
|
||||
|
||||
if (CmdLineGetBool(CMD_HW_DETECT) || s_cvHwDetect->GetInt() != 0) {
|
||||
if (CmdLineGetBool(CMD_HW_DETECT) == 1 || s_cvHwDetect->GetInt() != 0) {
|
||||
s_hwDetect = true;
|
||||
s_cvHwDetect->Set("0", true, false, false, true);
|
||||
} else {
|
||||
s_hwDetect = false;
|
||||
}
|
||||
|
||||
ConsoleAccessSetEnabled(CmdLineGetBool(CMD_CONSOLE) == 1);
|
||||
|
||||
ConsoleAccessSetEnabled(CmdLineGetBool(CMD_CONSOLE));
|
||||
|
||||
// TODO: sub_76B520(&unk_CABAF0, &unk_CABB38);
|
||||
|
||||
// CHANGE: Remove this when the rest will be ready
|
||||
s_defaults.format.size.x = 1024;
|
||||
s_defaults.format.size.y = 768;
|
||||
s_defaults.format.colorFormat = CGxFormat::Fmt_Argb8888;
|
||||
s_defaults.format.depthFormat = CGxFormat::Fmt_Ds248;
|
||||
ConsoleDetectSetDefaultsFormat(s_defaults, s_hardware);
|
||||
|
||||
RegisterGxCVars();
|
||||
ConsoleCommandRegister("gxRestart", &CCGxRestart, CATEGORY::GRAPHICS, nullptr);
|
||||
|
||||
// TODO: GxAdapterMonitorModes((int)&unk_CABCC8);
|
||||
// TODO: ValidateFormatMonitor(&unk_CABDA8);
|
||||
ConsoleCommandRegister("gxRestart", CCGxRestart, GRAPHICS, nullptr);
|
||||
|
||||
// TODO: if ( GxAdapterDesktopMode(&v28) )
|
||||
if (true) {
|
||||
s_requestedFormat.size.x = 1024;
|
||||
s_requestedFormat.size.y = 768;
|
||||
s_requestedFormat.colorFormat = CGxFormat::Fmt_Argb8888;
|
||||
s_requestedFormat.depthFormat = CGxFormat::Fmt_Ds248;
|
||||
GxAdapterMonitorModes(s_gxMonitorModes);
|
||||
ValidateFormatMonitor(s_fallbackFormat);
|
||||
|
||||
CGxMonitorMode mode;
|
||||
mode.size = { 0, 0 };
|
||||
if (GxAdapterDesktopMode(mode)) {
|
||||
s_desktopFormat.size = mode.size;
|
||||
s_desktopFormat.colorFormat = mode.bpp > 16 ? CGxFormat::Fmt_ArgbX888 : CGxFormat::Fmt_Rgb565;
|
||||
s_desktopFormat.refreshRate = mode.refreshRate;
|
||||
}
|
||||
|
||||
GxLog("ConsoleDeviceInitialize(): hwDetect = %d, hwChanged = %d", s_hwDetect, s_hwChanged);
|
||||
|
||||
if (CmdLineGetBool(CMD_RES_800x600)) {
|
||||
s_requestedFormat.size.x = 800;
|
||||
s_requestedFormat.size.y = 600;
|
||||
s_requestedFormat.size = { 800, 600 };
|
||||
} else if (CmdLineGetBool(CMD_RES_1024x768)) {
|
||||
s_requestedFormat.size.x = 1024;
|
||||
s_requestedFormat.size.y = 768;
|
||||
s_requestedFormat.size = { 1024, 768 };
|
||||
} else if (CmdLineGetBool(CMD_RES_1280x960)) {
|
||||
s_requestedFormat.size.x = 1280;
|
||||
s_requestedFormat.size.y = 960;
|
||||
s_requestedFormat.size = { 1280, 960 };
|
||||
} else if (CmdLineGetBool(CMD_RES_1280x1024)) {
|
||||
s_requestedFormat.size.x = 1280;
|
||||
s_requestedFormat.size.y = 1024;
|
||||
s_requestedFormat.size = { 1280, 1024 };
|
||||
} else if (CmdLineGetBool(CMD_RES_1600x1200)) {
|
||||
s_requestedFormat.size.x = 1600;
|
||||
s_requestedFormat.size.y = 1200;
|
||||
s_requestedFormat.size = { 1600, 1200 };
|
||||
}
|
||||
|
||||
if (s_cvGxFixedFunction->GetInt() != 0) {
|
||||
// TODO: (dword_CABD20 = 0) s_requestedFormat.unknown_field = 0;
|
||||
s_requestedFormat.pos.y = 0; // <--- CHECK THIS
|
||||
s_requestedFormat.pos.x = 0;
|
||||
// TODO: fixed function rendering!!!
|
||||
if (s_cvFixedFunction->GetInt()) {
|
||||
// TODO: IMPORTANT: figure out what these are called
|
||||
s_requestedFormat.unk48 = 0;
|
||||
s_requestedFormat.unk38 = 0;
|
||||
}
|
||||
|
||||
if (s_hwDetect || s_hwChanged) {
|
||||
// TODO Sub76B3F0(&UnkCABAF0, &UnkCABB38);
|
||||
s_cvGxFixedFunction->Set("0", true, false, false, true);
|
||||
// TODO memcpy(&s_requestedFormat, &s_defaults.format, sizeof(s_requestedFormat));
|
||||
|
||||
ConsoleDetectSetDefaults(s_defaults, s_hardware);
|
||||
s_cvFixedFunction->Set("0", true, false, false, true);
|
||||
memcpy(&s_requestedFormat, s_defaults.format, sizeof(CGxFormat));
|
||||
s_requestedFormat.window = s_cvGxWindow->GetInt() != 0;
|
||||
s_requestedFormat.maximize = s_cvGxMaximize->GetInt() != 0;
|
||||
|
||||
// TODO temporary override
|
||||
s_requestedFormat.maximize = 0;
|
||||
|
||||
SetGxCVars(s_requestedFormat);
|
||||
}
|
||||
|
||||
EGxApi api = GxApiDefault();
|
||||
|
||||
auto gxApiName = s_cvGxApi->GetString();
|
||||
|
||||
auto gxOverride = CmdLineGetString(CMD_GX_OVERRIDE);
|
||||
if (*gxOverride != '\0') {
|
||||
gxApiName = gxOverride;
|
||||
} else if (CmdLineGetBool(CMD_OPENGL)) {
|
||||
gxApiName = g_gxApiNames[GxApi_OpenGl];
|
||||
} else if (CmdLineGetBool(CMD_D3D)) {
|
||||
gxApiName = g_gxApiNames[GxApi_D3d9];
|
||||
} else if (CmdLineGetBool(CMD_D3D9EX)) {
|
||||
gxApiName = g_gxApiNames[GxApi_D3d9Ex];
|
||||
}
|
||||
|
||||
// Sanitize chosen gxApi against list of supported gxApis
|
||||
for (size_t i = 0; i < g_numGxApiSupported; i++) {
|
||||
EGxApi supportedApi = g_gxApiSupported[i];
|
||||
if (SStrCmpI(gxApiName, g_gxApiNames[supportedApi], STORM_MAX_STR) == 0) {
|
||||
api = supportedApi;
|
||||
break;
|
||||
auto gxApi = GxDefaultApi();
|
||||
auto cvGxApi = CVar::Lookup("gxApi");
|
||||
if (cvGxApi) {
|
||||
auto requestedGxApi = cvGxApi->GetString();
|
||||
for (auto api = GxApi_OpenGl; api < GxApis_Last; api = static_cast<EGxApi>(static_cast<int32_t>(api) + 1)) {
|
||||
if (GxApiSupported(api) && !SStrCmpI(requestedGxApi, g_gxApiNames[api], STORM_MAX_STR)) {
|
||||
gxApi = api;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CmdLineGetBool(CMD_OPENGL) && GxApiSupported(GxApi_OpenGl)) {
|
||||
gxApi = GxApi_OpenGl;
|
||||
}
|
||||
if (CmdLineGetBool(CMD_D3D) && GxApiSupported(GxApi_D3d9)) {
|
||||
gxApi = GxApi_D3d9;
|
||||
}
|
||||
if (CmdLineGetBool(CMD_D3D9EX) && GxApiSupported(GxApi_D3d9Ex)) {
|
||||
gxApi = GxApi_D3d9Ex;
|
||||
}
|
||||
|
||||
s_requestedFormat.fixLag = s_cvGxFixLag->GetInt() != 0;
|
||||
s_requestedFormat.hwTnL = !CmdLineGetBool(CMD_SW_TNL);
|
||||
|
||||
bool windowed = s_cvGxWindow->GetInt() != 0;
|
||||
s_requestedFormat.hwTnL = CmdLineGetBool(CMD_SW_TNL) == 0;
|
||||
bool window = s_cvGxWindow->GetInt() != 0;
|
||||
if (CmdLineGetBool(CMD_FULL_SCREEN)) {
|
||||
windowed = false;
|
||||
window = false;
|
||||
} else if (CmdLineGetBool(CMD_WINDOWED)) {
|
||||
windowed = true;
|
||||
window = true;
|
||||
}
|
||||
s_requestedFormat.window = window;
|
||||
s_desktopFormat.window = window;
|
||||
|
||||
bool bVar1 = false;
|
||||
CGxFormat apiFormat = s_requestedFormat;
|
||||
ValidateFormatMonitor(apiFormat);
|
||||
s_device = GxDevCreate(gxApi, OsWindowProc, apiFormat);
|
||||
while (!s_device) {
|
||||
if (apiFormat.sampleCount < 2) {
|
||||
auto colorFormat = apiFormat.colorFormat;
|
||||
if (colorFormat <= CGxFormat::Fmt_Rgb565) {
|
||||
if (bVar1) {
|
||||
GxLog("ConsoleDeviceInitialize(): no output device available!");
|
||||
auto titleRecord = g_Startup_StringsDB.GetRecord(MSG_TITLE_WOW);
|
||||
auto title = titleRecord ? titleRecord->m_message : "World of Warcraft";
|
||||
const char* message;
|
||||
if (gxApi == GxApi_D3d9 || gxApi == GxApi_D3d9Ex) {
|
||||
auto messageRecord = g_Startup_StringsDB.GetRecord(MSG_GX_INIT_FAILED_D3D);
|
||||
message = messageRecord ? messageRecord->m_message : "World of Warcraft was unable to start up 3D acceleration. Please make sure DirectX 9.0c is installed and your video drivers are up-to-date.";
|
||||
} else {
|
||||
auto messageRecord = g_Startup_StringsDB.GetRecord(MSG_GX_INIT_FAILED);
|
||||
message = messageRecord ? messageRecord->m_message : "World of Warcraft was unable to start up 3D acceleration.";
|
||||
}
|
||||
OsGuiMessageBox(nullptr, 0, message, title);
|
||||
GxLogClose();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
apiFormat = s_desktopFormat;
|
||||
bVar1 = true;
|
||||
} else if (apiFormat.depthFormat <= CGxFormat::Fmt_Ds160) {
|
||||
apiFormat.colorFormat = static_cast<CGxFormat::Format>(static_cast<int32_t>(apiFormat.colorFormat - 1));
|
||||
apiFormat.depthFormat = colorFormat != CGxFormat::Fmt_ArgbX888 ? CGxFormat::Fmt_Ds320 : CGxFormat::Fmt_Ds160;
|
||||
} else {
|
||||
apiFormat.depthFormat = static_cast<CGxFormat::Format>(static_cast<int32_t>(apiFormat.depthFormat - 1));
|
||||
}
|
||||
} else {
|
||||
apiFormat.sampleCount = std::max(apiFormat.sampleCount - 2, static_cast<uint32_t>(1));
|
||||
}
|
||||
|
||||
ValidateFormatMonitor(apiFormat);
|
||||
s_device = GxDevCreate(gxApi, OsWindowProc, apiFormat);
|
||||
}
|
||||
memcpy(&s_requestedFormat, &apiFormat, sizeof(CGxFormat));
|
||||
memcpy(&s_lastGoodFormat, &apiFormat, sizeof(CGxFormat));
|
||||
|
||||
SetGxCVars(apiFormat);
|
||||
|
||||
if (GxCaps().m_numTmus < 2) {
|
||||
GxDevDestroy(s_device);
|
||||
GxLog("ConsoleDeviceInitialize(): output device does not have dual TMUs!");
|
||||
auto titleRecord = g_Startup_StringsDB.GetRecord(MSG_TITLE_WOW);
|
||||
auto title = titleRecord ? titleRecord->m_message : "World of Warcraft";
|
||||
auto messageRecord = g_Startup_StringsDB.GetRecord(MSG_HW_UNSUPPORTED);
|
||||
auto message = messageRecord ? messageRecord->m_message : "Your 3D accelerator card is not supported by World of Warcraft. Please install a 3D acceler ator card with dual-TMU support.";
|
||||
OsGuiMessageBox(nullptr, 0, message, title);
|
||||
GxLogClose();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
s_requestedFormat.window = windowed;
|
||||
// TODO: byte_CABD47 = windowed;
|
||||
if (!GxCaps().m_numStreams) {
|
||||
GxDevDestroy(s_device);
|
||||
GxLog("ConsoleDeviceInitialize(): output device has 0 streams");
|
||||
auto titleRecord = g_Startup_StringsDB.GetRecord(MSG_TITLE_WOW);
|
||||
auto title = titleRecord ? titleRecord->m_message : "World of Warcraft";
|
||||
auto messageRecord = g_Startup_StringsDB.GetRecord(MSG_HW_UNSUPPORTED);
|
||||
auto message = messageRecord ? messageRecord->m_message : "Your 3D accelerator card is not supported by World of Warcraft. Please install a 3D acceler ator card with dual-TMU support.";
|
||||
OsGuiMessageBox(nullptr, 0, message, title);
|
||||
GxLogClose();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
GxLog("GxApi_%s selected\n", g_gxApiNames[api]);
|
||||
|
||||
// Set internally (CVar value reflects the current gxApi at launch),
|
||||
// this will not Set() as CVar gxApi is latched
|
||||
s_cvGxApi->InternalSet(g_gxApiNames[api], true, false, false, true);
|
||||
|
||||
CGxFormat format;
|
||||
memcpy(&format, &s_requestedFormat, sizeof(s_requestedFormat));
|
||||
|
||||
CGxDevice* device = GxDevCreate(api, OsWindowProc, format);
|
||||
|
||||
// TODO
|
||||
switch (GxDevApi()) {
|
||||
case GxApi_OpenGl:
|
||||
case GxApi_GLL:
|
||||
case GxApi_GLSDL:
|
||||
ConsoleGxOverride(s_hardware.videoHw->m_oglOverrides);
|
||||
break;
|
||||
case GxApi_D3d9:
|
||||
case GxApi_D3d9Ex:
|
||||
ConsoleGxOverride(s_hardware.videoHw->m_d3DOverrides);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
ConsoleGxOverride(CmdLineGetString(CMD_GX_OVERRIDE));
|
||||
for (auto override = GxOverride_PixelShader; override < GxOverrides_Last; override = static_cast<EGxOverride>(static_cast<int32_t>(override) + 1)) {
|
||||
if (s_consoleGxOverrideSet[override]) {
|
||||
GxDevOverride(override, s_consoleGxOverrideVal[override]);
|
||||
}
|
||||
}
|
||||
|
||||
OsGuiSetGxWindow(GxDevWindow());
|
||||
if (!title) {
|
||||
title = "";
|
||||
}
|
||||
SStrCopy(s_windowTitle, title, sizeof(s_windowTitle));
|
||||
auto gxWindow = GxDevWindow();
|
||||
OsGuiSetGxWindow(gxWindow);
|
||||
if (gxWindow) {
|
||||
OsGuiSetWindowTitle(gxWindow, s_windowTitle);
|
||||
}
|
||||
if (s_hwDetect || s_hwChanged) {
|
||||
// TODO: IMPORTANT: find out what the real name is
|
||||
s_defaults.unk19 = GxCaps().m_shaderTargets[GxSh_Pixel] != 0;
|
||||
}
|
||||
|
||||
char videoOptionsVersion[32];
|
||||
SStrPrintf(videoOptionsVersion, sizeof(videoOptionsVersion), "%d", 3);
|
||||
|
||||
s_cvVideoOptionsVersion->Set(videoOptionsVersion, true, false, false, true);
|
||||
|
||||
ConsoleDeviceStereoInitialize();
|
||||
|
||||
// TODO
|
||||
// OsSetSleepInBackground(1);
|
||||
// OsSetBackgroundSleepMs(250);
|
||||
}
|
||||
|
||||
bool ConsoleDeviceExists() {
|
||||
return s_device != nullptr;
|
||||
}
|
||||
|
||||
void ConsoleDeviceDestroy() {
|
||||
GxRemoveStereoChangedCallback(OnGxStereoChanged);
|
||||
s_cvVideoOptionsVersion->Update();
|
||||
GxDevDestroy(s_device);
|
||||
s_device = nullptr;
|
||||
GxLogClose();
|
||||
}
|
||||
|
||||
@ -3,10 +3,18 @@
|
||||
|
||||
#include "gx/CGxFormat.hpp"
|
||||
|
||||
struct DefaultSettings {
|
||||
CGxFormat format;
|
||||
};
|
||||
#include "console/Detect.hpp"
|
||||
|
||||
extern DefaultSettings s_defaults;
|
||||
extern Hardware s_hardware;
|
||||
extern bool s_hwChanged;
|
||||
extern bool s_hwDetect;
|
||||
extern CGxFormat s_requestedFormat;
|
||||
|
||||
void ConsoleDeviceInitialize(const char* title);
|
||||
|
||||
bool ConsoleDeviceExists();
|
||||
|
||||
void ConsoleDeviceDestroy();
|
||||
|
||||
#endif
|
||||
|
||||
72
src/console/Gx.cpp
Normal file
72
src/console/Gx.cpp
Normal file
@ -0,0 +1,72 @@
|
||||
#include "console/Gx.hpp"
|
||||
#include <storm/String.hpp>
|
||||
#include <cstdlib>
|
||||
|
||||
const char* g_gxApiNames[GxApis_Last] = {
|
||||
"OpenGL", // GxApi_OpenGl
|
||||
"D3D9", // GxApi_D3d9
|
||||
"D3D9Ex", // GxApi_D3d9Ex
|
||||
"D3D10", // GxApi_D3d10
|
||||
"D3D11", // GxApi_D3d11
|
||||
"GLL", // GxApi_GLL
|
||||
"GLSDL" // GxApi_GLSDL
|
||||
};
|
||||
|
||||
int32_t s_consoleGxOverrideSet[GxOverrides_Last];
|
||||
uint32_t s_consoleGxOverrideVal[GxOverrides_Last];
|
||||
|
||||
void ConsoleGxOverride(const char* str) {
|
||||
char value[256];
|
||||
char override[256];
|
||||
|
||||
while (*str) {
|
||||
SStrTokenize(&str, override, 256, " ,", 0);
|
||||
SStrTokenize(&str, value, 256, " ;", 0);
|
||||
|
||||
if (override[0] && value[0]) {
|
||||
auto gxOverride = static_cast<EGxOverride>(std::atol(override));
|
||||
auto gxValue = std::atol(value);
|
||||
|
||||
if (gxOverride < GxOverrides_Last) {
|
||||
if (gxOverride == 0) {
|
||||
switch (gxValue) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
gxValue = 1;
|
||||
break;
|
||||
case 3:
|
||||
gxValue = 2;
|
||||
break;
|
||||
case 4:
|
||||
gxValue = 3;
|
||||
break;
|
||||
case 5:
|
||||
gxValue = 7;
|
||||
break;
|
||||
case 6:
|
||||
gxValue = 8;
|
||||
break;
|
||||
case 7:
|
||||
gxValue = 9;
|
||||
break;
|
||||
case 8:
|
||||
gxValue = 10;
|
||||
break;
|
||||
case 10:
|
||||
gxValue = 12;
|
||||
break;
|
||||
case 11:
|
||||
gxValue = 13;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
s_consoleGxOverrideSet[gxOverride] = 1;
|
||||
s_consoleGxOverrideVal[gxOverride] = gxValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
14
src/console/Gx.hpp
Normal file
14
src/console/Gx.hpp
Normal file
@ -0,0 +1,14 @@
|
||||
#ifndef CONSOLE_GX_HPP
|
||||
#define CONSOLE_GX_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include "gx/Types.hpp"
|
||||
|
||||
extern const char* g_gxApiNames[GxApis_Last];
|
||||
|
||||
extern int32_t s_consoleGxOverrideSet[GxOverrides_Last];
|
||||
extern uint32_t s_consoleGxOverrideVal[GxOverrides_Last];
|
||||
|
||||
void ConsoleGxOverride(const char* str);
|
||||
|
||||
#endif
|
||||
@ -1,12 +1,17 @@
|
||||
#include <cstdint>
|
||||
#include <storm/String.hpp>
|
||||
#include "console/Handlers.hpp"
|
||||
#include "console/Line.hpp"
|
||||
#include "console/Console.hpp"
|
||||
#include "console/Command.hpp"
|
||||
#include "console/Screen.hpp"
|
||||
#include "console/Text.hpp"
|
||||
#include "console/Highlight.hpp"
|
||||
#include "event/Event.hpp"
|
||||
#include <cstdint>
|
||||
#include "event/Types.hpp"
|
||||
|
||||
static int32_t s_historyIndex = 0;
|
||||
#define SHIFT_MODIFIER(data) ((data->metaKeyState & ((1 << KEY_LSHIFT) | (1 << KEY_RSHIFT))) != 0)
|
||||
#define CTRL_MODIFIER(data) ((data->metaKeyState & ((1 << KEY_LCONTROL) | (1 << KEY_RCONTROL))) != 0)
|
||||
|
||||
namespace {
|
||||
|
||||
@ -21,19 +26,22 @@ int32_t OnChar(const EVENT_DATA_CHAR* data, void* param) {
|
||||
character[0] = char(data->ch);
|
||||
character[1] = 0;
|
||||
|
||||
// TODO: add custom behavior to support non-ASCII commands?
|
||||
// SUniSPutUTF8(data->ch, character);
|
||||
|
||||
PasteInInputLine(character);
|
||||
ResetHighlight();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// SUniSPutUTF8(data->ch, character);
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t OnIdle(const EVENT_DATA_IDLE* data, void* param) {
|
||||
// TODO repeat buffer logic
|
||||
if (s_repeatCount && (*s_repeatBuffer)) {
|
||||
ConsoleCommandExecute(s_repeatBuffer, 0);
|
||||
s_repeatCount--;
|
||||
}
|
||||
|
||||
ConsoleScreenAnimate(data->elapsedSec);
|
||||
|
||||
@ -58,71 +66,108 @@ int32_t OnKeyDown(const EVENT_DATA_KEY* data, void* param) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto anyControl = (1 << KEY_LCONTROL) | (1 << KEY_RCONTROL);
|
||||
|
||||
auto line = GetInputLine();
|
||||
auto lineptr = GetInputLine();
|
||||
|
||||
switch (data->key) {
|
||||
case KEY_ESCAPE:
|
||||
if (line->inputpos < line->inputstart || line->inputpos == line->inputstart) {
|
||||
if (lineptr->inputstart < lineptr->inputpos) {
|
||||
ConsoleSetActive(0);
|
||||
} else {
|
||||
line->inputpos = line->inputstart;
|
||||
line->chars = line->inputstart;
|
||||
line->buffer[line->inputstart] = '\0';
|
||||
SetInputString(line->buffer);
|
||||
lineptr->inputpos = lineptr->inputstart;
|
||||
lineptr->chars = lineptr->inputstart;
|
||||
lineptr->buffer[lineptr->inputstart] = '\0';
|
||||
SetInputString(lineptr->buffer);
|
||||
}
|
||||
break;
|
||||
case KEY_PAGEUP:
|
||||
MoveLinePtr(1, data->metaKeyState);
|
||||
break;
|
||||
case KEY_PAGEDOWN:
|
||||
MoveLinePtr(0, data->metaKeyState);
|
||||
break;
|
||||
case KEY_ENTER:
|
||||
if (line->inputstart <= line->inputpos && line->inputpos != line->inputstart) {
|
||||
line->inputpos = 0;
|
||||
GenerateNodeString(line);
|
||||
ConsoleCommandExecute(line->buffer + line->inputstart, 1);
|
||||
s_historyIndex = -1;
|
||||
}
|
||||
break;
|
||||
case KEY_HOME:
|
||||
break;
|
||||
case KEY_END:
|
||||
break;
|
||||
case KEY_C:
|
||||
if (data->metaKeyState & anyControl) {
|
||||
CutHighlightToClipboard();
|
||||
if (CTRL_MODIFIER(data)) {
|
||||
CopyHighlightToClipboard();
|
||||
}
|
||||
break;
|
||||
case KEY_V:
|
||||
if (data->metaKeyState & anyControl) {
|
||||
PasteClipboardToHighlight();
|
||||
if (CTRL_MODIFIER(data)) {
|
||||
PasteClipboardInInputLine();
|
||||
}
|
||||
break;
|
||||
case KEY_ENTER:
|
||||
if (lineptr->inputstart < lineptr->inputpos) {
|
||||
lineptr->inputpos = 0;
|
||||
GenerateNodeString(lineptr);
|
||||
ConsoleCommandExecute(lineptr->buffer + lineptr->inputstart, 1);
|
||||
s_historyIndex = -1;
|
||||
}
|
||||
break;
|
||||
case KEY_BACKSPACE:
|
||||
lineptr->Backspace();
|
||||
break;
|
||||
case KEY_TAB:
|
||||
if (s_completionMode == 0) {
|
||||
s_completedCmd = nullptr;
|
||||
s_completionMode = 1;
|
||||
SStrCopy(s_partial, lineptr->buffer + lineptr->inputstart, STORM_MAX_STR);
|
||||
}
|
||||
if (ConsoleCommandComplete(s_partial, &s_completedCmd, SHIFT_MODIFIER(data))) {
|
||||
MakeCommandCurrent(lineptr, s_completedCmd);
|
||||
}
|
||||
SetInputString(lineptr->buffer);
|
||||
break;
|
||||
case KEY_LEFT:
|
||||
if (line->inputstart <= line->inputpos && line->inputpos != line->inputstart) {
|
||||
line->inputpos--;
|
||||
if (lineptr->inputstart < lineptr->inputpos) {
|
||||
lineptr->inputpos--;
|
||||
}
|
||||
break;
|
||||
case KEY_UP:
|
||||
lineptr->Up();
|
||||
break;
|
||||
case KEY_RIGHT:
|
||||
if (line->inputpos < line->chars) {
|
||||
line->inputpos++;
|
||||
if (lineptr->inputpos < lineptr->chars) {
|
||||
lineptr->inputpos++;
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY_BACKSPACE:
|
||||
BackspaceLine(line);
|
||||
case KEY_DOWN:
|
||||
lineptr->Down();
|
||||
break;
|
||||
case KEY_DELETE:
|
||||
lineptr->Delete();
|
||||
break;
|
||||
case KEY_HOME:
|
||||
if (CTRL_MODIFIER(data)) {
|
||||
s_currlineptr = s_linelist.Tail();
|
||||
} else {
|
||||
if (lineptr->inputpos > lineptr->inputstart) {
|
||||
lineptr->inputpos = lineptr->inputstart;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KEY_END:
|
||||
if (CTRL_MODIFIER(data)) {
|
||||
s_currlineptr = s_linelist.Head();
|
||||
} else {
|
||||
if (lineptr->inputpos < lineptr->chars) {
|
||||
lineptr->inputpos = lineptr->chars;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KEY_PAGEUP:
|
||||
MoveLinePtr(1, SHIFT_MODIFIER(data));
|
||||
break;
|
||||
case KEY_PAGEDOWN:
|
||||
MoveLinePtr(0, SHIFT_MODIFIER(data));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (data->key != KEY_TAB && data->key != KEY_LSHIFT && data->key != KEY_RSHIFT && data->key != KEY_LALT && data->key != KEY_RALT && !(data->metaKeyState & anyControl)) {
|
||||
// s_completionMode = 0;
|
||||
if (data->key != KEY_TAB
|
||||
&& data->key != KEY_LSHIFT
|
||||
&& data->key != KEY_RSHIFT
|
||||
&& data->key != KEY_LALT
|
||||
&& data->key != KEY_RALT
|
||||
&& !(CTRL_MODIFIER(data))) {
|
||||
s_completionMode = 0;
|
||||
ResetHighlight();
|
||||
}
|
||||
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -132,34 +177,52 @@ int32_t OnKeyDownRepeat(const EVENT_DATA_KEY* data, void* param) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto anyControl = (1 << KEY_LCONTROL) | (1 << KEY_RCONTROL);
|
||||
if (EventIsKeyDown(ConsoleGetHotKey()) || !ConsoleGetActive()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto line = GetInputLine();
|
||||
auto lineptr = GetInputLine();
|
||||
|
||||
switch (data->key) {
|
||||
case KEY_PAGEUP:
|
||||
MoveLinePtr(1, data->metaKeyState);
|
||||
break;
|
||||
case KEY_PAGEDOWN:
|
||||
MoveLinePtr(0, data->metaKeyState);
|
||||
case KEY_BACKSPACE:
|
||||
lineptr->Backspace();
|
||||
break;
|
||||
case KEY_LEFT:
|
||||
if (line->inputstart <= line->inputpos && line->inputpos != line->inputstart) {
|
||||
line->inputpos--;
|
||||
if (lineptr->inputstart < lineptr->inputpos) {
|
||||
lineptr->inputpos--;
|
||||
}
|
||||
break;
|
||||
case KEY_UP:
|
||||
lineptr->Up();
|
||||
break;
|
||||
case KEY_RIGHT:
|
||||
if (line->inputpos < line->chars) {
|
||||
line->inputpos++;
|
||||
if (lineptr->inputstart < lineptr->inputpos) {
|
||||
lineptr->inputpos++;
|
||||
}
|
||||
break;
|
||||
case KEY_BACKSPACE:
|
||||
BackspaceLine(line);
|
||||
case KEY_DOWN:
|
||||
lineptr->Down();
|
||||
break;
|
||||
case KEY_DELETE:
|
||||
lineptr->Delete();
|
||||
break;
|
||||
case KEY_PAGEUP:
|
||||
MoveLinePtr(1, SHIFT_MODIFIER(data));
|
||||
break;
|
||||
case KEY_PAGEDOWN:
|
||||
MoveLinePtr(0, SHIFT_MODIFIER(data));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (data->key != KEY_TAB && data->key != KEY_LSHIFT && data->key != KEY_RSHIFT && data->key != KEY_LALT && data->key != KEY_RALT && !(data->metaKeyState & anyControl)) {
|
||||
// s_completionMode = 0;
|
||||
if (data->key != KEY_TAB
|
||||
&& data->key != KEY_LSHIFT
|
||||
&& data->key != KEY_RSHIFT
|
||||
&& data->key != KEY_LALT
|
||||
&& data->key != KEY_RALT
|
||||
&& !(CTRL_MODIFIER(data))) {
|
||||
s_completionMode = 0;
|
||||
ResetHighlight();
|
||||
}
|
||||
|
||||
@ -167,51 +230,50 @@ int32_t OnKeyDownRepeat(const EVENT_DATA_KEY* data, void* param) {
|
||||
}
|
||||
|
||||
int32_t OnKeyUp(const EVENT_DATA_KEY* data, void* param) {
|
||||
// TODO
|
||||
return 1;
|
||||
if (data->key == ConsoleGetHotKey()) {
|
||||
if (ConsoleAccessGetEnabled()) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return !ConsoleGetActive();
|
||||
}
|
||||
|
||||
int32_t OnMouseDown(const EVENT_DATA_MOUSE* data, void* param) {
|
||||
auto consoleHeight = ConsoleGetHeight();
|
||||
auto fontHeight = ConsoleGetFontHeight();
|
||||
|
||||
if (EventIsKeyDown(ConsoleGetHotKey()) || !ConsoleGetActive() || (1.0f - consoleHeight) > data->y) {
|
||||
if (EventIsKeyDown(ConsoleGetHotKey()) || !ConsoleGetActive() || (1.0f - s_consoleHeight) > data->y) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
float clickPos = 1.0f - data->y;
|
||||
|
||||
if (clickPos < (std::min(consoleHeight, 1.0f) - (fontHeight * 0.75f)) || clickPos > consoleHeight) {
|
||||
if (clickPos < (std::min(s_consoleHeight, 1.0f) - (s_fontHeight * 0.75f)) || clickPos > s_consoleHeight) {
|
||||
ResetHighlight();
|
||||
|
||||
auto line = GetLineAtMousePosition(data->y);
|
||||
auto lineptr = GetLineAtMousePosition(data->y);
|
||||
|
||||
if (line) {
|
||||
SetHighlightCopyText(line->buffer);
|
||||
SetHighlightState(HS_HIGHLIGHTING);
|
||||
if (lineptr) {
|
||||
SStrCopy(s_copyText, lineptr->buffer, CONSOLE_HIGHLIGHT_CLIPBOARD_SIZE);
|
||||
s_highlightState = HS_HIGHLIGHTING;
|
||||
|
||||
float v7 = 1.0f - (consoleHeight - (fontHeight * 0.75f) - (fontHeight) - ((consoleHeight - clickPos) / fontHeight - 1.0) * fontHeight);
|
||||
float v7 = 1.0f - (s_consoleHeight - (s_fontHeight * 0.75f) - (s_fontHeight) - ((s_consoleHeight - clickPos) / s_fontHeight - 1.0) * s_fontHeight);
|
||||
|
||||
auto hRect = GetHighlightRect();
|
||||
s_hRect.bottom = v7;
|
||||
s_hRect.top = v7 - s_fontHeight;
|
||||
|
||||
hRect.bottom = v7;
|
||||
hRect.top = v7 - fontHeight;
|
||||
|
||||
SetHighlightStart(v7);
|
||||
SetHighlightEnd(v7);
|
||||
s_highlightHStart = v7;
|
||||
s_highlightHEnd = v7;
|
||||
|
||||
UpdateHighlight();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
ResetHighlightCopyText();
|
||||
s_copyText[0] = '\0';
|
||||
return 0;
|
||||
}
|
||||
|
||||
ResetHighlight();
|
||||
|
||||
ConsoleSetResizeState(CS_STRETCH);
|
||||
s_consoleResizeState = CS_STRETCH;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -221,16 +283,16 @@ int32_t OnMouseMove(const EVENT_DATA_MOUSE* data, void* param) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ConsoleGetResizeState() == CS_STRETCH) {
|
||||
auto newHeight = std::max(1.0f - data->y, ConsoleGetFontHeight());
|
||||
ConsoleSetHeight(newHeight);
|
||||
} else if ((1.0f - ConsoleGetHeight()) > data->y) {
|
||||
if (s_consoleResizeState == CS_STRETCH) {
|
||||
auto newHeight = std::max(1.0f - data->y, s_fontHeight);
|
||||
s_consoleHeight = newHeight;
|
||||
} else if ((1.0f - s_consoleHeight) > data->y) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
SetHighlightEnd(data->x);
|
||||
s_highlightHEnd = data->x;
|
||||
|
||||
if (GetHighlightState() == HS_HIGHLIGHTING) {
|
||||
if (s_highlightState == HS_HIGHLIGHTING) {
|
||||
UpdateHighlight();
|
||||
}
|
||||
|
||||
@ -242,8 +304,8 @@ int32_t OnMouseUp(const EVENT_DATA_MOUSE* data, void* param) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
SetHighlightState(HS_ENDHIGHLIGHT);
|
||||
ConsoleSetResizeState(CS_NONE);
|
||||
s_highlightState = HS_ENDHIGHLIGHT;
|
||||
s_consoleResizeState = CS_NONE;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
59
src/console/Highlight.cpp
Normal file
59
src/console/Highlight.cpp
Normal file
@ -0,0 +1,59 @@
|
||||
#include "console/Highlight.hpp"
|
||||
#include "console/Text.hpp"
|
||||
#include "os/Clipboard.hpp"
|
||||
|
||||
HIGHLIGHTSTATE s_highlightState = HS_NONE;
|
||||
RECTF s_hRect = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||
float s_highlightHStart = 0.0f;
|
||||
float s_highlightHEnd = 0.0f;
|
||||
uint32_t s_highlightLeftCharIndex = 0;
|
||||
uint32_t s_highlightRightCharIndex = 0;
|
||||
int32_t s_highlightInput = 0;
|
||||
char s_copyText[CONSOLE_HIGHLIGHT_CLIPBOARD_SIZE] = { 0 };
|
||||
|
||||
void ResetHighlight() {
|
||||
s_highlightState = HS_NONE;
|
||||
s_hRect = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||
}
|
||||
|
||||
void UpdateHighlight() {
|
||||
auto font = TextBlockGetFontPtr(s_textFont);
|
||||
STORM_ASSERT(font);
|
||||
|
||||
auto len = SStrLen(s_copyText);
|
||||
|
||||
float left = std::min(s_highlightHStart, s_highlightHEnd);
|
||||
float right = std::max(s_highlightHStart, s_highlightHEnd);
|
||||
|
||||
auto chars = GxuFontGetMaxCharsWithinWidth(font, s_copyText, s_fontHeight, left, len, &s_hRect.left, 0.0f, 1.0f, s_charSpacing, s_baseTextFlags);
|
||||
|
||||
s_highlightLeftCharIndex = chars;
|
||||
|
||||
if (chars) {
|
||||
s_highlightRightCharIndex = chars - 1;
|
||||
}
|
||||
|
||||
if (s_hRect.left < 0.015f) {
|
||||
s_hRect.left = 0.0f;
|
||||
}
|
||||
|
||||
s_highlightRightCharIndex = GxuFontGetMaxCharsWithinWidth(font, s_copyText, s_fontHeight, right, len, &s_hRect.right, 0.0f, 1.0f, s_charSpacing, s_baseTextFlags);
|
||||
}
|
||||
|
||||
void CopyHighlightToClipboard() {
|
||||
char buffer[CONSOLE_HIGHLIGHT_CLIPBOARD_SIZE];
|
||||
|
||||
if (s_copyText[0] != '\0') {
|
||||
auto highlightWidth = s_highlightRightCharIndex - s_highlightLeftCharIndex;
|
||||
if (highlightWidth >= (CONSOLE_HIGHLIGHT_CLIPBOARD_SIZE-1)) {
|
||||
highlightWidth = CONSOLE_HIGHLIGHT_CLIPBOARD_SIZE-1;
|
||||
}
|
||||
|
||||
SStrCopy(buffer, &s_copyText[s_highlightLeftCharIndex], highlightWidth);
|
||||
buffer[highlightWidth] = '\0';
|
||||
|
||||
OsClipboardPutString(buffer);
|
||||
}
|
||||
|
||||
ResetHighlight();
|
||||
}
|
||||
31
src/console/Highlight.hpp
Normal file
31
src/console/Highlight.hpp
Normal file
@ -0,0 +1,31 @@
|
||||
#ifndef CONSOLE_HIGHLIGHT_HPP
|
||||
#define CONSOLE_HIGHLIGHT_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include <storm/Region.hpp>
|
||||
|
||||
#define CONSOLE_HIGHLIGHT_CLIPBOARD_SIZE 128
|
||||
|
||||
enum HIGHLIGHTSTATE {
|
||||
HS_NONE = 0,
|
||||
HS_HIGHLIGHTING = 1,
|
||||
HS_ENDHIGHLIGHT = 2,
|
||||
NUM_HIGHLIGHTSTATES
|
||||
};
|
||||
|
||||
extern HIGHLIGHTSTATE s_highlightState;
|
||||
extern RECTF s_hRect;
|
||||
extern float s_highlightHStart;
|
||||
extern float s_highlightHEnd;
|
||||
extern uint32_t s_highlightLeftCharIndex;
|
||||
extern uint32_t s_highlightRightCharIndex;
|
||||
extern int32_t s_highlightInput;
|
||||
extern char s_copyText[CONSOLE_HIGHLIGHT_CLIPBOARD_SIZE];
|
||||
|
||||
void ResetHighlight();
|
||||
|
||||
void UpdateHighlight();
|
||||
|
||||
void CopyHighlightToClipboard();
|
||||
|
||||
#endif
|
||||
@ -1,24 +1,203 @@
|
||||
|
||||
#include "console/Line.hpp"
|
||||
#include "console/Types.hpp"
|
||||
#include "console/Console.hpp"
|
||||
#include "console/Highlight.hpp"
|
||||
#include "console/Line.hpp"
|
||||
#include "console/Command.hpp"
|
||||
#include "console/Text.hpp"
|
||||
#include "console/Screen.hpp"
|
||||
#include "gx/Device.hpp"
|
||||
|
||||
#include <storm/List.hpp>
|
||||
#include <storm/thread/SCritSect.hpp>
|
||||
|
||||
#include <cstdio>
|
||||
#include "os/Clipboard.hpp"
|
||||
#include <bc/Memory.hpp>
|
||||
#include <storm/Thread.hpp>
|
||||
#include <cstdarg>
|
||||
#include <cstdio>
|
||||
|
||||
static SCritSect s_critsect;
|
||||
// In this list:
|
||||
// The head = the input line.
|
||||
// The tail = the oldest line printed.
|
||||
static STORM_LIST(CONSOLELINE) s_linelist;
|
||||
// Pointer to the current line. Determines what region of the console history gets rendered.
|
||||
static CONSOLELINE* s_currlineptr = nullptr;
|
||||
static uint32_t s_NumLines = 0;
|
||||
int32_t s_historyIndex = 0;
|
||||
// in this list
|
||||
// head = the input line
|
||||
// tail = the oldest line
|
||||
STORM_LIST(CONSOLELINE) s_linelist;
|
||||
CONSOLELINE* s_currlineptr;
|
||||
uint32_t s_NumLines = 0;
|
||||
SCritSect s_critsect;
|
||||
|
||||
void CONSOLELINE::Up() {
|
||||
if ((ConsoleCommandHistoryDepth() - 1) == s_historyIndex) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto previous = ConsoleCommandHistory(s_historyIndex + 1);
|
||||
|
||||
if (previous) {
|
||||
MakeCommandCurrent(this, previous);
|
||||
s_historyIndex++;
|
||||
SetInputString(this->buffer);
|
||||
}
|
||||
}
|
||||
|
||||
void CONSOLELINE::Down() {
|
||||
if (s_historyIndex == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
const char* next;
|
||||
|
||||
if (s_historyIndex == 0) {
|
||||
next = "";
|
||||
} else {
|
||||
if (!(next = ConsoleCommandHistory(s_historyIndex - 1))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
MakeCommandCurrent(this, next);
|
||||
s_historyIndex--;
|
||||
SetInputString(this->buffer);
|
||||
}
|
||||
|
||||
void CONSOLELINE::Delete() {
|
||||
if (this->inputpos > this->chars) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto pos = this->inputpos;
|
||||
memmove(this->buffer + pos, this->buffer + pos + 1, this->chars - pos);
|
||||
this->chars--;
|
||||
SetInputString(this->buffer);
|
||||
}
|
||||
|
||||
void CONSOLELINE::Backspace() {
|
||||
auto pos = this->inputpos;
|
||||
|
||||
if (this->inputstart >= pos) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pos < this->chars) {
|
||||
memmove(this->buffer + pos - 1, this->buffer + pos, (this->chars - pos) + 1);
|
||||
} else {
|
||||
this->buffer[pos - 1] = '\0';
|
||||
}
|
||||
|
||||
this->inputpos--;
|
||||
this->chars--;
|
||||
SetInputString(this->buffer);
|
||||
}
|
||||
|
||||
CONSOLELINE::~CONSOLELINE() {
|
||||
if (this->buffer) {
|
||||
FREE(this->buffer);
|
||||
}
|
||||
|
||||
if (this->fontPointer) {
|
||||
GxuFontDestroyString(this->fontPointer);
|
||||
}
|
||||
}
|
||||
|
||||
void GenerateNodeString(CONSOLELINE* node) {
|
||||
auto font = TextBlockGetFontPtr(s_textFont);
|
||||
|
||||
if (font && node && node->buffer && node->buffer[0] != '\0') {
|
||||
if (node->fontPointer) {
|
||||
GxuFontDestroyString(node->fontPointer);
|
||||
}
|
||||
|
||||
C3Vector pos = {
|
||||
0.0f, 0.0f, 1.0f
|
||||
};
|
||||
|
||||
GxuFontCreateString(
|
||||
font,
|
||||
node->buffer,
|
||||
s_fontHeight,
|
||||
pos,
|
||||
1.0f,
|
||||
s_fontHeight,
|
||||
0.0f,
|
||||
node->fontPointer,
|
||||
GxVJ_Middle, GxHJ_Left,
|
||||
s_baseTextFlags,
|
||||
s_colorArray[node->colorType],
|
||||
s_charSpacing,
|
||||
1.0f);
|
||||
|
||||
STORM_ASSERT(node->fontPointer);
|
||||
}
|
||||
}
|
||||
|
||||
void SetInputString(const char* buffer) {
|
||||
if (s_inputString) {
|
||||
GxuFontDestroyString(s_inputString);
|
||||
}
|
||||
s_inputString = nullptr;
|
||||
|
||||
if (buffer && buffer[0] != '\0') {
|
||||
C3Vector pos = { 0.0f, 0.0f, 1.0f };
|
||||
|
||||
auto font = TextBlockGetFontPtr(s_textFont);
|
||||
|
||||
GxuFontCreateString(
|
||||
font,
|
||||
buffer,
|
||||
s_fontHeight,
|
||||
pos,
|
||||
1.0f,
|
||||
s_fontHeight,
|
||||
0.0f,
|
||||
s_inputString,
|
||||
GxVJ_Middle, GxHJ_Left,
|
||||
s_baseTextFlags,
|
||||
s_colorArray[INPUT_COLOR],
|
||||
s_charSpacing,
|
||||
1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void ReserveInputSpace(CONSOLELINE* line, uint32_t chars) {
|
||||
size_t newsize = line->chars + chars;
|
||||
if (newsize >= line->charsalloc) {
|
||||
while (line->charsalloc <= newsize) {
|
||||
line->charsalloc += CONSOLE_LINE_EXTRA_BYTES;
|
||||
}
|
||||
|
||||
auto buffer = reinterpret_cast<char*>(ALLOC(line->charsalloc));
|
||||
SStrCopy(buffer, line->buffer, line->charsalloc);
|
||||
FREE(line->buffer);
|
||||
line->buffer = buffer;
|
||||
}
|
||||
}
|
||||
|
||||
void MoveLinePtr(int32_t direction, int32_t modifier) {
|
||||
auto lineptr = s_currlineptr;
|
||||
|
||||
if (modifier == 1) {
|
||||
for (int32_t i = 0; i < 10 && lineptr != nullptr; i++) {
|
||||
lineptr = direction == 1 ? lineptr->m_link.Next() : lineptr->m_link.Prev();
|
||||
}
|
||||
} else {
|
||||
lineptr = direction == 1 ? lineptr->m_link.Next() : lineptr->m_link.Prev();
|
||||
}
|
||||
|
||||
if (lineptr) {
|
||||
s_currlineptr = lineptr;
|
||||
}
|
||||
}
|
||||
|
||||
void MakeCommandCurrent(CONSOLELINE* lineptr, const char* command) {
|
||||
auto len = lineptr->inputstart;
|
||||
lineptr->inputpos = len;
|
||||
lineptr->chars = len;
|
||||
lineptr->buffer[len] = '\0';
|
||||
|
||||
len = SStrLen(command);
|
||||
ReserveInputSpace(lineptr, len);
|
||||
|
||||
SStrCopy(lineptr->buffer + lineptr->inputpos, command, STORM_MAX_STR);
|
||||
|
||||
len = lineptr->inputpos + len;
|
||||
lineptr->inputpos = len;
|
||||
lineptr->chars = len;
|
||||
}
|
||||
|
||||
void EnforceMaxLines() {
|
||||
if (s_NumLines <= CONSOLE_LINES_MAX) {
|
||||
@ -27,17 +206,11 @@ void EnforceMaxLines() {
|
||||
|
||||
// Pop oldest line off the list
|
||||
auto lineptr = s_linelist.Tail();
|
||||
|
||||
if (lineptr == nullptr) {
|
||||
lineptr = s_currlineptr;
|
||||
if (lineptr == s_currlineptr) {
|
||||
s_currlineptr = lineptr->Prev();
|
||||
}
|
||||
|
||||
if (lineptr == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clean up oldest line.
|
||||
s_linelist.UnlinkNode(lineptr);
|
||||
// Clean up oldest line
|
||||
s_linelist.DeleteNode(lineptr);
|
||||
|
||||
s_NumLines--;
|
||||
@ -47,37 +220,36 @@ CONSOLELINE* GetInputLine() {
|
||||
auto head = s_linelist.Head();
|
||||
|
||||
// If the list is empty, or the list's head is an entered input-line,
|
||||
// Create a fresh input line, with "> " prefixed before the caret.
|
||||
if (!head || head->inputpos == 0) {
|
||||
auto l = SMemAlloc(sizeof(CONSOLELINE), __FILE__, __LINE__, 0);
|
||||
auto line = new(l) CONSOLELINE();
|
||||
line->buffer = reinterpret_cast<char*>(SMemAlloc(CONSOLE_LINE_PREALLOC, __FILE__, __LINE__, 0));
|
||||
line->charsalloc = CONSOLE_LINE_PREALLOC;
|
||||
|
||||
s_linelist.LinkToHead(line);
|
||||
|
||||
SStrCopy(line->buffer, "> ", line->charsalloc);
|
||||
SetInputString(line->buffer);
|
||||
auto chars = SStrLen(line->buffer);
|
||||
s_NumLines++;
|
||||
line->inputstart = chars;
|
||||
line->inputpos = chars;
|
||||
line->chars = chars;
|
||||
line->colorType = INPUT_COLOR;
|
||||
|
||||
s_currlineptr = line;
|
||||
|
||||
EnforceMaxLines();
|
||||
|
||||
return line;
|
||||
// Create a fresh input line, with "> " prefixed before the caret
|
||||
if (head && head->inputpos != 0) {
|
||||
return head;
|
||||
}
|
||||
|
||||
return head;
|
||||
auto line = NEW(CONSOLELINE);
|
||||
line->buffer = reinterpret_cast<char*>(ALLOC(CONSOLE_LINE_EXTRA_BYTES));
|
||||
line->charsalloc = CONSOLE_LINE_EXTRA_BYTES;
|
||||
|
||||
s_linelist.LinkToHead(line);
|
||||
s_NumLines++;
|
||||
|
||||
SStrCopy(line->buffer, "> ", line->charsalloc);
|
||||
SetInputString(line->buffer);
|
||||
auto chars = SStrLen(line->buffer);
|
||||
line->inputstart = chars;
|
||||
line->inputpos = chars;
|
||||
line->chars = chars;
|
||||
line->colorType = INPUT_COLOR;
|
||||
|
||||
s_currlineptr = line;
|
||||
|
||||
EnforceMaxLines();
|
||||
|
||||
return line;
|
||||
}
|
||||
|
||||
CONSOLELINE* GetLineAtMousePosition(float y) {
|
||||
// Loop through linelist to find line at mouse position
|
||||
int32_t linePos = static_cast<int32_t>((ConsoleGetHeight() - (1.0 - y)) / ConsoleGetFontHeight());
|
||||
auto linePos = static_cast<int32_t>((s_consoleHeight - (1.0 - y)) / s_fontHeight);
|
||||
|
||||
if (linePos == 1) {
|
||||
return s_linelist.Head();
|
||||
@ -87,7 +259,7 @@ CONSOLELINE* GetLineAtMousePosition(float y) {
|
||||
linePos--;
|
||||
}
|
||||
|
||||
CONSOLELINE* line = s_currlineptr;
|
||||
auto line = s_currlineptr;
|
||||
|
||||
while (linePos > 1) {
|
||||
linePos--;
|
||||
@ -106,32 +278,73 @@ CONSOLELINE* GetLineAtMousePosition(float y) {
|
||||
return line;
|
||||
}
|
||||
|
||||
void ReserveInputSpace(CONSOLELINE* line, size_t len) {
|
||||
size_t newsize = line->chars + len;
|
||||
if (newsize >= line->charsalloc) {
|
||||
while (line->charsalloc <= newsize) {
|
||||
line->charsalloc += CONSOLE_LINE_PREALLOC;
|
||||
void PasteInInputLine(const char* characters) {
|
||||
auto len = SStrLen(characters);
|
||||
|
||||
if (!len) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto line = GetInputLine();
|
||||
|
||||
ReserveInputSpace(line, len);
|
||||
|
||||
if (line->inputpos < line->chars) {
|
||||
if (len <= 1) {
|
||||
memmove(&line->buffer[line->inputpos + 1], &line->buffer[line->inputpos], line->chars - (line->inputpos + 1));
|
||||
|
||||
line->buffer[line->inputpos] = *characters;
|
||||
|
||||
line->inputpos++;
|
||||
line->chars++;
|
||||
} else {
|
||||
auto input = reinterpret_cast<char*>(ALLOC(line->charsalloc));
|
||||
SStrCopy(input, &line->buffer[line->inputpos], STORM_MAX_STR);
|
||||
|
||||
auto buffer = reinterpret_cast<char*>(ALLOC(line->charsalloc));
|
||||
SStrCopy(buffer, line->buffer, STORM_MAX_STR);
|
||||
buffer[line->inputpos] = '\0';
|
||||
|
||||
SStrPack(buffer, characters, line->charsalloc);
|
||||
|
||||
auto len = SStrLen(buffer);
|
||||
|
||||
line->inputpos = len;
|
||||
|
||||
SStrPack(buffer, input, line->charsalloc);
|
||||
SStrCopy(line->buffer, buffer, STORM_MAX_STR);
|
||||
|
||||
line->chars = SStrLen(line->buffer);
|
||||
|
||||
if (input) {
|
||||
FREE(input);
|
||||
}
|
||||
|
||||
if (buffer) {
|
||||
FREE(buffer);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int32_t i = 0; i < len; i++) {
|
||||
line->buffer[line->inputpos++] = characters[i];
|
||||
}
|
||||
|
||||
auto buffer = reinterpret_cast<char*>(SMemAlloc(line->charsalloc, __FILE__, __LINE__, 0));
|
||||
SStrCopy(buffer, line->buffer, line->charsalloc);
|
||||
SMemFree(line->buffer, __FILE__, __LINE__, 0x0);
|
||||
line->buffer = buffer;
|
||||
line->buffer[line->inputpos] = '\0';
|
||||
line->chars = line->inputpos;
|
||||
}
|
||||
|
||||
SetInputString(line->buffer);
|
||||
}
|
||||
|
||||
void ConsoleWrite(const char* str, COLOR_T color) {
|
||||
if (g_theGxDevicePtr == nullptr || str[0] == '\0') {
|
||||
if (!str || !*str || !GxDevExists() || !s_textFont) {
|
||||
return;
|
||||
}
|
||||
|
||||
s_critsect.Enter();
|
||||
|
||||
auto l = reinterpret_cast<char*>(SMemAlloc(sizeof(CONSOLELINE), __FILE__, __LINE__, 0));
|
||||
auto lineptr = new(l) CONSOLELINE();
|
||||
|
||||
auto lineptr = NEW(CONSOLELINE);
|
||||
auto head = s_linelist.Head();
|
||||
|
||||
if (head == nullptr || head->inputpos == 0) {
|
||||
// Attach console line to head
|
||||
s_linelist.LinkToHead(lineptr);
|
||||
@ -143,21 +356,31 @@ void ConsoleWrite(const char* str, COLOR_T color) {
|
||||
size_t len = SStrLen(str) + 1;
|
||||
lineptr->chars = len;
|
||||
lineptr->charsalloc = len;
|
||||
lineptr->buffer = reinterpret_cast<char*>(SMemAlloc(len, __FILE__, __LINE__, 0));
|
||||
lineptr->buffer = reinterpret_cast<char*>(ALLOC(len));
|
||||
lineptr->colorType = color;
|
||||
|
||||
SStrCopy(lineptr->buffer, str, STORM_MAX_STR);
|
||||
|
||||
GenerateNodeString(lineptr);
|
||||
|
||||
s_NumLines++;
|
||||
|
||||
EnforceMaxLines();
|
||||
//
|
||||
|
||||
s_critsect.Leave();
|
||||
}
|
||||
|
||||
void ConsolePrintf(const char* str, ...) {
|
||||
char buffer[1024] = {0};
|
||||
|
||||
if (str != nullptr && str[0] != '\0') {
|
||||
va_list list;
|
||||
va_start(list, str);
|
||||
vsnprintf(buffer, sizeof(buffer), str, list);
|
||||
va_end(list);
|
||||
|
||||
ConsoleWrite(buffer, DEFAULT_COLOR);
|
||||
}
|
||||
}
|
||||
|
||||
void ConsoleWriteA(const char* str, COLOR_T color, ...) {
|
||||
char buffer[1024] = {0};
|
||||
|
||||
@ -171,91 +394,16 @@ void ConsoleWriteA(const char* str, COLOR_T color, ...) {
|
||||
}
|
||||
}
|
||||
|
||||
void ConsolePrintf(char const* str, ...) {
|
||||
char buffer[4096] = { 0 };
|
||||
|
||||
if (str != nullptr && str[0] != '\0') {
|
||||
va_list list;
|
||||
va_start(list, str);
|
||||
vsnprintf(buffer, sizeof(buffer), str, list);
|
||||
va_end(list);
|
||||
|
||||
ConsoleWrite(buffer, DEFAULT_COLOR);
|
||||
}
|
||||
}
|
||||
|
||||
void MoveLinePtr(int32_t direction, int32_t modifier) {
|
||||
CONSOLELINE* lineptr = s_currlineptr;
|
||||
|
||||
auto anyControl = (1 << KEY_LCONTROL) | (1 << KEY_RCONTROL);
|
||||
|
||||
if (modifier & anyControl) {
|
||||
for (int32_t i = 0; i < 10 && lineptr != nullptr; i++) {
|
||||
CONSOLELINE* next;
|
||||
|
||||
if (direction == 1) {
|
||||
next = lineptr->m_link.Next();
|
||||
} else {
|
||||
next = lineptr->m_link.Prev();
|
||||
}
|
||||
|
||||
if (next != nullptr) {
|
||||
lineptr = next;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// if (s_currlineptr == s_linelist.Head()) {
|
||||
// s_currlineptr = s_currlineptr->Prev();
|
||||
// }
|
||||
|
||||
if (direction == 1) {
|
||||
lineptr = lineptr->m_link.Next();
|
||||
} else {
|
||||
lineptr = lineptr->m_link.Prev();
|
||||
}
|
||||
}
|
||||
|
||||
if (lineptr) {
|
||||
s_currlineptr = lineptr;
|
||||
}
|
||||
}
|
||||
|
||||
void BackspaceLine(CONSOLELINE* line) {
|
||||
if (line->inputstart <= line->inputpos && line->inputpos != line->inputstart) {
|
||||
if (line->inputpos < line->chars) {
|
||||
memmove(line->buffer + line->inputpos + -1, line->buffer + line->inputpos, (line->chars - line->inputpos) + 1);
|
||||
} else {
|
||||
line->buffer[line->inputpos - 1] = '\0';
|
||||
}
|
||||
line->chars--;
|
||||
line->inputpos--;
|
||||
|
||||
SetInputString(line->buffer);
|
||||
}
|
||||
}
|
||||
|
||||
CONSOLELINE* GetCurrentLine() {
|
||||
return s_currlineptr;
|
||||
}
|
||||
|
||||
CONSOLELINE::~CONSOLELINE() {
|
||||
if (this->buffer) {
|
||||
SMemFree(this->buffer, __FILE__, __LINE__, 0);
|
||||
}
|
||||
|
||||
if (this->fontPointer) {
|
||||
GxuFontDestroyString(this->fontPointer);
|
||||
void PasteClipboardInInputLine() {
|
||||
auto str = OsClipboardGetString();
|
||||
if (str) {
|
||||
PasteInInputLine(str);
|
||||
FREE(str);
|
||||
ResetHighlight();
|
||||
}
|
||||
}
|
||||
|
||||
void ConsoleClear() {
|
||||
s_NumLines = 0;
|
||||
|
||||
auto ptr = s_linelist.Head();
|
||||
|
||||
while (ptr) {
|
||||
s_linelist.UnlinkNode(ptr);
|
||||
s_linelist.DeleteNode(ptr);
|
||||
ptr = s_linelist.Head();
|
||||
}
|
||||
s_linelist.Clear();
|
||||
}
|
||||
|
||||
@ -4,28 +4,59 @@
|
||||
#include "console/Types.hpp"
|
||||
|
||||
#include <storm/List.hpp>
|
||||
#include <storm/Thread.hpp>
|
||||
|
||||
#define CONSOLE_LINES_MAX 256
|
||||
#define CONSOLE_LINE_LENGTH 1024
|
||||
#define CONSOLE_LINE_PREALLOC 16
|
||||
#define CONSOLE_LINE_EXTRA_BYTES 16
|
||||
|
||||
void ConsoleWrite(const char* str, COLOR_T color);
|
||||
void ConsoleWriteA(const char* str, COLOR_T color, ...);
|
||||
void ConsolePrintf(char const* str, ...);
|
||||
class CONSOLELINE : public TSLinkedNode<CONSOLELINE> {
|
||||
public:
|
||||
char* buffer = nullptr;
|
||||
uint32_t chars = 0;
|
||||
uint32_t charsalloc = 0;
|
||||
uint32_t inputpos = 0;
|
||||
uint32_t inputstart = 0;
|
||||
COLOR_T colorType = DEFAULT_COLOR;
|
||||
CGxString* fontPointer = nullptr;
|
||||
|
||||
void PasteInInputLine(char* characters);
|
||||
void Up();
|
||||
void Down();
|
||||
void Delete();
|
||||
void Backspace();
|
||||
~CONSOLELINE();
|
||||
};
|
||||
|
||||
extern int32_t s_historyIndex;
|
||||
extern STORM_LIST(CONSOLELINE) s_linelist;
|
||||
extern CONSOLELINE* s_currlineptr;
|
||||
extern uint32_t s_NumLines;
|
||||
extern SCritSect s_critsect;
|
||||
|
||||
void GenerateNodeString(CONSOLELINE* node);
|
||||
|
||||
void SetInputString(const char* buffer);
|
||||
|
||||
void ReserveInputSpace(CONSOLELINE* lineptr, uint32_t len);
|
||||
|
||||
void MoveLinePtr(int32_t direction, int32_t modifier);
|
||||
|
||||
void BackspaceLine(CONSOLELINE* line);
|
||||
|
||||
void ReserveInputSpace(CONSOLELINE* line, size_t len);
|
||||
void MakeCommandCurrent(CONSOLELINE* lineptr, const char* command);
|
||||
|
||||
CONSOLELINE* GetInputLine();
|
||||
CONSOLELINE* GetCurrentLine();
|
||||
|
||||
CONSOLELINE* GetLineAtMousePosition(float y);
|
||||
|
||||
void ConsoleClear();
|
||||
void PasteInInputLine(const char* characters);
|
||||
|
||||
void PasteClipboardInInputLine();
|
||||
|
||||
// void BackspaceLine(CONSOLELINE* line);
|
||||
|
||||
// CONSOLELINE* GetCurrentLine();
|
||||
|
||||
// CONSOLELINE* GetLineAtMousePosition(float y);
|
||||
|
||||
// void ConsoleClear();
|
||||
|
||||
#endif
|
||||
|
||||
@ -2,7 +2,9 @@
|
||||
#include "console/Console.hpp"
|
||||
#include "console/Command.hpp"
|
||||
#include "console/Handlers.hpp"
|
||||
#include "console/Highlight.hpp"
|
||||
#include "console/Line.hpp"
|
||||
#include "console/Text.hpp"
|
||||
#include "console/Types.hpp"
|
||||
#include "gx/Buffer.hpp"
|
||||
#include "gx/Coordinate.hpp"
|
||||
@ -17,30 +19,15 @@
|
||||
#include <tempest/Rect.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
static CGxStringBatch* s_batch;
|
||||
static uint32_t s_baseTextFlags = 0x8;
|
||||
static int32_t s_caret = 0;
|
||||
static float s_caretpixwidth;
|
||||
static float s_caretpixheight;
|
||||
static float s_charSpacing = 0.0f;
|
||||
static CGxString* s_inputString = nullptr;
|
||||
|
||||
static char s_fontName[STORM_MAX_PATH];
|
||||
static HLAYER s_layerBackground;
|
||||
static HLAYER s_layerText;
|
||||
static RECTF s_rect = { 0.0f, 1.0f, 1.0f, 1.0f };
|
||||
static HTEXTFONT s_textFont;
|
||||
|
||||
static HIGHLIGHTSTATE s_highlightState = HS_NONE;
|
||||
static RECTF s_hRect = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||
static float s_highlightHStart = 0.0f;
|
||||
static float s_highlightHEnd = 0.0f;
|
||||
static uint32_t s_highlightLeftCharIndex = 0;
|
||||
static uint32_t s_highlightRightCharIndex = 0;
|
||||
static int32_t s_highlightInput = 0;
|
||||
static char s_copyText[HIGHLIGHT_COPY_SIZE] = { 0 };
|
||||
float s_consoleLines = 10.0f;
|
||||
float s_consoleHeight = s_consoleLines * s_fontHeight;
|
||||
CONSOLERESIZESTATE s_consoleResizeState = CS_NONE;
|
||||
|
||||
static CImVector s_colorArray[] = {
|
||||
CImVector s_colorArray[NUM_COLORTYPES] = {
|
||||
{ 0xFF, 0xFF, 0xFF, 0xFF }, // DEFAULT_COLOR
|
||||
{ 0xFF, 0xFF, 0xFF, 0xFF }, // INPUT_COLOR
|
||||
{ 0x80, 0x80, 0x80, 0xFF }, // ECHO_COLOR
|
||||
@ -116,7 +103,7 @@ void DrawCaret(C3Vector& caretpos) {
|
||||
float minY = caretpos.y;
|
||||
|
||||
float maxX = caretpos.x + (s_caretpixwidth * 2);
|
||||
float maxY = caretpos.y + ConsoleGetFontHeight();
|
||||
float maxY = caretpos.y + s_fontHeight;
|
||||
|
||||
C3Vector position[] = {
|
||||
{ minX, minY, 0.0f },
|
||||
@ -153,107 +140,6 @@ void PaintBackground(void* param, const RECTF* rect, const RECTF* visible, float
|
||||
}
|
||||
}
|
||||
|
||||
void SetInputString(char* buffer) {
|
||||
// s_highlightState = HS_NONE;
|
||||
// s_hRect = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||
// s_highlightLeftCharIndex = 0;
|
||||
// s_highlightRightCharIndex = 0;
|
||||
// s_highlightInput = 0;
|
||||
|
||||
if (s_inputString) {
|
||||
GxuFontDestroyString(s_inputString);
|
||||
}
|
||||
|
||||
s_inputString = nullptr;
|
||||
|
||||
auto fontHeight = ConsoleGetFontHeight();
|
||||
|
||||
if (buffer && buffer[0] != '\0') {
|
||||
C3Vector pos = { 0.0f, 0.0f, 1.0f };
|
||||
|
||||
auto font = TextBlockGetFontPtr(s_textFont);
|
||||
|
||||
GxuFontCreateString(font, buffer, fontHeight, pos, 1.0f, fontHeight, 0.0f, s_inputString, GxVJ_Middle, GxHJ_Left, s_baseTextFlags, s_colorArray[INPUT_COLOR], s_charSpacing, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void PasteInInputLine(char* characters) {
|
||||
auto len = SStrLen(characters);
|
||||
|
||||
if (!len) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto line = GetInputLine();
|
||||
|
||||
ReserveInputSpace(line, len);
|
||||
|
||||
if (line->inputpos < line->chars) {
|
||||
if (len <= 1) {
|
||||
memmove(&line->buffer[line->inputpos + 1], &line->buffer[line->inputpos], line->chars - (line->inputpos + 1));
|
||||
|
||||
line->buffer[line->inputpos] = *characters;
|
||||
|
||||
line->inputpos++;
|
||||
line->chars++;
|
||||
} else {
|
||||
auto input = reinterpret_cast<char*>(SMemAlloc(line->charsalloc, __FILE__, __LINE__, 0x0));
|
||||
SStrCopy(input, &line->buffer[line->inputpos], STORM_MAX_STR);
|
||||
|
||||
auto buffer = reinterpret_cast<char*>(SMemAlloc(line->charsalloc, __FILE__, __LINE__, 0x0));
|
||||
SStrCopy(buffer, line->buffer, STORM_MAX_STR);
|
||||
buffer[line->inputpos] = '\0';
|
||||
|
||||
SStrPack(buffer, characters, line->charsalloc);
|
||||
|
||||
auto len = SStrLen(buffer);
|
||||
|
||||
line->inputpos = len;
|
||||
|
||||
SStrPack(buffer, input, line->charsalloc);
|
||||
SStrCopy(line->buffer, buffer, STORM_MAX_STR);
|
||||
|
||||
line->chars = SStrLen(line->buffer);
|
||||
|
||||
if (input) {
|
||||
SMemFree(input, __FILE__, __LINE__, 0);
|
||||
}
|
||||
|
||||
if (buffer) {
|
||||
SMemFree(input, __FILE__, __LINE__, 0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int32_t i = 0; i < len; i++) {
|
||||
line->buffer[line->inputpos++] = characters[i];
|
||||
}
|
||||
|
||||
line->buffer[line->inputpos] = '\0';
|
||||
line->chars = line->inputpos;
|
||||
}
|
||||
|
||||
SetInputString(line->buffer);
|
||||
}
|
||||
|
||||
void GenerateNodeString(CONSOLELINE* node) {
|
||||
auto font = TextBlockGetFontPtr(s_textFont);
|
||||
|
||||
if (font && node && node->buffer && node->buffer[0] != '\0') {
|
||||
if (node->fontPointer) {
|
||||
GxuFontDestroyString(node->fontPointer);
|
||||
}
|
||||
|
||||
C3Vector pos = {
|
||||
0.0f, 0.0f, 1.0f
|
||||
};
|
||||
|
||||
auto fontHeight = ConsoleGetFontHeight();
|
||||
|
||||
GxuFontCreateString(font, node->buffer, fontHeight, pos, 1.0f, fontHeight, 0.0f, node->fontPointer, GxVJ_Middle, GxHJ_Left, s_baseTextFlags, s_colorArray[node->colorType], s_charSpacing, 1.0f);
|
||||
BC_ASSERT(node->fontPointer);
|
||||
}
|
||||
}
|
||||
|
||||
void PaintText(void* param, const RECTF* rect, const RECTF* visible, float elapsedSec) {
|
||||
if (s_rect.bottom >= 1.0f) {
|
||||
return;
|
||||
@ -273,7 +159,7 @@ void PaintText(void* param, const RECTF* rect, const RECTF* visible, float elaps
|
||||
|
||||
C3Vector pos = {
|
||||
s_rect.left,
|
||||
(ConsoleGetFontHeight() * 0.75f) + s_rect.bottom,
|
||||
(s_fontHeight * 0.75f) + s_rect.bottom,
|
||||
1.0f
|
||||
};
|
||||
|
||||
@ -289,14 +175,14 @@ void PaintText(void* param, const RECTF* rect, const RECTF* visible, float elaps
|
||||
if (line->inputpos) {
|
||||
caretpos = pos;
|
||||
|
||||
GxuFontGetTextExtent(font, line->buffer, line->inputpos, ConsoleGetFontHeight(), &caretpos.x, 0.0f, 1.0f, s_charSpacing, s_baseTextFlags);
|
||||
GxuFontGetTextExtent(font, line->buffer, line->inputpos, s_fontHeight, &caretpos.x, 0.0f, 1.0f, s_charSpacing, s_baseTextFlags);
|
||||
|
||||
DrawCaret(caretpos);
|
||||
}
|
||||
|
||||
pos.y += ConsoleGetFontHeight();
|
||||
pos.y += s_fontHeight;
|
||||
|
||||
for (auto lineptr = GetCurrentLine(); (lineptr && pos.y < 1.0); lineptr = lineptr->Next()) {
|
||||
for (auto lineptr = s_currlineptr; (lineptr && pos.y < 1.0); lineptr = lineptr->Next()) {
|
||||
if (lineptr != line) {
|
||||
if (lineptr->fontPointer == nullptr) {
|
||||
GenerateNodeString(lineptr);
|
||||
@ -304,101 +190,15 @@ void PaintText(void* param, const RECTF* rect, const RECTF* visible, float elaps
|
||||
|
||||
GxuFontSetStringPosition(lineptr->fontPointer, pos);
|
||||
GxuFontAddToBatch(s_batch, lineptr->fontPointer);
|
||||
pos.y += ConsoleGetFontHeight();
|
||||
pos.y += s_fontHeight;
|
||||
}
|
||||
}
|
||||
|
||||
GxuFontRenderBatch(s_batch);
|
||||
}
|
||||
|
||||
void UpdateHighlight() {
|
||||
auto font = TextBlockGetFontPtr(s_textFont);
|
||||
BC_ASSERT(font);
|
||||
|
||||
auto len = SStrLen(s_copyText);
|
||||
|
||||
float left = std::min(s_highlightHStart, s_highlightHEnd);
|
||||
float right = std::max(s_highlightHStart, s_highlightHEnd);
|
||||
|
||||
auto chars = GxuFontGetMaxCharsWithinWidth(font, s_copyText, ConsoleGetFontHeight(), left, len, &s_hRect.left, 0.0f, 1.0f, s_charSpacing, s_baseTextFlags);
|
||||
|
||||
s_highlightLeftCharIndex = chars;
|
||||
|
||||
if (chars) {
|
||||
s_highlightRightCharIndex = chars - 1;
|
||||
}
|
||||
|
||||
if (s_hRect.left < 0.015f) {
|
||||
s_hRect.left = 0.0f;
|
||||
}
|
||||
|
||||
s_highlightRightCharIndex = GxuFontGetMaxCharsWithinWidth(font, s_copyText, ConsoleGetFontHeight(), right, len, &s_hRect.right, 0.0f, 1.0f, s_charSpacing, s_baseTextFlags);
|
||||
}
|
||||
|
||||
void ResetHighlight() {
|
||||
s_highlightState = HS_NONE;
|
||||
s_hRect = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||
}
|
||||
|
||||
HIGHLIGHTSTATE GetHighlightState() {
|
||||
return s_highlightState;
|
||||
}
|
||||
|
||||
void SetHighlightState(HIGHLIGHTSTATE hs) {
|
||||
s_highlightState = hs;
|
||||
}
|
||||
|
||||
char* GetHighlightCopyText() {
|
||||
return s_copyText;
|
||||
}
|
||||
|
||||
void SetHighlightCopyText(char* text) {
|
||||
SStrCopy(s_copyText, text, HIGHLIGHT_COPY_SIZE);
|
||||
}
|
||||
|
||||
void ResetHighlightCopyText() {
|
||||
s_copyText[0] = '\0';
|
||||
}
|
||||
|
||||
RECTF& GetHighlightRect() {
|
||||
return s_hRect;
|
||||
}
|
||||
|
||||
void SetHighlightStart(float start) {
|
||||
s_highlightHStart = start;
|
||||
}
|
||||
|
||||
void SetHighlightEnd(float end) {
|
||||
s_highlightHEnd = end;
|
||||
}
|
||||
|
||||
void CutHighlightToClipboard() {
|
||||
char buffer[HIGHLIGHT_COPY_SIZE];
|
||||
|
||||
if (s_copyText[0] != '\0') {
|
||||
uint32_t size = s_highlightRightCharIndex - s_highlightLeftCharIndex;
|
||||
uint32_t capsize = HIGHLIGHT_COPY_SIZE-1;
|
||||
size = std::min(size, capsize);
|
||||
|
||||
SStrCopy(buffer, &s_copyText[s_highlightLeftCharIndex], size);
|
||||
|
||||
buffer[size] = '\0';
|
||||
|
||||
// OsClipboardPutString(buffer);
|
||||
}
|
||||
|
||||
ResetHighlight();
|
||||
}
|
||||
|
||||
void PasteClipboardToHighlight() {
|
||||
// auto buffer = OsClipboardGetString();
|
||||
// PasteInInputLine(buffer);
|
||||
// SMemFree(buffer, __FILE__, __LINE__, 0);
|
||||
// ResetHighlight();
|
||||
}
|
||||
|
||||
void ConsoleScreenAnimate(float elapsedSec) {
|
||||
auto finalPos = ConsoleGetActive() ? std::min(1.0f - ConsoleGetHeight(), 1.0f) : 1.0f;
|
||||
auto finalPos = ConsoleGetActive() ? std::min(1.0f - s_consoleHeight, 1.0f) : 1.0f;
|
||||
finalPos = std::max(finalPos, 0.0f);
|
||||
|
||||
if (s_rect.bottom == finalPos) {
|
||||
@ -407,7 +207,7 @@ void ConsoleScreenAnimate(float elapsedSec) {
|
||||
|
||||
auto currentPos = finalPos;
|
||||
|
||||
if (ConsoleGetResizeState() == CS_NONE) {
|
||||
if (s_consoleResizeState == CS_NONE) {
|
||||
auto direction = s_rect.bottom <= finalPos ? 1.0f : -1.0f;
|
||||
|
||||
currentPos = s_rect.bottom + direction * elapsedSec * 5.0f;
|
||||
@ -430,7 +230,7 @@ void ConsoleScreenInitialize(const char* title) {
|
||||
s_caretpixheight = height == 0.0f ? 1.0f : 1.0f / height;
|
||||
|
||||
SStrCopy(s_fontName, "Fonts\\ARIALN.ttf", sizeof(s_fontName));
|
||||
s_textFont = TextBlockGenerateFont(s_fontName, 0, NDCToDDCHeight(ConsoleGetFontHeight()));
|
||||
s_textFont = TextBlockGenerateFont(s_fontName, 0, NDCToDDCHeight(s_fontHeight));
|
||||
|
||||
ScrnLayerCreate(&s_rect, 6.0f, 0x1 | 0x2, nullptr, PaintBackground, &s_layerBackground);
|
||||
ScrnLayerCreate(&s_rect, 7.0f, 0x1 | 0x2, nullptr, PaintText, &s_layerText);
|
||||
|
||||
@ -1,46 +1,15 @@
|
||||
#ifndef CONSOLE_SCREEN_HPP
|
||||
#define CONSOLE_SCREEN_HPP
|
||||
|
||||
#define HIGHLIGHT_COPY_SIZE 128
|
||||
#include "console/Types.hpp"
|
||||
|
||||
#include "console/Line.hpp"
|
||||
#include <storm/region/Types.hpp>
|
||||
|
||||
enum HIGHLIGHTSTATE {
|
||||
HS_NONE = 0,
|
||||
HS_HIGHLIGHTING = 1,
|
||||
HS_ENDHIGHLIGHT = 2,
|
||||
NUM_HIGHLIGHTSTATES
|
||||
};
|
||||
extern float s_consoleLines;
|
||||
extern float s_consoleHeight;
|
||||
extern CONSOLERESIZESTATE s_consoleResizeState;
|
||||
extern CImVector s_colorArray[NUM_COLORTYPES];
|
||||
|
||||
void ConsoleScreenAnimate(float elapsedSec);
|
||||
|
||||
void ConsoleScreenInitialize(const char* title);
|
||||
|
||||
void SetInputString(char* buffer);
|
||||
|
||||
void ResetHighlight();
|
||||
|
||||
void UpdateHighlight();
|
||||
|
||||
HIGHLIGHTSTATE GetHighlightState();
|
||||
|
||||
void SetHighlightState(HIGHLIGHTSTATE hs);
|
||||
|
||||
void SetHighlightCopyText(char* text);
|
||||
|
||||
char* GetHighlightCopyText();
|
||||
|
||||
void ResetHighlightCopyText();
|
||||
|
||||
void SetHighlightStart(float start);
|
||||
void SetHighlightEnd(float end);
|
||||
|
||||
RECTF& GetHighlightRect();
|
||||
|
||||
void CutHighlightToClipboard();
|
||||
void PasteClipboardToHighlight();
|
||||
|
||||
void GenerateNodeString(CONSOLELINE* node);
|
||||
|
||||
#endif
|
||||
|
||||
12
src/console/Text.cpp
Normal file
12
src/console/Text.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
#include "console/Text.hpp"
|
||||
|
||||
CGxStringBatch* s_batch;
|
||||
uint32_t s_baseTextFlags = 0x8;
|
||||
int32_t s_caret = 0;
|
||||
float s_caretpixwidth;
|
||||
float s_caretpixheight;
|
||||
float s_charSpacing = 0.0f;
|
||||
CGxString* s_inputString = nullptr;
|
||||
char s_fontName[STORM_MAX_PATH];
|
||||
float s_fontHeight = 0.02f;
|
||||
HTEXTFONT s_textFont;
|
||||
18
src/console/Text.hpp
Normal file
18
src/console/Text.hpp
Normal file
@ -0,0 +1,18 @@
|
||||
#ifndef CONSOLE_TEXT_HPP
|
||||
#define CONSOLE_TEXT_HPP
|
||||
|
||||
#include "gx/Font.hpp"
|
||||
#include "storm/String.hpp"
|
||||
|
||||
extern CGxStringBatch* s_batch;
|
||||
extern uint32_t s_baseTextFlags;
|
||||
extern int32_t s_caret;
|
||||
extern float s_caretpixwidth;
|
||||
extern float s_caretpixheight;
|
||||
extern float s_charSpacing;
|
||||
extern CGxString* s_inputString;
|
||||
extern char s_fontName[STORM_MAX_PATH];
|
||||
extern float s_fontHeight;
|
||||
extern HTEXTFONT s_textFont;
|
||||
|
||||
#endif
|
||||
@ -2,7 +2,6 @@
|
||||
#define CONSOLE_TYPES_HPP
|
||||
|
||||
#include "gx/Font.hpp"
|
||||
|
||||
#include <storm/Hash.hpp>
|
||||
#include <storm/List.hpp>
|
||||
|
||||
@ -50,32 +49,4 @@ enum CONSOLERESIZESTATE {
|
||||
|
||||
typedef int32_t (*COMMANDHANDLER)(const char*, const char*);
|
||||
|
||||
class CONSOLECOMMAND : public TSHashObject<CONSOLECOMMAND, HASHKEY_STRI> {
|
||||
public:
|
||||
COMMANDHANDLER m_handler;
|
||||
const char* m_helpText;
|
||||
CATEGORY m_category;
|
||||
};
|
||||
|
||||
class CONSOLELINE : public TSLinkedNode<CONSOLELINE> {
|
||||
public:
|
||||
char* buffer;
|
||||
uint32_t chars;
|
||||
uint32_t charsalloc;
|
||||
uint32_t inputpos;
|
||||
uint32_t inputstart;
|
||||
COLOR_T colorType;
|
||||
CGxString* fontPointer;
|
||||
|
||||
~CONSOLELINE();
|
||||
};
|
||||
|
||||
class ConsoleCommandList {
|
||||
public:
|
||||
const char* m_command;
|
||||
COMMANDHANDLER m_handler;
|
||||
const char* m_helpText;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
32
src/console/command/Commands.hpp
Normal file
32
src/console/command/Commands.hpp
Normal file
@ -0,0 +1,32 @@
|
||||
#ifndef CONSOLE_COMMAND_COMMANDS_HPP
|
||||
#define CONSOLE_COMMAND_COMMANDS_HPP
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "console/Types.hpp"
|
||||
|
||||
#define DECLARE_COMMAND(x) int32_t ConsoleCommand_##x(const char* command, const char* arguments)
|
||||
|
||||
int32_t CCGxRestart(const char* command, const char* argument);
|
||||
|
||||
DECLARE_COMMAND(Quit);
|
||||
DECLARE_COMMAND(Ver);
|
||||
DECLARE_COMMAND(SetMap);
|
||||
|
||||
DECLARE_COMMAND(Help);
|
||||
DECLARE_COMMAND(FontColor);
|
||||
DECLARE_COMMAND(BackGroundColor);
|
||||
DECLARE_COMMAND(HighLightColor);
|
||||
DECLARE_COMMAND(FontSize);
|
||||
DECLARE_COMMAND(Font);
|
||||
DECLARE_COMMAND(BufferSize);
|
||||
DECLARE_COMMAND(ClearConsole);
|
||||
DECLARE_COMMAND(Proportional);
|
||||
DECLARE_COMMAND(CharSpacing);
|
||||
DECLARE_COMMAND(CurrentSettings);
|
||||
DECLARE_COMMAND(DefaultSettings);
|
||||
DECLARE_COMMAND(CloseConsole);
|
||||
DECLARE_COMMAND(RepeatHandler);
|
||||
DECLARE_COMMAND(AppendLogToFile);
|
||||
|
||||
#endif
|
||||
@ -1,6 +1,6 @@
|
||||
#include "console/Command.hpp"
|
||||
#include "console/command/Commands.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
|
||||
int32_t ConsoleCommand_AppendLogToFile(const char* command, const char* arguments) {
|
||||
// TODO
|
||||
return 1;
|
||||
DECLARE_COMMAND(AppendLogToFile) {
|
||||
WHOA_UNIMPLEMENTED(1);
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include "console/Command.hpp"
|
||||
#include "console/command/Commands.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
|
||||
int32_t ConsoleCommand_BackGroundColor(const char* command, const char* arguments) {
|
||||
// TODO
|
||||
return 1;
|
||||
DECLARE_COMMAND(BackGroundColor) {
|
||||
WHOA_UNIMPLEMENTED(1);
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include "console/Command.hpp"
|
||||
#include "console/command/Commands.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
|
||||
int32_t ConsoleCommand_BufferSize(const char* command, const char* arguments) {
|
||||
// TODO
|
||||
return 1;
|
||||
DECLARE_COMMAND(BufferSize) {
|
||||
WHOA_UNIMPLEMENTED(1);
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include "console/Command.hpp"
|
||||
#include "console/command/Commands.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
|
||||
int32_t ConsoleCommand_CharSpacing(const char* command, const char* arguments) {
|
||||
// TODO
|
||||
return 1;
|
||||
DECLARE_COMMAND(CharSpacing) {
|
||||
WHOA_UNIMPLEMENTED(1);
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#include "console/Command.hpp"
|
||||
#include "console/Console.hpp"
|
||||
#include "console/command/Commands.hpp"
|
||||
|
||||
int32_t ConsoleCommand_ClearConsole(const char* command, const char* arguments) {
|
||||
DECLARE_COMMAND(ClearConsole) {
|
||||
ConsoleClear();
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#include "console/Command.hpp"
|
||||
#include "console/Console.hpp"
|
||||
#include "console/command/Commands.hpp"
|
||||
|
||||
int32_t ConsoleCommand_CloseConsole(const char* command, const char* arguments) {
|
||||
DECLARE_COMMAND(CloseConsole) {
|
||||
ConsoleSetActive(false);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include "console/Command.hpp"
|
||||
#include "console/command/Commands.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
|
||||
int32_t ConsoleCommand_CurrentSettings(const char* command, const char* arguments) {
|
||||
// TODO
|
||||
return 1;
|
||||
DECLARE_COMMAND(CurrentSettings) {
|
||||
WHOA_UNIMPLEMENTED(1);
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include "console/Command.hpp"
|
||||
#include "console/command/Commands.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
|
||||
int32_t ConsoleCommand_DefaultSettings(const char* command, const char* arguments) {
|
||||
// TODO
|
||||
return 1;
|
||||
DECLARE_COMMAND(DefaultSettings) {
|
||||
WHOA_UNIMPLEMENTED(1);
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include "console/Command.hpp"
|
||||
#include "console/command/Commands.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
|
||||
int32_t ConsoleCommand_Font(const char* command, const char* arguments) {
|
||||
// TODO
|
||||
return 1;
|
||||
DECLARE_COMMAND(Font) {
|
||||
WHOA_UNIMPLEMENTED(1);
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include "console/Command.hpp"
|
||||
#include "console/command/Commands.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
|
||||
int32_t ConsoleCommand_FontColor(const char* command, const char* arguments) {
|
||||
// TODO
|
||||
return 1;
|
||||
DECLARE_COMMAND(FontColor) {
|
||||
WHOA_UNIMPLEMENTED(1);
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include "console/Command.hpp"
|
||||
#include "console/command/Commands.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
|
||||
int32_t ConsoleCommand_FontSize(const char* command, const char* arguments) {
|
||||
// TODO
|
||||
return 1;
|
||||
DECLARE_COMMAND(FontSize) {
|
||||
WHOA_UNIMPLEMENTED(1);
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#include "console/Console.hpp"
|
||||
#include "console/Command.hpp"
|
||||
#include "console/Line.hpp"
|
||||
#include "console/command/Commands.hpp"
|
||||
|
||||
struct CategoryTranslation {
|
||||
CATEGORY categoryValue;
|
||||
@ -7,18 +8,18 @@ struct CategoryTranslation {
|
||||
};
|
||||
|
||||
CategoryTranslation s_translation[] = {
|
||||
{ DEBUG, "debug" },
|
||||
{ DEBUG, "debug" },
|
||||
{ GRAPHICS, "graphics" },
|
||||
{ CONSOLE, "console" },
|
||||
{ COMBAT, "combat" },
|
||||
{ GAME, "game" },
|
||||
{ DEFAULT, "default" },
|
||||
{ NET, "net" },
|
||||
{ SOUND, "sound" },
|
||||
{ GM, "gm" }
|
||||
{ CONSOLE, "console" },
|
||||
{ COMBAT, "combat" },
|
||||
{ GAME, "game" },
|
||||
{ DEFAULT, "default" },
|
||||
{ NET, "net" },
|
||||
{ SOUND, "sound" },
|
||||
{ GM, "gm" }
|
||||
};
|
||||
|
||||
int32_t ConsoleCommand_Help(const char* command, const char* arguments) {
|
||||
DECLARE_COMMAND(Help) {
|
||||
char buffer[128];
|
||||
bool showCategories = *arguments == '\0';
|
||||
|
||||
@ -42,70 +43,72 @@ int32_t ConsoleCommand_Help(const char* command, const char* arguments) {
|
||||
|
||||
ConsoleWrite(buffer, WARNING_COLOR);
|
||||
ConsoleWrite("For more information type 'help [command] or [category]'", WARNING_COLOR);
|
||||
} else {
|
||||
for (size_t i = 0; i < numTranslation; i++) {
|
||||
auto& translation = s_translation[i];
|
||||
|
||||
if (SStrCmpI(translation.categoryString, arguments, STORM_MAX_STR) == 0) {
|
||||
if (translation.categoryValue != NONE) {
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
SStrPrintf(buffer, sizeof(buffer), "Commands registered for the category %s:", arguments);
|
||||
return 1;
|
||||
}
|
||||
|
||||
ConsoleWrite(buffer, WARNING_COLOR);
|
||||
for (size_t i = 0; i < numTranslation; i++) {
|
||||
auto& translation = s_translation[i];
|
||||
|
||||
buffer[0] = '\0';
|
||||
if (SStrCmpI(translation.categoryString, arguments, STORM_MAX_STR) == 0) {
|
||||
if (translation.categoryValue != NONE) {
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
SStrPrintf(buffer, sizeof(buffer), "Commands registered for the category %s:", arguments);
|
||||
|
||||
uint32_t counter = 0;
|
||||
ConsoleWrite(buffer, WARNING_COLOR);
|
||||
|
||||
for (auto cmd = g_consoleCommandHash.Head(); cmd; cmd = g_consoleCommandHash.Next(cmd)) {
|
||||
if (cmd->m_category == translation.categoryValue) {
|
||||
SStrPack(buffer, cmd->m_key.m_str, sizeof(buffer));
|
||||
SStrPack(buffer, ", ", sizeof(buffer));
|
||||
buffer[0] = '\0';
|
||||
|
||||
if (++counter == 8) {
|
||||
ConsoleWrite(buffer, DEFAULT_COLOR);
|
||||
buffer[0] = '\0';
|
||||
counter = 0;
|
||||
}
|
||||
uint32_t counter = 0;
|
||||
|
||||
for (auto cmd = g_consoleCommandHash.Head(); cmd; cmd = g_consoleCommandHash.Next(cmd)) {
|
||||
if (cmd->m_category == translation.categoryValue) {
|
||||
SStrPack(buffer, cmd->m_key.m_str, sizeof(buffer));
|
||||
SStrPack(buffer, ", ", sizeof(buffer));
|
||||
|
||||
if (++counter == 8) {
|
||||
ConsoleWrite(buffer, DEFAULT_COLOR);
|
||||
buffer[0] = '\0';
|
||||
counter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
const char* wr = nullptr;
|
||||
|
||||
if (buffer[0]) {
|
||||
auto comma = reinterpret_cast<char*>(SStrChrR(buffer, ','));
|
||||
if (comma) {
|
||||
*comma = 0x00;
|
||||
}
|
||||
|
||||
wr = buffer;
|
||||
} else {
|
||||
wr = "NONE";
|
||||
}
|
||||
|
||||
ConsoleWrite(wr, DEFAULT_COLOR);
|
||||
break;
|
||||
}
|
||||
|
||||
const char* wr = nullptr;
|
||||
|
||||
if (buffer[0]) {
|
||||
auto comma = reinterpret_cast<char*>(SStrChrR(buffer, ','));
|
||||
if (comma) {
|
||||
*comma = '\0';
|
||||
}
|
||||
|
||||
wr = buffer;
|
||||
} else {
|
||||
wr = "NONE";
|
||||
}
|
||||
|
||||
ConsoleWrite(wr, DEFAULT_COLOR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
auto cmd = g_consoleCommandHash.Ptr(arguments);
|
||||
|
||||
if (cmd == nullptr) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
SStrPrintf(buffer, 0xa5, "Help for command %s:", arguments);
|
||||
ConsoleWrite(buffer, WARNING_COLOR);
|
||||
|
||||
auto help = cmd->m_helpText;
|
||||
if (help == nullptr) {
|
||||
help = "No help yet";
|
||||
}
|
||||
|
||||
SStrPrintf(buffer, 0xa5, " %s %s", arguments, help);
|
||||
ConsoleWrite(buffer, DEFAULT_COLOR);
|
||||
}
|
||||
|
||||
auto cmd = g_consoleCommandHash.Ptr(arguments);
|
||||
|
||||
if (cmd == nullptr) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
SStrPrintf(buffer, 0xA5, "Help for command %s:", arguments);
|
||||
ConsoleWrite(buffer, WARNING_COLOR);
|
||||
|
||||
auto help = cmd->m_helpText;
|
||||
if (help == nullptr) {
|
||||
help = "No help yet";
|
||||
}
|
||||
|
||||
SStrPrintf(buffer, 0xA5, " %s %s", arguments, help);
|
||||
ConsoleWrite(buffer, DEFAULT_COLOR);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include "console/Command.hpp"
|
||||
#include "console/command/Commands.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
|
||||
int32_t ConsoleCommand_HighLightColor(const char* command, const char* arguments) {
|
||||
// TODO
|
||||
return 1;
|
||||
DECLARE_COMMAND(HighLightColor) {
|
||||
WHOA_UNIMPLEMENTED(1);
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include "console/Command.hpp"
|
||||
#include "console/command/Commands.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
|
||||
int32_t ConsoleCommand_Proportional(const char* command, const char* arguments) {
|
||||
// TODO
|
||||
return 1;
|
||||
DECLARE_COMMAND(Proportional) {
|
||||
WHOA_UNIMPLEMENTED(1);
|
||||
}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
#include "console/Command.hpp"
|
||||
#include "console/Console.hpp"
|
||||
#include "console/command/Commands.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
|
||||
int32_t ConsoleCommand_RepeatHandler(const char* command, const char* arguments) {
|
||||
// TODO
|
||||
return 1;
|
||||
DECLARE_COMMAND(RepeatHandler) {
|
||||
WHOA_UNIMPLEMENTED(1);
|
||||
}
|
||||
|
||||
@ -1,7 +1,21 @@
|
||||
#include "console/Command.hpp"
|
||||
#include "console/Line.hpp"
|
||||
#include "console/Console.hpp"
|
||||
#include "console/command/Commands.hpp"
|
||||
|
||||
#if defined(NDEBUG)
|
||||
#define WHOA_BUILD_TYPE "Release"
|
||||
#else
|
||||
#define WHOA_BUILD_TYPE "Debug"
|
||||
#endif
|
||||
|
||||
#define WHOA_BRAND_STRING "Whoa"
|
||||
|
||||
#define WHOA_PROJECT_URL "https://github.com/thunderbrewhq/thunderbrew"
|
||||
|
||||
#define WHOA_VERSION_STRING WHOA_BRAND_STRING " [" WHOA_BUILD_TYPE "] Build " WHOA_VERSION_BUILD " (" __DATE__ ") <" WHOA_PROJECT_URL ">"
|
||||
|
||||
DECLARE_COMMAND(Ver) {
|
||||
// ConsoleWrite("Thunderbrew <https://github.com/thunderbrewhq/thunderbrew>", ADMIN_COLOR);
|
||||
ConsoleWrite(WHOA_VERSION_STRING, DEFAULT_COLOR);
|
||||
|
||||
int32_t ConsoleCommand_Ver(const char* command, const char* arguments) {
|
||||
ConsoleWrite("Whoa <https://github.com/whoahq/whoa>", DEFAULT_COLOR);
|
||||
return 1;
|
||||
}
|
||||
|
||||
16
src/console/command/default/GxRestart.cpp
Normal file
16
src/console/command/default/GxRestart.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include "console/command/Commands.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
|
||||
int32_t CCGxRestart(const char* command, const char* argument) {
|
||||
// sub_512900();
|
||||
// ValidateFormatMonitor(s_requestedFormat);
|
||||
|
||||
// if (!GxDevSetFormat(s_requestedFormat)) {
|
||||
// ConsoleWrite("unable to set requested display mode", DEFAULT_COLOR);
|
||||
// memcpy(&s_requestedFormat, &s_lastGoodFormat, sizeof(CGxFormat));
|
||||
|
||||
// if (!GxDevSetFormat())
|
||||
// }
|
||||
|
||||
WHOA_UNIMPLEMENTED(1);
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
#include "console/Command.hpp"
|
||||
#include "console/Console.hpp"
|
||||
#include "console/command/Commands.hpp"
|
||||
|
||||
int32_t ConsoleCommand_Quit(const char* command, const char* arguments) {
|
||||
DECLARE_COMMAND(Quit) {
|
||||
ConsolePostClose();
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
#include "console/Command.hpp"
|
||||
#include "console/command/Commands.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
|
||||
int32_t ConsoleCommand_SetMap(const char* command, const char* arguments) {
|
||||
return 1;
|
||||
DECLARE_COMMAND(SetMap) {
|
||||
WHOA_UNIMPLEMENTED(1);
|
||||
}
|
||||
|
||||
641
src/console/cvar/Gx.cpp
Normal file
641
src/console/cvar/Gx.cpp
Normal file
@ -0,0 +1,641 @@
|
||||
#include "console/cvar/Gx.hpp"
|
||||
#include "console/Gx.hpp"
|
||||
#include "console/Console.hpp"
|
||||
#include "console/Detect.hpp"
|
||||
#include "console/Device.hpp"
|
||||
#include "console/Types.hpp"
|
||||
#include "gx/CGxFormat.hpp"
|
||||
#include "gx/CGxMonitorMode.hpp"
|
||||
#include "gx/Device.hpp"
|
||||
#include "gx/Types.hpp"
|
||||
#include "gx/Gx.hpp"
|
||||
#include "os/Input.hpp"
|
||||
#include "storm/String.hpp"
|
||||
#include <storm/Array.hpp>
|
||||
#include <cstdio>
|
||||
|
||||
CVar* s_cvGxStereoEnabled;
|
||||
CVar* s_cvGxRefresh;
|
||||
CVar* s_cvGxMaximize;
|
||||
CVar* s_cvGxMultisample;
|
||||
CVar* s_cvGxCursor;
|
||||
CVar* s_cvGxStereoSeparation;
|
||||
CVar* s_cvGxMultisampleQuality;
|
||||
CVar* s_cvGxResolution;
|
||||
CVar* s_cvGxOverride;
|
||||
CVar* s_cvGxFixLag;
|
||||
CVar* s_cvMaxFPS;
|
||||
CVar* s_cvGxVSync;
|
||||
CVar* s_cvVideoOptionsVersion;
|
||||
CVar* s_cvGxStereoConvergence;
|
||||
CVar* s_cvMaxFPSBk;
|
||||
CVar* s_cvGxTripleBuffer;
|
||||
CVar* s_cvGxDepthBits;
|
||||
CVar* s_cvGxColorBits;
|
||||
CVar* s_cvGxApi;
|
||||
CVar* s_cvGxAspect;
|
||||
CVar* s_cvFixedFunction;
|
||||
CVar* s_cvWidescreen;
|
||||
CVar* s_cvGxWindow;
|
||||
CVar* s_cvWindowResizeLock;
|
||||
|
||||
static const char* formatToInt[CGxFormat::Formats_Last] = {
|
||||
"16",
|
||||
"24",
|
||||
"24",
|
||||
"30",
|
||||
"16",
|
||||
"24",
|
||||
"24",
|
||||
"32"
|
||||
};
|
||||
|
||||
bool CVGxColorBitsCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
auto colorBits = SStrToInt(newValue);
|
||||
switch (colorBits) {
|
||||
case 16:
|
||||
s_requestedFormat.colorFormat = CGxFormat::Fmt_Rgb565;
|
||||
break;
|
||||
case 24:
|
||||
s_requestedFormat.colorFormat = CGxFormat::Fmt_ArgbX888;
|
||||
break;
|
||||
case 30:
|
||||
s_requestedFormat.colorFormat = CGxFormat::Fmt_Argb2101010;
|
||||
break;
|
||||
default:
|
||||
ConsoleWrite("Color bits must be 16, 24, or 30", DEFAULT_COLOR);
|
||||
return false;
|
||||
}
|
||||
|
||||
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxDepthBitsCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
auto depthBits = SStrToInt(newValue);
|
||||
switch (depthBits) {
|
||||
case 16:
|
||||
s_requestedFormat.depthFormat = CGxFormat::Fmt_Ds160;
|
||||
break;
|
||||
case 24:
|
||||
s_requestedFormat.depthFormat = CGxFormat::Fmt_Ds24X;
|
||||
break;
|
||||
case 32:
|
||||
s_requestedFormat.depthFormat = CGxFormat::Fmt_Ds320;
|
||||
break;
|
||||
default:
|
||||
ConsoleWrite("Depth bits must be 16, 24, or 32", DEFAULT_COLOR);
|
||||
return false;
|
||||
}
|
||||
|
||||
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxTripleBufferCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
auto tripleBuffer = SStrToInt(newValue);
|
||||
if (tripleBuffer > 1) {
|
||||
ConsoleWrite("TripleBuffer must be 0 or 1", DEFAULT_COLOR);
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO
|
||||
// s_requestedFormat.unk1C = (tripleBuffer != 0) + 1;
|
||||
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool CVGxApiCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
for (EGxApi api = GxApi_OpenGl; api < GxApis_Last; api = static_cast<EGxApi>(static_cast<int32_t>(api) + 1)) {
|
||||
if (GxApiSupported(api)) {
|
||||
if (!SStrCmpI(newValue, g_gxApiNames[api], STORM_MAX_STR)) {
|
||||
ConsoleWrite("GxApi set pending gxRestart", DEFAULT_COLOR);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// User supplied an unknown gxApi string
|
||||
// display list of available gxApis
|
||||
char message[1024];
|
||||
SStrCopy(message, "unsupported api, must be one of ", sizeof(message));
|
||||
|
||||
uint32_t i = 0;
|
||||
for (EGxApi api = GxApi_OpenGl; api < GxApis_Last; api = static_cast<EGxApi>(static_cast<int32_t>(api) + 1)) {
|
||||
if (GxApiSupported(api)) {
|
||||
if (i) {
|
||||
SStrPack(message, ", ", sizeof(message));
|
||||
}
|
||||
|
||||
SStrPack(message, "'", sizeof(message));
|
||||
SStrPack(message, g_gxApiNames[api], sizeof(message));
|
||||
SStrPack(message, "'", sizeof(message));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
ConsoleWrite(message, DEFAULT_COLOR);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CVGxVSyncCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
s_requestedFormat.vsync = SStrToInt(newValue);
|
||||
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxWindowCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
s_requestedFormat.window = SStrToInt(newValue) != 0;
|
||||
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxAspectCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
s_requestedFormat.aspect = SStrToInt(newValue) != 0;
|
||||
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxMaximizeCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
s_requestedFormat.maximize = SStrToInt(newValue) != 0;
|
||||
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxCursorCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
s_requestedFormat.hwCursor = SStrToInt(newValue) != 0;
|
||||
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxMultisampleCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
auto sampleCount = SStrToInt(newValue);
|
||||
s_requestedFormat.sampleCount = std::max(1, std::min(sampleCount, 16));
|
||||
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxMultisampleQualityCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
auto sampleQuality = SStrToFloat(newValue);
|
||||
s_requestedFormat.sampleQuality = std::max(0.0f, std::min(sampleQuality, 1.0f));
|
||||
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxFixLagCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
s_requestedFormat.fixLag = SStrToInt(newValue) != 0;
|
||||
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxOverrideCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
ConsoleGxOverride(newValue);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxMaxFPSCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
auto maxFPS = SStrToInt(newValue);
|
||||
GxSetMaxFPS(std::max(8, maxFPS));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxMaxFPSBkCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
auto maxFPSBk = SStrToInt(newValue);
|
||||
GxSetMaxFPSBk(std::max(8, maxFPSBk));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxWindowResizeLockCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
OsInputSetWindowResizeLock(SStrToInt(newValue));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxStereoEnabledCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
s_requestedFormat.stereoEnabled = SStrToInt(newValue) == 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxStereoConvergenceCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
GxStereoSetConvergence(SStrToFloat(newValue));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxStereoSeparationCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
GxStereoSetSeparation(SStrToFloat(newValue));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxResolutionCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
C2iVector size = { -1, -1 };
|
||||
uint8_t x;
|
||||
sscanf(newValue, "%d%c%d", &size.x, &x, &size.y);
|
||||
|
||||
if (s_requestedFormat.window) {
|
||||
s_requestedFormat.size = size;
|
||||
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
|
||||
return true;
|
||||
}
|
||||
|
||||
TSGrowableArray<C2iVector> resolutions;
|
||||
ConsoleDetectGetResolutions(resolutions, s_cvWidescreen->GetInt());
|
||||
|
||||
uint32_t i;
|
||||
for (i = 0; i < resolutions.Count(); i++) {
|
||||
if (size.x == resolutions[i].x && size.y == resolutions[i].y) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
char str[256];
|
||||
char rez[16];
|
||||
if (i == resolutions.Count()) {
|
||||
SStrCopy(str, "invalid resolution, must be one of ", sizeof(str));
|
||||
for (uint32_t i = 0; i < resolutions.Count(); i++) {
|
||||
if (i) {
|
||||
SStrPack(str, ", ", sizeof(str));
|
||||
}
|
||||
|
||||
// flush line
|
||||
if (SStrLen(str) > 100) {
|
||||
ConsoleWrite(str, DEFAULT_COLOR);
|
||||
*str = '\0';
|
||||
}
|
||||
|
||||
SStrPrintf(rez, sizeof(rez), "%dx%d", resolutions[i].x, resolutions[i].y);
|
||||
SStrPack(str, rez, sizeof(str));
|
||||
}
|
||||
|
||||
ConsoleWrite(str, DEFAULT_COLOR);
|
||||
return 0;
|
||||
}
|
||||
|
||||
s_requestedFormat.size = size;
|
||||
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxRefreshCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
auto refreshRate = SStrToUnsigned(newValue);
|
||||
|
||||
TSGrowableArray<CGxMonitorMode> modes;
|
||||
GxAdapterMonitorModes(modes);
|
||||
|
||||
uint32_t i;
|
||||
for (i = 0; i < modes.Count(); i++) {
|
||||
if (modes[i].refreshRate == refreshRate) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == modes.Count()) {
|
||||
ConsoleWrite("Unsupported refresh rate", DEFAULT_COLOR);
|
||||
return false;
|
||||
}
|
||||
|
||||
s_requestedFormat.refreshRate = refreshRate;
|
||||
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVGxVideoOptionsVersionCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void RegisterGxCVars() {
|
||||
auto format = s_defaults.format;
|
||||
|
||||
// TODO CURRENT_LANGUAGE check
|
||||
auto v1 = true;
|
||||
|
||||
s_cvWidescreen = CVar::Register(
|
||||
"widescreen",
|
||||
"Allow widescreen support",
|
||||
0,
|
||||
"1",
|
||||
nullptr,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
s_cvGxWindow = CVar::Register(
|
||||
"gxWindow",
|
||||
"toggle fullscreen/window",
|
||||
0x1 | 0x2,
|
||||
v1 ? "1" : "0",
|
||||
CVGxWindowCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
s_cvGxMaximize = CVar::Register(
|
||||
"gxMaximize",
|
||||
"maximize game window",
|
||||
0x1 | 0x2,
|
||||
v1 ? "1" : "0",
|
||||
CVGxMaximizeCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
char colorBits[260];
|
||||
SStrPrintf(colorBits, 260, "%s", formatToInt[format->colorFormat]);
|
||||
s_cvGxColorBits = CVar::Register(
|
||||
"gxColor",
|
||||
"color bits",
|
||||
0x1 | 0x2,
|
||||
colorBits,
|
||||
CVGxColorBitsCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
char depthBits[260];
|
||||
SStrPrintf(depthBits, 260, "%s", formatToInt[format->depthFormat]);
|
||||
s_cvGxDepthBits = CVar::Register(
|
||||
"gxDepthBits",
|
||||
"depth bits",
|
||||
0x1 | 0x2,
|
||||
colorBits,
|
||||
CVGxDepthBitsCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false);
|
||||
|
||||
char resolution[260];
|
||||
SStrPrintf(resolution, 260, "%dx%d", format->size.x, format->size.y);
|
||||
s_cvGxResolution = CVar::Register(
|
||||
"gxResolution",
|
||||
"resolution",
|
||||
0x1 | 0x2,
|
||||
resolution,
|
||||
CVGxResolutionCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
s_cvGxRefresh = CVar::Register(
|
||||
"gxRefresh",
|
||||
"refresh rate",
|
||||
0x1 | 0x2,
|
||||
"75",
|
||||
CVGxRefreshCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
s_cvGxTripleBuffer = CVar::Register(
|
||||
"gxTripleBuffer",
|
||||
"triple buffer",
|
||||
0x1 | 0x2,
|
||||
"0",
|
||||
CVGxTripleBufferCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
s_cvGxApi = CVar::Register(
|
||||
"gxApi",
|
||||
"graphics api",
|
||||
0x1 | 0x2,
|
||||
g_gxApiNames[GxDefaultApi()],
|
||||
CVGxApiCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
s_cvGxVSync = CVar::Register(
|
||||
"gxVSync",
|
||||
"vsync on or off",
|
||||
0x1 | 0x2,
|
||||
"1",
|
||||
CVGxVSyncCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
s_cvGxAspect = CVar::Register(
|
||||
"gxAspect",
|
||||
"constrain window aspect",
|
||||
0x1 | 0x2,
|
||||
"1",
|
||||
CVGxAspectCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
s_cvGxCursor = CVar::Register(
|
||||
"gxCursor",
|
||||
"toggle hardware cursor",
|
||||
0x1 | 0x2,
|
||||
"1",
|
||||
CVGxCursorCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
char multisample[260];
|
||||
SStrPrintf(multisample, 260, "%d", s_hardware.videoHw->m_multisample);
|
||||
s_cvGxMultisample = CVar::Register(
|
||||
"gxMultisample",
|
||||
"multisample",
|
||||
0x1 | 0x2,
|
||||
multisample,
|
||||
CVGxMultisampleCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
s_cvGxMultisampleQuality = CVar::Register(
|
||||
"gxMultisampleQuality",
|
||||
"multisample quality",
|
||||
0x1 | 0x2,
|
||||
"0.0",
|
||||
CVGxMultisampleQualityCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
char fixLag[260];
|
||||
SStrPrintf(fixLag, 260, "%d", s_hardware.videoHw->m_fixLag);
|
||||
s_cvGxFixLag = CVar::Register(
|
||||
"gxFixLag",
|
||||
"prevent cursor lag",
|
||||
0x1 | 0x2,
|
||||
fixLag,
|
||||
CVGxFixLagCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
s_cvGxStereoEnabled = CVar::Register(
|
||||
"gxStereoEnabled",
|
||||
"Enable stereoscopic rendering",
|
||||
0x1,
|
||||
"0",
|
||||
CVGxStereoEnabledCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
s_cvGxOverride = CVar::Register(
|
||||
"gxOverride",
|
||||
"gx overrides",
|
||||
0x1,
|
||||
"",
|
||||
CVGxOverrideCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
s_cvMaxFPS = CVar::Register(
|
||||
"maxFPS",
|
||||
"Set FPS limit",
|
||||
0x1,
|
||||
"200",
|
||||
CVGxMaxFPSCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
s_cvMaxFPSBk = CVar::Register(
|
||||
"maxFPSBk",
|
||||
"Set background FPS limit",
|
||||
0x1,
|
||||
"30",
|
||||
CVGxMaxFPSBkCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
s_cvVideoOptionsVersion = CVar::Register(
|
||||
"videoOptionsVersion",
|
||||
"Video options version",
|
||||
0x1 | 0x2,
|
||||
"0",
|
||||
CVGxVideoOptionsVersionCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
s_cvWindowResizeLock = CVar::Register(
|
||||
"windowResizeLock",
|
||||
"prevent resizing in windowed mode",
|
||||
0x1,
|
||||
"0",
|
||||
CVGxWindowResizeLockCallback,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
|
||||
s_cvFixedFunction = CVar::Register(
|
||||
"fixedFunction",
|
||||
"Force fixed function rendering",
|
||||
0x1 | 0x2,
|
||||
"0",
|
||||
nullptr,
|
||||
GRAPHICS,
|
||||
false,
|
||||
nullptr,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
void UpdateGxCVars() {
|
||||
s_cvGxColorBits->Update();
|
||||
s_cvGxDepthBits->Update();
|
||||
s_cvGxWindow->Update();
|
||||
s_cvGxResolution->Update();
|
||||
s_cvGxRefresh->Update();
|
||||
s_cvGxTripleBuffer->Update();
|
||||
s_cvGxApi->Update();
|
||||
s_cvGxVSync->Update();
|
||||
s_cvGxAspect->Update();
|
||||
s_cvGxMaximize->Update();
|
||||
s_cvGxCursor->Update();
|
||||
s_cvGxMultisample->Update();
|
||||
s_cvGxMultisampleQuality->Update();
|
||||
s_cvGxFixLag->Update();
|
||||
}
|
||||
|
||||
void SetGxCVars(const CGxFormat& format) {
|
||||
char value[1024];
|
||||
|
||||
s_cvGxColorBits->Set(formatToInt[format.colorFormat], true, false, false, true);
|
||||
|
||||
s_cvGxDepthBits->Set(formatToInt[format.depthFormat], true, false, false, true);
|
||||
|
||||
SStrPrintf(value, 1024, "%d", format.window);
|
||||
s_cvGxWindow->Set(value, true, false, false, true);
|
||||
|
||||
SStrPrintf(value, 1024, "%dx%d", format.size.x, format.size.y);
|
||||
s_cvGxResolution->Set(value, true, false, false, true);
|
||||
|
||||
SStrPrintf(value, 1024, "%d", format.refreshRate);
|
||||
s_cvGxRefresh->Set(value, true, false, false, true);
|
||||
|
||||
s_cvGxTripleBuffer->Set(format.backbuffers > 1 ? "1" : "0", true, false, false, true);
|
||||
|
||||
SStrPrintf(value, 1024, "%d", format.vsync);
|
||||
s_cvGxVSync->Set(value, true, false, false, true);
|
||||
|
||||
SStrPrintf(value, 1024, "%d", format.aspect);
|
||||
s_cvGxAspect->Set(value, true, false, false, true);
|
||||
|
||||
SStrPrintf(value, 1024, "%d", format.maximize);
|
||||
s_cvGxMaximize->Set(value, true, false, false, true);
|
||||
|
||||
SStrPrintf(value, 1024, "%d", format.hwCursor);
|
||||
s_cvGxCursor->Set(value, true, false, false, true);
|
||||
|
||||
SStrPrintf(value, 1024, "%d", format.sampleCount);
|
||||
s_cvGxMultisample->Set(value, true, false, false, true);
|
||||
|
||||
SStrPrintf(value, 1024, "%f", format.sampleQuality);
|
||||
s_cvGxMultisampleQuality->Set(value, true, false, false, true);
|
||||
|
||||
SStrPrintf(value, 1024, "%d", format.fixLag);
|
||||
s_cvGxFixLag->Set(value, true, false, false, true);
|
||||
|
||||
UpdateGxCVars();
|
||||
}
|
||||
43
src/console/cvar/Gx.hpp
Normal file
43
src/console/cvar/Gx.hpp
Normal file
@ -0,0 +1,43 @@
|
||||
#ifndef CONSOLE_C_VAR_GX_HPP
|
||||
#define CONSOLE_C_VAR_GX_HPP
|
||||
|
||||
#include "gx/CGxFormat.hpp"
|
||||
#include "console/CVar.hpp"
|
||||
|
||||
extern CVar* s_cvGxStereoEnabled;
|
||||
extern CVar* s_cvGxRefresh;
|
||||
extern CVar* s_cvGxMaximize;
|
||||
extern CVar* s_cvGxMultisample;
|
||||
extern CVar* s_cvGxCursor;
|
||||
extern CVar* s_cvGxStereoSeparation;
|
||||
extern CVar* s_cvGxMultisampleQuality;
|
||||
extern CVar* s_cvGxResolution;
|
||||
extern CVar* s_cvHwDetect;
|
||||
extern CVar* s_cvGxOverride;
|
||||
extern CVar* s_cvGxFixLag;
|
||||
extern CVar* s_cvMaxFPS;
|
||||
extern CVar* s_cvGxVSync;
|
||||
extern CVar* s_cvVideoOptionsVersion;
|
||||
extern CVar* s_cvGxStereoConvergence;
|
||||
extern CVar* s_cvMaxFPSBk;
|
||||
extern CVar* s_cvGxTripleBuffer;
|
||||
extern CVar* s_cvGxDepthBits;
|
||||
extern CVar* s_cvGxColorBits;
|
||||
extern CVar* s_cvGxApi;
|
||||
extern CVar* s_cvGxAspect;
|
||||
extern CVar* s_cvFixedFunction;
|
||||
extern CVar* s_cvWidescreen;
|
||||
extern CVar* s_cvGxWindow;
|
||||
extern CVar* s_cvWindowResizeLock;
|
||||
|
||||
void RegisterGxCVars();
|
||||
|
||||
void UpdateGxCVars();
|
||||
|
||||
void SetGxCVars(const CGxFormat& format);
|
||||
|
||||
bool CVGxStereoConvergenceCallback(CVar* h, const char* oldValue, const char* newValue, void* arg);
|
||||
|
||||
bool CVGxStereoSeparationCallback(CVar* h, const char* oldValue, const char* newValue, void* arg);
|
||||
|
||||
#endif
|
||||
@ -1,7 +1,11 @@
|
||||
#include "db/Db.hpp"
|
||||
#include "db/WowClientDB_Base.hpp"
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
void LoadDB(WowClientDB_Base* db, const char* filename, int32_t linenumber) {
|
||||
db->Load(filename, linenumber);
|
||||
printf("load %s:%d\n", filename, linenumber);
|
||||
};
|
||||
|
||||
void ClientDBInitialize() {
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
#ifndef DB_DB_HPP
|
||||
#define DB_DB_HPP
|
||||
|
||||
#include "db/WowClientDB.hpp"
|
||||
#include "db/StaticDb.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
|
||||
void ClientDBInitialize();
|
||||
|
||||
|
||||
3
src/db/Locale.cpp
Normal file
3
src/db/Locale.cpp
Normal file
@ -0,0 +1,3 @@
|
||||
#include "db/Locale.hpp"
|
||||
|
||||
WOW_LOCALE CURRENT_LANGUAGE = DEFAULT_LANGUAGE;
|
||||
20
src/db/Locale.hpp
Normal file
20
src/db/Locale.hpp
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef DB_LOCALE_HPP
|
||||
#define DB_LOCALE_HPP
|
||||
|
||||
enum WOW_LOCALE {
|
||||
LOCALE_en_US = 0,
|
||||
LOCALE_ko_KR = 1,
|
||||
LOCALE_fr_FR = 2,
|
||||
LOCALE_de_DE = 3,
|
||||
LOCALE_zh_CN = 4,
|
||||
LOCALE_zh_TW = 5,
|
||||
LOCALE_es_ES = 6,
|
||||
LOCALE_es_MX = 7,
|
||||
LOCALE_ru_RU = 8,
|
||||
NUM_LOCALES = 9,
|
||||
DEFAULT_LANGUAGE = 0,
|
||||
};
|
||||
|
||||
extern WOW_LOCALE CURRENT_LANGUAGE;
|
||||
|
||||
#endif
|
||||
3
src/db/Startup_Strings.cpp
Normal file
3
src/db/Startup_Strings.cpp
Normal file
@ -0,0 +1,3 @@
|
||||
#include "db/Startup_Strings.hpp"
|
||||
|
||||
WowClientDB<Startup_StringsRec> g_Startup_StringsDB;
|
||||
19
src/db/Startup_Strings.hpp
Normal file
19
src/db/Startup_Strings.hpp
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef DB_MESSAGE_HPP
|
||||
#define DB_MESSAGE_HPP
|
||||
|
||||
#include "db/WowClientDB.hpp"
|
||||
#include "db/rec/Startup_StringsRec.hpp"
|
||||
|
||||
#define MSG_TITLE_WOW 1
|
||||
#define MSG_GX_INIT_FAILED_D3D 2
|
||||
#define MSG_GX_INIT_FAILED 3
|
||||
#define MSG_HW_UNSUPPORTED 4
|
||||
#define MSG_HW_CHANGED 5
|
||||
#define MSG_GLUEXML_UI_CORRUPT 9
|
||||
#define MSG_FRAMEXML_UI_CORRUPT 10
|
||||
#define MSG_GX_NO_DEVICE 11
|
||||
#define MSG_REMOTE_DESKTOP 12
|
||||
|
||||
extern WowClientDB<Startup_StringsRec> g_Startup_StringsDB;
|
||||
|
||||
#endif
|
||||
@ -2,42 +2,28 @@
|
||||
#include "db/StaticDb.hpp"
|
||||
|
||||
WowClientDB<AchievementRec> g_achievementDB;
|
||||
WowClientDB<Achievement_CategoryRec> g_achievement_CategoryDB;
|
||||
WowClientDB<Achievement_CriteriaRec> g_achievement_CriteriaDB;
|
||||
WowClientDB<AnimKitRec> g_animKitDB;
|
||||
WowClientDB<AnimKitBoneSetRec> g_animKitBoneSetDB;
|
||||
WowClientDB<AnimKitBoneSetAliasRec> g_animKitBoneSetAliasDB;
|
||||
WowClientDB<AnimKitConfigRec> g_animKitConfigDB;
|
||||
WowClientDB<AnimKitConfigBoneSetRec> g_animKitConfigBoneSetDB;
|
||||
WowClientDB<AnimKitPriorityRec> g_animKitPriorityDB;
|
||||
WowClientDB<AnimKitSegmentRec> g_animKitSegmentDB;
|
||||
WowClientDB<AnimReplacementRec> g_animReplacementDB;
|
||||
WowClientDB<AnimReplacementSetRec> g_animReplacementSetDB;
|
||||
WowClientDB<Achievement_CategoryRec> g_achievement_CategoryDB;
|
||||
WowClientDB<AnimationDataRec> g_animationDataDB;
|
||||
WowClientDB<AreaAssignmentRec> g_areaAssignmentDB;
|
||||
WowClientDB<AreaGroupRec> g_areaGroupDB;
|
||||
WowClientDB<AreaPOIRec> g_areaPOIDB;
|
||||
WowClientDB<AreaTableRec> g_areaTableDB;
|
||||
WowClientDB<AreaTriggerRec> g_areaTriggerDB;
|
||||
WowClientDB<ArmorLocationRec> g_armorLocationDB;
|
||||
WowClientDB<AttackAnimKitsRec> g_attackAnimKitsDB;
|
||||
WowClientDB<AttackAnimTypesRec> g_attackAnimTypesDB;
|
||||
WowClientDB<AuctionHouseRec> g_auctionHouseDB;
|
||||
WowClientDB<BankBagSlotPricesRec> g_bankBagSlotPricesDB;
|
||||
WowClientDB<BannedAddonsRec> g_bannedAddonsDB;
|
||||
WowClientDB<BannedAddOnsRec> g_bannedAddOnsDB;
|
||||
WowClientDB<BarberShopStyleRec> g_barberShopStyleDB;
|
||||
WowClientDB<BattlemasterListRec> g_battlemasterListDB;
|
||||
WowClientDB<CameraModeRec> g_cameraModeDB;
|
||||
WowClientDB<CameraShakesRec> g_cameraShakesDB;
|
||||
WowClientDB<Cfg_CategoriesRec> g_cfg_CategoriesDB;
|
||||
WowClientDB<Cfg_ConfigsRec> g_cfg_ConfigsDB;
|
||||
WowClientDB<CharBaseInfoRec> g_charBaseInfoDB;
|
||||
WowClientDB<CharHairGeosetsRec> g_charHairGeosetsDB;
|
||||
WowClientDB<CharHairTexturesRec> g_charHairTexturesDB;
|
||||
WowClientDB<CharSectionsRec> g_charSectionsDB;
|
||||
WowClientDB<CharStartOutfitRec> g_charStartOutfitDB;
|
||||
WowClientDB<CharTitlesRec> g_charTitlesDB;
|
||||
WowClientDB<CharVariationsRec> g_charVariationsDB;
|
||||
WowClientDB<CharacterFacialHairStylesRec> g_characterFacialHairStylesDB;
|
||||
WowClientDB<ChatChannelsRec> g_chatChannelsDB;
|
||||
WowClientDB<ChatProfanityRec> g_chatProfanityDB;
|
||||
@ -53,12 +39,10 @@ WowClientDB<CreatureMovementInfoRec> g_creatureMovementInfoDB;
|
||||
WowClientDB<CreatureSoundDataRec> g_creatureSoundDataDB;
|
||||
WowClientDB<CreatureSpellDataRec> g_creatureSpellDataDB;
|
||||
WowClientDB<CreatureTypeRec> g_creatureTypeDB;
|
||||
WowClientDB<CurrencyCategoryRec> g_currencyCategoryDB;
|
||||
WowClientDB<CurrencyTypesRec> g_currencyTypesDB;
|
||||
WowClientDB<CurrencyCategoryRec> g_currencyCategoryDB;
|
||||
WowClientDB<DanceMovesRec> g_danceMovesDB;
|
||||
WowClientDB<DeathThudLookupsRec> g_deathThudLookupsDB;
|
||||
WowClientDB<DeclinedWordRec> g_declinedWordDB;
|
||||
WowClientDB<DeclinedWordCasesRec> g_declinedWordCasesDB;
|
||||
WowClientDB<DestructibleModelDataRec> g_destructibleModelDataDB;
|
||||
WowClientDB<DungeonEncounterRec> g_dungeonEncounterDB;
|
||||
WowClientDB<DungeonMapRec> g_dungeonMapDB;
|
||||
@ -77,41 +61,40 @@ WowClientDB<FactionTemplateRec> g_factionTemplateDB;
|
||||
WowClientDB<FileDataRec> g_fileDataDB;
|
||||
WowClientDB<FootprintTexturesRec> g_footprintTexturesDB;
|
||||
WowClientDB<FootstepTerrainLookupRec> g_footstepTerrainLookupDB;
|
||||
WowClientDB<GMSurveyAnswersRec> g_gMSurveyAnswersDB;
|
||||
WowClientDB<GMSurveyCurrentSurveyRec> g_gMSurveyCurrentSurveyDB;
|
||||
WowClientDB<GMSurveyQuestionsRec> g_gMSurveyQuestionsDB;
|
||||
WowClientDB<GMSurveySurveysRec> g_gMSurveySurveysDB;
|
||||
WowClientDB<GMTicketCategoryRec> g_gMTicketCategoryDB;
|
||||
WowClientDB<GameObjectArtKitRec> g_gameObjectArtKitDB;
|
||||
WowClientDB<GameObjectDisplayInfoRec> g_gameObjectDisplayInfoDB;
|
||||
WowClientDB<GameTablesRec> g_gameTablesDB;
|
||||
WowClientDB<GameTipsRec> g_gameTipsDB;
|
||||
WowClientDB<GemPropertiesRec> g_gemPropertiesDB;
|
||||
WowClientDB<GlueScreenEmoteRec> g_glueScreenEmoteDB;
|
||||
WowClientDB<GlyphPropertiesRec> g_glyphPropertiesDB;
|
||||
WowClientDB<GlyphSlotRec> g_glyphSlotDB;
|
||||
WowClientDB<GMSurveyAnswersRec> g_gMSurveyAnswersDB;
|
||||
WowClientDB<GMSurveyCurrentSurveyRec> g_gMSurveyCurrentSurveyDB;
|
||||
WowClientDB<GMSurveyQuestionsRec> g_gMSurveyQuestionsDB;
|
||||
WowClientDB<GMSurveySurveysRec> g_gMSurveySurveysDB;
|
||||
WowClientDB<GMTicketCategoryRec> g_gMTicketCategoryDB;
|
||||
WowClientDB<GroundEffectDoodadRec> g_groundEffectDoodadDB;
|
||||
WowClientDB<GroundEffectTextureRec> g_groundEffectTextureDB;
|
||||
WowClientDB<GuildPerkSpellsRec> g_guildPerkSpellsDB;
|
||||
WowClientDB<gtBarberShopCostBaseRec> g_gtBarberShopCostBaseDB;
|
||||
WowClientDB<gtCombatRatingsRec> g_gtCombatRatingsDB;
|
||||
WowClientDB<gtChanceToMeleeCritRec> g_gtChanceToMeleeCritDB;
|
||||
WowClientDB<gtChanceToMeleeCritBaseRec> g_gtChanceToMeleeCritBaseDB;
|
||||
WowClientDB<gtChanceToSpellCritRec> g_gtChanceToSpellCritDB;
|
||||
WowClientDB<gtChanceToSpellCritBaseRec> g_gtChanceToSpellCritBaseDB;
|
||||
WowClientDB<gtNPCManaCostScalerRec> g_gtNPCManaCostScalerDB;
|
||||
WowClientDB<gtOCTClassCombatRatingScalarRec> g_gtOCTClassCombatRatingScalarDB;
|
||||
WowClientDB<gtOCTRegenHPRec> g_gtOCTRegenHPDB;
|
||||
WowClientDB<gtOCTRegenMPRec> g_gtOCTRegenMPDB;
|
||||
WowClientDB<gtRegenHPPerSptRec> g_gtRegenHPPerSptDB;
|
||||
WowClientDB<gtRegenMPPerSptRec> g_gtRegenMPPerSptDB;
|
||||
WowClientDB<HelmetGeosetVisDataRec> g_helmetGeosetVisDataDB;
|
||||
WowClientDB<HolidayDescriptionsRec> g_holidayDescriptionsDB;
|
||||
WowClientDB<HolidayNamesRec> g_holidayNamesDB;
|
||||
WowClientDB<HolidaysRec> g_holidaysDB;
|
||||
WowClientDB<ItemRec> g_itemDB;
|
||||
WowClientDB<ItemArmorQualityRec> g_itemArmorQualityDB;
|
||||
WowClientDB<ItemArmorShieldRec> g_itemArmorShieldDB;
|
||||
WowClientDB<ItemArmorTotalRec> g_itemArmorTotalDB;
|
||||
WowClientDB<ItemBagFamilyRec> g_itemBagFamilyDB;
|
||||
WowClientDB<ItemClassRec> g_itemClassDB;
|
||||
WowClientDB<ItemCondExtCostsRec> g_itemCondExtCostsDB;
|
||||
WowClientDB<ItemDamageAmmoRec> g_itemDamageAmmoDB;
|
||||
WowClientDB<ItemDamageOneHandRec> g_itemDamageOneHandDB;
|
||||
WowClientDB<ItemDamageOneHandCasterRec> g_itemDamageOneHandCasterDB;
|
||||
WowClientDB<ItemDamageRangedRec> g_itemDamageRangedDB;
|
||||
WowClientDB<ItemDamageThrownRec> g_itemDamageThrownDB;
|
||||
WowClientDB<ItemDamageTwoHandRec> g_itemDamageTwoHandDB;
|
||||
WowClientDB<ItemDamageTwoHandCasterRec> g_itemDamageTwoHandCasterDB;
|
||||
WowClientDB<ItemDamageWandRec> g_itemDamageWandDB;
|
||||
WowClientDB<ItemDisplayInfoRec> g_itemDisplayInfoDB;
|
||||
WowClientDB<ItemExtendedCostRec> g_itemExtendedCostDB;
|
||||
WowClientDB<ItemGroupSoundsRec> g_itemGroupSoundsDB;
|
||||
@ -120,130 +103,96 @@ WowClientDB<ItemPetFoodRec> g_itemPetFoodDB;
|
||||
WowClientDB<ItemPurchaseGroupRec> g_itemPurchaseGroupDB;
|
||||
WowClientDB<ItemRandomPropertiesRec> g_itemRandomPropertiesDB;
|
||||
WowClientDB<ItemRandomSuffixRec> g_itemRandomSuffixDB;
|
||||
WowClientDB<ItemReforgeRec> g_itemReforgeDB;
|
||||
WowClientDB<ItemSetRec> g_itemSetDB;
|
||||
WowClientDB<ItemSubClassRec> g_itemSubClassDB;
|
||||
WowClientDB<ItemSubClassMaskRec> g_itemSubClassMaskDB;
|
||||
WowClientDB<ItemVisualEffectsRec> g_itemVisualEffectsDB;
|
||||
WowClientDB<ItemVisualsRec> g_itemVisualsDB;
|
||||
WowClientDB<LFGDungeonExpansionRec> g_lFGDungeonExpansionDB;
|
||||
WowClientDB<LFGDungeonGroupRec> g_lFGDungeonGroupDB;
|
||||
WowClientDB<LFGDungeonsRec> g_lFGDungeonsDB;
|
||||
WowClientDB<LanguageWordsRec> g_languageWordsDB;
|
||||
WowClientDB<LanguagesRec> g_languagesDB;
|
||||
WowClientDB<LfgDungeonExpansionRec> g_lfgDungeonExpansionDB;
|
||||
WowClientDB<LfgDungeonGroupRec> g_lfgDungeonGroupDB;
|
||||
WowClientDB<LfgDungeonsRec> g_lfgDungeonsDB;
|
||||
WowClientDB<LightRec> g_lightDB;
|
||||
WowClientDB<LightFloatBandRec> g_lightFloatBandDB;
|
||||
WowClientDB<LightIntBandRec> g_lightIntBandDB;
|
||||
WowClientDB<LightParamsRec> g_lightParamsDB;
|
||||
WowClientDB<LightSkyboxRec> g_lightSkyboxDB;
|
||||
WowClientDB<LiquidMaterialRec> g_liquidMaterialDB;
|
||||
WowClientDB<LiquidObjectRec> g_liquidObjectDB;
|
||||
WowClientDB<LiquidTypeRec> g_liquidTypeDB;
|
||||
WowClientDB<LoadingScreenTaxiSplinesRec> g_loadingScreenTaxiSplinesDB;
|
||||
WowClientDB<LiquidMaterialRec> g_liquidMaterialDB;
|
||||
WowClientDB<LoadingScreensRec> g_loadingScreensDB;
|
||||
WowClientDB<LoadingScreenTaxiSplinesRec> g_loadingScreenTaxiSplinesDB;
|
||||
WowClientDB<LockRec> g_lockDB;
|
||||
WowClientDB<LockTypeRec> g_lockTypeDB;
|
||||
WowClientDB<MailTemplateRec> g_mailTemplateDB;
|
||||
WowClientDB<MapRec> g_mapDB;
|
||||
WowClientDB<MapDifficultyRec> g_mapDifficultyDB;
|
||||
WowClientDB<MaterialRec> g_materialDB;
|
||||
WowClientDB<MountTypeRec> g_mountTypeDB;
|
||||
WowClientDB<MovieRec> g_movieDB;
|
||||
WowClientDB<MovieFileDataRec> g_movieFileDataDB;
|
||||
WowClientDB<MovieVariationRec> g_movieVariationDB;
|
||||
WowClientDB<NPCSoundsRec> g_nPCSoundsDB;
|
||||
WowClientDB<NameGenRec> g_nameGenDB;
|
||||
WowClientDB<NPCSoundsRec> g_nPCSoundsDB;
|
||||
WowClientDB<NamesProfanityRec> g_namesProfanityDB;
|
||||
WowClientDB<NamesReservedRec> g_namesReservedDB;
|
||||
WowClientDB<ObjectEffectRec> g_objectEffectDB;
|
||||
WowClientDB<ObjectEffectGroupRec> g_objectEffectGroupDB;
|
||||
WowClientDB<ObjectEffectModifierRec> g_objectEffectModifierDB;
|
||||
WowClientDB<ObjectEffectPackageRec> g_objectEffectPackageDB;
|
||||
WowClientDB<ObjectEffectPackageElemRec> g_objectEffectPackageElemDB;
|
||||
WowClientDB<OverrideSpellDataRec> g_overrideSpellDataDB;
|
||||
WowClientDB<PVPDifficultyRec> g_pVPDifficultyDB;
|
||||
WowClientDB<PackageRec> g_packageDB;
|
||||
WowClientDB<PageTextMaterialRec> g_pageTextMaterialDB;
|
||||
WowClientDB<PaperDollItemFrameRec> g_paperDollItemFrameDB;
|
||||
WowClientDB<ParticleColorRec> g_particleColorDB;
|
||||
WowClientDB<PetPersonalityRec> g_petPersonalityDB;
|
||||
WowClientDB<PetitionTypeRec> g_petitionTypeDB;
|
||||
WowClientDB<PhaseRec> g_phaseDB;
|
||||
WowClientDB<PhaseShiftZoneSoundsRec> g_phaseShiftZoneSoundsDB;
|
||||
WowClientDB<PhaseXPhaseGroupRec> g_phaseXPhaseGroupDB;
|
||||
WowClientDB<PowerDisplayRec> g_powerDisplayDB;
|
||||
WowClientDB<PvpDifficultyRec> g_pvpDifficultyDB;
|
||||
WowClientDB<QuestFactionRewardRec> g_questFactionRewardDB;
|
||||
WowClientDB<QuestInfoRec> g_questInfoDB;
|
||||
WowClientDB<QuestSortRec> g_questSortDB;
|
||||
WowClientDB<QuestXPRec> g_questXPDB;
|
||||
WowClientDB<RandPropPointsRec> g_randPropPointsDB;
|
||||
WowClientDB<ResearchBranchRec> g_researchBranchDB;
|
||||
WowClientDB<ResistancesRec> g_resistancesDB;
|
||||
WowClientDB<RandPropPointsRec> g_randPropPointsDB;
|
||||
WowClientDB<ScalingStatDistributionRec> g_scalingStatDistributionDB;
|
||||
WowClientDB<ScalingStatValuesRec> g_scalingStatValuesDB;
|
||||
WowClientDB<ScreenEffectRec> g_screenEffectDB;
|
||||
WowClientDB<ServerMessagesRec> g_serverMessagesDB;
|
||||
WowClientDB<SheatheSoundLookupsRec> g_sheatheSoundLookupsDB;
|
||||
WowClientDB<SkillCostsDataRec> g_skillCostsDataDB;
|
||||
WowClientDB<SkillLineRec> g_skillLineDB;
|
||||
WowClientDB<SkillLineAbilityRec> g_skillLineAbilityDB;
|
||||
WowClientDB<SkillLineCategoryRec> g_skillLineCategoryDB;
|
||||
WowClientDB<SkillLineRec> g_skillLineDB;
|
||||
WowClientDB<SkillRaceClassInfoRec> g_skillRaceClassInfoDB;
|
||||
WowClientDB<SkillTiersRec> g_skillTiersDB;
|
||||
WowClientDB<SoundAmbienceRec> g_soundAmbienceDB;
|
||||
WowClientDB<SoundEmittersRec> g_soundEmittersDB;
|
||||
WowClientDB<SoundEntriesRec> g_soundEntriesDB;
|
||||
WowClientDB<SoundEntriesAdvancedRec> g_soundEntriesAdvancedDB;
|
||||
WowClientDB<SoundFilterRec> g_soundFilterDB;
|
||||
WowClientDB<SoundFilterElemRec> g_soundFilterElemDB;
|
||||
WowClientDB<SoundProviderPreferencesRec> g_soundProviderPreferencesDB;
|
||||
WowClientDB<SoundSamplePreferencesRec> g_soundSamplePreferencesDB;
|
||||
WowClientDB<SoundWaterTypeRec> g_soundWaterTypeDB;
|
||||
WowClientDB<SpamMessagesRec> g_spamMessagesDB;
|
||||
WowClientDB<SpellRec> g_spellDB;
|
||||
WowClientDB<SpellAuraOptionsRec> g_spellAuraOptionsDB;
|
||||
WowClientDB<SpellAuraRestrictionsRec> g_spellAuraRestrictionsDB;
|
||||
WowClientDB<SpellCastTimesRec> g_spellCastTimesDB;
|
||||
WowClientDB<SpellCastingRequirementsRec> g_spellCastingRequirementsDB;
|
||||
WowClientDB<SpellCategoriesRec> g_spellCategoriesDB;
|
||||
WowClientDB<SpellCategoryRec> g_spellCategoryDB;
|
||||
WowClientDB<SpellChainEffectsRec> g_spellChainEffectsDB;
|
||||
WowClientDB<SpellClassOptionsRec> g_spellClassOptionsDB;
|
||||
WowClientDB<SpellCooldownsRec> g_spellCooldownsDB;
|
||||
WowClientDB<SpellRec> g_spellDB;
|
||||
WowClientDB<SpellDescriptionVariablesRec> g_spellDescriptionVariablesDB;
|
||||
WowClientDB<SpellDifficultyRec> g_spellDifficultyDB;
|
||||
WowClientDB<SpellDispelTypeRec> g_spellDispelTypeDB;
|
||||
WowClientDB<SpellDurationRec> g_spellDurationDB;
|
||||
WowClientDB<SpellEffectRec> g_spellEffectDB;
|
||||
WowClientDB<SpellEffectCameraShakesRec> g_spellEffectCameraShakesDB;
|
||||
WowClientDB<SpellEquippedItemsRec> g_spellEquippedItemsDB;
|
||||
WowClientDB<SpellFocusObjectRec> g_spellFocusObjectDB;
|
||||
WowClientDB<SpellIconRec> g_spellIconDB;
|
||||
WowClientDB<SpellInterruptsRec> g_spellInterruptsDB;
|
||||
WowClientDB<SpellItemEnchantmentRec> g_spellItemEnchantmentDB;
|
||||
WowClientDB<SpellItemEnchantmentConditionRec> g_spellItemEnchantmentConditionDB;
|
||||
WowClientDB<SpellLevelsRec> g_spellLevelsDB;
|
||||
WowClientDB<SpellMechanicRec> g_spellMechanicDB;
|
||||
WowClientDB<SpellMissileRec> g_spellMissileDB;
|
||||
WowClientDB<SpellMissileMotionRec> g_spellMissileMotionDB;
|
||||
WowClientDB<SpellPowerRec> g_spellPowerDB;
|
||||
WowClientDB<SpellRadiusRec> g_spellRadiusDB;
|
||||
WowClientDB<SpellRangeRec> g_spellRangeDB;
|
||||
WowClientDB<SpellReagentsRec> g_spellReagentsDB;
|
||||
WowClientDB<SpellRuneCostRec> g_spellRuneCostDB;
|
||||
WowClientDB<SpellScalingRec> g_spellScalingDB;
|
||||
WowClientDB<SpellShapeshiftRec> g_spellShapeshiftDB;
|
||||
WowClientDB<SpellShapeshiftFormRec> g_spellShapeshiftFormDB;
|
||||
WowClientDB<SpellTargetRestrictionsRec> g_spellTargetRestrictionsDB;
|
||||
WowClientDB<SpellTotemsRec> g_spellTotemsDB;
|
||||
WowClientDB<SpellVisualRec> g_spellVisualDB;
|
||||
WowClientDB<SpellVisualEffectNameRec> g_spellVisualEffectNameDB;
|
||||
WowClientDB<SpellVisualKitRec> g_spellVisualKitDB;
|
||||
WowClientDB<SpellVisualKitAreaModelRec> g_spellVisualKitAreaModelDB;
|
||||
WowClientDB<SpellVisualKitModelAttachRec> g_spellVisualKitModelAttachDB;
|
||||
WowClientDB<SpellVisualPrecastTransitionsRec> g_spellVisualPrecastTransitionsDB;
|
||||
WowClientDB<StableSlotPricesRec> g_stableSlotPricesDB;
|
||||
WowClientDB<Startup_StringsRec> g_startup_StringsDB;
|
||||
WowClientDB<StationeryRec> g_stationeryDB;
|
||||
WowClientDB<StringLookupsRec> g_stringLookupsDB;
|
||||
WowClientDB<SummonPropertiesRec> g_summonPropertiesDB;
|
||||
@ -253,7 +202,6 @@ WowClientDB<TaxiNodesRec> g_taxiNodesDB;
|
||||
WowClientDB<TaxiPathRec> g_taxiPathDB;
|
||||
WowClientDB<TaxiPathNodeRec> g_taxiPathNodeDB;
|
||||
WowClientDB<TeamContributionPointsRec> g_teamContributionPointsDB;
|
||||
WowClientDB<TerrainMaterialRec> g_terrainMaterialDB;
|
||||
WowClientDB<TerrainTypeRec> g_terrainTypeDB;
|
||||
WowClientDB<TerrainTypeSoundsRec> g_terrainTypeSoundsDB;
|
||||
WowClientDB<TotemCategoryRec> g_totemCategoryDB;
|
||||
@ -265,338 +213,269 @@ WowClientDB<UnitBloodRec> g_unitBloodDB;
|
||||
WowClientDB<UnitBloodLevelsRec> g_unitBloodLevelsDB;
|
||||
WowClientDB<VehicleRec> g_vehicleDB;
|
||||
WowClientDB<VehicleSeatRec> g_vehicleSeatDB;
|
||||
WowClientDB<VehicleUIIndSeatRec> g_vehicleUIIndSeatDB;
|
||||
WowClientDB<VehicleUIIndicatorRec> g_vehicleUIIndicatorDB;
|
||||
WowClientDB<VideoHardwareRec> g_videoHardwareDB;
|
||||
WowClientDB<VehicleUIIndSeatRec> g_vehicleUIIndSeatDB;
|
||||
WowClientDB<VocalUISoundsRec> g_vocalUISoundsDB;
|
||||
WowClientDB<WMOAreaTableRec> g_wMOAreaTableDB;
|
||||
WowClientDB<WeaponImpactSoundsRec> g_weaponImpactSoundsDB;
|
||||
WowClientDB<WeaponSwingSounds2Rec> g_weaponSwingSounds2DB;
|
||||
WowClientDB<WeatherRec> g_weatherDB;
|
||||
WowClientDB<WorldChunkSoundsRec> g_worldChunkSoundsDB;
|
||||
WowClientDB<WorldMapAreaRec> g_worldMapAreaDB;
|
||||
WowClientDB<WorldMapTransformsRec> g_worldMapTransformsDB;
|
||||
WowClientDB<WorldMapContinentRec> g_worldMapContinentDB;
|
||||
WowClientDB<WorldMapOverlayRec> g_worldMapOverlayDB;
|
||||
WowClientDB<WorldMapTransformsRec> g_worldMapTransformsDB;
|
||||
WowClientDB<WorldSafeLocsRec> g_worldSafeLocsDB;
|
||||
WowClientDB<WorldStateUIRec> g_worldStateUIDB;
|
||||
WowClientDB<WorldStateZoneSoundsRec> g_worldStateZoneSoundsDB;
|
||||
WowClientDB<WowError_StringsRec> g_wowError_StringsDB;
|
||||
WowClientDB<ZoneIntroMusicTableRec> g_zoneIntroMusicTableDB;
|
||||
WowClientDB<ZoneLightRec> g_zoneLightDB;
|
||||
WowClientDB<ZoneLightPointRec> g_zoneLightPointDB;
|
||||
WowClientDB<ZoneMusicRec> g_zoneMusicDB;
|
||||
WowClientDB<gtBarberShopCostBaseRec> g_gtBarberShopCostBaseDB;
|
||||
WowClientDB<gtChanceToMeleeCritRec> g_gtChanceToMeleeCritDB;
|
||||
WowClientDB<gtChanceToMeleeCritBaseRec> g_gtChanceToMeleeCritBaseDB;
|
||||
WowClientDB<gtChanceToSpellCritRec> g_gtChanceToSpellCritDB;
|
||||
WowClientDB<gtChanceToSpellCritBaseRec> g_gtChanceToSpellCritBaseDB;
|
||||
WowClientDB<gtCombatRatingsRec> g_gtCombatRatingsDB;
|
||||
WowClientDB<gtNPCManaCostScalerRec> g_gtNPCManaCostScalerDB;
|
||||
WowClientDB<gtOCTClassCombatRatingScalarRec> g_gtOCTClassCombatRatingScalarDB;
|
||||
WowClientDB<gtOCTRegenHPRec> g_gtOCTRegenHPDB;
|
||||
WowClientDB<gtOCTRegenMPRec> g_gtOCTRegenMPDB;
|
||||
WowClientDB<gtRegenHPPerSptRec> g_gtRegenHPPerSptDB;
|
||||
WowClientDB<gtRegenMPPerSptRec> g_gtRegenMPPerSptDB;
|
||||
WowClientDB<gtSpellScalingRec> g_gtSpellScalingDB;
|
||||
WowClientDB<WorldStateZoneSoundsRec> g_worldStateZoneSoundsDB;
|
||||
WowClientDB<WorldChunkSoundsRec> g_worldChunkSoundsDB;
|
||||
WowClientDB<SoundEntriesAdvancedRec> g_soundEntriesAdvancedDB;
|
||||
WowClientDB<ObjectEffectRec> g_objectEffectDB;
|
||||
WowClientDB<ObjectEffectGroupRec> g_objectEffectGroupDB;
|
||||
WowClientDB<ObjectEffectModifierRec> g_objectEffectModifierDB;
|
||||
WowClientDB<ObjectEffectPackageRec> g_objectEffectPackageDB;
|
||||
WowClientDB<ObjectEffectPackageElemRec> g_objectEffectPackageElemDB;
|
||||
WowClientDB<SoundFilterRec> g_soundFilterDB;
|
||||
WowClientDB<SoundFilterElemRec> g_soundFilterElemDB;
|
||||
|
||||
void StaticDBLoadAll(void (*loadFn)(WowClientDB_Base*, const char*, int32_t)) {
|
||||
loadFn(&g_achievementDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_achievement_CategoryDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_achievement_CriteriaDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_animKitDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_animKitBoneSetDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_animKitBoneSetAliasDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_animKitConfigDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_animKitConfigBoneSetDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_animKitPriorityDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_animKitSegmentDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_animReplacementDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_animReplacementSetDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_animationDataDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_areaAssignmentDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_areaGroupDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_areaPOIDB, __FILE__, __LINE__);
|
||||
loadFn(&g_areaTableDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_areaTriggerDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_armorLocationDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_attackAnimKitsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_attackAnimTypesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_auctionHouseDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_bankBagSlotPricesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_bannedAddonsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_barberShopStyleDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_battlemasterListDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_cameraModeDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_cameraShakesDB, __FILE__, __LINE__);
|
||||
loadFn(&g_cfg_CategoriesDB, __FILE__, __LINE__);
|
||||
loadFn(&g_cfg_ConfigsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_charBaseInfoDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_charHairGeosetsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_charHairTexturesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_charSectionsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_charStartOutfitDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_charTitlesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_charVariationsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_characterFacialHairStylesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_chatChannelsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_chatProfanityDB, __FILE__, __LINE__);
|
||||
loadFn(&g_chrClassesDB, __FILE__, __LINE__);
|
||||
loadFn(&g_chrRacesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_cinematicCameraDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_cinematicSequencesDB, __FILE__, __LINE__);
|
||||
loadFn(&g_creatureDisplayInfoDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_creatureDisplayInfoExtraDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_creatureFamilyDB, __FILE__, __LINE__);
|
||||
loadFn(&g_creatureModelDataDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_creatureMovementInfoDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_creatureSoundDataDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_creatureSpellDataDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_creatureTypeDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_currencyCategoryDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_currencyTypesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_danceMovesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_deathThudLookupsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_declinedWordDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_declinedWordCasesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_destructibleModelDataDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_dungeonEncounterDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_dungeonMapDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_dungeonMapChunkDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_durabilityCostsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_durabilityQualityDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_emotesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_emotesTextDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_emotesTextDataDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_emotesTextSoundDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_environmentalDamageDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_exhaustionDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_factionDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_factionGroupDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_factionTemplateDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_fileDataDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_footprintTexturesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_footstepTerrainLookupDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gMSurveyAnswersDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gMSurveyCurrentSurveyDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gMSurveyQuestionsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gMSurveySurveysDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gMTicketCategoryDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gameObjectArtKitDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gameObjectDisplayInfoDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gameTablesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gameTipsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gemPropertiesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_glueScreenEmoteDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_glyphPropertiesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_glyphSlotDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_groundEffectDoodadDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_groundEffectTextureDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_guildPerkSpellsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_helmetGeosetVisDataDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_holidayDescriptionsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_holidayNamesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_holidaysDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemArmorQualityDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemArmorShieldDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemArmorTotalDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemBagFamilyDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemClassDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemCondExtCostsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemDamageAmmoDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemDamageOneHandDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemDamageOneHandCasterDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemDamageRangedDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemDamageThrownDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemDamageTwoHandDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemDamageTwoHandCasterDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemDamageWandDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemDisplayInfoDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemExtendedCostDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemGroupSoundsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemLimitCategoryDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemPetFoodDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemPurchaseGroupDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemRandomPropertiesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemRandomSuffixDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemReforgeDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemSetDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemSubClassDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemSubClassMaskDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemVisualEffectsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_itemVisualsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_lFGDungeonExpansionDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_lFGDungeonGroupDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_lFGDungeonsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_languageWordsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_languagesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_lightDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_lightFloatBandDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_lightIntBandDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_lightParamsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_lightSkyboxDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_liquidMaterialDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_liquidObjectDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_liquidTypeDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_loadingScreenTaxiSplinesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_loadingScreensDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_lockDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_lockTypeDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_mailTemplateDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_mapDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_mapDifficultyDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_materialDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_mountTypeDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_movieDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_movieFileDataDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_movieVariationDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_nPCSoundsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_nameGenDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_namesProfanityDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_namesReservedDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_objectEffectDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_objectEffectGroupDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_objectEffectModifierDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_objectEffectPackageDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_objectEffectPackageElemDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_overrideSpellDataDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_pVPDifficultyDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_packageDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_pageTextMaterialDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_paperDollItemFrameDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_particleColorDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_petPersonalityDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_petitionTypeDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_phaseDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_phaseShiftZoneSoundsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_phaseXPhaseGroupDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_powerDisplayDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_questFactionRewardDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_questInfoDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_questSortDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_questXPDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_randPropPointsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_researchBranchDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_resistancesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_scalingStatDistributionDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_scalingStatValuesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_screenEffectDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_serverMessagesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_sheatheSoundLookupsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_skillCostsDataDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_skillLineDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_skillLineAbilityDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_skillLineCategoryDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_skillRaceClassInfoDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_skillTiersDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_soundAmbienceDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_soundEmittersDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_soundEntriesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_soundEntriesAdvancedDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_soundFilterDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_soundFilterElemDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_soundProviderPreferencesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_soundSamplePreferencesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_soundWaterTypeDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spamMessagesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellAuraOptionsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellAuraRestrictionsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellCastTimesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellCastingRequirementsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellCategoriesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellCategoryDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellChainEffectsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellClassOptionsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellCooldownsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellDescriptionVariablesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellDifficultyDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellDispelTypeDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellDurationDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellEffectDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellEffectCameraShakesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellEquippedItemsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellFocusObjectDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellIconDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellInterruptsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellItemEnchantmentDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellItemEnchantmentConditionDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellLevelsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellMechanicDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellMissileDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellMissileMotionDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellPowerDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellRadiusDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellRangeDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellReagentsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellRuneCostDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellScalingDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellShapeshiftDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellShapeshiftFormDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellTargetRestrictionsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellTotemsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellVisualDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellVisualEffectNameDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellVisualKitDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellVisualKitAreaModelDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellVisualKitModelAttachDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_spellVisualPrecastTransitionsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_stableSlotPricesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_stationeryDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_stringLookupsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_summonPropertiesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_talentDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_talentTabDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_taxiNodesDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_taxiPathDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_taxiPathNodeDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_teamContributionPointsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_terrainMaterialDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_terrainTypeDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_terrainTypeSoundsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_totemCategoryDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_transportAnimationDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_transportPhysicsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_transportRotationDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_uISoundLookupsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_unitBloodDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_unitBloodLevelsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_vehicleDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_vehicleSeatDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_vehicleUIIndSeatDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_vehicleUIIndicatorDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_videoHardwareDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_vocalUISoundsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_wMOAreaTableDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_weaponImpactSoundsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_weaponSwingSounds2DB, __FILE__, __LINE__);
|
||||
//loadFn(&g_weatherDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_worldChunkSoundsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_worldMapAreaDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_worldMapContinentDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_worldMapOverlayDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_worldMapTransformsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_worldSafeLocsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_worldStateUIDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_worldStateZoneSoundsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_wowError_StringsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_zoneIntroMusicTableDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_zoneLightDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_zoneLightPointDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_zoneMusicDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gtBarberShopCostBaseDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gtChanceToMeleeCritDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gtChanceToMeleeCritBaseDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gtChanceToSpellCritDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gtChanceToSpellCritBaseDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gtCombatRatingsDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gtNPCManaCostScalerDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gtOCTClassCombatRatingScalarDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gtOCTRegenHPDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gtOCTRegenMPDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gtRegenHPPerSptDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gtRegenMPPerSptDB, __FILE__, __LINE__);
|
||||
//loadFn(&g_gtSpellScalingDB, __FILE__, __LINE__);
|
||||
void StaticDBLoadAll(void (*load)(WowClientDB_Base*, const char*, int32_t)) {
|
||||
load(&g_achievementDB, __FILE__, __LINE__);
|
||||
load(&g_achievement_CriteriaDB, __FILE__, __LINE__);
|
||||
load(&g_achievement_CategoryDB, __FILE__, __LINE__);
|
||||
load(&g_animationDataDB, __FILE__, __LINE__);
|
||||
load(&g_areaGroupDB, __FILE__, __LINE__);
|
||||
load(&g_areaPOIDB, __FILE__, __LINE__);
|
||||
load(&g_areaTableDB, __FILE__, __LINE__);
|
||||
load(&g_areaTriggerDB, __FILE__, __LINE__);
|
||||
load(&g_attackAnimKitsDB, __FILE__, __LINE__);
|
||||
load(&g_attackAnimTypesDB, __FILE__, __LINE__);
|
||||
load(&g_auctionHouseDB, __FILE__, __LINE__);
|
||||
load(&g_bankBagSlotPricesDB, __FILE__, __LINE__);
|
||||
load(&g_bannedAddOnsDB, __FILE__, __LINE__);
|
||||
load(&g_barberShopStyleDB, __FILE__, __LINE__);
|
||||
load(&g_battlemasterListDB, __FILE__, __LINE__);
|
||||
load(&g_cameraShakesDB, __FILE__, __LINE__);
|
||||
load(&g_cfg_CategoriesDB, __FILE__, __LINE__);
|
||||
load(&g_cfg_ConfigsDB, __FILE__, __LINE__);
|
||||
load(&g_charBaseInfoDB, __FILE__, __LINE__);
|
||||
load(&g_charHairGeosetsDB, __FILE__, __LINE__);
|
||||
load(&g_charSectionsDB, __FILE__, __LINE__);
|
||||
load(&g_charStartOutfitDB, __FILE__, __LINE__);
|
||||
load(&g_charTitlesDB, __FILE__, __LINE__);
|
||||
load(&g_characterFacialHairStylesDB, __FILE__, __LINE__);
|
||||
load(&g_chatChannelsDB, __FILE__, __LINE__);
|
||||
load(&g_chatProfanityDB, __FILE__, __LINE__);
|
||||
load(&g_chrClassesDB, __FILE__, __LINE__);
|
||||
load(&g_chrRacesDB, __FILE__, __LINE__);
|
||||
load(&g_cinematicCameraDB, __FILE__, __LINE__);
|
||||
load(&g_cinematicSequencesDB, __FILE__, __LINE__);
|
||||
load(&g_creatureDisplayInfoDB, __FILE__, __LINE__);
|
||||
load(&g_creatureDisplayInfoExtraDB, __FILE__, __LINE__);
|
||||
load(&g_creatureFamilyDB, __FILE__, __LINE__);
|
||||
load(&g_creatureModelDataDB, __FILE__, __LINE__);
|
||||
load(&g_creatureMovementInfoDB, __FILE__, __LINE__);
|
||||
load(&g_creatureSoundDataDB, __FILE__, __LINE__);
|
||||
load(&g_creatureSpellDataDB, __FILE__, __LINE__);
|
||||
load(&g_creatureTypeDB, __FILE__, __LINE__);
|
||||
load(&g_currencyTypesDB, __FILE__, __LINE__);
|
||||
load(&g_currencyCategoryDB, __FILE__, __LINE__);
|
||||
load(&g_danceMovesDB, __FILE__, __LINE__);
|
||||
load(&g_deathThudLookupsDB, __FILE__, __LINE__);
|
||||
load(&g_destructibleModelDataDB, __FILE__, __LINE__);
|
||||
load(&g_dungeonEncounterDB, __FILE__, __LINE__);
|
||||
load(&g_dungeonMapDB, __FILE__, __LINE__);
|
||||
load(&g_dungeonMapChunkDB, __FILE__, __LINE__);
|
||||
load(&g_durabilityCostsDB, __FILE__, __LINE__);
|
||||
load(&g_durabilityQualityDB, __FILE__, __LINE__);
|
||||
load(&g_emotesDB, __FILE__, __LINE__);
|
||||
load(&g_emotesTextDB, __FILE__, __LINE__);
|
||||
load(&g_emotesTextDataDB, __FILE__, __LINE__);
|
||||
load(&g_emotesTextSoundDB, __FILE__, __LINE__);
|
||||
load(&g_environmentalDamageDB, __FILE__, __LINE__);
|
||||
load(&g_exhaustionDB, __FILE__, __LINE__);
|
||||
load(&g_factionDB, __FILE__, __LINE__);
|
||||
load(&g_factionGroupDB, __FILE__, __LINE__);
|
||||
load(&g_factionTemplateDB, __FILE__, __LINE__);
|
||||
load(&g_fileDataDB, __FILE__, __LINE__);
|
||||
load(&g_footprintTexturesDB, __FILE__, __LINE__);
|
||||
load(&g_footstepTerrainLookupDB, __FILE__, __LINE__);
|
||||
load(&g_gameObjectArtKitDB, __FILE__, __LINE__);
|
||||
load(&g_gameObjectDisplayInfoDB, __FILE__, __LINE__);
|
||||
load(&g_gameTablesDB, __FILE__, __LINE__);
|
||||
load(&g_gameTipsDB, __FILE__, __LINE__);
|
||||
load(&g_gemPropertiesDB, __FILE__, __LINE__);
|
||||
load(&g_glyphPropertiesDB, __FILE__, __LINE__);
|
||||
load(&g_glyphSlotDB, __FILE__, __LINE__);
|
||||
load(&g_gMSurveyAnswersDB, __FILE__, __LINE__);
|
||||
load(&g_gMSurveyCurrentSurveyDB, __FILE__, __LINE__);
|
||||
load(&g_gMSurveyQuestionsDB, __FILE__, __LINE__);
|
||||
load(&g_gMSurveySurveysDB, __FILE__, __LINE__);
|
||||
load(&g_gMTicketCategoryDB, __FILE__, __LINE__);
|
||||
load(&g_groundEffectDoodadDB, __FILE__, __LINE__);
|
||||
load(&g_groundEffectTextureDB, __FILE__, __LINE__);
|
||||
load(&g_gtBarberShopCostBaseDB, __FILE__, __LINE__);
|
||||
load(&g_gtCombatRatingsDB, __FILE__, __LINE__);
|
||||
load(&g_gtChanceToMeleeCritDB, __FILE__, __LINE__);
|
||||
load(&g_gtChanceToMeleeCritBaseDB, __FILE__, __LINE__);
|
||||
load(&g_gtChanceToSpellCritDB, __FILE__, __LINE__);
|
||||
load(&g_gtChanceToSpellCritBaseDB, __FILE__, __LINE__);
|
||||
load(&g_gtNPCManaCostScalerDB, __FILE__, __LINE__);
|
||||
load(&g_gtOCTClassCombatRatingScalarDB, __FILE__, __LINE__);
|
||||
load(&g_gtOCTRegenHPDB, __FILE__, __LINE__);
|
||||
load(&g_gtOCTRegenMPDB, __FILE__, __LINE__);
|
||||
load(&g_gtRegenHPPerSptDB, __FILE__, __LINE__);
|
||||
load(&g_gtRegenMPPerSptDB, __FILE__, __LINE__);
|
||||
load(&g_helmetGeosetVisDataDB, __FILE__, __LINE__);
|
||||
load(&g_holidayDescriptionsDB, __FILE__, __LINE__);
|
||||
load(&g_holidayNamesDB, __FILE__, __LINE__);
|
||||
load(&g_holidaysDB, __FILE__, __LINE__);
|
||||
load(&g_itemDB, __FILE__, __LINE__);
|
||||
load(&g_itemBagFamilyDB, __FILE__, __LINE__);
|
||||
load(&g_itemClassDB, __FILE__, __LINE__);
|
||||
load(&g_itemCondExtCostsDB, __FILE__, __LINE__);
|
||||
load(&g_itemDisplayInfoDB, __FILE__, __LINE__);
|
||||
load(&g_itemExtendedCostDB, __FILE__, __LINE__);
|
||||
load(&g_itemGroupSoundsDB, __FILE__, __LINE__);
|
||||
load(&g_itemLimitCategoryDB, __FILE__, __LINE__);
|
||||
load(&g_itemPetFoodDB, __FILE__, __LINE__);
|
||||
load(&g_itemPurchaseGroupDB, __FILE__, __LINE__);
|
||||
load(&g_itemRandomPropertiesDB, __FILE__, __LINE__);
|
||||
load(&g_itemRandomSuffixDB, __FILE__, __LINE__);
|
||||
load(&g_itemSetDB, __FILE__, __LINE__);
|
||||
load(&g_itemSubClassDB, __FILE__, __LINE__);
|
||||
load(&g_itemSubClassMaskDB, __FILE__, __LINE__);
|
||||
load(&g_itemVisualEffectsDB, __FILE__, __LINE__);
|
||||
load(&g_itemVisualsDB, __FILE__, __LINE__);
|
||||
load(&g_languageWordsDB, __FILE__, __LINE__);
|
||||
load(&g_languagesDB, __FILE__, __LINE__);
|
||||
load(&g_lfgDungeonExpansionDB, __FILE__, __LINE__);
|
||||
load(&g_lfgDungeonGroupDB, __FILE__, __LINE__);
|
||||
load(&g_lfgDungeonsDB, __FILE__, __LINE__);
|
||||
load(&g_lightDB, __FILE__, __LINE__);
|
||||
load(&g_lightFloatBandDB, __FILE__, __LINE__);
|
||||
load(&g_lightIntBandDB, __FILE__, __LINE__);
|
||||
load(&g_lightParamsDB, __FILE__, __LINE__);
|
||||
load(&g_lightSkyboxDB, __FILE__, __LINE__);
|
||||
load(&g_liquidTypeDB, __FILE__, __LINE__);
|
||||
load(&g_liquidMaterialDB, __FILE__, __LINE__);
|
||||
load(&g_loadingScreensDB, __FILE__, __LINE__);
|
||||
load(&g_loadingScreenTaxiSplinesDB, __FILE__, __LINE__);
|
||||
load(&g_lockDB, __FILE__, __LINE__);
|
||||
load(&g_lockTypeDB, __FILE__, __LINE__);
|
||||
load(&g_mailTemplateDB, __FILE__, __LINE__);
|
||||
load(&g_mapDB, __FILE__, __LINE__);
|
||||
load(&g_mapDifficultyDB, __FILE__, __LINE__);
|
||||
load(&g_materialDB, __FILE__, __LINE__);
|
||||
load(&g_movieDB, __FILE__, __LINE__);
|
||||
load(&g_movieFileDataDB, __FILE__, __LINE__);
|
||||
load(&g_movieVariationDB, __FILE__, __LINE__);
|
||||
load(&g_nameGenDB, __FILE__, __LINE__);
|
||||
load(&g_nPCSoundsDB, __FILE__, __LINE__);
|
||||
load(&g_namesProfanityDB, __FILE__, __LINE__);
|
||||
load(&g_namesReservedDB, __FILE__, __LINE__);
|
||||
load(&g_overrideSpellDataDB, __FILE__, __LINE__);
|
||||
load(&g_packageDB, __FILE__, __LINE__);
|
||||
load(&g_pageTextMaterialDB, __FILE__, __LINE__);
|
||||
load(&g_paperDollItemFrameDB, __FILE__, __LINE__);
|
||||
load(&g_particleColorDB, __FILE__, __LINE__);
|
||||
load(&g_petPersonalityDB, __FILE__, __LINE__);
|
||||
load(&g_powerDisplayDB, __FILE__, __LINE__);
|
||||
load(&g_pvpDifficultyDB, __FILE__, __LINE__);
|
||||
load(&g_questFactionRewardDB, __FILE__, __LINE__);
|
||||
load(&g_questInfoDB, __FILE__, __LINE__);
|
||||
load(&g_questSortDB, __FILE__, __LINE__);
|
||||
load(&g_questXPDB, __FILE__, __LINE__);
|
||||
load(&g_resistancesDB, __FILE__, __LINE__);
|
||||
load(&g_randPropPointsDB, __FILE__, __LINE__);
|
||||
load(&g_scalingStatDistributionDB, __FILE__, __LINE__);
|
||||
load(&g_scalingStatValuesDB, __FILE__, __LINE__);
|
||||
load(&g_screenEffectDB, __FILE__, __LINE__);
|
||||
load(&g_serverMessagesDB, __FILE__, __LINE__);
|
||||
load(&g_sheatheSoundLookupsDB, __FILE__, __LINE__);
|
||||
load(&g_skillCostsDataDB, __FILE__, __LINE__);
|
||||
load(&g_skillLineAbilityDB, __FILE__, __LINE__);
|
||||
load(&g_skillLineCategoryDB, __FILE__, __LINE__);
|
||||
load(&g_skillLineDB, __FILE__, __LINE__);
|
||||
load(&g_skillRaceClassInfoDB, __FILE__, __LINE__);
|
||||
load(&g_skillTiersDB, __FILE__, __LINE__);
|
||||
load(&g_soundAmbienceDB, __FILE__, __LINE__);
|
||||
load(&g_soundEmittersDB, __FILE__, __LINE__);
|
||||
load(&g_soundEntriesDB, __FILE__, __LINE__);
|
||||
load(&g_soundProviderPreferencesDB, __FILE__, __LINE__);
|
||||
load(&g_soundSamplePreferencesDB, __FILE__, __LINE__);
|
||||
load(&g_soundWaterTypeDB, __FILE__, __LINE__);
|
||||
load(&g_spamMessagesDB, __FILE__, __LINE__);
|
||||
load(&g_spellCastTimesDB, __FILE__, __LINE__);
|
||||
load(&g_spellCategoryDB, __FILE__, __LINE__);
|
||||
load(&g_spellChainEffectsDB, __FILE__, __LINE__);
|
||||
load(&g_spellDB, __FILE__, __LINE__);
|
||||
load(&g_spellDescriptionVariablesDB, __FILE__, __LINE__);
|
||||
load(&g_spellDifficultyDB, __FILE__, __LINE__);
|
||||
load(&g_spellDispelTypeDB, __FILE__, __LINE__);
|
||||
load(&g_spellDurationDB, __FILE__, __LINE__);
|
||||
load(&g_spellEffectCameraShakesDB, __FILE__, __LINE__);
|
||||
load(&g_spellFocusObjectDB, __FILE__, __LINE__);
|
||||
load(&g_spellIconDB, __FILE__, __LINE__);
|
||||
load(&g_spellItemEnchantmentDB, __FILE__, __LINE__);
|
||||
load(&g_spellItemEnchantmentConditionDB, __FILE__, __LINE__);
|
||||
load(&g_spellMechanicDB, __FILE__, __LINE__);
|
||||
load(&g_spellMissileDB, __FILE__, __LINE__);
|
||||
load(&g_spellMissileMotionDB, __FILE__, __LINE__);
|
||||
load(&g_spellRadiusDB, __FILE__, __LINE__);
|
||||
load(&g_spellRangeDB, __FILE__, __LINE__);
|
||||
load(&g_spellRuneCostDB, __FILE__, __LINE__);
|
||||
load(&g_spellShapeshiftFormDB, __FILE__, __LINE__);
|
||||
load(&g_spellVisualDB, __FILE__, __LINE__);
|
||||
load(&g_spellVisualEffectNameDB, __FILE__, __LINE__);
|
||||
load(&g_spellVisualKitDB, __FILE__, __LINE__);
|
||||
load(&g_spellVisualKitAreaModelDB, __FILE__, __LINE__);
|
||||
load(&g_spellVisualKitModelAttachDB, __FILE__, __LINE__);
|
||||
load(&g_stableSlotPricesDB, __FILE__, __LINE__);
|
||||
load(&g_stationeryDB, __FILE__, __LINE__);
|
||||
load(&g_stringLookupsDB, __FILE__, __LINE__);
|
||||
load(&g_summonPropertiesDB, __FILE__, __LINE__);
|
||||
load(&g_talentDB, __FILE__, __LINE__);
|
||||
load(&g_talentTabDB, __FILE__, __LINE__);
|
||||
load(&g_taxiNodesDB, __FILE__, __LINE__);
|
||||
load(&g_taxiPathDB, __FILE__, __LINE__);
|
||||
load(&g_taxiPathNodeDB, __FILE__, __LINE__);
|
||||
load(&g_teamContributionPointsDB, __FILE__, __LINE__);
|
||||
load(&g_terrainTypeDB, __FILE__, __LINE__);
|
||||
load(&g_terrainTypeSoundsDB, __FILE__, __LINE__);
|
||||
load(&g_totemCategoryDB, __FILE__, __LINE__);
|
||||
load(&g_transportAnimationDB, __FILE__, __LINE__);
|
||||
load(&g_transportPhysicsDB, __FILE__, __LINE__);
|
||||
load(&g_transportRotationDB, __FILE__, __LINE__);
|
||||
load(&g_uISoundLookupsDB, __FILE__, __LINE__);
|
||||
load(&g_unitBloodDB, __FILE__, __LINE__);
|
||||
load(&g_unitBloodLevelsDB, __FILE__, __LINE__);
|
||||
load(&g_vehicleDB, __FILE__, __LINE__);
|
||||
load(&g_vehicleSeatDB, __FILE__, __LINE__);
|
||||
load(&g_vehicleUIIndicatorDB, __FILE__, __LINE__);
|
||||
load(&g_vehicleUIIndSeatDB, __FILE__, __LINE__);
|
||||
load(&g_vocalUISoundsDB, __FILE__, __LINE__);
|
||||
load(&g_wMOAreaTableDB, __FILE__, __LINE__);
|
||||
load(&g_weaponImpactSoundsDB, __FILE__, __LINE__);
|
||||
load(&g_weaponSwingSounds2DB, __FILE__, __LINE__);
|
||||
load(&g_weatherDB, __FILE__, __LINE__);
|
||||
load(&g_worldMapAreaDB, __FILE__, __LINE__);
|
||||
load(&g_worldMapTransformsDB, __FILE__, __LINE__);
|
||||
load(&g_worldMapContinentDB, __FILE__, __LINE__);
|
||||
load(&g_worldMapOverlayDB, __FILE__, __LINE__);
|
||||
load(&g_worldSafeLocsDB, __FILE__, __LINE__);
|
||||
load(&g_worldStateUIDB, __FILE__, __LINE__);
|
||||
load(&g_zoneIntroMusicTableDB, __FILE__, __LINE__);
|
||||
load(&g_zoneMusicDB, __FILE__, __LINE__);
|
||||
load(&g_worldStateZoneSoundsDB, __FILE__, __LINE__);
|
||||
load(&g_worldChunkSoundsDB, __FILE__, __LINE__);
|
||||
load(&g_soundEntriesAdvancedDB, __FILE__, __LINE__);
|
||||
load(&g_objectEffectDB, __FILE__, __LINE__);
|
||||
load(&g_objectEffectGroupDB, __FILE__, __LINE__);
|
||||
load(&g_objectEffectModifierDB, __FILE__, __LINE__);
|
||||
load(&g_objectEffectPackageDB, __FILE__, __LINE__);
|
||||
load(&g_objectEffectPackageElemDB, __FILE__, __LINE__);
|
||||
load(&g_soundFilterDB, __FILE__, __LINE__);
|
||||
load(&g_soundFilterElemDB, __FILE__, __LINE__);
|
||||
}
|
||||
|
||||
|
||||
@ -5,42 +5,28 @@
|
||||
#include "db/WowClientDB_Base.hpp"
|
||||
#include "db/WowClientDB.hpp"
|
||||
#include "db/rec/AchievementRec.hpp"
|
||||
#include "db/rec/Achievement_CategoryRec.hpp"
|
||||
#include "db/rec/Achievement_CriteriaRec.hpp"
|
||||
#include "db/rec/AnimKitRec.hpp"
|
||||
#include "db/rec/AnimKitBoneSetRec.hpp"
|
||||
#include "db/rec/AnimKitBoneSetAliasRec.hpp"
|
||||
#include "db/rec/AnimKitConfigRec.hpp"
|
||||
#include "db/rec/AnimKitConfigBoneSetRec.hpp"
|
||||
#include "db/rec/AnimKitPriorityRec.hpp"
|
||||
#include "db/rec/AnimKitSegmentRec.hpp"
|
||||
#include "db/rec/AnimReplacementRec.hpp"
|
||||
#include "db/rec/AnimReplacementSetRec.hpp"
|
||||
#include "db/rec/Achievement_CategoryRec.hpp"
|
||||
#include "db/rec/AnimationDataRec.hpp"
|
||||
#include "db/rec/AreaAssignmentRec.hpp"
|
||||
#include "db/rec/AreaGroupRec.hpp"
|
||||
#include "db/rec/AreaPOIRec.hpp"
|
||||
#include "db/rec/AreaTableRec.hpp"
|
||||
#include "db/rec/AreaTriggerRec.hpp"
|
||||
#include "db/rec/ArmorLocationRec.hpp"
|
||||
#include "db/rec/AttackAnimKitsRec.hpp"
|
||||
#include "db/rec/AttackAnimTypesRec.hpp"
|
||||
#include "db/rec/AuctionHouseRec.hpp"
|
||||
#include "db/rec/BankBagSlotPricesRec.hpp"
|
||||
#include "db/rec/BannedAddonsRec.hpp"
|
||||
#include "db/rec/BannedAddOnsRec.hpp"
|
||||
#include "db/rec/BarberShopStyleRec.hpp"
|
||||
#include "db/rec/BattlemasterListRec.hpp"
|
||||
#include "db/rec/CameraModeRec.hpp"
|
||||
#include "db/rec/CameraShakesRec.hpp"
|
||||
#include "db/rec/Cfg_CategoriesRec.hpp"
|
||||
#include "db/rec/Cfg_ConfigsRec.hpp"
|
||||
#include "db/rec/CharBaseInfoRec.hpp"
|
||||
#include "db/rec/CharHairGeosetsRec.hpp"
|
||||
#include "db/rec/CharHairTexturesRec.hpp"
|
||||
#include "db/rec/CharSectionsRec.hpp"
|
||||
#include "db/rec/CharStartOutfitRec.hpp"
|
||||
#include "db/rec/CharTitlesRec.hpp"
|
||||
#include "db/rec/CharVariationsRec.hpp"
|
||||
#include "db/rec/CharacterFacialHairStylesRec.hpp"
|
||||
#include "db/rec/ChatChannelsRec.hpp"
|
||||
#include "db/rec/ChatProfanityRec.hpp"
|
||||
@ -56,12 +42,10 @@
|
||||
#include "db/rec/CreatureSoundDataRec.hpp"
|
||||
#include "db/rec/CreatureSpellDataRec.hpp"
|
||||
#include "db/rec/CreatureTypeRec.hpp"
|
||||
#include "db/rec/CurrencyCategoryRec.hpp"
|
||||
#include "db/rec/CurrencyTypesRec.hpp"
|
||||
#include "db/rec/CurrencyCategoryRec.hpp"
|
||||
#include "db/rec/DanceMovesRec.hpp"
|
||||
#include "db/rec/DeathThudLookupsRec.hpp"
|
||||
#include "db/rec/DeclinedWordRec.hpp"
|
||||
#include "db/rec/DeclinedWordCasesRec.hpp"
|
||||
#include "db/rec/DestructibleModelDataRec.hpp"
|
||||
#include "db/rec/DungeonEncounterRec.hpp"
|
||||
#include "db/rec/DungeonMapRec.hpp"
|
||||
@ -80,41 +64,40 @@
|
||||
#include "db/rec/FileDataRec.hpp"
|
||||
#include "db/rec/FootprintTexturesRec.hpp"
|
||||
#include "db/rec/FootstepTerrainLookupRec.hpp"
|
||||
#include "db/rec/GMSurveyAnswersRec.hpp"
|
||||
#include "db/rec/GMSurveyCurrentSurveyRec.hpp"
|
||||
#include "db/rec/GMSurveyQuestionsRec.hpp"
|
||||
#include "db/rec/GMSurveySurveysRec.hpp"
|
||||
#include "db/rec/GMTicketCategoryRec.hpp"
|
||||
#include "db/rec/GameObjectArtKitRec.hpp"
|
||||
#include "db/rec/GameObjectDisplayInfoRec.hpp"
|
||||
#include "db/rec/GameTablesRec.hpp"
|
||||
#include "db/rec/GameTipsRec.hpp"
|
||||
#include "db/rec/GemPropertiesRec.hpp"
|
||||
#include "db/rec/GlueScreenEmoteRec.hpp"
|
||||
#include "db/rec/GlyphPropertiesRec.hpp"
|
||||
#include "db/rec/GlyphSlotRec.hpp"
|
||||
#include "db/rec/GMSurveyAnswersRec.hpp"
|
||||
#include "db/rec/GMSurveyCurrentSurveyRec.hpp"
|
||||
#include "db/rec/GMSurveyQuestionsRec.hpp"
|
||||
#include "db/rec/GMSurveySurveysRec.hpp"
|
||||
#include "db/rec/GMTicketCategoryRec.hpp"
|
||||
#include "db/rec/GroundEffectDoodadRec.hpp"
|
||||
#include "db/rec/GroundEffectTextureRec.hpp"
|
||||
#include "db/rec/GuildPerkSpellsRec.hpp"
|
||||
#include "db/rec/gtBarberShopCostBaseRec.hpp"
|
||||
#include "db/rec/gtCombatRatingsRec.hpp"
|
||||
#include "db/rec/gtChanceToMeleeCritRec.hpp"
|
||||
#include "db/rec/gtChanceToMeleeCritBaseRec.hpp"
|
||||
#include "db/rec/gtChanceToSpellCritRec.hpp"
|
||||
#include "db/rec/gtChanceToSpellCritBaseRec.hpp"
|
||||
#include "db/rec/gtNPCManaCostScalerRec.hpp"
|
||||
#include "db/rec/gtOCTClassCombatRatingScalarRec.hpp"
|
||||
#include "db/rec/gtOCTRegenHPRec.hpp"
|
||||
#include "db/rec/gtOCTRegenMPRec.hpp"
|
||||
#include "db/rec/gtRegenHPPerSptRec.hpp"
|
||||
#include "db/rec/gtRegenMPPerSptRec.hpp"
|
||||
#include "db/rec/HelmetGeosetVisDataRec.hpp"
|
||||
#include "db/rec/HolidayDescriptionsRec.hpp"
|
||||
#include "db/rec/HolidayNamesRec.hpp"
|
||||
#include "db/rec/HolidaysRec.hpp"
|
||||
#include "db/rec/ItemRec.hpp"
|
||||
#include "db/rec/ItemArmorQualityRec.hpp"
|
||||
#include "db/rec/ItemArmorShieldRec.hpp"
|
||||
#include "db/rec/ItemArmorTotalRec.hpp"
|
||||
#include "db/rec/ItemBagFamilyRec.hpp"
|
||||
#include "db/rec/ItemClassRec.hpp"
|
||||
#include "db/rec/ItemCondExtCostsRec.hpp"
|
||||
#include "db/rec/ItemDamageAmmoRec.hpp"
|
||||
#include "db/rec/ItemDamageOneHandRec.hpp"
|
||||
#include "db/rec/ItemDamageOneHandCasterRec.hpp"
|
||||
#include "db/rec/ItemDamageRangedRec.hpp"
|
||||
#include "db/rec/ItemDamageThrownRec.hpp"
|
||||
#include "db/rec/ItemDamageTwoHandRec.hpp"
|
||||
#include "db/rec/ItemDamageTwoHandCasterRec.hpp"
|
||||
#include "db/rec/ItemDamageWandRec.hpp"
|
||||
#include "db/rec/ItemDisplayInfoRec.hpp"
|
||||
#include "db/rec/ItemExtendedCostRec.hpp"
|
||||
#include "db/rec/ItemGroupSoundsRec.hpp"
|
||||
@ -123,130 +106,96 @@
|
||||
#include "db/rec/ItemPurchaseGroupRec.hpp"
|
||||
#include "db/rec/ItemRandomPropertiesRec.hpp"
|
||||
#include "db/rec/ItemRandomSuffixRec.hpp"
|
||||
#include "db/rec/ItemReforgeRec.hpp"
|
||||
#include "db/rec/ItemSetRec.hpp"
|
||||
#include "db/rec/ItemSubClassRec.hpp"
|
||||
#include "db/rec/ItemSubClassMaskRec.hpp"
|
||||
#include "db/rec/ItemVisualEffectsRec.hpp"
|
||||
#include "db/rec/ItemVisualsRec.hpp"
|
||||
#include "db/rec/LFGDungeonExpansionRec.hpp"
|
||||
#include "db/rec/LFGDungeonGroupRec.hpp"
|
||||
#include "db/rec/LFGDungeonsRec.hpp"
|
||||
#include "db/rec/LanguageWordsRec.hpp"
|
||||
#include "db/rec/LanguagesRec.hpp"
|
||||
#include "db/rec/LfgDungeonExpansionRec.hpp"
|
||||
#include "db/rec/LfgDungeonGroupRec.hpp"
|
||||
#include "db/rec/LfgDungeonsRec.hpp"
|
||||
#include "db/rec/LightRec.hpp"
|
||||
#include "db/rec/LightFloatBandRec.hpp"
|
||||
#include "db/rec/LightIntBandRec.hpp"
|
||||
#include "db/rec/LightParamsRec.hpp"
|
||||
#include "db/rec/LightSkyboxRec.hpp"
|
||||
#include "db/rec/LiquidMaterialRec.hpp"
|
||||
#include "db/rec/LiquidObjectRec.hpp"
|
||||
#include "db/rec/LiquidTypeRec.hpp"
|
||||
#include "db/rec/LoadingScreenTaxiSplinesRec.hpp"
|
||||
#include "db/rec/LiquidMaterialRec.hpp"
|
||||
#include "db/rec/LoadingScreensRec.hpp"
|
||||
#include "db/rec/LoadingScreenTaxiSplinesRec.hpp"
|
||||
#include "db/rec/LockRec.hpp"
|
||||
#include "db/rec/LockTypeRec.hpp"
|
||||
#include "db/rec/MailTemplateRec.hpp"
|
||||
#include "db/rec/MapRec.hpp"
|
||||
#include "db/rec/MapDifficultyRec.hpp"
|
||||
#include "db/rec/MaterialRec.hpp"
|
||||
#include "db/rec/MountTypeRec.hpp"
|
||||
#include "db/rec/MovieRec.hpp"
|
||||
#include "db/rec/MovieFileDataRec.hpp"
|
||||
#include "db/rec/MovieVariationRec.hpp"
|
||||
#include "db/rec/NPCSoundsRec.hpp"
|
||||
#include "db/rec/NameGenRec.hpp"
|
||||
#include "db/rec/NPCSoundsRec.hpp"
|
||||
#include "db/rec/NamesProfanityRec.hpp"
|
||||
#include "db/rec/NamesReservedRec.hpp"
|
||||
#include "db/rec/ObjectEffectRec.hpp"
|
||||
#include "db/rec/ObjectEffectGroupRec.hpp"
|
||||
#include "db/rec/ObjectEffectModifierRec.hpp"
|
||||
#include "db/rec/ObjectEffectPackageRec.hpp"
|
||||
#include "db/rec/ObjectEffectPackageElemRec.hpp"
|
||||
#include "db/rec/OverrideSpellDataRec.hpp"
|
||||
#include "db/rec/PVPDifficultyRec.hpp"
|
||||
#include "db/rec/PackageRec.hpp"
|
||||
#include "db/rec/PageTextMaterialRec.hpp"
|
||||
#include "db/rec/PaperDollItemFrameRec.hpp"
|
||||
#include "db/rec/ParticleColorRec.hpp"
|
||||
#include "db/rec/PetPersonalityRec.hpp"
|
||||
#include "db/rec/PetitionTypeRec.hpp"
|
||||
#include "db/rec/PhaseRec.hpp"
|
||||
#include "db/rec/PhaseShiftZoneSoundsRec.hpp"
|
||||
#include "db/rec/PhaseXPhaseGroupRec.hpp"
|
||||
#include "db/rec/PowerDisplayRec.hpp"
|
||||
#include "db/rec/PvpDifficultyRec.hpp"
|
||||
#include "db/rec/QuestFactionRewardRec.hpp"
|
||||
#include "db/rec/QuestInfoRec.hpp"
|
||||
#include "db/rec/QuestSortRec.hpp"
|
||||
#include "db/rec/QuestXPRec.hpp"
|
||||
#include "db/rec/RandPropPointsRec.hpp"
|
||||
#include "db/rec/ResearchBranchRec.hpp"
|
||||
#include "db/rec/ResistancesRec.hpp"
|
||||
#include "db/rec/RandPropPointsRec.hpp"
|
||||
#include "db/rec/ScalingStatDistributionRec.hpp"
|
||||
#include "db/rec/ScalingStatValuesRec.hpp"
|
||||
#include "db/rec/ScreenEffectRec.hpp"
|
||||
#include "db/rec/ServerMessagesRec.hpp"
|
||||
#include "db/rec/SheatheSoundLookupsRec.hpp"
|
||||
#include "db/rec/SkillCostsDataRec.hpp"
|
||||
#include "db/rec/SkillLineRec.hpp"
|
||||
#include "db/rec/SkillLineAbilityRec.hpp"
|
||||
#include "db/rec/SkillLineCategoryRec.hpp"
|
||||
#include "db/rec/SkillLineRec.hpp"
|
||||
#include "db/rec/SkillRaceClassInfoRec.hpp"
|
||||
#include "db/rec/SkillTiersRec.hpp"
|
||||
#include "db/rec/SoundAmbienceRec.hpp"
|
||||
#include "db/rec/SoundEmittersRec.hpp"
|
||||
#include "db/rec/SoundEntriesRec.hpp"
|
||||
#include "db/rec/SoundEntriesAdvancedRec.hpp"
|
||||
#include "db/rec/SoundFilterRec.hpp"
|
||||
#include "db/rec/SoundFilterElemRec.hpp"
|
||||
#include "db/rec/SoundProviderPreferencesRec.hpp"
|
||||
#include "db/rec/SoundSamplePreferencesRec.hpp"
|
||||
#include "db/rec/SoundWaterTypeRec.hpp"
|
||||
#include "db/rec/SpamMessagesRec.hpp"
|
||||
#include "db/rec/SpellRec.hpp"
|
||||
#include "db/rec/SpellAuraOptionsRec.hpp"
|
||||
#include "db/rec/SpellAuraRestrictionsRec.hpp"
|
||||
#include "db/rec/SpellCastTimesRec.hpp"
|
||||
#include "db/rec/SpellCastingRequirementsRec.hpp"
|
||||
#include "db/rec/SpellCategoriesRec.hpp"
|
||||
#include "db/rec/SpellCategoryRec.hpp"
|
||||
#include "db/rec/SpellChainEffectsRec.hpp"
|
||||
#include "db/rec/SpellClassOptionsRec.hpp"
|
||||
#include "db/rec/SpellCooldownsRec.hpp"
|
||||
#include "db/rec/SpellRec.hpp"
|
||||
#include "db/rec/SpellDescriptionVariablesRec.hpp"
|
||||
#include "db/rec/SpellDifficultyRec.hpp"
|
||||
#include "db/rec/SpellDispelTypeRec.hpp"
|
||||
#include "db/rec/SpellDurationRec.hpp"
|
||||
#include "db/rec/SpellEffectRec.hpp"
|
||||
#include "db/rec/SpellEffectCameraShakesRec.hpp"
|
||||
#include "db/rec/SpellEquippedItemsRec.hpp"
|
||||
#include "db/rec/SpellFocusObjectRec.hpp"
|
||||
#include "db/rec/SpellIconRec.hpp"
|
||||
#include "db/rec/SpellInterruptsRec.hpp"
|
||||
#include "db/rec/SpellItemEnchantmentRec.hpp"
|
||||
#include "db/rec/SpellItemEnchantmentConditionRec.hpp"
|
||||
#include "db/rec/SpellLevelsRec.hpp"
|
||||
#include "db/rec/SpellMechanicRec.hpp"
|
||||
#include "db/rec/SpellMissileRec.hpp"
|
||||
#include "db/rec/SpellMissileMotionRec.hpp"
|
||||
#include "db/rec/SpellPowerRec.hpp"
|
||||
#include "db/rec/SpellRadiusRec.hpp"
|
||||
#include "db/rec/SpellRangeRec.hpp"
|
||||
#include "db/rec/SpellReagentsRec.hpp"
|
||||
#include "db/rec/SpellRuneCostRec.hpp"
|
||||
#include "db/rec/SpellScalingRec.hpp"
|
||||
#include "db/rec/SpellShapeshiftRec.hpp"
|
||||
#include "db/rec/SpellShapeshiftFormRec.hpp"
|
||||
#include "db/rec/SpellTargetRestrictionsRec.hpp"
|
||||
#include "db/rec/SpellTotemsRec.hpp"
|
||||
#include "db/rec/SpellVisualRec.hpp"
|
||||
#include "db/rec/SpellVisualEffectNameRec.hpp"
|
||||
#include "db/rec/SpellVisualKitRec.hpp"
|
||||
#include "db/rec/SpellVisualKitAreaModelRec.hpp"
|
||||
#include "db/rec/SpellVisualKitModelAttachRec.hpp"
|
||||
#include "db/rec/SpellVisualPrecastTransitionsRec.hpp"
|
||||
#include "db/rec/StableSlotPricesRec.hpp"
|
||||
#include "db/rec/Startup_StringsRec.hpp"
|
||||
#include "db/rec/StationeryRec.hpp"
|
||||
#include "db/rec/StringLookupsRec.hpp"
|
||||
#include "db/rec/SummonPropertiesRec.hpp"
|
||||
@ -256,7 +205,6 @@
|
||||
#include "db/rec/TaxiPathRec.hpp"
|
||||
#include "db/rec/TaxiPathNodeRec.hpp"
|
||||
#include "db/rec/TeamContributionPointsRec.hpp"
|
||||
#include "db/rec/TerrainMaterialRec.hpp"
|
||||
#include "db/rec/TerrainTypeRec.hpp"
|
||||
#include "db/rec/TerrainTypeSoundsRec.hpp"
|
||||
#include "db/rec/TotemCategoryRec.hpp"
|
||||
@ -268,78 +216,55 @@
|
||||
#include "db/rec/UnitBloodLevelsRec.hpp"
|
||||
#include "db/rec/VehicleRec.hpp"
|
||||
#include "db/rec/VehicleSeatRec.hpp"
|
||||
#include "db/rec/VehicleUIIndSeatRec.hpp"
|
||||
#include "db/rec/VehicleUIIndicatorRec.hpp"
|
||||
#include "db/rec/VideoHardwareRec.hpp"
|
||||
#include "db/rec/VehicleUIIndSeatRec.hpp"
|
||||
#include "db/rec/VocalUISoundsRec.hpp"
|
||||
#include "db/rec/WMOAreaTableRec.hpp"
|
||||
#include "db/rec/WeaponImpactSoundsRec.hpp"
|
||||
#include "db/rec/WeaponSwingSounds2Rec.hpp"
|
||||
#include "db/rec/WeatherRec.hpp"
|
||||
#include "db/rec/WorldChunkSoundsRec.hpp"
|
||||
#include "db/rec/WorldMapAreaRec.hpp"
|
||||
#include "db/rec/WorldMapTransformsRec.hpp"
|
||||
#include "db/rec/WorldMapContinentRec.hpp"
|
||||
#include "db/rec/WorldMapOverlayRec.hpp"
|
||||
#include "db/rec/WorldMapTransformsRec.hpp"
|
||||
#include "db/rec/WorldSafeLocsRec.hpp"
|
||||
#include "db/rec/WorldStateUIRec.hpp"
|
||||
#include "db/rec/WorldStateZoneSoundsRec.hpp"
|
||||
#include "db/rec/WowError_StringsRec.hpp"
|
||||
#include "db/rec/ZoneIntroMusicTableRec.hpp"
|
||||
#include "db/rec/ZoneLightRec.hpp"
|
||||
#include "db/rec/ZoneLightPointRec.hpp"
|
||||
#include "db/rec/ZoneMusicRec.hpp"
|
||||
#include "db/rec/gtBarberShopCostBaseRec.hpp"
|
||||
#include "db/rec/gtChanceToMeleeCritRec.hpp"
|
||||
#include "db/rec/gtChanceToMeleeCritBaseRec.hpp"
|
||||
#include "db/rec/gtChanceToSpellCritRec.hpp"
|
||||
#include "db/rec/gtChanceToSpellCritBaseRec.hpp"
|
||||
#include "db/rec/gtCombatRatingsRec.hpp"
|
||||
#include "db/rec/gtNPCManaCostScalerRec.hpp"
|
||||
#include "db/rec/gtOCTClassCombatRatingScalarRec.hpp"
|
||||
#include "db/rec/gtOCTRegenHPRec.hpp"
|
||||
#include "db/rec/gtOCTRegenMPRec.hpp"
|
||||
#include "db/rec/gtRegenHPPerSptRec.hpp"
|
||||
#include "db/rec/gtRegenMPPerSptRec.hpp"
|
||||
#include "db/rec/gtSpellScalingRec.hpp"
|
||||
#include "db/rec/WorldStateZoneSoundsRec.hpp"
|
||||
#include "db/rec/WorldChunkSoundsRec.hpp"
|
||||
#include "db/rec/SoundEntriesAdvancedRec.hpp"
|
||||
#include "db/rec/ObjectEffectRec.hpp"
|
||||
#include "db/rec/ObjectEffectGroupRec.hpp"
|
||||
#include "db/rec/ObjectEffectModifierRec.hpp"
|
||||
#include "db/rec/ObjectEffectPackageRec.hpp"
|
||||
#include "db/rec/ObjectEffectPackageElemRec.hpp"
|
||||
#include "db/rec/SoundFilterRec.hpp"
|
||||
#include "db/rec/SoundFilterElemRec.hpp"
|
||||
|
||||
extern WowClientDB<AchievementRec> g_achievementDB;
|
||||
extern WowClientDB<Achievement_CategoryRec> g_achievement_CategoryDB;
|
||||
extern WowClientDB<Achievement_CriteriaRec> g_achievement_CriteriaDB;
|
||||
extern WowClientDB<AnimKitRec> g_animKitDB;
|
||||
extern WowClientDB<AnimKitBoneSetRec> g_animKitBoneSetDB;
|
||||
extern WowClientDB<AnimKitBoneSetAliasRec> g_animKitBoneSetAliasDB;
|
||||
extern WowClientDB<AnimKitConfigRec> g_animKitConfigDB;
|
||||
extern WowClientDB<AnimKitConfigBoneSetRec> g_animKitConfigBoneSetDB;
|
||||
extern WowClientDB<AnimKitPriorityRec> g_animKitPriorityDB;
|
||||
extern WowClientDB<AnimKitSegmentRec> g_animKitSegmentDB;
|
||||
extern WowClientDB<AnimReplacementRec> g_animReplacementDB;
|
||||
extern WowClientDB<AnimReplacementSetRec> g_animReplacementSetDB;
|
||||
extern WowClientDB<Achievement_CategoryRec> g_achievement_CategoryDB;
|
||||
extern WowClientDB<AnimationDataRec> g_animationDataDB;
|
||||
extern WowClientDB<AreaAssignmentRec> g_areaAssignmentDB;
|
||||
extern WowClientDB<AreaGroupRec> g_areaGroupDB;
|
||||
extern WowClientDB<AreaPOIRec> g_areaPOIDB;
|
||||
extern WowClientDB<AreaTableRec> g_areaTableDB;
|
||||
extern WowClientDB<AreaTriggerRec> g_areaTriggerDB;
|
||||
extern WowClientDB<ArmorLocationRec> g_armorLocationDB;
|
||||
extern WowClientDB<AttackAnimKitsRec> g_attackAnimKitsDB;
|
||||
extern WowClientDB<AttackAnimTypesRec> g_attackAnimTypesDB;
|
||||
extern WowClientDB<AuctionHouseRec> g_auctionHouseDB;
|
||||
extern WowClientDB<BankBagSlotPricesRec> g_bankBagSlotPricesDB;
|
||||
extern WowClientDB<BannedAddonsRec> g_bannedAddonsDB;
|
||||
extern WowClientDB<BannedAddOnsRec> g_bannedAddOnsDB;
|
||||
extern WowClientDB<BarberShopStyleRec> g_barberShopStyleDB;
|
||||
extern WowClientDB<BattlemasterListRec> g_battlemasterListDB;
|
||||
extern WowClientDB<CameraModeRec> g_cameraModeDB;
|
||||
extern WowClientDB<CameraShakesRec> g_cameraShakesDB;
|
||||
extern WowClientDB<Cfg_CategoriesRec> g_cfg_CategoriesDB;
|
||||
extern WowClientDB<Cfg_ConfigsRec> g_cfg_ConfigsDB;
|
||||
extern WowClientDB<CharBaseInfoRec> g_charBaseInfoDB;
|
||||
extern WowClientDB<CharHairGeosetsRec> g_charHairGeosetsDB;
|
||||
extern WowClientDB<CharHairTexturesRec> g_charHairTexturesDB;
|
||||
extern WowClientDB<CharSectionsRec> g_charSectionsDB;
|
||||
extern WowClientDB<CharStartOutfitRec> g_charStartOutfitDB;
|
||||
extern WowClientDB<CharTitlesRec> g_charTitlesDB;
|
||||
extern WowClientDB<CharVariationsRec> g_charVariationsDB;
|
||||
extern WowClientDB<CharacterFacialHairStylesRec> g_characterFacialHairStylesDB;
|
||||
extern WowClientDB<ChatChannelsRec> g_chatChannelsDB;
|
||||
extern WowClientDB<ChatProfanityRec> g_chatProfanityDB;
|
||||
@ -355,12 +280,10 @@ extern WowClientDB<CreatureMovementInfoRec> g_creatureMovementInfoDB;
|
||||
extern WowClientDB<CreatureSoundDataRec> g_creatureSoundDataDB;
|
||||
extern WowClientDB<CreatureSpellDataRec> g_creatureSpellDataDB;
|
||||
extern WowClientDB<CreatureTypeRec> g_creatureTypeDB;
|
||||
extern WowClientDB<CurrencyCategoryRec> g_currencyCategoryDB;
|
||||
extern WowClientDB<CurrencyTypesRec> g_currencyTypesDB;
|
||||
extern WowClientDB<CurrencyCategoryRec> g_currencyCategoryDB;
|
||||
extern WowClientDB<DanceMovesRec> g_danceMovesDB;
|
||||
extern WowClientDB<DeathThudLookupsRec> g_deathThudLookupsDB;
|
||||
extern WowClientDB<DeclinedWordRec> g_declinedWordDB;
|
||||
extern WowClientDB<DeclinedWordCasesRec> g_declinedWordCasesDB;
|
||||
extern WowClientDB<DestructibleModelDataRec> g_destructibleModelDataDB;
|
||||
extern WowClientDB<DungeonEncounterRec> g_dungeonEncounterDB;
|
||||
extern WowClientDB<DungeonMapRec> g_dungeonMapDB;
|
||||
@ -379,41 +302,40 @@ extern WowClientDB<FactionTemplateRec> g_factionTemplateDB;
|
||||
extern WowClientDB<FileDataRec> g_fileDataDB;
|
||||
extern WowClientDB<FootprintTexturesRec> g_footprintTexturesDB;
|
||||
extern WowClientDB<FootstepTerrainLookupRec> g_footstepTerrainLookupDB;
|
||||
extern WowClientDB<GMSurveyAnswersRec> g_gMSurveyAnswersDB;
|
||||
extern WowClientDB<GMSurveyCurrentSurveyRec> g_gMSurveyCurrentSurveyDB;
|
||||
extern WowClientDB<GMSurveyQuestionsRec> g_gMSurveyQuestionsDB;
|
||||
extern WowClientDB<GMSurveySurveysRec> g_gMSurveySurveysDB;
|
||||
extern WowClientDB<GMTicketCategoryRec> g_gMTicketCategoryDB;
|
||||
extern WowClientDB<GameObjectArtKitRec> g_gameObjectArtKitDB;
|
||||
extern WowClientDB<GameObjectDisplayInfoRec> g_gameObjectDisplayInfoDB;
|
||||
extern WowClientDB<GameTablesRec> g_gameTablesDB;
|
||||
extern WowClientDB<GameTipsRec> g_gameTipsDB;
|
||||
extern WowClientDB<GemPropertiesRec> g_gemPropertiesDB;
|
||||
extern WowClientDB<GlueScreenEmoteRec> g_glueScreenEmoteDB;
|
||||
extern WowClientDB<GlyphPropertiesRec> g_glyphPropertiesDB;
|
||||
extern WowClientDB<GlyphSlotRec> g_glyphSlotDB;
|
||||
extern WowClientDB<GMSurveyAnswersRec> g_gMSurveyAnswersDB;
|
||||
extern WowClientDB<GMSurveyCurrentSurveyRec> g_gMSurveyCurrentSurveyDB;
|
||||
extern WowClientDB<GMSurveyQuestionsRec> g_gMSurveyQuestionsDB;
|
||||
extern WowClientDB<GMSurveySurveysRec> g_gMSurveySurveysDB;
|
||||
extern WowClientDB<GMTicketCategoryRec> g_gMTicketCategoryDB;
|
||||
extern WowClientDB<GroundEffectDoodadRec> g_groundEffectDoodadDB;
|
||||
extern WowClientDB<GroundEffectTextureRec> g_groundEffectTextureDB;
|
||||
extern WowClientDB<GuildPerkSpellsRec> g_guildPerkSpellsDB;
|
||||
extern WowClientDB<gtBarberShopCostBaseRec> g_gtBarberShopCostBaseDB;
|
||||
extern WowClientDB<gtCombatRatingsRec> g_gtCombatRatingsDB;
|
||||
extern WowClientDB<gtChanceToMeleeCritRec> g_gtChanceToMeleeCritDB;
|
||||
extern WowClientDB<gtChanceToMeleeCritBaseRec> g_gtChanceToMeleeCritBaseDB;
|
||||
extern WowClientDB<gtChanceToSpellCritRec> g_gtChanceToSpellCritDB;
|
||||
extern WowClientDB<gtChanceToSpellCritBaseRec> g_gtChanceToSpellCritBaseDB;
|
||||
extern WowClientDB<gtNPCManaCostScalerRec> g_gtNPCManaCostScalerDB;
|
||||
extern WowClientDB<gtOCTClassCombatRatingScalarRec> g_gtOCTClassCombatRatingScalarDB;
|
||||
extern WowClientDB<gtOCTRegenHPRec> g_gtOCTRegenHPDB;
|
||||
extern WowClientDB<gtOCTRegenMPRec> g_gtOCTRegenMPDB;
|
||||
extern WowClientDB<gtRegenHPPerSptRec> g_gtRegenHPPerSptDB;
|
||||
extern WowClientDB<gtRegenMPPerSptRec> g_gtRegenMPPerSptDB;
|
||||
extern WowClientDB<HelmetGeosetVisDataRec> g_helmetGeosetVisDataDB;
|
||||
extern WowClientDB<HolidayDescriptionsRec> g_holidayDescriptionsDB;
|
||||
extern WowClientDB<HolidayNamesRec> g_holidayNamesDB;
|
||||
extern WowClientDB<HolidaysRec> g_holidaysDB;
|
||||
extern WowClientDB<ItemRec> g_itemDB;
|
||||
extern WowClientDB<ItemArmorQualityRec> g_itemArmorQualityDB;
|
||||
extern WowClientDB<ItemArmorShieldRec> g_itemArmorShieldDB;
|
||||
extern WowClientDB<ItemArmorTotalRec> g_itemArmorTotalDB;
|
||||
extern WowClientDB<ItemBagFamilyRec> g_itemBagFamilyDB;
|
||||
extern WowClientDB<ItemClassRec> g_itemClassDB;
|
||||
extern WowClientDB<ItemCondExtCostsRec> g_itemCondExtCostsDB;
|
||||
extern WowClientDB<ItemDamageAmmoRec> g_itemDamageAmmoDB;
|
||||
extern WowClientDB<ItemDamageOneHandRec> g_itemDamageOneHandDB;
|
||||
extern WowClientDB<ItemDamageOneHandCasterRec> g_itemDamageOneHandCasterDB;
|
||||
extern WowClientDB<ItemDamageRangedRec> g_itemDamageRangedDB;
|
||||
extern WowClientDB<ItemDamageThrownRec> g_itemDamageThrownDB;
|
||||
extern WowClientDB<ItemDamageTwoHandRec> g_itemDamageTwoHandDB;
|
||||
extern WowClientDB<ItemDamageTwoHandCasterRec> g_itemDamageTwoHandCasterDB;
|
||||
extern WowClientDB<ItemDamageWandRec> g_itemDamageWandDB;
|
||||
extern WowClientDB<ItemDisplayInfoRec> g_itemDisplayInfoDB;
|
||||
extern WowClientDB<ItemExtendedCostRec> g_itemExtendedCostDB;
|
||||
extern WowClientDB<ItemGroupSoundsRec> g_itemGroupSoundsDB;
|
||||
@ -422,130 +344,96 @@ extern WowClientDB<ItemPetFoodRec> g_itemPetFoodDB;
|
||||
extern WowClientDB<ItemPurchaseGroupRec> g_itemPurchaseGroupDB;
|
||||
extern WowClientDB<ItemRandomPropertiesRec> g_itemRandomPropertiesDB;
|
||||
extern WowClientDB<ItemRandomSuffixRec> g_itemRandomSuffixDB;
|
||||
extern WowClientDB<ItemReforgeRec> g_itemReforgeDB;
|
||||
extern WowClientDB<ItemSetRec> g_itemSetDB;
|
||||
extern WowClientDB<ItemSubClassRec> g_itemSubClassDB;
|
||||
extern WowClientDB<ItemSubClassMaskRec> g_itemSubClassMaskDB;
|
||||
extern WowClientDB<ItemVisualEffectsRec> g_itemVisualEffectsDB;
|
||||
extern WowClientDB<ItemVisualsRec> g_itemVisualsDB;
|
||||
extern WowClientDB<LFGDungeonExpansionRec> g_lFGDungeonExpansionDB;
|
||||
extern WowClientDB<LFGDungeonGroupRec> g_lFGDungeonGroupDB;
|
||||
extern WowClientDB<LFGDungeonsRec> g_lFGDungeonsDB;
|
||||
extern WowClientDB<LanguageWordsRec> g_languageWordsDB;
|
||||
extern WowClientDB<LanguagesRec> g_languagesDB;
|
||||
extern WowClientDB<LfgDungeonExpansionRec> g_lfgDungeonExpansionDB;
|
||||
extern WowClientDB<LfgDungeonGroupRec> g_lfgDungeonGroupDB;
|
||||
extern WowClientDB<LfgDungeonsRec> g_lfgDungeonsDB;
|
||||
extern WowClientDB<LightRec> g_lightDB;
|
||||
extern WowClientDB<LightFloatBandRec> g_lightFloatBandDB;
|
||||
extern WowClientDB<LightIntBandRec> g_lightIntBandDB;
|
||||
extern WowClientDB<LightParamsRec> g_lightParamsDB;
|
||||
extern WowClientDB<LightSkyboxRec> g_lightSkyboxDB;
|
||||
extern WowClientDB<LiquidMaterialRec> g_liquidMaterialDB;
|
||||
extern WowClientDB<LiquidObjectRec> g_liquidObjectDB;
|
||||
extern WowClientDB<LiquidTypeRec> g_liquidTypeDB;
|
||||
extern WowClientDB<LoadingScreenTaxiSplinesRec> g_loadingScreenTaxiSplinesDB;
|
||||
extern WowClientDB<LiquidMaterialRec> g_liquidMaterialDB;
|
||||
extern WowClientDB<LoadingScreensRec> g_loadingScreensDB;
|
||||
extern WowClientDB<LoadingScreenTaxiSplinesRec> g_loadingScreenTaxiSplinesDB;
|
||||
extern WowClientDB<LockRec> g_lockDB;
|
||||
extern WowClientDB<LockTypeRec> g_lockTypeDB;
|
||||
extern WowClientDB<MailTemplateRec> g_mailTemplateDB;
|
||||
extern WowClientDB<MapRec> g_mapDB;
|
||||
extern WowClientDB<MapDifficultyRec> g_mapDifficultyDB;
|
||||
extern WowClientDB<MaterialRec> g_materialDB;
|
||||
extern WowClientDB<MountTypeRec> g_mountTypeDB;
|
||||
extern WowClientDB<MovieRec> g_movieDB;
|
||||
extern WowClientDB<MovieFileDataRec> g_movieFileDataDB;
|
||||
extern WowClientDB<MovieVariationRec> g_movieVariationDB;
|
||||
extern WowClientDB<NPCSoundsRec> g_nPCSoundsDB;
|
||||
extern WowClientDB<NameGenRec> g_nameGenDB;
|
||||
extern WowClientDB<NPCSoundsRec> g_nPCSoundsDB;
|
||||
extern WowClientDB<NamesProfanityRec> g_namesProfanityDB;
|
||||
extern WowClientDB<NamesReservedRec> g_namesReservedDB;
|
||||
extern WowClientDB<ObjectEffectRec> g_objectEffectDB;
|
||||
extern WowClientDB<ObjectEffectGroupRec> g_objectEffectGroupDB;
|
||||
extern WowClientDB<ObjectEffectModifierRec> g_objectEffectModifierDB;
|
||||
extern WowClientDB<ObjectEffectPackageRec> g_objectEffectPackageDB;
|
||||
extern WowClientDB<ObjectEffectPackageElemRec> g_objectEffectPackageElemDB;
|
||||
extern WowClientDB<OverrideSpellDataRec> g_overrideSpellDataDB;
|
||||
extern WowClientDB<PVPDifficultyRec> g_pVPDifficultyDB;
|
||||
extern WowClientDB<PackageRec> g_packageDB;
|
||||
extern WowClientDB<PageTextMaterialRec> g_pageTextMaterialDB;
|
||||
extern WowClientDB<PaperDollItemFrameRec> g_paperDollItemFrameDB;
|
||||
extern WowClientDB<ParticleColorRec> g_particleColorDB;
|
||||
extern WowClientDB<PetPersonalityRec> g_petPersonalityDB;
|
||||
extern WowClientDB<PetitionTypeRec> g_petitionTypeDB;
|
||||
extern WowClientDB<PhaseRec> g_phaseDB;
|
||||
extern WowClientDB<PhaseShiftZoneSoundsRec> g_phaseShiftZoneSoundsDB;
|
||||
extern WowClientDB<PhaseXPhaseGroupRec> g_phaseXPhaseGroupDB;
|
||||
extern WowClientDB<PowerDisplayRec> g_powerDisplayDB;
|
||||
extern WowClientDB<PvpDifficultyRec> g_pvpDifficultyDB;
|
||||
extern WowClientDB<QuestFactionRewardRec> g_questFactionRewardDB;
|
||||
extern WowClientDB<QuestInfoRec> g_questInfoDB;
|
||||
extern WowClientDB<QuestSortRec> g_questSortDB;
|
||||
extern WowClientDB<QuestXPRec> g_questXPDB;
|
||||
extern WowClientDB<RandPropPointsRec> g_randPropPointsDB;
|
||||
extern WowClientDB<ResearchBranchRec> g_researchBranchDB;
|
||||
extern WowClientDB<ResistancesRec> g_resistancesDB;
|
||||
extern WowClientDB<RandPropPointsRec> g_randPropPointsDB;
|
||||
extern WowClientDB<ScalingStatDistributionRec> g_scalingStatDistributionDB;
|
||||
extern WowClientDB<ScalingStatValuesRec> g_scalingStatValuesDB;
|
||||
extern WowClientDB<ScreenEffectRec> g_screenEffectDB;
|
||||
extern WowClientDB<ServerMessagesRec> g_serverMessagesDB;
|
||||
extern WowClientDB<SheatheSoundLookupsRec> g_sheatheSoundLookupsDB;
|
||||
extern WowClientDB<SkillCostsDataRec> g_skillCostsDataDB;
|
||||
extern WowClientDB<SkillLineRec> g_skillLineDB;
|
||||
extern WowClientDB<SkillLineAbilityRec> g_skillLineAbilityDB;
|
||||
extern WowClientDB<SkillLineCategoryRec> g_skillLineCategoryDB;
|
||||
extern WowClientDB<SkillLineRec> g_skillLineDB;
|
||||
extern WowClientDB<SkillRaceClassInfoRec> g_skillRaceClassInfoDB;
|
||||
extern WowClientDB<SkillTiersRec> g_skillTiersDB;
|
||||
extern WowClientDB<SoundAmbienceRec> g_soundAmbienceDB;
|
||||
extern WowClientDB<SoundEmittersRec> g_soundEmittersDB;
|
||||
extern WowClientDB<SoundEntriesRec> g_soundEntriesDB;
|
||||
extern WowClientDB<SoundEntriesAdvancedRec> g_soundEntriesAdvancedDB;
|
||||
extern WowClientDB<SoundFilterRec> g_soundFilterDB;
|
||||
extern WowClientDB<SoundFilterElemRec> g_soundFilterElemDB;
|
||||
extern WowClientDB<SoundProviderPreferencesRec> g_soundProviderPreferencesDB;
|
||||
extern WowClientDB<SoundSamplePreferencesRec> g_soundSamplePreferencesDB;
|
||||
extern WowClientDB<SoundWaterTypeRec> g_soundWaterTypeDB;
|
||||
extern WowClientDB<SpamMessagesRec> g_spamMessagesDB;
|
||||
extern WowClientDB<SpellRec> g_spellDB;
|
||||
extern WowClientDB<SpellAuraOptionsRec> g_spellAuraOptionsDB;
|
||||
extern WowClientDB<SpellAuraRestrictionsRec> g_spellAuraRestrictionsDB;
|
||||
extern WowClientDB<SpellCastTimesRec> g_spellCastTimesDB;
|
||||
extern WowClientDB<SpellCastingRequirementsRec> g_spellCastingRequirementsDB;
|
||||
extern WowClientDB<SpellCategoriesRec> g_spellCategoriesDB;
|
||||
extern WowClientDB<SpellCategoryRec> g_spellCategoryDB;
|
||||
extern WowClientDB<SpellChainEffectsRec> g_spellChainEffectsDB;
|
||||
extern WowClientDB<SpellClassOptionsRec> g_spellClassOptionsDB;
|
||||
extern WowClientDB<SpellCooldownsRec> g_spellCooldownsDB;
|
||||
extern WowClientDB<SpellRec> g_spellDB;
|
||||
extern WowClientDB<SpellDescriptionVariablesRec> g_spellDescriptionVariablesDB;
|
||||
extern WowClientDB<SpellDifficultyRec> g_spellDifficultyDB;
|
||||
extern WowClientDB<SpellDispelTypeRec> g_spellDispelTypeDB;
|
||||
extern WowClientDB<SpellDurationRec> g_spellDurationDB;
|
||||
extern WowClientDB<SpellEffectRec> g_spellEffectDB;
|
||||
extern WowClientDB<SpellEffectCameraShakesRec> g_spellEffectCameraShakesDB;
|
||||
extern WowClientDB<SpellEquippedItemsRec> g_spellEquippedItemsDB;
|
||||
extern WowClientDB<SpellFocusObjectRec> g_spellFocusObjectDB;
|
||||
extern WowClientDB<SpellIconRec> g_spellIconDB;
|
||||
extern WowClientDB<SpellInterruptsRec> g_spellInterruptsDB;
|
||||
extern WowClientDB<SpellItemEnchantmentRec> g_spellItemEnchantmentDB;
|
||||
extern WowClientDB<SpellItemEnchantmentConditionRec> g_spellItemEnchantmentConditionDB;
|
||||
extern WowClientDB<SpellLevelsRec> g_spellLevelsDB;
|
||||
extern WowClientDB<SpellMechanicRec> g_spellMechanicDB;
|
||||
extern WowClientDB<SpellMissileRec> g_spellMissileDB;
|
||||
extern WowClientDB<SpellMissileMotionRec> g_spellMissileMotionDB;
|
||||
extern WowClientDB<SpellPowerRec> g_spellPowerDB;
|
||||
extern WowClientDB<SpellRadiusRec> g_spellRadiusDB;
|
||||
extern WowClientDB<SpellRangeRec> g_spellRangeDB;
|
||||
extern WowClientDB<SpellReagentsRec> g_spellReagentsDB;
|
||||
extern WowClientDB<SpellRuneCostRec> g_spellRuneCostDB;
|
||||
extern WowClientDB<SpellScalingRec> g_spellScalingDB;
|
||||
extern WowClientDB<SpellShapeshiftRec> g_spellShapeshiftDB;
|
||||
extern WowClientDB<SpellShapeshiftFormRec> g_spellShapeshiftFormDB;
|
||||
extern WowClientDB<SpellTargetRestrictionsRec> g_spellTargetRestrictionsDB;
|
||||
extern WowClientDB<SpellTotemsRec> g_spellTotemsDB;
|
||||
extern WowClientDB<SpellVisualRec> g_spellVisualDB;
|
||||
extern WowClientDB<SpellVisualEffectNameRec> g_spellVisualEffectNameDB;
|
||||
extern WowClientDB<SpellVisualKitRec> g_spellVisualKitDB;
|
||||
extern WowClientDB<SpellVisualKitAreaModelRec> g_spellVisualKitAreaModelDB;
|
||||
extern WowClientDB<SpellVisualKitModelAttachRec> g_spellVisualKitModelAttachDB;
|
||||
extern WowClientDB<SpellVisualPrecastTransitionsRec> g_spellVisualPrecastTransitionsDB;
|
||||
extern WowClientDB<StableSlotPricesRec> g_stableSlotPricesDB;
|
||||
extern WowClientDB<Startup_StringsRec> g_startup_StringsDB;
|
||||
extern WowClientDB<StationeryRec> g_stationeryDB;
|
||||
extern WowClientDB<StringLookupsRec> g_stringLookupsDB;
|
||||
extern WowClientDB<SummonPropertiesRec> g_summonPropertiesDB;
|
||||
@ -555,7 +443,6 @@ extern WowClientDB<TaxiNodesRec> g_taxiNodesDB;
|
||||
extern WowClientDB<TaxiPathRec> g_taxiPathDB;
|
||||
extern WowClientDB<TaxiPathNodeRec> g_taxiPathNodeDB;
|
||||
extern WowClientDB<TeamContributionPointsRec> g_teamContributionPointsDB;
|
||||
extern WowClientDB<TerrainMaterialRec> g_terrainMaterialDB;
|
||||
extern WowClientDB<TerrainTypeRec> g_terrainTypeDB;
|
||||
extern WowClientDB<TerrainTypeSoundsRec> g_terrainTypeSoundsDB;
|
||||
extern WowClientDB<TotemCategoryRec> g_totemCategoryDB;
|
||||
@ -567,41 +454,32 @@ extern WowClientDB<UnitBloodRec> g_unitBloodDB;
|
||||
extern WowClientDB<UnitBloodLevelsRec> g_unitBloodLevelsDB;
|
||||
extern WowClientDB<VehicleRec> g_vehicleDB;
|
||||
extern WowClientDB<VehicleSeatRec> g_vehicleSeatDB;
|
||||
extern WowClientDB<VehicleUIIndSeatRec> g_vehicleUIIndSeatDB;
|
||||
extern WowClientDB<VehicleUIIndicatorRec> g_vehicleUIIndicatorDB;
|
||||
extern WowClientDB<VideoHardwareRec> g_videoHardwareDB;
|
||||
extern WowClientDB<VehicleUIIndSeatRec> g_vehicleUIIndSeatDB;
|
||||
extern WowClientDB<VocalUISoundsRec> g_vocalUISoundsDB;
|
||||
extern WowClientDB<WMOAreaTableRec> g_wMOAreaTableDB;
|
||||
extern WowClientDB<WeaponImpactSoundsRec> g_weaponImpactSoundsDB;
|
||||
extern WowClientDB<WeaponSwingSounds2Rec> g_weaponSwingSounds2DB;
|
||||
extern WowClientDB<WeatherRec> g_weatherDB;
|
||||
extern WowClientDB<WorldChunkSoundsRec> g_worldChunkSoundsDB;
|
||||
extern WowClientDB<WorldMapAreaRec> g_worldMapAreaDB;
|
||||
extern WowClientDB<WorldMapTransformsRec> g_worldMapTransformsDB;
|
||||
extern WowClientDB<WorldMapContinentRec> g_worldMapContinentDB;
|
||||
extern WowClientDB<WorldMapOverlayRec> g_worldMapOverlayDB;
|
||||
extern WowClientDB<WorldMapTransformsRec> g_worldMapTransformsDB;
|
||||
extern WowClientDB<WorldSafeLocsRec> g_worldSafeLocsDB;
|
||||
extern WowClientDB<WorldStateUIRec> g_worldStateUIDB;
|
||||
extern WowClientDB<WorldStateZoneSoundsRec> g_worldStateZoneSoundsDB;
|
||||
extern WowClientDB<WowError_StringsRec> g_wowError_StringsDB;
|
||||
extern WowClientDB<ZoneIntroMusicTableRec> g_zoneIntroMusicTableDB;
|
||||
extern WowClientDB<ZoneLightRec> g_zoneLightDB;
|
||||
extern WowClientDB<ZoneLightPointRec> g_zoneLightPointDB;
|
||||
extern WowClientDB<ZoneMusicRec> g_zoneMusicDB;
|
||||
extern WowClientDB<gtBarberShopCostBaseRec> g_gtBarberShopCostBaseDB;
|
||||
extern WowClientDB<gtChanceToMeleeCritRec> g_gtChanceToMeleeCritDB;
|
||||
extern WowClientDB<gtChanceToMeleeCritBaseRec> g_gtChanceToMeleeCritBaseDB;
|
||||
extern WowClientDB<gtChanceToSpellCritRec> g_gtChanceToSpellCritDB;
|
||||
extern WowClientDB<gtChanceToSpellCritBaseRec> g_gtChanceToSpellCritBaseDB;
|
||||
extern WowClientDB<gtCombatRatingsRec> g_gtCombatRatingsDB;
|
||||
extern WowClientDB<gtNPCManaCostScalerRec> g_gtNPCManaCostScalerDB;
|
||||
extern WowClientDB<gtOCTClassCombatRatingScalarRec> g_gtOCTClassCombatRatingScalarDB;
|
||||
extern WowClientDB<gtOCTRegenHPRec> g_gtOCTRegenHPDB;
|
||||
extern WowClientDB<gtOCTRegenMPRec> g_gtOCTRegenMPDB;
|
||||
extern WowClientDB<gtRegenHPPerSptRec> g_gtRegenHPPerSptDB;
|
||||
extern WowClientDB<gtRegenMPPerSptRec> g_gtRegenMPPerSptDB;
|
||||
extern WowClientDB<gtSpellScalingRec> g_gtSpellScalingDB;
|
||||
extern WowClientDB<WorldStateZoneSoundsRec> g_worldStateZoneSoundsDB;
|
||||
extern WowClientDB<WorldChunkSoundsRec> g_worldChunkSoundsDB;
|
||||
extern WowClientDB<SoundEntriesAdvancedRec> g_soundEntriesAdvancedDB;
|
||||
extern WowClientDB<ObjectEffectRec> g_objectEffectDB;
|
||||
extern WowClientDB<ObjectEffectGroupRec> g_objectEffectGroupDB;
|
||||
extern WowClientDB<ObjectEffectModifierRec> g_objectEffectModifierDB;
|
||||
extern WowClientDB<ObjectEffectPackageRec> g_objectEffectPackageDB;
|
||||
extern WowClientDB<ObjectEffectPackageElemRec> g_objectEffectPackageElemDB;
|
||||
extern WowClientDB<SoundFilterRec> g_soundFilterDB;
|
||||
extern WowClientDB<SoundFilterElemRec> g_soundFilterElemDB;
|
||||
|
||||
void StaticDBLoadAll(void (*loadFn)(WowClientDB_Base*, const char*, int32_t));
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@ -159,6 +159,10 @@ void WowClientDB<T>::LoadRecords(SFile* f, const char* filename, int32_t linenum
|
||||
auto record = &this->m_records[i];
|
||||
record->Read(f, this->m_strings);
|
||||
|
||||
if (T::NeedIDAssigned()) {
|
||||
record->SetID(i);
|
||||
}
|
||||
|
||||
this->m_maxID = record->GetID() > this->m_maxID ? record->GetID() : this->m_maxID;
|
||||
this->m_minID = record->GetID() < this->m_minID ? record->GetID() : this->m_minID;
|
||||
}
|
||||
|
||||
1
src/db/rec/AchievementRec.cpp
Normal file → Executable file
1
src/db/rec/AchievementRec.cpp
Normal file → Executable file
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/AchievementRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* AchievementRec::GetFilename() {
|
||||
|
||||
0
src/db/rec/AchievementRec.hpp
Normal file → Executable file
0
src/db/rec/AchievementRec.hpp
Normal file → Executable file
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/Achievement_CategoryRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* Achievement_CategoryRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/Achievement_CriteriaRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* Achievement_CriteriaRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/AnimKitBoneSetAliasRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* AnimKitBoneSetAliasRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/AnimKitBoneSetRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* AnimKitBoneSetRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/AnimKitConfigBoneSetRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* AnimKitConfigBoneSetRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/AnimKitConfigRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* AnimKitConfigRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/AnimKitPriorityRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* AnimKitPriorityRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/AnimKitRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* AnimKitRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/AnimKitSegmentRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* AnimKitSegmentRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/AnimReplacementRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* AnimReplacementRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/AnimReplacementSetRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* AnimReplacementSetRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/AnimationDataRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* AnimationDataRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/AreaAssignmentRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* AreaAssignmentRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/AreaGroupRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* AreaGroupRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/AreaPOIRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* AreaPOIRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/AreaTableRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* AreaTableRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/AreaTriggerRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* AreaTriggerRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/ArmorLocationRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* ArmorLocationRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/AttackAnimKitsRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* AttackAnimKitsRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/AttackAnimTypesRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* AttackAnimTypesRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/AuctionHouseRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* AuctionHouseRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/BankBagSlotPricesRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* BankBagSlotPricesRec::GetFilename() {
|
||||
|
||||
48
src/db/rec/BannedAddOnsRec.cpp
Executable file
48
src/db/rec/BannedAddOnsRec.cpp
Executable file
@ -0,0 +1,48 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/BannedAddOnsRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* BannedAddOnsRec::GetFilename() {
|
||||
return "DBFilesClient\\BannedAddOns.dbc";
|
||||
}
|
||||
|
||||
uint32_t BannedAddOnsRec::GetNumColumns() {
|
||||
return 11;
|
||||
}
|
||||
|
||||
uint32_t BannedAddOnsRec::GetRowSize() {
|
||||
return 44;
|
||||
}
|
||||
|
||||
bool BannedAddOnsRec::NeedIDAssigned() {
|
||||
return false;
|
||||
}
|
||||
|
||||
int32_t BannedAddOnsRec::GetID() {
|
||||
return this->m_ID;
|
||||
}
|
||||
|
||||
void BannedAddOnsRec::SetID(int32_t id) {
|
||||
this->m_ID = id;
|
||||
}
|
||||
|
||||
bool BannedAddOnsRec::Read(SFile* f, const char* stringBuffer) {
|
||||
if (
|
||||
!SFile::Read(f, &this->m_ID, sizeof(this->m_ID), nullptr, nullptr, nullptr)
|
||||
|| !SFile::Read(f, &this->m_nameMd5[0], sizeof(m_nameMd5[0]), nullptr, nullptr, nullptr)
|
||||
|| !SFile::Read(f, &this->m_nameMd5[1], sizeof(m_nameMd5[0]), nullptr, nullptr, nullptr)
|
||||
|| !SFile::Read(f, &this->m_nameMd5[2], sizeof(m_nameMd5[0]), nullptr, nullptr, nullptr)
|
||||
|| !SFile::Read(f, &this->m_nameMd5[3], sizeof(m_nameMd5[0]), nullptr, nullptr, nullptr)
|
||||
|| !SFile::Read(f, &this->m_versionMd5[0], sizeof(m_versionMd5[0]), nullptr, nullptr, nullptr)
|
||||
|| !SFile::Read(f, &this->m_versionMd5[1], sizeof(m_versionMd5[0]), nullptr, nullptr, nullptr)
|
||||
|| !SFile::Read(f, &this->m_versionMd5[2], sizeof(m_versionMd5[0]), nullptr, nullptr, nullptr)
|
||||
|| !SFile::Read(f, &this->m_versionMd5[3], sizeof(m_versionMd5[0]), nullptr, nullptr, nullptr)
|
||||
|| !SFile::Read(f, &this->m_lastModified, sizeof(this->m_lastModified), nullptr, nullptr, nullptr)
|
||||
|| !SFile::Read(f, &this->m_flags, sizeof(this->m_flags), nullptr, nullptr, nullptr)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
26
src/db/rec/BannedAddOnsRec.hpp
Executable file
26
src/db/rec/BannedAddOnsRec.hpp
Executable file
@ -0,0 +1,26 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#ifndef DB_REC_BANNED_ADD_ONS_REC_HPP
|
||||
#define DB_REC_BANNED_ADD_ONS_REC_HPP
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
class SFile;
|
||||
|
||||
class BannedAddOnsRec {
|
||||
public:
|
||||
int32_t m_ID;
|
||||
int32_t m_nameMd5[4];
|
||||
int32_t m_versionMd5[4];
|
||||
int32_t m_lastModified;
|
||||
int32_t m_flags;
|
||||
|
||||
static const char* GetFilename();
|
||||
static uint32_t GetNumColumns();
|
||||
static uint32_t GetRowSize();
|
||||
static bool NeedIDAssigned();
|
||||
int32_t GetID();
|
||||
void SetID(int32_t id);
|
||||
bool Read(SFile* f, const char* stringBuffer);
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -1,32 +1,33 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/BannedAddonsRec.hpp"
|
||||
#include "db/rec/BannedAddOnsRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* BannedAddonsRec::GetFilename() {
|
||||
return "DBFilesClient\\BannedAddons.dbc";
|
||||
const char* BannedAddOnsRec::GetFilename() {
|
||||
return "DBFilesClient\\BannedAddOns.dbc";
|
||||
}
|
||||
|
||||
uint32_t BannedAddonsRec::GetNumColumns() {
|
||||
uint32_t BannedAddOnsRec::GetNumColumns() {
|
||||
return 11;
|
||||
}
|
||||
|
||||
uint32_t BannedAddonsRec::GetRowSize() {
|
||||
uint32_t BannedAddOnsRec::GetRowSize() {
|
||||
return 44;
|
||||
}
|
||||
|
||||
bool BannedAddonsRec::NeedIDAssigned() {
|
||||
bool BannedAddOnsRec::NeedIDAssigned() {
|
||||
return false;
|
||||
}
|
||||
|
||||
int32_t BannedAddonsRec::GetID() {
|
||||
int32_t BannedAddOnsRec::GetID() {
|
||||
return this->m_ID;
|
||||
}
|
||||
|
||||
void BannedAddonsRec::SetID(int32_t id) {
|
||||
void BannedAddOnsRec::SetID(int32_t id) {
|
||||
this->m_ID = id;
|
||||
}
|
||||
|
||||
bool BannedAddonsRec::Read(SFile* f, const char* stringBuffer) {
|
||||
bool BannedAddOnsRec::Read(SFile* f, const char* stringBuffer) {
|
||||
if (
|
||||
!SFile::Read(f, &this->m_ID, sizeof(this->m_ID), nullptr, nullptr, nullptr)
|
||||
|| !SFile::Read(f, &this->m_nameMd5[0], sizeof(m_nameMd5[0]), nullptr, nullptr, nullptr)
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#ifndef DB_REC_BANNED_ADDONS_REC_HPP
|
||||
#define DB_REC_BANNED_ADDONS_REC_HPP
|
||||
#ifndef DB_REC_BANNED_ADD_ONS_REC_HPP
|
||||
#define DB_REC_BANNED_ADD_ONS_REC_HPP
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
class SFile;
|
||||
|
||||
class BannedAddonsRec {
|
||||
class BannedAddOnsRec {
|
||||
public:
|
||||
int32_t m_ID;
|
||||
int32_t m_nameMd5[4];
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/BarberShopStyleRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* BarberShopStyleRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/BattlemasterListRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* BattlemasterListRec::GetFilename() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// DO NOT EDIT: generated by whoa-autocode
|
||||
#include "db/rec/CameraModeRec.hpp"
|
||||
#include "db/Locale.hpp"
|
||||
#include "util/SFile.hpp"
|
||||
|
||||
const char* CameraModeRec::GetFilename() {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user