Changeset - r24326:510409fb8c32
[Not reviewed]
master
! ! !
glx - 5 years ago 2019-03-12 14:37:57
glx@openttd.org
Change: rewrote squirrel_export in CMake
53 files changed:
Changeset was too big and was cut off... Show full diff anyway
0 comments (0 inline, 0 general)
cmake/scripts/SquirrelExport.cmake
Show inline comments
 
new file 100644
 
cmake_minimum_required(VERSION 3.5)
 

	
 
if (NOT SCRIPT_API_SOURCE_FILE)
 
    message(FATAL_ERROR "Script needs SCRIPT_API_SOURCE_FILE defined")
 
endif (NOT SCRIPT_API_SOURCE_FILE)
 
if (NOT SCRIPT_API_BINARY_FILE)
 
    message(FATAL_ERROR "Script needs SCRIPT_API_BINARY_FILE defined")
 
endif (NOT SCRIPT_API_BINARY_FILE)
 
if (NOT SCRIPT_API_FILE)
 
    message(FATAL_ERROR "Script needs SCRIPT_API_FILE defined")
 
endif (NOT SCRIPT_API_FILE)
 
if (NOT APIUC)
 
    message(FATAL_ERROR "Script needs APIUC defined")
 
endif (NOT APIUC)
 
if (NOT APILC)
 
    message(FATAL_ERROR "Script needs APILC defined")
 
endif (NOT APILC)
 

	
 
macro(dump_fileheader)
 
    get_filename_component(SCRIPT_API_FILE_NAME "${SCRIPT_API_FILE}" NAME)
 
    string(APPEND SQUIRREL_EXPORT "\n#include \"../${SCRIPT_API_FILE_NAME}\"")
 
    if (NOT "${APIUC}" STREQUAL "Template")
 
        string(REPLACE "script_" "template_" SCRIPT_API_FILE_NAME "${SCRIPT_API_FILE_NAME}")
 
        string(APPEND SQUIRREL_EXPORT "\n#include \"../template/${SCRIPT_API_FILE_NAME}.sq\"")
 
    endif (NOT "${APIUC}" STREQUAL "Template")
 
endmacro(dump_fileheader)
 

	
 
macro(dump_class_templates NAME)
 
    string(REGEX REPLACE "^Script" "" REALNAME ${NAME})
 

	
 
    string(APPEND SQUIRREL_EXPORT "\n	template <> inline ${NAME} *GetParam(ForceType<${NAME} *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (${NAME} *)instance; }")
 
    string(APPEND SQUIRREL_EXPORT "\n	template <> inline ${NAME} &GetParam(ForceType<${NAME} &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(${NAME} *)instance; }")
 
    string(APPEND SQUIRREL_EXPORT "\n	template <> inline const ${NAME} *GetParam(ForceType<const ${NAME} *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (${NAME} *)instance; }")
 
    string(APPEND SQUIRREL_EXPORT "\n	template <> inline const ${NAME} &GetParam(ForceType<const ${NAME} &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(${NAME} *)instance; }")
 
    if ("${NAME}" STREQUAL "ScriptEvent")
 
        string(APPEND SQUIRREL_EXPORT "\n	template <> inline int Return<${NAME} *>(HSQUIRRELVM vm, ${NAME} *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } Squirrel::CreateClassInstanceVM(vm, \"${REALNAME}\", res, nullptr, DefSQDestructorCallback<${NAME}>, true); return 1; }")
 
    elseif ("${NAME}" STREQUAL "ScriptText")
 
        string(APPEND SQUIRREL_EXPORT "\n")
 
        string(APPEND SQUIRREL_EXPORT "\n	template <> inline Text *GetParam(ForceType<Text *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) {")
 
        string(APPEND SQUIRREL_EXPORT "\n		if (sq_gettype(vm, index) == OT_INSTANCE) {")
 
        string(APPEND SQUIRREL_EXPORT "\n			return GetParam(ForceType<ScriptText *>(), vm, index, ptr);")
 
        string(APPEND SQUIRREL_EXPORT "\n		}")
 
        string(APPEND SQUIRREL_EXPORT "\n		if (sq_gettype(vm, index) == OT_STRING) {")
 
        string(APPEND SQUIRREL_EXPORT "\n			return new RawText(GetParam(ForceType<const char *>(), vm, index, ptr));")
 
        string(APPEND SQUIRREL_EXPORT "\n		}")
 
        string(APPEND SQUIRREL_EXPORT "\n		return nullptr;")
 
        string(APPEND SQUIRREL_EXPORT "\n	}")
 
    else ()
 
        string(APPEND SQUIRREL_EXPORT "\n	template <> inline int Return<${NAME} *>(HSQUIRRELVM vm, ${NAME} *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, \"${REALNAME}\", res, nullptr, DefSQDestructorCallback<${NAME}>, true); return 1; }")
 
    endif ()
 
endmacro(dump_class_templates)
 

	
 
macro(reset_reader)
 
    unset(ENUMS)
 
    unset(ENUM_VALUES)
 
    unset(CONST_VALUES)
 
    unset(STRUCTS)
 
    unset(ENUM_STRING_TO_ERRORS)
 
    unset(ENUM_ERROR_TO_STRINGS)
 
    unset(METHODS)
 
    unset(STATIC_METHODS)
 
    unset(CLS)
 
    unset(START_SQUIRREL_DEFINE_ON_NEXT_LINE)
 
    set(CLS_LEVEL 0)
 
    unset(CLS_IN_API)
 
endmacro(reset_reader)
 

	
 
reset_reader()
 

	
 
file(STRINGS "${SCRIPT_API_FILE}" SOURCE_LINES)
 

	
 
foreach(LINE IN LISTS SOURCE_LINES)
 
    # Ignore special doxygen blocks
 
    if ("${LINE}" MATCHES "^#ifndef DOXYGEN_API")
 
        set(DOXYGEN_SKIP "next")
 
        continue()
 
    endif ()
 
    if ("${LINE}" MATCHES "^#ifdef DOXYGEN_API")
 
        set(DOXYGEN_SKIP "true")
 
        continue()
 
    endif ()
 
    if ("${LINE}" MATCHES "^#endif /\\* DOXYGEN_API \\*/")
 
        unset(DOXYGEN_SKIP)
 
        continue()
 
    endif ()
 
    if ("${LINE}" MATCHES "^#else")
 
        if ("${DOXYGEN_SKIP}" STREQUAL "next")
 
            set(DOXYGEN_SKIP "true")
 
        else()
 
            unset(DOXYGEN_SKIP)
 
        endif()
 
        continue()
 
    endif ()
 
    if ("${DOXYGEN_SKIP}" STREQUAL "true")
 
        continue()
 
    endif()
 

	
 
    if ("${LINE}" MATCHES "^([	 ]*)\\* @api (.*)$")
 
        set(LINE ${CMAKE_MATCH_2})
 
        # By default, classes are not selected
 
        if (NOT CLS_LEVEL)
 
            set(API_SELECTED FALSE)
 
        endif (NOT CLS_LEVEL)
 

	
 
        if ("${APIUC}" STREQUAL "Template")
 
            set(API_SELECTED TRUE)
 
            if ("${LINE}" STREQUAL "none" OR "${LINE}" STREQUAL "-all")
 
                set(API_SELECTED FALSE)
 
            endif ("${LINE}" STREQUAL "none" OR "${LINE}" STREQUAL "-all")
 
            continue()
 
        endif("${APIUC}" STREQUAL "Template")
 

	
 
        if ("${LINE}" STREQUAL "none" OR "${LINE}" STREQUAL "-all")
 
            set(API_SELECTED FALSE)
 
        elseif ("${LINE}" MATCHES "-${APILC}")
 
            set(API_SELECTED FALSE)
 
        elseif ("${LINE}" MATCHES "${APILC}")
 
            set(API_SELECTED TRUE)
 
        endif ()
 
        continue()
 
    endif ("${LINE}" MATCHES "^([	 ]*)\\* @api (.*)$")
 

	
 
    # Remove the old squirrel stuff
 
    if ("${LINE}" MATCHES "#ifdef DEFINE_SQUIRREL_CLASS")
 
        set(SQUIRREL_STUFF TRUE)
 
        continue()
 
    endif ("${LINE}" MATCHES "#ifdef DEFINE_SQUIRREL_CLASS")
 
    if ("${LINE}" MATCHES "^#endif /\\* DEFINE_SQUIRREL_CLASS \\*/")
 
        unset(SQUIRREL_STUFF)
 
        continue()
 
    endif ("${LINE}" MATCHES "^#endif /\\* DEFINE_SQUIRREL_CLASS \\*/")
 
    if (SQUIRREL_STUFF)
 
        continue()
 
    endif (SQUIRREL_STUFF)
 

	
 
    # Ignore forward declarations of classes
 
    if ("${LINE}" MATCHES "^(	*)class(.*);")
 
        continue()
 
    endif ("${LINE}" MATCHES "^(	*)class(.*);")
 

	
 
    # We only want to have public functions exported for now
 
    if ("${LINE}" MATCHES "^(	*)class (.*) (: public|: protected|: private|:) ([^ ]*)")
 
        if (NOT CLS_LEVEL)
 
            if (NOT DEFINED API_SELECTED)
 
                message(WARNING "Class '${CMAKE_MATCH_2}' has no @api. It won't be published to any API.")
 
                set(API_SELECTED FALSE)
 
            endif (NOT DEFINED API_SELECTED)
 
            unset(IS_PUBLIC)
 
            unset(CLS_PARAM_0)
 
            set(CLS_PARAM_1 1)
 
            set(CLS_PARAM_2 "x")
 
            set(CLS_IN_API ${API_SELECTED})
 
            unset(API_SELECTED)
 
            set(CLS "${CMAKE_MATCH_2}")
 
            set(SUPER_CLS "${CMAKE_MATCH_4}")
 
        elseif (CLS_LEVEL EQUAL 1)
 
            if (NOT DEFINED API_SELECTED)
 
                set(API_SELECTED ${CLS_IN_API})
 
            endif (NOT API_SELECTED)
 

	
 
            if (API_SELECTED)
 
                list(APPEND STRUCTS "${CLS}::${CMAKE_MATCH_2}")
 
            endif (API_SELECTED)
 
            unset(API_SELECTED)
 
        endif ()
 
        math(EXPR CLS_LEVEL "${CLS_LEVEL} + 1")
 
        continue()
 
    endif ("${LINE}" MATCHES "^(	*)class (.*) (: public|: protected|: private|:) ([^ ]*)")
 
    if ("${LINE}" MATCHES "^(	*)public")
 
        if (CLS_LEVEL EQUAL 1)
 
            set(IS_PUBLIC TRUE)
 
        endif (CLS_LEVEL EQUAL 1)
 
        continue()
 
    endif ("${LINE}" MATCHES "^(	*)public")
 
    if ("${LINE}" MATCHES "^(	*)protected")
 
        if (CLS_LEVEL EQUAL 1)
 
            unset(IS_PUBLIC)
 
        endif (CLS_LEVEL EQUAL 1)
 
        continue()
 
    endif ("${LINE}" MATCHES "^(	*)protected")
 
    if ("${LINE}" MATCHES "^(	*)private")
 
        if (CLS_LEVEL EQUAL 1)
 
            unset(IS_PUBLIC)
 
        endif (CLS_LEVEL EQUAL 1)
 
        continue()
 
    endif ("${LINE}" MATCHES "^(	*)private")
 

	
 
    # Ignore the comments
 
    if ("${LINE}" MATCHES "^#")
 
        continue()
 
    endif ("${LINE}" MATCHES "^#")
 
    if ("${LINE}" MATCHES "/\\*.*\\*/")
 
        unset(COMMENT)
 
        continue()
 
    endif ("${LINE}" MATCHES "/\\*.*\\*/")
 
    if ("${LINE}" MATCHES "/\\*")
 
        set(COMMENT TRUE)
 
        continue()
 
    endif ("${LINE}" MATCHES "/\\*")
 
    if ("${LINE}" MATCHES "\\*/")
 
        unset(COMMENT)
 
        continue()
 
    endif ("${LINE}" MATCHES "\\*/")
 
    if (COMMENT)
 
        continue()
 
    endif (COMMENT)
 

	
 
    # We need to make specialized conversions for structs
 
    if ("${LINE}" MATCHES "^(	*)struct ([^ ]*)")
 
        math(EXPR CLS_LEVEL "${CLS_LEVEL} + 1")
 

	
 
        # Check if we want to publish this struct
 
        if (NOT DEFINED API_SELECTED)
 
            set(API_SELECTED ${CLS_IN_API})
 
        endif (NOT DEFINED API_SELECTED)
 
        if (NOT API_SELECTED)
 
            unset(API_SELECTED)
 
            continue()
 
        endif (NOT API_SELECTED)
 
        unset(API_SELECTED)
 

	
 
        if (NOT IS_PUBLIC OR NOT CLS_LEVEL EQUAL 1)
 
            continue()
 
        endif (NOT IS_PUBLIC OR NOT CLS_LEVEL EQUAL 1)
 

	
 
        list(APPEND STRUCTS "${CLS}::${CMAKE_MATCH_2}")
 
        continue()
 
    endif ("${LINE}" MATCHES "^(	*)struct ([^ ]*)")
 

	
 
    # We need to make specialized conversions for enums
 
    if ("${LINE}" MATCHES "^(	*)enum ([^ ]*)")
 
        math(EXPR CLS_LEVEL "${CLS_LEVEL} + 1")
 

	
 
        # Check if we want to publish this enum
 
        if (NOT DEFINED API_SELECTED)
 
            set(API_SELECTED ${CLS_IN_API})
 
        endif (NOT DEFINED API_SELECTED)
 
        if (NOT API_SELECTED)
 
            unset(API_SELECTED)
 
            continue()
 
        endif (NOT API_SELECTED)
 
        unset(API_SELECTED)
 

	
 
        if (NOT IS_PUBLIC)
 
            continue()
 
        endif (NOT IS_PUBLIC)
 

	
 
        set(IN_ENUM TRUE)
 
        list(APPEND ENUMS "${CLS}::${CMAKE_MATCH_2}")
 
        continue()
 
    endif ("${LINE}" MATCHES "^(	*)enum ([^ ]*)")
 

	
 
    # Maybe the end of the class, if so we can start with the Squirrel export pretty soon
 
    if ("${LINE}" MATCHES "};")
 
        math(EXPR CLS_LEVEL "${CLS_LEVEL} - 1")
 
        if (CLS_LEVEL)
 
            unset(IN_ENUM)
 
            continue()
 
        endif (CLS_LEVEL)
 

	
 
        if (CLS)
 
            set(START_SQUIRREL_DEFINE_ON_NEXT_LINE TRUE)
 
        endif (CLS)
 
        continue()
 
    endif ("${LINE}" MATCHES "};")
 

	
 
    # Empty/white lines. When we may do the Squirrel export, do that export.
 
    if ("${LINE}" MATCHES "^([ 	]*)$")
 
        if (NOT START_SQUIRREL_DEFINE_ON_NEXT_LINE)
 
            continue()
 
        endif (NOT START_SQUIRREL_DEFINE_ON_NEXT_LINE)
 

	
 
        if (NOT CLS_IN_API)
 
            reset_reader()
 
            continue()
 
        endif (NOT CLS_IN_API)
 

	
 
        if (NOT HAS_FILEHEADER)
 
            dump_fileheader()
 
            set(HAS_FILEHEADER TRUE)
 
        endif (NOT HAS_FILEHEADER)
 

	
 
        unset(IS_PUBLIC)
 
        unset(NAMESPACE_OPENED)
 

	
 
        string(REGEX REPLACE "^Script" "${APIUC}" API_CLS "${CLS}")
 
        string(REGEX REPLACE "^Script" "${APIUC}" API_SUPER_CLS "${SUPER_CLS}")
 

	
 
        string(APPEND SQUIRREL_EXPORT "\n")
 

	
 
        if ("${APIUC}" STREQUAL "Template")
 
            # First check whether we have enums to print
 
            if (DEFINED ENUMS)
 
                if (NOT NAMESPACE_OPENED)
 
                    string(APPEND SQUIRREL_EXPORT "\nnamespace SQConvert {")
 
                    set(NAMESPACE_OPENED TRUE)
 
                endif (NOT NAMESPACE_OPENED)
 
                string(APPEND SQUIRREL_EXPORT "\n	/* Allow enums to be used as Squirrel parameters */")
 
                foreach(ENUM IN LISTS ENUMS)
 
                    string(APPEND SQUIRREL_EXPORT "\n	template <> inline ${ENUM} GetParam(ForceType<${ENUM}>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (${ENUM})tmp; }")
 
                    string(APPEND SQUIRREL_EXPORT "\n	template <> inline int Return<${ENUM}>(HSQUIRRELVM vm, ${ENUM} res) { sq_pushinteger(vm, (int32)res); return 1; }")
 
                endforeach(ENUM)
 
            endif (DEFINED ENUMS)
 

	
 
            # Then check whether we have structs/classes to print
 
            if (DEFINED STRUCTS)
 
                if (NOT NAMESPACE_OPENED)
 
                    string(APPEND SQUIRREL_EXPORT "\nnamespace SQConvert {")
 
                    set(NAMESPACE_OPENED TRUE)
 
                endif (NOT NAMESPACE_OPENED)
 
                string(APPEND SQUIRREL_EXPORT "\n	/* Allow inner classes/structs to be used as Squirrel parameters */")
 
                foreach(STRUCT IN LISTS STRUCTS)
 
                    dump_class_templates(${STRUCT})
 
                endforeach(STRUCT)
 
            endif (DEFINED STRUCTS)
 

	
 
            if (NOT NAMESPACE_OPENED)
 
                string(APPEND SQUIRREL_EXPORT "\nnamespace SQConvert {")
 
                set(NAMESPACE_OPENED TRUE)
 
            else (NOT NAMESPACE_OPENED)
 
                string(APPEND SQUIRREL_EXPORT "\n")
 
            endif (NOT NAMESPACE_OPENED)
 
            string(APPEND SQUIRREL_EXPORT "\n	/* Allow ${CLS} to be used as Squirrel parameter */")
 
            dump_class_templates(${CLS})
 

	
 
            string(APPEND SQUIRREL_EXPORT "\n} // namespace SQConvert")
 

	
 
            reset_reader()
 
            continue()
 
        endif ("${APIUC}" STREQUAL "Template")
 

	
 
        string(APPEND SQUIRREL_EXPORT "\n")
 
        string(APPEND SQUIRREL_EXPORT "\ntemplate <> const char *GetClassName<${CLS}, ST_${APIUC}>() { return \"${API_CLS}\"; }")
 
        string(APPEND SQUIRREL_EXPORT "\n")
 

	
 
        # Then do the registration functions of the class.
 
        string(APPEND SQUIRREL_EXPORT "\nvoid SQ${API_CLS}_Register(Squirrel *engine)")
 
        string(APPEND SQUIRREL_EXPORT "\n{")
 
        string(APPEND SQUIRREL_EXPORT "\n	DefSQClass<${CLS}, ST_${APIUC}> SQ${API_CLS}(\"${API_CLS}\");")
 
        if ("${SUPER_CLS}" STREQUAL "Text" OR "${SUPER_CLS}" STREQUAL "ScriptObject" OR "${SUPER_CLS}" STREQUAL "AIAbstractiveList::Valuator")
 
            string(APPEND SQUIRREL_EXPORT "\n	SQ${API_CLS}.PreRegister(engine);")
 
        else ("${SUPER_CLS}" STREQUAL "Text" OR "${SUPER_CLS}" STREQUAL "ScriptObject" OR "${SUPER_CLS}" STREQUAL "AIAbstractiveList::Valuator")
 
            string(APPEND SQUIRREL_EXPORT "\n	SQ${API_CLS}.PreRegister(engine, \"${API_SUPER_CLS}\");")
 
        endif ("${SUPER_CLS}" STREQUAL "Text" OR "${SUPER_CLS}" STREQUAL "ScriptObject" OR "${SUPER_CLS}" STREQUAL "AIAbstractiveList::Valuator")
 
        if (NOT "${SUPER_CLS}" STREQUAL "ScriptEvent")
 
            if ("${CLS_PARAM_2}" STREQUAL "v")
 
                string(APPEND SQUIRREL_EXPORT "\n	SQ${API_CLS}.AddSQAdvancedConstructor(engine);")
 
            else ("${CLS_PARAM_2}" STREQUAL "v")
 
                string(APPEND SQUIRREL_EXPORT "\n	SQ${API_CLS}.AddConstructor<void (${CLS}::*)(${CLS_PARAM_0}), ${CLS_PARAM_1}>(engine, \"${CLS_PARAM_2}\");")
 
            endif ("${CLS_PARAM_2}" STREQUAL "v")
 
        endif (NOT "${SUPER_CLS}" STREQUAL "ScriptEvent")
 
        string(APPEND SQUIRREL_EXPORT "\n")
 

	
 
        # Enum values
 
        set(MLEN 0)
 
        foreach(ENUM_VALUE IN LISTS ENUM_VALUES)
 
            string(LENGTH "${ENUM_VALUE}" LEN)
 
            if (MLEN LESS LEN)
 
                set(MLEN ${LEN})
 
            endif (MLEN LESS LEN)
 
        endforeach(ENUM_VALUE)
 
        foreach(ENUM_VALUE IN LISTS ENUM_VALUES)
 
            string(LENGTH "${ENUM_VALUE}" LEN)
 
            math(EXPR LEN "${MLEN} - ${LEN}")
 
            unset(SPACES)
 
            foreach(i RANGE ${LEN})
 
                string(APPEND SPACES " ")
 
            endforeach(i)
 
            string(APPEND SQUIRREL_EXPORT "\n	SQ${API_CLS}.DefSQConst(engine, ${CLS}::${ENUM_VALUE},${SPACES}\"${ENUM_VALUE}\");")
 
        endforeach(ENUM_VALUE)
 
        if (MLEN)
 
            string(APPEND SQUIRREL_EXPORT "\n")
 
        endif (MLEN)
 

	
 
        # Const values
 
        set(MLEN 0)
 
        foreach(CONST_VALUE IN LISTS CONST_VALUES)
 
            string(LENGTH "${CONST_VALUE}" LEN)
 
            if (MLEN LESS LEN)
 
                set(MLEN ${LEN})
 
            endif (MLEN LESS LEN)
 
        endforeach(CONST_VALUE)
 
        foreach(CONST_VALUE IN LISTS CONST_VALUES)
 
            string(LENGTH "${CONST_VALUE}" LEN)
 
            math(EXPR LEN "${MLEN} - ${LEN}")
 
            unset(SPACES)
 
            foreach(i RANGE ${LEN})
 
                string(APPEND SPACES " ")
 
            endforeach(i)
 
            string(APPEND SQUIRREL_EXPORT "\n	SQ${API_CLS}.DefSQConst(engine, ${CLS}::${CONST_VALUE},${SPACES}\"${CONST_VALUE}\");")
 
        endforeach(CONST_VALUE)
 
        if (MLEN)
 
            string(APPEND SQUIRREL_EXPORT "\n")
 
        endif (MLEN)
 

	
 
        # Mapping of OTTD strings to errors
 
        set(MLEN 0)
 
        foreach(ENUM_STRING_TO_ERROR IN LISTS ENUM_STRING_TO_ERRORS)
 
            string(REPLACE ":" ";" ENUM_STRING_TO_ERROR "${ENUM_STRING_TO_ERROR}")
 
            list(GET ENUM_STRING_TO_ERROR 0 ENUM_STRING)
 
            string(LENGTH "${ENUM_STRING}" LEN)
 
            if (MLEN LESS LEN)
 
                set(MLEN ${LEN})
 
            endif (MLEN LESS LEN)
 
        endforeach(ENUM_STRING_TO_ERROR)
 
        foreach(ENUM_STRING_TO_ERROR IN LISTS ENUM_STRING_TO_ERRORS)
 
            string(REPLACE ":" ";" ENUM_STRING_TO_ERROR "${ENUM_STRING_TO_ERROR}")
 
            list(GET ENUM_STRING_TO_ERROR 0 ENUM_STRING)
 
            list(GET ENUM_STRING_TO_ERROR 1 ENUM_ERROR)
 
            string(LENGTH "${ENUM_STRING}" LEN)
 
            math(EXPR LEN "${MLEN} - ${LEN}")
 
            unset(SPACES)
 
            foreach(i RANGE ${LEN})
 
                string(APPEND SPACES " ")
 
            endforeach(i)
 
            string(APPEND SQUIRREL_EXPORT "\n	ScriptError::RegisterErrorMap(${ENUM_STRING},${SPACES}${CLS}::${ENUM_ERROR});")
 
        endforeach(ENUM_STRING_TO_ERROR)
 
        if (MLEN)
 
            string(APPEND SQUIRREL_EXPORT "\n")
 
        endif (MLEN)
 

	
 
        # Mapping of errors to human 'readable' strings.
 
        set(MLEN 0)
 
        foreach(ENUM_ERROR_TO_STRING IN LISTS ENUM_ERROR_TO_STRINGS)
 
            string(LENGTH "${ENUM_ERROR_TO_STRING}" LEN)
 
            if (MLEN LESS LEN)
 
                set(MLEN ${LEN})
 
            endif (MLEN LESS LEN)
 
        endforeach(ENUM_ERROR_TO_STRING)
 
        foreach(ENUM_ERROR_TO_STRING IN LISTS ENUM_ERROR_TO_STRINGS)
 
            string(LENGTH "${ENUM_ERROR_TO_STRING}" LEN)
 
            math(EXPR LEN "${MLEN} - ${LEN}")
 
            unset(SPACES)
 
            foreach(i RANGE ${LEN})
 
                string(APPEND SPACES " ")
 
            endforeach(i)
 
            string(APPEND SQUIRREL_EXPORT "\n	ScriptError::RegisterErrorMapString(${CLS}::${ENUM_ERROR_TO_STRING},${SPACES}\"${ENUM_ERROR_TO_STRING}\");")
 
        endforeach(ENUM_ERROR_TO_STRING)
 
        if (MLEN)
 
            string(APPEND SQUIRREL_EXPORT "\n")
 
        endif (MLEN)
 

	
 
        # Static methods
 
        set(MLEN 0)
 
        foreach(STATIC_METHOD IN LISTS STATIC_METHODS)
 
            string(REPLACE ":" ";" STATIC_METHOD "${STATIC_METHOD}")
 
            list(GET STATIC_METHOD 0 FUNCNAME)
 
            string(LENGTH "${FUNCNAME}" LEN)
 
            if (MLEN LESS LEN)
 
                set(MLEN ${LEN})
 
            endif (MLEN LESS LEN)
 
        endforeach(STATIC_METHOD)
 
        foreach(STATIC_METHOD IN LISTS STATIC_METHODS)
 
            string(REPLACE ":" ";" STATIC_METHOD "${STATIC_METHOD}")
 
            list(GET STATIC_METHOD 0 FUNCNAME)
 
            list(GET STATIC_METHOD 1 ARGC)
 
            list(GET STATIC_METHOD 2 TYPES)
 
            string(LENGTH "${FUNCNAME}" LEN)
 
            math(EXPR LEN "${MLEN} - ${LEN}")
 
            if ("${TYPES}" STREQUAL "v")
 
                if (LEN GREATER 8)
 
                    math(EXPR LEN "${LEN} - 8")
 
                else (LEN GREATER 8)
 
                    set(LEN 0)
 
                endif (LEN GREATER 8)
 
            endif ("${TYPES}" STREQUAL "v")
 
            unset(SPACES)
 
            foreach(i RANGE ${LEN})
 
                string(APPEND SPACES " ")
 
            endforeach(i)
 
            if ("${TYPES}" STREQUAL "v")
 
                string(APPEND SQUIRREL_EXPORT "\n	SQ${API_CLS}.DefSQAdvancedStaticMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\");")
 
            else ("${TYPES}" STREQUAL "v")
 
                string(APPEND SQUIRREL_EXPORT "\n	SQ${API_CLS}.DefSQStaticMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\",${SPACES}${ARGC}, \"${TYPES}\");")
 
            endif ("${TYPES}" STREQUAL "v")
 
        endforeach(STATIC_METHOD)
 
        if (MLEN)
 
            string(APPEND SQUIRREL_EXPORT "\n")
 
        endif (MLEN)
 

	
 
        # Non-static methods
 
        set(MLEN 0)
 
        foreach(METHOD IN LISTS METHODS)
 
            string(REPLACE ":" ";" METHOD "${METHOD}")
 
            list(GET METHOD 0 FUNCNAME)
 
            string(LENGTH "${FUNCNAME}" LEN)
 
            if (MLEN LESS LEN)
 
                set(MLEN ${LEN})
 
            endif (MLEN LESS LEN)
 
        endforeach(METHOD)
 
        foreach(METHOD IN LISTS METHODS)
 
            string(REPLACE ":" ";" METHOD "${METHOD}")
 
            list(GET METHOD 0 FUNCNAME)
 
            list(GET METHOD 1 ARGC)
 
            list(GET METHOD 2 TYPES)
 
            string(LENGTH "${FUNCNAME}" LEN)
 
            math(EXPR LEN "${MLEN} - ${LEN}")
 
            if ("${TYPES}" STREQUAL "v")
 
                if (LEN GREATER 8)
 
                    math(EXPR LEN "${LEN} - 8")
 
                else (LEN GREATER 8)
 
                    set(LEN 0)
 
                endif (LEN GREATER 8)
 
            endif ("${TYPES}" STREQUAL "v")
 
            unset(SPACES)
 
            foreach(i RANGE ${LEN})
 
                string(APPEND SPACES " ")
 
            endforeach(i)
 
            if ("${TYPES}" STREQUAL "v")
 
                string(APPEND SQUIRREL_EXPORT "\n	SQ${API_CLS}.DefSQAdvancedMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\");")
 
            else ("${TYPES}" STREQUAL "v")
 
                string(APPEND SQUIRREL_EXPORT "\n	SQ${API_CLS}.DefSQMethod(engine, &${CLS}::${FUNCNAME},${SPACES}\"${FUNCNAME}\",${SPACES}${ARGC}, \"${TYPES}\");")
 
            endif ("${TYPES}" STREQUAL "v")
 
        endforeach(METHOD)
 
        if (MLEN)
 
            string(APPEND SQUIRREL_EXPORT "\n")
 
        endif (MLEN)
 

	
 
        string(APPEND SQUIRREL_EXPORT "\n	SQ${API_CLS}.PostRegister(engine);")
 
        string(APPEND SQUIRREL_EXPORT "\n}")
 

	
 
        reset_reader()
 

	
 
        continue()
 
    endif ("${LINE}" MATCHES "^([ 	]*)$")
 

	
 
    # Skip non-public functions
 
    if (NOT IS_PUBLIC)
 
        continue()
 
    endif (NOT IS_PUBLIC)
 

	
 
    # Add enums
 
    if (IN_ENUM)
 
        string(REGEX MATCH "([^,	 ]+)" ENUM_VALUE "${LINE}")
 
        list(APPEND ENUM_VALUES "${ENUM_VALUE}")
 

	
 
        # Check if this a special error enum
 
        list(GET ENUMS -1 ENUM)
 
        if ("${ENUM}" MATCHES ".*::ErrorMessages")
 
            # syntax:
 
            # enum ErrorMessages {
 
            #	ERR_SOME_ERROR,	// [STR_ITEM1, STR_ITEM2, ...]
 
            # }
 

	
 
            # Set the mappings
 
            if ("${LINE}" MATCHES "\\[(.*)\\]")
 
                string(REGEX REPLACE "[ 	]" "" MAPPINGS "${CMAKE_MATCH_1}")
 
                string(REPLACE "," ";" MAPPINGS "${MAPPINGS}")
 

	
 
                foreach(MAPPING IN LISTS MAPPINGS)
 
                    list(APPEND ENUM_STRING_TO_ERRORS "${MAPPING}:${ENUM_VALUE}")
 
                endforeach(MAPPING)
 

	
 
                list(APPEND ENUM_ERROR_TO_STRINGS "${ENUM_VALUE}")
 
            endif ("${LINE}" MATCHES "\\[(.*)\\]")
 
        endif ("${ENUM}" MATCHES ".*::ErrorMessages")
 
        continue()
 
    endif (IN_ENUM)
 

	
 
    # Add a const (non-enum) value
 
    if ("${LINE}" MATCHES "^[ 	]*static const [^ ]+ ([^ ]+) = -?\\(?[^ ]*\\)?[^ ]+;")
 
        list(APPEND CONST_VALUES "${CMAKE_MATCH_1}")
 
        continue()
 
    endif ("${LINE}" MATCHES "^[ 	]*static const [^ ]+ ([^ ]+) = -?\\(?[^ ]*\\)?[^ ]+;")
 

	
 
    # Add a method to the list
 
    if ("${LINE}" MATCHES "^.*\\(.*\\).*$")
 
        if (NOT CLS_LEVEL EQUAL 1)
 
            continue()
 
        endif (NOT CLS_LEVEL EQUAL 1)
 
        if ("${LINE}" MATCHES "~")
 
            if (DEFINED API_SELECTED)
 
                message(WARNING "Destructor for '${CLS}' has @api. Tag ignored.")
 
                unset(API_SELECTED)
 
            endif (DEFINED API_SELECTED)
 
            continue()
 
        endif ("${LINE}" MATCHES "~")
 

	
 
        unset(IS_STATIC)
 
        if ("${LINE}" MATCHES "static")
 
            set(IS_STATIC TRUE)
 
        endif ("${LINE}" MATCHES "static")
 

	
 
        string(REGEX REPLACE "(virtual|static|const)[ 	]+" "" LINE "${LINE}")
 
        string(REGEX REPLACE "{.*" "" LINE "${LINE}")
 
        set(PARAM_S "${LINE}")
 
        string(REGEX REPLACE "\\*" "" LINE "${LINE}")
 
        string(REGEX REPLACE "\\(.*" "" LINE "${LINE}")
 

	
 
        string(REGEX REPLACE ".*\\(" "" PARAM_S "${PARAM_S}")
 
        string(REGEX REPLACE "\\).*" "" PARAM_S "${PARAM_S}")
 

	
 
        string(REGEX MATCH "([^ 	]+)( ([^ ]+))?" RESULT "${LINE}")
 
        set(FUNCTYPE "${CMAKE_MATCH_1}")
 
        set(FUNCNAME "${CMAKE_MATCH_3}")
 
        if ("${FUNCTYPE}" STREQUAL "${CLS}" AND NOT FUNCNAME)
 
            if (DEFINED API_SELECTED)
 
                message(WARNING "Constructor for '${CLS}' has @api. Tag ignored.")
 
                unset(API_SELECTED)
 
            endif (DEFINED API_SELECTED)
 
            set(CLS_PARAM_0 "${PARAM_S}")
 
            if (NOT PARAM_S)
 
                continue()
 
            endif (NOT PARAM_S)
 
        elseif (NOT FUNCNAME)
 
            continue()
 
		endif ()
 

	
 
        string(REPLACE "," ";" PARAMS "${PARAM_S}")
 
        if (IS_STATIC)
 
            set(TYPES ".")
 
        else (IS_STATIC)
 
            set(TYPES "x")
 
        endif (IS_STATIC)
 

	
 
        set(LEN 1)
 
        foreach(PARAM IN LISTS PARAMS)
 
            math(EXPR LEN "${LEN} + 1")
 
            string(STRIP "${PARAM}" PARAM)
 
            if ("${PARAM}" MATCHES "\\*|&")
 
                if ("${PARAM}" MATCHES "^char")
 
                    # Many types can be converted to string, so use '.', not 's'. (handled by our glue code)
 
                    string(APPEND TYPES ".")
 
                elseif ("${PARAM}" MATCHES "^void")
 
                    string(APPEND TYPES "p")
 
                elseif ("${PARAM}" MATCHES "^Array")
 
                    string(APPEND TYPES "a")
 
                elseif ("${PARAM}" MATCHES "^struct Array")
 
                    string(APPEND TYPES "a")
 
                elseif ("${PARAM}" MATCHES "^Text")
 
                    string(APPEND TYPES ".")
 
                else ()
 
                    string(APPEND TYPES "x")
 
                endif ()
 
            elseif ("${PARAM}" MATCHES "^bool")
 
                string(APPEND TYPES "b")
 
            elseif ("${PARAM}" MATCHES "^HSQUIRRELVM")
 
                set(TYPES "v")
 
            else ()
 
                string(APPEND TYPES "i")
 
            endif ()
 
        endforeach(PARAM)
 

	
 
        # Check if we want to publish this function
 
        if (NOT DEFINED API_SELECTED)
 
            set(API_SELECTED ${CLS_IN_API})
 
        endif (NOT DEFINED API_SELECTED)
 
        if (NOT API_SELECTED)
 
            unset(API_SELECTED)
 
            continue()
 
        endif (NOT API_SELECTED)
 
        unset(API_SELECTED)
 

	
 
        if ("${FUNCTYPE}" STREQUAL "${CLS}" AND NOT FUNCNAME)
 
            set(CLS_PARAM_1 ${LEN})
 
            set(CLS_PARAM_2 "${TYPES}")
 
        elseif ("${FUNCNAME}" MATCHES "^_" AND NOT "${TYPES}" STREQUAL "v")
 
        elseif (IS_STATIC)
 
            list(APPEND STATIC_METHODS "${FUNCNAME}:${LEN}:${TYPES}")
 
        else ()
 
            list(APPEND METHODS "${FUNCNAME}:${LEN}:${TYPES}")
 
        endif ()
 
        continue()
 
    endif ("${LINE}" MATCHES "^.*\\(.*\\).*$")
 
endforeach(LINE)
 

	
 
configure_file(${SCRIPT_API_SOURCE_FILE} ${SCRIPT_API_BINARY_FILE})
cmake/scripts/SquirrelIncludes.cmake
Show inline comments
 
new file 100644
 
cmake_minimum_required(VERSION 3.5)
 

	
 
if (NOT INCLUDES_SOURCE_FILE)
 
    message(FATAL_ERROR "Script needs INCLUDES_SOURCE_FILE defined")
 
endif (NOT INCLUDES_SOURCE_FILE)
 
if (NOT INCLUDES_BINARY_FILE)
 
    message(FATAL_ERROR "Script needs INCLUDES_BINARY_FILE defined")
 
endif (NOT INCLUDES_BINARY_FILE)
 
if (NOT APILC)
 
    message(FATAL_ERROR "Script needs APILC defined")
 
endif (NOT APILC)
 
if (NOT APIUC)
 
    message(FATAL_ERROR "Script needs APIUC defined")
 
endif (NOT APIUC)
 

	
 
set(ARGC 1)
 
set(ARG_READ NO)
 

	
 
# Read all the arguments given to CMake; we are looking for -- and everything
 
# that follows. Those are our api files.
 
while(ARGC LESS CMAKE_ARGC)
 
    set(ARG ${CMAKE_ARGV${ARGC}})
 

	
 
    if (ARG_READ)
 
        list(APPEND SCRIPT_API_BINARY_FILES "${ARG}")
 
    endif (ARG_READ)
 

	
 
    if (ARG STREQUAL "--")
 
        set(ARG_READ YES)
 
    endif (ARG STREQUAL "--")
 

	
 
    math(EXPR ARGC "${ARGC} + 1")
 
endwhile()
 

	
 
foreach(FILE IN LISTS SCRIPT_API_BINARY_FILES)
 
    file(STRINGS "${FILE}" LINES REGEX "^void SQ${APIUC}.*_Register\\(Squirrel \\*engine\\)$")
 
    if (LINES)
 
        string(REGEX REPLACE ".*api/${APILC}/(.*)" "#include \"\\1\"" FILE "${FILE}")
 
        list(APPEND SQUIRREL_INCLUDES "${FILE}")
 
        foreach(LINE IN LISTS LINES)
 
            if ("${LINE}" MATCHES "SQ${APIUC}(List|Controller)_Register")
 
                continue()
 
            endif ("${LINE}" MATCHES "SQ${APIUC}(List|Controller)_Register")
 
            string(REGEX REPLACE "^.*void " "	" LINE "${LINE}")
 
            string(REGEX REPLACE "Squirrel \\*" "" LINE "${LINE}")
 
            list(APPEND SQUIRREL_REGISTER "${LINE}")
 
        endforeach(LINE)
 
    endif (LINES)
 
endforeach(FILE)
 

	
 
list(SORT SQUIRREL_INCLUDES)
 
string(REPLACE ";" "\n" SQUIRREL_INCLUDES "${SQUIRREL_INCLUDES}")
 

	
 
string(REGEX REPLACE "_Register" "0000Register" SQUIRREL_REGISTER "${SQUIRREL_REGISTER}")
 
list(SORT SQUIRREL_REGISTER)
 
string(REGEX REPLACE "0000Register" "_Register" SQUIRREL_REGISTER "${SQUIRREL_REGISTER}")
 
string(REPLACE ";" ";\n" SQUIRREL_REGISTER "${SQUIRREL_REGISTER}")
 
set(SQUIRREL_REGISTER "	SQ${APIUC}List_Register(engine);\n${SQUIRREL_REGISTER};")
 

	
 
configure_file(${INCLUDES_SOURCE_FILE} ${INCLUDES_BINARY_FILE})
src/ai/ai_instance.cpp
Show inline comments
 
@@ -24,60 +24,8 @@
 
/* Manually include the Text glue. */
 
#include "../script/api/template/template_text.hpp.sq"
 

	
 
/* Convert all AI related classes to Squirrel data.
 
 * Note: this line is a marker in squirrel_export.sh. Do not change! */
 
#include "../script/api/ai/ai_accounting.hpp.sq"
 
#include "../script/api/ai/ai_airport.hpp.sq"
 
#include "../script/api/ai/ai_base.hpp.sq"
 
#include "../script/api/ai/ai_basestation.hpp.sq"
 
#include "../script/api/ai/ai_bridge.hpp.sq"
 
#include "../script/api/ai/ai_bridgelist.hpp.sq"
 
#include "../script/api/ai/ai_cargo.hpp.sq"
 
#include "../script/api/ai/ai_cargolist.hpp.sq"
 
#include "../script/api/ai/ai_company.hpp.sq"
 
#include "../script/api/ai/ai_controller.hpp.sq"
 
#include "../script/api/ai/ai_date.hpp.sq"
 
#include "../script/api/ai/ai_depotlist.hpp.sq"
 
#include "../script/api/ai/ai_engine.hpp.sq"
 
#include "../script/api/ai/ai_enginelist.hpp.sq"
 
#include "../script/api/ai/ai_error.hpp.sq"
 
#include "../script/api/ai/ai_event.hpp.sq"
 
#include "../script/api/ai/ai_event_types.hpp.sq"
 
#include "../script/api/ai/ai_execmode.hpp.sq"
 
#include "../script/api/ai/ai_gamesettings.hpp.sq"
 
#include "../script/api/ai/ai_group.hpp.sq"
 
#include "../script/api/ai/ai_grouplist.hpp.sq"
 
#include "../script/api/ai/ai_industry.hpp.sq"
 
#include "../script/api/ai/ai_industrylist.hpp.sq"
 
#include "../script/api/ai/ai_industrytype.hpp.sq"
 
#include "../script/api/ai/ai_industrytypelist.hpp.sq"
 
#include "../script/api/ai/ai_infrastructure.hpp.sq"
 
#include "../script/api/ai/ai_list.hpp.sq"
 
#include "../script/api/ai/ai_log.hpp.sq"
 
#include "../script/api/ai/ai_map.hpp.sq"
 
#include "../script/api/ai/ai_marine.hpp.sq"
 
#include "../script/api/ai/ai_order.hpp.sq"
 
#include "../script/api/ai/ai_priorityqueue.hpp.sq"
 
#include "../script/api/ai/ai_rail.hpp.sq"
 
#include "../script/api/ai/ai_railtypelist.hpp.sq"
 
#include "../script/api/ai/ai_road.hpp.sq"
 
#include "../script/api/ai/ai_roadtypelist.hpp.sq"
 
#include "../script/api/ai/ai_sign.hpp.sq"
 
#include "../script/api/ai/ai_signlist.hpp.sq"
 
#include "../script/api/ai/ai_station.hpp.sq"
 
#include "../script/api/ai/ai_stationlist.hpp.sq"
 
#include "../script/api/ai/ai_subsidy.hpp.sq"
 
#include "../script/api/ai/ai_subsidylist.hpp.sq"
 
#include "../script/api/ai/ai_testmode.hpp.sq"
 
#include "../script/api/ai/ai_tile.hpp.sq"
 
#include "../script/api/ai/ai_tilelist.hpp.sq"
 
#include "../script/api/ai/ai_town.hpp.sq"
 
#include "../script/api/ai/ai_townlist.hpp.sq"
 
#include "../script/api/ai/ai_tunnel.hpp.sq"
 
#include "../script/api/ai/ai_vehicle.hpp.sq"
 
#include "../script/api/ai/ai_vehiclelist.hpp.sq"
 
#include "../script/api/ai/ai_waypoint.hpp.sq"
 
#include "../script/api/ai/ai_waypointlist.hpp.sq"
 
/* Convert all AI related classes to Squirrel data. */
 
#include "../script/api/ai/ai_includes.hpp"
 

	
 
#include "../company_base.h"
 
#include "../company_func.h"
 
@@ -102,112 +50,8 @@ void AIInstance::RegisterAPI()
 
{
 
	ScriptInstance::RegisterAPI();
 

	
 
/* Register all classes */
 
	SQAIList_Register(this->engine);
 
	SQAIAccounting_Register(this->engine);
 
	SQAIAirport_Register(this->engine);
 
	SQAIBase_Register(this->engine);
 
	SQAIBaseStation_Register(this->engine);
 
	SQAIBridge_Register(this->engine);
 
	SQAIBridgeList_Register(this->engine);
 
	SQAIBridgeList_Length_Register(this->engine);
 
	SQAICargo_Register(this->engine);
 
	SQAICargoList_Register(this->engine);
 
	SQAICargoList_IndustryAccepting_Register(this->engine);
 
	SQAICargoList_IndustryProducing_Register(this->engine);
 
	SQAICargoList_StationAccepting_Register(this->engine);
 
	SQAICompany_Register(this->engine);
 
	SQAIDate_Register(this->engine);
 
	SQAIDepotList_Register(this->engine);
 
	SQAIEngine_Register(this->engine);
 
	SQAIEngineList_Register(this->engine);
 
	SQAIError_Register(this->engine);
 
	SQAIEvent_Register(this->engine);
 
	SQAIEventAircraftDestTooFar_Register(this->engine);
 
	SQAIEventCompanyAskMerger_Register(this->engine);
 
	SQAIEventCompanyBankrupt_Register(this->engine);
 
	SQAIEventCompanyInTrouble_Register(this->engine);
 
	SQAIEventCompanyMerger_Register(this->engine);
 
	SQAIEventCompanyNew_Register(this->engine);
 
	SQAIEventCompanyTown_Register(this->engine);
 
	SQAIEventController_Register(this->engine);
 
	SQAIEventDisasterZeppelinerCleared_Register(this->engine);
 
	SQAIEventDisasterZeppelinerCrashed_Register(this->engine);
 
	SQAIEventEngineAvailable_Register(this->engine);
 
	SQAIEventEnginePreview_Register(this->engine);
 
	SQAIEventExclusiveTransportRights_Register(this->engine);
 
	SQAIEventIndustryClose_Register(this->engine);
 
	SQAIEventIndustryOpen_Register(this->engine);
 
	SQAIEventRoadReconstruction_Register(this->engine);
 
	SQAIEventStationFirstVehicle_Register(this->engine);
 
	SQAIEventSubsidyAwarded_Register(this->engine);
 
	SQAIEventSubsidyExpired_Register(this->engine);
 
	SQAIEventSubsidyOffer_Register(this->engine);
 
	SQAIEventSubsidyOfferExpired_Register(this->engine);
 
	SQAIEventTownFounded_Register(this->engine);
 
	SQAIEventVehicleAutoReplaced_Register(this->engine);
 
	SQAIEventVehicleCrashed_Register(this->engine);
 
	SQAIEventVehicleLost_Register(this->engine);
 
	SQAIEventVehicleUnprofitable_Register(this->engine);
 
	SQAIEventVehicleWaitingInDepot_Register(this->engine);
 
	SQAIExecMode_Register(this->engine);
 
	SQAIGameSettings_Register(this->engine);
 
	SQAIGroup_Register(this->engine);
 
	SQAIGroupList_Register(this->engine);
 
	SQAIIndustry_Register(this->engine);
 
	SQAIIndustryList_Register(this->engine);
 
	SQAIIndustryList_CargoAccepting_Register(this->engine);
 
	SQAIIndustryList_CargoProducing_Register(this->engine);
 
	SQAIIndustryType_Register(this->engine);
 
	SQAIIndustryTypeList_Register(this->engine);
 
	SQAIInfrastructure_Register(this->engine);
 
	SQAILog_Register(this->engine);
 
	SQAIMap_Register(this->engine);
 
	SQAIMarine_Register(this->engine);
 
	SQAIOrder_Register(this->engine);
 
	SQAIPriorityQueue_Register(this->engine);
 
	SQAIRail_Register(this->engine);
 
	SQAIRailTypeList_Register(this->engine);
 
	SQAIRoad_Register(this->engine);
 
	SQAIRoadTypeList_Register(this->engine);
 
	SQAISign_Register(this->engine);
 
	SQAISignList_Register(this->engine);
 
	SQAIStation_Register(this->engine);
 
	SQAIStationList_Register(this->engine);
 
	SQAIStationList_Cargo_Register(this->engine);
 
	SQAIStationList_CargoPlanned_Register(this->engine);
 
	SQAIStationList_CargoPlannedByFrom_Register(this->engine);
 
	SQAIStationList_CargoPlannedByVia_Register(this->engine);
 
	SQAIStationList_CargoPlannedFromByVia_Register(this->engine);
 
	SQAIStationList_CargoPlannedViaByFrom_Register(this->engine);
 
	SQAIStationList_CargoWaiting_Register(this->engine);
 
	SQAIStationList_CargoWaitingByFrom_Register(this->engine);
 
	SQAIStationList_CargoWaitingByVia_Register(this->engine);
 
	SQAIStationList_CargoWaitingFromByVia_Register(this->engine);
 
	SQAIStationList_CargoWaitingViaByFrom_Register(this->engine);
 
	SQAIStationList_Vehicle_Register(this->engine);
 
	SQAISubsidy_Register(this->engine);
 
	SQAISubsidyList_Register(this->engine);
 
	SQAITestMode_Register(this->engine);
 
	SQAITile_Register(this->engine);
 
	SQAITileList_Register(this->engine);
 
	SQAITileList_IndustryAccepting_Register(this->engine);
 
	SQAITileList_IndustryProducing_Register(this->engine);
 
	SQAITileList_StationType_Register(this->engine);
 
	SQAITown_Register(this->engine);
 
	SQAITownEffectList_Register(this->engine);
 
	SQAITownList_Register(this->engine);
 
	SQAITunnel_Register(this->engine);
 
	SQAIVehicle_Register(this->engine);
 
	SQAIVehicleList_Register(this->engine);
 
	SQAIVehicleList_DefaultGroup_Register(this->engine);
 
	SQAIVehicleList_Depot_Register(this->engine);
 
	SQAIVehicleList_Group_Register(this->engine);
 
	SQAIVehicleList_SharedOrders_Register(this->engine);
 
	SQAIVehicleList_Station_Register(this->engine);
 
	SQAIWaypoint_Register(this->engine);
 
	SQAIWaypointList_Register(this->engine);
 
	SQAIWaypointList_Vehicle_Register(this->engine);
 
	/* Register all classes */
 
	SQAI_RegisterAll(this->engine);
 

	
 
	if (!this->LoadCompatibilityScripts(this->versionAPI, AI_DIR)) this->Died();
 
}
src/game/game_instance.cpp
Show inline comments
 
@@ -20,72 +20,8 @@
 
#include "game_text.hpp"
 
#include "game.hpp"
 

	
 
/* Convert all Game related classes to Squirrel data.
 
 * Note: this line is a marker in squirrel_export.sh. Do not change! */
 
#include "../script/api/game/game_accounting.hpp.sq"
 
#include "../script/api/game/game_admin.hpp.sq"
 
#include "../script/api/game/game_airport.hpp.sq"
 
#include "../script/api/game/game_base.hpp.sq"
 
#include "../script/api/game/game_basestation.hpp.sq"
 
#include "../script/api/game/game_bridge.hpp.sq"
 
#include "../script/api/game/game_bridgelist.hpp.sq"
 
#include "../script/api/game/game_cargo.hpp.sq"
 
#include "../script/api/game/game_cargolist.hpp.sq"
 
#include "../script/api/game/game_cargomonitor.hpp.sq"
 
#include "../script/api/game/game_client.hpp.sq"
 
#include "../script/api/game/game_clientlist.hpp.sq"
 
#include "../script/api/game/game_company.hpp.sq"
 
#include "../script/api/game/game_companymode.hpp.sq"
 
#include "../script/api/game/game_controller.hpp.sq"
 
#include "../script/api/game/game_date.hpp.sq"
 
#include "../script/api/game/game_depotlist.hpp.sq"
 
#include "../script/api/game/game_engine.hpp.sq"
 
#include "../script/api/game/game_enginelist.hpp.sq"
 
#include "../script/api/game/game_error.hpp.sq"
 
#include "../script/api/game/game_event.hpp.sq"
 
#include "../script/api/game/game_event_types.hpp.sq"
 
#include "../script/api/game/game_execmode.hpp.sq"
 
#include "../script/api/game/game_game.hpp.sq"
 
#include "../script/api/game/game_gamesettings.hpp.sq"
 
#include "../script/api/game/game_goal.hpp.sq"
 
#include "../script/api/game/game_industry.hpp.sq"
 
#include "../script/api/game/game_industrylist.hpp.sq"
 
#include "../script/api/game/game_industrytype.hpp.sq"
 
#include "../script/api/game/game_industrytypelist.hpp.sq"
 
#include "../script/api/game/game_infrastructure.hpp.sq"
 
#include "../script/api/game/game_list.hpp.sq"
 
#include "../script/api/game/game_log.hpp.sq"
 
#include "../script/api/game/game_map.hpp.sq"
 
#include "../script/api/game/game_marine.hpp.sq"
 
#include "../script/api/game/game_news.hpp.sq"
 
#include "../script/api/game/game_order.hpp.sq"
 
#include "../script/api/game/game_priorityqueue.hpp.sq"
 
#include "../script/api/game/game_rail.hpp.sq"
 
#include "../script/api/game/game_railtypelist.hpp.sq"
 
#include "../script/api/game/game_road.hpp.sq"
 
#include "../script/api/game/game_roadtypelist.hpp.sq"
 
#include "../script/api/game/game_sign.hpp.sq"
 
#include "../script/api/game/game_signlist.hpp.sq"
 
#include "../script/api/game/game_station.hpp.sq"
 
#include "../script/api/game/game_stationlist.hpp.sq"
 
#include "../script/api/game/game_story_page.hpp.sq"
 
#include "../script/api/game/game_storypageelementlist.hpp.sq"
 
#include "../script/api/game/game_storypagelist.hpp.sq"
 
#include "../script/api/game/game_subsidy.hpp.sq"
 
#include "../script/api/game/game_subsidylist.hpp.sq"
 
#include "../script/api/game/game_testmode.hpp.sq"
 
#include "../script/api/game/game_text.hpp.sq"
 
#include "../script/api/game/game_tile.hpp.sq"
 
#include "../script/api/game/game_tilelist.hpp.sq"
 
#include "../script/api/game/game_town.hpp.sq"
 
#include "../script/api/game/game_townlist.hpp.sq"
 
#include "../script/api/game/game_tunnel.hpp.sq"
 
#include "../script/api/game/game_vehicle.hpp.sq"
 
#include "../script/api/game/game_vehiclelist.hpp.sq"
 
#include "../script/api/game/game_viewport.hpp.sq"
 
#include "../script/api/game/game_waypoint.hpp.sq"
 
#include "../script/api/game/game_waypointlist.hpp.sq"
 
#include "../script/api/game/game_window.hpp.sq"
 
/* Convert all Game related classes to Squirrel data. */
 
#include "../script/api/game/game_includes.hpp"
 

	
 
#include "../safeguards.h"
 

	
 
@@ -108,119 +44,8 @@ void GameInstance::RegisterAPI()
 
{
 
	ScriptInstance::RegisterAPI();
 

	
 
/* Register all classes */
 
	SQGSList_Register(this->engine);
 
	SQGSAccounting_Register(this->engine);
 
	SQGSAdmin_Register(this->engine);
 
	SQGSAirport_Register(this->engine);
 
	SQGSBase_Register(this->engine);
 
	SQGSBaseStation_Register(this->engine);
 
	SQGSBridge_Register(this->engine);
 
	SQGSBridgeList_Register(this->engine);
 
	SQGSBridgeList_Length_Register(this->engine);
 
	SQGSCargo_Register(this->engine);
 
	SQGSCargoList_Register(this->engine);
 
	SQGSCargoList_IndustryAccepting_Register(this->engine);
 
	SQGSCargoList_IndustryProducing_Register(this->engine);
 
	SQGSCargoList_StationAccepting_Register(this->engine);
 
	SQGSCargoMonitor_Register(this->engine);
 
	SQGSClient_Register(this->engine);
 
	SQGSClientList_Register(this->engine);
 
	SQGSClientList_Company_Register(this->engine);
 
	SQGSCompany_Register(this->engine);
 
	SQGSCompanyMode_Register(this->engine);
 
	SQGSDate_Register(this->engine);
 
	SQGSDepotList_Register(this->engine);
 
	SQGSEngine_Register(this->engine);
 
	SQGSEngineList_Register(this->engine);
 
	SQGSError_Register(this->engine);
 
	SQGSEvent_Register(this->engine);
 
	SQGSEventAdminPort_Register(this->engine);
 
	SQGSEventCompanyBankrupt_Register(this->engine);
 
	SQGSEventCompanyInTrouble_Register(this->engine);
 
	SQGSEventCompanyMerger_Register(this->engine);
 
	SQGSEventCompanyNew_Register(this->engine);
 
	SQGSEventCompanyTown_Register(this->engine);
 
	SQGSEventController_Register(this->engine);
 
	SQGSEventExclusiveTransportRights_Register(this->engine);
 
	SQGSEventGoalQuestionAnswer_Register(this->engine);
 
	SQGSEventIndustryClose_Register(this->engine);
 
	SQGSEventIndustryOpen_Register(this->engine);
 
	SQGSEventRoadReconstruction_Register(this->engine);
 
	SQGSEventStationFirstVehicle_Register(this->engine);
 
	SQGSEventStoryPageButtonClick_Register(this->engine);
 
	SQGSEventStoryPageTileSelect_Register(this->engine);
 
	SQGSEventStoryPageVehicleSelect_Register(this->engine);
 
	SQGSEventSubsidyAwarded_Register(this->engine);
 
	SQGSEventSubsidyExpired_Register(this->engine);
 
	SQGSEventSubsidyOffer_Register(this->engine);
 
	SQGSEventSubsidyOfferExpired_Register(this->engine);
 
	SQGSEventTownFounded_Register(this->engine);
 
	SQGSEventVehicleCrashed_Register(this->engine);
 
	SQGSEventWindowWidgetClick_Register(this->engine);
 
	SQGSExecMode_Register(this->engine);
 
	SQGSGame_Register(this->engine);
 
	SQGSGameSettings_Register(this->engine);
 
	SQGSGoal_Register(this->engine);
 
	SQGSIndustry_Register(this->engine);
 
	SQGSIndustryList_Register(this->engine);
 
	SQGSIndustryList_CargoAccepting_Register(this->engine);
 
	SQGSIndustryList_CargoProducing_Register(this->engine);
 
	SQGSIndustryType_Register(this->engine);
 
	SQGSIndustryTypeList_Register(this->engine);
 
	SQGSInfrastructure_Register(this->engine);
 
	SQGSLog_Register(this->engine);
 
	SQGSMap_Register(this->engine);
 
	SQGSMarine_Register(this->engine);
 
	SQGSNews_Register(this->engine);
 
	SQGSOrder_Register(this->engine);
 
	SQGSPriorityQueue_Register(this->engine);
 
	SQGSRail_Register(this->engine);
 
	SQGSRailTypeList_Register(this->engine);
 
	SQGSRoad_Register(this->engine);
 
	SQGSRoadTypeList_Register(this->engine);
 
	SQGSSign_Register(this->engine);
 
	SQGSSignList_Register(this->engine);
 
	SQGSStation_Register(this->engine);
 
	SQGSStationList_Register(this->engine);
 
	SQGSStationList_Cargo_Register(this->engine);
 
	SQGSStationList_CargoPlanned_Register(this->engine);
 
	SQGSStationList_CargoPlannedByFrom_Register(this->engine);
 
	SQGSStationList_CargoPlannedByVia_Register(this->engine);
 
	SQGSStationList_CargoPlannedFromByVia_Register(this->engine);
 
	SQGSStationList_CargoPlannedViaByFrom_Register(this->engine);
 
	SQGSStationList_CargoWaiting_Register(this->engine);
 
	SQGSStationList_CargoWaitingByFrom_Register(this->engine);
 
	SQGSStationList_CargoWaitingByVia_Register(this->engine);
 
	SQGSStationList_CargoWaitingFromByVia_Register(this->engine);
 
	SQGSStationList_CargoWaitingViaByFrom_Register(this->engine);
 
	SQGSStationList_Vehicle_Register(this->engine);
 
	SQGSStoryPage_Register(this->engine);
 
	SQGSStoryPageElementList_Register(this->engine);
 
	SQGSStoryPageList_Register(this->engine);
 
	SQGSSubsidy_Register(this->engine);
 
	SQGSSubsidyList_Register(this->engine);
 
	SQGSTestMode_Register(this->engine);
 
	SQGSText_Register(this->engine);
 
	SQGSTile_Register(this->engine);
 
	SQGSTileList_Register(this->engine);
 
	SQGSTileList_IndustryAccepting_Register(this->engine);
 
	SQGSTileList_IndustryProducing_Register(this->engine);
 
	SQGSTileList_StationType_Register(this->engine);
 
	SQGSTown_Register(this->engine);
 
	SQGSTownEffectList_Register(this->engine);
 
	SQGSTownList_Register(this->engine);
 
	SQGSTunnel_Register(this->engine);
 
	SQGSVehicle_Register(this->engine);
 
	SQGSVehicleList_Register(this->engine);
 
	SQGSVehicleList_Depot_Register(this->engine);
 
	SQGSVehicleList_SharedOrders_Register(this->engine);
 
	SQGSVehicleList_Station_Register(this->engine);
 
	SQGSViewport_Register(this->engine);
 
	SQGSWaypoint_Register(this->engine);
 
	SQGSWaypointList_Register(this->engine);
 
	SQGSWaypointList_Vehicle_Register(this->engine);
 
	SQGSWindow_Register(this->engine);
 
	/* Register all classes */
 
	SQGS_RegisterAll(this->engine);
 

	
 
	RegisterGameTranslation(this->engine);
 

	
src/script/api/CMakeLists.txt
Show inline comments
 
add_library(script_api
 
        INTERFACE
 
)
 

	
 
# Get script_window.hpp dependencies
 
file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/script_window.hpp.in ENUM_LINES REGEX "@enum")
 
foreach(ENUM IN LISTS ENUM_LINES)
 
@@ -13,7 +17,6 @@ add_custom_command_timestamp(OUTPUT ${CM
 
                -DGENERATE_SOURCE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/script_window.hpp.in
 
                -DGENERATE_BINARY_FILE=${CMAKE_BINARY_DIR}/generated/script/api/script_window.hpp
 
                -P ${CMAKE_SOURCE_DIR}/cmake/scripts/GenerateWidget.cmake
 
        COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/generated/script/api/dummy # dummy directory for #include "../script_window.hpp"
 
        MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/script_window.hpp.in
 
        DEPENDS ${CMAKE_SOURCE_DIR}/cmake/scripts/GenerateWidget.cmake ${DEPENDENCIES}
 
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
 
@@ -23,19 +26,94 @@ add_custom_target_timestamp(script_windo
 
        DEPENDS
 
        ${CMAKE_BINARY_DIR}/generated/script/api/script_window.hpp
 
)
 

	
 
add_library(script_api
 
        INTERFACE
 
)
 
target_include_directories(script_api
 
        INTERFACE
 
        ${CMAKE_BINARY_DIR}/generated/script/api/
 
        ${CMAKE_BINARY_DIR}/generated/script/api/dummy # dummy path so #include "../script_window.hpp" works
 
        ${CMAKE_CURRENT_SOURCE_DIR}
 
)
 
add_dependencies(script_api
 
        script_window
 
)
 

	
 
file(GLOB SCRIPT_API_FILES "script_*.hpp")
 
list(APPEND SCRIPT_API_FILES ${CMAKE_BINARY_DIR}/generated/script/api/script_window.hpp)
 

	
 
foreach(API "ai;AI" "game;GS" "template;Template")
 
    list(GET API 0 APILC)
 
    list(GET API 1 APIUC)
 

	
 
    foreach(SCRIPT_API_FILE IN LISTS SCRIPT_API_FILES)
 
        if ("${SCRIPT_API_FILE}" MATCHES ".*script_controller.*")
 
            continue()
 
        endif ("${SCRIPT_API_FILE}" MATCHES ".*script_controller.*")
 
        get_filename_component(SCRIPT_API_FILE_NAME "${SCRIPT_API_FILE}" NAME)
 
        string(REPLACE "script_" "${APILC}_" SCRIPT_API_FILE_NAME "${SCRIPT_API_FILE_NAME}")
 
        set(SCRIPT_API_BINARY_FILE "${CMAKE_BINARY_DIR}/generated/script/api/${APILC}/${SCRIPT_API_FILE_NAME}.sq")
 

	
 
        add_custom_command_timestamp(OUTPUT ${SCRIPT_API_BINARY_FILE}
 
                COMMAND ${CMAKE_COMMAND}
 
                        -DSCRIPT_API_SOURCE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/squirrel_export.hpp.sq.in
 
                        -DSCRIPT_API_BINARY_FILE=${SCRIPT_API_BINARY_FILE}
 
                        -DSCRIPT_API_FILE=${SCRIPT_API_FILE}
 
                        -DAPIUC=${APIUC}
 
                        -DAPILC=${APILC}
 
                        -P ${CMAKE_SOURCE_DIR}/cmake/scripts/SquirrelExport.cmake
 
                MAIN_DEPENDENCY ${SCRIPT_API_FILE}
 
                DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/squirrel_export.hpp.sq.in
 
                        ${CMAKE_SOURCE_DIR}/cmake/scripts/SquirrelExport.cmake
 
                WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 
                COMMENT "Generating ${APILC}/${SCRIPT_API_FILE_NAME}.sq"
 
        )
 
        list(APPEND SCRIPT_${APIUC}_BINARY_FILES ${SCRIPT_API_BINARY_FILE})
 
    endforeach(SCRIPT_API_FILE)
 

	
 
    add_custom_target_timestamp(script_${APILC}
 
            DEPENDS
 
            ${SCRIPT_${APIUC}_BINARY_FILES}
 
    )
 
    add_dependencies(script_${APILC}
 
            script_window
 
    )
 

	
 
    if (NOT "${APILC}" STREQUAL "template")
 
        list(APPEND SCRIPT_${APIUC}_BINARY_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${APILC}/${APILC}_controller.hpp.sq")
 
        set(INCLUDES_BINARY_FILE "${CMAKE_BINARY_DIR}/generated/script/api/${APILC}/${APILC}_includes.hpp")
 
        add_custom_command_timestamp(OUTPUT ${INCLUDES_BINARY_FILE}
 
                COMMAND ${CMAKE_COMMAND}
 
                        -DINCLUDES_SOURCE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/script_includes.hpp.in
 
                        -DINCLUDES_BINARY_FILE=${INCLUDES_BINARY_FILE}
 
                        -DAPIUC=${APIUC}
 
                        -DAPILC=${APILC}
 
                        -P ${CMAKE_SOURCE_DIR}/cmake/scripts/SquirrelIncludes.cmake
 
                        --
 
                        ${SCRIPT_${APIUC}_BINARY_FILES}
 
                MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/script_includes.hpp.in
 
                DEPENDS ${SCRIPT_${APIUC}_BINARY_FILES}
 
                        ${CMAKE_SOURCE_DIR}/cmake/scripts/SquirrelIncludes.cmake
 
                WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 
                COMMENT "Generating ${APILC}/${APILC}_includes.hpp"
 
        )
 
        add_custom_target_timestamp(script_${APILC}_includes
 
                DEPENDS
 
                ${INCLUDES_BINARY_FILE}
 
        )
 
        add_dependencies(script_${APILC}_includes
 
            script_${APILC}
 
        )
 
        add_dependencies(script_api
 
                script_${APILC}_includes
 
        )
 
    else (NOT "${APILC}" STREQUAL "template")
 
        add_dependencies(script_api
 
                script_${APILC}
 
        )
 
    endif (NOT "${APILC}" STREQUAL "template")
 

	
 
    target_include_directories(script_api
 
            INTERFACE
 
            ${CMAKE_BINARY_DIR}/generated/script
 
            ${CMAKE_BINARY_DIR}/generated/script/api/${APILC}
 
            ${CMAKE_CURRENT_SOURCE_DIR}/${APILC}
 
    )
 
endforeach(API)
 

	
 
add_library(openttd::script_api ALIAS script_api)
 

	
 

	
src/script/api/Doxyfile_AI
Show inline comments
 
@@ -98,7 +98,7 @@ FILE_PATTERNS          = script_*.hpp \
 
RECURSIVE              = YES
 
EXCLUDE                =
 
EXCLUDE_SYMLINKS       = NO
 
EXCLUDE_PATTERNS       =
 
EXCLUDE_PATTERNS       = ai_includes.hpp
 
EXCLUDE_SYMBOLS        = GetClassName DECLARE_ENUM_AS_BIT_SET DECLARE_POSTFIX_INCREMENT
 
EXAMPLE_PATH           =
 
EXAMPLE_PATTERNS       = *
src/script/api/Doxyfile_Game
Show inline comments
 
@@ -98,7 +98,7 @@ FILE_PATTERNS          = script_*.hpp \
 
RECURSIVE              = YES
 
EXCLUDE                =
 
EXCLUDE_SYMLINKS       = NO
 
EXCLUDE_PATTERNS       =
 
EXCLUDE_PATTERNS       = game_includes.hpp
 
EXCLUDE_SYMBOLS        = GetClassName DECLARE_ENUM_AS_BIT_SET DECLARE_POSTFIX_INCREMENT
 
EXAMPLE_PATH           =
 
EXAMPLE_PATTERNS       = *
src/script/api/ai/ai_accounting.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_airport.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_base.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_basestation.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_bridge.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_bridgelist.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_cargo.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_cargolist.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_company.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_date.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_depotlist.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_engine.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_enginelist.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_error.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_event.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_event_types.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_execmode.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_gamesettings.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_group.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_grouplist.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_industry.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_industrylist.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_industrytype.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_industrytypelist.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_infrastructure.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_list.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_log.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_map.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_marine.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_order.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_priorityqueue.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_rail.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_railtypelist.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_road.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_roadtypelist.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_sign.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_signlist.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_station.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_stationlist.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_subsidy.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_subsidylist.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_testmode.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_tile.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_tilelist.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_town.hpp.sq
Show inline comments
 
deleted file
src/script/api/ai/ai_townlist.hpp.sq
Show inline comments
 
deleted file

Changeset was too big and was cut off... Show full diff anyway

0 comments (0 inline, 0 general)