Remove Player parameter from Camera::GetPosition

This commit is contained in:
Jochen Sch„fer 2024-09-12 08:18:15 +02:00
parent bce034185b
commit 8fbc76eace
3 changed files with 6 additions and 6 deletions

View File

@ -53,7 +53,7 @@ struct Camera {
/* Returns the current orientation of the camera. */
Vec2 (*GetOrientation)(void);
/* 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. */
/* Typically, this is used to adjust yaw/pitch based on accumulated mouse movement. */

View File

@ -400,7 +400,7 @@ static cc_bool CanDeleteTexture(struct Entity* except) {
int i;
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]->TextureId == except->TextureId) return false;
@ -1049,7 +1049,7 @@ void LocalPlayers_MoveToSpawn(struct LocationUpdate* update) {
}
/* 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) {

View File

@ -658,7 +658,7 @@ static void LimitFPS(void) {
Thread_Sleep((int)(cooldown + 0.5f));
/* 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) */
sleepEnd = Stopwatch_Measure();
gfx_actualTime += ElapsedMilliseconds(frameEnd, sleepEnd);
@ -734,7 +734,7 @@ static CC_INLINE void Game_RenderFrame(void) {
cc_uint64 render = Stopwatch_Measure();
cc_uint64 elapsed = Stopwatch_ElapsedMicroseconds(frameStart, render);
/* avoid large delta with suspended process */
if (elapsed > 5000000) elapsed = 5000000;
if (elapsed > 5000000) elapsed = 5000000;
deltaD = (int)elapsed / (1000.0 * 1000.0);
delta = (float)deltaD;
@ -789,7 +789,7 @@ static CC_INLINE void Game_RenderFrame(void) {
t = (float)(entTask.accumulator / entTask.interval);
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 */
EnvRenderer_UpdateFog();
AudioBackend_Tick();