Update Files

This commit is contained in:
2025-01-22 16:18:30 +01:00
parent ed4603cf95
commit a36294b518
16718 changed files with 2960346 additions and 0 deletions

View File

@ -0,0 +1,34 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "{package}"
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
signingConfigs {
release {
if (project.hasProperty('RELEASE_STORE_FILE')) {
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
}
}
buildTypes {
release {
if (project.hasProperty('RELEASE_STORE_FILE')) {
signingConfig signingConfigs.release
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main.java.srcDirs += 'src/main/../../../src'
}
}

View File

@ -0,0 +1 @@
/build

View File

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View File

@ -0,0 +1,27 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

View File

@ -0,0 +1,13 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild

View File

@ -0,0 +1,15 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

Binary file not shown.

View File

@ -0,0 +1,6 @@
#Sun Feb 03 14:14:14 CET 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

172
Kha/Tools/khamake/Data/android/gradlew vendored Normal file
View File

@ -0,0 +1,172 @@
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

View File

@ -0,0 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@ -0,0 +1,29 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<Objective-C-extensions>
<file>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
</file>
<class>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
</class>
<extensions>
<pair source="cpp" header="h" fileNamingConvention="NONE" />
<pair source="c" header="h" fileNamingConvention="NONE" />
</extensions>
</Objective-C-extensions>
</code_scheme>
</component>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>

View File

@ -0,0 +1,19 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="{package}" android:installLocation="{installLocation}">{permissions}
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true">
<activity android:name="tech.kode.kha.KhaActivity"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize"
android:screenOrientation="{screenOrientation}"
android:launchMode="singleTask"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@ -0,0 +1,3 @@
<resources>
<string name="app_name">{name}</string>
</resources>

View File

@ -0,0 +1 @@
include ':app'

View File

@ -0,0 +1,58 @@
'use strict';
const electron = require('electron');
const fs = require('fs');
const path = require('path');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
var mainWindow = null;
electron.ipcMain.on('show-window', (event, arg) => {
if (arg.width && arg.height) mainWindow.setContentSize(arg.width, arg.height);
if (arg.title) mainWindow.setTitle(arg.title);
if (arg.x != -1 && arg.y != -1) {
mainWindow.setPosition(arg.x, arg.y);
}
else {
mainWindow.center();
}
mainWindow.show();
});
electron.ipcMain.on('load-blob', (event, arg) => {
let url = null;
if (path.isAbsolute(arg.file)) {
url = arg.file;
}
else {
url = path.join(__dirname, arg.file);
}
try {
const data = fs.readFileSync(url);
mainWindow.webContents.send('blob-loaded', {id: arg.id, data: data});
}
catch (err) {
mainWindow.webContents.send('blob-failed', {id: arg.id, url: url, error: err});
}
});
app.on('window-all-closed', function () {
app.quit();
});
app.on('ready', function () {
mainWindow = new BrowserWindow({
width: {Width}, height: {Height},
show: false, useContentSize: true, autoHideMenuBar: true,
icon: app.getAppPath() + '/favicon' + {ext},
webPreferences: {
contextIsolation: true,
preload: path.join(app.getAppPath(), 'preload.js')
}
});
mainWindow.loadURL('file://' + app.getAppPath() + '/index.html');
mainWindow.on('closed', function() {
mainWindow = null;
});
});

View File

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' {UnsafeEval};">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
<title>{Name}</title>
<style>
html, body, canvas, div {
margin:0;
padding: 0;
width:100%;
height:100%;
}
#khanvas {
display:block;
border:none;
outline:none;
}
</style>
</head>
<body>
<canvas id="khanvas" width="0" height="0" tabindex="-1"></canvas>
<script src="kha.js"></script>
</body>
</html>

View File

@ -0,0 +1,5 @@
{
"name" : "kodestudio-debug",
"version" : "0.1.0",
"main" : "electron.js"
}

View File

@ -0,0 +1,48 @@
const electron = require('electron');
const fs = require('fs');
const path = require('path');
let blobId = 0;
let blobRequests = {};
electron.ipcRenderer.on('blob-loaded', (event, args) => {
const blobRequest = blobRequests[args.id];
delete blobRequests[args.id];
blobRequest.done(new Uint8Array(args.data));
});
electron.ipcRenderer.on('blob-failed', (event, args) => {
const blobRequest = blobRequests[args.id];
delete blobRequests[args.id];
blobRequest.failed({url: args.url, error: args.error});
});
electron.contextBridge.exposeInMainWorld(
'electron', {
{Expose}
showWindow: (title, x, y, width, height) => {
if (electron.webFrame.setZoomLevelLimits != null) { // TODO: Figure out why this check is sometimes required
electron.webFrame.setZoomLevelLimits(1, 1);
}
const options = {
title: title,
x: x,
y: y,
width: width,
height: height,
};
electron.ipcRenderer.send('show-window', options);
},
loadBlob: (desc, done, failed) => {
const options = {
file: desc.files[0],
id: blobId++
};
blobRequests[options.id] = {
done: done,
failed: failed
};
electron.ipcRenderer.send('load-blob', options);
}
}
);

View File

@ -0,0 +1,5 @@
let project = new Project('HaxeC');
project.addFiles('kore_sources.c');
project.addFiles('Sources/**.metal');
project.addIncludeDirs('.');
resolve(project);

View File

@ -0,0 +1,5 @@
let project = new Project('HaxeC');
project.addFiles('kore_sources.c');
project.addFiles('Sources/**.metal');
project.addIncludeDirs('.');
resolve(project);

View File

@ -0,0 +1,5 @@
#include "sources.c"
void frame() {
kha_SystemImpl_frame();
}

View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
<title>{Name}</title>
</head>
<body>
<canvas id="{CanvasId}" width="{Width}" height="{Height}" tabindex="-1"></canvas>
<script src="{ScriptName}.js"></script>
</body>
</html>

View File

@ -0,0 +1,13 @@
let project = new Project('HaxeCpp');
if (platform === Platform.WindowsApp) {
project.addFiles('Sources/**.h', 'Sources/**.cpp');
}
else {
project.addFiles('Sources/**.h', 'Sources/**.cpp', { pch: 'hxcpp.h' });
}
project.addFiles('Sources/src/resources/**.cpp');
project.addFiles('Sources/src/__lib__.cpp', 'Sources/src/__boot__.cpp');
project.addExcludes('Sources/src/__main__.cpp');
project.addIncludeDirs('Sources/include');
//project.addDefine('HX_SMART_STRINGS');
resolve(project);

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>

View File

@ -0,0 +1,3 @@
<component name="CopyrightManager">
<settings default="" />
</component>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="HaxeProjectSettings" defines="{defines}" />
</project>

View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ClientPropertiesManager">
<properties class="javax.swing.AbstractButton">
<property name="hideActionText" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JComponent">
<property name="html.disable" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JEditorPane">
<property name="JEditorPane.w3cLengthUnits" class="java.lang.Boolean" />
<property name="JEditorPane.honorDisplayProperties" class="java.lang.Boolean" />
<property name="charset" class="java.lang.String" />
</properties>
<properties class="javax.swing.JList">
<property name="List.isFileList" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JPasswordField">
<property name="JPasswordField.cutCopyAllowed" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JSlider">
<property name="Slider.paintThumbArrowShape" class="java.lang.Boolean" />
<property name="JSlider.isFilled" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JTable">
<property name="Table.isFileList" class="java.lang.Boolean" />
<property name="JTable.autoStartsEdit" class="java.lang.Boolean" />
<property name="terminateEditOnFocusLost" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JToolBar">
<property name="JToolBar.isRollover" class="java.lang.Boolean" />
</properties>
<properties class="javax.swing.JTree">
<property name="JTree.lineStyle" class="java.lang.String" />
</properties>
<properties class="javax.swing.text.JTextComponent">
<property name="caretAspectRatio" class="java.lang.Double" />
<property name="caretWidth" class="java.lang.Integer" />
</properties>
</component>
<component name="MavenImportPreferences">
<option name="generalSettings">
<MavenGeneralSettings>
<option name="mavenHome" value="Bundled (Maven 3)" />
</MavenGeneralSettings>
</option>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="Haxe 3.2.0" project-jdk-type="Haxe toolkit">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/{name}.iml" filepath="$PROJECT_DIR$/{name}.iml" />
</modules>
</component>
</project>

View File

@ -0,0 +1 @@
{name}

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="" />
</component>
</project>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="HAXE_MODULE" version="4">
<component name="HaxeModuleSettingsStorage">
<option name="arguments" value="{args}" />
<option name="buildConfig" value="1" />
<option name="excludeFromCompilation" value="true" />
<option name="flexSdkName" value="flex_sdk_4.6" />
<option name="haxeTarget" value="{target}" />
<option name="hxmlPath" value="$MODULE_DIR$/../{name}-{system}.hxml" />
<option name="mainClass" value="Main" />
<option name="outputFileName" value="kha.swf" />
<option name="outputFolder" value="$MODULE_DIR$/../{system}" />
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/../{system}" />
<exclude-output />
<content url="file://$MODULE_DIR$/../..">
{sources}
</content>
{libraries}
<orderEntry type="jdk" jdkName="Haxe 3.2.0" jdkType="Haxe toolkit" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -0,0 +1,21 @@
{
"name": "kha-server",
"version": "1.0.0",
"description": "",
"main": "kha.js",
"dependencies": {
"express": "^4.13.3",
"express-ws": "^0.2.6"
},
"devDependencies": {
"nodemon": "^1.11.0",
"livereloadx": "^0.3.10"
},
"scripts": {
"autoserve": "nodemon kha.js",
"autoreload": "livereloadx ./",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "khamake",
"license": "Zlib"
}

View File

@ -0,0 +1,71 @@
const port = 6789;
const playersPerSession = 2;
const child_process = require('child_process');
const fs = require('fs');
const path = require('path');
if (!fs.existsSync('node_modules')) {
console.log('Please run npm install.')
process.exit(1);
}
const express = require('express');
app = express();
require('express-ws')(app);
if (!fs.existsSync(path.join('..', 'html5'))) {
console.log('Please compile for html5 before running the server.');
process.exit(1);
}
app.use('/', express.static('../html5'));
app.use((err, req, res, next) => {
console.error(err.stack);
});
class Session {
constructor() {
this.clients = [];
this.instance = child_process.fork('./kha.js');
this.instance.on('message', (message) => {
this.clients[message.id].send(Buffer.from(message.data));
});
}
}
let sessions = [];
let pendingSession = new Session();
app.ws('/', (socket, req) => {
console.log('Client connected.');
socket.session = pendingSession;
socket.id = socket.session.clients.length;
socket.session.clients.push(socket);
socket.session.instance.send({message: 'connect', id: socket.id});
socket.on('message', function (message) {
socket.session.instance.send({message: 'message', data: message, id: socket.id});
});
socket.onclose = () => {
console.log('Removing client ' + socket.id + '.');
socket.session.instance.send({message: 'disconnect', id: socket.id});
socket.session.clients.remove(socket);
if (socket.session.clients.length === 0) {
socket.session.instance.kill();
sessions.remove(socket.session);
}
};
if (pendingSession.clients.length === playersPerSession) {
console.log('Starting session.');
sessions.push(pendingSession);
pendingSession = new Session();
}
});
console.log('Starting server at ' + port + '.');
app.listen(port);

View File

@ -0,0 +1,28 @@
/*
#version 100
#ifdef GL_ES
precision mediump float;
#endif
uniform sampler2D tex;
varying vec2 texCoord;
varying vec4 color;
void kore() {
vec4 texcolor = texture2D(tex, texCoord) * color;
texcolor.rgb *= color.a;
gl_FragColor = texcolor;
}
*/
/*void main(float2 in v_TexCoord : TEXCOORD0, float4 out Color : COLOR, uniform sampler2D Texture0 : TEXUNIT0) {
Color = tex2D(Texture0, v_TexCoord);
}*/
void main(float2 in texCoord : TEXCOORD0, float4 in color : TEXCOORD1, float4 out gl_FragColor : COLOR, uniform sampler2D tex : TEXUNIT0) {
float4 texcolor = tex2D(tex, texCoord) * color;
//texcolor.rgb *= color.a;
gl_FragColor = texcolor;
//gl_FragColor = float4(1.0, 0.0, 0.0, 1.0);
}

View File

@ -0,0 +1,31 @@
/*
#version 100
attribute vec3 vertexPosition;
attribute vec2 texPosition;
attribute vec4 vertexColor;
uniform mat4 projectionMatrix;
varying vec2 texCoord;
varying vec4 color;
void kore() {
gl_Position = projectionMatrix * vec4(vertexPosition, 1.0);
texCoord = texPosition;
color = vertexColor;
}
*/
/*void main(float4 in a_Position : POSITION, float2 in a_TexCoord : TEXCOORD0, float4 out v_Position : POSITION, float2 out v_TexCoord : TEXCOORD0, uniform float4x4 WorldViewProj) {
v_Position = mul(a_Position, WorldViewProj);
v_TexCoord = a_TexCoord;
}*/
void main(
float3 in vertexPosition : TEXCOORD0, float2 in texPosition : TEXCOORD1, float4 in vertexColor : TEXCOORD2,
float4 out gl_Position : POSITION, float2 out texCoord : TEXCOORD0, float4 out color : TEXCOORD1,
uniform float4x4 projectionMatrix) {
gl_Position = mul(transpose(projectionMatrix), float4(vertexPosition, 1.0));
gl_Position.z = 0.5;
texCoord = texPosition;
color = vertexColor;
}

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<application project_name="*" version="1.00" default_locale="en-US">
<runtime_config>
<memory managed_heap_size="32768" resource_heap_size="65536" />
</runtime_config>
<feature_list>
<feature value="GamePad" />
<feature value="Touch" />
</feature_list>
</application>