您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ Blit函数代码示例

51自学网 2021-06-01 19:55:12
  C++
这篇教程C++ Blit函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中Blit函数的典型用法代码示例。如果您正苦于以下问题:C++ Blit函数的具体用法?C++ Blit怎么用?C++ Blit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了Blit函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: while

void TEXTEDITBOX::GetInput(char Stringx[100]){	MSG Msg;	//save the original programflow variable to change it back later.	int ProgramFlowTemp=Pass.ProgramFlow;	Pass.ProgramFlow=PF_TEXTEDITBOX;	Info=TEBI_NOTHING;	//display the text box on the screen.	//message loop	while(Info!=TEBI_DONE){		UpdateBox();		if(!GetMessage(&Msg, NULL, 0, 0)){   			//if they're trying to quit...			Pass.SettingsInfo=SETTINGS_EXIT;			Pass.ProgramFlow=PF_EXIT;			Info=TEBI_DONE;		}		TranslateMessage(&Msg);		DispatchMessage(&Msg);	}		if(Pass.ProgramFlow!=PF_EXIT) Pass.ProgramFlow=ProgramFlowTemp;	//now put the screen back together again.	Blit(Pass.DDFront, StorageSurface, 0, 0, TEXTENTRYBOX_WIDTH, TEXTENTRYBOX_HEIGHT,						TEXTENTRYBOX_LEFT, TEXTENTRYBOX_TOP);	Blit(Pass.DDBack, StorageSurface, 0, 0, TEXTENTRYBOX_WIDTH, TEXTENTRYBOX_HEIGHT,                         TEXTENTRYBOX_LEFT, TEXTENTRYBOX_TOP);	lstrcpy(Stringx, String);}
开发者ID:thenfour,项目名称:Archives,代码行数:28,


示例2: DrawObjectiveInfo

static void DrawObjectiveInfo(	const struct MissionOptions *mo, const int idx, const Vec2i pos){	const MissionObjective *mobj =		CArrayGet(&mo->missionData->Objectives, idx);	const ObjectiveDef *o = CArrayGet(&mo->Objectives, idx);	const CharacterStore *store = &gCampaign.Setting.characters;	switch (mobj->Type)	{	case OBJECTIVE_KILL:		{			const Character *cd = CArrayGet(				&store->OtherChars, CharacterStoreGetSpecialId(store, 0));			const int i = cd->looks.face;			TOffsetPic pic;			pic.picIndex = cHeadPic[i][DIRECTION_DOWN][STATE_IDLE];			pic.dx = cHeadOffset[i][DIRECTION_DOWN].dx;			pic.dy = cHeadOffset[i][DIRECTION_DOWN].dy;			DrawTTPic(				pos.x + pic.dx, pos.y + pic.dy,				PicManagerGetOldPic(&gPicManager, pic.picIndex), &cd->table);		}		break;	case OBJECTIVE_RESCUE:		{			const Character *cd = CArrayGet(				&store->OtherChars, CharacterStoreGetPrisonerId(store, 0));			const int i = cd->looks.face;			TOffsetPic pic;			pic.picIndex = cHeadPic[i][DIRECTION_DOWN][STATE_IDLE];			pic.dx = cHeadOffset[i][DIRECTION_DOWN].dx;			pic.dy = cHeadOffset[i][DIRECTION_DOWN].dy;			DrawTTPic(				pos.x + pic.dx, pos.y + pic.dy,				PicManagerGetOldPic(&gPicManager, pic.picIndex), &cd->table);		}		break;	case OBJECTIVE_COLLECT:		{			const Pic *p = o->pickupClass->Pic;			Blit(&gGraphicsDevice, p, Vec2iAdd(pos, p->offset));		}		break;	case OBJECTIVE_DESTROY:		{			Vec2i picOffset;			const Pic *p =				MapObjectGetPic(IntMapObject(mobj->Index), &picOffset, false);			Blit(&gGraphicsDevice, p, Vec2iAdd(pos, picOffset));		}		break;	case OBJECTIVE_INVESTIGATE:		// Don't draw		return;	default:		CASSERT(false, "Unknown objective type");		return;	}}
开发者ID:Gokulakrishnansr,项目名称:cdogs-sdl,代码行数:60,


示例3: CreditsProc

int CreditsProc(PASSPROCVARS Params){	int r=0;	r+=ccbOK.ProcFunction(Params);	if(r){		//we have to flip the screen		Flip(Pass.DDFront);		Blit(Pass.DDBack, ddsCredits, 0, 0, 640, 480, 0, 0);	}//now handle some messages	switch(Params.uMsg){	case WM_CLOSE:		Pass.ProgramFlow=PF_EXIT;		CreditsInfo=CREDITS_EXIT;		break;	case WM_PAINT:		ddsCredits->Restore();		ddsCreditsh->Restore();		DDReLoadBitmap(ddsCredits,BMP_CREDITS);		DDReLoadBitmap(ddsCreditsh,BMP_CREDITSH);		Blit(Pass.DDFront, ddsCredits, 0, 0, 640, 480, 0, 0);		Blit(Pass.DDBack, ddsCredits, 0, 0, 640, 480, 0, 0);		break;	case WM_KEYDOWN:   	switch(Params.wParam){      	case VK_ESCAPE:         	CreditsInfo=CREDITS_EXIT;         break;      }	break;	}	return 0;}
开发者ID:thenfour,项目名称:Archives,代码行数:32,


示例4: settingsRedrawScreen

void settingsRedrawScreen(){	ScreenHighlighted->Restore();	ScreenUnhighlighted->Restore();	DDReLoadBitmap(ScreenHighlighted,BMP_SETTINGSH);	DDReLoadBitmap(ScreenUnhighlighted,BMP_SETTINGS);	DrawString("Setting up alpha table/@", 0, 0, 8);	Blit(Pass.DDFront, ScreenUnhighlighted, 0, 0, 640, 480, 0, 0);	Blit(Pass.DDBack, ScreenUnhighlighted, 0, 0, 640, 480, 0, 0);}
开发者ID:thenfour,项目名称:Archives,代码行数:9,


示例5: image

void dd_Window::activate(){	image *tempimg = new image(xres,yres);	Blit(0,0,img,tempimg);	if(bActive)		return;	bActive = true;	set_win(xres,yres,vid_bpp);	Blit(0,0,tempimg,img);	if(bVisible)		ShowWindow(hwnd,SW_SHOWNA);}
开发者ID:Bananattack,项目名称:verge3,代码行数:12,


示例6: Mouvement_depart

void Mouvement_depart(SDL_Surface *ecran, int *a){    Blit(ecran, TAILLE_X/8*7-TAILLE_CARRE,TAILLE_Y/8-TAILLE_CARRE,TAILLE_CARRE*2,TAILLE_CARRE*2,255,0,255);    Blit(ecran, TAILLE_X/8*7-TAILLE_CARRE,TAILLE_Y/8*7-TAILLE_CARRE,TAILLE_CARRE*2,TAILLE_CARRE*2,255,0,255);    if(a[1]<=TAILLE_Y/8+TAILLE_CARRE) a[3]= 6;    else if(a[1]>=TAILLE_Y/8*7-TAILLE_CARRE*2) a[3]= -6;    a[1] += a[3];    Blit(ecran,a[0],a[1],TAILLE_CARRE,TAILLE_CARRE,255,0,0);}
开发者ID:mniank,项目名称:c-stuff,代码行数:13,


示例7: calcBlitsInt

static BlitVec calcBlitsInt(ColumnVec &srcCols, ColumnVec &dstCols){	BlitVec blits;	/* Using signed indices here is safer, as we	 * might decrement dstI while it is zero. */	int dstI = 0;	for (size_t srcI = 0; srcI < srcCols.size(); ++srcI)	{		Column &srcCol = srcCols[srcI];		for (; dstI < (int) dstCols.size() && srcCol.h > 0; ++dstI)		{			Column &dstCol = dstCols[dstI];			if (srcCol.h > dstCol.h)			{				/* srcCol doesn't fully fit into dstCol */				blits.push_back(Blit(srcCol.x, srcCol.y,				                     dstCol.x, dstCol.y, dstCol.h));				srcCol.y += dstCol.h;				srcCol.h -= dstCol.h;			}			else if (srcCol.h < dstCol.h)			{				/* srcCol fits into dstCol with space remaining */				blits.push_back(Blit(srcCol.x, srcCol.y,				                     dstCol.x, dstCol.y, srcCol.h));				dstCol.y += srcCol.h;				dstCol.h -= srcCol.h;				/* Queue this column up again for processing */				--dstI;				srcCol.h = 0;			}			else			{				/* srcCol fits perfectly into dstCol */				blits.push_back(Blit(srcCol.x, srcCol.y,				                     dstCol.x, dstCol.y, dstCol.h));			}		}	}	return blits;}
开发者ID:Lobomon,项目名称:mkxp,代码行数:50,


示例8: Blit

////////////////////////////////////////////////////////////// Stretch blit///////////////////////////////////////////////////////////void Bitmap::StretchBlit(Rect dst_rect, Bitmap* src_bitmap, Rect src_rect, int opacity) {	if (src_rect.width == dst_rect.width && src_rect.height == dst_rect.height) {		Blit(dst_rect.x, dst_rect.y, src_bitmap, src_rect, opacity);	} else {		src_rect.Adjust(src_bitmap->GetWidth(), src_bitmap->GetHeight());		if (src_rect.IsOutOfBounds(src_bitmap->GetWidth(), src_bitmap->GetHeight())) return;		Bitmap* resampled = src_bitmap->Resample(dst_rect.width, dst_rect.height, src_rect);		Rect rect(0, 0, dst_rect.width, dst_rect.height);		Blit(dst_rect.x, dst_rect.y, resampled, rect, opacity);		delete resampled;	}	Changed();}
开发者ID:cstrahan,项目名称:argss,代码行数:18,


示例9: GetExtent

void Image::Resize(const Extent3D& extent, const ColorRGBAd& fillColor, const Offset3D& offset){    if (extent != GetExtent())    {        /* Store ownership of current image buffer in temporary image */        Image prevImage;        prevImage.extent_   = GetExtent();        prevImage.format_   = GetFormat();        prevImage.dataType_ = GetDataType();        prevImage.data_     = std::move(data_);        if ( extent.width  > GetExtent().width  ||             extent.height > GetExtent().height ||             extent.depth  > GetExtent().depth )        {            /* Resize image buffer with fill color */            extent_ = extent;            data_   = GenerateImageBuffer(GetFormat(), GetDataType(), GetNumPixels(), fillColor);        }        else        {            /* Resize image buffer with uninitialized image buffer */            extent_ = extent;            data_   = GenerateEmptyByteBuffer(GetDataSize(), false);        }        /* Copy previous image into new image */        Blit(offset, prevImage, { 0, 0, 0 }, prevImage.GetExtent());    }}
开发者ID:LukasBanana,项目名称:LLGL,代码行数:31,


示例10: Surface

void VideoSystem::DrawRectAlpha(SDL_Rect *r, Uint32 color) {#if 0    SDL_Surface *surf = Surface(r->w, r->h, screen->format->BitsPerPixel);    if (!surf)        return;    for (int y=0;y<surf->h;y++) {        Uint16 *src = (Uint16*)(screen->pixels + ((r->y+y)*screen->pitch) + (r->x*2));        Uint16 *dst = (Uint16*)(surf->pixels + (y*surf->pitch));        for (int x=0;x<surf->w;x++) {            Uint8 r1, g1, b1;            Uint8 r2, g2, b2;            int r3, g3, b3;            Uint16 px;            SDL_GetRGB(*src, screen->format, &r1, &g1, &b1);            SDL_GetRGB(color, surf->format, &r2, &g2, &b2);            r3 = std::min(255, ((r1*256)/256 + (r2*256)/256));            g3 = std::min(255, ((g1*256)/256 + (g2*256)/256));            b3 = std::min(255, ((b1*256)/256 + (b2*256)/256));            px = SDL_MapRGB(surf->format, r3, g3, b3);            *dst = px;            src++;        }    }    Blit(surf, NULL, r);    SDL_FreeSurface(surf);#endif}
开发者ID:thuskey,项目名称:sidescroller,代码行数:28,


示例11: Fastclic

int Fastclic(SDL_Surface *ecran){    int score=0;    int combo=0;    int temps=SDL_GetTicks();    int carre_x[20]={-1}, carre_y[20]={-1}, carre_t[20]={-1}, carre_c[20]={255};    while(Genere_carre(ecran,carre_x,carre_y,carre_t,carre_c) && !Situation.exit)    {        SDL_Flip(ecran);        Blit(ecran,0,0,TAILLE_X,TAILLE_Y,0,0,0);        Changer_situation();        switch(Gerer_clic(carre_x, carre_y, carre_t))        {            case 1: combo+=N; score += combo; break;            case -1: combo=0; break;            case 0: break;        }        if(combo >= 5*N*(N+2)) N++;        Affichage_score2(ecran,score*100,TAILLE_X-67,TAILLE_Y-15);        temps=SDL_GetTicks()-temps;        if(temps<15) SDL_Delay(15- temps);        temps=SDL_GetTicks();    }    return score*100;}
开发者ID:mniank,项目名称:c-stuff,代码行数:29,


示例12: Blit

void PixmanBitmap::FlipBlit(int x, int y, Bitmap* _src, Rect src_rect, bool horizontal, bool vertical) {	if (!horizontal && !vertical) {		Blit(x, y, _src, src_rect, 255);		return;	}	PixmanBitmap* src = (PixmanBitmap*) _src;	pixman_transform_t xform;	pixman_transform_init_scale(&xform,								pixman_int_to_fixed(horizontal ? -1 : 1),								pixman_int_to_fixed(vertical ? -1 : 1));	pixman_transform_translate((pixman_transform_t*) NULL, &xform,							   pixman_int_to_fixed(horizontal ? src_rect.width : 0),							   pixman_int_to_fixed(vertical ? src_rect.height : 0));	pixman_image_set_transform(bitmap, &xform);	pixman_image_composite32(PIXMAN_OP_SRC,							 src->bitmap, (pixman_image_t*) NULL, bitmap,							 src_rect.x, src_rect.y,							 0, 0,							 x, y,							 src_rect.width, src_rect.height);	pixman_transform_init_identity(&xform);	pixman_image_set_transform(bitmap, &xform);	RefreshCallback();}
开发者ID:take-cheeze,项目名称:EasyRPG,代码行数:31,


示例13: SettingsWindowProc

int SettingsWindowProc(PASSPROCVARS Params){	int r=0;	r+=cbHighScores.ProcFunction(Params);	r+=cbPlay.ProcFunction(Params);	r+=cbExit.ProcFunction(Params);	r+=cbOptions.ProcFunction(Params);	r+=cbCredits.ProcFunction(Params);	if(r){//DrawString("Setting up alpha table/@", 0, 10, 8);//DrawString("Setting up alpha table/@", 0, 20, 12);//DrawString("Setting up alpha table/@", 0, 35, 13);//DrawString("Setting up alpha table/@", 0, 50, 21);		Flip(Pass.DDFront);		Blit(Pass.DDBack, ScreenUnhighlighted, 0,0,640,480,0,0);	}	switch(Params.uMsg){	case WM_PAINT:		settingsRedrawScreen();		break;	case WM_CLOSE:		Pass.SettingsInfo=SETTINGS_EXIT;		Pass.ProgramFlow=PF_EXIT;		break;	}return 0;}
开发者ID:thenfour,项目名称:Archives,代码行数:28,


示例14: DrawEndGame

int DrawEndGame(void *pCtx, state *ptr) {	attron(A_BOLD | A_BLINK);	mvprintw(14, 9, "GAME OVER");	attroff(A_BOLD | A_BLINK);	Blit(pCtx);	return 0;}
开发者ID:snehaltiwari10,项目名称:pacman_project,代码行数:7,


示例15: OBJECT_TO_JSVAL

intStage::DrawScreen(int h) {	jsval rval;	int x, y, ytimesw;	if (SDL_MUSTLOCK(screen)) {		if (SDL_LockSurface(screen) < 0) {			return 0;		}	}	jsval argv[5];	argv[0] = OBJECT_TO_JSVAL(screenArrayBuffer);	argv[1] = INT_TO_JSVAL(WIDTH);	argv[2] = INT_TO_JSVAL(HEIGHT);	argv[3] = INT_TO_JSVAL(screen->pitch);	argv[4] = INT_TO_JSVAL(BPP);	JSBool ok = JS_CallFunctionName(cx, global, "paint", 5, argv, &rval);	Blit((char *)screen->pixels, screenBuffer, screenBufferSize);	if (SDL_MUSTLOCK(screen))		SDL_UnlockSurface(screen);	SDL_Flip(screen);}
开发者ID:EgoIncarnate,项目名称:Broadway264,代码行数:27,


示例16: find_format

PixmanBitmap::PixmanBitmap(Bitmap* source, Rect src_rect, bool transparent) {	format = (transparent ? pixel_format : opaque_pixel_format);	pixman_format = find_format(format);	Init(src_rect.width, src_rect.height, (void *) NULL);	Blit(0, 0, source, src_rect, 255);}
开发者ID:take-cheeze,项目名称:EasyRPG,代码行数:8,


示例17: Init

void SoftBitmap::ConvertImage(int& width, int& height, void*& pixels, bool transparent) {	Init(width, height, NULL);	const DynamicFormat& img_format = transparent ? image_format : opaque_image_format;	SoftBitmap src(pixels, width, height, 0, img_format);	Clear();	Blit(0, 0, &src, src.GetRect(), 255);	free(pixels);}
开发者ID:take-cheeze,项目名称:EasyRPG,代码行数:8,


示例18: Genere_mobile

void Genere_mobile(SDL_Surface *ecran, int sens, int *y, int *xdeb, int *xfin, int ecart, int trou, int affichage){    int i=0;    int k=0;    int t=0;    while(i<50 && y[i]>-1)    {        y[i]++;        if((y[i]==TAILLE_Y && (sens==1 || sens== -1)) || (y[i]==TAILLE_X && (sens==2 || sens== -2)))        {            k=i;            while(k<49 && y[k]!=-1)            {                y[k]=y[k+1];                xdeb[k]=xdeb[k+1];                xfin[k]=xfin[k+1];                k++;            }        }        else if(sens==1)        {            if(affichage)Blit(ecran,0,y[i],xdeb[i],2,255,0,0);            if(affichage)Blit(ecran,xfin[i],y[i],TAILLE_X-xfin[i],2,255,0,0);            i++;        }        else if(sens==-1)        {            if(affichage)Blit(ecran,0,TAILLE_Y-y[i],xdeb[i],2,255,0,0);            if(affichage)Blit(ecran,xfin[i],TAILLE_Y-y[i],TAILLE_X-xfin[i],2,255,0,0);            i++;        }        else if(sens==2)        {            if(affichage)Blit(ecran,TAILLE_X-y[i],0,2,xdeb[i],255,0,0);            if(affichage)Blit(ecran,TAILLE_X-y[i],xfin[i],2,TAILLE_X-xfin[i],255,0,0);            i++;        }        else if(sens==-2)        {            if(affichage)Blit(ecran,y[i],0,2,xdeb[i],255,0,0);            if(affichage)Blit(ecran,y[i],xfin[i],2,TAILLE_X-xfin[i],255,0,0);            i++;        }    }    if(y[i]==-1) y[i]= rand()%(ecart/2) - 5*ecart/4;    else if(y[i]>-y[i-1])    {        y[i]=0;        t=rand()%(trou)+trou/2;        if(sens==1 || sens ==-1) xdeb[i]=rand()%(TAILLE_X-t);        else                     xdeb[i]=rand()%(TAILLE_Y-t);        xfin[i]=xdeb[i]+t;    }}
开发者ID:mniank,项目名称:c-stuff,代码行数:56,


示例19: Blit

////////////////////////////////////////////////////////////// Waver, Single Opacityvoid Surface::EffectsBlit(int x, int y, Bitmap* src, Rect src_rect,						   int opacity,						   int waver_depth, double waver_phase) {	if (waver_depth == 0)		Blit(x, y, src, src_rect, opacity);	else		WaverBlit(x, y, src, src_rect, waver_depth, waver_phase, opacity);}
开发者ID:take-cheeze,项目名称:EasyRPG,代码行数:10,


示例20: Longer_Higher

int Longer_Higher(SDL_Surface *ecran){    int score=0;    int past_longueur=0;    int a[6]={0}; // 0 : px, 1 py, 2 : vx, 3 : vy, 4 : longueur, 5 : hauteur    int tir[3];    tir[0]=0; // direction de frappe du marteau ( ou contenant la vitesse algebrique )    tir[1]=TAILLE_X/2; // marteaux    tir[2]=TAILLE_Y/10 + TAILLE_Y/2 ; // marteauy    a[0]=TAILLE_X/8*7-TAILLE_CARRE/2;    a[1]=TAILLE_Y/2-TAILLE_CARRE/2;    a[3]=6;    // Phase de départ    while(Gestion_lanceur(ecran,a, tir) && !Situation.exit)    {        SDL_Flip(ecran);        Blit(ecran,0,0,TAILLE_X,TAILLE_Y,0,0,0);        Changer_situation();        Mouvement_depart(ecran,a);        SDL_Delay(3);    }    //Test de vitesse initiale    a[2] = 5;    a[3] *= -1;    a[5]= TAILLE_Y - a[1];    // Phase de jeu    while(a[5] >= 0 && !Situation.exit)    {        SDL_Flip(ecran);        Blit(ecran,0,0,TAILLE_X,TAILLE_Y,0,0,0);        Changer_situation();        Mouvement_reel(ecran,a);        score += (a[4]-past_longueur)*a[5];        past_longueur=a[4];        Affichage_score2(ecran,score,TAILLE_X-67,TAILLE_Y-15);    }    return score;}
开发者ID:mniank,项目名称:c-stuff,代码行数:45,


示例21: calcBlitsInt

static BlitList calcBlitsInt(ColumnList &srcCols, ColumnList &dstCols){	BlitList blits;	while (!srcCols.empty())	{		Column srcCol = srcCols.takeFirst();		Q_ASSERT(srcCol.h > 0);		while (!dstCols.empty() && srcCol.h > 0)		{			Column dstCol = dstCols.takeFirst();			if (srcCol.h > dstCol.h)			{				/* srcCol doesn't fully fit into dstCol */				blits << Blit(srcCol.x, srcCol.y,				              dstCol.x, dstCol.y, dstCol.h);				srcCol.y += dstCol.h;				srcCol.h -= dstCol.h;			}			else if (srcCol.h < dstCol.h)			{				/* srcCol fits into dstCol with space remaining */				blits << Blit(srcCol.x, srcCol.y,				              dstCol.x, dstCol.y, srcCol.h);				dstCol.y += srcCol.h;				dstCol.h -= srcCol.h;				dstCols.prepend(dstCol);				srcCol.h = 0;			}			else			{				/* srcCol fits perfectly into dstCol */				blits << Blit(srcCol.x, srcCol.y,				              dstCol.x, dstCol.y, dstCol.h);			}		}	}	return blits;}
开发者ID:Tikilou,项目名称:mkxp,代码行数:44,


示例22: Blit

void WgGfxDevice::TileBlit( const WgSurfacePtr& _pSrc, const WgRect& _src, const WgRect& _dest ){    if( !_pSrc || _dest.h == 0 || _dest.w == 0 )        return;    WgRect	r = _src;    WgRect	r2 = _src;    int nCol = _dest.w / _src.w;    r2.w = _dest.w % _src.w;    int nRow = (_dest.h+(_src.h-1))/ _src.h;	// Including any cut row....    int		destX = _dest.x;    int		destY = _dest.y;    for( int row = 1 ; row <= nRow ; row++ )    {        // Possibly cut the height if this is the last row...        if( row == nRow )        {            r.h = _dest.y + _dest.h - destY;            r2.h = r.h;        }        // Blit a row.        for( int col = 0 ; col < nCol ; col++ )        {            Blit( _pSrc, r, destX, destY );            destX += r.w;        }        // Blit any left over part at end of row.        if( r2.w > 0 )            Blit( _pSrc, r2, destX, destY );        destX = _dest.x;        destY += _src.h;    }    return;}
开发者ID:maerson,项目名称:GUI-WonderGUI,代码行数:44,


示例23: r

void WgGfxDevice::BlitHorrBar(	const WgSurfacePtr& _pSurf, const WgRect& _src,                                const WgBorder& _borders, bool _bTile,                                int _dx, int _dy, int _len ){    // Blit left edge    WgRect	r( _src.x, _src.y, _borders.left, _src.h );    Blit( _pSurf, r, _dx, _dy );    _len -= _borders.Width();			// Remove left and right edges from len.    _dx += _borders.left;    // Blit tiling part    r.x += _borders.left;    r.w = _src.w - _borders.Width();    if( _bTile )    {        while( _len > r.w )        {            Blit( _pSurf, r, _dx, _dy );            _len -= r.w;            _dx += r.w;        }        if( _len != 0 )        {            r.w = _len;            Blit( _pSurf, r, _dx, _dy );            _dx += _len;        }    }    else    {        StretchBlit( _pSurf, r, WgRect( _dx, _dy, _len, r.h ) );        _dx += _len;    }    // Blit right edge    r.x = _src.x + _src.w - _borders.right;    r.w = _borders.right;    Blit( _pSurf, r, _dx, _dy );}
开发者ID:maerson,项目名称:GUI-WonderGUI,代码行数:44,


示例24: DrawObjectiveInfo

static void DrawObjectiveInfo(const Objective *o, const Vec2i pos){	const CharacterStore *store = &gCampaign.Setting.characters;	switch (o->Type)	{	case OBJECTIVE_KILL:		{			const Character *cd = CArrayGet(				&store->OtherChars, CharacterStoreGetSpecialId(store, 0));			DrawHead(cd, DIRECTION_DOWN, STATE_IDLE, pos);		}		break;	case OBJECTIVE_RESCUE:		{			const Character *cd = CArrayGet(				&store->OtherChars, CharacterStoreGetPrisonerId(store, 0));			DrawHead(cd, DIRECTION_DOWN, STATE_IDLE, pos);		}		break;	case OBJECTIVE_COLLECT:		{			const Pic *p = o->u.Pickup->Pic;			Blit(&gGraphicsDevice, p,				Vec2iMinus(pos, Vec2iScaleDiv(p->size, 2)));		}		break;	case OBJECTIVE_DESTROY:		{			Vec2i picOffset;			const Pic *p =				MapObjectGetPic(o->u.MapObject, &picOffset, false);			Blit(&gGraphicsDevice, p, Vec2iAdd(pos, picOffset));		}		break;	case OBJECTIVE_INVESTIGATE:		// Don't draw		return;	default:		CASSERT(false, "Unknown objective type");		return;	}}
开发者ID:ChunHungLiu,项目名称:cdogs-sdl,代码行数:43,


示例25: cbOptionsProc

int cbOptionsProc(PASSPROCVARS Params){	//cbsound	FadeOut(Pass.DDObject, &Pass.DDFront, &ScreenUnhighlighted, 0);	OptionsMain();	if(Pass.ProgramFlow==PF_EXIT) Pass.SettingsInfo=SETTINGS_EXIT;	else FadeIn(Pass.DDObject, &Pass.DDFront, &ScreenUnhighlighted, 0);	Blit(Pass.DDBack, ScreenUnhighlighted, 0,0,640,480,0,0);	settingsRedrawScreen();	return 0;}
开发者ID:thenfour,项目名称:Archives,代码行数:10,


示例26: QImage

void EC_WidgetCanvas::Update(){    if (framework->IsHeadless())        return;    if (!widget_.data() || texture_name_.empty())        return;    if (widget_->width() <= 0 || widget_->height() <= 0)        return;    try    {        Ogre::TexturePtr texture = Ogre::TextureManager::getSingleton().getByName(texture_name_);        if (texture.isNull())            return;        if (buffer_.size() != widget_->size())            buffer_ = QImage(widget_->size(), QImage::Format_ARGB32_Premultiplied);        if (buffer_.width() <= 0 || buffer_.height() <= 0)            return;        QPainter painter(&buffer_);        widget_->render(&painter);        // Set texture to material        if (update_internals_ && !material_name_.empty())        {            Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().getByName(material_name_);            if (material.isNull())                return;            // Just for good measure, this is done once in the ctor already if everything went well.            OgreRenderer::SetTextureUnitOnMaterial(material, texture_name_);            UpdateSubmeshes();            update_internals_ = false;        }        if ((int)texture->getWidth() != buffer_.width() || (int)texture->getHeight() != buffer_.height())        {            texture->freeInternalResources();            texture->setWidth(buffer_.width());            texture->setHeight(buffer_.height());            texture->createInternalResources();        }        Blit(buffer_, texture);    }    catch (Ogre::Exception &e) // inherits std::exception    {        LogError("Exception occurred while blitting texture data from memory: " + std::string(e.what()));    }    catch (...)    {        LogError("Unknown exception occurred while blitting texture data from memory.");    }}
开发者ID:360degrees-fi,项目名称:tundra,代码行数:55,



注:本文中的Blit函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ Bloaded函数代码示例
C++ Blinelen函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。