fix almost all compiler errors and warnings
This commit is contained in:
@@ -134,7 +134,6 @@ ADD_SUBDIRECTORY("${EXTERNAL_SOURCE_DIR}/qtimgui")
|
||||
ADD_SUBDIRECTORY("${EXTERNAL_SOURCE_DIR}/QtAdvancedDockingSystem")
|
||||
ADD_SUBDIRECTORY("${EXTERNAL_SOURCE_DIR}/NodeEditor")
|
||||
option(BUILD_LIBNOISE_EXAMPLES "Build libnoise examples" OFF)
|
||||
option(BUILD_LIBNOISE_UTILS "Build libnoise utils" OFF)
|
||||
ADD_SUBDIRECTORY("${EXTERNAL_SOURCE_DIR}/libnoise")
|
||||
ADD_SUBDIRECTORY("${EXTERNAL_SOURCE_DIR}/glm")
|
||||
|
||||
@@ -444,3 +443,24 @@ ENDIF()
|
||||
|
||||
includePlatform("pack")
|
||||
|
||||
# Disable warnings
|
||||
if(WIN32)
|
||||
target_compile_options(lodepng PRIVATE /wd4334 /wd4267)
|
||||
target_compile_options(FramelessHelper PRIVATE /wd4996)
|
||||
target_compile_options(ColorWidgets-qt5 PRIVATE /wd4996)
|
||||
target_compile_options(qtadvanceddocking PRIVATE /wd4996)
|
||||
target_compile_options(nodes PRIVATE /wd4100 /wd4267 /wd4456 /wd4101 /wd5054 /wd4458 /wd4018 /wd4189)
|
||||
target_compile_options(noiseutils-static PRIVATE /wd4244)
|
||||
|
||||
foreach(file ${png_blp_sources})
|
||||
set_source_files_properties(${file} PROPERTIES COMPILE_FLAGS "/wd4244 /wd4819 /wd4018 /wd4996 /wd4267 /wd4305")
|
||||
endforeach()
|
||||
|
||||
foreach(file ${imguipiemenu_sources})
|
||||
set_source_files_properties(${file} PROPERTIES COMPILE_FLAGS "/wd4244 /wd4267")
|
||||
endforeach()
|
||||
|
||||
foreach(file ${gradienteditor_sources})
|
||||
set_source_files_properties(${file} PROPERTIES COMPILE_FLAGS "/wd4996")
|
||||
endforeach()
|
||||
endif()
|
||||
2
cmake
2
cmake
Submodule cmake updated: de8a3b94ba...1f2d79b79f
@@ -342,7 +342,7 @@ public:
|
||||
BOOL Publics; // contains public symbols
|
||||
};
|
||||
*/
|
||||
typedef struct IMAGEHLP_MODULE64_V2 {
|
||||
struct IMAGEHLP_MODULE64_V2 {
|
||||
DWORD SizeOfStruct; // set to sizeof(IMAGEHLP_MODULE64)
|
||||
DWORD64 BaseOfImage; // base load address of module
|
||||
DWORD ImageSize; // virtual size of the loaded module
|
||||
|
||||
2
src/external/blizzard-archive-library
vendored
2
src/external/blizzard-archive-library
vendored
Submodule src/external/blizzard-archive-library updated: c4c9d75e93...cb73a80bc6
2
src/external/blizzard-database-library
vendored
2
src/external/blizzard-database-library
vendored
Submodule src/external/blizzard-database-library updated: 3098739e5a...b0bd5d2732
10
src/external/libnoise/noiseutils/CMakeLists.txt
vendored
10
src/external/libnoise/noiseutils/CMakeLists.txt
vendored
@@ -3,13 +3,13 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS YES CACHE BOOL "Export all symbols")
|
||||
set(libSrcs ${libSrcs}
|
||||
noiseutils.cpp
|
||||
)
|
||||
add_library(noiseutils SHARED ${libSrcs})
|
||||
#add_library(noiseutils SHARED ${libSrcs})
|
||||
add_library(noiseutils-static STATIC ${libSrcs})
|
||||
|
||||
set_target_properties(noiseutils PROPERTIES LIBNOISE_VERSION ${LIBNOISE_VERSION})
|
||||
#set_target_properties(noiseutils PROPERTIES LIBNOISE_VERSION ${LIBNOISE_VERSION})
|
||||
set_target_properties(noiseutils-static PROPERTIES LIBNOISE_VERSION ${LIBNOISE_VERSION})
|
||||
|
||||
target_link_libraries(noiseutils noise)
|
||||
#target_link_libraries(noiseutils noise)
|
||||
target_link_libraries(noiseutils-static noise-static)
|
||||
|
||||
# I would like to see more projects using these defaults
|
||||
@@ -22,7 +22,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
endif()
|
||||
|
||||
# Where to look for noise headers
|
||||
target_include_directories( noiseutils PRIVATE ../src )
|
||||
#target_include_directories( noiseutils PRIVATE ../src )
|
||||
target_include_directories( noiseutils-static PRIVATE ../src )
|
||||
|
||||
# install include files into /include
|
||||
@@ -30,7 +30,7 @@ install( FILES "${PROJECT_SOURCE_DIR}/noiseutils/noiseutils.h"
|
||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/include/noise" )
|
||||
|
||||
# install dynamic libraries (.dll or .so) into /bin
|
||||
install( TARGETS noiseutils DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" )
|
||||
#install( TARGETS noiseutils DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" )
|
||||
|
||||
# install static libraries (.lib) into /lib
|
||||
install( TARGETS noiseutils-static DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" )
|
||||
|
||||
@@ -69,7 +69,7 @@ Action* ActionManager::beginAction(MapView* map_view
|
||||
// clean canceled actions
|
||||
if (_undo_index)
|
||||
{
|
||||
for (int i = 0; i < _undo_index; ++i)
|
||||
for (unsigned i = 0; i < _undo_index; ++i)
|
||||
{
|
||||
delete _action_stack.back();
|
||||
_action_stack.pop_back();
|
||||
@@ -151,7 +151,7 @@ void ActionManager::undo()
|
||||
if (_action_stack.empty())
|
||||
return;
|
||||
|
||||
int index = _action_stack.size() - _undo_index - 1;
|
||||
int index = static_cast<int>(_action_stack.size()) - static_cast<int>(_undo_index) - 1;
|
||||
|
||||
if (index < 0)
|
||||
return;
|
||||
@@ -173,7 +173,7 @@ void ActionManager::redo()
|
||||
if (!_undo_index)
|
||||
return;
|
||||
|
||||
unsigned index = _action_stack.size() - _undo_index;
|
||||
unsigned index = static_cast<int>(_action_stack.size()) - static_cast<int>(_undo_index);
|
||||
|
||||
Action* action = _action_stack.at(index);
|
||||
action->undo(true);
|
||||
|
||||
@@ -64,7 +64,7 @@ void Alphamap::readCompressed(BlizzardArchive::ClientFile *f)
|
||||
if (offset_output + count > 4096)
|
||||
{
|
||||
LogError << "Invalid MCAL, uncompressed size is greater than 4096" << std::endl;
|
||||
count = 4096 - offset_output;
|
||||
count = static_cast<int>(4096 - offset_output);
|
||||
}
|
||||
|
||||
++input;
|
||||
|
||||
@@ -204,19 +204,19 @@ namespace Animation
|
||||
const AnimationBlockHeader* timestampHeaders = file.get<AnimationBlockHeader>(animationBlock.ofsTimes);
|
||||
const AnimationBlockHeader* keyHeaders = file.get<AnimationBlockHeader>(animationBlock.ofsKeys);
|
||||
|
||||
for (size_t j = 0; j < animationBlock.nTimes; ++j)
|
||||
for (std::uint32_t j = 0; j < animationBlock.nTimes; ++j)
|
||||
{
|
||||
const TimestampType* timestamps = j < animation_files.size() && animation_files[j] ?
|
||||
animation_files[j]->get<TimestampType>(timestampHeaders[j].ofsEntries) :
|
||||
file.get<TimestampType>(timestampHeaders[j].ofsEntries);
|
||||
|
||||
for (size_t i = 0; i < timestampHeaders[j].nEntries; ++i)
|
||||
for (std::uint32_t i = 0; i < timestampHeaders[j].nEntries; ++i)
|
||||
{
|
||||
times[j].push_back(timestamps[i]);
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t j = 0; j < animationBlock.nKeys; ++j)
|
||||
for (std::uint32_t j = 0; j < animationBlock.nKeys; ++j)
|
||||
{
|
||||
const DataType* keys = j < animation_files.size() && animation_files[j] ?
|
||||
animation_files[j]->get<DataType>(keyHeaders[j].ofsEntries) :
|
||||
@@ -226,14 +226,14 @@ namespace Animation
|
||||
{
|
||||
case Animation::Interpolation::Type::NONE:
|
||||
case Animation::Interpolation::Type::LINEAR:
|
||||
for (size_t i = 0; i < keyHeaders[j].nEntries; ++i)
|
||||
for (std::uint32_t i = 0; i < keyHeaders[j].nEntries; ++i)
|
||||
{
|
||||
data[j].push_back(_conversion(keys[i]));
|
||||
}
|
||||
break;
|
||||
|
||||
case Animation::Interpolation::Type::HERMITE:
|
||||
for (size_t i = 0; i < keyHeaders[j].nEntries; ++i)
|
||||
for (std::uint32_t i = 0; i < keyHeaders[j].nEntries; ++i)
|
||||
{
|
||||
data[j].push_back(_conversion(keys[i * 3]));
|
||||
in[j].push_back(_conversion(keys[i * 3 + 1]));
|
||||
@@ -250,9 +250,9 @@ namespace Animation
|
||||
{
|
||||
case Animation::Interpolation::Type::NONE:
|
||||
case Animation::Interpolation::Type::LINEAR:
|
||||
for (size_t i = 0; i < data.size(); ++i)
|
||||
for (std::uint32_t i = 0; i < data.size(); ++i)
|
||||
{
|
||||
for (size_t j = 0; j < data[i].size(); ++j)
|
||||
for (std::uint32_t j = 0; j < data[i].size(); ++j)
|
||||
{
|
||||
data[i][j] = function(data[i][j]);
|
||||
}
|
||||
@@ -260,9 +260,9 @@ namespace Animation
|
||||
break;
|
||||
|
||||
case Animation::Interpolation::Type::HERMITE:
|
||||
for (size_t i = 0; i < data.size(); ++i)
|
||||
for (std::uint32_t i = 0; i < data.size(); ++i)
|
||||
{
|
||||
for (size_t j = 0; j < data[i].size(); ++j)
|
||||
for (std::uint32_t j = 0; j < data[i].size(); ++j)
|
||||
{
|
||||
data[i][j] = function(data[i][j]);
|
||||
in[i][j] = function(in[i][j]);
|
||||
|
||||
@@ -122,7 +122,7 @@ void ChunkWater::save(sExtendableArray& adt, int base_pos, int& header_pos, int&
|
||||
|
||||
if (hasData(0))
|
||||
{
|
||||
header.nLayers = _layers.size();
|
||||
header.nLayers = static_cast<std::uint32_t>(_layers.size());
|
||||
|
||||
if (Render.has_value())
|
||||
{
|
||||
@@ -139,9 +139,9 @@ void ChunkWater::save(sExtendableArray& adt, int base_pos, int& header_pos, int&
|
||||
int info_pos = current_pos;
|
||||
|
||||
std::size_t info_size = sizeof(MH2O_Information) * _layers.size();
|
||||
current_pos += info_size;
|
||||
current_pos += static_cast<std::uint32_t>(info_size);
|
||||
|
||||
adt.Extend(info_size);
|
||||
adt.Extend(static_cast<long>(info_size));
|
||||
|
||||
for (liquid_layer& layer : _layers)
|
||||
{
|
||||
@@ -315,7 +315,7 @@ void ChunkWater::paintLiquid( glm::vec3 const& pos
|
||||
|
||||
void ChunkWater::cleanup()
|
||||
{
|
||||
for (int i = _layers.size() - 1; i >= 0; --i)
|
||||
for (int i = static_cast<int>(_layers.size() - 1); i >= 0; --i)
|
||||
{
|
||||
if (_layers[i].empty())
|
||||
{
|
||||
|
||||
@@ -99,7 +99,7 @@ DBCFile::Record DBCFile::addRecord(size_t id, size_t id_field)
|
||||
|
||||
size_t old_size = data.size();
|
||||
data.resize(old_size + recordSize);
|
||||
*reinterpret_cast<unsigned int*>(data.data() + old_size + id_field * sizeof(std::uint32_t)) = id;
|
||||
*reinterpret_cast<unsigned int*>(data.data() + old_size + id_field * sizeof(std::uint32_t)) = static_cast<unsigned int>(id);
|
||||
|
||||
return Record(*this, data.data() + old_size);
|
||||
}
|
||||
@@ -137,7 +137,7 @@ DBCFile::Record DBCFile::addRecordCopy(size_t id, size_t id_from, size_t id_fiel
|
||||
|
||||
Record record_from = getRecord(from_idx);
|
||||
std::copy(data.data() + from_idx * recordSize, data.data() + from_idx * recordSize + recordSize, data.data() + old_size);
|
||||
*reinterpret_cast<unsigned int*>(data.data() + old_size + id_field * sizeof(std::uint32_t)) = id;
|
||||
*reinterpret_cast<unsigned int*>(data.data() + old_size + id_field * sizeof(std::uint32_t)) = static_cast<unsigned int>(id);
|
||||
|
||||
return Record(*this, data.data() + old_size);
|
||||
}
|
||||
|
||||
@@ -99,10 +99,10 @@ public:
|
||||
}
|
||||
|
||||
size_t old_size = file.stringTable.size();
|
||||
*reinterpret_cast<unsigned int*>(offset + field * 4) = file.stringTable.size();
|
||||
*reinterpret_cast<unsigned int*>(offset + field * 4) = static_cast<unsigned int>(file.stringTable.size());
|
||||
file.stringTable.resize(old_size + val.size() + 1);
|
||||
std::copy(val.c_str(), val.c_str() + val.size() + 1, file.stringTable.data() + old_size);
|
||||
file.stringSize += val.size() + 1;
|
||||
file.stringSize += static_cast<std::uint32_t>(val.size() + 1);
|
||||
}
|
||||
|
||||
void writeLocalizedString(size_t field, const std::string& val, int locale)
|
||||
@@ -116,10 +116,10 @@ public:
|
||||
}
|
||||
|
||||
size_t old_size = file.stringTable.size();
|
||||
*reinterpret_cast<unsigned int*>(offset + ((field + locale) * 4)) = file.stringTable.size();
|
||||
*reinterpret_cast<unsigned int*>(offset + ((field + locale) * 4)) = static_cast<unsigned int>(file.stringTable.size());
|
||||
file.stringTable.resize(old_size + val.size() + 1);
|
||||
std::copy(val.c_str(), val.c_str() + val.size() + 1, file.stringTable.data() + old_size);
|
||||
file.stringSize += val.size() + 1;
|
||||
file.stringSize += static_cast<std::uint32_t>(val.size() + 1);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -788,7 +788,7 @@ void MapChunk::updateNormalsData()
|
||||
|
||||
bool MapChunk::changeTerrain(glm::vec3 const& pos, float change, float radius, int BrushType, float inner_radius)
|
||||
{
|
||||
float dist, xdiff, zdiff;
|
||||
//float dist, xdiff, zdiff;
|
||||
bool changed = false;
|
||||
|
||||
for (int i = 0; i < mapbufsize; ++i)
|
||||
@@ -1519,11 +1519,11 @@ void MapChunk::save(sExtendableArray& lADTFile
|
||||
// {
|
||||
size_t lMCLY_Size = texture_set ? texture_set->num() * 0x10 : 0;
|
||||
|
||||
lADTFile.Extend(8 + lMCLY_Size);
|
||||
SetChunkHeader(lADTFile, lCurrentPosition, 'MCLY', lMCLY_Size);
|
||||
lADTFile.Extend(static_cast<long>(8 + lMCLY_Size));
|
||||
SetChunkHeader(lADTFile, lCurrentPosition, 'MCLY', static_cast<int>(lMCLY_Size));
|
||||
|
||||
lADTFile.GetPointer<MapChunkHeader>(lMCNK_Position + 8)->ofsLayer = lCurrentPosition - lMCNK_Position;
|
||||
lADTFile.GetPointer<MapChunkHeader>(lMCNK_Position + 8)->nLayers = texture_set ? texture_set->num() : 0;
|
||||
lADTFile.GetPointer<MapChunkHeader>(lMCNK_Position + 8)->nLayers = texture_set ? static_cast<std::uint32_t>(texture_set->num()) : 0;
|
||||
|
||||
std::vector<std::vector<uint8_t>> alphamaps;
|
||||
|
||||
@@ -1536,7 +1536,7 @@ void MapChunk::save(sExtendableArray& lADTFile
|
||||
// MCLY data
|
||||
for (size_t j = 0; j < texture_set->num(); ++j)
|
||||
{
|
||||
ENTRY_MCLY * lLayer = lADTFile.GetPointer<ENTRY_MCLY>(lCurrentPosition + 8 + 0x10 * j);
|
||||
ENTRY_MCLY * lLayer = lADTFile.GetPointer<ENTRY_MCLY>(lCurrentPosition + 8 + 0x10 * static_cast<unsigned long>(j));
|
||||
|
||||
lLayer->textureID = lTextures.find(texture_set->filename(j))->second;
|
||||
lLayer->flags = texture_set->flag(j);
|
||||
@@ -1553,14 +1553,14 @@ void MapChunk::save(sExtendableArray& lADTFile
|
||||
//! \todo find out why compression fuck up textures ingame
|
||||
lLayer->flags &= ~FLAG_ALPHA_COMPRESSED;
|
||||
|
||||
lMCAL_Size += alphamaps[j - 1].size();
|
||||
lMCAL_Size += static_cast<int>(alphamaps[j - 1].size());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
lCurrentPosition += 8 + lMCLY_Size;
|
||||
lMCNK_Size += 8 + lMCLY_Size;
|
||||
lCurrentPosition += 8 + static_cast<int>(lMCLY_Size);
|
||||
lMCNK_Size += 8 + static_cast<int>(lMCLY_Size);
|
||||
// }
|
||||
|
||||
// MCRF
|
||||
@@ -1595,13 +1595,13 @@ void MapChunk::save(sExtendableArray& lADTFile
|
||||
lID++;
|
||||
}
|
||||
|
||||
int lMCRF_Size = 4 * (lDoodadIDs.size() + lObjectIDs.size());
|
||||
int lMCRF_Size = static_cast<int>(4 * (lDoodadIDs.size() + lObjectIDs.size()));
|
||||
lADTFile.Extend(8 + lMCRF_Size);
|
||||
SetChunkHeader(lADTFile, lCurrentPosition, 'MCRF', lMCRF_Size);
|
||||
|
||||
lADTFile.GetPointer<MapChunkHeader>(lMCNK_Position + 8)->ofsRefs = lCurrentPosition - lMCNK_Position;
|
||||
lADTFile.GetPointer<MapChunkHeader>(lMCNK_Position + 8)->nDoodadRefs = lDoodadIDs.size();
|
||||
lADTFile.GetPointer<MapChunkHeader>(lMCNK_Position + 8)->nMapObjRefs = lObjectIDs.size();
|
||||
lADTFile.GetPointer<MapChunkHeader>(lMCNK_Position + 8)->nDoodadRefs = static_cast<std::uint32_t>(lDoodadIDs.size());
|
||||
lADTFile.GetPointer<MapChunkHeader>(lMCNK_Position + 8)->nMapObjRefs = static_cast<std::uint32_t>(lObjectIDs.size());
|
||||
|
||||
// MCRF data
|
||||
int *lReferences = lADTFile.GetPointer<int>(lCurrentPosition + 8);
|
||||
|
||||
@@ -662,10 +662,10 @@ void MapTile::saveTile(World* world)
|
||||
// MTEX data
|
||||
for (auto const& texture : lTextures)
|
||||
{
|
||||
lADTFile.Insert(lCurrentPosition, texture.first.size() + 1, texture.first.c_str());
|
||||
lADTFile.Insert(lCurrentPosition, static_cast<unsigned long>(texture.first.size() + 1), texture.first.c_str());
|
||||
|
||||
lCurrentPosition += texture.first.size() + 1;
|
||||
lADTFile.GetPointer<sChunkHeader>(lMTEX_Position)->mSize += texture.first.size() + 1;
|
||||
lCurrentPosition += static_cast<int>(texture.first.size() + 1);
|
||||
lADTFile.GetPointer<sChunkHeader>(lMTEX_Position)->mSize += static_cast<int>(texture.first.size() + 1);
|
||||
LogDebug << "Added texture \"" << texture.first << "\"." << std::endl;
|
||||
}
|
||||
|
||||
@@ -681,15 +681,15 @@ void MapTile::saveTile(World* world)
|
||||
for (auto it = lModels.begin(); it != lModels.end(); ++it)
|
||||
{
|
||||
it->second.filenamePosition = lADTFile.GetPointer<sChunkHeader>(lMMDX_Position)->mSize;
|
||||
lADTFile.Insert(lCurrentPosition, it->first.size() + 1, misc::normalize_adt_filename(it->first).c_str());
|
||||
lCurrentPosition += it->first.size() + 1;
|
||||
lADTFile.GetPointer<sChunkHeader>(lMMDX_Position)->mSize += it->first.size() + 1;
|
||||
lADTFile.Insert(lCurrentPosition, static_cast<unsigned long>(it->first.size() + 1), misc::normalize_adt_filename(it->first).c_str());
|
||||
lCurrentPosition += static_cast<int>(it->first.size() + 1);
|
||||
lADTFile.GetPointer<sChunkHeader>(lMMDX_Position)->mSize += static_cast<int>(it->first.size() + 1);
|
||||
LogDebug << "Added model \"" << it->first << "\"." << std::endl;
|
||||
}
|
||||
|
||||
// MMID
|
||||
// M2 model names
|
||||
int lMMID_Size = 4 * lModels.size();
|
||||
int lMMID_Size = static_cast<int>(4 * lModels.size());
|
||||
lADTFile.Extend(8 + lMMID_Size);
|
||||
SetChunkHeader(lADTFile, lCurrentPosition, 'MMID', lMMID_Size);
|
||||
lADTFile.GetPointer<MHDR>(lMHDR_Position + 8)->mmid = lCurrentPosition - 0x14;
|
||||
@@ -718,14 +718,14 @@ void MapTile::saveTile(World* world)
|
||||
for (auto& object : lObjects)
|
||||
{
|
||||
object.second.filenamePosition = lADTFile.GetPointer<sChunkHeader>(lMWMO_Position)->mSize;
|
||||
lADTFile.Insert(lCurrentPosition, object.first.size() + 1, misc::normalize_adt_filename(object.first).c_str());
|
||||
lCurrentPosition += object.first.size() + 1;
|
||||
lADTFile.GetPointer<sChunkHeader>(lMWMO_Position)->mSize += object.first.size() + 1;
|
||||
lADTFile.Insert(lCurrentPosition, static_cast<unsigned long>(object.first.size() + 1), misc::normalize_adt_filename(object.first).c_str());
|
||||
lCurrentPosition += static_cast<int>(object.first.size() + 1);
|
||||
lADTFile.GetPointer<sChunkHeader>(lMWMO_Position)->mSize += static_cast<int>(object.first.size() + 1);
|
||||
LogDebug << "Added object \"" << object.first << "\"." << std::endl;
|
||||
}
|
||||
|
||||
// MWID
|
||||
int lMWID_Size = 4 * lObjects.size();
|
||||
int lMWID_Size = static_cast<int>(4 * lObjects.size());
|
||||
lADTFile.Extend(8 + lMWID_Size);
|
||||
SetChunkHeader(lADTFile, lCurrentPosition, 'MWID', lMWID_Size);
|
||||
lADTFile.GetPointer<MHDR>(lMHDR_Position + 8)->mwid = lCurrentPosition - 0x14;
|
||||
@@ -740,7 +740,7 @@ void MapTile::saveTile(World* world)
|
||||
lCurrentPosition += 8 + lMWID_Size;
|
||||
|
||||
// MDDF
|
||||
int lMDDF_Size = 0x24 * lModelInstances.size();
|
||||
int lMDDF_Size = static_cast<int>(0x24 * lModelInstances.size());
|
||||
lADTFile.Extend(8 + lMDDF_Size);
|
||||
SetChunkHeader(lADTFile, lCurrentPosition, 'MDDF', lMDDF_Size);
|
||||
lADTFile.GetPointer<MHDR>(lMHDR_Position + 8)->mddf = lCurrentPosition - 0x14;
|
||||
@@ -784,7 +784,7 @@ void MapTile::saveTile(World* world)
|
||||
LogDebug << "Added " << lID << " doodads to MDDF" << std::endl;
|
||||
|
||||
// MODF
|
||||
int lMODF_Size = 0x40 * lObjectInstances.size();
|
||||
int lMODF_Size = static_cast<int>(0x40 * lObjectInstances.size());
|
||||
lADTFile.Extend(8 + lMODF_Size);
|
||||
SetChunkHeader(lADTFile, lCurrentPosition, 'MODF', lMODF_Size);
|
||||
lADTFile.GetPointer<MHDR>(lMHDR_Position + 8)->modf = lCurrentPosition - 0x14;
|
||||
@@ -847,8 +847,8 @@ void MapTile::saveTile(World* world)
|
||||
if (mFlags & 1)
|
||||
{
|
||||
size_t chunkSize = sizeof(int16_t) * 9 * 2;
|
||||
lADTFile.Extend(8 + chunkSize);
|
||||
SetChunkHeader(lADTFile, lCurrentPosition, 'MFBO', chunkSize);
|
||||
lADTFile.Extend(static_cast<long>(8 + chunkSize));
|
||||
SetChunkHeader(lADTFile, lCurrentPosition, 'MFBO', static_cast<int>(chunkSize));
|
||||
lADTFile.GetPointer<MHDR>(lMHDR_Position + 8)->mfbo = lCurrentPosition - 0x14;
|
||||
|
||||
int16_t *lMFBO_Data = lADTFile.GetPointer<int16_t>(lCurrentPosition + 8);
|
||||
@@ -861,7 +861,7 @@ void MapTile::saveTile(World* world)
|
||||
for (int i = 0; i < 9; ++i)
|
||||
lMFBO_Data[lID++] = (int16_t)mMinimumValues[i].y;
|
||||
|
||||
lCurrentPosition += 8 + chunkSize;
|
||||
lCurrentPosition += static_cast<int>(8 + chunkSize);
|
||||
}
|
||||
|
||||
//! \todo Do not do bullshit here in MTFX.
|
||||
@@ -885,7 +885,7 @@ void MapTile::saveTile(World* world)
|
||||
}
|
||||
#endif
|
||||
|
||||
lADTFile.Extend(lCurrentPosition - lADTFile.data.size()); // cleaning unused nulls at the end of file
|
||||
lADTFile.Extend(static_cast<long>(lCurrentPosition - lADTFile.data.size())); // cleaning unused nulls at the end of file
|
||||
|
||||
|
||||
{
|
||||
|
||||
@@ -2959,7 +2959,7 @@ void MapView::saveMinimap(MinimapRenderSettings* settings)
|
||||
if (!saving_minimap)
|
||||
return;
|
||||
|
||||
if (_mmap_async_index < 4096 && _mmap_render_index < progress->maximum())
|
||||
if (_mmap_async_index < 4096 && static_cast<int>(_mmap_render_index) < progress->maximum())
|
||||
{
|
||||
TileIndex tile = TileIndex(_mmap_async_index / 64, _mmap_async_index % 64);
|
||||
|
||||
@@ -3073,7 +3073,7 @@ void MapView::saveMinimap(MinimapRenderSettings* settings)
|
||||
return;
|
||||
|
||||
|
||||
if (_mmap_async_index < 4096 && _mmap_render_index < progress->maximum())
|
||||
if (_mmap_async_index < 4096 && static_cast<int>(_mmap_render_index) < progress->maximum())
|
||||
{
|
||||
if (selected_tiles->at(_mmap_async_index))
|
||||
{
|
||||
|
||||
@@ -474,7 +474,7 @@ void Model::animate(glm::mat4x4 const& model_view, int anim_id, int anim_time)
|
||||
|
||||
for (auto const& sub_animation : _animations_seq_per_id[anim_id])
|
||||
{
|
||||
if (sub_animation.second.length > time_for_anim)
|
||||
if (static_cast<int>(sub_animation.second.length) > time_for_anim)
|
||||
{
|
||||
current_sub_anim = sub_animation.first;
|
||||
break;
|
||||
@@ -782,7 +782,7 @@ std::vector<std::pair<float, std::tuple<int, int, int>>> Model::intersect (glm::
|
||||
fake_geom.vertices[fake_geom.indices[i + 2]])
|
||||
)
|
||||
{
|
||||
results.emplace_back (*distance, std::make_tuple(i, i+1, 1+2));
|
||||
results.emplace_back (*distance, std::make_tuple(static_cast<int>(i), static_cast<int>(i+1), 1+2));
|
||||
return results;
|
||||
}
|
||||
}
|
||||
@@ -792,12 +792,12 @@ std::vector<std::pair<float, std::tuple<int, int, int>>> Model::intersect (glm::
|
||||
|
||||
for (auto const& pass : _renderer.renderPasses())
|
||||
{
|
||||
for (size_t i (pass.index_start); i < pass.index_start + pass.index_count; i += 3)
|
||||
for (int i (pass.index_start); i < pass.index_start + pass.index_count; i += 3)
|
||||
{
|
||||
if ( auto distance
|
||||
= ray.intersect_triangle( _vertices[_indices[i + 0]].position,
|
||||
_vertices[_indices[i + 1]].position,
|
||||
_vertices[_indices[i + 2]].position)
|
||||
= ray.intersect_triangle( _vertices[_indices[static_cast<std::size_t>(i + 0)]].position,
|
||||
_vertices[_indices[static_cast<std::size_t>(i + 1)]].position,
|
||||
_vertices[_indices[static_cast<std::size_t>(i + 2)]].position)
|
||||
)
|
||||
{
|
||||
results.emplace_back (*distance, std::make_tuple(i, i + 1, 1 + 2));
|
||||
|
||||
@@ -208,7 +208,7 @@ void ParticleSystem::update(float dt)
|
||||
int tospawn = (int)ftospawn;
|
||||
|
||||
if ((tospawn + particles.size()) > MAX_PARTICLES) // Error check to prevent the program from trying to load insane amounts of particles.
|
||||
tospawn = particles.size() - MAX_PARTICLES;
|
||||
tospawn = static_cast<int>(particles.size()) - MAX_PARTICLES;
|
||||
|
||||
rem = ftospawn - static_cast<float>(tospawn);
|
||||
|
||||
@@ -499,7 +499,7 @@ void ParticleSystem::draw( glm::mat4x4 const& model_view
|
||||
}
|
||||
|
||||
OpenGL::Scoped::buffer_binder<GL_ELEMENT_ARRAY_BUFFER> const indices_binder (_indices_vbo);
|
||||
gl.drawElementsInstanced(GL_TRIANGLES, indices.size(), GL_UNSIGNED_SHORT, nullptr, instances_count);
|
||||
gl.drawElementsInstanced(GL_TRIANGLES, static_cast<GLsizei>(indices.size()), GL_UNSIGNED_SHORT, nullptr, instances_count);
|
||||
|
||||
}
|
||||
|
||||
@@ -991,7 +991,7 @@ void RibbonEmitter::draw( OpenGL::Scoped::use_program& shader
|
||||
}
|
||||
|
||||
OpenGL::Scoped::buffer_binder<GL_ELEMENT_ARRAY_BUFFER> const indices_binder(_indices_vbo);
|
||||
gl.drawElementsInstanced(GL_TRIANGLES, indices.size(), GL_UNSIGNED_SHORT, nullptr, instances_count);
|
||||
gl.drawElementsInstanced(GL_TRIANGLES, static_cast<GLsizei>(indices.size()), GL_UNSIGNED_SHORT, nullptr, instances_count);
|
||||
}
|
||||
|
||||
void RibbonEmitter::upload()
|
||||
|
||||
@@ -368,7 +368,7 @@ glm::vec3 Sky::colorFor(int r, int t) const
|
||||
}
|
||||
glm::vec3 c1, c2;
|
||||
int t1, t2;
|
||||
int last = sky_param->colorRows[r].size() - 1;
|
||||
int last = static_cast<int>(sky_param->colorRows[r].size()) - 1;
|
||||
|
||||
if (last == 0)
|
||||
{
|
||||
@@ -875,7 +875,7 @@ void main()
|
||||
|
||||
for (int v = 0; v < cnum - 1; v++)
|
||||
{
|
||||
int start = vertices.size();
|
||||
int start = static_cast<int>(vertices.size());
|
||||
|
||||
vertices.push_back(basepos2[v]);
|
||||
vertices.push_back(basepos1[v]);
|
||||
@@ -895,7 +895,7 @@ void main()
|
||||
gl.bufferData<GL_ARRAY_BUFFER, glm::vec3>(_vertices_vbo, vertices, GL_STATIC_DRAW);
|
||||
gl.bufferData<GL_ELEMENT_ARRAY_BUFFER, std::uint16_t>(_indices_vbo, indices, GL_STATIC_DRAW);
|
||||
|
||||
_indices_count = indices.size();
|
||||
_indices_count = static_cast<int>(indices.size());
|
||||
|
||||
_uploaded = true;
|
||||
_need_vao_update = true;
|
||||
@@ -1080,7 +1080,7 @@ void Sky::save_to_dbc()
|
||||
{
|
||||
DBCFile::Record rec = is_new_record ? gLightIntBandDB.addRecord(light_int_start + i) : gLightIntBandDB.getByID(light_int_start + i);
|
||||
// int entries = rec.getInt(LightIntBandDB::Entries);
|
||||
int entries = skyParams[param_id]->colorRows[i].size();
|
||||
int entries = static_cast<int>(skyParams[param_id]->colorRows[i].size());
|
||||
|
||||
rec.write(LightIntBandDB::Entries, entries); // nb of entries
|
||||
|
||||
@@ -1115,7 +1115,7 @@ void Sky::save_to_dbc()
|
||||
try
|
||||
{
|
||||
DBCFile::Record rec = is_new_record ? gLightFloatBandDB.addRecord(light_float_start + i) : gLightFloatBandDB.getByID(light_float_start + i);
|
||||
int entries = skyParams[param_id]->floatParams[i].size();
|
||||
int entries = static_cast<int>(skyParams[param_id]->floatParams[i].size());
|
||||
|
||||
rec.write(LightFloatBandDB::Entries, entries); // nb of entries
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ void TextureManager::unload_all(Noggit::NoggitRenderContext context)
|
||||
|
||||
for (auto& pair : arrays_for_context)
|
||||
{
|
||||
gl.deleteTextures(pair.second.arrays.size(), pair.second.arrays.data());
|
||||
gl.deleteTextures(static_cast<GLuint>(pair.second.arrays.size()), pair.second.arrays.data());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ TexArrayParams& TextureManager::get_tex_array(GLint compression, int width, int
|
||||
|
||||
for (int i = 0; i < mip_level; ++i)
|
||||
{
|
||||
gl.compressedTexImage3D(GL_TEXTURE_2D_ARRAY, i, compression, width_, height_, n_layers, 0, comp_data[i].size() * n_layers, nullptr);
|
||||
gl.compressedTexImage3D(GL_TEXTURE_2D_ARRAY, i, compression, width_, height_, n_layers, 0, static_cast<GLsizei>(comp_data[i].size() * n_layers), nullptr);
|
||||
|
||||
width_ = std::max(width_ >> 1, 1);
|
||||
height_ = std::max(height_ >> 1, 1);
|
||||
@@ -188,7 +188,7 @@ void blp_texture::uploadToArray(unsigned layer)
|
||||
{
|
||||
for (int i = 0; i < _compressed_data.size(); ++i)
|
||||
{
|
||||
gl.compressedTexSubImage3D(GL_TEXTURE_2D_ARRAY, i, 0, 0, layer, width, height, 1, _compression_format.value(), _compressed_data[i].size(), _compressed_data[i].data());
|
||||
gl.compressedTexSubImage3D(GL_TEXTURE_2D_ARRAY, i, 0, 0, layer, width, height, 1, _compression_format.value(), static_cast<GLsizei>(_compressed_data[i].size()), _compressed_data[i].data());
|
||||
|
||||
width = std::max(width >> 1, 1);
|
||||
height = std::max(height >> 1, 1);
|
||||
@@ -217,7 +217,7 @@ void blp_texture::upload()
|
||||
|
||||
if (!_compression_format)
|
||||
{
|
||||
auto& params = TextureManager::get_tex_array( _width, _height, _data.size(), _context);
|
||||
auto& params = TextureManager::get_tex_array( _width, _height, static_cast<int>(_data.size()), _context);
|
||||
|
||||
int index_x = params.n_used / n_layers;
|
||||
int index_y = params.n_used % n_layers;
|
||||
@@ -241,7 +241,7 @@ void blp_texture::upload()
|
||||
}
|
||||
else
|
||||
{
|
||||
auto& params = TextureManager::get_tex_array(_compression_format.value(), _width, _height, _compressed_data.size(), _compressed_data, _context);
|
||||
auto& params = TextureManager::get_tex_array(_compression_format.value(), _width, _height, static_cast<int>(_compressed_data.size()), _compressed_data, _context);
|
||||
|
||||
int index_x = params.n_used / n_layers;
|
||||
int index_y = params.n_used % n_layers;
|
||||
@@ -251,7 +251,7 @@ void blp_texture::upload()
|
||||
|
||||
for (int i = 0; i < _compressed_data.size(); ++i)
|
||||
{
|
||||
gl.compressedTexSubImage3D(GL_TEXTURE_2D_ARRAY, i, 0, 0, index_y, width, height, 1, _compression_format.value(), _compressed_data[i].size(), _compressed_data[i].data());
|
||||
gl.compressedTexSubImage3D(GL_TEXTURE_2D_ARRAY, i, 0, 0, index_y, width, height, 1, _compression_format.value(), static_cast<GLsizei>(_compressed_data[i].size()), _compressed_data[i].data());
|
||||
|
||||
width = std::max(width >> 1, 1);
|
||||
height = std::max(height >> 1, 1);
|
||||
|
||||
@@ -60,7 +60,7 @@ struct blp_texture : public AsyncObject
|
||||
GLuint texture_array() { return _texture_array; };
|
||||
int array_index() { return _array_index; };
|
||||
bool is_specular() { return _is_specular; };
|
||||
unsigned mip_level() { return !_compression_format ? _data.size() : _compressed_data.size(); };
|
||||
unsigned mip_level() { return static_cast<unsigned>(!_compression_format ? _data.size() : _compressed_data.size()); };
|
||||
|
||||
std::map<int, std::vector<uint32_t>>& data() { return _data;};
|
||||
std::map<int, std::vector<uint8_t>>& compressed_data() { return _compressed_data; };
|
||||
|
||||
@@ -105,7 +105,9 @@ void WMO::finishLoading ()
|
||||
std::size_t const num_materials (size / 0x40);
|
||||
materials.resize (num_materials);
|
||||
|
||||
std::map<std::uint32_t, std::size_t> texture_offset_to_inmem_index;
|
||||
// note: used to map to size_t, but our other values don't support that.
|
||||
//std::map<std::uint32_t, std::size_t> texture_offset_to_inmem_index;
|
||||
std::map<std::uint32_t, std::uint32_t> texture_offset_to_inmem_index;
|
||||
|
||||
auto load_texture
|
||||
( [&] (std::uint32_t ofs)
|
||||
@@ -114,7 +116,7 @@ void WMO::finishLoading ()
|
||||
(texbuf[ofs] ? &texbuf[ofs] : "textures/shanecube.blp");
|
||||
|
||||
auto const mapping
|
||||
(texture_offset_to_inmem_index.emplace(ofs, textures.size()));
|
||||
(texture_offset_to_inmem_index.emplace(ofs, static_cast<std::uint32_t>(textures.size())));
|
||||
|
||||
if (mapping.second)
|
||||
{
|
||||
@@ -157,7 +159,7 @@ void WMO::finishLoading ()
|
||||
assert (fourcc == 'MOGI');
|
||||
|
||||
groups.reserve(nGroups);
|
||||
for (size_t i (0); i < nGroups; ++i) {
|
||||
for (int i (0); i < nGroups; ++i) {
|
||||
groups.emplace_back (this, &f, i, groupnames);
|
||||
}
|
||||
|
||||
|
||||
@@ -428,7 +428,7 @@ void World::rotate_selected_models_to_ground_normal(bool smoothNormals)
|
||||
|
||||
auto normalizedQ = glm::normalize(q);
|
||||
|
||||
math::degrees::vec3 new_dir;
|
||||
//math::degrees::vec3 new_dir;
|
||||
// To euler, because wow
|
||||
/*
|
||||
// roll (x-axis rotation)
|
||||
@@ -1942,7 +1942,7 @@ void World::importADTHeightmap(glm::vec3 const& pos, float multiplier, unsigned
|
||||
|
||||
size_t desiredSize = tiledEdges ? 256 : 257;
|
||||
if (img.width() != desiredSize || img.height() != desiredSize)
|
||||
img = img.scaled(desiredSize, desiredSize, Qt::AspectRatioMode::IgnoreAspectRatio);
|
||||
img = img.scaled(static_cast<int>(desiredSize), static_cast<int>(desiredSize), Qt::AspectRatioMode::IgnoreAspectRatio);
|
||||
|
||||
tile->setHeightmapImage(img, multiplier, mode, tiledEdges);
|
||||
|
||||
@@ -1980,7 +1980,7 @@ void World::importADTVertexColorMap(glm::vec3 const& pos, int mode, bool tiledEd
|
||||
|
||||
size_t desiredSize = tiledEdges ? 256 : 257;
|
||||
if (img.width() != desiredSize || img.height() != desiredSize)
|
||||
img = img.scaled(desiredSize, desiredSize, Qt::AspectRatioMode::IgnoreAspectRatio);
|
||||
img = img.scaled(static_cast<int>(desiredSize), static_cast<int>(desiredSize), Qt::AspectRatioMode::IgnoreAspectRatio);
|
||||
|
||||
tile->setVertexColorImage(img, mode, tiledEdges);
|
||||
|
||||
@@ -2024,7 +2024,7 @@ void World::importADTVertexColorMap(glm::vec3 const& pos, QImage const& image, i
|
||||
|
||||
if (image.width() != desiredDimensions || image.height() != desiredDimensions)
|
||||
{
|
||||
QImage scaled = image.scaled(desiredDimensions, desiredDimensions, Qt::AspectRatioMode::IgnoreAspectRatio);
|
||||
QImage scaled = image.scaled(static_cast<int>(desiredDimensions), static_cast<int>(desiredDimensions), Qt::AspectRatioMode::IgnoreAspectRatio);
|
||||
|
||||
for_tile_at ( pos
|
||||
, [&] (MapTile* tile)
|
||||
@@ -2195,7 +2195,7 @@ void World::fixAllGaps()
|
||||
// fix the gaps with the adt at the left of the current one
|
||||
if (left)
|
||||
{
|
||||
for (size_t ty = 0; ty < 16; ty++)
|
||||
for (unsigned ty = 0; ty < 16; ty++)
|
||||
{
|
||||
MapChunk* chunk = tile->getChunk(0, ty);
|
||||
NOGGIT_CUR_ACTION->registerChunkTerrainChange(chunk);
|
||||
@@ -2210,7 +2210,7 @@ void World::fixAllGaps()
|
||||
// fix the gaps with the adt above the current one
|
||||
if (above)
|
||||
{
|
||||
for (size_t tx = 0; tx < 16; tx++)
|
||||
for (unsigned tx = 0; tx < 16; tx++)
|
||||
{
|
||||
MapChunk* chunk = tile->getChunk(tx, 0);
|
||||
NOGGIT_CUR_ACTION->registerChunkTerrainChange(chunk);
|
||||
@@ -2223,9 +2223,9 @@ void World::fixAllGaps()
|
||||
}
|
||||
|
||||
// fix gaps within the adt
|
||||
for (size_t ty = 0; ty < 16; ty++)
|
||||
for (unsigned ty = 0; ty < 16; ty++)
|
||||
{
|
||||
for (size_t tx = 0; tx < 16; tx++)
|
||||
for (unsigned tx = 0; tx < 16; tx++)
|
||||
{
|
||||
MapChunk* chunk = tile->getChunk(tx, ty);
|
||||
NOGGIT_CUR_ACTION->registerChunkTerrainChange(chunk);
|
||||
@@ -2269,8 +2269,8 @@ bool World::isUnderMap(glm::vec3 const& pos)
|
||||
|
||||
if (mapIndex.tileLoaded(tile))
|
||||
{
|
||||
size_t chnkX = (pos.x / CHUNKSIZE) - tile.x * 16;
|
||||
size_t chnkZ = (pos.z / CHUNKSIZE) - tile.z * 16;
|
||||
unsigned chnkX = (pos.x / CHUNKSIZE) - tile.x * 16;
|
||||
unsigned chnkZ = (pos.z / CHUNKSIZE) - tile.z * 16;
|
||||
|
||||
// check using the cursor height
|
||||
return (mapIndex.getTile(tile)->getChunk(chnkX, chnkZ)->getMinHeight()) > pos.y + 2.0f;
|
||||
|
||||
@@ -15,9 +15,9 @@ void World::for_all_chunks_on_tile (glm::vec3 const& pos, Fun&& fun)
|
||||
{
|
||||
mapIndex.setChanged(tile);
|
||||
|
||||
for (size_t ty = 0; ty < 16; ++ty)
|
||||
for (unsigned ty = 0; ty < 16; ++ty)
|
||||
{
|
||||
for (size_t tx = 0; tx < 16; ++tx)
|
||||
for (unsigned tx = 0; tx < 16; ++tx)
|
||||
{
|
||||
fun(tile->getChunk(ty, tx));
|
||||
}
|
||||
|
||||
@@ -220,18 +220,18 @@ void map_horizon::set_minimap(const MapIndex* const index)
|
||||
_qt_minimap = QImage(16 * 64, 16 * 64, QImage::Format_ARGB32);
|
||||
_qt_minimap.fill(Qt::transparent);
|
||||
|
||||
for (size_t y(0); y < 64; ++y)
|
||||
for (int y(0); y < 64; ++y)
|
||||
{
|
||||
for (size_t x(0); x < 64; ++x)
|
||||
for (int x(0); x < 64; ++x)
|
||||
{
|
||||
if (_tiles[y][x])
|
||||
{
|
||||
//! \todo There also is a second heightmap appended which has additional 16*16 pixels.
|
||||
//! \todo There also is MAHO giving holes into this heightmap.
|
||||
|
||||
for (size_t j(0); j < 16; ++j)
|
||||
for (int j(0); j < 16; ++j)
|
||||
{
|
||||
for (size_t i(0); i < 16; ++i)
|
||||
for (int i(0); i < 16; ++i)
|
||||
{
|
||||
//! \todo R and B are inverted here
|
||||
_qt_minimap.setPixel(x * 16 + i, y * 16 + j, color_for_height(_tiles[y][x]->height_17[j][i]));
|
||||
@@ -241,9 +241,9 @@ void map_horizon::set_minimap(const MapIndex* const index)
|
||||
// the adt exist but there's no data in the wdl
|
||||
else if (index->hasTile(TileIndex(x, y)))
|
||||
{
|
||||
for (size_t j(0); j < 16; ++j)
|
||||
for (int j(0); j < 16; ++j)
|
||||
{
|
||||
for (size_t i(0); i < 16; ++i)
|
||||
for (int i(0); i < 16; ++i)
|
||||
{
|
||||
_qt_minimap.setPixel(x * 16 + i, y * 16 + j, color(200, 100, 25));
|
||||
}
|
||||
@@ -494,7 +494,7 @@ map_horizon::render::render(const map_horizon& horizon)
|
||||
if (!horizon._tiles[y][x])
|
||||
continue;
|
||||
|
||||
_batches[y][x] = map_horizon_batch (vertices.size(), 17 * 17 + 16 * 16);
|
||||
_batches[y][x] = map_horizon_batch (static_cast<std::uint32_t>(vertices.size()), 17 * 17 + 16 * 16);
|
||||
|
||||
for (size_t j (0); j < 17; ++j)
|
||||
{
|
||||
@@ -563,9 +563,9 @@ void map_horizon::render::draw( glm::mat4x4 const& model_view
|
||||
if (batch.vertex_count == 0)
|
||||
continue;
|
||||
|
||||
for (size_t j (0); j < 16; ++j)
|
||||
for (int j (0); j < 16; ++j)
|
||||
{
|
||||
for (size_t i (0); i < 16; ++i)
|
||||
for (int i (0); i < 16; ++i)
|
||||
{
|
||||
// do not draw over visible chunks
|
||||
|
||||
@@ -629,7 +629,7 @@ void map_horizon::render::draw( glm::mat4x4 const& model_view
|
||||
OpenGL::Scoped::buffer_binder<GL_ELEMENT_ARRAY_BUFFER> indices_binder (_index_buffer);
|
||||
|
||||
|
||||
gl.drawElements (GL_TRIANGLES, indices.size(), GL_UNSIGNED_INT, nullptr);
|
||||
gl.drawElements (GL_TRIANGLES, static_cast<GLsizei>(indices.size()), GL_UNSIGNED_INT, nullptr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -246,11 +246,11 @@ void MapIndex::save()
|
||||
// MWMO
|
||||
// {
|
||||
wdtFile.Extend(8);
|
||||
SetChunkHeader(wdtFile, curPos, 'MWMO', globalWMOName.size());
|
||||
SetChunkHeader(wdtFile, curPos, 'MWMO', static_cast<int>(globalWMOName.size()));
|
||||
curPos += 8;
|
||||
|
||||
wdtFile.Insert(curPos, globalWMOName.size(), globalWMOName.data());
|
||||
curPos += globalWMOName.size();
|
||||
wdtFile.Insert(curPos, static_cast<unsigned long>(globalWMOName.size()), globalWMOName.data());
|
||||
curPos += static_cast<int>(globalWMOName.size());
|
||||
// }
|
||||
|
||||
// MODF
|
||||
@@ -282,8 +282,8 @@ void MapIndex::enterTile(const TileIndex& tile)
|
||||
}
|
||||
|
||||
noadt = false;
|
||||
int cx = tile.x;
|
||||
int cz = tile.z;
|
||||
int cx = static_cast<int>(tile.x);
|
||||
int cz = static_cast<int>(tile.z);
|
||||
|
||||
for (int pz = std::max(cz - 1, 0); pz < std::min(cz + 2, 63); ++pz)
|
||||
{
|
||||
@@ -381,7 +381,7 @@ MapTile* MapIndex::loadTile(const TileIndex& tile, bool reloading)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
mTiles[tile.z][tile.x].tile = std::make_unique<MapTile> (tile.x, tile.z, filename.str(),
|
||||
mTiles[tile.z][tile.x].tile = std::make_unique<MapTile> (static_cast<int>(tile.x), static_cast<int>(tile.z), filename.str(),
|
||||
mBigAlpha, true, use_mclq_green_lava(), reloading, _world, _context);
|
||||
|
||||
MapTile* adt = mTiles[tile.z][tile.x].tile.get();
|
||||
@@ -1075,7 +1075,7 @@ void MapIndex::loadMinimapMD5translate()
|
||||
void* buffer_raw = std::malloc(size);
|
||||
md5trs_file.read(buffer_raw, size);
|
||||
|
||||
QByteArray md5trs_bytes(static_cast<char*>(buffer_raw), size);
|
||||
QByteArray md5trs_bytes(static_cast<char*>(buffer_raw), static_cast<int>(size));
|
||||
|
||||
QTextStream md5trs_stream(md5trs_bytes, QIODevice::ReadOnly);
|
||||
|
||||
@@ -1149,7 +1149,7 @@ void MapIndex::addTile(const TileIndex& tile)
|
||||
std::stringstream filename;
|
||||
filename << "World\\Maps\\" << basename << "\\" << basename << "_" << tile.x << "_" << tile.z << ".adt";
|
||||
|
||||
mTiles[tile.z][tile.x].tile = std::make_unique<MapTile> (tile.x, tile.z, filename.str(),
|
||||
mTiles[tile.z][tile.x].tile = std::make_unique<MapTile> (static_cast<int>(tile.x), static_cast<int>(tile.z), filename.str(),
|
||||
mBigAlpha, true, use_mclq_green_lava(), false, _world, _context);
|
||||
|
||||
mTiles[tile.z][tile.x].flags |= 0x1;
|
||||
@@ -1164,7 +1164,7 @@ void MapIndex::removeTile(const TileIndex &tile)
|
||||
|
||||
std::stringstream filename;
|
||||
filename << "World\\Maps\\" << basename << "\\" << basename << "_" << tile.x << "_" << tile.z << ".adt";
|
||||
mTiles[tile.z][tile.x].tile = std::make_unique<MapTile> (tile.x, tile.z, filename.str(),
|
||||
mTiles[tile.z][tile.x].tile = std::make_unique<MapTile> (static_cast<int>(tile.x), static_cast<int>(tile.z), filename.str(),
|
||||
mBigAlpha, true, use_mclq_green_lava(), false, _world, _context);
|
||||
|
||||
mTiles[tile.z][tile.x].tile->changed = true;
|
||||
|
||||
@@ -49,8 +49,13 @@ class MapIndex
|
||||
public:
|
||||
template<bool Load>
|
||||
struct tile_iterator
|
||||
: std::iterator<std::forward_iterator_tag, MapTile*, std::ptrdiff_t, MapTile**, MapTile* const&>
|
||||
{
|
||||
using iterator_category = std::forward_iterator_tag;
|
||||
using value_type = MapTile*;
|
||||
using difference_type = std::ptrdiff_t;
|
||||
using pointer = MapTile**;
|
||||
using reference = MapTile* const&;
|
||||
|
||||
template<typename Pred>
|
||||
tile_iterator (MapIndex* index, TileIndex tile, Pred pred)
|
||||
: _index (index)
|
||||
|
||||
@@ -212,7 +212,7 @@ namespace Noggit::Project
|
||||
project->ClientData = std::make_shared<BlizzardArchive::ClientData>(
|
||||
project->ClientPath, client_archive_version, client_archive_locale, project_path.generic_string());
|
||||
}
|
||||
catch (BlizzardArchive::Exceptions::Locale::LocaleNotFoundError& e)
|
||||
catch (BlizzardArchive::Exceptions::Locale::LocaleNotFoundError&)
|
||||
{
|
||||
QMessageBox::critical(nullptr, "Error", "The client does not appear to be valid.");
|
||||
return {};
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Noggit
|
||||
indices.emplace_back((i + 1) % segment);
|
||||
}
|
||||
|
||||
_indices_count[Mode::circle] = indices.size();
|
||||
_indices_count[Mode::circle] = static_cast<int>(indices.size());
|
||||
|
||||
int id = static_cast<int>(Mode::circle);
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace Noggit
|
||||
}
|
||||
}
|
||||
|
||||
_indices_count[Mode::sphere] = indices.size();
|
||||
_indices_count[Mode::sphere] = static_cast<int>(indices.size());
|
||||
|
||||
int id = static_cast<int>(Mode::sphere);
|
||||
|
||||
@@ -164,7 +164,7 @@ namespace Noggit
|
||||
|
||||
std::vector<std::uint16_t> indices = {0,1, 1,2 ,2,3 ,3,0};
|
||||
|
||||
_indices_count[Mode::square] = indices.size();
|
||||
_indices_count[Mode::square] = static_cast<int>(indices.size());
|
||||
|
||||
int id = static_cast<int>(Mode::square);
|
||||
|
||||
@@ -206,7 +206,7 @@ namespace Noggit
|
||||
, 4,5, 5,6 ,6,7 ,7,4
|
||||
};
|
||||
|
||||
_indices_count[Mode::cube] = indices.size();
|
||||
_indices_count[Mode::cube] = static_cast<int>(indices.size());
|
||||
|
||||
int id = static_cast<int>(Mode::cube);
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ void FlightBoundsRender::draw(OpenGL::Scoped::use_program& mfbo_shader)
|
||||
OpenGL::Scoped::buffer_binder<GL_ELEMENT_ARRAY_BUFFER> ibo_binder(_mfbo_indices);
|
||||
|
||||
mfbo_shader.uniform("color", glm::vec4(1.0f, 1.0f, 0.0f, 0.2f));
|
||||
gl.drawElements(GL_TRIANGLE_FAN, indices.size(), GL_UNSIGNED_BYTE, nullptr);
|
||||
gl.drawElements(GL_TRIANGLE_FAN, static_cast<GLsizei>(indices.size()), GL_UNSIGNED_BYTE, nullptr);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -65,7 +65,7 @@ void FlightBoundsRender::draw(OpenGL::Scoped::use_program& mfbo_shader)
|
||||
OpenGL::Scoped::buffer_binder<GL_ELEMENT_ARRAY_BUFFER> ibo_binder(_mfbo_indices);
|
||||
|
||||
mfbo_shader.uniform("color", glm::vec4(0.0f, 1.0f, 1.0f, 0.2f));
|
||||
gl.drawElements(GL_TRIANGLE_FAN, indices.size(), GL_UNSIGNED_BYTE, nullptr);
|
||||
gl.drawElements(GL_TRIANGLE_FAN, static_cast<int>(indices.size()), GL_UNSIGNED_BYTE, nullptr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ void LiquidRender::draw(math::frustum const& frustum
|
||||
if (samplers_upload_buf[j] < 0)
|
||||
break;
|
||||
|
||||
gl.activeTexture(GL_TEXTURE0 + 2 + j);
|
||||
gl.activeTexture(static_cast<GLenum>(GL_TEXTURE0 + 2 + j));
|
||||
gl.bindTexture(GL_TEXTURE_2D_ARRAY, samplers_upload_buf[j]);
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ void LiquidRender::updateLayerData(LiquidTextureManager* tex_manager)
|
||||
}
|
||||
else
|
||||
{
|
||||
sampler_index = layer_params.texture_samplers.size();
|
||||
sampler_index = static_cast<unsigned int>(layer_params.texture_samplers.size());
|
||||
layer_params.texture_samplers.emplace_back(std::get<0>(tex_profile));
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ void LiquidRender::updateLayerData(LiquidTextureManager* tex_manager)
|
||||
|
||||
if (!n_chunks) // break and clean-up
|
||||
{
|
||||
if (long diff = _render_layers.size() - layer_counter; diff > 0)
|
||||
if (long diff = static_cast<long>(_render_layers.size() - layer_counter); diff > 0)
|
||||
{
|
||||
for (int i = 0; i < diff; ++i)
|
||||
{
|
||||
@@ -195,7 +195,7 @@ void LiquidRender::updateLayerData(LiquidTextureManager* tex_manager)
|
||||
else
|
||||
{
|
||||
auto& layer_params = _render_layers[layer_counter];
|
||||
layer_params.n_used_chunks = n_chunks;
|
||||
layer_params.n_used_chunks = static_cast<unsigned int>(n_chunks);
|
||||
|
||||
gl.bindTexture(GL_TEXTURE_2D_ARRAY, layer_params.vertex_data_tex);
|
||||
gl.bindBuffer(GL_UNIFORM_BUFFER, layer_params.chunk_data_buf);
|
||||
|
||||
@@ -68,7 +68,7 @@ void LiquidTextureManager::upload()
|
||||
|
||||
if (is_uncompressed)
|
||||
{
|
||||
for (int j = 0; j < mip_level; ++j)
|
||||
for (unsigned int j = 0; j < mip_level; ++j)
|
||||
{
|
||||
gl.texImage3D(GL_TEXTURE_2D_ARRAY, j, GL_RGBA8, width_, height_, N_FRAMES, 0, GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
nullptr);
|
||||
@@ -80,10 +80,10 @@ void LiquidTextureManager::upload()
|
||||
else
|
||||
[[likely]]
|
||||
{
|
||||
for (int j = 0; j < mip_level; ++j)
|
||||
for (unsigned int j = 0; j < mip_level; ++j)
|
||||
{
|
||||
gl.compressedTexImage3D(GL_TEXTURE_2D_ARRAY, j, tex.compression_format().value(), width_, height_, N_FRAMES,
|
||||
0, tex.compressed_data()[j].size() * N_FRAMES, nullptr);
|
||||
0, static_cast<GLsizei>(tex.compressed_data()[j].size() * N_FRAMES), nullptr);
|
||||
|
||||
width_ = std::max(width_ >> 1, 1);
|
||||
height_ = std::max(height_ >> 1, 1);
|
||||
|
||||
@@ -233,7 +233,7 @@ void ModelRender::draw(glm::mat4x4 const& model_view
|
||||
{
|
||||
if (p.prepareDraw(m2_shader, _model, model_render_state))
|
||||
{
|
||||
gl.drawElementsInstanced(GL_TRIANGLES, p.index_count, GL_UNSIGNED_SHORT, reinterpret_cast<void*>(p.index_start * sizeof(GLushort)), instances.size());
|
||||
gl.drawElementsInstanced(GL_TRIANGLES, p.index_count, GL_UNSIGNED_SHORT, reinterpret_cast<void*>(p.index_start * sizeof(GLushort)), static_cast<GLsizei>(instances.size()));
|
||||
//p.after_draw();
|
||||
}
|
||||
}
|
||||
@@ -248,7 +248,7 @@ void ModelRender::drawParticles(glm::mat4x4 const& model_view
|
||||
{
|
||||
for (auto& p : _model->_particles)
|
||||
{
|
||||
p.draw(model_view, particles_shader, _transform_buffer, instance_count);
|
||||
p.draw(model_view, particles_shader, _transform_buffer, static_cast<int>(instance_count));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ void ModelRender::drawRibbons( OpenGL::Scoped::use_program& ribbons_shader
|
||||
{
|
||||
for (auto& r : _model->_ribbons)
|
||||
{
|
||||
r.draw(ribbons_shader, _transform_buffer, instance_count);
|
||||
r.draw(ribbons_shader, _transform_buffer, static_cast<int>(instance_count));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ void ModelRender::drawBox(OpenGL::Scoped::use_program& m2_box_shader, std::size_
|
||||
|
||||
OpenGL::Scoped::buffer_binder<GL_ELEMENT_ARRAY_BUFFER> indices_binder(_box_indices_buffer);
|
||||
|
||||
gl.drawElementsInstanced (GL_LINE_STRIP, _box_indices.size(), GL_UNSIGNED_SHORT, nullptr, box_count);
|
||||
gl.drawElementsInstanced (GL_LINE_STRIP, static_cast<GLsizei>(_box_indices.size()), GL_UNSIGNED_SHORT, nullptr, static_cast<GLsizei>(box_count));
|
||||
}
|
||||
|
||||
void ModelRender::setupVAO(OpenGL::Scoped::use_program& m2_shader)
|
||||
@@ -965,7 +965,7 @@ void ModelRenderPass::bindTexture(size_t index, Model* m, OpenGL::M2RenderState&
|
||||
GLuint tex_array = texture->texture_array();
|
||||
int tex_index = texture->array_index();
|
||||
|
||||
gl.activeTexture(GL_TEXTURE0 + index + 1);
|
||||
gl.activeTexture(static_cast<GLenum>(GL_TEXTURE0 + index + 1));
|
||||
gl.bindTexture(GL_TEXTURE_2D_ARRAY, tex_array);
|
||||
/*
|
||||
if (model_render_state.tex_arrays[index] != tex_array)
|
||||
@@ -995,7 +995,7 @@ void ModelRenderPass::bindTexture(size_t index, Model* m, OpenGL::M2RenderState&
|
||||
GLuint tex_array = texture->texture_array();
|
||||
int tex_index = texture->array_index();
|
||||
|
||||
gl.activeTexture(GL_TEXTURE0 + index + 1);
|
||||
gl.activeTexture(static_cast<GLenum>(GL_TEXTURE0 + index + 1));
|
||||
gl.bindTexture(GL_TEXTURE_2D_ARRAY, tex_array);
|
||||
|
||||
/*
|
||||
|
||||
@@ -167,7 +167,7 @@ void WireBox::setup_buffers()
|
||||
}
|
||||
}
|
||||
|
||||
_indice_count = indices.size();
|
||||
_indice_count = static_cast<int>(indices.size());
|
||||
|
||||
gl.bufferData<GL_ARRAY_BUFFER, glm::vec3>
|
||||
(_vertices_vbo, vertices, GL_STATIC_DRAW);
|
||||
|
||||
@@ -148,7 +148,7 @@ void TileRender::draw (OpenGL::Scoped::use_program& mcnk_shader
|
||||
alphamap_bound = true;
|
||||
chunk->texture_set->uploadAlphamapData();
|
||||
|
||||
if (!_split_drawcall && !fillSamplers(chunk.get(), i, _draw_calls.size() - 1))
|
||||
if (!_split_drawcall && !fillSamplers(chunk.get(), i, static_cast<unsigned int>(_draw_calls.size() - 1)))
|
||||
{
|
||||
_split_drawcall = true;
|
||||
}
|
||||
@@ -238,7 +238,7 @@ void TileRender::draw (OpenGL::Scoped::use_program& mcnk_shader
|
||||
{
|
||||
auto& chunk = _map_tile->mChunks[i % 16][i / 16];
|
||||
|
||||
if (!fillSamplers(chunk.get(), i, _draw_calls.size() - 1))
|
||||
if (!fillSamplers(chunk.get(), i, static_cast<unsigned int>(_draw_calls.size() - 1)))
|
||||
{
|
||||
MapTileDrawCall& previous_draw_call = _draw_calls[_draw_calls.size() - 1];
|
||||
unsigned new_start = previous_draw_call.start_chunk + previous_draw_call.n_chunks;
|
||||
@@ -248,7 +248,7 @@ void TileRender::draw (OpenGL::Scoped::use_program& mcnk_shader
|
||||
new_draw_call.start_chunk = new_start;
|
||||
new_draw_call.n_chunks = 1;
|
||||
|
||||
fillSamplers(chunk.get(), i, _draw_calls.size() - 1);
|
||||
fillSamplers(chunk.get(), i, static_cast<unsigned int>(_draw_calls.size() - 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -468,7 +468,7 @@ bool TileRender::fillSamplers(MapChunk* chunk, unsigned chunk_index, unsigned i
|
||||
{
|
||||
MapTileDrawCall& draw_call = _draw_calls[draw_call_index];
|
||||
|
||||
_chunk_instance_data[chunk_index].ChunkHoles_DrawImpass_TexLayerCount_CantPaint[2] = chunk->texture_set->num();
|
||||
_chunk_instance_data[chunk_index].ChunkHoles_DrawImpass_TexLayerCount_CantPaint[2] = static_cast<int>(chunk->texture_set->num());
|
||||
|
||||
static constexpr unsigned NUM_SAMPLERS = 11;
|
||||
|
||||
@@ -536,7 +536,7 @@ void TileRender::initChunkData(MapChunk* chunk)
|
||||
|
||||
chunk_render_instance.ChunkHoles_DrawImpass_TexLayerCount_CantPaint[0] = chunk->holes;
|
||||
chunk_render_instance.ChunkHoles_DrawImpass_TexLayerCount_CantPaint[1] = chunk->header_flags.flags.impass;
|
||||
chunk_render_instance.ChunkHoles_DrawImpass_TexLayerCount_CantPaint[2] = chunk->texture_set->num();
|
||||
chunk_render_instance.ChunkHoles_DrawImpass_TexLayerCount_CantPaint[2] = static_cast<int>(chunk->texture_set->num());
|
||||
chunk_render_instance.ChunkHoles_DrawImpass_TexLayerCount_CantPaint[3] = 0;
|
||||
chunk_render_instance.AreaIDColor_Pad2_DrawSelection[0] = chunk->areaID;
|
||||
chunk_render_instance.AreaIDColor_Pad2_DrawSelection[3] = 0;
|
||||
|
||||
@@ -73,7 +73,7 @@ void WMOGroupRender::upload()
|
||||
{
|
||||
// identify if we can fit this batch into current draw_call
|
||||
unsigned n_required_slots = use_tex2 ? 2 : 1;
|
||||
unsigned n_avaliable_slots = draw_call->samplers.size() - draw_call->n_used_samplers;
|
||||
unsigned n_avaliable_slots = static_cast<unsigned>(draw_call->samplers.size()) - draw_call->n_used_samplers;
|
||||
unsigned n_slots_to_be_occupied = 0;
|
||||
|
||||
std::vector<int>::iterator it2;
|
||||
@@ -318,7 +318,7 @@ void WMOGroupRender::draw(OpenGL::Scoped::use_program& wmo_shader
|
||||
if (draw_call.samplers[i] < 0)
|
||||
break;
|
||||
|
||||
gl.activeTexture(GL_TEXTURE0 + 1 + i);
|
||||
gl.activeTexture(static_cast<GLenum>(GL_TEXTURE0 + 1 + i));
|
||||
gl.bindTexture(GL_TEXTURE_2D_ARRAY, draw_call.samplers[i]);
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@ void WMOGroupRender::initRenderBatches()
|
||||
{
|
||||
for (std::size_t i = 0; i < (batch.vertex_end - batch.vertex_start + 1); ++i)
|
||||
{
|
||||
_render_batch_mapping[batch.vertex_start + i] = batch_counter + 1;
|
||||
_render_batch_mapping[batch.vertex_start + i] = static_cast<unsigned>(batch_counter + 1);
|
||||
}
|
||||
|
||||
std::uint32_t flags = 0;
|
||||
|
||||
@@ -111,7 +111,7 @@ void WorldRender::draw (glm::mat4x4 const& model_view
|
||||
tile->renderer()->setFrustumCulled(false);
|
||||
tile->renderer()->setObjectsFrustumCullTest(2);
|
||||
tile->renderer()->setOccluded(false);
|
||||
_world->_loaded_tiles_buffer[tile_counter] = std::make_pair(std::make_pair(tile->index.x, tile->index.z), tile);
|
||||
_world->_loaded_tiles_buffer[tile_counter] = std::make_pair(std::make_pair(static_cast<int>(tile->index.x), static_cast<int>(tile->index.z)), tile);
|
||||
|
||||
tile_counter++;
|
||||
_world->_n_loaded_tiles++;
|
||||
@@ -122,7 +122,7 @@ void WorldRender::draw (glm::mat4x4 const& model_view
|
||||
if (frustum.intersects(tile_extents[1], tile_extents[0]) || tile->getChunkUpdateFlags())
|
||||
{
|
||||
tile->calcCamDist(camera_pos);
|
||||
_world->_loaded_tiles_buffer[tile_counter] = std::make_pair(std::make_pair(tile->index.x, tile->index.z), tile);
|
||||
_world->_loaded_tiles_buffer[tile_counter] = std::make_pair(std::make_pair(static_cast<int>(tile->index.x), static_cast<int>(tile->index.z)), tile);
|
||||
|
||||
tile->renderer()->setObjectsFrustumCullTest(1);
|
||||
if (frustum.contains(tile_extents[0]) && frustum.contains(tile_extents[1]))
|
||||
@@ -1687,7 +1687,7 @@ bool WorldRender::saveMinimap(TileIndex const& tile_idx, MinimapRenderSettings*
|
||||
{
|
||||
for (int j = 0; j < 128; ++j)
|
||||
{
|
||||
combined_image->setPixelColor(tile_idx.x * 128 + j, tile_idx.z * 128 + i, scaled_image.pixelColor(j, i));
|
||||
combined_image->setPixelColor(static_cast<int>(tile_idx.x) * 128 + j, static_cast<int>(tile_idx.z) * 128 + i, scaled_image.pixelColor(j, i));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Noggit
|
||||
|
||||
int chunk::get_texture_count()
|
||||
{
|
||||
return _chunk->texture_set->num();
|
||||
return static_cast<int>(_chunk->texture_set->num());
|
||||
}
|
||||
|
||||
std::string chunk::get_texture(int index)
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace Noggit
|
||||
int image::get_index(int x, int y) const
|
||||
{
|
||||
int index = ((x + y * _width) * 4);
|
||||
if(index<0||index>=_size)
|
||||
if(index<0 || index >= static_cast<int>(_size))
|
||||
{
|
||||
throw script_exception(
|
||||
"img_get_index",
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace Noggit
|
||||
, width
|
||||
, height
|
||||
, frequency
|
||||
, std::hash<std::string>()(std::string(seed))
|
||||
, static_cast<std::int32_t>(std::hash<std::string>()(std::string(seed)))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Noggit
|
||||
|
||||
random::random(script_context * ctx, std::string const& seed)
|
||||
: script_object(ctx)
|
||||
, _state(std::hash<std::string>()(seed))
|
||||
, _state(static_cast<unsigned>(std::hash<std::string>()(seed)))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ int TextureSet::addTexture (scoped_blp_texture_reference texture)
|
||||
|
||||
if (nTextures < 4U)
|
||||
{
|
||||
texLevel = nTextures;
|
||||
texLevel = static_cast<int>(nTextures);
|
||||
nTextures++;
|
||||
|
||||
textures.emplace_back (std::move (texture));
|
||||
@@ -91,7 +91,7 @@ void TextureSet::replace_texture (scoped_blp_texture_reference const& texture_to
|
||||
{
|
||||
int texture_to_replace_level = -1, replacement_texture_level = -1;
|
||||
|
||||
for (size_t i = 0; i < nTextures; ++i)
|
||||
for (int i = 0; i < nTextures; ++i)
|
||||
{
|
||||
if (textures[i] == texture_to_replace)
|
||||
{
|
||||
@@ -314,7 +314,7 @@ bool TextureSet::eraseUnusedTextures()
|
||||
|
||||
if (visible_tex.size() < nTextures)
|
||||
{
|
||||
for (int i = nTextures - 1; i >= 0; --i)
|
||||
for (int i = static_cast<int>(nTextures) - 1; i >= 0; --i)
|
||||
{
|
||||
if (visible_tex.find(i) == visible_tex.end())
|
||||
{
|
||||
@@ -995,7 +995,7 @@ std::vector<std::vector<uint8_t>> TextureSet::save_alpha(bool big_alphamap)
|
||||
}
|
||||
);
|
||||
|
||||
for (size_t layer = 0; layer < nTextures - 1; ++layer)
|
||||
for (int layer = 0; layer < nTextures - 1; ++layer)
|
||||
{
|
||||
amaps.emplace_back(2048);
|
||||
auto& layer_data = amaps.back();
|
||||
@@ -1028,7 +1028,7 @@ void TextureSet::alphas_to_big_alpha(uint8_t* dest)
|
||||
}
|
||||
);
|
||||
|
||||
for (size_t k = 0; k < nTextures - 1; k++)
|
||||
for (int k = 0; k < nTextures - 1; k++)
|
||||
{
|
||||
memcpy(alpha(k), alphamaps[k]->getAlpha(), 4096);
|
||||
}
|
||||
@@ -1037,7 +1037,7 @@ void TextureSet::alphas_to_big_alpha(uint8_t* dest)
|
||||
{
|
||||
int a = 255;
|
||||
|
||||
for (int k = nTextures - 2; k >= 0; --k)
|
||||
for (int k = static_cast<int>(nTextures - 2); k >= 0; --k)
|
||||
{
|
||||
uint8_t val = misc::rounded_255_int_div(*alpha(k, i) * a);
|
||||
a -= val;
|
||||
@@ -1077,7 +1077,7 @@ void TextureSet::alphas_to_old_alpha(uint8_t* dest)
|
||||
}
|
||||
);
|
||||
|
||||
for (size_t k = 0; k < nTextures - 1; k++)
|
||||
for (int k = 0; k < nTextures - 1; k++)
|
||||
{
|
||||
memcpy(alpha(k), alphamaps[k]->getAlpha(), 64 * 64);
|
||||
}
|
||||
@@ -1087,7 +1087,7 @@ void TextureSet::alphas_to_old_alpha(uint8_t* dest)
|
||||
// a = remaining visibility
|
||||
int a = 255;
|
||||
|
||||
for (int k = nTextures - 2; k >= 0; --k)
|
||||
for (int k = static_cast<int>(nTextures - 2); k >= 0; --k)
|
||||
{
|
||||
if (a <= 0)
|
||||
{
|
||||
@@ -1239,19 +1239,19 @@ namespace
|
||||
|
||||
void TextureSet::update_lod_texture_map()
|
||||
{
|
||||
std::array<std::uint16_t, 8> lod;
|
||||
std::array<std::uint16_t, 8> lod{};
|
||||
|
||||
for (std::size_t z = 0; z < 8; ++z)
|
||||
for (int z = 0; z < 8; ++z)
|
||||
{
|
||||
for (std::size_t x = 0; x < 8; ++x)
|
||||
for (int x = 0; x < 8; ++x)
|
||||
{
|
||||
misc::max_capacity_stack_vector<std::size_t, 4> dominant_square_count (nTextures);
|
||||
|
||||
for (std::size_t pz = z * 8; pz < (z + 1) * 8; ++pz)
|
||||
for (int pz = z * 8; pz < (z + 1) * 8; ++pz)
|
||||
{
|
||||
for (std::size_t px = x * 8; px < (x + 1) * 8; ++px)
|
||||
for (int px = x * 8; px < (x + 1) * 8; ++px)
|
||||
{
|
||||
++dominant_square_count[max_element_index (current_layer_values (nTextures, alphamaps.data(), pz, px))];
|
||||
++dominant_square_count[max_element_index (current_layer_values (static_cast<std::uint8_t>(nTextures), alphamaps.data(), pz, px))];
|
||||
}
|
||||
}
|
||||
//lod.push_back (max_element_index (dominant_square_count));
|
||||
|
||||
@@ -141,9 +141,9 @@ namespace Noggit
|
||||
{
|
||||
//! \todo Draw non-existing tiles aswell?
|
||||
painter.setBrush (QColor (255, 255, 255, 30));
|
||||
for (size_t i (0); i < 64; ++i)
|
||||
for (int i (0); i < 64; ++i)
|
||||
{
|
||||
for (size_t j (0); j < 64; ++j)
|
||||
for (int j (0); j < 64; ++j)
|
||||
{
|
||||
TileIndex const tile (i, j);
|
||||
bool changed = false;
|
||||
|
||||
@@ -105,7 +105,7 @@ LightEditor::LightEditor(MapView* map_view, QWidget* parent)
|
||||
|
||||
// global settings ********************************************************************************************** //
|
||||
// TODO : name lights on laoding instead
|
||||
light_editing_layout->addWidget(new QLabel("Selected Light :", this), 0, 0);
|
||||
light_editing_layout->addWidget(new QLabel("Selected Light :", this), 0);
|
||||
auto lightid_label = new QLabel("No light selected", this);
|
||||
light_editing_layout->addWidget(lightid_label);
|
||||
|
||||
@@ -147,7 +147,7 @@ LightEditor::LightEditor(MapView* map_view, QWidget* parent)
|
||||
|
||||
global_values_layout->addWidget(new QLabel("Inner Radius:", this),4,0);
|
||||
auto inner_radius_spin = new QDoubleSpinBox(this);
|
||||
inner_radius_spin->setRange(0, 100000); // max seen in dbc is 3871 (139363 <20> 36 )
|
||||
inner_radius_spin->setRange(0, 100000); // max seen in dbc is 3871 (139363 <20>E36 )
|
||||
inner_radius_spin->setValue(0);
|
||||
inner_radius_spin->setSingleStep(50);
|
||||
inner_radius_spin->setEnabled(false);
|
||||
@@ -155,7 +155,7 @@ LightEditor::LightEditor(MapView* map_view, QWidget* parent)
|
||||
|
||||
global_values_layout->addWidget(new QLabel("Outer Radius:", this),5,0);
|
||||
auto outer_radius_spin = new QDoubleSpinBox(this);
|
||||
outer_radius_spin->setRange(0, 100000); // max seen in dbc is 3871 (139363 <20> 36 )
|
||||
outer_radius_spin->setRange(0, 100000); // max seen in dbc is 3871 (139363 <20>E36 )
|
||||
outer_radius_spin->setValue(0);
|
||||
outer_radius_spin->setSingleStep(50);
|
||||
outer_radius_spin->setEnabled(false);
|
||||
|
||||
@@ -141,11 +141,11 @@ unsigned int BaseNode::nPorts(PortType port_type) const
|
||||
{
|
||||
if (port_type == PortType::In)
|
||||
{
|
||||
return _in_ports.size();
|
||||
return static_cast<unsigned int>(_in_ports.size());
|
||||
}
|
||||
else if (port_type == PortType::Out)
|
||||
{
|
||||
return _out_ports.size();
|
||||
return static_cast<unsigned int>(_out_ports.size());
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -89,12 +89,12 @@ void Noggit::Ui::Tools::NodeEditor::Nodes::BaseNode::addPortDefault(PortType por
|
||||
|
||||
if (port_type == PortType::In)
|
||||
{
|
||||
PortIndex index = _in_ports.size() - 1;
|
||||
PortIndex index = static_cast<PortIndex>(_in_ports.size() - 1);
|
||||
addDefaultWidget(_in_ports[index].data_type->default_widget(&_embedded_widget), port_type, index);
|
||||
}
|
||||
else if (port_type == PortType::Out)
|
||||
{
|
||||
PortIndex index = _out_ports.size() - 1;
|
||||
PortIndex index = static_cast<PortIndex>(_out_ports.size() - 1);
|
||||
addDefaultWidget(_out_ports[index].data_type->default_widget(&_embedded_widget), port_type, index);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -26,7 +26,7 @@ void JSONArrayInsertValueNode::compute()
|
||||
{
|
||||
QJsonArray* json_array = defaultPortData<JSONArrayData>(PortType::In, 1)->value_ptr();
|
||||
QJsonValue* json_val = defaultPortData<JSONValueData>(PortType::In, 2)->value_ptr();
|
||||
unsigned index = defaultPortData<UnsignedIntegerData>(PortType::In, 3)->value();
|
||||
int index = static_cast<int>(defaultPortData<UnsignedIntegerData>(PortType::In, 3)->value());
|
||||
|
||||
if (index > json_array->size() || index < 0)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ ListSizeNode::ListSizeNode()
|
||||
void ListSizeNode::compute()
|
||||
{
|
||||
_out_ports[0].out_value =
|
||||
std::make_shared<UnsignedIntegerData>(static_cast<ListData*>(_in_ports[0].in_value.lock().get())->value()->size());
|
||||
std::make_shared<UnsignedIntegerData>(static_cast<unsigned>(static_cast<ListData*>(_in_ports[0].in_value.lock().get())->value()->size()));
|
||||
|
||||
_node->onDataUpdated(0);
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ void ImageGaussianBlurNode::compute()
|
||||
QImage* image = static_cast<ImageData*>(_in_ports[1].in_value.lock().get())->value_ptr();
|
||||
|
||||
QImage new_image = *image;
|
||||
for (int i = 0; i < defaultPortData<UnsignedIntegerData>(PortType::In, 3)->value(); ++i)
|
||||
for (unsigned i = 0; i < defaultPortData<UnsignedIntegerData>(PortType::In, 3)->value(); ++i)
|
||||
{
|
||||
GaussianBlur blur(5.0,
|
||||
std::max(defaultPortData<DecimalData>(PortType::In, 2)->value(), 1.0));
|
||||
|
||||
@@ -166,7 +166,7 @@ QTextStream &operator << (QTextStream &stream, const GaussianBlur &blur) {
|
||||
for (int i = 0; i < blur.size_; i++) {
|
||||
for (int j = 0; j < blur.size_; j++)
|
||||
stream << blur.matrix_[i][j] << " ";
|
||||
stream << endl;
|
||||
stream << Qt::endl;
|
||||
}
|
||||
return stream;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ StringSizeNode::StringSizeNode()
|
||||
|
||||
void StringSizeNode::compute()
|
||||
{
|
||||
_out_ports[0].out_value = std::make_shared<UnsignedIntegerData>(static_cast<StringData*>(_in_ports[0].in_value.lock().get())->value().size());
|
||||
_out_ports[0].out_value = std::make_shared<UnsignedIntegerData>(static_cast<unsigned>(static_cast<StringData*>(_in_ports[0].in_value.lock().get())->value().size()));
|
||||
|
||||
_node->onDataUpdated(0);
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ void LogicBeginNode::restore(const QJsonObject& json_obj)
|
||||
{
|
||||
addPort<AnyData>(PortType::Out, "Any", true, ConnectionPolicy::One);
|
||||
addDefaultWidget(new QLabel(&_embedded_widget), PortType::Out, 2 + i);
|
||||
emit portAdded(PortType::Out, _out_ports.size() - 1);
|
||||
emit portAdded(PortType::Out, static_cast<QtNodes::PortIndex>(_out_ports.size() - 1));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -132,8 +132,8 @@ void LogicBeginNode::outputConnectionCreated(const Connection& connection)
|
||||
if (_out_ports[_out_ports.size() - 1].connected)
|
||||
{
|
||||
addPort<AnyData>(PortType::Out, "Any", true, ConnectionPolicy::One);
|
||||
addDefaultWidget(new QLabel(&_embedded_widget), PortType::Out, _out_ports.size() - 1);
|
||||
emit portAdded(PortType::Out, _out_ports.size() - 1);
|
||||
addDefaultWidget(new QLabel(&_embedded_widget), PortType::Out, static_cast<QtNodes::PortIndex>(_out_ports.size() - 1));
|
||||
emit portAdded(PortType::Out, static_cast<QtNodes::PortIndex>(_out_ports.size() - 1));
|
||||
}
|
||||
|
||||
emit visualsNeedUpdate();
|
||||
@@ -163,8 +163,8 @@ void LogicBeginNode::outputConnectionDeleted(const Connection& connection)
|
||||
else
|
||||
{
|
||||
addPort<AnyData>(PortType::Out, "Any", true, ConnectionPolicy::One);
|
||||
addDefaultWidget(new QLabel(&_embedded_widget), PortType::Out, _out_ports.size() - 1);
|
||||
emit portAdded(PortType::Out, _out_ports.size() - 1);
|
||||
addDefaultWidget(new QLabel(&_embedded_widget), PortType::Out, static_cast<QtNodes::PortIndex>(_out_ports.size() - 1));
|
||||
emit portAdded(PortType::Out, static_cast<QtNodes::PortIndex>(_out_ports.size() - 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -172,8 +172,8 @@ void LogicBeginNode::outputConnectionDeleted(const Connection& connection)
|
||||
if (_out_ports[_out_ports.size() - 1].connected)
|
||||
{
|
||||
addPort<AnyData>(PortType::Out, "Any", true, ConnectionPolicy::One);
|
||||
addDefaultWidget(new QLabel(&_embedded_widget), PortType::Out, _out_ports.size() - 1);
|
||||
emit portAdded(PortType::Out, _out_ports.size() - 1);
|
||||
addDefaultWidget(new QLabel(&_embedded_widget), PortType::Out, static_cast<QtNodes::PortIndex>(_out_ports.size() - 1));
|
||||
emit portAdded(PortType::Out, static_cast<QtNodes::PortIndex>(_out_ports.size() - 1));
|
||||
}
|
||||
|
||||
emit visualsNeedUpdate();
|
||||
@@ -203,8 +203,8 @@ void LogicBeginNode::restorePostConnection(const QJsonObject& json_obj)
|
||||
else
|
||||
{
|
||||
addPort<AnyData>(PortType::Out, "Any", true, ConnectionPolicy::One);
|
||||
addDefaultWidget(new QLabel(&_embedded_widget), PortType::Out, _out_ports.size() - 1);
|
||||
emit portAdded(PortType::Out, _out_ports.size() - 1);
|
||||
addDefaultWidget(new QLabel(&_embedded_widget), PortType::Out, static_cast<QtNodes::PortIndex>(_out_ports.size() - 1));
|
||||
emit portAdded(PortType::Out, static_cast<QtNodes::PortIndex>(_out_ports.size() - 1));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ void LogicChainNode::outputConnectionCreated(const Connection& connection)
|
||||
if (_out_ports[_out_ports.size() - 1].connected)
|
||||
{
|
||||
addPort<LogicData>(PortType::Out, "Logic", true, ConnectionPolicy::One);
|
||||
emit portAdded(PortType::Out, _out_ports.size() - 1);
|
||||
emit portAdded(PortType::Out, static_cast<QtNodes::PortIndex>(_out_ports.size() - 1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ void LogicChainNode::outputConnectionDeleted(const Connection& connection)
|
||||
else
|
||||
{
|
||||
addPort<LogicData>(PortType::Out, "Logic", true, ConnectionPolicy::One);
|
||||
emit portAdded(PortType::Out, _out_ports.size() - 1);
|
||||
emit portAdded(PortType::Out, static_cast<QtNodes::PortIndex>(_out_ports.size() - 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,7 @@ void LogicChainNode::outputConnectionDeleted(const Connection& connection)
|
||||
if (_out_ports.size() == 1 && _out_ports[0].connected)
|
||||
{
|
||||
addPort<LogicData>(PortType::Out, "Logic", true, ConnectionPolicy::One);
|
||||
emit portAdded(PortType::Out, _out_ports.size() - 1);
|
||||
emit portAdded(PortType::Out, static_cast<QtNodes::PortIndex>(_out_ports.size() - 1));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -103,7 +103,7 @@ void LogicChainNode::restore(const QJsonObject& json_obj)
|
||||
for (int i = 0; i < json_obj["n_dynamic_ports"].toInt(); ++i)
|
||||
{
|
||||
addPort<LogicData>(PortType::Out, "Logic", true, ConnectionPolicy::One);
|
||||
emit portAdded(PortType::Out, _out_ports.size() - 1);
|
||||
emit portAdded(PortType::Out, static_cast<QtNodes::PortIndex>(_out_ports.size() - 1));
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ void LogicChainNode::restorePostConnection(const QJsonObject& json_obj)
|
||||
else
|
||||
{
|
||||
addPort<LogicData>(PortType::Out, "Logic", true, ConnectionPolicy::One);
|
||||
emit portAdded(PortType::Out, _out_ports.size() - 1);
|
||||
emit portAdded(PortType::Out, static_cast<QtNodes::PortIndex>(_out_ports.size() - 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -130,7 +130,7 @@ void LogicChainNode::restorePostConnection(const QJsonObject& json_obj)
|
||||
if (_out_ports[_out_ports.size() - 1].connected)
|
||||
{
|
||||
addPort<LogicData>(PortType::Out, "Logic", true, ConnectionPolicy::One);
|
||||
emit portAdded(PortType::Out, _out_ports.size() - 1);
|
||||
emit portAdded(PortType::Out, static_cast<QtNodes::PortIndex>(_out_ports.size() - 1));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -184,13 +184,13 @@ void LogicProcedureNode::restore(const QJsonObject& json_obj)
|
||||
for (int i = 0; i < json_obj["n_dynamic_in_ports"].toInt(); ++i)
|
||||
{
|
||||
addPort<LogicData>(PortType::In, json_obj[("in_port_" + std::to_string(i + 2) + "_caption").c_str()].toString(), true);
|
||||
addDefaultWidget(new QLabel(&_embedded_widget), PortType::In, _in_ports.size() - 1);
|
||||
addDefaultWidget(new QLabel(&_embedded_widget), PortType::In, static_cast<QtNodes::PortIndex>(_in_ports.size() - 1));
|
||||
|
||||
std::unique_ptr<NodeData> type;
|
||||
type.reset(TypeFactory::create(json_obj[("in_port_" + std::to_string(i + 2)).c_str()].toString().toStdString()));
|
||||
|
||||
_in_ports[_in_ports.size() - 1].data_type = std::move(type);
|
||||
emit portAdded(PortType::In, _in_ports.size() - 1);
|
||||
emit portAdded(PortType::In, static_cast<QtNodes::PortIndex>(_in_ports.size() - 1));
|
||||
}
|
||||
|
||||
for (int i = 0; i < json_obj["n_dynamic_out_ports"].toInt(); ++i)
|
||||
@@ -201,7 +201,7 @@ void LogicProcedureNode::restore(const QJsonObject& json_obj)
|
||||
type.reset(TypeFactory::create(json_obj[("out_port_" + std::to_string(i + 1)).c_str()].toString().toStdString()));
|
||||
|
||||
_out_ports[_out_ports.size() - 1].data_type = std::move(type);
|
||||
emit portAdded(PortType::Out, _out_ports.size() - 1);
|
||||
emit portAdded(PortType::Out, static_cast<QtNodes::PortIndex>(_out_ports.size() - 1));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -236,12 +236,12 @@ NodeValidationState LogicProcedureNode::validate()
|
||||
|
||||
void LogicProcedureNode::clearDynamicPorts()
|
||||
{
|
||||
for (int i = _in_ports.size() - 1; i != 1 ; --i)
|
||||
for (int i = static_cast<int>(_in_ports.size() - 1); i != 1 ; --i)
|
||||
{
|
||||
deletePort(PortType::In, i);
|
||||
}
|
||||
|
||||
for (int i = _out_ports.size() - 1; i != 0 ; --i)
|
||||
for (int i = static_cast<int>(_out_ports.size() - 1); i != 0 ; --i)
|
||||
{
|
||||
deletePort(PortType::Out, i);
|
||||
}
|
||||
@@ -284,7 +284,7 @@ void LogicProcedureNode::setProcedure(const QString& path)
|
||||
continue;
|
||||
|
||||
addPort<LogicData>(PortType::In, port.caption, true);
|
||||
int port_idx = _in_ports.size() - 1;
|
||||
int port_idx = static_cast<int>(_in_ports.size() - 1);
|
||||
addDefaultWidget(new QLabel(&_embedded_widget), PortType::In, port_idx);
|
||||
|
||||
_in_ports[port_idx].data_type = port.data_type->instantiate();
|
||||
@@ -305,7 +305,7 @@ void LogicProcedureNode::setProcedure(const QString& path)
|
||||
continue;
|
||||
|
||||
addPort<LogicData>(PortType::Out, port.caption, true);
|
||||
int port_idx = _out_ports.size() - 1;
|
||||
int port_idx = static_cast<int>(_out_ports.size() - 1);
|
||||
_out_ports[port_idx].data_type = port.data_type->instantiate();
|
||||
_out_ports[port_idx].data_type->set_parameter_type(port.data_type->type().parameter_type_id);
|
||||
emit portAdded(PortType::Out, port_idx);
|
||||
|
||||
@@ -50,7 +50,7 @@ void LogicReturnNode::restore(const QJsonObject& json_obj)
|
||||
for (int i = 0; i < json_obj["n_dynamic_ports"].toInt(); ++i)
|
||||
{
|
||||
addPort<AnyData>(PortType::In, "Any", true);
|
||||
emit portAdded(PortType::In, _in_ports.size() - 1);
|
||||
emit portAdded(PortType::In, static_cast<QtNodes::PortIndex>(_in_ports.size() - 1));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -109,7 +109,7 @@ void LogicReturnNode::inputConnectionCreated(const Connection& connection)
|
||||
if (_in_ports[_in_ports.size() - 1].connected)
|
||||
{
|
||||
addPort<AnyData>(PortType::In, "Any", true);
|
||||
emit portAdded(PortType::In, _in_ports.size() - 1);
|
||||
emit portAdded(PortType::In, static_cast<QtNodes::PortIndex>(_in_ports.size() - 1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ void LogicReturnNode::inputConnectionDeleted(const Connection& connection)
|
||||
else
|
||||
{
|
||||
addPort<AnyData>(PortType::In, "Any", true);
|
||||
emit portAdded(PortType::In, _in_ports.size() - 1);
|
||||
emit portAdded(PortType::In, static_cast<QtNodes::PortIndex>(_in_ports.size() - 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -141,7 +141,7 @@ void LogicReturnNode::inputConnectionDeleted(const Connection& connection)
|
||||
if (_in_ports[_in_ports.size() - 1].connected)
|
||||
{
|
||||
addPort<AnyData>(PortType::In, "Any", true);
|
||||
emit portAdded(PortType::In, _in_ports.size() - 1);
|
||||
emit portAdded(PortType::In, static_cast<QtNodes::PortIndex>(_in_ports.size() - 1));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ bool LogicBranch::executeNode(Node* node, Node* source_node)
|
||||
return false;
|
||||
|
||||
// Handle dependant nodes
|
||||
for (int i = 0; i < model->nPorts(PortType::Out); ++i)
|
||||
for (int i = 0; i < static_cast<int>(model->nPorts(PortType::Out)); ++i)
|
||||
{
|
||||
// we do not process dependant data nodes here, discard them
|
||||
if (model->dataType(PortType::Out, i).id != "logic")
|
||||
@@ -180,7 +180,7 @@ bool LogicBranch::executeNodeLeaves(Node* node, Node* source_node)
|
||||
if (model->isComputed())
|
||||
return true;
|
||||
|
||||
for (int i = 0; i < model->nPorts(PortType::In); ++i)
|
||||
for (int i = 0; i < static_cast<int>(model->nPorts(PortType::In)); ++i)
|
||||
{
|
||||
auto const& connections = nodeState.connectionsRef(PortType::In, i);
|
||||
|
||||
@@ -221,7 +221,7 @@ void LogicBranch::markNodesComputed(Node* start_node, bool state)
|
||||
model->setComputed(state);
|
||||
markNodeLeavesComputed(start_node, start_node, state);
|
||||
|
||||
for (int i = 0; i < model->nPorts(PortType::Out); ++i)
|
||||
for (int i = 0; i < static_cast<int>(model->nPorts(PortType::Out)); ++i)
|
||||
{
|
||||
auto const& connections = nodeState.connectionsRef(PortType::Out, i);
|
||||
|
||||
@@ -247,7 +247,7 @@ void LogicBranch::markNodeLeavesComputed(Node* start_node, Node* source_node, bo
|
||||
|
||||
model->setComputed(state);
|
||||
|
||||
for (int i = 0; i < model->nPorts(PortType::In); ++i)
|
||||
for (int i = 0; i < static_cast<int>(model->nPorts(PortType::In)); ++i)
|
||||
{
|
||||
auto const& connections = nodeState.connectionsRef(PortType::In, i);
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ void ChunkInfoNode::compute()
|
||||
if (_out_ports[7].connected)
|
||||
{
|
||||
auto center = chunk->getCenter();
|
||||
_out_ports[7].out_value = std::make_shared<UnsignedIntegerData>(chunk->texture_set->num());
|
||||
_out_ports[7].out_value = std::make_shared<UnsignedIntegerData>(static_cast<unsigned>(chunk->texture_set->num()));
|
||||
_node->onDataUpdated(7);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class StackedWidget : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
StackedWidget(QWidget * = 0, Qt::WindowFlags = 0);
|
||||
StackedWidget(QWidget * = 0, Qt::WindowFlags = Qt::WindowFlags{});
|
||||
|
||||
void addWidget(QWidget *);
|
||||
void removeLast();
|
||||
|
||||
@@ -36,7 +36,7 @@ void ViewportGizmo::handleTransformGizmo(MapView* map_view
|
||||
auto model_view_trs = model_view;
|
||||
auto projection_trs = projection;
|
||||
|
||||
int n_selected = selection.size();
|
||||
int n_selected = static_cast<int>(selection.size());
|
||||
|
||||
if (!n_selected || (n_selected == 1 & selection[0].index() != eEntry_Object))
|
||||
return;
|
||||
|
||||
@@ -101,7 +101,7 @@ void LightViewPreview::SetPreview(std::vector<SkyColor>& data)
|
||||
|
||||
void LightViewPreview::UpdatePixmap(const QPixmap Updated)
|
||||
{
|
||||
Preview->setPixmap(Updated.scaled(Preview->pixmap()->size(), Qt::IgnoreAspectRatio));
|
||||
Preview->setPixmap(Updated.scaled(Preview->pixmap(Qt::ReturnByValueConstant{}).size(), Qt::IgnoreAspectRatio));
|
||||
}
|
||||
|
||||
LightViewPixmap::LightViewPixmap(QSize Size, QWidget* parent)
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Noggit::Ui::Widget
|
||||
|
||||
QString MapListBookmarkItem::toCamelCase(const QString& s)
|
||||
{
|
||||
QStringList parts = s.split(' ', QString::SkipEmptyParts);
|
||||
QStringList parts = s.split(' ', Qt::SplitBehaviorFlags::SkipEmptyParts);
|
||||
for (int i = 0; i < parts.size(); ++i)
|
||||
parts[i].replace(0, 1, parts[i][0].toUpper());
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace Noggit::Ui::Widget
|
||||
|
||||
QString MapListItem::toCamelCase(const QString& s)
|
||||
{
|
||||
QStringList parts = s.split(' ', QString::SkipEmptyParts);
|
||||
QStringList parts = s.split(' ', Qt::SplitBehaviorFlags::SkipEmptyParts);
|
||||
for (int i = 0; i < parts.size(); ++i)
|
||||
parts[i].replace(0, 1, parts[i][0].toUpper());
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace Noggit::Ui::Widget
|
||||
|
||||
QString ProjectListItem::toCamelCase(const QString& s)
|
||||
{
|
||||
QStringList parts = s.split(' ', QString::SkipEmptyParts);
|
||||
QStringList parts = s.split(' ', Qt::SplitBehaviorFlags::SkipEmptyParts);
|
||||
for (int i = 0; i < parts.size(); ++i)
|
||||
parts[i].replace(0, 1, parts[i][0].toUpper());
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ namespace Noggit
|
||||
QMessageBox::warning(
|
||||
this,
|
||||
tr("Not implemented"),
|
||||
tr("This is not implemented, i don't know what it is or what it does but it didn't comppile."));
|
||||
tr("This is not implemented, i don't know what it is or what it does but it didn't compile."));
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ int wmo_liquid::initGeometry(BlizzardArchive::ClientFile* f)
|
||||
}
|
||||
}
|
||||
|
||||
_indices_count = indices.size();
|
||||
_indices_count = static_cast<int>(indices.size());
|
||||
|
||||
return last_liquid_id;
|
||||
}
|
||||
|
||||
@@ -31,9 +31,9 @@ namespace Noggit
|
||||
auto& extents(instance->getExtents());
|
||||
TileIndex start(extents[0]), end(extents[1]);
|
||||
|
||||
for (int z = start.z; z <= end.z; ++z)
|
||||
for (size_t z = start.z; z <= end.z; ++z)
|
||||
{
|
||||
for (int x = start.x; x <= end.x; ++x)
|
||||
for (size_t x = start.x; x <= end.x; ++x)
|
||||
{
|
||||
world->mapIndex.update_model_tile(TileIndex(x, z), update_type, instance);
|
||||
}
|
||||
|
||||
@@ -620,7 +620,7 @@ void OpenGL::context::compile_shader (GLuint shader)
|
||||
if (get_shader (shader, GL_COMPILE_STATUS) != GL_TRUE)
|
||||
{
|
||||
std::vector<char> log (get_shader (shader, GL_INFO_LOG_LENGTH));
|
||||
_current_context->functions()->glGetShaderInfoLog (shader, log.size(), nullptr, log.data());
|
||||
_current_context->functions()->glGetShaderInfoLog (shader, static_cast<GLsizei>(log.size()), nullptr, log.data());
|
||||
LogDebug << std::string (log.data ()) << std::endl;
|
||||
throw std::runtime_error ("compiling shader failed: " + std::string (log.data()));
|
||||
}
|
||||
@@ -729,7 +729,7 @@ std::string OpenGL::context::get_program_info_log(GLuint program)
|
||||
return "<empty log>";
|
||||
}
|
||||
|
||||
_current_context->functions()->glGetProgramInfoLog(program, log.size(), nullptr, log.data());
|
||||
_current_context->functions()->glGetProgramInfoLog(program, static_cast<GLsizei>(log.size()), nullptr, log.data());
|
||||
|
||||
return std::string(log.data());
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ namespace OpenGL
|
||||
if (loc < 0)
|
||||
return;
|
||||
|
||||
gl.uniform1iv (loc, value.size(), value.data());
|
||||
gl.uniform1iv (loc, static_cast<GLsizei>(value.size()), value.data());
|
||||
}
|
||||
void use_program::uniform (std::string const& name, int const* data, std::size_t size)
|
||||
{
|
||||
@@ -256,7 +256,7 @@ namespace OpenGL
|
||||
if (loc < 0)
|
||||
return;
|
||||
|
||||
gl.uniform1iv (loc, size, data);
|
||||
gl.uniform1iv (loc, static_cast<GLsizei>(size), data);
|
||||
}
|
||||
void use_program::uniform (std::string const& name, glm::vec3 const* data, std::size_t size)
|
||||
{
|
||||
@@ -264,11 +264,11 @@ namespace OpenGL
|
||||
if (loc < 0)
|
||||
return;
|
||||
|
||||
gl.uniform3fv (loc, size, reinterpret_cast<const GLfloat*>(data));
|
||||
gl.uniform3fv (loc, static_cast<GLsizei>(size), reinterpret_cast<const GLfloat*>(data));
|
||||
}
|
||||
void use_program::uniform (GLint pos, std::vector<int> const& value)
|
||||
{
|
||||
gl.uniform1iv (pos, value.size(), value.data());
|
||||
gl.uniform1iv (pos, static_cast<GLsizei>(value.size()), value.data());
|
||||
}
|
||||
void use_program::uniform (std::string const& name, std::vector<glm::vec3> const& value)
|
||||
{
|
||||
@@ -276,7 +276,7 @@ namespace OpenGL
|
||||
if (loc < 0)
|
||||
return;
|
||||
|
||||
gl.uniform3fv (loc, value.size(), glm::value_ptr(value[0]));
|
||||
gl.uniform3fv (loc, static_cast<GLsizei>(value.size()), glm::value_ptr(value[0]));
|
||||
}
|
||||
void use_program::uniform(std::string const& name, std::vector<glm::vec4> const& value)
|
||||
{
|
||||
@@ -284,7 +284,7 @@ namespace OpenGL
|
||||
if (loc < 0)
|
||||
return;
|
||||
|
||||
gl.uniform4fv(loc, value.size(), glm::value_ptr(value[0]));
|
||||
gl.uniform4fv(loc, static_cast<GLsizei>(value.size()), glm::value_ptr(value[0]));
|
||||
}
|
||||
void use_program::uniform_chunk_textures (std::string const& name, std::array<std::array<std::array<int, 2>, 4>, 256> const& value)
|
||||
{
|
||||
@@ -296,11 +296,11 @@ namespace OpenGL
|
||||
}
|
||||
void use_program::uniform (GLint pos, std::vector<glm::vec3> const& value)
|
||||
{
|
||||
gl.uniform3fv (pos, value.size(),glm::value_ptr(value[0]));
|
||||
gl.uniform3fv (pos, static_cast<GLsizei>(value.size()),glm::value_ptr(value[0]));
|
||||
}
|
||||
void use_program::uniform(GLint pos, std::vector<glm::vec4> const& value)
|
||||
{
|
||||
gl.uniform4fv(pos, value.size(), glm::value_ptr(value[0]));
|
||||
gl.uniform4fv(pos, static_cast<GLsizei>(value.size()), glm::value_ptr(value[0]));
|
||||
}
|
||||
void use_program::uniform (std::string const& name, glm::vec2 const& value)
|
||||
{
|
||||
@@ -437,7 +437,7 @@ namespace OpenGL
|
||||
void use_program::attrib_divisor(std::string const& name, GLuint divisor, GLsizei range)
|
||||
{
|
||||
GLuint const location (attrib_location (name));
|
||||
for (GLuint i = 0; i < range; ++i)
|
||||
for (GLuint i = 0; i < static_cast<GLuint>(range); ++i)
|
||||
{
|
||||
gl.vertexAttribDivisor(location + i, divisor);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace OpenGL
|
||||
|
||||
void texture::set_active_texture (size_t num)
|
||||
{
|
||||
gl.activeTexture (GL_TEXTURE0 + num);
|
||||
gl.activeTexture (static_cast<GLenum>(GL_TEXTURE0 + num));
|
||||
}
|
||||
|
||||
void texture::unload()
|
||||
|
||||
Reference in New Issue
Block a user