I'm slowly getting a hang of the C++ in visual studio while converting the code from Tier 1 to Tier 2.
I've been using Visual Studio 2015 for all of 2 days now. This is an absolutely new coding environment for me so these errors are simply foreign. I have no idea where I should start with figuring them out.
One thing I noticed is that I get a lot of :
Quote: "
conversion from 'double' to 'float', possible loss of data
"
So I discovered that if I need to set a float variable to actually be a float value, I need to do:
Quote: "
float speed = 0.5f;
"
So that "f" is what sets it as a float as far as I can understand and if I have a function:
Quote: "
SetObjectScale(enter, 0.3, 0.3, 0.3);
"
in C++ it needs to be
agk::SetObjectScale(enter, 0.3f, 0.3f, 0.3f);
So What if I have variables for values like:
agk::SetObjectScale(enter, value_one, value_two, value_three);
Do I need to make sure that when I'm setting those variables, I do
Quote: "
value_one = 2.5f;
value_two = 7.2f;
value_three = 4.9f; "
to prevent visual studio from complaining about it?
From what I can see, a good number of functions complain about variable conversion.
Most surprisingly is the fact that functions like
Quote: "
agk::GetRawMouseX();
"
are complaining about converting a float value (one getting returned from the function) to an integer value (variable that stores that function) How can a mouse be half a pixel across the screen?
Eisenstadt Studio: Eisenstadtstudio.com
Composers Page: Milesthatch.net