Merge branch 'save_ext' into tracerestrict-sx
# Conflicts: # src/rail_gui.cpp # src/saveload/extended_ver_sl.cpp
This commit is contained in:
@@ -15,9 +15,13 @@
|
||||
* functions may still be available if you return an older API version
|
||||
* in GetAPIVersion() in info.nut.
|
||||
*
|
||||
* \b 1.7.0
|
||||
*
|
||||
* 1.7.0 is not yet released. The following changes are not set in stone yet.
|
||||
*
|
||||
* \b 1.6.0
|
||||
*
|
||||
* 1.6.0 is not yet released. The following changes are not set in stone yet.
|
||||
* No changes
|
||||
*
|
||||
* \b 1.5.3
|
||||
*
|
||||
|
||||
@@ -15,9 +15,13 @@
|
||||
* functions may still be available if you return an older API version
|
||||
* in GetAPIVersion() in info.nut.
|
||||
*
|
||||
* \b 1.7.0
|
||||
*
|
||||
* 1.7.0 is not yet released. The following changes are not set in stone yet.
|
||||
*
|
||||
* \b 1.6.0
|
||||
*
|
||||
* 1.6.0 is not yet released. The following changes are not set in stone yet.
|
||||
* No changes
|
||||
*
|
||||
* \b 1.5.3
|
||||
*
|
||||
|
||||
@@ -47,6 +47,9 @@ public:
|
||||
*/
|
||||
~ScriptExecMode();
|
||||
|
||||
/**
|
||||
* @api -all
|
||||
*/
|
||||
virtual void FinalRelease();
|
||||
};
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "script_list.hpp"
|
||||
#include "script_controller.hpp"
|
||||
#include "../../debug.h"
|
||||
#include "../../script/squirrel.hpp"
|
||||
|
||||
@@ -905,6 +906,16 @@ SQInteger ScriptList::Valuate(HSQUIRRELVM vm)
|
||||
}
|
||||
}
|
||||
|
||||
/* Kill the script when the valuator call takes way too long.
|
||||
* Triggered by nesting valuators, which then take billions of iterations. */
|
||||
if (ScriptController::GetOpsTillSuspend() < -1000000) {
|
||||
/* See below for explanation. The extra pop is the return value. */
|
||||
sq_pop(vm, nparam + 4);
|
||||
|
||||
ScriptObject::SetAllowDoCommand(backup_allow);
|
||||
return sq_throwerror(vm, "excessive CPU usage in valuator function");
|
||||
}
|
||||
|
||||
/* Was something changed? */
|
||||
if (previous_modification_count != this->modifications) {
|
||||
/* See below for explanation. The extra pop is the return value. */
|
||||
|
||||
@@ -49,6 +49,9 @@ public:
|
||||
*/
|
||||
~ScriptTestMode();
|
||||
|
||||
/**
|
||||
* @api -all
|
||||
*/
|
||||
virtual void FinalRelease();
|
||||
};
|
||||
|
||||
|
||||
@@ -124,7 +124,10 @@ public:
|
||||
ScriptText *AddParam(Object value);
|
||||
#endif /* DOXYGEN_API */
|
||||
|
||||
/* virtual */ const char *GetEncodedText();
|
||||
/**
|
||||
* @api -all
|
||||
*/
|
||||
virtual const char *GetEncodedText();
|
||||
|
||||
private:
|
||||
StringID string;
|
||||
|
||||
@@ -81,7 +81,6 @@ function reset_reader()
|
||||
struct_size = 0
|
||||
method_size = 0
|
||||
static_method_size = 0
|
||||
virtual_class = "false"
|
||||
cls = ""
|
||||
start_squirrel_define_on_next_line = "false"
|
||||
cls_level = 0
|
||||
@@ -97,7 +96,6 @@ BEGIN {
|
||||
struct_size = 0
|
||||
method_size = 0
|
||||
static_method_size = 0
|
||||
virtual_class = "false"
|
||||
super_cls = ""
|
||||
cls = ""
|
||||
api_selected = ""
|
||||
@@ -340,7 +338,7 @@ BEGIN {
|
||||
} else {
|
||||
print " SQ" api_cls ".PreRegister(engine, \"" api_super_cls "\");"
|
||||
}
|
||||
if (virtual_class == "false" && super_cls != "ScriptEvent") {
|
||||
if (super_cls != "ScriptEvent") {
|
||||
if (cls_param[2] == "v") {
|
||||
print " SQ" api_cls ".AddSQAdvancedConstructor(engine);"
|
||||
} else {
|
||||
@@ -409,22 +407,21 @@ BEGIN {
|
||||
}
|
||||
if (static_method_size != 0) print ""
|
||||
|
||||
if (virtual_class == "false") {
|
||||
# Non-static methods
|
||||
mlen = 0
|
||||
for (i = 1; i <= method_size; i++) {
|
||||
if (mlen <= length(methods[i, 0])) mlen = length(methods[i, 0])
|
||||
}
|
||||
for (i = 1; i <= method_size; i++) {
|
||||
if (methods[i, 2] == "v") {
|
||||
print " SQ" api_cls ".DefSQAdvancedMethod(engine, &" cls "::" methods[i, 0] ", " substr(spaces, 1, mlen - length(methods[i, 0]) - 8) "\"" methods[i, 0] "\");"
|
||||
} else {
|
||||
print " SQ" api_cls ".DefSQMethod(engine, &" cls "::" methods[i, 0] ", " substr(spaces, 1, mlen - length(methods[i, 0])) "\"" methods[i, 0] "\", " substr(spaces, 1, mlen - length(methods[i, 0])) "" methods[i, 1] ", \"" methods[i, 2] "\");"
|
||||
}
|
||||
delete methods[i]
|
||||
}
|
||||
if (method_size != 0) print ""
|
||||
# Non-static methods
|
||||
mlen = 0
|
||||
for (i = 1; i <= method_size; i++) {
|
||||
if (mlen <= length(methods[i, 0])) mlen = length(methods[i, 0])
|
||||
}
|
||||
for (i = 1; i <= method_size; i++) {
|
||||
if (methods[i, 2] == "v") {
|
||||
print " SQ" api_cls ".DefSQAdvancedMethod(engine, &" cls "::" methods[i, 0] ", " substr(spaces, 1, mlen - length(methods[i, 0]) - 8) "\"" methods[i, 0] "\");"
|
||||
} else {
|
||||
print " SQ" api_cls ".DefSQMethod(engine, &" cls "::" methods[i, 0] ", " substr(spaces, 1, mlen - length(methods[i, 0])) "\"" methods[i, 0] "\", " substr(spaces, 1, mlen - length(methods[i, 0])) "" methods[i, 1] ", \"" methods[i, 2] "\");"
|
||||
}
|
||||
delete methods[i]
|
||||
}
|
||||
if (method_size != 0) print ""
|
||||
|
||||
print " SQ" api_cls ".PostRegister(engine);"
|
||||
print "}"
|
||||
|
||||
@@ -489,9 +486,6 @@ BEGIN {
|
||||
}
|
||||
|
||||
is_static = match($0, "static")
|
||||
if (match($0, "virtual")) {
|
||||
virtual_class = "true"
|
||||
}
|
||||
gsub("\\yvirtual\\y", "", $0)
|
||||
gsub("\\ystatic\\y", "", $0)
|
||||
gsub("\\yconst\\y", "", $0)
|
||||
|
||||
Reference in New Issue
Block a user