-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RSDKv3 has plus disabled, dw :)
- Loading branch information
Showing
13 changed files
with
230 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
'use-client' | ||
|
||
import '@/app/globals.css'; | ||
import * as React from 'react'; | ||
|
||
// -------------------- | ||
// UI Component Imports | ||
// -------------------- | ||
|
||
import Script from 'next/script' | ||
|
||
import { Skeleton } from "@/components/ui/skeleton" | ||
import { ThemeProvider } from '@/app/controls/theme-provider' | ||
|
||
// --------------------- | ||
// Component Definitions | ||
// --------------------- | ||
|
||
// Content of host/v2 | ||
export default function v2() { | ||
return ( | ||
<html lang='en' className='enginePage' suppressHydrationWarning> | ||
<body className='enginePage'> | ||
<ThemeProvider attribute='class' defaultTheme='system' enableSystem> | ||
<div id='splash' className='engineSplash relative flex min-h-screen flex-col bg-background items-center justify-center'> | ||
<div className="flex flex-col space-y-3"> | ||
<Skeleton className="h-[125px] w-[250px] rounded-xl" /> | ||
<div className="space-y-2"> | ||
<Skeleton className="h-4 w-[250px]" /> | ||
<Skeleton className="h-4 w-[200px]" /> | ||
</div> | ||
</div> | ||
</div> | ||
<canvas className='engineCanvas' id='canvas' /> | ||
</ThemeProvider> | ||
<Script src='./lib/Emscripten.js' /> | ||
<Script src='./lib/RSDKv2.js' /> | ||
<Script src='./modules/RSDKv2.js' /> | ||
</body> | ||
</html> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
'use-client' | ||
|
||
import '@/app/globals.css'; | ||
import * as React from 'react'; | ||
|
||
// -------------------- | ||
// UI Component Imports | ||
// -------------------- | ||
|
||
import Script from 'next/script' | ||
|
||
import { Skeleton } from "@/components/ui/skeleton" | ||
import { ThemeProvider } from '@/app/controls/theme-provider' | ||
|
||
// --------------------- | ||
// Component Definitions | ||
// --------------------- | ||
|
||
// Content of host/v2 | ||
export default function v2() { | ||
return ( | ||
<html lang='en' className='enginePage' suppressHydrationWarning> | ||
<body className='enginePage'> | ||
<ThemeProvider attribute='class' defaultTheme='system' enableSystem> | ||
<div id='splash' className='engineSplash relative flex min-h-screen flex-col bg-background items-center justify-center'> | ||
<div className="flex flex-col space-y-3"> | ||
<Skeleton className="h-[125px] w-[250px] rounded-xl" /> | ||
<div className="space-y-2"> | ||
<Skeleton className="h-4 w-[250px]" /> | ||
<Skeleton className="h-4 w-[200px]" /> | ||
</div> | ||
</div> | ||
</div> | ||
<canvas className='engineCanvas' id='canvas' /> | ||
</ThemeProvider> | ||
<Script src='./lib/Emscripten.js' /> | ||
<Script src='./lib/RSDKv3.js' /> | ||
<Script src='./modules/RSDKv3.js' /> | ||
</body> | ||
</html> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
var Module = { | ||
onRuntimeInitialized: function () { | ||
FS.mkdir('FileSystem'); | ||
FS.mount(IDBFS, { autoPersist: true }, 'FileSystem'); | ||
|
||
FS.syncfs(true, function (err) { | ||
if (err) { | ||
alert('Error syncing FS: ' + err); | ||
console.error('Error syncing FS:', err); | ||
reject(err); | ||
} else { | ||
const splash = document.getElementById("splash"); | ||
splash.style.opacity = 0; | ||
|
||
setTimeout(() => { | ||
splash.remove(); | ||
}, 1000); | ||
|
||
console.log('FileSystem initialized'); | ||
RSDK_Init(); | ||
} | ||
}); | ||
}, | ||
print: (function () { | ||
var element = document.getElementById('output'); | ||
if (element) element.value = ''; // clear browser cache | ||
return function (text) { | ||
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' '); | ||
|
||
console.log(text); | ||
if (element) { | ||
element.value += text + "\n"; | ||
element.scrollTop = element.scrollHeight; // focus on bottom | ||
} | ||
}; | ||
})(), | ||
canvas: (() => { | ||
var canvas = document.getElementById('canvas'); | ||
|
||
// As a default initial behavior, pop up an alert when the webgl context is lost. | ||
// To make your application robust, you may want to override this behavior before shipping! | ||
// See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2 | ||
canvas.addEventListener("webglcontextlost", (e) => { alert('WebGL context lost. You will need to reload the page.'); e.preventDefault(); }, false); | ||
|
||
return canvas; | ||
})(), | ||
setStatus: (text) => { | ||
if (!Module.setStatus.last) Module.setStatus.last = { time: Date.now(), text: '' }; | ||
if (text === Module.setStatus.last.text) return; | ||
var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/); | ||
var now = Date.now(); | ||
if (m && now - Module.setStatus.last.time < 30) return; // if this is a progress update, skip it if too soon | ||
Module.setStatus.last.time = now; | ||
Module.setStatus.last.text = text; | ||
|
||
if (m) { | ||
text = m[1]; | ||
} | ||
|
||
// statusElement.innerHTML = text; | ||
}, | ||
totalDependencies: 0, | ||
monitorRunDependencies: (left) => { | ||
this.totalDependencies = Math.max(this.totalDependencies, left); | ||
Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies - left) + '/' + this.totalDependencies + ')' : 'All downloads complete.'); | ||
} | ||
}; | ||
Module.setStatus('Downloading...'); | ||
window.onerror = () => { | ||
Module.setStatus('Exception thrown, see JavaScript console'); | ||
|
||
Module.setStatus = (text) => { | ||
if (text) console.error('[post-exception status] ' + text); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Defined for Emscripten.js to call | ||
function RSDK_Init() | ||
{ | ||
// TODO: Custom FS Path | ||
FS.chdir('/FileSystem/RSDKv2') | ||
_RSDK_Initialize(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Defined for Emscripten.js to call | ||
function RSDK_Init() | ||
{ | ||
// TODO: Custom FS Path, settings | ||
FS.chdir('/FileSystem/RSDKv3') | ||
|
||
// value, index | ||
// index 0 - plus | ||
_RSDK_Configure(0, 0); | ||
_RSDK_Initialize(); | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.