All throughout my code I have to make a horizontal and vertical adjustment to the coorindates I blit to. The way I've done this is simply to have two variables, xadj and yadj, and I add them to the X/Y coordinates I'm going to blit to any time I do a blit, like so:
doBlit(xadj + 25, yadj + 25, myImage);
My question, which I know is very basic yet I'm not 100% certain of the answer is this...
If I replace my xadj and yadj variables with defines, then the addition in the case of literals like the above will be done at compile-time rather than runtime, correct?
Ok, stop laughing and answer me!
Seriously though, I've never had a reason to think about it, so I'm not sure (although I believe what I've written to be the case). Just wanted to verify or get a correction. Thanks all!
doBlit(xadj + 25, yadj + 25, myImage);
My question, which I know is very basic yet I'm not 100% certain of the answer is this...
If I replace my xadj and yadj variables with defines, then the addition in the case of literals like the above will be done at compile-time rather than runtime, correct?
Ok, stop laughing and answer me!