1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-17 09:22:42 +01:00

(svn r27587) [1.6] -Backport from trunk:

- Fix: Use a more appropiate sound effect for convert-rail (r27547)
- Fix: Remove SetFill from vehicle GUI buttons, so that the viewport is resized instead of them in case of long window titles (r27546)
- Fix: [Script] Generation of API wrappers (r27545, r27544, r27543)
- Fix: [Windows] ICU got disabled for Windows builds, breaking RTL support [FS#6427] (r27542)
- Fix: [NewGRF] Station spritelayouts did not accept the var10 flag for the palette [FS#6435] (r27534)
This commit is contained in:
frosch
2016-05-29 18:52:56 +00:00
parent 235e714eee
commit df885ee66c
16 changed files with 69 additions and 66 deletions

View File

@@ -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)