Esempio n. 1
0
void build_info(void)
{
    int y = 0;

    info[y++] = strdup(qdgdfv_sprintf("QDGDF %s", _qdgdfv_version));
    info[y++] = strdup(qdgdfv_sprintf("%d x %d (scale %d)",
                                      _qdgdfv_screen_x_size,
                                      _qdgdfv_screen_y_size,
                                      _qdgdfv_scale));
    info[y++] = strdup(qdgdfv_sprintf("full screen: %d",
                                      _qdgdfv_full_screen));
    info[y++] = strdup(qdgdfv_sprintf("window position: %d x %d",
                                    _qdgdfv_window_x,
                                    _qdgdfv_window_y));
    info[y++] = strdup(qdgdfv_sprintf("pixel size: %d", _qdgdfv_pixel_size));
    info[y++] = strdup(qdgdfv_sprintf("home dir: %s", qdgdfv_home_dir()));
    info[y++] = strdup(qdgdfv_sprintf("app dir: %s", qdgdfv_app_dir()));
    info[y++] = strdup(qdgdfv_sprintf("sound: %d (%d bit)",
                                      _qdgdfa_sound,
                                      _qdgdfa_16_bit ? 16 : 8));

#ifdef CONFOPT_OPENGL
    info[y++] = "OpenGL support enabled";
#else
    info[y++] = "OpenGL support disabled";
#endif
}
Esempio n. 2
0
void GameShutdown(void)
/* cierra todo en una sesi?n de juego */
{
    _fade_edges = 0;
    qdgdfv_logger(_game_name,
              qdgdfv_sprintf("Shutdown - Frames per sec.: %d / %d",
                     _avg_frames_per_sec, _max_frames_per_sec));
}
Esempio n. 3
0
/**
 * qdgdfv_assert_in_virtual_screen - Asserts that a pointer is inside the virtual screen.
 * @func: function where the test is happening
 * @ptr: the pointer
 *
 * Asserts that a pointer falls inside the virtual screen.
 * If it's outside (less than _qdgdfv_virtual_screen or further the
 * end of the virtual screen), aborts.
 */
void qdgdfv_assert_in_virtual_screen(char *func, unsigned char *ptr)
{
	int diff;

	diff = (int) (ptr - _qdgdfv_virtual_screen);

	if (diff < 0 || diff >= (_qdgdfv_screen_x_size * _qdgdfv_screen_y_size))
		qdgdfv_bang(func, qdgdfv_sprintf("virtual screen diff: %d", diff));
}
Esempio n. 4
0
void show_info(void)
{
    int c = qdgdfv_seek_color(255, 255, 255);
    int y;

    qdgdfv_clear_virtual_screen();

    for (y = 0; info[y] != NULL; y++)
        qdgdfv_font_print(1, y * _qdgdfv_font_height, (unsigned char *)info[y], c);

    qdgdfv_font_print(1, y * _qdgdfv_font_height,
            (unsigned char *)qdgdfv_sprintf("%d %c", _qdgdfv_key_alnum, _qdgdfv_alnum),
            c);

    qdgdfv_font_print(-1, -1, (unsigned char *)"Press ESCAPE", c);

    qdgdfv_dump_virtual_screen();
}