Welcome, Guest.
Username: Password: Remember me

TOPIC: Using a #define keydef in uniform key var

Using a #define keydef in uniform key var 8 months 3 weeks ago #1

  • OtisInf
  • OtisInf's Avatar
  • Offline
  • Posts: 122
  • Thank you received: 51
I defined in the cfg file:
#define DOF_MouseAFFocusPointToggleKey VK_PAUSE //[undef] //- <<<<<<< line 82

and used it in the shader fx: (inside the namespace def)
uniform bool PauseKeyDown < source = "key"; keycode = DOF_MouseAFFocusPointToggleKey; toggle=true; >;

(var name should of course change, but it's for testing ;)).

If I do this, I get:
C:\Games\Assassin's Creed Syndicate\ReShade/Presets/Default/Shaders_by_MartyMcFly.cfg(82, 9): preprocessor error: redefinition of 'DOF_MouseAFFocusPointToggleKey'
C:\Games\Assassin's Creed Syndicate\ReShade/Presets/Default/Shaders_by_MartyMcFly.cfg(82, 9): preprocessor error: redefinition of 'DOF_MouseAFFocusPointToggleKey'
C:\Games\Assassin's Creed Syndicate\ReShade/Presets/Default/Shaders_by_MartyMcFly.cfg(82, 9): preprocessor error: redefinition of 'DOF_MouseAFFocusPointToggleKey'
C:\Games\Assassin's Creed Syndicate\ReShade/Presets/Default/Shaders_by_MartyMcFly.cfg(82, 9): preprocessor error: redefinition of 'DOF_MouseAFFocusPointToggleKey'
C:\Games\Assassin's Creed Syndicate\ReShade/Presets/Default/Shaders_by_MartyMcFly.cfg(82, 9): preprocessor error: redefinition of 'DOF_MouseAFFocusPointToggleKey'
C:\Games\Assassin's Creed Syndicate\ReShade/Presets/Default/Shaders_by_MartyMcFly.cfg(82, 9): preprocessor error: redefinition of 'DOF_MouseAFFocusPointToggleKey'
C:\Games\Assassin's Creed Syndicate\ReShade/Presets/Default/Shaders_by_MartyMcFly.cfg(82, 9): preprocessor error: redefinition of 'DOF_MouseAFFocusPointToggleKey'
C:\Games\Assassin's Creed Syndicate\ReShade/Presets/Default/Shaders_by_MartyMcFly.cfg(82, 9): preprocessor error: redefinition of 'DOF_MouseAFFocusPointToggleKey'

Which is kind of odd, as it's not defined anywhere else. Does the uniform inside the fx already define it somehow? That would be a shame as it then can't depend on a configured key but only a hardcoded one. (it works if I remove the #define and hard-code VK_PAUSE as the key in the uniform).

(for the rest, the small tweak I added with the mouse works great, so glad you added that mousepoint uniform source! much easier for taking screenshots now as you don't need to have the subject dead-center anymore ;))
Last Edit: 8 months 3 weeks ago by OtisInf.
The administrator has disabled public write access.

Using a #define keydef in uniform key var 8 months 3 weeks ago #2

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2437
  • Thank you received: 1385
Add an "#undef DOF_MouseAFFocusPointToggleKey" to the .undef file. The cfg file is included in each of your shaders ("#include EFFECT_CONFIG(Otis)"), so without undefining the value (done via "#include EFFECT_CONFIG_UNDEF(Otis)") before reincluding it, the redefinition error will show up.
Cheers, crosire =)
Last Edit: 8 months 3 weeks ago by crosire.
The administrator has disabled public write access.

Using a #define keydef in uniform key var 8 months 3 weeks ago #3

  • OtisInf
  • OtisInf's Avatar
  • Offline
  • Posts: 122
  • Thank you received: 51
Doh, totally forgot that. Thanks :) Solved it in a different way but for next time it's good to know ;)
The administrator has disabled public write access.