Fixed 21-deferred for Emscripten.

This commit is contained in:
Branimir Karadžić 2015-08-21 22:52:37 -07:00
parent f149fcec94
commit 46eba42ba0
3 changed files with 526 additions and 461 deletions

File diff suppressed because it is too large Load diff

View file

@ -53,7 +53,7 @@ static void cmd(const void* _userData)
cmdExec( (const char*)_userData); cmdExec( (const char*)_userData);
} }
static const InputBinding s_camBindings[] = static const InputBinding s_camBindings[] =
{ {
{ entry::Key::KeyW, entry::Modifier::None, 0, cmd, "move forward" }, { entry::Key::KeyW, entry::Modifier::None, 0, cmd, "move forward" },
{ entry::Key::GamepadUp, entry::Modifier::None, 0, cmd, "move forward" }, { entry::Key::GamepadUp, entry::Modifier::None, 0, cmd, "move forward" },
@ -258,7 +258,7 @@ struct Camera
bx::mtxLookAt(_viewMtx, m_eye, m_at, m_up); bx::mtxLookAt(_viewMtx, m_eye, m_at, m_up);
} }
void setPosition(float* _pos) void setPosition(const float* _pos)
{ {
memcpy(m_eye, _pos, sizeof(float)*3); memcpy(m_eye, _pos, sizeof(float)*3);
} }
@ -267,7 +267,7 @@ struct Camera
{ {
m_verticalAngle = _verticalAngle; m_verticalAngle = _verticalAngle;
} }
void setHorizontalAngle(float _horizontalAngle) void setHorizontalAngle(float _horizontalAngle)
{ {
m_horizontalAngle = _horizontalAngle; m_horizontalAngle = _horizontalAngle;
@ -303,7 +303,7 @@ void cameraDestroy()
s_camera = NULL; s_camera = NULL;
} }
void cameraSetPosition(float* _pos) void cameraSetPosition(const float* _pos)
{ {
s_camera->setPosition(_pos); s_camera->setPosition(_pos);
} }

View file

@ -22,7 +22,7 @@ void cameraCreate();
void cameraDestroy(); void cameraDestroy();
/// ///
void cameraSetPosition(float* _pos); void cameraSetPosition(const float* _pos);
/// ///
void cameraSetHorizontalAngle(float _horizontalAngle); void cameraSetHorizontalAngle(float _horizontalAngle);