···570570 return current_renderer->BlitBatch(current_renderer, src, dest, numSprites, values, flags);
571571572572 // Conversion time...
573573- int size = numSprites*(12 + 8 + 16);
574574- float* new_values = (float*)malloc(sizeof(float)*size);
575573576574 // Convert condensed interleaved format into full interleaved format for the renderer to use.
577575 // Condensed: Each vertex has 2 pos, 4 rect, 4 color
···587585 Uint8 pass_vertices = (flags & GPU_PASSTHROUGH_VERTICES);
588586 Uint8 pass_texcoords = (flags & GPU_PASSTHROUGH_TEXCOORDS);
589587 Uint8 pass_colors = (flags & GPU_PASSTHROUGH_COLORS);
588588+589589+ // Passthrough data is per-vertex. Non-passthrough is per-sprite. They can't interleave cleanly.
590590+ if((flags & GPU_PASSTHROUGH_ALL) != GPU_PASSTHROUGH_ALL)
591591+ {
592592+ GPU_LogError("GPU_BlitBatch: Cannot interpret interleaved data using partial passthrough.\n");
593593+ return -1;
594594+ }
595595+590596 if(pass_vertices)
591597 src_position_floats_per_sprite = 12; // 4 vertices of x, y, z
592598 if(pass_texcoords)
···601607 src_color_floats_per_sprite = 0;
602608603609 int src_floats_per_sprite = src_position_floats_per_sprite + src_rect_floats_per_sprite + src_color_floats_per_sprite;
610610+611611+ int size = numSprites*(12 + 8 + 16);
612612+ float* new_values = (float*)malloc(sizeof(float)*size);
604613605614 int n; // The sprite number iteration variable.
606615 // Source indices (per sprite)
···617626 float w2 = 0.5f*src->w; // texcoord helpers for position expansion
618627 float h2 = 0.5f*src->h;
619628620620- // FIXME: Does not do the right thing when pass_* is used.
621621- // I need to specify what the expected format is because mixing expanded values with passthrough values leads to format ambiguities.
622629 for(n = 0; n < numSprites; n++)
623630 {
624631 if(no_rects)
+2-1
SDL_gpu/SDL_gpu.h
···708708int GPU_BlitTransformMatrix(GPU_Image* src, GPU_Rect* srcrect, GPU_Target* dest, float x, float y, float* matrix3x3);
709709710710/*! Performs 'numSprites' blits of the 'src' image to the 'dest' target.
711711+ * Note: GPU_BlitBatch() cannot interpret a mix of normal values and "passthrough" values due to format ambiguity.
711712 * \param values A tightly-packed array of position (x,y), color (r,g,b,a) values with a range from 0-255, and src_rect (x,y,w,h) values in image coordinates
712712- * \param flags Bit flags to control the interpretation of the array parameters
713713+ * \param flags Bit flags to control the interpretation of the array parameters. The only passthrough option accepted is GPU_PASSTHROUGH_ALL.
713714 */
714715int GPU_BlitBatch(GPU_Image* src, GPU_Target* dest, unsigned int numSprites, float* values, GPU_BlitFlagEnum flags);
715716