Commit bda1ac7f authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist

Typo. Use GLib random functions.

2000-12-17  Tor Lillqvist  <tml@iki.fi>

	* config.h.win32: Typo.
	Use GLib random functions.

	* plug-ins/makefile.mingw.in (COMMON): Add gee_zoom.

	* plug-ins/common/animationplay.c: Win32-specific #include and
	#define stuff not needed any longer.

	* plug-ins/FractalExplorer/FractalExplorer.c
	* plug-ins/common/gz.c
	* plug-ins/common/hrz.c: No use trying to use G_OS_WIN32 to decide
	whether to include glib.h, as glib.h is where G_OS_WIN32 gets
	defined...

	* plug-ins/common/gee.c: Can't use "environ" as variable name,
	it's in the C library.h on various systems. Use the name "env"
	instead.
parent 1d81bcaa
2000-12-17 Tor Lillqvist <tml@iki.fi>
* config.h.win32: Typo.
Use GLib random functions.
* plug-ins/makefile.mingw.in (COMMON): Add gee_zoom.
* plug-ins/common/animationplay.c: Win32-specific #include and
#define stuff not needed any longer.
* plug-ins/FractalExplorer/FractalExplorer.c
* plug-ins/common/gz.c
* plug-ins/common/hrz.c: No use trying to use G_OS_WIN32 to decide
whether to include glib.h, as glib.h is where G_OS_WIN32 gets
defined...
* plug-ins/common/gee.c: Can't use "environ" as variable name,
it's in the C library.h on various systems. Use the name "env"
instead.
2000-12-17 Michael Natterer <mitch@gimp.org>
* plug-ins/FractalExplorer/FractalExplorer.c
......
......@@ -84,7 +84,7 @@
/* #undef HAVE_STPCPY */
/* #undef HAVE_SYS_DIR_H */
/* #undef HAVE_SYS_NDIR_H */
/* #undef HAVE_SYS_PARAM_H /*
/* #undef HAVE_SYS_PARAM_H */
/* #undef HAVE_SYS_SELECT_H */
/* #undef HAVE_SYS_TIME_H */
/* #undef HAVE_SYS_TIMES_H */
......@@ -98,8 +98,8 @@
/* #undef NO_DIFFTIME */
/* #undef NO_FD_SET */
#define RAND_FUNC rand
#define SRAND_FUNC srand
#define RAND_FUNC g_random_int
#define SRAND_FUNC g_random_set_seed
/* #undef USE_PTHREADS */
......
......@@ -51,10 +51,6 @@
#include "config.h"
#ifdef G_OS_WIN32
#include <glib.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......@@ -68,6 +64,15 @@
#endif
#include <ctype.h>
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include "pix_data.h"
#include "FractalExplorer.h"
#include "Events.h"
#include "Dialogs.h"
#ifdef G_OS_WIN32
#include <io.h>
......@@ -82,15 +87,6 @@
#endif
#endif
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#include "pix_data.h"
#include "FractalExplorer.h"
#include "Events.h"
#include "Dialogs.h"
#include "libgimp/stdplugins-intl.h"
static void query (void);
......
......@@ -113,16 +113,6 @@
#include <string.h>
#include <ctype.h>
#ifdef G_OS_WIN32
#include <glib.h>
/* This just to be able to include windows.h and undef RGB */
#define WinMain WinMain_foo
#include <windows.h>
#undef WinMain
#undef RGB
#endif
#include <gtk/gtk.h>
#ifndef GDK_WINDOWING_WIN32
#include <gdk/gdkx.h>
......
......@@ -58,15 +58,6 @@
#include "config.h"
#ifdef G_OS_WIN32
#include <glib.h>
#define STRICT
#define WinMain WinMain_foo
#include <windows.h>
#undef WinMain
#endif
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
......@@ -90,6 +81,13 @@
#include <libgimp/gimp.h>
#ifdef G_OS_WIN32
#define STRICT
#define WinMain WinMain_foo
#include <windows.h>
#undef WinMain
#endif
#include "libgimp/stdplugins-intl.h"
......
......@@ -68,7 +68,7 @@ GimpPlugInInfo PLUG_IN_INFO =
/* Global widgets'n'stuff */
static guchar *disp; /* RGBX preview data */
static guchar *environ; /* src warping image data */
static guchar *env; /* src warping image data */
static guchar *bump1base;
static guchar *bump1;
static guchar *bump2base;
......@@ -406,7 +406,7 @@ iterate (void)
frame++;
env = (guint32*) environ;
env = (guint32*) env;
dest = (guint32*) disp;
srcbump = (frame&1) ? bump1 : bump2;
destbump = (frame&1) ? bump2 : bump1;
......@@ -615,8 +615,7 @@ render_frame (void)
for (i=0;i<bytes;i++)
{
disp[i] =
environ[i];
disp[i] = env[i];
}
}
#endif
......@@ -638,7 +637,7 @@ init_preview_misc (void)
has_alpha = gimp_drawable_has_alpha(drawable->id);
environ = g_malloc (4 * IWIDTH * IHEIGHT * 2);
env = g_malloc (4 * IWIDTH * IHEIGHT * 2);
disp = g_malloc ((IWIDTH + 2 + IWIDTH * IHEIGHT) * 4);
bump1base = g_malloc (IWIDTH * IHEIGHT + IWIDTH+IWIDTH);
bump2base = g_malloc (IWIDTH * IHEIGHT + IWIDTH+IWIDTH);
......@@ -663,22 +662,22 @@ init_preview_misc (void)
FALSE,
FALSE);
gimp_pixel_rgn_get_rect (&pixel_rgn,
&environ[(256*i +
(
(
drawable->width<256 ?
(256-drawable->width)/2 :
0
)
+
(
drawable->height<256 ?
(256-drawable->height)/2 :
0
) * 256
)) *
gimp_drawable_bpp
(drawable->id)
&env[(256*i +
(
(
drawable->width<256 ?
(256-drawable->width)/2 :
0
)
+
(
drawable->height<256 ?
(256-drawable->height)/2 :
0
) * 256
)) *
gimp_drawable_bpp
(drawable->id)
],
drawable->width>256?
(drawable->width/2-128):0,
......@@ -700,7 +699,7 @@ init_preview_misc (void)
FALSE,
FALSE);
gimp_pixel_rgn_get_rect (&pixel_rgn,
environ,
env,
drawable->width>256?(drawable->width/2-128):0,
drawable->height>256?(drawable->height/2-128):0,
MIN(256,drawable->width),
......@@ -719,24 +718,24 @@ init_preview_misc (void)
{
for (i=IWIDTH*IHEIGHT;i>0;i--)
{
environ[4*(i-1)+2] =
((palette[3*(environ[(i-1)*2])+2]*environ[(i-1)*2+1])/255)
+ ((255-environ[(i-1)*2+1])*((i&255) ^ (i>>8)))/255;
environ[4*(i-1)+1] =
((palette[3*(environ[(i-1)*2])+1]*environ[(i-1)*2+1])/255)
+ ((255-environ[(i-1)*2+1])*((i&255) ^ (i>>8)))/255;
environ[4*(i-1)+0] =
((palette[3*(environ[(i-1)*2])+0]*environ[(i-1)*2+1])/255)
+ ((255-environ[(i-1)*2+1])*((i&255) ^ (i>>8)))/255;
env[4*(i-1)+2] =
((palette[3*(env[(i-1)*2])+2]*env[(i-1)*2+1])/255)
+ ((255-env[(i-1)*2+1])*((i&255) ^ (i>>8)))/255;
env[4*(i-1)+1] =
((palette[3*(env[(i-1)*2])+1]*env[(i-1)*2+1])/255)
+ ((255-env[(i-1)*2+1])*((i&255) ^ (i>>8)))/255;
env[4*(i-1)+0] =
((palette[3*(env[(i-1)*2])+0]*env[(i-1)*2+1])/255)
+ ((255-env[(i-1)*2+1])*((i&255) ^ (i>>8)))/255;
}
}
else
{
for (i=IWIDTH*IHEIGHT;i>0;i--)
{
environ[4*(i-1)+2] = palette[3*(environ[i-1])+2];
environ[4*(i-1)+1] = palette[3*(environ[i-1])+1];
environ[4*(i-1)+0] = palette[3*(environ[i-1])+0];
env[4*(i-1)+2] = palette[3*(env[i-1])+2];
env[4*(i-1)+1] = palette[3*(env[i-1])+1];
env[4*(i-1)+0] = palette[3*(env[i-1])+0];
}
}
break;
......@@ -746,24 +745,24 @@ init_preview_misc (void)
{
for (i=0;i<IWIDTH*IHEIGHT;i++)
{
environ[i*4+2] =
(environ[i*4+2]*environ[i*4+3])/255
+ ((255-environ[i*4+3])*((i&255) ^ (i>>8)))/255;
environ[i*4+1] =
(environ[i*4+1]*environ[i*4+3])/255
+ ((255-environ[i*4+3])*((i&255) ^ (i>>8)))/255;
environ[i*4+0] =
(environ[i*4+0]*environ[i*4+3])/255
+ ((255-environ[i*4+3])*((i&255) ^ (i>>8)))/255;
env[i*4+2] =
(env[i*4+2]*env[i*4+3])/255
+ ((255-env[i*4+3])*((i&255) ^ (i>>8)))/255;
env[i*4+1] =
(env[i*4+1]*env[i*4+3])/255
+ ((255-env[i*4+3])*((i&255) ^ (i>>8)))/255;
env[i*4+0] =
(env[i*4+0]*env[i*4+3])/255
+ ((255-env[i*4+3])*((i&255) ^ (i>>8)))/255;
}
}
else
{
for (i=IWIDTH*IHEIGHT;i>0;i--)
{
environ[4*(i-1)+2] = environ[(i-1)*3+2];
environ[4*(i-1)+1] = environ[(i-1)*3+1];
environ[4*(i-1)+0] = environ[(i-1)*3+0];
env[4*(i-1)+2] = env[(i-1)*3+2];
env[4*(i-1)+1] = env[(i-1)*3+1];
env[4*(i-1)+0] = env[(i-1)*3+0];
}
}
break;
......@@ -776,15 +775,15 @@ init_preview_misc (void)
for (i = 0; i < IWIDTH*IHEIGHT/2; i++)
{
guchar t;
t = environ[4*(i)+0];
environ[4*(i)+0] = environ[4*(IWIDTH*IHEIGHT-(i+1))+0];
environ[4*(IWIDTH*IHEIGHT-(i+1))+0] = t;
t = environ[4*(i)+1];
environ[4*(i)+1] = environ[4*(IWIDTH*IHEIGHT-(i+1))+1];
environ[4*(IWIDTH*IHEIGHT-(i+1))+1] = t;
t = environ[4*(i)+2];
environ[4*(i)+2] = environ[4*(IWIDTH*IHEIGHT-(i+1))+2];
environ[4*(IWIDTH*IHEIGHT-(i+1))+2] = t;
t = env[4*(i)+0];
env[4*(i)+0] = env[4*(IWIDTH*IHEIGHT-(i+1))+0];
env[4*(IWIDTH*IHEIGHT-(i+1))+0] = t;
t = env[4*(i)+1];
env[4*(i)+1] = env[4*(IWIDTH*IHEIGHT-(i+1))+1];
env[4*(IWIDTH*IHEIGHT-(i+1))+1] = t;
t = env[4*(i)+2];
env[4*(i)+2] = env[4*(IWIDTH*IHEIGHT-(i+1))+2];
env[4*(IWIDTH*IHEIGHT-(i+1))+2] = t;
}
}
......
......@@ -58,15 +58,6 @@
#include "config.h"
#ifdef G_OS_WIN32
#include <glib.h>
#define STRICT
#define WinMain WinMain_foo
#include <windows.h>
#undef WinMain
#endif
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
......@@ -90,6 +81,13 @@
#include <libgimp/gimp.h>
#ifdef G_OS_WIN32
#define STRICT
#define WinMain WinMain_foo
#include <windows.h>
#undef WinMain
#endif
#include "libgimp/stdplugins-intl.h"
......
......@@ -33,10 +33,6 @@
#include "config.h"
#ifdef G_OS_WIN32
#include <glib.h>
#endif
#include <setjmp.h>
#include <sys/types.h>
#include <sys/stat.h>
......
......@@ -78,6 +78,7 @@ COMMON = \
gauss_rle \
gbr \
gee \
gee_zoom \
gicon \
gif \
gifload \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment