Implement FONTDEF (3)
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user