Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions kernel/PX_Object_Firework.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ PX_OBJECT_RENDER_FUNCTION(PX_Object_Firework01Render)

PX_Object* PX_Object_Firework01Create(px_memorypool* mp, PX_Object* Parent, px_float x, px_float y)
{
if (!mp) return PX_NULL;

px_int i;
PX_Object_Firework01 desc;
PX_memset(&desc, 0, sizeof(desc));
Expand Down
8 changes: 8 additions & 0 deletions runtime/PainterEngine_Application.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,13 @@ px_bool PainterEngine_Initialize(px_int _screen_width,px_int _screen_height)
App.object_root = PX_ObjectCreateRoot(&runtime->mp_static);
if (!App.object_root)
{
mp = NULL;
return PX_FALSE;
}
App.object_printer=PX_Object_PrinterCreate(&runtime->mp, App.object_root, 0, 0, _screen_width, _screen_height, App.pfontmodule);
if (!App.object_printer)
{
mp = NULL;
return PX_FALSE;
}
PX_Object_PanelAttachObject(App.object_printer, PX_ObjectGetFreeDescIndex(App.object_printer));
Expand Down Expand Up @@ -374,6 +376,12 @@ px_bool PX_ApplicationInitialize(PX_Application *pApp,px_int screen_width,px_int
PainterEngine_SetBackgroundColor(PX_COLOR_BACKGROUNDCOLOR);

px_main();

if (mp == PX_NULL){
printf("PainterEngine_Initialize:Create MemoryPool failed! \n");
printf("The window size must be set larger than 24 * 24! \n");
return PX_FALSE;
}

if (pApp->runtime.window_height&&pApp->runtime.window_width&& pApp->runtime.surface_height&& pApp->runtime.surface_width)
{
Expand Down