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