Skip to content

Commit f666a11

Browse files
authored
Update API and bump version for 8193.37-17 (#1843)
1 parent 86747b7 commit f666a11

File tree

8 files changed

+28
-17
lines changed

8 files changed

+28
-17
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ find_package(Sanitizers)
2020
execute_process(COMMAND git rev-parse --short HEAD OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE SHORT_HASH)
2121
set(TARGET_NWN_BUILD 8193)
2222
set(TARGET_NWN_BUILD_REVISION 37)
23-
set(TARGET_NWN_BUILD_POSTFIX 15)
23+
set(TARGET_NWN_BUILD_POSTFIX 17)
2424
set(NWNX_BUILD_SHA ${SHORT_HASH})
2525
set(PLUGIN_PREFIX NWNX_)
2626

NWNXLib/API/API/CExoString.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ struct CExoString
9393
{
9494
return m_nStringLength;
9595
}
96-
void Insert(const CExoString & string, uint32_t position);
96+
void Insert(const CExoString & string, int32_t position);
9797
BOOL IsEmpty() const { return GetLength() == 0; }
98-
CExoString Left(uint32_t count) const;
98+
CExoString Left(int32_t count) const;
9999
CExoString LowerCase() const;
100-
CExoString Right(uint32_t count) const;
101-
CExoString SubString(uint32_t start, uint32_t count=~0) const;
100+
CExoString Right(int32_t count) const;
101+
CExoString SubString(int32_t start, int32_t count=-1) const;
102102
CExoString UpperCase() const;
103103
BOOL CompareNoCase(const CExoString & sString) const;
104104
BOOL ComparePrefixNoCase(const CExoString & sString, int32_t nSize) const;

NWNXLib/API/API/CNWCreatureStatsUpdate.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ struct CNWCreatureStatsUpdate
4545
char m_nFortSave;
4646
char m_nWillSave;
4747
char m_nReflexSave;
48-
char m_nNegativeLevels[3];
48+
char m_nNegativeLevels[8];
4949
int16_t m_nCurrentHP;
5050
int16_t m_nMaxHP;
5151
uint32_t m_nCurrentXP;

NWNXLib/API/API/CScriptCompiler.hpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,19 @@ typedef int BOOL;
3232

3333
// Removes any functions that cannot possibly be called by any codepath
3434
#define CSCRIPTCOMPILER_OPTIMIZE_DEAD_FUNCTIONS 0x00000001
35-
// Merges constant expressions into a single constant where possible.
36-
// Note: Only affects runtime expressions, assignments to const variables are always folded.
37-
#define CSCRIPTCOMPILER_OPTIMIZE_FOLD_CONSTANTS 0x00000002
3835
// Post processes generated instructions to merge sequences into shorter equivalents
39-
#define CSCRIPTCOMPILER_OPTIMIZE_MELD_INSTRUCTIONS 0x00000004
36+
#define CSCRIPTCOMPILER_OPTIMIZE_MELD_INSTRUCTIONS 0x00000002
37+
// Removes the jump and the dead branches in if (CONST) constructs
38+
#define CSCRIPTCOMPILER_OPTIMIZE_DEAD_BRANCHES 0x00000004
4039

40+
// Optimization groups - roughly corresponding to -O0, -O1, -O2, -O3. Each group includes the previous one.
41+
// Safe - Known good, used by the game and toolset
42+
// Aggressive - Probably good, used by the external compiler
43+
// Experimental - Untested or known to break something
4144
#define CSCRIPTCOMPILER_OPTIMIZE_NOTHING 0x00000000
42-
#define CSCRIPTCOMPILER_OPTIMIZE_EVERYTHING 0xFFFFFFFF
45+
#define CSCRIPTCOMPILER_OPTIMIZE_SAFE (CSCRIPTCOMPILER_OPTIMIZE_DEAD_FUNCTIONS)
46+
#define CSCRIPTCOMPILER_OPTIMIZE_AGGRESSIVE (CSCRIPTCOMPILER_OPTIMIZE_SAFE | CSCRIPTCOMPILER_OPTIMIZE_DEAD_BRANCHES)
47+
#define CSCRIPTCOMPILER_OPTIMIZE_EXPERIMENTAL (CSCRIPTCOMPILER_OPTIMIZE_AGGRESSIVE | CSCRIPTCOMPILER_OPTIMIZE_MELD_INSTRUCTIONS)
4348

4449
struct CScriptCompilerAPI
4550
{
@@ -297,7 +302,7 @@ struct CScriptCompiler
297302
int32_t GetStructureSize(const CExoString & sStructureName);
298303
int32_t GetIdentifierByName(const CExoString & sIdentifierName);
299304
int32_t AddToGlobalVariableList(CScriptParseTreeNode * pGlobalVariableNode);
300-
BOOL ConstantFoldNode(CScriptParseTreeNode *pNode, BOOL bForce = false);
305+
BOOL ConstantFoldNode(CScriptParseTreeNode *pNode);
301306
CScriptParseTreeNode *TrimParseTree(CScriptParseTreeNode *pNode);
302307
void InitializeSwitchLabelList();
303308
int32_t TraverseTreeForSwitchLabels(CScriptParseTreeNode * pNode);

NWNXLib/API/Constants/Messages.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,12 @@ namespace MessageMajor
6464
GuiEvent = 0x35,
6565
Device = 0x36,
6666
Nui = 0x37,
67+
SetShaderUniform = 0x38,
68+
TargetingData = 0x39,
69+
AudioStream = 0x40,
6770
};
6871
constexpr int32_t MIN = 0;
69-
constexpr int32_t MAX = 0x37;
72+
constexpr int32_t MAX = 0x40;
7073

7174
constexpr const char* ToString(const unsigned value)
7275
{
@@ -128,6 +131,9 @@ namespace MessageMajor
128131
"GuiEvent",
129132
"Device",
130133
"Nui",
134+
"SetShaderUniform",
135+
"TargetingData",
136+
"AudioStream",
131137
};
132138

133139
return (value > MAX) ? "(invalid)" : TYPE_STRINGS[value];

Plugins/Compiler/Compiler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static std::unique_ptr<CScriptCompiler> CreateAndConfigureCompiler(const CExoStr
153153
auto scriptCompiler = std::make_unique<CScriptCompiler>(Constants::ResRefType::NSS, Constants::ResRefType::NCS, Constants::ResRefType::NDB);
154154

155155
scriptCompiler->SetGenerateDebuggerOutput(Config::Get<int>("GENERATE_DEBUGGER_OUTPUT", 0));
156-
scriptCompiler->SetOptimizationFlags(Config::Get<uint32_t>("OPTIMIZATION_FLAGS", CSCRIPTCOMPILER_OPTIMIZE_EVERYTHING));
156+
scriptCompiler->SetOptimizationFlags(Config::Get<uint32_t>("OPTIMIZATION_FLAGS", CSCRIPTCOMPILER_OPTIMIZE_AGGRESSIVE));
157157
scriptCompiler->SetIdentifierSpecification("nwscript");
158158
scriptCompiler->SetCompileConditionalOrMain(true);
159159
scriptCompiler->SetCompileConditionalFile(true);

Plugins/Util/Util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ NWNX_EXPORT ArgumentStack AddScript(ArgumentStack&& args)
339339
{
340340
s_scriptCompiler = std::make_unique<CScriptCompiler>(Constants::ResRefType::NSS, Constants::ResRefType::NCS, Constants::ResRefType::NDB);
341341
s_scriptCompiler->SetGenerateDebuggerOutput(0);
342-
s_scriptCompiler->SetOptimizationFlags(CSCRIPTCOMPILER_OPTIMIZE_EVERYTHING);
342+
s_scriptCompiler->SetOptimizationFlags(CSCRIPTCOMPILER_OPTIMIZE_AGGRESSIVE);
343343
s_scriptCompiler->SetCompileConditionalOrMain(true);
344344
s_scriptCompiler->SetIdentifierSpecification("nwscript");
345345
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[![Discord](https://img.shields.io/discord/382306806866771978.svg?colorB=7289DA&label=Discord&logo=Discord&logoColor=7289DA&style=flat-square)](https://discord.gg/hxTt8Fr)
22

3-
# NWNX:EE (build 8193.37.15 - v89)
3+
# NWNX:EE (build 8193.37.17 - v89)
44

55
- Latest release: [build8193.37.13-HEAD](https://github.com/nwnxee/unified/releases/latest) - [Changelog](https://github.com/nwnxee/unified/blob/master/CHANGELOG.md#Unreleased)
66
- Docker tag: `nwnxee/unified:latest`
7-
- nwserver-linux md5: `745847640ed0821ca087f86c92bdef74`
7+
- nwserver-linux md5: `0fa8c362e21f38321ec8fb9f6d885949`
88

99
@mainpage
1010
@tableofcontents

0 commit comments

Comments
 (0)