Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rts/Lua/LuaOpenGLUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,8 @@ void LuaMatTexture::Print(const string& indent) const
STRING_CASE(typeName, LUATEX_ICONS_ATLAS0);
STRING_CASE(typeName, LUATEX_ICONS_ATLAS1);

STRING_CASE(typeName, LUATEX_LUATEXTUREATLAS);

Comment thread
bruno-dasilva marked this conversation as resolved.
#undef STRING_CASE
}

Expand Down
3 changes: 1 addition & 2 deletions rts/Map/SMF/SMFGroundTextures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ void CSMFGroundTextures::LoadTiles(CSMFMapFile& file)

tileMap.clear();
tileMap.resize(smfMap->tileCount);
tiles.clear();
tiles.resize(tileHeader.numTiles * SMALL_TILE_SIZE);
tiles.assign(static_cast<size_t>(tileHeader.numTiles) * SMALL_TILE_SIZE, 0);
Comment thread
bruno-dasilva marked this conversation as resolved.
squares.clear();
squares.resize(smfMap->numBigTexX * smfMap->numBigTexY);

Expand Down
2 changes: 1 addition & 1 deletion rts/Rendering/DepthBufferCopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,6 @@ void DepthBufferCopy::CreateTextureAndFBO(bool ms)
depthFBO->Bind();
depthFBO->AttachTexture(depthTexture, target, GL_DEPTH_ATTACHMENT);
glDrawBuffer(GL_NONE);
depthFBO->CheckStatus("DEPTH-BUFFER-COPY-FBO" + ms ? "-MULTISAMPLED" : "");
depthFBO->CheckStatus(ms ? "DEPTH-BUFFER-COPY-FBO-MULTISAMPLED" : "DEPTH-BUFFER-COPY-FBO");
Comment thread
bruno-dasilva marked this conversation as resolved.
depthFBO->Unbind();
}
2 changes: 1 addition & 1 deletion rts/Rendering/GL/glHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ inline GLuint FetchActiveTextureSlot() {
template<auto DedicatedGLFuncPtrPtr, GLenum... GLParamName, class AttribValuesTupleType>
inline void glSetAny(AttribValuesTupleType&& newValues)
{
if constexpr(DedicatedGLFuncPtrPtr)
if constexpr(DedicatedGLFuncPtrPtr != nullptr)
Comment thread
bruno-dasilva marked this conversation as resolved.
{
static auto HelperFunc = [](auto&& ... p) {
(*DedicatedGLFuncPtrPtr)(std::forward<decltype(p)>(p)...);
Expand Down
5 changes: 3 additions & 2 deletions rts/Rendering/Textures/Bitmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,11 @@ void ITexMemPool::Init(size_t size)
{
RECOIL_DETAILED_TRACY_ZONE;
if (size == 0) {
if (texMemPool == nullptr || typeid(*texMemPool.get()) != typeid(TexNoMemPool))
if (dynamic_cast<TexNoMemPool*>(texMemPool.get()) == nullptr)
texMemPool = std::make_unique<TexNoMemPool>();
}
else {
if (texMemPool == nullptr || typeid(*texMemPool.get()) != typeid( TexMemPool))
if (dynamic_cast< TexMemPool*>(texMemPool.get()) == nullptr)
texMemPool = std::make_unique< TexMemPool>();
}
texMemPool->Resize(size);
Comment thread
bruno-dasilva marked this conversation as resolved.
Expand Down Expand Up @@ -405,6 +405,7 @@ class BitmapAction {
BitmapAction(CBitmap* bmp_)
: bmp{ bmp_ }
{}
virtual ~BitmapAction() = default;

BitmapAction(const BitmapAction& ba) = delete;
BitmapAction(BitmapAction&& ba) noexcept = delete;
Expand Down
4 changes: 3 additions & 1 deletion rts/Rendering/Units/UnitDrawer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,10 @@ void CUnitDrawerGLSL::DrawUnitMiniMapIcon(TypedRenderBuffer<VA_TYPE_2DTC3>& rb,

std::swap(posX, posY);
break;
case CMiniMap::ROTATION_0:
break;
}

float x0 = posX - iconSizeX;
float x1 = posX + iconSizeX;
float y0 = posY - iconSizeY;
Expand Down
5 changes: 4 additions & 1 deletion rts/Sim/MoveTypes/MoveDefHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,10 @@ MoveDef::MoveDef(const LuaTable& moveDefTable): MoveDef() {
waterline = std::abs(moveDefTable.GetInt("waterline", defaultWaterline));
overrideUnitWaterline = moveDefTable.GetBool("overrideUnitWaterline", overrideUnitWaterline);
} else {
waterline = std::numeric_limits<int>::max();
// we read as int from configuration but used as float...
// this should probably be changed to float everywhere
// github issue: https://github.com/beyond-all-reason/RecoilEngine/issues/2996
waterline = static_cast<float>(std::numeric_limits<int>::max());
}

height = std::max(1, moveDefTable.GetInt("height", defaultHeight));
Expand Down
2 changes: 1 addition & 1 deletion rts/Sim/Path/HAPFS/PathingState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ void PathingState::CalcVertexPathCosts(const MoveDef& moveDef, int2 block, unsig
// other four directions are stored at the adjacent vertices)
auto idx = BlockPosToIdx(block);
const uint8_t nodeLinksObsoleteFlags = blockStates.nodeLinksObsoleteFlags[idx]
& (moveDef.allowDirectionalPathing) ? PATH_DIRECTIONS_MASK : PATH_DIRECTIONS_HALF_MASK;
& ((moveDef.allowDirectionalPathing) ? PATH_DIRECTIONS_MASK : PATH_DIRECTIONS_HALF_MASK);
Comment thread
bruno-dasilva marked this conversation as resolved.

int pathdir = 0;
for (int checkBit = 1; checkBit <= PATHDIR_LEFT_DOWN_MASK; checkBit <<= 1, ++pathdir) {
Expand Down
3 changes: 1 addition & 2 deletions rts/Sim/Units/Scripts/CobDeferredCallin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@


CCobDeferredCallin::CCobDeferredCallin(const CUnit* unit, const LuaHashString& hs, const std::vector<int>& dataStack, const int stackStart)
: argCount(argCount), unit(unit), funcName(hs.GetString()), funcHash(hs.GetHash())
: unit(unit), argCount(std::min(stackStart, MAX_LUA_COB_ARGS)), funcName(hs.GetString()), funcHash(hs.GetHash())
{
const int size = static_cast<int>(dataStack.size());
argCount = std::min(stackStart, MAX_LUA_COB_ARGS);
Comment thread
bruno-dasilva marked this conversation as resolved.

const int start = std::max(0, size - stackStart);
const int end = std::min(size, start + argCount);
Expand Down
Loading