mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-31 11:46:58 +08:00
groundwork for new asset system
This commit is contained in:
parent
ecc5a359c1
commit
65d531261d
1728
.efrocachemap
1728
.efrocachemap
File diff suppressed because it is too large
Load Diff
2
.idea/dictionaries/ericf.xml
generated
2
.idea/dictionaries/ericf.xml
generated
@ -177,6 +177,7 @@
|
||||
<w>ballisticacorecb</w>
|
||||
<w>bamaster</w>
|
||||
<w>bamasteraddr</w>
|
||||
<w>bamasterlegacy</w>
|
||||
<w>bameta</w>
|
||||
<w>bametainternal</w>
|
||||
<w>barcolor</w>
|
||||
@ -1671,6 +1672,7 @@
|
||||
<w>pipvers</w>
|
||||
<w>pkey</w>
|
||||
<w>pkgutil</w>
|
||||
<w>platstr</w>
|
||||
<w>playercast</w>
|
||||
<w>playerdata</w>
|
||||
<w>playerinfos</w>
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
### 1.6.6 (20394)
|
||||
- Beginning work on moving to new asset system.
|
||||
|
||||
### 1.6.5 (20394)
|
||||
- Added co-op support to server builds (thanks Dliwk!)
|
||||
- Updated everything from Python 3.8 to Python 3.9. The biggest immediate impact to our code is that basic types such as list, dict, and tuple can be used in annotations, eliminating the need to import typing.Dict, typing.List, etc. See python.org for more changes.
|
||||
|
||||
6
Makefile
6
Makefile
@ -188,11 +188,11 @@ RUN_PREFAB_MAC_ARM64_GUI_DEBUG = cd build/prefab/full/mac_arm64_gui/debug \
|
||||
&& ./ballisticacore
|
||||
|
||||
prefab-mac-x86-64-gui-debug: prefab-mac-x86-64-gui-debug-build
|
||||
@tools/pcommand ensure_build_platform mac_x86_64
|
||||
@tools/pcommand ensure_prefab_platform mac_x86_64
|
||||
@${RUN_PREFAB_MAC_X86_64_GUI_DEBUG}
|
||||
|
||||
prefab-mac-arm64-gui-debug: prefab-mac-arm64-gui-debug-build
|
||||
@tools/pcommand ensure_build_platform mac_arm64
|
||||
@tools/pcommand ensure_prefab_platform mac_arm64
|
||||
@${RUN_PREFAB_MAC_ARM64_GUI_DEBUG}
|
||||
|
||||
prefab-mac-x86-64-gui-debug-build: prereqs assets-cmake \
|
||||
@ -855,7 +855,7 @@ cmake-build: assets-cmake resources meta
|
||||
@cd build/cmake/$(CM_BT_LC) && test -f Makefile \
|
||||
|| cmake -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) \
|
||||
${PWD}/ballisticacore-cmake
|
||||
@cd build/cmake/$(CM_BT_LC) && $(MAKE) -j$(CPUS)
|
||||
@cd build/cmake/$(CM_BT_LC) && $(MAKE) -j$(CPUS) ballisticacore
|
||||
|
||||
cmake-clean:
|
||||
rm -rf build/cmake/$(CM_BT_LC)
|
||||
|
||||
@ -79,6 +79,7 @@
|
||||
<w>ballistica</w>
|
||||
<w>ballisticacore</w>
|
||||
<w>bamasteraddr</w>
|
||||
<w>bamasterlegacy</w>
|
||||
<w>bameta</w>
|
||||
<w>bametainternal</w>
|
||||
<w>barebones</w>
|
||||
@ -799,6 +800,7 @@
|
||||
<w>piplist</w>
|
||||
<w>pipvers</w>
|
||||
<w>pixelformat</w>
|
||||
<w>platstr</w>
|
||||
<w>playpause</w>
|
||||
<w>playsound</w>
|
||||
<w>plen</w>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<!-- THIS FILE IS AUTO GENERATED; DO NOT EDIT BY HAND -->
|
||||
<h4><em>last updated on 2021-10-23 for Ballistica version 1.6.5 build 20395</em></h4>
|
||||
<h4><em>last updated on 2021-11-02 for Ballistica version 1.6.6 build 20400</em></h4>
|
||||
<p>This page documents the Python classes and functions in the 'ba' module,
|
||||
which are the ones most relevant to modding in Ballistica. If you come across something you feel should be included here or could be better explained, please <a href="mailto:support@froemling.net">let me know</a>. Happy modding!</p>
|
||||
<hr>
|
||||
|
||||
@ -21,8 +21,8 @@
|
||||
namespace ballistica {
|
||||
|
||||
// These are set automatically via script; don't modify them here.
|
||||
const int kAppBuildNumber = 20395;
|
||||
const char* kAppVersion = "1.6.5";
|
||||
const int kAppBuildNumber = 20400;
|
||||
const char* kAppVersion = "1.6.6";
|
||||
|
||||
// Our standalone globals.
|
||||
// These are separated out for easy access.
|
||||
|
||||
@ -495,7 +495,6 @@ def get_current_prefab_platform(wsl_gives_windows: bool = True) -> str:
|
||||
return 'mac_x86_64'
|
||||
if machine == 'arm64':
|
||||
return 'mac_arm64'
|
||||
# TODO: add support for arm macs.
|
||||
raise RuntimeError(f'make_prefab: unsupported mac machine type:'
|
||||
f' {machine}.')
|
||||
if system == 'Linux':
|
||||
@ -659,29 +658,29 @@ def get_pip_reqs() -> list[str]:
|
||||
return out
|
||||
|
||||
|
||||
def update_makebob() -> None:
|
||||
"""Build fresh make_bob binaries for all relevant platforms."""
|
||||
print('Building mac_x86_64...', flush=True)
|
||||
env = dict(os.environ)
|
||||
env['CMAKE_BUILD_TYPE'] = 'Release'
|
||||
subprocess.run(['make', 'cmake-build'], check=True, env=env)
|
||||
subprocess.run(
|
||||
[
|
||||
'cp', '-v', 'build/cmake/release/make_bob',
|
||||
'tools/make_bob/mac_x86_64/'
|
||||
],
|
||||
check=True,
|
||||
)
|
||||
print('Building linux_x86_64...', flush=True)
|
||||
subprocess.run(['make', 'linux-vm-build'], check=True, env=env)
|
||||
subprocess.run(
|
||||
[
|
||||
'cp', '-v', 'build/linux-release/make_bob',
|
||||
'tools/make_bob/linux_x86_64/'
|
||||
],
|
||||
check=True,
|
||||
)
|
||||
print('All builds complete!', flush=True)
|
||||
# def update_makebob() -> None:
|
||||
# """Build fresh make_bob binaries for all relevant platforms."""
|
||||
# print('Building mac_x86_64...', flush=True)
|
||||
# env = dict(os.environ)
|
||||
# env['CMAKE_BUILD_TYPE'] = 'Release'
|
||||
# subprocess.run(['make', 'cmake-build'], check=True, env=env)
|
||||
# subprocess.run(
|
||||
# [
|
||||
# 'cp', '-v', 'build/cmake/release/make_bob',
|
||||
# 'tools/make_bob/mac_x86_64/'
|
||||
# ],
|
||||
# check=True,
|
||||
# )
|
||||
# print('Building linux_x86_64...', flush=True)
|
||||
# subprocess.run(['make', 'linux-vm-build'], check=True, env=env)
|
||||
# subprocess.run(
|
||||
# [
|
||||
# 'cp', '-v', 'build/linux-release/make_bob',
|
||||
# 'tools/make_bob/linux_x86_64/'
|
||||
# ],
|
||||
# check=True,
|
||||
# )
|
||||
# print('All builds complete!', flush=True)
|
||||
|
||||
|
||||
def _get_server_config_raw_contents(projroot: str) -> str:
|
||||
|
||||
@ -589,7 +589,13 @@ def wsl_path_to_win() -> None:
|
||||
|
||||
|
||||
def ensure_prefab_platform() -> None:
|
||||
"""Ensure we are building on a particular platform."""
|
||||
"""Ensure we are running on a particular prefab platform.
|
||||
|
||||
Note that prefab platform may not exactly match hardware/os.
|
||||
For example, when running in Linux under a WSL environment,
|
||||
the prefab platform may be Windows; not Linux. Also, a 64-bit
|
||||
os may be targeting a 32-bit platform.
|
||||
"""
|
||||
import batools.build
|
||||
from efro.error import CleanError
|
||||
|
||||
@ -632,12 +638,6 @@ def make_prefab() -> None:
|
||||
sys.exit(-1)
|
||||
|
||||
|
||||
def update_makebob() -> None:
|
||||
"""Build fresh make_bob binaries for all relevant platforms."""
|
||||
import batools.build
|
||||
batools.build.update_makebob()
|
||||
|
||||
|
||||
def lazybuild() -> None:
|
||||
"""Run a build command only if an input has changed."""
|
||||
import subprocess
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, TypeVar, Generic, Callable, cast
|
||||
import functools
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any, overload
|
||||
@ -265,4 +266,10 @@ if TYPE_CHECKING:
|
||||
def Call(*_args: Any, **_keywds: Any) -> Any:
|
||||
...
|
||||
|
||||
Call = Call
|
||||
partial = Call
|
||||
else:
|
||||
partial = functools.partial
|
||||
|
||||
# A convenient wrapper around functools.partial which adds type-safety
|
||||
# (though it does not support keyword arguments).
|
||||
# partial = Call if TYPE_CHECKING else functools.partial
|
||||
|
||||
@ -393,7 +393,8 @@ def valuedispatchmethod(
|
||||
# To the type checker's eyes we return a ValueDispatchMethod instance;
|
||||
# this lets it know about our register func and type-check its usage.
|
||||
# In reality we just return a raw function call (for reasons listed above).
|
||||
if TYPE_CHECKING: # pylint: disable=no-else-return
|
||||
# pylint: disable=undefined-variable, no-else-return
|
||||
if TYPE_CHECKING:
|
||||
return ValueDispatcherMethod[TVAL, TRET]()
|
||||
else:
|
||||
return _call_wrapper
|
||||
|
||||
@ -143,7 +143,7 @@ def _export_ipa_from_xcarchive(archivepath: pathlib.Path,
|
||||
exportoptions = textwrap.dedent("""
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
|
||||
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
"https://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>compileBitcode</key>
|
||||
|
||||
@ -307,7 +307,7 @@ def pylint() -> None:
|
||||
efrotools.code.pylint(PROJROOT, full, fast)
|
||||
|
||||
|
||||
def runpylint() -> None:
|
||||
def pylint_files() -> None:
|
||||
"""Run pylint checks on provided filenames."""
|
||||
from efro.terminal import Clr
|
||||
from efro.error import CleanError
|
||||
@ -415,8 +415,8 @@ def _filter_tool_config(cfg: str) -> str:
|
||||
short_names = {
|
||||
'ballistica-internal': 'ba-int',
|
||||
'ballistica': 'ba',
|
||||
'ballistica-master-server-2.0': 'bamaster2',
|
||||
'ballistica-master-server': 'bamaster',
|
||||
'ballistica-master-server-legacy': 'bamasterlegacy',
|
||||
'ballistica-server-node': 'baservnode',
|
||||
}
|
||||
shortname = short_names.get(PROJROOT.name, PROJROOT.name)
|
||||
|
||||
@ -35,31 +35,47 @@ def failed_import_hook(modname: str) -> None:
|
||||
raise astroid.AstroidBuildingError(modname=modname)
|
||||
|
||||
|
||||
def ignore_type_check_filter(node: nc.NodeNG) -> nc.NodeNG:
|
||||
def ignore_type_check_filter(if_node: nc.NodeNG) -> nc.NodeNG:
|
||||
"""Ignore stuff under 'if TYPE_CHECKING:' block at module level."""
|
||||
|
||||
# Look for a non-nested 'if TYPE_CHECKING:'
|
||||
if (isinstance(node.test, astroid.Name)
|
||||
and node.test.name == 'TYPE_CHECKING'
|
||||
and isinstance(node.parent, astroid.Module)):
|
||||
if (isinstance(if_node.test, astroid.Name)
|
||||
and if_node.test.name == 'TYPE_CHECKING'
|
||||
and isinstance(if_node.parent, astroid.Module)):
|
||||
|
||||
# Find the module node.
|
||||
mnode = node
|
||||
while mnode.parent is not None:
|
||||
mnode = mnode.parent
|
||||
module_node = if_node.parent
|
||||
|
||||
# First off, remove any names that are getting defined
|
||||
# in this block from the module locals.
|
||||
for cnode in node.body:
|
||||
_strip_import(cnode, mnode)
|
||||
# Remove any locals getting defined under this if statement.
|
||||
# (ideally should recurse in case we have nested if statements/etc
|
||||
# but keeping it simple for now).
|
||||
for name, locations in list(module_node.locals.items()):
|
||||
# Calc which remaining name locations are outside of the if
|
||||
# block. Update or delete the list as needed.
|
||||
new_locs = [l for l in locations if not _under_if(l, if_node)]
|
||||
if len(new_locs) == len(locations):
|
||||
continue
|
||||
if new_locs:
|
||||
module_node.locals[name] = new_locs
|
||||
continue
|
||||
del module_node.locals[name]
|
||||
|
||||
# Now replace the body with a simple 'pass'. This will
|
||||
# keep pylint from complaining about grouped imports/etc.
|
||||
passnode = astroid.Pass(parent=node,
|
||||
lineno=node.lineno + 1,
|
||||
col_offset=node.col_offset + 1)
|
||||
node.body = [passnode]
|
||||
return node
|
||||
# Now replace its children with a simple pass statement.
|
||||
passnode = astroid.Pass(parent=if_node,
|
||||
lineno=if_node.lineno + 1,
|
||||
col_offset=if_node.col_offset + 1)
|
||||
if_node.body = [passnode]
|
||||
return if_node
|
||||
|
||||
|
||||
def _under_if(node: nc.NodeNG, if_node: nc.NodeNG) -> bool:
|
||||
"""Return whether the node is under the if statement.
|
||||
|
||||
(This returns False if it is under an elif/else portion)
|
||||
"""
|
||||
# Quick out:
|
||||
if node.parent is not if_node:
|
||||
return False
|
||||
return node in if_node.body
|
||||
|
||||
|
||||
def ignore_reveal_type_call(node: nc.NodeNG) -> nc.NodeNG:
|
||||
@ -78,19 +94,6 @@ def ignore_reveal_type_call(node: nc.NodeNG) -> nc.NodeNG:
|
||||
return node
|
||||
|
||||
|
||||
def _strip_import(cnode: nc.NodeNG, mnode: nc.NodeNG) -> None:
|
||||
if isinstance(cnode, (astroid.Import, astroid.ImportFrom)):
|
||||
for name, val in list(mnode.locals.items()):
|
||||
if cnode in val:
|
||||
|
||||
# Pull us out of the list.
|
||||
valnew = [v for v in val if v is not cnode]
|
||||
if valnew:
|
||||
mnode.locals[name] = valnew
|
||||
else:
|
||||
del mnode.locals[name]
|
||||
|
||||
|
||||
def using_future_annotations(node: nc.NodeNG) -> nc.NodeNG:
|
||||
"""Return whether postponed annotation evaluation is enabled (PEP 563)."""
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@ from typing import TYPE_CHECKING
|
||||
# pylint: disable=unused-import
|
||||
from efrotools.pcommand import (
|
||||
PROJROOT, pcommand_main, formatcode, formatscripts, formatmakefile,
|
||||
cpplint, pylint, runpylint, mypy, runmypy, dmypy, tool_config_install,
|
||||
cpplint, pylint, pylint_files, mypy, runmypy, dmypy, tool_config_install,
|
||||
sync, sync_all, scriptfiles, pycharm, clioncode, androidstudiocode,
|
||||
makefile_target_list, spelling, spelling_all, pytest, echo,
|
||||
compile_python_files, pyver, try_repeat)
|
||||
@ -35,8 +35,8 @@ from batools.pcommand import (
|
||||
python_gather, python_winprune, capitalize, upper, efrocache_update,
|
||||
efrocache_get, get_modern_make, warm_start_asset_build, gendocs,
|
||||
update_docs_md, list_pip_reqs, install_pip_reqs, checkenv,
|
||||
ensure_prefab_platform, prefab_run_var, make_prefab, update_makebob,
|
||||
lazybuild, android_archive_unstripped_libs, efro_gradle, stage_assets,
|
||||
ensure_prefab_platform, prefab_run_var, make_prefab, lazybuild,
|
||||
android_archive_unstripped_libs, efro_gradle, stage_assets,
|
||||
update_assets_makefile, update_project, update_cmake_prefab_lib,
|
||||
cmake_prep_dir, gen_binding_code, gen_flat_data_code, wsl_path_to_win,
|
||||
wsl_build_check_win_drive, win_ci_binary_build, genchangelog,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user