changed Id to uint since builtin hash functions hash to uints
This commit is contained in:
parent
c49a689304
commit
a390a8908c
@ -9,7 +9,7 @@ import std::core::string;
|
|||||||
|
|
||||||
|
|
||||||
// element ids are just long ints
|
// element ids are just long ints
|
||||||
alias Id = usz;
|
alias Id = uint;
|
||||||
|
|
||||||
enum ElemType {
|
enum ElemType {
|
||||||
ETYPE_NONE,
|
ETYPE_NONE,
|
||||||
|
@ -522,18 +522,18 @@ enum TextureType : (GPUTextureFormat format) {
|
|||||||
macro void Renderer.new_texture(&self, name_or_id, TextureType type, char[] pixels, uint width, uint height)
|
macro void Renderer.new_texture(&self, name_or_id, TextureType type, char[] pixels, uint width, uint height)
|
||||||
{
|
{
|
||||||
$switch $typeof(name_or_id):
|
$switch $typeof(name_or_id):
|
||||||
$case usz: return self.new_texture_by_id(id, type, pixels, width, height);
|
$case uint: return self.new_texture_by_id(id, type, pixels, width, height);
|
||||||
$case String: return self.new_texture_by_id(name_or_id.hash(), type, pixels, width, height);
|
$case String: return self.new_texture_by_id(name_or_id.hash(), type, pixels, width, height);
|
||||||
$default: unreachable("texture must have a name (String) or an id (usz)");
|
$default: unreachable("texture must have a name (String) or an id (uint)");
|
||||||
$endswitch
|
$endswitch
|
||||||
}
|
}
|
||||||
|
|
||||||
macro void Renderer.update_texture(&self, name_or_id, char[] pixels, uint width, uint height, uint x = 0, uint y = 0)
|
macro void Renderer.update_texture(&self, name_or_id, char[] pixels, uint width, uint height, uint x = 0, uint y = 0)
|
||||||
{
|
{
|
||||||
$switch $typeof(name_or_id):
|
$switch $typeof(name_or_id):
|
||||||
$case usz: return self.update_texture_by_id(name_or_id, pixels, width, height, x, y);
|
$case uint: return self.update_texture_by_id(name_or_id, pixels, width, height, x, y);
|
||||||
$case String: return self.update_texture_by_id(name_or_id.hash(), pixels, width, height, x, y);
|
$case String: return self.update_texture_by_id(name_or_id.hash(), pixels, width, height, x, y);
|
||||||
$default: unreachable("texture must have a name (String) or an id (usz)");
|
$default: unreachable("texture must have a name (String) or an id (uint)");
|
||||||
$endswitch
|
$endswitch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user