diff options
author | Treeki <treeki@gmail.com> | 2012-01-17 00:40:00 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2012-01-17 00:40:00 +0100 |
commit | bb5d7f7e737e318d095d23939b7d288eaf5f9e63 (patch) | |
tree | ec41984cd10376e7fec2b24e22b1b695c3692b36 /src/koopatlas/camera.cpp | |
parent | 28efd888af3ffe227565683e2cd2960ea5b52f61 (diff) | |
download | kamek-bb5d7f7e737e318d095d23939b7d288eaf5f9e63.tar.gz kamek-bb5d7f7e737e318d095d23939b7d288eaf5f9e63.zip |
added path support and the new API LevelInfo
Diffstat (limited to 'src/koopatlas/camera.cpp')
-rw-r--r-- | src/koopatlas/camera.cpp | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/src/koopatlas/camera.cpp b/src/koopatlas/camera.cpp index bfcc674..9efbcd6 100644 --- a/src/koopatlas/camera.cpp +++ b/src/koopatlas/camera.cpp @@ -31,8 +31,8 @@ dWorldCamera_c::dWorldCamera_c() { projection2d.near = 1.0; projection2d.far = 20000.0; - currentX = 0; - currentY = 0; + currentX = 416; + currentY = -224; zoomLevel = 2.0f; } @@ -68,34 +68,37 @@ int dWorldCamera_c::onDelete() { int dWorldCamera_c::onExecute() { - int nowPressed = Remocon_GetPressed(GetActiveRemocon()); - bool change = false; - if (nowPressed & WPAD_LEFT) { - currentX -= 16; - change = true; - } - if (nowPressed & WPAD_RIGHT) { - currentX += 16; - change = true; - } - if (nowPressed & WPAD_UP) { - currentY += 16; - change = true; - } - if (nowPressed & WPAD_DOWN) { - currentY -= 16; - change = true; - } - if (nowPressed & WPAD_B) { - zoomLevel -= 0.02; - change = true; - } - if (nowPressed & WPAD_A) { - zoomLevel += 0.02; - change = true; - } - if (change) { - OSReport("%f, %f (%f)\n", currentX, currentY, zoomLevel); + int heldButtons = Remocon_GetButtons(GetActiveRemocon()); + if (heldButtons & WPAD_MINUS) { + int nowPressed = Remocon_GetPressed(GetActiveRemocon()); + bool change = false; + if (nowPressed & WPAD_LEFT) { + currentX -= 16; + change = true; + } + if (nowPressed & WPAD_RIGHT) { + currentX += 16; + change = true; + } + if (nowPressed & WPAD_UP) { + currentY += 16; + change = true; + } + if (nowPressed & WPAD_DOWN) { + currentY -= 16; + change = true; + } + if (nowPressed & WPAD_B) { + zoomLevel -= 0.02; + change = true; + } + if (nowPressed & WPAD_A) { + zoomLevel += 0.02; + change = true; + } + if (change) { + OSReport("%f, %f (%f)\n", currentX, currentY, zoomLevel); + } } calculateScreenGeometry(); doStuff(10000.0); |