hedgewars/uMisc.pas
branchqmlfrontend
changeset 11071 3851ce4f2061
parent 10748 dc587913987c
parent 11046 47a8c19ecb60
child 11408 b894922d58cc
equal deleted inserted replaced
11050:9b7c8c5a94e0 11071:3851ce4f2061
     1 (*
     1 (*
     2  * Hedgewars, a free turn based strategy game
     2  * Hedgewars, a free turn based strategy game
     3  * Copyright (c) 2004-2014 Andrey Korotaev <unC0Rr@gmail.com>
     3  * Copyright (c) 2004-2015 Andrey Korotaev <unC0Rr@gmail.com>
     4  *
     4  *
     5  * This program is free software; you can redistribute it and/or modify
     5  * This program is free software; you can redistribute it and/or modify
     6  * it under the terms of the GNU General Public License as published by
     6  * it under the terms of the GNU General Public License as published by
     7  * the Free Software Foundation; version 2 of the License
     7  * the Free Software Foundation; version 2 of the License
     8  *
     8  *
   248     AddFileLog('Error: Could not allocate memory for screenshot.');
   248     AddFileLog('Error: Could not allocate memory for screenshot.');
   249     MakeScreenshot:= false;
   249     MakeScreenshot:= false;
   250     exit;
   250     exit;
   251 end;
   251 end;
   252 
   252 
   253 // read pixels from the front buffer
   253 // read pixels from land array
   254 if dump > 0 then
   254 if dump > 0 then
   255     begin
   255     begin
   256     for y:= 0 to LAND_HEIGHT-1 do
   256     for y:= 0 to LAND_HEIGHT-1 do
   257         for x:= 0 to LAND_WIDTH-1 do
   257         for x:= 0 to LAND_WIDTH-1 do
   258             if dump = 2 then
   258             if dump = 2 then
   272                 else
   272                 else
   273                     PLongWordArray(p)^[y*LAND_WIDTH+x]:= 0
   273                     PLongWordArray(p)^[y*LAND_WIDTH+x]:= 0
   274                 end
   274                 end
   275     end
   275     end
   276 else
   276 else
       
   277 // read pixels from the front buffer
   277     begin
   278     begin
   278     glReadPixels(0, 0, cScreenWidth, cScreenHeight, format, GL_UNSIGNED_BYTE, p);
   279     glReadPixels(0, 0, cScreenWidth, cScreenHeight, format, GL_UNSIGNED_BYTE, p);
   279 {$IFDEF USE_VIDEO_RECORDING}
   280 {$IFDEF USE_VIDEO_RECORDING}
   280     ReduceImage(p, cScreenWidth, cScreenHeight, k)
   281     ReduceImage(p, cScreenWidth, cScreenHeight, k)
   281 {$ENDIF}
   282 {$ENDIF}