mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-11 16:45:48 -04:00
Remove Player parameter from Camera::GetPosition
This commit is contained in:
parent
bce034185b
commit
8fbc76eace
@ -53,7 +53,7 @@ struct Camera {
|
|||||||
/* Returns the current orientation of the camera. */
|
/* Returns the current orientation of the camera. */
|
||||||
Vec2 (*GetOrientation)(void);
|
Vec2 (*GetOrientation)(void);
|
||||||
/* Returns the current interpolated position of the camera. */
|
/* Returns the current interpolated position of the camera. */
|
||||||
Vec3 (*GetPosition)(struct LocalPlayer* p, float t);
|
Vec3 (*GetPosition)(float t);
|
||||||
|
|
||||||
/* Called to update the camera's state. */
|
/* Called to update the camera's state. */
|
||||||
/* Typically, this is used to adjust yaw/pitch based on accumulated mouse movement. */
|
/* Typically, this is used to adjust yaw/pitch based on accumulated mouse movement. */
|
||||||
|
@ -400,7 +400,7 @@ static cc_bool CanDeleteTexture(struct Entity* except) {
|
|||||||
int i;
|
int i;
|
||||||
if (!except->TextureId) return false;
|
if (!except->TextureId) return false;
|
||||||
|
|
||||||
for (i = 0; i < ENTITIES_MAX_COUNT; i++)
|
for (i = 0; i < ENTITIES_MAX_COUNT; i++)
|
||||||
{
|
{
|
||||||
if (!Entities.List[i] || Entities.List[i] == except) continue;
|
if (!Entities.List[i] || Entities.List[i] == except) continue;
|
||||||
if (Entities.List[i]->TextureId == except->TextureId) return false;
|
if (Entities.List[i]->TextureId == except->TextureId) return false;
|
||||||
@ -1049,7 +1049,7 @@ void LocalPlayers_MoveToSpawn(struct LocationUpdate* update) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: This needs to be before new map... */
|
/* TODO: This needs to be before new map... */
|
||||||
Camera.CurrentPos = Camera.Active->GetPosition(p, 0.0f);
|
Camera.CurrentPos = Camera.Active->GetPosition(0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocalPlayer_CalcDefaultSpawn(struct LocalPlayer* p, struct LocationUpdate* update) {
|
void LocalPlayer_CalcDefaultSpawn(struct LocalPlayer* p, struct LocationUpdate* update) {
|
||||||
|
@ -658,7 +658,7 @@ static void LimitFPS(void) {
|
|||||||
Thread_Sleep((int)(cooldown + 0.5f));
|
Thread_Sleep((int)(cooldown + 0.5f));
|
||||||
|
|
||||||
/* also accumulate Thread_Sleep duration, as actual sleep */
|
/* also accumulate Thread_Sleep duration, as actual sleep */
|
||||||
/* duration can significantly deviate from requested time */
|
/* duration can significantly deviate from requested time */
|
||||||
/* (e.g. requested 4ms, but actually slept for 8ms) */
|
/* (e.g. requested 4ms, but actually slept for 8ms) */
|
||||||
sleepEnd = Stopwatch_Measure();
|
sleepEnd = Stopwatch_Measure();
|
||||||
gfx_actualTime += ElapsedMilliseconds(frameEnd, sleepEnd);
|
gfx_actualTime += ElapsedMilliseconds(frameEnd, sleepEnd);
|
||||||
@ -734,7 +734,7 @@ static CC_INLINE void Game_RenderFrame(void) {
|
|||||||
cc_uint64 render = Stopwatch_Measure();
|
cc_uint64 render = Stopwatch_Measure();
|
||||||
cc_uint64 elapsed = Stopwatch_ElapsedMicroseconds(frameStart, render);
|
cc_uint64 elapsed = Stopwatch_ElapsedMicroseconds(frameStart, render);
|
||||||
/* avoid large delta with suspended process */
|
/* avoid large delta with suspended process */
|
||||||
if (elapsed > 5000000) elapsed = 5000000;
|
if (elapsed > 5000000) elapsed = 5000000;
|
||||||
|
|
||||||
deltaD = (int)elapsed / (1000.0 * 1000.0);
|
deltaD = (int)elapsed / (1000.0 * 1000.0);
|
||||||
delta = (float)deltaD;
|
delta = (float)deltaD;
|
||||||
@ -789,7 +789,7 @@ static CC_INLINE void Game_RenderFrame(void) {
|
|||||||
t = (float)(entTask.accumulator / entTask.interval);
|
t = (float)(entTask.accumulator / entTask.interval);
|
||||||
LocalPlayer_SetInterpPosition(Entities.CurPlayer, t);
|
LocalPlayer_SetInterpPosition(Entities.CurPlayer, t);
|
||||||
|
|
||||||
Camera.CurrentPos = Camera.Active->GetPosition(Entities.CurPlayer, t);
|
Camera.CurrentPos = Camera.Active->GetPosition(t);
|
||||||
/* NOTE: EnvRenderer_UpdateFog also also sets clear color */
|
/* NOTE: EnvRenderer_UpdateFog also also sets clear color */
|
||||||
EnvRenderer_UpdateFog();
|
EnvRenderer_UpdateFog();
|
||||||
AudioBackend_Tick();
|
AudioBackend_Tick();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user