Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
boytacean
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
João Magalhães
boytacean
Commits
51548c51
Verified
Commit
51548c51
authored
2 years ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
refactor: improved type handing in wasm engine
parent
1f7e57e8
No related branches found
No related tags found
No related merge requests found
Pipeline
#2224
canceled
2 years ago
Stage: build
Stage: test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontends/web/ts/gb.ts
+1
-1
1 addition, 1 deletion
frontends/web/ts/gb.ts
src/gb.rs
+4
-4
4 additions, 4 deletions
src/gb.rs
with
5 additions
and
5 deletions
frontends/web/ts/gb.ts
+
1
−
1
View file @
51548c51
...
@@ -549,7 +549,7 @@ export class GameboyEmulator extends EmulatorBase implements Emulator {
...
@@ -549,7 +549,7 @@ export class GameboyEmulator extends EmulatorBase implements Emulator {
get
wasmEngine
():
string
|
null
{
get
wasmEngine
():
string
|
null
{
if
(
!
this
.
gameBoy
)
return
null
;
if
(
!
this
.
gameBoy
)
return
null
;
return
this
.
gameBoy
.
get_wasm_engine_ws
();
return
this
.
gameBoy
.
get_wasm_engine_ws
()
??
null
;
}
}
get
framerate
():
number
{
get
framerate
():
number
{
...
...
This diff is collapsed.
Click to expand it.
src/gb.rs
+
4
−
4
View file @
51548c51
...
@@ -322,15 +322,15 @@ impl GameBoy {
...
@@ -322,15 +322,15 @@ impl GameBoy {
self
.ppu
()
.set_palette_colors
(
&
palette
);
self
.ppu
()
.set_palette_colors
(
&
palette
);
}
}
pub
fn
get_wasm_engine_ws
(
&
self
)
->
String
{
pub
fn
get_wasm_engine_ws
(
&
self
)
->
Option
<
String
>
{
let
dependencies
=
dependencies_map
();
let
dependencies
=
dependencies_map
();
if
!
dependencies
.contains_key
(
"wasm-bindgen"
)
{
if
!
dependencies
.contains_key
(
"wasm-bindgen"
)
{
return
String
::
from
(
"-"
)
;
return
None
;
}
}
String
::
from
(
format!
(
Some
(
String
::
from
(
format!
(
"wasm-bindgen/{}"
,
"wasm-bindgen/{}"
,
*
dependencies
.get
(
"wasm-bindgen"
)
.unwrap
()
*
dependencies
.get
(
"wasm-bindgen"
)
.unwrap
()
))
))
)
}
}
fn
js_to_pixel
(
value
:
&
JsValue
)
->
Pixel
{
fn
js_to_pixel
(
value
:
&
JsValue
)
->
Pixel
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment