Skip to content

Commit

Permalink
work
Browse files Browse the repository at this point in the history
  • Loading branch information
steeljustify committed Feb 6, 2025
1 parent c59b4b0 commit 512698b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
12 changes: 2 additions & 10 deletions header/actrprng.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,9 @@
#include "actrtime.h"

// this is probably a "bad" idea, some guy on SO said making my own prng was bad so I did it
//
extern void prngd(double d);

float actr_prng_max = 4294967295;
//unsigned int actr_prng_prime = 2147483647;
float actr_prng_max = 4294967296;
unsigned int actr_prng_prime = 2147483629;

//unsigned int actr_prng_prime = 479001599;

//unsigned int actr_prng_prime = 13;
unsigned int actr_prng_seed = 419420;

void actr_sprng(unsigned int seed) {
Expand All @@ -23,10 +16,9 @@ unsigned int actr_prng() {
return actr_prng_seed;
}

float actr_prngd() {
float actr_prngf() {
actr_prng_seed *= actr_prng_prime;
float result = actr_prng_seed / actr_prng_max;
prngd(result);
return result;
}

Expand Down
4 changes: 2 additions & 2 deletions ui-example.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ void actr_init()
{
actr_sprng(actr_time());
tree = actr_quad_tree_init();
for (int i = 0; i < 77; i++)
for (int i = 0; i < 1000; i++)
{
actr_prngd();
actr_prngf();
}
}
[[clang::export_name("actr_tap")]]
Expand Down

0 comments on commit 512698b

Please sign in to comment.