Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
JujuAdams committed May 3, 2021
2 parents dba2647 + 41c2a37 commit 246c1f1
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Clean Shapes.yyp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ function CleanBatchDrawVertexBuffer()
var _vertexBuffer = argument[0];
var _destroyAfter = ((argument_count > 1) && (argument[1] != undefined))? argument[1] : false;

if (_vertexBuffer == undefined) return undefined;

if (!global.__cleanMatrixIdentity)
{
var _oldWorldMatrix = matrix_get(matrix_world);
Expand Down
31 changes: 1 addition & 30 deletions scripts/CleanBatchEndDraw/CleanBatchEndDraw.gml
Original file line number Diff line number Diff line change
@@ -1,33 +1,4 @@
function CleanBatchEndDraw()
{
var _batchArray = global.__cleanBatch;

if (!is_array(_batchArray))
{
__CleanError("Cannot end a batch, no batch started");
exit;
}

//Don't bother doing anything if our batch is empty
if (array_length(_batchArray) <= 0)
{
global.__cleanBatch = undefined;
exit;
}

var _vbuff = vertex_create_buffer();
vertex_begin(_vbuff, global.__cleanVertexFormat);

var _i = 0;
repeat(array_length(_batchArray))
{
_batchArray[_i].__Build(_vbuff);
++_i;
}

vertex_end(_vbuff);

CleanBatchDrawVertexBuffer(_vbuff, true);

global.__cleanBatch = undefined;
CleanBatchDrawVertexBuffer(CleanBatchEndReturnVertexBuffer(), true);
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
function CleanBatchEndReturnVertexBuffer()
{
var _vertexBuffer = CleanBatchEndReturnVertexBuffer();
var _batchArray = global.__cleanBatch;

CleanBatchDrawVertexBuffer(_vertexBuffer, false);
if (!is_array(_batchArray))
{
__CleanError("Cannot end a batch, no batch started");
exit;
}

return _vertexBuffer;
//Don't bother doing anything if our batch is empty
if (array_length(_batchArray) <= 0)
{
global.__cleanBatch = undefined;
return undefined;
}

var _vbuff = vertex_create_buffer();
vertex_begin(_vbuff, global.__cleanVertexFormat);

var _i = 0;
repeat(array_length(_batchArray))
{
_batchArray[_i].__Build(_vbuff);
++_i;
}

vertex_end(_vbuff);

global.__cleanBatch = undefined;

return _vbuff;
}
4 changes: 2 additions & 2 deletions scripts/__CleanSystem/__CleanSystem.gml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#macro __CLEAN_VERSION "1.0.11"
#macro __CLEAN_DATE "2021-04-09"
#macro __CLEAN_VERSION "1.0.12"
#macro __CLEAN_DATE "2021-05-03"
#macro __CLEAN_FLAG_A 65536 // 2^16
#macro __CLEAN_FLAG_B 131072 // 2^17
#macro __CLEAN_FLAG_AB 196608 // 2^16 + 2^17
Expand Down

0 comments on commit 246c1f1

Please sign in to comment.