• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ZMap类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ASSERT_LE

DynamicModelVertex *TranslationMatrix::getVertex(int x, int y, int z, int normal) {
    if (x < 0) { x = _width  - 1 ; }
    if (y < 0) { y = _height - 1 ; }
    ASSERT_LE(x, _width  - 1);
    ASSERT_LE(y, _height - 1);

    ZMap *zmap = _matrix + (normal * _width * _height) + (y * _width) + x;

    ZMap::iterator itr = zmap->find(z);
    return itr == zmap->end() ? NULL : itr->second;
}
开发者ID:,项目名称:,代码行数:11,代码来源:


示例2: DoRender

void EMissileCRockets::DoRender(ZMap &zmap, SDL_Surface *dest)
{
	SDL_Rect from_rect, to_rect;

	if(killme) return;

	zmap.RenderZSurface(&bullet_img, x, y, false, true);
	//if(zmap.GetBlitInfo(bullet_img, x, y, from_rect, to_rect))
	//	SDL_BlitSurface( bullet_img, &from_rect, dest, &to_rect);

	zmap.RenderZSurface(&bullet_img, x + other_x_shift, y + other_y_shift, false, true);
	//if(zmap.GetBlitInfo(bullet_img, x + other_x_shift, y + other_y_shift, from_rect, to_rect))
	//	SDL_BlitSurface( bullet_img, &from_rect, dest, &to_rect);
}
开发者ID:Nitaym,项目名称:zodengine,代码行数:14,代码来源:emissilecrockets.cpp


示例3: DoRender

void RLaser::DoRender(ZMap &the_map, SDL_Surface *dest, int shift_x, int shift_y)
{
	int &x = loc.x;
	int &y = loc.y;
	ZSDL_Surface *base_surface;
	SDL_Rect from_rect, to_rect;
	int lx, ly;
	
	if(owner != NULL_TEAM)
	{
		switch(mode)
		{
			case R_WALKING: base_surface = &walk[owner][direction][move_i]; break;
			case R_STANDING: base_surface = &stand[owner][direction]; break;
			case R_BEER: base_surface = &beer[owner][action_i]; break;
			case R_CIGARETTE: base_surface = &cigarette[owner][action_i]; break;
			case R_FULLSCAN: base_surface = &full_area_scan[owner][action_i]; break;
			case R_HEADSTRETCH: base_surface = &head_stretch[owner][action_i]; break;
			case R_PICKUP_UP_GRENADES: base_surface = &pickup_up[owner][action_i]; break;
			case R_PICKUP_DOWN_GRENADES: base_surface = &pickup_down[owner][action_i]; break;
			case R_ATTACKING: 
				if(this->CanThrowGrenades() || (m_attacked_object && m_attacked_object->AttackedOnlyByExplosives()))
					base_surface = &throw_something[owner][direction][grenade_i];
				else
					base_surface = &fire[owner][direction][action_i];
				break;
			default: base_surface = &null_img;
		}
	}
	else
		base_surface = &null_img;
	
	if(!base_surface) return;

	submerge_amount = the_map.SubmergeAmount(loc.x+8,loc.y+8);
	
	//if(the_map.GetBlitInfo(base_surface, x, y, from_rect, to_rect))
	if(the_map.GetBlitInfo(x, y + submerge_amount, 16, 16 - submerge_amount, from_rect, to_rect))
	{
		to_rect.x += shift_x;
		to_rect.y += shift_y;

		base_surface->BlitHitSurface(&from_rect, &to_rect, NULL, do_hit_effect);
		//ZSDL_BlitHitSurface( base_surface, &from_rect, dest, &to_rect, do_hit_effect);
	}

	do_hit_effect = false;
}
开发者ID:sebhd,项目名称:zod,代码行数:48,代码来源:rlaser.cpp


示例4: Render

void ZCursor::Render(ZMap &the_map, SDL_Surface *dest, int &x, int &y, bool restrict_to_map)
{
	SDL_Rect from_rect, to_rect;
	int x_shift, y_shift;

	if(!current_surface) return;

	if(current_cursor > CURSOR_C)
	{
		x_shift = -8;
		y_shift = -8;
	}
	else
	{
		x_shift = 0;
		y_shift = 0;
	}

	if(restrict_to_map)
	{

		if(the_map.GetBlitInfo(current_surface->GetBaseSurface(), x + x_shift, y + y_shift, from_rect, to_rect))
			current_surface->BlitSurface(&from_rect, &to_rect);
			//SDL_BlitSurface( current_surface, &from_rect, dest, &to_rect);
	}
	else
	{
		to_rect.x = x + x_shift;
		to_rect.y = y + y_shift;

		current_surface->BlitSurface(NULL, &to_rect);
		//SDL_BlitSurface( current_surface, NULL, dest, &to_rect);
	}
}
开发者ID:Nitaym,项目名称:zodengine,代码行数:34,代码来源:cursor.cpp


示例5: SetMapImpassables

void OMapObject::SetMapImpassables(ZMap &tmap)
{
	int tx, ty;

	tx = loc.x / 16;
	ty = loc.y / 16;

	tmap.SetImpassable(tx, ty, true, true);
}
开发者ID:capehill,项目名称:zodengine,代码行数:9,代码来源:omapobject.cpp


示例6: UnSetMapImpassables

void OHut::UnSetMapImpassables(ZMap &tmap)
{
	int tx, ty;

	tx = loc.x / 16;
	ty = loc.y / 16;

	tmap.SetImpassable(tx, ty, false, true);
}
开发者ID:Nitaym,项目名称:zodengine,代码行数:9,代码来源:ohut.cpp


示例7: DoRender

void ELightInitFire::DoRender(ZMap &zmap/*, SDL_Surface *dest*/)
{
	//SDL_Rect from_rect, to_rect;

	if(killme) return;

	zmap.RenderZSurface(&render_img[render_i], x, y);
	//if(zmap.GetBlitInfo( render_img[render_i], x, y, from_rect, to_rect))
	//	SDL_BlitSurface( render_img[render_i], &from_rect, dest, &to_rect);
}
开发者ID:capehill,项目名称:zodengine,代码行数:10,代码来源:elightinitfire.cpp


示例8: DoRender

void EToughSmoke::DoRender(ZMap &zmap, SDL_Surface *dest)
{
	SDL_Rect from_rect, to_rect;

	if(killme) return;

	zmap.RenderZSurface(&render_img[render_i], x, y, false, true);
	//if(zmap.GetBlitInfo( render_img[render_i], x, y, from_rect, to_rect))
	//	SDL_BlitSurface( render_img[render_i], &from_rect, dest, &to_rect);
}
开发者ID:Nitaym,项目名称:zodengine,代码行数:10,代码来源:etoughsmoke.cpp


示例9: DoPreRender

void ETankSpark::DoPreRender(ZMap &zmap, SDL_Surface *dest)
{
	ZSDL_Surface *render_img;

	if(killme) return;

	render_img = &tank_spark[ni];

	if(!render_img) return;

	zmap.RenderZSurface(render_img, cx, cy, false, true);
}
开发者ID:Nitaym,项目名称:zodengine,代码行数:12,代码来源:etankspark.cpp


示例10: DoRender

void EDeath::DoRender(ZMap &zmap/*, SDL_Surface *dest*/)
{
	//SDL_Rect from_rect, to_rect;

	if(killme) return;

	zmap.RenderZSurface(wasted_img, x, y);
	//if(zmap.GetBlitInfo( wasted_img, x, y, from_rect, to_rect))
	//	SDL_BlitSurface( wasted_img, &from_rect, dest, &to_rect);

	for(vector<EStandard*>::iterator i=extra_effects.begin(); i!=extra_effects.end(); i++)
		(*i)->DoRender(zmap/*, dest*/);
}
开发者ID:capehill,项目名称:zodengine,代码行数:13,代码来源:edeath.cpp


示例11: DoRender

void GWProduction::DoRender(ZMap &the_map, SDL_Surface *dest)
{
	int lx, ly;
	SDL_Rect from_rect, to_rect;

	if(killme) return;

	if(!building_obj)
	{
		killme = true;
		return;
	}

	if(!is_expanded)
		the_map.RenderZSurface(&base_img, x, y);
	else
		the_map.RenderZSurface(&base_expanded_img, x, y);

	lx = x + 9;
	ly = y + 6;

	the_map.RenderZSurface(&name_label[type], lx, ly);
	//if(the_map.GetBlitInfo(name_label[type], x + lx, y + ly, from_rect, to_rect))
	//	SDL_BlitSurface( name_label[type], &from_rect, dest, &to_rect);

	lx = x + 64;
	ly = y + 19;

	the_map.RenderZSurface(&state_label[state][state_i], lx, ly);
	//if(the_map.GetBlitInfo( state_label[state][state_i], x + lx, y + ly, from_rect, to_rect))
	//	SDL_BlitSurface( state_label[state][state_i], &from_rect, dest, &to_rect);

	//buttons
	ok_button.DoRender(the_map, dest, x, y);
	cancel_button.DoRender(the_map, dest, x, y);
	place_button.DoRender(the_map, dest, x, y);
	small_plus_button.DoRender(the_map, dest, x, y);
	small_minus_button.DoRender(the_map, dest, x, y);
	queue_button.DoRender(the_map, dest, x, y);

	//queue_list buttons
	RenderQueueButtonList(the_map, dest);

	lx = x + 90;
	ly = y + 35;

	the_map.RenderZSurface(&show_time_img, lx, ly);
	//if(show_time_img)
	//	if(the_map.GetBlitInfo( show_time_img, x + 90, y + 35, from_rect, to_rect))
	//		SDL_BlitSurface( show_time_img, &from_rect, dest, &to_rect);

	if(health_percent_img.GetBaseSurface())
	{
		lx = x + 86 - (health_percent_img.GetBaseSurface()->w >> 1);
		ly = y + 6;

		the_map.RenderZSurface(&health_percent_img, lx, ly);
	}
开发者ID:Nitaym,项目名称:zodengine,代码行数:58,代码来源:gwproduction.cpp


示例12: DoRender

void EDeathSparks::DoRender(ZMap &zmap, SDL_Surface *dest)
{
	SDL_Rect from_rect, to_rect;
	//SDL_Surface *render_img;

	if(killme) return;

	//render_img = base_img[render_i].GetImage(size);
	base_img[render_i].SetSize(size);

	zmap.RenderZSurface(&base_img[render_i], x, y, false, true);
	//if(zmap.GetBlitInfo( render_img, x, y, from_rect, to_rect))
	//	SDL_BlitSurface( render_img, &from_rect, dest, &to_rect);
}
开发者ID:sebhd,项目名称:zod,代码行数:14,代码来源:edeathsparks.cpp


示例13: DoRender

void EToughRocket::DoRender(ZMap &zmap, SDL_Surface *dest)
{
	SDL_Rect from_rect, to_rect;

	if(killme) return;

	zmap.RenderZSurface(&bullet_img[0], x, y, false, true);
	//if(zmap.GetBlitInfo(bullet_img[0], x, y, from_rect, to_rect))
	//	SDL_BlitSurface( bullet_img[bullet_i], &from_rect, dest, &to_rect);

	//always new
	bullet_i++;
	if(bullet_i) bullet_i = 0;
}
开发者ID:Nitaym,项目名称:zodengine,代码行数:14,代码来源:etoughrocket.cpp


示例14: DoRender

void OHut::DoRender(ZMap &the_map, SDL_Surface *dest, int shift_x, int shift_y)
{
	int &x = loc.x;
	int &y = loc.y;
	SDL_Rect from_rect, to_rect;

	if(the_map.GetBlitInfo( render_img[palette].GetBaseSurface(), x, y, from_rect, to_rect))
	{
		to_rect.x += shift_x;
		to_rect.y += shift_y;

		render_img[palette].BlitSurface(&from_rect, &to_rect);
		//SDL_BlitSurface( render_img[palette], &from_rect, dest, &to_rect);
	}
}
开发者ID:Nitaym,项目名称:zodengine,代码行数:15,代码来源:ohut.cpp


示例15: DoRender

void ORockets::DoRender(ZMap &the_map, SDL_Surface *dest, int shift_x, int shift_y)
{
	int &x = loc.x;
	int &y = loc.y;
	SDL_Rect from_rect, to_rect;

	the_map.RenderZSurface(&render_img, x, y);
	//if(the_map.GetBlitInfo( render_img, x, y, from_rect, to_rect))
	//{
	//	to_rect.x += shift_x;
	//	to_rect.y += shift_y;

	//	SDL_BlitSurface( render_img, &from_rect, dest, &to_rect);
	//}
}
开发者ID:sebhd,项目名称:zod,代码行数:15,代码来源:orockets.cpp


示例16: DoPreRender

void ETankSmoke::DoPreRender(ZMap &zmap, SDL_Surface *dest)
{
	ZSDL_Surface *render_img;

	if(killme) return;

	if(do_spark && ni<4)
		render_img = &tank_spark[direction][ni];
	else
		render_img = &tank_smoke[direction][ni];

	if(!render_img) return;
	if(!render_img->GetBaseSurface()) return;

	zmap.RenderZSurface(render_img, x, y);
}
开发者ID:Nitaym,项目名称:zodengine,代码行数:16,代码来源:etanksmoke.cpp


示例17: DoRender

void ERockParticle::DoRender(ZMap &zmap, SDL_Surface *dest)
{
	SDL_Rect from_rect, to_rect;
	//SDL_Surface *surface;

	if(killme) return;

	//surface = render_img[render_i].GetImage(size);
	render_img[render_i].SetSize(size);

	//if(!surface) return;

	zmap.RenderZSurface(&render_img[render_i], x, y, false, true);
	//if(zmap.GetBlitInfo( surface, x - (surface->w >> 1), y - (surface->h >> 1), from_rect, to_rect))
	//	SDL_BlitSurface( surface, &from_rect, dest, &to_rect);
}
开发者ID:sebhd,项目名称:zod,代码行数:16,代码来源:erockparticle.cpp


示例18: DoRender

void EMapObjectTurrent::DoRender(ZMap &zmap, SDL_Surface *dest)
{
	SDL_Rect from_rect, to_rect;
	//SDL_Surface *render_img;

	if(killme) return;

	//render_img = object_img[object].GetImage(angle, size);
	object_img[object].SetAngle(angle);
	object_img[object].SetSize(size);

	//if(!render_img) return;

	zmap.RenderZSurface(&object_img[object], x, y, false, true);
	//if(zmap.GetBlitInfo(render_img, x - (render_img->w >> 1), y - (render_img->h >> 1), from_rect, to_rect))
	//	SDL_BlitSurface( render_img, &from_rect, dest, &to_rect);
}
开发者ID:sebhd,项目名称:zod,代码行数:17,代码来源:emapobjectturrent.cpp


示例19: DoRender

void OMapObject::DoRender(ZMap &the_map, /*SDL_Surface *dest,*/ int shift_x, int shift_y)
{
	int &x = loc.x;
	int &y = loc.y;
	SDL_Rect from_rect, to_rect;

	if(!render_img[object_i].GetBaseSurface()) return;

	if(the_map.GetBlitInfo( render_img[object_i].GetBaseSurface(), x, y + (16 - render_img[object_i].GetBaseSurface()->h), from_rect, to_rect))
	{
		to_rect.x += shift_x;
		to_rect.y += shift_y;

		render_img[object_i].BlitSurface(&from_rect, &to_rect);
		//SDL_BlitSurface( render_img[object_i], &from_rect, dest, &to_rect);
	}
}
开发者ID:capehill,项目名称:zodengine,代码行数:17,代码来源:omapobject.cpp


示例20: DoRender

void ERockTurrent::DoRender(ZMap &zmap, SDL_Surface *dest)
{
	SDL_Rect from_rect, to_rect;
	//SDL_Surface *surface;

	if(killme) return;

	//surface = debri_large_img[large_i][palette][render_i].GetImage(angle, size);
	debri_large_img[large_i][palette][render_i].SetAngle(angle);
	debri_large_img[large_i][palette][render_i].SetSize(size);

	//if(!surface) return;

	zmap.RenderZSurface(&debri_large_img[large_i][palette][render_i], x, y, false, true);
	//if(zmap.GetBlitInfo( surface, x - (surface->w >> 1), y - (surface->h >> 1), from_rect, to_rect))
	//	SDL_BlitSurface( surface, &from_rect, dest, &to_rect);
}
开发者ID:sebhd,项目名称:zod,代码行数:17,代码来源:erockturrent.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ZONE_CONTAINER类代码示例发布时间:2022-05-31
下一篇:
C++ ZLTextWordCursor类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap