Показать сообщение отдельно
Старый 25.08.2013, 13:22   #1
St@SyaN
AnyKey`щик
 
Регистрация: 25.08.2013
Сообщений: 5
Написано 0 полезных сообщений
(для 0 пользователей)
Вопрос Слишком медленная работа

Такая проблема: этот код работает на телефоне со скоростью в 1 фпс. Можно ли как-то его ускорить?
    procedure painter;
    var temp:integer;
    begin
    for y:=0 to 319 do for x:=1 to 239 do
     begin
     temp:=canvas[y,240-x];
     if temp=0 then setcolor(0,0,0);
     if (temp>=101) and (temp<=130) then setcolor(colors[temp-100,1],colors[temp-100,2],colors[temp-100,3]);
     if (temp>=201) and (temp<=230) then setcolor((colors[temp-200,1] div 3)*2,(colors[temp-200,2] div 3)*2,(colors[temp-200,3] div 3)*2);
     if (temp>=301) and (temp<=330) then setcolor((colors[temp-300,1] div 2),(colors[temp-300,2] div 2),(colors[temp-300,3] div 2));
     if (temp>=401) and (temp<=430) then setcolor((colors[temp-400,1] div 3),(colors[temp-400,2] div 3),(colors[temp-400,3] div 3));
     if (temp>=501) and (temp<=530) then setcolor((colors[temp-500,1] div 4),(colors[temp-500,2] div 4),(colors[temp-500,3] div 4));
     plot (x,y);
     end;
    repaint;
    end;
(Offline)
 
Ответить с цитированием