diff --git a/src/MyAzurShaders.h b/src/MyAzurShaders.h index d092fda..9557aeb 100644 --- a/src/MyAzurShaders.h +++ b/src/MyAzurShaders.h @@ -3,4 +3,4 @@ void azrp_pixel(int x1, int y1, int color); -void azrp_pixellist(std::vector list, int fragnum ); \ No newline at end of file +void azrp_pixellist(std::vector const &list, int fragnum ); \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index afc1f62..026489e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -222,7 +222,7 @@ int main(void) usb_fxlink_videocapture(false); } - if (textouput && usb_is_open()) + if (textoutput && usb_is_open()) { char texttosend[1024]; for(unsigned int i=0; iMyStars.size(); i++) diff --git a/src/pixellistshader.cpp b/src/pixellistshader.cpp index db8d59e..a0b57a9 100644 --- a/src/pixellistshader.cpp +++ b/src/pixellistshader.cpp @@ -23,17 +23,19 @@ void azrp_shader_pixellist_configure(void) struct command { uint8_t shader_id; - std::vector data; + uint16_t length; + Pixel * const *data; }; -void azrp_pixellist(std::vector list, int fragnum ) +void azrp_pixellist(std::vector const &list, int fragnum ) { prof_enter(azrp_perf_cmdgen); struct command cmd; cmd.shader_id = AZRP_SHADER_PIXELLIST; - cmd.data = list; + cmd.length = list.size(); + cmd.data = list.data(); azrp_queue_command(&cmd, sizeof cmd, fragnum, 1); prof_leave(azrp_perf_cmdgen); @@ -45,6 +47,8 @@ void azrp_shader_pixellist( void *uniforms, void *comnd, void *fragment ) struct command *cmd = (struct command *) comnd; uint16_t *frag = (uint16_t *) fragment; - for( auto& pix : cmd->data ) + for(int i = 0; i < cmd->length; i++) { + Pixel *pix = cmd->data[i]; frag[azrp_width * pix->y + pix->x] = pix->c; + } } \ No newline at end of file diff --git a/src/starfield.cpp b/src/starfield.cpp index 24ffe5a..53fc556 100644 --- a/src/starfield.cpp +++ b/src/starfield.cpp @@ -24,10 +24,13 @@ Star::Star( void ) int colorrandom = rand() % 4; + color = 0xFFFF; +/* if (colorrandom==0) color = 0xFFFF; else if (colorrandom==1) color = 0xFFE0; else if (colorrandom==2) color = 0xFB80; else color = 0xF80D; +*/ } Star::~Star() @@ -55,7 +58,7 @@ Starfield::Starfield( ) { srand(rtc_ticks()); - for(int i=0; i<10; i++) + for(int i=0; i<100; i++) { Star *s = new Star( ); MyStars.push_back( s ); @@ -79,10 +82,8 @@ Starfield::~Starfield( ) void Starfield::Update( float dt ) { -// for(auto& s : MyStars) -// s->Update( dt ); + libnum::num a = libnum::num( dt / 50000.f ); - libnum::num a = libnum::num( dt / 120000.f ); for(auto& s : MyStars) s->Update( a ); }