Hi all. I am new to the forums and have been working on a game application and have come across a somewhat annoying error i cannot seem to correct. This application is a port of another application just to add. Also just to add i am not a top level coder, i am very low level so im trying to do the best i can with what knowledge i do have.
I am trying to set a sound distortion code when using cheat codes are enabled. I figured it to be a simple if/else statement but every time i try to compile it spits out a error C2365: 'SetDistortion' : redefinition; previous definition was a 'data variable'
First in my main.cpp i had to add the function itself which is this:
1 2 3 4 5 6 7
|
void SetDistortion() {
Sound sound(emulator);
if(SetDistortion)
sound.SetGenie(true);
else
sound.SetGenie(false);
}
|
this compiles ok and fine. It's when i try to add the menu option for it that it starts giving me trouble. This is my function for the menu option itself:
1 2 3 4 5 6 7 8
|
if(GeneralOptionsSelected == 8) {
SetDistortion++;
if(SetDistortion > 1)
SetDistortion = 0;
if(SetDistortion == 1) GeneralOptionsValueSettings[8] = "Enabled";
else
GeneralOptionsValueSettings[8] = "Disabled";
return;
|
the other relevant files for this would be the place where the function itself is added in the original application though i dont think that is needed in this case. If someone does not minding maybe giving me a clue i would greatly appreciate it.
And yes, to confirm i am a newb at this and trying the best i can.
Edit** for some reason the code tag messed up and i cant fix it.
if(GeneralOptionsSelected == 8) {
SetDistortion++;
if(SetDistortion > 1)
SetDistortion = 0;
if(SetDistortion == 1)
GeneralOptionsValueSettings[8] = "Enabled";
else
GeneralOptionsValueSettings[8] = "Disabled";
return;