fix compiler warnings and release mode u32 overflow
This commit is contained in:
parent
9550d34e65
commit
704b14b2a0
3 changed files with 12 additions and 7 deletions
|
|
@ -467,12 +467,12 @@ void pxl8_procgen_tex(u8* buffer, const pxl8_procgen_tex_params* params) {
|
|||
i32 ix = (i32)((f32)x * params->scale);
|
||||
i32 iy = (i32)((f32)y * params->scale);
|
||||
|
||||
u32 block_hash = (ix * 374761393 + iy * 668265263) ^ params->seed;
|
||||
u32 block_hash = ((u32)ix * 374761393u + (u32)iy * 668265263u) ^ params->seed;
|
||||
block_hash ^= block_hash >> 13;
|
||||
block_hash ^= block_hash << 17;
|
||||
block_hash ^= block_hash >> 5;
|
||||
|
||||
u32 pixel_hash = (x * 1597334677 + y * 3812015801) ^ params->seed;
|
||||
u32 pixel_hash = ((u32)x * 1597334677u + (u32)y * 3812015801u) ^ params->seed;
|
||||
pixel_hash ^= pixel_hash >> 13;
|
||||
pixel_hash ^= pixel_hash << 17;
|
||||
pixel_hash ^= pixel_hash >> 5;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue