static void game_draw(context *ctx) { struct game_context *game = (struct game_context *)ctx; struct config_info *conf = get_config(); struct world *mzx_world = ctx->world; // No game state change has happened (yet) mzx_world->change_game_state = CHANGE_STATE_NONE; if(game->is_title && game->fade_in) { // Focus on center int x, y; set_screen_coords(640/2, 350/2, &x, &y); focus_pixel(x, y); } if(!mzx_world->active) { // There is no MZX_SPEED to derive a framerate from, so use the UI rate. set_context_framerate_mode(ctx, FRAMERATE_UI); if(!conf->standalone_mode) draw_intro_mesg(mzx_world); m_show(); return; } set_context_framerate_mode(ctx, FRAMERATE_MZX_SPEED); update_world(ctx, game->is_title); draw_world(ctx, game->is_title); }
void warp_real_mouse_x(Uint32 mx) { struct buffered_status *status = store_status(); int mx_real, my_real, x = mx / 8; status->mouse_x = x; status->real_mouse_x = mx; set_screen_coords(mx, status->real_mouse_y, &mx_real, &my_real); real_warp_mouse(mx_real, my_real); }
void warp_real_mouse_y(Uint32 my) { struct buffered_status *status = store_status(); int mx_real, my_real, y = my / 14; status->mouse_y = y; status->real_mouse_y = my; set_screen_coords(status->real_mouse_x, my, &mx_real, &my_real); real_warp_mouse(mx_real, my_real); }
void warp_mouse(Uint32 x, Uint32 y) { int mx_real, my_real, mx = (x * 8) + 4, my = (y * 14) + 7; struct buffered_status *status = store_status(); status->mouse_x = x; status->mouse_y = y; status->real_mouse_x = mx; status->real_mouse_y = my; set_screen_coords(mx, my, &mx_real, &my_real); real_warp_mouse(mx_real, my_real); }