~ubuntu-branches/ubuntu/lucid/sdlmame/lucid

« back to all changes in this revision

Viewing changes to src/emu/uigfx.c

  • Committer: Bazaar Package Importer
  • Author(s): Cesare Falco
  • Date: 2009-11-03 17:10:15 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20091103171015-6hop4ory5lxnumpn
Tags: 0.135-0ubuntu1
* New upstream release - Closes (LP: #403212)
* debian/watch: unstable releases are no longer detected
* mame.ini: added the cheat subdirectories to cheatpath so zipped
  cheatfiles will be searched too
* renamed crsshair subdirectory to crosshair to reflect upstream change
* mame.ini: renamed references to crosshair subdirectory (see above)

Show diffs side-by-side

added added

removed removed

Lines of Context:
155
155
        ui_gfx_state *state = &ui_gfx;
156
156
 
157
157
        /* if we have nothing, implicitly cancel */
158
 
        if (machine->config->total_colors == 0 && machine->colortable == NULL && machine->gfx[0] == NULL && tilemap_count() == 0)
 
158
        if (machine->config->total_colors == 0 && machine->colortable == NULL && machine->gfx[0] == NULL && tilemap_count(machine) == 0)
159
159
                goto cancel;
160
160
 
161
161
        /* if we're not paused, mark the bitmap dirty */
190
190
 
191
191
                case 2:
192
192
                        /* if we have tilemaps, display them */
193
 
                        if (tilemap_count() > 0)
 
193
                        if (tilemap_count(machine) > 0)
194
194
                        {
195
195
                                tilemap_handler(machine, state);
196
196
                                break;
275
275
                x0 = boxbounds.x0 - (0.5f - 0.5f * (titlewidth + chwidth));
276
276
 
277
277
        /* go ahead and draw the outer box now */
278
 
        ui_draw_outlined_box(boxbounds.x0 - x0, boxbounds.y0, boxbounds.x1 + x0, boxbounds.y1, UI_FILLCOLOR);
 
278
        ui_draw_outlined_box(boxbounds.x0 - x0, boxbounds.y0, boxbounds.x1 + x0, boxbounds.y1, UI_GFXVIEWER_BG_COLOR);
279
279
 
280
280
        /* draw the title */
281
281
        x0 = 0.5f - 0.5f * titlewidth;
518
518
                x0 = boxbounds.x0 - (0.5f - 0.5f * (titlewidth + chwidth));
519
519
 
520
520
        /* go ahead and draw the outer box now */
521
 
        ui_draw_outlined_box(boxbounds.x0 - x0, boxbounds.y0, boxbounds.x1 + x0, boxbounds.y1, UI_FILLCOLOR);
 
521
        ui_draw_outlined_box(boxbounds.x0 - x0, boxbounds.y0, boxbounds.x1 + x0, boxbounds.y1, UI_GFXVIEWER_BG_COLOR);
522
522
 
523
523
        /* draw the title */
524
524
        x0 = 0.5f - 0.5f * titlewidth;
857
857
        render_target_get_bounds(render_get_ui_target(), &targwidth, &targheight, NULL);
858
858
 
859
859
        /* get the size of the tilemap itself */
860
 
        tilemap_size_by_index(state->tilemap.which, &mapwidth, &mapheight);
 
860
        tilemap_size_by_index(machine, state->tilemap.which, &mapwidth, &mapheight);
861
861
        if (state->tilemap.rotate & ORIENTATION_SWAP_XY)
862
862
                { UINT32 temp = mapwidth; mapwidth = mapheight; mapheight = temp; }
863
863
 
909
909
        boxbounds.y1 = mapboxbounds.y1 + 0.5f * chheight;
910
910
 
911
911
        /* figure out the title and expand the outer box to fit */
912
 
        sprintf(title, "TMAP %d/%d %dx%d OFFS %d,%d", state->tilemap.which, tilemap_count() - 1, mapwidth, mapheight, state->tilemap.xoffs, state->tilemap.yoffs);
 
912
        sprintf(title, "TMAP %d/%d %dx%d OFFS %d,%d", state->tilemap.which, tilemap_count(machine) - 1, mapwidth, mapheight, state->tilemap.xoffs, state->tilemap.yoffs);
913
913
        titlewidth = render_font_get_string_width(ui_font, chheight, render_get_ui_aspect(), title);
914
914
        if (boxbounds.x1 - boxbounds.x0 < titlewidth + chwidth)
915
915
        {
918
918
        }
919
919
 
920
920
        /* go ahead and draw the outer box now */
921
 
        ui_draw_outlined_box(boxbounds.x0, boxbounds.y0, boxbounds.x1, boxbounds.y1, UI_FILLCOLOR);
 
921
        ui_draw_outlined_box(boxbounds.x0, boxbounds.y0, boxbounds.x1, boxbounds.y1, UI_GFXVIEWER_BG_COLOR);
922
922
 
923
923
        /* draw the title */
924
924
        x0 = 0.5f - 0.5f * titlewidth;
963
963
        /* clamp within range */
964
964
        if (state->tilemap.which < 0)
965
965
                state->tilemap.which = 0;
966
 
        if (state->tilemap.which >= tilemap_count())
967
 
                state->tilemap.which = tilemap_count() - 1;
 
966
        if (state->tilemap.which >= tilemap_count(machine))
 
967
                state->tilemap.which = tilemap_count(machine) - 1;
968
968
 
969
969
        /* cache some info in locals */
970
 
        tilemap_size_by_index(state->tilemap.which, &mapwidth, &mapheight);
 
970
        tilemap_size_by_index(machine, state->tilemap.which, &mapwidth, &mapheight);
971
971
 
972
972
        /* handle zoom (minus,plus) */
973
973
        if (ui_input_pressed(machine, IPT_UI_ZOOM_OUT))
994
994
 
995
995
        /* handle navigation (up,down,left,right) */
996
996
        step = 8;
997
 
        if (input_code_pressed(KEYCODE_LSHIFT)) step = 1;
998
 
        if (input_code_pressed(KEYCODE_LCONTROL)) step = 64;
 
997
        if (input_code_pressed(machine, KEYCODE_LSHIFT)) step = 1;
 
998
        if (input_code_pressed(machine, KEYCODE_LCONTROL)) step = 64;
999
999
        if (ui_input_pressed_repeat(machine, IPT_UI_UP, 4))
1000
1000
                state->tilemap.yoffs -= step;
1001
1001
        if (ui_input_pressed_repeat(machine, IPT_UI_DOWN, 4))
1071
1071
        /* handle the redraw */
1072
1072
        if (state->bitmap_dirty)
1073
1073
        {
1074
 
                tilemap_draw_by_index(state->bitmap, state->tilemap.which, state->tilemap.xoffs, state->tilemap.yoffs);
 
1074
                tilemap_draw_by_index(machine, state->bitmap, state->tilemap.which, state->tilemap.xoffs, state->tilemap.yoffs);
1075
1075
 
1076
1076
                /* reset the texture to force an update */
1077
1077
                render_texture_set_bitmap(state->texture, state->bitmap, NULL, screen_texformat, palette);