Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/LOSTexture.cpp
/* Copyright (C) 2014 Wildfire Games. | /* Copyright (C) 2019 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 349 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
size_t CLOSTexture::GetBitmapSize(size_t w, size_t h, size_t* pitch) | size_t CLOSTexture::GetBitmapSize(size_t w, size_t h, size_t* pitch) | ||||
{ | { | ||||
*pitch = round_up(w + g_BlurSize - 1, g_SubTextureAlignment); | *pitch = round_up(w + g_BlurSize - 1, g_SubTextureAlignment); | ||||
return *pitch * (h + g_BlurSize - 1); | return *pitch * (h + g_BlurSize - 1); | ||||
} | } | ||||
void CLOSTexture::GenerateBitmap(ICmpRangeManager::CLosQuerier los, u8* losData, size_t w, size_t h, size_t pitch) | void CLOSTexture::GenerateBitmap(const ICmpRangeManager::CLosQuerier& los, u8* losData, size_t w, size_t h, size_t pitch) | ||||
elexis: This change can be tested by compiing, starting a game and looking at the minimap. | |||||
{ | { | ||||
u8 *dataPtr = losData; | u8 *dataPtr = losData; | ||||
// Initialise the top padding | // Initialise the top padding | ||||
for (size_t j = 0; j < g_BlurSize/2; ++j) | for (size_t j = 0; j < g_BlurSize/2; ++j) | ||||
for (size_t i = 0; i < pitch; ++i) | for (size_t i = 0; i < pitch; ++i) | ||||
*dataPtr++ = 0; | *dataPtr++ = 0; | ||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
This change can be tested by compiing, starting a game and looking at the minimap.