This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via fa2fab96f4932dece35de36740e2f1e4af38afd2 (commit) from d0bab795ded3a1c36fcc330aa7dcc91748351fd3 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/fa2fab96f4932dece35de36740e2f1e4af38a...
commit fa2fab96f4932dece35de36740e2f1e4af38afd2 Author: Cyril Hrubis metan@ucw.cz Date: Fri Nov 2 12:38:44 2012 +0100
tests: Remove symboltests.
diff --git a/tests/SDL/Makefile b/tests/SDL/Makefile index 9e60d18..1a27121 100644 --- a/tests/SDL/Makefile +++ b/tests/SDL/Makefile @@ -7,7 +7,7 @@ LDLIBS+=-lGP -L$(TOPDIR)/build/ -lGP_SDL -lSDL ifeq ($(HAVE_LIBSDL),yes) CSOURCES=$(shell echo *.c)
-APPS=symbolstest textaligntest blittest subcontext+APPS=textaligntest blittest subcontext aatest mixpixeltest endif
diff --git a/tests/SDL/symbolstest.c b/tests/SDL/symbolstest.c deleted file mode 100644 index be96422..0000000 --- a/tests/SDL/symbolstest.c +++ /dev/null @@ -1,195 +0,0 @@ -/***************************************************************************** - * This file is part of gfxprim library. * - * * - * Gfxprim is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * Gfxprim is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with gfxprim; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, * - * Boston, MA 02110-1301 USA * - * * - * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos * - * jiri.bluebear.dluhos@gmail.com * - * * - * Copyright (C) 2009-2011 Cyril Hrubis metan@ucw.cz * - * * - *****************************************************************************/ - -#include <stdio.h> -#include <stdlib.h> -#include <SDL/SDL.h> - -#include "GP_SDL.h" - -static GP_Pixel black; - -/* The surface used as a display (in fact it is a software surface). */ -SDL_Surface *display = NULL; -GP_Context context; - -/* Timer used for refreshing the display */ -SDL_TimerID timer; - -/* An event used for signaling that the timer was triggered. */ -SDL_UserEvent timer_event; - -static int pause_flag = 0; - -static int fill_flag = 0; - -Uint32 timer_callback(__attribute__((unused)) Uint32 interval, - __attribute__((unused)) void *param) -{ - timer_event.type = SDL_USEREVENT; - SDL_PushEvent((SDL_Event *) &timer_event); - return 60; -} - -void random_point(SDL_Surface *surf, int *x, int *y) -{ - *x = random() % surf->w; - *y = random() % surf->h; -} - -void draw_random_symbol(GP_Pixel pixel) -{ - int x, y, w, h; - random_point(display, &x, &y); - - w = (random() % 10) + 5; - h = (random() % 10) + 5; - - if (fill_flag) - GP_FillSymbol(&context, random() % GP_SYM_MAX, x, y, w, h, - pixel); - else - GP_Symbol(&context, random() % GP_SYM_MAX, x, y, w, h, - pixel); -} - -void clear_screen(void) -{ - SDL_LockSurface(display); - GP_Fill(&context, black); - SDL_UnlockSurface(display); -} - -void redraw_screen(void) -{ - if (pause_flag) - return; - - SDL_LockSurface(display); - - GP_Pixel pixel; - pixel = GP_RGBToPixel(random() % 256, random() % 256, - random() % 256, context.pixel_type); - - draw_random_symbol(pixel); - - SDL_UnlockSurface(display); -} - -void event_loop(void) -{ - SDL_Event event; - - while (SDL_WaitEvent(&event) > 0) { - - switch (event.type) { - - case SDL_USEREVENT: - redraw_screen(); - SDL_Flip(display); - break; - - case SDL_KEYDOWN: - switch (event.key.keysym.sym) { - case SDLK_SPACE: - fill_flag = !fill_flag; - clear_screen(); - break; - case SDLK_p: - pause_flag = !pause_flag; - break; - case SDLK_ESCAPE: - return; - - default: - break; - } - break; - case SDL_QUIT: - return; - default: - break; - } - } -} - -int main(int argc, char *argv[]) -{ - /* Bits per pixel to be set for the display surface. */ - int display_bpp = 0; - - int i; - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-16") == 0) { - display_bpp = 16; - } - else if (strcmp(argv[i], "-24") == 0) { - display_bpp = 24; - } - else if (strcmp(argv[i], "-32") == 0) { - display_bpp = 32; - } - } - - /* Initialize SDL */ - if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0) { - fprintf(stderr, "Could not initialize SDL: %sn", SDL_GetError()); - return 1; - } - - /* Create a window with a software back surface */ - display = SDL_SetVideoMode(640, 480, display_bpp, SDL_SWSURFACE); - if (display == NULL) { - fprintf(stderr, "Could not open display: %sn", SDL_GetError()); - goto fail; - } - - /* Set up a clipping rectangle to test proper clipping of pixels */ - SDL_Rect clip_rect = {10, 10, 620, 460}; - SDL_SetClipRect(display, &clip_rect); - - GP_SDL_ContextFromSurface(&context, display); - - black = GP_ColorToContextPixel(GP_COL_BLACK, &context); - - /* Set up the refresh timer */ - timer = SDL_AddTimer(60, timer_callback, NULL); - if (timer == 0) { - fprintf(stderr, "Could not set up timer: %sn", SDL_GetError()); - goto fail; - } - - /* Enter the event loop */ - event_loop(); - - /* We're done */ - SDL_Quit(); - return 0; - -fail: - SDL_Quit(); - return 1; -} -
-----------------------------------------------------------------------
Summary of changes: tests/SDL/Makefile | 2 +- tests/SDL/symbolstest.c | 195 ----------------------------------------------- 2 files changed, 1 insertions(+), 196 deletions(-) delete mode 100644 tests/SDL/symbolstest.c
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.