Added ability for PGE to listen to global mouse and window position.
This commit is contained in:
parent
18e6c68b75
commit
570931d5ff
@ -28,9 +28,11 @@ Day 4 Visuals/Clarity
|
|||||||
Attacking Lines
|
Attacking Lines
|
||||||
Buff/Debuff Indicators
|
Buff/Debuff Indicators
|
||||||
Day 5 Enemy AI / Resource Management + Collectors
|
Day 5 Enemy AI / Resource Management + Collectors
|
||||||
(Or Day 7): Hotkeys
|
Memory Allocator Platforms
|
||||||
|
Enemy AI
|
||||||
Day 6 Multiple Levels
|
Day 6 Multiple Levels
|
||||||
Day 7 Tutorializing
|
Day 7 Tutorializing
|
||||||
|
Hotkeys
|
||||||
Day 8 Customized Units
|
Day 8 Customized Units
|
||||||
Day 9 Sounds/Music - Timer (Speedrun) Difficulty Selection
|
Day 9 Sounds/Music - Timer (Speedrun) Difficulty Selection
|
||||||
|
|
||||||
|
@ -335,16 +335,16 @@ void VirusAttack::DrawMinimap(){
|
|||||||
|
|
||||||
void VirusAttack::HandlePanAndZoom(float fElapsedTime){
|
void VirusAttack::HandlePanAndZoom(float fElapsedTime){
|
||||||
float speedScale=std::min(1.f,game.GetWorldScale().x);
|
float speedScale=std::min(1.f,game.GetWorldScale().x);
|
||||||
if(GetKey(A).bHeld/*||GetMouseX()<=CONSTANT::SCROLL_BOUNDARY*/){
|
if(GetKey(A).bHeld||GetMouseScreenX()<=GetWindowPos().x){
|
||||||
game.MoveWorldOffset(vf2d{-256*fElapsedTime,0}/speedScale);
|
game.MoveWorldOffset(vf2d{-256*fElapsedTime,0}/speedScale);
|
||||||
}
|
}
|
||||||
if(GetKey(W).bHeld/*||GetMouseY()<=CONSTANT::SCROLL_BOUNDARY*/){
|
if(GetKey(W).bHeld||GetMouseScreenY()<=GetWindowPos().y){
|
||||||
game.MoveWorldOffset(vf2d{0,-256*fElapsedTime}/speedScale);
|
game.MoveWorldOffset(vf2d{0,-256*fElapsedTime}/speedScale);
|
||||||
}
|
}
|
||||||
if(GetKey(S).bHeld/*||GetMouseY()>=ScreenHeight()-CONSTANT::SCROLL_BOUNDARY*/){
|
if(GetKey(S).bHeld||GetMouseScreenY()>=GetWindowPos().y+GetWindowSize().y){
|
||||||
game.MoveWorldOffset(vf2d{0,256*fElapsedTime}/speedScale);
|
game.MoveWorldOffset(vf2d{0,256*fElapsedTime}/speedScale);
|
||||||
}
|
}
|
||||||
if(GetKey(D).bHeld/*||GetMouseX()>=ScreenWidth()-CONSTANT::SCROLL_BOUNDARY*/){
|
if(GetKey(D).bHeld||GetMouseScreenX()>=GetWindowPos().x+GetWindowSize().x){
|
||||||
game.MoveWorldOffset(vf2d{256*fElapsedTime,0}/speedScale);
|
game.MoveWorldOffset(vf2d{256*fElapsedTime,0}/speedScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -998,6 +998,12 @@ namespace olc
|
|||||||
const olc::vi2d& GetWindowMouse() const;
|
const olc::vi2d& GetWindowMouse() const;
|
||||||
// Gets the mouse as a vector to keep Tarriest happy
|
// Gets the mouse as a vector to keep Tarriest happy
|
||||||
const olc::vi2d& GetMousePos() const;
|
const olc::vi2d& GetMousePos() const;
|
||||||
|
// Get Mouse X coordinate in "screen" space
|
||||||
|
int32_t GetMouseScreenX() const;
|
||||||
|
// Get Mouse Y coordinate in "screen" space
|
||||||
|
int32_t GetMouseScreenY() const;
|
||||||
|
// Gets the mouse as a vector in screen space, this will still keep Tarriest happy
|
||||||
|
const olc::vi2d& GetMouseScreenPos() const;
|
||||||
|
|
||||||
static const std::map<size_t, uint8_t>& GetKeyMap() { return mapKeys; }
|
static const std::map<size_t, uint8_t>& GetKeyMap() { return mapKeys; }
|
||||||
|
|
||||||
@ -1021,6 +1027,8 @@ namespace olc
|
|||||||
uint32_t GetFPS() const;
|
uint32_t GetFPS() const;
|
||||||
// Gets last update of elapsed time
|
// Gets last update of elapsed time
|
||||||
float GetElapsedTime() const;
|
float GetElapsedTime() const;
|
||||||
|
// Gets Actual Window pos
|
||||||
|
const olc::vi2d& GetWindowPos() const;
|
||||||
// Gets Actual Window size
|
// Gets Actual Window size
|
||||||
const olc::vi2d& GetWindowSize() const;
|
const olc::vi2d& GetWindowSize() const;
|
||||||
// Gets pixel scale
|
// Gets pixel scale
|
||||||
@ -1218,10 +1226,13 @@ namespace olc
|
|||||||
olc::vi2d vPixelSize = { 4, 4 };
|
olc::vi2d vPixelSize = { 4, 4 };
|
||||||
olc::vi2d vScreenPixelSize = { 4, 4 };
|
olc::vi2d vScreenPixelSize = { 4, 4 };
|
||||||
olc::vi2d vMousePos = { 0, 0 };
|
olc::vi2d vMousePos = { 0, 0 };
|
||||||
|
olc::vi2d vMouseScreenPos = { 0, 0 };
|
||||||
int32_t nMouseWheelDelta = 0;
|
int32_t nMouseWheelDelta = 0;
|
||||||
olc::vi2d vMousePosCache = { 0, 0 };
|
olc::vi2d vMousePosCache = { 0, 0 };
|
||||||
|
olc::vi2d vMouseScreenPosCache = { 0, 0 };
|
||||||
olc::vi2d vMouseWindowPos = { 0, 0 };
|
olc::vi2d vMouseWindowPos = { 0, 0 };
|
||||||
int32_t nMouseWheelDeltaCache = 0;
|
int32_t nMouseWheelDeltaCache = 0;
|
||||||
|
olc::vi2d vWindowPos = { 0, 0 };
|
||||||
olc::vi2d vWindowSize = { 0, 0 };
|
olc::vi2d vWindowSize = { 0, 0 };
|
||||||
olc::vi2d vViewPos = { 0, 0 };
|
olc::vi2d vViewPos = { 0, 0 };
|
||||||
olc::vi2d vViewSize = { 0,0 };
|
olc::vi2d vViewSize = { 0,0 };
|
||||||
@ -1291,7 +1302,9 @@ namespace olc
|
|||||||
public:
|
public:
|
||||||
// "Break In" Functions
|
// "Break In" Functions
|
||||||
void olc_UpdateMouse(int32_t x, int32_t y);
|
void olc_UpdateMouse(int32_t x, int32_t y);
|
||||||
|
void olc_UpdateScreenMouse(int32_t x, int32_t y);
|
||||||
void olc_UpdateMouseWheel(int32_t delta);
|
void olc_UpdateMouseWheel(int32_t delta);
|
||||||
|
void olc_UpdateWindowPos(int32_t x, int32_t y);
|
||||||
void olc_UpdateWindowSize(int32_t x, int32_t y);
|
void olc_UpdateWindowSize(int32_t x, int32_t y);
|
||||||
void olc_UpdateViewport();
|
void olc_UpdateViewport();
|
||||||
void olc_ConstructFontSheet();
|
void olc_ConstructFontSheet();
|
||||||
@ -2001,6 +2014,7 @@ namespace olc
|
|||||||
|
|
||||||
// Construct the window
|
// Construct the window
|
||||||
if (platform->CreateWindowPane({ 30,30 }, vWindowSize, bFullScreen) != olc::OK) return olc::FAIL;
|
if (platform->CreateWindowPane({ 30,30 }, vWindowSize, bFullScreen) != olc::OK) return olc::FAIL;
|
||||||
|
olc_UpdateWindowPos(30,30);
|
||||||
olc_UpdateWindowSize(vWindowSize.x, vWindowSize.y);
|
olc_UpdateWindowSize(vWindowSize.x, vWindowSize.y);
|
||||||
|
|
||||||
// Start the thread
|
// Start the thread
|
||||||
@ -2114,6 +2128,15 @@ namespace olc
|
|||||||
const olc::vi2d& PixelGameEngine::GetMousePos() const
|
const olc::vi2d& PixelGameEngine::GetMousePos() const
|
||||||
{ return vMousePos; }
|
{ return vMousePos; }
|
||||||
|
|
||||||
|
int32_t PixelGameEngine::GetMouseScreenX() const
|
||||||
|
{ return vMouseScreenPos.x; }
|
||||||
|
|
||||||
|
int32_t PixelGameEngine::GetMouseScreenY() const
|
||||||
|
{ return vMouseScreenPos.y; }
|
||||||
|
|
||||||
|
const olc::vi2d& PixelGameEngine::GetMouseScreenPos() const
|
||||||
|
{ return vMouseScreenPos; }
|
||||||
|
|
||||||
int32_t PixelGameEngine::GetMouseWheel() const
|
int32_t PixelGameEngine::GetMouseWheel() const
|
||||||
{ return nMouseWheelDelta; }
|
{ return nMouseWheelDelta; }
|
||||||
|
|
||||||
@ -2126,6 +2149,9 @@ namespace olc
|
|||||||
float PixelGameEngine::GetElapsedTime() const
|
float PixelGameEngine::GetElapsedTime() const
|
||||||
{ return fLastElapsed; }
|
{ return fLastElapsed; }
|
||||||
|
|
||||||
|
const olc::vi2d& PixelGameEngine::GetWindowPos() const
|
||||||
|
{ return vWindowPos; }
|
||||||
|
|
||||||
const olc::vi2d& PixelGameEngine::GetWindowSize() const
|
const olc::vi2d& PixelGameEngine::GetWindowSize() const
|
||||||
{ return vWindowSize; }
|
{ return vWindowSize; }
|
||||||
|
|
||||||
@ -3760,6 +3786,11 @@ namespace olc
|
|||||||
vViewPos = (vWindowSize - vViewSize) / 2;
|
vViewPos = (vWindowSize - vViewSize) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PixelGameEngine::olc_UpdateWindowPos(int32_t x, int32_t y)
|
||||||
|
{
|
||||||
|
vWindowPos = { x, y };
|
||||||
|
}
|
||||||
|
|
||||||
void PixelGameEngine::olc_UpdateWindowSize(int32_t x, int32_t y)
|
void PixelGameEngine::olc_UpdateWindowSize(int32_t x, int32_t y)
|
||||||
{
|
{
|
||||||
vWindowSize = { x, y };
|
vWindowSize = { x, y };
|
||||||
@ -3786,6 +3817,12 @@ namespace olc
|
|||||||
if (vMousePosCache.y < 0) vMousePosCache.y = 0;
|
if (vMousePosCache.y < 0) vMousePosCache.y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PixelGameEngine::olc_UpdateScreenMouse(int32_t x, int32_t y)
|
||||||
|
{
|
||||||
|
vMouseScreenPos={x,y};
|
||||||
|
vMouseScreenPosCache={x,y};
|
||||||
|
}
|
||||||
|
|
||||||
void PixelGameEngine::olc_UpdateMouseState(int32_t button, bool state)
|
void PixelGameEngine::olc_UpdateMouseState(int32_t button, bool state)
|
||||||
{ pMouseNewState[button] = state; }
|
{ pMouseNewState[button] = state; }
|
||||||
|
|
||||||
@ -3932,6 +3969,11 @@ namespace olc
|
|||||||
for (auto& ext : vExtensions) bExtensionBlockFrame |= ext->OnBeforeUserUpdate(fElapsedTime);
|
for (auto& ext : vExtensions) bExtensionBlockFrame |= ext->OnBeforeUserUpdate(fElapsedTime);
|
||||||
if (!bExtensionBlockFrame)
|
if (!bExtensionBlockFrame)
|
||||||
{
|
{
|
||||||
|
#if defined(OLC_PLATFORM_WINAPI)
|
||||||
|
struct tagPOINT p{0,0};
|
||||||
|
GetCursorPos(&p);
|
||||||
|
olc_UpdateScreenMouse(p.x,p.y);
|
||||||
|
#endif
|
||||||
if (!OnUserUpdate(fElapsedTime)) bAtomActive = false;
|
if (!OnUserUpdate(fElapsedTime)) bAtomActive = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -5594,6 +5636,7 @@ namespace olc
|
|||||||
ptrPGE->olc_UpdateMouse(ix, iy);
|
ptrPGE->olc_UpdateMouse(ix, iy);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
case WM_MOVE: ptrPGE->olc_UpdateWindowPos(lParam & 0xFFFF, (lParam >> 16) & 0xFFFF); return 0;
|
||||||
case WM_SIZE: ptrPGE->olc_UpdateWindowSize(lParam & 0xFFFF, (lParam >> 16) & 0xFFFF); return 0;
|
case WM_SIZE: ptrPGE->olc_UpdateWindowSize(lParam & 0xFFFF, (lParam >> 16) & 0xFFFF); return 0;
|
||||||
case WM_MOUSEWHEEL: ptrPGE->olc_UpdateMouseWheel(GET_WHEEL_DELTA_WPARAM(wParam)); return 0;
|
case WM_MOUSEWHEEL: ptrPGE->olc_UpdateMouseWheel(GET_WHEEL_DELTA_WPARAM(wParam)); return 0;
|
||||||
case WM_MOUSELEAVE: ptrPGE->olc_UpdateMouseFocus(false); return 0;
|
case WM_MOUSELEAVE: ptrPGE->olc_UpdateMouseFocus(false); return 0;
|
||||||
@ -5839,11 +5882,13 @@ namespace olc
|
|||||||
{
|
{
|
||||||
XWindowAttributes gwa;
|
XWindowAttributes gwa;
|
||||||
XGetWindowAttributes(olc_Display, olc_Window, &gwa);
|
XGetWindowAttributes(olc_Display, olc_Window, &gwa);
|
||||||
|
ptrPGE->olc_UpdateWindowPos(gwa.x, gwa.y);
|
||||||
ptrPGE->olc_UpdateWindowSize(gwa.width, gwa.height);
|
ptrPGE->olc_UpdateWindowSize(gwa.width, gwa.height);
|
||||||
}
|
}
|
||||||
else if (xev.type == ConfigureNotify)
|
else if (xev.type == ConfigureNotify)
|
||||||
{
|
{
|
||||||
XConfigureEvent xce = xev.xconfigure;
|
XConfigureEvent xce = xev.xconfigure;
|
||||||
|
ptrPGE->olc_UpdateWindowPos(xce.x, xce.y);
|
||||||
ptrPGE->olc_UpdateWindowSize(xce.width, xce.height);
|
ptrPGE->olc_UpdateWindowSize(xce.width, xce.height);
|
||||||
}
|
}
|
||||||
else if (xev.type == KeyPress)
|
else if (xev.type == KeyPress)
|
||||||
@ -6340,7 +6385,7 @@ namespace olc
|
|||||||
emscripten_set_focus_callback("#canvas", 0, 1, focus_callback);
|
emscripten_set_focus_callback("#canvas", 0, 1, focus_callback);
|
||||||
|
|
||||||
#pragma warning disable format
|
#pragma warning disable format
|
||||||
EM_ASM( window.onunload = Module._olc_OnPageUnload; );
|
EM_ASM( window.onunload = Module._olc_OnPageUnload;);
|
||||||
|
|
||||||
// IMPORTANT! - Sorry About This...
|
// IMPORTANT! - Sorry About This...
|
||||||
//
|
//
|
||||||
@ -6363,6 +6408,7 @@ namespace olc
|
|||||||
// dimensions of the canvas container's element.
|
// dimensions of the canvas container's element.
|
||||||
Module.olc_AspectRatio = $0 / $1;
|
Module.olc_AspectRatio = $0 / $1;
|
||||||
|
|
||||||
|
onmousemove = function(e){Module.olc_MOUSEX=e.clientX;Module.olc_MOUSEY=e.clientY;};
|
||||||
// HACK ALERT!
|
// HACK ALERT!
|
||||||
//
|
//
|
||||||
// Here we assume any html shell that uses 3 or more instance of the class "emscripten"
|
// Here we assume any html shell that uses 3 or more instance of the class "emscripten"
|
||||||
@ -6414,8 +6460,6 @@ namespace olc
|
|||||||
Module.canvas.focus();
|
Module.canvas.focus();
|
||||||
}, 200);
|
}, 200);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// olc_Init
|
// olc_Init
|
||||||
//
|
//
|
||||||
// set up resize observer and fullscreenchange event handler
|
// set up resize observer and fullscreenchange event handler
|
||||||
@ -6451,10 +6495,17 @@ namespace olc
|
|||||||
Module.olc_Init();
|
Module.olc_Init();
|
||||||
|
|
||||||
}, vWindowSize.x, vWindowSize.y); // Fullscreen and Resize Observers
|
}, vWindowSize.x, vWindowSize.y); // Fullscreen and Resize Observers
|
||||||
|
|
||||||
#pragma warning restore format
|
#pragma warning restore format
|
||||||
return olc::rcode::OK;
|
return olc::rcode::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void UpdateScreenMouse(int x, int y)
|
||||||
|
{
|
||||||
|
ptrPGE->olc_UpdateScreenMouse(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
// Interface PGE's UpdateWindowSize, for use in Javascript
|
// Interface PGE's UpdateWindowSize, for use in Javascript
|
||||||
void UpdateWindowSize(int width, int height)
|
void UpdateWindowSize(int width, int height)
|
||||||
{
|
{
|
||||||
@ -6508,12 +6559,14 @@ namespace olc
|
|||||||
if (eventType == EMSCRIPTEN_EVENT_TOUCHMOVE)
|
if (eventType == EMSCRIPTEN_EVENT_TOUCHMOVE)
|
||||||
{
|
{
|
||||||
ptrPGE->olc_UpdateMouse(e->touches->targetX, e->touches->targetY);
|
ptrPGE->olc_UpdateMouse(e->touches->targetX, e->touches->targetY);
|
||||||
|
ptrPGE->olc_UpdateScreenMouse(e->touches->targetX, e->touches->targetY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start
|
// Start
|
||||||
if (eventType == EMSCRIPTEN_EVENT_TOUCHSTART)
|
if (eventType == EMSCRIPTEN_EVENT_TOUCHSTART)
|
||||||
{
|
{
|
||||||
ptrPGE->olc_UpdateMouse(e->touches->targetX, e->touches->targetY);
|
ptrPGE->olc_UpdateMouse(e->touches->targetX, e->touches->targetY);
|
||||||
|
ptrPGE->olc_UpdateScreenMouse(e->touches->targetX, e->touches->targetY);
|
||||||
ptrPGE->olc_UpdateMouseState(0, true);
|
ptrPGE->olc_UpdateMouseState(0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6530,8 +6583,10 @@ namespace olc
|
|||||||
static EM_BOOL mouse_callback(int eventType, const EmscriptenMouseEvent* e, void* userData)
|
static EM_BOOL mouse_callback(int eventType, const EmscriptenMouseEvent* e, void* userData)
|
||||||
{
|
{
|
||||||
//Mouse Movement
|
//Mouse Movement
|
||||||
if (eventType == EMSCRIPTEN_EVENT_MOUSEMOVE)
|
if (eventType == EMSCRIPTEN_EVENT_MOUSEMOVE){
|
||||||
ptrPGE->olc_UpdateMouse(e->targetX, e->targetY);
|
ptrPGE->olc_UpdateMouse(e->targetX, e->targetY);
|
||||||
|
ptrPGE->olc_UpdateScreenMouse(e->targetX, e->targetY);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//Mouse button press
|
//Mouse button press
|
||||||
@ -6578,6 +6633,10 @@ namespace olc
|
|||||||
|
|
||||||
static void MainLoop()
|
static void MainLoop()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
ptrPGE->olc_UpdateWindowPos(EM_ASM_INT({return Module.canvas.getBoundingClientRect().left}),EM_ASM_INT({return Module.canvas.getBoundingClientRect().top}));
|
||||||
|
vi2d screenMousePos = {EM_ASM_INT({return Module.olc_MOUSEX;}),EM_ASM_INT({return Module.olc_MOUSEY;})};
|
||||||
|
ptrPGE->olc_UpdateScreenMouse(screenMousePos.x,screenMousePos.y);
|
||||||
olc::Platform::ptrPGE->olc_CoreUpdate();
|
olc::Platform::ptrPGE->olc_CoreUpdate();
|
||||||
if (!ptrPGE->olc_IsRunning())
|
if (!ptrPGE->olc_IsRunning())
|
||||||
{
|
{
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 438 KiB After Width: | Height: | Size: 455 KiB |
@ -190,7 +190,7 @@ Module['FS_createPath']("/", "assets", true, true);
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
loadPackage({"files": [{"filename": "/assets/MAINICON.ico", "start": 0, "end": 766}, {"filename": "/assets/atk.png", "start": 766, "end": 1443}, {"filename": "/assets/bit_restorer.png", "start": 1443, "end": 10991}, {"filename": "/assets/corrupter.png", "start": 10991, "end": 22054}, {"filename": "/assets/down_arrow.png", "start": 22054, "end": 22695}, {"filename": "/assets/left_shifter.png", "start": 22695, "end": 31900}, {"filename": "/assets/machine2.wav", "start": 31900, "end": 110508, "audio": 1}, {"filename": "/assets/memory_collection_point.png", "start": 110508, "end": 111454}, {"filename": "/assets/memory_swapper.png", "start": 111454, "end": 122904}, {"filename": "/assets/minimap_hud.png", "start": 122904, "end": 126362}, {"filename": "/assets/outline.png", "start": 126362, "end": 126971}, {"filename": "/assets/prc.png", "start": 126971, "end": 136274}, {"filename": "/assets/ram_bank.png", "start": 136274, "end": 138538}, {"filename": "/assets/range_indicator.png", "start": 138538, "end": 147573}, {"filename": "/assets/red_x.png", "start": 147573, "end": 148185}, {"filename": "/assets/right_shifter.png", "start": 148185, "end": 157409}, {"filename": "/assets/rld.png", "start": 157409, "end": 165080}, {"filename": "/assets/rng.png", "start": 165080, "end": 174212}, {"filename": "/assets/selection_circle.png", "start": 174212, "end": 174891}, {"filename": "/assets/shell.png", "start": 174891, "end": 181765}, {"filename": "/assets/sonar.wav", "start": 181765, "end": 438253, "audio": 1}, {"filename": "/assets/spd.png", "start": 438253, "end": 446795}, {"filename": "/assets/tile.png", "start": 446795, "end": 448130}, {"filename": "/assets/unit.png", "start": 448130, "end": 448860}], "remote_package_size": 448860});
|
loadPackage({"files": [{"filename": "/assets/MAINICON.ico", "start": 0, "end": 766}, {"filename": "/assets/atk.png", "start": 766, "end": 1443}, {"filename": "/assets/attackLine.png", "start": 1443, "end": 2084}, {"filename": "/assets/bit_restorer.png", "start": 2084, "end": 11632}, {"filename": "/assets/corrupter.png", "start": 11632, "end": 22695}, {"filename": "/assets/down_arrow.png", "start": 22695, "end": 23336}, {"filename": "/assets/left_shifter.png", "start": 23336, "end": 32541}, {"filename": "/assets/machine2.wav", "start": 32541, "end": 111149, "audio": 1}, {"filename": "/assets/material.png", "start": 111149, "end": 111844}, {"filename": "/assets/memory_collection_point.png", "start": 111844, "end": 112790}, {"filename": "/assets/memory_collection_point_highlight.png", "start": 112790, "end": 124867}, {"filename": "/assets/memory_swapper.png", "start": 124867, "end": 136317}, {"filename": "/assets/minimap_hud.png", "start": 136317, "end": 139775}, {"filename": "/assets/outline.png", "start": 139775, "end": 140384}, {"filename": "/assets/prc.png", "start": 140384, "end": 149687}, {"filename": "/assets/prc_icon.png", "start": 149687, "end": 150439}, {"filename": "/assets/ram_bank.png", "start": 150439, "end": 152703}, {"filename": "/assets/range_indicator.png", "start": 152703, "end": 161738}, {"filename": "/assets/red_x.png", "start": 161738, "end": 162350}, {"filename": "/assets/right_shifter.png", "start": 162350, "end": 171574}, {"filename": "/assets/rld.png", "start": 171574, "end": 179245}, {"filename": "/assets/rld_icon.png", "start": 179245, "end": 179911}, {"filename": "/assets/rng.png", "start": 179911, "end": 189043}, {"filename": "/assets/rng_icon.png", "start": 189043, "end": 189750}, {"filename": "/assets/selection_circle.png", "start": 189750, "end": 190429}, {"filename": "/assets/shell.png", "start": 190429, "end": 197303}, {"filename": "/assets/sonar.wav", "start": 197303, "end": 453791, "audio": 1}, {"filename": "/assets/spd.png", "start": 453791, "end": 462333}, {"filename": "/assets/spd_icon.png", "start": 462333, "end": 463024}, {"filename": "/assets/targetLine.png", "start": 463024, "end": 463646}, {"filename": "/assets/tile.png", "start": 463646, "end": 464981}, {"filename": "/assets/unit.png", "start": 464981, "end": 465711}], "remote_package_size": 465711});
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@ -1187,23 +1187,27 @@ function dbg(text) {
|
|||||||
// === Body ===
|
// === Body ===
|
||||||
|
|
||||||
var ASM_CONSTS = {
|
var ASM_CONSTS = {
|
||||||
5369420: () => { window.onunload = Module._olc_OnPageUnload; },
|
5371692: () => { return Module.canvas.getBoundingClientRect().left },
|
||||||
5369464: ($0, $1) => { Module.olc_AspectRatio = $0 / $1; Module.olc_AssumeDefaultShells = (document.querySelectorAll('.emscripten').length >= 3) ? true : false; var olc_ResizeHandler = function() { let isFullscreen = (document.fullscreenElement != null); let width = (isFullscreen) ? window.innerWidth : Module.canvas.parentNode.clientWidth; let height = (isFullscreen) ? window.innerHeight : Module.canvas.parentNode.clientHeight; let viewWidth = width; let viewHeight = width / Module.olc_AspectRatio; if(viewHeight > height) { viewWidth = height * Module.olc_AspectRatio; viewHeight = height; } viewWidth = parseInt(viewWidth); viewHeight = parseInt(viewHeight); setTimeout(function() { if(Module.olc_AssumeDefaultShells) Module.canvas.parentNode.setAttribute('style', 'width: 100%; height: 70vh; margin-left: auto; margin-right: auto;'); Module.canvas.setAttribute('width', viewWidth); Module.canvas.setAttribute('height', viewHeight); Module.canvas.setAttribute('style', `width: ${viewWidth}px; height: ${viewHeight}px;`); Module._olc_PGE_UpdateWindowSize(viewWidth, viewHeight); Module.canvas.focus(); }, 200); }; var olc_Init = function() { if(Module.olc_AspectRatio === undefined) { setTimeout(function() { Module.olc_Init(); }, 50); return; } let resizeObserver = new ResizeObserver(function(entries) { Module.olc_ResizeHandler(); }).observe(Module.canvas.parentNode); let mutationObserver = new MutationObserver(function(mutationsList, observer) { setTimeout(function() { Module.olc_ResizeHandler(); }, 200); }).observe(Module.canvas.parentNode, { attributes: false, childList: true, subtree: false }); window.addEventListener('fullscreenchange', function(e) { setTimeout(function() { Module.olc_ResizeHandler();}, 200); }); }; Module.olc_ResizeHandler = (Module.olc_ResizeHandler != undefined) ? Module.olc_ResizeHandler : olc_ResizeHandler; Module.olc_Init = (Module.olc_Init != undefined) ? Module.olc_Init : olc_Init; Module.olc_Init(); },
|
5371744: () => { return Module.canvas.getBoundingClientRect().top },
|
||||||
5371396: () => { if (typeof(AudioContext) !== 'undefined') { return true; } else if (typeof(webkitAudioContext) !== 'undefined') { return true; } return false; },
|
5371795: () => { return Module.olc_MOUSEX; },
|
||||||
5371543: () => { if ((typeof(navigator.mediaDevices) !== 'undefined') && (typeof(navigator.mediaDevices.getUserMedia) !== 'undefined')) { return true; } else if (typeof(navigator.webkitGetUserMedia) !== 'undefined') { return true; } return false; },
|
5371823: () => { return Module.olc_MOUSEY; },
|
||||||
5371777: ($0) => { if(typeof(Module['SDL2']) === 'undefined') { Module['SDL2'] = {}; } var SDL2 = Module['SDL2']; if (!$0) { SDL2.audio = {}; } else { SDL2.capture = {}; } if (!SDL2.audioContext) { if (typeof(AudioContext) !== 'undefined') { SDL2.audioContext = new AudioContext(); } else if (typeof(webkitAudioContext) !== 'undefined') { SDL2.audioContext = new webkitAudioContext(); } if (SDL2.audioContext) { autoResumeAudioContext(SDL2.audioContext); } } return SDL2.audioContext === undefined ? -1 : 0; },
|
5371851: () => { window.onunload = Module._olc_OnPageUnload; },
|
||||||
5372270: () => { var SDL2 = Module['SDL2']; return SDL2.audioContext.sampleRate; },
|
5371895: ($0, $1) => { Module.olc_AspectRatio = $0 / $1; onmousemove = function(e){Module.olc_MOUSEX=e.clientX;Module.olc_MOUSEY=e.clientY;}; Module.olc_AssumeDefaultShells = (document.querySelectorAll('.emscripten').length >= 3) ? true : false; var olc_ResizeHandler = function() { let isFullscreen = (document.fullscreenElement != null); let width = (isFullscreen) ? window.innerWidth : Module.canvas.parentNode.clientWidth; let height = (isFullscreen) ? window.innerHeight : Module.canvas.parentNode.clientHeight; let viewWidth = width; let viewHeight = width / Module.olc_AspectRatio; if(viewHeight > height) { viewWidth = height * Module.olc_AspectRatio; viewHeight = height; } viewWidth = parseInt(viewWidth); viewHeight = parseInt(viewHeight); setTimeout(function() { if(Module.olc_AssumeDefaultShells) Module.canvas.parentNode.setAttribute('style', 'width: 100%; height: 70vh; margin-left: auto; margin-right: auto;'); Module.canvas.setAttribute('width', viewWidth); Module.canvas.setAttribute('height', viewHeight); Module.canvas.setAttribute('style', `width: ${viewWidth}px; height: ${viewHeight}px;`); Module._olc_PGE_UpdateWindowSize(viewWidth, viewHeight); Module.canvas.focus(); }, 200); }; var olc_Init = function() { if(Module.olc_AspectRatio === undefined) { setTimeout(function() { Module.olc_Init(); }, 50); return; } let resizeObserver = new ResizeObserver(function(entries) { Module.olc_ResizeHandler(); }).observe(Module.canvas.parentNode); let mutationObserver = new MutationObserver(function(mutationsList, observer) { setTimeout(function() { Module.olc_ResizeHandler(); }, 200); }).observe(Module.canvas.parentNode, { attributes: false, childList: true, subtree: false }); window.addEventListener('fullscreenchange', function(e) { setTimeout(function() { Module.olc_ResizeHandler();}, 200); }); }; Module.olc_ResizeHandler = (Module.olc_ResizeHandler != undefined) ? Module.olc_ResizeHandler : olc_ResizeHandler; Module.olc_Init = (Module.olc_Init != undefined) ? Module.olc_Init : olc_Init; Module.olc_Init(); },
|
||||||
5372338: ($0, $1, $2, $3) => { var SDL2 = Module['SDL2']; var have_microphone = function(stream) { if (SDL2.capture.silenceTimer !== undefined) { clearTimeout(SDL2.capture.silenceTimer); SDL2.capture.silenceTimer = undefined; } SDL2.capture.mediaStreamNode = SDL2.audioContext.createMediaStreamSource(stream); SDL2.capture.scriptProcessorNode = SDL2.audioContext.createScriptProcessor($1, $0, 1); SDL2.capture.scriptProcessorNode.onaudioprocess = function(audioProcessingEvent) { if ((SDL2 === undefined) || (SDL2.capture === undefined)) { return; } audioProcessingEvent.outputBuffer.getChannelData(0).fill(0.0); SDL2.capture.currentCaptureBuffer = audioProcessingEvent.inputBuffer; dynCall('vi', $2, [$3]); }; SDL2.capture.mediaStreamNode.connect(SDL2.capture.scriptProcessorNode); SDL2.capture.scriptProcessorNode.connect(SDL2.audioContext.destination); SDL2.capture.stream = stream; }; var no_microphone = function(error) { }; SDL2.capture.silenceBuffer = SDL2.audioContext.createBuffer($0, $1, SDL2.audioContext.sampleRate); SDL2.capture.silenceBuffer.getChannelData(0).fill(0.0); var silence_callback = function() { SDL2.capture.currentCaptureBuffer = SDL2.capture.silenceBuffer; dynCall('vi', $2, [$3]); }; SDL2.capture.silenceTimer = setTimeout(silence_callback, ($1 / SDL2.audioContext.sampleRate) * 1000); if ((navigator.mediaDevices !== undefined) && (navigator.mediaDevices.getUserMedia !== undefined)) { navigator.mediaDevices.getUserMedia({ audio: true, video: false }).then(have_microphone).catch(no_microphone); } else if (navigator.webkitGetUserMedia !== undefined) { navigator.webkitGetUserMedia({ audio: true, video: false }, have_microphone, no_microphone); } },
|
5373912: () => { if (typeof(AudioContext) !== 'undefined') { return true; } else if (typeof(webkitAudioContext) !== 'undefined') { return true; } return false; },
|
||||||
5373990: ($0, $1, $2, $3) => { var SDL2 = Module['SDL2']; SDL2.audio.scriptProcessorNode = SDL2.audioContext['createScriptProcessor']($1, 0, $0); SDL2.audio.scriptProcessorNode['onaudioprocess'] = function (e) { if ((SDL2 === undefined) || (SDL2.audio === undefined)) { return; } SDL2.audio.currentOutputBuffer = e['outputBuffer']; dynCall('vi', $2, [$3]); }; SDL2.audio.scriptProcessorNode['connect'](SDL2.audioContext['destination']); },
|
5374059: () => { if ((typeof(navigator.mediaDevices) !== 'undefined') && (typeof(navigator.mediaDevices.getUserMedia) !== 'undefined')) { return true; } else if (typeof(navigator.webkitGetUserMedia) !== 'undefined') { return true; } return false; },
|
||||||
5374400: ($0, $1) => { var SDL2 = Module['SDL2']; var numChannels = SDL2.capture.currentCaptureBuffer.numberOfChannels; for (var c = 0; c < numChannels; ++c) { var channelData = SDL2.capture.currentCaptureBuffer.getChannelData(c); if (channelData.length != $1) { throw 'Web Audio capture buffer length mismatch! Destination size: ' + channelData.length + ' samples vs expected ' + $1 + ' samples!'; } if (numChannels == 1) { for (var j = 0; j < $1; ++j) { setValue($0 + (j * 4), channelData[j], 'float'); } } else { for (var j = 0; j < $1; ++j) { setValue($0 + (((j * numChannels) + c) * 4), channelData[j], 'float'); } } } },
|
5374293: ($0) => { if(typeof(Module['SDL2']) === 'undefined') { Module['SDL2'] = {}; } var SDL2 = Module['SDL2']; if (!$0) { SDL2.audio = {}; } else { SDL2.capture = {}; } if (!SDL2.audioContext) { if (typeof(AudioContext) !== 'undefined') { SDL2.audioContext = new AudioContext(); } else if (typeof(webkitAudioContext) !== 'undefined') { SDL2.audioContext = new webkitAudioContext(); } if (SDL2.audioContext) { autoResumeAudioContext(SDL2.audioContext); } } return SDL2.audioContext === undefined ? -1 : 0; },
|
||||||
5375005: ($0, $1) => { var SDL2 = Module['SDL2']; var numChannels = SDL2.audio.currentOutputBuffer['numberOfChannels']; for (var c = 0; c < numChannels; ++c) { var channelData = SDL2.audio.currentOutputBuffer['getChannelData'](c); if (channelData.length != $1) { throw 'Web Audio output buffer length mismatch! Destination size: ' + channelData.length + ' samples vs expected ' + $1 + ' samples!'; } for (var j = 0; j < $1; ++j) { channelData[j] = HEAPF32[$0 + ((j*numChannels + c) << 2) >> 2]; } } },
|
5374786: () => { var SDL2 = Module['SDL2']; return SDL2.audioContext.sampleRate; },
|
||||||
5375485: ($0) => { var SDL2 = Module['SDL2']; if ($0) { if (SDL2.capture.silenceTimer !== undefined) { clearTimeout(SDL2.capture.silenceTimer); } if (SDL2.capture.stream !== undefined) { var tracks = SDL2.capture.stream.getAudioTracks(); for (var i = 0; i < tracks.length; i++) { SDL2.capture.stream.removeTrack(tracks[i]); } SDL2.capture.stream = undefined; } if (SDL2.capture.scriptProcessorNode !== undefined) { SDL2.capture.scriptProcessorNode.onaudioprocess = function(audioProcessingEvent) {}; SDL2.capture.scriptProcessorNode.disconnect(); SDL2.capture.scriptProcessorNode = undefined; } if (SDL2.capture.mediaStreamNode !== undefined) { SDL2.capture.mediaStreamNode.disconnect(); SDL2.capture.mediaStreamNode = undefined; } if (SDL2.capture.silenceBuffer !== undefined) { SDL2.capture.silenceBuffer = undefined } SDL2.capture = undefined; } else { if (SDL2.audio.scriptProcessorNode != undefined) { SDL2.audio.scriptProcessorNode.disconnect(); SDL2.audio.scriptProcessorNode = undefined; } SDL2.audio = undefined; } if ((SDL2.audioContext !== undefined) && (SDL2.audio === undefined) && (SDL2.capture === undefined)) { SDL2.audioContext.close(); SDL2.audioContext = undefined; } },
|
5374854: ($0, $1, $2, $3) => { var SDL2 = Module['SDL2']; var have_microphone = function(stream) { if (SDL2.capture.silenceTimer !== undefined) { clearTimeout(SDL2.capture.silenceTimer); SDL2.capture.silenceTimer = undefined; } SDL2.capture.mediaStreamNode = SDL2.audioContext.createMediaStreamSource(stream); SDL2.capture.scriptProcessorNode = SDL2.audioContext.createScriptProcessor($1, $0, 1); SDL2.capture.scriptProcessorNode.onaudioprocess = function(audioProcessingEvent) { if ((SDL2 === undefined) || (SDL2.capture === undefined)) { return; } audioProcessingEvent.outputBuffer.getChannelData(0).fill(0.0); SDL2.capture.currentCaptureBuffer = audioProcessingEvent.inputBuffer; dynCall('vi', $2, [$3]); }; SDL2.capture.mediaStreamNode.connect(SDL2.capture.scriptProcessorNode); SDL2.capture.scriptProcessorNode.connect(SDL2.audioContext.destination); SDL2.capture.stream = stream; }; var no_microphone = function(error) { }; SDL2.capture.silenceBuffer = SDL2.audioContext.createBuffer($0, $1, SDL2.audioContext.sampleRate); SDL2.capture.silenceBuffer.getChannelData(0).fill(0.0); var silence_callback = function() { SDL2.capture.currentCaptureBuffer = SDL2.capture.silenceBuffer; dynCall('vi', $2, [$3]); }; SDL2.capture.silenceTimer = setTimeout(silence_callback, ($1 / SDL2.audioContext.sampleRate) * 1000); if ((navigator.mediaDevices !== undefined) && (navigator.mediaDevices.getUserMedia !== undefined)) { navigator.mediaDevices.getUserMedia({ audio: true, video: false }).then(have_microphone).catch(no_microphone); } else if (navigator.webkitGetUserMedia !== undefined) { navigator.webkitGetUserMedia({ audio: true, video: false }, have_microphone, no_microphone); } },
|
||||||
5376657: ($0, $1, $2) => { var w = $0; var h = $1; var pixels = $2; if (!Module['SDL2']) Module['SDL2'] = {}; var SDL2 = Module['SDL2']; if (SDL2.ctxCanvas !== Module['canvas']) { SDL2.ctx = Module['createContext'](Module['canvas'], false, true); SDL2.ctxCanvas = Module['canvas']; } if (SDL2.w !== w || SDL2.h !== h || SDL2.imageCtx !== SDL2.ctx) { SDL2.image = SDL2.ctx.createImageData(w, h); SDL2.w = w; SDL2.h = h; SDL2.imageCtx = SDL2.ctx; } var data = SDL2.image.data; var src = pixels >> 2; var dst = 0; var num; if (typeof CanvasPixelArray !== 'undefined' && data instanceof CanvasPixelArray) { num = data.length; while (dst < num) { var val = HEAP32[src]; data[dst ] = val & 0xff; data[dst+1] = (val >> 8) & 0xff; data[dst+2] = (val >> 16) & 0xff; data[dst+3] = 0xff; src++; dst += 4; } } else { if (SDL2.data32Data !== data) { SDL2.data32 = new Int32Array(data.buffer); SDL2.data8 = new Uint8Array(data.buffer); SDL2.data32Data = data; } var data32 = SDL2.data32; num = data32.length; data32.set(HEAP32.subarray(src, src + num)); var data8 = SDL2.data8; var i = 3; var j = i + 4*num; if (num % 8 == 0) { while (i < j) { data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; } } else { while (i < j) { data8[i] = 0xff; i = i + 4 | 0; } } } SDL2.ctx.putImageData(SDL2.image, 0, 0); },
|
5376506: ($0, $1, $2, $3) => { var SDL2 = Module['SDL2']; SDL2.audio.scriptProcessorNode = SDL2.audioContext['createScriptProcessor']($1, 0, $0); SDL2.audio.scriptProcessorNode['onaudioprocess'] = function (e) { if ((SDL2 === undefined) || (SDL2.audio === undefined)) { return; } SDL2.audio.currentOutputBuffer = e['outputBuffer']; dynCall('vi', $2, [$3]); }; SDL2.audio.scriptProcessorNode['connect'](SDL2.audioContext['destination']); },
|
||||||
5378126: ($0, $1, $2, $3, $4) => { var w = $0; var h = $1; var hot_x = $2; var hot_y = $3; var pixels = $4; var canvas = document.createElement("canvas"); canvas.width = w; canvas.height = h; var ctx = canvas.getContext("2d"); var image = ctx.createImageData(w, h); var data = image.data; var src = pixels >> 2; var dst = 0; var num; if (typeof CanvasPixelArray !== 'undefined' && data instanceof CanvasPixelArray) { num = data.length; while (dst < num) { var val = HEAP32[src]; data[dst ] = val & 0xff; data[dst+1] = (val >> 8) & 0xff; data[dst+2] = (val >> 16) & 0xff; data[dst+3] = (val >> 24) & 0xff; src++; dst += 4; } } else { var data32 = new Int32Array(data.buffer); num = data32.length; data32.set(HEAP32.subarray(src, src + num)); } ctx.putImageData(image, 0, 0); var url = hot_x === 0 && hot_y === 0 ? "url(" + canvas.toDataURL() + "), auto" : "url(" + canvas.toDataURL() + ") " + hot_x + " " + hot_y + ", auto"; var urlBuf = _malloc(url.length + 1); stringToUTF8(url, urlBuf, url.length + 1); return urlBuf; },
|
5376916: ($0, $1) => { var SDL2 = Module['SDL2']; var numChannels = SDL2.capture.currentCaptureBuffer.numberOfChannels; for (var c = 0; c < numChannels; ++c) { var channelData = SDL2.capture.currentCaptureBuffer.getChannelData(c); if (channelData.length != $1) { throw 'Web Audio capture buffer length mismatch! Destination size: ' + channelData.length + ' samples vs expected ' + $1 + ' samples!'; } if (numChannels == 1) { for (var j = 0; j < $1; ++j) { setValue($0 + (j * 4), channelData[j], 'float'); } } else { for (var j = 0; j < $1; ++j) { setValue($0 + (((j * numChannels) + c) * 4), channelData[j], 'float'); } } } },
|
||||||
5379115: ($0) => { if (Module['canvas']) { Module['canvas'].style['cursor'] = UTF8ToString($0); } },
|
5377521: ($0, $1) => { var SDL2 = Module['SDL2']; var numChannels = SDL2.audio.currentOutputBuffer['numberOfChannels']; for (var c = 0; c < numChannels; ++c) { var channelData = SDL2.audio.currentOutputBuffer['getChannelData'](c); if (channelData.length != $1) { throw 'Web Audio output buffer length mismatch! Destination size: ' + channelData.length + ' samples vs expected ' + $1 + ' samples!'; } for (var j = 0; j < $1; ++j) { channelData[j] = HEAPF32[$0 + ((j*numChannels + c) << 2) >> 2]; } } },
|
||||||
5379198: () => { if (Module['canvas']) { Module['canvas'].style['cursor'] = 'none'; } },
|
5378001: ($0) => { var SDL2 = Module['SDL2']; if ($0) { if (SDL2.capture.silenceTimer !== undefined) { clearTimeout(SDL2.capture.silenceTimer); } if (SDL2.capture.stream !== undefined) { var tracks = SDL2.capture.stream.getAudioTracks(); for (var i = 0; i < tracks.length; i++) { SDL2.capture.stream.removeTrack(tracks[i]); } SDL2.capture.stream = undefined; } if (SDL2.capture.scriptProcessorNode !== undefined) { SDL2.capture.scriptProcessorNode.onaudioprocess = function(audioProcessingEvent) {}; SDL2.capture.scriptProcessorNode.disconnect(); SDL2.capture.scriptProcessorNode = undefined; } if (SDL2.capture.mediaStreamNode !== undefined) { SDL2.capture.mediaStreamNode.disconnect(); SDL2.capture.mediaStreamNode = undefined; } if (SDL2.capture.silenceBuffer !== undefined) { SDL2.capture.silenceBuffer = undefined } SDL2.capture = undefined; } else { if (SDL2.audio.scriptProcessorNode != undefined) { SDL2.audio.scriptProcessorNode.disconnect(); SDL2.audio.scriptProcessorNode = undefined; } SDL2.audio = undefined; } if ((SDL2.audioContext !== undefined) && (SDL2.audio === undefined) && (SDL2.capture === undefined)) { SDL2.audioContext.close(); SDL2.audioContext = undefined; } },
|
||||||
5379267: () => { return window.innerWidth; },
|
5379173: ($0, $1, $2) => { var w = $0; var h = $1; var pixels = $2; if (!Module['SDL2']) Module['SDL2'] = {}; var SDL2 = Module['SDL2']; if (SDL2.ctxCanvas !== Module['canvas']) { SDL2.ctx = Module['createContext'](Module['canvas'], false, true); SDL2.ctxCanvas = Module['canvas']; } if (SDL2.w !== w || SDL2.h !== h || SDL2.imageCtx !== SDL2.ctx) { SDL2.image = SDL2.ctx.createImageData(w, h); SDL2.w = w; SDL2.h = h; SDL2.imageCtx = SDL2.ctx; } var data = SDL2.image.data; var src = pixels >> 2; var dst = 0; var num; if (typeof CanvasPixelArray !== 'undefined' && data instanceof CanvasPixelArray) { num = data.length; while (dst < num) { var val = HEAP32[src]; data[dst ] = val & 0xff; data[dst+1] = (val >> 8) & 0xff; data[dst+2] = (val >> 16) & 0xff; data[dst+3] = 0xff; src++; dst += 4; } } else { if (SDL2.data32Data !== data) { SDL2.data32 = new Int32Array(data.buffer); SDL2.data8 = new Uint8Array(data.buffer); SDL2.data32Data = data; } var data32 = SDL2.data32; num = data32.length; data32.set(HEAP32.subarray(src, src + num)); var data8 = SDL2.data8; var i = 3; var j = i + 4*num; if (num % 8 == 0) { while (i < j) { data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; data8[i] = 0xff; i = i + 4 | 0; } } else { while (i < j) { data8[i] = 0xff; i = i + 4 | 0; } } } SDL2.ctx.putImageData(SDL2.image, 0, 0); },
|
||||||
5379297: () => { return window.innerHeight; }
|
5380642: ($0, $1, $2, $3, $4) => { var w = $0; var h = $1; var hot_x = $2; var hot_y = $3; var pixels = $4; var canvas = document.createElement("canvas"); canvas.width = w; canvas.height = h; var ctx = canvas.getContext("2d"); var image = ctx.createImageData(w, h); var data = image.data; var src = pixels >> 2; var dst = 0; var num; if (typeof CanvasPixelArray !== 'undefined' && data instanceof CanvasPixelArray) { num = data.length; while (dst < num) { var val = HEAP32[src]; data[dst ] = val & 0xff; data[dst+1] = (val >> 8) & 0xff; data[dst+2] = (val >> 16) & 0xff; data[dst+3] = (val >> 24) & 0xff; src++; dst += 4; } } else { var data32 = new Int32Array(data.buffer); num = data32.length; data32.set(HEAP32.subarray(src, src + num)); } ctx.putImageData(image, 0, 0); var url = hot_x === 0 && hot_y === 0 ? "url(" + canvas.toDataURL() + "), auto" : "url(" + canvas.toDataURL() + ") " + hot_x + " " + hot_y + ", auto"; var urlBuf = _malloc(url.length + 1); stringToUTF8(url, urlBuf, url.length + 1); return urlBuf; },
|
||||||
|
5381631: ($0) => { if (Module['canvas']) { Module['canvas'].style['cursor'] = UTF8ToString($0); } },
|
||||||
|
5381714: () => { if (Module['canvas']) { Module['canvas'].style['cursor'] = 'none'; } },
|
||||||
|
5381783: () => { return window.innerWidth; },
|
||||||
|
5381813: () => { return window.innerHeight; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user