static gboolean
timeout_cb (gpointer user_data)
{
    HardDriveStatusTile *tile = HARD_DRIVE_STATUS_TILE (user_data);

    update_tile (tile);

    return TRUE;
}
Esempio n. 2
0
static void write8(uint16_t address, uint8_t data)
{
    if(address >= 0xFF10 && address <= 0xFF3F)
        gameboy->apu.write_reg(address, data);

    if(address >= 0xFF40 && address <= 0xFF4B)
        gameboy->gpu.write_reg(address, data);

    if(address >= 0x8000 && address <= 0x9FFF)
        update_tile(address, data);

    ram[address] = data;
}
static void
tile_hide_event_cb (GtkWidget * widget, gpointer user_data)
{
    HardDriveStatusTile *tile = HARD_DRIVE_STATUS_TILE (widget);
    HardDriveStatusTilePrivate *priv = HARD_DRIVE_STATUS_TILE_GET_PRIVATE (tile);

    if (priv->timeout_notify)
    {
        mateconf_client_notify_remove (priv->mateconf, priv->timeout_notify);
        priv->timeout_notify = 0;
    }

    if (priv->update_timeout)
    {
        g_source_remove (priv->update_timeout);
        priv->update_timeout = 0;
    }

    update_tile (tile);
}
static void
tile_show_event_cb (GtkWidget * widget, gpointer user_data)
{
    HardDriveStatusTile *tile = HARD_DRIVE_STATUS_TILE (widget);
    HardDriveStatusTilePrivate *priv = HARD_DRIVE_STATUS_TILE_GET_PRIVATE (tile);

    update_tile (tile);
    if (!priv->update_timeout)
    {
        int timeout;

        timeout = mateconf_client_get_int (priv->mateconf, TIMEOUT_KEY, NULL);
        timeout = MAX (timeout, 1000);

        priv->timeout_notify =
            mateconf_client_notify_add (priv->mateconf, TIMEOUT_KEY, timeout_changed_cb, tile,
                                        NULL, NULL);

        priv->update_timeout = g_timeout_add (timeout, timeout_cb, tile);
    }
}
static void
hard_drive_status_tile_style_set (GtkWidget * widget, GtkStyle * prev_style)
{
    update_tile (HARD_DRIVE_STATUS_TILE (widget));
}
 void update_all() {
   glClear(GL_COLOR_BUFFER_BIT);
   for (int x = 0; x < gps.dimx; x++)
     for (int y = 0; y < gps.dimy; y++)
       update_tile(x, y);
 }
Esempio n. 7
0
void renderer_cool::display_new(bool update_graphics)
{
#ifndef NO_DISPLAY_PATCH
    // In this case this function replaces original (non-virtual) renderer::display()
    // So update text tiles here

    const int dimx = tdimx;//init->display.grid_x;
    const int dimy = tdimy;//init->display.grid_y;

    if (gps->force_full_display_count) {
        update_all();
    } else {
        uint32_t *screenp = (uint32_t*)screen, *oldp = (uint32_t*)screen_old;
        /*if (use_graphics) {
        int off = 0;
        for (int x2=0; x2 < dimx; x2++) {
        for (int y2=0; y2 < dimy; y2++, ++off, ++screenp, ++oldp) {
        // We don't use pointers for the non-screen arrays because we mostly fail at the
        // *first* comparison, and having pointers for the others would exceed register
        // count.
        // Partial printing (and color-conversion): Big-ass if.
        if (*screenp == *oldp &&
        screentexpos[off] == screentexpos_old[off] &&
        screentexpos_addcolor[off] == screentexpos_addcolor_old[off] &&
        screentexpos_grayscale[off] == screentexpos_grayscale_old[off] &&
        screentexpos_cf[off] == screentexpos_cf_old[off] &&
        screentexpos_cbr[off] == screentexpos_cbr_old[off])
        {
        // Nothing's changed, this clause deliberately empty
        } else {
        update_tile(x2, y2);
        }
        }
        }
        } else {*/
        for (int x2=0; x2 < dimx; ++x2) {
            for (int y2=0; y2 < dimy; ++y2, ++screenp, ++oldp) {
                if (*screenp != *oldp) {
                    update_tile(x2, y2);
                }
            }
        }
        //}
    }

    if (gps->force_full_display_count > 0) gps->force_full_display_count--;
#endif

    // Update map tiles is current screen has a map
    if (update_graphics)
    {
        if (needs_full_update || always_full_update)
        {
            needs_full_update = false;

            //clock_t c1 = clock();
            for (int x2 = 0; x2 < gdimx; x2++)
                for (int y2 = 0; y2 < gdimy; y2++)
                    update_map_tile(x2, y2);
            //clock_t c2 = clock();
            //*out2 << (c2-c1) << std::endl;
        }
        else
        {
            uint32_t *gscreenp = (uint32_t*)gscreen, *goldp = (uint32_t*)gscreen_old;
            int off = 0;
            for (int x2=0; x2 < gdimx; x2++) {
                for (int y2=0; y2 < gdimy; y2++, ++off, ++gscreenp, ++goldp) {
                    // We don't use pointers for the non-screen arrays because we mostly fail at the
                    // *first* comparison, and having pointers for the others would exceed register
                    // count.
                    if (*gscreenp == *goldp &&
                    gscreentexpos[off] == gscreentexpos_old[off] &&
                    gscreentexpos_addcolor[off] == gscreentexpos_addcolor_old[off] &&
                    gscreentexpos_grayscale[off] == gscreentexpos_grayscale_old[off] &&
                    gscreentexpos_cf[off] == gscreentexpos_cf_old[off] &&
                    gscreentexpos_cbr[off] == gscreentexpos_cbr_old[off])
                        ;
                    else
                        update_map_tile(x2, y2);
                }
            }
        }
    }
} 
Esempio n. 8
0
void uncheck_column(Grid *grid, int index) {
  int i;
  for (i=0; i < grid->height; i++) {
    update_tile(grid, index, i, '.');
  }
}
Esempio n. 9
0
void uncheck_line(Grid *grid, int index) {
  int i;
  for (i=0; i < grid->width; i++) {
    update_tile(grid, i, index, '.');
  }
}
Esempio n. 10
0
void hc_map::update_tile(void)
{
	update_tile(server);
}