branch | physfslayer |
changeset 8022 | 10b3b93c1f56 |
parent 7866 | 58d10edc5d21 |
child 8025 | 07862ab415c8 |
8019:b216953c2617 | 8022:10b3b93c1f56 |
---|---|
54 |
54 |
55 procedure WarpMouse(x, y: Word); inline; |
55 procedure WarpMouse(x, y: Word); inline; |
56 procedure SwapBuffers; {$IFDEF USE_VIDEO_RECORDING}cdecl{$ELSE}inline{$ENDIF}; |
56 procedure SwapBuffers; {$IFDEF USE_VIDEO_RECORDING}cdecl{$ELSE}inline{$ENDIF}; |
57 |
57 |
58 implementation |
58 implementation |
59 uses uMisc, uConsole, uMobile, uVariables, uUtils, uTextures, uRender, uRenderUtils, uCommands, |
59 uses uMisc, uConsole, uMobile, uVariables, uUtils, uTextures, uRender, uRenderUtils, uCommands |
60 uDebug{$IFDEF USE_CONTEXT_RESTORE}, uWorld{$ENDIF} |
60 , uPhysFSLayer |
61 {$IF NOT DEFINED(SDL13) AND DEFINED(USE_VIDEO_RECORDING)}, glut {$ENDIF}; |
61 , uDebug |
62 {$IFDEF USE_CONTEXT_RESTORE}, uWorld{$ENDIF} |
|
63 {$IF NOT DEFINED(SDL13) AND DEFINED(USE_VIDEO_RECORDING)}, glut {$ENDIF}; |
|
62 |
64 |
63 //type TGPUVendor = (gvUnknown, gvNVIDIA, gvATI, gvIntel, gvApple); |
65 //type TGPUVendor = (gvUnknown, gvNVIDIA, gvATI, gvIntel, gvApple); |
64 |
66 |
65 var MaxTextureSize: LongInt; |
67 var MaxTextureSize: LongInt; |
66 {$IFDEF SDL13} |
68 {$IFDEF SDL13} |
562 begin |
564 begin |
563 LoadImage:= nil; |
565 LoadImage:= nil; |
564 WriteToConsole(msgLoading + filename + '.png [flags: ' + inttostr(imageFlags) + '] '); |
566 WriteToConsole(msgLoading + filename + '.png [flags: ' + inttostr(imageFlags) + '] '); |
565 |
567 |
566 s:= filename + '.png'; |
568 s:= filename + '.png'; |
567 tmpsurf:= IMG_Load(Str2PChar(s)); |
569 tmpsurf:= IMG_Load_RW(PHYSFSRWOPS_openRead(Str2PChar(s)), true); |
568 |
570 |
569 if tmpsurf = nil then |
571 if tmpsurf = nil then |
570 begin |
572 begin |
571 OutError(msgFailed, (imageFlags and ifCritical) <> 0); |
573 OutError(msgFailed, (imageFlags and ifCritical) <> 0); |
572 exit; |
574 exit; |
594 |
596 |
595 function LoadDataImage(const path: TPathType; const filename: shortstring; imageFlags: LongInt): PSDL_Surface; |
597 function LoadDataImage(const path: TPathType; const filename: shortstring; imageFlags: LongInt): PSDL_Surface; |
596 var tmpsurf: PSDL_Surface; |
598 var tmpsurf: PSDL_Surface; |
597 begin |
599 begin |
598 // check for file in user dir (never critical) |
600 // check for file in user dir (never critical) |
599 tmpsurf:= LoadImage(UserPathz[path] + '/' + filename, imageFlags and (not ifCritical)); |
601 tmpsurf:= LoadImage(cPathz[path] + '/' + filename, imageFlags); |
600 |
|
601 // if unsuccessful check data dir |
|
602 if (tmpsurf = nil) then |
|
603 tmpsurf:= LoadImage(Pathz[path] + '/' + filename, imageFlags); |
|
604 |
|
605 LoadDataImage:= tmpsurf; |
|
606 end; |
602 end; |
607 |
603 |
608 |
604 |
609 function LoadDataImageAltPath(const path, altPath: TPathType; const filename: shortstring; imageFlags: LongInt): PSDL_Surface; |
605 function LoadDataImageAltPath(const path, altPath: TPathType; const filename: shortstring; imageFlags: LongInt): PSDL_Surface; |
610 var tmpsurf: PSDL_Surface; |
606 var tmpsurf: PSDL_Surface; |