mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
fix yield function Roger H
This commit is contained in:
parent
9362e32d6f
commit
5f33765f9b
@ -939,16 +939,17 @@ describe_message(ostream &out, const string &prefix,
|
|||||||
|
|
||||||
bool CConnectionRepository::network_based_reader_and_yielder(PyObject *PycallBackFunction,ClockObject &clock, float returnBy)
|
bool CConnectionRepository::network_based_reader_and_yielder(PyObject *PycallBackFunction,ClockObject &clock, float returnBy)
|
||||||
{
|
{
|
||||||
bool KeepRunning = true;
|
while(is_connected())
|
||||||
while(KeepRunning)
|
|
||||||
{
|
{
|
||||||
check_datagram_ai(PycallBackFunction);
|
check_datagram_ai(PycallBackFunction);
|
||||||
_bdc.Flush();
|
if(is_connected())
|
||||||
|
_bdc.Flush();
|
||||||
float currentTime = clock.get_real_time();
|
float currentTime = clock.get_real_time();
|
||||||
float dif_time = returnBy - currentTime;
|
float dif_time = returnBy - currentTime;
|
||||||
if(dif_time <= 0.001) // to avoi over runs..
|
if(dif_time <= 0.001) // to avoi over runs..
|
||||||
break;
|
break;
|
||||||
_bdc.WaitForNetworkReadEvent(dif_time);
|
if(is_connected())
|
||||||
|
_bdc.WaitForNetworkReadEvent(dif_time);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user