int main( int argc, char **argv ) { int i; SetSystemLog( SYSLOG_FILE, stdout ); g.pdi = GetDisplayInterface(); g.pii = GetImageInterface(); g.x = 10; g.y = 10; for( i = 1; i < argc; i++ ) { AddImage( argv[i] ); } while( !g.flags.exit ) Relinquish(); // hmm what do we have to do here? { PIMAGE_DISPLAY pdi; pdi = g.images; while( pdi ) { CloseDisplay( pdi->display ); UnmakeImageFile( pdi->Loaded ); pdi = pdi->next; } } return 0; }
RAGDOLL_NAMESPACE PRELOAD( InitLocal ) { l.pri = GetDisplayInterface(); l.pii = GetImageInterface(); }
static void InitBannerFrame( void ) { if( !banner_local.flags.bInited ) { TEXTCHAR font[256]; InvokeDeadstart(); // register my control please... (f*****g optimizations) banner_local.pii = GetImageInterface(); banner_local.pdi = GetDisplayInterface(); banner_local.flags.bFullDraw = RequiresDrawAll(); GetDisplaySizeEx( 0, NULL, NULL, &banner_local.w, &banner_local.h ); #ifndef __NO_OPTIONS__ SACK_GetProfileStringEx( WIDE( "SACK/Widgets/Banner2" ), WIDE( "Default Font" ), WIDE( "arialbd.ttf" ), font, sizeof( font ), TRUE ); #else StrCpy( font, WIDE( "arialbd.ttf" ) ); #endif banner_local.font = RenderFontFile( font , banner_local.w / 30, ( ( banner_local.w * 1080 ) / 1920 ) / 20 , 2 ); if( !banner_local.font ) { #ifndef __NO_OPTIONS__ SACK_GetProfileStringEx( WIDE( "SACK/Widgets/Banner2" ), WIDE( "Alternate Font" ), WIDE( "fonts/arialbd.ttf" ), font, sizeof( font ), TRUE ); #else StrCpy( font, WIDE( "fonts/arialbd.ttf" ) ); #endif banner_local.font = RenderFontFile( font , banner_local.w / 30, ( ( banner_local.w * 1080 ) / 1920 ) / 20 , 2 ); } banner_local.explorer_font = RenderFontFile( font , banner_local.w / 60, ( ( banner_local.w * 1080 ) / 1920 ) / 40 , 2 ); banner_local.flags.bInited = TRUE; } }
int main( void ) { int32_t x, y; uint32_t w, h; PRENDERER renderer; l.pii = GetImageInterface(); l.pri = GetDisplayInterface(); SetSystemLog( SYSLOG_FILE, stdout ); GetDisplaySizeEx( 0, &x, &y, &w, &h ); renderer = OpenDisplaySizedAt( 0, w, h, x, y ); SetTouchHandler( renderer, touch_events, 0 ); UpdateDisplay( renderer ); while( 1 ) { WakeableSleep( 1000 ); } #if 0 HOOKPROC hkprcSysMsg; static HINSTANCE hinstDLL; static HHOOK hhookSysMsg; hinstDLL = LoadLibrary(TEXT("c:\\myapp\\sysmsg.dll")); hkprcSysMsg = (HOOKPROC)GetProcAddress(hinstDLL, "SysMessageProc"); hhookSysMsg = SetWindowsHookEx( WH_SYSMSGFILTER, hkprcSysMsg, hinstDLL, 0); SetWindowsHookEx( #endif return 0; }
SaneWinMain(argc, argv ) //int main( int argc, char **argv ) { int x = 0; int y = 0; uint32_t width, height; int w, h; g.pdi = GetDisplayInterface(); g.pii = GetImageInterface(); RegisterIcon( NULL ); GetDisplaySize( &width, &height ); w = width; h = height; y = x = 0; { int state = 0; int arg; g.fade_in = 500; g.show_time = 1000; for( arg = 1; arg < argc; arg++ ) { if( argv[arg][0] == '-' ) { if( argv[arg][1] == 'i' ) { g.flags.bShowInverted = 1; } else { switch( state ) { case 0: x = atoi( argv[arg]+1 ); break; case 1: y = atoi( argv[arg]+1 ); break; case 2: w = atoi( argv[arg]+1 ); break; case 3: h = atoi( argv[arg]+1 ); break; case 4: g.show_time = atoi( argv[arg]+1 ); break; case 5: g.fade_in = atoi( argv[arg]+1 ); break; } state++; } } else { Image x = LoadImageFile( argv[arg] ); if( x ) { g.nImages++; AddLink( &g.images, x ); } } } } if( g.nImages ) { g.displays[0] = OpenDisplaySizedAt( DISPLAY_ATTRIBUTE_LAYERED|DISPLAY_ATTRIBUTE_CHILD|DISPLAY_ATTRIBUTE_NO_MOUSE|DISPLAY_ATTRIBUTE_NO_AUTO_FOCUS , w //width , h //height , x //0 , y //0 ); g.displays[1] = OpenDisplaySizedAt( DISPLAY_ATTRIBUTE_LAYERED|DISPLAY_ATTRIBUTE_CHILD|DISPLAY_ATTRIBUTE_NO_MOUSE|DISPLAY_ATTRIBUTE_NO_AUTO_FOCUS , w //width , h //height , x //0 , y //0 ); SetRedrawHandler( g.displays[0], Output, 0 ); SetRedrawHandler( g.displays[1], Output, 1 ); if( g.nImages > 1 ) { target_in_start = GetTickCount(); AddTimer( 33, tick, 0 ); } else { //lprintf( "Show the first and only the first image." ); g.is_up[0] = 1; RestoreDisplay( g.displays[0] ); UpdateDisplay( g.displays[0] ); } while( 1 ) WakeableSleep( 10000 ); } else { } return 0; }
_bullet->dispatcher = new btCollisionDispatcher(_bullet->collisionConfiguration); _bullet->solver = new btSequentialImpulseConstraintSolver; _bullet->dynamicsWorld = new btDiscreteDynamicsWorld(_bullet->dispatcher,_bullet->broadphase,_bullet->solver,_bullet->collisionConfiguration); _bullet->dynamicsWorld->setGravity(btVector3(0,-900,0)); } PRIORITY_PRELOAD( InitLocal, DEFAULT_PRELOAD_PRIORITY - 1 ) { l.pri = GetDisplayInterface(); l.pii = GetImageInterface(); SetupBullet( &l.bullet ); //l.debug_drawer = new GLDebugDrawer(); //l.bullet.dynamicsWorld->setDebugDrawer( l.debug_drawer ); //l.debug_drawer->setDebugMode( btIDebugDraw::DBG_DrawWireframe ); l.time_scale = 100.0; } RAGDOLL_NAMESPACE_END
int main( void ) { uint32_t width, height; uint32_t imagecount = 0; uint32_t testimagesatinitialization = 0; Image blank; srand( time( NULL ) ); for(width=0; width< NUM_REELS; width++) { g.uiSpeedCounter[width] = 0; g.uiSpeedStep[width] = 2; g.idx[width]= 0; } g.pdi = GetDisplayInterface(); g.pii = GetImageInterface(); //SetSystemLog( SYSLOG_FILE, stdout ); SetSystemLoggingLevel( 1000 + LOG_NOISE); GetDisplaySize( &width, &height );; g.render = OpenDisplaySizedAt( 0, width, height, 0, 0 ); UpdateDisplay(g.render); g.surface = GetDisplayImage( g.render ); SetMouseHandler( g.render, MouseMethod, 0 ); // blank = LoadImageFile( WIDE("blankimage.jpg")); blank = MakeImageFile(96,96); ClearImageTo( blank, BASE_COLOR_CYAN ); g.playagain=LoadImageFile( WIDE("%images%/playagain.jpg")); g.playing =LoadImageFile( WIDE("%images%/playing.jpg")); g.background = LoadImageFile( WIDE("%images%/background.jpg") ); // g.background = blank; g.strip = LoadImageFile( WIDE("%images%/slot_strip.jpg") ); g.nReels = NUM_REELS; { Image icons[NUM_ICONS]; int n, m; INDEX idx; for( n = 0; n < NUM_ICONS; n++ ) { icons[n] = MakeSubImage( g.strip, 96 * n, 0, 96, 96 ); } n = width = imagecount = height = 0; while(imagecount < NUM_IMAGES ) { idx = rand()%NUM_ICONS; g.images[imagecount] = icons[idx]; if( testimagesatinitialization ) { BlotImage( g.surface, g.images[imagecount], width * 96, height * 96 ); width++; if(!( width % 8 )) { width=0; height++; } } imagecount++; for( m = 0; m < (( rand()%2 ) ); m++) { g.images[imagecount] = blank; if( testimagesatinitialization ) { BlotImage( g.surface, g.images[imagecount], width * 96, height * 96 ); width++; if(!( width % 8 )) { width=0; height++; } } imagecount++; } if( testimagesatinitialization ) { SyncRender( g.render); UpdateDisplay(g.render); } } if( !testimagesatinitialization ) { SyncRender( g.render); UpdateDisplay(g.render); } for( n = 0; n < NUM_BLURS; n++ ) { g.blurs[n] = MakeImageFile( 96, (NUM_PICS) * 96 ); g.dodges[n] = MakeImageFile( 96, (NUM_PICS) * 96 ); for( m = 0; m < NUM_IMAGES; m++ ) { idx = rand()%NUM_IMAGES; g.reel[0][m] = g.images[idx]; } Blur( g.blurs[n], g.reel[0] ); DodgeEx( g.dodges[n], g.reel[0] , 2); } for( n = 0; n < NUM_REELS; n++) { g.subsurface[n] = MakeSubImage( g.surface , REEL_OFSX + REEL_STEPX * n , REEL_OFSY , REEL_WIDTH, (96 * NUM_PICS_IN_WINDOW) ); g.testsurface[n] = MakeSubImage( g.surface, REEL_OFSX + REEL_STEPX * n + 480, REEL_OFSY , REEL_WIDTH, (96 * NUM_PICS) ); } g.statussurface = MakeSubImage( g.surface , 490, 10 , 140, 68 ); g.backgroundsurface = MakeSubImage( g.surface , 0, 0 , 640, 460 ); } g.flags.bBackgroundInitialized = 0; ThreadTo( ReadInput, 0 ); { uint32_t start = GetTickCount(); xlprintf(LOG_NOISE)("Started at %lu" , start); g.ofs = 0; while( 1 ) { if( g.flags.bSpinning ) { DrawSpinningReels(FALSE); } #ifndef __ARM__ // scale to approx unit speeds.. WakeableSleep( 250 ); //WakeableSleep( 33); #endif } } CloseDisplay( g.render ); UnmakeImageFile( g.strip ); return 0; }