Started to move over zpl depndencies and use templated containers.

Still have a ways to go.
This commit is contained in:
2023-07-11 18:29:45 -04:00
parent 661630a88f
commit 20d307759b
15 changed files with 2485 additions and 1340 deletions

View File

@ -224,16 +224,16 @@ struct GenArrayRequest
StrC Dependency;
StrC Type;
};
Array(GenArrayRequest) GenArrayRequests;
Array<GenArrayRequest> GenArrayRequests;
void gen__array_request( StrC type, sw size, StrC dep = {} )
{
do_once_start
array_init( GenArrayRequests, Memory::GlobalAllocator );
GenArrayRequests = Array<GenArrayRequest>::init( Memory::GlobalAllocator );
do_once_end
// Make sure we don't already have a request for the type.
for ( sw idx = 0; idx < array_count( GenArrayRequests ); ++idx )
for ( sw idx = 0; idx < GenArrayRequests.num(); ++idx )
{
StrC const reqest_type = GenArrayRequests[ idx ].Type;
@ -245,7 +245,7 @@ void gen__array_request( StrC type, sw size, StrC dep = {} )
}
GenArrayRequest request = { dep, type };
array_append( GenArrayRequests, request );
GenArrayRequests.append( request );
}
#define gen_array( type ) gen__array_request( { txt_to_StrC(type) }, sizeof(type) )
@ -262,7 +262,7 @@ u32 gen_array_file()
gen_array_file.print( array_base );
GenArrayRequest* current = GenArrayRequests;
s32 left = array_count( GenArrayRequests );
s32 left = GenArrayRequests.num();
while (left--)
{
GenArrayRequest const& request = * current;

View File

@ -137,16 +137,16 @@ struct GenBufferRequest
StrC Dependency;
StrC Type;
};
Array(GenBufferRequest) GenBufferRequests;
Array<GenBufferRequest> GenBufferRequests;
void gen__buffer_request( StrC type, StrC dep = {} )
{
do_once_start
array_init( GenBufferRequests, Memory::GlobalAllocator );
GenBufferRequests = Array<GenBufferRequest>::init( Memory::GlobalAllocator );
do_once_end
// Make sure we don't already have a request for the type.
for ( sw idx = 0; idx < array_count( GenBufferRequests ); ++idx )
for ( sw idx = 0; idx < GenBufferRequests.num(); ++idx )
{
StrC const reqest_type = GenBufferRequests[ idx ].Type;
@ -158,7 +158,7 @@ void gen__buffer_request( StrC type, StrC dep = {} )
}
GenBufferRequest request = { dep, type };
array_append( GenBufferRequests, request );
GenBufferRequests.append( request );
}
#define gen_buffer( type ) gen__buffer_request( { txt_to_StrC(type) } )
@ -172,7 +172,7 @@ u32 gen_buffer_file()
gen_buffer_file.print( gen__buffer_base() );
GenBufferRequest* current = GenBufferRequests;
s32 left = array_count( GenBufferRequests );
s32 left = GenBufferRequests.num();
while (left--)
{
GenBufferRequest const& request = * current;

View File

@ -290,18 +290,18 @@ struct GenHashTableRequest
StrC Type;
sw TypeSize;
};
Array(GenHashTableRequest) GenHashTableRequests;
Array<GenHashTableRequest> GenHashTableRequests;
void gen__hashtable_request( StrC type, sw size, StrC dep = {} )
{
do_once_start
array_init( GenHashTableRequests, Memory::GlobalAllocator );
GenHashTableRequests = Array<GenHashTableRequest>::init( Memory::GlobalAllocator );
gen_array( sw );
do_once_end
// Make sure we don't already have a request for the type.
for ( sw idx = 0; idx < array_count( GenHashTableRequests ); ++idx )
for ( sw idx = 0; idx < GenHashTableRequests.num(); ++idx )
{
StrC const reqest_type = GenHashTableRequests[ idx ].Type;
@ -313,7 +313,7 @@ void gen__hashtable_request( StrC type, sw size, StrC dep = {} )
}
GenHashTableRequest request = { dep, type, size};
array_append( GenHashTableRequests, request );
GenHashTableRequests.append( request );
}
#define gen_hashtable( type ) gen__hashtable_request( { txt_to_StrC(type) }, sizeof( type ))
@ -329,7 +329,7 @@ u32 gen_hashtable_file()
gen_buffer_file.print( gen__hashtable_base());
GenHashTableRequest* current = GenHashTableRequests;
s32 left = array_count( GenHashTableRequests );
s32 left = GenHashTableRequests.num();
while (left--)
{
GenHashTableRequest const& request = * current;

View File

@ -102,16 +102,16 @@ struct GenRingRequest
StrC Dependency;
StrC Type;
};
Array(GenRingRequest) GenRingRequests;
Array<GenRingRequest> GenRingRequests;
void gen__ring_request( StrC type, sw size, StrC dep = {} )
{
do_once_start
array_init( GenRingRequests, Memory::GlobalAllocator );
GenRingRequests = Array<GenRingRequest>::init( Memory::GlobalAllocator );
do_once_end
// Make sure we don't already have a request for the type.
for ( sw idx = 0; idx < array_count( GenRingRequests ); ++idx )
for ( sw idx = 0; idx < GenRingRequests.num(); ++idx )
{
StrC const reqest_type = GenRingRequests[ idx ].Type;
@ -126,7 +126,7 @@ void gen__ring_request( StrC type, sw size, StrC dep = {} )
gen__buffer_request( type, dep );
GenRingRequest request = { dep, type };
array_append( GenRingRequests, request );
GenRingRequests.append( request );
}
#define gen_ring( type ) gen__ring_request( { txt_to_StrC(type) }, sizeof( type ))
@ -141,7 +141,7 @@ u32 gen_ring_file()
// gen_ring_file.print( gen__ring_base() );
GenRingRequest* current = GenRingRequests;
s32 left = array_count( GenRingRequests );
s32 left = GenRingRequests.num();
while (left--)
{
GenRingRequest const& request = * current;