Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Commit

Permalink
Implemented support for Linux32, Linux64, Windows32 and Windows64 rel…
Browse files Browse the repository at this point in the history
…eases
  • Loading branch information
joelgomes1994 committed Jan 14, 2021
1 parent 9abd2c6 commit 3c30ed5
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 19 deletions.
2 changes: 0 additions & 2 deletions engine/Linux/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions engine/Windows/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion launcher/Linux/engine_executable.txt

This file was deleted.

1 change: 0 additions & 1 deletion launcher/Linux/python_executable.txt

This file was deleted.

1 change: 1 addition & 0 deletions launcher/Linux32/engine_executable.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ENGINE_EXECUTABLE='./engine/Linux32/blenderplayer'
1 change: 1 addition & 0 deletions launcher/Linux32/python_executable.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PYTHON_EXECUTABLE='./engine/Linux32/2.79/python/bin/python3.5m'
1 change: 1 addition & 0 deletions launcher/Linux64/engine_executable.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ENGINE_EXECUTABLE='./engine/Linux64/blenderplayer'
1 change: 1 addition & 0 deletions launcher/Linux64/python_executable.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PYTHON_EXECUTABLE='./engine/Linux64/2.79/python/bin/python3.5m'
1 change: 0 additions & 1 deletion launcher/Windows/engine_executable.txt

This file was deleted.

1 change: 0 additions & 1 deletion launcher/Windows/python_executable.txt

This file was deleted.

1 change: 1 addition & 0 deletions launcher/Windows32/engine_executable.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ENGINE_EXECUTABLE="./engine/Windows32/blenderplayer.exe"
1 change: 1 addition & 0 deletions launcher/Windows32/python_executable.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PYTHON_EXECUTABLE="./engine/Windows32/2.79/python/bin/python.exe"
1 change: 1 addition & 0 deletions launcher/Windows64/engine_executable.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ENGINE_EXECUTABLE="./engine/Windows64/blenderplayer.exe"
1 change: 1 addition & 0 deletions launcher/Windows64/python_executable.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PYTHON_EXECUTABLE="./engine/Windows64/2.79/python/bin/python.exe"
2 changes: 1 addition & 1 deletion launcher/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"GameName" : "BGArmor",
"Version" : "0.0.2",
"Version" : "0.0.3",
"MainFile" : "Example Game.blend",
"DataFile" : "./data.dat",
"DataSource" : "./data",
Expand Down
18 changes: 15 additions & 3 deletions source/Launcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@
#define _WIN32_WINNT 0x0500
#include <windows.h>
const char* COMMON_FILE_PATH = "./launcher/Windows/python_executable.txt";
const char* COMMON_FILE_PATH_32 = "./launcher/Windows32/python_executable.txt";
const char* COMMON_FILE_PATH_64 = "./launcher/Windows64/python_executable.txt";
const char* COMMAND_PREFIX = "ECHO OFF && ";
const char* DEFAULT_QUOTE = "\"";
#elif defined(__unix__)
const char* COMMON_FILE_PATH = "./launcher/Linux/python_executable.txt";
const char* COMMON_FILE_PATH_32 = "./launcher/Linux32/python_executable.txt";
const char* COMMON_FILE_PATH_64 = "./launcher/Linux64/python_executable.txt";
const char* COMMAND_PREFIX = "";
const char* DEFAULT_QUOTE = "'";
#endif

const char* DEFAULT_LAUNCHER_SCRIPT = "./launcher/launcher.py";
const char* FALLBACK_LAUNCHER_SCRIPT = "./source/launcher.py";
const char* DEFAULT_LAUNCHER_SCRIPT = "./source/launcher.py";
const char* FALLBACK_LAUNCHER_SCRIPT = "./launcher/launcher.py";
const char* HELP_TEXT = "\nLAUNCHER COMMAND LINE ARGUMENTS:\n\n"
"-c\tEnable console window.\n"
"-h\tShow this help text.\n";
Expand Down Expand Up @@ -56,8 +60,16 @@ void copyStringChunk(char* source, char* target, const char from, const char to)
}

void getPathFromCommon(Common* common) {
FILE* filePointer = fopen(COMMON_FILE_PATH, "r");
char buffer[LINE_BUFFER_LENGTH];
FILE* filePointer = fopen(COMMON_FILE_PATH, "r");

if (filePointer == NULL) {
filePointer = fopen(COMMON_FILE_PATH_32, "r");
}

if (filePointer == NULL) {
filePointer = fopen(COMMON_FILE_PATH_64, "r");
}

if (filePointer != NULL) {
while(fgets(buffer, LINE_BUFFER_LENGTH, filePointer) != NULL) {
Expand Down
11 changes: 9 additions & 2 deletions source/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,16 @@
def loadConfig(path):
config = None
configPath = path / "config.json"
enginePath = path / (curPlatform + "/engine_executable.txt")
engineCandidates = [curPlatform, curPlatform + "32", curPlatform + "64"]
enginePath = None

if configPath.exists():
for _path in engineCandidates:
_path = path / (_path + "/engine_executable.txt")
if _path.exists():
enginePath = _path.resolve()
break

if configPath.exists() and enginePath is not None:
with open(configPath.as_posix(), "r") as sourceFile:
config = literal_eval(sourceFile.read())
print("> Read config from", configPath.as_posix())
Expand Down
14 changes: 9 additions & 5 deletions source/release_files.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
# End folders with a forward slash (/)
"Create" : [
"./engine/",
"./engine/Windows/",
"./engine/Linux/",
"./engine/Windows/DELETE-ME",
"./engine/Linux/DELETE-ME",
"./engine/Windows32/",
"./engine/Windows64/",
"./engine/Linux32/",
"./engine/Linux64/",
"./engine/Windows32/DELETE-ME",
"./engine/Windows64/DELETE-ME",
"./engine/Linux32/DELETE-ME",
"./engine/Linux64/DELETE-ME",
"./release/",
"./release/DELETE-ME",
"./source/",
Expand All @@ -30,4 +34,4 @@
"build_launcher.py",
".gitignore",
]
}
}

0 comments on commit 3c30ed5

Please sign in to comment.