Consolodating description of source extraction in CHANGES.txt.
Extracted do_floodfill, playsound, draw_progressbar and RGB-to-linear functions.
This commit is contained in:
parent
a9511eda41
commit
7448cd879d
12 changed files with 780 additions and 505 deletions
75
src/progressbar.c
Normal file
75
src/progressbar.c
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
progressbar.h
|
||||
|
||||
For Tux Paint
|
||||
Progress bar functions
|
||||
|
||||
Copyright (c) 2002-2006 by Bill Kendrick and others
|
||||
bill@newbreedsoftware.com
|
||||
http://www.newbreedsoftware.com/tuxpaint/
|
||||
|
||||
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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
June 14, 2002 - February 18, 2006
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
||||
#include "progressbar.h"
|
||||
|
||||
SDL_Surface * img_progress;
|
||||
int progress_bar_disabled, prog_bar_ctr;
|
||||
|
||||
static void eat_sdl_events(void);
|
||||
|
||||
|
||||
void show_progress_bar(SDL_Surface * screen)
|
||||
{
|
||||
SDL_Rect dest, src;
|
||||
int x;
|
||||
static Uint32 oldtime;
|
||||
Uint32 newtime;
|
||||
|
||||
if(progress_bar_disabled)
|
||||
return;
|
||||
|
||||
newtime = SDL_GetTicks();
|
||||
if(newtime > oldtime+15) // trying not to eat some serious CPU time!
|
||||
{
|
||||
for (x = 0; x < screen->w; x = x + 65)
|
||||
{
|
||||
src.x = 65 - (prog_bar_ctr % 65);
|
||||
src.y = 0;
|
||||
src.w = 65;
|
||||
src.h = 24;
|
||||
|
||||
dest.x = x;
|
||||
dest.y = screen->h - 24;
|
||||
|
||||
SDL_BlitSurface(img_progress, &src, screen, &dest);
|
||||
}
|
||||
|
||||
prog_bar_ctr++;
|
||||
|
||||
SDL_UpdateRect(screen, 0, screen->h - 24, screen->w, 24);
|
||||
}
|
||||
oldtime = newtime;
|
||||
|
||||
|
||||
/* FIXME: RESURRECT THIS (bjk 2006.02.18) */
|
||||
//eat_sdl_events();
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue