From 7e9dfe9127c3192b862e421b29c98f091950d3fc Mon Sep 17 00:00:00 2001 From: Jan Date: Sun, 7 Mar 2021 15:33:21 +0100 Subject: [PATCH] move iw4 string arrays to commoniw4 header --- src/Common/Game/IW4/CommonIW4.h | 195 ++++++++++++++++++ .../IW4/AssetDumpers/AssetDumperVehicle.cpp | 19 +- .../IW4/AssetDumpers/AssetDumperWeapon.cpp | 174 +--------------- 3 files changed, 197 insertions(+), 191 deletions(-) diff --git a/src/Common/Game/IW4/CommonIW4.h b/src/Common/Game/IW4/CommonIW4.h index e69de29b..53ca3f5d 100644 --- a/src/Common/Game/IW4/CommonIW4.h +++ b/src/Common/Game/IW4/CommonIW4.h @@ -0,0 +1,195 @@ +#pragma once + +namespace IW4 +{ + inline const char* szWeapTypeNames[] + { + "bullet", + "grenade", + "projectile", + "riotshield", + }; + + inline const char* szWeapClassNames[] + { + "rifle", + "sniper", + "mg", + "smg", + "spread", + "pistol", + "grenade", + "rocketlauncher", + "turret", + "throwingknife", + "non-player", + "item", + }; + + inline const char* szWeapOverlayReticleNames[] + { + "none", + "crosshair", + }; + + inline const char* szWeapInventoryTypeNames[] + { + "primary", + "offhand", + "item", + "altmode", + "exclusive", + "scavenger", + }; + + inline const char* szWeapFireTypeNames[] + { + "Full Auto", + "Single Shot", + "2-Round Burst", + "3-Round Burst", + "4-Round Burst", + "Double Barrel", + }; + + inline const char* penetrateTypeNames[] + { + "none", + "small", + "medium", + "large", + }; + + inline const char* impactTypeNames[] + { + "none", + "bullet_small", + "bullet_large", + "bullet_ap", + "bullet_explode", + "shotgun", + "shotgun_explode", + "grenade_bounce", + "grenade_explode", + "rocket_explode", + "projectile_dud", + }; + + inline const char* szWeapStanceNames[] + { + "stand", + "duck", + "prone", + }; + + inline const char* szProjectileExplosionNames[] + { + "grenade", + "rocket", + "flashbang", + "none", + "dud", + "smoke", + "heavy explosive", + }; + + inline const char* offhandClassNames[] + { + "None", + "Frag Grenade", + "Smoke Grenade", + "Flash Grenade", + "Throwing Knife", + "Other", + }; + + inline const char* playerAnimTypeNames[] + { + "none", + "other", + "pistol", + "smg", + "autorifle", + "mg", + "sniper", + "rocketlauncher", + "explosive", + "grenade", + "turret", + "c4", + "m203", + "hold", + "briefcase", + "riotshield", + "laptop", + "throwingknife", + }; + + inline const char* activeReticleNames[] + { + "None", + "Pip-On-A-Stick", + "Bouncing diamond", + }; + + inline const char* guidedMissileNames[] + { + "None", + "Sidewinder", + "Hellfire", + "Javelin", + }; + + inline const char* stickinessNames[] + { + "Don't stick", + "Stick to all", + "Stick to all, orient to surface", + "Stick to ground", + "Stick to ground, maintain yaw", + "Knife", + }; + + inline const char* overlayInterfaceNames[] + { + "None", + "Javelin", + "Turret Scope", + }; + + inline const char* ammoCounterClipNames[] + { + "None", + "Magazine", + "ShortMagazine", + "Shotgun", + "Rocket", + "Beltfed", + "AltWeapon", + }; + + inline const char* weapIconRatioNames[] + { + "1:1", + "2:1", + "4:1", + }; + + inline const char* s_vehicleClassNames[] + { + "4 wheel", + "tank", + "plane", + "boat", + "artillery", + "helicopter", + "snowmobile", + }; + + inline const char* s_vehicleAxleTypeNames[] + { + "front", + "rear", + "all", + }; +} \ No newline at end of file diff --git a/src/ObjWriting/Game/IW4/AssetDumpers/AssetDumperVehicle.cpp b/src/ObjWriting/Game/IW4/AssetDumpers/AssetDumperVehicle.cpp index 5b97f8f4..db44a529 100644 --- a/src/ObjWriting/Game/IW4/AssetDumpers/AssetDumperVehicle.cpp +++ b/src/ObjWriting/Game/IW4/AssetDumpers/AssetDumperVehicle.cpp @@ -4,6 +4,7 @@ #include #include +#include "Game/IW4/CommonIW4.h" #include "Game/IW4/InfoStringIW4.h" using namespace IW4; @@ -157,24 +158,6 @@ cspField_t AssetDumperVehicle::vehicle_fields[] namespace IW4 { - const char* s_vehicleClassNames[] - { - "4 wheel", - "tank", - "plane", - "boat", - "artillery", - "helicopter", - "snowmobile", - }; - - const char* s_vehicleAxleTypeNames[] - { - "front", - "rear", - "all", - }; - class InfoStringFromVehicleConverter final : public InfoStringFromStructConverter { protected: diff --git a/src/ObjWriting/Game/IW4/AssetDumpers/AssetDumperWeapon.cpp b/src/ObjWriting/Game/IW4/AssetDumpers/AssetDumperWeapon.cpp index 011b9564..32333540 100644 --- a/src/ObjWriting/Game/IW4/AssetDumpers/AssetDumperWeapon.cpp +++ b/src/ObjWriting/Game/IW4/AssetDumpers/AssetDumperWeapon.cpp @@ -5,6 +5,7 @@ #include #include +#include "Game/IW4/CommonIW4.h" #include "Game/IW4/InfoStringIW4.h" using namespace IW4; @@ -687,179 +688,6 @@ cspField_t AssetDumperWeapon::weapon_fields[] namespace IW4 { - const char* szWeapTypeNames[] - { - "bullet", - "grenade", - "projectile", - "riotshield", - }; - - const char* szWeapClassNames[] - { - "rifle", - "sniper", - "mg", - "smg", - "spread", - "pistol", - "grenade", - "rocketlauncher", - "turret", - "throwingknife", - "non-player", - "item", - }; - - const char* szWeapOverlayReticleNames[] - { - "none", - "crosshair", - }; - - const char* szWeapInventoryTypeNames[] - { - "primary", - "offhand", - "item", - "altmode", - "exclusive", - "scavenger", - }; - - const char* szWeapFireTypeNames[] - { - "Full Auto", - "Single Shot", - "2-Round Burst", - "3-Round Burst", - "4-Round Burst", - "Double Barrel", - }; - - const char* penetrateTypeNames[] - { - "none", - "small", - "medium", - "large", - }; - - const char* impactTypeNames[] - { - "none", - "bullet_small", - "bullet_large", - "bullet_ap", - "bullet_explode", - "shotgun", - "shotgun_explode", - "grenade_bounce", - "grenade_explode", - "rocket_explode", - "projectile_dud", - }; - - const char* szWeapStanceNames[] - { - "stand", - "duck", - "prone", - }; - - const char* szProjectileExplosionNames[] - { - "grenade", - "rocket", - "flashbang", - "none", - "dud", - "smoke", - "heavy explosive", - }; - - const char* offhandClassNames[] - { - "None", - "Frag Grenade", - "Smoke Grenade", - "Flash Grenade", - "Throwing Knife", - "Other", - }; - - const char* playerAnimTypeNames[] - { - "none", - "other", - "pistol", - "smg", - "autorifle", - "mg", - "sniper", - "rocketlauncher", - "explosive", - "grenade", - "turret", - "c4", - "m203", - "hold", - "briefcase", - "riotshield", - "laptop", - "throwingknife", - }; - - const char* activeReticleNames[] - { - "None", - "Pip-On-A-Stick", - "Bouncing diamond", - }; - - const char* guidedMissileNames[] - { - "None", - "Sidewinder", - "Hellfire", - "Javelin", - }; - - const char* stickinessNames[] - { - "Don't stick", - "Stick to all", - "Stick to all, orient to surface", - "Stick to ground", - "Stick to ground, maintain yaw", - "Knife", - }; - - const char* overlayInterfaceNames[] - { - "None", - "Javelin", - "Turret Scope", - }; - - const char* ammoCounterClipNames[] - { - "None", - "Magazine", - "ShortMagazine", - "Shotgun", - "Rocket", - "Beltfed", - "AltWeapon", - }; - - const char* weapIconRatioNames[] - { - "1:1", - "2:1", - "4:1", - }; - class InfoStringFromWeaponConverter final : public InfoStringFromStructConverter { protected: