branches/micko/src/emu/guiengine.c
r23987 | r23988 | |
87 | 87 | virtual void RenderGeometry(Rocket::Core::Vertex* vertices, int num_vertices, int* indices, int num_indices, Rocket::Core::TextureHandle texture, const Rocket::Core::Vector2f& translation) |
88 | 88 | { |
89 | 89 | |
90 | | for (int i = 0; i < num_indices/3; i++) |
| 90 | for (int i = 0; i < num_indices/6; i++) |
91 | 91 | { |
92 | | /*render_texture *hilight_texture = machine().render().texture_alloc(); |
| 92 | render_texture *hilight_texture = machine().render().texture_alloc(); |
| 93 | rectangle bit = ((bitmap_rgb32 *)texture)->cliprect(); |
93 | 94 | rectangle myrect = ((bitmap_rgb32 *)texture)->cliprect(); |
94 | | printf("%f, %f\n",myrect.max_x * vertices[indices[i*3+0]].tex_coord[0],myrect.max_y * vertices[indices[i*3+0]].tex_coord[1]); |
95 | | myrect.min_x = myrect.max_x * vertices[indices[i*3+0]].tex_coord[0]; |
96 | | myrect.min_y = myrect.max_y * vertices[indices[i*3+0]].tex_coord[1]; |
| 95 | int p1 = indices[i*6+0]; |
| 96 | int p2 = indices[i*6+5]; |
| 97 | |
| 98 | myrect.min_x = bit.max_x * vertices[p1].tex_coord.x; |
| 99 | myrect.min_y = bit.max_y * vertices[p1].tex_coord.y; |
| 100 | myrect.max_x = bit.max_x * vertices[p2].tex_coord.x; |
| 101 | myrect.max_y = bit.max_y * vertices[p2].tex_coord.y; |
| 102 | if (myrect.min_x > myrect.max_x) { int t = myrect.max_x; myrect.max_x = myrect.min_x; myrect.min_x = t; } // this should be flipping |
| 103 | if (myrect.min_y > myrect.max_y) { int t = myrect.max_y; myrect.max_y = myrect.min_y; myrect.min_y = t; } |
| 104 | |
97 | 105 | hilight_texture->set_bitmap(*((bitmap_rgb32 *)texture), myrect, TEXFORMAT_ARGB32); |
98 | | */ |
99 | | rgb_t col1 = MAKE_ARGB(vertices[i].colour.alpha, vertices[indices[i*3+0]].colour.red, vertices[indices[i*3+0]].colour.green, vertices[indices[i*3+0]].colour.blue); |
100 | | rgb_t col2 = MAKE_ARGB(vertices[i].colour.alpha, vertices[indices[i*3+0]].colour.red, vertices[indices[i*3+0]].colour.green, vertices[indices[i*3+0]].colour.blue); |
101 | | rgb_t col3 = MAKE_ARGB(vertices[i].colour.alpha, vertices[indices[i*3+0]].colour.red, vertices[indices[i*3+0]].colour.green, vertices[indices[i*3+0]].colour.blue); |
102 | | machine().render().ui_container().add_line((vertices[indices[i*3+0]].position.x+translation.x)/1024,(vertices[indices[i*3+0]].position.y+translation.y)/768, (vertices[indices[i*3+1]].position.x+translation.x)/1024,(vertices[indices[i*3+1]].position.y+translation.y)/768, UI_LINE_WIDTH, col1, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); |
103 | | machine().render().ui_container().add_line((vertices[indices[i*3+1]].position.x+translation.x)/1024,(vertices[indices[i*3+1]].position.y+translation.y)/768, (vertices[indices[i*3+2]].position.x+translation.x)/1024,(vertices[indices[i*3+2]].position.y+translation.y)/768, UI_LINE_WIDTH, col2, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); |
104 | | machine().render().ui_container().add_line((vertices[indices[i*3+2]].position.x+translation.x)/1024,(vertices[indices[i*3+2]].position.y+translation.y)/768, (vertices[indices[i*3+0]].position.x+translation.x)/1024,(vertices[indices[i*3+0]].position.y+translation.y)/768, UI_LINE_WIDTH, col3, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); |
105 | 106 | |
106 | | //machine().render().ui_container().add_quad((vertices[indices[i*3+0]].position.x+translation.x)/1024,(vertices[indices[i*3+0]].position.y+translation.y)/768, (vertices[indices[i*3+1]].position.x+translation.x)/1024,(vertices[indices[i*3+2]].position.y+translation.y)/768, UI_BORDER_COLOR, hilight_texture,PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); |
| 107 | machine().render().ui_container().add_quad((vertices[p1].position.x+translation.x)/1024,(vertices[p1].position.y+translation.y)/768, (vertices[p2].position.x+translation.x)/1024,(vertices[p2].position.y+translation.y)/768, UI_BORDER_COLOR, hilight_texture,PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); |
| 108 | //machine().render().texture_free(hilight_texture); |
107 | 109 | } |
108 | | //machine().render().texture_free(hilight_texture); |
| 110 | |
109 | 111 | } |
110 | 112 | |
111 | 113 | /// Called by Rocket when it wants to compile geometry it believes will be static for the forseeable future. |