#include "firepaint3d.bmx.gui.release.win32.x64.h"
struct BBString_1{BBClass_String* clas;BBULONG hash;int length;BBChar buf[1];};
struct BBString_5{BBClass_String* clas;BBULONG hash;int length;BBChar buf[5];};
struct BBString_19{BBClass_String* clas;BBULONG hash;int length;BBChar buf[19];};
struct BBString_18{BBClass_String* clas;BBULONG hash;int length;BBChar buf[18];};
struct BBString_15{BBClass_String* clas;BBULONG hash;int length;BBChar buf[15];};
static struct BBString_1 _s4={
	&bbStringClass,
	0xa8d4ace0dc8d360e,
	1,
	{32}
};
static struct BBString_5 _s3={
	&bbStringClass,
	0x6f88bee3459d55f4,
	5,
	{70,80,83,58,32}
};
static struct BBString_19 _s0={
	&bbStringClass,
	0xfd0051eb3011ee25,
	19,
	{109,101,100,105,97,47,98,108,105,116,122,108,111,103,111,46,98
	,109,112}
};
static struct BBString_18 _s2={
	&bbStringClass,
	0xa01206078b0a3b,
	18,
	{109,101,100,105,97,47,98,108,117,115,112,97,114,107,46,98,109
	,112}
};
static struct BBString_15 _s1={
	&bbStringClass,
	0x56bc2acc640f102b,
	15,
	{109,101,100,105,97,47,115,116,97,114,115,46,98,109,112}
};
struct BBDebugScope_4{int kind; const char *name; BBDebugDecl decls[5]; };
void __m_firepaint3d_Frag_New(struct _m_firepaint3d_Frag_obj* o) {
	bbObjectCtor((BBOBJECT)o);
	o->clas = &_m_firepaint3d_Frag;
	o->__m_firepaint3d_frag_ys = .00000000f;
	o->__m_firepaint3d_frag_alpha = .00000000f;
	o->__m_firepaint3d_frag_entity = (struct openb3d_openb3dcore_TSprite_obj*)((struct openb3d_openb3dcore_TSprite_obj*)&bbNullObject);
}
struct BBDebugScope_4 _m_firepaint3d_Frag_scope ={
	BBDEBUGSCOPE_USERTYPE,
	"Frag",
	{
		{
			BBDEBUGDECL_FIELD,
			"ys",
			"f",
			.field_offset=offsetof(struct _m_firepaint3d_Frag_obj,__m_firepaint3d_frag_ys)
		},
		{
			BBDEBUGDECL_FIELD,
			"alpha",
			"f",
			.field_offset=offsetof(struct _m_firepaint3d_Frag_obj,__m_firepaint3d_frag_alpha)
		},
		{
			BBDEBUGDECL_FIELD,
			"entity",
			":TSprite",
			.field_offset=offsetof(struct _m_firepaint3d_Frag_obj,__m_firepaint3d_frag_entity)
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"New",
			"()i",
			.func_ptr=(BBFuncPtr)&__m_firepaint3d_Frag_New
		},
		{
			BBDEBUGDECL_END
		}
	}
};
struct BBClass__m_firepaint3d_Frag _m_firepaint3d_Frag={
	&bbObjectClass,
	bbObjectFree,
	(BBDebugScope*)&_m_firepaint3d_Frag_scope,
	sizeof(struct _m_firepaint3d_Frag_obj),
	(void (*)(BBOBJECT))__m_firepaint3d_Frag_New,
	bbObjectDtor,
	bbObjectToString,
	bbObjectCompare,
	bbObjectSendMessage,
	0,
	0,
	offsetof(struct _m_firepaint3d_Frag_obj,__m_firepaint3d_frag_entity) - offsetof(struct _m_firepaint3d_Frag_obj,__m_firepaint3d_frag_ys) + sizeof(struct openb3d_openb3dcore_TSprite_obj*)
	,0
	,offsetof(struct _m_firepaint3d_Frag_obj,__m_firepaint3d_frag_ys)
};

static int _bb_main_inited = 0;
int _bb_main(){
	if (!_bb_main_inited) {
		_bb_main_inited = 1;
		__bb_brl_blitz_blitz();
		__bb_openb3d_b3dglgraphics_b3dglgraphics();
		bbObjectRegisterType((BBCLASS)&_m_firepaint3d_Frag);
		BBINT bbt_width=640;
		BBINT bbt_height=480;
		BBINT bbt_depth=0;
		BBINT bbt_mode=2;
		openb3d_b3dglgraphics_Graphics3D(bbt_width,bbt_height,bbt_depth,bbt_mode,60,-1,0,-1,-1);
		openb3d_openb3dcore_AmbientLight(0.00000000f,0.00000000f,0.00000000f);
		struct brl_linkedlist_TList_obj* bbt_fraglist=(struct brl_linkedlist_TList_obj*)brl_linkedlist_CreateList();
		struct openb3d_openb3dcore_TPivot_obj* bbt_pivot=(struct openb3d_openb3dcore_TPivot_obj*)openb3d_openb3dcore_CreatePivot((struct openb3d_openb3dcore_TEntity_obj*)&bbNullObject);
		struct openb3d_openb3dcore_TCamera_obj* bbt_camera=(struct openb3d_openb3dcore_TCamera_obj*)openb3d_openb3dcore_CreateCamera((struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_pivot,(BBClass*)&openb3d_openb3dcore_TEntity)));
		openb3d_openb3dcore_CameraClsMode((struct openb3d_openb3dcore_TCamera_obj*)bbt_camera,0,1);
		struct openb3d_openb3dcore_TCamera_obj* bbt_camera2=(struct openb3d_openb3dcore_TCamera_obj*)openb3d_openb3dcore_CreateCamera((struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_pivot,(BBClass*)&openb3d_openb3dcore_TEntity)));
		openb3d_openb3dcore_RotateEntity((struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_camera2,(BBClass*)&openb3d_openb3dcore_TEntity)),90.0000000f,0.00000000f,0.00000000f,0);
		openb3d_openb3dcore_CameraViewport((struct openb3d_openb3dcore_TCamera_obj*)bbt_camera2,0,0,100,100);
		struct openb3d_openb3dcore_TMesh_obj* bbt_cursor=(struct openb3d_openb3dcore_TMesh_obj*)openb3d_openb3dcore_CreateSphere(8,(struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_camera,(BBClass*)&openb3d_openb3dcore_TEntity)));
		struct openb3d_openb3dcore_TTexture_obj* bbt_logotex=(struct openb3d_openb3dcore_TTexture_obj*)openb3d_openb3dcore_LoadTexture(((BBString*)&_s0),9,(struct openb3d_openb3dcore_TTexture_obj*)&bbNullObject);
		openb3d_openb3dcore_EntityTexture((struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_cursor,(BBClass*)&openb3d_openb3dcore_TEntity)),(struct openb3d_openb3dcore_TTexture_obj*)bbt_logotex,0,0);
		openb3d_openb3dcore_MoveEntity((struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_cursor,(BBClass*)&openb3d_openb3dcore_TEntity)),0.00000000f,0.00000000f,25.0000000f);
		openb3d_openb3dcore_EntityBlend((struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_cursor,(BBClass*)&openb3d_openb3dcore_TEntity)),3);
		openb3d_openb3dcore_EntityFX((struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_cursor,(BBClass*)&openb3d_openb3dcore_TEntity)),1);
		struct openb3d_openb3dcore_TMesh_obj* bbt_sky=(struct openb3d_openb3dcore_TMesh_obj*)openb3d_openb3dcore_CreateSphere(8,(struct openb3d_openb3dcore_TEntity_obj*)&bbNullObject);
		struct openb3d_openb3dcore_TTexture_obj* bbt_tex=(struct openb3d_openb3dcore_TTexture_obj*)openb3d_openb3dcore_LoadTexture(((BBString*)&_s1),9,(struct openb3d_openb3dcore_TTexture_obj*)&bbNullObject);
		openb3d_openb3dcore_ScaleTexture((struct openb3d_openb3dcore_TTexture_obj*)bbt_tex,.125f,.25f);
		openb3d_openb3dcore_EntityTexture((struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_sky,(BBClass*)&openb3d_openb3dcore_TEntity)),(struct openb3d_openb3dcore_TTexture_obj*)bbt_tex,0,0);
		openb3d_openb3dcore_ScaleEntity((struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_sky,(BBClass*)&openb3d_openb3dcore_TEntity)),500.000000f,500.000000f,500.000000f,0);
		openb3d_openb3dcore_EntityFX((struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_sky,(BBClass*)&openb3d_openb3dcore_TEntity)),1);
		openb3d_openb3dcore_FlipMesh((struct openb3d_openb3dcore_TMesh_obj*)bbt_sky);
		struct openb3d_openb3dcore_TSprite_obj* bbt_spark=(struct openb3d_openb3dcore_TSprite_obj*)openb3d_openb3dcore_LoadSprite(((BBString*)&_s2),1,(struct openb3d_openb3dcore_TEntity_obj*)&bbNullObject);
		BBINT bbt_old_ms=bbMilliSecs();
		BBINT bbt_renders=0;
		BBINT bbt_fps=0;
		BBINT bbt_time=bbMilliSecs();
		BBINT bbt_num=0;
		brl_system_MoveMouse(0,0);
		while(!(brl_polledinput_KeyDown(27)!=0)){
			BBINT bbt_elapsed=(bbMilliSecs()-bbt_time);
			bbt_time=(bbt_time+bbt_elapsed);
			BBFLOAT bbt_dt=((((BBFLOAT)bbt_elapsed)*60.0f)/1000.0f);
			BBFLOAT bbt_x_speed=.00000000f;
			BBFLOAT bbt_y_speed=.00000000f;
			bbt_x_speed=(((((BBFLOAT)(brl_polledinput_MouseX()-320))-bbt_x_speed)/4.00000000f)+bbt_x_speed);
			bbt_y_speed=(((((BBFLOAT)(brl_polledinput_MouseY()-240))-bbt_y_speed)/4.00000000f)+bbt_y_speed);
			brl_system_MoveMouse(320,240);
			openb3d_openb3dcore_TurnEntity((struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_pivot,(BBClass*)&openb3d_openb3dcore_TEntity)),0.00000000f,-bbt_x_speed,0.00000000f,0);
			openb3d_openb3dcore_TurnEntity((struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_camera,(BBClass*)&openb3d_openb3dcore_TEntity)),-bbt_y_speed,0.00000000f,0.00000000f,0);
			openb3d_openb3dcore_TurnEntity((struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_cursor,(BBClass*)&openb3d_openb3dcore_TEntity)),0.00000000f,(bbt_dt*5.00000000f),0.00000000f,0);
			if(brl_polledinput_MouseDown(1)!=0){
				{
					BBINT bbt_t=1;
					for(;(bbt_t<=9);bbt_t=(bbt_t+1)){
						struct _m_firepaint3d_Frag_obj* bbt_f=(struct _m_firepaint3d_Frag_obj*)(struct _m_firepaint3d_Frag_obj*)bbObjectNew((BBClass *)&_m_firepaint3d_Frag);
						bbt_f->__m_firepaint3d_frag_ys =0.00000000f;
						bbt_f->__m_firepaint3d_frag_alpha =((BBFLOAT)random_core_Rnd(2.0000000000000000,3.0000000000000000));
						bbt_f->__m_firepaint3d_frag_entity =(struct openb3d_openb3dcore_TSprite_obj*)(bbt_spark)->clas->m_CopyEntity_TTEntity((struct openb3d_openb3dcore_TSprite_obj*)bbt_spark,(struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_cursor,(BBClass*)&openb3d_openb3dcore_TEntity)));
						openb3d_openb3dcore_SpriteRenderMode((struct openb3d_openb3dcore_TSprite_obj*)bbt_f->__m_firepaint3d_frag_entity ,2);
						openb3d_openb3dcore_SpriteViewMode((struct openb3d_openb3dcore_TSprite_obj*)bbt_f->__m_firepaint3d_frag_entity ,1);
						openb3d_openb3dcore_ShowEntity((struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_f->__m_firepaint3d_frag_entity ,(BBClass*)&openb3d_openb3dcore_TEntity)));
						openb3d_openb3dcore_EntityColor((struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_f->__m_firepaint3d_frag_entity ,(BBClass*)&openb3d_openb3dcore_TEntity)),((BBFLOAT)random_core_Rnd(255.00000000000000,0.0000000000000000)),((BBFLOAT)random_core_Rnd(255.00000000000000,0.0000000000000000)),((BBFLOAT)random_core_Rnd(255.00000000000000,0.0000000000000000)),1);
						openb3d_openb3dcore_EntityParent((struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_f->__m_firepaint3d_frag_entity ,(BBClass*)&openb3d_openb3dcore_TEntity)),(struct openb3d_openb3dcore_TEntity_obj*)&bbNullObject,1);
						openb3d_openb3dcore_RotateEntity((struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_f->__m_firepaint3d_frag_entity ,(BBClass*)&openb3d_openb3dcore_TEntity)),((BBFLOAT)random_core_Rnd(360.00000000000000,0.0000000000000000)),((BBFLOAT)random_core_Rnd(360.00000000000000,0.0000000000000000)),((BBFLOAT)random_core_Rnd(360.00000000000000,0.0000000000000000)),0);
						bbt_num=(bbt_num+1);
						brl_linkedlist_ListAddLast((struct brl_linkedlist_TList_obj*)bbt_fraglist,(BBOBJECT)bbt_f);
					}
				}
			}
			BBINT bbt_n_parts=0;
			BBINT bbt_n_surfs=0;
			struct brl_linkedlist_TListEnum_obj* bbt_=(struct brl_linkedlist_TListEnum_obj*)(bbt_fraglist)->clas->m_ObjectEnumerator((struct brl_linkedlist_TList_obj*)bbt_fraglist);
			while((bbt_)->clas->m_HasNext((struct brl_linkedlist_TListEnum_obj*)bbt_)!=0){
				struct _m_firepaint3d_Frag_obj* bbt_f2=(struct _m_firepaint3d_Frag_obj*)((struct _m_firepaint3d_Frag_obj*)bbObjectDowncast((BBOBJECT)(bbt_)->clas->m_NextObject((struct brl_linkedlist_TListEnum_obj*)bbt_),(BBClass*)&_m_firepaint3d_Frag));
				if(((BBOBJECT)bbt_f2)==&bbNullObject){
					continue;
				}
				bbt_f2->__m_firepaint3d_frag_alpha =(bbt_f2->__m_firepaint3d_frag_alpha -(bbt_dt*.01f));
				if(bbt_f2->__m_firepaint3d_frag_alpha >0.00000000f){
					BBFLOAT bbt_al=bbt_f2->__m_firepaint3d_frag_alpha ;
					if(bbt_al>1.00000000f){
						bbt_al=1.00000000f;
					}
					openb3d_openb3dcore_EntityAlpha((struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_f2->__m_firepaint3d_frag_entity ,(BBClass*)&openb3d_openb3dcore_TEntity)),bbt_al);
					openb3d_openb3dcore_MoveEntity((struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_f2->__m_firepaint3d_frag_entity ,(BBClass*)&openb3d_openb3dcore_TEntity)),0.00000000f,0.00000000f,(bbt_dt*.4f));
					BBFLOAT bbt_ys=(bbt_f2->__m_firepaint3d_frag_ys +(-0.02f*bbt_dt));
					BBFLOAT bbt_dy=(bbt_f2->__m_firepaint3d_frag_ys *bbt_dt);
					bbt_f2->__m_firepaint3d_frag_ys =bbt_ys;
					openb3d_openb3dcore_TranslateEntity((struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_f2->__m_firepaint3d_frag_entity ,(BBClass*)&openb3d_openb3dcore_TEntity)),0.00000000f,bbt_dy,0.00000000f,0);
				}else{
					openb3d_openb3dcore_FreeEntity((struct openb3d_openb3dcore_TEntity_obj*)((struct openb3d_openb3dcore_TEntity_obj*)bbObjectDowncast((BBOBJECT)bbt_f2->__m_firepaint3d_frag_entity ,(BBClass*)&openb3d_openb3dcore_TEntity)));
					brl_linkedlist_ListRemove((struct brl_linkedlist_TList_obj*)bbt_fraglist,(BBOBJECT)bbt_f2);
					bbt_num=(bbt_num-1);
				}
			}
			openb3d_openb3dcore_UpdateWorld(1.00000000f);
			openb3d_openb3dcore_RenderWorld();
			bbt_renders=(bbt_renders+1);
			if((bbMilliSecs()-bbt_old_ms)>=1000){
				bbt_old_ms=bbMilliSecs();
				bbt_fps=bbt_renders;
				bbt_renders=0;
			}
			openb3d_b3dglgraphics_Text(0,20,bbStringConcat(bbStringConcat(bbStringConcat(((BBString*)&_s3),bbStringFromInt(bbt_fps)),((BBString*)&_s4)),bbStringFromInt(bbt_num)));
			brl_graphics_Flip(-1);
		}
		bbEnd();
		return 0;
	}
	return 0;
}