~ubuntu-branches/ubuntu/maverick/grafx2/maverick

« back to all changes in this revision

Viewing changes to pxwide2.c

  • Committer: Bazaar Package Importer
  • Author(s): Gürkan Sengün
  • Date: 2010-03-22 12:07:47 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100322120747-g0jel6vf6mjkc53s
Tags: 2.2-1
* New upstream version, fixes FTBFS with binutils-gold. (Closes: #554742)
* Bump standards version to 3.8.4.
* debian/control: Add liblua5.1-0-dev and pkg-config to build depends.
* debian/rules: Drop dh_desktop call.
* debian/copyright: Update years.
* Switch to dpkg-source format version 3.0 (quilt).
* debian/watch: Added.
* Added patch to fix spelling errors in source code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*  Grafx2 - The Ultimate 256-color bitmap paint program
2
 
 
3
 
    Copyright 2008 Yves Rizoud
4
 
    Copyright 2008 Franck Charlet
5
 
    Copyright 2007 Adrien Destugues
6
 
    Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud)
7
 
 
8
 
    Grafx2 is free software; you can redistribute it and/or
9
 
    modify it under the terms of the GNU General Public License
10
 
    as published by the Free Software Foundation; version 2
11
 
    of the License.
12
 
 
13
 
    Grafx2 is distributed in the hope that it will be useful,
14
 
    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 
    GNU General Public License for more details.
17
 
 
18
 
    You should have received a copy of the GNU General Public License
19
 
    along with Grafx2; if not, see <http://www.gnu.org/licenses/>
20
 
*/
21
 
 
22
 
#include <string.h>
23
 
#include <stdlib.h>
24
 
#include <SDL.h>
25
 
#include "global.h"
26
 
#include "sdlscreen.h"
27
 
#include "misc.h"
28
 
#include "graph.h"
29
 
#include "pxwide2.h"
30
 
 
31
 
#define ZOOMX 4
32
 
#define ZOOMY 2
33
 
 
34
 
void Pixel_wide2 (word x,word y,byte color)
35
 
/* Affiche un pixel de la color aux coords x;y � l'�cran */
36
 
{
37
 
  *(Screen_pixels + x * ZOOMX + y*ZOOMY * VIDEO_LINE_WIDTH)=color;
38
 
  *(Screen_pixels + x * ZOOMX + y*ZOOMY * VIDEO_LINE_WIDTH + 1)=color;
39
 
  *(Screen_pixels + x * ZOOMX + y*ZOOMY * VIDEO_LINE_WIDTH + 2)=color;
40
 
  *(Screen_pixels + x * ZOOMX + y*ZOOMY * VIDEO_LINE_WIDTH + 3)=color;
41
 
  *(Screen_pixels + x * ZOOMX + (y*ZOOMY+1) * VIDEO_LINE_WIDTH)=color;
42
 
  *(Screen_pixels + x * ZOOMX + (y*ZOOMY+1) * VIDEO_LINE_WIDTH + 1)=color;
43
 
  *(Screen_pixels + x * ZOOMX + (y*ZOOMY+1) * VIDEO_LINE_WIDTH + 2)=color;
44
 
  *(Screen_pixels + x * ZOOMX + (y*ZOOMY+1) * VIDEO_LINE_WIDTH + 3)=color;
45
 
}
46
 
 
47
 
byte Read_pixel_wide2 (word x,word y)
48
 
/* On retourne la couleur du pixel aux coords donn�es */
49
 
{
50
 
  return *( Screen_pixels + y * ZOOMY * VIDEO_LINE_WIDTH + x * ZOOMX);
51
 
}
52
 
 
53
 
void Block_wide2 (word start_x,word start_y,word width,word height,byte color)
54
 
/* On affiche un rectangle de la couleur donn�e */
55
 
{
56
 
  SDL_Rect rectangle;
57
 
  rectangle.x=start_x*ZOOMX;
58
 
  rectangle.y=start_y*ZOOMY;
59
 
  rectangle.w=width*ZOOMX;
60
 
  rectangle.h=height*ZOOMY;
61
 
  SDL_FillRect(Screen_SDL,&rectangle,color);
62
 
}
63
 
 
64
 
void Display_part_of_screen_wide2 (word width,word height,word image_width)
65
 
/* Afficher une partie de l'image telle quelle sur l'�cran */
66
 
{
67
 
  byte* dest=Screen_pixels; //On va se mettre en 0,0 dans l'�cran (dest)
68
 
  byte* src=Main_offset_Y*image_width+Main_offset_X+Main_screen; //Coords de d�part ds la source (src)
69
 
  int y;
70
 
  int dy;
71
 
 
72
 
  for(y=height;y!=0;y--)
73
 
  // Pour chaque ligne
74
 
  {
75
 
    // On fait une copie de la ligne
76
 
    for (dy=width;dy>0;dy--)
77
 
    {
78
 
      *(dest+3)=*(dest+2)=*(dest+1)=*dest=*src;
79
 
      src++;
80
 
      dest+=ZOOMX;
81
 
    }
82
 
    // On double la ligne qu'on vient de copier
83
 
    memcpy(dest-width*ZOOMX+VIDEO_LINE_WIDTH,dest-width*ZOOMX,width*ZOOMX);
84
 
    
85
 
    // On passe � la ligne suivante
86
 
    src+=image_width-width;
87
 
    dest+=VIDEO_LINE_WIDTH*ZOOMY - width*ZOOMX;
88
 
  }
89
 
  //Update_rect(0,0,width,height);
90
 
}
91
 
 
92
 
void Pixel_preview_normal_wide2 (word x,word y,byte color)
93
 
/* Affichage d'un pixel dans l'�cran, par rapport au d�calage de l'image 
94
 
 * dans l'�cran, en mode normal (pas en mode loupe)
95
 
 * Note: si on modifie cette proc�dure, il faudra penser � faire �galement 
96
 
 * la modif dans la proc�dure Pixel_Preview_Loupe_SDL. */
97
 
{
98
 
//  if(x-Main_offset_X >= 0 && y - Main_offset_Y >= 0)
99
 
  Pixel_wide2(x-Main_offset_X,y-Main_offset_Y,color);
100
 
}
101
 
 
102
 
void Pixel_preview_magnifier_wide2  (word x,word y,byte color)
103
 
{
104
 
  // Affiche le pixel dans la partie non zoom�e
105
 
  Pixel_wide2(x-Main_offset_X,y-Main_offset_Y,color);
106
 
  
107
 
  // Regarde si on doit aussi l'afficher dans la partie zoom�e
108
 
  if (y >= Limit_top_zoom && y <= Limit_visible_bottom_zoom
109
 
          && x >= Limit_left_zoom && x <= Limit_visible_right_zoom)
110
 
  {
111
 
    // On est dedans
112
 
    int height;
113
 
    int y_zoom = Main_magnifier_factor * (y-Main_magnifier_offset_Y);
114
 
 
115
 
    if (Menu_Y - y_zoom < Main_magnifier_factor)
116
 
      // On ne doit dessiner qu'un morceau du pixel
117
 
      // sinon on d�passe sur le menu
118
 
      height = Menu_Y - y_zoom;
119
 
    else
120
 
      height = Main_magnifier_factor;
121
 
 
122
 
    Block_wide2(
123
 
      Main_magnifier_factor * (x-Main_magnifier_offset_X) + Main_X_zoom, 
124
 
      y_zoom, Main_magnifier_factor, height, color
125
 
      );
126
 
  }
127
 
}
128
 
 
129
 
void Horizontal_XOR_line_wide2(word x_pos,word y_pos,word width)
130
 
{
131
 
  //On calcule la valeur initiale de dest:
132
 
  byte* dest=y_pos*ZOOMY*VIDEO_LINE_WIDTH+x_pos*ZOOMX+Screen_pixels;
133
 
 
134
 
  int x;
135
 
 
136
 
  for (x=0;x<width*ZOOMX;x+=ZOOMX)
137
 
    *(dest+x+VIDEO_LINE_WIDTH+3)=*(dest+x+VIDEO_LINE_WIDTH+2)=*(dest+x+VIDEO_LINE_WIDTH+1)=*(dest+x+VIDEO_LINE_WIDTH)=*(dest+x+3)=*(dest+x+2)=*(dest+x+1)=*(dest+x)=~*(dest+x);
138
 
}
139
 
 
140
 
void Vertical_XOR_line_wide2(word x_pos,word y_pos,word height)
141
 
{
142
 
  int i;
143
 
  byte *dest=Screen_pixels+x_pos*ZOOMX+y_pos*VIDEO_LINE_WIDTH*ZOOMY;
144
 
  for (i=height;i>0;i--)
145
 
  {
146
 
    *(dest+VIDEO_LINE_WIDTH+3)=*(dest+VIDEO_LINE_WIDTH+2)=*(dest+VIDEO_LINE_WIDTH+1)=*(dest+VIDEO_LINE_WIDTH)=*(dest+3)=*(dest+2)=*(dest+1)=*(dest)=~*(dest);
147
 
    dest+=VIDEO_LINE_WIDTH*ZOOMY;
148
 
  }
149
 
}
150
 
 
151
 
void Display_brush_color_wide2(word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word brush_width)
152
 
{
153
 
  // dest = Position � l'�cran
154
 
  byte* dest = Screen_pixels + y_pos * ZOOMY * VIDEO_LINE_WIDTH + x_pos * ZOOMX;
155
 
  // src = Position dans la brosse
156
 
  byte* src = Brush + y_offset * brush_width + x_offset;
157
 
 
158
 
  word x,y;
159
 
 
160
 
  // Pour chaque ligne
161
 
  for(y = height;y > 0; y--)
162
 
  {
163
 
    // Pour chaque pixel
164
 
    for(x = width;x > 0; x--)
165
 
    {
166
 
      // On v�rifie que ce n'est pas la transparence
167
 
      if(*src != transp_color)
168
 
      {
169
 
        *(dest+VIDEO_LINE_WIDTH+3) = *(dest+VIDEO_LINE_WIDTH+2) = *(dest+VIDEO_LINE_WIDTH+1) = *(dest+VIDEO_LINE_WIDTH) = *(dest+3) = *(dest+2) = *(dest+1) = *dest = *src;
170
 
      }
171
 
 
172
 
      // Pixel suivant
173
 
      src++;
174
 
      dest+=ZOOMX;
175
 
    }
176
 
 
177
 
    // On passe � la ligne suivante
178
 
    dest = dest + VIDEO_LINE_WIDTH*ZOOMY - width*ZOOMX;
179
 
    src = src + brush_width - width;
180
 
  }
181
 
  Update_rect(x_pos,y_pos,width,height);
182
 
}
183
 
 
184
 
void Display_brush_mono_wide2(word x_pos, word y_pos,
185
 
        word x_offset, word y_offset, word width, word height,
186
 
        byte transp_color, byte color, word brush_width)
187
 
/* On affiche la brosse en monochrome */
188
 
{
189
 
  byte* dest=y_pos*ZOOMY*VIDEO_LINE_WIDTH+x_pos*ZOOMX+Screen_pixels; // dest = adr destination � 
190
 
      // l'�cran
191
 
  byte* src=brush_width*y_offset+x_offset+Brush; // src = adr ds 
192
 
      // la brosse
193
 
  int x,y;
194
 
 
195
 
  for(y=height;y!=0;y--)
196
 
  //Pour chaque ligne
197
 
  {
198
 
    for(x=width;x!=0;x--)
199
 
    //Pour chaque pixel
200
 
    {
201
 
      if (*src!=transp_color)
202
 
        *(dest+VIDEO_LINE_WIDTH+3)=*(dest+VIDEO_LINE_WIDTH+2)=*(dest+VIDEO_LINE_WIDTH+1)=*(dest+VIDEO_LINE_WIDTH)=*(dest+3)=*(dest+2)=*(dest+1)=*dest=color;
203
 
 
204
 
      // On passe au pixel suivant
205
 
      src++;
206
 
      dest+=ZOOMX;
207
 
    }
208
 
 
209
 
    // On passe � la ligne suivante
210
 
    src+=brush_width-width;
211
 
    dest+=VIDEO_LINE_WIDTH*ZOOMY-width*ZOOMX;
212
 
  }
213
 
  Update_rect(x_pos,y_pos,width,height);
214
 
}
215
 
 
216
 
void Clear_brush_wide2(word x_pos,word y_pos,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word width,word height,__attribute__((unused))byte transp_color,word image_width)
217
 
{
218
 
  byte* dest=Screen_pixels+x_pos*ZOOMX+y_pos*ZOOMY*VIDEO_LINE_WIDTH; //On va se mettre en 0,0 dans l'�cran (dest)
219
 
  byte* src = ( y_pos + Main_offset_Y ) * image_width + x_pos + Main_offset_X + Main_screen; //Coords de d�part ds la source (src)
220
 
  int y;
221
 
  int x;
222
 
 
223
 
  for(y=height;y!=0;y--)
224
 
  // Pour chaque ligne
225
 
  {
226
 
    for(x=width;x!=0;x--)
227
 
    //Pour chaque pixel
228
 
    {
229
 
      *(dest+VIDEO_LINE_WIDTH+3)=*(dest+VIDEO_LINE_WIDTH+2)=*(dest+VIDEO_LINE_WIDTH+1)=*(dest+VIDEO_LINE_WIDTH)=*(dest+3)=*(dest+2)=*(dest+1)=*dest=*src;
230
 
 
231
 
      // On passe au pixel suivant
232
 
      src++;
233
 
      dest+=ZOOMX;
234
 
    }
235
 
 
236
 
    // On passe � la ligne suivante
237
 
    src+=image_width-width;
238
 
    dest+=VIDEO_LINE_WIDTH*ZOOMY-width*ZOOMX;
239
 
  }
240
 
  Update_rect(x_pos,y_pos,width,height);
241
 
}
242
 
 
243
 
// Affiche une brosse (arbitraire) � l'�cran
244
 
void Display_brush_wide2(byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word brush_width)
245
 
{
246
 
  // dest = Position � l'�cran
247
 
  byte* dest = Screen_pixels + y_pos * ZOOMY * VIDEO_LINE_WIDTH + x_pos * ZOOMX;
248
 
  // src = Position dans la brosse
249
 
  byte* src = brush + y_offset * brush_width + x_offset;
250
 
  
251
 
  word x,y;
252
 
  
253
 
  // Pour chaque ligne
254
 
  for(y = height;y > 0; y--)
255
 
  {
256
 
    // Pour chaque pixel
257
 
    for(x = width;x > 0; x--)
258
 
    {
259
 
      // On v�rifie que ce n'est pas la transparence
260
 
      if(*src != transp_color)
261
 
      {
262
 
        *(dest+VIDEO_LINE_WIDTH+3)=*(dest+VIDEO_LINE_WIDTH+2)=*(dest+VIDEO_LINE_WIDTH+1)=*(dest+VIDEO_LINE_WIDTH)=*(dest+3)=*(dest+2)=*(dest+1)=*dest=*src;
263
 
      }
264
 
 
265
 
      // Pixel suivant
266
 
      src++; dest+=ZOOMX;
267
 
    }
268
 
 
269
 
    // On passe � la ligne suivante
270
 
    dest = dest + VIDEO_LINE_WIDTH*ZOOMY - width*ZOOMX;
271
 
    src = src + brush_width - width;
272
 
  }
273
 
}
274
 
 
275
 
void Remap_screen_wide2(word x_pos,word y_pos,word width,word height,byte * conversion_table)
276
 
{
277
 
  // dest = coords a l'�cran
278
 
  byte* dest = Screen_pixels + y_pos * ZOOMY * VIDEO_LINE_WIDTH + x_pos * ZOOMX;
279
 
  int x,y;
280
 
 
281
 
  // Pour chaque ligne
282
 
  for(y=height;y>0;y--)
283
 
  {
284
 
    // Pour chaque pixel
285
 
    for(x=width;x>0;x--)
286
 
    {
287
 
        *(dest+VIDEO_LINE_WIDTH+3)=*(dest+VIDEO_LINE_WIDTH+2)=*(dest+VIDEO_LINE_WIDTH+1)=*(dest+VIDEO_LINE_WIDTH)=*(dest+3)=*(dest+2)=*(dest+1)=*dest=
288
 
        conversion_table[*dest];
289
 
      dest +=ZOOMX;
290
 
    }
291
 
 
292
 
    dest = dest + VIDEO_LINE_WIDTH*ZOOMY - width*ZOOMX;
293
 
  }
294
 
 
295
 
  Update_rect(x_pos,y_pos,width,height);
296
 
}
297
 
 
298
 
void Display_line_on_screen_fast_wide2(word x_pos,word y_pos,word width,byte * line)
299
 
/* On affiche toute une ligne de pixels telle quelle. */
300
 
/* Utilis�e si le buffer contient d�ja des pixel doubl�s. */
301
 
{
302
 
  memcpy(Screen_pixels+x_pos*ZOOMX+y_pos*ZOOMY*VIDEO_LINE_WIDTH,line,width*ZOOMX);
303
 
  memcpy(Screen_pixels+x_pos*ZOOMX+(y_pos*ZOOMY+1)*VIDEO_LINE_WIDTH,line,width*ZOOMX);
304
 
}
305
 
 
306
 
void Display_line_on_screen_wide2(word x_pos,word y_pos,word width,byte * line)
307
 
/* On affiche une ligne de pixels en les doublant. */
308
 
{
309
 
  int x;
310
 
  byte *dest;
311
 
  dest=Screen_pixels+x_pos*ZOOMX+y_pos*ZOOMY*VIDEO_LINE_WIDTH;
312
 
  for(x=width;x>0;x--)
313
 
  {
314
 
    *(dest+VIDEO_LINE_WIDTH+3)=*(dest+VIDEO_LINE_WIDTH+2)=*(dest+VIDEO_LINE_WIDTH+1)=*(dest+VIDEO_LINE_WIDTH)=*(dest+3)=*(dest+2)=*(dest+1)=*dest=*line;
315
 
    dest+=ZOOMX;
316
 
    line++;
317
 
  }
318
 
}
319
 
void Display_transparent_mono_line_on_screen_wide2(
320
 
        word x_pos, word y_pos, word width, byte* line, 
321
 
        byte transp_color, byte color)
322
 
// Affiche une ligne � l'�cran avec une couleur + transparence.
323
 
// Utilis� par les brosses en mode zoom
324
 
{
325
 
  byte* dest = Screen_pixels+ y_pos*VIDEO_LINE_WIDTH + x_pos*ZOOMX;
326
 
  int x;
327
 
  // Pour chaque pixel
328
 
  for(x=0;x<width;x++)
329
 
  {
330
 
    if (transp_color!=*line)
331
 
    {
332
 
      *(dest+3)=*(dest+2)=*(dest+1)=*dest=color;
333
 
    }
334
 
    line ++; // Pixel suivant
335
 
    dest+=ZOOMX;
336
 
  }
337
 
}
338
 
 
339
 
void Read_line_screen_wide2(word x_pos,word y_pos,word width,byte * line)
340
 
{
341
 
  memcpy(line,VIDEO_LINE_WIDTH*ZOOMY * y_pos + x_pos * ZOOMX + Screen_pixels,width*ZOOMX);
342
 
}
343
 
 
344
 
void Display_part_of_screen_scaled_wide2(
345
 
        word width, // width non zoom�e
346
 
        word height, // height zoom�e
347
 
        word image_width,byte * buffer)
348
 
{
349
 
  byte* src = Main_screen + Main_magnifier_offset_Y * image_width 
350
 
                      + Main_magnifier_offset_X;
351
 
  int y = 0; // Ligne en cours de traitement
352
 
 
353
 
  // Pour chaque ligne � zoomer
354
 
  while(1)
355
 
  {
356
 
    int x;
357
 
    
358
 
    // On �clate la ligne
359
 
    Zoom_a_line(src,buffer,Main_magnifier_factor*ZOOMX,width);
360
 
    // On l'affiche Facteur fois, sur des lignes cons�cutives
361
 
    x = Main_magnifier_factor/**ZOOMY*/;
362
 
    // Pour chaque ligne
363
 
    do{
364
 
      // On affiche la ligne zoom�e
365
 
      Display_line_on_screen_fast_wide2(
366
 
        Main_X_zoom, y, width*Main_magnifier_factor,
367
 
        buffer
368
 
      );
369
 
      // On passe � la suivante
370
 
      y++;
371
 
      if(y==height/**ZOOMY*/)
372
 
      {
373
 
        Redraw_grid(Main_X_zoom,0,
374
 
          width*Main_magnifier_factor,height);
375
 
        Update_rect(Main_X_zoom,0,
376
 
          width*Main_magnifier_factor,height);
377
 
        return;
378
 
      }
379
 
      x--;
380
 
    }while (x > 0);
381
 
    src += image_width;
382
 
  }
383
 
// ATTENTION on n'arrive jamais ici !
384
 
}
385
 
 
386
 
// Affiche une partie de la brosse couleur zoom�e
387
 
void Display_brush_color_zoom_wide2(word x_pos,word y_pos,
388
 
        word x_offset,word y_offset,
389
 
        word width, // width non zoom�e
390
 
        word end_y_pos,byte transp_color,
391
 
        word brush_width, // width r�elle de la brosse
392
 
        byte * buffer)
393
 
{
394
 
  byte* src = Brush+y_offset*brush_width + x_offset;
395
 
  word y = y_pos;
396
 
  byte bx;
397
 
 
398
 
  // Pour chaque ligne
399
 
  while(1)
400
 
  {
401
 
    Zoom_a_line(src,buffer,Main_magnifier_factor,width);
402
 
    // On affiche facteur fois la ligne zoom�e
403
 
    for(bx=Main_magnifier_factor;bx>0;bx--)
404
 
    {
405
 
      byte* line_src = buffer;
406
 
      byte* dest = Screen_pixels + y*ZOOMY * VIDEO_LINE_WIDTH + x_pos * ZOOMX;
407
 
      word x;
408
 
      // Pour chaque pixel de la ligne
409
 
      for(x = width*Main_magnifier_factor;x > 0;x--)
410
 
      {
411
 
        if(*line_src!=transp_color)
412
 
        {
413
 
          *(dest+3)=*(dest+2)=*(dest+1)=*dest = *line_src;
414
 
        }
415
 
        line_src++;
416
 
        dest+=ZOOMX;
417
 
      }
418
 
      // Double the line
419
 
      memcpy(Screen_pixels + (y*ZOOMY+1)*VIDEO_LINE_WIDTH + x_pos*ZOOMX, Screen_pixels + y*ZOOMY*VIDEO_LINE_WIDTH + x_pos*ZOOMX, width*ZOOMX*Main_magnifier_factor);
420
 
      y++;
421
 
      if(y==end_y_pos)
422
 
      {
423
 
        return;
424
 
      }
425
 
    }
426
 
    src += brush_width;
427
 
  }
428
 
  // ATTENTION zone jamais atteinte
429
 
}
430
 
 
431
 
void Display_brush_mono_zoom_wide2(word x_pos, word y_pos,
432
 
        word x_offset, word y_offset, 
433
 
        word width, // width non zoom�e 
434
 
        word end_y_pos,
435
 
        byte transp_color, byte color, 
436
 
        word brush_width, // width r�elle de la brosse
437
 
        byte * buffer
438
 
)
439
 
 
440
 
{
441
 
  byte* src = Brush + y_offset * brush_width + x_offset;
442
 
  int y=y_pos*ZOOMY;
443
 
 
444
 
  //Pour chaque ligne � zoomer :
445
 
  while(1)
446
 
  {
447
 
    int bx;
448
 
    // src = Ligne originale
449
 
    // On �clate la ligne
450
 
    Zoom_a_line(src,buffer,Main_magnifier_factor,width);
451
 
 
452
 
    // On affiche la ligne Facteur fois � l'�cran (sur des
453
 
    // lignes cons�cutives)
454
 
    bx = Main_magnifier_factor*ZOOMY;
455
 
 
456
 
    // Pour chaque ligne �cran
457
 
    do
458
 
    {
459
 
      // On affiche la ligne zoom�e
460
 
      Display_transparent_mono_line_on_screen_wide2(
461
 
        x_pos, y, width * Main_magnifier_factor, 
462
 
        buffer, transp_color, color
463
 
      );
464
 
      // On passe � la ligne suivante
465
 
      y++;
466
 
      // On v�rifie qu'on est pas � la ligne finale
467
 
      if(y == end_y_pos*ZOOMY)
468
 
      {
469
 
        Redraw_grid( x_pos, y_pos,
470
 
          width * Main_magnifier_factor, end_y_pos - y_pos );
471
 
        Update_rect( x_pos, y_pos,
472
 
          width * Main_magnifier_factor, end_y_pos - y_pos );
473
 
        return;
474
 
      }
475
 
      bx --;
476
 
    }
477
 
    while (bx > 0);
478
 
    
479
 
    // Passage � la ligne suivante dans la brosse aussi
480
 
    src+=brush_width;
481
 
  }
482
 
}
483
 
 
484
 
void Clear_brush_scaled_wide2(word x_pos,word y_pos,word x_offset,word y_offset,word width,word end_y_pos,__attribute__((unused)) byte transp_color,word image_width,byte * buffer)
485
 
{
486
 
 
487
 
  // En fait on va recopier l'image non zoom�e dans la partie zoom�e !
488
 
  byte* src = Main_screen + y_offset * image_width + x_offset;
489
 
  int y = y_pos;
490
 
  int bx;
491
 
 
492
 
  // Pour chaque ligne � zoomer
493
 
  while(1){
494
 
    Zoom_a_line(src,buffer,Main_magnifier_factor*ZOOMX,width);
495
 
 
496
 
    bx=Main_magnifier_factor;
497
 
 
498
 
    // Pour chaque ligne
499
 
    do{
500
 
      // TODO a verifier
501
 
      Display_line_on_screen_fast_wide2(x_pos,y,
502
 
        width * Main_magnifier_factor,buffer);
503
 
 
504
 
      // Ligne suivante
505
 
      y++;
506
 
      if(y==end_y_pos)
507
 
      {
508
 
        Redraw_grid(x_pos,y_pos,
509
 
          width*Main_magnifier_factor,end_y_pos-y_pos);
510
 
        Update_rect(x_pos,y_pos,
511
 
          width*Main_magnifier_factor,end_y_pos-y_pos);
512
 
        return;
513
 
      }
514
 
      bx--;
515
 
    }while(bx!=0);
516
 
 
517
 
    src+= image_width;
518
 
  }
519
 
}
520
 
 
521