From: Peter S. <zu...@us...> - 2006-03-18 18:07:07
|
Update of /cvsroot/apophysis/2.10/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23725/Source Modified Files: FormRender.pas Log Message: fixed an int64 bug, prevented user from starting render if not enough memory Index: FormRender.pas =================================================================== RCS file: /cvsroot/apophysis/2.10/Source/FormRender.pas,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** FormRender.pas 8 Mar 2006 14:21:36 -0000 1.15 --- FormRender.pas 18 Mar 2006 18:07:02 -0000 1.16 *************** *** 158,165 **** GlobalMemoryStatus(GlobalMemoryInfo); PhysicalMemory := GlobalMemoryInfo.dwAvailPhys div 1048576; ! ApproxMemory := ImageHeight * ImageWidth * Oversample * Oversample * ! SizeOf(TBucket) div 1048576; ! lblPhysical.Caption := 'Physical memory available: ' + Format('%d', [PhysicalMemory]) + ' Mb'; ! lblApproxMem.Caption := 'Approximate memory required: ' + Format('%d', [ApproxMemory]) + ' Mb'; if ApproxMemory > PhysicalMemory then lblPhysical.Font.Color := clRed else lblPhysical.Font.Color := clWindowText; --- 158,167 ---- GlobalMemoryStatus(GlobalMemoryInfo); PhysicalMemory := GlobalMemoryInfo.dwAvailPhys div 1048576; ! ApproxMemory := int64(ImageHeight) * int64(ImageWidth) * int64(Oversample * Oversample ! * SizeOf(TBucket)) div 1048576; ! ! lblPhysical.Caption := 'Physical memory available: ' + Format('%u', [PhysicalMemory]) + ' Mb'; ! lblApproxMem.Caption := 'Approximate memory required: ' + Format('%u', [ApproxMemory]) + ' Mb'; ! if ApproxMemory > PhysicalMemory then lblPhysical.Font.Color := clRed else lblPhysical.Font.Color := clWindowText; *************** *** 265,277 **** ImageWidth := StrToInt(cbWidth.text); ImageHeight := StrToInt(cbHeight.text); if (not chkLimitMem.checked) and (ApproxMemory > PhysicalMemory) then begin Application.MessageBox('You do not have enough memory for this render. Please use memory limiting.', 'Apophysis', 48); ! // exit; end; if chkLimitMem.checked and (PhysicalMemory < StrToInt(cbMaxMemory.text)) and (Approxmemory > PhysicalMemory) then begin Application.MessageBox('You do not have enough memory for this render. Please use a lower Maximum memory setting.', 'Apophysis', 48); ! // exit; end; t := txtFilename.Text; if t = '' then --- 267,281 ---- ImageWidth := StrToInt(cbWidth.text); ImageHeight := StrToInt(cbHeight.text); + if (not chkLimitMem.checked) and (ApproxMemory > PhysicalMemory) then begin Application.MessageBox('You do not have enough memory for this render. Please use memory limiting.', 'Apophysis', 48); ! exit; end; if chkLimitMem.checked and (PhysicalMemory < StrToInt(cbMaxMemory.text)) and (Approxmemory > PhysicalMemory) then begin Application.MessageBox('You do not have enough memory for this render. Please use a lower Maximum memory setting.', 'Apophysis', 48); ! exit; end; + t := txtFilename.Text; if t = '' then *************** *** 338,342 **** Renderer.WaitFor; Renderer.Free; - Renderer := nil; //? end; if not Assigned(Renderer) then --- 342,345 ---- *************** *** 357,361 **** --- 360,367 ---- edt:=0; + try + Renderer := TRenderThread.Create; + assert(Renderer <> nil); if chkLimitMem.checked then Renderer.MaxMem := StrToInt(cbMaxMemory.text); *************** *** 368,371 **** --- 374,381 ---- Renderer.Resume; + except + Application.MessageBox('Error while rendering!', 'Apophysis', 48) + end; + // enable screensaver SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 1, nil, 0); |