Added camera click
This commit is contained in:
BIN
content/sounds/SWITCH3.wav
Normal file
BIN
content/sounds/SWITCH3.wav
Normal file
Binary file not shown.
5
main.cpp
5
main.cpp
@@ -37,6 +37,7 @@ static G3D::RealTime messageTime = 0;
|
|||||||
static G3D::RealTime inputTime = 0;
|
static G3D::RealTime inputTime = 0;
|
||||||
static int FPSVal[8] = {10, 20, 30, 60, 120, 240, INT_MAX,1};
|
static int FPSVal[8] = {10, 20, 30, 60, 120, 240, INT_MAX,1};
|
||||||
static int index = 2;
|
static int index = 2;
|
||||||
|
static std::string cameraSound = "";
|
||||||
static float TIMERVAL = 60.0F;
|
static float TIMERVAL = 60.0F;
|
||||||
static int SCOREVAL = 0;
|
static int SCOREVAL = 0;
|
||||||
static AudioPlayer soundSystem;
|
static AudioPlayer soundSystem;
|
||||||
@@ -250,6 +251,7 @@ public:
|
|||||||
|
|
||||||
void CameraButtonListener::onButton1MouseClick(BaseButtonInstance* button)
|
void CameraButtonListener::onButton1MouseClick(BaseButtonInstance* button)
|
||||||
{
|
{
|
||||||
|
soundSystem.PlaySound(cameraSound);
|
||||||
CoordinateFrame frame = usableApp->debugCamera.getCoordinateFrame();
|
CoordinateFrame frame = usableApp->debugCamera.getCoordinateFrame();
|
||||||
if(button->name == "CenterCam")
|
if(button->name == "CenterCam")
|
||||||
centerCam = true;
|
centerCam = true;
|
||||||
@@ -878,11 +880,13 @@ void Demo::onUserInput(UserInput* ui) {
|
|||||||
|
|
||||||
if(ui->keyPressed(SDL_MOUSE_WHEEL_UP_KEY))
|
if(ui->keyPressed(SDL_MOUSE_WHEEL_UP_KEY))
|
||||||
{
|
{
|
||||||
|
soundSystem.PlaySound(cameraSound);
|
||||||
CoordinateFrame frame = app->debugCamera.getCoordinateFrame();
|
CoordinateFrame frame = app->debugCamera.getCoordinateFrame();
|
||||||
cameraPos = cameraPos + frame.lookVector()*2;
|
cameraPos = cameraPos + frame.lookVector()*2;
|
||||||
}
|
}
|
||||||
if(ui->keyPressed(SDL_MOUSE_WHEEL_DOWN_KEY))
|
if(ui->keyPressed(SDL_MOUSE_WHEEL_DOWN_KEY))
|
||||||
{
|
{
|
||||||
|
soundSystem.PlaySound(cameraSound);
|
||||||
CoordinateFrame frame = app->debugCamera.getCoordinateFrame();
|
CoordinateFrame frame = app->debugCamera.getCoordinateFrame();
|
||||||
cameraPos = cameraPos - frame.lookVector()*2;
|
cameraPos = cameraPos - frame.lookVector()*2;
|
||||||
}
|
}
|
||||||
@@ -1371,6 +1375,7 @@ void App::main() {
|
|||||||
cursor = Texture::fromFile(GetFileInPath("/content/cursor2.png"));
|
cursor = Texture::fromFile(GetFileInPath("/content/cursor2.png"));
|
||||||
fntdominant = GFont::fromFile(GetFileInPath("/content/font/dominant.fnt"));
|
fntdominant = GFont::fromFile(GetFileInPath("/content/font/dominant.fnt"));
|
||||||
fntlighttrek = GFont::fromFile(GetFileInPath("/content/font/lighttrek.fnt"));
|
fntlighttrek = GFont::fromFile(GetFileInPath("/content/font/lighttrek.fnt"));
|
||||||
|
cameraSound = GetFileInPath("/content/sounds/SWITCH3.wav");
|
||||||
sky = Sky::create(NULL, ExePath() + "/content/sky/");
|
sky = Sky::create(NULL, ExePath() + "/content/sky/");
|
||||||
cursorid = cursor->openGLID();
|
cursorid = cursor->openGLID();
|
||||||
applet->run();
|
applet->run();
|
||||||
|
|||||||
Reference in New Issue
Block a user