From a5b071912fea8fadbc836a111706f2c6a840f0d1 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 4 Apr 2015 13:15:27 +0200 Subject: [PATCH] CfgPreloadtextures for optics --- addons/optics/CfgPreloadTextures.hpp | 50 +++++++++++++++++++++ addons/optics/CfgRscTitles.hpp | 4 +- addons/optics/CfgWeapons.hpp | 33 ++++++++++++-- addons/optics/config.cpp | 2 + addons/optics/functions/fnc_handleFired.sqf | 4 +- 5 files changed, 85 insertions(+), 8 deletions(-) create mode 100644 addons/optics/CfgPreloadTextures.hpp diff --git a/addons/optics/CfgPreloadTextures.hpp b/addons/optics/CfgPreloadTextures.hpp new file mode 100644 index 0000000000..57fa2cabf8 --- /dev/null +++ b/addons/optics/CfgPreloadTextures.hpp @@ -0,0 +1,50 @@ + +#define MACRO_PRELOAD \ + GVAR(BodyDay) = "*"; \ + GVAR(BodyNight) = "*"; \ + GVAR(ReticleDay) = "*"; \ + GVAR(ReticleNight) = "*" + +class PreloadTextures { + class CfgWeapons { + class ACE_optic_Hamr_2D { + MACRO_PRELOAD; + }; + + class ACE_optic_Hamr_PIP { + MACRO_PRELOAD; + }; + + class ACE_optic_Arco_2D { + MACRO_PRELOAD; + }; + + class ACE_optic_Arco_PIP { + MACRO_PRELOAD; + }; + + class ACE_optic_MRCO_2D { + MACRO_PRELOAD; + }; + + class ACE_optic_MRCO_PIP { + MACRO_PRELOAD; + }; + + class ACE_optic_SOS_2D { + MACRO_PRELOAD; + }; + + class ACE_optic_SOS_PIP { + MACRO_PRELOAD; + }; + + class ACE_optic_LRPS_2D { + MACRO_PRELOAD; + }; + + class ACE_optic_LRPS_PIP { + MACRO_PRELOAD; + }; + }; +}; diff --git a/addons/optics/CfgRscTitles.hpp b/addons/optics/CfgRscTitles.hpp index f48749f09d..32449b392e 100644 --- a/addons/optics/CfgRscTitles.hpp +++ b/addons/optics/CfgRscTitles.hpp @@ -60,7 +60,7 @@ class RscInGameUI { h = 0; }; - #define SIZEX 0.76/(getResolution select 5) + #define SIZEX 0.75/(getResolution select 5) class ReticleDay: RscText { idc = 1713001; style = 48; @@ -80,7 +80,7 @@ class RscInGameUI { text = ""; }; - #define SIZEX 2*0.76/(getResolution select 5) + #define SIZEX 2*0.75/(getResolution select 5) class BodyDay: ReticleDay { idc = 1713005; text = ""; diff --git a/addons/optics/CfgWeapons.hpp b/addons/optics/CfgWeapons.hpp index c8adc5d090..e105a1eab9 100644 --- a/addons/optics/CfgWeapons.hpp +++ b/addons/optics/CfgWeapons.hpp @@ -49,6 +49,11 @@ class CfgWeapons { }; class ACE_optic_Hamr_2D: optic_Hamr { + GVAR(BodyDay) = QUOTE(PATHTOF(reticles\hamr-body_ca.paa)); + GVAR(BodyNight) = QUOTE(PATHTOF(reticles\hamr-bodyNight_ca.paa)); + GVAR(ReticleDay) = QUOTE(PATHTOF(reticles\hamr-reticle65_ca.paa)); + GVAR(ReticleNight) = QUOTE(PATHTOF(reticles\hamr-reticle65Illum_ca.paa)); + author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_Hamr_2D"; displayName = "$STR_ACE_optic_hamr"; @@ -65,7 +70,7 @@ class CfgWeapons { opticsZoomInit = 0.0872664626; opticsZoomMax = 0.0872664626; opticsZoomMin = 0.0872664626; - opticsPPEffects[] += {"ACE_OpticsRadBlur1"}; + opticsPPEffects[] = {"OpticsCHAbera5","OpticsBlur5","ACE_OpticsRadBlur1"}; opticsDisablePeripherialVision = 0; visionMode[] = {"Normal","NVG"}; }; @@ -94,6 +99,11 @@ class CfgWeapons { }; class ACE_optic_Arco_2D: optic_Arco { + GVAR(BodyDay) = QUOTE(PATHTOF(reticles\arco-body_ca.paa)); + GVAR(BodyNight) = QUOTE(PATHTOF(reticles\arco-bodyNight_ca.paa)); + GVAR(ReticleDay) = QUOTE(PATHTOF(reticles\arco-reticle65_ca.paa)); + GVAR(ReticleNight) = QUOTE(PATHTOF(reticles\arco-reticle65Illum_ca.paa)); + author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_Arco_2D"; displayName = "$STR_ACE_optic_arco"; @@ -109,7 +119,7 @@ class CfgWeapons { opticsZoomInit = 0.0872664626; opticsZoomMax = 0.0872664626; opticsZoomMin = 0.0872664626; - opticsPPEffects[] += {"ACE_OpticsRadBlur1"}; + opticsPPEffects[] = {"OpticsCHAbera5","OpticsBlur5","ACE_OpticsRadBlur1"}; opticsDisablePeripherialVision = 0; visionMode[] = {"Normal"}; }; @@ -138,6 +148,11 @@ class CfgWeapons { }; class ACE_optic_MRCO_2D: optic_MRCO { + GVAR(BodyDay) = QUOTE(PATHTOF(reticles\mrco-body_ca.paa)); + GVAR(BodyNight) = QUOTE(PATHTOF(reticles\mrco-bodyNight_ca.paa)); + GVAR(ReticleDay) = QUOTE(PATHTOF(reticles\mrco-reticle556_ca.paa)); + GVAR(ReticleNight) = QUOTE(PATHTOF(reticles\mrco-reticle556Illum_ca.paa)); + author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_MRCO_2D"; displayName = "$STR_ACE_optic_valdada"; @@ -153,7 +168,7 @@ class CfgWeapons { opticsZoomInit = 0.0872664626; opticsZoomMax = 0.0872664626; opticsZoomMin = 0.0872664626; - opticsPPEffects[] += {"ACE_OpticsRadBlur1"}; + opticsPPEffects[] = {"OpticsCHAbera5","OpticsBlur5","ACE_OpticsRadBlur1"}; opticsDisablePeripherialVision = 0; visionMode[] = {"Normal"}; }; @@ -200,6 +215,11 @@ class CfgWeapons { }; class ACE_optic_SOS_PIP: ACE_optic_SOS_2D { + GVAR(BodyDay) = QUOTE(PATHTOF(reticles\sos-body_ca.paa)); + GVAR(BodyNight) = QUOTE(PATHTOF(reticles\sos-bodyNight_ca.paa)); + GVAR(ReticleDay) = QUOTE(PATHTOF(reticles\sos-reticleMLR_ca.paa)); + GVAR(ReticleNight) = QUOTE(PATHTOF(reticles\sos-reticleMLRIllum_ca.paa)); + author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_SOS_PIP"; scopeArsenal = 1; @@ -223,6 +243,11 @@ class CfgWeapons { }; class ACE_optic_LRPS_2D: optic_LRPS { + GVAR(BodyDay) = QUOTE(PATHTOF(reticles\sos-body_ca.paa)); + GVAR(BodyNight) = QUOTE(PATHTOF(reticles\sos-bodyNight_ca.paa)); + GVAR(ReticleDay) = QUOTE(PATHTOF(reticles\sos-reticleMLR_ca.paa)); + GVAR(ReticleNight) = QUOTE(PATHTOF(reticles\sos-reticleMLRIllum_ca.paa)); + author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_LRPS_2D"; displayName = "$STR_ACE_optic_lrps"; @@ -237,7 +262,7 @@ class CfgWeapons { opticsZoomMax = 0.04673; opticsZoomMin = 0.01234; discreteFOV[] = {}; - opticsPPEffects[] += {"ACE_OpticsRadBlur1"}; + opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1","ACE_OpticsRadBlur1"}; opticsDisablePeripherialVision = 0; }; }; diff --git a/addons/optics/config.cpp b/addons/optics/config.cpp index d0b477caf3..bae1da314b 100644 --- a/addons/optics/config.cpp +++ b/addons/optics/config.cpp @@ -30,3 +30,5 @@ class CfgPatches { #include "CfgRscTitles.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" + +#include "CfgPreloadTextures.hpp" diff --git a/addons/optics/functions/fnc_handleFired.sqf b/addons/optics/functions/fnc_handleFired.sqf index 94d18e4354..d1b7531928 100644 --- a/addons/optics/functions/fnc_handleFired.sqf +++ b/addons/optics/functions/fnc_handleFired.sqf @@ -51,7 +51,7 @@ _scopeShiftY = _recoilCoef * linearConversion [0, 1, random 1, SCOPE_SHIFT_Y_MIN // Create and commit recoil effect private ["_sizeX", "_sizeY"]; -_sizeX = (0.76+_recoilScope)/(getResolution select 5); +_sizeX = (0.75+_recoilScope)/(getResolution select 5); _sizeY = _sizeX*safezoneW/safezoneH; private "_positionReticle"; @@ -82,7 +82,7 @@ _positionBody = [ (_display displayCtrl 1713006) ctrlCommit 0; // Bring them all back -_sizeX = 0.76/(getResolution select 5); +_sizeX = 0.75/(getResolution select 5); _sizeY = _sizeX*safezoneW/safezoneH; _positionReticle = [