Code formatting

This commit is contained in:
Adam Sawicki 2018-08-13 12:15:50 +02:00
parent f188a152de
commit 5b48b5efcf

View File

@ -347,8 +347,10 @@ void Player::ExecuteLine(size_t lineNumber, const StrRange& line)
else else
{ {
if(IssueWarning()) if(IssueWarning())
{
printf("Line %zu: Incorrect frame index.\n", lineNumber); printf("Line %zu: Incorrect frame index.\n", lineNumber);
} }
}
StrRange functionName = csvSplit.GetRange(3); StrRange functionName = csvSplit.GetRange(3);
@ -390,14 +392,18 @@ void Player::ExecuteLine(size_t lineNumber, const StrRange& line)
else else
{ {
if(IssueWarning()) if(IssueWarning())
{
printf("Line %zu: Unknown function.\n", lineNumber); printf("Line %zu: Unknown function.\n", lineNumber);
} }
} }
}
else else
{ {
if(IssueWarning()) if(IssueWarning())
{
printf("Line %zu: Too few columns.\n", lineNumber); printf("Line %zu: Too few columns.\n", lineNumber);
} }
}
} }
void Player::Destroy(const Allocation& alloc) void Player::Destroy(const Allocation& alloc)
@ -697,8 +703,10 @@ bool Player::ValidateFunctionParameterCount(size_t lineNumber, const CsvSplit& c
if(!ok) if(!ok)
{ {
if(IssueWarning()) if(IssueWarning())
{
printf("Line %zu: Incorrect number of function parameters.\n", lineNumber); printf("Line %zu: Incorrect number of function parameters.\n", lineNumber);
} }
}
return ok; return ok;
} }
@ -723,24 +731,30 @@ void Player::ExecuteCreatePool(size_t lineNumber, const CsvSplit& csvSplit)
if(res != VK_SUCCESS) if(res != VK_SUCCESS)
{ {
if(IssueWarning()) if(IssueWarning())
{
printf("Line %zu: vmaCreatePool failed (%u).\n", lineNumber, res); printf("Line %zu: vmaCreatePool failed (%u).\n", lineNumber, res);
} }
}
const auto existingIt = m_Pools.find(origPtr); const auto existingIt = m_Pools.find(origPtr);
if(existingIt != m_Pools.end()) if(existingIt != m_Pools.end())
{ {
if(IssueWarning()) if(IssueWarning())
{
printf("Line %zu: Pool %llX already exists.\n", lineNumber, origPtr); printf("Line %zu: Pool %llX already exists.\n", lineNumber, origPtr);
} }
}
m_Pools[origPtr] = poolDesc; m_Pools[origPtr] = poolDesc;
} }
else else
{ {
if(IssueWarning()) if(IssueWarning())
{
printf("Line %zu: Invalid parameters for vmaCreatePool.\n", lineNumber); printf("Line %zu: Invalid parameters for vmaCreatePool.\n", lineNumber);
} }
} }
}
} }
void Player::ExecuteDestroyPool(size_t lineNumber, const CsvSplit& csvSplit) void Player::ExecuteDestroyPool(size_t lineNumber, const CsvSplit& csvSplit)
@ -760,15 +774,19 @@ void Player::ExecuteDestroyPool(size_t lineNumber, const CsvSplit& csvSplit)
else else
{ {
if(IssueWarning()) if(IssueWarning())
{
printf("Line %zu: Pool %llX not found.\n", lineNumber, origPtr); printf("Line %zu: Pool %llX not found.\n", lineNumber, origPtr);
} }
} }
}
else else
{ {
if(IssueWarning()) if(IssueWarning())
{
printf("Line %zu: Invalid parameters for vmaDestroyPool.\n", lineNumber); printf("Line %zu: Invalid parameters for vmaDestroyPool.\n", lineNumber);
} }
} }
}
} }
void Player::ExecuteCreateBuffer(size_t lineNumber, const CsvSplit& csvSplit) void Player::ExecuteCreateBuffer(size_t lineNumber, const CsvSplit& csvSplit)
@ -800,9 +818,11 @@ void Player::ExecuteCreateBuffer(size_t lineNumber, const CsvSplit& csvSplit)
else else
{ {
if(IssueWarning()) if(IssueWarning())
{
printf("Line %zu: Pool %llX not found.\n", lineNumber, origPool); printf("Line %zu: Pool %llX not found.\n", lineNumber, origPool);
} }
} }
}
Allocation allocDesc = {}; Allocation allocDesc = {};
VkResult res = vmaCreateBuffer(m_Allocator, &bufCreateInfo, &allocCreateInfo, &allocDesc.buffer, &allocDesc.allocation, nullptr); VkResult res = vmaCreateBuffer(m_Allocator, &bufCreateInfo, &allocCreateInfo, &allocDesc.buffer, &allocDesc.allocation, nullptr);
@ -813,24 +833,30 @@ void Player::ExecuteCreateBuffer(size_t lineNumber, const CsvSplit& csvSplit)
else else
{ {
if(IssueWarning()) if(IssueWarning())
{
printf("Line %zu: vmaCreateBuffer failed (%u).\n", lineNumber, res); printf("Line %zu: vmaCreateBuffer failed (%u).\n", lineNumber, res);
} }
}
const auto existingIt = m_Allocations.find(origPtr); const auto existingIt = m_Allocations.find(origPtr);
if(existingIt != m_Allocations.end()) if(existingIt != m_Allocations.end())
{ {
if(IssueWarning()) if(IssueWarning())
{
printf("Line %zu: Allocation %llX already exists.\n", lineNumber, origPtr); printf("Line %zu: Allocation %llX already exists.\n", lineNumber, origPtr);
} }
}
m_Allocations[origPtr] = allocDesc; m_Allocations[origPtr] = allocDesc;
} }
else else
{ {
if(IssueWarning()) if(IssueWarning())
{
printf("Line %zu: Invalid parameters for vmaCreateBuffer.\n", lineNumber); printf("Line %zu: Invalid parameters for vmaCreateBuffer.\n", lineNumber);
} }
} }
}
} }
void Player::DestroyAllocation(size_t lineNumber, const CsvSplit& csvSplit) void Player::DestroyAllocation(size_t lineNumber, const CsvSplit& csvSplit)
@ -850,15 +876,19 @@ void Player::DestroyAllocation(size_t lineNumber, const CsvSplit& csvSplit)
else else
{ {
if(IssueWarning()) if(IssueWarning())
{
printf("Line %zu: Allocation %llX not found.\n", lineNumber, origAllocPtr); printf("Line %zu: Allocation %llX not found.\n", lineNumber, origAllocPtr);
} }
} }
}
else else
{ {
if(IssueWarning()) if(IssueWarning())
{
printf("Line %zu: Invalid parameters for vmaDestroyBuffer.\n", lineNumber); printf("Line %zu: Invalid parameters for vmaDestroyBuffer.\n", lineNumber);
} }
} }
}
} }
void Player::ExecuteCreateImage(size_t lineNumber, const CsvSplit& csvSplit) void Player::ExecuteCreateImage(size_t lineNumber, const CsvSplit& csvSplit)
@ -895,13 +925,17 @@ void Player::ExecuteCreateImage(size_t lineNumber, const CsvSplit& csvSplit)
{ {
const auto poolIt = m_Pools.find(origPool); const auto poolIt = m_Pools.find(origPool);
if(poolIt != m_Pools.end()) if(poolIt != m_Pools.end())
{
allocCreateInfo.pool = poolIt->second.pool; allocCreateInfo.pool = poolIt->second.pool;
}
else else
{ {
if(IssueWarning()) if(IssueWarning())
{
printf("Line %zu: Pool %llX not found.\n", lineNumber, origPool); printf("Line %zu: Pool %llX not found.\n", lineNumber, origPool);
} }
} }
}
Allocation allocDesc = {}; Allocation allocDesc = {};
VkResult res = vmaCreateImage(m_Allocator, &imageCreateInfo, &allocCreateInfo, &allocDesc.image, &allocDesc.allocation, nullptr); VkResult res = vmaCreateImage(m_Allocator, &imageCreateInfo, &allocCreateInfo, &allocDesc.image, &allocDesc.allocation, nullptr);
@ -912,24 +946,30 @@ void Player::ExecuteCreateImage(size_t lineNumber, const CsvSplit& csvSplit)
else else
{ {
if(IssueWarning()) if(IssueWarning())
{
printf("Line %zu: vmaCreateImage failed (%u).\n", lineNumber, res); printf("Line %zu: vmaCreateImage failed (%u).\n", lineNumber, res);
} }
}
const auto existingIt = m_Allocations.find(origPtr); const auto existingIt = m_Allocations.find(origPtr);
if(existingIt != m_Allocations.end()) if(existingIt != m_Allocations.end())
{ {
if(IssueWarning()) if(IssueWarning())
{
printf("Line %zu: Allocation %llX already exists.\n", lineNumber, origPtr); printf("Line %zu: Allocation %llX already exists.\n", lineNumber, origPtr);
} }
}
m_Allocations[origPtr] = allocDesc; m_Allocations[origPtr] = allocDesc;
} }
else else
{ {
if(IssueWarning()) if(IssueWarning())
{
printf("Line %zu: Invalid parameters for vmaCreateImage.\n", lineNumber); printf("Line %zu: Invalid parameters for vmaCreateImage.\n", lineNumber);
} }
} }
}
} }