mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-09-02 23:17:26 +00:00
Reformat code with clang format
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
#include "MenuDumperIW5.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <cassert>
|
||||
#include <sstream>
|
||||
|
||||
#include "ObjWriting.h"
|
||||
#include "Game/IW5/MenuConstantsIW5.h"
|
||||
#include "ObjWriting.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <sstream>
|
||||
|
||||
using namespace IW5;
|
||||
|
||||
@@ -92,9 +92,7 @@ void MenuDumper::WriteStatementOperator(const Statement_s* statement, size_t& cu
|
||||
const auto& staticDvarEntry = statement->entries[currentPos + 1];
|
||||
if (staticDvarEntry.type == EET_OPERAND && staticDvarEntry.data.operand.dataType == VAL_INT)
|
||||
{
|
||||
if (statement->supportingData
|
||||
&& statement->supportingData->staticDvarList.staticDvars
|
||||
&& staticDvarEntry.data.operand.internals.intVal >= 0
|
||||
if (statement->supportingData && statement->supportingData->staticDvarList.staticDvars && staticDvarEntry.data.operand.internals.intVal >= 0
|
||||
&& staticDvarEntry.data.operand.internals.intVal < statement->supportingData->staticDvarList.numStaticDvars)
|
||||
{
|
||||
const auto* staticDvar = statement->supportingData->staticDvarList.staticDvars[staticDvarEntry.data.operand.internals.intVal];
|
||||
@@ -244,9 +242,7 @@ void MenuDumper::WriteStatementSkipInitialUnnecessaryParenthesis(const Statement
|
||||
|
||||
const auto statementEnd = static_cast<size_t>(statementValue->numEntries);
|
||||
|
||||
if (statementValue->numEntries >= 1
|
||||
&& statementValue->entries[0].type == EET_OPERATOR
|
||||
&& statementValue->entries[0].data.op == OP_LEFTPAREN)
|
||||
if (statementValue->numEntries >= 1 && statementValue->entries[0].type == EET_OPERATOR && statementValue->entries[0].data.op == OP_LEFTPAREN)
|
||||
{
|
||||
const auto parenthesisEnd = FindStatementClosingParenthesis(statementValue, 0);
|
||||
|
||||
@@ -295,7 +291,7 @@ void MenuDumper::WriteSetLocalVarData(const std::string& setFunction, const SetL
|
||||
m_stream << ";\n";
|
||||
}
|
||||
|
||||
//#define WRITE_ORIGINAL_SCRIPT
|
||||
// #define WRITE_ORIGINAL_SCRIPT
|
||||
|
||||
void MenuDumper::WriteUnconditionalScript(const char* script) const
|
||||
{
|
||||
@@ -359,8 +355,7 @@ void MenuDumper::WriteMenuEventHandlerSet(const MenuEventHandlerSet* eventHandle
|
||||
break;
|
||||
|
||||
case EVENT_IF:
|
||||
if (eventHandler->eventData.conditionalScript == nullptr
|
||||
|| eventHandler->eventData.conditionalScript->eventExpression == nullptr
|
||||
if (eventHandler->eventData.conditionalScript == nullptr || eventHandler->eventData.conditionalScript->eventExpression == nullptr
|
||||
|| eventHandler->eventData.conditionalScript->eventHandlerSet == nullptr)
|
||||
{
|
||||
continue;
|
||||
@@ -422,7 +417,8 @@ void MenuDumper::WriteRectProperty(const std::string& propertyKey, const rectDef
|
||||
{
|
||||
Indent();
|
||||
WriteKey(propertyKey);
|
||||
m_stream << rect.x << " " << rect.y << " " << rect.w << " " << rect.h << " " << static_cast<int>(rect.horzAlign) << " " << static_cast<int>(rect.vertAlign) << "\n";
|
||||
m_stream << rect.x << " " << rect.y << " " << rect.w << " " << rect.h << " " << static_cast<int>(rect.horzAlign) << " " << static_cast<int>(rect.vertAlign)
|
||||
<< "\n";
|
||||
}
|
||||
|
||||
void MenuDumper::WriteMaterialProperty(const std::string& propertyKey, const Material* materialValue) const
|
||||
@@ -486,7 +482,7 @@ void MenuDumper::WriteFloatExpressionsProperty(const ItemFloatExpression* floatE
|
||||
continue;
|
||||
|
||||
std::string propertyName = std::string("exp ") + floatExpressionTargetBindings[floatExpression.target].name + std::string(" ")
|
||||
+ floatExpressionTargetBindings[floatExpression.target].componentName;
|
||||
+ floatExpressionTargetBindings[floatExpression.target].componentName;
|
||||
|
||||
WriteStatementProperty(propertyName, floatExpression.expression, false);
|
||||
}
|
||||
@@ -532,12 +528,8 @@ void MenuDumper::WriteColumnProperty(const std::string& propertyKey, const listB
|
||||
for (auto i = 0u; i < MENU_KEY_SPACING; i++)
|
||||
m_stream << " ";
|
||||
|
||||
m_stream << listBox->columnInfo[col].xpos
|
||||
<< " " << listBox->columnInfo[col].ypos
|
||||
<< " " << listBox->columnInfo[col].width
|
||||
<< " " << listBox->columnInfo[col].height
|
||||
<< " " << listBox->columnInfo[col].maxChars
|
||||
<< " " << listBox->columnInfo[col].alignment << "\n";
|
||||
m_stream << listBox->columnInfo[col].xpos << " " << listBox->columnInfo[col].ypos << " " << listBox->columnInfo[col].width << " "
|
||||
<< listBox->columnInfo[col].height << " " << listBox->columnInfo[col].maxChars << " " << listBox->columnInfo[col].alignment << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "Menu/AbstractMenuDumper.h"
|
||||
#include "Game/IW5/IW5.h"
|
||||
#include "Menu/AbstractMenuDumper.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace IW5
|
||||
{
|
||||
@@ -52,4 +52,4 @@ namespace IW5
|
||||
void WriteFunctionDef(const std::string& functionName, const Statement_s* statement);
|
||||
void WriteMenu(const menuDef_t* menu);
|
||||
};
|
||||
}
|
||||
} // namespace IW5
|
||||
|
Reference in New Issue
Block a user