Lines 71-84
Link Here
|
71 |
|
71 |
|
72 |
if(sec->floordata->IsKindOf(RUNTIME_CLASS(DPlat))) |
72 |
if(sec->floordata->IsKindOf(RUNTIME_CLASS(DPlat))) |
73 |
{ |
73 |
{ |
74 |
DPlat *plat = (DPlat *)sec->floordata; |
74 |
DPlat *Plat = (DPlat *)sec->floordata; |
75 |
sec->floorheight = pred->floorheight; |
75 |
|
76 |
plat->SetState(pred->state, pred->count); |
76 |
sec->floorheight = pred->floorheight; |
|
|
77 |
sec->ceilingheight = pred->ceilingheight; |
78 |
|
79 |
Plat->m_Speed = pred->m_Speed; |
80 |
Plat->m_Low = pred->m_Low; |
81 |
Plat->m_High = pred->m_High; |
82 |
Plat->m_Wait = pred->m_Wait; |
83 |
Plat->m_Count = pred->m_Count; |
84 |
Plat->m_Status = (DPlat::EPlatState)pred->m_Status; |
85 |
Plat->m_OldStatus = (DPlat::EPlatState)pred->m_OldStatus; |
86 |
Plat->m_Crush = pred->m_Crush; |
87 |
Plat->m_Tag = pred->m_Tag; |
88 |
Plat->m_Type = (DPlat::EPlatType)pred->m_Type; |
89 |
Plat->m_PostWait = pred->m_PostWait; |
77 |
} |
90 |
} |
78 |
else if(sec->floordata && sec->floordata->IsKindOf(RUNTIME_CLASS(DMovingFloor))) |
|
|
79 |
{ |
80 |
sec->floorheight = pred->floorheight; |
81 |
} |
82 |
} |
91 |
} |
83 |
} |
92 |
} |
84 |
|
93 |
|
Lines 94-103
Link Here
|
94 |
|
103 |
|
95 |
if(pred->tic < predtic) |
104 |
if(pred->tic < predtic) |
96 |
{ |
105 |
{ |
97 |
if(sec->floordata && (sec->floordata->IsKindOf(RUNTIME_CLASS(DPlat)) |
106 |
if(sec->floordata && sec->floordata->IsKindOf(RUNTIME_CLASS(DPlat))) |
98 |
|| sec->floordata->IsKindOf(RUNTIME_CLASS(DMovingFloor)))) |
|
|
99 |
{ |
107 |
{ |
100 |
sec->floordata->RunThink(); |
108 |
sec->floordata->RunThink(); |
101 |
} |
109 |
} |
102 |
} |
110 |
} |
103 |
} |
111 |
} |
Lines 147-152
Link Here
|
147 |
} |
155 |
} |
148 |
else |
156 |
else |
149 |
{ |
157 |
{ |
|
|
158 |
// [Russell] - Unsure if its good to call this all the time, but it does |
159 |
// smooth out the viewheight pogo |
160 |
CL_MoveThing(p->mo, p->mo->x, p->mo->y, p->mo->z); |
150 |
P_MovePlayer(p); |
161 |
P_MovePlayer(p); |
151 |
P_CalcHeight(p); |
162 |
P_CalcHeight(p); |
152 |
} |
163 |
} |
Lines 198-204
Link Here
|
198 |
} |
209 |
} |
199 |
|
210 |
|
200 |
// |
211 |
// |
201 |
// CL_PredicMove |
212 |
// CL_PredictMove |
202 |
// |
213 |
// |
203 |
void CL_PredictMove (void) |
214 |
void CL_PredictMove (void) |
204 |
{ |
215 |
{ |
Lines 210-215
Link Here
|
210 |
if (!p->tic || !p->mo) |
221 |
if (!p->tic || !p->mo) |
211 |
return; |
222 |
return; |
212 |
|
223 |
|
|
|
224 |
#ifdef _PRED_DBG |
225 |
fixed_t origx, origy, origz; |
226 |
#endif |
227 |
|
213 |
// Save player angle, viewheight,deltaviewheight and jumpTics. |
228 |
// Save player angle, viewheight,deltaviewheight and jumpTics. |
214 |
// Will use it later to predict movements |
229 |
// Will use it later to predict movements |
215 |
cl_angle[gametic%MAXSAVETICS] = p->mo->angle; |
230 |
cl_angle[gametic%MAXSAVETICS] = p->mo->angle; |
Lines 219-224
Link Here
|
219 |
cl_jumpTics[gametic%MAXSAVETICS] = p->jumpTics; |
234 |
cl_jumpTics[gametic%MAXSAVETICS] = p->jumpTics; |
220 |
cl_reactiontime[gametic%MAXSAVETICS] = p->mo->reactiontime; |
235 |
cl_reactiontime[gametic%MAXSAVETICS] = p->mo->reactiontime; |
221 |
|
236 |
|
|
|
237 |
#ifdef _PRED_DBG |
238 |
// Backup original position |
239 |
origx = p->mo->x; |
240 |
origy = p->mo->y; |
241 |
origz = p->mo->z; |
242 |
#endif |
243 |
|
222 |
// Disable sounds, etc, during prediction |
244 |
// Disable sounds, etc, during prediction |
223 |
predicting = true; |
245 |
predicting = true; |
224 |
|
246 |
|
Lines 232-249
Link Here
|
232 |
predtic = 0; |
254 |
predtic = 0; |
233 |
|
255 |
|
234 |
// Predict each tic |
256 |
// Predict each tic |
235 |
while(predtic < gametic) |
257 |
while(++predtic < gametic) |
236 |
{ |
258 |
{ |
237 |
CL_PredictPlayers(predtic); |
259 |
CL_PredictPlayers(predtic); |
238 |
CL_PredictSectors(predtic); |
260 |
CL_PredictSectors(predtic); |
239 |
|
|
|
240 |
++predtic; |
241 |
} |
261 |
} |
242 |
|
262 |
|
243 |
predicting = false; |
263 |
predicting = false; |
244 |
|
264 |
|
245 |
CL_PredictPlayers(predtic); |
265 |
CL_PredictPlayers(predtic); |
246 |
CL_PredictSectors(predtic); |
266 |
// [Russell] - I don't think we need to call this as DThinker::RunThinkers() |
|
|
267 |
// will already run the platform thinkers after prediction |
268 |
//CL_PredictSectors(predtic); |
269 |
|
270 |
#ifdef _PRED_DBG |
271 |
if ((origx == p->mo->x) && (origy == p->mo->y) && (origz == p->mo->z)) |
272 |
{ |
273 |
Printf(PRINT_HIGH, "%d tics predicted\n", predtic); |
274 |
} |
275 |
else |
276 |
{ |
277 |
Printf(PRINT_HIGH, "%d tics failed\n", predtic); |
278 |
} |
279 |
#endif |
247 |
} |
280 |
} |
248 |
|
281 |
|
249 |
VERSION_CONTROL (cl_pred_cpp, "$Id$") |
282 |
VERSION_CONTROL (cl_pred_cpp, "$Id$") |