Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nico.nim(2227, 19) Error: type mismatch: got '(int, int, int32, int32)' for '(int(x), int(y), src.w * scale, src.h * scale)' but expected 'Rect = tuple[x: int, y: int, w: int, h: int]' #121

Open
arkanoid87 opened this issue Aug 25, 2023 · 6 comments

Comments

@arkanoid87
Copy link

choosenim stable
nimble install nico
nicoboot test test test
cd test
nimble webd
@arkanoid87
Copy link
Author

nim 1.6.14 + rund = works
nim 1.6.14 + webd = works
nim 2.0.0 + rund = works
nim 2.0.0 + webd = error

@HVukman
Copy link

HVukman commented Aug 31, 2023

Have the same problem with Nim2.0

@Angluca
Copy link

Angluca commented Dec 30, 2023

Fix it

let dst: Rect = (x.int, y.int, src.w * scale.int, src.h * scale.int)

@HVukman
Copy link

HVukman commented Jan 7, 2024

Can build now with webr on Ubuntu, but I cannot run it in the browser (this is the basic example):

registerOrRemoveHandler: the target element for event handler registration does not exist, when processing the following event handler
registration:Object
allowsDeferredCalls: true
callbackfunc: 609
eventTypeString: "touchstart"
handlerFunc: e=> {…}
target: null
useCapture: 0
[[Prototype]]: Object

and then:

Aborted(Runtime error: The application has corrupted its heap memory area (address zero)!)
abort @ niconim.js:1
Uncaught RuntimeError: Aborted(Runtime error: The application has corrupted its heap memory area (address zero)!)
at abort (niconim.js:1:20947)
at checkStackCookie (niconim.js:1:17381)
at handleException (niconim.js:1:99085)
at callUserCallback (niconim.js:1:118954)
at Object.runIter (niconim.js:1:129885)
at Browser_mainLoop_runner (niconim.js:1:128289)

@Angluca
Copy link

Angluca commented Jan 8, 2024

@HVukman Sorry I haven't use nico in linux so don't know .

But you can test it.

  1. Install sdl2 and emscripten
  2. Use this nimble (nimble webr and runweb) or bash input command test
    https://github.com/Angluca/nico/blob/main/exampleApp/exampleApp.nimble
nim c -d:emscripten -o:exampleApp.html src/main.nim
emrun exampleApp.html

@HVukman
Copy link

HVukman commented Jan 8, 2024

^ This works under WIndows, thanks.
Edit: if anybody stumbles upon this and uploads their game on itch.io: You need to enable SharedBufferSupport
https://itch.io/t/2025776/experimental-sharedarraybuffer-support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants