Просьба помочь с оптимизацией...
Помогите, пожалуйста, оптимизировать код, если это вообще возможно. Кроме способа с двухмерным массивом:
PHP код:
procedure mainMenu;
var work:image;
startIm:array[0..5] of image;
configIm:array[0..5] of image;
loadIm:array[0..5] of image;
exitIm:array[0..5] of image;
w,h:integer;
begin
work:=LoadImage('start.png');
w:=getImageWidth(work)/6;
h:=getImageHeight(work);
startIm[0]:=rotate_image_from_image(work,0,0,w,h,5);
startIm[1]:=rotate_image_from_image(work,w,0,w,h,5);
startIm[2]:=rotate_image_from_image(work,w*2,0,w,h,5);
startIm[3]:=rotate_image_from_image(work,w*3,0,w,h,5);
startIm[4]:=rotate_image_from_image(work,w*4,0,w,h,5);
startIm[5]:=rotate_image_from_image(work,w*5,0,w,h,5);
work:=LoadImage('config.png');
w:=getImageWidth(work)/6;
h:=getImageHeight(work);
configIm[0]:=rotate_image_from_image(work,0,0,w,h,5);
configIm[1]:=rotate_image_from_image(work,w,0,w,h,5);
configIm[2]:=rotate_image_from_image(work,w*2,0,w,h,5);
configIm[3]:=rotate_image_from_image(work,w*3,0,w,h,5);
configIm[4]:=rotate_image_from_image(work,w*4,0,w,h,5);
configIm[5]:=rotate_image_from_image(work,w*5,0,w,h,5);
work:=LoadImage('load.png');
w:=getImageWidth(work)/6;
h:=getImageHeight(work);
loadIm[0]:=rotate_image_from_image(work,0,0,w,h,5);
loadIm[1]:=rotate_image_from_image(work,w,0,w,h,5);
loadIm[2]:=rotate_image_from_image(work,w*2,0,w,h,5);
loadIm[3]:=rotate_image_from_image(work,w*3,0,w,h,5);
loadIm[4]:=rotate_image_from_image(work,w*4,0,w,h,5);
loadIm[5]:=rotate_image_from_image(work,w*5,0,w,h,5);
work:=LoadImage('exit.png');
w:=getImageWidth(work)/6;
h:=getImageHeight(work);
exitIm[0]:=rotate_image_from_image(work,0,0,w,h,5);
exitIm[1]:=rotate_image_from_image(work,w,0,w,h,5);
exitIm[2]:=rotate_image_from_image(work,w*2,0,w,h,5);
exitIm[3]:=rotate_image_from_image(work,w*3,0,w,h,5);
exitIm[4]:=rotate_image_from_image(work,w*4,0,w,h,5);
exitIm[5]:=rotate_image_from_image(work,w*5,0,w,h,5);
end;
Имеется 4 рисунка, в которых поочередно слева на право вырезается по 6 отдельных картинок и заносятся в соответствующие массивы.
|