Frame
This commit is contained in:
@@ -8,22 +8,41 @@
|
||||
#include "ui.h"
|
||||
#include "ui/uifps.h"
|
||||
#include "ui/uiconsole.h"
|
||||
#include "ui/uiframe.h"
|
||||
#include "display/framebuffer/framebuffer.h"
|
||||
#include "display/spritebatch/spritebatch.h"
|
||||
|
||||
#include "display/tileset/tileset_minogram.h"
|
||||
#include "display/tileset/tileset_ui.h"
|
||||
#include "display/tileset/tileset_ui_frame.h"
|
||||
|
||||
ui_t UI;
|
||||
|
||||
void uiInit(void) {
|
||||
errorret_t uiInit(void) {
|
||||
cameraInitOrthographic(&UI.camera);
|
||||
|
||||
UI.minogramTileset = (tileset_t*)&TILESET_MINOGRAM;
|
||||
|
||||
assetManagerLoadAsset(
|
||||
errorChain(assetManagerLoadAsset(
|
||||
UI.minogramTileset->image,
|
||||
&UI.minogramAsset,
|
||||
&UI.minogramRef
|
||||
);
|
||||
));
|
||||
|
||||
UI.uiTileset = (tileset_t*)&TILESET_UI;
|
||||
errorChain(assetManagerLoadAsset(
|
||||
UI.uiTileset->image,
|
||||
&UI.uiAsset,
|
||||
&UI.uiRef
|
||||
));
|
||||
|
||||
UI.frameTileset = (tileset_t*)&TILESET_UI_FRAME;
|
||||
errorChain(assetManagerLoadAsset(
|
||||
UI.frameTileset->image,
|
||||
&UI.frameAsset,
|
||||
&UI.frameRef
|
||||
));
|
||||
|
||||
errorOk();
|
||||
}
|
||||
|
||||
void uiRender(void) {
|
||||
@@ -38,7 +57,22 @@ void uiRender(void) {
|
||||
cameraPushMatrix(&UI.camera);
|
||||
|
||||
uiFPSRender(UI.minogramTileset, &UI.minogramAsset->alphaImage.texture);
|
||||
uiConsoleRender(UI.minogramTileset, &UI.minogramAsset->alphaImage.texture);
|
||||
|
||||
float_t x, y;
|
||||
x = 32, y = 32;
|
||||
uiFrameDrawTiled(
|
||||
x, y,
|
||||
256, 256,
|
||||
UI.frameTileset,
|
||||
0, 0,
|
||||
&UI.frameAsset->paletteImage.texture
|
||||
);
|
||||
|
||||
uiConsoleRender(
|
||||
0, 0,
|
||||
UI.minogramTileset, &UI.minogramAsset->alphaImage.texture
|
||||
);
|
||||
spriteBatchFlush();
|
||||
|
||||
cameraPopMatrix();
|
||||
}
|
||||
|
Reference in New Issue
Block a user