@@ -816,60 +816,6 @@ long ValidateBrushStyle (const long BrushStyle,
816
816
// ascii to double
817
817
int myAtoF (const char *z, double *pResult);
818
818
819
- // colour stuff
820
-
821
- #define CLAMP (x ) (((x) < 0 ) ? 0 : (x > 255 ) ? 255 : (x))
822
-
823
-
824
- // see: http://www.nathanm.com/photoshop-blending-math/
825
- // and: http://www.pegtop.net/delphi/articles/blendmodes/
826
-
827
- #define uint8 unsigned char
828
- #define sqr (x ) ((x)*(x)) // square of x
829
-
830
- // A = blend, B = base
831
-
832
- #define Blend_Normal (A,B ) ((uint8)(A))
833
- #define Blend_Lighten (A,B ) ((uint8)((B > A) ? B:A))
834
- #define Blend_Darken (A,B ) ((uint8)((B > A) ? A:B))
835
- #define Blend_Multiply (A,B ) ((uint8)((A * B) / 255 ))
836
- #define Blend_Average (A,B ) ((uint8)((A + B) / 2 ))
837
- #define Blend_Add (A,B ) ((uint8)((A + B > 255 ) ? 255 :(A + B)))
838
- #define Blend_Subtract (A,B ) ((uint8)((A + B < 255 ) ? 0 :(A + B - 255 )))
839
- #define Blend_Difference (A,B ) ((uint8)(abs(A - B)))
840
- #define Blend_Negation (A,B ) ((uint8)(255 - abs(255 - A - B)))
841
- #define Blend_Screen (A,B ) ((uint8)(255 - (((255 - A) * (255 - B)) >> 8 )))
842
- #define Blend_Exclusion (A,B ) ((uint8)(A + B - 2 * A * B / 255 ))
843
- #define Blend_Overlay (A,B ) ((uint8)((B < 128 ) ? (2 * A * B / 255 ):(255 - 2 * (255 - A) * (255 - B) / 255 )))
844
- #define Blend_SoftLight (A,B ) ((uint8) ((A * B) >> 8 ) + ((B * (255 - (((255 - B) * (255 -A)) >> 8 ) - ((A * B) >> 8 ) )) >> 8 ) ) // c = ((A * B) >> 8)
845
- #define Blend_HardLight (A,B ) (Blend_Overlay(B,A))
846
- #define Blend_ColorDodge (A,B ) ((uint8)((A == 255 ) ? A:((((unsigned long ) B) << 8 ) / (255 - A) > 255 ) ? 255 :((((unsigned long ) B) << 8 ) / (255 - A))))
847
- #define Blend_ColorBurn (A,B ) ((uint8)((A == 0 ) ? 0 :((255 - (( ((unsigned long )(255 - B)) << 8 ) / A)) < 0 ) ? 0 :(255 - (( ((unsigned long )(255 - B)) << 8 ) / A))))
848
- #define Blend_LinearDodge (A,B ) (Blend_Add(A,B))
849
- #define Blend_LinearBurn (A,B ) (Blend_Subtract(A,B))
850
- #define Blend_LinearLight (A,B ) ((uint8)(A < 128 ) ? Blend_LinearBurn((2 * A),B):Blend_LinearDodge((2 * (A - 128 )),B))
851
- #define Blend_VividLight (A,B ) ((uint8)(A < 128 ) ? Blend_ColorBurn((2 * A),B):Blend_ColorDodge((2 * (A - 128 )),B))
852
- #define Blend_PinLight (A,B ) ((uint8)(A < 128 ) ? Blend_Darken((2 * A),B):Blend_Lighten((2 *(A - 128 )),B))
853
- #define Blend_HardMix (A,B ) ((uint8)(A < 255 - B) ? 0 :255 )
854
- #define Blend_Reflect (A,B ) ((uint8)((B == 255 ) ? B:((A * A / (255 - B) > 255 ) ? 255 :(A * A / (255 - B)))))
855
- #define Blend_Glow (A,B ) (Blend_Reflect(B,A))
856
- #define Blend_Phoenix (A,B ) ((uint8)(min(A,B) - max(A,B) + 255 ))
857
- #define Blend_Opacity (A,B,F,O ) ((uint8)(O * F (A,B) + (1 - O) * B))
858
-
859
- #define Simple_Opacity (B,X,O ) ((uint8)(O * X + (1 - O) * B))
860
-
861
- #define Blend_InverseColorDodge (A,B ) Blend_ColorDodge (B, A)
862
- #define Blend_InverseColorBurn (A,B ) Blend_ColorBurn (B, A)
863
- #define Blend_Freeze (A,B ) ((uint8)((A == 0 ) ? A:((255 - sqr(255 - B)/ A < 0 ) ? 0 :(255 - sqr(255 - B) / A))))
864
- #define Blend_Heat (A,B ) Blend_Freeze (B, A)
865
- #define Blend_Stamp (A,B ) ((uint8)((B + 2 *A - 256 < 0 ) ? 0 : (B + 2 *A - 256 > 255 ) ? 255 : (B + 2 *A - 256 ) ))
866
- #define Blend_Interpolate (A,B ) ((uint8)((cos_table [A] + cos_table [B]> 255 ) ? 255 : (cos_table [A] + cos_table [B]) ))
867
-
868
- #define Blend_Xor (A,B ) ((uint8) A ^ B )
869
- #define Blend_And (A,B ) ((uint8) A & B )
870
- #define Blend_Or (A,B ) ((uint8) A | B )
871
- #define Blend_A (A,B ) ((uint8) (A))
872
- #define Blend_B (A,B ) ((uint8) (B))
873
819
874
820
875
821
long LoadPng (LPCTSTR FileName, HBITMAP & hbmp); // load a PNG file into a bitmap
@@ -903,3 +849,19 @@ typedef struct
903
849
#ifndef BIF_NEWDIALOGSTYLE
904
850
#define BIF_NEWDIALOGSTYLE 0x00000040
905
851
#endif
852
+
853
+ /* Manifest instructions for the linker.
854
+ * Originally there is an '#IFDEF _UNICODE' statement around these pragmas, but we don't compile as _UNICODE.
855
+ * Research shows this #IFDEF seems to exist by default due to a bug in CEditView in MBCS mode, but I do not
856
+ * believe this bug can affect us at present as it involves 'loading from files'. Testing thus far seems to
857
+ * confirm there is no different behaviour in/around the command window with this enabled. -JW
858
+ */
859
+ #if _MSC_VER > 1200 // doesn't work with Visual Studio 6
860
+ #if defined _M_IX86
861
+ #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
862
+ #elif defined _M_X64
863
+ #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
864
+ #else
865
+ #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
866
+ #endif
867
+ #endif // _MSC_VER > 1200
0 commit comments