void CUITextureMaster::GetTextureShader(LPCSTR texture_name, ref_shader& sh){ xr_map<shared_str, TEX_INFO>::iterator it; it = m_textures.find(texture_name); R_ASSERT3(it != m_textures.end(), "can't find texture", texture_name); sh.create("hud\\default", *((*it).second.file)); }
void draw_rect(Frect& r, u32 color) { if(!dbg_draw_sh){ dbg_draw_sh.create("hud\\default","ui\\ui_pop_up_active_back"); dbg_draw_gm.create(FVF::F_TL, RCache.Vertex.Buffer(), 0); } RCache.set_Shader (dbg_draw_sh); u32 vOffset; FVF::TL* pv = (FVF::TL*)RCache.Vertex.Lock (5,dbg_draw_gm.stride(),vOffset); pv->set(r.lt.x, r.lt.y, color, 0,0); ++pv; pv->set(r.rb.x, r.lt.y, color, 0,0); ++pv; pv->set(r.rb.x, r.rb.y, color, 0,0); ++pv; pv->set(r.lt.x, r.rb.y, color, 0,0); ++pv; pv->set(r.lt.x, r.lt.y, color, 0,0); ++pv; RCache.Vertex.Unlock (5,dbg_draw_gm.stride()); RCache.set_Geometry (dbg_draw_gm); RCache.Render (D3DPT_LINESTRIP,vOffset,4); }
void clean_wnd_rects() { dbg_draw_sh.destroy(); dbg_draw_gm.destroy(); }