From 1da0c96db89e2a1c221ba0ba7acd321da523fee9 Mon Sep 17 00:00:00 2001 From: Franck Charlet Date: Mon, 23 May 2011 22:36:39 +0000 Subject: [PATCH 01/15] fixed makefile for OSX regarding scripts git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1788 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/.DS_Store | Bin 24580 -> 24580 bytes src/Makefile | 13 ++++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/.DS_Store b/src/.DS_Store index 98526fb477415d5c1242b5006c69f7d887171057..0be3b5309f69205baf9abc5973f128efed2ea8ca 100644 GIT binary patch delta 205 zcmZoUz}Rwtal|}=V^fxcpc*+Rm^}B7Jpe4`5 zyzIO^P>b&5`#L^Qw*KZ=-Mt_sV8e7Ld+Ue8IQpBf>i}Nm}&9_Rm07@RdzB@ZV)ltyj0^kBg@GJQL{Er z(2{4G%&%-T`Js*%^McU$$pz~An`3qNGJ@1i_SO$)0h%HU7QL$flW}r^u;JwYhP%P^ TYa@HGY0<_ZoWz=8ude_A?r=b6 diff --git a/src/Makefile b/src/Makefile index 136c0eca..c0a05bbf 100644 --- a/src/Makefile +++ b/src/Makefile @@ -388,6 +388,12 @@ all : $(MACAPPEXE) $(MACAPPEXE) : $(BIN) rm -rf Grafx2.app mkdir -p Grafx2.app Grafx2.app/Contents Grafx2.app/Contents/Frameworks Grafx2.app/Contents/MacOS Grafx2.app/Contents/Resources Grafx2.app/Contents/Resources/scripts + mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.3 + mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.3/brush + mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.3/demo + mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.3/libs + mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.3/palette + mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.3/picture echo 'APPL????' > Grafx2.app/Contents/PkgInfo cp ../Info.plist Grafx2.app/Contents cp -r Grafx2.icns Grafx2.app/Contents/Resources @@ -395,13 +401,18 @@ $(MACAPPEXE) : $(BIN) cp -r ../share/grafx2/fonts Grafx2.app/Contents/Resources cp -r ../share/grafx2/skins Grafx2.app/Contents/Resources cp -r ../share/grafx2/gfx2def.ini Grafx2.app/Contents/Resources - cp -r $(SCRIPT_FILES) Grafx2.app/Contents/Resources/scripts + cp -r ../share/grafx2/scripts/samples_2.3/brush Grafx2.app/Contents/Resources/scripts/samples_2.3 + cp -r ../share/grafx2/scripts/samples_2.3/demo Grafx2.app/Contents/Resources/scripts/samples_2.3 + cp -r ../share/grafx2/scripts/samples_2.3/libs Grafx2.app/Contents/Resources/scripts/samples_2.3 + cp -r ../share/grafx2/scripts/samples_2.3/palette Grafx2.app/Contents/Resources/scripts/samples_2.3 + cp -r ../share/grafx2/scripts/samples_2.3/picture Grafx2.app/Contents/Resources/scripts/samples_2.3 mkdir -p Grafx2.app/Contents/Frameworks/SDL.framework/Versions mkdir -p Grafx2.app/Contents/Frameworks/SDL_image.framework/Versions # mkdir -p Grafx2.app/Contents/Frameworks/SDL_ttf.framework/Versions cp -Rp $(FWDIR)/SDL.framework/Versions/A Grafx2.app/Contents/Frameworks/SDL.framework/Versions cp -Rp $(FWDIR)/SDL_image.framework/Versions/A Grafx2.app/Contents/Frameworks/SDL_image.framework/Versions # cp -Rp $(FWDIR)/SDL_ttf.framework/Versions/A Grafx2.app/Contents/Frameworks/SDL_ttf.framework/Versions + # remove those rm -fr Grafx2.app/Contents/Frameworks/SDL.framework/Versions/A/Headers rm -fr Grafx2.app/Contents/Frameworks/SDL.framework/Versions/A/Resources rm -fr Grafx2.app/Contents/Frameworks/SDL_image.framework/Versions/A/Headers From 2d8c061e3220a592dd894ccde4ebbd80c6c16897 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sat, 4 Jun 2011 15:22:13 +0000 Subject: [PATCH 02/15] Improved brush rotation by adding 3 steps of scale2x. Result is not as good as I hoped, but for large flat surfaces, the edges are indeed much smoother than before. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1789 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/brush.c | 110 +++++++++++++++++++++++++++---- src/brush.h | 2 + src/brush_ops.c | 4 +- src/op_c.c | 172 ++++++++++++++++++++++++++++++++++++++++++------ src/operatio.c | 11 ++++ src/pversion.c | 2 +- 6 files changed, 263 insertions(+), 38 deletions(-) diff --git a/src/brush.c b/src/brush.c index f3001505..6b912029 100644 --- a/src/brush.c +++ b/src/brush.c @@ -36,6 +36,10 @@ #include "sdlscreen.h" #include "brush.h" +// Data used during brush rotation operation +static byte * Brush_rotate_buffer; +static int Brush_rotate_width; +static int Brush_rotate_height; // Calcul de redimensionnement du pinceau pour éviter les débordements de // l'écran et de l'image @@ -1670,7 +1674,8 @@ void Interpolate_texture(int start_x,int start_y,int xt1,int yt1, -void Compute_quad_texture(int x1,int y1,int xt1,int yt1, +void Compute_quad_texture( byte *texture, int texture_width, + int x1,int y1,int xt1,int yt1, int x2,int y2,int xt2,int yt2, int x3,int y3,int xt3,int yt3, int x4,int y4,int xt4,int yt4, @@ -1719,7 +1724,7 @@ void Compute_quad_texture(int x1,int y1,int xt1,int yt1, xt=Round((float)(ScanY_Xt[0][y])+(temp*(ScanY_Xt[1][y]-ScanY_Xt[0][y]))); yt=Round((float)(ScanY_Yt[0][y])+(temp*(ScanY_Yt[1][y]-ScanY_Yt[0][y]))); if (xt>=0 && yt>=0) - buffer[x+(y*width)]=*(Brush_original_pixels + yt * Brush_width + xt); + buffer[x+(y*width)]=*(texture + yt * texture_width + xt); } for (; x>1); end_x=start_x+Brush_width-1; end_y=start_y+Brush_height-1; + //offset = Brush_rotate_width/Brush_width-1; Transform_point(start_x,start_y, cos_a,sin_a, &x1,&y1); Transform_point(end_x ,start_y, cos_a,sin_a, &x2,&y2); @@ -1780,10 +1859,11 @@ void Rotate_brush(float angle) return; } // Et maintenant on calcule la nouvelle brosse tournée. - Compute_quad_texture(x1,y1, 0, 0, - x2,y2,Brush_width-1, 0, - x3,y3, 0,Brush_height-1, - x4,y4,Brush_width-1,Brush_height-1, + Compute_quad_texture( Brush_rotate_buffer, Brush_rotate_width, + x1,y1, offset, offset, + x2,y2,Brush_rotate_width-offset-1, offset, + x3,y3, offset,Brush_rotate_height-offset-1, + x4,y4,Brush_rotate_width-offset-1,Brush_rotate_height-offset-1, new_brush,new_brush_width,new_brush_height); if (Realloc_brush(new_brush_width, new_brush_height, new_brush, NULL)) @@ -1802,7 +1882,8 @@ void Rotate_brush(float angle) -void Draw_quad_texture_preview(int x1,int y1,int xt1,int yt1, +void Draw_quad_texture_preview(byte *texture, int texture_width, + int x1,int y1,int xt1,int yt1, int x2,int y2,int xt2,int yt2, int x3,int y3,int xt3,int yt3, int x4,int y4,int xt4,int yt4) @@ -1861,7 +1942,7 @@ void Draw_quad_texture_preview(int x1,int y1,int xt1,int yt1, yt=Round((float)(ScanY_Yt[0][y])+(temp*(ScanY_Yt[1][y]-ScanY_Yt[0][y]))); if (xt>=0 && yt>=0) { - color=Read_pixel_from_brush(xt,yt); + color=Brush_colormap[*(texture+xt+yt*texture_width)]; if (color!=Back_color) Pixel_preview(x,y_,color); } @@ -1885,6 +1966,7 @@ void Rotate_brush_preview(float angle) int start_x,end_x,start_y,end_y; float cos_a=cos(angle); float sin_a=sin(angle); + int offset=0; // Calcul des coordonnées des 4 coins: // 1 2 @@ -1894,6 +1976,7 @@ void Rotate_brush_preview(float angle) start_y=1-(Brush_height>>1); end_x=start_x+Brush_width-1; end_y=start_y+Brush_height-1; + //offset = Brush_rotate_width/Brush_width-1; Transform_point(start_x,start_y, cos_a,sin_a, &x1,&y1); Transform_point(end_x ,start_y, cos_a,sin_a, &x2,&y2); @@ -1910,10 +1993,11 @@ void Rotate_brush_preview(float angle) y4+=Brush_rotation_center_Y; // Et maintenant on dessine la brosse tournée. - Draw_quad_texture_preview(x1,y1, 0, 0, - x2,y2,Brush_width-1, 0, - x3,y3, 0,Brush_height-1, - x4,y4,Brush_width-1,Brush_height-1); + Draw_quad_texture_preview(Brush_rotate_buffer, Brush_rotate_width, + x1, y1, offset, offset, + x2, y2, Brush_rotate_width-offset-1, offset, + x3, y3, offset, Brush_rotate_height-offset-1, + x4, y4, Brush_rotate_width-offset-1, Brush_rotate_height-offset-1); start_x=Min(Min(x1,x2),Min(x3,x4)); end_x=Max(Max(x1,x2),Max(x3,x4)); start_y=Min(Min(y1,y2),Min(y3,y4)); diff --git a/src/brush.h b/src/brush.h index 9682b1fe..d12defb2 100644 --- a/src/brush.h +++ b/src/brush.h @@ -125,5 +125,7 @@ byte Realloc_brush(word new_brush_width, word new_brush_height, byte *new_brush, /// Sets brush's original palette and color mapping. void Brush_set_palette(T_Palette *palette); +void Begin_brush_rotation(void); +void End_brush_rotation(void); #endif diff --git a/src/brush_ops.c b/src/brush_ops.c index 405ca753..046621c0 100644 --- a/src/brush_ops.c +++ b/src/brush_ops.c @@ -42,7 +42,6 @@ #define M_PI 3.141592653589793238462643 #endif - /// Simulates clicking the "Draw" button. void Return_to_draw_mode(void) { @@ -971,8 +970,7 @@ void Rotate_brush_1_5(void) { dx=Paintbrush_X-Brush_rotation_center_X; dy=Paintbrush_Y-Brush_rotation_center_Y; - angle=acos(((float)dx)/sqrt((dx*dx)+(dy*dy))); - if (dy>0) angle=M_2PI-angle; + angle=M_2PI-atan2(dy,dx); } if (Menu_is_visible) diff --git a/src/op_c.c b/src/op_c.c index 1838d5d7..45614ff8 100644 --- a/src/op_c.c +++ b/src/op_c.c @@ -386,7 +386,7 @@ int OT_count_colors(T_Occurrence_table * t) // Cluster management // Clusters are boxes in the RGB spaces, defined by 6 corner coordinates : -// Rmax, Rmin, Vmax (or Gmax), Vmin, Rmax, Rmin +// Rmax, Rmin, vmax (or Vmax), vmin, Rmax, Rmin // The median cut algorithm start with a single cluster covering the whole // colorspace then split it in two smaller clusters on the longest axis until // there are 256 non-empty clusters (with some tricks if the original image @@ -403,6 +403,7 @@ void Cluster_pack(T_Cluster * c,T_Occurrence_table * to) { int rmin,rmax,vmin,vmax,bmin,bmax; int r,g,b; + int nbocc; // Find min. and max. values actually used for each component in this cluster @@ -411,15 +412,15 @@ void Cluster_pack(T_Cluster * c,T_Occurrence_table * to) // 256^3*sizeof(int) = 64MB table. If your computer has less free ram and // malloc fails, this will not work at all ! // GIMP use only 6 bits for G and B components in this table. - rmin=c->rmax <<16; rmax=c->rmin << 16; + /*rmin=c->rmax <<16; rmax=c->rmin << 16; vmin=c->vmax << 8; vmax=c->vmin << 8; bmin=c->bmax; bmax=c->bmin; c->occurences=0; - +*/ // Unoptimized code kept here for documentation purpose because the optimized // one is unreadable : run over the whole cluster and find the min and max, // and count the occurences at the same time. - /* + for (r=c->rmin<<16;r<=c->rmax<<16;r+=1<<16) for (g=c->vmin<<8;g<=c->vmax<<8;g+=1<<8) for (b=c->bmin;b<=c->bmax;b++) @@ -436,8 +437,8 @@ void Cluster_pack(T_Cluster * c,T_Occurrence_table * to) c->occurences+=nbocc; } } - */ - + +/* // Optimized version : find the extremums one at a time, so we can reduce the // area to seek for the next one. Start at the edges of the cluster and go to // the center until we find a pixel. @@ -460,10 +461,10 @@ RMAX: if(to->table[r + g + b]) // OT_get { rmax=r; - goto VMIN; + goto vmin; } } -VMIN: +vmin: for(g=c->vmin<<8;g<=c->vmax<<8;g+=1<<8) for(r=rmin;r<=rmax;r+=1<<16) for(b=c->bmin;b<=c->bmax;b++) @@ -471,10 +472,10 @@ VMIN: if(to->table[r + g + b]) // OT_get { vmin=g; - goto VMAX; + goto vmax; } } -VMAX: +vmax: for(g=c->vmax<<8;g>=vmin;g-=1<<8) for(r=rmin;r<=rmax;r+=1<<16) for(b=c->bmin;b<=c->bmax;b++) @@ -521,7 +522,12 @@ ENDCRUSH: c->rmin=rmin>>16; c->rmax=rmax>>16; c->vmin=vmin>>8; c->vmax=vmax>>8; c->bmin=bmin; c->bmax=bmax; +*/ + c->rmin=rmin; c->rmax=rmax; + c->vmin=vmin; c->vmax=vmax; + c->bmin=bmin; c->bmax=bmax; + // Find the longest axis to know which way to split the cluster // This multiplications are supposed to improve the result, but may or may not // work, actually. @@ -559,7 +565,133 @@ ENDCRUSH: } } +void Cluster_split(T_Cluster * c,T_Cluster * c1,T_Cluster * c2,int teinte,T_Occurrence_table * to) +{ + int limite; + int cumul; + int r,v,b; + limite=(c->occurences)/2; + cumul=0; + if (teinte==0) + { + + for (r=c->rmin;r<=c->rmax;r++) + { + for (v=c->vmin;v<=c->vmax;v++) + { + for (b=c->bmin;b<=c->bmax;b++) + { + cumul+=OT_get(to,r,v,b); + if (cumul>=limite) + break; + } + if (cumul>=limite) + break; + } + if (cumul>=limite) + break; + } + + + if (r==c->rmin) + r++; + // R est la valeur de début du 2nd cluster + + c1->Rmin=c->Rmin; c1->Rmax=r-1; + c1->rmin=c->rmin; c1->rmax=r-1; + c1->Gmin=c->Gmin; c1->Vmax=c->Vmax; + c1->vmin=c->vmin; c1->vmax=c->vmax; + c1->Bmin=c->Bmin; c1->Bmax=c->Bmax; + c1->bmin=c->bmin; c1->bmax=c->bmax; + c2->Rmin=r; c2->Rmax=c->Rmax; + c2->rmin=r; c2->rmax=c->rmax; + c2->Gmin=c->Gmin; c2->Vmax=c->Vmax; + c2->vmin=c->vmin; c2->vmax=c->vmax; + c2->Bmin=c->Bmin; c2->Bmax=c->Bmax; + c2->bmin=c->bmin; c2->bmax=c->bmax; + } + else + if (teinte==1) + { + + for (v=c->vmin;v<=c->vmax;v++) + { + for (r=c->rmin;r<=c->rmax;r++) + { + for (b=c->bmin;b<=c->bmax;b++) + { + cumul+=OT_get(to,r,v,b); + if (cumul>=limite) + break; + } + if (cumul>=limite) + break; + } + if (cumul>=limite) + break; + } + + + if (v==c->vmin) + v++; + // V est la valeur de début du 2nd cluster + + c1->Rmin=c->Rmin; c1->Rmax=c->Rmax; + c1->rmin=c->rmin; c1->rmax=c->rmax; + c1->Gmin=c->Gmin; c1->Vmax=v-1; + c1->vmin=c->vmin; c1->vmax=v-1; + c1->Bmin=c->Bmin; c1->Bmax=c->Bmax; + c1->bmin=c->bmin; c1->bmax=c->bmax; + c2->Rmin=c->Rmin; c2->Rmax=c->Rmax; + c2->rmin=c->rmin; c2->rmax=c->rmax; + c2->Gmin=v; c2->Vmax=c->Vmax; + c2->vmin=v; c2->vmax=c->vmax; + c2->Bmin=c->Bmin; c2->Bmax=c->Bmax; + c2->bmin=c->bmin; c2->bmax=c->bmax; + } + else + { + + + for (b=c->bmin;b<=c->bmax;b++) + { + for (v=c->vmin;v<=c->vmax;v++) + { + for (r=c->rmin;r<=c->rmax;r++) + { + cumul+=OT_get(to,r,v,b); + if (cumul>=limite) + break; + } + if (cumul>=limite) + break; + } + if (cumul>=limite) + break; + } + + + if (b==c->bmin) + b++; + // B est la valeur de début du 2nd cluster + + c1->Rmin=c->Rmin; c1->Rmax=c->Rmax; + c1->rmin=c->rmin; c1->rmax=c->rmax; + c1->Gmin=c->Gmin; c1->Vmax=c->Vmax; + c1->vmin=c->vmin; c1->vmax=c->vmax; + c1->Bmin=c->Bmin; c1->Bmax=b-1; + c1->bmin=c->bmin; c1->bmax=b-1; + c2->Rmin=c->Rmin; c2->Rmax=c->Rmax; + c2->rmin=c->rmin; c2->rmax=c->rmax; + c2->Gmin=c->Gmin; c2->Vmax=c->Vmax; + c2->vmin=c->vmin; c2->vmax=c->vmax; + c2->Bmin=b; c2->Bmax=c->Bmax; + c2->bmin=b; c2->bmax=c->bmax; + } +} + +/* /// Split a cluster on its longest axis. /// c = source cluster, c1, c2 = output after split void Cluster_split(T_Cluster * c, T_Cluster * c1, T_Cluster * c2, int hue, @@ -603,14 +735,14 @@ void Cluster_split(T_Cluster * c, T_Cluster * c1, T_Cluster * c2, int hue, c1->Rmin=c->Rmin; c1->Rmax=r-1; c1->rmin=c->rmin; c1->rmax=r-1; - c1->Gmin=c->Gmin; c1->Vmax=c->Vmax; + c1->Gmin=c->Gmin; c1->vmax=c->vmax; c1->vmin=c->vmin; c1->vmax=c->vmax; c1->Bmin=c->Bmin; c1->Bmax=c->Bmax; c1->bmin=c->bmin; c1->bmax=c->bmax; c2->Rmin=r; c2->Rmax=c->Rmax; c2->rmin=r; c2->rmax=c->rmax; - c2->Gmin=c->Gmin; c2->Vmax=c->Vmax; + c2->Gmin=c->Gmin; c2->vmax=c->vmax; c2->vmin=c->vmin; c2->vmax=c->vmax; c2->Bmin=c->Bmin; c2->Bmax=c->Bmax; c2->bmin=c->bmin; c2->bmax=c->bmax; @@ -643,14 +775,14 @@ void Cluster_split(T_Cluster * c, T_Cluster * c1, T_Cluster * c2, int hue, c1->Rmin=c->Rmin; c1->Rmax=c->Rmax; c1->rmin=c->rmin; c1->rmax=c->rmax; - c1->Gmin=c->Gmin; c1->Vmax=g-1; + c1->Gmin=c->Gmin; c1->vmax=g-1; c1->vmin=c->vmin; c1->vmax=g-1; c1->Bmin=c->Bmin; c1->Bmax=c->Bmax; c1->bmin=c->bmin; c1->bmax=c->bmax; c2->Rmin=c->Rmin; c2->Rmax=c->Rmax; c2->rmin=c->rmin; c2->rmax=c->rmax; - c2->Gmin=g; c2->Vmax=c->Vmax; + c2->Gmin=g; c2->vmax=c->vmax; c2->vmin=g; c2->vmax=c->vmax; c2->Bmin=c->Bmin; c2->Bmax=c->Bmax; c2->bmin=c->bmin; c2->bmax=c->bmax; @@ -682,20 +814,20 @@ void Cluster_split(T_Cluster * c, T_Cluster * c1, T_Cluster * c2, int hue, c1->Rmin=c->Rmin; c1->Rmax=c->Rmax; c1->rmin=c->rmin; c1->rmax=c->rmax; - c1->Gmin=c->Gmin; c1->Vmax=c->Vmax; + c1->Gmin=c->Gmin; c1->vmax=c->vmax; c1->vmin=c->vmin; c1->vmax=c->vmax; c1->Bmin=c->Bmin; c1->Bmax=b-1; c1->bmin=c->bmin; c1->bmax=b-1; c2->Rmin=c->Rmin; c2->Rmax=c->Rmax; c2->rmin=c->rmin; c2->rmax=c->rmax; - c2->Gmin=c->Gmin; c2->Vmax=c->Vmax; + c2->Gmin=c->Gmin; c2->vmax=c->vmax; c2->vmin=c->vmin; c2->vmax=c->vmax; c2->Bmin=b; c2->Bmax=c->Bmax; c2->bmin=b; c2->bmax=c->bmax; } } - +*/ /// Compute the mean R, G, B (for palette generation) and H, L (for palette sorting) void Cluster_compute_hue(T_Cluster * c,T_Occurrence_table * to) @@ -757,7 +889,7 @@ void CS_Init(T_Cluster_set * cs, T_Occurrence_table * to) cs->clusters->Gmin = cs->clusters->vmin = 0; cs->clusters->Bmin = cs->clusters->bmin = 0; cs->clusters->Rmax = cs->clusters->rmax = to->rng_r - 1; - cs->clusters->Vmax = cs->clusters->vmax = to->rng_g - 1; + cs->clusters->vmax = cs->clusters->vmax = to->rng_g - 1; cs->clusters->Bmax = cs->clusters->bmax = to->rng_b - 1; cs->clusters->next = NULL; Cluster_pack(cs->clusters, to); @@ -1007,7 +1139,7 @@ void CS_Generate_color_table_and_palette(T_Cluster_set * cs,T_Conversion_table * palette[index].B=current->b; for (r=current->Rmin; r<=current->Rmax; r++) - for (g=current->Gmin;g<=current->Vmax;g++) + for (g=current->Gmin;g<=current->vmax;g++) for (b=current->Bmin;b<=current->Bmax;b++) CT_set(tc,r,g,b,index); current = current->next; @@ -1338,8 +1470,6 @@ void Convert_24b_bitmap_to_256_nearest_neighbor(T_Bitmap256 dest, // For some of them only the first one may work because of ugly optimizations static const byte precision_24b[]= { - 8,8,8, - 6,6,6, 6,6,5, 5,6,5, 5,5,5, diff --git a/src/operatio.c b/src/operatio.c index 92667d37..ee158e11 100644 --- a/src/operatio.c +++ b/src/operatio.c @@ -49,7 +49,17 @@ Uint32 Airbrush_next_time; void Start_operation_stack(word new_operation) { + // This part handles things that must be done when exiting an operation. Brush_rotation_center_is_defined=0; + switch(Current_operation) + { + case OPERATION_ROTATE_BRUSH: + End_brush_rotation(); + break; + + default: + break; + } // On mémorise l'opération précédente si on démarre une interruption switch(new_operation) @@ -61,6 +71,7 @@ void Start_operation_stack(word new_operation) case OPERATION_POLYBRUSH: case OPERATION_STRETCH_BRUSH: case OPERATION_ROTATE_BRUSH: + Begin_brush_rotation(); Operation_before_interrupt=Current_operation; // On passe à l'operation demandée Current_operation=new_operation; diff --git a/src/pversion.c b/src/pversion.c index b60e3b67..bcc14b4d 100644 --- a/src/pversion.c +++ b/src/pversion.c @@ -1,2 +1,2 @@ -char Program_version[]="2.3"; +char Program_version[]="2.4wip"; From 8cf7e1096f4a00bcca24ee6c790a428d3e7cb77d Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sat, 4 Jun 2011 15:25:06 +0000 Subject: [PATCH 03/15] Fix performance bug in previous commit (pre-scale was also performed when entering other tools than 'brush rotate') git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1790 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/operatio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/operatio.c b/src/operatio.c index ee158e11..cbddd2d4 100644 --- a/src/operatio.c +++ b/src/operatio.c @@ -70,6 +70,10 @@ void Start_operation_stack(word new_operation) case OPERATION_GRAB_BRUSH: case OPERATION_POLYBRUSH: case OPERATION_STRETCH_BRUSH: + Operation_before_interrupt=Current_operation; + // On passe à l'operation demandée + Current_operation=new_operation; + break; case OPERATION_ROTATE_BRUSH: Begin_brush_rotation(); Operation_before_interrupt=Current_operation; From 8cc20115d5290d18f91cbd5acddc74e9a363cb18 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sun, 12 Jun 2011 17:56:20 +0000 Subject: [PATCH 04/15] Fix systematic crash of 2.4wip.1790 when loading 24bit images. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1794 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/op_c.c | 170 +++++++---------------------------------------------- 1 file changed, 20 insertions(+), 150 deletions(-) diff --git a/src/op_c.c b/src/op_c.c index 45614ff8..004446e2 100644 --- a/src/op_c.c +++ b/src/op_c.c @@ -386,7 +386,7 @@ int OT_count_colors(T_Occurrence_table * t) // Cluster management // Clusters are boxes in the RGB spaces, defined by 6 corner coordinates : -// Rmax, Rmin, vmax (or Vmax), vmin, Rmax, Rmin +// Rmax, Rmin, Vmax (or Gmax), Vmin, Rmax, Rmin // The median cut algorithm start with a single cluster covering the whole // colorspace then split it in two smaller clusters on the longest axis until // there are 256 non-empty clusters (with some tricks if the original image @@ -403,7 +403,6 @@ void Cluster_pack(T_Cluster * c,T_Occurrence_table * to) { int rmin,rmax,vmin,vmax,bmin,bmax; int r,g,b; - int nbocc; // Find min. and max. values actually used for each component in this cluster @@ -412,15 +411,15 @@ void Cluster_pack(T_Cluster * c,T_Occurrence_table * to) // 256^3*sizeof(int) = 64MB table. If your computer has less free ram and // malloc fails, this will not work at all ! // GIMP use only 6 bits for G and B components in this table. - /*rmin=c->rmax <<16; rmax=c->rmin << 16; + rmin=c->rmax <<16; rmax=c->rmin << 16; vmin=c->vmax << 8; vmax=c->vmin << 8; bmin=c->bmax; bmax=c->bmin; c->occurences=0; -*/ + // Unoptimized code kept here for documentation purpose because the optimized // one is unreadable : run over the whole cluster and find the min and max, // and count the occurences at the same time. - + /* for (r=c->rmin<<16;r<=c->rmax<<16;r+=1<<16) for (g=c->vmin<<8;g<=c->vmax<<8;g+=1<<8) for (b=c->bmin;b<=c->bmax;b++) @@ -437,8 +436,8 @@ void Cluster_pack(T_Cluster * c,T_Occurrence_table * to) c->occurences+=nbocc; } } + */ -/* // Optimized version : find the extremums one at a time, so we can reduce the // area to seek for the next one. Start at the edges of the cluster and go to // the center until we find a pixel. @@ -461,10 +460,10 @@ RMAX: if(to->table[r + g + b]) // OT_get { rmax=r; - goto vmin; + goto VMIN; } } -vmin: +VMIN: for(g=c->vmin<<8;g<=c->vmax<<8;g+=1<<8) for(r=rmin;r<=rmax;r+=1<<16) for(b=c->bmin;b<=c->bmax;b++) @@ -472,10 +471,10 @@ vmin: if(to->table[r + g + b]) // OT_get { vmin=g; - goto vmax; + goto VMAX; } } -vmax: +VMAX: for(g=c->vmax<<8;g>=vmin;g-=1<<8) for(r=rmin;r<=rmax;r+=1<<16) for(b=c->bmin;b<=c->bmax;b++) @@ -522,11 +521,6 @@ ENDCRUSH: c->rmin=rmin>>16; c->rmax=rmax>>16; c->vmin=vmin>>8; c->vmax=vmax>>8; c->bmin=bmin; c->bmax=bmax; -*/ - - c->rmin=rmin; c->rmax=rmax; - c->vmin=vmin; c->vmax=vmax; - c->bmin=bmin; c->bmax=bmax; // Find the longest axis to know which way to split the cluster // This multiplications are supposed to improve the result, but may or may not @@ -565,133 +559,7 @@ ENDCRUSH: } } -void Cluster_split(T_Cluster * c,T_Cluster * c1,T_Cluster * c2,int teinte,T_Occurrence_table * to) -{ - int limite; - int cumul; - int r,v,b; - limite=(c->occurences)/2; - cumul=0; - if (teinte==0) - { - - for (r=c->rmin;r<=c->rmax;r++) - { - for (v=c->vmin;v<=c->vmax;v++) - { - for (b=c->bmin;b<=c->bmax;b++) - { - cumul+=OT_get(to,r,v,b); - if (cumul>=limite) - break; - } - if (cumul>=limite) - break; - } - if (cumul>=limite) - break; - } - - - if (r==c->rmin) - r++; - // R est la valeur de début du 2nd cluster - - c1->Rmin=c->Rmin; c1->Rmax=r-1; - c1->rmin=c->rmin; c1->rmax=r-1; - c1->Gmin=c->Gmin; c1->Vmax=c->Vmax; - c1->vmin=c->vmin; c1->vmax=c->vmax; - c1->Bmin=c->Bmin; c1->Bmax=c->Bmax; - c1->bmin=c->bmin; c1->bmax=c->bmax; - c2->Rmin=r; c2->Rmax=c->Rmax; - c2->rmin=r; c2->rmax=c->rmax; - c2->Gmin=c->Gmin; c2->Vmax=c->Vmax; - c2->vmin=c->vmin; c2->vmax=c->vmax; - c2->Bmin=c->Bmin; c2->Bmax=c->Bmax; - c2->bmin=c->bmin; c2->bmax=c->bmax; - } - else - if (teinte==1) - { - - for (v=c->vmin;v<=c->vmax;v++) - { - for (r=c->rmin;r<=c->rmax;r++) - { - for (b=c->bmin;b<=c->bmax;b++) - { - cumul+=OT_get(to,r,v,b); - if (cumul>=limite) - break; - } - if (cumul>=limite) - break; - } - if (cumul>=limite) - break; - } - - - if (v==c->vmin) - v++; - // V est la valeur de début du 2nd cluster - - c1->Rmin=c->Rmin; c1->Rmax=c->Rmax; - c1->rmin=c->rmin; c1->rmax=c->rmax; - c1->Gmin=c->Gmin; c1->Vmax=v-1; - c1->vmin=c->vmin; c1->vmax=v-1; - c1->Bmin=c->Bmin; c1->Bmax=c->Bmax; - c1->bmin=c->bmin; c1->bmax=c->bmax; - c2->Rmin=c->Rmin; c2->Rmax=c->Rmax; - c2->rmin=c->rmin; c2->rmax=c->rmax; - c2->Gmin=v; c2->Vmax=c->Vmax; - c2->vmin=v; c2->vmax=c->vmax; - c2->Bmin=c->Bmin; c2->Bmax=c->Bmax; - c2->bmin=c->bmin; c2->bmax=c->bmax; - } - else - { - - - for (b=c->bmin;b<=c->bmax;b++) - { - for (v=c->vmin;v<=c->vmax;v++) - { - for (r=c->rmin;r<=c->rmax;r++) - { - cumul+=OT_get(to,r,v,b); - if (cumul>=limite) - break; - } - if (cumul>=limite) - break; - } - if (cumul>=limite) - break; - } - - - if (b==c->bmin) - b++; - // B est la valeur de début du 2nd cluster - - c1->Rmin=c->Rmin; c1->Rmax=c->Rmax; - c1->rmin=c->rmin; c1->rmax=c->rmax; - c1->Gmin=c->Gmin; c1->Vmax=c->Vmax; - c1->vmin=c->vmin; c1->vmax=c->vmax; - c1->Bmin=c->Bmin; c1->Bmax=b-1; - c1->bmin=c->bmin; c1->bmax=b-1; - c2->Rmin=c->Rmin; c2->Rmax=c->Rmax; - c2->rmin=c->rmin; c2->rmax=c->rmax; - c2->Gmin=c->Gmin; c2->Vmax=c->Vmax; - c2->vmin=c->vmin; c2->vmax=c->vmax; - c2->Bmin=b; c2->Bmax=c->Bmax; - c2->bmin=b; c2->bmax=c->bmax; - } -} - -/* /// Split a cluster on its longest axis. /// c = source cluster, c1, c2 = output after split void Cluster_split(T_Cluster * c, T_Cluster * c1, T_Cluster * c2, int hue, @@ -735,14 +603,14 @@ void Cluster_split(T_Cluster * c, T_Cluster * c1, T_Cluster * c2, int hue, c1->Rmin=c->Rmin; c1->Rmax=r-1; c1->rmin=c->rmin; c1->rmax=r-1; - c1->Gmin=c->Gmin; c1->vmax=c->vmax; + c1->Gmin=c->Gmin; c1->Vmax=c->Vmax; c1->vmin=c->vmin; c1->vmax=c->vmax; c1->Bmin=c->Bmin; c1->Bmax=c->Bmax; c1->bmin=c->bmin; c1->bmax=c->bmax; c2->Rmin=r; c2->Rmax=c->Rmax; c2->rmin=r; c2->rmax=c->rmax; - c2->Gmin=c->Gmin; c2->vmax=c->vmax; + c2->Gmin=c->Gmin; c2->Vmax=c->Vmax; c2->vmin=c->vmin; c2->vmax=c->vmax; c2->Bmin=c->Bmin; c2->Bmax=c->Bmax; c2->bmin=c->bmin; c2->bmax=c->bmax; @@ -775,14 +643,14 @@ void Cluster_split(T_Cluster * c, T_Cluster * c1, T_Cluster * c2, int hue, c1->Rmin=c->Rmin; c1->Rmax=c->Rmax; c1->rmin=c->rmin; c1->rmax=c->rmax; - c1->Gmin=c->Gmin; c1->vmax=g-1; + c1->Gmin=c->Gmin; c1->Vmax=g-1; c1->vmin=c->vmin; c1->vmax=g-1; c1->Bmin=c->Bmin; c1->Bmax=c->Bmax; c1->bmin=c->bmin; c1->bmax=c->bmax; c2->Rmin=c->Rmin; c2->Rmax=c->Rmax; c2->rmin=c->rmin; c2->rmax=c->rmax; - c2->Gmin=g; c2->vmax=c->vmax; + c2->Gmin=g; c2->Vmax=c->Vmax; c2->vmin=g; c2->vmax=c->vmax; c2->Bmin=c->Bmin; c2->Bmax=c->Bmax; c2->bmin=c->bmin; c2->bmax=c->bmax; @@ -814,20 +682,20 @@ void Cluster_split(T_Cluster * c, T_Cluster * c1, T_Cluster * c2, int hue, c1->Rmin=c->Rmin; c1->Rmax=c->Rmax; c1->rmin=c->rmin; c1->rmax=c->rmax; - c1->Gmin=c->Gmin; c1->vmax=c->vmax; + c1->Gmin=c->Gmin; c1->Vmax=c->Vmax; c1->vmin=c->vmin; c1->vmax=c->vmax; c1->Bmin=c->Bmin; c1->Bmax=b-1; c1->bmin=c->bmin; c1->bmax=b-1; c2->Rmin=c->Rmin; c2->Rmax=c->Rmax; c2->rmin=c->rmin; c2->rmax=c->rmax; - c2->Gmin=c->Gmin; c2->vmax=c->vmax; + c2->Gmin=c->Gmin; c2->Vmax=c->Vmax; c2->vmin=c->vmin; c2->vmax=c->vmax; c2->Bmin=b; c2->Bmax=c->Bmax; c2->bmin=b; c2->bmax=c->bmax; } } -*/ + /// Compute the mean R, G, B (for palette generation) and H, L (for palette sorting) void Cluster_compute_hue(T_Cluster * c,T_Occurrence_table * to) @@ -889,7 +757,7 @@ void CS_Init(T_Cluster_set * cs, T_Occurrence_table * to) cs->clusters->Gmin = cs->clusters->vmin = 0; cs->clusters->Bmin = cs->clusters->bmin = 0; cs->clusters->Rmax = cs->clusters->rmax = to->rng_r - 1; - cs->clusters->vmax = cs->clusters->vmax = to->rng_g - 1; + cs->clusters->Vmax = cs->clusters->vmax = to->rng_g - 1; cs->clusters->Bmax = cs->clusters->bmax = to->rng_b - 1; cs->clusters->next = NULL; Cluster_pack(cs->clusters, to); @@ -1139,7 +1007,7 @@ void CS_Generate_color_table_and_palette(T_Cluster_set * cs,T_Conversion_table * palette[index].B=current->b; for (r=current->Rmin; r<=current->Rmax; r++) - for (g=current->Gmin;g<=current->vmax;g++) + for (g=current->Gmin;g<=current->Vmax;g++) for (b=current->Bmin;b<=current->Bmax;b++) CT_set(tc,r,g,b,index); current = current->next; @@ -1470,6 +1338,8 @@ void Convert_24b_bitmap_to_256_nearest_neighbor(T_Bitmap256 dest, // For some of them only the first one may work because of ugly optimizations static const byte precision_24b[]= { + 8,8,8, + 6,6,6, 6,6,5, 5,6,5, 5,5,5, From 1af5ee33f151b16121049c6f4ea4b2005358cda7 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sun, 12 Jun 2011 18:07:08 +0000 Subject: [PATCH 05/15] Merge r1787 (Fix loading of BMPs with negative heights) from release (2.3) to trunk (2.4wip) git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1795 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/fileformats.c | 54 ++++++++++++++++++++++++++++++++++------------- src/helpfile.h | 31 ++++++++++++++------------- 2 files changed, 55 insertions(+), 30 deletions(-) diff --git a/src/fileformats.c b/src/fileformats.c index 4f6b1d1b..1dc85ded 100644 --- a/src/fileformats.c +++ b/src/fileformats.c @@ -1102,7 +1102,7 @@ typedef struct dword Size_2; // 40 dword Width; - dword Height; + int32_t Height; // signed: negative means a top-down bitmap (rare) word Planes; // 1 word Nb_bits; // 1,4,8 ou 24 dword Compression; @@ -1132,7 +1132,7 @@ void Test_BMP(T_IO_Context * context) && Read_dword_le(file,&(header.Offset)) && Read_dword_le(file,&(header.Size_2)) && Read_dword_le(file,&(header.Width)) - && Read_dword_le(file,&(header.Height)) + && Read_dword_le(file,(dword *)&(header.Height)) && Read_word_le(file,&(header.Planes)) && Read_word_le(file,&(header.Nb_bits)) && Read_dword_le(file,&(header.Compression)) @@ -1209,6 +1209,7 @@ void Load_BMP(T_IO_Context * context) word line_size; byte a,b,c=0; long file_size; + byte negative_height; Get_full_filename(filename, context->File_name, context->File_directory); @@ -1225,7 +1226,7 @@ void Load_BMP(T_IO_Context * context) && Read_dword_le(file,&(header.Offset)) && Read_dword_le(file,&(header.Size_2)) && Read_dword_le(file,&(header.Width)) - && Read_dword_le(file,&(header.Height)) + && Read_dword_le(file,(dword *)&(header.Height)) && Read_word_le(file,&(header.Planes)) && Read_word_le(file,&(header.Nb_bits)) && Read_dword_le(file,&(header.Compression)) @@ -1249,6 +1250,16 @@ void Load_BMP(T_IO_Context * context) default: File_error=1; } + + if (header.Height < 0) + { + negative_height=1; + header.Height = -header.Height; + } + else + { + negative_height=0; + } if (!File_error) { @@ -1271,6 +1282,9 @@ void Load_BMP(T_IO_Context * context) context->Width=header.Width; context->Height=header.Height; + if (fseek(file, header.Offset, SEEK_SET)) + File_error=2; + switch (header.Compression) { case 0 : // Pas de compression @@ -1283,26 +1297,29 @@ void Load_BMP(T_IO_Context * context) line_size=(line_size*header.Nb_bits)>>3; buffer=(byte *)malloc(line_size); - for (y_pos=context->Height-1; ((y_pos>=0) && (!File_error)); y_pos--) + for (y_pos=0; (y_pos < context->Height && !File_error); y_pos++) { + short target_y; + target_y = negative_height ? y_pos : context->Height-1-y_pos; + if (Read_bytes(file,buffer,line_size)) for (x_pos=0; x_posWidth; x_pos++) switch (header.Nb_bits) { case 8 : - Set_pixel(context, x_pos,y_pos,buffer[x_pos]); + Set_pixel(context, x_pos,target_y,buffer[x_pos]); break; case 4 : if (x_pos & 1) - Set_pixel(context, x_pos,y_pos,buffer[x_pos>>1] & 0xF); + Set_pixel(context, x_pos,target_y,buffer[x_pos>>1] & 0xF); else - Set_pixel(context, x_pos,y_pos,buffer[x_pos>>1] >> 4 ); + Set_pixel(context, x_pos,target_y,buffer[x_pos>>1] >> 4 ); break; case 1 : if ( buffer[x_pos>>3] & (0x80>>(x_pos&7)) ) - Set_pixel(context, x_pos,y_pos,1); + Set_pixel(context, x_pos,target_y,1); else - Set_pixel(context, x_pos,y_pos,0); + Set_pixel(context, x_pos,target_y,0); } else File_error=2; @@ -1481,11 +1498,14 @@ void Load_BMP(T_IO_Context * context) line_size+=(4-x_pos); buffer=(byte *)malloc(line_size); - for (y_pos=context->Height-1; ((y_pos>=0) && (!File_error)); y_pos--) + for (y_pos=0; (y_pos < context->Height && !File_error); y_pos++) { + short target_y; + target_y = negative_height ? y_pos : context->Height-1-y_pos; + if (Read_bytes(file,buffer,line_size)) for (x_pos=0,index=0; x_posWidth; x_pos++,index+=3) - Set_pixel_24b(context, x_pos,y_pos,buffer[index+2],buffer[index+1],buffer[index+0]); + Set_pixel_24b(context, x_pos,target_y,buffer[index+2],buffer[index+1],buffer[index+0]); else File_error=2; } @@ -1495,13 +1515,15 @@ void Load_BMP(T_IO_Context * context) case 32: line_size=context->Width*4; buffer=(byte *)malloc(line_size); - for (y_pos=context->Height-1; ((y_pos>=0) && (!File_error)); y_pos--) + for (y_pos=0; (y_pos < context->Height && !File_error); y_pos++) { + short target_y; + target_y = negative_height ? y_pos : context->Height-1-y_pos; if (Read_bytes(file,buffer,line_size)) for (x_pos=0; x_posWidth; x_pos++) { dword pixel=*(((dword *)buffer)+x_pos); - Set_pixel_24b(context, x_pos,y_pos,Bitmap_mask(pixel,red_mask),Bitmap_mask(pixel,green_mask),Bitmap_mask(pixel,blue_mask)); + Set_pixel_24b(context, x_pos,target_y,Bitmap_mask(pixel,red_mask),Bitmap_mask(pixel,green_mask),Bitmap_mask(pixel,blue_mask)); } else File_error=2; @@ -1512,13 +1534,15 @@ void Load_BMP(T_IO_Context * context) case 16: line_size=(context->Width*2) + (context->Width&1)*2; buffer=(byte *)malloc(line_size); - for (y_pos=context->Height-1; ((y_pos>=0) && (!File_error)); y_pos--) + for (y_pos=0; (y_pos < context->Height && !File_error); y_pos++) { + short target_y; + target_y = negative_height ? y_pos : context->Height-1-y_pos; if (Read_bytes(file,buffer,line_size)) for (x_pos=0; x_posWidth; x_pos++) { word pixel=*(((word *)buffer)+x_pos); - Set_pixel_24b(context, x_pos,y_pos,Bitmap_mask(pixel,red_mask),Bitmap_mask(pixel,green_mask),Bitmap_mask(pixel,blue_mask)); + Set_pixel_24b(context, x_pos,target_y,Bitmap_mask(pixel,red_mask),Bitmap_mask(pixel,green_mask),Bitmap_mask(pixel,blue_mask)); } else File_error=2; diff --git a/src/helpfile.h b/src/helpfile.h index 6ed351bc..0b47d16e 100644 --- a/src/helpfile.h +++ b/src/helpfile.h @@ -453,21 +453,22 @@ static const T_Help_table helptable_credits[] = HELP_TITLE(" BUGFINDERS") HELP_TEXT ("") //HELP_TEXT ("0----5----0----5----0----5----0----5----0--X") - HELP_TEXT (" anibiqme blumunkee BDCIron ") - HELP_TEXT (" Ced DarkDefende DawnBringer ") - HELP_TEXT (" El Topo falenblood fanickbux ") - HELP_TEXT (" fano fogbot121 Frost ") - HELP_TEXT (" Grimmy Gürkan Sengün Hatch ") - HELP_TEXT (" HoraK-FDF iLKke Iw2evk ") - HELP_TEXT (" jackfrost128 Jamon keito ") - HELP_TEXT (" kusma Lord Graga Lorenzo Gatti ") - HELP_TEXT (" MagerValp maymunbeyin mind ") - HELP_TEXT (" MooZ Pasi Kallinen the Peach ") - HELP_TEXT (" petter PheeL Ravey1138 ") - HELP_TEXT (" richienyhus sm4tik spratek ") - HELP_TEXT (" Surt tape.yrm TeeEmCee ") - HELP_TEXT (" tempest Timo Kurrpa titus^Rab ") - HELP_TEXT (" Tobé yakumo2975 00ai99") + HELP_TEXT (" anibiqme antdzeryn blumunkee ") + HELP_TEXT (" BDCIron Ced DarkDefende ") + HELP_TEXT (" DawnBringer El Topo falenblood ") + HELP_TEXT (" fanickbux fano fogbot121 ") + HELP_TEXT (" Frost Grimmy Gürkan Sengün ") + HELP_TEXT (" Hatch HoraK-FDF iLKke ") + HELP_TEXT (" Iw2evk jackfrost128 Jamon ") + HELP_TEXT (" keito kusma Lord Graga ") + HELP_TEXT (" Lorenzo Gatti MagerValp maymunbeyin ") + HELP_TEXT (" mind MooZ Pasi Kallinen ") + HELP_TEXT (" the Peach petter PheeL ") + HELP_TEXT (" Ravey1138 richienyhus sm4tik ") + HELP_TEXT (" spratek Surt tape.yrm ") + HELP_TEXT (" TeeEmCee tempest Timo Kurrpa ") + HELP_TEXT (" titus^Rab Tobé yakumo2975 ") + HELP_TEXT (" 00ai99") HELP_TEXT ("") HELP_TEXT (" ... posted the annoying bug reports.") HELP_TEXT ("") From 17ce3a602b43278af7f5e541da9797636fc67d40 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sun, 12 Jun 2011 18:24:24 +0000 Subject: [PATCH 06/15] Merge r1791 (Updated credits) from release (2.3) to trunk (2.4wip) git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1796 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/helpfile.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/helpfile.h b/src/helpfile.h index 0b47d16e..6afbbcb5 100644 --- a/src/helpfile.h +++ b/src/helpfile.h @@ -405,6 +405,7 @@ static const T_Help_table helptable_credits[] = HELP_TEXT ("") HELP_BOLD (" AROS PORT") HELP_TEXT ("") + HELP_TEXT (" Yannick") HELP_TEXT (" Fernando Mastandrea (masta.uy)") HELP_TEXT (" Markus Weiss") HELP_TEXT ("") From 2f3e1e3294c3c89f6249916d5410be57c9e5debd Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sun, 12 Jun 2011 19:03:14 +0000 Subject: [PATCH 07/15] Lua: added 'matchcolor2' that uses DawnBringer's perceptual formula. Updated scripts numbering to 2.4 git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1797 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- .../brush/ApplyColor.lua | 0 .../brush/Fisheye.lua | 0 .../brush/GrayscaleAvg.lua | 0 .../brush/GrayscaleDesat.lua | 0 .../brush/Halfsmooth.lua | 0 .../brush/Waves.lua | 0 .../demo/3DPalette.lua | 0 .../demo/Ellipse.lua | 0 .../demo/FlipPicture.lua | 0 .../demo/SierpinskyCarpet.lua | 0 .../demo/SierpinskyTriangle.lua | 0 .../demo/Spritesheet.lua | 0 .../demo/brush/Amigaball.lua | 0 .../demo/brush/ColorSphere.lua | 0 .../demo/brush/FindAA.lua | 0 .../demo/brush/Mandelbrot.lua | 0 .../libs/dawnbringer_lib.lua | 0 .../libs/memory.lua | 0 .../palette/Desaturate.lua | 0 .../palette/ExpandColors.lua | 0 .../palette/FillColorCube.lua | 0 .../palette/InvertedRGB.lua | 0 .../palette/Set3bit.lua | 0 .../palette/Set6bit.lua | 0 .../palette/SetC64Palette.lua | 0 .../palette/ShiftHue.lua | 0 .../picture/CellColourReducer.lua | 0 .../picture/DrawGridIsometric.lua | 0 .../picture/DrawGridOrthogonal_RGB.lua | 0 .../picture/DrawgridOrthogonal_Index.lua | 0 .../picture/GlassGridFilter.lua | 0 .../picture/PaletteToPicture.lua | 0 .../picture/Pic2isometric.lua | 0 .../picture/Rainbow-Dark2Bright.lua | 0 .../picture/RemapImage2RGB.lua | 0 .../picture/RemapImage2RGB_ed.lua | 0 .../picture/RemapImageTo3bitPal.lua | 0 .../picture/XBitColourXpaceFromPalette.lua | 0 src/Makefile | 60 +++++++++---------- src/factory.c | 17 ++++++ 40 files changed, 47 insertions(+), 30 deletions(-) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/brush/ApplyColor.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/brush/Fisheye.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/brush/GrayscaleAvg.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/brush/GrayscaleDesat.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/brush/Halfsmooth.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/brush/Waves.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/demo/3DPalette.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/demo/Ellipse.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/demo/FlipPicture.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/demo/SierpinskyCarpet.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/demo/SierpinskyTriangle.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/demo/Spritesheet.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/demo/brush/Amigaball.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/demo/brush/ColorSphere.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/demo/brush/FindAA.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/demo/brush/Mandelbrot.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/libs/dawnbringer_lib.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/libs/memory.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/palette/Desaturate.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/palette/ExpandColors.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/palette/FillColorCube.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/palette/InvertedRGB.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/palette/Set3bit.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/palette/Set6bit.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/palette/SetC64Palette.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/palette/ShiftHue.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/picture/CellColourReducer.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/picture/DrawGridIsometric.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/picture/DrawGridOrthogonal_RGB.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/picture/DrawgridOrthogonal_Index.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/picture/GlassGridFilter.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/picture/PaletteToPicture.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/picture/Pic2isometric.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/picture/Rainbow-Dark2Bright.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/picture/RemapImage2RGB.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/picture/RemapImage2RGB_ed.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/picture/RemapImageTo3bitPal.lua (100%) rename share/grafx2/scripts/{samples_2.3 => samples_2.4}/picture/XBitColourXpaceFromPalette.lua (100%) diff --git a/share/grafx2/scripts/samples_2.3/brush/ApplyColor.lua b/share/grafx2/scripts/samples_2.4/brush/ApplyColor.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/brush/ApplyColor.lua rename to share/grafx2/scripts/samples_2.4/brush/ApplyColor.lua diff --git a/share/grafx2/scripts/samples_2.3/brush/Fisheye.lua b/share/grafx2/scripts/samples_2.4/brush/Fisheye.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/brush/Fisheye.lua rename to share/grafx2/scripts/samples_2.4/brush/Fisheye.lua diff --git a/share/grafx2/scripts/samples_2.3/brush/GrayscaleAvg.lua b/share/grafx2/scripts/samples_2.4/brush/GrayscaleAvg.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/brush/GrayscaleAvg.lua rename to share/grafx2/scripts/samples_2.4/brush/GrayscaleAvg.lua diff --git a/share/grafx2/scripts/samples_2.3/brush/GrayscaleDesat.lua b/share/grafx2/scripts/samples_2.4/brush/GrayscaleDesat.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/brush/GrayscaleDesat.lua rename to share/grafx2/scripts/samples_2.4/brush/GrayscaleDesat.lua diff --git a/share/grafx2/scripts/samples_2.3/brush/Halfsmooth.lua b/share/grafx2/scripts/samples_2.4/brush/Halfsmooth.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/brush/Halfsmooth.lua rename to share/grafx2/scripts/samples_2.4/brush/Halfsmooth.lua diff --git a/share/grafx2/scripts/samples_2.3/brush/Waves.lua b/share/grafx2/scripts/samples_2.4/brush/Waves.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/brush/Waves.lua rename to share/grafx2/scripts/samples_2.4/brush/Waves.lua diff --git a/share/grafx2/scripts/samples_2.3/demo/3DPalette.lua b/share/grafx2/scripts/samples_2.4/demo/3DPalette.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/demo/3DPalette.lua rename to share/grafx2/scripts/samples_2.4/demo/3DPalette.lua diff --git a/share/grafx2/scripts/samples_2.3/demo/Ellipse.lua b/share/grafx2/scripts/samples_2.4/demo/Ellipse.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/demo/Ellipse.lua rename to share/grafx2/scripts/samples_2.4/demo/Ellipse.lua diff --git a/share/grafx2/scripts/samples_2.3/demo/FlipPicture.lua b/share/grafx2/scripts/samples_2.4/demo/FlipPicture.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/demo/FlipPicture.lua rename to share/grafx2/scripts/samples_2.4/demo/FlipPicture.lua diff --git a/share/grafx2/scripts/samples_2.3/demo/SierpinskyCarpet.lua b/share/grafx2/scripts/samples_2.4/demo/SierpinskyCarpet.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/demo/SierpinskyCarpet.lua rename to share/grafx2/scripts/samples_2.4/demo/SierpinskyCarpet.lua diff --git a/share/grafx2/scripts/samples_2.3/demo/SierpinskyTriangle.lua b/share/grafx2/scripts/samples_2.4/demo/SierpinskyTriangle.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/demo/SierpinskyTriangle.lua rename to share/grafx2/scripts/samples_2.4/demo/SierpinskyTriangle.lua diff --git a/share/grafx2/scripts/samples_2.3/demo/Spritesheet.lua b/share/grafx2/scripts/samples_2.4/demo/Spritesheet.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/demo/Spritesheet.lua rename to share/grafx2/scripts/samples_2.4/demo/Spritesheet.lua diff --git a/share/grafx2/scripts/samples_2.3/demo/brush/Amigaball.lua b/share/grafx2/scripts/samples_2.4/demo/brush/Amigaball.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/demo/brush/Amigaball.lua rename to share/grafx2/scripts/samples_2.4/demo/brush/Amigaball.lua diff --git a/share/grafx2/scripts/samples_2.3/demo/brush/ColorSphere.lua b/share/grafx2/scripts/samples_2.4/demo/brush/ColorSphere.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/demo/brush/ColorSphere.lua rename to share/grafx2/scripts/samples_2.4/demo/brush/ColorSphere.lua diff --git a/share/grafx2/scripts/samples_2.3/demo/brush/FindAA.lua b/share/grafx2/scripts/samples_2.4/demo/brush/FindAA.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/demo/brush/FindAA.lua rename to share/grafx2/scripts/samples_2.4/demo/brush/FindAA.lua diff --git a/share/grafx2/scripts/samples_2.3/demo/brush/Mandelbrot.lua b/share/grafx2/scripts/samples_2.4/demo/brush/Mandelbrot.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/demo/brush/Mandelbrot.lua rename to share/grafx2/scripts/samples_2.4/demo/brush/Mandelbrot.lua diff --git a/share/grafx2/scripts/samples_2.3/libs/dawnbringer_lib.lua b/share/grafx2/scripts/samples_2.4/libs/dawnbringer_lib.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/libs/dawnbringer_lib.lua rename to share/grafx2/scripts/samples_2.4/libs/dawnbringer_lib.lua diff --git a/share/grafx2/scripts/samples_2.3/libs/memory.lua b/share/grafx2/scripts/samples_2.4/libs/memory.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/libs/memory.lua rename to share/grafx2/scripts/samples_2.4/libs/memory.lua diff --git a/share/grafx2/scripts/samples_2.3/palette/Desaturate.lua b/share/grafx2/scripts/samples_2.4/palette/Desaturate.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/palette/Desaturate.lua rename to share/grafx2/scripts/samples_2.4/palette/Desaturate.lua diff --git a/share/grafx2/scripts/samples_2.3/palette/ExpandColors.lua b/share/grafx2/scripts/samples_2.4/palette/ExpandColors.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/palette/ExpandColors.lua rename to share/grafx2/scripts/samples_2.4/palette/ExpandColors.lua diff --git a/share/grafx2/scripts/samples_2.3/palette/FillColorCube.lua b/share/grafx2/scripts/samples_2.4/palette/FillColorCube.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/palette/FillColorCube.lua rename to share/grafx2/scripts/samples_2.4/palette/FillColorCube.lua diff --git a/share/grafx2/scripts/samples_2.3/palette/InvertedRGB.lua b/share/grafx2/scripts/samples_2.4/palette/InvertedRGB.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/palette/InvertedRGB.lua rename to share/grafx2/scripts/samples_2.4/palette/InvertedRGB.lua diff --git a/share/grafx2/scripts/samples_2.3/palette/Set3bit.lua b/share/grafx2/scripts/samples_2.4/palette/Set3bit.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/palette/Set3bit.lua rename to share/grafx2/scripts/samples_2.4/palette/Set3bit.lua diff --git a/share/grafx2/scripts/samples_2.3/palette/Set6bit.lua b/share/grafx2/scripts/samples_2.4/palette/Set6bit.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/palette/Set6bit.lua rename to share/grafx2/scripts/samples_2.4/palette/Set6bit.lua diff --git a/share/grafx2/scripts/samples_2.3/palette/SetC64Palette.lua b/share/grafx2/scripts/samples_2.4/palette/SetC64Palette.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/palette/SetC64Palette.lua rename to share/grafx2/scripts/samples_2.4/palette/SetC64Palette.lua diff --git a/share/grafx2/scripts/samples_2.3/palette/ShiftHue.lua b/share/grafx2/scripts/samples_2.4/palette/ShiftHue.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/palette/ShiftHue.lua rename to share/grafx2/scripts/samples_2.4/palette/ShiftHue.lua diff --git a/share/grafx2/scripts/samples_2.3/picture/CellColourReducer.lua b/share/grafx2/scripts/samples_2.4/picture/CellColourReducer.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/picture/CellColourReducer.lua rename to share/grafx2/scripts/samples_2.4/picture/CellColourReducer.lua diff --git a/share/grafx2/scripts/samples_2.3/picture/DrawGridIsometric.lua b/share/grafx2/scripts/samples_2.4/picture/DrawGridIsometric.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/picture/DrawGridIsometric.lua rename to share/grafx2/scripts/samples_2.4/picture/DrawGridIsometric.lua diff --git a/share/grafx2/scripts/samples_2.3/picture/DrawGridOrthogonal_RGB.lua b/share/grafx2/scripts/samples_2.4/picture/DrawGridOrthogonal_RGB.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/picture/DrawGridOrthogonal_RGB.lua rename to share/grafx2/scripts/samples_2.4/picture/DrawGridOrthogonal_RGB.lua diff --git a/share/grafx2/scripts/samples_2.3/picture/DrawgridOrthogonal_Index.lua b/share/grafx2/scripts/samples_2.4/picture/DrawgridOrthogonal_Index.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/picture/DrawgridOrthogonal_Index.lua rename to share/grafx2/scripts/samples_2.4/picture/DrawgridOrthogonal_Index.lua diff --git a/share/grafx2/scripts/samples_2.3/picture/GlassGridFilter.lua b/share/grafx2/scripts/samples_2.4/picture/GlassGridFilter.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/picture/GlassGridFilter.lua rename to share/grafx2/scripts/samples_2.4/picture/GlassGridFilter.lua diff --git a/share/grafx2/scripts/samples_2.3/picture/PaletteToPicture.lua b/share/grafx2/scripts/samples_2.4/picture/PaletteToPicture.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/picture/PaletteToPicture.lua rename to share/grafx2/scripts/samples_2.4/picture/PaletteToPicture.lua diff --git a/share/grafx2/scripts/samples_2.3/picture/Pic2isometric.lua b/share/grafx2/scripts/samples_2.4/picture/Pic2isometric.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/picture/Pic2isometric.lua rename to share/grafx2/scripts/samples_2.4/picture/Pic2isometric.lua diff --git a/share/grafx2/scripts/samples_2.3/picture/Rainbow-Dark2Bright.lua b/share/grafx2/scripts/samples_2.4/picture/Rainbow-Dark2Bright.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/picture/Rainbow-Dark2Bright.lua rename to share/grafx2/scripts/samples_2.4/picture/Rainbow-Dark2Bright.lua diff --git a/share/grafx2/scripts/samples_2.3/picture/RemapImage2RGB.lua b/share/grafx2/scripts/samples_2.4/picture/RemapImage2RGB.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/picture/RemapImage2RGB.lua rename to share/grafx2/scripts/samples_2.4/picture/RemapImage2RGB.lua diff --git a/share/grafx2/scripts/samples_2.3/picture/RemapImage2RGB_ed.lua b/share/grafx2/scripts/samples_2.4/picture/RemapImage2RGB_ed.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/picture/RemapImage2RGB_ed.lua rename to share/grafx2/scripts/samples_2.4/picture/RemapImage2RGB_ed.lua diff --git a/share/grafx2/scripts/samples_2.3/picture/RemapImageTo3bitPal.lua b/share/grafx2/scripts/samples_2.4/picture/RemapImageTo3bitPal.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/picture/RemapImageTo3bitPal.lua rename to share/grafx2/scripts/samples_2.4/picture/RemapImageTo3bitPal.lua diff --git a/share/grafx2/scripts/samples_2.3/picture/XBitColourXpaceFromPalette.lua b/share/grafx2/scripts/samples_2.4/picture/XBitColourXpaceFromPalette.lua similarity index 100% rename from share/grafx2/scripts/samples_2.3/picture/XBitColourXpaceFromPalette.lua rename to share/grafx2/scripts/samples_2.4/picture/XBitColourXpaceFromPalette.lua diff --git a/src/Makefile b/src/Makefile index c0a05bbf..a76e2ed1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -374,11 +374,11 @@ OBJ = $(OBJDIR)/main.o $(OBJDIR)/init.o $(OBJDIR)/graph.o $(OBJDIR)/sdlscreen.o SKIN_FILES = ../share/grafx2/skins/skin_classic.png ../share/grafx2/skins/skin_modern.png ../share/grafx2/skins/skin_DPaint.png ../share/grafx2/skins/font_Classic.png ../share/grafx2/skins/font_Fun.png ../share/grafx2/skins/font_Fairlight.png ../share/grafx2/skins/font_Melon.png ../share/grafx2/skins/font_DPaint.png ../share/grafx2/skins/skin_scenish.png ../share/grafx2/skins/font_Seen.png ../share/grafx2/skins/skin_Aurora.png -SCRIPT_FILES = ../share/grafx2/scripts/samples_2.3/brush/ApplyColor.lua ../share/grafx2/scripts/samples_2.3/brush/Fisheye.lua ../share/grafx2/scripts/samples_2.3/brush/GrayscaleAvg.lua ../share/grafx2/scripts/samples_2.3/brush/GrayscaleDesat.lua ../share/grafx2/scripts/samples_2.3/brush/Halfsmooth.lua ../share/grafx2/scripts/samples_2.3/brush/Waves.lua ../share/grafx2/scripts/samples_2.3/demo/3DPalette.lua ../share/grafx2/scripts/samples_2.3/demo/Ellipse.lua ../share/grafx2/scripts/samples_2.3/demo/FlipPicture.lua \ -../share/grafx2/scripts/samples_2.3/demo/SierpinskyCarpet.lua ../share/grafx2/scripts/samples_2.3/demo/SierpinskyTriangle.lua ../share/grafx2/scripts/samples_2.3/demo/Spritesheet.lua ../share/grafx2/scripts/samples_2.3/demo/brush/Amigaball.lua ../share/grafx2/scripts/samples_2.3/demo/brush/ColorSphere.lua ../share/grafx2/scripts/samples_2.3/demo/brush/FindAA.lua ../share/grafx2/scripts/samples_2.3/demo/brush/Mandelbrot.lua ../share/grafx2/scripts/samples_2.3/libs/dawnbringer_lib.lua ../share/grafx2/scripts/samples_2.3/libs/memory.lua \ -../share/grafx2/scripts/samples_2.3/palette/Desaturate.lua ../share/grafx2/scripts/samples_2.3/palette/ExpandColors.lua ../share/grafx2/scripts/samples_2.3/palette/FillColorCube.lua ../share/grafx2/scripts/samples_2.3/palette/InvertedRGB.lua ../share/grafx2/scripts/samples_2.3/palette/Set3bit.lua ../share/grafx2/scripts/samples_2.3/palette/Set6bit.lua ../share/grafx2/scripts/samples_2.3/palette/SetC64Palette.lua ../share/grafx2/scripts/samples_2.3/palette/ShiftHue.lua ../share/grafx2/scripts/samples_2.3/picture/CellColourReducer.lua \ -../share/grafx2/scripts/samples_2.3/picture/DrawGridIsometric.lua ../share/grafx2/scripts/samples_2.3/picture/DrawgridOrthogonal_Index.lua ../share/grafx2/scripts/samples_2.3/picture/DrawGridOrthogonal_RGB.lua ../share/grafx2/scripts/samples_2.3/picture/GlassGridFilter.lua ../share/grafx2/scripts/samples_2.3/picture/PaletteToPicture.lua ../share/grafx2/scripts/samples_2.3/picture/Pic2isometric.lua ../share/grafx2/scripts/samples_2.3/picture/Rainbow-Dark2Bright.lua ../share/grafx2/scripts/samples_2.3/picture/RemapImage2RGB.lua \ -../share/grafx2/scripts/samples_2.3/picture/RemapImage2RGB_ed.lua ../share/grafx2/scripts/samples_2.3/picture/RemapImageTo3bitPal.lua ../share/grafx2/scripts/samples_2.3/picture/XBitColourXpaceFromPalette.lua +SCRIPT_FILES = ../share/grafx2/scripts/samples_2.4/brush/ApplyColor.lua ../share/grafx2/scripts/samples_2.4/brush/Fisheye.lua ../share/grafx2/scripts/samples_2.4/brush/GrayscaleAvg.lua ../share/grafx2/scripts/samples_2.4/brush/GrayscaleDesat.lua ../share/grafx2/scripts/samples_2.4/brush/Halfsmooth.lua ../share/grafx2/scripts/samples_2.4/brush/Waves.lua ../share/grafx2/scripts/samples_2.4/demo/3DPalette.lua ../share/grafx2/scripts/samples_2.4/demo/Ellipse.lua ../share/grafx2/scripts/samples_2.4/demo/FlipPicture.lua \ +../share/grafx2/scripts/samples_2.4/demo/SierpinskyCarpet.lua ../share/grafx2/scripts/samples_2.4/demo/SierpinskyTriangle.lua ../share/grafx2/scripts/samples_2.4/demo/Spritesheet.lua ../share/grafx2/scripts/samples_2.4/demo/brush/Amigaball.lua ../share/grafx2/scripts/samples_2.4/demo/brush/ColorSphere.lua ../share/grafx2/scripts/samples_2.4/demo/brush/FindAA.lua ../share/grafx2/scripts/samples_2.4/demo/brush/Mandelbrot.lua ../share/grafx2/scripts/samples_2.4/libs/dawnbringer_lib.lua ../share/grafx2/scripts/samples_2.4/libs/memory.lua \ +../share/grafx2/scripts/samples_2.4/palette/Desaturate.lua ../share/grafx2/scripts/samples_2.4/palette/ExpandColors.lua ../share/grafx2/scripts/samples_2.4/palette/FillColorCube.lua ../share/grafx2/scripts/samples_2.4/palette/InvertedRGB.lua ../share/grafx2/scripts/samples_2.4/palette/Set3bit.lua ../share/grafx2/scripts/samples_2.4/palette/Set6bit.lua ../share/grafx2/scripts/samples_2.4/palette/SetC64Palette.lua ../share/grafx2/scripts/samples_2.4/palette/ShiftHue.lua ../share/grafx2/scripts/samples_2.4/picture/CellColourReducer.lua \ +../share/grafx2/scripts/samples_2.4/picture/DrawGridIsometric.lua ../share/grafx2/scripts/samples_2.4/picture/DrawgridOrthogonal_Index.lua ../share/grafx2/scripts/samples_2.4/picture/DrawGridOrthogonal_RGB.lua ../share/grafx2/scripts/samples_2.4/picture/GlassGridFilter.lua ../share/grafx2/scripts/samples_2.4/picture/PaletteToPicture.lua ../share/grafx2/scripts/samples_2.4/picture/Pic2isometric.lua ../share/grafx2/scripts/samples_2.4/picture/Rainbow-Dark2Bright.lua ../share/grafx2/scripts/samples_2.4/picture/RemapImage2RGB.lua \ +../share/grafx2/scripts/samples_2.4/picture/RemapImage2RGB_ed.lua ../share/grafx2/scripts/samples_2.4/picture/RemapImageTo3bitPal.lua ../share/grafx2/scripts/samples_2.4/picture/XBitColourXpaceFromPalette.lua FONT_FILES = ../share/grafx2/fonts/8pxfont.png ../share/grafx2/fonts/Tuffy.ttf ../share/grafx2/fonts/PF_Arma_5__.png ../share/grafx2/fonts/PF_Easta_7_.png ../share/grafx2/fonts/PF_Easta_7__.png ../share/grafx2/fonts/PF_Ronda_7__.png ../share/grafx2/fonts/PF_Tempesta_5.png ../share/grafx2/fonts/PF_Tempesta_5_.png ../share/grafx2/fonts/PF_Tempesta_5__.png ../share/grafx2/fonts/PF_Tempesta_5___.png ../share/grafx2/fonts/PF_Tempesta_7.png ../share/grafx2/fonts/PF_Tempesta_7_.png ../share/grafx2/fonts/PF_Tempesta_7__.png ../share/grafx2/fonts/PF_Tempesta_7___.png ../share/grafx2/fonts/PF_Westa_7_.png ../share/grafx2/fonts/PF_Westa_7__.png @@ -388,12 +388,12 @@ all : $(MACAPPEXE) $(MACAPPEXE) : $(BIN) rm -rf Grafx2.app mkdir -p Grafx2.app Grafx2.app/Contents Grafx2.app/Contents/Frameworks Grafx2.app/Contents/MacOS Grafx2.app/Contents/Resources Grafx2.app/Contents/Resources/scripts - mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.3 - mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.3/brush - mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.3/demo - mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.3/libs - mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.3/palette - mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.3/picture + mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.4 + mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.4/brush + mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.4/demo + mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.4/libs + mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.4/palette + mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.4/picture echo 'APPL????' > Grafx2.app/Contents/PkgInfo cp ../Info.plist Grafx2.app/Contents cp -r Grafx2.icns Grafx2.app/Contents/Resources @@ -401,11 +401,11 @@ $(MACAPPEXE) : $(BIN) cp -r ../share/grafx2/fonts Grafx2.app/Contents/Resources cp -r ../share/grafx2/skins Grafx2.app/Contents/Resources cp -r ../share/grafx2/gfx2def.ini Grafx2.app/Contents/Resources - cp -r ../share/grafx2/scripts/samples_2.3/brush Grafx2.app/Contents/Resources/scripts/samples_2.3 - cp -r ../share/grafx2/scripts/samples_2.3/demo Grafx2.app/Contents/Resources/scripts/samples_2.3 - cp -r ../share/grafx2/scripts/samples_2.3/libs Grafx2.app/Contents/Resources/scripts/samples_2.3 - cp -r ../share/grafx2/scripts/samples_2.3/palette Grafx2.app/Contents/Resources/scripts/samples_2.3 - cp -r ../share/grafx2/scripts/samples_2.3/picture Grafx2.app/Contents/Resources/scripts/samples_2.3 + cp -r ../share/grafx2/scripts/samples_2.4/brush Grafx2.app/Contents/Resources/scripts/samples_2.4 + cp -r ../share/grafx2/scripts/samples_2.4/demo Grafx2.app/Contents/Resources/scripts/samples_2.4 + cp -r ../share/grafx2/scripts/samples_2.4/libs Grafx2.app/Contents/Resources/scripts/samples_2.4 + cp -r ../share/grafx2/scripts/samples_2.4/palette Grafx2.app/Contents/Resources/scripts/samples_2.4 + cp -r ../share/grafx2/scripts/samples_2.4/picture Grafx2.app/Contents/Resources/scripts/samples_2.4 mkdir -p Grafx2.app/Contents/Frameworks/SDL.framework/Versions mkdir -p Grafx2.app/Contents/Frameworks/SDL_image.framework/Versions # mkdir -p Grafx2.app/Contents/Frameworks/SDL_ttf.framework/Versions @@ -499,13 +499,13 @@ install : $(BIN) test -d $(DESTDIR)$(datadir)/grafx2/skins || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/skins test -d $(DESTDIR)$(datadir)/grafx2/scripts || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts test -d $(DESTDIR)$(datadir)/grafx2/scripts/libs || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/libs - test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3 || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3 - test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/brush || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/brush - test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/demo || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/demo - test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/demo/brush || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/demo/brush - test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/libs || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/libs - test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/palette || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/palette - test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/picture || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/picture + test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4 || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4 + test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/brush || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/brush + test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/demo || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/demo + test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/demo/brush || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/demo/brush + test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/libs || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/libs + test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/palette || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/palette + test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/picture || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/picture test -d $(DESTDIR)$(datadir)/applications || $(MKDIR) $(DESTDIR)$(datadir)/applications test -d $(DESTDIR)$(pixmapdir) || $(MKDIR) $(DESTDIR)$(pixmapdir) # Copy files @@ -531,13 +531,13 @@ uninstall : $(DELCOMMAND) $(SKIN_FILES:../share%=$(DESTDIR)$(datadir)%) $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/skins),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/skins,) $(DELCOMMAND) $(SCRIPT_FILES:../share%=$(DESTDIR)$(datadir)%) - $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/picture),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/picture,) - $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/palette),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/palette,) - $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/libs),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/libs,) - $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/demo/brush),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/demo/brush,) - $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/demo),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/demo,) - $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/brush),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/brush,) - $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3,) + $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/picture),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/picture,) + $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/palette),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/palette,) + $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/libs),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/libs,) + $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/demo/brush),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/demo/brush,) + $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/demo),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/demo,) + $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/brush),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/brush,) + $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4,) $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/libs),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/libs,) $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts,) $(if $(wildcard $(DESTDIR)$(datadir)/grafx2),$(RMDIR) $(DESTDIR)$(datadir)/grafx2,) diff --git a/src/factory.c b/src/factory.c index 03fe7674..796dd910 100644 --- a/src/factory.c +++ b/src/factory.c @@ -690,6 +690,22 @@ int L_MatchColor(lua_State* L) return 1; } +int L_MatchColor2(lua_State* L) +{ + double r, g, b; + int c; + int nb_args=lua_gettop(L); + + LUA_ARG_LIMIT (3, "matchcolor2"); + LUA_ARG_NUMBER(1, "matchcolor2", r, -DBL_MAX, DBL_MAX); + LUA_ARG_NUMBER(2, "matchcolor2", g, -DBL_MAX, DBL_MAX); + LUA_ARG_NUMBER(3, "matchcolor2", b, -DBL_MAX, DBL_MAX); + + c = Best_color_perceptual(clamp_byte(r),clamp_byte(g),clamp_byte(b)); + lua_pushinteger(L, c); + return 1; +} + int L_GetForeColor(lua_State* L) { lua_pushinteger(L, Fore_color); @@ -1506,6 +1522,7 @@ void Run_script(const char *script_subdirectory, const char *script_filename) lua_register(L,"gettranscolor",L_GetTransColor); lua_register(L,"matchcolor",L_MatchColor); + lua_register(L,"matchcolor2",L_MatchColor2); // ui lua_register(L,"inputbox",L_InputBox); From bf28d19f208db02fa79061de5ee4f1478dff32af Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Tue, 14 Jun 2011 21:52:20 +0000 Subject: [PATCH 08/15] Lua: Fixed drawdisk which was drawing a square instead of a circle (doh!). Radius can now be a multiple of 0.5 to draw circles of even sizes (r=0 -> 1x1, r=0.5 -> 2x2, r=1 -> 3x3 etc.) git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1798 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/factory.c | 26 ++++++++++++++++++++------ src/graph.c | 14 ++++++++++++++ src/graph.h | 2 ++ src/special.c | 15 --------------- 4 files changed, 36 insertions(+), 21 deletions(-) diff --git a/src/factory.c b/src/factory.c index 796dd910..156f9248 100644 --- a/src/factory.c +++ b/src/factory.c @@ -457,30 +457,44 @@ int L_DrawCircle(lua_State* L) int L_DrawDisk(lua_State* L) { - int center_x, center_y, r, c; + int center_x, center_y, diameter, c, r, even; long circle_limit; short x_pos,y_pos; short min_x,max_x,min_y,max_y; + double r_float; int nb_args = lua_gettop(L); LUA_ARG_LIMIT(4, "drawdisk"); LUA_ARG_NUMBER(1, "drawdisk", center_x, INT_MIN, INT_MAX); LUA_ARG_NUMBER(2, "drawdisk", center_y, INT_MIN, INT_MAX); - LUA_ARG_NUMBER(3, "drawdisk", r, INT_MIN, INT_MAX); + LUA_ARG_NUMBER(3, "drawdisk", r_float, INT_MIN, INT_MAX); LUA_ARG_NUMBER(4, "drawdisk", c, INT_MIN, INT_MAX); - circle_limit = r*r; + if (r_float<0.0) + return 0; + diameter=(int)(floor(r_float*2.0+1.0)); + r=diameter/2; + even=!(diameter&1); + + circle_limit = Circle_squared_diameter(diameter); // Compute clipping limits - min_x=center_x-r<0 ? 0 : center_x-r; + min_x=center_x-r+even<0 ? 0 : center_x-r+even; max_x=center_x+r>=Main_image_width? Main_image_width-1 : center_x+r; - min_y=center_y-r<0 ? 0 : center_y-r; + min_y=center_y-r+even<0 ? 0 : center_y-r+even; max_y=center_y+r>=Main_image_height? Main_image_height-1 : center_y+r; for (y_pos=min_y;y_pos<=max_y;y_pos++) + { + short y=(y_pos-center_y)*2-even; for (x_pos=min_x;x_pos<=max_x;x_pos++) - Pixel_in_current_screen(x_pos,y_pos,c,0); + { + short x=(x_pos-center_x)*2-even; + if (x*x+y*y <= circle_limit) + Pixel_in_current_screen(x_pos,y_pos,c,0); + } + } return 0; } diff --git a/src/graph.c b/src/graph.c index 06c99716..1bd0d9fb 100644 --- a/src/graph.c +++ b/src/graph.c @@ -1340,6 +1340,20 @@ void Draw_filled_circle(short center_x,short center_y,short radius,byte color) Update_part_of_screen(start_x,start_y,end_x+1-start_x,end_y+1-start_y); } +int Circle_squared_diameter(int diameter) +{ + int result = diameter*diameter; + // Trick to make some circles rounder, even though + // mathematically incorrect. + if (diameter==3 || diameter==9) + return result-2; + if (diameter==11) + return result-6; + if (diameter==14) + return result-4; + + return result; +} // -- Tracer général d'une ellipse vide ----------------------------------- diff --git a/src/graph.h b/src/graph.h index 70c49d3c..5347a2d6 100644 --- a/src/graph.h +++ b/src/graph.h @@ -66,6 +66,8 @@ void Hide_empty_circle_preview (short center_x,short center_y,short radius); void Draw_empty_circle_general(short center_x,short center_y,short radius,byte color); void Draw_filled_circle (short center_x,short center_y,short radius,byte color); +int Circle_squared_diameter(int diameter); + void Draw_empty_ellipse_permanent(short center_x,short center_y,short horizontal_radius,short vertical_radius,byte color); void Draw_empty_ellipse_preview (short center_x,short center_y,short horizontal_radius,short vertical_radius,byte color); void Hide_empty_ellipse_preview (short center_x,short center_y,short horizontal_radius,short vertical_radius); diff --git a/src/special.c b/src/special.c index 6e3dc579..db8e14c0 100644 --- a/src/special.c +++ b/src/special.c @@ -37,21 +37,6 @@ //---------------------- Modifier le pinceau spécial ------------------------- -int Circle_squared_diameter(int diameter) -{ - int result = diameter*diameter; - // Trick to make some circles rounder, even though - // mathematically incorrect. - if (diameter==3 || diameter==9) - return result-2; - if (diameter==11) - return result-6; - if (diameter==14) - return result-4; - - return result; -} - void Set_paintbrush_size(int width, int height) { int x_pos,y_pos; From 7184fb857fe284896b0a929e77bd5b9fcd2ef908 Mon Sep 17 00:00:00 2001 From: nokturnal Date: Wed, 15 Jun 2011 19:29:11 +0000 Subject: [PATCH 09/15] bugfix in Add_element_to_list(), there were changes in function interface, but they were not applied in function call, so this resulted in program hang when calling fileselector. Bugfix there was no Atari_Memory_free() declaration when __MINT_ define was declared. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1799 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/Makefile | 28 +++++++++++++++++++++++----- src/fileformats.c | 5 +++++ src/filesel.c | 5 +++-- src/misc.c | 3 --- src/misc.h | 5 ++++- 5 files changed, 35 insertions(+), 11 deletions(-) diff --git a/src/Makefile b/src/Makefile index a76e2ed1..624d40bf 100644 --- a/src/Makefile +++ b/src/Makefile @@ -209,7 +209,24 @@ else X11LOPT = -lX11 CC = gcc else - + ifeq ($(PLATFORM),FreeMiNT) #10 + #Atari FreeMiNT/TOS specific + DELCOMMAND = rm -rf + MKDIR = mkdir -p + RMDIR = rmdir + CP = cp + ZIP = zip + PLATFORMFILES = gfx2.png + CC = gcc + BIN = ../bin/grafx2.ttp + LUALOPT = -llua + OBJDIR = ../obj/m68k-atari-mint + PLATFORM = m68k-atari-mint + STRIP = strip -s + X11LOPT = + COPT = -W -Wall -m68020-60 -fomit-frame-pointer -pedantic -std=c99 -Wdeclaration-after-statement -D__MINT__ -DNO_INLINE_MATH -O$(OPTIM) -c -I$(prefix)/include `$(prefix)/bin/libpng12-config --cflags` `$(prefix)/bin/sdl-config --cflags` $(JOYCOPT) $(LAYERCOPT) $(LUACOPT) + LOPT = -static -m68020-60 -lSDL_image `$(prefix)/bin/sdl-config --libs` -L$(prefix)/lib -ltiff -ljpeg `$(prefix)/bin/libpng12-config --libs` -lz -lm $(TTFLOPT) -lfreetype $(LUALOPT) $(LAYERLOPT) + else # Finally, the default rules that work fine for most unix/gcc systems, linux and freebsd are tested. # Linux and FreeBSD specific (default rules) DELCOMMAND = rm -rf @@ -267,13 +284,13 @@ else #cross compile an exec for atari TOS/MiNT machine CC = m68k-atari-mint-gcc BIN = ../bin/grafx2.ttp - LUALOPT = -llua + LUALOPT = -llua OBJDIR = ../obj/m68k-atari-mint PLATFORM = m68k-atari-mint STRIP = m68k-atari-mint-strip -s - X11LOPT = - COPT = -W -Wall -m68020-60 -fomit-frame-pointer -pedantic -std=c99 -Wdeclaration-after-statement -D__MINT__ -DNO_INLINE_MATH -O$(OPTIM) -c -I$(prefix)/include `$(prefix)/bin/libpng12-config --cflags` `$(prefix)/bin/sdl-config --cflags` $() $(JOYCOPT) $(LAYERCOPT) $(LUACOPT) - LOPT = -static -m68020-60 -lSDL_image `$(prefix)/bin/sdl-config --libs` -L$(prefix)/lib -ltiff -ljpeg `$(prefix)/bin/libpng12-config --libs` -lz -lm $(TTFLOPT) -lfreetype $(LUALOPT) $(LAYERLOPT) + X11LOPT = + COPT = -W -Wall -m68020-60 -fomit-frame-pointer -std=c99 -Wdeclaration-after-statement -D__MINT__ -ffast-math -O$(OPTIM) -c -I$(prefix)/include `$(prefix)/bin/libpng12-config --cflags` `$(prefix)/bin/sdl-config --cflags` $(JOYCOPT) $(LAYERCOPT) $(LUACOPT) + LOPT = -static -m68020-60 -lSDL_image `$(prefix)/bin/sdl-config --libs` -L$(prefix)/lib -ltiff -ljpeg `$(prefix)/bin/libpng12-config --libs` -lz -lm $(TTFLOPT) -lfreetype $(LUALOPT) -lm $(LAYERLOPT) -Wl,--stack,32k else # Compiles a regular linux executable for the native platform @@ -298,6 +315,7 @@ else endif endif endif + endif endif ### BUILD SETTINGS are set according to vars set in the platform selection, diff --git a/src/fileformats.c b/src/fileformats.c index 1dc85ded..18baf90c 100644 --- a/src/fileformats.c +++ b/src/fileformats.c @@ -46,6 +46,11 @@ #endif #endif +#ifndef png_jmpbuf +# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) +#endif + + #include #include "errors.h" diff --git a/src/filesel.c b/src/filesel.c index f0eec93c..ce038464 100644 --- a/src/filesel.c +++ b/src/filesel.c @@ -437,7 +437,7 @@ void Read_list_of_files(T_Fileselector *list, byte selected_format) } if(!bFound){ - Add_element_to_list(list, "..",1,Format_filename("/",19,1),ICON_NONE); // add if not present + Add_element_to_list(list, "..",Format_filename("/",19,1),1,ICON_NONE); // add if not present list->Nb_directories ++; } @@ -1401,8 +1401,9 @@ byte Button_Load_or_Save(byte load, T_IO_Context *context) if (load) { #if defined(__MINT__) - chdir(Main_current_directory); static char path[1024]={0}; + + chdir(Main_current_directory); Dgetpath(path,0); strcat(path,PATH_SEPARATOR); strcpy(Main_current_directory,path); diff --git a/src/misc.c b/src/misc.c index d926e305..4c455ee4 100644 --- a/src/misc.c +++ b/src/misc.c @@ -754,11 +754,8 @@ void Zoom_a_line(byte* original_line, byte* zoomed_line, // atari have two kinds of memory // standard and fast ram void Atari_Memory_free(unsigned long *stRam,unsigned long *ttRam){ - //TODO: return STRAM/TT-RAM - unsigned long mem=0; *stRam=Mxalloc(-1L,0); *ttRam = Mxalloc(-1L,1); - } #else // Indique quelle est la mémoire disponible diff --git a/src/misc.h b/src/misc.h index 063125c8..aabeebfe 100644 --- a/src/misc.h +++ b/src/misc.h @@ -146,8 +146,11 @@ dword Timer_start; // Heure de d byte New_preview_is_needed; // Booléen "Il faut relancer le chrono de preview" +#if defined (__MINT__) +void Atari_Memory_free(unsigned long *stRam,unsigned long *ttRam); +#else unsigned long Memory_free(void); - +#endif #define Num2str(a,b,c) sprintf(b,"%*lu",c,(long)(a)) #define Dec2str(a,b,c) sprintf(b,"%.*f",c,(double)(a)) From 78e1745ef1fb86a584b7ee6f538871a46ee5c299 Mon Sep 17 00:00:00 2001 From: nokturnal Date: Wed, 15 Jun 2011 22:40:43 +0000 Subject: [PATCH 10/15] replaced hardcoded lua script and libs paths with defines, Atari build stack adjustments (reduced it's size to 8k) git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1800 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/Makefile | 2 +- src/factory.c | 6 +++--- src/readini.c | 2 +- src/setup.c | 1 - src/setup.h | 16 ++++++++++++++++ 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/Makefile b/src/Makefile index 624d40bf..91e36057 100644 --- a/src/Makefile +++ b/src/Makefile @@ -290,7 +290,7 @@ else STRIP = m68k-atari-mint-strip -s X11LOPT = COPT = -W -Wall -m68020-60 -fomit-frame-pointer -std=c99 -Wdeclaration-after-statement -D__MINT__ -ffast-math -O$(OPTIM) -c -I$(prefix)/include `$(prefix)/bin/libpng12-config --cflags` `$(prefix)/bin/sdl-config --cflags` $(JOYCOPT) $(LAYERCOPT) $(LUACOPT) - LOPT = -static -m68020-60 -lSDL_image `$(prefix)/bin/sdl-config --libs` -L$(prefix)/lib -ltiff -ljpeg `$(prefix)/bin/libpng12-config --libs` -lz -lm $(TTFLOPT) -lfreetype $(LUALOPT) -lm $(LAYERLOPT) -Wl,--stack,32k + LOPT = -static -m68020-60 -lSDL_image `$(prefix)/bin/sdl-config --libs` -L$(prefix)/lib -ltiff -ljpeg `$(prefix)/bin/libpng12-config --libs` -lz -lm $(TTFLOPT) -lfreetype $(LUALOPT) -lm $(LAYERLOPT) -Wl,--stack,8k else # Compiles a regular linux executable for the native platform diff --git a/src/factory.c b/src/factory.c index 156f9248..2bf8f503 100644 --- a/src/factory.c +++ b/src/factory.c @@ -45,7 +45,7 @@ #include "graph.h" #include "filesel.h" // Read_list_of_drives() #include "realpath.h" - +#include "setup.h" /// Lua scripts bound to shortcut keys. char * Bound_script[10]; @@ -1491,8 +1491,8 @@ void Run_script(const char *script_subdirectory, const char *script_filename) strcpy(buf, "LUA_PATH="); strcat(buf, Data_directory); - Append_path(buf+9, "scripts", NULL); - Append_path(buf+9, "libs", NULL); + Append_path(buf+9, SCRIPTS_SUBDIRECTORY, NULL); + Append_path(buf+9, LUALIB_SUBDIRECTORY, NULL); Append_path(buf+9, "?.lua", NULL); putenv(buf); diff --git a/src/readini.c b/src/readini.c index 21827b6c..0d5ae57b 100644 --- a/src/readini.c +++ b/src/readini.c @@ -945,7 +945,7 @@ int Load_INI(T_Config * conf) { // Default when empty: Realpath(Data_directory, conf->Scripts_directory); - Append_path(conf->Scripts_directory, "scripts", NULL); + Append_path(conf->Scripts_directory, SCRIPTS_SUBDIRECTORY, NULL); } conf->Allow_multi_shortcuts=0; diff --git a/src/setup.c b/src/setup.c index e1c18dfc..95160b57 100644 --- a/src/setup.c +++ b/src/setup.c @@ -89,7 +89,6 @@ void Set_program_directory(ARG_UNUSED const char * argv0,char * program_dir) #elif defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) strcpy(program_dir,"PROGDIR:"); #elif defined(__MINT__) - static char path[1024]={0}; char currentDrive='A'; currentDrive=currentDrive+Dgetdrv(); diff --git a/src/setup.h b/src/setup.h index 67869512..369ac7ce 100644 --- a/src/setup.h +++ b/src/setup.h @@ -70,6 +70,22 @@ void Set_config_directory(const char * program_dir, char * config_dir); #define SKINS_SUBDIRECTORY "skins" #endif +/// Name of the subdirectory containing scripts +#if defined (__MINT__) + #define SCRIPTS_SUBDIRECTORY "SCRIPTS" +#else + #define SCRIPTS_SUBDIRECTORY "scripts" +#endif + +/// LUA directory prefix +#if defined (__MINT__) + #define LUALIB_SUBDIRECTORY "LIBS" +#else + #define LUALIB_SUBDIRECTORY "libs" +#endif + + + /// Name of the binary file containing some configuration settings. #if defined (__MINT__) #define CONFIG_FILENAME "GFX2.CFG" From 03e21d436cf91b8595e948ec7c8a361c648bfa4d Mon Sep 17 00:00:00 2001 From: nokturnal Date: Wed, 15 Jun 2011 23:32:49 +0000 Subject: [PATCH 11/15] added build instructions for Atari TOS machines (m68k/Coldfire) git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1801 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- doc/COMPILING.txt | 64 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/doc/COMPILING.txt b/doc/COMPILING.txt index 271c656a..41a1374e 100644 --- a/doc/COMPILING.txt +++ b/doc/COMPILING.txt @@ -184,3 +184,67 @@ Lua: Copy liblua.a to c:\msys\mingw\lib Copy lua51.dll to c:\msys\mingw\bin +== Atari TOS machines == +The Atari build is very similar to the Linux one. The build might work on native machine with gcc 4.3> compiler, +but it wasn't tested. You can also build binary for Coldfire based machines(e.g. Firebee) by +replacing '-m68020-60' in makefile to '-mcpu=5475'. + +Preferable way is to build GRAFX2 with use of cross compiler, you can get one from Vincent Riviere site: +(URL: http://vincent.riviere.free.fr/soft/m68k-atari-mint). There are versions for win32 (Cygwin) and +debian packages for latest Ubuntu (32/64bit). + +Before compilation you have to build all the needed libraries mentioned in requirements. + +To compile a Atari TOS executable, type in + make ATARICROSS=1 +You can also add other options like NOTTF,NOLUA,NOLAYERS etc. to enable/disable program features.. + +If you don't know how build libraries here's some hints. Please note that prefix path in examples below is valid only under Linux, +in case of Cygwin the path will be '/opt/m68k-atari-mint'. There will be no prefix when building on native machine. +You have to omit 'sudo' under Cygwin and native build. Stick to this order and you will be fine ;> ... +The versions of libraries were tested, you can also try newer versions. As I mentioned earlier, replace '-m68020-60' with '-mcpu=5475' +if you want to target Coldfire machines. + +libpng [optional](for png reading in SDL_image): +------------------------------------------------ +note: you will need libzip too +libpng 1.2.44 +./configure --prefix=/usr/m68k-atari-mint --disable-shared --enable-static --host=m68k-atari-mint CFLAGS="-m68020-60 -O2 -fomit-frame-pointer" +sudo make install +or +libpng 1.4.44 +./configure --prefix=/usr/m68k-atari-mint --disable-shared --enable-static --host=m68k-atari-mint CFLAGS="-m68020-60 -O2 -fomit-frame-pointer -DPNG_NO_SETJMP" +sudo make install + +libjpeg, libtiff [optional] (for jpeg/tiff support in SDL_image) +---------------------------------------------------------------- +./configure --prefix=/usr/m68k-atari-mint --disable-shared --enable-static --host=m68k-atari-mint CFLAGS="-m68020-60 -O2 -fomit-frame-pointer" +sudo make install + +freetype 2.4.4 [optional] (for TTF fonts support, required by SDL_ttf) +---------------------------------------------------------------------- +./configure --prefix=/usr/m68k-atari-mint --disable-shared --enable-static --host=m68k-atari-mint CFLAGS="-m68020-60 -O2 -fomit-frame-pointer" +sudo make install + +lua 5.0.4 [optional] (for LUA scripting support) +------------------------------------------------ +Here you have to customize makefiles, add prefixes, platform has to be set as generic. + +SDL 1.2 [mandatory] +-------------------- +note: best is to grab it directly from Mercurial repository +./configure --prefix=/usr/m68k-atari-mint --disable-shared --enable-static --host=m68k-atari-mint --disable-video-opengl --disable-shared --enable-static --disable-threads CFLAGS="-m68020-60 -O2 -fomit-frame-pointer" +sudo make install + +SDL_ttf [optional] (for ttf fonts support, depends on SDL and freetype) +------------------------------------------- +./configure --prefix=/usr/m68k-atari-mint --disable-shared --enable-static --host=m68k-atari-mint --disable-shared --enable-static --with-sdl-prefix=/usr/m68k-atari-mint --with-freetype-prefix=/usr/m68k-atari-mint CFLAGS=" -m68020-60 -O2 -fomit-frame-pointer" +sudo make install + +SDL_image 1.2.10 [mandatory] +---------------------------- +./configure --prefix=/usr/m68k-atari-mint --disable-shared --enable-static --host=m68k-atari-mint --disable-shared --enable-static --with-sdl-prefix=/usr/m68k-atari-mint CFLAGS="-DHAVE_OPENGL=0 -m68020-60 -O2 -fomit-frame-pointer" +sudo make install + +And that's it! :) + From 775c0e06ff6b4d895f05dddb3bbef078d95c1c3a Mon Sep 17 00:00:00 2001 From: nokturnal Date: Thu, 16 Jun 2011 00:07:09 +0000 Subject: [PATCH 12/15] added missing prefix option in build command for m68k/Coldfire build git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1802 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- doc/COMPILING.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/COMPILING.txt b/doc/COMPILING.txt index 41a1374e..c3d753ac 100644 --- a/doc/COMPILING.txt +++ b/doc/COMPILING.txt @@ -196,7 +196,7 @@ debian packages for latest Ubuntu (32/64bit). Before compilation you have to build all the needed libraries mentioned in requirements. To compile a Atari TOS executable, type in - make ATARICROSS=1 + make ATARICROSS=1 prefix=/usr/m68k-atari-mint You can also add other options like NOTTF,NOLUA,NOLAYERS etc. to enable/disable program features.. If you don't know how build libraries here's some hints. Please note that prefix path in examples below is valid only under Linux, From a28b5f617276e5e7aaa4fcbf5b895f8250d85a50 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 18 Jun 2011 15:49:44 +0000 Subject: [PATCH 13/15] * Get the available memory for Haiku/BeOS * Refactor the code a bit so the warning for missing code will be there for all the people that don't provide code. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1805 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/misc.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/misc.c b/src/misc.c index 4c455ee4..afaa624b 100644 --- a/src/misc.c +++ b/src/misc.c @@ -738,7 +738,7 @@ void Zoom_a_line(byte* original_line, byte* zoomed_line, #elif defined(__macosx__) || defined(__FreeBSD__) || defined(__NetBSD__) #include #elif defined(__BEOS__) || defined(__HAIKU__) - // sysinfo not implemented + #include #elif defined(__AROS__) || defined(__amigaos4__) || defined(__MORPHOS__) || defined(__amigaos__) #include #elif defined(__MINT__) @@ -784,17 +784,23 @@ unsigned long Memory_free(void) len = sizeof(maxmem); sysctl(mib,2,&maxmem,&len,NULL,0); return maxmem; -#elif defined(__BEOS__) || defined(__HAIKU__) || defined(__SKYOS__) || defined(__amigaos4__) || defined(__TRU64__) - // No on BeOS or Haiku - // AvailMem is misleading on os4 (os4 caches stuff in memory that you can still allocate) -#warning "There is missing code there for your platform ! please check and correct :)" - return 10*1024*1024; +#elif defined(__HAIKU__) || defined(__BEOS__) + int pages; + system_info systemInfo; + get_system_info(&systemInfo); + + pages = systemInfo.max_pages - systemInfo.used_pages; + return pages * B_PAGE_SIZE; #elif defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) return AvailMem(MEMF_ANY); -#else +#elif defined(__linux__) struct sysinfo info; sysinfo(&info); return info.freeram*info.mem_unit; +#else + // AvailMem is misleading on os4 (os4 caches stuff in memory that you can still allocate) +#warning "There is missing code there for your platform ! please check and correct :)" + return 10*1024*1024; #endif } #endif From f53734636df68a087c7aed5ed23937c2c6f42569 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 18 Jun 2011 16:00:26 +0000 Subject: [PATCH 14/15] Use $(shell ...) instead of `...` for calling the shell in variable configuration. Consequences : * This is a GNU Make extension, so it may not work with BSD Make and others * However, backticks relied on an sh shell, which may not be the case everywhere (AmigaOS comes to mind) Why did I do that : $(shell) is evaluated at variable assignment, not each time a command with the variable is executed. This is cleaner and should get the build running a little faster. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1806 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/Makefile | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Makefile b/src/Makefile index 91e36057..9fb267f1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -50,8 +50,8 @@ ifdef COMSPEC RMDIR = rmdir --ignore-fail-on-non-empty CP = cp BIN = ../bin/grafx2.exe - COPT = -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -g -ggdb `sdl-config --cflags` $(TTFCOPT) $(JOYCOPT) $(VKEYCOPT) $(LUACOPT) $(LAYERCOPT) - LOPT = `sdl-config --libs` -lSDL_image $(TTFLOPT) -lpng14 $(LUALOPT) + COPT = -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -g -ggdb $(shell sdl-config --cflags) $(TTFCOPT) $(JOYCOPT) $(VKEYCOPT) $(LUACOPT) $(LAYERCOPT) + LOPT = $(shell sdl-config --libs) -lSDL_image $(TTFLOPT) -lpng14 $(LUALOPT) LUALOPT = -llua CC = gcc OBJDIR = ../obj/win32 @@ -74,8 +74,8 @@ else RMDIR = rmdir --ignore-fail-on-non-empty CP = cp BIN = ../bin/grafx2 - COPT = -Wall -c -gstabs `sdl-config --cflags` $(TTFCOPT) - LOPT = `sdl-config --libs` -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) -lft2 + COPT = -Wall -c -gstabs $(shell sdl-config --cflags) $(TTFCOPT) + LOPT = $(shell sdl-config --libs) -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) -lft2 CC = gcc OBJDIR = ../obj/amiga ZIP = lha @@ -100,8 +100,8 @@ else SDLCOPT = $(MACOSX_ARCH) -I$(FWDIR)/SDL.framework/Headers -I$(FWDIR)/SDL_image.framework/Headers -I$(FWDIR)/SDL_ttf.framework/Headers -D_THREAD_SAFE #-framework SDL_ttf SDLLOPT = -isysroot $(MACOSX_SYSROOT) $(MACOSX_ARCH) -L/usr/lib -framework SDL -framework SDL_image -framework Cocoa -framework Carbon -framework OpenGL - COPT = -D_DARWIN_C_SOURCE -D__macosx__ -D__linux__ -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -std=c99 -c -g $(LUACOPT) $(SDLCOPT) $(TTFCOPT) -I/usr/X11/include - LOPT = $(SDLLOPT) -llua -lpng -lz + COPT = -D_DARWIN_C_SOURCE -D__macosx__ -D__linux__ -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -std=c99 -c -g $(LUACOPT) $(shell sdlCOPT) $(TTFCOPT) -I/usr/X11/include + LOPT = $(shell sdlLOPT) -llua -lpng -lz # Use gcc for compiling. Use ncc to build a callgraph and analyze the code. CC = gcc #CC = nccgen -ncgcc -ncld -ncfabs @@ -119,8 +119,8 @@ else RMDIR = rmdir --ignore-fail-on-non-empty CP = cp BIN = ../bin/grafx2 - COPT = -Wall -g `sdl-config --cflags` $(TTFCOPT) - LOPT = -lSDL_image `sdl-config --libs` -lpng -ljpeg -lz $(TTFLOPT) -lfreetype2shared + COPT = -Wall -g $(shell sdl-config --cflags) $(TTFCOPT) + LOPT = -lSDL_image $(shell sdl-config --libs) -lpng -ljpeg -lz $(TTFLOPT) -lfreetype2shared CC = gcc OBJDIR = ../obj/aros STRIP = strip --strip-unneeded --remove-section .comment @@ -135,8 +135,8 @@ else RMDIR = rmdir --ignore-fail-on-non-empty CP = cp BIN = ../bin/grafx2 - COPT = -Wall -gstabs -c `sdl-config --cflags` $(TTFCOPT) - LOPT = -lSDL_image `sdl-config --libs` -lpng -ljpeg -lz $(TTFLOPT) + COPT = -Wall -gstabs -c $(shell sdl-config --cflags) $(TTFCOPT) + LOPT = -lSDL_image $(shell sdl-config --libs) -lpng -ljpeg -lz $(TTFLOPT) CC = gcc OBJDIR = ../obj/morphos ZIP = lha @@ -151,8 +151,8 @@ else RMDIR = rmdir --ignore-fail-on-non-empty CP = cp BIN = ../bin/grafx2 - COPT = -W -Wall -c -g `sdl-config --cflags` $(TTFCOPT) -I/boot/home/config/include - LOPT = `sdl-config --libs` -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) + COPT = -W -Wall -c -g $(shell sdl-config --cflags) $(TTFCOPT) -I/boot/home/config/include + LOPT = $(shell sdl-config --libs) -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) CC = gcc OBJDIR = ../obj/beos ZIP = zip @@ -173,8 +173,8 @@ else LUACOPT = -D__ENABLE_LUA__ LUALOPT = -llua endif - COPT = -W -Wall -c -g `sdl-config --cflags` $(TTFCOPT) -I/boot/common/include $(LUACOPT) - LOPT = `sdl-config --libs` -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) -lfreetype -lbe $(LUALOPT) + COPT = -W -Wall -c -g $(shell sdl-config --cflags) $(TTFCOPT) -I/boot/common/include $(LUACOPT) + LOPT = $(shell sdl-config --libs) -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) -lfreetype -lbe $(LUALOPT) CC = gcc OBJDIR = ../obj/haiku ZIP = zip @@ -187,8 +187,8 @@ else RMDIR = rmdir --ignore-fail-on-non-empty CP = cp BIN = ../bin/grafx2 - COPT = -W -Wall -Wdeclaration-after-statement -c -g `sdl-config --cflags` $(TTFCOPT) - LOPT = `sdl-config --libs` -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) + COPT = -W -Wall -Wdeclaration-after-statement -c -g $(shell sdl-config --cflags) $(TTFCOPT) + LOPT = $(shell sdl-config --libs) -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) CC = gcc OBJDIR = ../obj/skyos ZIP = zip @@ -203,8 +203,8 @@ else ZIP = zip PLATFORMFILES = gfx2.png BIN = ../bin/grafx2 - COPT = -W -Wall -std=c99 -c -g -gstabs -D__TRU64__ `sdl-config --cflags` $(TTFCOPT) $(LUACOPT) - LOPT = `sdl-config --libs` -lSDL_image $(TTFLOPT) -lpng $(LUALOPT) -lm + COPT = -W -Wall -std=c99 -c -g -gstabs -D__TRU64__ $(shell sdl-config --cflags) $(TTFCOPT) $(LUACOPT) + LOPT = $(shell sdl-config --libs) -lSDL_image $(TTFLOPT) -lpng $(LUALOPT) -lm OBJDIR = ../obj/unix X11LOPT = -lX11 CC = gcc @@ -250,8 +250,8 @@ else #cross compile a Win32 executable CC = i586-mingw32msvc-gcc BIN = ../bin/grafx2.exe - COPT = -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -g -ggdb -Dmain=SDL_main `/usr/local/cross-tools/i386-mingw32/bin/sdl-config --cflags` $(TTFCOPT) - LOPT = -mwindows -lmingw32 -lSDLmain -lSDL -lshlwapi `/usr/local/cross-tools/i386-mingw32/bin/sdl-config --libs` -lSDL_image $(TTFLOPT) + COPT = -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -g -ggdb -Dmain=SDL_main $(shell /usr/local/cross-tools/i386-mingw32/bin/sdl-config --cflags) $(TTFCOPT) + LOPT = -mwindows -lmingw32 -lSDLmain -lSDL -lshlwapi $(shell /usr/local/cross-tools/i386-mingw32/bin/sdl-config --libs) -lSDL_image $(TTFLOPT) OBJDIR = ../obj/win32 PLATFORM = win32 else From 2d95dac3b0e3cda7cf4ceef87564d4437d0729fe Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 18 Jun 2011 16:08:40 +0000 Subject: [PATCH 15/15] Add a warning if the native fileselector isn't available. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1807 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/filesel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/filesel.c b/src/filesel.c index ce038464..9e73b616 100644 --- a/src/filesel.c +++ b/src/filesel.c @@ -120,7 +120,8 @@ byte Native_filesel(byte load) // Check if cancel return CommDlgExtendedError(); } -#else +#else ifndef(__linux__) // This makes no sense on X11-oriented platform. Nothing is really native there. + #warning "EXPERIMENTAL function for native fileselector not available for this platform!" return 255; // fail ! #endif }