Skip to content

Commit

Permalink
Move scalableresource.h
Browse files Browse the repository at this point in the history
When @jsakkine was doing linux resources, he and I realized
that I had put this file in the wrong directory. It should be
in windows and conditionally included. Addresses issue surge-synthesizer#453


Former-commit-id: 7eb4a31efd6308799729774ede412595ff6e485d [formerly be507bc]
Former-commit-id: cc90150f2e2d77aba0b1e1256969742150589919
Former-commit-id: 1cf76594e1ff9d363f205bfbac50ad370b27fe5c
  • Loading branch information
baconpaul committed Feb 2, 2019
1 parent c2d7539 commit 979f3ba
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 979f3ba

Please sign in to comment.