@@ -51,10 +51,6 @@ class RaylibJs {
51
51
this . #reset( ) ;
52
52
}
53
53
54
- get quit ( ) {
55
- return this . views . stop [ 0 ] !== 0 ;
56
- }
57
-
58
54
async start ( { wasmPath, shared} ) {
59
55
if ( this . wasm !== undefined ) {
60
56
console . error ( "The game is already running. Please stop() it first." ) ;
@@ -91,18 +87,6 @@ class RaylibJs {
91
87
this . CloseWindow ( ) ;
92
88
}
93
89
94
- get currentMouseWheelMoveState ( ) {
95
- return Math . sign ( - this . views . mouse [ 2 ] ) ;
96
- }
97
-
98
- set currentMouseWheelMoveState ( v ) {
99
- this . views . mouse [ 2 ] = v ;
100
- }
101
-
102
- get currentMousePosition ( ) {
103
- return { x : this . views . mouse [ 0 ] , y : this . views . mouse [ 1 ] } ;
104
- }
105
-
106
90
InitWindow ( width , height , title_ptr ) {
107
91
this . ctx . canvas . width = width ;
108
92
this . ctx . canvas . height = height ;
@@ -111,7 +95,7 @@ class RaylibJs {
111
95
}
112
96
113
97
WindowShouldClose ( ) {
114
- return this . quit ;
98
+ return this . views . stop [ 0 ] !== 0 ;
115
99
}
116
100
117
101
CloseWindow ( ) {
@@ -147,7 +131,7 @@ class RaylibJs {
147
131
148
132
EndDrawing ( ) {
149
133
this . prevKeys . set ( this . views . keys ) ;
150
- this . currentMouseWheelMoveState = 0.0 ;
134
+ this . views . mouse [ 2 ] = 0.0 ;
151
135
const img = this . ctx . canvas . transferToImageBitmap ( ) ;
152
136
this . ctx . drawImage ( img , 0 , 0 ) ;
153
137
reply ( "frame" , img ) ;
@@ -207,7 +191,7 @@ class RaylibJs {
207
191
}
208
192
209
193
GetMouseWheelMove ( ) {
210
- return this . currentMouseWheelMoveState ;
194
+ return Math . sign ( - this . views . mouse [ 2 ] ) ;
211
195
}
212
196
IsGestureDetected ( ) {
213
197
return false ;
@@ -236,8 +220,8 @@ class RaylibJs {
236
220
237
221
GetMousePosition ( result_ptr ) {
238
222
const bcrect = this . views . boundingRect ;
239
- const x = this . currentMousePosition . x - bcrect [ 0 ] ;
240
- const y = this . currentMousePosition . y - bcrect [ 1 ] ;
223
+ const x = this . views . mouse [ 0 ] - bcrect [ 0 ] ;
224
+ const y = this . views . mouse [ 1 ] - bcrect [ 1 ] ;
241
225
242
226
const buffer = this . wasm . instance . exports . memory . buffer ;
243
227
new Float32Array ( buffer , result_ptr , 2 ) . set ( [ x , y ] ) ;
0 commit comments