Skip to content

Commit

Permalink
Misc changes from private repo (defold#9359)
Browse files Browse the repository at this point in the history
* Misc changes from private repo

* Added dmPlatform::DEVICE_STATE_MAX enum value
  • Loading branch information
JCash authored Sep 2, 2024
1 parent 16583ec commit 6596bc1
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 20 deletions.
2 changes: 1 addition & 1 deletion ci/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ def main(argv):
return

if platform and not is_platform_private(platform):
if platform not in ['x86_64-win32']:
if platform not in ['x86_64-win32', 'x86_64-linux']:
print("The repo {} is private. We've disabled building the platform {}. Skipping".format(repo, platform))
return

Expand Down
2 changes: 1 addition & 1 deletion engine/dlib/src/dlib/ssdp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ namespace dmSSDP
if (sr != dmSocket::RESULT_OK)
{
// When returning from sleep mode on iOS socket is in state ECONNABORTED
if (sr == dmSocket::RESULT_CONNABORTED || sr == dmSocket::RESULT_NOTCONN)
if (sr == dmSocket::RESULT_CONNABORTED || sr == dmSocket::RESULT_NOTCONN || sr == dmSocket::RESULT_NETDOWN)
{
dmLogDebug("SSDP permanent dispatch error");
return false;
Expand Down
2 changes: 1 addition & 1 deletion engine/dlib/src/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def build(bld):

if 'arm64-nx64' in bld.env.PLATFORM:
source_files = remove_files(source_files, ['condition_variable.cpp',
'mutex.cpp',
'mutex_posix.cpp',
'sys_posix.cpp',
'socket_posix.cpp',
'time.cpp'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <algorithm>
#include <map>
#include <random>
#include <vector>

#include "../gameobject.h"
Expand Down Expand Up @@ -181,6 +182,9 @@ TEST_F(DeleteTest, DeleteSelf)
* Component instances of type 'A' is used here. We need a specific ComponentUpdate though. (DeleteSelfComponentsUpdate)
* See New(..., goproto01.goc") below.
*/
std::random_device rd;
std::mt19937 g(rd());

for (int iter = 0; iter < 4; ++iter)
{
m_DeleteSelfInstances.clear();
Expand All @@ -196,7 +200,7 @@ TEST_F(DeleteTest, DeleteSelf)
m_DeleteSelfIndices.push_back(i);
}

std::random_shuffle(m_DeleteSelfIndices.begin(), m_DeleteSelfIndices.end());
std::shuffle(m_DeleteSelfIndices.begin(), m_DeleteSelfIndices.end(), g);

while (m_DeleteSelfIndices.size() > 0)
{
Expand Down
7 changes: 6 additions & 1 deletion engine/gamesys/src/gamesys/test/test_gamesys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4524,6 +4524,8 @@ TEST_F(RenderConstantsTest, CreateDestroy)
dmGameSystem::DestroyRenderConstants(constants);
}

#if !defined(DM_PLATFORM_VENDOR) // we need to fix our test material/shader compiler to work with the constants

TEST_F(RenderConstantsTest, SetGetConstant)
{
dmhash_t name_hash1 = dmHashString64("user_var1");
Expand Down Expand Up @@ -4584,7 +4586,7 @@ TEST_F(RenderConstantsTest, SetGetConstant)

dmResource::Release(m_Factory, material);
}

#endif

TEST_F(RenderConstantsTest, SetGetManyConstants)
{
Expand Down Expand Up @@ -4661,6 +4663,7 @@ TEST_F(RenderConstantsTest, HashRenderConstants)
dmGameSystem::DestroyRenderConstants(constants);
}

#if !defined(DM_PLATFORM_VENDOR) // we need to fix our test material/shader compiler to work with the constants
TEST_F(MaterialTest, CustomVertexAttributes)
{
dmGameSystem::MaterialResource* material_res;
Expand Down Expand Up @@ -5191,6 +5194,8 @@ TEST_F(MaterialTest, GoGetSetConstants)
dmGameSystem::FinalizeScriptLibs(m_Scriptlibcontext);
}

#endif // !defined(DM_PLATFORM_VENDOR)

TEST_F(ComponentTest, GetSetCollisionShape)
{
dmHashEnableReverseHash(true);
Expand Down
7 changes: 4 additions & 3 deletions engine/graphics/src/opengl/graphics_opengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1526,11 +1526,12 @@ static void LogFrameBufferError(GLenum status)
#endif
}

static void OpenGLFlip(HContext context)
static void OpenGLFlip(HContext _context)
{
DM_PROFILE(__FUNCTION__);
PostDeleteTextures((OpenGLContext*) context, false);
dmPlatform::SwapBuffers(((OpenGLContext*) context)->m_Window);
OpenGLContext* context = (OpenGLContext*) _context;
PostDeleteTextures(context, false);
dmPlatform::SwapBuffers(context->m_Window);
CHECK_GL_ERROR;
}

Expand Down
3 changes: 3 additions & 0 deletions engine/hid/src/test/test_app_hid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ static void* EngineCreate(int argc, char** argv)

static const char* KeyToStr(dmHID::Key key)
{
#if !defined(DM_PLATFORM_VENDOR)
switch(key)
{
case dmHID::KEY_SPACE:return "KEY_SPACE";
Expand Down Expand Up @@ -318,7 +319,9 @@ static const char* KeyToStr(dmHID::Key key)
case dmHID::KEY_RSUPER:return "KEY_RSUPER";
case dmHID::KEY_MENU:return "KEY_MENU";
case dmHID::KEY_BACK:return "KEY_BACK";
default: break;
}
#endif // DM_PLATFORM_VENDOR

return "<UNKNOWN-KEY>";
}
Expand Down
1 change: 1 addition & 0 deletions engine/platform/src/platform_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ namespace dmPlatform
DEVICE_STATE_KEYBOARD_PASSWORD = 7,
DEVICE_STATE_KEYBOARD_RESET = 8,
DEVICE_STATE_JOYSTICK_PRESENT = 9,
DEVICE_STATE_MAX // Used to create arrays of correct size (private repo)
};

enum GamepadEvent
Expand Down
23 changes: 16 additions & 7 deletions scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@
import build_vendor
sys.modules['build_private'] = build_vendor
print("Imported %s from %s" % ('build_private', build_vendor.__file__))
except ModuleNotFoundError:
pass
except ModuleNotFoundError as e:
if "No module named 'build_vendor'" in str(e):
print("Couldn't find build_vendor.py. Skipping.")
pass
else:
raise e
except Exception as e:
print("Failed to import build_vendor.py:")
raise e
Expand Down Expand Up @@ -1436,11 +1440,16 @@ def build_sdk(self):
platforms = build_private.get_target_platforms()
else:
platforms = get_target_platforms()
# Since we usually want to use the scripts in this package on a linux machine, we'll unpack
# it last, in order to preserve unix line endings in the files
if 'x86_64-linux' in platforms:
platforms.remove('x86_64-linux')
platforms.append('x86_64-linux')

# For the linux build tools (protoc, dlib_shared etc)
if 'x86_64-linux' not in platforms:
platforms.append('x86_64-linux')

# Since we usually want to use the scripts in this package on a linux machine, we'll unpack
# it last, in order to preserve unix line endings in the files
if 'x86_64-linux' in platforms:
platforms.remove('x86_64-linux')
platforms.append('x86_64-linux')

for platform in platforms:
prefix = os.path.join(base_prefix, 'engine', platform, 'defoldsdk.zip')
Expand Down
2 changes: 2 additions & 0 deletions scripts/copy_from_private_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
FILE_PATTERNS.append('meta.properties') # TODO: create meta.edn plugins for extensions
FILE_PATTERNS.append('build.xml') # TODO: make a strategy here

FILE_PATTERNS.append('platform.sdks.json')

#FILE_PATTERNS.append('com.dynamo.cr.bob') # TODO: until we've fixed the above bob cases

LOCAL_PATTERNS=[]
Expand Down
7 changes: 7 additions & 0 deletions scripts/unpack_ddf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@

import os, sys

try:
from google.protobuf import text_format
except:
dynamo_home = os.environ.get('DYNAMO_HOME')
sys.path.append(os.path.join(dynamo_home, "lib", "python"))
sys.path.append(os.path.join(dynamo_home, "ext", "lib", "python"))

from google.protobuf import text_format
import google.protobuf.message

Expand Down
8 changes: 3 additions & 5 deletions share/ext/luajit/build_win32.bat
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ goto :END
set TMP_TARGET=tmp_%PLATFORM%

set URL=https://github.com/LuaJIT/LuaJIT/archive/
set SHA1=04dca7911ea255f37be799c18d74c305b921c1a6
set SHA1_SHORT=04dca79
set VERSION=2.1.0-%SHA1_SHORT%
set PRODUCT=luajit
set TARGET_FILE=%PRODUCT%-%VERSION%

call version.bat

set PATCH_FILE=patch_%VERSION%

set ZIPFILENAME=%SHA1%.zip
Expand Down

0 comments on commit 6596bc1

Please sign in to comment.