littlejsengine 1.16.1 → 1.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -168,8 +168,7 @@ function glInit(rootElement)
168
168
 
169
169
  function glSetInstancedMode()
170
170
  {
171
- if (!glPolyMode)
172
- return;
171
+ if (!glPolyMode) return;
173
172
 
174
173
  // setup instanced mode
175
174
  glFlush();
@@ -202,8 +201,7 @@ function glSetInstancedMode()
202
201
 
203
202
  function glSetPolyMode()
204
203
  {
205
- if (glPolyMode)
206
- return;
204
+ if (glPolyMode) return;
207
205
 
208
206
  // setup poly mode
209
207
  glFlush();
@@ -282,8 +280,8 @@ function glClearCanvas()
282
280
  if (!glContext) return;
283
281
 
284
282
  // clear and set to same size as main canvas
285
- glCanvas.width = drawCanvas.width;
286
- glCanvas.height = drawCanvas.height;
283
+ glCanvas.width = mainCanvasSize.x;
284
+ glCanvas.height = mainCanvasSize.y;
287
285
  glContext.viewport(0, 0, glCanvas.width, glCanvas.height);
288
286
  const color = canvasClearColor;
289
287
  if (color.a > 0)
@@ -299,8 +297,7 @@ function glClearCanvas()
299
297
  function glSetTexture(texture, wrap=false)
300
298
  {
301
299
  // must flush cache with the old texture to set a new one
302
- if (!glContext || texture === glActiveTexture)
303
- return;
300
+ if (!glContext || texture === glActiveTexture) return;
304
301
 
305
302
  glFlush();
306
303
  glActiveTexture = texture;
@@ -396,6 +393,7 @@ function glCreateTexture(image)
396
393
  function glDeleteTexture(texture)
397
394
  {
398
395
  if (!glContext) return;
396
+
399
397
  glContext.deleteTexture(texture);
400
398
  }
401
399
 
@@ -480,8 +478,7 @@ function glFlush()
480
478
  * @memberof WebGL */
481
479
  function glCopyToContext(context)
482
480
  {
483
- if (!glEnable || !glContext)
484
- return;
481
+ if (!glEnable || !glContext) return;
485
482
 
486
483
  glFlush();
487
484
  context.drawImage(glCanvas, 0, 0);