Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/andreasdr/tdme2
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasdr committed Jan 22, 2025
2 parents 2d6f1c8 + 7ef6e16 commit 56d7b97
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
run: sudo apt update && sudo apt-get install pkgconf libglew-dev libopenal-dev libglfw3-dev libfreetype-dev libxml2-dev libvulkan-dev
- uses: actions/checkout@v2
- name: build
run: cd ext/minitscript/ && make mains && export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/lib && ./bin/minitscript/tools/minitscript --working-directory=../.. ../../make.tscript --arguments clean libraries executables && cd ../..
run: cd ext/minitscript/ && make mains && export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/lib && ./bin/minitscript/tools/minitscript --working-directory=../.. ../../make.tscript --arguments clean libraries tests executables && cd ../..
2 changes: 1 addition & 1 deletion .github/workflows/windows-mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
unzip
- uses: actions/checkout@v2
- name: build
run: cd ext/minitscript && cd ./ext/windows-msc && unzip tools.zip && cd ../.. && make mains && cp ./lib/*.dll ./bin/minitscript/tools/ && ./bin/minitscript/tools/minitscript --working-directory=../.. ../../make.tscript --arguments clean libraries executables && cd ../..
run: cd ext/minitscript && cd ./ext/windows-msc && unzip tools.zip && cd ../.. && make mains && cp ./lib/*.dll ./bin/minitscript/tools/ && ./bin/minitscript/tools/minitscript --working-directory=../.. ../../make.tscript --arguments clean libraries tests executables && cd ../..
2 changes: 1 addition & 1 deletion .github/workflows/windows-msc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
- uses: ilammy/msvc-dev-cmd@v1
- uses: actions/checkout@v2
- name: build
run: cd ext\minitscript\ && cd ./ext/windows-msc && 7z x tools.zip && cd ../.. && nmake -f Makefile.nmake && copy ".\lib\*.dll" ".\bin\minitscript\tools\" && .\scripts\windows-prepare-platform-libs.bat && copy "platform\libs\*.dll" ".\bin\minitscript\tools\" && .\bin\minitscript\tools\minitscript --working-directory=../.. ../../make.tscript --arguments clean libraries executables && cd ..\..
run: cd ext\minitscript\ && cd ./ext/windows-msc && 7z x tools.zip && cd ../.. && nmake -f Makefile.nmake && copy ".\lib\*.dll" ".\bin\minitscript\tools\" && .\scripts\windows-prepare-platform-libs.bat && copy "platform\libs\*.dll" ".\bin\minitscript\tools\" && .\bin\minitscript\tools\minitscript --working-directory=../.. ../../make.tscript --arguments clean libraries tests executables && cd ..\..
42 changes: 24 additions & 18 deletions make-msc-module.tscript
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ function: generateRCMSC($template, $fileName)
)
end

function: buildLibraryMSC($name, $libraries, $definitions, $includes, $ldFlags, $files, $optional)
console.printLine("Building library: " + $name)
function: buildLibraryMSC($idx, $name, $libraries, $definitions, $includes, $ldFlags, $files, $optional)
console.printLine("Building library: " + $name + "(" + $idx + ")")
console.printLine()

$librariesIncludes = ""
Expand Down Expand Up @@ -219,7 +219,7 @@ function: buildLibraryMSC($name, $libraries, $definitions, $includes, $ldFlags,
$fileObjectPaths->set($fileObjectPathCandidate, $fileObjectPaths->getSize())
end
$fileObjectPath =
$name +
$idx +
"/" +
$fileObjectPaths->get($fileObjectPathCandidate)

Expand Down Expand Up @@ -270,9 +270,7 @@ function: buildLibraryMSC($name, $libraries, $definitions, $includes, $ldFlags,
" " +
$includes +
" " +
$file +
" " +
"1>nul"
$file
#
if ($command == null)
continue
Expand Down Expand Up @@ -385,13 +383,10 @@ function: buildLibraryMSC($name, $libraries, $definitions, $includes, $ldFlags,
end
end

# link $(LD_FLAGS) /DLL /DEF:$(MSCBIN)\libtdme.def /DEBUG /IGNORE:4197 /IGNORE:4102 $** $(MSCBIN)\libtdme.dll.res $(LIBS_LDFLAGS) /LIBPATH $(MSCBIN)\libtdme-ext.lib /OUT:$(MSCBIN)\libtdme.dll

# link
$command =
"chcp 65001 > nul && " +
"link" +
" " +
# response file
filesystem.setContentFromString(
".",
"link.response",
$librariesLdFlags +
" " +
$ldFlags +
Expand All @@ -410,7 +405,15 @@ function: buildLibraryMSC($name, $libraries, $definitions, $includes, $ldFlags,
" " +
$libraryDLLRESFile +
" " +
"/OUT:" + $libraryDLLFile
"/OUT:" + $libraryDLLFile
)

# link
$command =
"chcp 65001 > nul && " +
"link" +
" " +
"@link.response"

console.printLine($command)

Expand All @@ -426,7 +429,12 @@ function: buildLibraryMSC($name, $libraries, $definitions, $includes, $ldFlags,
application.exit($$.application::EXITCODE_FAILURE)
end
end


# remove response file
filesystem.removeFile(
".",
"link.response"
)
end
catch ($exception)
console.printLine("An error occurred: " + $exception)
Expand Down Expand Up @@ -564,9 +572,7 @@ function: buildExecutablesMSC($name, $libraries, $definitions, $includes, $ldFla
" " +
$librariesLdFlags +
" " +
$ldFlags +
" " # +
# "> nul"
$ldFlags
console.printLine($command)

# execute
Expand Down
2 changes: 1 addition & 1 deletion make-unix-module.tscript
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function: determineLibraryFlagsUnix($libraries, &$librariesIncludes, &$libraries
return(true)
end

function: buildLibraryUnix($name, $libraries, $definitions, $includes, $ldFlags, $files, $optional)
function: buildLibraryUnix($idx, $name, $libraries, $definitions, $includes, $ldFlags, $files, $optional)
console.printLine("Building library: " + $name)
console.printLine()

Expand Down
33 changes: 30 additions & 3 deletions make.tscript
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,17 @@ function: main()
$tdmeLdFlags = $tdmeLdFlags + " " + "/LIBPATH \"lib/libyannet.lib\""
$tdmeLdFlags = $tdmeLdFlags + " " + "/LIBPATH \"lib/libtdme-ext.lib\""
$tdmeLdFlags = $tdmeLdFlags + " " + "/LIBPATH \"lib/libagui.lib\""
$tdmeExtraLibsLdFlags = "/LIBPATH \"lib/libtdme.lib\""
$tdmeExtraLibsLdFlags = "/LIBPATH \"ext/fbx/win64/lib/libfbxsdk.lib\""
$tdmeExtraLibsLdFlags = $tdmeExtraLibsLdFlags + " " + "/LIBPATH \"lib/libminitscript.lib\""
$tdmeExtraLibsLdFlags = $tdmeExtraLibsLdFlags + " " + "/LIBPATH \"lib/libyannet.lib\""
$tdmeExtraLibsLdFlags = $tdmeExtraLibsLdFlags + " " + "/LIBPATH \"lib/libtdme-ext.lib\""
$tdmeExtraLibsLdFlags = $tdmeExtraLibsLdFlags + " " + "/LIBPATH \"lib/libagui.lib\""
$tdmeExtraLibsLdFlags = $tdmeExtraLibsLdFlags + " " + "/LIBPATH \"lib/libtdme.lib\""
$tdmeRendererLdFlags = "/LIBPATH \"lib/libtdme.lib\""
$tdmeRendererLdFlags = $tdmeRendererLdFlags + " " + "/LIBPATH \"" + getWindowsSDKPathNameMSC() + "/um/x64/OpenGL32.Lib\""
$tdmeRendererDefinitions = "/D TDME2_DLL_IMPORT"
$tdmeVulkanRendererIncludes = "/I \"ext/windows-msc/vulkan-sdk/include\"",
$tdmeVulkanRendererIncludes = $tdmeVulkanRendererIncludes + " " + "/I.",
$tdmeVulkanRendererPlatformFiles[] = "ext/vulkan/glslang/OSDependent/Windows/ossource.cpp"
$buildLibrary = "buildLibraryMSC"
$buildExecutables = "buildExecutablesMSC"
Expand All @@ -175,9 +181,9 @@ function: main()
$yannetDefinitions = "/D YANNET_DLL_EXPORT"
$aguiDefinitions = "/D MINITSCRIPT_DLL_IMPORT"
$tdmeDefinitions = "/D MINITSCRIPT_DLL_IMPORT /D YANNET_DLL_IMPORT /D TDME2_DLL_EXPORT"
$tdmeExtraLibsDefinitions = "/D MINITSCRIPT_DLL_IMPORT /D YANNET_DLL_IMPORT /D TDME2_DLL_IMPORT"
$tdmeExtraLibsDefinitions = "/D MINITSCRIPT_DLL_IMPORT /D YANNET_DLL_IMPORT /D TDME2_DLL_IMPORT /D TDMETOOLS_DLL_EXPORT"
$glfwDefinitions = "/D GLFW_DLL"
$executableDefinitions = "/D MINITSCRIPT_DLL_IMPORT /D YANNET_DLL_IMPORT /D TDME2_DLL_IMPORT"
$executableDefinitions = "/D MINITSCRIPT_DLL_IMPORT /D YANNET_DLL_IMPORT /D TDME2_DLL_IMPORT /D TDMETOOLS_DLL_IMPORT"
$executableLdFlags = ""
$executableLdFlags = "/LIBPATH \"ext/fbx/win64/lib/libfbxsdk.lib\""
$executableLdFlags = $executableLdFlags + " " + "/LIBPATH \"lib/libminitscript.lib\""
Expand Down Expand Up @@ -212,6 +218,7 @@ function: main()

script.call(
$buildLibrary,
0,
"libminitscript",
[
"libssl",
Expand Down Expand Up @@ -280,6 +287,7 @@ function: main()

script.call(
$buildLibrary,
1,
"libyannet",
[
"libssl",
Expand Down Expand Up @@ -329,6 +337,7 @@ function: main()

script.call(
$buildLibrary,
2,
"libtdme-ext",
[],
$rapidJSONDefinitions,
Expand Down Expand Up @@ -501,6 +510,7 @@ function: main()

script.call(
$buildLibrary,
3,
"libagui",
[
"glew",
Expand Down Expand Up @@ -666,6 +676,7 @@ function: main()

script.call(
$buildLibrary,
4,
"libtdme",
[
"glfw3",
Expand Down Expand Up @@ -924,8 +935,14 @@ function: main()

script.call(
$buildLibrary,
5,
"libtdme-tools",
[
"glfw3",
"openal",
"freetype2",
"libssl",
"libcrypto"
],
$rapidJSONDefinitions + " " + $glfwDefinitions + " " + $tdmeExtraLibsDefinitions,
"-Isrc -Iext -I. -Iext/reactphysics3d/include/ -Iext/vhacd/include/ -Iext/cpp-spline/src -Iext/zlib -Iext/yannet/src -Iext/minitscript/src -Iext/a-gui/src",
Expand Down Expand Up @@ -1005,8 +1022,14 @@ function: main()

script.call(
$buildLibrary,
6,
"libtdme-tests",
[
"glfw3",
"openal",
"freetype2",
"libssl",
"libcrypto"
],
$rapidJSONDefinitions + " " + $glfwDefinitions + " " + $tdmeExtraLibsDefinitions,
"-Isrc -Iext -I. -Iext/reactphysics3d/include/ -Iext/vhacd/include/ -Iext/cpp-spline/src -Iext/zlib -Iext/yannet/src -Iext/minitscript/src -Iext/a-gui/src" + " " + $tdmeIncludes,
Expand Down Expand Up @@ -1041,6 +1064,7 @@ function: main()

script.call(
$buildLibrary,
7,
"libopengl2renderer",
[
"glew",
Expand All @@ -1058,6 +1082,7 @@ function: main()

script.call(
$buildLibrary,
8,
"libopengl3corerenderer",
[
"glew",
Expand All @@ -1075,6 +1100,7 @@ function: main()

script.call(
$buildLibrary,
9,
"libopengles2renderer",
[
"glesv2",
Expand All @@ -1093,6 +1119,7 @@ function: main()

script.call(
$buildLibrary,
10,
"libvulkanrenderer",
[
"glfw3",
Expand Down
8 changes: 8 additions & 0 deletions src/tdme/tdme.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@
#else
#define STATIC_DLL_IMPEXT
#endif

#if defined(TDMETOOLS_DLL_EXPORT)
#define TDMETOOLS_STATIC_DLL_IMPEXT __declspec(dllexport)
#elif defined(TDMETOOLS_DLL_IMPORT)
#define TDMETOOLS_STATIC_DLL_IMPEXT __declspec(dllimport)
#else
#define TDMETOOLS_STATIC_DLL_IMPEXT
#endif
2 changes: 1 addition & 1 deletion src/tdme/tools/editor/Editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ using tdme::tools::editor::views::View;
class tdme::tools::editor::Editor final: public Application
{
private:
STATIC_DLL_IMPEXT static Editor* instance;
TDMETOOLS_STATIC_DLL_IMPEXT static Editor* instance;
Engine* engine { nullptr };
View* view { nullptr };
bool viewInitialized;
Expand Down
2 changes: 1 addition & 1 deletion src/tdme/tools/editor/misc/TextFormatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class tdme::tools::editor::misc::TextFormatter final
string whitespaces = " \t";
} propertiesLanguage;

STATIC_DLL_IMPEXT static TextFormatter* instance;
TDMETOOLS_STATIC_DLL_IMPEXT static TextFormatter* instance;

/**
* Returns immediate children tags by tag name
Expand Down
12 changes: 6 additions & 6 deletions src/tdme/tools/editor/misc/Tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ using tdme::engine::model::Model;
class tdme::tools::editor::misc::Tools final
{
private:
STATIC_DLL_IMPEXT static unique_ptr<Model> gizmoAll;
STATIC_DLL_IMPEXT static unique_ptr<Model> gizmoTranslationScale;
STATIC_DLL_IMPEXT static unique_ptr<Model> gizmoTranslation;
STATIC_DLL_IMPEXT static unique_ptr<Model> gizmoScale;
STATIC_DLL_IMPEXT static unique_ptr<Model> gizmoRotations;
STATIC_DLL_IMPEXT static unique_ptr<Model> defaultOBB;
TDMETOOLS_STATIC_DLL_IMPEXT static unique_ptr<Model> gizmoAll;
TDMETOOLS_STATIC_DLL_IMPEXT static unique_ptr<Model> gizmoTranslationScale;
TDMETOOLS_STATIC_DLL_IMPEXT static unique_ptr<Model> gizmoTranslation;
TDMETOOLS_STATIC_DLL_IMPEXT static unique_ptr<Model> gizmoScale;
TDMETOOLS_STATIC_DLL_IMPEXT static unique_ptr<Model> gizmoRotations;
TDMETOOLS_STATIC_DLL_IMPEXT static unique_ptr<Model> defaultOBB;

public:
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ using tdme::utilities::Enum;
class tdme::tools::editor::tabcontrollers::subcontrollers::PrototypePhysicsSubController_BoundingVolumeType final: public Enum
{
public:
STATIC_DLL_IMPEXT static PrototypePhysicsSubController_BoundingVolumeType* NONE;
STATIC_DLL_IMPEXT static PrototypePhysicsSubController_BoundingVolumeType* SPHERE;
STATIC_DLL_IMPEXT static PrototypePhysicsSubController_BoundingVolumeType* CAPSULE;
STATIC_DLL_IMPEXT static PrototypePhysicsSubController_BoundingVolumeType* BOUNDINGBOX;
STATIC_DLL_IMPEXT static PrototypePhysicsSubController_BoundingVolumeType* ORIENTEDBOUNDINGBOX;
STATIC_DLL_IMPEXT static PrototypePhysicsSubController_BoundingVolumeType* CONVEXMESH;
TDMETOOLS_STATIC_DLL_IMPEXT static PrototypePhysicsSubController_BoundingVolumeType* NONE;
TDMETOOLS_STATIC_DLL_IMPEXT static PrototypePhysicsSubController_BoundingVolumeType* SPHERE;
TDMETOOLS_STATIC_DLL_IMPEXT static PrototypePhysicsSubController_BoundingVolumeType* CAPSULE;
TDMETOOLS_STATIC_DLL_IMPEXT static PrototypePhysicsSubController_BoundingVolumeType* BOUNDINGBOX;
TDMETOOLS_STATIC_DLL_IMPEXT static PrototypePhysicsSubController_BoundingVolumeType* ORIENTEDBOUNDINGBOX;
TDMETOOLS_STATIC_DLL_IMPEXT static PrototypePhysicsSubController_BoundingVolumeType* CONVEXMESH;

/**
* Public constructor
Expand Down

0 comments on commit 56d7b97

Please sign in to comment.