Linux Port (CLI and GTK): When building with --enable-hud, fix the segfault on startup that was caused by an uninitialized OSD object. (Fixes #107.)
This commit is contained in:
parent
109dd6f373
commit
b03a799834
|
@ -475,10 +475,6 @@ static void desmume_cycle(struct ctrls_event_config * cfg)
|
|||
SPU_Emulate_user();
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBAGG
|
||||
T_AGG_RGB555 agg_targetScreen_cli((u8 *)GPU->GetDisplayInfo().masterNativeBuffer, 256, 384, 512);
|
||||
#endif
|
||||
|
||||
int main(int argc, char ** argv) {
|
||||
class configured_features my_config;
|
||||
struct ctrls_event_config ctrls_cfg;
|
||||
|
@ -736,8 +732,11 @@ int main(int argc, char ** argv) {
|
|||
// Now that gtk port draws to RGBA buffer directly, the other one
|
||||
// has to use ugly ways to make HUD rendering work again.
|
||||
// desmume gtk: Sorry desmume-cli :(
|
||||
T_AGG_RGB555 agg_targetScreen_cli((u8 *)GPU->GetDisplayInfo().masterNativeBuffer, 256, 384, 512);
|
||||
aggDraw.hud = &agg_targetScreen_cli;
|
||||
aggDraw.hud->setFont("verdana18_bold");
|
||||
|
||||
osd = new OSDCLASS(-1);
|
||||
#endif
|
||||
|
||||
ctrls_cfg.boost = 0;
|
||||
|
|
|
@ -3114,6 +3114,7 @@ common_gtk_main( class configured_features *my_config)
|
|||
#ifdef HAVE_LIBAGG
|
||||
Desmume_InitOnce();
|
||||
Hud.reset();
|
||||
osd = new OSDCLASS(-1);
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue