Now I want to add functions to blit the Sony OSK but there was a bug when I blit image+osk (fast scanlines and controls doesn't respond, but no freeze).
I foudn a solution, but I've a question:
what is the difference between these two codes :
Code: Select all
int j = 0;
while (j < width) {
TextureVertex* vertices = (TextureVertex*)geGetMemory(2 * sizeof(TextureVertex));
int sliceWidth = 64;
if (j + sliceWidth > width) sliceWidth = width - j;
vertices[0].u = sx + j;
vertices[0].v = sy;
vertices[0].x = x + j;
vertices[0].y = y;
vertices[1].u = sx + j + sliceWidth;
vertices[1].v = sy + height;
vertices[1].x = x + j + sliceWidth;
vertices[1].y = y + height;
vertices[0].color = vertices[1].color = 0xffffffff;
geSendCommandi(CMD_DRAW_MODE, GE_COLOR_8888 | GE_TEXTURE_16BIT | GE_VERTEX_16BIT | GE_TRANSFORM_2D);
geSendCommandi(CMD_VERTICES_POINTER, ((unsigned int)vertices) & 0xffffff);
geSendCommandi(CMD_DRAW_TYPE_VCOUNT, (GE_SPRITES << 16)|2);
j += sliceWidth;
}
Code: Select all
int total_count = ((int)(width/64))+1;
TextureVertex* vertices = (TextureVertex*)geGetMemory((total_count<<1) * sizeof(TextureVertex));
int count = 0;
int j = 0;
while(j < width){
int sliceWidth = 64;
if (j + sliceWidth > width) sliceWidth = width - j;
vertices[count+0].u = sx + j;
vertices[count+0].v = sy;
vertices[count+0].x = x + j;
vertices[count+0].y = y;
vertices[count+1].u = sx + j + sliceWidth;
vertices[count+1].v = sy + height;
vertices[count+1].x = x + j + sliceWidth;
vertices[count+1].y = y + height;
vertices[count+0].color = vertices[count+1].color = 0xffffffff;
j += sliceWidth;
count += 2;
}
geSendCommandi(CMD_DRAW_MODE, GE_COLOR_8888 | GE_TEXTURE_16BIT | GE_VERTEX_16BIT | GE_TRANSFORM_2D);
geSendCommandi(CMD_VERTICES_POINTER, ((unsigned int)vertices) & 0xffffff);
geSendCommandi(CMD_DRAW_TYPE_VCOUNT, (GE_SPRITES << 16)|(total_count<<1));
I verified if the 'total_count' variable is the good, and yes...