annotate Gui/skin/font.c @ 7285:46336b8e7a28

merged xacodec.c and vd_xanim.c
author alex
date Thu, 05 Sep 2002 16:34:57 +0000
parents 8cfddba867b4
children 0cb951ac0133
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
1
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
2 #include <stdlib.h>
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
3 #include <stdio.h>
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
4 #include <stdarg.h>
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
5 #include <string.h>
6166
82f770634c5b inttypes gui patch from Bjrn Sandell <biorn@dce.chalmers.se>
pontscho
parents: 6159
diff changeset
6 #include <inttypes.h>
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
7
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
8 #include "skin.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
9 #include "font.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
10 #include "cut.h"
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 1907
diff changeset
11 #include "../../mp_msg.h"
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
12
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
13 int items;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
14
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
15 bmpFont * Fonts[26] = { NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL };
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
16
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
17 int fntAddNewFont( char * name )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
18 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
19 int id;
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
20 int i;
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
21
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
22 for( id=0;id<26;id++ )
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
23 if ( !Fonts[id] ) break;
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
24
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
25 if ( id == 25 ) return -2;
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
26
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
27 if ( ( Fonts[id]=calloc( 1,sizeof( bmpFont ) ) ) == NULL ) return -1;
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
28
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
29 strcpy( Fonts[id]->name,name );
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
30 for ( i=0;i<256;i++ )
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
31 Fonts[id]->Fnt[i].x=Fonts[id]->Fnt[i].y=Fonts[id]->Fnt[i].sx=Fonts[id]->Fnt[i].sy=-1;
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
32
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
33 return id;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
34 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
35
1829
a4156c8cdd57 add font free func.
pontscho
parents: 1693
diff changeset
36 void fntFreeFont( void )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
37 {
1829
a4156c8cdd57 add font free func.
pontscho
parents: 1693
diff changeset
38 int i;
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
39 for( i=0;i < 25;i++ )
1829
a4156c8cdd57 add font free func.
pontscho
parents: 1693
diff changeset
40 {
a4156c8cdd57 add font free func.
pontscho
parents: 1693
diff changeset
41 if ( Fonts[i] )
a4156c8cdd57 add font free func.
pontscho
parents: 1693
diff changeset
42 {
a4156c8cdd57 add font free func.
pontscho
parents: 1693
diff changeset
43 if ( Fonts[i]->Bitmap.Image ) free( Fonts[i]->Bitmap.Image );
a4156c8cdd57 add font free func.
pontscho
parents: 1693
diff changeset
44 free( Fonts[i] );
a4156c8cdd57 add font free func.
pontscho
parents: 1693
diff changeset
45 Fonts[i]=NULL;
a4156c8cdd57 add font free func.
pontscho
parents: 1693
diff changeset
46 }
a4156c8cdd57 add font free func.
pontscho
parents: 1693
diff changeset
47 }
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
48 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
49
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
50 int fntRead( char * path,char * fname )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
51 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
52 FILE * f;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
53 unsigned char tmp[512];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
54 unsigned char * ptmp;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
55 unsigned char command[32];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
56 unsigned char param[256];
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 1907
diff changeset
57 int c,linenumber = 0;
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
58 int id = fntAddNewFont( fname );
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
59
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
60 if ( id < 0 ) return id;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
61
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
62 strcpy( tmp,path ); strcat( tmp,fname ); strcat( tmp,".fnt" );
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
63 if ( ( f=fopen( tmp,"rt" ) ) == NULL )
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
64 { free( Fonts[id] ); return -3; }
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
65
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
66 while ( !feof( f ) )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
67 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
68 fgets( tmp,255,f ); linenumber++;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
69
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
70 c=tmp[ strlen( tmp ) - 1 ]; if ( ( c == '\n' )||( c == '\r' ) ) tmp[ strlen( tmp ) - 1 ]=0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
71 c=tmp[ strlen( tmp ) - 1 ]; if ( ( c == '\n' )||( c == '\r' ) ) tmp[ strlen( tmp ) - 1 ]=0;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 1907
diff changeset
72 for ( c=0;c < (int)strlen( tmp );c++ )
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
73 if ( tmp[c] == ';' ) { tmp[c]=0; break; }
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
74 if ( !tmp[0] ) continue;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
75 ptmp=strdelspacesbeforecommand( tmp );
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
76 if ( !tmp[0] ) continue;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
77 ptmp=strswap( ptmp,'\t',' ' );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
78 ptmp=strdelspaces( ptmp );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
79 cutItem( ptmp,command,'=',0 ); cutItem( ptmp,param,'=',1 );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
80 if ( command[0] == '"' )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
81 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
82 int i;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
83 cutItem( command,command,'"',1 );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
84 i=(int)command[0];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
85 cutItem( param,tmp,',',0 ); Fonts[id]->Fnt[i].x=atoi( tmp );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
86 cutItem( param,tmp,',',1 ); Fonts[id]->Fnt[i].y=atoi( tmp );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
87 cutItem( param,tmp,',',2 ); Fonts[id]->Fnt[i].sx=atoi( tmp );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
88 cutItem( param,tmp,',',3 ); Fonts[id]->Fnt[i].sy=atoi( tmp );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 1907
diff changeset
89 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[font] char: '%s' params: %d,%d %dx%d\n",command,Fonts[id]->Fnt[i].x,Fonts[id]->Fnt[i].y,Fonts[id]->Fnt[i].sx,Fonts[id]->Fnt[i].sy );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
90 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
91 else
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
92 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
93 if ( !strcmp( command,"image" ) )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
94 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
95 strcpy( tmp,path ); strcat( tmp,param );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 1907
diff changeset
96 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[font] font imagefile: %s\n",tmp );
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
97 if ( skinBPRead( tmp,&Fonts[id]->Bitmap ) ) return -4;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
98 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
99 }
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
100 }
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
101
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
102 return 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
103 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
104
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
105 int fntFindID( char * name )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
106 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
107 int i;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
108 for ( i=0;i < 25;i++ )
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
109 if ( Fonts[i] )
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
110 if ( !strcmp( name,Fonts[i]->name ) ) return i;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
111 return -1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
112 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
113
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
114 int fntTextWidth( int id,char * str )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
115 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
116 int size = 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
117 int i;
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
118
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
119 if ( ( !Fonts[id] )||( !str[0] ) ) return 0;
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
120
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
121 for ( i=0;i < (unsigned int)strlen( str );i++ )
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
122 size+=( Fonts[id]->Fnt[ (unsigned char)str[i] ].sx == -1? Fonts[id]->Fnt[ 32 ].sx : Fonts[id]->Fnt[ (unsigned char)str[i] ].sx );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
123 return size;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
124 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
125
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
126 int fntTextHeight( int id,char * str )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
127 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
128 int max = 0,i;
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
129
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
130 if ( ( !Fonts[id] )||( !str[0] ) ) return 0;
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
131
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 1907
diff changeset
132 for ( i=0;i < (int)strlen( str );i++ )
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
133 {
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
134 int h = Fonts[id]->Fnt[ (unsigned char)str[i] ].sy;
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
135 if ( h > max ) max=h;
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
136 }
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
137 return max;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
138 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
139
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
140 txSample * fntRender( int id,int px,int sx,char * fmt,... )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
141 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
142 txSample * tmp = NULL;
4848
ad868aae2a5c fix playtree bug. but ... i dont' see this ... bazmeg
pontscho
parents: 4818
diff changeset
143 txSample tmp2;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
144 char p[512];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
145 va_list ap;
6159
dcf195b784bf applied 64bit patch from Ulrich Hecht <uli@suse.de>
pontscho
parents: 6145
diff changeset
146 uint32_t * ibuf;
dcf195b784bf applied 64bit patch from Ulrich Hecht <uli@suse.de>
pontscho
parents: 6145
diff changeset
147 uint32_t * obuf;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
148 int i,x,y;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
149 int oy = 0, ox = 0, dx = 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
150
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
151 va_start( ap,fmt );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
152 vsnprintf( p,512,fmt,ap );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
153 va_end( ap );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
154
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
155 if ( ( !Fonts[id] )||
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
156 ( !strlen( p ) )||
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
157 ( !fntTextWidth( id,p ) )||
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
158 ( (tmp=malloc( sizeof( txSample ) )) == NULL ) ) return NULL;
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
159
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
160 tmp->Width=fntTextWidth( id,p );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
161 tmp->Height=fntTextHeight( id,p );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
162 tmp->BPP=32;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
163 tmp->ImageSize=tmp->Width * tmp->Height * 4;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
164 if ( ( tmp->Image=malloc( tmp->ImageSize ) ) == NULL ) return NULL;
6159
dcf195b784bf applied 64bit patch from Ulrich Hecht <uli@suse.de>
pontscho
parents: 6145
diff changeset
165 obuf=(uint32_t *)tmp->Image;
dcf195b784bf applied 64bit patch from Ulrich Hecht <uli@suse.de>
pontscho
parents: 6145
diff changeset
166 ibuf=(uint32_t *)Fonts[id]->Bitmap.Image;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 1907
diff changeset
167 for ( i=0;i < (int)strlen( p );i++ )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
168 {
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
169 unsigned int c = (unsigned char)p[i];
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
170 if ( Fonts[id]->Fnt[c].sx == -1 ) c=32;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
171 for ( oy=0,y=Fonts[id]->Fnt[c].y;y < Fonts[id]->Fnt[c].y + Fonts[id]->Fnt[c].sy; y++,oy++ )
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
172 for ( ox=0,x=Fonts[id]->Fnt[c].x;x < Fonts[id]->Fnt[c].x + Fonts[id]->Fnt[c].sx; x++,ox++ )
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6166
diff changeset
173 obuf[ oy * tmp->Width + dx + ox ]=ibuf[ y * Fonts[id]->Bitmap.Width + x ];
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
174 dx+=Fonts[id]->Fnt[c].sx;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
175 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
176
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
177 if ( ( sx > 0 )&&( sx < tmp->Width ) )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
178 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
179 tmp2.ImageSize=sx * tmp->Height * 4;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
180 if ( ( tmp2.Image=malloc( tmp2.ImageSize ) ) == NULL ) { free( tmp->Image ); return NULL; }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
181
6159
dcf195b784bf applied 64bit patch from Ulrich Hecht <uli@suse.de>
pontscho
parents: 6145
diff changeset
182 obuf=(uint32_t *)tmp->Image;
dcf195b784bf applied 64bit patch from Ulrich Hecht <uli@suse.de>
pontscho
parents: 6145
diff changeset
183 ibuf=(uint32_t *)tmp2.Image;
5919
60cf2bca993f some bug fix
pontscho
parents: 4848
diff changeset
184 oy=0;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
185
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
186 for ( y=0;y < tmp->Height;y++ )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
187 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
188 ox=px;
5919
60cf2bca993f some bug fix
pontscho
parents: 4848
diff changeset
189 dx=y * tmp->Width;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
190 for ( x=0;x < sx;x++ )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
191 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
192 ibuf[oy++]=obuf[dx + ox++];
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
193 if ( ox >= tmp->Width ) ox=0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
194 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
195 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
196
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
197 free( tmp->Image ); tmp->Width=sx; tmp->ImageSize=tmp2.ImageSize; tmp->Image=tmp2.Image;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
198 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
199
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
200 return tmp;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
201 }