1
0

Implement FONTDEF (3)

This commit is contained in:
otya128
2016-12-30 16:49:32 +09:00
parent 20b00236a2
commit 6f4b4d0f65
3 changed files with 18 additions and 5 deletions

View File

@@ -3362,6 +3362,10 @@ class BuiltinFunction
p.console.define(code, array.doubleArray.array); p.console.define(code, array.doubleArray.array);
} }
} }
static void FONTDEF(PetitComputer p)
{
p.console.initGRPF();
}
//alias void function(PetitComputer, Value[], Value[]) BuiltinFunc; //alias void function(PetitComputer, Value[], Value[]) BuiltinFunc;
static BuiltinFunctions[wstring] builtinFunctions; static BuiltinFunctions[wstring] builtinFunctions;
static wstring getBasicName(BFD)(const wstring def) static wstring getBasicName(BFD)(const wstring def)

View File

@@ -524,4 +524,16 @@ class Console
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_BGRA, GL_UNSIGNED_BYTE, buffer); glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_BGRA, GL_UNSIGNED_BYTE, buffer);
glFlush(); glFlush();
} }
void initGRPF()
{
if (GRPF)
{
GRPF.deleteGL();
GRPF.deleteSDL();
}
GRPF = petitcom.graphic.createGRPF(petitcom.fontFile);
petitcom.graphic.GRPFWidth = GRPF.surface.w;
petitcom.graphic.GRPFHeight = GRPF.surface.h;
GRPF.createTexture(petitcom.renderer, petitcom.textureScaleMode);
}
} }

View File

@@ -736,10 +736,7 @@ class PetitComputer
return; return;
} }
SDL_GL_MakeCurrent(window, context); SDL_GL_MakeCurrent(window, context);
console.GRPF = graphic.createGRPF(fontFile); console.initGRPF();
graphic.GRPFWidth = console.GRPF.surface.w;
graphic.GRPFHeight = console.GRPF.surface.h;
console.GRPF.createTexture(renderer, textureScaleMode);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glEnable(GL_DEPTH_TEST); glEnable(GL_DEPTH_TEST);
version(Windows) version(Windows)
@@ -1669,7 +1666,7 @@ class PetitComputer
} }
if (fontdef) if (fontdef)
{ {
//TODO this.console.initGRPF();
} }
} }