hedgewars/uStore.pas
changeset 9295 f8819c3dde54
parent 9080 9b42757d7e71
child 9317 a04c30940d2d
equal deleted inserted replaced
9293:873022596d15 9295:f8819c3dde54
    52 procedure InitOffscreenOpenGL;
    52 procedure InitOffscreenOpenGL;
    53 {$ENDIF}
    53 {$ENDIF}
    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 procedure SetSkyColor(r, g, b: real);
    57 
    58 
    58 implementation
    59 implementation
    59 uses uMisc, uConsole, uVariables, uUtils, uTextures, uRender, uRenderUtils, uCommands
    60 uses uMisc, uConsole, uVariables, uUtils, uTextures, uRender, uRenderUtils, uCommands
    60     , uPhysFSLayer
    61     , uPhysFSLayer
    61     , uDebug
    62     , uDebug
  1256     if reinit then
  1257     if reinit then
  1257         begin
  1258         begin
  1258         // clean the window from any previous content
  1259         // clean the window from any previous content
  1259         glClear(GL_COLOR_BUFFER_BIT);
  1260         glClear(GL_COLOR_BUFFER_BIT);
  1260         if SuddenDeathDmg then
  1261         if SuddenDeathDmg then
  1261             glClearColor(SDSkyColor.r * (SDTint/255) / 255, SDSkyColor.g * (SDTint/255) / 255, SDSkyColor.b * (SDTint/255) / 255, 0.99)
  1262             SetSkyColor(SDSkyColor.r * (SDTint/255) / 255, SDSkyColor.g * (SDTint/255) / 255, SDSkyColor.b * (SDTint/255) / 255)
  1262         else if ((cReducedQuality and rqNoBackground) = 0) then 
  1263         else if ((cReducedQuality and rqNoBackground) = 0) then 
  1263             glClearColor(SkyColor.r / 255, SkyColor.g / 255, SkyColor.b / 255, 0.99)
  1264             SetSkyColor(SkyColor.r / 255, SkyColor.g / 255, SkyColor.b / 255)
  1264         else
  1265         else
  1265             glClearColor(RQSkyColor.r / 255, RQSkyColor.g / 255, RQSkyColor.b / 255, 0.99);
  1266             SetSkyColor(RQSkyColor.r / 255, RQSkyColor.g / 255, RQSkyColor.b / 255);
  1266 
  1267 
  1267         // reload everything we had before
  1268         // reload everything we had before
  1268         ReloadCaptions(false);
  1269         ReloadCaptions(false);
  1269         ReloadLines;
  1270         ReloadLines;
  1270         StoreLoad(true);
  1271         StoreLoad(true);
  1271         // redraw all land
  1272         // redraw all land
  1272         UpdateLandTexture(0, LAND_WIDTH, 0, LAND_HEIGHT, false);
  1273         UpdateLandTexture(0, LAND_WIDTH, 0, LAND_HEIGHT, false);
  1273         end;
  1274         end;
       
  1275 end;
       
  1276 
       
  1277 procedure WarpMouse(x, y: Word); inline;
       
  1278 begin
       
  1279 {$IFDEF SDL13}
       
  1280     SDL_WarpMouseInWindow(SDLwindow, x, y);
       
  1281 {$ELSE}
       
  1282     x:= x; y:= y; // avoid hints
       
  1283 {$ENDIF}
       
  1284 end;
       
  1285 
       
  1286 procedure SwapBuffers; {$IFDEF USE_VIDEO_RECORDING}cdecl{$ELSE}inline{$ENDIF};
       
  1287 begin
       
  1288     if GameType = gmtRecord then
       
  1289         exit;
       
  1290 {$IFDEF SDL13}
       
  1291     SDL_GL_SwapWindow(SDLwindow);
       
  1292 {$ELSE}
       
  1293     SDL_GL_SwapBuffers();
       
  1294 {$ENDIF}
       
  1295 end;
       
  1296 
       
  1297 procedure SetSkyColor(r, g, b: real);
       
  1298 begin
       
  1299     glClearColor(r, g, b, 0.99)
  1274 end;
  1300 end;
  1275 
  1301 
  1276 procedure initModule;
  1302 procedure initModule;
  1277 var ai: TAmmoType;
  1303 var ai: TAmmoType;
  1278     i: LongInt;
  1304     i: LongInt;
  1308     SDL_GL_DeleteContext(SDLGLcontext);
  1334     SDL_GL_DeleteContext(SDLGLcontext);
  1309     SDL_DestroyWindow(SDLwindow);
  1335     SDL_DestroyWindow(SDLwindow);
  1310 {$ENDIF}
  1336 {$ENDIF}
  1311     SDL_Quit();
  1337     SDL_Quit();
  1312 end;
  1338 end;
  1313 
       
  1314 procedure WarpMouse(x, y: Word); inline;
       
  1315 begin
       
  1316 {$IFDEF SDL13}
       
  1317     SDL_WarpMouseInWindow(SDLwindow, x, y);
       
  1318 {$ELSE}
       
  1319     x:= x; y:= y; // avoid hints
       
  1320 {$ENDIF}
       
  1321 end;
       
  1322 
       
  1323 procedure SwapBuffers; {$IFDEF USE_VIDEO_RECORDING}cdecl{$ELSE}inline{$ENDIF};
       
  1324 begin
       
  1325     if GameType = gmtRecord then
       
  1326         exit;
       
  1327 {$IFDEF SDL13}
       
  1328     SDL_GL_SwapWindow(SDLwindow);
       
  1329 {$ELSE}
       
  1330     SDL_GL_SwapBuffers();
       
  1331 {$ENDIF}
       
  1332 end;
       
  1333 
       
  1334 end.
  1339 end.