Пример #1
0
Файл: ge.c Проект: drewet/libge
void ge_Splashscreen(){
#ifndef LIBGE_MINI
	if(!_ge_splashscreen_enabled)return;
	u32 ticks = geGetTick();
	u32 time = 0;
	ge_Image* splash = geLoadImage(geFileFromBuffer(ge_splash_screen, sizeof(ge_splash_screen)));
	int h = (splash->height > libge_context->height) ? libge_context->height : splash->height;
	int w = h * splash->width / splash->height;
	geDrawingMode(GE_DRAWING_MODE_2D);
	while(time < 3000){
		time = geGetTick() - ticks;
		if(time < 800){
			splash->color = RGBA(255, 255, 255, (u8)(time * 255 / 800));
		}else
		if(time < 2200){
			splash->color = RGBA(255, 255, 255, 255);
		}else
		if(time < 3000){
			splash->color = RGBA(255, 255, 255, (u8)((1000-(time-3000)) * 255 / 1000));
		}
		geClearScreen();
		geBlitImageStretched(libge_context->width/2, libge_context->height/2, splash, 0, 0, splash->width, splash->height, w, h, GE_BLIT_CENTERED);
		geSwapBuffers();
	}
	geFreeImage(splash);
#endif
}
Пример #2
0
void geDrawImageStretched(int x, int y, ge_Image* img, int width, int height){
	if(!img)return;
	geBlitImageStretched(x, y, img, 0, 0, img->width, img->height, width, height, 0);
}