Permalink
Browse files

Add IMG_SIZE macro #15

  • Loading branch information...
msfeldstein committed Jun 11, 2018
1 parent f95d152 commit f731d3709347684e2faabdd6b40d97b20bc07de4
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/ISFParser.js
View
@@ -149,6 +149,12 @@ ISFParser.prototype.replaceSpecialFunctions = function replaceSpecialFunctions(s
const coord = results[1];
return `VVSAMPLER_2DBYNORM(${sampler}, _${sampler}_imgRect, _${sampler}_imgSize, _${sampler}_flip, ${coord})`;
});
// IMG_SIZE
regex = /IMG_SIZE\((.+?)\)/g;
source = source.replace(regex, (fullMatch, imgName) => {
return `_${imgName}_imgSize`;
});
return source;
};

0 comments on commit f731d37

Please sign in to comment.