dp_doom: fix silly bug causing only the first frame to be published
This commit is contained in:
parent
c292aadb68
commit
9e857180be
1 changed files with 31 additions and 30 deletions
|
@ -228,10 +228,9 @@ void IB_FinishUpdate (void)
|
|||
{
|
||||
if (!dp_nng_is_timeout(res))
|
||||
dp_nng_fatal("doom/recvmsg", res);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
MessageBase *msgBase = DP_NNG_BODY_AS(msg, MessageBase);
|
||||
|
||||
DP_DoomCommand cmd = DP_DC_Noop;
|
||||
|
@ -253,6 +252,7 @@ void IB_FinishUpdate (void)
|
|||
|
||||
if (cmd == DP_DC_Endoom)
|
||||
{
|
||||
log_info("Received Endoom from controller, quitting");
|
||||
ctx->state = DP_DS_Endoom;
|
||||
|
||||
if ((res = publish_state(ctx)))
|
||||
|
@ -262,6 +262,7 @@ void IB_FinishUpdate (void)
|
|||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
int res = 0;
|
||||
|
@ -279,7 +280,7 @@ void IB_FinishUpdate (void)
|
|||
if ((res = nng_sendmsg(ctx->pub, msg, 0)))
|
||||
dp_nng_fatal("ctrl/sendmsg", res);
|
||||
|
||||
log_debug("doom(%d) published frame", ctx->id);
|
||||
log_trace("doom(%d) published frame", ctx->id);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -294,6 +295,7 @@ static void I_Quit_Wrapper(int dummy)
|
|||
{
|
||||
(void)dummy;
|
||||
|
||||
log_info("Caught SIGINT, quitting");
|
||||
I_Quit();
|
||||
}
|
||||
|
||||
|
@ -311,11 +313,7 @@ void IB_InitGraphics(const char *title, size_t screen_width, size_t screen_heigh
|
|||
|
||||
signal(SIGINT, I_Quit_Wrapper);
|
||||
|
||||
#ifndef NDEBUG
|
||||
log_set_level(LOG_DEBUG);
|
||||
#else
|
||||
log_set_level(LOG_INFO);
|
||||
#endif
|
||||
log_set_level(LOG_TRACE);
|
||||
|
||||
dp_nng_init_limits(1, 1, 1);
|
||||
|
||||
|
@ -346,7 +344,10 @@ void IB_InitGraphics(const char *title, size_t screen_width, size_t screen_heigh
|
|||
}
|
||||
|
||||
if (ctx->state == DP_DS_Endoom)
|
||||
{
|
||||
log_info("Received Endoom from controller, quitting");
|
||||
I_Quit();
|
||||
}
|
||||
}
|
||||
|
||||
void IB_ShutdownGraphics(void)
|
||||
|
|
Loading…
Reference in a new issue