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/fa2fab96f4932dece35de36740e2f1e4af38…
commit fa2fab96f4932dece35de36740e2f1e4af38afd2
Author: Cyril Hrubis <metan(a)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(a)gmail.com> *
- * *
- * Copyright (C) 2009-2011 Cyril Hrubis <metan(a)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(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
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 ff0706d61e00ba22fcb83e4902461b1832ab1023 (commit)
from d0453af494e305191b9d85f6f35fbc06b828d61d (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/ff0706d61e00ba22fcb83e4902461b1832ab…
commit ff0706d61e00ba22fcb83e4902461b1832ab1023
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Wed Oct 31 18:30:59 2012 +0100
gfx: algo: Fix negative and zero radius for Circle
The gfx prototypes are not correct though.
diff --git a/libs/gfx/algo/Circle.algo.h b/libs/gfx/algo/Circle.algo.h
index f5f5acc..76deb83 100644
--- a/libs/gfx/algo/Circle.algo.h
+++ b/libs/gfx/algo/Circle.algo.h
@@ -74,10 +74,20 @@
* FN_NAME - name of the function to be defined
*/
#define DEF_CIRCLE_FN(FN_NAME, CONTEXT_T, PIXVAL_T, PUTPIXEL) -void FN_NAME(CONTEXT_T context, int xcenter, int ycenter, unsigned int r, +void FN_NAME(CONTEXT_T context, int xcenter, int ycenter, int r, PIXVAL_T pixval) { int x, y, error; ++ /* Special case for r == 0 */ + if (r == 0) { + PUTPIXEL(context, xcenter, ycenter, pixval); + return; + } ++ /* Clip negative r */ + r = r < 0 ? -r : r; + for (x = 0, error = -r, y = r; y >= 0; y--) { /* Iterate X until we can pass to the next line. */
-----------------------------------------------------------------------
Summary of changes:
libs/gfx/algo/Circle.algo.h | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
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 a74fce450b62265d5dc4b80f43a89bfeb570e271 (commit)
from 8701e8765185f90507ff6a02c03fcf0c22ae1e8f (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/a74fce450b62265d5dc4b80f43a89bfeb570…
commit a74fce450b62265d5dc4b80f43a89bfeb570e271
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Tue Oct 30 22:25:02 2012 +0100
tests: Remove pixeltests.
diff --git a/tests/SDL/Makefile b/tests/SDL/Makefile
index 6985861..35a76e1 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=pixeltest fonttest+APPS=fonttest symbolstest textaligntest blittest subcontext aatest mixpixeltest
endif
diff --git a/tests/SDL/pixeltest.c b/tests/SDL/pixeltest.c
deleted file mode 100644
index 6d7ccf0..0000000
--- a/tests/SDL/pixeltest.c
+++ /dev/null
@@ -1,169 +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(a)gmail.com> *
- * *
- * Copyright (C) 2009-2011 Cyril Hrubis <metan(a)ucw.cz> *
- * *
- *****************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <SDL/SDL.h>
-
-#include "GP.h"
-#include "GP_SDL.h"
-
-/* 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;
-
-/* Values for color pixels in display format. */
-GP_Pixel red_pixel, green_pixel, blue_pixel, white_pixel;
-
-Uint32 timer_callback(__attribute__((unused)) Uint32 interval,
- __attribute__((unused)) void *param)
-{
- timer_event.type = SDL_USEREVENT;
- SDL_PushEvent((SDL_Event *) &timer_event);
- return 30;
-}
-
-void draw_pixel(void)
-{
- GP_Pixel pixel;
- int x = random() % 320;
- int y = random() % 240;
-
- pixel = GP_GetPixel(&context, x, y);
-
- if (pixel == blue_pixel) {
- GP_PutPixel(&context, x, y, green_pixel);
- }
- else if (pixel == red_pixel) {
- GP_PutPixel(&context, x, y, white_pixel);
- }
- else {
- if (x < 160) {
- GP_PutPixel(&context, x, y, blue_pixel);
- } else {
- GP_PutPixel(&context, x, y, red_pixel);
- }
- }
-}
-
-void draw_pixels(void)
-{
- SDL_LockSurface(display);
-
- /* Draw some pixels (exact number is not important). */
- int i;
- for (i = 0; i < 30; i++)
- draw_pixel();
-
- SDL_UnlockSurface(display);
-}
-
-void event_loop(void)
-{
- SDL_Event event;
-
- while (SDL_WaitEvent(&event) > 0) {
- switch (event.type) {
- case SDL_USEREVENT:
- draw_pixels();
- SDL_Flip(display);
- break;
- case SDL_KEYDOWN:
- case SDL_QUIT:
- return;
- }
- }
-}
-
-int main(int argc, char **argv)
-{
- 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;
- }
- }
-
- /* 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(320, 240, display_bpp, SDL_SWSURFACE);
- if (display == NULL) {
- fprintf(stderr, "Could not open display: %sn", SDL_GetError());
- goto fail;
- }
-
-
- /* Print basic information about the surface */
- printf("Display surface properties:n");
- printf(" width: %4d, height: %4d, pitch: %4dn",
- display->w, display->h, display->pitch);
- printf(" bits per pixel: %2d, bytes per pixel: %2dn",
- display->format->BitsPerPixel, display->format->BytesPerPixel);
-
- /* Set up a clipping rectangle to test proper clipping of pixels */
- SDL_Rect clip_rect = {10, 10, 300, 220};
- SDL_SetClipRect(display, &clip_rect);
-
- GP_SDL_ContextFromSurface(&context, display);
-
- /* Load pixel values compatible with the display. */
- red_pixel = GP_ColorToContextPixel(GP_COL_RED, &context);
- green_pixel = GP_ColorToContextPixel(GP_COL_GREEN, &context);
- blue_pixel = GP_ColorToContextPixel(GP_COL_BLUE, &context);
- white_pixel = GP_ColorToContextPixel(GP_COL_WHITE, &context);
-
- /* Set up the refresh timer */
- timer = SDL_AddTimer(30, 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/pixeltest.c | 169 -------------------------------------------------
2 files changed, 1 insertions(+), 170 deletions(-)
delete mode 100644 tests/SDL/pixeltest.c
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")