From 80c37034f926e14db0346066be3333e4849b33f8 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Wed, 16 Feb 2011 17:03:45 +0000 Subject: [PATCH 01/46] Fix a remap problem on brush, when modified by Lua script then transformed. Fix Brush remap to maintain transparent pixels. Fix Text tool , respects transparent pixels and preview is always visible (The black PF_ fonts are no longer shown on a black background) git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1726 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/SFont.c | 4 +++- src/SFont.h | 1 + src/brush.c | 2 +- src/buttons.c | 17 +++++++++++++++-- src/factory.c | 9 ++++++--- src/text.c | 34 ++++++++++++++++++++++++++-------- src/windows.c | 42 ++++++++++++++++++++++++++++++++++++++++++ src/windows.h | 1 + 8 files changed, 95 insertions(+), 15 deletions(-) diff --git a/src/SFont.c b/src/SFont.c index fef5b17f..cd44d850 100644 --- a/src/SFont.c +++ b/src/SFont.c @@ -117,7 +117,9 @@ SFont_Font* SFont_InitFont(SDL_Surface* Surface) pixel = GetPixel(Surface, 0, Surface->h-1); SDL_UnlockSurface(Surface); - SDL_SetColorKey(Surface, SDL_SRCCOLORKEY, pixel); + // No longer use SDL color keying + //SDL_SetColorKey(Surface, SDL_SRCCOLORKEY, pixel); + Font->Transparent=pixel; return Font; } diff --git a/src/SFont.h b/src/SFont.h index 27a54937..71b694b7 100644 --- a/src/SFont.h +++ b/src/SFont.h @@ -59,6 +59,7 @@ typedef struct { int CharBegin[256]; int CharWidth[256]; int Space; + unsigned char Transparent; } SFont_Font; /// diff --git a/src/brush.c b/src/brush.c index 4f210afd..f3001505 100644 --- a/src/brush.c +++ b/src/brush.c @@ -844,7 +844,7 @@ void Remap_brush(void) Brush_colormap[color]=color; else // Usual method: closest by r g b - Brush_colormap[color]=Best_color_perceptual(r,g,b); + Brush_colormap[color]=Best_color_perceptual_except(r,g,b,Back_color); } // Il reste une couleur non calculée dans la table qu'il faut mettre à diff --git a/src/buttons.c b/src/buttons.c index d483ea53..221c0b42 100644 --- a/src/buttons.c +++ b/src/buttons.c @@ -4867,9 +4867,22 @@ void Button_Text(void) if (str[0]) preview_string=str; is_truetype=TrueType_font(selected_font_index); - Window_rectangle(8, 106, 273, 50,(antialias&&is_truetype)?MC_Black:Back_color); free(new_brush); new_brush = Render_text(preview_string, selected_font_index, font_size, antialias, is_bold, is_italic, &new_width, &new_height, text_palette); + // Background: + if (antialias&&is_truetype) + // Solid + Window_rectangle(8, 106, 273, 50,MC_Black); + else if (is_truetype) + { + long l = text_palette[Fore_color].R+text_palette[Fore_color].G+text_palette[Fore_color].B; + Window_rectangle(8, 106, 273, 50,l>128*3? MC_Black:MC_Light); + } + else + { + long l = text_palette[Back_color].R+text_palette[Back_color].G+text_palette[Back_color].B; + Window_rectangle(8, 106, 273, 50,l>128*3? MC_Light:MC_Black); + } if (new_brush) { if (!is_truetype || (is_truetype&&antialias)) @@ -4906,7 +4919,7 @@ void Button_Text(void) //if (r==Main_palette[color].R && g==Main_palette[color].G && b==Main_palette[color].B) // colmap[color]=color; //else - colmap[color]=Best_color_perceptual(r,g,b); + colmap[color]=Best_color_perceptual_except(r,g,b,Back_color); } colmap[Back_color]=Back_color; diff --git a/src/factory.c b/src/factory.c index 62cdf692..94f466d3 100644 --- a/src/factory.c +++ b/src/factory.c @@ -153,6 +153,7 @@ void Update_colors_during_script(void) int L_SetBrushSize(lua_State* L) { + int i; int w; int h; int nb_args=lua_gettop(L); @@ -168,10 +169,12 @@ int L_SetBrushSize(lua_State* L) Brush_was_altered=1; // Fill with Back_color memset(Brush_original_pixels,Back_color,(long)Brush_width*Brush_height); - // Grab palette + memset(Brush,Back_color,(long)Brush_width*Brush_height); + // Adopt the current palette. memcpy(Brush_original_palette, Main_palette,sizeof(T_Palette)); - // Remap (no change) - Remap_brush(); + for (i=0; i<256; i++) + Brush_colormap[i]=i; + //-- // Center the handle Brush_offset_X=(Brush_width>>1); diff --git a/src/text.c b/src/text.c index 701ba06e..d5c70fa8 100644 --- a/src/text.c +++ b/src/text.c @@ -483,12 +483,7 @@ byte *Render_text_TTF(const char *str, int font_number, int size, int antialias, if (Fore_color==Back_color) { - if (Main_palette[Back_color].R+Main_palette[Back_color].G+Main_palette[Back_color].B > 128*3) - // Back color is rather light: - new_fore=MC_Black; - else - // Back color is rather dark: - new_fore=MC_White; + new_fore=Best_color_perceptual_except(Main_palette[Back_color].R, Main_palette[Back_color].G, Main_palette[Back_color].B, Back_color); } for (index=0; index < text_surface->w * text_surface->h; index++) @@ -578,12 +573,12 @@ byte *Render_text_SFont(const char *str, int font_number, int *width, int *heigh text_surface=SDL_CreateRGBSurface(SDL_SWSURFACE, *width, *height, 8, 0, 0, 0, 0); // Copy palette SDL_SetPalette(text_surface, SDL_LOGPAL, font_surface->format->palette->colors, 0, 256); - // Fill with backcolor + // Fill with transparent color rectangle.x=0; rectangle.y=0; rectangle.w=*width; rectangle.h=*height; - SDL_FillRect(text_surface, &rectangle, Back_color); + SDL_FillRect(text_surface, &rectangle, font->Transparent); // Rendu du texte SFont_Write(text_surface, font, 0, 0, str); if (!text_surface) @@ -604,6 +599,29 @@ byte *Render_text_SFont(const char *str, int font_number, int *width, int *heigh Get_SDL_Palette(font_surface->format->palette, palette); + // Swap current BG color with font's transparent color + if (font->Transparent != Back_color) + { + int c; + byte colmap[256]; + // Swap palette entries + + SWAP_BYTES(palette[font->Transparent].R, palette[Back_color].R) + SWAP_BYTES(palette[font->Transparent].G, palette[Back_color].G) + SWAP_BYTES(palette[font->Transparent].B, palette[Back_color].B) + + // Define a colormap + for (c=0; c<256; c++) + colmap[c]=c; + + // The swap + colmap[font->Transparent]=Back_color; + colmap[Back_color]=font->Transparent; + + Remap_general_lowlevel(colmap, new_brush, new_brush, text_surface->w,text_surface->h, text_surface->w); + + } + SDL_FreeSurface(text_surface); SFont_FreeFont(font); diff --git a/src/windows.c b/src/windows.c index 49c3d456..a0af70bb 100644 --- a/src/windows.c +++ b/src/windows.c @@ -2721,6 +2721,48 @@ byte Best_color_perceptual(byte r,byte g,byte b) return best_color; } +byte Best_color_perceptual_except(byte r,byte g,byte b, byte except) +{ + + int col; + float best_diff=255.0*1.56905; + byte best_color=0; + float target_bri; + float bri; + float diff_b, diff_c, diff; + + // Similar to Perceptual_lightness(); + target_bri = sqrt(0.26*r*0.26*r + 0.55*g*0.55*g + 0.19*b*0.19*b); + + for (col=0; col<256; col++) + { + if (col==except || Exclude_color[col]) + continue; + + diff_c = sqrt( + (0.26*(Main_palette[col].R-r))* + (0.26*(Main_palette[col].R-r))+ + (0.55*(Main_palette[col].G-g))* + (0.55*(Main_palette[col].G-g))+ + (0.19*(Main_palette[col].B-b))* + (0.19*(Main_palette[col].B-b))); + // Exact match + if (diff_c==0) + return col; + + bri = sqrt(0.26*Main_palette[col].R*0.26*Main_palette[col].R + 0.55*Main_palette[col].G*0.55*Main_palette[col].G + 0.19*Main_palette[col].B*0.19*Main_palette[col].B); + diff_b = abs(target_bri-bri); + + diff=0.25*(diff_b-diff_c)+diff_c; + if (diff Date: Fri, 18 Feb 2011 10:48:08 +0000 Subject: [PATCH 02/46] Fix #418: don't overwrite main file format if saving only the palette. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1729 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/filesel.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/filesel.c b/src/filesel.c index 6a24a71a..e00a3223 100644 --- a/src/filesel.c +++ b/src/filesel.c @@ -1610,7 +1610,6 @@ byte Button_Load_or_Save(byte load, T_IO_Context *context) if (Main_format != Window_attribute2) { char* savename = (char *)strdup(Selector_filename); int nameLength = strlen(savename); - DEBUG(Selector_filename, 42); Main_format = Window_attribute2; // Comme on change de liste, on se place en début de liste: Main_fileselector_position = 0; @@ -1940,7 +1939,7 @@ byte Button_Load_or_Save(byte load, T_IO_Context *context) else // Sinon on essaye de charger ou sauver le fichier { strcpy(context->File_directory,Main_current_directory); - if (!load) + if (!load && !Get_fileformat(Main_format)->Palette_only) Main_fileformat=Main_format; save_or_load_image=1; } From f6da992038736cbd90965da45835a91a06c299ea Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 19 Feb 2011 12:40:12 +0000 Subject: [PATCH 03/46] * Add scripts from dawnbringer : 3D palette viewer and applycolor (with tint and colorize effects) * Add the dawnbringer lib Some changes were made * Remove line and filled circle functions from dawnbringer lib * Add C replacement (slightly faster, and useful enough to be part of core) git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1730 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- share/grafx2/scripts/ani_db_3DPalette.lua | 431 +++ share/grafx2/scripts/bru_db_ApplyColor.lua | 125 + share/grafx2/scripts/libs/dawnbringer_lib.lua | 2471 +++++++++++++++++ src/factory.c | 121 +- 4 files changed, 3136 insertions(+), 12 deletions(-) create mode 100644 share/grafx2/scripts/ani_db_3DPalette.lua create mode 100644 share/grafx2/scripts/bru_db_ApplyColor.lua create mode 100644 share/grafx2/scripts/libs/dawnbringer_lib.lua diff --git a/share/grafx2/scripts/ani_db_3DPalette.lua b/share/grafx2/scripts/ani_db_3DPalette.lua new file mode 100644 index 00000000..bf119e65 --- /dev/null +++ b/share/grafx2/scripts/ani_db_3DPalette.lua @@ -0,0 +1,431 @@ +--3D-Palette viwer V0.7 (HSL-models added, 3D-World added, Pen-color only cycles thru unique colors, InputBox) +--by Richard 'Dawnbringer' Fhager + +-- Mouse: Rotate Cube (Stops animation) +-- Arrow-keys: Move Cube (in 3D world) +-- F1: Start/Stop animation +-- F2: Reset +-- F3: Increase Color-Size +-- F4: Decrease Color-Size +-- F5: (Wip) Cycle thru selected PenColor (Note that only unique colors are displayed) +-- F9: RGB-space model +--F10: HSL-space model +--F11: HSLcubic-space model +-- "+" (Num): Zoom In +-- "-" (Num): Zoom Out +-- Esc: Exit script + +require("dawnbringer_lib") + + +BRIDIAG_SHOW = 1 -- Show brightness/Grayscale diagonal (1 = on, 0 = off) +ANIM = 1 -- Animation (1 = on, 0 = off) +BOX_DRK = 8 -- Darkest color used for box (0-255) +BOX_BRI = 112 -- Brightest color used for box (0-255) +COLSIZE_BASE = 26 -- Colors base size (value to adjusted by palette-size, with 2 cols maxsize is v / 1.23) + +-- +OK,RGB,HSL,HSLC,BOX_BRI,COLSIZE_BASE,SET800x600 = inputbox("3D-Palette Viever Settings", + + "1. RGB space [F9]", 1, 0,1,-1, + "2. HSL space [F10]", 0, 0,1,-1, + "3. HSL-cubic space [F11]",0, 0,1,-1, + "Box Brightness (16-255)", BOX_BRI, 16,255,0, + "Col Size (1-100) [F3/F4]", COLSIZE_BASE, 1,100,0, + "Set Screen to 800x600", 1,0,1,0 + +); +-- + +if OK then + + if SET800x600 == 1 then setpicturesize(800,600); end + + SPACE = "rgb" + FORM = "cube" + if HSL == 1 then + SPACE = "hsl" + FORM = "cylinder" + end + if HSLC == 1 then + SPACE = "hsl_cubic" + FORM = "cube" + end + + +pal = db.fixPalette(db.makePalList(256)) + +FG = getforecolor() +BG = getbackcolor() + +palcol = FG + +-- +function initColors(space) + for n = 1, #pal, 1 do + c = pal[n]; + if space == "rgb" then + cols[n] = {c[1]/128-1,c[2]/128-1,c[3]/128-1,c[4]}; + end + if space == "hsl_cubic" then + cols[n] = {} + cols[n][1] = (db.getHUE(c[1],c[2],c[3],0) / 6.0 * 255) / 128 - 1 + cols[n][2] = (db.getSaturation(c[1],c[2],c[3])) / 128 - 1 + cols[n][3] = (db.getLightness(c[1],c[2],c[3])) / 128 - 1 + cols[n][4] = c[4] + end + if space == "hsl" then + cols[n] = {} + hue = db.getHUE(c[1],c[2],c[3],0) / 6.0 * math.pi*2 + rad = db.getSaturation(c[1],c[2],c[3]) / 256 + cols[n][1] = math.cos(hue) * rad + cols[n][2] = math.sin(hue) * rad + cols[n][3] = (db.getLightness(c[1],c[2],c[3])) / 128 - 1 + cols[n][4] = c[4] + end + end +end +-- + +cols = {} -- Make points of palette colors +colz = {} -- To hold calculated points +initColors(SPACE) + + +function initPointsAndLines(form,bridiag) + if form == "cube" then + pts = {{-1,1,-1},{1,1,-1},{1,-1,-1},{-1,-1,-1}, -- The box + {-1,1, 1},{1,1, 1},{1,-1, 1},{-1,-1, 1}} + lin = {{1,2},{2,3},{3,4},{4,1},{5,6},{6,7},{7,8},{8,5},{1,5},{2,6},{3,7},{4,8}} -- Box Lines + if bridiag == 1 then lin[13] = {4,6}; end + end + if form == "cylinder" then + p = 28 + pts = {} + lin = {} + for n = 1, p, 1 do + x = math.cos(math.pi*2 / p * (n-1)) + y = math.sin(math.pi*2 / p * (n-1)) + pts[n] = {x,y,-1} + lin[n] = {n,1 + (n%p)} + pts[n + p] = {x,y,1} + lin[n + p] = {n+p,p + 1 + (n%p)} + end + lin[p*2+1] = {1,p+1} -- Red (0 degrees) + lin[p*2+2] = {p+1,p+1+math.ceil(p/2)} -- Lightness end (needs an even # of points to work) + end +end + +boxp = {} -- To hold the calculated points +initPointsAndLines(FORM,BRIDIAG_SHOW) + +w,h = getpicturesize() +CX,CY = w/2, h/2 + + + +function initAndReset() + XANG, YANG, ZANG, ZOOM, COLSIZE_ADJ, XD, YD, WORLD_X, WORLD_Y = 0,0,0,0,0,0,0,0,0 +end + +initAndReset() + +SIZE = math.min(w,h)/4 +DIST = 5 -- Distance perspective modifier, ~5 is nominal, more means "less 3D" + +CMAXSIZE = math.floor(COLSIZE_BASE / ((#pal)^0.3)) +--CMAXSIZE = 8 +CMINSIZE = 1 -- Negative values are ok. Color are never smaller than 1 pix + +BOX_LINE_DIV = 20 -- Number of colors/segments that a box-line can be divided into (depth) +BOX_DIV_MULT = BOX_LINE_DIV / (math.sqrt(3)*2) + +-- Box depth colors +box_div = {} +for n = 0, BOX_LINE_DIV-1, 1 do + c = BOX_DRK + (BOX_BRI / (BOX_LINE_DIV - 1)) * n + --box_div[BOX_LINE_DIV - n] = matchcolor(c,c,c) + box_div[BOX_LINE_DIV - n] = db.getBestPalMatchHYBRID({c,c,c},pal,0.5,true) +end + +--BOX_COL = matchcolor(80,80,80) +BKG_COL = matchcolor(0,0,0) +--CUR_COL = matchcolor(112,112,112) + + + function rotate3D(x,y,z,Xsin,Ysin,Zsin,Xcos,Ycos,Zcos) -- PrecCalced cos&sin for speed + + local x1,x2,x3,y1,y2,y3,f,xp,yp + + x1 = x + y1 = y * Xcos + z * Xsin + z1 = z * Xcos - y * Xsin + + x2 = x1 * Ycos - z1 * Ysin + y2 = y1 + z2 = x1 * Ysin + z1 * Ycos + + x3 = x2 * Zcos - y2 * Zsin + y3 = x2 * Zsin + y2 * Zcos + z3 = z2 + + return x3,y3,z3 + end + + function do3D(x,y,z,zoom,dist,Xsin,Ysin,Zsin,Xcos,Ycos,Zcos) -- PrecCalced cos&sin for speed + + local x1,x2,x3,y1,y2,y3,f,xp,yp + + x1 = x + y1 = y * Xcos + z * Xsin + z1 = z * Xcos - y * Xsin + + x2 = x1 * Ycos - z1 * Ysin + y2 = y1 + z2 = x1 * Ysin + z1 * Ycos + + x3 = x2 * Zcos - y2 * Zsin + y3 = x2 * Zsin + y2 * Zcos + z3 = z2 + + f = dist/(z3 + dist + zoom) + xp = x3 * f + yp = y3 * f + + return xp,yp,z3 + end + + +function draw3Dline(x1,y1,z1,x2,y2,z2,div,mult,depthlist) + local s,xt,yt,xd,yd,zd,xf,yf + xd = (x2 - x1) / div + yd = (y2 - y1) / div + zd = (z2 - z1) / div + xf,yf = x1,y1 + + for s = 1, div, 1 do + -- Depth assumes a 1-Box (z ranges from -sq(3) to sq(3)) + depth = math.floor(1 + (z1+zd*s + 1.732) * mult) + xt = x1 + xd*s -- + math.random()*8 + yt = y1 + yd*s -- + math.random()*8 + c = depthlist[depth] + if c == null then c = 1; end -- Something isn't perfect, error is super rare but this controls it + drawline(xf,yf,xt,yt,c) + xf = xt + yf = yt + end +end + +function killinertia() + XD = 0 + YD = 0 +end + + -- If using 1-box, z is -sq(3) to sq(3) + minz = math.sqrt(3) + totz = minz * 2 + maxrad = CMAXSIZE - CMINSIZE + +q = 0 +delay = 4 +move = 0.03 + +while 1 < 2 do + + -- Time-for-space-wiggle...or somekindof attempt + --WORLD_X = -move + --q = (q + 1) % delay + --if q < delay/2 then WORLD_X = move; end + + clearpicture(BKG_COL) + + Xsin = math.sin(XANG); Xcos = math.cos(XANG) + Ysin = math.sin(YANG); Ycos = math.cos(YANG) + Zsin = math.sin(ZANG); Zcos = math.cos(ZANG) + + -- Rotate Box points + for n = 1, #pts, 1 do + p = pts[n] + x,y,z = p[1],p[2],p[3] + XP,YP,zp = rotate3D(x,y,z,Xsin,Ysin,Zsin,Xcos,Ycos,Zcos) + boxp[n] = {XP,YP,zp} + end + + -- Rotate Colors in palette + for n = 1, #cols, 1 do + p = cols[n] + x,y,z,c = p[1],p[2],p[3],p[4] + XP,YP,zp = rotate3D(x,y,z,Xsin,Ysin,Zsin,Xcos,Ycos,Zcos) + colz[n] = {XP,YP,zp,c} + end + + ------------------------------------ + -- Control world + ------------------------------------ + + -- Calculate points anew + + -- Worldize Box points + for n = 1, #boxp, 1 do + s = SIZE + v = boxp[n] + x = v[1] + WORLD_X + y = v[2] + WORLD_Y + z = v[3] + f = DIST/(z + DIST + ZOOM) + XP = CX + x * f * s + YP = CY + y * f * s + boxp[n] = {XP,YP,z} + end + + -- Worldize Colors in palette + for n = 1, #colz, 1 do + s = SIZE + v = colz[n] + x = v[1] + WORLD_X + y = v[2] + WORLD_Y + z = v[3] + c = v[4] + f = DIST/(z + DIST + ZOOM) + XP = CX + x * f * s + YP = CY + y * f * s + colz[n] = {XP,YP,z,c} + end + + +------------------------------------- +------------------------------------- + + -- Brightness Diagonal + --if BRIDIAG_SHOW == 1 then + -- p1 = boxp[4] + -- p2 = boxp[6] + -- x1,y1,z1 = p1[1],p1[2],p1[3] + -- x2,y2,z2 = p2[1],p2[2],p2[3] + -- draw3Dline(x1,y1,z1,x2,y2,z2,BOX_LINE_DIV,BOX_DIV_MULT,box_div) + --end + + -- sort on z + db.sorti(colz,3) + + -- Draw colors + for n = #colz, 1, -1 do + p = colz[n] + XP,YP,zp,c = p[1],p[2],p[3],p[4] + + radius = CMINSIZE + maxrad - (zp+minz) / totz * maxrad + dorad = math.floor(radius - ZOOM*2 + COLSIZE_ADJ) + + if dorad >= 1 then + drawdisk(XP,YP,dorad,c) + --db.drawRectangle(XP,YP,dorad,dorad,c) + else putpicturepixel(XP,YP,c) + end + + if c == FG or c == BG then + sz = math.max(3,dorad + 3) + if c == BKG_COL then v = (c+128) % 255; c = matchcolor(v,v,v); end + db.drawRectangleLine(XP-sz,YP-sz,sz*2,sz*2,c) + end + + end -- colz + + + + -- Draw box + for n = 1, #lin, 1 do + + l = lin[n] + p1 = boxp[l[1]] + p2 = boxp[l[2]] + x1,y1,z1 = p1[1],p1[2],p1[3] + x2,y2,z2 = p2[1],p2[2],p2[3] + draw3Dline(x1,y1,z1,x2,y2,z2,BOX_LINE_DIV,BOX_DIV_MULT,box_div) + + end -- eof box + + --updatescreen(); if (waitbreak(0.00)==1) then return; end + + repeat + + old_key = key; + old_mouse_x = mouse_x; + old_mouse_y = mouse_y; + old_mouse_b = mouse_b; + + updatescreen() + moved, key, mouse_x, mouse_y, mouse_b = waitinput(0) + + if mouse_b == 1 then ANIM = 0; end + + if (key==27) then + return; + end + + if (key==282) then ANIM = (ANIM+1) % 2; end -- F1: Stop/Start Animation + if (key==283) then initAndReset(); end -- F2: Reset all values + if (key==284) then COLSIZE_ADJ = COLSIZE_ADJ + 0.5; end -- F3 + if (key==285) then COLSIZE_ADJ = COLSIZE_ADJ - 0.5; end -- F4 + + if (key==286) then + --FG = (FG + 1) % 255; + palcol = (palcol + 1) % #pal + FG = pal[palcol+1][4] + setforecolor(FG); + setcolor(0,getcolor(0)) -- Force update of palette until setforecolor() is fixed + end -- F5 + + if (key==290) then -- F9 + initColors("rgb") + initPointsAndLines("cube",BRIDIAG_SHOW) + end + if (key==291) then -- F10 + initColors("hsl") + initPointsAndLines("cylinder", 0) -- Bridiag won't show even if turned on, it's only for cube + end + if (key==292) then -- F11 + initColors("hsl_cubic") + initPointsAndLines("cube",BRIDIAG_SHOW) + end + + if (key==269) then ZOOM = ZOOM + 0.1; end + if (key==270) then ZOOM = ZOOM - 0.1; end + SPEED = math.pi / 100 + + + if (key==273) then WORLD_Y = WORLD_Y - 0.05; killinertia(); end + if (key==274) then WORLD_Y = WORLD_Y + 0.05; killinertia(); end + + if (key==276) then WORLD_X = WORLD_X - 0.05; killinertia(); end + if (key==275) then WORLD_X = WORLD_X + 0.05; killinertia(); end + + until ((mouse_b == 1 and (old_mouse_x~=mouse_x or old_mouse_y~=mouse_y)) or key~=0 or ANIM==1 or math.abs(XD)>0.01 or math.abs(YD)>0.01); + + if ANIM == 0 then + if (mouse_b==1 and (old_mouse_x~=mouse_x or old_mouse_y~=mouse_y)) then -- Inertia + XD = (mouse_y - old_mouse_y)*0.005 + YD = (mouse_x - old_mouse_x)*0.005 + else + XD = XD*0.92 + YD = YD*0.92 + end + XANG = ((XANG - XD) % (math.pi*2)); + YANG = ((YANG + YD) % (math.pi*2)); + ZANG = 0 + end + + if ANIM == 1 then + XANG = (XANG + math.pi/300) % (math.pi*2) + YANG = (YANG + math.pi/500) % (math.pi*2) + ZANG = (ZANG + math.pi/1000) % (math.pi*2) + end + + --XANG = ((CY-mouse_y) / 200 % (math.pi*2)); + --YANG = ((mouse_x - CX) / 200 % (math.pi*2)); + --ZANG = 0 + + + statusmessage("X: "..math.floor(XANG*57.3).."°, Y: "..math.floor(YANG*57.3).."°, Z: "..math.floor(ZANG*57.3).."°, Zoom: "..math.floor(-ZOOM*10).." ") +end + +end -- OK diff --git a/share/grafx2/scripts/bru_db_ApplyColor.lua b/share/grafx2/scripts/bru_db_ApplyColor.lua new file mode 100644 index 00000000..94db376e --- /dev/null +++ b/share/grafx2/scripts/bru_db_ApplyColor.lua @@ -0,0 +1,125 @@ +--BRUSH Remap: Apply PenColor +--by Richard Fhager +--http://hem.fyristorg.com/dawnbringer/ + +-- Copyright 2010 Richard Fhager +-- +-- This program is free software; you can redistribute it and/or +-- modify it under the terms of the GNU General Public License +-- as published by the Free Software Foundation; version 2 +-- of the License. See + +--dofile("dawnbringer_lib.lua") +require("dawnbringer_lib") + +OK,tin,clz,fade,amt,brikeep,falloff,nobg,briweight = inputbox("Apply PenColor 2 Brush", + + "1. Tint", 1, 0,1,-1, + "2. Colorize", 0, 0,1,-1, + "BG->FG color Fade", 0, 0,1,0, + "AMOUNT % (0-100)", 100, 0,100,0, + "Preserve Brightness", 1, 0,1,0, + "Bri/Dark FallOff", 1, 0,1,0, + "Exclude Background", 1,0,1,0, + "ColMatch Bri-Weight %", 25, 0,100,0 +); + + +if OK == true then + + function cap(v) return math.min(255,math.max(v,0)); end + + w, h = getbrushsize() + + + fg = getforecolor() + bg = getbackcolor() + fR,fG,fB = getcolor(fg) + bR,bG,bB = getcolor(bg) + + pal = db.fixPalette(db.makePalList(256)) + if nobg == 1 then + pal = db.stripIndexFromPalList(pal,bg) -- Remove background color from pallist + end + + amtA = amt / 100 + amtR = 1 - amtA + + -- Normalize Pen Color + lev = (fR+fG+fB)/3 + fR = fR - lev + fG = fG - lev + fB = fB - lev + + --------------------------------------------------- + -- Colorize (Colourant) (just apply colorbalance) + -- Tint (make grayscale and apply colorbalance) + -- + -- I think it should be the other way around since colorize is the process of adding color to B&W film... + -- But this is the what Brilliance and others call it + -- + if clz == 1 or tin == 1 then + cols = {} + for n = 0, 255, 1 do + + r,g,b = getcolor(n) + a = db.getBrightness(r,g,b) + + + mR,mG,mB = fR,fG,fB + + -- Fade between bg & fg pencolor across dark-bright + if fade == 1 then + lf = a / 255 + lr = 1 - lf + mR = bR*lr + fR*lf + mG = bG*lr + fG*lf + mB = bB*lr + fB*lf + lev = (mR+mG+mB)/3 + mR = mR - lev + mG = mG - lev + mB = mB - lev + end + + fr,fg,fb = mR,mG,mB + + + if brikeep == 1 then + -- Loose Brightness preservation (ex: applying full red to dark colors) + brin = db.getBrightness(cap(r+mR),cap(g+mG),cap(b+mB)) + itot = brin - a + fr = mR - itot + fg = mG - itot + fb = mB - itot + end + + -- Falloff (Effect weakens at dark and bright colors) + if falloff == 1 then + fo = 1 - math.abs((a - 127.5)/127.5)^2 + fr = fr * fo + fg = fg * fo + fb = fb * fo + end + + if tin == 1 then + --cols[n+1] = matchcolor((a+fr)*amtA + r*amtR, (a+fg)*amtA + g*amtR, (a+fb)*amtA + b*amtR) + cols[n+1] = db.getBestPalMatchHYBRID({(a+fr)*amtA+r*amtR, (a+fg)*amtA + g*amtR, (a+fb)*amtA + b*amtR},pal,briweight / 100,true) + end + if clz == 1 then + --cols[n+1] = matchcolor((r+fr)*amtA + r*amtR, (g+fg)*amtA + g*amtR, (b+fb)*amtA + b*amtR) + cols[n+1] = db.getBestPalMatchHYBRID({(r+fr)*amtA+r*amtR, (g+fg)*amtA + g*amtR, (b+fb)*amtA + b*amtR},pal,briweight / 100,true) + end + end + + if nobg == 1 then cols[getbackcolor()+1] = getbackcolor(); end + + for x = 0, w - 1, 1 do + for y = 0, h - 1, 1 do + putbrushpixel(x, y, cols[getbrushpixel(x,y) + 1]); + end + end +end; +-- eof Colorize & Tint +-------------------------------------------------------- + +end -- OK diff --git a/share/grafx2/scripts/libs/dawnbringer_lib.lua b/share/grafx2/scripts/libs/dawnbringer_lib.lua new file mode 100644 index 00000000..541a5cb0 --- /dev/null +++ b/share/grafx2/scripts/libs/dawnbringer_lib.lua @@ -0,0 +1,2471 @@ +--DawnBringer function library v1.1 +--** THIS IS NOT A RUNNABLE SCRIPT! ** +--by Richard Fhager +-- http://hem.fyristorg.com/dawnbringer/ +-- Email: dawnbringer@hem.utfors.se +-- MSN: annassar@hotmail.com +-- +-- Many functions in here was adopted from Evalion, a Javascript codecrafting/imageprocessing project +-- http://goto.glocalnet.net/richard_fhager/evalion/evalion.html +-- +-- +-- You may access these functions in your own scripts by loading this library, +-- just add the follwing line as one of the first instructions: +-- +-- require("dawnbringer_lib") +-- +-- or +-- +-- dofile("dawnbringer_lib.lua") +-- +-- +-- Note that the functions must be called with the full library object-name, "db.function_name..." +-- + +-- Global library object +db = {} + + +-- ************************************* +-- *** Text & Conversions *** +-- ************************************* +-- +-- + +function db.rgb2HEX(r,g,b,prefix) + local c,n,s,t,z + c = {r,g,b} + z = {"0",""} + t = "" + for n = 1, 3, 1 do + s = string.upper(string.format("%x",c[n])) + t = t..z[#s]..s + --s = tonumber(c[n],16) + --t = t..s + end + return prefix..t +end + + +-- +-- ... eof Text & Conversions ... +-- + + + +-- ************************************* +-- *** Custom Math Functions *** +-- ************************************* +-- +-- +function db.sign(v) + local s + s = 0 + if v > 0 then s = 1; end + if v < 0 then s = -1; end + return s +end +-- + +-- +function db.rotation (rot_ang,hub_x,hub_y,x,y) -- Rotate coordinates x & y relative hub + local new_ang,dist,m,xd,yd,v; m = math + xd=hub_x-x; + yd=hub_y-y; + if (not(xd==0 and yd==0)) then + v = -90; if xd < 0 then v = 90; end + new_ang = m.atan(yd/xd) - (v+rot_ang) * m.pi/180; + dist = m.sqrt(xd*xd+yd*yd); + x = hub_x - m.sin(new_ang)*dist; + y = hub_y + m.cos(new_ang)*dist; + end + return math.floor(x),math.floor(y) -- For drawing purposes +end +-- + +-- +-- ... eof Custom Math Functions ... +-- + +-- ************************************* +-- *** Fractional Scenery *** +-- ************************************* + +-- +function db.setSceneryPalette() + db.colorCigarr(10,28,true) -- 250 colors + setcolor(250, 208,48,48) + setcolor(251, 48,208,48) + setcolor(252, 48,48,208) + setcolor(253, 224,224,64) + setcolor(254, 224,64,224) + setcolor(255, 64,224,224) +end +-- + +-- +function db.star(xf,yf,sx,sy,rgb,haz,out,lum) + local n,c,dist; c={} + dist = haz + out * math.sqrt((xf-sx)^2+(yf-sy)^2); + for n = 1, 3, 1 do c[n] = (rgb[n] * lum) / dist; end + return c; +end +-- + +-- +function db.zoom(xf,yf,zoom,panx,pany) -- Zoom and Pan in a fractional coord-system + xf = (xf-0.5)/zoom + 0.5 + panx; + yf = (yf-0.5)/zoom + 0.5 + pany; + return xf,yf +end +-- + +-- +function db.rotationFrac(rot_ang,hub_x,hub_y,x,y) -- Rotate coordinates x & y relative hub + local new_ang,dist,m,xd,yd,v; m = math + xd=hub_x-x; + yd=hub_y-y; + if (not(xd==0 and yd==0)) then + v = -90; if xd < 0 then v = 90; end + new_ang = m.atan(yd/xd) - (v+rot_ang) * m.pi/180; + dist = m.sqrt(xd*xd+yd*yd); + x = hub_x - m.sin(new_ang)*dist; + y = hub_y + m.cos(new_ang)*dist; + end + return x,y +end +-- + +-- +function db.twirl(x,y,arms,trot,tpow,tang) + local b,ang,vx,vy,vr,m,deg,tw + m=math; deg=math.pi/180; tw=.5; + if (not(x==.5 and y==.5)) then + ang = m.atan((.5-y)/(.5-x)); + b = 0; if (x>.5) then b = m.pi; end + vx = .5-x; vy = .5-y; vr = m.pow(m.sqrt(vx*vx+vy*vy),tpow); + tw = .5+m.sin(-tang*deg+vr*trot+(ang + b)*arms)*.5; + end + return tw; +end +-- + +--- Alpha filters +-- +function db.alpha1(x,y,amp) -- Coord, Amplify: 0..n + local p,a,xh,yh,m + xh=0.5-x; yh=0.5-y; m = math + p = m.pow(xh*xh+yh*yh,0.7); + a = m.cos(32*m.pi*p)*m.sin(8*m.pi*(xh+yh)); + return 1 + (a * amp) +end +-- + +-- +-- ... eof Fractional Scenery ... +-- + +-- ************************************* +-- *** Custom Array Functions *** +-- ************************************* +-- +-- Ok, I don't know Lua that well (still unsure about some scopes & refs etc.) +-- And some features may not be active in Grafx2. So, some of the follwing functions +-- may exist in Lua/Grafx2...but since I'm not sure if and how they work - I'll prefer +-- to add a set of my own of known performance. + +-- +function db.newArrayInit2Dim(xs,ys,val) + local x,y,ary; ary = {} + for y = 1, ys, 1 do + ary[y] = {} + for x = 1, xs, 1 do + ary[y][x] = val + end + end + return ary +end +-- + +-- +-- Merge two arrays into a NEW one: array_c = db.newArrayMerge(array_b,array_b) +-- +function db.newArrayMerge(a,b) + local n,ary; ary = {} + for n = 1, #a, 1 do + ary[n] = a[n] + end + for n = 1, #b, 1 do + ary[n+#a] = b[n] + end + return ary +end +-- + +-- +-- Generate a copy of an array with a new value added Last +-- +function db.newArrayInsertLast(a,val) + local n,ary; ary = {} + for n = 1, #a, 1 do + ary[n] = a[n] + end + ary[#a+1] = val + return ary +end +-- + +-- +-- Generate a copy of an array with a new value added First +-- +function db.newArrayInsertFirst(a,val) + local n,ary; ary = {} + ary[1] = val + for n = 2, #a+1, 1 do + ary[n] = a[n-1] + end + return ary +end +-- + +-- +function db.ary2txt(ary) -- One & two dimensions supported [a,b] -> "a,b". [[a,b],[c,d]] -> "a-b, c-d" + local t,n,m,v + t = "" + for n = 1, #ary, 1 do + if type(ary[n]) == "table" then + t = t..ary[n][1] + for m = 2, #ary[n], 1 do + t = t.."-"..ary[n][m] + end + else t = t..ary[n]; + end + t = t..", " + end + return t +end +-- + + +-- +-- ... eof Custom Array Functions ... +-- + + +-- ************************************* +-- *** Misc. Logical Operations *** +-- ************************************* + +-- +-- palList [r,g,b,palindex] is expected only to contain unique colors +-- index = -1 --> index of list +-- +function db.makeIndexList(list,index) + local n,ilist + ilist = {} + for n = 1, #list, 1 do + if (index > 0) then ilist[n] = list[n][index]; end + if (index == -1) then ilist[n] = n; end + end + return ilist +end +-- + +-- +-- Return a list of all possible (non-same) pairs from the entries in a list +-- [a,b,c] --> [[a,b],[a,c],[b,c]] +-- (All entries are treated as unique. i.e it's only the INDEX that counts) +-- mode = 0: Only unique pairs (m = (n^2 - n)/2), [a,b] --> [[a,b]] +-- mode = 1: All pairs, i.e mirror versions as well. (m = n^2 - n), [a,b] --> [[a,b], [b,a]] +-- +function db.pairsFromList(list,mode) + local a,b,l,n,pairs + pairs = {} + l = #list + n = 1 + for a = 1, l, 1 do + for b = a+1, l, 1 do + pairs[n] = {list[a],list[b]}; n = n + 1 + if mode == 1 then pairs[n] = {list[b],list[a]}; n = n + 1; end + end + end + return pairs +end +-- + +function db.valueInArray(ary,val) + local n,res + res = false + for n = 1, #ary, 1 do + if ary[n] == val then res = true; break; end + end + return res +end + +-- RAMP specific + +-- Remove initial pair (palList) colors from pallist +function db.initiateRamp(pair,pallist,pal_index) + local n,found,plist + plist = {} + + found = 1 + for n = 1, #pallist, 1 do + if db.valueInArray(pair,pallist[n]) == false then + plist[found] = pallist[n]; found = found + 1; + end + end + + pair[pal_index] = plist -- ex: ["pal"] + + return pair -- Is now a 2 color RAMP +end +-- + +-- Remove new col entry from ramp's pallist and add it to the ramp, returns an updated ramp +-- RampList = [1,2] ["pal"] = palList = [3,4,5], addindex = 3 +-- --> [1,2,3] palList = [4,5] +function db.updateRamp(ramp,addindex,pal_index) + local n,found,pallist,plist,newramp + plist = {} + pallist = ramp[pal_index] + + -- New palList without added color to IndexList + found = 1 + for n = 1, #pallist, 1 do + if pallist[n] ~= addindex then + plist[found] = pallist[n]; found = found + 1; + end + end + + newramp = db.newArrayInsertLast(ramplist,addindex) + newramp[pal_index] = plist + + return rlist +end + +-- +-- Returns a list of all inital ramps from color pairs +-- +-- Weeds out bad pairs, attaches remaining palette colors and the first rgb-vector +-- +-- +function db.initiateRampList(pairs,pallist,pal_index,vec_index,min,maxmult,rw,gw,bw) + local n,ramplist,newpairs,accept,dist,c1,c2,max,rD,gD,bD + ramplist = {} + max = min + (142 / math.sqrt(#pallist)) * maxmult -- min ex: 8-12 + accept = 0 + + for n = 1, #pairs, 1 do + c1 = pallist[pairs[n][1]] + c2 = pallist[pairs[n][2]] + rD = c2[1] - c1[1] + gD = c2[2] - c1[2] + bD = c2[3] - c1[3] + dist = math.sqrt( (rw*rD)^2 + (gw*gD)^2 + (bw*bD)^2 ) + + if dist >= min and dist <= max then + accept = accept + 1; ramplist[accept] = db.initiateRamp(pairs[n],pallist,pal_index); + ramplist[accept][vec_index] = {rD, gD, bD, dist}; -- Add first color vector, ONLY KEEP DISTANCE? + end + end + + return ramplist +end + + +function db.findRampExpansionColors(ramp) + local clist + clist = {} + -- Calculate vectors here? + return clist +end + + +function db.findRAMPS(min_len, max_len) + local i,n,c,pallist,ramp,ramplist,pairs,spairs,palindex,vecindex,found,donelist,newlist,dones + local colorlist + palindex = "pal" + vecindex = "vector" + pallist = db.fixPalette(db.makePalList(256), 0) + pairs = db.pairsFromList(db.makeIndexList(pallist,-1), 0) + ramplist = db.initiateRampList(pairs,pallist,palindex,vecindex, 8,0.75, 0.26,0.55,0.19) + + -- MIN_LEN = 5 + -- MAX_LEN = 10 + + -- Split Ramp-build into two parts: + -- 1. Build ramps >= MIN_LEN, NONE added to 'Done' + -- 2. Run til no more ramps can be expanded or reaches MAX_LEN, ALL ramps added to 'Done' + + for i = 1, (min_len - 2), 1 do -- Assuming 2 for inital pairs (2 color ramps) + newlist = {} + found = 0 + for n = 1, #ramplist, 1 do + ramp = ramplist[n] + colorlist = db.findRampExpansionColors(ramp) -- Colors that can split the current ramp into new expanded ramps + for c = 1, #colorlist, 1 do + found = found + 1; newlist[found] = db.updateRamp(ramp,colorlist[c],palindex); -- Ramp is expanded by 1 color + end + end + ramplist = newlist + end + + + donelist = {}; dones = 0 + + repeat + newlist = {} + found = 0 + for n = 1, #ramplist, 1 do + ramp = ramplist[n] + if true == false then + found = found + 1; newlist[found] = db.updateRamp(ramp,color,palindex); + else + dones = dones + 1; donelist[dones] = ramp; + end + end + --ramplist = newlist + until found == 0 + + return #pairs.." - "..#ramplist +end + +-- +-- ... eof Misc. Logical Operations ... +-- + + +-- *************************************** +-- *** General RGB-Color Modifications *** +-- *************************************** + + +-- +function db.makeComplimentaryColor(r,g,b,brikeeplev) -- Lev: 0 = Normal, 1 = Loose, 2 = Strict + + local bri_o,bri_n,bdiff + + function cap(v) return math.max(0,math.min(v,255)); end + + bri_o = db.getBrightness(r,g,b) + r,g,b = db.shiftHUE(r,g,b,180) + + if brikeeplev > 0 then + + for n = 0, brikeeplev*3-1, 1 do -- Must iterate to reduce brightness error + bri_n = db.getBrightness(r,g,b) + bdiff = (bri_o - bri_n) / 2 * brikeeplev + r = cap(r + bdiff) + g = cap(g + bdiff) + b = cap(b + bdiff) + end + + end + + return r,g,b + +end +-- + + +-- *** Color balance *** +-- +-- bri_flag: Preserve brightness +-- loose_flag: Loose preservation restrictions for brightness and balance +-- +-- Jeez, was this a tricky sucker; color-balance is just adding and capping... +-- but trying color-balance with preserved perceptual brightness is a different monster... +-- ...so bad I could only solve it by iterative error correction. +-- +function db.ColorBalance(r,g,b,rd,gd,bd,bri_flag,loose_flag) -- preserve brightness + local rw,gw,bw,ri,gi,bi,itot,rni,gni,bni,ro,go,bo,ovscale,lev,count,rt,gt,bt,rf,gf,bf,bri + + -- Dawn 3.0, [0.26,0.55,0.19], 0-255 bri-colorscale adjust = 1.56905 + rw,gw,bw = 0.26, 0.55, 0.19 + + function cap(v) return math.min(255,math.max(v,0)); end + + bri = db.getBrightness(r,g,b) + + + -- Loose brightness & balance preservation, a good compromise. + if bri_flag == true and loose_flag == true then + + lev = (rd + gd + bd) / 3 + rd = rd - lev + gd = gd - lev + bd = bd - lev + + brin = db.getBrightness(cap(r+rd),cap(g+gd),cap(b+bd)) + itot = brin - bri + rd = rd - itot + gd = gd - itot + bd = bd - itot + + end + + + if bri_flag == true and loose_flag == false then + + itot = 255 + count = 0 + + -- Normalize (Yup, it's right only to normalize once first..cont.norm. will have some counter-effect) + lev = (rd + gd + bd) / 3 + rd = rd - lev + gd = gd - lev + bd = bd - lev + + repeat + + --messagebox("Norm:"..rd..", "..gd..", "..bd) + + -- Calculate total brightness change + -- Note: Perceptual Brightness is exponential, and can't be delta-adjusted for anything other than greyscales. + -- Although the formula for the new brightness corrected normalization level can can be derived... + -- ...it doesn't do much good since the bigger problem is overflow outside the 0-255 boundary. + -- As for now, I see no other means to solve this issue than with iterative error-correction. + + rt = r+rd + gt = g+gd + bt = b+bd + + itot = 9e99 + rni = rd + gni = gd + bni = bd + + -- We can get brightness of negative values etc. So bri-correction is put on hold until values are scaled down + if (rt>=0 and gt>=0 and bt>=0) and (rt<256 and gt<256 and bt<256) then + brin = db.getBrightness(rt,gt,bt) + itot = brin - bri + --messagebox("Bri Diff: "..itot) + -- Brightness adjusted balance + rni = rd - itot + gni = gd - itot + bni = bd - itot + end + + --messagebox("Bri Adj Bal:"..rni..", "..gni..", "..bni) + + -- Apply balance to find overflow (as fraction of the channel change) + ro = math.max( math.max((r + rni)-255,0), math.abs(math.min((r + rni),0)) ) / math.max(math.abs(rni),1) + go = math.max( math.max((g + gni)-255,0), math.abs(math.min((g + gni),0)) ) / math.max(math.abs(gni),1) + bo = math.max( math.max((b + bni)-255,0), math.abs(math.min((b + bni),0)) ) / math.max(math.abs(bni),1) + + ovscale = 1 - math.max(ro,go,bo) + + -- Scaling balances might be logically incorrect (as they can be seen as constant differences) + -- But scaling DOWN is quite harmless and I don't see how it could be done otherwise... + -- ex: +10 red, +5 blue: Scale x2 = +20 red, +10 blue -> More red over blue than ordered, a contrast behaviour. + -- +10 red, +5 blue: Scale x0.5 = +5 red, +2.5 blue -> Less of everything, but a part of the order. Harmless? + -- + rd = rni * ovscale + gd = gni * ovscale + bd = bni * ovscale + + count = count + 1 + + --messagebox("Final bal:"..rd..", "..gd..", "..bd) + + until math.abs(itot) < 1 or count > 5 + + end + + rf = r + rd + gf = g + gd + bf = b + bd + + --messagebox("Result color:"..rf..", "..gf..", "..bf) + + return rf,gf,bf +end +-- + + + +-- +-- bri_flag: Preserve brightness +-- cap_flag: Cap new color at 0-255, has a desaturating effect for large values. +-- +function db.ColorBalanceXXX(r,g,b,rd,gd,bd,bri_flag,cap_flag) -- preserve brightness + local rf,gf,bf + + if cap_flag == true then + rd = math.min(255,math.max(0, r+rd)) - r + gd = math.min(255,math.max(0, g+gd)) - g + bd = math.min(255,math.max(0, b+bd)) - b + end + + local rw,gw,bw,ri,gi,bi,itot,rni,gni,bni,ro,go,bo,ovscale + + + -- Dawn 3.0, [0.26,0.55,0.19], 0-255 bri-colorscale adjust = 1.56905 + rw,gw,bw = 0.26, 0.55, 0.19 + + if bri_flag == true then + + -- Calculate total brightness change + --ri = rd * rw + --gi = gd * gw + --bi = bd * bw + --itot = math.sqrt(ri^2 + gi^2 + bi^2) + + bri = db.getBrightness(r,g,b) + brin = db.getBrightness(r+rd,g+gd,b+bd) + itot = brin - bri + + + -- Normalized and Brightness adjusted balance + rni = rd - itot + gni = gd - itot + bni = bd - itot + + -- Apply balance to find overflow (as fraction of the channel change) + ro = math.max( math.max((r + rni)-255,0), math.abs(math.min((r + rni),0)) ) / math.max(math.abs(rni),1) + go = math.max( math.max((g + gni)-255,0), math.abs(math.min((g + gni),0)) ) / math.max(math.abs(gni),1) + bo = math.max( math.max((b + bni)-255,0), math.abs(math.min((b + bni),0)) ) / math.max(math.abs(bni),1) + + ovscale = 1 - math.max(ro,go,bo) + + rd = rni * ovscale + gd = gni * ovscale + bd = bni * ovscale + + end + + rf = r + rd + gf = g + gd + bf = b + bd + + return rf,gf,bf +end +-- + +-- +function db.getContrast(ch) -- Channel, returns fraction -1..0..1, negative for ch < 127.5 + --return math.abs((ch / 127.5) - 1) + return (ch / 127.5) - 1 +end +-- + +-- +function db.getAvgContrast(r,g,b) + return (math.abs(db.getContrast(r)) + math.abs(db.getContrast(g)) + math.abs(db.getContrast(b))) / 3 +end +-- + +-- +-- Mode = 0: Proportional - all colors reach max contrast at 100% +-- +-- Mode = 1: Linear - percentage simply added +-- +function db.changeContrastOLD(r,g,b,prc,mode) + + local m,rd,gd,bd,rv,gv,bv,rc,gc,bc,base,sign + + base = 1; sign = 1 + if prc < 0 then base = 0; sign = -1; end -- decontrast + + m = prc / 100 * sign + + -- mode 0 + rc = db.getContrast(r) + rd = (base - math.abs(rc)) * m * db.sign(rc) + rv = (rc+rd+1) * 127.5 + + gc = db.getContrast(g) + gd = (base - math.abs(gc)) * m * db.sign(gc) + gv = (gc+gd+1) * 127.5 + + bc = db.getContrast(b) + bd = (base - math.abs(bc)) * m * db.sign(bc) + bv = (bc+bd+1) * 127.5 + + return rv,gv,bv + +end +-- + +function db.changeContrast(r,g,b,prc) -- Photoshop style + + local m,rd,gd,bd,rv,gv,bv,rc,gc,bc + + m = 1 + math.pow((255 / 100 * prc),3) / (255*255) + + -- decontrast + if prc < 0 then + m = 1 - math.abs(prc)/100 + end + + rc = db.getContrast(r) + rd = rc * m + rv = (rd+1) * 127.5 + + gc = db.getContrast(g) + gd = gc * m + gv = (gd+1) * 127.5 + + bc = db.getContrast(b) + bd = bc * m + bv = (bd+1) * 127.5 + + return rv,gv,bv + +end + + + +-- +function db.getBrightness(r,g,b) -- 0-255 + local bri + --bri = (r+g+b)/3 + --bri = r*0.3 + g*0.59 + b*0.11 -- Luma Y'601 + --bri = math.sqrt((r*0.3)^2 + (g*0.59)^2 + (b*0.11)^2) -- Luma Y'601 + --bri = r*0.245 + g*0.575 + b*0.18 -- Dawn 2.0 + + bri = math.sqrt((r*0.26)^2 + (g*0.55)^2 + (b*0.19)^2) * 1.56905 -- Dawn 3.0 + return bri +end +-- + + +-- +-- Note on desaturation: These functions are all junk, the only way to desaturate +-- is to fade a color into it's corresponding greyscale. +-- + +-- +function db.desaturate(percent,r,g,b) -- V1.0 by Richard Fhager + local a,p + p = percent / 100 + a = (math.min(math.max(r,g,b),255) + math.max(math.min(r,g,b),0)) * 0.5 * p + r = r + (a-r*p) -- a+r*(1-p) + g = g + (a-g*p) + b = b + (a-b*p) + return r,g,b +end +-- + +-- +function db.desaturateA(percent,c) -- array version + local r,g,b,a + r = c[1] + g = c[2] + b = c[3] + p = percent / 100 + a = (math.min(math.max(r,g,b),255) + math.max(math.min(r,g,b),0)) * 0.5 * p + r = r + (a-r*p) + g = g + (a-g*p) + b = b + (a-b*p) + return {r,g,b} +end +-- + +-- +function db.desatAVG(desat,c) -- Desaturation, simpe average + r = c[1] + g = c[2] + b = c[3] + p = desat / 100 + a = (r+g+b)/3 + r = r + p*(a-r) + g = g + p*(a-g) + b = b + p*(a-b) + return {r,g,b} +end +-- + + +-- +function db.getSaturation(r,g,b) -- HSL + local M,m,c,s,l + M = math.max(r,g,b) + m = math.min(r,g,b) + c = (M - m)/255 + s = 0 + if c ~= 0 then + --l = (0.3*r + 0.59*g + 0.11*b)/255 -- HSLuma: Y'601 + l = (M+m)/510 -- This produces a quite "correct looking" divison of saturation + if l <= 0.5 then s = c / (2*l); end + if l > 0.5 then s = c / (2-2*l); end + end + return math.min(255,s * 255) +end +-- + +-- +function db.getTrueSaturationX(r,g,b) -- Distance from grayscale axis. Not HSV/HSL + local sat,bri + bri = (r+g+b) / 3 + sat = math.min(255, math.sqrt((r-bri)^2 + (g-bri)^2 + (b-bri)^2) * 1.224744875) + return sat +end +-- + +-- WIP. Trying to find a more natural model for estimating Saturation +-- Current: (HSL + True) / 2 +function db.getAppSaturation(r,g,b) + return math.min(255, (db.getSaturation(r,g,b) + db.getTrueSaturationX(r,g,b)) / 2) +end +-- + +-- +function db.saturate(percent,r,g,b) + local a,m,p,mc + a = (math.min(math.max(r,g,b),255) + math.max(math.min(r,g,b),0)) * 0.5 + m = math.min(255-math.max(r,g,b), math.min(r,g,b)) + p = percent * (m / 100) + mc = math.max((r-a),(g-a),(b-a)) -- Can this be derived elsewhere? + if mc ~= 0 then + r = r + (r-a) * p / mc + g = g + (g-a) * p / mc + b = b + (b-a) * p / mc + end + return r,g,b +end +-- + +-- +-- Super Saturate: Better than Photoshop etc. +-- +-- Higher than 100% power is ok +-- +function db.saturateAdv(percent,r,g,b,brikeeplev,greydamp) -- brikeep = 0 - 2 + local a,m,p,mc,bri_o,bri_n,bdiff,mx,mi,adj,q,n + function cap(v) return math.max(0,math.min(v,255)); end + mx = math.max(r,g,b) + mi = math.min(r,g,b) + bri_o = db.getBrightness(r,g,b) + a = (math.min(mx,255) + math.max(mi,0)) * 0.5 + m = math.min(255-mx, mi) + p = percent * (m / 100) + mc = math.max((r-a),(g-a),(b-a)) -- Can this be derived elsewhere? + if mc ~= 0 and m ~= 0 then + adj = math.min(1,(mx - mi) / m) -- Reduce effect on low saturation + if greydamp == false then adj = 1; end + q = p / mc * adj + r = cap( r + (r-a) * q ) + g = cap( g + (g-a) * q ) + b = cap( b + (b-a) * q ) + end + for n = 0, brikeeplev*2, 1 do -- Must iterate to reduce brightness error + bri_n = db.getBrightness(r,g,b) + bdiff = (bri_o - bri_n) / 2 * brikeeplev + r = cap(r + bdiff) + g = cap(g + bdiff) + b = cap(b + bdiff) + end + return r,g,b +end +-- + + +-- +-- Lightness: Darken / Brighten color (Argument and returnvalue is a rgb-list) +-- Rate of change is inversely proportional to the distance of the max/min. +-- i.e. all colors/channels will reach max/min at the same time (at 0 or 100 %) +-- (As opposed to 'Brightness' where all channels are changed by a constant value) +-- +function db.lightness(percent,c) + local v,r,g,b,p + r = c[1] + g = c[2] + b = c[3] + p = math.abs(percent/100) + v = 255 + if percent < 0 then v = 0; end + r = r + (v - r)*p + g = g + (v - g)*p + b = b + (v - b)*p + return {r,g,b} +end +-- + +-- +function db.changeLightness(r,g,b,percent) + local v + v = db.lightness(percent,{r,g,b}) + return v[1],v[2],v[3] +end +-- + +-- +function db.getLightness(r,g,b) -- HSL bi-hexcone + return (math.max(r,g,b) + math.min(r,g,b)) / 2 +end +-- + +-- +function db.shiftHUE(r,g,b,deg) -- V1.3 R.Fhager 2007, (Heavily derived code, hehe...) + local c,h,mi,mx,d,s,p,i,f,q,t + c = {g,b,r} + mi = math.min(r,g,b) + mx = math.max(r,g,b); v = mx; + d = mx - mi; + s = 0; if mx ~= 0 then s = d/mx; end + p = 1; if g ~= mx then p = 2; if b ~= mx then p = 0; end; end + + if s~=0 then + h=(deg/60+(6+p*2+(c[1+p]-c[1+(p+1)%3])/d))%6; + i=math.floor(h); + f=h-i; + p=v*(1-s); + q=v*(1-s*f); + t=v*(1-s*(1-f)); + c={v,q,p,p,t,v} + r = c[1+i] + g = c[1+(i+4)%6] + b = c[1+(i+2)%6] + end + + return r,g,b +end +-- + +-- +function db.getHUE(r,g,b,greytol) -- 0-6 (6.5 = Greyscale), mult. with 60 for degrees + -- 1 Color diff is roughly detected by Tolerance = 0.0078125 (Tol. incr. with lightness etc.) + local c,h,mi,mx,d,s,p,i,f,q,t + c = {g,b,r} + mi = math.min(r,g,b) + mx = math.max(r,g,b); v = mx; + d = mx - mi; + s = 0; if mx ~= 0 then s = d/mx; end + p = 1; if g ~= mx then p = 2; if b ~= mx then p = 0; end; end + + h = 6.5 -- for custom graphical purposes + if s>greytol then -- can't use >= + h=(6+p*2+(c[1+p]-c[1+(p+1)%3])/d)%6; + end + + return h +end +-- + +-- +-- ... eof RGB color modifications ... +-- + + + +-- **************************************** +-- *** Custom Color / Palette functions *** +-- **************************************** + + +-- +function db.rgbcap(r,g,b,mx,mi) + local m = math + return m.max(mi,m.min(r,mx)), m.max(mi,m.min(g,mx)), m.max(mi,m.min(b,mx)) +end +-- + +-- +function db.makePalList(cols) + local pal,n,r,g,b + pal = {} + for n = 0, cols-1, 1 do + r,g,b = getcolor(n) + pal[n+1] = {r,g,b,n} + end + return pal +end +-- + +-- +function db.makeSparePalList(cols) + local pal,n,r,g,b + pal = {} + for n = 0, cols-1, 1 do + r,g,b = getsparecolor(n) + pal[n+1] = {r,g,b,n} + end + return pal +end +-- + + +-- +-- Use to remove the black colors (marks unused colors) from palette-list +-- if it's known that no black color exists in the image. +function db.stripBlackFromPalList(pallist) + local i,u,c,dummy; i = 257 -- Do 'nothing' If using a full 256 col palette with no blacks + for u = 1, #pallist, 1 do + c = pallist[u] + if (c[1]+c[2]+c[3]) == 0 then i = u; end + end + dummy = table.remove(pallist,i) + return pallist +end +-- + +-- +function db.stripIndexFromPalList(pallist,colindex) + local i,u,c,dummy + for u = 1, #pallist, 1 do + c = pallist[u] + if c[4] == colindex then i = u; end + end + dummy = table.remove(pallist,i) + return pallist +end +-- + +-- +function db.addHSBtoPalette(pallist) + local n,hue,sat,rgb + for n=1, #pallist, 1 do + rgb = pallist[n] + pallist[n][5] = db.getHUE(rgb[1],rgb[2],rgb[3],0) + pallist[n][6] = db.getSaturation(rgb[1],rgb[2],rgb[3]) + pallist[n][7] = db.getBrightness(rgb[1],rgb[2],rgb[3]) + end + return pallist -- {r,g,b,n,bri,hue,sat} +end +-- + +-- +function db.makePalListRange(start,ends) + local pal,n,r,g,b,a + pal = {} + a = 1 + for n = start, ends, 1 do + r,g,b = getcolor(n) + pal[a] = {r,g,b,n}; a = a + 1; + end + return pal +end +-- + + +-- +function db.makePalListShade(cols,sha) -- Convert colors to less bits, colorcube operations etc. + local pal,n,r,g,b,mf,div + mf = math.floor + div = 256 / sha + pal = {} + for n = 0, cols-1, 1 do + r,g,b = getcolor(n) + pal[n+1] = {mf(r/div),mf(g/div),mf(b/div),n} + end + return pal +end +-- +-- +function db.makePalListShadeSPARE(cols,sha) -- Convert colors to less bits, colorcube operations etc. + local pal,n,r,g,b,mf,div + mf = math.floor + div = 256 / sha + pal = {} + for n = 0, cols-1, 1 do + r,g,b = getsparecolor(n) + pal[n+1] = {mf(r/div),mf(g/div),mf(b/div),n} + end + return pal +end +-- + + + +-- +function db.getColorDistance_weight(r1,g1,b1,r2,g2,b2,rw,gw,bw) + return math.sqrt( (rw*(r1-r2))^2 + (gw*(g1-g2))^2 + (bw*(b1-b2))^2 ) +end +-- + +-- +function db.getBestPalMatch(r,g,b,pal,index_flag) -- pal = [r,g,b,palindex], index_flag -> return palindex if pal is sorted or reduced + local diff,best,bestcol,cols,n,c,p + cols = #pal + bestcol = -1 + best = 9e99 + + for n=1, cols, 1 do + p = pal[n] + diff = db.getColorDistance_weight(r,g,b,p[1],p[2],p[3],0.26,0.55,0.19) * 1.569 + if diff < best then bestcol = n; best = diff; end + end + + if index_flag == true then + bestcol = pal[bestcol][4] + 1 + end + + return bestcol-1 -- palList index start at 1, image-palette at 0 +end +-- + + +-- Normally this function will return the (image)palette index of best color +-- ...but if the palette has been sorted with 'fixPalette' it will return the index +-- of the custom palList, setting index_flag will convert this value to image-palette index +-- +-- HYBRID means the colormatch is a combo of color and (perceptual)brightness +-- +-- +function db.getBestPalMatchHYBRID(rgb,pal,briweight,index_flag) -- Now correctly balanced + local diff,diffC,diffB,best,bestcol,cols,n,c,r,g,b,p,obri,pbri + cols = #pal + bestcol = -1 + best = 9e99 + + --messagebox(briweight) + + -- Note: Not secured against negative values (this algorithm is SLOW, we cannot afford it) + r = rgb[1] + g = rgb[2] + b = rgb[3] + + obri = db.getBrightness(r,g,b) -- 0-255 + + for n=1, cols, 1 do + p = pal[n] + pbri = db.getBrightness(p[1],p[2],p[3]) + diffB = math.abs(obri - pbri) + -- we need to normalize the distance by the weights + diffC = db.getColorDistance_weight(r,g,b,p[1],p[2],p[3],0.26,0.55,0.19) * 1.569 + + diff = briweight * (diffB - diffC) + diffC + if diff < best then bestcol = n; best = diff; end + end + + if index_flag == true then + bestcol = pal[bestcol][4] + 1 -- Since we detract 1 on return, God Lua is stupid + end + + return bestcol-1 -- palList index start at 1, image-palette at 0 +end +-- + + + +-- +-- Special version of Hybrid-remapping for mixPalette list +-- +-- mixpal: {score,col#1,col#2,dist,rm,gm,bm, c1_r,c1_g,c1_b, c2_r,c2_g,c2_b} +-- +-- returns: {col#1,col#2} (index of palette) +-- +function db.getBestPalMatchHybridMIX(rgb,mixpal,briweight,mixreduction) + local diff,diffC,diffB,best,bestcol,cols,n,c,r,g,b,p,obri,pbri, distmult + cols = #mixpal + bestcol = -1 + best = 9e99 + + -- We will simply add the the distance to the mix with the distance between the mixcolors and + -- employ a user tolerance to much the latter will matter. + --distmult = 255 / 9.56 / 100 * mixreduction -- 16 shades + distmult = 1.56902 / 100 * mixreduction -- 24-bit, Dawn3.0 colormodel + + -- Note: Not secured against negative values (this algorithm is SLOW, we cannot afford it) + r = rgb[1] + g = rgb[2] + b = rgb[3] + + obri = db.getBrightness(r,g,b) -- 0-255 + + for n=1, cols, 1 do + p = mixpal[n] + --pbri = db.getBrightness(p[5],p[6],p[7]) + + -- *** DawnBringer's exponetial color brightness dither resolution phenomena theorem *** + -- Bri = color value ^ 2 + -- Two adjacent pixels displayed with "normal high resolution" will NOT have the perceptual + -- brightness of the resulting mixcolor. The brightness lies closer to that of the brightest pixel. + -- Bri[(C1+C2)/2] = SQRT( (C1bri^2 + C2bri^2) / 2 ) + -- (Brightness according to Dawn-model: bri = SQRT( (r*.26)^2 + (g*.55)^2 + (b*.19)^2 ) ) + + pbri = math.sqrt((db.getBrightness(p[8],p[9],p[10])^2 + db.getBrightness(p[11],p[12],p[13])^2) / 2) + + diffB = math.abs(obri - pbri) + -- we need to normalize the distance by the weights + diffC = db.getColorDistance_weight(r,g,b,p[5],p[6],p[7],0.26,0.55,0.19) * 1.569 + p[4]*distmult + + diff = briweight * (diffB - diffC) + diffC + if diff <= best then bestcol = n; best = diff; end + end + + return {mixpal[bestcol][2], mixpal[bestcol][3]} +--return {mixpal[bestcol][2], 0} + + + +end +-- + + + +-- +function db.matchcolorHSB(h,s,b,pallist,index_flag) + -- + -- why don't we just convert HSB-diagram to RGB and do normal colormatching? + -- Not the same... + -- + local n,c,best,bestcol,pb,ph,ps,diff,huediff,huecorr,hue_adj,sat_adj,bri_adj + bestcol = -1 + best = 9e99 + + -- higher adjust means more impact (higher hue gives more interpolation ) + hue_adj = 4 + sat_adj = 0.075 + bri_adj = 2 + + huecorr = 255 / 6 -- Our Hue goes from 0.0 - 5.999 + + for n=1, #pallist, 1 do + c = pallist[n] + ph = c[5] + ps = c[6] + pb = c[7] + + huediff = math.abs(h-ph*huecorr) + if huediff > 127 then huediff = huediff - (huediff % 127) * 2; end + + --if ph == 6.5 then huediff = 0; end + + -- With less saturation, exact hue becomes less important and brightness more usefull + -- This allows for greyscales and low saturation colors to work smoothly. + huediff = huediff * (ps /255) + + diff = hue_adj*huediff^2 + (s-ps)^2 * sat_adj + (b-pb)^2 * bri_adj + + if diff <= best then bestcol = n; best = diff; end + end + + if index_flag == true then + bestcol = palList[bestcol][4] + 1 -- Since we detract 1 on return, God Lua is stupid + end + + return bestcol-1 + +end +-- + +-- +-- Used by PaletteAnalysis.lua, FindRamps(), MixColors() +-- +function db.fixPalette(pal,sortflag) -- Arrange palette & only keep unique colors + + local n,l,rgb,i,unique,bri,hue,sat,ulist,indexpal,newpal,dtot + ulist = {} + indexpal = {} + newpal = {} + local doubles; doubles = {} + + l = #pal + + unique = 1 -- ok, see how stupid lua is + dtot = 0 + for n=1, l, 1 do + rgb = pal[n]; -- actually rgbn + i = 1 + rgb[1] * 65536 + rgb[2] * 256 + rgb[3]; + bri = db.getBrightness(rgb[1],rgb[2],rgb[3]) + if indexpal[i] == nil then + indexpal[i] = rgb; ulist[unique] = {i,bri}; unique = unique+1; + else + doubles[rgb[4]] = true; -- Mark as double + dtot = dtot + 1 + end + end + + -- sort ulist + if sortflag == 1 then db.sorti(ulist,2); end -- sort by brightness + + l = #ulist + for n=1, l, 1 do + newpal[n] = indexpal[ulist[n][1]] + end + + newpal["doubles"] = doubles + newpal.double_total = dtot + + --messagebox("unique colors", unique-1) + + return newpal + +end +-- + +-- +-- InsertionSort Array, this is chaos...I'm confused and stomped...don't understand how Lua works... +-- ...sorting seem be to ok but this code is ugly... +-- Sort LO-HI +-- +-- Screwed up or confused thing here I think, perhaps lo-hi/hi-lo. This is working lo-hi but the code +-- looks like hi-lo...edit this some day +-- +function db.sorti(d,idx) + local a,j,tmp,l,e + l = #d + + for a=2, l, 1 do + tmp = d[a]; + e = a + for j=a, 2, -1 do + e = j + if d[j-1][idx] > tmp[idx] then d[j] = d[j-1]; e = j-1; else break; end; + end; + d[e] = tmp; -- WHY THE F**K CAN'T YOU READ j HERE!?! STUPID ASSUCKING LANGUAGE + + end; + --return d +end +-- + +-- +function db.drawColorspace12bit(x,y,cols,size) + local r,g,b,c,rows,row,col,s16,rx,ry,xx,yy + s16 = size*16 + rows = math.floor(16/cols) + + for g = 0, 15, 1 do + col = g % cols + row = math.floor(g / cols) + for r = 0, 15, 1 do + for b = 0, 15, 1 do + c = matchcolor(r*17,g*17,b*17) + xx = x+col*s16+r*size + yy = y+row*s16+b*size + for ry = 0, size-1, 1 do + for rx = 0, size-1, 1 do + putpicturepixel(xx+rx,yy+ry,c) + end;end + end + end + end +end +-- + +-- +function db.drawHSBdiagram(pallist,posx,posy,width,height,size,sat) + --db.addHSBtoPalette(palList) + local x,y,c + for y = 0, height-1, 1 do + for x = 0, width-1, 1 do + hue = 255/width * x + bri = 255/height * y + c = db.matchcolorHSB(hue,sat,bri,pallist,true) + db.drawRectangle(posx + x*size, posy + y*size,size,size, c) + end + end +end +-- + +-- +-- Histograms, remapping etc. +-- + +-- +function db.makeHistogram() + local n,y,x,c,w,h,list; list = {} + w, h = getpicturesize() + for n = 1, 256, 1 do list[n] = 0; end + for y = 0, h - 1, 1 do + for x = 0, w - 1, 1 do + c = getpicturepixel(x,y) + list[c+1] = list[c+1] + 1 + end + end + return list +end +-- + +-- +function db.makeSpareHistogram() + local n,y,x,c,w,h,list; list = {} + w, h = getsparepicturesize() + --w,h = 512,360 + for n = 1, 256, 1 do list[n] = 0; end + for y = 0, h - 1, 1 do + for x = 0, w - 1, 1 do + c = getsparepicturepixel(x,y) + list[c+1] = list[c+1] + 1 + end + end + return list +end +-- + + +-- +-- Makes a palette-list from only the colors (histogram) that occurs in the image +-- Assumes image/palette has not changed since histogram was created +function db.makePalListFromHistogram(hist) + local n,r,g,b,list,count + list = {} + count = 1 + for n = 1, #hist, 1 do + if hist[n] > 0 then + r,g,b = getcolor(n-1) + list[count] = {r,g,b,n-1} + count = count + 1 + end + end + return list +end +-- + +function db.makePalListFromSpareHistogram(hist) + local n,r,g,b,list,count + list = {} + count = 1 + for n = 1, #hist, 1 do + if hist[n] > 0 then + r,g,b = getsparecolor(n-1) + list[count] = {r,g,b,n-1} + count = count + 1 + end + end + return list +end +-- + + +-- +function db.remap(org) -- Working with a remap-list there's no need of reading backuppixel + --messagebox("Remapping") + local x,y,c,i,w,h,s,f,col + f = getpicturepixel + s = false + w, h = getpicturesize() + for y = 0, h - 1, 1 do + for x = 0, w - 1, 1 do + c = f(x,y) + i = org[c+1] + if i == null then i = matchcolor(getbackupcolor(getbackuppixel(x,y))); s = true; col = c; end -- Find color for a removed double + putpicturepixel(x,y,i) + end + end + if s then messagebox("Remapping: Not all image colors were found in remap-list (re-assign), probably due to duplicate removal. Matchcolor was used, ex: col# "..col); + end +end +-- + +-- +-- Palette DeCluster: Color-reduction by fusing similar colors into new ones, using a desired tolerance. +-- This is a method similar to Median-Cut, but more surgical. +-- +-- pallist: Palette list {r,g,b,palette_index} +-- hist: Histogram {color 0 pixels, color 1 pixels...etc} always a full 256 color list +-- crad: Cluster radius treshold in % of distance between black & white +-- A value of 0 will only remove identical colors +-- A value of 3-4 will usally fuse redundant colors without causing notice +-- prot_pow: (0..10) Protect common colors in histogram. Distances are increased by ocurrence. +-- Also gives protection to fused colors even if not using histogram (combined nominal weights) +-- pixels: Pixels in image (so protection can be calculated) +-- rw,gw,bw: Color weights (rw+gw+bw = 1, 0.33,0.33,0.33 is nominal) +-- +-- Returns: +-- a new (c)palette list {r,g,b,{original palette_indices},fused flag, histogram_weight} +-- a remap list (org) [image color + 1] = remap color (in the new palette) +function db.deCluster(pallist, hist, crad, prot_pow, pixels, rw,gw,bw) + + --messagebox(pixels) + + local u,c,a,i,o,j,n,c1,c2,r,g,b,r1,g1,b1,r2,g2,b2,wt,rt,gt,bt,tot,pd + local worst,wtot,maxdist,maxDist,distfrac,clusterExists,clustVal,count,crad1 + local cList,cPalList,clusterList,fuseCol,orgcols,newPalList,org + + maxdist = math.sqrt(rw*rw*65025 + gw*gw*65025 + bw*bw*65025) + distfrac = 100 / maxdist + + -- Let's just make a slightly more suitable format of the pallist (List for original color(s)) + cPalList = {} + for u = 1, #pallist, 1 do + c = pallist[u] + cPalList[u] = {c[1],c[2],c[3],{c[4]},false,hist[c[4]+1]} -- r,g,b,{original colors},fuse_marker,histogram_weight + end + + --table.insert(cPalList,{255,255,0,{257},false,1}) + + clusterExists = true + while clusterExists do + clusterExists = false + clusterList = {} + + crad1 = crad + 1 -- avoid divison by zero + worst = 9999 + for a = 1, #cPalList, 1 do + c1 = cPalList[a] + r1,g1,b1 = c1[1],c1[2],c1[3] + wtot = c1[6] + cList = {a} + maxDist = 0 + for b = 1, #cPalList, 1 do + if (b ~= a) then + c2 = cPalList[b] + r2,g2,b2 = c2[1],c2[2],c2[3] + wt = c2[6] + pd = math.pow((1 + wt / pixels), prot_pow) -- Protection, increase distance + dist = db.getColorDistance_weight(r1,g1,b1,r2,g2,b2,rw,gw,bw) * distfrac * pd + if dist <= crad then + wtot = wtot + wt + table.insert(cList,b) + maxDist = math.max(dist,maxDist) + end + end + end -- b + if #cList > 1 then + clustVal = maxDist / (crad1 * #cList) * (wtot / #cList) + if clustVal < worst then + worst = clustVal + clusterList = cList + end + end + end -- a + + --t = db.ary2txt(clusterList) + --messagebox("Worst cluster is "..t) + + -- Fuse + if #clusterList > 1 then + clusterExists = true -- Run another iteration and look for more clusters + fuseCol = {0,0,0,{}} + rt,gt,bt,tot = 0,0,0,0 + for n = 1, #clusterList, 1 do + i = clusterList[n] + c = cPalList[i] + --o = c[4][1] -- Original color (always #1 in list since fused colors can't re-fuse) + o = c[4] -- Original color list + --if c[5] == true then messagebox("Re-Fusing..."); end + r,g,b = c[1],c[2],c[3] + --wt = hist[o+1] -- Org. colors are 0-255 + wt = c[6] + rt = rt + r * wt + gt = gt + g * wt + bt = bt + b * wt + tot = tot + wt + cPalList[i] = -1 -- Erase color + --table.insert(fuseCol[4],o) + orgcols = fuseCol[4] + for j = 1, #o, 1 do + table.insert(orgcols,o[j]) + end + fuseCol[4] = orgcols + end + + rt = rt / tot + gt = gt / tot + bt = bt / tot + fuseCol[1] = rt + fuseCol[2] = gt + fuseCol[3] = bt + fuseCol[5] = true -- fusecol marker + fuseCol[6] = tot + table.insert(cPalList,fuseCol) + --messagebox(#clusterList.." Colors was fused, resulting in "..rt..", "..gt..", "..bt) + newPalList = {} + for n = 1, #cPalList, 1 do + if cPalList[n] ~= -1 then + table.insert(newPalList,cPalList[n]) + --newPalList = db.newArrayInsertLast(newPalList,cPalList[n]) + end + end + cPalList = newPalList + --messagebox("Pal length: "..#cPalList) + statusmessage("DeCluster - Image colors:"..#cPalList.." "); waitbreak(0) + end -- fuse + + end -- while + + -- Create remap-list + org = {} + count = 0 + for u = 1, #cPalList, 1 do + c = cPalList[u] + for n = 1, #c[4], 1 do + i = c[4][n] + org[i+1] = count -- quick way to remap without matchcolor + end + count = count + 1 + end + + return org,cPalList + +end; -- decluster + + +-- +-- ... eof Custom Color / Palette functions ... +-- + + +-- ***************************** +-- *** Custom Draw functions *** +-- ***************************** + +-- +function db.lineTransp(x1,y1,x2,y2,c,amt) -- amt: 0-1, 1 = Full color + local n,st,m,x,y,r,g,b,r1,g1,b1,c2,org; m = math + org = 1 - amt + st = m.max(1,m.abs(x2-x1),m.abs(y2-y1)); + for n = 0, st, 1 do + x = m.floor(x1+n*(x2-x1)/st) + y = m.floor(y1+n*(y2-y1)/st) + r,g,b = getcolor(getpicturepixel(x,y)) + r1,g1,b1 = getcolor(c) + c2 = matchcolor(r1*amt+r*org, g1*amt+g*org, b1*amt+b*org) + putpicturepixel(x, y, c2 ); + end +end +-- + +-- +function db.drawBrushRectangle(x1,y1,w,h,c) + local x,y + for y = y1, y1+h-1, 1 do + for x = x1, x1+w-1, 1 do + putbrushpixel(x,y,c); + end + end +end +-- + +-- +function db.drawRectangle(x1,y1,w,h,c) + drawfilledrect(x1, y1, x1+w, y1+w, c); +end +-- + +-- +function db.drawRectangleNeg(x1,y1,w,h,c) + local x,y,xs,ys + xs = db.sign(w) + ys = db.sign(h) + if xs == 0 then xs = 1; end + if ys == 0 then ys = 1; end + for y = y1, y1+h-1, ys do + for x = x1, x1+w-1, xs do + putpicturepixel(x,y,c); + end + end +end +-- + +-- +function db.drawRectangleLine(x,y,w,h,c) + w = w-1 + h = h-1 + drawline(x,y,x+w,y,c) + drawline(x,y,x,y+h,c) + drawline(x,y+h,x+w,y+h,c) + drawline(x+w,y,x+w,y+h,c) +end +-- + + +-- +function db.drawRectangleMix(x1,y1,w,h,c1,c2) + local x,y,c,n + c = {c1,c2} + n = 0 + for y = y1, y1+h-1, 1 do + n = n + 1 + for x = x1, x1+w-1, 1 do + n = n + 1 + putpicturepixel(x,y,c[n%2+1]); + end + end +end +-- + +-- +function db.drawBrushCircle(x1,y1,r,c) -- ok, lottsa weird adjustments here, can probably be optimized... + local x,y,d + for y = 0, r*2, 1 do + for x = 0, r*2, 1 do + d = math.sqrt((x-r-0.5)^2 + (y-r-0.5)^2) + if d < r-0.25 then putbrushpixel(x1+x-r-0.5,y1+y-r-0.5,c); end + end + end +end +-- + +-- +-- Rotation in degrees +-- Step is # of line segments (more is "better") +-- a & b are axis-radius +function db.ellipse2(x,y,a,b,stp,rot,col) + local n,m=math,rad,al,sa,ca,sb,cb,ox,oy,x1,y1,ast + m = math; rad = m.pi/180; ast = rad * 360/stp; + sb = m.sin(-rot * rad); cb = m.cos(-rot * rad) + for n = 0, stp, 1 do + ox = x1; oy = y1; + sa = m.sin(ast*n) * b; ca = m.cos(ast*n) * a + x1 = x + ca * cb - sa * sb + y1 = y + ca * sb + sa * cb + if (n > 0) then drawline(ox,oy,x1,y1,col); end + end +end +-- + + + +--[[ +var ER = 0.3 +var DR = 0.15 + +ellipse(0.5*xx,0.5*yy,DR*xx,6,Math.PI*0) + +function ellipse(x,y,r,stp,rot){ + var n,deg=360,m=Math,rad=Math.PI/180,rn + var ox,oy,x1,y1,x2,y2,d1,r1 = ER * xx + + for (n=0; n<=deg; n+=stp){ + + ox = x2; oy = y2, rn = rad * n + d1 = rn - rot + x1 = x + m.sin(d1) * r + y1 = y + m.cos(d1) * r + + x2 = x1 + m.sin(-rn) * r1 + y2 = y1 + m.cos(-rn) * r1 + if (n > 0){ line_rgb(MX,[0,0,0],0,ox,oy,x2,y2) } + } +} + +} + +ellipse2(0.5*xx,0.5*yy,15,8,200,22,[0,0,0],0.5) + +function ellipse2(x,y,a,b,stp,rot,rgb,transp){ + var n,m=Math,rad=m.PI/180,al,sa,ca,sb,cb,ox,oy,x1,y1 + sb = m.sin(-rot * rad); cb = m.cos(-rot * rad) + for (n=0; n<=stp; n++){ + ox = x1; oy = y1; al = rad * 360/stp * n + sa = m.sin(al) * b; ca = m.cos(al) * a + x1 = x + ca * cb - sa * sb + y1 = y + ca * sb + sa * cb + if (n > 0){ line_rgb(MX,rgb,transp,ox,oy,x1,y1) } + } +} + + +]] + + + +function db.obliqueCube(side,x,y,r,g,b,bri) + local n,c,depth,x1,y1,x2,y2,f + + f = matchcolor + c = f(r,g,b) + cP50 = f(r+bri*0.5,g+bri*0.5,b+bri*0.5) + cP75 = f(r+bri*0.75,g+bri*0.75,b+bri*0.75) + cM50 = f(r-bri*0.5,g-bri*0.5,b-bri*0.5) + cM100 = f(r-bri,g-bri,b-bri) + + depth = math.floor(side / 2) + + for n = 0, depth-1, 1 do + drawline(x+side+n,y-1-n,x+side+n,y+side-n-1,cM50) + end + + for n = 0, depth-1, 1 do + drawline(x+n,y-1-n,x+side+n-1,y-1-n,cP50) + end + + -- / + -- + --drawline(x+side,y-1,x+side+depth-1,y-depth,c) + + -- Smoothing & Shade + + -- + -- / + --drawline(x+side,y+side-1,x+side+depth-1,y+side-depth,cM100) + + --drawline(x,y,x+side-2,y,cP75) + --drawline(x,y,x,y+side-2,cP75) + + db.drawRectangle(x,y,side,side,c) + +end + + +function db.obliqueCubeBRI(side,x,y,r,g,b,bri,pallist,briweight,index_flag) + local n,c,depth,x1,y1,x2,y2 + + --f = db.getBestPalMatchHYBRID + c = db.getBestPalMatchHYBRID({r,g,b}, pallist, briweight, index_flag) + cP50 = db.getBestPalMatchHYBRID({r+bri*0.5,g+bri*0.5,b+bri*0.5}, pallist, briweight, index_flag) + cP75 = db.getBestPalMatchHYBRID({r+bri*0.75,g+bri*0.75,b+bri*0.75}, pallist, briweight, index_flag) + cM50 = db.getBestPalMatchHYBRID({r-bri*0.5,g-bri*0.5,b-bri*0.5}, pallist, briweight, index_flag) + cM100 = db.getBestPalMatchHYBRID({r-bri,g-bri,b-bri}, pallist, briweight, index_flag) + + depth = math.floor(side / 2) + + db.drawRectangle(x,y,side,side,c) + + for n = 0, depth-1, 1 do + drawline(x+side+n,y-1-n,x+side+n,y+side-n-1,cM50) + end + + for n = 0, depth-1, 1 do + drawline(x+n,y-1-n,x+side+n-1,y-1-n,cP50) + end + + -- / + -- + drawline(x+side,y-1,x+side+depth-1,y-depth,c) + + -- Smoothing & Shade + + -- + -- / + --drawline(x+side,y+side-1,x+side+depth-1,y+side-depth,cM100) + + --drawline(x,y,x+side-2,y,cP75) + --drawline(x,y,x,y+side-2,cP75) + + +end + + +-- +-- ... eof Custom Draw functions ... +-- + + +-- ****************************** +-- *** Filters & Convolutions *** +-- ****************************** + + +function db.applyConvolution2Pic(convmx,divisor,bias,neg,amt) + local r,g,b,mx,my,cx,cy,mxh,myh,mp,rb,gb,bb,xx,yy,x,y,w,h,div,n1,n2,amtr,ro,go,bo + + n1 = 1 + n2 = bias + if neg == 1 then + n1 = -1 + n2 = 255 + bias + end + + amtr = 1 - amt + w, h = getpicturesize() + cy = #convmx + cx = #convmx[1] + mxh = math.floor(cx / 2) + 1 + myh = math.floor(cy / 2) + 1 + + for y = 0, h-1, 1 do + for x = 0, w-1, 1 do + r,g,b = 0,0,0 + ro,go,bo = getcolor(getbackuppixel(x,y)) + div = divisor + for my = 1, cy, 1 do + for mx = 1, cx, 1 do + xp = mx-mxh + yp = my-myh + mp = convmx[my][mx] + xx = x + xp + yy = y + yp + if yy>=0 and yy=0 and xx 0 and n 0 and n0) then + x = x*px - fx + y = y*py - fy + nfrac = nfrac + spfrac + end + n = n+1 + end + --return 1 - n/i; + return 1 - nfrac/i +end +-- + + +-- +function db.mandel(x,y,l,r,o,i) -- pos. as fraction of 1, left coord, right coord, y coord, iterations + + local w,s,a,p,q,n,v,w + + s=math.abs(r-l); + + a = l + s*x; + p = a; + b = o - s*(y-0.5); + q = b; + n = 1; + v = 0; + w = 0; + + while (v+w<4 and n weakest then weakest = w; weak_i = {z,y,x}; end + end + + end;end;end + return weak_i[1],weak_i[2],weak_i[3] +end +-- + +-- +-- +-- Nearest color version: void is selected by the point that has the greatest distance +-- to the nearest color. Higher value means greater void. +-- +function db.addColor2Cube(cube,sha,r,g,b,rw,gw,bw) + local star,x,y,z,d,rd,gd,bd,cu1,cu2 + star = 0 + cube[r+1][g+1][b+1] = {false, star} + for z = 0, sha-1, 1 do + rd = (rw*(z-r))^2 + cu2 = cube[z+1] + for y = 0, sha-1, 1 do + gd = (gw*(y-g))^2 + cu1 = cu2[y+1] + for x = 0, sha-1, 1 do + + d = rd + gd + (bw*(x-b))^2 + + --cube[z+1][y+1][x+1][2] = math.min(d, cube[z+1][y+1][x+1][2]) -- Don't add, use nearest color + + cu1[x+1][2] = math.min(d, cu1[x+1][2]) + + end;end;end +end +-- + +-- Should be same as original, but not 100% verified. Using a rgb+1 trick to speed up handling +-- +function db.addColor2Cube_test(cube,sha,r,g,b,rw,gw,bw) + local star,x,y,z,d,rd,gd,bd,cu1,cu2 + star = 0 + r = r+1; g = g+1; b = b+1 + cube[r][g][b] = {false, star} + for z = 1, sha, 1 do + rd = (rw*(z-r))^2 + cu2 = cube[z] + for y = 1, sha, 1 do + gd = (gw*(y-g))^2 + cu1 = cu2[y] + for x = 1, sha, 1 do + cu1[x][2] = math.min(rd+gd+(bw*(x-b))^2, cu1[x][2]) + end;end;end +end +-- + + + +-- Create new allowed colorlines in colorspace (ramps from which colors can be picked) +function db.enableRangeColorsInCube(cube,sha,r1,g1,b1,r2,g2,b2) + + local div,r,g,b,n,rs,gs,bs + div = 256 / sha + rs = (r2 - r1) / sha / div + gs = (g2 - g1) / sha / div + bs = (b2 - b1) / sha / div + + for n = 0, sha-1, 1 do + + r = math.floor(r1/div + rs * n) + g = math.floor(g1/div + gs * n) + b = math.floor(b1/div + bs * n) + + cube[r+1][g+1][b+1][1] = true + + end +end +-- + + +function db.colorCigarr(shades,radius,fill_flag) + local s,rad,radsq,step,shalf,bas,cols,found,x,y,z,bri,con,d,n + radius = radius / 100 + step = math.floor(255 / (shades-1)) + shalf = math.floor(shades / 2) + s = shades - 1 + rad = math.floor(shades / 2 * radius) + radsq = rad^2 + + bas = 0 + cols = {} + found = 0 + + for z = 0, s, 1 do + for y = 0, s, 1 do + for x = 0, s, 1 do + + --0.26,0.55,0.19 + bri = (x + y + z ) / 3 + --bri = math.sqrt(((x*0.26)^2 + (y*0.55)^2 + (z*0.19)^2)) * 1.5609 + con = math.floor((shades - math.abs(bri - shalf)*2) * radius) + + d = math.floor(math.sqrt((bri-x)^2 + (bri-y)^2 + (bri-z)^2)) + --d = math.floor(math.sqrt(((bri-x)*0.26)^2 + ((bri-y)*0.55)^2 + ((bri-z)*0.19)^2)) * 1.5609 + + -- Filled cigarr: Less or Equal, cigarr shell: Equal + if d == con or (d < con and fill_flag) then + found = found + 1 + r = bas + x * step + g = bas + y * step + b = bas + z * step + cols[found] = {r,g,b} + end + + end; end; end + + --messagebox("Colors found: "..found.."\n\n".."Run AnalyzePalette to examine") + + for n = 0, 255, 1 do + if n < found then + c = cols[n+1] + setcolor(n,c[1],c[2],c[3]) + else + setcolor(n,0,0,0) + end + end +end -- eof colorcigarr + + +-- +-- ... eof Color Cube ... +-- + + + +-- COLORMIX -- +-- +-- Returns a list of mixcolors palette entries, that are ranked by by quality & usefulness +-- +-- This whole junk my partly locked on 16 shades (4096 colors/ 12bit palette precision) so don't use anything else... +-- +-- +function db.colormixAnalysis(sha,spare_flag,cust_dist) -- Interface + local shades,pallist,ilist,custom_max_distance + + shades = sha -- 16 is good + --messagebox(shades) + + custom_max_distance = -1 + if cust_dist ~= null then + custom_max_distance = cust_dist -- in % + end + + if spare_flag == true then -- No shades here for now + --pallist = db.makePalListShadeSPARE(256,shades) -- 16 shades so Colorcube processes is possible + pallist = db.makeSparePalList(256) + pallist = db.fixPalette(pallist,0) -- Remove doubles, No need to sort? + ilist = db.makeIndexList(pallist, -1) -- -1, use list order as index + else + pallist = db.makePalListShade(256,shades) -- 16 shades so Colorcube processes is possible + pallist = db.fixPalette(pallist,0) -- Remove doubles, No need to sort? + ilist = db.makeIndexList(pallist, -1) -- -1, use list order as index + end + + if shades > 0 then + return db.colormixAnalysisEXT(shades,pallist,ilist,custom_max_distance) -- max distance in % + end + if shades == -1 then + return db.colormixAnalysisEXTnoshade(pallist,ilist,custom_max_distance) -- max distance in % + end +end +-- +-- +function db.colormixAnalysisEXT(SHADES,pallist,ilist,custom_max_distance) -- Shades, most number of mixes returned + local n,m,c1,c2,pairs,cube,rm,gm,bm + local mix,total,found,dist,void,ideal,mini,maxi,bestmix,bestscore + + --messagebox("will now make pairs") + + pairs = db.pairsFromList(ilist,0) -- 0 for unique pairs only, pairs are entries in pallist + + --messagebox(#pairs.." will now add colors to cube") + + cube = db.initColorCube(SHADES,{true,9999}) + for n = 1, #pallist, 1 do + c1 = pallist[n] + db.addColor2Cube_test(cube,SHADES,c1[1],c1[2],c1[3],0.26,0.55,0.19) + end + + -- these values are adjusted for a 12bit palette (0-15) and perceptual weight where r+g+b = 1.0 + -- Ideal distance = 2.5 Green steps = 1.375 + -- Minimum distance = 1 Green step = 0.55 + + --messagebox("colorcube done") + + VACT = 1 + DACT = 1 + + total = 9.56 -- Max distance possible with 16 shades + ideal = 0.45 -- 1 step = 0.637 + mini = 0.35 + maxi = ideal + (total - ideal) / math.max(1, #pallist / 16) + if custom_max_distance ~= -1 then + maxi = total * (custom_max_distance / 100) + end + mix = {} + --mix[1] = {9e99,0,0,9e99,0,0,0} + bestmix = -1 + bestscore = 9e99 + found = 0 + for n = 1, #pairs, 1 do + + c1 = pallist[pairs[n][1]] + c2 = pallist[pairs[n][2]] + --0.26,0.55,0.19 + dist = db.getColorDistance_weight(c1[1],c1[2],c1[3],c2[1],c2[2],c2[3],0.26,0.55,0.19) -- Not normalized + + rm = math.floor((c1[1]+c2[1])/2) + gm = math.floor((c1[2]+c2[2])/2) + bm = math.floor((c1[3]+c2[3])/2) + + -- Mix color adjustment (perhaps less than perfect, but probably good enough) + mixbri = db.getBrightness(rm,gm,bm) + truebri = math.sqrt((db.getBrightness(c1[1],c1[2],c1[3])^2 + db.getBrightness(c2[1],c2[2],c2[3])^2) / 2) + diff = truebri - mixbri + rm = math.max(0,math.min(15,math.floor(rm + diff))) + gm = math.max(0,math.min(15,math.floor(gm + diff))) + bm = math.max(0,math.min(15,math.floor(bm + diff))) + newbri = db.getBrightness(rm,gm,bm) + delta = math.abs(newbri - truebri) + --if delta > 0.9 then + -- messagebox(pallist[pairs[n][1]][4]..", "..pallist[pairs[n][2]][4].." delta = "..delta) + --end + -- + + --rm = math.floor(math.sqrt((c1[1]^2 + c2[1]^2) / 2)) + --gm = math.floor(math.sqrt((c1[2]^2 + c2[2]^2) / 2)) + --bm = math.floor(math.sqrt((c1[3]^2 + c2[3]^2) / 2)) + + void = cube[rm+1][gm+1][bm+1][2] + + if dist >= mini and dist <= maxi then + found = found + 1 + score = ((1+DACT*(dist - ideal)^2) / (1+void*VACT)) -- Lowest is best + mix[found] = {score,pallist[pairs[n][1]][4],pallist[pairs[n][2]][4],dist,rm*SHADES,gm*SHADES,bm*SHADES,c1[1]*SHADES,c1[2]*SHADES,c1[3]*SHADES,c2[1]*SHADES,c2[2]*SHADES,c2[3]*SHADES} -- mix holds palette entry + if score < bestscore then bestscore = score; bestmix = found; end + end + + end + + + if true == false then + -- 2nd pass, add bestmix to colorspace. This reduces many similar mixes. + m = mix[bestmix] + db.addColor2Cube(cube,SHADES,m[5],m[6],m[7],0.26,0.55,0.19) + for n = 1, #mix, 1 do + if n ~= bestmix then + m = mix[n] + dist = m[4] + void = cube[m[5]+1][m[6]+1][m[7]+1][2] + score = ((1+DACT*(dist - ideal)^2) / (1+void*VACT)) + m[1] = score + end + end + end + + c1,c2 = -1,-1 + if found > 0 then + db.sorti(mix,1) + best = mix[1] + c1 = best[2] + c2 = best[3] + end + + --return found,c1,c2 + return mix,found,c1,c2 +end +-- + + +-- +-- Mixcolor without colorcube - no scoring or sorting, 24bit colors, faster... +-- +function db.colormixAnalysisEXTnoshade(pallist,ilist,custom_max_distance) + local n,m,c1,c2,pairs,cube,rm,gm,bm + local mix,total,found,dist,void,ideal,mini,maxi,bestmix,bestscore + + pairs = db.pairsFromList(ilist,0) -- 0 for unique pairs only, pairs are entries in pallist + + total = 162.53 -- Max distance possible with 24-bit palette ad Dawn3.0 color weights 162.53 + ideal = 0 + mini = 0 + maxi = ideal + (total - ideal) / math.max(1, #pallist / 16) + + if custom_max_distance ~= -1 then + maxi = total * (custom_max_distance / 100) + end + + mix = {} + found = 0 + for n = 1, #pairs, 1 do + + c1 = pallist[pairs[n][1]] + c2 = pallist[pairs[n][2]] + --0.26,0.55,0.19 + dist = db.getColorDistance_weight(c1[1],c1[2],c1[3],c2[1],c2[2],c2[3],0.26,0.55,0.19) -- Not normalized + + rm = math.floor((c1[1]+c2[1])/2) + gm = math.floor((c1[2]+c2[2])/2) + bm = math.floor((c1[3]+c2[3])/2) + + -- Mix color adjustment + mixbri = db.getBrightness(rm,gm,bm) + truebri = math.sqrt((db.getBrightness(c1[1],c1[2],c1[3])^2 + db.getBrightness(c2[1],c2[2],c2[3])^2) / 2) + diff = truebri - mixbri + rm = math.max(0,math.min(255,math.floor(rm + diff))) + gm = math.max(0,math.min(255,math.floor(gm + diff))) + bm = math.max(0,math.min(255,math.floor(bm + diff))) + newbri = db.getBrightness(rm,gm,bm) + delta = math.abs(newbri - truebri) + --if delta > 0.9 then + -- messagebox(pallist[pairs[n][1]][4]..", "..pallist[pairs[n][2]][4].." delta = "..delta) + --end + -- + + if dist >= mini and dist <= maxi then + found = found + 1 + score = 1 + mix[found] = {score,pallist[pairs[n][1]][4],pallist[pairs[n][2]][4],dist,rm,gm,bm,c1[1],c1[2],c1[3],c2[1],c2[2],c2[3]} -- mix holds palette entry + end + + end + + --messagebox(#mix) + + return mix,found,-1,-1 +end +-- + + + +-- Fuse a palettelist into an extended mix-anlysis list +function db.fusePALandMIX(pal,mix,max_score,max_dist) + local n,c,mixlist,tot,score,dist,c1,c2,rm,gm,bm + + mixlist = {} + tot = 0 + + -- {r,g,b,n} + for n = 1, #pal, 1 do + tot = tot + 1 + c = pal[n] + mixlist[tot] = {0,c[4],c[4],0,c[1],c[2],c[3],c[1],c[2],c[3],c[1],c[2],c[3]} + end + + -- {score,col#1,col#2,dist,rm,gm,bm} low score is best + for n = 1, #mix, 1 do + score = mix[n][1] + dist = mix[n][4] + if score <= max_score and dist <= max_dist then + tot = tot + 1 + mixlist[tot] = mix[n] + end + end + + return mixlist +end +-- + + +-- ******************************************** +-- *** L-system (fractal curves & "plants") *** +-- ******************************************** +-- + +-- +function db.Lsys_makeData(a) + local n,i; i = {} + for n = 1, #a, 1 do i[a[n][2]] = a[n]; end + return i +end +-- + +-- +function db.Lsys_makeSet(seed,iter,data) + local s,n,i,nset,set + set = seed + for n = 1, iter, 1 do + nset = '' + for i = 1, #set, 1 do + s = string.sub(set,i,i) + nset = nset..data[s][3] + end + set = nset + end + return set +end +-- + +function db.Lsys_draw(set,data,cx,cy,size,rot,rgb,rng,transp, speed) + local p,M,DEG,l,n,d,i,v,q,c,tx,ty,posx,posy,dval,col,w,h,s,cl,count + + if speed == nil then speed = 50; end -- speed is drawing operations per update + + function ang(d) return (d % 360 + 360) * DEG; end + + w,h = getpicturesize() + + p = 0 + M = math + DEG = math.pi/180 + l = #set + + posx={}; posy={}; dval={} + + if (rgb == null) then rgb = {0,0,0}; end + if (transp == null) then transp = 0; end + col = db.newArrayMerge(rgb,{}) + q = 255 / l + + count = 0 + for n = 1, l, 1 do + s = string.sub(set,n,n) + d = data[s] + i = d[1] + v = d[4] + + --messagebox(i) + + if (i == 'Left') then rot = rot - v; end + if (i == 'Right') then rot = rot + v; end + + if (i == 'Save') then p=p+1; posx[p] = cx; posy[p] = cy; dval[p] = rot; end + if (i == 'Load') then cx = posx[p]; cy = posy[p]; rot = dval[p]; p=p-1; end + + if (i == 'Draw') then + tx = cx + M.sin(ang(rot)) * size + ty = cy + -M.cos(ang(rot)) * size + for c = 1, 3, 1 do + if (rng[c] > 0) then col[c] = rgb[c] + (n * q) * rng[c]; end + if (rng[c] < 0) then col[c] = rgb[c] + (n * q) * rng[c]; end + end + + cl = matchcolor(col[1],col[2],col[3]) + --putpicturepixel(cx*w,cy*h,cl); + --drawline(cx*w,cy*h,tx*w,ty*h,cl) + db.lineTransp(cx*w,cy*h,tx*w,ty*h,cl,transp) + + cx = tx; cy = ty + end + count = count + 1 + if count == speed then count = 0; updatescreen(); if (waitbreak(0)==1) then return end; end + end + + return {cx,cy,rot} +end -- draw + + +-- +-- eof L-system +-- + + + + + + + + diff --git a/src/factory.c b/src/factory.c index 94f466d3..7bb7f565 100644 --- a/src/factory.c +++ b/src/factory.c @@ -348,6 +348,85 @@ int L_PutPicturePixel(lua_State* L) return 0; // no values returned for lua } + +int L_DrawLine(lua_State* L) +{ + int x1, y1, x2, y2, c; + + int nb_args = lua_gettop(L); + + LUA_ARG_LIMIT(5, "drawline"); + LUA_ARG_NUMBER(1, "drawline", x1, INT_MIN, INT_MAX); + LUA_ARG_NUMBER(2, "drawline", y1, INT_MIN, INT_MAX); + LUA_ARG_NUMBER(3, "drawline", x2, INT_MIN, INT_MAX); + LUA_ARG_NUMBER(4, "drawline", y2, INT_MIN, INT_MAX); + LUA_ARG_NUMBER(5, "drawline", c, INT_MIN, INT_MAX); + + Pixel_figure = Display_pixel; + Draw_line_general(x1, y1, x2, y2, c); + + return 0; +} + + +int L_DrawFilledRect(lua_State* L) +{ + int x1, y1, x2, y2, c; + + int nb_args = lua_gettop(L); + + LUA_ARG_LIMIT(5, "drawfilledrect"); + LUA_ARG_NUMBER(1, "drawfilledrect", x1, INT_MIN, INT_MAX); + LUA_ARG_NUMBER(2, "drawfilledrect", y1, INT_MIN, INT_MAX); + LUA_ARG_NUMBER(3, "drawfilledrect", x2, INT_MIN, INT_MAX); + LUA_ARG_NUMBER(4, "drawfilledrect", y2, INT_MIN, INT_MAX); + LUA_ARG_NUMBER(5, "drawfilledrect", c, INT_MIN, INT_MAX); + + Draw_filled_rectangle(x1, y1, x2, y2, c); + + return 0; +} + + +int L_DrawCircle(lua_State* L) +{ + int x1, y1, r, c; + + int nb_args = lua_gettop(L); + + LUA_ARG_LIMIT(4, "drawcircle"); + LUA_ARG_NUMBER(1, "drawcircle", x1, INT_MIN, INT_MAX); + LUA_ARG_NUMBER(2, "drawcircle", y1, INT_MIN, INT_MAX); + LUA_ARG_NUMBER(3, "drawcircle", r, INT_MIN, INT_MAX); + LUA_ARG_NUMBER(4, "drawcircle", c, INT_MIN, INT_MAX); + + Pixel_figure = Display_pixel; + Circle_limit = r*r; + Draw_empty_circle_general(x1, y1, r, c); + + return 0; +} + + +int L_DrawDisk(lua_State* L) +{ + int x1, y1, r, c; + + int nb_args = lua_gettop(L); + + LUA_ARG_LIMIT(4, "drawdisk"); + LUA_ARG_NUMBER(1, "drawdisk", x1, INT_MIN, INT_MAX); + LUA_ARG_NUMBER(2, "drawdisk", y1, INT_MIN, INT_MAX); + LUA_ARG_NUMBER(3, "drawdisk", r, INT_MIN, INT_MAX); + LUA_ARG_NUMBER(4, "drawdisk", c, INT_MIN, INT_MAX); + + Circle_limit = r*r; + Draw_filled_circle(x1, y1, r, c); + + return 0; +} + + int L_GetPicturePixel(lua_State* L) { int x; @@ -1308,36 +1387,54 @@ void Run_script(const char *script_subdirectory, const char *script_filename) L = lua_open(); putenv("LUA_PATH=libs\\?.lua"); + // writing and reading pixels lua_register(L,"putbrushpixel",L_PutBrushPixel); + lua_register(L,"putpicturepixel",L_PutPicturePixel); + lua_register(L, "drawline",L_DrawLine); + lua_register(L, "drawfilledrect",L_DrawFilledRect); + lua_register(L, "drawcircle",L_DrawCircle); + lua_register(L, "drawdisk",L_DrawDisk); + lua_register(L,"getbrushpixel",L_GetBrushPixel); lua_register(L,"getbrushbackuppixel",L_GetBrushBackupPixel); - lua_register(L,"putpicturepixel",L_PutPicturePixel); lua_register(L,"getpicturepixel",L_GetPicturePixel); lua_register(L,"getlayerpixel",L_GetLayerPixel); lua_register(L,"getbackuppixel",L_GetBackupPixel); + lua_register(L,"getsparelayerpixel",L_GetSpareLayerPixel); + lua_register(L,"getsparepicturepixel",L_GetSparePicturePixel); + + + // resizing stuff lua_register(L,"setbrushsize",L_SetBrushSize); lua_register(L,"setpicturesize",L_SetPictureSize); + lua_register(L,"getbrushsize",L_GetBrushSize); lua_register(L,"getpicturesize",L_GetPictureSize); + lua_register(L,"getsparepicturesize",L_GetSparePictureSize); + + // color and palette lua_register(L,"setcolor",L_SetColor); + lua_register(L,"setforecolor",L_SetForeColor); + lua_register(L,"setbackcolor",L_SetBackColor); + lua_register(L,"getcolor",L_GetColor); lua_register(L,"getbackupcolor",L_GetBackupColor); - lua_register(L,"matchcolor",L_MatchColor); lua_register(L,"getbrushtransparentcolor",L_GetBrushTransparentColor); + lua_register(L,"getsparecolor",L_GetSpareColor); + lua_register(L,"getsparetranscolor",L_GetSpareTransColor); + lua_register(L,"getforecolor",L_GetForeColor); + lua_register(L,"getbackcolor",L_GetBackColor); + lua_register(L,"gettranscolor",L_GetTransColor); + + lua_register(L,"matchcolor",L_MatchColor); + + // ui lua_register(L,"inputbox",L_InputBox); lua_register(L,"messagebox",L_MessageBox); lua_register(L,"statusmessage",L_StatusMessage); lua_register(L,"selectbox",L_SelectBox); - lua_register(L,"getforecolor",L_GetForeColor); - lua_register(L,"getbackcolor",L_GetBackColor); - lua_register(L,"setforecolor",L_SetForeColor); - lua_register(L,"setbackcolor",L_SetBackColor); - lua_register(L,"gettranscolor",L_GetTransColor); - lua_register(L,"getsparepicturesize",L_GetSparePictureSize); - lua_register(L,"getsparelayerpixel",L_GetSpareLayerPixel); - lua_register(L,"getsparepicturepixel",L_GetSparePicturePixel); - lua_register(L,"getsparecolor",L_GetSpareColor); - lua_register(L,"getsparetranscolor",L_GetSpareTransColor); + + // misc. stuff lua_register(L,"clearpicture",L_ClearPicture); lua_register(L,"wait",L_Wait); lua_register(L,"waitbreak",L_WaitBreak); From 5b332bfa256a19426e91b48a7df0fb13ed93830a Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 19 Feb 2011 13:59:44 +0000 Subject: [PATCH 04/46] * Do not allow script to write more than 24 chars to the statusline * Clear the statusline when a script is finished running. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1731 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/factory.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/factory.c b/src/factory.c index 7bb7f565..5a50f759 100644 --- a/src/factory.c +++ b/src/factory.c @@ -1175,7 +1175,8 @@ int L_StatusMessage(lua_State* L) LUA_ARG_LIMIT(1,"statusmessage"); LUA_ARG_STRING(1, "statusmessage", msg); - Print_in_menu(msg,0); + if(strlen(msg)<=24) + Print_in_menu(msg,0); return 0; } @@ -1507,6 +1508,7 @@ void Run_script(const char *script_subdirectory, const char *script_filename) Brush_backup=NULL; Update_colors_during_script(); End_of_modification(); + Print_in_menu(" ",0); lua_close(L); From 107779edf55c091c03ea61685c6040524a048192 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Wed, 23 Feb 2011 23:37:34 +0000 Subject: [PATCH 05/46] Implemented double-click in Brush factory window. Still need to check/fix all other occurences of the listbox control (need to eliminate unnecessary refresh on double-click, or trigger a specific action instead) git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1733 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/engine.c | 26 +++++++++++++++++++++++--- src/factory.c | 35 +++++++++++++++-------------------- 2 files changed, 38 insertions(+), 23 deletions(-) diff --git a/src/engine.c b/src/engine.c index 1e2ad64a..2cb62b63 100644 --- a/src/engine.c +++ b/src/engine.c @@ -3145,9 +3145,10 @@ short Window_get_button_shortcut(void) short Window_clicked_button(void) { short Button; + byte old_mouse_k; + old_mouse_k=Mouse_K; Get_input(20); - // Handle clicks if (Mouse_K) { @@ -3174,6 +3175,9 @@ short Window_clicked_button(void) { short clicked_button; T_List_button * list; + static Uint32 time_last_click = 0; + static int last_list_number = -1; + Uint32 time_now; // Check which controls was clicked (by rectangular area) clicked_button = Window_get_clicked_button(); @@ -3186,9 +3190,25 @@ short Window_clicked_button(void) // Click in the textual part of a list. short clicked_line; clicked_line = (((Mouse_Y-Window_pos_Y)/Menu_factor_Y)-list->Entry_button->Pos_Y)>>3; - if (clicked_line == list->Cursor_position || // Same as before - clicked_line >= list->Scroller->Nb_elements) // Below last line + if (clicked_line >= list->Scroller->Nb_elements) // Below last line return 0; + time_now = SDL_GetTicks(); + if (clicked_line == list->Cursor_position) + { + // Double click check + if (old_mouse_k==0 && last_list_number==list->Number && time_now - time_last_click < Config.Double_click_speed) + { + time_last_click = time_now; + // Store the selected value as attribute2 + Window_attribute2=list->List_start + list->Cursor_position; + // Return the control ID of the list. + return list->Number; + } + time_last_click = time_now; + last_list_number=list->Number; + // Already selected : don't activate anything + return 0; + } Hide_cursor(); // Redraw one item as disabled diff --git a/src/factory.c b/src/factory.c index 5a50f759..693c319d 100644 --- a/src/factory.c +++ b/src/factory.c @@ -1632,7 +1632,7 @@ void Button_Brush_Factory(void) T_Special_button* scriptarea; char scriptdir[MAX_PATH_CHARACTERS]; T_Fileselector_item *item; - + int last_selected_item=-1; // Reinitialize the list Free_fileselector_list(&Scripts_selector); strcpy(scriptdir, Data_directory); @@ -1675,6 +1675,12 @@ void Button_Brush_Factory(void) Update_window_area(0, 0, Window_width, Window_height); Display_cursor(); + // Wait for mouse release (needed for example after a double-click + // that navigates to a subdirectory) + while (last_selected_item==-1 && Mouse_K) + { + Get_input(20); + } Reset_quicksearch(); @@ -1701,28 +1707,17 @@ void Button_Brush_Factory(void) switch (clicked_button) { case 4: + if (last_selected_item == scriptlist->List_start + scriptlist->Cursor_position) + { + // Double click + clicked_button=5; + break; + } + last_selected_item = scriptlist->List_start + scriptlist->Cursor_position; Hide_cursor(); Draw_script_information(Get_item_by_index(&Scripts_selector, scriptlist->List_start + scriptlist->Cursor_position)); Display_cursor(); - { - // Test double-click - static long time_click = 0; - static int last_selected_item=-1; - static long time_previous; - - time_previous = time_click; - time_click = SDL_GetTicks(); - if (scriptlist->List_start + scriptlist->Cursor_position == last_selected_item) - { - if (time_click - time_previous < Config.Double_click_speed) - clicked_button=5; - } - else - { - last_selected_item=scriptlist->List_start + scriptlist->Cursor_position; - } - } break; case 6: @@ -1807,7 +1802,7 @@ void Button_Brush_Factory(void) scriptlist->Scroller->Nb_elements=Scripts_selector.Nb_elements; Compute_slider_cursor_length(scriptlist->Scroller); - + last_selected_item = -1; Hide_cursor(); } } From 9cfefc96624a8b4e19a85a1da3f50d6a565183df Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sat, 26 Feb 2011 15:56:45 +0000 Subject: [PATCH 06/46] Fix display bug on menu buttons when comiled with 'unsigned character' (issue 423) git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1734 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/engine.c | 2 +- src/global.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine.c b/src/engine.c index 2cb62b63..5c9bdd59 100644 --- a/src/engine.c +++ b/src/engine.c @@ -227,7 +227,7 @@ void Draw_menu_button(byte btn_number,byte pressed) word y_pos; byte current_menu; byte color; - char icon; + signed char icon; // Find in which menu the button is for (current_menu = 0; current_menu < MENUBAR_COUNT; current_menu++) diff --git a/src/global.h b/src/global.h index 3746126b..2b6b9ee8 100644 --- a/src/global.h +++ b/src/global.h @@ -581,7 +581,7 @@ GFX2_GLOBAL struct word Height; ///< Button's active heigth byte Pressed; ///< Button is currently pressed byte Shape; ///< Shape, listed in enum ::BUTTON_SHAPES - char Icon; ///< Which icon to display: Either the one from the toolbar (-1) or one of ::MENU_SPRITE + signed char Icon; ///< Which icon to display: Either the one from the toolbar (-1) or one of ::MENU_SPRITE // Triggers on mouse/keyboard Func_action Left_action; ///< Action triggered by a left mouseclick on the button From 34cd4d11cd34c3d83986eedda7ebb338eab66c47 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sat, 26 Feb 2011 16:15:29 +0000 Subject: [PATCH 07/46] Added Surt to list of bugfinders (issue 423) git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1735 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/helpfile.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/helpfile.h b/src/helpfile.h index 1fc745cd..6ee84106 100644 --- a/src/helpfile.h +++ b/src/helpfile.h @@ -464,9 +464,9 @@ static const T_Help_table helptable_credits[] = HELP_TEXT (" mind MooZ Pasi Kallinen ") HELP_TEXT (" the Peach petter PheeL ") HELP_TEXT (" richienyhus sm4tik spratek ") - HELP_TEXT (" tape.yrm TeeEmCee tempest ") - HELP_TEXT (" Timo Kurrpa titus^Rab Tobé ") - HELP_TEXT (" yakumo2975 00ai99") + HELP_TEXT (" Surt tape.yrm TeeEmCee ") + HELP_TEXT (" tempest Timo Kurrpa titus^Rab ") + HELP_TEXT (" Tobé yakumo2975 00ai99") HELP_TEXT ("") HELP_TEXT (" ... posted the annoying bug reports.") HELP_TEXT ("") From cdd7f212655a9504183c6bb93ce2145956609388 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sat, 26 Feb 2011 17:43:55 +0000 Subject: [PATCH 08/46] Fxed and simplified double-click handling in Listboxes (Skins window, Text window, Factory window). Double-clicking a font in Text window 'accepts' the rendering and closes the window. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1736 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/buttons.c | 9 +++------ src/engine.c | 5 +++-- src/factory.c | 11 ++++------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/buttons.c b/src/buttons.c index 221c0b42..53374938 100644 --- a/src/buttons.c +++ b/src/buttons.c @@ -1424,12 +1424,12 @@ void Button_Skins(void) { case 1 : // OK break; - case 2 : // doesn't happen + case 2 : // double-click file: do nothing break; case 3 : // doesn't happen break; case 4 : // a file is selected - need_load=1; + need_load=1; break; case 5 : // Font dropdown selected_font = Window_attribute2; // Get the index of the chosen font. @@ -5009,10 +5009,6 @@ void Button_Text(void) /* Cannot happen, event is catched by the list control */ break; - case 6: // Selecteur de fonte - /* Cannot happen, event is catched by the list control */ - break; - case 13: // Font selection selected_font_index = Window_attribute2; Hide_cursor(); @@ -5056,6 +5052,7 @@ void Button_Text(void) break; + case 6: // Double-click font selector case 11: // OK // Save the selector settings list_start = font_list->List_start; diff --git a/src/engine.c b/src/engine.c index 5c9bdd59..e140c9a1 100644 --- a/src/engine.c +++ b/src/engine.c @@ -3199,10 +3199,11 @@ short Window_clicked_button(void) if (old_mouse_k==0 && last_list_number==list->Number && time_now - time_last_click < Config.Double_click_speed) { time_last_click = time_now; + Input_sticky_control=0; // Store the selected value as attribute2 Window_attribute2=list->List_start + list->Cursor_position; - // Return the control ID of the list. - return list->Number; + // Return the control ID of the "special button" that covers the list. + return list->Entry_button->Number; } time_last_click = time_now; last_list_number=list->Number; diff --git a/src/factory.c b/src/factory.c index 693c319d..e8068e67 100644 --- a/src/factory.c +++ b/src/factory.c @@ -1706,13 +1706,10 @@ void Button_Brush_Factory(void) switch (clicked_button) { - case 4: - if (last_selected_item == scriptlist->List_start + scriptlist->Cursor_position) - { - // Double click - clicked_button=5; - break; - } + case 2: // Double-click an entry in script list + clicked_button=5; + break; + case 4: // Select script last_selected_item = scriptlist->List_start + scriptlist->Cursor_position; Hide_cursor(); Draw_script_information(Get_item_by_index(&Scripts_selector, From 65d34dd7e0da744c3f554b566d3913b9333b8ee7 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sat, 26 Feb 2011 18:44:43 +0000 Subject: [PATCH 09/46] Issue 346: Basic support for multi-line text with bitmap fonts: use alt-enter to type carriage returns (like Excel) git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1737 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- share/grafx2/skins/font_Classic.png | Bin 2634 -> 2636 bytes share/grafx2/skins/font_DPaint.png | Bin 2647 -> 2648 bytes share/grafx2/skins/font_Fairlight.png | Bin 2681 -> 2680 bytes share/grafx2/skins/font_Fun.png | Bin 2728 -> 2728 bytes share/grafx2/skins/font_Melon.png | Bin 2715 -> 2714 bytes share/grafx2/skins/font_Seen.png | Bin 2605 -> 2606 bytes share/grafx2/skins/skin_Clax2.gif | Bin 19290 -> 19290 bytes share/grafx2/skins/skin_Clax3.gif | Bin 20334 -> 20334 bytes src/SFont.c | 41 +++++++++++++++++++++----- src/SFont.h | 2 +- src/keyboard.c | 5 ++++ src/readline.c | 2 +- src/text.c | 2 +- 13 files changed, 42 insertions(+), 10 deletions(-) diff --git a/share/grafx2/skins/font_Classic.png b/share/grafx2/skins/font_Classic.png index 8db8d5fcef4096bf8aaf63fdfa56f602ddb2e463..cdb0701637bff7a89537b117cb1cbc73e8c7ce40 100644 GIT binary patch delta 1833 zcmV+^2iEw?6wDN`AOj6;ZEdQms{jB0$;UdwlPv=tf9y#_K~#90)K`1{>2@O?jzs}^_UcwN_ZG1-bSycGT|0~>X6 zGoFsH%5j^&Ue|Mi05fD+nTH`++8v2!BqrAAiUVLDe@%WR9&ul<(v_P3{PQ{R;|>8ZBC`Y>%#pte01(2O5mU8<8;gO!Hvr5SXX2+Z>ovI2^D`D+T43Vn zL8;x^0uHPM-nKxomkqpNbTS}{OqG7f0Q9Rh2)9odfXqPv6bPv3mH~;gXo_gSrpFjK zMHZr>^>`aDU>NlZ0-!2Tn8oT!r3W)j%ZR~Mf5JU=fV%zk(g}kCs8!Gw5C#-S&vt>* zYJcD;nY?F2f&U7d^S$(-zcWQ;d?y+afdLwl+B0vmM(BA_^^zE$boliE%$X>VoH0=Q zl@o7U+x$Uvv9$o&1=?jj3Ew7vI&JS5h`m{CLId*V`~-l?kmcbOX89Zn0E@cS^)jhv zf2J^P4FH_!wh{StoJ#jVNs6}YJ0AN`2bQA{5zVgrF#t^&S~b_Hq?S>t8IU5?+dVKK z;^$DM#3Xi2rI++*(p|LfIzB}Fl|MYise`o!^hCo!6XK~vShDee~uq>^sZk07X{- zfLqLW>{A=U6UgsLge^Ix)TdSX$3)`$cWf2B15 zwtsdnnoxSx^6N7JyNU;YfBl36jJHY9AkZSp04;YOS3gFU@B@G@fChm5QGoXkK{Xp{ z%X06n{)Bi(D%MOHpbUW2{Q(2c2wcpfc@qHZ{W0ULLbwM&7(g1*w!ldPzV1L420^Mn zs{Q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2r;4xkmK zGHU}IuMz-(yzD$XKBM7+f8@dCoKg67KcC<A++3O3vGY+7_!QTl8Zidf~hka=G_YVQiuYUpfLKJmAHJuI3 P00000NkvXXu0mjffaPIB diff --git a/share/grafx2/skins/font_DPaint.png b/share/grafx2/skins/font_DPaint.png index c7c84745ae27c7d13634687a8b8810e6e0020c2c..f9e89c22ff446a77e7c81a5980ea4ff56e06fcf3 100644 GIT binary patch delta 1746 zcmV;@1}*v56xbB7AOj6;ZEdQms{jB0$;UdwlPv=tfA~p6K~#90)me#l94QP$|NqmQ zmw;4m?w-3^`_U=u(v4QFvxxqK#G-0P*u*6QB7b=6#h`JpTD_{R%{4eDZ5YfySY82d<3h%&>z>4E-37Ebr;0>dT0hwgV^h*YyUClw7eZv4`4g#P+Kt>-KP&i9Zksk0+V+@=k z3trKA+=c~o!&eXh?E=Ou?yi)2P}7u*DBK0ye^Upj+lyNz406D;pd}y-FhlQd0V}m{ z7#7KAN)-6tp>zJ$8r)GY@Z?9%tfEJKP=d%E$Q(bL{3bAcFnMV{cx?nVM+1h7KV;z; ze|D|VH4IR!ncO}J7N__r0Kij#5ctFIHPCN4gJ%E=XaNj0YWHR*I{?g|3P}9wp{XaM zAL4v;NsK2JWg0{qdr0k+teFzEDkf9`8PM&a!)v&CljQ^{e|@0+Cjd49J`#Pu6Jhoj z1zQAe^%^s!i(7Z^sLt_LZIV5zoW`321Ag21TXsIRD{n@0-9pdd-WISw@)ttB)-xUR zH_5BLQTEmcx{N{^vpz5HfCEjwjp^dhpjzXy6J7-d#3l@Ye0JTPEp}!P0Qu201CLv7 zqgB=lfIF^ge-uCmfPstk69$mXo#So5$UHdI__jj@07&CNInEqWbe#jr2>?O%tArAR zk_)#pL~R3rrCs8eyind-0Ge7mFn}__taS#AsP(53(d4`GN)#}_^4}H227opoVnu_a zQPBa|0x7x^p%`rM8GvLir5fU7pEm$_=1;c(A5_PBe|=u-lXs$zsLqvD&E0_(FYp$? zWLeldOulV=k3(#=^??={xQ1~G_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1ZC4fbimIwe~08yJ_ zXe(e0KJcckxfmr@kA^;D2+i^`BiDH1Yr?f9Qv+VS8S0hM;e;H~HVEtoXh+0dG z+Ksi_QrzB)Z*TkUt^D}Dz&Y<2us??!o-F7BxYYPp4r#1y3DvJv`_#?hh9(5HBJ35i zeV*MI^&IsD=q<0?S9tSd1;%0U&J?Rw#zh|VI8AYDFb5CM7ZTuSC!YzibKwVCJ6ZT8 zMH#r9S7(DuWnNGHf4m>yFLk&}f5sx>eX;|=h#t{YKpNQI7K#p!fejJ{QQ%%2_}EIuBX>?Sh^Yq(27!-wE>P- z34lPp?7Vh;X2S*l$b-wdqFC#GKEWB{&~+e1h}X_3170;81K$IzaBcpB00@IF0*~}w zDfc=9)Pe0h4zp+ESzqd%aR3z#{!T#fF#P`Vh>uSH{1D*Q`XAp46k-)f#i0NI002ov JPDHLkV1m>gP7?qC diff --git a/share/grafx2/skins/font_Fairlight.png b/share/grafx2/skins/font_Fairlight.png index 5d4f9818ab37bc4a037016df27dccf3b345e7024..f5ca8af9f84db5e9d340e4c000ce3a88d4e21ed6 100644 GIT binary patch delta 1877 zcmV-b2den_6!;XdAOj6;ZEdQms{jB0$jKv}lPv=te;7$bK~#907QCjWxFFkU-P{{fLXF_tV5Hc<*vrF9203YlK{lef5yLIkEoxsG&B9b{^cbQiBCrZJ|O^BdDeh~IMO!(078W6(bZ_UF&GHE0pPOna{Q_9crA|fb&r9U6u59q zqg3upfdp0zw<$2>bpme~-3+K8Q>0%q0QG7NO6?m4Aaf7^1p*>^%YepNYKqi=n;c`{ z6j`u}_TyuiKr`kH0-#l3FpH}zg&xG1lo5eDe}_GFfVzJ9$b>}(%qVCI2m^+qcc;Ke zwZG7YC!YyX;D3e8>pF5UuS`+tKd~lrj`UOCN;ows^=RYHF&;SlJOEi$*91l!?^HWQ zB##5heMDB#CaJg|7vK0#L;ED4*hkbMw7_rnPfZ&P*|xS@k{l#JJhuMJBF{`bZf*g9 ze~}&=<)7meQW%&6%f`8rwl7rx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S`{DS}pgDwL1^j<0Vo&oB>cD9GPXXLCe^{zO83J?A+KyWjBem(qKyMKQO baB=+)jxH2Y&_9k?00000NkvXXu0mjfM&V&= diff --git a/share/grafx2/skins/font_Seen.png b/share/grafx2/skins/font_Seen.png index 8510a9a01aa77e2a12d2b7dcf95947fc0ba70642..85f82d5630eb1681442fdf1039e84ce77e188fad 100644 GIT binary patch delta 1783 zcmV6(U6PEX3 zV}{`re`vh__JjzqjI0O;bL6iR0D|yg#!$WJ#$+Jz0|5);3jArVd>LnYy~o5$2`nB1 zl-lhj5X1`bu>_jED&UQxO97c=%JfSGpkK{Fx_zSnR1OlLL_kK53MihXr$`St)EE<| z%mOOfkB{L7!svI90PO-zS=?PI^7Dm@rREk7`e8t$aoRuO~))Xf2BMovk*a)(7nOyu-?g`O1*CA{@siQBwB<= z@w;20CE&Y2$lTz|ony6V9r4YP{Y}>j{17nVHHAZ{jDz_iKtJWdxk`?;St&XtfN!FL z?lXBofH^(yk!#9ixETc2GcaBk#@sgm6$QlqG@1A*LJ^0iav&g6A3V5v?2u;$e_Eis zS*>xD4d|?-Ag({h`zHdXgvl$#E0Smol%ydemYKoX(LMv9g=%jjamFj9!6i`s5}uL& zDhODC3`p-orTx#xUrU2jZHu$j3U&9KTahp}|nf%CX#p=^+V1FXOfA#bL#ACA>9I!PE$Z9V8)Wg`$lRrt^4iDKaglvG_ zs!TTyTAK{z?lCAPE?P8k;B;G&R#R9{lwa0)WOTJ*aw-Qv_&v^0@mk zvcXRRCIABg=h29dHz_qYf3@Xx^mKnByhkbaNSUAlfC6}HaA97JpE296xlqiGa1jn*E;;;BiO`u!w6~`Rh>q8Kd9$gfq9z+DbN(AuHKJ9c%n-!&i)}GS8E1DA7jHaJw)@ifo-0eGpy zUE;A2;?e-BRaFgSp#t&Vi@6+sGZFLLG9&Y1i{*VWLk#2h{kFb>HKWV71Q?e<5i-wD z1eA>ZDiD^gT@x4U2L+rZ+~z8xD<#|$kR03v1b>*#C&ifdfKL?QVDO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k=|NsBAw6s@Z zdTniOs;a60005H>19=ev2prh2puv9r5-Riup`k+vla~Wo0RWTn1HS--a{!abEk-8-0Du=SUAl1L5>n*I438wNgy0gwqm_>?Y^hnZ%1FJA!wvo|ox0RjksvjZ}U0RaG$jx$gJ0F&P{N&*XklPfei0vH0bW;CY) z0uKO_4>uYD0RXcrH~t0=1Hdb@@?W@w*P3c(Kme0BJ{<@k1UR!X-yj6DTt3AF5(ET+ t{Q&e62!Wu%g9Q&l006*~GefKbAq11*Ll*)K;IsNeSpot9__I|;1qEG1v4;Qv diff --git a/share/grafx2/skins/skin_Clax3.gif b/share/grafx2/skins/skin_Clax3.gif index 98fe8257c6aa3f620a932cd1c3bdf143afeb9514..3e7d2f5b03864af55676769fd678a227c95d4b7a 100644 GIT binary patch delta 508 zcmVV16cunllKFa7XL51cJd9u zj}LDiefsn0*R#*-zC6E^q69VpKa<%6G6DaS3@%nWg@2QlG+qHev-LC|0RsQQlNL5o0sOORHrN3I^23uuI9CG4 zKa-p|KLY*(v)wq>0vv(Y>L1`hK> z@cVvEl+&GKFjf46liflc2<$(AKlUf>Ka&DOCn$ac|M4qm5MjZ72M0EExKQ9ghz=P_ ybjU9vL5Kbd{`1$6A;*6n`Q4LILpKxpZ~v*rp#(_|6e+Q2R-;vk@)NV0L(>cUuk4Bd delta 508 zcmV(BnSZHj7agOMhLSA87lz-2mrG+ z8t4H6Apo-<9Hj#j0NAmCA7bP=XD!VKrZb-1EMN$;*B@L80RWRUDmelM0F!SjdjbFm zv+OD@0~Y`|T-a#x`HYrU3wx>@%nW1qhRtG+qG!v-LC|0RkbwlNL5o0RXdUHrN3I0>G0)I9CD( z1e2UNKLSDkv)wq>0v-SmY(MntN<6H;cF4lE)xlQm!UF6t(Q6?7YrX=2v(Y>L1`Y#2 z@cVvEl+&GKFjYW+liflc2rLAEKlUdr1d{?oCnx{|Apj_75MjZ72M0EExKQ9ghz=P_ ybO<0KL5KbdLh#p+Ax8)v0o;>OLpKu&VgISdp#(_|6e+Q2R-;vk0uZyCL(>acY`I_n diff --git a/src/SFont.c b/src/SFont.c index cd44d850..23de8ce0 100644 --- a/src/SFont.c +++ b/src/SFont.c @@ -145,8 +145,13 @@ void SFont_Write(SDL_Surface *Surface, const SFont_Font *Font, srcrect.h = dstrect.h = Font->Surface->h - 1; for(c = text; *c != '\0' && x <= Surface->w ; c++) { + if (*c == '\n') { + dstrect.y += Font->Surface->h-1; + x=0; + continue; + } // skip spaces and nonprintable characters - if (*c == ' ' || Font->CharWidth[(int)*c]==0) { + else if (*c == ' ' || Font->CharWidth[(int)*c]==0) { x += Font->Space; continue; } @@ -166,13 +171,23 @@ int SFont_TextWidth(const SFont_Font *Font, const char *text) { const char* c; int width = 0; + int previous_width = 0; if(text == NULL) return 0; - for(c = text; *c != '\0'; c++) { + for(c = text; *c != '\0'; c++) + { + if (*c == '\n') + { + if (previous_widthCharWidth[(int)*c]==0) { + if (*c == ' ' || Font->CharWidth[(int)*c]==0) + { width += Font->Space; continue; } @@ -180,18 +195,30 @@ int SFont_TextWidth(const SFont_Font *Font, const char *text) width += Font->CharWidth[(int)*c]; } - return width; + return previous_widthSurface->h - 1; + // Count occurences of '\n' + int nb_cr=0; + while (*text!='\0') + { + if (*text=='\n') + nb_cr++; + text++; + } + + return (Font->Surface->h - 1) * (nb_cr+1); } +/* +// Do not use: Doesn't implement carriage returns + void SFont_WriteCenter(SDL_Surface *Surface, const SFont_Font *Font, int y, const char *text) { SFont_Write(Surface, Font, Surface->w/2 - SFont_TextWidth(Font, text)/2, y, text); } - +*/ diff --git a/src/SFont.h b/src/SFont.h index 71b694b7..446acf4e 100644 --- a/src/SFont.h +++ b/src/SFont.h @@ -87,7 +87,7 @@ void SFont_Write(SDL_Surface *Surface, const SFont_Font *Font, int x, int y, /// Returns the width of "text" in pixels int SFont_TextWidth(const SFont_Font* Font, const char *text); /// Returns the height of "text" in pixels (which is always equal to Font->Surface->h) -int SFont_TextHeight(const SFont_Font* Font); +int SFont_TextHeight(const SFont_Font* Font, const char *text); /// Blits a string to Surface with centered x position void SFont_WriteCenter(SDL_Surface *Surface, const SFont_Font* Font, int y, diff --git a/src/keyboard.c b/src/keyboard.c index b459b83c..584d20fb 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -601,6 +601,7 @@ word Keysym_to_ANSI(SDL_keysym keysym) #if !(defined(__macosx__) || defined(__FreeBSD__)) if ( keysym.unicode == 0) { + switch(keysym.sym) { case SDLK_DELETE: @@ -610,7 +611,11 @@ word Keysym_to_ANSI(SDL_keysym keysym) case SDLK_END: case SDLK_BACKSPACE: case KEY_ESC: + return keysym.sym; case SDLK_RETURN: + // Case alt-enter + if (SDL_GetModState() & (KMOD_ALT|KMOD_META)) + return '\n'; return keysym.sym; default: return 0; diff --git a/src/readline.c b/src/readline.c index ce153024..89ebc17a 100644 --- a/src/readline.c +++ b/src/readline.c @@ -509,7 +509,7 @@ byte Readline_ex(word x_pos,word y_pos,char * str,byte visible_size,byte max_siz switch(input_type) { case INPUT_TYPE_STRING : - if (input_key>=' ' && input_key<= 255) + if ((input_key>=' ' && input_key<= 255)||input_key=='\n') is_authorized=1; break; case INPUT_TYPE_INTEGER : diff --git a/src/text.c b/src/text.c index d5c70fa8..42bf09c4 100644 --- a/src/text.c +++ b/src/text.c @@ -567,7 +567,7 @@ byte *Render_text_SFont(const char *str, int font_number, int *width, int *heigh } // Calcul des dimensions - *height=SFont_TextHeight(font); + *height=SFont_TextHeight(font, str); *width=SFont_TextWidth(font, str); // Allocation d'une surface SDL text_surface=SDL_CreateRGBSurface(SDL_SWSURFACE, *width, *height, 8, 0, 0, 0, 0); From 4b6263d6fcd7b28411f8a5c6e551409228741137 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Mon, 28 Feb 2011 19:42:06 +0000 Subject: [PATCH 10/46] Fixes grafx2 forgetting the image's directory, since r1710 (issue 421) git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1739 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 e00a3223..a6bf033b 100644 --- a/src/filesel.c +++ b/src/filesel.c @@ -1419,12 +1419,13 @@ byte Button_Load_or_Save(byte load, T_IO_Context *context) else { #if defined(__MINT__) - chdir(context->File_directory); static char path[1024]={0}; + chdir(context->File_directory); Dgetpath(path,0); strcat(path,PATH_SEPARATOR); strcpy(Main_current_directory,path); #else + chdir(context->File_directory); getcwd(Main_current_directory,256); #endif From 9e7b8c7d4a9179b21f9c4be7b3a155e4770ac669 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Mon, 28 Feb 2011 20:04:49 +0000 Subject: [PATCH 11/46] Fixed issue 366: Default cursor of DPaint skin not very visible over white background : Made this cursor have black outline, and replaced the secondary cursor with the white borderless cursor. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1741 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- share/grafx2/skins/skin_DPaint.png | Bin 15317 -> 15328 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/share/grafx2/skins/skin_DPaint.png b/share/grafx2/skins/skin_DPaint.png index 2685dcb40b154f8799b95dfdfbc37184173788e8..52fd207687c7ba68941f949741c69894be55df70 100644 GIT binary patch delta 14510 zcmbVzcT`i~wk}BTqV%dFBA_DDTOtY~AR;2tgrJBhNRtjBn+}424N*aYpmgb7NC;H~ z4822wlprmEP!bZ73;xa<=biiR{pV$jjJ@Z|US-a2&Tq}N_R4S|Hn6OS3D6v@c_o-% z6*E*D{&0rH`_c!NI=^${$(0Mwos)hCtqxTtP*1He^=Yc!6p%MzeX_M?AY^>>?cNop zB&H`FU)*jn6<)?)MjCtFd4Ww+jD(c2!%(M4EQwg*a|eRWI^X4=a{s;b-;dm_0j@-; zW-gnq#xF-hV_U$jMoVQ(Nsg+Jx3 zcJQuJY)KZ-;MfHtospwTLGD_vQe1kUEOBv>{H?4mm)>kn6P|UsN-Z@M{lf+?C@P#1 z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4JhhnIzK`C}R;s3q%^d@}h|GJ>zOC74_Dv69%Btc5pxxv0ZiHWf*5O)69gdd`PDBWjOg zG>Svz-sd0mlJqr=%V;434aGk06-CJunA#UozW9OGk=Dwm5i0?{l)6n_3n60mTZa^# z-oMLWd1OrpOr04gG8l5uc6!CV|2u9;WF+2=>O`@97`R?V>}Fa@$6MfhZggplH6<12 zGwRPbKX91c>TlsmC}kIV3)mib98t#YA&W?Uuu8p@bP<*j53U5hU-&`YAJ^4P7}{!n z;PaapF6xI3u4yfZIEdJuTuqv1?3m7-dKC}r-T%-FQP?N~efnWLDeW^=V*xwxr;L{s z*Zp-^OYa~$cN6;MZ-w}d-60m#bMA=+>4Nydplt54(>mNLTbKta2!lCZEo6)Z?2s)n zS{BL~cnb08`7IM*065*#daxv-Fv8gTJSE;W5jS&;6*dVyR=Co@_a<;W1Iiv5TA_22 zwBJ3``9iL!cco(|igoCZ6Cd?>z9}{}T8J1?y6peFr!+5cZ2hn1=*Hx`UM)$xVwPg5 zX>9VM+}ZqZg&xn(IDq6nKZ>`=#Sp?Zv>n{}U&TEi63&kT^szZ&s>*1T!<>4(EZyHw zCL-BJb@!@XVhcF*;T@a*;R@1jlJ)=3F9-i!2W5l&re{qKCnH-pc0VRY*A2@qJ4XF4 DZ5J2q From 7caab79d217ac4febeeb3166b468d49d1b0cfd3d Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Tue, 1 Mar 2011 18:10:32 +0000 Subject: [PATCH 12/46] Issue 425: Spray setting 'Init' is now minimum 1 git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1742 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/buttons.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/buttons.c b/src/buttons.c index 53374938..ee99605b 100644 --- a/src/buttons.c +++ b/src/buttons.c @@ -4066,7 +4066,7 @@ void Refresh_airbrush_settings(byte selected_color, byte update_slider) void Button_Airbrush_menu(void) { - static byte spray_init=0; + static byte spray_init=1; short clicked_button; char str[4]; word index; @@ -4329,6 +4329,12 @@ void Button_Airbrush_menu(void) Num2str(spray_init,str,2); Window_input_content(input_init_button,str); } + else if (spray_init<1) + { + spray_init=1; + Num2str(spray_init,str,2); + Window_input_content(input_init_button,str); + } Display_cursor(); break; } From cdbc5be351bdf881756e9a9fc4075f475b03c607 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sat, 5 Mar 2011 16:16:32 +0000 Subject: [PATCH 13/46] Fix issue 354: Palette undo unreliable git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1744 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/palette.c | 122 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 90 insertions(+), 32 deletions(-) diff --git a/src/palette.c b/src/palette.c index 91bad838..4143abb9 100644 --- a/src/palette.c +++ b/src/palette.c @@ -207,6 +207,66 @@ void Spread_colors(short start,short end,T_Palette palette) } } +// FIXME: keep them in main function but pass them to Palette_edit_*() + T_Components * backup_palette; + T_Components * temp_palette; + T_Components * working_palette; + +byte Palette_undo_state = 0; +byte Palette_change_state = 0; + +/// Backup before doing one self-complete change. +void Palette_edit_step() +{ + // back up + memcpy(backup_palette,working_palette,sizeof(T_Palette)); + Palette_change_state=0; + Palette_undo_state=0; +} + +/// Mode for incremental changes. +void Palette_edit_select_range() +{ + if (Palette_change_state) + {/* + // acknowledge pending changes and back up + memcpy(backup_palette,working_palette,sizeof(T_Palette)); + memcpy(temp_palette,working_palette,sizeof(T_Palette)); + */} + Palette_change_state=0; +} + +/// Perform incremental change in RGB channel of some color(s). +void Palette_edit_alter_channel() +{ + if (!Palette_change_state) + { + memcpy(backup_palette,working_palette,sizeof(T_Palette)); + memcpy(temp_palette,working_palette,sizeof(T_Palette)); + } + Palette_change_state=1; +} + +/// Undo +void Palette_edit_undo_redo() +{ + if (Palette_change_state) + { + // swap backup and working (temp serves as intermediate) + memcpy(temp_palette,backup_palette,sizeof(T_Palette)); + memcpy(backup_palette,working_palette,sizeof(T_Palette)); + memcpy(working_palette,temp_palette,sizeof(T_Palette)); + } + else + { + // swap backup and working (temp serves as intermediate) + memcpy(temp_palette,backup_palette,sizeof(T_Palette)); + memcpy(backup_palette,working_palette,sizeof(T_Palette)); + memcpy(working_palette,temp_palette,sizeof(T_Palette)); + } + Palette_undo_state=(Palette_undo_state==0); +} + void Update_color_count(short * used_colors, dword * color_usage) { @@ -1027,9 +1087,9 @@ void Button_Palette(void) short used_colors = -1; // -1 <=> Inconnu byte conversion_table[256]; - T_Components * backup_palette; - T_Components * temp_palette; - T_Components * working_palette; + //T_Components * backup_palette; + //T_Components * temp_palette; + //T_Components * working_palette; static byte show_used_colors=0; @@ -1042,8 +1102,7 @@ void Button_Palette(void) Open_window(299, 188,"Palette"); memcpy(working_palette, Main_palette, sizeof(T_Palette)); - memcpy(backup_palette, Main_palette, sizeof(T_Palette)); - memcpy(temp_palette, Main_palette, sizeof(T_Palette)); + Palette_edit_step(); Window_set_palette_button(5, 79); // 1 @@ -1195,7 +1254,7 @@ void Button_Palette(void) int nb_colors; // Backup - memcpy(backup_palette,working_palette,sizeof(T_Palette)); + Palette_edit_step(); nb_colors = Get_clipboard_colors(working_palette, block_start); if (nb_colors>0) @@ -1261,8 +1320,7 @@ void Button_Palette(void) Window_rectangle(FGCOLOR_DISPLAY_X,FGCOLOR_DISPLAY_Y,FGCOLOR_DISPLAY_W,FGCOLOR_DISPLAY_H,Fore_color); Update_window_area(FGCOLOR_DISPLAY_X,FGCOLOR_DISPLAY_Y,FGCOLOR_DISPLAY_W,FGCOLOR_DISPLAY_H); - memcpy(backup_palette ,working_palette,sizeof(T_Palette)); - memcpy(temp_palette,working_palette,sizeof(T_Palette)); + Palette_edit_select_range(); } } else @@ -1337,6 +1395,7 @@ void Button_Palette(void) break; case 2 : // Jauge rouge Hide_cursor(); + Palette_edit_alter_channel(); if (block_start==block_end) { if(Palette_view_is_RGB) @@ -1417,6 +1476,7 @@ void Button_Palette(void) break; case 3 : // Jauge verte Hide_cursor(); + Palette_edit_alter_channel(); if (block_start==block_end) { if(Palette_view_is_RGB) @@ -1497,6 +1557,7 @@ void Button_Palette(void) case 4 : // Jauge bleue Hide_cursor(); + Palette_edit_alter_channel(); if (block_start==block_end) { if(Palette_view_is_RGB) @@ -1580,7 +1641,7 @@ void Button_Palette(void) { dword sum_r=0, sum_g=0, sum_b=0, used=0; - memcpy(backup_palette,working_palette,sizeof(T_Palette)); + Palette_edit_step(); // Compute weighted average for (i=block_start; i<=block_end; i++) { @@ -1614,7 +1675,7 @@ void Button_Palette(void) if (temp_color>=0) { dword sum_r=0, sum_g=0, sum_b=0, used; - memcpy(backup_palette,working_palette,sizeof(T_Palette)); + Palette_edit_step(); // Compute weighted average used=color_usage[temp_color]+color_usage[Fore_color]; @@ -1656,7 +1717,7 @@ void Button_Palette(void) case 6 : // Grey scale // Backup - memcpy(backup_palette,working_palette,sizeof(T_Palette)); + Palette_edit_step(); // Grey Scale for (i=block_start;i<=block_end;i++) { @@ -1680,7 +1741,7 @@ void Button_Palette(void) && (temp_color!=block_start)) { Hide_cursor(); - memcpy(backup_palette,working_palette,sizeof(T_Palette)); + Palette_edit_step();// Not undoable if X-Swap // On calcule le nombre de couleurs a swapper sans risquer de sortir // de la palette (La var. first_color est utilisée pour économiser 1 var; c'est tout) @@ -1742,12 +1803,12 @@ void Button_Palette(void) } break; - case 9 : // Copy + case 9 : // Copy (to other slot) temp_color=Wait_click_in_palette(Window_palette_button_list); if ((temp_color>=0) && (temp_color!=block_start)) { Hide_cursor(); - memcpy(backup_palette,working_palette,sizeof(T_Palette)); + Palette_edit_step(); memcpy(working_palette+temp_color,backup_palette+block_start, ((temp_color+block_end-block_start<=255)?block_end+1-block_start:256-temp_color)*3); memcpy(temp_palette,working_palette,sizeof(T_Palette)); @@ -1788,7 +1849,7 @@ void Button_Palette(void) case 10 : // Spread if (block_start!=block_end) { - memcpy(backup_palette,working_palette,sizeof(T_Palette)); + Palette_edit_step(); Spread_colors(block_start,block_end,working_palette); } else @@ -1796,7 +1857,7 @@ void Button_Palette(void) temp_color=Wait_click_in_palette(Window_palette_button_list); if (temp_color>=0) { - memcpy(backup_palette,working_palette,sizeof(T_Palette)); + Palette_edit_step(); if (temp_colorPosition) @@ -2037,6 +2097,7 @@ void Button_Palette(void) if (!Palette_view_is_RGB) break; Hide_cursor(); + Palette_edit_alter_channel(); if (block_start==block_end) { if (red_slider->Position RGB // Acte les changements en cours sur une ou plusieurs couleurs - memcpy(temp_palette,working_palette,sizeof(T_Palette)); - memcpy(backup_palette, working_palette,sizeof(T_Palette)); + Palette_edit_select_range(); Hide_cursor(); @@ -2398,7 +2458,7 @@ void Button_Palette(void) new_blue=(new_color&0x0000FF); // Backup - memcpy(backup_palette,working_palette,sizeof(T_Palette)); + Palette_edit_step(); // Assign color for (i=block_start;i<=block_end;i++) { @@ -2445,8 +2505,7 @@ void Button_Palette(void) Window_rectangle(FGCOLOR_DISPLAY_X,FGCOLOR_DISPLAY_Y,FGCOLOR_DISPLAY_W,FGCOLOR_DISPLAY_H,Fore_color); Update_window_area(FGCOLOR_DISPLAY_X,FGCOLOR_DISPLAY_Y,FGCOLOR_DISPLAY_W,FGCOLOR_DISPLAY_H); - memcpy(backup_palette ,working_palette,sizeof(T_Palette)); - memcpy(temp_palette,working_palette,sizeof(T_Palette)); + Palette_edit_select_range(); } Display_cursor(); @@ -2541,7 +2600,7 @@ void Button_Palette(void) if (used_colors==-1) Update_color_count(&used_colors, color_usage); - memcpy(backup_palette,working_palette,sizeof(T_Palette)); + Palette_edit_step(); memcpy(temp_palette,Main_palette,sizeof(T_Palette)); memcpy(Main_palette,working_palette,sizeof(T_Palette)); Set_nice_menu_colors(color_usage,0); @@ -2594,8 +2653,7 @@ void Button_Palette(void) Window_rectangle(FGCOLOR_DISPLAY_X,FGCOLOR_DISPLAY_Y,FGCOLOR_DISPLAY_W,FGCOLOR_DISPLAY_H,Fore_color); Update_window_area(FGCOLOR_DISPLAY_X,FGCOLOR_DISPLAY_Y,FGCOLOR_DISPLAY_W,FGCOLOR_DISPLAY_H); - memcpy(backup_palette ,working_palette,sizeof(T_Palette)); - memcpy(temp_palette,working_palette,sizeof(T_Palette)); + Palette_edit_select_range(); } Display_cursor(); Wait_end_of_click(); @@ -2622,7 +2680,7 @@ void Button_Palette(void) Hide_cursor(); // Backup - memcpy(backup_palette,working_palette,sizeof(T_Palette)); + Palette_edit_step(); nb_colors = Get_clipboard_colors(working_palette, block_start); if (nb_colors>0) From 50aa747510553de39f7104e8e190a9aae4717be2 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sat, 5 Mar 2011 16:28:08 +0000 Subject: [PATCH 14/46] Palette: Disabled Undo after operations that perform remapping (x-swap, x-inv, sort, reduce) because the undo was incomplete anyway. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1745 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/palette.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/palette.c b/src/palette.c index 4143abb9..3ca1f7d3 100644 --- a/src/palette.c +++ b/src/palette.c @@ -1741,7 +1741,7 @@ void Button_Palette(void) && (temp_color!=block_start)) { Hide_cursor(); - Palette_edit_step();// Not undoable if X-Swap + Palette_edit_step(); // On calcule le nombre de couleurs a swapper sans risquer de sortir // de la palette (La var. first_color est utilisée pour économiser 1 var; c'est tout) @@ -1796,6 +1796,7 @@ void Button_Palette(void) // En cas de X-Swap, tout l'ecran a pu changer de couleur. if (clicked_button==8) { + Palette_edit_step(); // Disable Undo Update_rect(0, 0, Screen_width, Menu_Y_before_window); End_of_modification(); } @@ -1918,7 +1919,7 @@ void Button_Palette(void) Draw_all_palette_sliders(red_slider, green_slider, blue_slider, working_palette, block_start, block_end); memcpy(temp_palette, working_palette, sizeof(T_Palette)); - + Palette_edit_step(); // Disable Undo End_of_modification(); need_to_remap = 1; } @@ -2279,6 +2280,7 @@ void Button_Palette(void) Remap_image_highlevel(conversion_table); Display_cursor(); End_of_modification(); + Palette_edit_step(); // Disable Undo } // On prépare la "modifiabilité" des nouvelles couleurs Set_palette(working_palette); @@ -2420,6 +2422,7 @@ void Button_Palette(void) // Maintenant, tous ces calculs doivent êtres pris en compte dans la // palette, l'image et à l'écran. Set_palette(working_palette); + Palette_edit_step(); // Disable Undo End_of_modification(); need_to_remap=1; From d403d134f393f1d32c8d6e901e495b6e0058a172 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sat, 5 Mar 2011 16:33:56 +0000 Subject: [PATCH 15/46] Palette: updated helpfile git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1746 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/helpfile.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/helpfile.h b/src/helpfile.h index 6ee84106..4d95e3ca 100644 --- a/src/helpfile.h +++ b/src/helpfile.h @@ -2632,10 +2632,10 @@ static const T_Help_table helptable_palette[] = HELP_TEXT ("modifies the picture).") HELP_TEXT ("") HELP_TEXT ("- Undo: Allows you to recover the last") - HELP_TEXT ("modifications made on the palette. If the") - HELP_TEXT ("last operation modified the picture, it") - HELP_TEXT ("won't recover them: you'll have to click on") - HELP_TEXT ("Cancel to do so.") + HELP_TEXT ("modifications made on the palette. Note that") + HELP_TEXT ("it can't undo the changes that affect the") + HELP_TEXT ("pixels (remapping), you'll need to Cancel") + HELP_TEXT ("them.") HELP_TEXT ("") HELP_TEXT ("") HELP_TEXT ("If you press , the program will") From 504f25f1e10d9fdc4d830038c907cdf9bf16f58f Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sat, 5 Mar 2011 17:29:28 +0000 Subject: [PATCH 16/46] Fix issue 414: Incomplete loading of some GIF images git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1747 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/fileformats.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/fileformats.c b/src/fileformats.c index 21d281e2..5c427c00 100644 --- a/src/fileformats.c +++ b/src/fileformats.c @@ -2195,14 +2195,18 @@ void Load_GIF(T_IO_Context * context) } } else + { File_error=2; + break; + } } // Code End-Of-Information ou erreur de fichier rencontré - + if (File_error==2 && GIF_pos_X==0 && GIF_pos_Y==IDB.Image_height) + File_error=0; /*Close_lecture();*/ if (File_error>=0) if ( /* (GIF_pos_X!=0) || */ - ( ( (!GIF_interlaced) && (GIF_pos_Y!=IDB.Image_height) ) || + ( ( (!GIF_interlaced) && (GIF_pos_Y!=IDB.Image_height) && (GIF_pos_X!=0)) || ( (GIF_interlaced) && (!GIF_finished_interlaced_image) ) ) ) File_error=2; @@ -2214,7 +2218,8 @@ void Load_GIF(T_IO_Context * context) break; } // Lecture du code de fonction suivant: - Read_byte(GIF_file,&block_identifier); + if (!Read_byte(GIF_file,&block_identifier)) + File_error=2; } } // Le fichier contenait un LSDB else From e11d8e030c24c0795e74853a590949bafc9eb2df Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sat, 5 Mar 2011 18:17:55 +0000 Subject: [PATCH 17/46] Fix issue 417: Severe image corruption when scrolling image while some layers are hidden. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1748 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/operatio.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/operatio.c b/src/operatio.c index d822fe29..92667d37 100644 --- a/src/operatio.c +++ b/src/operatio.c @@ -2760,7 +2760,16 @@ void Scroll_12_0(void) if (Mouse_K == LEFT_SIDE) Backup(); else - Backup_layers(Main_layers_visible); + { + Backup_layers(-1); // Main_layers_visible + #ifndef NOLAYERS + // Ensure the backup visible image is up-to-date + // (after swapping some layers on/off, it gets outdated) + memcpy(Main_visible_image_backup.Image, + Main_visible_image.Image, + Main_image_width*Main_image_height); + #endif + } Cursor_hidden_before_scroll=Cursor_hidden; Cursor_hidden=1; @@ -2818,7 +2827,6 @@ void Scroll_12_5(void) { // One layer at once Scroll_picture(Main_backups->Pages->Next->Image[Main_current_layer], Main_backups->Pages->Image[Main_current_layer], x_offset, y_offset); - //Redraw_layered_image(); Redraw_current_layer(); } @@ -2874,6 +2882,7 @@ void Scroll_0_5(void) // Do the actual scroll operation on all layers. for (i=0; iPages->Nb_layers; i++) + //if ((1<Pages->Next->Image[i], Main_backups->Pages->Image[i], x_offset, y_offset); // Update the depth buffer too ... // It would be faster to scroll it, but we don't have method From eae47aa0e8713365a365b2157ecddaf1b7f3e115 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Mon, 7 Mar 2011 21:53:39 +0000 Subject: [PATCH 18/46] * Factory : if message is longer than 24 chars, cut it instead of not doing anything * Fileformats : remove outdated comment in gif loader git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1750 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/factory.c | 8 ++++++-- src/fileformats.c | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/factory.c b/src/factory.c index e8068e67..50b5674c 100644 --- a/src/factory.c +++ b/src/factory.c @@ -1171,12 +1171,16 @@ int L_UpdateScreen(lua_State* L) int L_StatusMessage(lua_State* L) { const char* msg; + char* msg2; int nb_args = lua_gettop(L); LUA_ARG_LIMIT(1,"statusmessage"); LUA_ARG_STRING(1, "statusmessage", msg); - if(strlen(msg)<=24) - Print_in_menu(msg,0); + msg2 = strdup(msg); + if(strlen(msg)>24) + msg2[24] = 0; // Cut off long messages + Print_in_menu(msg2,0); + free(msg2); return 0; } diff --git a/src/fileformats.c b/src/fileformats.c index 5c427c00..163e4e45 100644 --- a/src/fileformats.c +++ b/src/fileformats.c @@ -2079,7 +2079,6 @@ void Load_GIF(T_IO_Context * context) break; case 0x2C: // Local Image Descriptor { - // Si on a deja lu une image, c'est une GIF animée ou bizarroide, on sort. if (number_LID!=0) { // This a second layer/frame, or more. From c1ede1f6578535b00adfc698038875d952ca2a1b Mon Sep 17 00:00:00 2001 From: Franck Charlet Date: Thu, 10 Mar 2011 18:29:53 +0000 Subject: [PATCH 19/46] started to bring Mac OS X version up to date git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1751 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/.DS_Store | Bin 15364 -> 21508 bytes src/English.lproj/InfoPlist.strings | Bin 650 -> 654 bytes src/Grafx2.xcodeproj/project.pbxproj | 754 -------------- src/Grafx2.xcodeproj/xx.pbxuser | 319 ------ src/Grafx2.xcodeproj/xx.perspective | 1403 -------------------------- src/Makefile | 216 ++-- src/init.c | 7 +- src/mountlist.c | 3 + src/readline.c | 1 + src/text.c | 10 +- 10 files changed, 131 insertions(+), 2582 deletions(-) delete mode 100644 src/Grafx2.xcodeproj/project.pbxproj delete mode 100644 src/Grafx2.xcodeproj/xx.pbxuser delete mode 100644 src/Grafx2.xcodeproj/xx.perspective diff --git a/src/.DS_Store b/src/.DS_Store index fdc8668961d00f89117ef9ffe07afe2f46cd36af..099fb4721c4cfba42cfeb65bda70b5ee7d2278e3 100644 GIT binary patch literal 21508 zcmeHNJ&znk5Un}i?bq4J4hWH!(1~R%A(0@REZfKuNFWDDNY=4?AHIe4?fUN4z6+2p zffz!503koX8FtPOaL5lpM8xL3n%Skgy7$&31Xj&yrsrns)yM1Vn(o$!NOgO*`+>+! z5$WJ$d-XCdKZx|%nuEXd%#KTVQsErq#Qjx~Gue|PIhGr8kV)qc*6@ho(%CD6jv`{;`wVm@Z?BlxW*9-1Ovf9Fc1s`1OJ@?zI$!C-$i<`If1=h>=q2QDIQIGIn7J;(73ghfBv(_!94etl?2>s3dF2^jr+PH4K zN~OJSaFa-PRW~va5uD(f>8Cd<5YC2r^u6(@2OAuB+^-``g%QH>p7aATr^s>U$dDr> z_e?RCrxM2bMobb-N9{a;6;_BWdX=}ac=?k4KV0mm8uw#ZS{g^|;}w{Koz~9=Q~Py- zD8~3J#?kuw0{Mde_7_H;d2)&jsrBE=EwItb2Zmr;EGYKKsXzW!6A;|J9CzAoKYSHz1pyu z+Xb&F!r9P~ZV|l&f))C38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2b269de2e76daff3e58..456b0022c775966ba1121ad085463685628c5f9b 100644 GIT binary patch delta 35 lcmeBT?PHzrmeq(skHKi-yJluX2E)l*OvaO!GbTXU4FI{+36B5( delta 31 hcmeBU?P8tqmeFA1r)FjY2FuBOOvaN}GbTXU4FIL`2}b|` diff --git a/src/Grafx2.xcodeproj/project.pbxproj b/src/Grafx2.xcodeproj/project.pbxproj deleted file mode 100644 index dbebbcfb..00000000 --- a/src/Grafx2.xcodeproj/project.pbxproj +++ /dev/null @@ -1,754 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 42; - objects = { - -/* Begin PBXBuildFile section */ - 002F39FA09D0881F10EBEB88 /* SDL_image.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F10EBEB88 /* SDL_image.framework */; }; - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; }; - 002F3A3F09D088BA00EBEB88 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A3E09D088BA00EBEB88 /* main.c */; }; - 40D82CA110ECAF13005D27B5 /* miscfileformats.c in Sources */ = {isa = PBXBuildFile; fileRef = 40D82CA010ECAF13005D27B5 /* miscfileformats.c */; }; - 40D82CA610ECAF58005D27B5 /* brush_ops.c in Sources */ = {isa = PBXBuildFile; fileRef = 40D82CA510ECAF58005D27B5 /* brush_ops.c */; }; - 40D82CAA10ECAFC5005D27B5 /* buttons_effects.c in Sources */ = {isa = PBXBuildFile; fileRef = 40D82CA910ECAFC5005D27B5 /* buttons_effects.c */; }; - 40D82CAE10ECAFDC005D27B5 /* layers.c in Sources */ = {isa = PBXBuildFile; fileRef = 40D82CAD10ECAFDC005D27B5 /* layers.c */; }; - 40D82CB210ECB02B005D27B5 /* fileformats.c in Sources */ = {isa = PBXBuildFile; fileRef = 40D82CB110ECB02B005D27B5 /* fileformats.c */; }; - 40D82CBF10ECB089005D27B5 /* libraw2crtc.c in Sources */ = {isa = PBXBuildFile; fileRef = 40D82CBE10ECB089005D27B5 /* libraw2crtc.c */; }; - 40D82D3A10ECC4CA005D27B5 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 40D82D4310ECC536005D27B5 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 40D82D4110ECC536005D27B5 /* Info.plist */; }; - 40D82D4410ECC536005D27B5 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 40D82D4210ECC536005D27B5 /* SDLMain.nib */; }; - 40D82D5010ECC609005D27B5 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 40D82D4E10ECC609005D27B5 /* Info.plist */; }; - 40D82D5110ECC609005D27B5 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 40D82D4F10ECC609005D27B5 /* SDLMain.nib */; }; - 40D82D5710ECC67A005D27B5 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 40D82D5510ECC67A005D27B5 /* Info.plist */; }; - 40D82D5810ECC67A005D27B5 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 40D82D5610ECC67A005D27B5 /* SDLMain.nib */; }; - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; - F5142653101F6CC5006CF3C4 /* font_Classic.png in Copy skins */ = {isa = PBXBuildFile; fileRef = F514264D101F6CB8006CF3C4 /* font_Classic.png */; }; - F5142654101F6CC5006CF3C4 /* font_Fairlight.png in Copy skins */ = {isa = PBXBuildFile; fileRef = F514264E101F6CB8006CF3C4 /* font_Fairlight.png */; }; - F5142655101F6CC5006CF3C4 /* font_Fun.png in Copy skins */ = {isa = PBXBuildFile; fileRef = F514264F101F6CB9006CF3C4 /* font_Fun.png */; }; - F5142656101F6CC5006CF3C4 /* font_Melon.png in Copy skins */ = {isa = PBXBuildFile; fileRef = F5142650101F6CB9006CF3C4 /* font_Melon.png */; }; - F5142657101F6CC5006CF3C4 /* skin_classic.png in Copy skins */ = {isa = PBXBuildFile; fileRef = F5142651101F6CB9006CF3C4 /* skin_classic.png */; }; - F5142658101F6CC5006CF3C4 /* skin_modern.png in Copy skins */ = {isa = PBXBuildFile; fileRef = F5142652101F6CB9006CF3C4 /* skin_modern.png */; }; - F51CBD2E0EC8A3E1005C06AC /* 5pxtinyfont.png in Copy fonts */ = {isa = PBXBuildFile; fileRef = F51CBD2B0EC8A3E1005C06AC /* 5pxtinyfont.png */; }; - F51CBD2F0EC8A3E1005C06AC /* colorfont.pcx in Copy fonts */ = {isa = PBXBuildFile; fileRef = F51CBD2C0EC8A3E1005C06AC /* colorfont.pcx */; }; - F51CBD300EC8A3E1005C06AC /* Tuffy.ttf in Copy fonts */ = {isa = PBXBuildFile; fileRef = F51CBD2D0EC8A3E1005C06AC /* Tuffy.ttf */; }; - F539315E0FE171C3003CB103 /* pversion.c in Sources */ = {isa = PBXBuildFile; fileRef = F539315D0FE171C3003CB103 /* pversion.c */; }; - F5A33E6A0EC893F800F8052D /* 8pxfont.png in Copy fonts */ = {isa = PBXBuildFile; fileRef = F5A33E690EC893F800F8052D /* 8pxfont.png */; }; - F5AA405F0FBC406D00B7577C /* pxquad.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AA405A0FBC406D00B7577C /* pxquad.c */; }; - F5AA40600FBC406D00B7577C /* pxtall2.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AA405B0FBC406D00B7577C /* pxtall2.c */; }; - F5AA40610FBC406D00B7577C /* pxtriple.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AA405C0FBC406D00B7577C /* pxtriple.c */; }; - F5AA40620FBC406D00B7577C /* pxwide2.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AA405D0FBC406D00B7577C /* pxwide2.c */; }; - F5AA40630FBC406D00B7577C /* transform.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AA405E0FBC406D00B7577C /* transform.c */; }; - F5AC28BC0F4873C700455509 /* hotkeys.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AC28B90F4873C700455509 /* hotkeys.c */; }; - F5AC28BD0F4873C700455509 /* input.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AC28BA0F4873C700455509 /* input.c */; }; - F5AC28BE0F4873C700455509 /* realpath.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AC28BB0F4873C700455509 /* realpath.c */; }; - F5AD4B1F0EA8CCF0009CCAC4 /* version.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AD4B1E0EA8CCF0009CCAC4 /* version.c */; }; - F5AE6F990EDA119D000CE0EF /* GrafX2_Classic.gif in Copy fonts */ = {isa = PBXBuildFile; fileRef = F5AE6F980EDA119D000CE0EF /* GrafX2_Classic.gif */; }; - F5AE83FD0ECF8FD300200704 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5AE83FC0ECF8FD300200704 /* ApplicationServices.framework */; }; - F5AED03E0F1989E00090A93F /* mountlist.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AED03C0F1989E00090A93F /* mountlist.c */; }; - F5AFA00D0EFAC7D300663B43 /* brush.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AFA0070EFAC7D300663B43 /* brush.c */; }; - F5AFA00E0EFAC7D300663B43 /* pxsimple.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AFA0080EFAC7D300663B43 /* pxsimple.c */; }; - F5AFA00F0EFAC7D300663B43 /* pxtall.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AFA0090EFAC7D300663B43 /* pxtall.c */; }; - F5AFA0100EFAC7D300663B43 /* pxwide.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AFA00A0EFAC7D300663B43 /* pxwide.c */; }; - F5AFA0110EFAC7D300663B43 /* setup.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AFA00B0EFAC7D300663B43 /* setup.c */; }; - F5AFA0120EFAC7D300663B43 /* windows.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AFA00C0EFAC7D300663B43 /* windows.c */; }; - F5B138C30EB71D28000B83CC /* SDL_ttf in Frameworks */ = {isa = PBXBuildFile; fileRef = F5B138C20EB71D28000B83CC /* SDL_ttf */; }; - F5B19B930EA4BE3E003F4BA4 /* graph.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B7B0EA4BE3E003F4BA4 /* graph.c */; }; - F5B19B940EA4BE3E003F4BA4 /* init.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B7C0EA4BE3E003F4BA4 /* init.c */; }; - F5B19B950EA4BE3E003F4BA4 /* io.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B7D0EA4BE3E003F4BA4 /* io.c */; }; - F5B19B970EA4BE3E003F4BA4 /* loadsave.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B7F0EA4BE3E003F4BA4 /* loadsave.c */; }; - F5B19B9A0EA4BE3E003F4BA4 /* op_c.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B820EA4BE3E003F4BA4 /* op_c.c */; }; - F5B19B9B0EA4BE3E003F4BA4 /* operatio.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B830EA4BE3E003F4BA4 /* operatio.c */; }; - F5B19B9C0EA4BE3E003F4BA4 /* pages.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B840EA4BE3E003F4BA4 /* pages.c */; }; - F5B19B9D0EA4BE3E003F4BA4 /* palette.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B850EA4BE3E003F4BA4 /* palette.c */; }; - F5B19B9E0EA4BE3E003F4BA4 /* readini.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B860EA4BE3E003F4BA4 /* readini.c */; }; - F5B19B9F0EA4BE3E003F4BA4 /* readline.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B870EA4BE3E003F4BA4 /* readline.c */; }; - F5B19BA00EA4BE3E003F4BA4 /* saveini.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B880EA4BE3E003F4BA4 /* saveini.c */; }; - F5B19BA10EA4BE3E003F4BA4 /* sdlscreen.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B890EA4BE3E003F4BA4 /* sdlscreen.c */; }; - F5B19BA20EA4BE3E003F4BA4 /* SFont.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B8A0EA4BE3E003F4BA4 /* SFont.c */; }; - F5B19BA30EA4BE3E003F4BA4 /* shade.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B8B0EA4BE3E003F4BA4 /* shade.c */; }; - F5B19BA40EA4BE3E003F4BA4 /* special.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B8C0EA4BE3E003F4BA4 /* special.c */; }; - F5B19C1D0EA4D71C003F4BA4 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5B19C1C0EA4D71C003F4BA4 /* CoreFoundation.framework */; }; - F5B19C3D0EA4DC91003F4BA4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F5B19C3B0EA4DC91003F4BA4 /* InfoPlist.strings */; }; - F5B1EE850EAD0F4E00B087B5 /* gfx2def.ini in Resources */ = {isa = PBXBuildFile; fileRef = F5B1EE840EAD0F4E00B087B5 /* gfx2def.ini */; }; - F5B310B40F949A9C008197E2 /* buttons.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B310AD0F949A9C008197E2 /* buttons.c */; }; - F5B310B50F949A9C008197E2 /* engine.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B310AE0F949A9C008197E2 /* engine.c */; }; - F5B310B60F949A9C008197E2 /* filesel.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B310AF0F949A9C008197E2 /* filesel.c */; }; - F5B310B70F949A9C008197E2 /* help.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B310B00F949A9C008197E2 /* help.c */; }; - F5B310B80F949A9C008197E2 /* keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B310B10F949A9C008197E2 /* keyboard.c */; }; - F5B310B90F949A9C008197E2 /* misc.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B310B20F949A9C008197E2 /* misc.c */; }; - F5B310BA0F949A9C008197E2 /* text.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B310B30F949A9C008197E2 /* text.c */; }; - F5CDCE320F6EA6D600B31F63 /* pxdouble.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CDCE310F6EA6D600B31F63 /* pxdouble.c */; }; - F5DCE2BC0EA5116A0065B0EF /* SDL_ttf in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = F5DCE2BE0EA5118F0065B0EF /* SDL_ttf */; }; - F5DCE2BC0EA5116B0065B0EF /* SDL_image in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = F5DCE2BB0EA5116B0065B0EF /* SDL_image */; }; - F5DCE2BE0EA5118E0065B0EF /* SDL in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = F5DCE2BD0EA5118E0065B0EF /* SDL */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = SDL_image.framework/Versions/A; - dstSubfolderSpec = 10; - files = ( - F5DCE2BC0EA5116B0065B0EF /* SDL_image in Copy Frameworks into .app bundle */, - ); - name = "Copy Frameworks into .app bundle"; - runOnlyForDeploymentPostprocessing = 0; - }; - 002F39FD09D0883400EBEB89 /* Copy Frameworks into .app bundle */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = SDL.framework/Versions/A; - dstSubfolderSpec = 10; - files = ( - F5DCE2BE0EA5118E0065B0EF /* SDL in Copy Frameworks into .app bundle */, - ); - name = "Copy Frameworks into .app bundle"; - runOnlyForDeploymentPostprocessing = 0; - }; - 002F39FD09D0883400EBEB8A /* Copy Frameworks into .app bundle */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = SDL_ttf.framework/Versions/A; - dstSubfolderSpec = 10; - files = ( - F5DCE2BC0EA5116A0065B0EF /* SDL_ttf in Copy Frameworks into .app bundle */, - ); - name = "Copy Frameworks into .app bundle"; - runOnlyForDeploymentPostprocessing = 0; - }; - 40D82D4C10ECC5A4005D27B5 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = Library/Frameworks/SDL.framework/Resources; - dstSubfolderSpec = 7; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 40D82D5310ECC659005D27B5 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 7; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F514264B101F6C5B006CF3C4 /* Copy skins */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = skins; - dstSubfolderSpec = 7; - files = ( - F5142653101F6CC5006CF3C4 /* font_Classic.png in Copy skins */, - F5142654101F6CC5006CF3C4 /* font_Fairlight.png in Copy skins */, - F5142655101F6CC5006CF3C4 /* font_Fun.png in Copy skins */, - F5142656101F6CC5006CF3C4 /* font_Melon.png in Copy skins */, - F5142657101F6CC5006CF3C4 /* skin_classic.png in Copy skins */, - F5142658101F6CC5006CF3C4 /* skin_modern.png in Copy skins */, - ); - name = "Copy skins"; - runOnlyForDeploymentPostprocessing = 0; - }; - F5A33F1D0EC8A26C00F8052D /* Copy fonts */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = fonts; - dstSubfolderSpec = 7; - files = ( - F5AE6F990EDA119D000CE0EF /* GrafX2_Classic.gif in Copy fonts */, - F51CBD300EC8A3E1005C06AC /* Tuffy.ttf in Copy fonts */, - F51CBD2F0EC8A3E1005C06AC /* colorfont.pcx in Copy fonts */, - F51CBD2E0EC8A3E1005C06AC /* 5pxtinyfont.png in Copy fonts */, - F5A33E6A0EC893F800F8052D /* 8pxfont.png in Copy fonts */, - ); - name = "Copy fonts"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = ""; }; - 002F39F909D0881F10EBEB88 /* SDL_image.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL_image.framework; path = /Library/Frameworks/SDL_image.framework; sourceTree = ""; }; - 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; }; - 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; }; - 002F3A3E09D088BA00EBEB88 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = SOURCE_ROOT; }; - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; - 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 32CA4F630368D1EE00C91783 /* Grafx2_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Grafx2_Prefix.pch; sourceTree = ""; }; - 40D82CA010ECAF13005D27B5 /* miscfileformats.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = miscfileformats.c; sourceTree = ""; }; - 40D82CA510ECAF58005D27B5 /* brush_ops.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = brush_ops.c; sourceTree = ""; }; - 40D82CA910ECAFC5005D27B5 /* buttons_effects.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = buttons_effects.c; sourceTree = ""; }; - 40D82CAD10ECAFDC005D27B5 /* layers.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = layers.c; sourceTree = ""; }; - 40D82CB110ECB02B005D27B5 /* fileformats.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fileformats.c; sourceTree = ""; }; - 40D82CBE10ECB089005D27B5 /* libraw2crtc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = libraw2crtc.c; sourceTree = ""; }; - 40D82D4110ECC536005D27B5 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = /Library/Frameworks/SDL.framework/Resources/Info.plist; sourceTree = ""; }; - 40D82D4210ECC536005D27B5 /* SDLMain.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = SDLMain.nib; path = /Library/Frameworks/SDL.framework/Resources/SDLMain.nib; sourceTree = ""; }; - 40D82D4E10ECC609005D27B5 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = /Library/Frameworks/SDL.framework/Versions/A/Resources/Info.plist; sourceTree = ""; }; - 40D82D4F10ECC609005D27B5 /* SDLMain.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = SDLMain.nib; path = /Library/Frameworks/SDL.framework/Versions/A/Resources/SDLMain.nib; sourceTree = ""; }; - 40D82D5510ECC67A005D27B5 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = /Library/Frameworks/SDL.framework/Versions/A/Resources/Info.plist; sourceTree = ""; }; - 40D82D5610ECC67A005D27B5 /* SDLMain.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = SDLMain.nib; path = /Library/Frameworks/SDL.framework/Versions/A/Resources/SDLMain.nib; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - 8D1107320486CEB800E47090 /* Grafx2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Grafx2.app; sourceTree = BUILT_PRODUCTS_DIR; }; - F514264D101F6CB8006CF3C4 /* font_Classic.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = font_Classic.png; path = skins/font_Classic.png; sourceTree = ""; }; - F514264E101F6CB8006CF3C4 /* font_Fairlight.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = font_Fairlight.png; path = skins/font_Fairlight.png; sourceTree = ""; }; - F514264F101F6CB9006CF3C4 /* font_Fun.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = font_Fun.png; path = skins/font_Fun.png; sourceTree = ""; }; - F5142650101F6CB9006CF3C4 /* font_Melon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = font_Melon.png; path = skins/font_Melon.png; sourceTree = ""; }; - F5142651101F6CB9006CF3C4 /* skin_classic.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = skin_classic.png; path = skins/skin_classic.png; sourceTree = ""; }; - F5142652101F6CB9006CF3C4 /* skin_modern.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = skin_modern.png; path = skins/skin_modern.png; sourceTree = ""; }; - F51CBD2B0EC8A3E1005C06AC /* 5pxtinyfont.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = 5pxtinyfont.png; path = fonts/5pxtinyfont.png; sourceTree = ""; }; - F51CBD2C0EC8A3E1005C06AC /* colorfont.pcx */ = {isa = PBXFileReference; lastKnownFileType = file; name = colorfont.pcx; path = fonts/colorfont.pcx; sourceTree = ""; }; - F51CBD2D0EC8A3E1005C06AC /* Tuffy.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = Tuffy.ttf; path = fonts/Tuffy.ttf; sourceTree = ""; }; - F539315D0FE171C3003CB103 /* pversion.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pversion.c; sourceTree = ""; }; - F5A33E690EC893F800F8052D /* 8pxfont.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = 8pxfont.png; path = fonts/8pxfont.png; sourceTree = ""; }; - F5AA405A0FBC406D00B7577C /* pxquad.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxquad.c; sourceTree = ""; }; - F5AA405B0FBC406D00B7577C /* pxtall2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxtall2.c; sourceTree = ""; }; - F5AA405C0FBC406D00B7577C /* pxtriple.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxtriple.c; sourceTree = ""; }; - F5AA405D0FBC406D00B7577C /* pxwide2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxwide2.c; sourceTree = ""; }; - F5AA405E0FBC406D00B7577C /* transform.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = transform.c; sourceTree = ""; }; - F5AC28B90F4873C700455509 /* hotkeys.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = hotkeys.c; sourceTree = ""; }; - F5AC28BA0F4873C700455509 /* input.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = input.c; sourceTree = ""; }; - F5AC28BB0F4873C700455509 /* realpath.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = realpath.c; sourceTree = ""; }; - F5AD4B1E0EA8CCF0009CCAC4 /* version.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = version.c; sourceTree = ""; }; - F5AE6F980EDA119D000CE0EF /* GrafX2_Classic.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; name = GrafX2_Classic.gif; path = fonts/GrafX2_Classic.gif; sourceTree = ""; }; - F5AE83FC0ECF8FD300200704 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = ""; }; - F5AED03C0F1989E00090A93F /* mountlist.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = mountlist.c; sourceTree = ""; }; - F5AFA0070EFAC7D300663B43 /* brush.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = brush.c; sourceTree = ""; }; - F5AFA0080EFAC7D300663B43 /* pxsimple.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxsimple.c; sourceTree = ""; }; - F5AFA0090EFAC7D300663B43 /* pxtall.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxtall.c; sourceTree = ""; }; - F5AFA00A0EFAC7D300663B43 /* pxwide.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxwide.c; sourceTree = ""; }; - F5AFA00B0EFAC7D300663B43 /* setup.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = setup.c; sourceTree = ""; }; - F5AFA00C0EFAC7D300663B43 /* windows.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = windows.c; sourceTree = ""; }; - F5B138C20EB71D28000B83CC /* SDL_ttf */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = SDL_ttf; path = /Library/Frameworks/SDL_ttf.framework/SDL_ttf; sourceTree = ""; }; - F5B19B6C0EA4BDA8003F4BA4 /* SDL_image.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL_image.framework; path = /Library/Frameworks/SDL_image.framework; sourceTree = ""; }; - F5B19B7B0EA4BE3E003F4BA4 /* graph.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = graph.c; sourceTree = ""; }; - F5B19B7C0EA4BE3E003F4BA4 /* init.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = init.c; sourceTree = ""; }; - F5B19B7D0EA4BE3E003F4BA4 /* io.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = io.c; sourceTree = ""; }; - F5B19B7F0EA4BE3E003F4BA4 /* loadsave.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = loadsave.c; sourceTree = ""; }; - F5B19B820EA4BE3E003F4BA4 /* op_c.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = op_c.c; sourceTree = ""; }; - F5B19B830EA4BE3E003F4BA4 /* operatio.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = operatio.c; sourceTree = ""; }; - F5B19B840EA4BE3E003F4BA4 /* pages.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pages.c; sourceTree = ""; }; - F5B19B850EA4BE3E003F4BA4 /* palette.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = palette.c; sourceTree = ""; }; - F5B19B860EA4BE3E003F4BA4 /* readini.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = readini.c; sourceTree = ""; }; - F5B19B870EA4BE3E003F4BA4 /* readline.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = readline.c; sourceTree = ""; }; - F5B19B880EA4BE3E003F4BA4 /* saveini.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = saveini.c; sourceTree = ""; }; - F5B19B890EA4BE3E003F4BA4 /* sdlscreen.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = sdlscreen.c; sourceTree = ""; }; - F5B19B8A0EA4BE3E003F4BA4 /* SFont.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SFont.c; sourceTree = ""; }; - F5B19B8B0EA4BE3E003F4BA4 /* shade.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = shade.c; sourceTree = ""; }; - F5B19B8C0EA4BE3E003F4BA4 /* special.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = special.c; sourceTree = ""; }; - F5B19C1C0EA4D71C003F4BA4 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; - F5B19C3C0EA4DC91003F4BA4 /* English */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - F5B1EE840EAD0F4E00B087B5 /* gfx2def.ini */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = gfx2def.ini; sourceTree = ""; }; - F5B310AD0F949A9C008197E2 /* buttons.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = buttons.c; sourceTree = ""; }; - F5B310AE0F949A9C008197E2 /* engine.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = engine.c; sourceTree = ""; }; - F5B310AF0F949A9C008197E2 /* filesel.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = filesel.c; sourceTree = ""; }; - F5B310B00F949A9C008197E2 /* help.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = help.c; sourceTree = ""; }; - F5B310B10F949A9C008197E2 /* keyboard.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = keyboard.c; sourceTree = ""; }; - F5B310B20F949A9C008197E2 /* misc.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = misc.c; sourceTree = ""; }; - F5B310B30F949A9C008197E2 /* text.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = text.c; sourceTree = ""; }; - F5CDCE310F6EA6D600B31F63 /* pxdouble.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxdouble.c; sourceTree = ""; }; - F5DCE2BB0EA5116B0065B0EF /* SDL_image */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = SDL_image; path = /Library/Frameworks/SDL_image.framework/Versions/A/SDL_image; sourceTree = ""; }; - F5DCE2BD0EA5118E0065B0EF /* SDL */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = SDL; path = /Library/Frameworks/SDL.framework/Versions/A/SDL; sourceTree = ""; }; - F5DCE2BE0EA5118F0065B0EF /* SDL_ttf */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = SDL_ttf; path = /Library/Frameworks/SDL_ttf.framework/Versions/A/SDL_ttf; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8D11072E0486CEB800E47090 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F39FA09D0881F10EBEB88 /* SDL_image.framework in Frameworks */, - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, - F5B19C1D0EA4D71C003F4BA4 /* CoreFoundation.framework in Frameworks */, - F5B138C30EB71D28000B83CC /* SDL_ttf in Frameworks */, - F5AE83FD0ECF8FD300200704 /* ApplicationServices.framework in Frameworks */, - 40D82D3A10ECC4CA005D27B5 /* SDL.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 080E96DDFE201D6D7F000001 /* Classes */ = { - isa = PBXGroup; - children = ( - 002F3A2B09D0888800EBEB88 /* SDLMain.h */, - 002F3A2C09D0888800EBEB88 /* SDLMain.m */, - ); - name = Classes; - sourceTree = ""; - }; - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { - isa = PBXGroup; - children = ( - 002F39F909D0881F00EBEB88 /* SDL.framework */, - 002F39F909D0881F10EBEB88 /* SDL_image.framework */, - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, - ); - name = "Linked Frameworks"; - sourceTree = ""; - }; - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 29B97324FDCFA39411CA2CEA /* AppKit.framework */, - 29B97325FDCFA39411CA2CEA /* Foundation.framework */, - ); - name = "Other Frameworks"; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8D1107320486CEB800E47090 /* Grafx2.app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* Grafx2 */ = { - isa = PBXGroup; - children = ( - 40D82D5410ECC67A005D27B5 /* Resources */, - 40D82D4D10ECC609005D27B5 /* Resources */, - 40D82D4010ECC536005D27B5 /* Resources */, - 40D82CBE10ECB089005D27B5 /* libraw2crtc.c */, - 40D82CB110ECB02B005D27B5 /* fileformats.c */, - 40D82CAD10ECAFDC005D27B5 /* layers.c */, - 40D82CA910ECAFC5005D27B5 /* buttons_effects.c */, - 40D82CA510ECAF58005D27B5 /* brush_ops.c */, - 40D82CA010ECAF13005D27B5 /* miscfileformats.c */, - F514264D101F6CB8006CF3C4 /* font_Classic.png */, - F514264E101F6CB8006CF3C4 /* font_Fairlight.png */, - F514264F101F6CB9006CF3C4 /* font_Fun.png */, - F5142650101F6CB9006CF3C4 /* font_Melon.png */, - F5142651101F6CB9006CF3C4 /* skin_classic.png */, - F5142652101F6CB9006CF3C4 /* skin_modern.png */, - F539315D0FE171C3003CB103 /* pversion.c */, - F5CDCE310F6EA6D600B31F63 /* pxdouble.c */, - F5AC28B90F4873C700455509 /* hotkeys.c */, - F5AC28BA0F4873C700455509 /* input.c */, - F5AC28BB0F4873C700455509 /* realpath.c */, - F5AED03C0F1989E00090A93F /* mountlist.c */, - F5AFA0070EFAC7D300663B43 /* brush.c */, - F5AFA0080EFAC7D300663B43 /* pxsimple.c */, - F5AFA0090EFAC7D300663B43 /* pxtall.c */, - F5AFA00A0EFAC7D300663B43 /* pxwide.c */, - F5AFA00B0EFAC7D300663B43 /* setup.c */, - F5AFA00C0EFAC7D300663B43 /* windows.c */, - F5AE6F980EDA119D000CE0EF /* GrafX2_Classic.gif */, - F5AE83FC0ECF8FD300200704 /* ApplicationServices.framework */, - F51CBD2B0EC8A3E1005C06AC /* 5pxtinyfont.png */, - F51CBD2C0EC8A3E1005C06AC /* colorfont.pcx */, - F51CBD2D0EC8A3E1005C06AC /* Tuffy.ttf */, - F5A33E690EC893F800F8052D /* 8pxfont.png */, - F5B138C20EB71D28000B83CC /* SDL_ttf */, - F5B1EE840EAD0F4E00B087B5 /* gfx2def.ini */, - F5B310AD0F949A9C008197E2 /* buttons.c */, - F5B310AE0F949A9C008197E2 /* engine.c */, - F5B310AF0F949A9C008197E2 /* filesel.c */, - F5B310B00F949A9C008197E2 /* help.c */, - F5B310B10F949A9C008197E2 /* keyboard.c */, - F5B310B20F949A9C008197E2 /* misc.c */, - F5B310B30F949A9C008197E2 /* text.c */, - F5AD4B1E0EA8CCF0009CCAC4 /* version.c */, - F5DCE2BD0EA5118E0065B0EF /* SDL */, - F5DCE2BB0EA5116B0065B0EF /* SDL_image */, - F5DCE2BE0EA5118F0065B0EF /* SDL_ttf */, - F5B19C3B0EA4DC91003F4BA4 /* InfoPlist.strings */, - F5B19C1C0EA4D71C003F4BA4 /* CoreFoundation.framework */, - F5B19B7B0EA4BE3E003F4BA4 /* graph.c */, - F5B19B7C0EA4BE3E003F4BA4 /* init.c */, - F5B19B7D0EA4BE3E003F4BA4 /* io.c */, - F5B19B7F0EA4BE3E003F4BA4 /* loadsave.c */, - F5B19B820EA4BE3E003F4BA4 /* op_c.c */, - F5B19B830EA4BE3E003F4BA4 /* operatio.c */, - F5B19B840EA4BE3E003F4BA4 /* pages.c */, - F5B19B850EA4BE3E003F4BA4 /* palette.c */, - F5B19B860EA4BE3E003F4BA4 /* readini.c */, - F5B19B870EA4BE3E003F4BA4 /* readline.c */, - F5B19B880EA4BE3E003F4BA4 /* saveini.c */, - F5B19B890EA4BE3E003F4BA4 /* sdlscreen.c */, - F5B19B8A0EA4BE3E003F4BA4 /* SFont.c */, - F5B19B8B0EA4BE3E003F4BA4 /* shade.c */, - F5B19B8C0EA4BE3E003F4BA4 /* special.c */, - F5B19B6C0EA4BDA8003F4BA4 /* SDL_image.framework */, - 080E96DDFE201D6D7F000001 /* Classes */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - name = Grafx2; - sourceTree = ""; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 32CA4F630368D1EE00C91783 /* Grafx2_Prefix.pch */, - 002F3A3E09D088BA00EBEB88 /* main.c */, - F5AA405A0FBC406D00B7577C /* pxquad.c */, - F5AA405B0FBC406D00B7577C /* pxtall2.c */, - F5AA405C0FBC406D00B7577C /* pxtriple.c */, - F5AA405D0FBC406D00B7577C /* pxwide2.c */, - F5AA405E0FBC406D00B7577C /* transform.c */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 8D1107310486CEB800E47090 /* Info.plist */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = ""; - }; - 40D82D4010ECC536005D27B5 /* Resources */ = { - isa = PBXGroup; - children = ( - 40D82D4110ECC536005D27B5 /* Info.plist */, - 40D82D4210ECC536005D27B5 /* SDLMain.nib */, - ); - name = Resources; - path = /Library/Frameworks/SDL.framework/Resources; - sourceTree = ""; - }; - 40D82D4D10ECC609005D27B5 /* Resources */ = { - isa = PBXGroup; - children = ( - 40D82D4E10ECC609005D27B5 /* Info.plist */, - 40D82D4F10ECC609005D27B5 /* SDLMain.nib */, - ); - name = Resources; - path = /Library/Frameworks/SDL.framework/Versions/A/Resources; - sourceTree = ""; - }; - 40D82D5410ECC67A005D27B5 /* Resources */ = { - isa = PBXGroup; - children = ( - 40D82D5510ECC67A005D27B5 /* Info.plist */, - 40D82D5610ECC67A005D27B5 /* SDLMain.nib */, - ); - name = Resources; - path = /Library/Frameworks/SDL.framework/Versions/A/Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8D1107260486CEB800E47090 /* Grafx2 */ = { - isa = PBXNativeTarget; - buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Grafx2" */; - buildPhases = ( - 8D1107290486CEB800E47090 /* Resources */, - 8D11072C0486CEB800E47090 /* Sources */, - 8D11072E0486CEB800E47090 /* Frameworks */, - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */, - 002F39FD09D0883400EBEB89 /* Copy Frameworks into .app bundle */, - 002F39FD09D0883400EBEB8A /* Copy Frameworks into .app bundle */, - F5A33F1D0EC8A26C00F8052D /* Copy fonts */, - F514264B101F6C5B006CF3C4 /* Copy skins */, - 40D82D4C10ECC5A4005D27B5 /* CopyFiles */, - 40D82D5310ECC659005D27B5 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Grafx2; - productInstallPath = "$(HOME)/Applications"; - productName = Grafx2; - productReference = 8D1107320486CEB800E47090 /* Grafx2.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Grafx2" */; - compatibilityVersion = "Xcode 2.4"; - hasScannedForEncodings = 1; - mainGroup = 29B97314FDCFA39411CA2CEA /* Grafx2 */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8D1107260486CEB800E47090 /* Grafx2 */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D1107290486CEB800E47090 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F5B19C3D0EA4DC91003F4BA4 /* InfoPlist.strings in Resources */, - F5B1EE850EAD0F4E00B087B5 /* gfx2def.ini in Resources */, - 40D82D4310ECC536005D27B5 /* Info.plist in Resources */, - 40D82D4410ECC536005D27B5 /* SDLMain.nib in Resources */, - 40D82D5010ECC609005D27B5 /* Info.plist in Resources */, - 40D82D5110ECC609005D27B5 /* SDLMain.nib in Resources */, - 40D82D5710ECC67A005D27B5 /* Info.plist in Resources */, - 40D82D5810ECC67A005D27B5 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8D11072C0486CEB800E47090 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */, - 002F3A3F09D088BA00EBEB88 /* main.c in Sources */, - F5B19B930EA4BE3E003F4BA4 /* graph.c in Sources */, - F5B19B940EA4BE3E003F4BA4 /* init.c in Sources */, - F5B19B950EA4BE3E003F4BA4 /* io.c in Sources */, - F5B19B970EA4BE3E003F4BA4 /* loadsave.c in Sources */, - F5B19B9A0EA4BE3E003F4BA4 /* op_c.c in Sources */, - F5B19B9B0EA4BE3E003F4BA4 /* operatio.c in Sources */, - F5B19B9C0EA4BE3E003F4BA4 /* pages.c in Sources */, - F5B19B9D0EA4BE3E003F4BA4 /* palette.c in Sources */, - F5B19B9E0EA4BE3E003F4BA4 /* readini.c in Sources */, - F5B19B9F0EA4BE3E003F4BA4 /* readline.c in Sources */, - F5B19BA00EA4BE3E003F4BA4 /* saveini.c in Sources */, - F5B19BA10EA4BE3E003F4BA4 /* sdlscreen.c in Sources */, - F5B19BA20EA4BE3E003F4BA4 /* SFont.c in Sources */, - F5B19BA30EA4BE3E003F4BA4 /* shade.c in Sources */, - F5B19BA40EA4BE3E003F4BA4 /* special.c in Sources */, - F5AD4B1F0EA8CCF0009CCAC4 /* version.c in Sources */, - F5AFA00D0EFAC7D300663B43 /* brush.c in Sources */, - F5AFA00E0EFAC7D300663B43 /* pxsimple.c in Sources */, - F5AFA00F0EFAC7D300663B43 /* pxtall.c in Sources */, - F5AFA0100EFAC7D300663B43 /* pxwide.c in Sources */, - F5AFA0110EFAC7D300663B43 /* setup.c in Sources */, - F5AFA0120EFAC7D300663B43 /* windows.c in Sources */, - F5AED03E0F1989E00090A93F /* mountlist.c in Sources */, - F5AC28BC0F4873C700455509 /* hotkeys.c in Sources */, - F5AC28BD0F4873C700455509 /* input.c in Sources */, - F5AC28BE0F4873C700455509 /* realpath.c in Sources */, - F5CDCE320F6EA6D600B31F63 /* pxdouble.c in Sources */, - F5B310B40F949A9C008197E2 /* buttons.c in Sources */, - F5B310B50F949A9C008197E2 /* engine.c in Sources */, - F5B310B60F949A9C008197E2 /* filesel.c in Sources */, - F5B310B70F949A9C008197E2 /* help.c in Sources */, - F5B310B80F949A9C008197E2 /* keyboard.c in Sources */, - F5B310B90F949A9C008197E2 /* misc.c in Sources */, - F5B310BA0F949A9C008197E2 /* text.c in Sources */, - F5AA405F0FBC406D00B7577C /* pxquad.c in Sources */, - F5AA40600FBC406D00B7577C /* pxtall2.c in Sources */, - F5AA40610FBC406D00B7577C /* pxtriple.c in Sources */, - F5AA40620FBC406D00B7577C /* pxwide2.c in Sources */, - F5AA40630FBC406D00B7577C /* transform.c in Sources */, - F539315E0FE171C3003CB103 /* pversion.c in Sources */, - 40D82CA110ECAF13005D27B5 /* miscfileformats.c in Sources */, - 40D82CA610ECAF58005D27B5 /* brush_ops.c in Sources */, - 40D82CAA10ECAFC5005D27B5 /* buttons_effects.c in Sources */, - 40D82CAE10ECAFDC005D27B5 /* layers.c in Sources */, - 40D82CB210ECB02B005D27B5 /* fileformats.c in Sources */, - 40D82CBF10ECB089005D27B5 /* libraw2crtc.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - F5B19C3B0EA4DC91003F4BA4 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - F5B19C3C0EA4DC91003F4BA4 /* English */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - C01FCF4B08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", - ); - FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(DEVELOPER_DIR)/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks\""; - FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Versions/A/Frameworks\""; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - __macosx__, - __linux__, - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)", - ); - LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL_image.framework\""; - LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL.framework\""; - LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3 = "\"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL_ttf.framework\""; - LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework\""; - PRODUCT_NAME = Grafx2; - REZ_SEARCH_PATHS = ""; - WRAPPER_EXTENSION = app; - ZERO_LINK = YES; - }; - name = Debug; - }; - C01FCF4C08A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - ppc, - i386, - ); - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", - ); - FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(DEVELOPER_DIR)/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks\""; - FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Versions/A/Frameworks\""; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - GCC_PREPROCESSOR_DEFINITIONS = ( - __macosx__, - __linux__, - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)", - ); - LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL_image.framework\""; - LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL.framework\""; - LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3 = "\"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL_ttf.framework\""; - LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework\""; - PRODUCT_NAME = Grafx2; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_OPTIMIZATION_LEVEL = 3; - GCC_PREPROCESSOR_DEFINITIONS = ( - __macosx__, - __linux__, - ); - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - /usr/X11/include, - /Library/Frameworks/SDL_image.framework/Headers, - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - /Library/SDL_ttf.framework/Headers, - /usr/local/include, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ( - /usr/X11/lib, - /usr/local/lib, - ); - OTHER_LDFLAGS = ( - "-lpng", - "-lz", - ); - PREBINDING = NO; - PRELINK_LIBS = SDL_Image; - SDKROOT = /Developer/SDKs/MacOSX10.5.sdk; - STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static; - ZERO_LINK = YES; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - DEAD_CODE_STRIPPING = YES; - FRAMEWORK_SEARCH_PATHS = ( - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_PREPROCESSOR_DEFINITIONS = ( - __macosx__, - __linux__, - ); - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - /usr/local/include, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = /usr/local/lib; - OTHER_LDFLAGS = ( - "-lpng", - "-lz", - ); - PREBINDING = NO; - PRELINK_LIBS = SDL_Image; - SDKROOT = /Developer/SDKs/MacOSX10.5.sdk; - STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Grafx2" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4B08A954540054247B /* Debug */, - C01FCF4C08A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Grafx2" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/src/Grafx2.xcodeproj/xx.pbxuser b/src/Grafx2.xcodeproj/xx.pbxuser deleted file mode 100644 index a3b5507f..00000000 --- a/src/Grafx2.xcodeproj/xx.pbxuser +++ /dev/null @@ -1,319 +0,0 @@ -// !$*UTF8*$! -{ - 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {867, 536}}"; - sepNavSelRange = "{302, 0}"; - sepNavVisRect = "{{0, 0}, {867, 536}}"; - sepNavWindowFrame = "{{15, 76}, {906, 665}}"; - }; - }; - 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1084, 7296}}"; - sepNavSelRange = "{1567, 12}"; - sepNavVisRect = "{{0, 718}, {867, 536}}"; - sepNavWindowFrame = "{{38, 55}, {906, 665}}"; - }; - }; - 002F3A3E09D088BA00EBEB88 /* main.c */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1044, 15086}}"; - sepNavSelRange = "{19535, 0}"; - sepNavVisRect = "{{0, 10961}, {867, 536}}"; - sepNavWindowFrame = "{{14, 76}, {906, 665}}"; - }; - }; - 29B97313FDCFA39411CA2CEA /* Project object */ = { - activeBuildConfigurationName = Release; - activeExecutable = F5B19B5D0EA4BD57003F4BA4 /* Grafx2 */; - activeTarget = 8D1107260486CEB800E47090 /* Grafx2 */; - addToTargets = ( - ); - breakpointsGroup = F5B19B700EA4BDA9003F4BA4 /* XCBreakpointsBucket */; - codeSenseManager = F5B19B6A0EA4BD79003F4BA4 /* Code sense */; - executables = ( - F5B19B5D0EA4BD57003F4BA4 /* Grafx2 */, - ); - perUserDictionary = { - PBXConfiguration.PBXFileTableDataSource3.PBXErrorsWarningsDataSource = { - PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; - PBXFileTableDataSourceColumnSortingKey = PBXErrorsWarningsDataSource_LocationID; - PBXFileTableDataSourceColumnWidthsKey = ( - 20, - 453, - 58, - ); - PBXFileTableDataSourceColumnsKey = ( - PBXErrorsWarningsDataSource_TypeID, - PBXErrorsWarningsDataSource_MessageID, - PBXErrorsWarningsDataSource_LocationID, - ); - }; - PBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = { - PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; - PBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID; - PBXFileTableDataSourceColumnWidthsKey = ( - 22, - 300, - 209, - ); - PBXFileTableDataSourceColumnsKey = ( - PBXExecutablesDataSource_ActiveFlagID, - PBXExecutablesDataSource_NameID, - PBXExecutablesDataSource_CommentsID, - ); - }; - PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { - PBXFileTableDataSourceColumnSortingDirectionKey = 1; - PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Built_ColumnID; - PBXFileTableDataSourceColumnWidthsKey = ( - 20, - 99, - 20, - 48, - 43, - 43, - 20, - 264, - 10, - 20, - ); - PBXFileTableDataSourceColumnsKey = ( - PBXFileDataSource_FiletypeID, - PBXFileDataSource_Filename_ColumnID, - PBXFileDataSource_Built_ColumnID, - PBXFileDataSource_ObjectSize_ColumnID, - PBXFileDataSource_Errors_ColumnID, - PBXFileDataSource_Warnings_ColumnID, - PBXFileDataSource_Target_ColumnID, - PBXFileDataSource_Path_ColumnID, - PBXFileDataSource_Comments_ColumnID, - PBXFileDataSource_SCM_ColumnID, - ); - }; - PBXConfiguration.PBXFileTableDataSource3.PBXFindDataSource = { - PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; - PBXFileTableDataSourceColumnSortingKey = PBXFindDataSource_LocationID; - PBXFileTableDataSourceColumnWidthsKey = ( - 200, - 413.2085, - ); - PBXFileTableDataSourceColumnsKey = ( - PBXFindDataSource_MessageID, - PBXFindDataSource_LocationID, - ); - }; - PBXConfiguration.PBXFileTableDataSource3.PBXSymbolsDataSource = { - PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; - PBXFileTableDataSourceColumnSortingKey = PBXSymbolsDataSource_SymbolNameID; - PBXFileTableDataSourceColumnWidthsKey = ( - 16, - 200, - 50, - 325.2085, - ); - PBXFileTableDataSourceColumnsKey = ( - PBXSymbolsDataSource_SymbolTypeIconID, - PBXSymbolsDataSource_SymbolNameID, - PBXSymbolsDataSource_SymbolTypeID, - PBXSymbolsDataSource_ReferenceNameID, - ); - }; - PBXConfiguration.PBXFileTableDataSource3.XCSCMDataSource = { - PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; - PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; - PBXFileTableDataSourceColumnWidthsKey = ( - 20, - 20, - 262, - 20, - 48.1626, - 43, - 43, - 20, - ); - PBXFileTableDataSourceColumnsKey = ( - PBXFileDataSource_SCM_ColumnID, - PBXFileDataSource_FiletypeID, - PBXFileDataSource_Filename_ColumnID, - PBXFileDataSource_Built_ColumnID, - PBXFileDataSource_ObjectSize_ColumnID, - PBXFileDataSource_Errors_ColumnID, - PBXFileDataSource_Warnings_ColumnID, - PBXFileDataSource_Target_ColumnID, - ); - }; - PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { - PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; - PBXFileTableDataSourceColumnSortingKey = PBXTargetDataSource_PrimaryAttribute; - PBXFileTableDataSourceColumnWidthsKey = ( - 20, - 200, - 106, - 20, - 48, - 43, - 43, - ); - PBXFileTableDataSourceColumnsKey = ( - PBXFileDataSource_FiletypeID, - PBXFileDataSource_Filename_ColumnID, - PBXTargetDataSource_PrimaryAttribute, - PBXFileDataSource_Built_ColumnID, - PBXFileDataSource_ObjectSize_ColumnID, - PBXFileDataSource_Errors_ColumnID, - PBXFileDataSource_Warnings_ColumnID, - ); - }; - PBXPerProjectTemplateStateSaveDate = 270495112; - PBXWorkspaceStateSaveDate = 270495112; - }; - sourceControlManager = F5B19B690EA4BD79003F4BA4 /* Source Control */; - userBuildSettings = { - OBJROOT = "$(SYMROOT)"; - }; - }; - 32CA4F630368D1EE00C91783 /* Grafx2_Prefix.pch */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {932, 587}}"; - sepNavSelRange = "{0, 0}"; - sepNavVisRect = "{{0, 0}, {932, 587}}"; - sepNavWindowFrame = "{{15, 25}, {971, 716}}"; - }; - }; - 8D1107260486CEB800E47090 /* Grafx2 */ = { - activeExec = 0; - executables = ( - F5B19B5D0EA4BD57003F4BA4 /* Grafx2 */, - ); - }; - F51CBD2B0EC8A3E1005C06AC /* 5pxtinyfont.png */ = { - uiCtxt = { - sepNavWindowFrame = "{{15, 25}, {971, 716}}"; - }; - }; - F5A33E690EC893F800F8052D /* 8pxfont.png */ = { - uiCtxt = { - sepNavWindowFrame = "{{15, 76}, {906, 665}}"; - }; - }; - F5AD4B1E0EA8CCF0009CCAC4 /* version.c */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {932, 587}}"; - sepNavSelRange = "{26, 0}"; - sepNavVisRect = "{{0, 0}, {932, 587}}"; - sepNavWindowFrame = "{{7, 5}, {971, 716}}"; - }; - }; - F5AED03C0F1989E00090A93F /* mountlist.c */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {867, 17252}}"; - sepNavSelRange = "{4702, 50}"; - sepNavVisRect = "{{0, 2973}, {867, 536}}"; - sepNavWindowFrame = "{{15, 76}, {906, 665}}"; - }; - }; - F5B19B5D0EA4BD57003F4BA4 /* Grafx2 */ = { - isa = PBXExecutable; - activeArgIndex = 2147483647; - activeArgIndices = ( - ); - argumentStrings = ( - ); - autoAttachOnCrash = 1; - configStateDict = { - }; - customDataFormattersEnabled = 1; - debuggerPlugin = GDBDebugging; - disassemblyDisplayState = 0; - dylibVariantSuffix = ""; - enableDebugStr = 1; - environmentEntries = ( - ); - executableSystemSymbolLevel = 0; - executableUserSymbolLevel = 0; - libgmallocEnabled = 0; - name = Grafx2; - savedGlobals = { - }; - sourceDirectories = ( - ); - variableFormatDictionary = { - }; - }; - F5B19B690EA4BD79003F4BA4 /* Source Control */ = { - isa = PBXSourceControlManager; - fallbackIsa = XCSourceControlManager; - isSCMEnabled = 0; - scmConfiguration = { - }; - scmType = scm.subversion; - }; - F5B19B6A0EA4BD79003F4BA4 /* Code sense */ = { - isa = PBXCodeSenseManager; - indexTemplatePath = ""; - }; - F5B19B700EA4BDA9003F4BA4 /* XCBreakpointsBucket */ = { - isa = XCBreakpointsBucket; - name = "Project Breakpoints"; - objects = ( - ); - }; - F5B19B7B0EA4BE3E003F4BA4 /* graph.c */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1140, 52782}}"; - sepNavSelRange = "{6769, 0}"; - sepNavVisRect = "{{0, 0}, {867, 536}}"; - sepNavWindowFrame = "{{14, 76}, {906, 665}}"; - }; - }; - F5B19B7C0EA4BE3E003F4BA4 /* init.c */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1660, 46018}}"; - sepNavSelRange = "{81112, 1}"; - sepNavVisRect = "{{0, 44925}, {867, 536}}"; - sepNavWindowFrame = "{{12, 46}, {906, 665}}"; - }; - }; - F5B19B7F0EA4BE3E003F4BA4 /* loadsave.c */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1700, 112651}}"; - sepNavSelRange = "{1098, 24}"; - sepNavVisRect = "{{0, 331}, {867, 536}}"; - sepNavWindowFrame = "{{15, 76}, {906, 665}}"; - }; - }; - F5B19B850EA4BE3E003F4BA4 /* palette.c */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1268, 37031}}"; - sepNavSelRange = "{75128, 0}"; - sepNavVisRect = "{{0, 0}, {0, 0}}"; - sepNavWindowFrame = "{{15, 76}, {906, 665}}"; - }; - }; - F5B19B880EA4BE3E003F4BA4 /* saveini.c */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1156, 12084}}"; - sepNavSelRange = "{19568, 0}"; - sepNavVisRect = "{{0, 0}, {0, 0}}"; - sepNavWindowFrame = "{{15, 76}, {906, 665}}"; - }; - }; - F5B19B890EA4BE3E003F4BA4 /* sdlscreen.c */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1396, 4351}}"; - sepNavSelRange = "{2375, 0}"; - sepNavVisRect = "{{0, 1072}, {867, 536}}"; - sepNavWindowFrame = "{{35, 15}, {906, 665}}"; - }; - }; - F5B19C3C0EA4DC91003F4BA4 /* English */ = { - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1692, 536}}"; - sepNavSelRange = "{0, 0}"; - sepNavVisRect = "{{825, 0}, {867, 536}}"; - sepNavWindowFrame = "{{15, 76}, {906, 665}}"; - }; - }; -} diff --git a/src/Grafx2.xcodeproj/xx.perspective b/src/Grafx2.xcodeproj/xx.perspective deleted file mode 100644 index f9c5d992..00000000 --- a/src/Grafx2.xcodeproj/xx.perspective +++ /dev/null @@ -1,1403 +0,0 @@ - - - - - ActivePerspectiveName - Build - AllowedModules - - - BundleLoadPath - - MaxInstances - n - Module - PBXSmartGroupTreeModule - Name - Groups and Files Outline View - - - BundleLoadPath - - MaxInstances - n - Module - PBXNavigatorGroup - Name - Editor - - - BundleLoadPath - - MaxInstances - n - Module - XCTaskListModule - Name - Task List - - - BundleLoadPath - - MaxInstances - n - Module - XCDetailModule - Name - File and Smart Group Detail Viewer - - - BundleLoadPath - - MaxInstances - 1 - Module - PBXBuildResultsModule - Name - Detailed Build Results Viewer - - - BundleLoadPath - - MaxInstances - 1 - Module - PBXProjectFindModule - Name - Project Batch Find Tool - - - BundleLoadPath - - MaxInstances - n - Module - PBXRunSessionModule - Name - Run Log - - - BundleLoadPath - - MaxInstances - n - Module - PBXBookmarksModule - Name - Bookmarks Tool - - - BundleLoadPath - - MaxInstances - n - Module - PBXClassBrowserModule - Name - Class Browser - - - BundleLoadPath - - MaxInstances - n - Module - PBXCVSModule - Name - Source Code Control Tool - - - BundleLoadPath - - MaxInstances - n - Module - PBXDebugBreakpointsModule - Name - Debug Breakpoints Tool - - - BundleLoadPath - - MaxInstances - n - Module - XCDockableInspector - Name - Inspector - - - BundleLoadPath - - MaxInstances - n - Module - PBXOpenQuicklyModule - Name - Open Quickly Tool - - - BundleLoadPath - - MaxInstances - 1 - Module - PBXDebugSessionModule - Name - Debugger - - - BundleLoadPath - - MaxInstances - 1 - Module - PBXDebugCLIModule - Name - Debug Console - - - Description - AIODescriptionKey - DockingSystemVisible - - Extension - perspective - FavBarConfig - - PBXProjectModuleGUID - F5A33EC80EC89C3000F8052D - XCBarModuleItemNames - - XCBarModuleItems - - - FirstTimeWindowDisplayed - - Identifier - com.apple.perspectives.project.default - MajorVersion - 33 - MinorVersion - 0 - Name - All-In-One - Notifications - - OpenEditors - - PerspectiveWidths - - 971 - 971 - 971 - - Perspectives - - - ChosenToolbarItems - - XCToolbarPerspectiveControl - NSToolbarSeparatorItem - active-target-popup - active-buildstyle-popup - action - NSToolbarFlexibleSpaceItem - buildOrClean - build-and-runOrDebug - com.apple.ide.PBXToolbarStopButton - get-info - toggle-editor - NSToolbarFlexibleSpaceItem - com.apple.pbx.toolbar.searchfield - - ControllerClassBaseName - - IconName - WindowOfProject - Identifier - perspective.project - IsVertical - - Layout - - - ContentConfiguration - - PBXBottomSmartGroupGIDs - - 1C37FBAC04509CD000000102 - 1C37FAAC04509CD000000102 - 1C08E77C0454961000C914BD - 1C37FABC05509CD000000102 - 1C37FABC05539CD112110102 - E2644B35053B69B200211256 - 1C37FABC04509CD000100104 - 1CC0EA4004350EF90044410B - 1CC0EA4004350EF90041110B - 1C77FABC04509CD000000102 - - PBXProjectModuleGUID - 1CA23ED40692098700951B8B - PBXProjectModuleLabel - Files - PBXProjectStructureProvided - yes - PBXSmartGroupTreeModuleColumnData - - PBXSmartGroupTreeModuleColumnWidthsKey - - 345 - - PBXSmartGroupTreeModuleColumnsKey_v4 - - MainColumn - - - PBXSmartGroupTreeModuleOutlineStateKey_v7 - - PBXSmartGroupTreeModuleOutlineStateExpansionKey - - 29B97314FDCFA39411CA2CEA - 29B97317FDCFA39411CA2CEA - 1C37FBAC04509CD000000102 - F56B73F7101F6D9500B6D9A4 - F56B7443101FA1C600B6D9A4 - - PBXSmartGroupTreeModuleOutlineStateSelectionKey - - - 0 - - - PBXSmartGroupTreeModuleOutlineStateVisibleRectKey - {{0, 0}, {345, 600}} - - PBXTopSmartGroupGIDs - - XCIncludePerspectivesSwitch - - - GeometryConfiguration - - Frame - {{0, 0}, {362, 618}} - GroupTreeTableConfiguration - - MainColumn - 345 - - - Module - PBXSmartGroupTreeModule - Proportion - 362pt - - - Dock - - - ContentConfiguration - - PBXProjectModuleGUID - F5A33EBD0EC89C3000F8052D - PBXProjectModuleLabel - - PBXSplitModuleInNavigatorKey - - Split0 - - PBXProjectModuleGUID - F5A33EBE0EC89C3000F8052D - PBXProjectModuleLabel - - - SplitCount - 1 - - StatusBarVisibility - - XCSharingToken - com.apple.Xcode.CommonNavigatorGroupSharingToken - - GeometryConfiguration - - Frame - {{0, 0}, {604, 0}} - - Module - PBXNavigatorGroup - Proportion - 0pt - - - Proportion - 613pt - Tabs - - - ContentConfiguration - - PBXProjectModuleGUID - 1CA23EDF0692099D00951B8B - PBXProjectModuleLabel - Detail - - GeometryConfiguration - - Frame - {{10, 27}, {604, 586}} - - Module - XCDetailModule - - - ContentConfiguration - - PBXProjectModuleGUID - 1CA23EE00692099D00951B8B - PBXProjectModuleLabel - Project Find - - GeometryConfiguration - - Frame - {{10, 27}, {644, 586}} - - Module - PBXProjectFindModule - - - ContentConfiguration - - PBXProjectModuleGUID - 1CA23EE10692099D00951B8B - PBXProjectModuleLabel - SCM Results - - GeometryConfiguration - - Frame - {{10, 27}, {644, 586}} - - Module - PBXCVSModule - - - - - Proportion - 604pt - - - Name - Project - ServiceClasses - - XCModuleDock - PBXSmartGroupTreeModule - XCModuleDock - PBXNavigatorGroup - XCDockableTabModule - XCDetailModule - PBXProjectFindModule - PBXCVSModule - - TableOfContents - - F56B7444101FA1C600B6D9A4 - 1CA23ED40692098700951B8B - F56B7445101FA1C600B6D9A4 - F5A33EBD0EC89C3000F8052D - F56B7446101FA1C600B6D9A4 - 1CA23EDF0692099D00951B8B - 1CA23EE00692099D00951B8B - 1CA23EE10692099D00951B8B - - ToolbarConfiguration - xcode.toolbar.config.default - - - ChosenToolbarItems - - XCToolbarPerspectiveControl - NSToolbarSeparatorItem - active-target-popup - active-buildstyle-popup - active-executable-popup - NSToolbarFlexibleSpaceItem - build - clean - NSToolbarSeparatorItem - run - debug - - ControllerClassBaseName - - IconName - BuildTabIcon - Identifier - perspective.build - IsVertical - - Layout - - - BecomeActive - - ContentConfiguration - - PBXBottomSmartGroupGIDs - - PBXProjectModuleGUID - 1CA23EE50692099D00951B8B - PBXProjectModuleLabel - Files - PBXProjectStructureProvided - yes - PBXSmartGroupTreeModuleColumnData - - PBXSmartGroupTreeModuleColumnWidthsKey - - 275 - - PBXSmartGroupTreeModuleColumnsKey_v4 - - MainColumn - - - PBXSmartGroupTreeModuleOutlineStateKey_v7 - - PBXSmartGroupTreeModuleOutlineStateExpansionKey - - 29B97314FDCFA39411CA2CEA - F5B19C3B0EA4DC91003F4BA4 - 080E96DDFE201D6D7F000001 - 29B97315FDCFA39411CA2CEA - 29B97317FDCFA39411CA2CEA - 29B97323FDCFA39411CA2CEA - 1058C7A0FEA54F0111CA2CBB - 1058C7A2FEA54F0111CA2CBB - 19C28FACFE9D520D11CA2CBB - - PBXSmartGroupTreeModuleOutlineStateSelectionKey - - - 42 - 0 - - - PBXSmartGroupTreeModuleOutlineStateVisibleRectKey - {{0, 475}, {275, 600}} - - PBXTopSmartGroupGIDs - - XCIncludePerspectivesSwitch - - - GeometryConfiguration - - Frame - {{0, 0}, {292, 618}} - GroupTreeTableConfiguration - - MainColumn - 275 - - RubberWindowFrame - 151 75 971 659 0 0 1024 746 - - Module - PBXSmartGroupTreeModule - Proportion - 292pt - - - Dock - - - ContentConfiguration - - PBXProjectModuleGUID - F5A33EC20EC89C3000F8052D - PBXProjectModuleLabel - - PBXSplitModuleInNavigatorKey - - Split0 - - PBXProjectModuleGUID - F5A33EC30EC89C3000F8052D - PBXProjectModuleLabel - - - SplitCount - 1 - - StatusBarVisibility - - XCSharingToken - com.apple.Xcode.CommonNavigatorGroupSharingToken - - GeometryConfiguration - - Frame - {{0, 0}, {674, 0}} - RubberWindowFrame - 151 75 971 659 0 0 1024 746 - - Module - PBXNavigatorGroup - Proportion - 0pt - - - Proportion - 613pt - Tabs - - - ContentConfiguration - - PBXBuildLogShowsTranscriptDefaultKey - {{0, 5}, {674, 581}} - PBXProjectModuleGUID - XCMainBuildResultsModuleGUID - PBXProjectModuleLabel - Build - XCBuildResultsTrigger_Collapse - 1021 - XCBuildResultsTrigger_Open - 1011 - - GeometryConfiguration - - Frame - {{10, 27}, {674, 586}} - RubberWindowFrame - 151 75 971 659 0 0 1024 746 - - Module - PBXBuildResultsModule - - - ContentConfiguration - - LauncherConfigVersion - 3 - PBXProjectModuleGUID - 1CA23EE80692099D00951B8B - PBXProjectModuleLabel - Run - Runner - - HorizontalSplitView - - _collapsingFrameDimension - 0.0 - _indexOfCollapsedView - 0 - _percentageOfCollapsedView - 0.0 - isCollapsed - yes - sizes - - {{0, 0}, {365, 167}} - {{0, 176}, {365, 267}} - - - VerticalSplitView - - _collapsingFrameDimension - 0.0 - _indexOfCollapsedView - 0 - _percentageOfCollapsedView - 0.0 - isCollapsed - yes - sizes - - {{0, 0}, {405, 443}} - {{414, 0}, {514, 443}} - - - - - GeometryConfiguration - - Frame - {{10, 27}, {902, 597}} - - Module - PBXRunSessionModule - - - - - Proportion - 674pt - - - Name - Build - ServiceClasses - - XCModuleDock - PBXSmartGroupTreeModule - XCModuleDock - PBXNavigatorGroup - XCDockableTabModule - PBXBuildResultsModule - PBXRunSessionModule - XCConsole - - TableOfContents - - F56B7447101FA1C600B6D9A4 - 1CA23EE50692099D00951B8B - F56B7448101FA1C600B6D9A4 - F5A33EC20EC89C3000F8052D - F56B7449101FA1C600B6D9A4 - XCMainBuildResultsModuleGUID - 1CA23EE80692099D00951B8B - F56B744A101FA1C600B6D9A4 - - ToolbarConfiguration - xcode.toolbar.config.buildAndRun - - - ChosenToolbarItems - - XCToolbarPerspectiveControl - NSToolbarSeparatorItem - build-and-debug - debug - NSToolbarFlexibleSpaceItem - debugger-fix-and-continue - debugger-restart-executable - debugger-pause - debugger-continue - debugger-step-over - debugger-step-into - debugger-step-out - debugger-step-instruction - NSToolbarFlexibleSpaceItem - - ControllerClassBaseName - PBXDebugSessionModule - IconName - DebugTabIcon - Identifier - perspective.debug - IsVertical - - Layout - - - ContentConfiguration - - PBXProjectModuleGUID - 1CCC7628064C1048000F2A68 - PBXProjectModuleLabel - Debugger Console - - GeometryConfiguration - - Frame - {{0, 0}, {971, 0}} - - Module - PBXDebugCLIModule - Proportion - 0pt - - - ContentConfiguration - - Debugger - - HorizontalSplitView - - _collapsingFrameDimension - 0.0 - _indexOfCollapsedView - 0 - _percentageOfCollapsedView - 0.0 - isCollapsed - yes - sizes - - {{0, 0}, {470, 295}} - {{470, 0}, {501, 295}} - - - VerticalSplitView - - _collapsingFrameDimension - 0.0 - _indexOfCollapsedView - 0 - _percentageOfCollapsedView - 0.0 - isCollapsed - yes - sizes - - {{0, 0}, {971, 295}} - {{0, 295}, {971, 318}} - - - - LauncherConfigVersion - 8 - PBXProjectModuleGUID - 1CCC7629064C1048000F2A68 - PBXProjectModuleLabel - Debug - - GeometryConfiguration - - DebugConsoleDrawerSize - {100, 120} - DebugConsoleVisible - None - DebugConsoleWindowFrame - {{200, 200}, {500, 300}} - DebugSTDIOWindowFrame - {{200, 200}, {500, 300}} - Frame - {{0, 5}, {971, 613}} - - Module - PBXDebugSessionModule - Proportion - 613pt - - - Name - Debug - ServiceClasses - - XCModuleDock - PBXDebugCLIModule - PBXDebugSessionModule - PBXDebugProcessAndThreadModule - PBXDebugProcessViewModule - PBXDebugThreadViewModule - PBXDebugStackFrameViewModule - PBXNavigatorGroup - XCConsole - - TableOfContents - - F56B744B101FA1C600B6D9A4 - 1CCC7628064C1048000F2A68 - 1CCC7629064C1048000F2A68 - F56B744C101FA1C600B6D9A4 - F56B744D101FA1C600B6D9A4 - F56B744E101FA1C600B6D9A4 - F56B744F101FA1C600B6D9A4 - F56B7409101F6DEB00B6D9A4 - F56B7450101FA1C600B6D9A4 - - ToolbarConfiguration - xcode.toolbar.config.debug - - - PerspectivesBarVisible - - PinnedNavigatorIdentifier - F56B743E101F7E4F00B6D9A4 - ShelfIsVisible - - SourceDescription - file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Versions/A/Resources/XCPerspectivesSpecification.xcperspec' - StatusbarIsVisible - - TimeStamp - 0.0 - ToolbarDisplayMode - 1 - ToolbarIsVisible - - ToolbarSizeMode - 1 - Type - Perspectives - UpdateMessage - - WindowJustification - 5 - WindowOrderList - - F56B7450101FA1C600B6D9A4 - /Users/xx/Grafx2/Grafx2.xcodeproj - - WindowString - 151 75 971 659 0 0 1024 746 - WindowTools - - - Identifier - windowTool.find - Layout - - - Dock - - - Dock - - - ContentConfiguration - - PBXProjectModuleGUID - 1CDD528C0622207200134675 - PBXProjectModuleLabel - <No Editor> - PBXSplitModuleInNavigatorKey - - Split0 - - PBXProjectModuleGUID - 1CD0528D0623707200166675 - - SplitCount - 1 - - StatusBarVisibility - 1 - - GeometryConfiguration - - Frame - {{0, 0}, {781, 167}} - RubberWindowFrame - 62 385 781 470 0 0 1440 878 - - Module - PBXNavigatorGroup - Proportion - 781pt - - - Proportion - 50% - - - BecomeActive - 1 - ContentConfiguration - - PBXProjectModuleGUID - 1CD0528E0623707200166675 - PBXProjectModuleLabel - Project Find - - GeometryConfiguration - - Frame - {{8, 0}, {773, 254}} - RubberWindowFrame - 62 385 781 470 0 0 1440 878 - - Module - PBXProjectFindModule - Proportion - 50% - - - Proportion - 428pt - - - Name - Project Find - ServiceClasses - - PBXProjectFindModule - - StatusbarIsVisible - 1 - TableOfContents - - 1C530D57069F1CE1000CFCEE - 1C530D58069F1CE1000CFCEE - 1C530D59069F1CE1000CFCEE - 1CDD528C0622207200134675 - 1C530D5A069F1CE1000CFCEE - 1CE0B1FE06471DED0097A5F4 - 1CD0528E0623707200166675 - - WindowString - 62 385 781 470 0 0 1440 878 - WindowToolGUID - 1C530D57069F1CE1000CFCEE - WindowToolIsVisible - 0 - - - Identifier - windowTool.run - Layout - - - Dock - - - ContentConfiguration - - LauncherConfigVersion - 3 - PBXProjectModuleGUID - 1CD0528B0623707200166675 - PBXProjectModuleLabel - Run - cocoapp112 - cocoapp112 - Runner - - HorizontalSplitView - - _collapsingFrameDimension - 0.0 - _indexOfCollapsedView - 0 - _percentageOfCollapsedView - 0.0 - isCollapsed - yes - sizes - - {{0, 0}, {365, 167}} - {{0, 176}, {365, 267}} - - - VerticalSplitView - - _collapsingFrameDimension - 0.0 - _indexOfCollapsedView - 0 - _percentageOfCollapsedView - 0.0 - isCollapsed - yes - sizes - - {{0, 0}, {405, 443}} - {{414, 0}, {514, 443}} - - - - - GeometryConfiguration - - Frame - {{0, 0}, {456, 192}} - RubberWindowFrame - 741 130 456 234 0 0 1280 1002 - - Module - PBXRunSessionModule - Proportion - 192pt - - - Proportion - 192pt - - - Name - Run Log - ServiceClasses - - PBXRunSessionModule - - StatusbarIsVisible - 1 - TableOfContents - - 1C78EAAF065D492600B07095 - 1C78EAB0065D492600B07095 - 1CD0528B0623707200166675 - 1C78EAB1065D492600B07095 - - ToolbarConfiguration - xcode.toolbar.config.run - WindowString - 741 130 456 234 0 0 1280 1002 - - - Identifier - windowTool.scm - Layout - - - Dock - - - ContentConfiguration - - PBXProjectModuleGUID - 1C78EAB2065D492600B07095 - PBXProjectModuleLabel - <No Editor> - PBXSplitModuleInNavigatorKey - - Split0 - - PBXProjectModuleGUID - 1C78EAB3065D492600B07095 - - SplitCount - 1 - - StatusBarVisibility - 1 - - GeometryConfiguration - - Frame - {{0, 0}, {452, 0}} - RubberWindowFrame - 743 379 452 308 0 0 1280 1002 - - Module - PBXNavigatorGroup - Proportion - 0pt - - - BecomeActive - 1 - ContentConfiguration - - PBXProjectModuleGUID - 1CD052920623707200166675 - PBXProjectModuleLabel - SCM - - GeometryConfiguration - - ConsoleFrame - {{0, 259}, {452, 0}} - Frame - {{0, 7}, {452, 259}} - RubberWindowFrame - 743 379 452 308 0 0 1280 1002 - TableConfiguration - - Status - 30 - FileName - 199 - Path - 197.09500122070312 - - TableFrame - {{0, 0}, {452, 250}} - - Module - PBXCVSModule - Proportion - 262pt - - - Proportion - 266pt - - - Name - SCM - ServiceClasses - - PBXCVSModule - - StatusbarIsVisible - 1 - TableOfContents - - 1C78EAB4065D492600B07095 - 1C78EAB5065D492600B07095 - 1C78EAB2065D492600B07095 - 1CD052920623707200166675 - - ToolbarConfiguration - xcode.toolbar.config.scm - WindowString - 743 379 452 308 0 0 1280 1002 - - - Identifier - windowTool.breakpoints - IsVertical - 0 - Layout - - - Dock - - - BecomeActive - 1 - ContentConfiguration - - PBXBottomSmartGroupGIDs - - 1C77FABC04509CD000000102 - - PBXProjectModuleGUID - 1CE0B1FE06471DED0097A5F4 - PBXProjectModuleLabel - Files - PBXProjectStructureProvided - no - PBXSmartGroupTreeModuleColumnData - - PBXSmartGroupTreeModuleColumnWidthsKey - - 168 - - PBXSmartGroupTreeModuleColumnsKey_v4 - - MainColumn - - - PBXSmartGroupTreeModuleOutlineStateKey_v7 - - PBXSmartGroupTreeModuleOutlineStateExpansionKey - - 1C77FABC04509CD000000102 - - PBXSmartGroupTreeModuleOutlineStateSelectionKey - - - 0 - - - PBXSmartGroupTreeModuleOutlineStateVisibleRectKey - {{0, 0}, {168, 350}} - - PBXTopSmartGroupGIDs - - XCIncludePerspectivesSwitch - 0 - - GeometryConfiguration - - Frame - {{0, 0}, {185, 368}} - GroupTreeTableConfiguration - - MainColumn - 168 - - RubberWindowFrame - 315 424 744 409 0 0 1440 878 - - Module - PBXSmartGroupTreeModule - Proportion - 185pt - - - ContentConfiguration - - PBXProjectModuleGUID - 1CA1AED706398EBD00589147 - PBXProjectModuleLabel - Detail - - GeometryConfiguration - - Frame - {{190, 0}, {554, 368}} - RubberWindowFrame - 315 424 744 409 0 0 1440 878 - - Module - XCDetailModule - Proportion - 554pt - - - Proportion - 368pt - - - MajorVersion - 2 - MinorVersion - 0 - Name - Breakpoints - ServiceClasses - - PBXSmartGroupTreeModule - XCDetailModule - - StatusbarIsVisible - 1 - TableOfContents - - 1CDDB66807F98D9800BB5817 - 1CDDB66907F98D9800BB5817 - 1CE0B1FE06471DED0097A5F4 - 1CA1AED706398EBD00589147 - - ToolbarConfiguration - xcode.toolbar.config.breakpoints - WindowString - 315 424 744 409 0 0 1440 878 - WindowToolGUID - 1CDDB66807F98D9800BB5817 - WindowToolIsVisible - 1 - - - Identifier - windowTool.debugAnimator - Layout - - - Dock - - - Module - PBXNavigatorGroup - Proportion - 100% - - - Proportion - 100% - - - Name - Debug Visualizer - ServiceClasses - - PBXNavigatorGroup - - StatusbarIsVisible - 1 - ToolbarConfiguration - xcode.toolbar.config.debugAnimator - WindowString - 100 100 700 500 0 0 1280 1002 - - - Identifier - windowTool.bookmarks - Layout - - - Dock - - - Module - PBXBookmarksModule - Proportion - 166pt - - - Proportion - 166pt - - - Name - Bookmarks - ServiceClasses - - PBXBookmarksModule - - StatusbarIsVisible - 0 - WindowString - 538 42 401 187 0 0 1280 1002 - - - Identifier - windowTool.classBrowser - Layout - - - Dock - - - BecomeActive - 1 - ContentConfiguration - - OptionsSetName - Hierarchy, all classes - PBXProjectModuleGUID - 1CA6456E063B45B4001379D8 - PBXProjectModuleLabel - Class Browser - NSObject - - GeometryConfiguration - - ClassesFrame - {{0, 0}, {369, 96}} - ClassesTreeTableConfiguration - - PBXClassNameColumnIdentifier - 208 - PBXClassBookColumnIdentifier - 22 - - Frame - {{0, 0}, {616, 353}} - MembersFrame - {{0, 105}, {369, 395}} - MembersTreeTableConfiguration - - PBXMemberTypeIconColumnIdentifier - 22 - PBXMemberNameColumnIdentifier - 216 - PBXMemberTypeColumnIdentifier - 94 - PBXMemberBookColumnIdentifier - 22 - - PBXModuleWindowStatusBarHidden2 - 1 - RubberWindowFrame - 597 125 616 374 0 0 1280 1002 - - Module - PBXClassBrowserModule - Proportion - 354pt - - - Proportion - 354pt - - - Name - Class Browser - ServiceClasses - - PBXClassBrowserModule - - StatusbarIsVisible - 0 - TableOfContents - - 1C78EABA065D492600B07095 - 1C78EABB065D492600B07095 - 1CA6456E063B45B4001379D8 - - ToolbarConfiguration - xcode.toolbar.config.classbrowser - WindowString - 597 125 616 374 0 0 1280 1002 - - - - diff --git a/src/Makefile b/src/Makefile index 1da2da25..ae96bb97 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,6 @@ # Grafx2 - The Ultimate 256-color bitmap paint program # +# Copyright 2011 Franck Charlet # Copyright 2011 Pawel Góralski # Copyright 2009 Per Olofsson # Copyright 2008 Peter Gordon @@ -61,8 +62,8 @@ else #For all other platforms, we can rely on uname PLATFORM = $(shell uname) - #AmigaOS (3 or 4) specific ifeq ($(PLATFORM),AmigaOS) # 1 + #AmigaOS (3 or 4) specific DELCOMMAND = rm -rf MKDIR = mkdir -p RMDIR = rmdir @@ -78,31 +79,33 @@ else else ifeq ($(PLATFORM),Darwin) # 2 - #Mac OS X specific - DELCOMMAND = rm -rf - MKDIR = mkdir -p - RMDIR = rmdir - CP = cp - ZIP = zip - PLATFORMFILES = gfx2.png - BIN = ../bin/grafx2 - # Where the SDL frameworks are located - FWDIR = /Library/Frameworks - SDLCOPT = -arch i386 -I$(FWDIR)/SDL.framework/Headers -I$(FWDIR)/SDL_image.framework/Headers -I$(FWDIR)/SDL_ttf.framework/Headers -D_THREAD_SAFE - SDLLOPT = -arch i386 -L/usr/lib -framework SDL -framework SDL_image -framework SDL_ttf -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 $(SDLCOPT) $(TTFCOPT) -I/usr/X11/include - LOPT = $(SDLLOPT) -L/usr/X11/lib -R/usr/X11/lib -lpng - # Use gcc for compiling. Use ncc to build a callgraph and analyze the code. - CC = gcc - #CC = nccgen -ncgcc -ncld -ncfabs - OBJDIR = ../obj/macosx - PLATFORMOBJ = $(OBJDIR)/SDLMain.o - X11LOPT = - MACAPPEXE = Grafx2.app/Contents/MacOS/Grafx2 + #Mac OS X specific + DELCOMMAND = rm -rf + MKDIR = mkdir -p + RMDIR = rmdir + CP = cp + ZIP = zip + PLATFORMFILES = gfx2.png + BIN = ../bin/grafx2 + # Where the SDL frameworks are located + FWDIR = /Library/Frameworks + SDLCOPT = -arch ppc -I$(FWDIR)/SDL.framework/Headers -I$(FWDIR)/SDL_image.framework/Headers -I$(FWDIR)/SDL_ttf.framework/Headers -D_THREAD_SAFE + #-framework SDL_ttf + SDLLOPT = -arch ppc -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 $(SDLCOPT) $(TTFCOPT) -I/usr/X11/include + LOPT = $(SDLLOPT) -lpng + # Use gcc for compiling. Use ncc to build a callgraph and analyze the code. + CC = gcc + #CC = nccgen -ncgcc -ncld -ncfabs + OBJDIR = ../obj/macosx + PLATFORMOBJ = $(OBJDIR)/SDLMain.o + X11LOPT = + MACAPPEXE = Grafx2.app/Contents/MacOS/Grafx2 + NOTTF = 1 else ifeq ($(PLATFORM),AROS) # 3 - #AROS specific + #AROS specific DELCOMMAND = rm -rf MKDIR = mkdir -p RMDIR = rmdir @@ -118,7 +121,7 @@ else else ifeq ($(PLATFORM),MorphOS) # 4 - #MorphOS specific + #MorphOS specific DELCOMMAND = rm -rf MKDIR = mkdir -p RMDIR = rmdir @@ -134,7 +137,7 @@ else else ifeq ($(PLATFORM),BeOS) # 6 - #BeOS specific + #BeOS specific DELCOMMAND = rm -rf MKDIR = mkdir -p RMDIR = rmdir @@ -148,7 +151,7 @@ else else ifeq ($(PLATFORM),Haiku) # 7 - #Haiku specific + #Haiku specific DELCOMMAND = rm -rf MKDIR = mkdir -p RMDIR = rmdir @@ -159,8 +162,8 @@ else LUACOPT = LUALOPT = else - LUACOPT = -D__ENABLE_LUA__ - LUALOPT = -llua + 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) @@ -170,7 +173,7 @@ else else ifeq ($(PLATFORM),skyos) # 8 - #SkyOS specific + #SkyOS specific DELCOMMAND = rm -rf MKDIR = mkdir -p RMDIR = rmdir @@ -184,50 +187,50 @@ else else ifeq ($(PLATFORM),OSF1) #9 - #OSF1 / tru64 alpha - DELCOMMAND = rm -rf - MKDIR = mkdir -p - RMDIR = rmdir - CP = cp - 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 - OBJDIR = ../obj/unix - X11LOPT = -lX11 - CC = gcc + #OSF1 / tru64 alpha + DELCOMMAND = rm -rf + MKDIR = mkdir -p + RMDIR = rmdir + CP = cp + 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 + OBJDIR = ../obj/unix + X11LOPT = -lX11 + CC = gcc 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 - MKDIR = mkdir -p - RMDIR = rmdir - CP = cp - ZIP = zip - PLATFORMFILES = gfx2.png - ifneq ($(ATARICROSS),1) + # 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 + MKDIR = mkdir -p + RMDIR = rmdir + CP = cp + ZIP = zip + PLATFORMFILES = gfx2.png + ifneq ($(ATARICROSS),1) ifeq ($(NOLUA),1) LUACOPT = LUALOPT = else - LUACOPT = `pkg-config lua --cflags --silence-errors ||pkg-config lua5.1 --cflags --silence-errors ||pkg-config lua-5.1 --cflags` - LUALOPT = `pkg-config lua --libs --silence-errors ||pkg-config lua5.1 --libs --silence-errors ||pkg-config lua-5.1 --libs` + LUACOPT = `pkg-config lua --cflags --silence-errors ||pkg-config lua5.1 --cflags --silence-errors ||pkg-config lua-5.1 --cflags` + LUALOPT = `pkg-config lua --libs --silence-errors ||pkg-config lua5.1 --libs --silence-errors ||pkg-config lua-5.1 --libs` endif - endif - # These can only be used under linux and maybe freebsd. They allow to compile for the gp2x or to create a windows binary - ifdef WIN32CROSS - #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) - OBJDIR = ../obj/win32 - PLATFORM = win32 - else + endif + + # These can only be used under linux and maybe freebsd. They allow to compile for the gp2x or to create a windows binary + ifdef WIN32CROSS + #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) + OBJDIR = ../obj/win32 + PLATFORM = win32 + else ifdef GP2XCROSS - #cross compile an exec for the gp2x CC = /opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin/arm-open2x-linux-gcc BIN = ../bin/grafx2.gpe @@ -239,28 +242,30 @@ else STRIP = /opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin/arm-open2x-linux-strip JOYCOPT = -DUSE_JOYSTICK - else ifdef AROS32CROSS - #cross compile an Aros 32 bit executable + else + ifdef AROS32CROSS + #cross compile an Aros 32 bit executable BIN = ../bin/grafx2 COPT = -Wall -g `i386-linux-aros-sdl-config --cflags` $(TTFCOPT) LOPT = -lSDL_image `i386-linux-aros-sdl-config --libs` -lpng -ljpeg -lz $(TTFLOPT) -lfreetype2shared CC = i386-aros-gcc OBJDIR = ../obj/aros - STRIP = strip --strip-unneeded --remove-section .comment + STRIP = strip --strip-unneeded --remove-section .comment PLATFORM = AROS ZIP = lha ZIPOPT = a - else ifdef ATARICROSS + else + ifdef ATARICROSS #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 -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 # Compiles a regular linux executable for the native platform @@ -274,6 +279,9 @@ else X11LOPT = -lX11 endif endif + endif + endif + endif endif endif @@ -284,33 +292,34 @@ else endif endif -### BUILD SETTINGS are set according to vars set in the platform selection, the "overridable defaults", and environment variables set before launching make +### BUILD SETTINGS are set according to vars set in the platform selection, +### the "overridable defaults", and environment variables set before launching make #TrueType is optional: make NOTTF=1 to disable support and dependencies. ifndef ($(ATARICROSS,1)) -ifeq ($(NOTTF),1) - TTFCOPT = -DNOTTF=1 - TTFLOPT = - TTFLIBS = - TTFLABEL = -nottf + ifeq ($(NOTTF),1) + TTFCOPT = -DNOTTF=1 + TTFLOPT = + TTFLIBS = + TTFLABEL = -nottf + else + TTFCOPT = + TTFLOPT = -L$(prefix)/lib -lSDL_ttf $(X11LOPT) + TTFLIBS = bin/libfreetype-6.dll bin/SDL_ttf.dll + TTFLABEL = + endif else - TTFCOPT = - TTFLOPT = -L$(prefix)/lib -lSDL_ttf $(X11LOPT) - TTFLIBS = bin/libfreetype-6.dll bin/SDL_ttf.dll - TTFLABEL = -endif -else -ifeq ($(NOTTF),1) - TTFCOPT = -DNOTTF=1 - TTFLOPT = - TTFLIBS = - TTFLABEL = -nottf -else - TTFCOPT = - TTFLOPT = -L$(prefix)/lib -lSDL_ttf $(X11LOPT) - TTFLIBS = - TTFLABEL = -endif + ifeq ($(NOTTF),1) + TTFCOPT = -DNOTTF=1 + TTFLOPT = + TTFLIBS = + TTFLABEL = -nottf + else + TTFCOPT = + TTFLOPT = -L$(prefix)/lib -lSDL_ttf $(X11LOPT) + TTFLIBS = + TTFLABEL = + endif endif #Lua scripting is optional too @@ -377,9 +386,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 -Rp $(FWDIR)/SDL.framework Grafx2.app/Contents/Frameworks - cp -Rp $(FWDIR)/SDL_image.framework Grafx2.app/Contents/Frameworks - cp -Rp $(FWDIR)/SDL_ttf.framework Grafx2.app/Contents/Frameworks + 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 + 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 + rm -fr Grafx2.app/Contents/Frameworks/SDL_image.framework/Versions/A/Resources +# rm -fr Grafx2.app/Contents/Frameworks/SDL_ttf.framework/Versions +# rm -fr Grafx2.app/Contents/Frameworks/SDL_ttf.framework/Versions cp $(BIN) $(MACAPPEXE) else all : $(BIN) diff --git a/src/init.c b/src/init.c index 2ff75c27..8be7e423 100644 --- a/src/init.c +++ b/src/init.c @@ -2512,7 +2512,7 @@ void Set_config_defaults(void) { int index, index2; - // Raccourcis clavier + // Keyboard shortcuts for (index=0; index>8) @@ -2550,7 +2550,7 @@ void Set_config_defaults(void) Shade_list[Shade_current].Mode, Shade_table_left,Shade_table_right); - // Masque + // Mask for (index=0; index<256; index++) Mask_table[index]=0; @@ -2577,7 +2577,7 @@ void Set_config_defaults(void) Quick_shade_step=1; Quick_shade_loop=0; - // Grille + // Grid Snap_width=Snap_height=8; Snap_offset_X=Snap_offset_Y=0; @@ -2588,6 +2588,7 @@ void Set_config_defaults(void) #if defined(__WIN32__) #define SIGHANDLER_T __p_sig_fn_t #elif defined(__macosx__) + typedef void (*sig_t) (int); #define SIGHANDLER_T sig_t #else #define SIGHANDLER_T __sighandler_t diff --git a/src/mountlist.c b/src/mountlist.c index 2912918c..113a4d34 100644 --- a/src/mountlist.c +++ b/src/mountlist.c @@ -25,6 +25,9 @@ // We don't use autoconf and all that in grafx2, so let's do the config here ... #if defined(__macosx__) || defined(__FreeBSD__) // MacOS X is POSIX compliant #define MOUNTED_GETMNTINFO +#if defined(__macosx__) + #include +#endif #elif defined(__NetBSD__) #define MOUNTED_GETMNTINFO2 #elif defined(__BEOS__) || defined(__HAIKU__) diff --git a/src/readline.c b/src/readline.c index 89ebc17a..cc7900be 100644 --- a/src/readline.c +++ b/src/readline.c @@ -39,6 +39,7 @@ #include "readline.h" #include "windows.h" #include "input.h" +#include "engine.h" // Virtual keyboard is mandatory on these platforms: #if defined(__GP2X__) || defined(__WIZ__) || defined(__CAANOO__) diff --git a/src/text.c b/src/text.c index 42bf09c4..9c0258c6 100644 --- a/src/text.c +++ b/src/text.c @@ -39,15 +39,17 @@ #if defined(__CAANOO__) || defined(__WIZ__) || defined(__GP2X__) // No X11 -#elif defined(__macosx__) - #include - #import - #import #elif defined(__linux__) #include #endif #endif +#if defined(__macosx__) + #include + #import + #import +#endif + #include #include "SFont.h" From 431484914e84e1e7fa67b31b99da35dcc4666489 Mon Sep 17 00:00:00 2001 From: Franck Charlet Date: Thu, 10 Mar 2011 22:16:42 +0000 Subject: [PATCH 20/46] more work done on Mac OSX version git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1752 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- Info.plist | 2 +- src/.DS_Store | Bin 21508 -> 21508 bytes src/Grafx2.icns | Bin 0 -> 15824 bytes src/Makefile | 17 +++++++++++++---- src/buttons.c | 2 +- src/fileformats.c | 3 +++ src/helpfile.h | 2 +- 7 files changed, 19 insertions(+), 7 deletions(-) create mode 100755 src/Grafx2.icns diff --git a/Info.plist b/Info.plist index b5d2a5aa..b2bfa1c1 100644 --- a/Info.plist +++ b/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable Grafx2 CFBundleIconFile - + Grafx2.icns CFBundleIdentifier com.googlecode.grafx2 CFBundleInfoDictionaryVersion diff --git a/src/.DS_Store b/src/.DS_Store index 099fb4721c4cfba42cfeb65bda70b5ee7d2278e3..6f0fb88d3ef427d0597c2df68b9fad8040d488a5 100644 GIT binary patch delta 352 zcmZut!AiqG6r43FO-V{y#9kB{NTCry+Y&HG5wv*p;=M_<6r&M~*xpMI^~tZf3tRb8-DX2R)hu;adoBxCS@u9%Enz_Q7+q?I2yux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6y1L(?zb_(7lgcKp>3hQGexH8)3-d1td9jBL2Y;uK ztolXq4?E^RRsGhVy%E2aJn`vgs@3GsiBHbN$>IN+n;c6p26HhX|w!riG$2*dwFgbn)&yz1c#i4jIgmQZ3_XDHLliXiSp06fXCO`W9ztK5)tSL#p_v$luB=g_< z>ER?vDxcwI7k_@>QyEHS9uQ>f#&!_{#jc zr#t35o;f}Lch7Ys$+LKQ8p)(^^#tzvJWP;xFBosa)rqA&Q+6qv$NPzp&|jPxv; zcpYdEHd%T}r*eB~owp^MNVBiWgJVApl)hUz_Wje(|I3G8K2Uk%;v3H=FJ1Y!E6*i= z|I_iGO6fI~h53%S5MQ$~Ux+(C*S_lu`tKOYl54HT_kwHf68^6(7Yp1Jo+JwemH}TV zuq^mBfn~yL0?USbfm?t};FjP?a__Gt`nQDNL( zACJ`=E2-YZpL^Yn0G6@q1JZK4(zEv0P?|RnW u{-Vu++JDDjJT6YjlI3FNt*n+PT4HF)lK+UiMEBD5685r}OB7=_)%?HZ^mM)e literal 0 HcmV?d00001 diff --git a/src/Makefile b/src/Makefile index ae96bb97..79cc11ba 100644 --- a/src/Makefile +++ b/src/Makefile @@ -32,6 +32,10 @@ # Compile with OPTIM=0 to disable gcc optimizations, to enable debug. STRIP = strip +### Specific to build MAC OS X universal binaries on Tiger ### +### (may need to be changed on your OS) ### + +MACOSX_SYSROOT = /Developer/SDKs/MacOSX10.4u.sdk ### PLATFORM DETECTION AND CONFIGURATION ### @@ -83,17 +87,19 @@ else DELCOMMAND = rm -rf MKDIR = mkdir -p RMDIR = rmdir + # Force it + #OPTIM = 3 CP = cp ZIP = zip PLATFORMFILES = gfx2.png - BIN = ../bin/grafx2 # Where the SDL frameworks are located FWDIR = /Library/Frameworks - SDLCOPT = -arch ppc -I$(FWDIR)/SDL.framework/Headers -I$(FWDIR)/SDL_image.framework/Headers -I$(FWDIR)/SDL_ttf.framework/Headers -D_THREAD_SAFE + BIN = ../bin/grafx2 + SDLCOPT = -arch ppc -arch i386 -I$(FWDIR)/SDL.framework/Headers -I$(FWDIR)/SDL_image.framework/Headers -I$(FWDIR)/SDL_ttf.framework/Headers -D_THREAD_SAFE #-framework SDL_ttf - SDLLOPT = -arch ppc -L/usr/lib -framework SDL -framework SDL_image -framework Cocoa -framework Carbon -framework OpenGL + SDLLOPT = -isysroot $(MACOSX_SYSROOT) -arch ppc -arch i386 -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 $(SDLCOPT) $(TTFCOPT) -I/usr/X11/include - LOPT = $(SDLLOPT) -lpng + LOPT = $(SDLLOPT) -lpng -lz # Use gcc for compiling. Use ncc to build a callgraph and analyze the code. CC = gcc #CC = nccgen -ncgcc -ncld -ncfabs @@ -382,6 +388,7 @@ $(MACAPPEXE) : $(BIN) mkdir -p Grafx2.app Grafx2.app/Contents Grafx2.app/Contents/Frameworks Grafx2.app/Contents/MacOS Grafx2.app/Contents/Resources echo 'APPL????' > Grafx2.app/Contents/PkgInfo cp ../Info.plist Grafx2.app/Contents + cp -r Grafx2.icns Grafx2.app/Contents/Resources cp -r English.lproj Grafx2.app/Contents/Resources cp -r ../share/grafx2/fonts Grafx2.app/Contents/Resources cp -r ../share/grafx2/skins Grafx2.app/Contents/Resources @@ -399,6 +406,8 @@ $(MACAPPEXE) : $(BIN) # rm -fr Grafx2.app/Contents/Frameworks/SDL_ttf.framework/Versions # rm -fr Grafx2.app/Contents/Frameworks/SDL_ttf.framework/Versions cp $(BIN) $(MACAPPEXE) + $(STRIP) -x -X -S $(MACAPPEXE) + chmod +x $(MACAPPEXE) else all : $(BIN) endif diff --git a/src/buttons.c b/src/buttons.c index ee99605b..2d43c572 100644 --- a/src/buttons.c +++ b/src/buttons.c @@ -169,7 +169,7 @@ void Button_Message_initial(void) for (x=14,x_pos=0; x_pos<231; x_pos++,x++) Pixel_in_window(x,y,Gfx->Logo_grafx2[offs_y+x_pos]); - Print_in_window(130-4*26,88,"Copyright (c) 2007-2010 by",MC_Dark,MC_Light); + Print_in_window(130-4*26,88,"Copyright (c) 2007-2011 by",MC_Dark,MC_Light); Print_in_window(130-4*23,96,"the Grafx2 project team",MC_Black,MC_Light); Print_in_window(130-4*26,112,"Copyright (c) 1996-2001 by",MC_Dark,MC_Light); Print_in_window(130-4*13,120,"Sunset Design",MC_Black,MC_Light); diff --git a/src/fileformats.c b/src/fileformats.c index 163e4e45..4f6b1d1b 100644 --- a/src/fileformats.c +++ b/src/fileformats.c @@ -28,6 +28,9 @@ #ifndef __no_pnglib__ #include +#if !defined(PNG_HAVE_PLTE) +#define PNG_HAVE_PLTE 0x02 +#endif #if (PNG_LIBPNG_VER_MAJOR <= 1) && (PNG_LIBPNG_VER_MINOR < 4) // Compatibility layer to allow us to use libng 1.4 or any older one. diff --git a/src/helpfile.h b/src/helpfile.h index 4d95e3ca..e878af88 100644 --- a/src/helpfile.h +++ b/src/helpfile.h @@ -67,7 +67,7 @@ static const T_Help_table helptable_about[] = #else HELP_TEXT ("") #endif - HELP_TEXT ("Copyright 2007-2010, the Grafx2 project team") + HELP_TEXT ("Copyright 2007-2011, the Grafx2 project team") HELP_TEXT (" Copyright 1996-2001, SUNSET DESIGN") }; static const T_Help_table helptable_licence[] = From a5fc3d9fec5e931ee03d45ec03db7e762544d552 Mon Sep 17 00:00:00 2001 From: Franck Charlet Date: Thu, 10 Mar 2011 23:38:38 +0000 Subject: [PATCH 21/46] new OSX version should be ready git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1753 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/.DS_Store | Bin 21508 -> 24580 bytes src/Makefile | 7 ++++--- src/SDLMain.m | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/.DS_Store b/src/.DS_Store index 6f0fb88d3ef427d0597c2df68b9fad8040d488a5..800eb5af569ded69ea499608d60d1d381a2406b5 100644 G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<7M4vFA5uKgqNT>sPl*Jwh1&QoGu^25VONigmWx*SoaM_>FkC zF8nTgQ?i<5pWXOTDZ^aH7!}Ijer3javR{KRyx3L|ubPawLqthNor2nHKH4_tSKHRb z??mRQ)H7JzC{(7gweig?BkN80&g}A0zpS0{$Gk4>6brp$fJadF6#Vv&-~ZoT{rf*L z@{=pz3j9A6C^q*V?A<|b)pzSjmK(U!!RrgWX!8qRJn&v1IMIav$k*|>%4!kUcX*!% z-tSh|^YV&2IR1qn0{Hyz^S}H|tSy0aw5ka0OfeSHKl;1zZ7Fz!h)> rTme_W6>tSy0aw5ka0OfeSHKl;1zZ7Fz!h)>Tme_W6>tUqdkXvo9aGw! diff --git a/src/Makefile b/src/Makefile index 79cc11ba..325880b8 100644 --- a/src/Makefile +++ b/src/Makefile @@ -33,9 +33,10 @@ STRIP = strip ### Specific to build MAC OS X universal binaries on Tiger ### -### (may need to be changed on your OS) ### +### (may need to be changed or removed depedning on the OSX version) ### MACOSX_SYSROOT = /Developer/SDKs/MacOSX10.4u.sdk +MACOSX_ARCH = -arch ppc -arch i386 ### PLATFORM DETECTION AND CONFIGURATION ### @@ -95,9 +96,9 @@ else # Where the SDL frameworks are located FWDIR = /Library/Frameworks BIN = ../bin/grafx2 - SDLCOPT = -arch ppc -arch i386 -I$(FWDIR)/SDL.framework/Headers -I$(FWDIR)/SDL_image.framework/Headers -I$(FWDIR)/SDL_ttf.framework/Headers -D_THREAD_SAFE + 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) -arch ppc -arch i386 -L/usr/lib -framework SDL -framework SDL_image -framework Cocoa -framework Carbon -framework OpenGL + 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 $(SDLCOPT) $(TTFCOPT) -I/usr/X11/include LOPT = $(SDLLOPT) -lpng -lz # Use gcc for compiling. Use ncc to build a callgraph and analyze the code. diff --git a/src/SDLMain.m b/src/SDLMain.m index 5274d96c..06b858aa 100644 --- a/src/SDLMain.m +++ b/src/SDLMain.m @@ -82,7 +82,7 @@ static NSString *getApplicationName(void) if (NSKeyDown == [anEvent type] || NSKeyUp == [anEvent type]) { if ([anEvent modifierFlags] & NSCommandKeyMask) { - SDL_SetModState(SDL_GetModState() | KMOD_META); +// SDL_SetModState(SDL_GetModState() /*| KMOD_META*/); [super sendEvent: anEvent]; } } else From ec6fa4eab026e7908f63161924f39267bc4455fd Mon Sep 17 00:00:00 2001 From: Franck Charlet Date: Fri, 11 Mar 2011 22:54:11 +0000 Subject: [PATCH 22/46] Added support for LUA in Mac OS X version git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1754 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/.DS_Store | Bin 24580 -> 24580 bytes src/Makefile | 11 ++++++----- src/graph.h | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/.DS_Store b/src/.DS_Store index 800eb5af569ded69ea499608d60d1d381a2406b5..c275b5884d3150812635b82fb03e7643fb44866d 100644 GIT binary patch delta 226 zcmZoUz}Rwtae@>RL;FM-W5zWT1I#BIxUfv-W|W@1M_+z&Dxw&Q$gE@mKgE3Gf7bu&|kk3#I zRH4UE#gNHR;F*)3j4+jHIRgVr(Buu83X|t(Ix{Z_@19(suDh9EYZmL|oBDi=dXohh zLpSpq1aNPT)%IbT{MTL<=-kaR4k|2+43lkmq$kI?ESy}ZV>7whRBG~9EB?&_ri+<2 Mi+FqxpV+_;0MW}kng9R* delta 153 zcmZoUz}Rwtae@>RBgaG;W5(4J1I#BYFg8p!aABF)Ej?L9$bRBc-N_SFMJE3+h~F&4 z$i%jpouff>4n_tBh6W&>?BTL?v%e_^^JXEBPvSrq@B#pjqb+~{ diff --git a/src/Makefile b/src/Makefile index 325880b8..36540e2a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -89,7 +89,7 @@ else MKDIR = mkdir -p RMDIR = rmdir # Force it - #OPTIM = 3 + OPTIM = 3 CP = cp ZIP = zip PLATFORMFILES = gfx2.png @@ -99,8 +99,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 $(SDLCOPT) $(TTFCOPT) -I/usr/X11/include - LOPT = $(SDLLOPT) -lpng -lz + 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 # Use gcc for compiling. Use ncc to build a callgraph and analyze the code. CC = gcc #CC = nccgen -ncgcc -ncld -ncfabs @@ -375,7 +375,7 @@ SKIN_FILES = ../share/grafx2/skins/skin_classic.png ../share/grafx2/skins/skin_m SCRIPT_FILES1 = ../share/grafx2/scripts/bru_db_Amigaball.lua ../share/grafx2/scripts/bru_db_ColorSphere.lua ../share/grafx2/scripts/bru_db_FindAA.lua ../share/grafx2/scripts/bru_db_Fisheye.lua ../share/grafx2/scripts/bru_db_GrayscaleAvg.lua ../share/grafx2/scripts/bru_db_GrayscaleDesat.lua ../share/grafx2/scripts/bru_db_Halfsmooth.lua ../share/grafx2/scripts/bru_db_Mandelbrot.lua ../share/grafx2/scripts/bru_db_Waves.lua ../share/grafx2/scripts/pal_db_Desaturate.lua ../share/grafx2/scripts/pal_db_ExpandColors.lua ../share/grafx2/scripts/pal_db_FillColorCube.lua ../share/grafx2/scripts/pal_db_InvertedRGB.lua ../share/grafx2/scripts/pal_db_Set3bit.lua ../share/grafx2/scripts/pal_db_Set6bit.lua ../share/grafx2/scripts/pal_db_SetC64Palette.lua ../share/grafx2/scripts/pal_db_ShiftHue.lua ../share/grafx2/scripts/pic_db_Pic2isometric.lua ../share/grafx2/scripts/pic_db_Rainbow-Dark2Bright.lua ../share/grafx2/scripts/pic_db_SierpinskyCarpet.lua SCRIPT_FILES2 = ../share/grafx2/scripts/pic_db_SierpinskyTriangle.lua ../share/grafx2/scripts/pic_ni_GlassGridFilter.lua ../share/grafx2/scripts/scn_db_RemapImage2RGB.lua ../share/grafx2/scripts/scn_db_RemapImage2RGB_ed.lua ../share/grafx2/scripts/scn_db_RemapImageTo3bitPal.lua -SCRIPT_FILES= $(SCRIPT_FILES1) $(SCRIPT_FILES2) +SCRIPT_FILES = $(SCRIPT_FILES1) $(SCRIPT_FILES2) SCRIPTLIB_FILES = ../share/grafx2/scripts/libs/memory.lua @@ -386,7 +386,7 @@ ifeq ($(PLATFORM),Darwin) 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 + mkdir -p Grafx2.app Grafx2.app/Contents Grafx2.app/Contents/Frameworks Grafx2.app/Contents/MacOS Grafx2.app/Contents/Resources Grafx2.app/Contents/Resources/scripts echo 'APPL????' > Grafx2.app/Contents/PkgInfo cp ../Info.plist Grafx2.app/Contents cp -r Grafx2.icns Grafx2.app/Contents/Resources @@ -394,6 +394,7 @@ $(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 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 diff --git a/src/graph.h b/src/graph.h index 34a6f634..efa74664 100644 --- a/src/graph.h +++ b/src/graph.h @@ -58,6 +58,8 @@ void Pixel_figure_preview_xor(word x_pos,word y_pos,byte color); void Pixel_figure_preview_xorback(word x_pos,word y_pos,byte color); void Pixel_figure_in_brush(word x_pos,word y_pos,byte color); +void Draw_empty_circle_general(short center_x,short center_y,short radius,byte color); + void Draw_empty_circle_permanent(short center_x,short center_y,short radius,byte color); void Draw_empty_circle_preview (short center_x,short center_y,short radius,byte color); void Hide_empty_circle_preview (short center_x,short center_y,short radius); From 48c11e15a6b2e3fdfbca8a1e37b03419af269537 Mon Sep 17 00:00:00 2001 From: Franck Charlet Date: Fri, 11 Mar 2011 23:03:23 +0000 Subject: [PATCH 23/46] fixed a typo in makefile git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1755 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 36540e2a..725754f8 100644 --- a/src/Makefile +++ b/src/Makefile @@ -100,7 +100,7 @@ else #-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 + LOPT = $(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 From 64e39cda85ba34cebc38fd31828dc1e131aaffb5 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sun, 13 Mar 2011 00:52:51 +0000 Subject: [PATCH 24/46] Lua: fix crash of the new drawing primitives (drawcircle, drawdisk, drawfilledrect, drawline) when outside view area git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1756 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/Makefile.dep | 5 +++- src/factory.c | 72 ++++++++++++++++++++++++++++++++++++++++++------ src/graph.c | 1 - src/graph.h | 1 + 4 files changed, 69 insertions(+), 10 deletions(-) diff --git a/src/Makefile.dep b/src/Makefile.dep index 27c8461b..0059f24d 100644 --- a/src/Makefile.dep +++ b/src/Makefile.dep @@ -61,6 +61,9 @@ $(OBJDIR)/pages.o: pages.c global.h struct.h const.h pages.h errors.h loadsave.h $(OBJDIR)/palette.o: palette.c const.h struct.h global.h misc.h engine.h readline.h \ buttons.h pages.h help.h sdlscreen.h errors.h op_c.h windows.h input.h \ palette.h shade.h +$(OBJDIR)/palette_test.o: palette_test.c const.h struct.h global.h misc.h engine.h \ + readline.h buttons.h pages.h help.h sdlscreen.h errors.h op_c.h \ + windows.h input.h palette.h shade.h $(OBJDIR)/pversion.o: pversion.c $(OBJDIR)/pxdouble.o: pxdouble.c global.h struct.h const.h sdlscreen.h misc.h \ graph.h pxdouble.h pxwide.h @@ -81,7 +84,7 @@ $(OBJDIR)/pxwide2.o: pxwide2.c global.h struct.h const.h sdlscreen.h misc.h grap $(OBJDIR)/readini.o: readini.c const.h errors.h global.h struct.h misc.h readini.h \ setup.h $(OBJDIR)/readline.o: readline.c const.h struct.h global.h misc.h errors.h \ - sdlscreen.h readline.h windows.h input.h + sdlscreen.h readline.h windows.h input.h engine.h $(OBJDIR)/realpath.o: realpath.c $(OBJDIR)/saveini.o: saveini.c const.h global.h struct.h readini.h io.h errors.h \ misc.h saveini.h setup.h diff --git a/src/factory.c b/src/factory.c index 50b5674c..a31a6312 100644 --- a/src/factory.c +++ b/src/factory.c @@ -42,6 +42,7 @@ #include "palette.h" #include "input.h" // Is_shortcut() #include "help.h" // Window_help() +#include "graph.h" /// Lua scripts bound to shortcut keys. char * Bound_script[10]; @@ -148,6 +149,13 @@ void Update_colors_during_script(void) } } +/// Paint a pixel in image without updating the screen +void Pixel_figure_no_screen(short x_pos,short y_pos,byte color) +{ + if (x_pos>0 && y_pos >0 && x_posx1) + { + min_x=x1; + max_x=x2; + } + else + { + min_x=x2; + max_x=x1; + } + if (y2>y1) + { + min_y=y1; + max_y=y2; + } + else + { + min_y=y2; + max_y=y1; + } + // Clipping limits + if (max_x>Main_image_width) + max_x=Main_image_width-1; + if (max_y>Main_image_height) + max_y=Main_image_height-1; + if (min_x<0) + min_x=0; + if (min_y<0) + min_y=0; + + // Perform drawing + for (y_pos=min_y; y_pos<=max_y;y_pos++) + for (x_pos=min_x; x_pos<=max_x;x_pos++) + Pixel_in_current_screen(x_pos,y_pos,c,0); return 0; + } @@ -400,7 +444,7 @@ int L_DrawCircle(lua_State* L) LUA_ARG_NUMBER(3, "drawcircle", r, INT_MIN, INT_MAX); LUA_ARG_NUMBER(4, "drawcircle", c, INT_MIN, INT_MAX); - Pixel_figure = Display_pixel; + Pixel_figure = (void (*) (word,word,byte))Pixel_figure_no_screen; Circle_limit = r*r; Draw_empty_circle_general(x1, y1, r, c); @@ -410,18 +454,30 @@ int L_DrawCircle(lua_State* L) int L_DrawDisk(lua_State* L) { - int x1, y1, r, c; + int center_x, center_y, r, c; + long circle_limit; + short x_pos,y_pos; + short min_x,max_x,min_y,max_y; int nb_args = lua_gettop(L); LUA_ARG_LIMIT(4, "drawdisk"); - LUA_ARG_NUMBER(1, "drawdisk", x1, INT_MIN, INT_MAX); - LUA_ARG_NUMBER(2, "drawdisk", y1, INT_MIN, INT_MAX); + 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(4, "drawdisk", c, INT_MIN, INT_MAX); - Circle_limit = r*r; - Draw_filled_circle(x1, y1, r, c); + circle_limit = r*r; + + // Compute clipping limits + min_x=center_x-r<0 ? 0 : center_x-r; + 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; + 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++) + for (x_pos=min_x;x_pos<=max_x;x_pos++) + Pixel_in_current_screen(x_pos,y_pos,c,0); return 0; } diff --git a/src/graph.c b/src/graph.c index 077e062e..06c99716 100644 --- a/src/graph.c +++ b/src/graph.c @@ -1275,7 +1275,6 @@ void Draw_empty_circle_general(short center_x,short center_y,short radius,byte c Pixel_figure(center_x+radius,center_y,color); // Droite Pixel_figure(center_x,center_y+radius,color); // Bas - if(Main_magnifier_mode) Update_part_of_screen(center_x-radius,center_y-radius,2*radius+1,2*radius+1); } // -- Tracé définitif d'un cercle vide -- diff --git a/src/graph.h b/src/graph.h index efa74664..70c49d3c 100644 --- a/src/graph.h +++ b/src/graph.h @@ -63,6 +63,7 @@ void Draw_empty_circle_general(short center_x,short center_y,short radius,byte c void Draw_empty_circle_permanent(short center_x,short center_y,short radius,byte color); void Draw_empty_circle_preview (short center_x,short center_y,short radius,byte color); 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); void Draw_empty_ellipse_permanent(short center_x,short center_y,short horizontal_radius,short vertical_radius,byte color); From c16d9dab4c994f37d8081514365f7edd41b2863c Mon Sep 17 00:00:00 2001 From: Franck Charlet Date: Wed, 16 Mar 2011 21:13:54 +0000 Subject: [PATCH 25/46] added automatic archive generation on OSX git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1757 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/.DS_Store | Bin 24580 -> 24580 bytes src/Makefile | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/.DS_Store b/src/.DS_Store index c275b5884d3150812635b82fb03e7643fb44866d..98526fb477415d5c1242b5006c69f7d887171057 100644 GIT binary patch delta 223 zcmZoUz}Rwtae@>RBgaG;W5%@;1I#BYFg8p!aABF)Ej4+szQe?$x|44h@J`M(NS*vk zUvRSm<0sb5>>O7VRb?5{8HyMZ8PXUk7>pQnfmn~hn4z2@lc4~}GGs7kFl8{EyiBu? zDQec_0(ITZ$y#|#%nL%}fgJtGrn-WgMRcb#u`_^y{=^BUlUM5tO;#3in0(WKXLGKB xGxz2WZBIrF9g|rdM1k(zEaRZU!odjC-2lXsJzTbKK5fFz3~{8#6LFwFxB-iXKPvzL delta 176 zcmZoUz}Rwtae@>RL;FM-W5zWT1I#BIxUfv-W|W%zRgizOfq~%UR7PE)q@4UD1_lNJ z1_nkiAh!7bf3u(mGy7(Cjw_0jGqpq~duh2ag?DeBpf#ImGQYCH=4jnjOp}EfgC?^x z@iFR67GM0?mT^#FVPu$W!y`R8#%1ATLu;GK|4pSf Rx0-HZ+AQMnL40BZKL9%GGJya9 diff --git a/src/Makefile b/src/Makefile index 725754f8..a3549238 100644 --- a/src/Makefile +++ b/src/Makefile @@ -96,6 +96,7 @@ else # Where the SDL frameworks are located FWDIR = /Library/Frameworks BIN = ../bin/grafx2 + SVN_REVISION = $(shell svnversion | tr -d "M") 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 @@ -405,11 +406,11 @@ $(MACAPPEXE) : $(BIN) rm -fr Grafx2.app/Contents/Frameworks/SDL.framework/Versions/A/Resources rm -fr Grafx2.app/Contents/Frameworks/SDL_image.framework/Versions/A/Headers rm -fr Grafx2.app/Contents/Frameworks/SDL_image.framework/Versions/A/Resources -# rm -fr Grafx2.app/Contents/Frameworks/SDL_ttf.framework/Versions # rm -fr Grafx2.app/Contents/Frameworks/SDL_ttf.framework/Versions cp $(BIN) $(MACAPPEXE) $(STRIP) -x -X -S $(MACAPPEXE) chmod +x $(MACAPPEXE) + tar cvzf grafx2-$(SVN_REVISION)-macosx.tgz Grafx2.app/* else all : $(BIN) endif From 14e891f3e6444ae68de48358b16b9c1aed93688d Mon Sep 17 00:00:00 2001 From: Franck Charlet Date: Wed, 16 Mar 2011 21:58:04 +0000 Subject: [PATCH 26/46] using cut instead of tr to extract svn revision to generate archive name git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1758 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index a3549238..c2aef751 100644 --- a/src/Makefile +++ b/src/Makefile @@ -96,7 +96,7 @@ else # Where the SDL frameworks are located FWDIR = /Library/Frameworks BIN = ../bin/grafx2 - SVN_REVISION = $(shell svnversion | tr -d "M") + SVN_REVISION = $(shell svnversion | cut -f1 -d ":" -) 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 @@ -410,7 +410,7 @@ $(MACAPPEXE) : $(BIN) cp $(BIN) $(MACAPPEXE) $(STRIP) -x -X -S $(MACAPPEXE) chmod +x $(MACAPPEXE) - tar cvzf grafx2-$(SVN_REVISION)-macosx.tgz Grafx2.app/* + tar cvzf grafx2-svn$(SVN_REVISION)-macosx.tgz Grafx2.app/* else all : $(BIN) endif From 92b76f2126455c18b70fe53731ee3f9300173fa5 Mon Sep 17 00:00:00 2001 From: Franck Charlet Date: Wed, 16 Mar 2011 22:08:40 +0000 Subject: [PATCH 27/46] svn files excluded from archivbe OSX building git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1759 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index c2aef751..bbd0fd62 100644 --- a/src/Makefile +++ b/src/Makefile @@ -96,7 +96,7 @@ else # Where the SDL frameworks are located FWDIR = /Library/Frameworks BIN = ../bin/grafx2 - SVN_REVISION = $(shell svnversion | cut -f1 -d ":" -) + SVN_REVISION = $(shell svnversion | cut -f2 -d ":" - | tr -d "M") 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 @@ -410,7 +410,7 @@ $(MACAPPEXE) : $(BIN) cp $(BIN) $(MACAPPEXE) $(STRIP) -x -X -S $(MACAPPEXE) chmod +x $(MACAPPEXE) - tar cvzf grafx2-svn$(SVN_REVISION)-macosx.tgz Grafx2.app/* + tar cvzf grafx2-svn$(SVN_REVISION)-macosx.tgz --exclude '*svn*' --exclude '*DS_Store*' Grafx2.app/* else all : $(BIN) endif From 9f8dada2b0694f8f590779dcf12fa975d3028133 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Wed, 23 Mar 2011 20:13:12 +0000 Subject: [PATCH 28/46] Lua window: Fix inconsistency of 'parent directory' appearance. Now applies the 'show hidden files/dirs' settings too. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1760 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/buttons.c | 7 ------- src/factory.c | 15 +++++++++++---- src/filesel.c | 9 ++------- src/io.c | 28 +++++++++++++++++++++++----- src/io.h | 3 +++ 5 files changed, 39 insertions(+), 23 deletions(-) diff --git a/src/buttons.c b/src/buttons.c index 2d43c572..0ab8c362 100644 --- a/src/buttons.c +++ b/src/buttons.c @@ -25,14 +25,11 @@ #include #include #include - #define isHidden(x) (0) #elif defined(__WIN32__) #include #include - #define isHidden(x) (GetFileAttributesA((x)->d_name)&FILE_ATTRIBUTE_HIDDEN) #else #include - #define isHidden(x) ((x)->d_name[0]=='.') #endif #define _XOPEN_SOURCE 500 @@ -82,18 +79,14 @@ #if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) #include #include - #define isHidden(x) (0) #elif defined(__MINT__) #include #include - #define isHidden(x) (0) #elif defined(__WIN32__) #include #include - #define isHidden(x) (GetFileAttributesA((x)->d_name)&FILE_ATTRIBUTE_HIDDEN) #else #include - #define isHidden(x) ((x)->d_name[0]=='.') #endif extern char Program_version[]; // generated in pversion.c diff --git a/src/factory.c b/src/factory.c index a31a6312..de18f4c9 100644 --- a/src/factory.c +++ b/src/factory.c @@ -1388,8 +1388,8 @@ void Add_script(const char *name, byte is_file, byte is_directory, byte is_hidde if (len<=4 || strcasecmp(file_name+len-4, ".lua")) return; // Hidden - //if (is_hidden && !Config.Show_hidden_files) - // return; + if (is_hidden && !Config.Show_hidden_files) + return; Add_element_to_list(&Scripts_selector, file_name, Format_filename(file_name, NAME_WIDTH+1, 0), 0, ICON_NONE); } @@ -1398,9 +1398,12 @@ void Add_script(const char *name, byte is_file, byte is_directory, byte is_hidde // Ignore current directory if ( !strcmp(file_name, ".")) return; + // Ignore parent directory entry + if (!strcmp(file_name, PARENT_DIR)) + return; // Hidden - //if (is_hidden && !Config.Show_hidden_directories) - // return; + if (is_hidden && !Config.Show_hidden_directories) + return; Add_element_to_list(&Scripts_selector, file_name, Format_filename(file_name, NAME_WIDTH+1, 1), 1, ICON_NONE); } @@ -1698,6 +1701,8 @@ void Button_Brush_Factory(void) strcpy(scriptdir, Data_directory); strcat(scriptdir, "scripts/"); strcat(scriptdir, sub_directory); + if (sub_directory[0]!='\0') + Add_element_to_list(&Scripts_selector, PARENT_DIR, Format_filename(PARENT_DIR, NAME_WIDTH+1, 1), 1, ICON_NONE); // Add each found file to the list For_each_directory_entry(scriptdir, Add_script); // Sort it @@ -1851,6 +1856,8 @@ void Button_Brush_Factory(void) strcpy(scriptdir, Data_directory); strcat(scriptdir, "scripts/"); strcat(scriptdir, sub_directory); + if (sub_directory[0]!='\0') + Add_element_to_list(&Scripts_selector, PARENT_DIR, Format_filename(PARENT_DIR, NAME_WIDTH+1, 1), 1, ICON_NONE); // Add each found file to the list For_each_directory_entry(scriptdir, Add_script); // Sort it diff --git a/src/filesel.c b/src/filesel.c index a6bf033b..117a8ab3 100644 --- a/src/filesel.c +++ b/src/filesel.c @@ -29,20 +29,15 @@ #include #include #include - #define isHidden(x) (0) - #elif defined (__MINT__) #include #include - #define isHidden(x) (0) #elif defined(__WIN32__) #include #include #include - #define isHidden(x) (GetFileAttributesA((x)->d_name)&FILE_ATTRIBUTE_HIDDEN) #else #include - #define isHidden(x) ((x)->d_name[0]=='.') #endif #include @@ -393,7 +388,7 @@ void Read_list_of_files(T_Fileselector *list, byte selected_format) (!strcmp(entry->d_name, PARENT_DIR) || // ou qu'il n'est pas caché Config.Show_hidden_directories || - !isHidden(entry))) + !File_is_hidden(entry->d_name))) { // On rajoute le répertoire à la liste Add_element_to_list(list, entry->d_name, Format_filename(entry->d_name, 19, 1), 1, ICON_NONE); @@ -401,7 +396,7 @@ void Read_list_of_files(T_Fileselector *list, byte selected_format) } else if (S_ISREG(Infos_enreg.st_mode) && //Il s'agit d'un fichier (Config.Show_hidden_files || //Il n'est pas caché - !isHidden(entry))) + File_is_hidden(entry->d_name))) { const char * ext = filter; while (ext!=NULL) diff --git a/src/io.c b/src/io.c index d770a84f..81cf19c0 100644 --- a/src/io.c +++ b/src/io.c @@ -37,20 +37,16 @@ #include #include #include - #define isHidden(x) (0) #elif defined(__WIN32__) #include #include //#include - #define isHidden(x) (GetFileAttributesA((x)->d_name)&FILE_ATTRIBUTE_HIDDEN) #elif defined(__MINT__) #include #include #include - #define isHidden(x) (0) #else #include - #define isHidden(x) ((x)->d_name[0]=='.') #endif #include "struct.h" @@ -242,6 +238,28 @@ int Directory_exists(char * directory) } } +#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) || defined(__MINT__) + #define FILE_IS_HIDDEN_ATTRIBUTE __attribute__((unused)) +#else + #define FILE_IS_HIDDEN_ATTRIBUTE +#endif +/// Check if a file or directory is hidden. +int File_is_hidden(FILE_IS_HIDDEN_ATTRIBUTE const char *fname) +{ +#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) || defined(__MINT__) + // False (unable to determine, or irrrelevent for platform) + return 0; +#elif defined(__WIN32__) + unsigned long att = GetFileAttributesA(fname); + if (att==INVALID_FILE_ATTRIBUTES) + return 0; + return att&FILE_ATTRIBUTE_HIDDEN?1:0; +#else + return fname[0]=='.'; +#endif + + +} // Taille de fichier, en octets int File_length(const char * fname) { @@ -313,7 +331,7 @@ void For_each_directory_entry(const char * directory_name, void Callback(const c full_filename, S_ISREG(Infos_enreg.st_mode), S_ISDIR(Infos_enreg.st_mode), - isHidden(entry)?1:0); + File_is_hidden(entry->d_name)); } closedir(current_directory); } diff --git a/src/io.h b/src/io.h index 53237f3f..15419df2 100644 --- a/src/io.h +++ b/src/io.h @@ -90,6 +90,9 @@ int File_exists(char * fname); /// Returns true if a directory passed as a parameter exists in the current directory. int Directory_exists(char * directory); +/// Check if a file or directory is hidden. +int File_is_hidden(const char *fname); + /// Scans a directory, calls Callback for each file in it, void For_each_file(const char * directory_name, void Callback(const char *)); From 04761c79c4b5d911274a541ff389f9852423375d Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sat, 2 Apr 2011 17:43:16 +0000 Subject: [PATCH 29/46] Unbroke the file selector (was listing only hidden files instead of non-hidden). Lua: can browse the whole filesystem now git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1761 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/buttons.c | 4 +- src/engine.c | 12 ++++- src/engine.h | 2 +- src/factory.c | 126 ++++++++++++++++++++++++++------------------------ src/filesel.c | 20 ++++---- src/io.c | 75 ++++++++++++++++++++++++++++-- src/io.h | 4 +- src/struct.h | 3 +- 8 files changed, 163 insertions(+), 83 deletions(-) diff --git a/src/buttons.c b/src/buttons.c index 0ab8c362..d53a8b60 100644 --- a/src/buttons.c +++ b/src/buttons.c @@ -1307,7 +1307,7 @@ void Button_Skins(void) // Scroller for the fileselector (file_scroller = Window_set_scroller_button(155, FILESEL_Y - 1, 82, Skin_files_list.Nb_elements, 10, 0)), // 3 - Draw_one_skin_name); // 4 + Draw_one_skin_name, 2); // 4 skin_list->Cursor_position = Find_file_in_fileselector(&Skin_files_list, Config.Skin_file); @@ -4835,7 +4835,7 @@ void Button_Text(void) Window_set_normal_button(54,160,60,14,"Cancel",0,1,KEY_ESC); // 12 // List of fonts - font_list = Window_set_list_button(font_list_button, font_scroller, Draw_one_font_name); // 13 + font_list = Window_set_list_button(font_list_button, font_scroller, Draw_one_font_name, 2); // 13 // Restore its settings from last passage in screen font_list->List_start = list_start; font_list->Cursor_position = cursor_position; diff --git a/src/engine.c b/src/engine.c index e140c9a1..717232fd 100644 --- a/src/engine.c +++ b/src/engine.c @@ -2184,7 +2184,7 @@ void Window_dropdown_clear_items(T_Dropdown_button * dropdown) // - entry_button is the textual area where the list values will be printed. // - scroller is a scroller button attached to it -T_List_button * Window_set_list_button(T_Special_button * entry_button, T_Scroller_button * scroller, Func_draw_list_item draw_list_item) +T_List_button * Window_set_list_button(T_Special_button * entry_button, T_Scroller_button * scroller, Func_draw_list_item draw_list_item, byte color_index) { T_List_button *temp; @@ -2195,6 +2195,7 @@ T_List_button * Window_set_list_button(T_Special_button * entry_button, T_Scroll temp->Entry_button = entry_button; temp->Scroller = scroller; temp->Draw_list_item = draw_list_item; + temp->Color_index = color_index; temp->Next=Window_list_button_list; Window_list_button_list=temp; @@ -2216,12 +2217,19 @@ void Window_redraw_list(T_List_button * list) // Remaining rectangle under list i=list->Scroller->Nb_visibles-list->Scroller->Nb_elements; if (i>0) + { + byte color; + color = list->Color_index == 0 ? MC_Black : + (list->Color_index == 1 ? MC_Dark : + (list->Color_index == 2 ? MC_Light : MC_White)); + Window_rectangle( list->Entry_button->Pos_X, list->Entry_button->Pos_Y+list->Scroller->Nb_elements*8, list->Entry_button->Width, i*8, - MC_Light); + color); + } } //----------------------- Ouverture d'un pop-up ----------------------- diff --git a/src/engine.h b/src/engine.h index d9f16861..fb577db2 100644 --- a/src/engine.h +++ b/src/engine.h @@ -98,7 +98,7 @@ void Window_dropdown_clear_items(T_Dropdown_button * dropdown); T_Dropdown_choice * Dropdown_activate(T_Dropdown_button *button, short off_x, short off_y); T_List_button * Window_set_list_button(T_Special_button * entry_button, - T_Scroller_button * scroller, Func_draw_list_item draw_list_item); + T_Scroller_button * scroller, Func_draw_list_item draw_list_item, byte color_index); void Window_redraw_list(T_List_button * list); byte Window_click_in_rectangle(short start_x, short start_y, short end_x, short end_y); diff --git a/src/factory.c b/src/factory.c index de18f4c9..a3cab720 100644 --- a/src/factory.c +++ b/src/factory.c @@ -1268,15 +1268,23 @@ void Draw_script_name(word x, word y, word index, byte highlighted) current_item = Get_item_by_index(&Scripts_selector, index); - if (current_item->Type==1) // Directories + if (current_item->Type==0) // Files { - fg=(highlighted)?MC_Black:MC_Dark; - bg=(highlighted)?MC_Dark:MC_Light; + fg=(highlighted)?MC_White:MC_Light; + bg=(highlighted)?MC_Dark:MC_Black; } - else // Files + else if (current_item->Type==1) // Directories { - fg=MC_Black; - bg=(highlighted)?MC_Dark:MC_Light; + fg=(highlighted)?MC_Light:MC_Dark; + bg=(highlighted)?MC_Dark:MC_Black; + } + else // Drives + { + fg=(highlighted)?MC_Light:MC_Dark; + bg=(highlighted)?MC_Dark:MC_Black; + + Window_display_icon_sprite(x,y,current_item->Icon); + x+=8; } Print_in_window(x, y, current_item->Short_name, fg,bg); @@ -1426,30 +1434,36 @@ void Run_script(const char *script_subdirectory, const char *script_filename) lua_State* L; const char* message; byte old_cursor_shape=Cursor_shape; - char scriptdir[MAX_PATH_CHARACTERS]; - - strcpy(scriptdir, Data_directory); - strcat(scriptdir, "scripts/"); + char buf[MAX_PATH_CHARACTERS]; // Some scripts are slow Cursor_shape=CURSOR_SHAPE_HOURGLASS; Display_cursor(); Flush_update(); - chdir(scriptdir); - if (script_subdirectory && script_subdirectory[0]!='\0') { - sprintf(Last_run_script, "%s%s%s", script_subdirectory, PATH_SEPARATOR, script_filename); + strcpy(Last_run_script, script_subdirectory); + Append_path(Last_run_script, script_filename, NULL); } else { strcpy(Last_run_script, script_filename); } + // This chdir is for the script's sake. Grafx2 itself will (try to) + // not rely on what is the system's current directory. + Extract_path(buf,Last_run_script); + chdir(buf); L = lua_open(); - putenv("LUA_PATH=libs\\?.lua"); + + strcpy(buf, "LUA_PATH="); + strcat(buf, Data_directory); + Append_path(buf+9, "scripts", NULL); + Append_path(buf+9, "libs", NULL); + Append_path(buf+9, "?.lua", NULL); + putenv(buf); // writing and reading pixels lua_register(L,"putbrushpixel",L_PutBrushPixel); @@ -1687,24 +1701,34 @@ void Set_script_shortcut(T_Fileselector_item * script_item) void Button_Brush_Factory(void) { static char selected_file[MAX_PATH_CHARACTERS]=""; - static char sub_directory[MAX_PATH_CHARACTERS]=""; + static char sub_directory[MAX_PATH_CHARACTERS]="!"; short clicked_button; T_List_button* scriptlist; T_Scroller_button* scriptscroll; T_Special_button* scriptarea; - char scriptdir[MAX_PATH_CHARACTERS]; T_Fileselector_item *item; int last_selected_item=-1; + + if (sub_directory[0]=='!') + { + // Default directory + Realpath(Data_directory, sub_directory); + Append_path(sub_directory, "scripts", NULL); + } + // Reinitialize the list Free_fileselector_list(&Scripts_selector); - strcpy(scriptdir, Data_directory); - strcat(scriptdir, "scripts/"); - strcat(scriptdir, sub_directory); - if (sub_directory[0]!='\0') + if (sub_directory[0]=='\0') + { + Read_list_of_drives(&Scripts_selector,NAME_WIDTH+1); + } + else + { Add_element_to_list(&Scripts_selector, PARENT_DIR, Format_filename(PARENT_DIR, NAME_WIDTH+1, 1), 1, ICON_NONE); - // Add each found file to the list - For_each_directory_entry(scriptdir, Add_script); + // Add each found file to the list + For_each_directory_entry(sub_directory, Add_script); + } // Sort it Sort_list_of_files(&Scripts_selector); // @@ -1715,11 +1739,11 @@ void Button_Brush_Factory(void) Window_display_frame_in(6, FILESEL_Y - 2, NAME_WIDTH*8+4, 84); // File selector // Fileselector - scriptarea=Window_set_special_button(8, FILESEL_Y + 1, NAME_WIDTH*8, 80); // 2 + scriptarea=Window_set_special_button(8, FILESEL_Y + 0, NAME_WIDTH*8, 80); // 2 // Scroller for the fileselector scriptscroll = Window_set_scroller_button(NAME_WIDTH*8+14, FILESEL_Y - 1, 82, Scripts_selector.Nb_elements,10, 0); // 3 - scriptlist = Window_set_list_button(scriptarea,scriptscroll,Draw_script_name); // 4 + scriptlist = Window_set_list_button(scriptarea,scriptscroll,Draw_script_name, 0); // 4 Window_set_normal_button(10, 149, 67, 14, "Run", 0, 1, SDLK_RETURN); // 5 @@ -1811,55 +1835,37 @@ void Button_Brush_Factory(void) if (item->Type==0) // File { - strcpy(selected_file, sub_directory); - strcat(selected_file, item->Full_name); + strcpy(selected_file, item->Full_name); break; } - else if (item->Type==1) // Directory + else if (item->Type==1 || item->Type==2) // Directory { - if (!strcmp(item->Full_name,PARENT_DIR)) + if (item->Type==2) { - // Going up one directory - long len; - char * slash_pos; - - // Remove trailing slash - len=strlen(sub_directory); - if (len && !strcmp(sub_directory+len-1,PATH_SEPARATOR)) - sub_directory[len-1]='\0'; - - slash_pos=Find_last_slash(sub_directory); - if (slash_pos) - { - strcpy(selected_file, slash_pos+1); - *slash_pos='\0'; - } - else - { - strcpy(selected_file, sub_directory); - sub_directory[0]='\0'; - } + // Selecting one drive root + strcpy(selected_file, PARENT_DIR); + strcat(sub_directory, item->Full_name); } else { - // Going down one directory - strcpy(selected_file, PARENT_DIR); - - strcat(sub_directory, item->Full_name); - strcat(sub_directory, PATH_SEPARATOR); + // Going down one or up by one directory + Append_path(sub_directory, item->Full_name, selected_file); } // No break: going back up to beginning of loop // Reinitialize the list Free_fileselector_list(&Scripts_selector); - strcpy(scriptdir, Data_directory); - strcat(scriptdir, "scripts/"); - strcat(scriptdir, sub_directory); - if (sub_directory[0]!='\0') + if (sub_directory[0]=='\0') + { + Read_list_of_drives(&Scripts_selector,NAME_WIDTH+1); + } + else + { Add_element_to_list(&Scripts_selector, PARENT_DIR, Format_filename(PARENT_DIR, NAME_WIDTH+1, 1), 1, ICON_NONE); - // Add each found file to the list - For_each_directory_entry(scriptdir, Add_script); + // Add each found file to the list + For_each_directory_entry(sub_directory, Add_script); + } // Sort it Sort_list_of_files(&Scripts_selector); // @@ -1876,7 +1882,7 @@ void Button_Brush_Factory(void) if (clicked_button == 5) // Run the script { - Run_script("", selected_file); + Run_script(sub_directory, selected_file); } else { diff --git a/src/filesel.c b/src/filesel.c index 117a8ab3..756064f7 100644 --- a/src/filesel.c +++ b/src/filesel.c @@ -388,7 +388,7 @@ void Read_list_of_files(T_Fileselector *list, byte selected_format) (!strcmp(entry->d_name, PARENT_DIR) || // ou qu'il n'est pas caché Config.Show_hidden_directories || - !File_is_hidden(entry->d_name))) + !File_is_hidden(entry->d_name, entry->d_name))) { // On rajoute le répertoire à la liste Add_element_to_list(list, entry->d_name, Format_filename(entry->d_name, 19, 1), 1, ICON_NONE); @@ -396,7 +396,7 @@ void Read_list_of_files(T_Fileselector *list, byte selected_format) } else if (S_ISREG(Infos_enreg.st_mode) && //Il s'agit d'un fichier (Config.Show_hidden_files || //Il n'est pas caché - File_is_hidden(entry->d_name))) + !File_is_hidden(entry->d_name, entry->d_name))) { const char * ext = filter; while (ext!=NULL) @@ -474,7 +474,7 @@ void bstrtostr( BSTR in, STRPTR out, TEXT max ) #endif // -- Lecture d'une liste de lecteurs / volumes ----------------------------- -void Read_list_of_drives(T_Fileselector *list) +void Read_list_of_drives(T_Fileselector *list, byte name_length) { // Empty the current content of fileselector: @@ -495,7 +495,7 @@ void Read_list_of_drives(T_Fileselector *list) { bstrtostr( dl->dol_Name, tmp, 254 ); strcat( tmp, ":" ); - Add_element_to_list(list, tmp, Format_filename(tmp, 19, 2), 2, ICON_NONE ); + Add_element_to_list(list, tmp, Format_filename(tmp, name_length, 2), 2, ICON_NONE ); list->Nb_directories++; } UnLockDosList( LDF_VOLUMES | LDF_READ ); @@ -539,7 +539,7 @@ void Read_list_of_drives(T_Fileselector *list) break; } drive_name[0]='A'+bit_index; - Add_element_to_list(list, drive_name, Format_filename(drive_name,18,2), 2, icon); + Add_element_to_list(list, drive_name, Format_filename(drive_name,name_length-1,2), 2, icon); list->Nb_directories++; drive_index++; } @@ -556,7 +556,7 @@ void Read_list_of_drives(T_Fileselector *list) if ( (1 << bit_index) & drive_bits ) { drive_name[0]='A'+bit_index; - Add_element_to_list(list, drive_name,Format_filename(drive_name,19,2),2,ICON_NONE); + Add_element_to_list(list, drive_name,Format_filename(drive_name,name_length,2),2,ICON_NONE); list->Nb_directories++; drive_index++; } @@ -578,11 +578,11 @@ void Read_list_of_drives(T_Fileselector *list) #else char * home_dir = getenv("HOME"); #endif - Add_element_to_list(list, "/", Format_filename("/",19,2), 2, ICON_NONE); + Add_element_to_list(list, "/", Format_filename("/",name_length,2), 2, ICON_NONE); list->Nb_directories++; if(home_dir) { - Add_element_to_list(list, home_dir, Format_filename(home_dir, 19, 2), 2, ICON_NONE); + Add_element_to_list(list, home_dir, Format_filename(home_dir, name_length, 2), 2, ICON_NONE); list->Nb_directories++; } @@ -592,7 +592,7 @@ void Read_list_of_drives(T_Fileselector *list) { if(mount_points_list->me_dummy == 0 && strcmp(mount_points_list->me_mountdir,"/") && strcmp(mount_points_list->me_mountdir,"/home")) { - Add_element_to_list(list, mount_points_list->me_mountdir, Format_filename(mount_points_list->me_mountdir, 19, 2), 2, ICON_NONE); + Add_element_to_list(list, mount_points_list->me_mountdir, Format_filename(mount_points_list->me_mountdir, name_length, 2), 2, ICON_NONE); list->Nb_directories++; } next = mount_points_list -> me_next; @@ -1704,7 +1704,7 @@ byte Button_Load_or_Save(byte load, T_IO_Context *context) Main_fileselector_position=0; Main_fileselector_offset=0; // Affichage des premiers fichiers visibles: - Read_list_of_drives(&Filelist); + Read_list_of_drives(&Filelist,19); Sort_list_of_files(&Filelist); Prepare_and_display_filelist(Main_fileselector_position,Main_fileselector_offset,file_scroller); Display_cursor(); diff --git a/src/io.c b/src/io.c index 81cf19c0..c28155ed 100644 --- a/src/io.c +++ b/src/io.c @@ -200,6 +200,67 @@ void Extract_path(char *dest, const char *source) strcat(dest, PATH_SEPARATOR); } +/// +/// Appends a file or directory name to an existing directory name. +/// As a special case, when the new item is equal to PARENT_DIR, this +/// will remove the rightmost directory name. +/// reverse_path is optional, if it's non-null, the function will +/// write there : +/// - if filename is ".." : The name of eliminated directory/file +/// - else: ".." +void Append_path(char *path, const char *filename, char *reverse_path) +{ + // Parent + if (!strcmp(filename, PARENT_DIR)) + { + // Going up one directory + long len; + char * slash_pos; + + // Remove trailing slash + len=strlen(path); + if (len && !strcmp(path+len-1,PATH_SEPARATOR)) + path[len-1]='\0'; + + slash_pos=Find_last_slash(path); + if (slash_pos) + { + if (reverse_path) + strcpy(reverse_path, slash_pos+1); + *slash_pos='\0'; + } + else + { + if (reverse_path) + strcpy(reverse_path, path); + path[0]='\0'; + } + #if defined(__WIN32__) + // Roots of drives need a pending antislash + if (path[0]!='\0' && path[1]==':' && path[2]=='\0') + { + strcat(path, PATH_SEPARATOR); + } + #endif + } + else + // Sub-directory + { + long len; + // Add trailing slash if needed + len=strlen(path); + if (len && strcmp(path+len-1,PATH_SEPARATOR)) + { + strcpy(path+len, PATH_SEPARATOR); + len+=strlen(PATH_SEPARATOR); + } + strcat(path, filename); + + if (reverse_path) + strcpy(reverse_path, PARENT_DIR); + } +} + int File_exists(char * fname) // Détermine si un file passé en paramètre existe ou non dans le // répertoire courant. @@ -244,16 +305,20 @@ int Directory_exists(char * directory) #define FILE_IS_HIDDEN_ATTRIBUTE #endif /// Check if a file or directory is hidden. -int File_is_hidden(FILE_IS_HIDDEN_ATTRIBUTE const char *fname) +int File_is_hidden(FILE_IS_HIDDEN_ATTRIBUTE const char *fname, const char *full_name) { #if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) || defined(__MINT__) // False (unable to determine, or irrrelevent for platform) return 0; #elif defined(__WIN32__) - unsigned long att = GetFileAttributesA(fname); + unsigned long att; + if (full_name!=NULL) + att = GetFileAttributesA(full_name); + else + att = GetFileAttributesA(fname); if (att==INVALID_FILE_ATTRIBUTES) return 0; - return att&FILE_ATTRIBUTE_HIDDEN?1:0; + return (att&FILE_ATTRIBUTE_HIDDEN)?1:0; #else return fname[0]=='.'; #endif @@ -314,7 +379,7 @@ void For_each_directory_entry(const char * directory_name, void Callback(const c char full_filename[MAX_PATH_CHARACTERS]; int filename_position; strcpy(full_filename, directory_name); - current_directory=opendir(directory_name); + current_directory=opendir(full_filename); if(current_directory == NULL) return; // Répertoire invalide ... filename_position = strlen(full_filename); if (filename_position==0 || strcmp(full_filename+filename_position-1,PATH_SEPARATOR)) @@ -331,7 +396,7 @@ void For_each_directory_entry(const char * directory_name, void Callback(const c full_filename, S_ISREG(Infos_enreg.st_mode), S_ISDIR(Infos_enreg.st_mode), - File_is_hidden(entry->d_name)); + File_is_hidden(entry->d_name, full_filename)); } closedir(current_directory); } diff --git a/src/io.h b/src/io.h index 15419df2..1c9c52b8 100644 --- a/src/io.h +++ b/src/io.h @@ -90,8 +90,8 @@ int File_exists(char * fname); /// Returns true if a directory passed as a parameter exists in the current directory. int Directory_exists(char * directory); -/// Check if a file or directory is hidden. -int File_is_hidden(const char *fname); +/// Check if a file or directory is hidden. Full name (with directories) is optional. +int File_is_hidden(const char *fname, const char *full_name); /// Scans a directory, calls Callback for each file in it, void For_each_file(const char * directory_name, void Callback(const char *)); diff --git a/src/struct.h b/src/struct.h index 62422bd0..d4f06b82 100644 --- a/src/struct.h +++ b/src/struct.h @@ -215,7 +215,8 @@ typedef struct T_List_button T_Special_button * Entry_button; ///< Pointer to the associated selection control. T_Scroller_button * Scroller; ///< Pointer to the associated scroller - Func_draw_list_item Draw_list_item; ///< + Func_draw_list_item Draw_list_item; ///< Function to call for each item to draw its line + byte Color_index; ///< Background color: From 0->MC_Black to 3->MC_White struct T_List_button * Next; ///< Pointer to the next list button of current window. } T_List_button; From e10fe19ae67ac7795cad9b1b8f244548e2c8a6a9 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sat, 2 Apr 2011 18:45:07 +0000 Subject: [PATCH 30/46] Lua: Fixed keyboard shortcuts to accomodate with full path names now used. Users who had shortcuts should clear them, from the list of shortcuts in Help screen. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1762 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/factory.c | 40 ++++++++++++++++++++-------------------- src/filesel.h | 2 ++ src/io.h | 11 ++++++++++- 3 files changed, 32 insertions(+), 21 deletions(-) diff --git a/src/factory.c b/src/factory.c index a3cab720..00705672 100644 --- a/src/factory.c +++ b/src/factory.c @@ -43,6 +43,9 @@ #include "input.h" // Is_shortcut() #include "help.h" // Window_help() #include "graph.h" +#include "filesel.h" // Read_list_of_drives() +#include "realpath.h" + /// Lua scripts bound to shortcut keys. char * Bound_script[10]; @@ -1295,26 +1298,24 @@ void Draw_script_name(word x, word y, word index, byte highlighted) /// /// Displays first lines of comments from a lua script in the window. -void Draw_script_information(T_Fileselector_item * script_item) +void Draw_script_information(T_Fileselector_item * script_item, const char *full_directory) { FILE *script_file; - char full_name[MAX_PATH_CHARACTERS]; char text_block[3][DESC_WIDTH+1]; int x, y; int i; - + // Blank the target area Window_rectangle(7, FILESEL_Y + 89, DESC_WIDTH*6+2, 4*8, MC_Black); if (script_item && script_item->Full_name && script_item->Full_name[0]!='\0') { - strcpy(full_name, Data_directory); - strcat(full_name, "scripts/"); - strcat(full_name, script_item->Full_name); - - + char full_name[MAX_PATH_CHARACTERS]; + strcpy(full_name, full_directory); + Append_path(full_name, script_item->Full_name, NULL); + x=0; - y=0; + y=0; text_block[0][0] = text_block[1][0] = text_block[2][0] = '\0'; // Start reading script_file = fopen(full_name, "r"); @@ -1360,7 +1361,7 @@ void Draw_script_information(T_Fileselector_item * script_item) // Display a line with the keyboard shortcut Print_help(8, FILESEL_Y + 89+24, "Key:", 'N', 0, 0); for (i=0; i<10; i++) - if (Bound_script[i]!=NULL && !strcmp(Bound_script[i], script_item->Full_name)) + if (Bound_script[i]!=NULL && !strcmp(Bound_script[i], full_name)) break; if (i<10) @@ -1646,20 +1647,19 @@ void Repeat_script(void) Run_script(NULL, Last_run_script); } -void Set_script_shortcut(T_Fileselector_item * script_item) +void Set_script_shortcut(T_Fileselector_item * script_item, const char *full_directory) { int i; char full_name[MAX_PATH_CHARACTERS]; if (script_item && script_item->Full_name && script_item->Full_name[0]!='\0') { - strcpy(full_name, Data_directory); - strcat(full_name, "scripts/"); - strcat(full_name, script_item->Full_name); + strcpy(full_name, full_directory); + Append_path(full_name, script_item->Full_name, NULL); // Find if it already has a shortcut for (i=0; i<10; i++) - if (Bound_script[i]!=NULL && !strcmp(Bound_script[i], script_item->Full_name)) + if (Bound_script[i]!=NULL && !strcmp(Bound_script[i], full_name)) break; if (i<10) { @@ -1676,7 +1676,7 @@ void Set_script_shortcut(T_Fileselector_item * script_item) if (i<10) { free(Bound_script[i]); - Bound_script[i]=strdup(script_item->Full_name); + Bound_script[i]=strdup(full_name); } else { @@ -1693,7 +1693,7 @@ void Set_script_shortcut(T_Fileselector_item * script_item) } // Refresh display Hide_cursor(); - Draw_script_information(script_item); + Draw_script_information(script_item, full_directory); Display_cursor(); } } @@ -1760,7 +1760,7 @@ void Button_Brush_Factory(void) Window_redraw_list(scriptlist); Draw_script_information(Get_item_by_index(&Scripts_selector, - scriptlist->List_start + scriptlist->Cursor_position)); + scriptlist->List_start + scriptlist->Cursor_position), sub_directory); Update_window_area(0, 0, Window_width, Window_height); Display_cursor(); @@ -1802,13 +1802,13 @@ void Button_Brush_Factory(void) last_selected_item = scriptlist->List_start + scriptlist->Cursor_position; Hide_cursor(); Draw_script_information(Get_item_by_index(&Scripts_selector, - scriptlist->List_start + scriptlist->Cursor_position)); + scriptlist->List_start + scriptlist->Cursor_position), sub_directory); Display_cursor(); break; case 6: Set_script_shortcut(Get_item_by_index(&Scripts_selector, - scriptlist->List_start + scriptlist->Cursor_position)); + scriptlist->List_start + scriptlist->Cursor_position), sub_directory); break; default: diff --git a/src/filesel.h b/src/filesel.h index 19b6f777..08956eb3 100644 --- a/src/filesel.h +++ b/src/filesel.h @@ -46,6 +46,8 @@ void Recount_files(T_Fileselector *list); T_Fileselector_item * Get_item_by_index(T_Fileselector *list, short index); +void Read_list_of_drives(T_Fileselector *list, byte name_length); + short Find_file_in_fileselector(T_Fileselector *list, const char * fname); void Locate_list_item(T_List_button * list, T_Fileselector * selector, short selected_item); diff --git a/src/io.h b/src/io.h index 1c9c52b8..042ef337 100644 --- a/src/io.h +++ b/src/io.h @@ -99,12 +99,21 @@ void For_each_file(const char * directory_name, void Callback(const char *)); /// Scans a directory, calls Callback for each file or directory in it, void For_each_directory_entry(const char * directory_name, void Callback(const char *, byte is_file, byte is_directory, byte is_hidden)); - /// /// Creates a fully qualified name from a directory and filename. /// The point is simply to insert a PATH_SEPARATOR when needed. void Get_full_filename(char * output_name, char * file_name, char * directory_name); +/// +/// Appends a file or directory name to an existing directory name. +/// As a special case, when the new item is equal to PARENT_DIR, this +/// will remove the rightmost directory name. +/// reverse_path is optional, if it's non-null, the function will +/// write there : +/// - if filename is ".." : The name of eliminated directory/file +/// - else: ".." +void Append_path(char *path, const char *filename, char *reverse_path); + /// /// Creates a lock file, to check if an other instance of Grafx2 is running. /// @return 0 on success (first instance), -1 on failure (others are running) From f34417919f35957620223c5f90bcb56636e5b746 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sun, 3 Apr 2011 14:43:16 +0000 Subject: [PATCH 31/46] Lua: now remembers which directory you last browsed when you quit. Fixed an issue where gfx2.ini isn't saved if there's a file gfx2.$$$ in same directory (Like after a crash) git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1763 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/Makefile.dep | 4 +-- src/factory.c | 71 ++++++++++++++++++------------------------------ src/io.c | 12 ++++++-- src/readini.c | 15 +++++++++- src/saveini.c | 7 ++++- src/struct.h | 3 +- 6 files changed, 61 insertions(+), 51 deletions(-) diff --git a/src/Makefile.dep b/src/Makefile.dep index 0059f24d..33532417 100644 --- a/src/Makefile.dep +++ b/src/Makefile.dep @@ -15,7 +15,7 @@ $(OBJDIR)/engine.o: engine.c const.h struct.h global.h graph.h misc.h special.h input.h engine.h pages.h layers.h factory.h loadsave.h io.h $(OBJDIR)/factory.o: factory.c brush.h struct.h const.h buttons.h engine.h errors.h \ filesel.h loadsave.h global.h graph.h io.h misc.h pages.h readline.h \ - sdlscreen.h windows.h palette.h input.h help.h + sdlscreen.h windows.h palette.h input.h help.h realpath.h $(OBJDIR)/fileformats.o: fileformats.c errors.h global.h struct.h const.h \ loadsave.h misc.h io.h windows.h pages.h $(OBJDIR)/filesel.o: filesel.c const.h struct.h global.h misc.h errors.h io.h \ @@ -82,7 +82,7 @@ $(OBJDIR)/pxwide.o: pxwide.c global.h struct.h const.h sdlscreen.h misc.h graph. $(OBJDIR)/pxwide2.o: pxwide2.c global.h struct.h const.h sdlscreen.h misc.h graph.h \ pxwide2.h $(OBJDIR)/readini.o: readini.c const.h errors.h global.h struct.h misc.h readini.h \ - setup.h + setup.h realpath.h io.h $(OBJDIR)/readline.o: readline.c const.h struct.h global.h misc.h errors.h \ sdlscreen.h readline.h windows.h input.h engine.h $(OBJDIR)/realpath.o: realpath.c diff --git a/src/factory.c b/src/factory.c index 00705672..27efa774 100644 --- a/src/factory.c +++ b/src/factory.c @@ -1308,7 +1308,7 @@ void Draw_script_information(T_Fileselector_item * script_item, const char *full // Blank the target area Window_rectangle(7, FILESEL_Y + 89, DESC_WIDTH*6+2, 4*8, MC_Black); - if (script_item && script_item->Full_name && script_item->Full_name[0]!='\0') + if (script_item && script_item->Type==0 && script_item->Full_name && script_item->Full_name[0]!='\0') { char full_name[MAX_PATH_CHARACTERS]; strcpy(full_name, full_directory); @@ -1698,28 +1698,11 @@ void Set_script_shortcut(T_Fileselector_item * script_item, const char *full_dir } } -void Button_Brush_Factory(void) +void Reload_scripts_list(void) { - static char selected_file[MAX_PATH_CHARACTERS]=""; - static char sub_directory[MAX_PATH_CHARACTERS]="!"; - - short clicked_button; - T_List_button* scriptlist; - T_Scroller_button* scriptscroll; - T_Special_button* scriptarea; - T_Fileselector_item *item; - int last_selected_item=-1; - - if (sub_directory[0]=='!') - { - // Default directory - Realpath(Data_directory, sub_directory); - Append_path(sub_directory, "scripts", NULL); - } - // Reinitialize the list Free_fileselector_list(&Scripts_selector); - if (sub_directory[0]=='\0') + if (Config.Scripts_directory[0]=='\0') { Read_list_of_drives(&Scripts_selector,NAME_WIDTH+1); } @@ -1727,11 +1710,25 @@ void Button_Brush_Factory(void) { Add_element_to_list(&Scripts_selector, PARENT_DIR, Format_filename(PARENT_DIR, NAME_WIDTH+1, 1), 1, ICON_NONE); // Add each found file to the list - For_each_directory_entry(sub_directory, Add_script); + For_each_directory_entry(Config.Scripts_directory, Add_script); } // Sort it - Sort_list_of_files(&Scripts_selector); + Sort_list_of_files(&Scripts_selector); // +} + +void Button_Brush_Factory(void) +{ + static char selected_file[MAX_PATH_CHARACTERS]=""; + + short clicked_button; + T_List_button* scriptlist; + T_Scroller_button* scriptscroll; + T_Special_button* scriptarea; + T_Fileselector_item *item; + int last_selected_item=-1; + + Reload_scripts_list(); Open_window(33+8*NAME_WIDTH, 180, "Brush Factory"); @@ -1760,7 +1757,7 @@ void Button_Brush_Factory(void) Window_redraw_list(scriptlist); Draw_script_information(Get_item_by_index(&Scripts_selector, - scriptlist->List_start + scriptlist->Cursor_position), sub_directory); + scriptlist->List_start + scriptlist->Cursor_position), Config.Scripts_directory); Update_window_area(0, 0, Window_width, Window_height); Display_cursor(); @@ -1776,7 +1773,7 @@ void Button_Brush_Factory(void) do { clicked_button = Window_clicked_button(); - if (Key==SDLK_BACKSPACE && sub_directory[0]!='\0') + if (Key==SDLK_BACKSPACE && Config.Scripts_directory[0]!='\0') { // Make it select first entry (parent directory) scriptlist->List_start=0; @@ -1802,13 +1799,13 @@ void Button_Brush_Factory(void) last_selected_item = scriptlist->List_start + scriptlist->Cursor_position; Hide_cursor(); Draw_script_information(Get_item_by_index(&Scripts_selector, - scriptlist->List_start + scriptlist->Cursor_position), sub_directory); + scriptlist->List_start + scriptlist->Cursor_position), Config.Scripts_directory); Display_cursor(); break; case 6: Set_script_shortcut(Get_item_by_index(&Scripts_selector, - scriptlist->List_start + scriptlist->Cursor_position), sub_directory); + scriptlist->List_start + scriptlist->Cursor_position), Config.Scripts_directory); break; default: @@ -1844,31 +1841,17 @@ void Button_Brush_Factory(void) { // Selecting one drive root strcpy(selected_file, PARENT_DIR); - strcat(sub_directory, item->Full_name); + strcat(Config.Scripts_directory, item->Full_name); } else { // Going down one or up by one directory - Append_path(sub_directory, item->Full_name, selected_file); + Append_path(Config.Scripts_directory, item->Full_name, selected_file); } // No break: going back up to beginning of loop - // Reinitialize the list - Free_fileselector_list(&Scripts_selector); - if (sub_directory[0]=='\0') - { - Read_list_of_drives(&Scripts_selector,NAME_WIDTH+1); - } - else - { - Add_element_to_list(&Scripts_selector, PARENT_DIR, Format_filename(PARENT_DIR, NAME_WIDTH+1, 1), 1, ICON_NONE); - // Add each found file to the list - For_each_directory_entry(sub_directory, Add_script); - } - // Sort it - Sort_list_of_files(&Scripts_selector); - // + Reload_scripts_list(); scriptlist->Scroller->Nb_elements=Scripts_selector.Nb_elements; Compute_slider_cursor_length(scriptlist->Scroller); @@ -1882,7 +1865,7 @@ void Button_Brush_Factory(void) if (clicked_button == 5) // Run the script { - Run_script(sub_directory, selected_file); + Run_script(Config.Scripts_directory, selected_file); } else { diff --git a/src/io.c b/src/io.c index c28155ed..171cb853 100644 --- a/src/io.c +++ b/src/io.c @@ -219,7 +219,11 @@ void Append_path(char *path, const char *filename, char *reverse_path) // Remove trailing slash len=strlen(path); - if (len && !strcmp(path+len-1,PATH_SEPARATOR)) + if (len && (!strcmp(path+len-1,PATH_SEPARATOR) + #ifdef __WIN32__ + || path[len-1]=='/' + #endif + )) path[len-1]='\0'; slash_pos=Find_last_slash(path); @@ -249,7 +253,11 @@ void Append_path(char *path, const char *filename, char *reverse_path) long len; // Add trailing slash if needed len=strlen(path); - if (len && strcmp(path+len-1,PATH_SEPARATOR)) + if (len && (strcmp(path+len-1,PATH_SEPARATOR) + #ifdef __WIN32__ + && path[len-1]!='/' + #endif + )) { strcpy(path+len, PATH_SEPARATOR); len+=strlen(PATH_SEPARATOR); diff --git a/src/readini.c b/src/readini.c index 15473878..225eabd6 100644 --- a/src/readini.c +++ b/src/readini.c @@ -34,6 +34,8 @@ #include "misc.h" #include "readini.h" #include "setup.h" +#include "realpath.h" +#include "io.h" void Load_INI_clear_string(char * str, byte keep_comments) { @@ -933,7 +935,18 @@ int Load_INI(T_Config * conf) } } - + // Optional, Location of last directory used for Lua scripts browsing (>=2.3) + conf->Scripts_directory[0]='\0'; + if (!Load_INI_get_string (file,buffer,"Scripts_directory",value_label, 1)) + { + strcpy(conf->Scripts_directory,value_label); + } + if (conf->Scripts_directory[0]=='\0') + { + // Default when empty: + Realpath(Data_directory, conf->Scripts_directory); + Append_path(conf->Scripts_directory, "scripts", NULL); + } // Insert new values here diff --git a/src/saveini.c b/src/saveini.c index b512b7ac..fab3cc12 100644 --- a/src/saveini.c +++ b/src/saveini.c @@ -419,7 +419,9 @@ int Save_INI(T_Config * conf) strcpy(temp_filename,Config_directory); strcat(temp_filename,INISAVE_FILENAME); - // On renome l'ancienne version du fichier INI vers un fichier temporaire: + // Delete gfx2.$$$ + remove(temp_filename); + // Rename current config file as gfx2.$$$ if (rename(filename,temp_filename)!=0) { goto Erreur_ERREUR_SAUVEGARDE_INI; @@ -697,6 +699,9 @@ int Save_INI(T_Config * conf) if ((return_code=Save_INI_set_values (old_file,new_file,buffer,"Swap_buttons",1,values,0))) goto Erreur_Retour; + if ((return_code=Save_INI_set_strings (old_file,new_file,buffer,"Scripts_directory",conf->Scripts_directory))) + goto Erreur_Retour; + // Insert new values here Save_INI_flush(old_file,new_file,buffer); diff --git a/src/struct.h b/src/struct.h index d4f06b82..f61f820e 100644 --- a/src/struct.h +++ b/src/struct.h @@ -357,7 +357,7 @@ typedef struct byte Screen_size_in_GIF; ///< Boolean, true to store current resolution in GIF files. byte Auto_nb_used; ///< Boolean, true to count colors in Palette screen. byte Default_resolution; ///< Default video mode to use on startup. Index in ::Video_mode. - char *Bookmark_directory[NB_BOOKMARKS];///< Bookmarked directories in fileselectors: This is the full dierctory name. + char *Bookmark_directory[NB_BOOKMARKS];///< Bookmarked directories in fileselectors: This is the full directory name. char Bookmark_label[NB_BOOKMARKS][8+1];///< Bookmarked directories in fileselectors: This is the displayed name. int Window_pos_x; ///< Last window x position (9999 if unsupportd/irrelevant for the platform) int Window_pos_y; ///< Last window y position (9999 if unsupportd/irrelevant for the platform) @@ -368,6 +368,7 @@ typedef struct byte Sync_views; ///< Boolean, true when the Main and Spare should share their viewport settings. byte Stylus_mode; ///< Boolean, true to tweak some tools (eg:Curve) for single-button stylus. word Swap_buttons; ///< Sets which key swaps mouse buttons : 0=none, or MOD_CTRL, or MOD_ALT. + char Scripts_directory[MAX_PATH_CHARACTERS];///< Full pathname of directory for Lua scripts } T_Config; // Structures utilisées pour les descriptions de pages et de liste de pages. From 0129bb359002048896919128f34150b014d40f19 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sun, 3 Apr 2011 14:43:47 +0000 Subject: [PATCH 32/46] missing file git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1764 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- share/grafx2/gfx2def.ini | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/share/grafx2/gfx2def.ini b/share/grafx2/gfx2def.ini index b05c8ef8..36f045fa 100644 --- a/share/grafx2/gfx2def.ini +++ b/share/grafx2/gfx2def.ini @@ -364,6 +364,7 @@ ; When this mode is active, scrolling the view (and the magnifier view) ; affects both the main image and the spare page - as long as they have ; the same dimensions. + ; Sync_views = YES; (Default YES) ; This setting determines which key inverts the mouse buttons @@ -371,7 +372,12 @@ ; It's especially useful for one-button controllers, ; such as touchscreens and tablets. ; Possible values are 0 (none), 1 (control), 2 (alt) - + ; Swap_buttons = 1; (Default 1) + ; Last directory browsed with the script selector. + ; Leave blank to initially start in (data directory)/scripts + ; + Scripts_directory = + ; end of configuration From 27e8d15971a07e30efa7219093f7ef5a4fb11ca7 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sun, 3 Apr 2011 16:45:10 +0000 Subject: [PATCH 33/46] Reorganized scripts, fixed 'memory' not working with subdirectories git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1765 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- .../brush/ApplyColor.lua} | 3 +-- .../brush/Fisheye.lua} | 0 .../brush/GrayscaleAvg.lua} | 0 .../brush/GrayscaleDesat.lua} | 0 .../brush/Halfsmooth.lua} | 0 .../brush/Waves.lua} | 0 .../demo/3DPalette.lua} | 2 +- .../demo/Ellipse.lua} | 13 +------------ .../demo/FlipPicture.lua} | 0 .../demo/SierpinskyCarpet.lua} | 0 .../demo/SierpinskyTriangle.lua} | 0 .../demo/Spritesheet.lua} | 5 ++--- .../demo/brush/Amigaball.lua} | 8 ++++++++ .../demo/brush/ColorSphere.lua} | 0 .../demo/brush/FindAA.lua} | 0 .../demo/brush/Mandelbrot.lua} | 3 +++ .../{ => samples_2.3}/libs/dawnbringer_lib.lua | 0 .../scripts/{ => samples_2.3}/libs/memory.lua | 18 ++++++++++++------ .../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 38 files changed, 28 insertions(+), 24 deletions(-) rename share/grafx2/scripts/{bru_db_ApplyColor.lua => samples_2.3/brush/ApplyColor.lua} (98%) rename share/grafx2/scripts/{bru_db_Fisheye.lua => samples_2.3/brush/Fisheye.lua} (100%) rename share/grafx2/scripts/{bru_db_GrayscaleAvg.lua => samples_2.3/brush/GrayscaleAvg.lua} (100%) rename share/grafx2/scripts/{bru_db_GrayscaleDesat.lua => samples_2.3/brush/GrayscaleDesat.lua} (100%) rename share/grafx2/scripts/{bru_db_Halfsmooth.lua => samples_2.3/brush/Halfsmooth.lua} (100%) rename share/grafx2/scripts/{bru_db_Waves.lua => samples_2.3/brush/Waves.lua} (100%) rename share/grafx2/scripts/{ani_db_3DPalette.lua => samples_2.3/demo/3DPalette.lua} (99%) rename share/grafx2/scripts/{ani_db_ellipse.lua => samples_2.3/demo/Ellipse.lua} (84%) rename share/grafx2/scripts/{pic_ni_flippicture.lua => samples_2.3/demo/FlipPicture.lua} (100%) rename share/grafx2/scripts/{pic_db_SierpinskyCarpet.lua => samples_2.3/demo/SierpinskyCarpet.lua} (100%) rename share/grafx2/scripts/{pic_db_SierpinskyTriangle.lua => samples_2.3/demo/SierpinskyTriangle.lua} (100%) rename share/grafx2/scripts/{ani_db_spritesheet.lua => samples_2.3/demo/Spritesheet.lua} (91%) rename share/grafx2/scripts/{bru_db_Amigaball.lua => samples_2.3/demo/brush/Amigaball.lua} (92%) rename share/grafx2/scripts/{bru_db_ColorSphere.lua => samples_2.3/demo/brush/ColorSphere.lua} (100%) rename share/grafx2/scripts/{bru_db_FindAA.lua => samples_2.3/demo/brush/FindAA.lua} (100%) rename share/grafx2/scripts/{bru_db_Mandelbrot.lua => samples_2.3/demo/brush/Mandelbrot.lua} (95%) rename share/grafx2/scripts/{ => samples_2.3}/libs/dawnbringer_lib.lua (100%) rename share/grafx2/scripts/{ => samples_2.3}/libs/memory.lua (84%) rename share/grafx2/scripts/{pal_db_Desaturate.lua => samples_2.3/palette/Desaturate.lua} (100%) rename share/grafx2/scripts/{pal_db_ExpandColors.lua => samples_2.3/palette/ExpandColors.lua} (100%) rename share/grafx2/scripts/{pal_db_FillColorCube.lua => samples_2.3/palette/FillColorCube.lua} (100%) rename share/grafx2/scripts/{pal_db_InvertedRGB.lua => samples_2.3/palette/InvertedRGB.lua} (100%) rename share/grafx2/scripts/{pal_db_Set3bit.lua => samples_2.3/palette/Set3bit.lua} (100%) rename share/grafx2/scripts/{pal_db_Set6bit.lua => samples_2.3/palette/Set6bit.lua} (100%) rename share/grafx2/scripts/{pal_db_SetC64Palette.lua => samples_2.3/palette/SetC64Palette.lua} (100%) rename share/grafx2/scripts/{pal_db_ShiftHue.lua => samples_2.3/palette/ShiftHue.lua} (100%) rename share/grafx2/scripts/{pic_ni_cellcolourreducer.lua => samples_2.3/picture/CellColourReducer.lua} (100%) rename share/grafx2/scripts/{pic_ni_drawgridisometric.lua => samples_2.3/picture/DrawGridIsometric.lua} (100%) rename share/grafx2/scripts/{pic_ni_drawgridorthogonal_rgbmatchcolor.lua => samples_2.3/picture/DrawGridOrthogonal_RGB.lua} (100%) rename share/grafx2/scripts/{pic_ni_drawgridorthogonal_indexedcolour.lua => samples_2.3/picture/DrawgridOrthogonal_Index.lua} (100%) rename share/grafx2/scripts/{pic_ni_GlassGridFilter.lua => samples_2.3/picture/GlassGridFilter.lua} (100%) rename share/grafx2/scripts/{pic_ni_palettetopicture.lua => samples_2.3/picture/PaletteToPicture.lua} (100%) rename share/grafx2/scripts/{pic_db_Pic2isometric.lua => samples_2.3/picture/Pic2isometric.lua} (100%) rename share/grafx2/scripts/{pic_db_Rainbow-Dark2Bright.lua => samples_2.3/picture/Rainbow-Dark2Bright.lua} (100%) rename share/grafx2/scripts/{scn_db_RemapImage2RGB.lua => samples_2.3/picture/RemapImage2RGB.lua} (100%) rename share/grafx2/scripts/{scn_db_RemapImage2RGB_ed.lua => samples_2.3/picture/RemapImage2RGB_ed.lua} (100%) rename share/grafx2/scripts/{scn_db_RemapImageTo3bitPal.lua => samples_2.3/picture/RemapImageTo3bitPal.lua} (100%) rename share/grafx2/scripts/{pic_ni_xbitcolourspacefrompalette.lua => samples_2.3/picture/XBitColourXpaceFromPalette.lua} (100%) diff --git a/share/grafx2/scripts/bru_db_ApplyColor.lua b/share/grafx2/scripts/samples_2.3/brush/ApplyColor.lua similarity index 98% rename from share/grafx2/scripts/bru_db_ApplyColor.lua rename to share/grafx2/scripts/samples_2.3/brush/ApplyColor.lua index 94db376e..3da26c1d 100644 --- a/share/grafx2/scripts/bru_db_ApplyColor.lua +++ b/share/grafx2/scripts/samples_2.3/brush/ApplyColor.lua @@ -9,8 +9,7 @@ -- as published by the Free Software Foundation; version 2 -- of the License. See ---dofile("dawnbringer_lib.lua") -require("dawnbringer_lib") +dofile("../libs/dawnbringer_lib.lua") OK,tin,clz,fade,amt,brikeep,falloff,nobg,briweight = inputbox("Apply PenColor 2 Brush", diff --git a/share/grafx2/scripts/bru_db_Fisheye.lua b/share/grafx2/scripts/samples_2.3/brush/Fisheye.lua similarity index 100% rename from share/grafx2/scripts/bru_db_Fisheye.lua rename to share/grafx2/scripts/samples_2.3/brush/Fisheye.lua diff --git a/share/grafx2/scripts/bru_db_GrayscaleAvg.lua b/share/grafx2/scripts/samples_2.3/brush/GrayscaleAvg.lua similarity index 100% rename from share/grafx2/scripts/bru_db_GrayscaleAvg.lua rename to share/grafx2/scripts/samples_2.3/brush/GrayscaleAvg.lua diff --git a/share/grafx2/scripts/bru_db_GrayscaleDesat.lua b/share/grafx2/scripts/samples_2.3/brush/GrayscaleDesat.lua similarity index 100% rename from share/grafx2/scripts/bru_db_GrayscaleDesat.lua rename to share/grafx2/scripts/samples_2.3/brush/GrayscaleDesat.lua diff --git a/share/grafx2/scripts/bru_db_Halfsmooth.lua b/share/grafx2/scripts/samples_2.3/brush/Halfsmooth.lua similarity index 100% rename from share/grafx2/scripts/bru_db_Halfsmooth.lua rename to share/grafx2/scripts/samples_2.3/brush/Halfsmooth.lua diff --git a/share/grafx2/scripts/bru_db_Waves.lua b/share/grafx2/scripts/samples_2.3/brush/Waves.lua similarity index 100% rename from share/grafx2/scripts/bru_db_Waves.lua rename to share/grafx2/scripts/samples_2.3/brush/Waves.lua diff --git a/share/grafx2/scripts/ani_db_3DPalette.lua b/share/grafx2/scripts/samples_2.3/demo/3DPalette.lua similarity index 99% rename from share/grafx2/scripts/ani_db_3DPalette.lua rename to share/grafx2/scripts/samples_2.3/demo/3DPalette.lua index bf119e65..b496240d 100644 --- a/share/grafx2/scripts/ani_db_3DPalette.lua +++ b/share/grafx2/scripts/samples_2.3/demo/3DPalette.lua @@ -15,7 +15,7 @@ -- "-" (Num): Zoom Out -- Esc: Exit script -require("dawnbringer_lib") +dofile("../libs/dawnbringer_lib.lua") BRIDIAG_SHOW = 1 -- Show brightness/Grayscale diagonal (1 = on, 0 = off) diff --git a/share/grafx2/scripts/ani_db_ellipse.lua b/share/grafx2/scripts/samples_2.3/demo/Ellipse.lua similarity index 84% rename from share/grafx2/scripts/ani_db_ellipse.lua rename to share/grafx2/scripts/samples_2.3/demo/Ellipse.lua index fe8da2f2..f24df21c 100644 --- a/share/grafx2/scripts/ani_db_ellipse.lua +++ b/share/grafx2/scripts/samples_2.3/demo/Ellipse.lua @@ -23,18 +23,7 @@ function ellipse2(x,y,a,b,stp,rot,col) sa = m.sin(ast*n) * b; ca = m.cos(ast*n) * a x1 = x + ca * cb - sa * sb y1 = y + ca * sb + sa * cb - if (n > 0) then line(ox,oy,x1,y1,col); end - end -end --- - --- -function line(x1,y1,x2,y2,c) - local n,st,m; m = math - st = m.max(1,m.abs(x2-x1),m.abs(y2-y1)); - for n = 0, st, 1 do - putpicturepixel(m.floor(x1+n*(x2-x1)/st), m.floor(y1+n*(y2-y1)/st), -c ); + if (n > 0) then drawline(ox,oy,x1,y1,col); end end end -- diff --git a/share/grafx2/scripts/pic_ni_flippicture.lua b/share/grafx2/scripts/samples_2.3/demo/FlipPicture.lua similarity index 100% rename from share/grafx2/scripts/pic_ni_flippicture.lua rename to share/grafx2/scripts/samples_2.3/demo/FlipPicture.lua diff --git a/share/grafx2/scripts/pic_db_SierpinskyCarpet.lua b/share/grafx2/scripts/samples_2.3/demo/SierpinskyCarpet.lua similarity index 100% rename from share/grafx2/scripts/pic_db_SierpinskyCarpet.lua rename to share/grafx2/scripts/samples_2.3/demo/SierpinskyCarpet.lua diff --git a/share/grafx2/scripts/pic_db_SierpinskyTriangle.lua b/share/grafx2/scripts/samples_2.3/demo/SierpinskyTriangle.lua similarity index 100% rename from share/grafx2/scripts/pic_db_SierpinskyTriangle.lua rename to share/grafx2/scripts/samples_2.3/demo/SierpinskyTriangle.lua diff --git a/share/grafx2/scripts/ani_db_spritesheet.lua b/share/grafx2/scripts/samples_2.3/demo/Spritesheet.lua similarity index 91% rename from share/grafx2/scripts/ani_db_spritesheet.lua rename to share/grafx2/scripts/samples_2.3/demo/Spritesheet.lua index 9c964047..171dcfaa 100644 --- a/share/grafx2/scripts/ani_db_spritesheet.lua +++ b/share/grafx2/scripts/samples_2.3/demo/Spritesheet.lua @@ -2,12 +2,11 @@ --Spare page holds data - Plays on current --by Richard Fhager -require("memory") +dofile("../libs/memory.lua") arg=memory.load({XS=16,YS=16,SPACE=1,FRAMES=8,XOFF=0,YOFF=0,FPS=10}) -OK, XS, YS, SPACE, FRAMES, XOFF, YOFF, FPS = inputbox("Sprite-Sheet -Animator", +OK, XS, YS, SPACE, FRAMES, XOFF, YOFF, FPS = inputbox("Sprite-Sheet Animator", "Sprite X-size", arg.XS, 1, 256,0, "Sprite Y-size", arg.YS, 1, 256,0, "Spacing", arg.SPACE, 0, 32,0, diff --git a/share/grafx2/scripts/bru_db_Amigaball.lua b/share/grafx2/scripts/samples_2.3/demo/brush/Amigaball.lua similarity index 92% rename from share/grafx2/scripts/bru_db_Amigaball.lua rename to share/grafx2/scripts/samples_2.3/demo/brush/Amigaball.lua index 0ed613ad..115a34a9 100644 --- a/share/grafx2/scripts/bru_db_Amigaball.lua +++ b/share/grafx2/scripts/samples_2.3/demo/brush/Amigaball.lua @@ -1,4 +1,7 @@ --BRUSH Scene: Amigaball 1.0 +-- +--Draws the famous 'Amiga ball' in the brush. +-- --by Richard Fhager --http://hem.fyristorg.com/dawnbringer/ @@ -15,6 +18,11 @@ w, h = getbrushsize() +if (w<64 or h<64) then + setbrushsize(64,64) + w=64 + h=64 +end for y = 0, h - 1, 1 do for x = 0, w - 1, 1 do diff --git a/share/grafx2/scripts/bru_db_ColorSphere.lua b/share/grafx2/scripts/samples_2.3/demo/brush/ColorSphere.lua similarity index 100% rename from share/grafx2/scripts/bru_db_ColorSphere.lua rename to share/grafx2/scripts/samples_2.3/demo/brush/ColorSphere.lua diff --git a/share/grafx2/scripts/bru_db_FindAA.lua b/share/grafx2/scripts/samples_2.3/demo/brush/FindAA.lua similarity index 100% rename from share/grafx2/scripts/bru_db_FindAA.lua rename to share/grafx2/scripts/samples_2.3/demo/brush/FindAA.lua diff --git a/share/grafx2/scripts/bru_db_Mandelbrot.lua b/share/grafx2/scripts/samples_2.3/demo/brush/Mandelbrot.lua similarity index 95% rename from share/grafx2/scripts/bru_db_Mandelbrot.lua rename to share/grafx2/scripts/samples_2.3/demo/brush/Mandelbrot.lua index 6fc12433..d93b8f6b 100644 --- a/share/grafx2/scripts/bru_db_Mandelbrot.lua +++ b/share/grafx2/scripts/samples_2.3/demo/brush/Mandelbrot.lua @@ -1,4 +1,7 @@ --BRUSH Scene: Mandelbrot fractal v0.5 +-- +--Draws a Mandelbrot fractal in the current brush. +-- --by Richard Fhager --http://hem.fyristorg.com/dawnbringer/ diff --git a/share/grafx2/scripts/libs/dawnbringer_lib.lua b/share/grafx2/scripts/samples_2.3/libs/dawnbringer_lib.lua similarity index 100% rename from share/grafx2/scripts/libs/dawnbringer_lib.lua rename to share/grafx2/scripts/samples_2.3/libs/dawnbringer_lib.lua diff --git a/share/grafx2/scripts/libs/memory.lua b/share/grafx2/scripts/samples_2.3/libs/memory.lua similarity index 84% rename from share/grafx2/scripts/libs/memory.lua rename to share/grafx2/scripts/samples_2.3/libs/memory.lua index 22d1ea24..f650e873 100644 --- a/share/grafx2/scripts/libs/memory.lua +++ b/share/grafx2/scripts/samples_2.3/libs/memory.lua @@ -3,7 +3,7 @@ -- memory.save(tab) and tab=memory.load() -- -- The data will be stored in file called --- ZZZ.dat +-- .dat -- in the lua directory -- -- Example 1: @@ -74,12 +74,18 @@ memory = -- Get part after directory name last_slash=0 while true do - local pos = string.find(info.short_src, "/", last_slash+1) + local pos = string.find(info.source, "/", last_slash+1) if (pos==nil) then break end last_slash=pos end - caller=string.sub(info.short_src, last_slash+1) - + while true do + local pos = string.find(info.source, "\\", last_slash+1) + if (pos==nil) then break end + last_slash=pos + end + + caller=string.sub(info.source, last_slash+1) + -- Remove file extension if (string.sub(caller,-4, -1)==".lua") then caller=string.sub(caller, 1, -5) @@ -94,7 +100,7 @@ memory = -- messagebox(tostring(k)) -- messagebox(tostring(v)) --end - local f, e = io.open("ZZZ"..caller..".dat", "w"); + local f, e = io.open(caller..".dat", "w"); if (f ~= nil) then f:write("Entry {\n") for k, v in pairs(o) do @@ -119,7 +125,7 @@ memory = o[k]=v end end - local f = (loadfile("ZZZ"..caller..".dat")) + local f = (loadfile(caller..".dat")) if (f ~= nil) then f() end diff --git a/share/grafx2/scripts/pal_db_Desaturate.lua b/share/grafx2/scripts/samples_2.3/palette/Desaturate.lua similarity index 100% rename from share/grafx2/scripts/pal_db_Desaturate.lua rename to share/grafx2/scripts/samples_2.3/palette/Desaturate.lua diff --git a/share/grafx2/scripts/pal_db_ExpandColors.lua b/share/grafx2/scripts/samples_2.3/palette/ExpandColors.lua similarity index 100% rename from share/grafx2/scripts/pal_db_ExpandColors.lua rename to share/grafx2/scripts/samples_2.3/palette/ExpandColors.lua diff --git a/share/grafx2/scripts/pal_db_FillColorCube.lua b/share/grafx2/scripts/samples_2.3/palette/FillColorCube.lua similarity index 100% rename from share/grafx2/scripts/pal_db_FillColorCube.lua rename to share/grafx2/scripts/samples_2.3/palette/FillColorCube.lua diff --git a/share/grafx2/scripts/pal_db_InvertedRGB.lua b/share/grafx2/scripts/samples_2.3/palette/InvertedRGB.lua similarity index 100% rename from share/grafx2/scripts/pal_db_InvertedRGB.lua rename to share/grafx2/scripts/samples_2.3/palette/InvertedRGB.lua diff --git a/share/grafx2/scripts/pal_db_Set3bit.lua b/share/grafx2/scripts/samples_2.3/palette/Set3bit.lua similarity index 100% rename from share/grafx2/scripts/pal_db_Set3bit.lua rename to share/grafx2/scripts/samples_2.3/palette/Set3bit.lua diff --git a/share/grafx2/scripts/pal_db_Set6bit.lua b/share/grafx2/scripts/samples_2.3/palette/Set6bit.lua similarity index 100% rename from share/grafx2/scripts/pal_db_Set6bit.lua rename to share/grafx2/scripts/samples_2.3/palette/Set6bit.lua diff --git a/share/grafx2/scripts/pal_db_SetC64Palette.lua b/share/grafx2/scripts/samples_2.3/palette/SetC64Palette.lua similarity index 100% rename from share/grafx2/scripts/pal_db_SetC64Palette.lua rename to share/grafx2/scripts/samples_2.3/palette/SetC64Palette.lua diff --git a/share/grafx2/scripts/pal_db_ShiftHue.lua b/share/grafx2/scripts/samples_2.3/palette/ShiftHue.lua similarity index 100% rename from share/grafx2/scripts/pal_db_ShiftHue.lua rename to share/grafx2/scripts/samples_2.3/palette/ShiftHue.lua diff --git a/share/grafx2/scripts/pic_ni_cellcolourreducer.lua b/share/grafx2/scripts/samples_2.3/picture/CellColourReducer.lua similarity index 100% rename from share/grafx2/scripts/pic_ni_cellcolourreducer.lua rename to share/grafx2/scripts/samples_2.3/picture/CellColourReducer.lua diff --git a/share/grafx2/scripts/pic_ni_drawgridisometric.lua b/share/grafx2/scripts/samples_2.3/picture/DrawGridIsometric.lua similarity index 100% rename from share/grafx2/scripts/pic_ni_drawgridisometric.lua rename to share/grafx2/scripts/samples_2.3/picture/DrawGridIsometric.lua diff --git a/share/grafx2/scripts/pic_ni_drawgridorthogonal_rgbmatchcolor.lua b/share/grafx2/scripts/samples_2.3/picture/DrawGridOrthogonal_RGB.lua similarity index 100% rename from share/grafx2/scripts/pic_ni_drawgridorthogonal_rgbmatchcolor.lua rename to share/grafx2/scripts/samples_2.3/picture/DrawGridOrthogonal_RGB.lua diff --git a/share/grafx2/scripts/pic_ni_drawgridorthogonal_indexedcolour.lua b/share/grafx2/scripts/samples_2.3/picture/DrawgridOrthogonal_Index.lua similarity index 100% rename from share/grafx2/scripts/pic_ni_drawgridorthogonal_indexedcolour.lua rename to share/grafx2/scripts/samples_2.3/picture/DrawgridOrthogonal_Index.lua diff --git a/share/grafx2/scripts/pic_ni_GlassGridFilter.lua b/share/grafx2/scripts/samples_2.3/picture/GlassGridFilter.lua similarity index 100% rename from share/grafx2/scripts/pic_ni_GlassGridFilter.lua rename to share/grafx2/scripts/samples_2.3/picture/GlassGridFilter.lua diff --git a/share/grafx2/scripts/pic_ni_palettetopicture.lua b/share/grafx2/scripts/samples_2.3/picture/PaletteToPicture.lua similarity index 100% rename from share/grafx2/scripts/pic_ni_palettetopicture.lua rename to share/grafx2/scripts/samples_2.3/picture/PaletteToPicture.lua diff --git a/share/grafx2/scripts/pic_db_Pic2isometric.lua b/share/grafx2/scripts/samples_2.3/picture/Pic2isometric.lua similarity index 100% rename from share/grafx2/scripts/pic_db_Pic2isometric.lua rename to share/grafx2/scripts/samples_2.3/picture/Pic2isometric.lua diff --git a/share/grafx2/scripts/pic_db_Rainbow-Dark2Bright.lua b/share/grafx2/scripts/samples_2.3/picture/Rainbow-Dark2Bright.lua similarity index 100% rename from share/grafx2/scripts/pic_db_Rainbow-Dark2Bright.lua rename to share/grafx2/scripts/samples_2.3/picture/Rainbow-Dark2Bright.lua diff --git a/share/grafx2/scripts/scn_db_RemapImage2RGB.lua b/share/grafx2/scripts/samples_2.3/picture/RemapImage2RGB.lua similarity index 100% rename from share/grafx2/scripts/scn_db_RemapImage2RGB.lua rename to share/grafx2/scripts/samples_2.3/picture/RemapImage2RGB.lua diff --git a/share/grafx2/scripts/scn_db_RemapImage2RGB_ed.lua b/share/grafx2/scripts/samples_2.3/picture/RemapImage2RGB_ed.lua similarity index 100% rename from share/grafx2/scripts/scn_db_RemapImage2RGB_ed.lua rename to share/grafx2/scripts/samples_2.3/picture/RemapImage2RGB_ed.lua diff --git a/share/grafx2/scripts/scn_db_RemapImageTo3bitPal.lua b/share/grafx2/scripts/samples_2.3/picture/RemapImageTo3bitPal.lua similarity index 100% rename from share/grafx2/scripts/scn_db_RemapImageTo3bitPal.lua rename to share/grafx2/scripts/samples_2.3/picture/RemapImageTo3bitPal.lua diff --git a/share/grafx2/scripts/pic_ni_xbitcolourspacefrompalette.lua b/share/grafx2/scripts/samples_2.3/picture/XBitColourXpaceFromPalette.lua similarity index 100% rename from share/grafx2/scripts/pic_ni_xbitcolourspacefrompalette.lua rename to share/grafx2/scripts/samples_2.3/picture/XBitColourXpaceFromPalette.lua From 7571dcf3e212e4c5f57e78644d5d3a064099f428 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sun, 3 Apr 2011 17:02:34 +0000 Subject: [PATCH 34/46] Changed makefile according to scripts reorganization. make ziprelease works, still need to check install/uninstall git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1766 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/Makefile | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/Makefile b/src/Makefile index bbd0fd62..dd46c4b5 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 ../share/grafx2/skins/skin_Clax3.gif ../share/grafx2/skins/skin_Clax2.gif ../share/grafx2/skins/skin_Clax4.gif -SCRIPT_FILES1 = ../share/grafx2/scripts/bru_db_Amigaball.lua ../share/grafx2/scripts/bru_db_ColorSphere.lua ../share/grafx2/scripts/bru_db_FindAA.lua ../share/grafx2/scripts/bru_db_Fisheye.lua ../share/grafx2/scripts/bru_db_GrayscaleAvg.lua ../share/grafx2/scripts/bru_db_GrayscaleDesat.lua ../share/grafx2/scripts/bru_db_Halfsmooth.lua ../share/grafx2/scripts/bru_db_Mandelbrot.lua ../share/grafx2/scripts/bru_db_Waves.lua ../share/grafx2/scripts/pal_db_Desaturate.lua ../share/grafx2/scripts/pal_db_ExpandColors.lua ../share/grafx2/scripts/pal_db_FillColorCube.lua ../share/grafx2/scripts/pal_db_InvertedRGB.lua ../share/grafx2/scripts/pal_db_Set3bit.lua ../share/grafx2/scripts/pal_db_Set6bit.lua ../share/grafx2/scripts/pal_db_SetC64Palette.lua ../share/grafx2/scripts/pal_db_ShiftHue.lua ../share/grafx2/scripts/pic_db_Pic2isometric.lua ../share/grafx2/scripts/pic_db_Rainbow-Dark2Bright.lua ../share/grafx2/scripts/pic_db_SierpinskyCarpet.lua -SCRIPT_FILES2 = ../share/grafx2/scripts/pic_db_SierpinskyTriangle.lua ../share/grafx2/scripts/pic_ni_GlassGridFilter.lua ../share/grafx2/scripts/scn_db_RemapImage2RGB.lua ../share/grafx2/scripts/scn_db_RemapImage2RGB_ed.lua ../share/grafx2/scripts/scn_db_RemapImageTo3bitPal.lua -SCRIPT_FILES = $(SCRIPT_FILES1) $(SCRIPT_FILES2) - -SCRIPTLIB_FILES = ../share/grafx2/scripts/libs/memory.lua +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 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 @@ -427,9 +427,9 @@ ziprelease: version $(BIN) release echo `sed "s/.*=\"\(.*\)\";/\1/" pversion.c`.`svnversion` | tr " :" "_-" | sed -e "s/\(wip\)\\./\1/I" > $(OBJDIR)/versiontag tar cvzf "../src-`cat $(OBJDIR)/versiontag`.tgz" --strip=1 ../src/*.c ../src/*.h ../src/Makefile ../src/Makefile.dep ../src/gfx2.ico - cd .. && $(ZIP) $(ZIPOPT) "grafx2-`cat $(OBJDIR:../%=%)/versiontag`$(TTFLABEL)-$(PLATFORM).$(ZIP)" $(BIN:../%=%) share/grafx2/gfx2def.ini $(SCRIPT_FILES:../%=%) $(SCRIPTLIB_FILES:../%=%) $(SKIN_FILES:../%=%) share/grafx2/gfx2.gif share/icons/grafx2.svg doc/README.txt doc/COMPILING.txt doc/gpl-2.0.txt doc/PF_fonts.txt $(FONT_FILES:../%=%) doc/README-zlib1.txt doc/README-SDL.txt doc/README-SDL_image.txt doc/README-SDL_ttf.txt doc/README-lua.txt src-`cat $(OBJDIR:../%=%)/versiontag`.tgz $(PLATFORMFILES:../%=%) + cd .. && $(ZIP) $(ZIPOPT) "grafx2-`cat $(OBJDIR:../%=%)/versiontag`$(TTFLABEL)-$(PLATFORM).$(ZIP)" $(BIN:../%=%) share/grafx2/gfx2def.ini $(SCRIPT_FILES:../%=%) $(SKIN_FILES:../%=%) share/grafx2/gfx2.gif share/icons/grafx2.svg doc/README.txt doc/COMPILING.txt doc/gpl-2.0.txt doc/PF_fonts.txt $(FONT_FILES:../%=%) doc/README-zlib1.txt doc/README-SDL.txt doc/README-SDL_image.txt doc/README-SDL_ttf.txt doc/README-lua.txt src-`cat $(OBJDIR:../%=%)/versiontag`.tgz $(PLATFORMFILES:../%=%) $(DELCOMMAND) "../src-`cat $(OBJDIR)/versiontag`.tgz" - tar cvzf "../grafx2-`cat $(OBJDIR)/versiontag`$(TTFLABEL)-src.tgz" --strip=1 --transform 's,^,grafx2/,g' ../src/*.c ../src/*.h ../src/Makefile ../src/Makefile.dep ../share/grafx2/gfx2def.ini $(SCRIPT_FILES) $(SCRIPTLIB_FILES) $(SKIN_FILES) ../src/gfx2.ico ../share/grafx2/gfx2.gif ../share/icons/grafx2.svg ../doc/README.txt ../doc/COMPILING.txt ../doc/gpl-2.0.txt ../doc/PF_fonts.txt ../misc/unix/grafx2.1 ../misc/unix/grafx2.xpm ../misc/unix/grafx2.desktop $(FONT_FILES) + tar cvzf "../grafx2-`cat $(OBJDIR)/versiontag`$(TTFLABEL)-src.tgz" --strip=1 --transform 's,^,grafx2/,g' ../src/*.c ../src/*.h ../src/Makefile ../src/Makefile.dep ../share/grafx2/gfx2def.ini $(SCRIPT_FILES) $(SKIN_FILES) ../src/gfx2.ico ../share/grafx2/gfx2.gif ../share/icons/grafx2.svg ../doc/README.txt ../doc/COMPILING.txt ../doc/gpl-2.0.txt ../doc/PF_fonts.txt ../misc/unix/grafx2.1 ../misc/unix/grafx2.xpm ../misc/unix/grafx2.desktop $(FONT_FILES) $(DELCOMMAND) "$(OBJDIR)/versiontag" testsed : @@ -500,7 +500,6 @@ install : $(BIN) $(CP) ../share/grafx2/fonts/* $(DESTDIR)$(datadir)/grafx2/fonts/ $(CP) $(SKIN_FILES) $(DESTDIR)$(datadir)/grafx2/skins/ $(CP) $(SCRIPT_FILES) $(DESTDIR)$(datadir)/grafx2/scripts/ - $(CP) $(SCRIPTLIB_FILES) $(DESTDIR)$(datadir)/grafx2/scripts/libs/ # Icon and desktop file for debian $(CP) ../misc/unix/grafx2.desktop $(DESTDIR)$(datadir)/applications/ $(CP) ../misc/unix/grafx2.xpm $(DESTDIR)$(pixmapdir) @@ -516,8 +515,6 @@ uninstall : $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/fonts),,$(RMDIR) $(DESTDIR)$(datadir)/grafx2/fonts) $(DELCOMMAND) $(SKIN_FILES:../share%=$(DESTDIR)$(datadir)%) $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/skins),,$(RMDIR) $(DESTDIR)$(datadir)/grafx2/skins) - $(DELCOMMAND) $(SCRIPTLIB_FILES:../share%=$(DESTDIR)$(datadir)%) - $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/libs),,$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/libs) $(DELCOMMAND) $(SCRIPT_FILES:../share%=$(DESTDIR)$(datadir)%) $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts),,$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts) $(if $(wildcard $(DESTDIR)$(datadir)/grafx2),,$(RMDIR) $(DESTDIR)$(datadir)/grafx2) From 65b3c4290ad1c485755b518f0ed3994d9277a59d Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sun, 3 Apr 2011 18:32:27 +0000 Subject: [PATCH 35/46] Fix critical bug: Grafx2 failing to load when no old config file is present (because of attempt to flash red screen, now has interactive mouse feedback, doesn't work before grafx2 is started). Fixed make install/make uninstall, tested on MSYS's shell for the moment git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1767 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/Makefile | 48 ++++++++++++++++++++++++++++++------------------ src/loadsave.c | 3 ++- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/src/Makefile b/src/Makefile index dd46c4b5..4292ee9e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -47,7 +47,7 @@ PLATFORMOBJ = ifdef COMSPEC DELCOMMAND = rm -f MKDIR = mkdir -p - RMDIR = rmdir + 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) @@ -71,7 +71,7 @@ else #AmigaOS (3 or 4) specific DELCOMMAND = rm -rf MKDIR = mkdir -p - RMDIR = rmdir + RMDIR = rmdir --ignore-fail-on-non-empty CP = cp BIN = ../bin/grafx2 COPT = -Wall -c -gstabs `sdl-config --cflags` $(TTFCOPT) @@ -87,7 +87,7 @@ else #Mac OS X specific DELCOMMAND = rm -rf MKDIR = mkdir -p - RMDIR = rmdir + RMDIR = rmdir --ignore-fail-on-non-empty # Force it OPTIM = 3 CP = cp @@ -116,7 +116,7 @@ else #AROS specific DELCOMMAND = rm -rf MKDIR = mkdir -p - RMDIR = rmdir + RMDIR = rmdir --ignore-fail-on-non-empty CP = cp BIN = ../bin/grafx2 COPT = -Wall -g `sdl-config --cflags` $(TTFCOPT) @@ -132,7 +132,7 @@ else #MorphOS specific DELCOMMAND = rm -rf MKDIR = mkdir -p - RMDIR = rmdir + RMDIR = rmdir --ignore-fail-on-non-empty CP = cp BIN = ../bin/grafx2 COPT = -Wall -gstabs -c `sdl-config --cflags` $(TTFCOPT) @@ -148,7 +148,7 @@ else #BeOS specific DELCOMMAND = rm -rf MKDIR = mkdir -p - RMDIR = rmdir + 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 @@ -162,7 +162,7 @@ else #Haiku specific DELCOMMAND = rm -rf MKDIR = mkdir -p - RMDIR = rmdir + RMDIR = rmdir --ignore-fail-on-non-empty CP = cp BIN = ../bin/grafx2 PLATFORMOBJ = $(OBJDIR)/haiku.o @@ -184,7 +184,7 @@ else #SkyOS specific DELCOMMAND = rm -rf MKDIR = mkdir -p - RMDIR = rmdir + RMDIR = rmdir --ignore-fail-on-non-empty CP = cp BIN = ../bin/grafx2 COPT = -W -Wall -Wdeclaration-after-statement -c -g `sdl-config --cflags` $(TTFCOPT) @@ -198,7 +198,7 @@ else #OSF1 / tru64 alpha DELCOMMAND = rm -rf MKDIR = mkdir -p - RMDIR = rmdir + RMDIR = rmdir --ignore-fail-on-non-empty CP = cp ZIP = zip PLATFORMFILES = gfx2.png @@ -214,7 +214,7 @@ else # Linux and FreeBSD specific (default rules) DELCOMMAND = rm -rf MKDIR = mkdir -p - RMDIR = rmdir + RMDIR = rmdir --ignore-fail-on-non-empty CP = cp ZIP = zip PLATFORMFILES = gfx2.png @@ -425,15 +425,12 @@ release : version $(BIN) # Create a zip archive ready for upload to the website, including binaries and sourcecode ziprelease: version $(BIN) release echo `sed "s/.*=\"\(.*\)\";/\1/" pversion.c`.`svnversion` | tr " :" "_-" | sed -e "s/\(wip\)\\./\1/I" > $(OBJDIR)/versiontag - tar cvzf "../src-`cat $(OBJDIR)/versiontag`.tgz" --strip=1 ../src/*.c ../src/*.h ../src/Makefile ../src/Makefile.dep ../src/gfx2.ico cd .. && $(ZIP) $(ZIPOPT) "grafx2-`cat $(OBJDIR:../%=%)/versiontag`$(TTFLABEL)-$(PLATFORM).$(ZIP)" $(BIN:../%=%) share/grafx2/gfx2def.ini $(SCRIPT_FILES:../%=%) $(SKIN_FILES:../%=%) share/grafx2/gfx2.gif share/icons/grafx2.svg doc/README.txt doc/COMPILING.txt doc/gpl-2.0.txt doc/PF_fonts.txt $(FONT_FILES:../%=%) doc/README-zlib1.txt doc/README-SDL.txt doc/README-SDL_image.txt doc/README-SDL_ttf.txt doc/README-lua.txt src-`cat $(OBJDIR:../%=%)/versiontag`.tgz $(PLATFORMFILES:../%=%) $(DELCOMMAND) "../src-`cat $(OBJDIR)/versiontag`.tgz" tar cvzf "../grafx2-`cat $(OBJDIR)/versiontag`$(TTFLABEL)-src.tgz" --strip=1 --transform 's,^,grafx2/,g' ../src/*.c ../src/*.h ../src/Makefile ../src/Makefile.dep ../share/grafx2/gfx2def.ini $(SCRIPT_FILES) $(SKIN_FILES) ../src/gfx2.ico ../share/grafx2/gfx2.gif ../share/icons/grafx2.svg ../doc/README.txt ../doc/COMPILING.txt ../doc/gpl-2.0.txt ../doc/PF_fonts.txt ../misc/unix/grafx2.1 ../misc/unix/grafx2.xpm ../misc/unix/grafx2.desktop $(FONT_FILES) $(DELCOMMAND) "$(OBJDIR)/versiontag" -testsed : - $(BIN) : $(OBJ) test -d ../bin || $(MKDIR) ../bin $(CC) $(OBJ) -o $(BIN) $(LOPT) $(LFLAGS) @@ -491,6 +488,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)/applications || $(MKDIR) $(DESTDIR)$(datadir)/applications test -d $(DESTDIR)$(pixmapdir) || $(MKDIR) $(DESTDIR)$(pixmapdir) # Copy files @@ -499,7 +503,7 @@ install : $(BIN) $(CP) ../share/grafx2/gfx2.gif $(DESTDIR)$(datadir)/grafx2/ $(CP) ../share/grafx2/fonts/* $(DESTDIR)$(datadir)/grafx2/fonts/ $(CP) $(SKIN_FILES) $(DESTDIR)$(datadir)/grafx2/skins/ - $(CP) $(SCRIPT_FILES) $(DESTDIR)$(datadir)/grafx2/scripts/ + for f in $(SCRIPT_FILES); do cp "$$f" "$(DESTDIR)$(bindir)/$$f" ; done # Icon and desktop file for debian $(CP) ../misc/unix/grafx2.desktop $(DESTDIR)$(datadir)/applications/ $(CP) ../misc/unix/grafx2.xpm $(DESTDIR)$(pixmapdir) @@ -512,12 +516,20 @@ uninstall : $(DELCOMMAND) $(DESTDIR)$(datadir)/grafx2/gfx2def.ini $(DELCOMMAND) $(DESTDIR)$(datadir)/grafx2/gfx2.gif $(DELCOMMAND) $(DESTDIR)$(datadir)/grafx2/fonts/* - $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/fonts),,$(RMDIR) $(DESTDIR)$(datadir)/grafx2/fonts) + $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/fonts),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/fonts,) $(DELCOMMAND) $(SKIN_FILES:../share%=$(DESTDIR)$(datadir)%) - $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/skins),,$(RMDIR) $(DESTDIR)$(datadir)/grafx2/skins) + $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/skins),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/skins,) $(DELCOMMAND) $(SCRIPT_FILES:../share%=$(DESTDIR)$(datadir)%) - $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts),,$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts) - $(if $(wildcard $(DESTDIR)$(datadir)/grafx2),,$(RMDIR) $(DESTDIR)$(datadir)/grafx2) + $(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/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,) # Icon and desktop file for debian $(DELCOMMAND) $(DESTDIR)$(datadir)/applications/grafx2.desktop $(DELCOMMAND) $(DESTDIR)$(pixmapdir)/grafx2.xpm diff --git a/src/loadsave.c b/src/loadsave.c index 4b4fdffc..5f135c10 100644 --- a/src/loadsave.c +++ b/src/loadsave.c @@ -619,7 +619,8 @@ void Load_image(T_IO_Context *context) if (File_error>0) { fprintf(stderr,"Unable to load file %s!\n",context->File_name); - Error(0); + if (context->Type!=CONTEXT_SURFACE) + Error(0); } // Post-load From 1d24885ddcafc5d29c8453815f441d57eb150e6f Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Mon, 4 Apr 2011 19:34:15 +0000 Subject: [PATCH 36/46] Beginning of setting to disable multi-shortcuts: settable in options, saved and reloaded, no effect so far. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1768 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- share/grafx2/gfx2def.ini | 7 +++++++ src/buttons.c | 2 +- src/readini.c | 7 +++++++ src/saveini.c | 4 ++++ src/struct.h | 1 + 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/share/grafx2/gfx2def.ini b/share/grafx2/gfx2def.ini index 36f045fa..3d9f6728 100644 --- a/share/grafx2/gfx2def.ini +++ b/share/grafx2/gfx2def.ini @@ -380,4 +380,11 @@ ; Scripts_directory = + ; When this setting is disabled, and you create a shortcut with a key that + ; is already associated to another shortcut, Grafx2 will unset the latter. + ; If you enable this mode, Grafx2 will not make such check, so you can design + ; shortcuts that trigger several actions at once. + ; + Allow_multi_shortcuts = no; (Default no) + ; end of configuration diff --git a/src/buttons.c b/src/buttons.c index d53a8b60..ea73b781 100644 --- a/src/buttons.c +++ b/src/buttons.c @@ -942,7 +942,7 @@ void Button_Settings(void) {"Safety colors:",1,&(selected_config.Safety_colors),0,1,0,Lookup_YesNo}, {"Grid XOR color:",1,&(selected_config.Grid_XOR_color),0,255,3,NULL}, {"Sync views:",1,&(selected_config.Sync_views),0,1,0,Lookup_YesNo}, - {"",0,NULL,0,0,0,NULL}, + {"Multi shortcuts",1,&(selected_config.Allow_multi_shortcuts),0,1,0,Lookup_YesNo}, {"",0,NULL,0,0,0,NULL}, {" --- Input ---",0,NULL,0,0,0,NULL}, diff --git a/src/readini.c b/src/readini.c index 225eabd6..21827b6c 100644 --- a/src/readini.c +++ b/src/readini.c @@ -948,6 +948,13 @@ int Load_INI(T_Config * conf) Append_path(conf->Scripts_directory, "scripts", NULL); } + conf->Allow_multi_shortcuts=0; + // Optional, allow or disallow multiple shortcuts on same key (>=2.3) + if (!Load_INI_get_values (file,buffer,"Allow_multi_shortcuts",1,values)) + { + conf->Allow_multi_shortcuts=(values[0]!=0); + } + // Insert new values here fclose(file); diff --git a/src/saveini.c b/src/saveini.c index fab3cc12..b691965f 100644 --- a/src/saveini.c +++ b/src/saveini.c @@ -702,6 +702,10 @@ int Save_INI(T_Config * conf) if ((return_code=Save_INI_set_strings (old_file,new_file,buffer,"Scripts_directory",conf->Scripts_directory))) goto Erreur_Retour; + values[0]=(conf->Allow_multi_shortcuts); + if ((return_code=Save_INI_set_values (old_file,new_file,buffer,"Allow_multi_shortcuts",1,values,1))) + goto Erreur_Retour; + // Insert new values here Save_INI_flush(old_file,new_file,buffer); diff --git a/src/struct.h b/src/struct.h index f61f820e..75e610f2 100644 --- a/src/struct.h +++ b/src/struct.h @@ -369,6 +369,7 @@ typedef struct byte Stylus_mode; ///< Boolean, true to tweak some tools (eg:Curve) for single-button stylus. word Swap_buttons; ///< Sets which key swaps mouse buttons : 0=none, or MOD_CTRL, or MOD_ALT. char Scripts_directory[MAX_PATH_CHARACTERS];///< Full pathname of directory for Lua scripts + byte Allow_multi_shortcuts; ///< Boolean, true if the same key combination can trigger multiple shortcuts. } T_Config; // Structures utilisées pour les descriptions de pages et de liste de pages. From 860648b19006bb905472934d095af3d8566f9ebc Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Mon, 4 Apr 2011 22:30:02 +0000 Subject: [PATCH 37/46] Multi-shorcuts option now works. Default OFF, it will avoid situations where user mistakenly sets the same key for multiple actions. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1769 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/buttons.c | 9 ++++++-- src/help.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/help.h | 4 ++++ src/helpfile.h | 10 +++++++++ src/main.c | 5 +++++ 5 files changed, 87 insertions(+), 2 deletions(-) diff --git a/src/buttons.c b/src/buttons.c index ea73b781..0f22a734 100644 --- a/src/buttons.c +++ b/src/buttons.c @@ -942,7 +942,7 @@ void Button_Settings(void) {"Safety colors:",1,&(selected_config.Safety_colors),0,1,0,Lookup_YesNo}, {"Grid XOR color:",1,&(selected_config.Grid_XOR_color),0,255,3,NULL}, {"Sync views:",1,&(selected_config.Sync_views),0,1,0,Lookup_YesNo}, - {"Multi shortcuts",1,&(selected_config.Allow_multi_shortcuts),0,1,0,Lookup_YesNo}, + {"",0,NULL,0,0,0,NULL}, {"",0,NULL,0,0,0,NULL}, {" --- Input ---",0,NULL,0,0,0,NULL}, @@ -966,7 +966,7 @@ void Button_Settings(void) {"Auto discontinuous:",1,&(selected_config.Auto_discontinuous),0,1,0,Lookup_YesNo}, {"Auto count colors:",1,&(selected_config.Auto_nb_used),0,1,0,Lookup_YesNo}, {"Right click colorpick:",1,&(selected_config.Right_click_colorpick),0,1,0,Lookup_YesNo}, - {"",0,NULL,0,0,0,NULL}, + {"Multi shortcuts:",1,&(selected_config.Allow_multi_shortcuts),0,1,0,Lookup_YesNo}, {"",0,NULL,0,0,0,NULL}, {" --- File selector ---",0,NULL,0,0,0,NULL}, @@ -1152,6 +1152,11 @@ void Button_Settings(void) Spare_fileselector_position=0; Spare_fileselector_offset=0; } + if(Config.Allow_multi_shortcuts && !selected_config.Allow_multi_shortcuts) + { + // User just disabled multi shortcuts: make them unique now. + Remove_duplicate_shortcuts(); + } // Copy all Config=selected_config; diff --git a/src/help.c b/src/help.c index 388eb34d..34eec25c 100644 --- a/src/help.c +++ b/src/help.c @@ -228,6 +228,32 @@ void Window_set_shortcut(int action_id) shortcut_ptr[0]=backup_shortcut[0]; shortcut_ptr[1]=backup_shortcut[1]; case 2: // OK + // Replace twice by single + if (shortcut_ptr[0]==shortcut_ptr[1]) + shortcut_ptr[1]=0; + // Remove all other shortcuts that use same keys + if (!Config.Allow_multi_shortcuts) + { + int n; + for (n=0; n<2; n++) + { + if (shortcut_ptr[n]!=0) + { + int i; + for(i=0; i Date: Mon, 4 Apr 2011 22:35:30 +0000 Subject: [PATCH 38/46] Removed skins Clax2 Clax3 from makefile, and thus default 2.3 package git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1770 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 4292ee9e..136c0eca 100644 --- a/src/Makefile +++ b/src/Makefile @@ -372,7 +372,7 @@ endif # This is the list of the objects we want to build. Dependancies are built by "make depend" automatically. OBJ = $(OBJDIR)/main.o $(OBJDIR)/init.o $(OBJDIR)/graph.o $(OBJDIR)/sdlscreen.o $(OBJDIR)/misc.o $(OBJDIR)/special.o $(OBJDIR)/buttons.o $(OBJDIR)/palette.o $(OBJDIR)/help.o $(OBJDIR)/operatio.o $(OBJDIR)/pages.o $(OBJDIR)/loadsave.o $(OBJDIR)/readline.o $(OBJDIR)/engine.o $(OBJDIR)/filesel.o $(OBJDIR)/op_c.o $(OBJDIR)/readini.o $(OBJDIR)/saveini.o $(OBJDIR)/shade.o $(OBJDIR)/keyboard.o $(OBJDIR)/io.o $(OBJDIR)/version.o $(OBJDIR)/text.o $(OBJDIR)/SFont.o $(OBJDIR)/setup.o $(OBJDIR)/pxsimple.o $(OBJDIR)/pxtall.o $(OBJDIR)/pxwide.o $(OBJDIR)/pxdouble.o $(OBJDIR)/pxtriple.o $(OBJDIR)/pxtall2.o $(OBJDIR)/pxwide2.o $(OBJDIR)/pxquad.o $(OBJDIR)/windows.o $(OBJDIR)/brush.o $(OBJDIR)/realpath.o $(OBJDIR)/mountlist.o $(OBJDIR)/input.o $(OBJDIR)/hotkeys.o $(OBJDIR)/transform.o $(OBJDIR)/pversion.o $(OBJDIR)/factory.o $(PLATFORMOBJ) $(OBJDIR)/fileformats.o $(OBJDIR)/miscfileformats.o $(OBJDIR)/libraw2crtc.o $(OBJDIR)/brush_ops.o $(OBJDIR)/buttons_effects.o $(OBJDIR)/layers.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 ../share/grafx2/skins/skin_Clax3.gif ../share/grafx2/skins/skin_Clax2.gif ../share/grafx2/skins/skin_Clax4.gif +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 \ From b411f01b4c121d384633b706eb9d1dd2be43ed7d Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Thu, 7 Apr 2011 20:50:38 +0000 Subject: [PATCH 39/46] Remove 'wip' tag, uploaded NSIS installer script, updated readme git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1771 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- doc/README.txt | 1 + install/WinInstaller_23.nsi | 338 ++++++++++++++++++++++++++++++++++++ install/vector.bmp | Bin 0 -> 154544 bytes src/pversion.c | 2 +- 4 files changed, 340 insertions(+), 1 deletion(-) create mode 100644 install/WinInstaller_23.nsi create mode 100644 install/vector.bmp diff --git a/doc/README.txt b/doc/README.txt index eab3e2f5..82f032f7 100644 --- a/doc/README.txt +++ b/doc/README.txt @@ -77,6 +77,7 @@ Sends greetings and glops to pouet.net : http://pouet.net/prod.php?which=51865 === HISTORY === Short revision history : + * 04/2011 2.3 Further improvements * 03/2010 2.2 Layers, Lua scripting * 09/2009 2.1 GUI improvements and some new features. * 06/2009 2.0 Completed the features planned by Sunset Design. diff --git a/install/WinInstaller_23.nsi b/install/WinInstaller_23.nsi new file mode 100644 index 00000000..cc8030a2 --- /dev/null +++ b/install/WinInstaller_23.nsi @@ -0,0 +1,338 @@ +;NSIS Modern User Interface +;Based on the Example Script written by Joost Verburg + +;-------------------------------- +;Include Modern UI + + !include "MUI2.nsh" + +;-------------------------------- +;General + + ;Name and file + Name "Grafx2" + OutFile "grafx2-2.3.1771.win32.exe" + + ;Default installation folder + InstallDir "$PROGRAMFILES\Grafx2" + + ;Get installation folder from registry if available + InstallDirRegKey HKCU "Software\Grafx2" "" + + ;Request application privileges for Windows Vista + RequestExecutionLevel user + +;-------------------------------- +;Interface Settings + + !define MUI_ABORTWARNING + +;-------------------------------- +;Pages + + !define MUI_WELCOMEFINISHPAGE_BITMAP vector.bmp + !define MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH + !insertmacro MUI_PAGE_WELCOME + ;!define MUI_HEADERIMAGE_BITMAP logo_scenish.bmp + ;!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH + !insertmacro MUI_PAGE_LICENSE "..\doc\gpl-2.0.txt" + !insertmacro MUI_PAGE_COMPONENTS + !insertmacro MUI_PAGE_DIRECTORY + !insertmacro MUI_PAGE_INSTFILES + + !insertmacro MUI_UNPAGE_CONFIRM + !insertmacro MUI_UNPAGE_INSTFILES + +;-------------------------------- +;Languages + + !insertmacro MUI_LANGUAGE "English" + +;-------------------------------- +;Functions + +Function .onInstSuccess + MessageBox MB_YESNO "Run GrafX2 now ?" IDNO norun + Exec $INSTDIR\bin\grafx2.exe + norun: +FunctionEnd + +;-------------------------------- +;Installer Sections + +Section "Grafx2" SecProgram + SectionIn RO + SetOutPath "$INSTDIR" + ;ADD YOUR OWN FILES HERE... + File ..\src-2.3.1771.tgz + SetOutPath "$INSTDIR\bin" + File ..\bin\grafx2.exe + File ..\bin\SDL_image.dll + File ..\bin\SDL.dll + File ..\bin\libfreetype-6.dll + File ..\bin\SDL_ttf.dll + File ..\bin\zlib1.dll + File ..\bin\libpng14-14.dll + SetOutPath "$INSTDIR\share\grafx2" + File ..\share\grafx2\gfx2.gif + File ..\share\grafx2\gfx2def.ini + SetOutPath "$INSTDIR\share\grafx2\skins" + File ..\share\grafx2\skins\font_Classic.png + File ..\share\grafx2\skins\font_DPaint.png + File ..\share\grafx2\skins\font_Fairlight.png + File ..\share\grafx2\skins\font_Fun.png + File ..\share\grafx2\skins\font_Melon.png + File ..\share\grafx2\skins\font_Seen.png + File ..\share\grafx2\skins\skin_Aurora.png + File ..\share\grafx2\skins\skin_classic.png + File ..\share\grafx2\skins\skin_DPaint.png + File ..\share\grafx2\skins\skin_modern.png + File ..\share\grafx2\skins\skin_scenish.png + SetOutPath "$INSTDIR\share\grafx2\scripts\samples_2.3\brush" + File ..\share\grafx2\scripts\samples_2.3\brush\ApplyColor.lua + File ..\share\grafx2\scripts\samples_2.3\brush\Fisheye.lua + File ..\share\grafx2\scripts\samples_2.3\brush\GrayscaleAvg.lua + File ..\share\grafx2\scripts\samples_2.3\brush\GrayscaleDesat.lua + File ..\share\grafx2\scripts\samples_2.3\brush\Halfsmooth.lua + File ..\share\grafx2\scripts\samples_2.3\brush\Waves.lua + SetOutPath "$INSTDIR\share\grafx2\scripts\samples_2.3\demo" + File ..\share\grafx2\scripts\samples_2.3\demo\3DPalette.lua + File ..\share\grafx2\scripts\samples_2.3\demo\Ellipse.lua + File ..\share\grafx2\scripts\samples_2.3\demo\FlipPicture.lua + File ..\share\grafx2\scripts\samples_2.3\demo\SierpinskyCarpet.lua + File ..\share\grafx2\scripts\samples_2.3\demo\SierpinskyTriangle.lua + File ..\share\grafx2\scripts\samples_2.3\demo\Spritesheet.lua + SetOutPath "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\brush" + File ..\share\grafx2\scripts\samples_2.3\demo\brush\Amigaball.lua + File ..\share\grafx2\scripts\samples_2.3\demo\brush\ColorSphere.lua + File ..\share\grafx2\scripts\samples_2.3\demo\brush\FindAA.lua + File ..\share\grafx2\scripts\samples_2.3\demo\brush\Mandelbrot.lua + SetOutPath "$INSTDIR\share\grafx2\scripts\samples_2.3\libs" + File ..\share\grafx2\scripts\samples_2.3\libs\dawnbringer_lib.lua + File ..\share\grafx2\scripts\samples_2.3\libs\memory.lua + SetOutPath "$INSTDIR\share\grafx2\scripts\samples_2.3\palette" + File ..\share\grafx2\scripts\samples_2.3\palette\Desaturate.lua + File ..\share\grafx2\scripts\samples_2.3\palette\ExpandColors.lua + File ..\share\grafx2\scripts\samples_2.3\palette\FillColorCube.lua + File ..\share\grafx2\scripts\samples_2.3\palette\InvertedRGB.lua + File ..\share\grafx2\scripts\samples_2.3\palette\Set3bit.lua + File ..\share\grafx2\scripts\samples_2.3\palette\Set6bit.lua + File ..\share\grafx2\scripts\samples_2.3\palette\SetC64Palette.lua + File ..\share\grafx2\scripts\samples_2.3\palette\ShiftHue.lua + SetOutPath "$INSTDIR\share\grafx2\scripts\samples_2.3\picture" + File ..\share\grafx2\scripts\samples_2.3\picture\CellColourReducer.lua + File ..\share\grafx2\scripts\samples_2.3\picture\DrawGridIsometric.lua + File ..\share\grafx2\scripts\samples_2.3\picture\DrawgridOrthogonal_Index.lua + File ..\share\grafx2\scripts\samples_2.3\picture\DrawGridOrthogonal_RGB.lua + File ..\share\grafx2\scripts\samples_2.3\picture\GlassGridFilter.lua + File ..\share\grafx2\scripts\samples_2.3\picture\PaletteToPicture.lua + File ..\share\grafx2\scripts\samples_2.3\picture\Pic2isometric.lua + File ..\share\grafx2\scripts\samples_2.3\picture\Rainbow-Dark2Bright.lua + File ..\share\grafx2\scripts\samples_2.3\picture\RemapImage2RGB.lua + File ..\share\grafx2\scripts\samples_2.3\picture\RemapImage2RGB_ed.lua + File ..\share\grafx2\scripts\samples_2.3\picture\RemapImageTo3bitPal.lua + File ..\share\grafx2\scripts\samples_2.3\picture\XBitColourXpaceFromPalette.lua + SetOutPath "$INSTDIR\doc" + File ..\doc\README.txt + File ..\doc\COMPILING.txt + File ..\doc\README-SDL_ttf.txt + File ..\doc\README-SDL.txt + File ..\doc\README-SDL_image.txt + File ..\doc\README-zlib1.txt + File ..\doc\README-lua.txt + File ..\doc\gpl-2.0.txt + SetOutPath "$INSTDIR\share\grafx2\fonts" + File ..\share\grafx2\fonts\8pxfont.png + File ..\share\grafx2\fonts\Tuffy.ttf + File ..\share\grafx2\fonts\PF_Arma_5__.png + File ..\share\grafx2\fonts\PF_Easta_7_.png + File ..\share\grafx2\fonts\PF_Easta_7__.png + File ..\share\grafx2\fonts\PF_Ronda_7__.png + File ..\share\grafx2\fonts\PF_Tempesta_5.png + File ..\share\grafx2\fonts\PF_Tempesta_5_.png + File ..\share\grafx2\fonts\PF_Tempesta_5__.png + File ..\share\grafx2\fonts\PF_Tempesta_5___.png + File ..\share\grafx2\fonts\PF_Tempesta_7.png + File ..\share\grafx2\fonts\PF_Tempesta_7_.png + File ..\share\grafx2\fonts\PF_Tempesta_7__.png + File ..\share\grafx2\fonts\PF_Tempesta_7___.png + File ..\share\grafx2\fonts\PF_Westa_7_.png + File ..\share\grafx2\fonts\PF_Westa_7__.png + + ; Register in Add/Remove programs + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ + "DisplayName" "GrafX2 (GNU GPL)" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ + "UninstallString" "$INSTDIR\uninstall.exe" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ + "InstalledProductName" "GrafX2" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ + "InstalledLocation" $INSTDIR + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ + "DisplayIcon" "$INSTDIR\gfx2.ico" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ + "URLInfoAbout" "http://grafx2.googlecode.com" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ + "DisplayVersion" "2.3.1771" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ + "NoModify" 1 + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ + "NoRepair" 1 + + ;Store installation folder + WriteRegStr HKLM "Software\Grafx2" "" $INSTDIR + + ;Create uninstaller + WriteUninstaller "$INSTDIR\Uninstall.exe" + +SectionEnd + +Section "Desktop shortcut" SecShortcut + + SetOutPath "$INSTDIR" + CreateShortCut "$DESKTOP\Grafx2.lnk" "$INSTDIR\bin\grafx2.exe" "" "" "" SW_SHOWNORMAL + +SectionEnd + + +;-------------------------------- +;Descriptions + + ;Language strings + LangString DESC_SecProgram ${LANG_ENGLISH} "Grafx2 application and runtime data." + LangString DESC_SecShortcut ${LANG_ENGLISH} "Desktop shortcut." + + ;Assign language strings to sections + !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${SecProgram} $(DESC_SecProgram) + !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcut} $(DESC_SecShortcut) + !insertmacro MUI_FUNCTION_DESCRIPTION_END + +;-------------------------------- +;Uninstaller Section + +Section "un.SecProgram" + + ;ADD YOUR OWN FILES HERE... + Delete "$INSTDIR\bin\grafx2.exe" + Delete "$INSTDIR\src-2.3.1771.tgz" + Delete "$INSTDIR\share\grafx2\gfx2.gif" + Delete "$INSTDIR\share\grafx2\gfx2def.ini" + Delete "$INSTDIR\bin\SDL_image.dll" + Delete "$INSTDIR\bin\SDL.dll" + Delete "$INSTDIR\bin\libfreetype-6.dll" + Delete "$INSTDIR\bin\SDL_ttf.dll" + Delete "$INSTDIR\bin\zlib1.dll" + Delete "$INSTDIR\bin\libpng14-14.dll" + Delete "$INSTDIR\bin\stdout.txt" + Delete "$INSTDIR\bin\stderr.txt" + RMDir "$INSTDIR\bin" + Delete "$INSTDIR\doc\README.txt" + Delete "$INSTDIR\doc\COMPILING.txt" + Delete "$INSTDIR\doc\README-SDL_ttf.txt" + Delete "$INSTDIR\doc\README-SDL.txt" + Delete "$INSTDIR\doc\README-SDL_image.txt" + Delete "$INSTDIR\doc\README-zlib1.txt" + Delete "$INSTDIR\doc\README-lua.txt" + Delete "$INSTDIR\doc\gpl-2.0.txt" + RMDir "$INSTDIR\doc" + Delete "$INSTDIR\share\grafx2\fonts\8pxfont.png" + Delete "$INSTDIR\share\grafx2\fonts\Tuffy.ttf" + Delete "$INSTDIR\share\grafx2\fonts\PF_Arma_5__.png" + Delete "$INSTDIR\share\grafx2\fonts\PF_Easta_7_.png" + Delete "$INSTDIR\share\grafx2\fonts\PF_Easta_7__.png" + Delete "$INSTDIR\share\grafx2\fonts\PF_Ronda_7__.png" + Delete "$INSTDIR\share\grafx2\fonts\PF_Tempesta_5.png" + Delete "$INSTDIR\share\grafx2\fonts\PF_Tempesta_5_.png" + Delete "$INSTDIR\share\grafx2\fonts\PF_Tempesta_5__.png" + Delete "$INSTDIR\share\grafx2\fonts\PF_Tempesta_5___.png" + Delete "$INSTDIR\share\grafx2\fonts\PF_Tempesta_7.png" + Delete "$INSTDIR\share\grafx2\fonts\PF_Tempesta_7_.png" + Delete "$INSTDIR\share\grafx2\fonts\PF_Tempesta_7__.png" + Delete "$INSTDIR\share\grafx2\fonts\PF_Tempesta_7___.png" + Delete "$INSTDIR\share\grafx2\fonts\PF_Westa_7_.png" + Delete "$INSTDIR\share\grafx2\fonts\PF_Westa_7__.png" + RMDir "$INSTDIR\share\grafx2\fonts" + Delete "$INSTDIR\share\grafx2\skins\font_Classic.png" + Delete "$INSTDIR\share\grafx2\skins\font_Fun.png" + Delete "$INSTDIR\share\grafx2\skins\font_Fairlight.png" + Delete "$INSTDIR\share\grafx2\skins\font_Melon.png" + Delete "$INSTDIR\share\grafx2\skins\font_DPaint.png" + Delete "$INSTDIR\share\grafx2\skins\font_Seen.png" + Delete "$INSTDIR\share\grafx2\skins\skin_classic.png" + Delete "$INSTDIR\share\grafx2\skins\skin_Aurora.png" + Delete "$INSTDIR\share\grafx2\skins\skin_modern.png" + Delete "$INSTDIR\share\grafx2\skins\skin_DPaint.png" + Delete "$INSTDIR\share\grafx2\skins\skin_scenish.png" + RMDir "$INSTDIR\share\grafx2\skins" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\brush\ApplyColor.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\brush\Fisheye.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\brush\GrayscaleAvg.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\brush\GrayscaleDesat.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\brush\Halfsmooth.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\brush\Waves.lua" + RMDir "$INSTDIR\share\grafx2\scripts\samples_2.3\brush" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\brush\Amigaball.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\brush\ColorSphere.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\brush\FindAA.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\brush\Mandelbrot.lua" + RMDir "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\brush" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\3DPalette.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\Ellipse.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\FlipPicture.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\SierpinskyCarpet.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\SierpinskyTriangle.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\Spritesheet.lua" + RMDir "$INSTDIR\share\grafx2\scripts\samples_2.3\demo" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\libs\dawnbringer_lib.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\libs\memory.lua" + RMDir "$INSTDIR\share\grafx2\scripts\samples_2.3\libs" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\palette\Desaturate.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\palette\ExpandColors.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\palette\FillColorCube.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\palette\InvertedRGB.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\palette\Set3bit.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\palette\Set6bit.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\palette\SetC64Palette.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\palette\ShiftHue.lua" + RMDir "$INSTDIR\share\grafx2\scripts\samples_2.3\palette" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\CellColourReducer.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\DrawGridIsometric.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\DrawgridOrthogonal_Index.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\DrawGridOrthogonal_RGB.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\GlassGridFilter.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\PaletteToPicture.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\Pic2isometric.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\Rainbow-Dark2Bright.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\RemapImage2RGB.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\RemapImage2RGB_ed.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\RemapImageTo3bitPal.lua" + Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\XBitColourXpaceFromPalette.lua" + RMDir "$INSTDIR\share\grafx2\scripts\samples_2.3\picture" + RMDir "$INSTDIR\share\grafx2\scripts\samples_2.3" + RMDir "$INSTDIR\share\grafx2\scripts" + RMDir "$INSTDIR\share\grafx2" + RMDir "$INSTDIR\share" + Delete "$INSTDIR\Uninstall.exe" + + MessageBox MB_YESNO|MB_DEFBUTTON2|MB_ICONQUESTION "Do you wish to keep your configuration settings ?" IDYES keepconfig IDNO deleteconfig + deleteconfig: + Delete "$INSTDIR\gfx2.cfg" + Delete "$INSTDIR\gfx2.ini" + Delete "$APPDATA\Grafx2\gfx2.cfg" + Delete "$APPDATA\Grafx2\gfx2.ini" + RMDir "$APPDATA\Grafx2" + keepconfig: + + RMDir "$INSTDIR" + + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" + + DeleteRegKey /ifempty HKLM "Software\Grafx2" + +SectionEnd + +Section "un.SecShortcut" + Delete "$DESKTOP\Grafx2.lnk" +SectionEnd + diff --git a/install/vector.bmp b/install/vector.bmp new file mode 100644 index 0000000000000000000000000000000000000000..f9d153b8eac3fb75dd1288a6a3c8fbc720b873c5 GIT binary patch literal 154544 zcmeI5cWe{c*Z22%{(b*?LuAi55fC6E1q7ifp$S40F$5*BMX(EqjzU|}tx!eh2^&Ck zew2`x5|)>Q^7}0%s|Au3uq=qBiIyNzh*E4vE(v0@e$Jh1kEh#CH=O7at{r>E^ZoeT zx#gU56UXOH`R}jD&j9!r1^=?)-@yO+>Z||yih&ya3Hd)?eMSCxeq8v23ZMe004jhA zpaQ4>Du4>00;m8gfC``jr~oQ}3ZMe004jhApaQ4>Du4>00;m8gfC``jr~oQ}3ZMe0 z04jhApaQ4>Du4>00;m8gfC``jr~oQ}3ZMe004jhApaQ4>Du4>00;m8gfC``jr~oQ} z3ZMe004jhApaQ4>Du4>00;m8gfC``jr~oQ}3ZMe004jhApaQ4>Du4>00;m8gfC``j zr~oQ}3ZMe004jhApaQ4>Du4>00;m8gfC``jr~oQ}3ZMe004jhApaQ4>Du4>00;m8g zfC``jr~oQ}3ZMe004jhApaQ4>Du4>00;m8gfC``jr~oQ}3ZMe004jhApaQ4>Du4>0 z0;m8gfC``jr~oQ}3ZMe004jhApaQ4>Du4>00;m8gfC``jr~oQ}3ZMe004jhApaQ4> zDu4>00;m8gfC``jr~oQ}3ZMe004jhApaQ4>Du4>00;m8gfC``jr~oQ}3ZMe004jhA zpaQ4>Du4>00;m8gfC``jr~oQ}3ZMe004jhApaQ4>Du4>00;m8gfC``jr~o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S*qyJ#XJam~Ze*>^ z8e+XA7TpNYl$8SRV+LZ*P#&<3N38uZ>j2QtS;q_3@tU=s6X1Sv9fCmJbLO5j*UGpB znNfvnpy1emtTk9SBWP9JSq29O+QEZQ2$iw?Dxx@Jd zOWw#@jkO#!1pdn#=Rlv4Z|GcbhIRbqv1ksolLPI1&pON4+Dlx|Tzd`FKiomdT5Vk1 ze9uF85k!;mKhPO#7SQyIA;(>q!;q%?CF^|6I*W)!Q_#)|wyuh;t6}RbY+Wr|Z)fYB zs_w4}Us|ysS7sX(aSJaq(64S&UeBKwDn37a3%#I4K`Y~)Xe_v>cY}V%I!lN}*9k$} znhKg~rHGr?9KO;`VHfCo`SZ3F>sA1*iaSs5R0Hj3yg5rOLXMl){EK4UYM|Y?kBO&Q zCMFeJ)zy`IEZR((?s~B3<^!#0-CrQf-B#=1>Fdm3}8br&J`qJ`}_-?+l)|G61<4P4<4|d^SDf}(;Yw_^v z+>vyOpf!Kz9T!`-TK*96FiMUu&}XhK6796xnwQLf$J(UQyyNIVb(7$3eFfUEAKuCr z3s(y1wgLszysys{_sm;gf#$s&?W48w)$yl;L|bhRnkoahg;~G&PuL2TFT}1dW$)4c z61L`FFJDu4>00;m8gfC``jr~oQ}3ZMe0 e04jhApaQ4>Du4>00;m8gfC``jpP2$*ef7U*RZIQ= literal 0 HcmV?d00001 diff --git a/src/pversion.c b/src/pversion.c index 8d757738..b60e3b67 100644 --- a/src/pversion.c +++ b/src/pversion.c @@ -1,2 +1,2 @@ -char Program_version[]="2.3wip"; +char Program_version[]="2.3"; From 80e0b17be879c3cd943b867975c5b18620658b9b Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sun, 10 Apr 2011 14:35:29 +0000 Subject: [PATCH 40/46] Fix issue 430: warning 'Implicit declaration of function Remove_duplicate_shortcuts'. Fix another warning for unused parameter. Now 0 warnings on mingw32-gcc 4.4.1 git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1774 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/Makefile.dep | 3 ++- src/factory.c | 2 +- src/filesel.c | 4 ++-- src/filesel.h | 2 +- src/main.c | 1 + 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Makefile.dep b/src/Makefile.dep index 33532417..5a8bbedc 100644 --- a/src/Makefile.dep +++ b/src/Makefile.dep @@ -45,7 +45,8 @@ $(OBJDIR)/loadsave.o: loadsave.c buttons.h struct.h const.h errors.h global.h io engine.h brush.h setup.h $(OBJDIR)/main.o: main.c const.h struct.h global.h graph.h misc.h init.h buttons.h \ engine.h pages.h loadsave.h sdlscreen.h errors.h readini.h saveini.h \ - io.h text.h setup.h windows.h brush.h palette.h realpath.h input.h + io.h text.h setup.h windows.h brush.h palette.h realpath.h input.h \ + help.h $(OBJDIR)/misc.o: misc.c struct.h const.h sdlscreen.h global.h errors.h buttons.h \ engine.h misc.h keyboard.h windows.h palette.h input.h graph.h pages.h $(OBJDIR)/miscfileformats.o: miscfileformats.c engine.h struct.h const.h errors.h \ diff --git a/src/factory.c b/src/factory.c index 27efa774..03fe7674 100644 --- a/src/factory.c +++ b/src/factory.c @@ -1423,7 +1423,7 @@ void Highlight_script(T_Fileselector *selector, T_List_button *list, const char short index; index=Find_file_in_fileselector(selector, selected_file); - Locate_list_item(list, selector, index); + Locate_list_item(list, index); } static char Last_run_script[MAX_PATH_CHARACTERS]=""; diff --git a/src/filesel.c b/src/filesel.c index 756064f7..f0eec93c 100644 --- a/src/filesel.c +++ b/src/filesel.c @@ -1222,7 +1222,7 @@ short Quicksearch(T_Fileselector *selector) } // Translated from Highlight_file -void Locate_list_item(T_List_button * list, T_Fileselector * selector, short selected_item) +void Locate_list_item(T_List_button * list, short selected_item) { // Safety bounds @@ -1258,7 +1258,7 @@ int Quicksearch_list(T_List_button * list, T_Fileselector * selector) short selected_item=Quicksearch(selector); if (selected_item>=0 && selected_item!=list->Cursor_position+list->List_start) { - Locate_list_item(list, selector, selected_item); + Locate_list_item(list, selected_item); Hide_cursor(); // Mise à jour du scroller diff --git a/src/filesel.h b/src/filesel.h index 08956eb3..e2f9a4c1 100644 --- a/src/filesel.h +++ b/src/filesel.h @@ -50,7 +50,7 @@ void Read_list_of_drives(T_Fileselector *list, byte name_length); short Find_file_in_fileselector(T_Fileselector *list, const char * fname); -void Locate_list_item(T_List_button * list, T_Fileselector * selector, short selected_item); +void Locate_list_item(T_List_button * list, short selected_item); int Quicksearch_list(T_List_button * list, T_Fileselector * selector); diff --git a/src/main.c b/src/main.c index 36fe82fa..08685850 100644 --- a/src/main.c +++ b/src/main.c @@ -67,6 +67,7 @@ #include "palette.h" #include "realpath.h" #include "input.h" +#include "help.h" #if defined(__WIN32__) #include From c266b38e05b6fccc7d1f8390b9977ae112cf5ac2 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Wed, 13 Apr 2011 21:40:47 +0000 Subject: [PATCH 41/46] Fix part of issue 433: Safety colors (after image load) are now only added when not already present in palette, and in reverse order so that in the very common case of 0=black, the white is added in slot 255 (Now it's more consistent with 'backspace' in palette which forcibly adds these colors in unused slots at the end) git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1775 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/loadsave.c | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/loadsave.c b/src/loadsave.c index 5f135c10..d2a06de4 100644 --- a/src/loadsave.c +++ b/src/loadsave.c @@ -685,14 +685,35 @@ void Load_image(T_IO_Context *context) memset(color_usage,0,sizeof(color_usage)); if (Count_used_colors(color_usage)<252) { - int gui_index=0; - int c; - for (c=255; c>=0 && gui_index<4; c--) + int gui_index; + // From white to black + for (gui_index=3; gui_index>=0; gui_index--) { - if (color_usage[c]==0) + int c; + T_Components gui_color; + + gui_color=*Favorite_GUI_color(gui_index); + // Try find a very close match (ignore last 2 bits) + for (c=255; c>=0; c--) { - context->Palette[c]=*Favorite_GUI_color(gui_index); - gui_index++; + if ((context->Palette[c].R|3) == (gui_color.R|3) + && (context->Palette[c].G|3) == (gui_color.G|3) + && (context->Palette[c].B|3) == (gui_color.B|3) ) + break; + } + if (c<0) // Not found + { + // Find an unused slot at end of palette + for (c=255; c>=0; c--) + { + if (color_usage[c]==0) + { + context->Palette[c]=gui_color; + // Tag as a used color + color_usage[c]=1; + break; + } + } } } } From c56b3ac35a5be5c6d225ec157817c288e555ae24 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Wed, 13 Apr 2011 22:13:14 +0000 Subject: [PATCH 42/46] Added Ravey1138 to bugfinders list (Help/Credits) git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1776 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/helpfile.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/helpfile.h b/src/helpfile.h index cdf171b6..576113e6 100644 --- a/src/helpfile.h +++ b/src/helpfile.h @@ -463,10 +463,11 @@ static const T_Help_table helptable_credits[] = HELP_TEXT (" Lorenzo Gatti MagerValp maymunbeyin ") HELP_TEXT (" mind MooZ Pasi Kallinen ") HELP_TEXT (" the Peach petter PheeL ") - 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 (" 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 8596bc365fc92107f4495adf1b71db424e18b5fe Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Thu, 14 Apr 2011 17:36:54 +0000 Subject: [PATCH 43/46] Updated manpage source git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1777 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- misc/unix/grafx2.1 | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/misc/unix/grafx2.1 b/misc/unix/grafx2.1 index 1ea6c72a..7219d61c 100644 --- a/misc/unix/grafx2.1 +++ b/misc/unix/grafx2.1 @@ -1,4 +1,4 @@ -.TH GRAFX2 1 "February 23, 2009" +.TH GRAFX2 1 "April 14, 2011" .SH NAME grafx2 \- Ultimate 256-color bitmap paint program .SH SYNOPSIS @@ -23,24 +23,40 @@ little more difficult for you, but you should give it a try (or more, because most of the power of this program won't show up on the first try). .SH OPTIONS A summary of options is included below. +They can be prefixed by either / - or -- .TP -.B /?, /h, /help +.B -?, -h, -help Show summary of options. .TP -.B /wide +.B -wide To emulate a video mode with wide pixels (2 x 1). .TP -.B /tall +.B -tall To emulate a video mode with tall pixels (1 x 2). .TP -.B /double +.B -double To emulate a video mode with double pixels (2 x 2). .TP -.B /skin +.B -wide2 +To emulate a video mode with double wide pixels (4 x 2). +.TP +.B -tall2 +To emulate a video mode with double tall pixels (2 x 4). +.TP +.B -triple +To emulate a video mode with triple pixels (3 x 3). +.TP +.B -quadruple +To emulate a video mode with quadruple pixels (4 x 4). +.TP +.B -rgb +To reduce RGB precision from 256 to n levels. +.TP +.B -skin Use an alternate file for the menu graphics. .TP -.B /mode -To set a video mode listed with the /help parameter. +.B -mode +To set a video mode listed with the -help parameter. .SH FILES User settings are stored in ~/.grafx2/gfx2.ini. This file is really meant to be edited by the user and allows to tweak many aspects of the program. From 02ecd8d29d71ec278800dafb59d2076d94971390 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Thu, 14 Apr 2011 19:43:16 +0000 Subject: [PATCH 44/46] Fix issue 432: Options/Input: Missing graphic update after changing a numeric value git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1778 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/buttons.c | 1 + src/windows.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/buttons.c b/src/buttons.c index 0f22a734..c72f6fb1 100644 --- a/src/buttons.c +++ b/src/buttons.c @@ -898,6 +898,7 @@ void Settings_display_config(T_Setting *setting, T_Config * conf, T_Special_butt } } } + Update_window_area(panel->Pos_X, panel->Pos_Y, panel->Width, panel->Height+1); } void Settings_save_config(T_Config * conf) diff --git a/src/windows.c b/src/windows.c index a0af70bb..06f38b33 100644 --- a/src/windows.c +++ b/src/windows.c @@ -698,6 +698,10 @@ void Print_in_menu(const char * str, short position) { Print_general((18+(position<<3))*Menu_factor_X,Menu_status_Y,str,MC_Black,MC_Light); Update_rect((18+(position<<3))*Menu_factor_X,Menu_status_Y,strlen(str)*8*Menu_factor_X,8*Menu_factor_Y); + // Might want to replace the above by: + // SDL_UpdateRect(Screen_SDL, (18+(position<<3))*Menu_factor_X*Pixel_width,Menu_status_Y*Pixel_height,strlen(str)*8*Menu_factor_X*Pixel_width,8*Menu_factor_Y*Pixel_height); + // It can divide by 1000 the amount of pixels that are refreshed + // when you draw in top right of image. } /// Draws the mouse coordinates on the menu From 63dcf9cc258aaf2e2e2edd4b01939d9ccac75d97 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sat, 16 Apr 2011 18:24:24 +0000 Subject: [PATCH 45/46] Performance improvement for slow graphic systems: avoid lag on X11 (Issue 405,269) git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1780 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/sdlscreen.c | 31 +++++++++++++++++++++++++++++++ src/sdlscreen.h | 2 ++ src/windows.c | 7 +------ 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/sdlscreen.c b/src/sdlscreen.c index a8ef9476..ee1127e6 100644 --- a/src/sdlscreen.c +++ b/src/sdlscreen.c @@ -99,6 +99,8 @@ short Min_X=0; short Min_Y=0; short Max_X=10000; short Max_Y=10000; +short Status_line_dirty_begin=0; +short Status_line_dirty_end=0; #endif #if (UPDATE_METHOD == UPDATE_METHOD_FULL_PAGE) @@ -131,6 +133,13 @@ void Flush_update(void) Min_X=Min_Y=10000; Max_X=Max_Y=0; } + if (Status_line_dirty_end) + { + SDL_UpdateRect(Screen_SDL, (18+(Status_line_dirty_begin*8))*Menu_factor_X*Pixel_width,Menu_status_Y*Pixel_height,(Status_line_dirty_end-Status_line_dirty_begin)*8*Menu_factor_X*Pixel_width,8*Menu_factor_Y*Pixel_height); + } + Status_line_dirty_begin=25; + Status_line_dirty_end=0; + #endif } @@ -166,6 +175,28 @@ void Update_rect(short x, short y, unsigned short width, unsigned short height) } +void Update_status_line(short char_pos, short width) +{ + #if (UPDATE_METHOD == UPDATE_METHOD_MULTI_RECTANGLE) + SDL_UpdateRect(Screen_SDL, (18+char_pos*8)*Menu_factor_X*Pixel_width,Menu_status_Y*Pixel_height,width*8*Menu_factor_X*Pixel_width,8*Menu_factor_Y*Pixel_height); + #endif + + #if (UPDATE_METHOD == UPDATE_METHOD_CUMULATED) + // Merge the ranges + if (Status_line_dirty_end < char_pos+width) + Status_line_dirty_end=char_pos+width; + if (Status_line_dirty_begin > char_pos) + Status_line_dirty_begin=char_pos; + #endif + + #if (UPDATE_METHOD == UPDATE_METHOD_FULL_PAGE) + (void)char_pos; // unused parameter + (void)width; // unused parameter + update_is_required=1; + #endif + +} + /// /// Converts a SDL_Surface (indexed colors or RGB) into an array of bytes /// (indexed colors). diff --git a/src/sdlscreen.h b/src/sdlscreen.h index d0b7d004..8c58a141 100644 --- a/src/sdlscreen.h +++ b/src/sdlscreen.h @@ -44,6 +44,8 @@ byte* Screen_pixels; void Update_rect(short x, short y, unsigned short width, unsigned short height); void Flush_update(void); +void Update_status_line(short char_pos, short width); + /// /// Converts a SDL_Surface (indexed colors or RGB) into an array of bytes /// (indexed colors). diff --git a/src/windows.c b/src/windows.c index 06f38b33..e2e5fa27 100644 --- a/src/windows.c +++ b/src/windows.c @@ -697,11 +697,7 @@ void Print_in_window(short x,short y,const char * str,byte text_color,byte backg void Print_in_menu(const char * str, short position) { Print_general((18+(position<<3))*Menu_factor_X,Menu_status_Y,str,MC_Black,MC_Light); - Update_rect((18+(position<<3))*Menu_factor_X,Menu_status_Y,strlen(str)*8*Menu_factor_X,8*Menu_factor_Y); - // Might want to replace the above by: - // SDL_UpdateRect(Screen_SDL, (18+(position<<3))*Menu_factor_X*Pixel_width,Menu_status_Y*Pixel_height,strlen(str)*8*Menu_factor_X*Pixel_width,8*Menu_factor_Y*Pixel_height); - // It can divide by 1000 the amount of pixels that are refreshed - // when you draw in top right of image. + Update_status_line(position, strlen(str)); } /// Draws the mouse coordinates on the menu @@ -728,7 +724,6 @@ void Print_coordinates(void) Num2str(Colorpicker_color,temp,3); Print_in_menu(temp,20); Print_general(170*Menu_factor_X,Menu_status_Y," ",0,Colorpicker_color); - Update_rect(170*Menu_factor_X,Menu_status_Y,8*Menu_factor_X,8*Menu_factor_Y); } Num2str((dword)Paintbrush_X,temp,4); From 37d30ae1142efd99ca0851e44dca8edbfd0e8b41 Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Mon, 18 Apr 2011 21:56:11 +0000 Subject: [PATCH 46/46] Fix issue 428: Mouse cursor deadzones in fullscreen mode; also non-functional mouse in fullscreen if mouse speed (in options) was any other value than 'normal'. Mouse speed removed, it's impossible to make it work AND have working tablets -> Issue 317 re-opened. Added 2 missing bugfinders in credits git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1781 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/buttons.c | 9 +++++--- src/helpfile.h | 28 ++++++++++++------------- src/input.c | 57 +++++--------------------------------------------- 3 files changed, 25 insertions(+), 69 deletions(-) diff --git a/src/buttons.c b/src/buttons.c index c72f6fb1..5499fa46 100644 --- a/src/buttons.c +++ b/src/buttons.c @@ -953,10 +953,13 @@ void Button_Settings(void) {"Merge movement:",1,&(selected_config.Mouse_merge_movement),0,100,4,NULL}, {"Double click speed:",2,&(selected_config.Double_click_speed),1,1999,4,NULL}, {"Double key speed:",2,&(selected_config.Double_key_speed),1,1999,4,NULL}, - {"Mouse speed (fullscreen)",0,NULL,0,0,0,NULL}, - {" horizontally:",1,&(selected_config.Mouse_sensitivity_index_x),1,4,0,Lookup_MouseSpeed}, - {" vertically:",1,&(selected_config.Mouse_sensitivity_index_y),1,4,0,Lookup_MouseSpeed}, + //{"Mouse speed (fullscreen)",0,NULL,0,0,0,NULL}, + //{" horizontally:",1,&(selected_config.Mouse_sensitivity_index_x),1,4,0,Lookup_MouseSpeed}, + //{" vertically:",1,&(selected_config.Mouse_sensitivity_index_y),1,4,0,Lookup_MouseSpeed}, {"Key to swap buttons:",2,&(selected_config.Swap_buttons),0,0,0,Lookup_SwapButtons}, + {"",0,NULL,0,0,0,NULL}, + {"",0,NULL,0,0,0,NULL}, + {"",0,NULL,0,0,0,NULL}, {" --- Editing ---",0,NULL,0,0,0,NULL}, {"Adjust brush pick:",1,&(selected_config.Adjust_brush_pick),0,1,0,Lookup_YesNo}, diff --git a/src/helpfile.h b/src/helpfile.h index 576113e6..6ed351bc 100644 --- a/src/helpfile.h +++ b/src/helpfile.h @@ -454,20 +454,20 @@ static const T_Help_table helptable_credits[] = HELP_TEXT ("") //HELP_TEXT ("0----5----0----5----0----5----0----5----0--X") HELP_TEXT (" anibiqme blumunkee BDCIron ") - HELP_TEXT (" Ced DawnBringer El Topo ") - HELP_TEXT (" falenblood fanickbux fano ") - HELP_TEXT (" fogbot121 Frost Grimmy ") - HELP_TEXT (" Gürkan Sengün Hatch HoraK-FDF ") - HELP_TEXT (" iLKke Iw2evk 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 (" 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 ("") HELP_TEXT (" ... posted the annoying bug reports.") HELP_TEXT ("") diff --git a/src/input.c b/src/input.c index 45b54b6f..d9e5273d 100644 --- a/src/input.c +++ b/src/input.c @@ -85,12 +85,6 @@ word Input_new_mouse_Y; byte Input_new_mouse_K; byte Button_inverter=0; // State of the key that swaps mouse buttons. -byte Mouse_mode = 0; ///< Mouse mode = 0:normal, 1:emulated with custom sensitivity. -short Mouse_virtual_x_position; -short Mouse_virtual_y_position; -short Mouse_virtual_width; -short Mouse_virtual_height; - // Joystick/pad configurations for the various console ports. // See the #else for the documentation of fields. // TODO: Make these user-settable somehow. @@ -306,30 +300,8 @@ void Handle_window_exit(__attribute__((unused)) SDL_QuitEvent event) int Handle_mouse_move(SDL_MouseMotionEvent event) { - if (Mouse_mode == 0) - { - Input_new_mouse_X = event.x/Pixel_width; - Input_new_mouse_Y = event.y/Pixel_height; - } - else - { - Mouse_virtual_x_position += event.xrel * 12 / Config.Mouse_sensitivity_index_x; - // Clip - if (Mouse_virtual_x_position > Mouse_virtual_width) - Mouse_virtual_x_position = Mouse_virtual_width; - else if (Mouse_virtual_x_position < 0) - Mouse_virtual_x_position = 0; - - Mouse_virtual_y_position += event.yrel * 12 / Config.Mouse_sensitivity_index_y; - // Clip - if (Mouse_virtual_y_position > Mouse_virtual_height) - Mouse_virtual_y_position = Mouse_virtual_height; - else if (Mouse_virtual_y_position < 0) - Mouse_virtual_y_position = 0; - - Input_new_mouse_X = Mouse_virtual_x_position / 12 / Pixel_width; - Input_new_mouse_Y = Mouse_virtual_y_position / 12 / Pixel_height; - } + Input_new_mouse_X = event.x/Pixel_width; + Input_new_mouse_Y = event.y/Pixel_height; return Move_cursor_with_constraints(); } @@ -1050,32 +1022,13 @@ int Get_input(int sleep_time) void Adjust_mouse_sensitivity(word fullscreen) { - if (fullscreen == 0) - { - Mouse_mode = 0; - return; - } - Mouse_mode = 1; - Mouse_virtual_x_position = 12*Mouse_X*Pixel_width; - Mouse_virtual_y_position = 12*Mouse_Y*Pixel_height; - Mouse_virtual_width = 12*(Screen_width-1)*Pixel_width; - Mouse_virtual_height = 12*(Screen_height-1)*Pixel_height; + // Deprecated + (void)fullscreen; } void Set_mouse_position(void) { - if (Mouse_mode == 0) - { - SDL_WarpMouse( - Mouse_X*Pixel_width, - Mouse_Y*Pixel_height - ); - } - else - { - Mouse_virtual_x_position = 12*Mouse_X*Pixel_width; - Mouse_virtual_y_position = 12*Mouse_Y*Pixel_height; - } + SDL_WarpMouse(Mouse_X*Pixel_width, Mouse_Y*Pixel_height); } int Color_cycling(__attribute__((unused)) void* useless)