Skip to content

Commit

Permalink
Merge pull request surge-synthesizer#466 from baconpaul/win-resource-453
Browse files Browse the repository at this point in the history
Move scalableresource.h
  • Loading branch information
baconpaul authored Feb 2, 2019
2 parents d43b898 + be507bc commit 5188ec4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/win/emit-vector-rc.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
scaleToOffset[ matchscale.group( 1 ) ] = int( matchscale.group( 2 ) )


subRes = open( "src\\common\\scalableresource.h", "w" )
subRes = open( "src\\windows\\scalableresource.h", "w" )
subRes.write( """
/*
** THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT IT
Expand Down
5 changes: 4 additions & 1 deletion src/common/gui/CScalableBitmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,16 @@ CScalableBitmap::CScalableBitmap(CResourceDescription desc)
scaleFilePostfixes[ 300 ] = "@3x";
scaleFilePostfixes[ 400 ] = "@4x";

#if WINDOWS
// Only windows uses this integer indexing and knows these offsets
std::map< int, int > scaleIDOffsets;
scaleIDOffsets[ 100 ] = SCALABLE_100_OFFSET;
scaleIDOffsets[ 150 ] = SCALABLE_150_OFFSET;
scaleIDOffsets[ 200 ] = SCALABLE_200_OFFSET;
scaleIDOffsets[ 300 ] = SCALABLE_300_OFFSET;
scaleIDOffsets[ 400 ] = SCALABLE_400_OFFSET;

#endif

for(auto sc : scales)
{
CBitmap *scBmp = NULL;
Expand Down
6 changes: 5 additions & 1 deletion src/common/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,20 @@
#endif
#endif

#if WINDOWS
/*
** Each of the bitmaps is also available in scaled form. The ID of the scaled bitmaps
** is ID_BG+SCALABLE_200_OFFSET for the 200% image.
**
** Do NOT change the values of these constants without understanding scripts/win/emit-vector-rc.py
**
** This is windows only. Mac and Linux use different resource approaches
*/
#define SCALABLE_100_OFFSET 70000
#define SCALABLE_150_OFFSET 71000
#define SCALABLE_200_OFFSET 72000
#define SCALABLE_300_OFFSET 73000
#define SCALABLE_400_OFFSET 74000

#include "scalableresource.h"
#include "scalableresource.h" // found in src/windows
#endif
File renamed without changes.

0 comments on commit 5188ec4

Please sign in to comment.