1
0

グラフィック系を大幅に高速化,16,2進数リテラルの実�

This commit is contained in:
otya128
2015-08-23 20:37:56 +09:00
parent e57782ea3d
commit 0a52b51371
7 changed files with 185 additions and 48 deletions

View File

@@ -18,6 +18,9 @@ class Draw
void gline(int page, int x, int y, int x2, int y2, uint color)
{
import std.math;
color = PetitComputer.toGLColor(petitcom.GRP[page].textureFormat, color);
glBindTexture(GL_TEXTURE_2D, petitcom.GRP[page].glTexture);
auto tf = petitcom.GRP[page].textureFormat;
int dx = abs(x2 - x);
int dy = abs(y2 - y);
int sx, sy;
@@ -27,7 +30,7 @@ class Draw
while(true)
{
if(x < 0 || y < 0 || x >= 512 || y >= 512) break;
gpset(page, x, y, color);
glTexSubImage2D(GL_TEXTURE_2D , 0, x, y, 1, 1, tf, GL_UNSIGNED_BYTE, &color);
if(x == x2 && y == y2) break;
int e2 = 2*err;
if(e2 > -dy)