14 * You should have received a copy of the GNU General Public License |
14 * You should have received a copy of the GNU General Public License |
15 * along with this program; if not, write to the Free Software |
15 * along with this program; if not, write to the Free Software |
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
17 *) |
17 *) |
18 |
18 |
|
19 {$INCLUDE "options.inc"} |
|
20 |
19 unit uStore; |
21 unit uStore; |
20 interface |
22 interface |
21 {$INCLUDE "options.inc"} |
|
22 uses sysutils, uConsts, uTeams, SDLh, |
23 uses sysutils, uConsts, uTeams, SDLh, |
23 {$IFDEF GLES11} |
24 {$IFDEF GLES11} |
24 gles11, |
25 gles11, |
25 {$ELSE} |
26 {$ELSE} |
26 GL, GLext, |
27 GL, GLext, |
120 TTF_SizeUTF8(Fontz[Font].Handle, Str2PChar(s), w, h); |
121 TTF_SizeUTF8(Fontz[Font].Handle, Str2PChar(s), w, h); |
121 Result.x:= X; |
122 Result.x:= X; |
122 Result.y:= Y; |
123 Result.y:= Y; |
123 Result.w:= w + FontBorder * 2 + 4; |
124 Result.w:= w + FontBorder * 2 + 4; |
124 Result.h:= h + FontBorder * 2; |
125 Result.h:= h + FontBorder * 2; |
125 DrawRoundRect(@Result, cWhiteColor, cColorNearBlack, Surface, true); |
126 DrawRoundRect(@Result, cWhiteColor, cNearBlackColor, Surface, true); |
126 clr.r:= Color shr 16; |
127 clr.r:= Color shr 16; |
127 clr.g:= (Color shr 8) and $FF; |
128 clr.g:= (Color shr 8) and $FF; |
128 clr.b:= Color and $FF; |
129 clr.b:= Color and $FF; |
129 tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, Str2PChar(s), clr.value); |
130 tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, Str2PChar(s), clr.value); |
130 tmpsurf:= doSurfaceConversion(tmpsurf); |
131 tmpsurf:= doSurfaceConversion(tmpsurf); |
163 |
164 |
164 texsurf:= SDL_CreateRGBSurface(SDL_SWSURFACE, r.w, r.h, 32, RMask, GMask, BMask, AMask); |
165 texsurf:= SDL_CreateRGBSurface(SDL_SWSURFACE, r.w, r.h, 32, RMask, GMask, BMask, AMask); |
165 TryDo(texsurf <> nil, errmsgCreateSurface, true); |
166 TryDo(texsurf <> nil, errmsgCreateSurface, true); |
166 TryDo(SDL_SetColorKey(texsurf, SDL_SRCCOLORKEY, 0) = 0, errmsgTransparentSet, true); |
167 TryDo(SDL_SetColorKey(texsurf, SDL_SRCCOLORKEY, 0) = 0, errmsgTransparentSet, true); |
167 |
168 |
168 DrawRoundRect(@r, cWhiteColor, cColorNearBlack, texsurf, true); |
169 DrawRoundRect(@r, cWhiteColor, cNearBlackColor, texsurf, true); |
169 rr:= r; |
170 rr:= r; |
170 inc(rr.x, 2); dec(rr.w, 4); inc(rr.y, 2); dec(rr.h, 4); |
171 inc(rr.x, 2); dec(rr.w, 4); inc(rr.y, 2); dec(rr.h, 4); |
171 DrawRoundRect(@rr, Clan^.Color, Clan^.Color, texsurf, false); |
172 DrawRoundRect(@rr, Clan^.Color, Clan^.Color, texsurf, false); |
172 HealthTex:= Surface2Tex(texsurf, false); |
173 HealthTex:= Surface2Tex(texsurf, false); |
173 SDL_FreeSurface(texsurf); |
174 SDL_FreeSurface(texsurf); |
380 HHTexture:= Surface2Tex(tmpsurf, false); |
381 HHTexture:= Surface2Tex(tmpsurf, false); |
381 SDL_FreeSurface(tmpsurf); |
382 SDL_FreeSurface(tmpsurf); |
382 |
383 |
383 InitHealth; |
384 InitHealth; |
384 |
385 |
385 PauseTexture:= RenderStringTex(trmsg[sidPaused], $FFFF00, fntBig); |
386 PauseTexture:= RenderStringTex(trmsg[sidPaused], cYellowColor, fntBig); |
386 ConfirmTexture:= RenderStringTex(trmsg[sidConfirm], $FFFF00, fntBig); |
387 ConfirmTexture:= RenderStringTex(trmsg[sidConfirm], cYellowColor, fntBig); |
387 SyncTexture:= RenderStringTex(trmsg[sidSync], $FFFF00, fntBig); |
388 SyncTexture:= RenderStringTex(trmsg[sidSync], cYellowColor, fntBig); |
388 |
389 |
389 AddProgress; |
390 AddProgress; |
390 |
391 |
391 for ai:= Low(TAmmoType) to High(TAmmoType) do |
392 for ai:= Low(TAmmoType) to High(TAmmoType) do |
392 with Ammoz[ai] do |
393 with Ammoz[ai] do |
988 if s[pos] <> #1 then inc(pos); |
989 if s[pos] <> #1 then inc(pos); |
989 while s[prevpos+1] = ' 'do inc(prevpos); |
990 while s[prevpos+1] = ' 'do inc(prevpos); |
990 substr:= copy(s, prevpos+1, pos-prevpos-1); |
991 substr:= copy(s, prevpos+1, pos-prevpos-1); |
991 if Length(substr) <> 0 then |
992 if Length(substr) <> 0 then |
992 begin |
993 begin |
993 tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, Str2PChar(substr), cColorNearBlack); |
994 tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, Str2PChar(substr), cNearBlackColor); |
994 tmpsurf:= doSurfaceConversion(tmpsurf); |
995 tmpsurf:= doSurfaceConversion(tmpsurf); |
995 rect.x:= edgeHeight + 1 + ((i - w) div 2); |
996 rect.x:= edgeHeight + 1 + ((i - w) div 2); |
996 // trying to more evenly position the text, vertically |
997 // trying to more evenly position the text, vertically |
997 rect.y:= edgeHeight + ((j-(numLines*h)) div 2) + line * h; |
998 rect.y:= edgeHeight + ((j-(numLines*h)) div 2) + line * h; |
998 SDLTry(tmpsurf <> nil, true); |
999 SDLTry(tmpsurf <> nil, true); |