mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-13 09:35:23 -04:00
WIP on avoiding calling Window_SetRenderScreen so often
This commit is contained in:
parent
7d3bdb7f53
commit
e91cc7cfd8
26
src/Gui.c
26
src/Gui.c
@ -143,16 +143,12 @@ void Gui_LayoutAll(void) {
|
|||||||
struct Screen* s;
|
struct Screen* s;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
enum Screen3DS scr = Window_3DS_SetRenderScreen(BOTTOM_SCREEN);
|
|
||||||
|
|
||||||
for (i = 0; i < Gui.ScreensCount; i++)
|
for (i = 0; i < Gui.ScreensCount; i++)
|
||||||
{
|
{
|
||||||
s = Gui_Screens[i];
|
s = Gui_Screens[i];
|
||||||
s->VTABLE->Layout(s);
|
s->VTABLE->Layout(s);
|
||||||
s->dirty = true;
|
s->dirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Window_3DS_SetRenderScreen(scr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gui_RefreshAll(void) {
|
void Gui_RefreshAll(void) {
|
||||||
@ -162,14 +158,10 @@ void Gui_RefreshAll(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Gui_Refresh(struct Screen* s) {
|
void Gui_Refresh(struct Screen* s) {
|
||||||
enum Screen3DS scr = Window_3DS_SetRenderScreen(BOTTOM_SCREEN);
|
|
||||||
|
|
||||||
s->VTABLE->ContextLost(s);
|
s->VTABLE->ContextLost(s);
|
||||||
s->VTABLE->ContextRecreated(s);
|
s->VTABLE->ContextRecreated(s);
|
||||||
s->VTABLE->Layout(s);
|
s->VTABLE->Layout(s);
|
||||||
s->dirty = true;
|
s->dirty = true;
|
||||||
|
|
||||||
Window_3DS_SetRenderScreen(scr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Gui_AddCore(struct Screen* s, int priority) {
|
static void Gui_AddCore(struct Screen* s, int priority) {
|
||||||
@ -193,13 +185,13 @@ static void Gui_AddCore(struct Screen* s, int priority) {
|
|||||||
priorities[i] = priority;
|
priorities[i] = priority;
|
||||||
Gui.ScreensCount++;
|
Gui.ScreensCount++;
|
||||||
|
|
||||||
enum Screen3DS scr = Window_3DS_SetRenderScreen(BOTTOM_SCREEN);
|
|
||||||
|
|
||||||
s->dirty = true;
|
s->dirty = true;
|
||||||
s->VTABLE->Init(s);
|
s->VTABLE->Init(s);
|
||||||
s->VTABLE->ContextRecreated(s);
|
s->VTABLE->ContextRecreated(s);
|
||||||
s->VTABLE->Layout(s);
|
s->VTABLE->Layout(s);
|
||||||
|
|
||||||
|
enum Screen3DS scr = Window_3DS_SetRenderScreen(BOTTOM_SCREEN);
|
||||||
|
|
||||||
/* for selecting active button etc */
|
/* for selecting active button etc */
|
||||||
for (i = 0; i < Pointers_Count; i++)
|
for (i = 0; i < Pointers_Count; i++)
|
||||||
{
|
{
|
||||||
@ -409,8 +401,18 @@ void Widget_SetLocation(void* widget, cc_uint8 horAnchor, cc_uint8 verAnchor, in
|
|||||||
|
|
||||||
void Widget_CalcPosition(void* widget) {
|
void Widget_CalcPosition(void* widget) {
|
||||||
struct Widget* w = (struct Widget*)widget;
|
struct Widget* w = (struct Widget*)widget;
|
||||||
w->x = Gui_CalcPos(w->horAnchor, w->xOffset, w->width , Window_Main.Width );
|
int windowWidth, windowHeight;
|
||||||
w->y = Gui_CalcPos(w->verAnchor, w->yOffset, w->height, Window_Main.Height);
|
|
||||||
|
#ifdef CC_BUILD_DUALSCREEN
|
||||||
|
windowWidth = (w->flags & WIDGET_FLAG_MAINSCREEN) ? Window_Main.Width : Window_Alt.Width;
|
||||||
|
windowHeight = (w->flags & WIDGET_FLAG_MAINSCREEN) ? Window_Main.Height : Window_Alt.Height;
|
||||||
|
#else
|
||||||
|
windowWidth = Window_Main.Width;
|
||||||
|
windowHeight = Window_Main.Height;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
w->x = Gui_CalcPos(w->horAnchor, w->xOffset, w->width , windowWidth );
|
||||||
|
w->y = Gui_CalcPos(w->verAnchor, w->yOffset, w->height, windowHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget_Reset(void* widget) {
|
void Widget_Reset(void* widget) {
|
||||||
|
@ -173,6 +173,14 @@ struct WidgetVTABLE {
|
|||||||
#define WIDGET_FLAG_DISABLED 0x01
|
#define WIDGET_FLAG_DISABLED 0x01
|
||||||
/* Whether a widget can be selected via up/down */
|
/* Whether a widget can be selected via up/down */
|
||||||
#define WIDGET_FLAG_SELECTABLE 0x02
|
#define WIDGET_FLAG_SELECTABLE 0x02
|
||||||
|
/* Whether for dual screen builds, this widget still appears on */
|
||||||
|
/* the main game screen instead of the dedicated UI screen */
|
||||||
|
#define WIDGET_FLAG_MAINSCREEN 0x04
|
||||||
|
#ifdef CC_BUILD_DUALSCREEN
|
||||||
|
#define Window_UI Window_Alt
|
||||||
|
#else
|
||||||
|
#define Window_UI Window_Main
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Represents an individual 2D gui component. */
|
/* Represents an individual 2D gui component. */
|
||||||
struct Widget { Widget_Body };
|
struct Widget { Widget_Body };
|
||||||
|
14
src/Menus.c
14
src/Menus.c
@ -994,13 +994,13 @@ static void EditHotkeyScreen_Update(void* screen, double delta) {
|
|||||||
static void EditHotkeyScreen_Layout(void* screen) {
|
static void EditHotkeyScreen_Layout(void* screen) {
|
||||||
struct EditHotkeyScreen* s = (struct EditHotkeyScreen*)screen;
|
struct EditHotkeyScreen* s = (struct EditHotkeyScreen*)screen;
|
||||||
s->barWidth = Display_ScaleX(500);
|
s->barWidth = Display_ScaleX(500);
|
||||||
s->barX = Gui_CalcPos(ANCHOR_CENTRE, 0, s->barWidth, Window_Main.Width);
|
s->barX = Gui_CalcPos(ANCHOR_CENTRE, 0, s->barWidth, Window_UI.Width);
|
||||||
s->barHeight = Display_ScaleY(2);
|
s->barHeight = Display_ScaleY(2);
|
||||||
|
|
||||||
s->barY[0] = Gui_CalcPos(ANCHOR_CENTRE, Display_ScaleY(-65),
|
s->barY[0] = Gui_CalcPos(ANCHOR_CENTRE, Display_ScaleY(-65),
|
||||||
s->barHeight, Window_Main.Height);
|
s->barHeight, Window_UI.Height);
|
||||||
s->barY[1] = Gui_CalcPos(ANCHOR_CENTRE, Display_ScaleY( 45),
|
s->barY[1] = Gui_CalcPos(ANCHOR_CENTRE, Display_ScaleY( 45),
|
||||||
s->barHeight, Window_Main.Height);
|
s->barHeight, Window_UI.Height);
|
||||||
|
|
||||||
Widget_SetLocation(&s->btns[0], ANCHOR_CENTRE, ANCHOR_CENTRE, 0, -150);
|
Widget_SetLocation(&s->btns[0], ANCHOR_CENTRE, ANCHOR_CENTRE, 0, -150);
|
||||||
Widget_SetLocation(&s->btns[1], ANCHOR_CENTRE, ANCHOR_CENTRE, 0, -100);
|
Widget_SetLocation(&s->btns[1], ANCHOR_CENTRE, ANCHOR_CENTRE, 0, -100);
|
||||||
@ -2458,7 +2458,7 @@ static void MenuOptionsScreen_LayoutExtHelp(struct MenuOptionsScreen* s) {
|
|||||||
Widget_SetLocation(&s->extHelp, ANCHOR_MIN, ANCHOR_CENTRE_MIN, 0, 100);
|
Widget_SetLocation(&s->extHelp, ANCHOR_MIN, ANCHOR_CENTRE_MIN, 0, 100);
|
||||||
/* If use centre align above, then each line in extended help gets */
|
/* If use centre align above, then each line in extended help gets */
|
||||||
/* centered aligned separately - which is not the desired behaviour. */
|
/* centered aligned separately - which is not the desired behaviour. */
|
||||||
s->extHelp.xOffset = Window_Main.Width / 2 - s->extHelp.width / 2;
|
s->extHelp.xOffset = Window_UI.Width / 2 - s->extHelp.width / 2;
|
||||||
Widget_Layout(&s->extHelp);
|
Widget_Layout(&s->extHelp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3551,12 +3551,12 @@ static void TexIdsOverlay_Layout(void* screen) {
|
|||||||
struct TexIdsOverlay* s = (struct TexIdsOverlay*)screen;
|
struct TexIdsOverlay* s = (struct TexIdsOverlay*)screen;
|
||||||
int size;
|
int size;
|
||||||
|
|
||||||
size = Window_Main.Height / ATLAS2D_TILES_PER_ROW;
|
size = Window_UI.Height / ATLAS2D_TILES_PER_ROW;
|
||||||
size = (size / 8) * 8;
|
size = (size / 8) * 8;
|
||||||
Math_Clamp(size, 8, 40);
|
Math_Clamp(size, 8, 40);
|
||||||
|
|
||||||
s->xOffset = Gui_CalcPos(ANCHOR_CENTRE, 0, size * Atlas2D.RowsCount, Window_Main.Width);
|
s->xOffset = Gui_CalcPos(ANCHOR_CENTRE, 0, size * Atlas2D.RowsCount, Window_UI.Width);
|
||||||
s->yOffset = Gui_CalcPos(ANCHOR_CENTRE, 0, size * ATLAS2D_TILES_PER_ROW, Window_Main.Height);
|
s->yOffset = Gui_CalcPos(ANCHOR_CENTRE, 0, size * ATLAS2D_TILES_PER_ROW, Window_UI.Height);
|
||||||
s->tileSize = size;
|
s->tileSize = size;
|
||||||
|
|
||||||
/* Can't use vertical centreing here */
|
/* Can't use vertical centreing here */
|
||||||
|
@ -202,11 +202,9 @@ static void HUDScreen_ContextRecreated(void* screen) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int HUDScreen_LayoutHotbar(void) {
|
static int HUDScreen_LayoutHotbar(void) {
|
||||||
enum Screen3DS scr = Window_3DS_SetRenderScreen(BOTTOM_SCREEN);
|
|
||||||
struct HUDScreen* s = &HUDScreen_Instance;
|
struct HUDScreen* s = &HUDScreen_Instance;
|
||||||
s->hotbar.scale = Gui_GetHotbarScale();
|
s->hotbar.scale = Gui_GetHotbarScale();
|
||||||
Widget_Layout(&s->hotbar);
|
Widget_Layout(&s->hotbar);
|
||||||
Window_3DS_SetRenderScreen(scr);
|
|
||||||
return s->hotbar.height;
|
return s->hotbar.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,6 +293,10 @@ static void HUDScreen_Init(void* screen) {
|
|||||||
TextWidget_Init(&s->line1);
|
TextWidget_Init(&s->line1);
|
||||||
TextWidget_Init(&s->line2);
|
TextWidget_Init(&s->line2);
|
||||||
|
|
||||||
|
s->hotbar.flags |= WIDGET_FLAG_MAINSCREEN;
|
||||||
|
s->line1.flags |= WIDGET_FLAG_MAINSCREEN;
|
||||||
|
s->line2.flags |= WIDGET_FLAG_MAINSCREEN;
|
||||||
|
|
||||||
Event_Register_(&UserEvents.HacksStateChanged, s, HUDScreen_HacksChanged);
|
Event_Register_(&UserEvents.HacksStateChanged, s, HUDScreen_HacksChanged);
|
||||||
Event_Register_(&TextureEvents.AtlasChanged, s, HUDScreen_NeedRedrawing);
|
Event_Register_(&TextureEvents.AtlasChanged, s, HUDScreen_NeedRedrawing);
|
||||||
Event_Register_(&BlockEvents.BlockDefChanged, s, HUDScreen_NeedRedrawing);
|
Event_Register_(&BlockEvents.BlockDefChanged, s, HUDScreen_NeedRedrawing);
|
||||||
@ -339,17 +341,14 @@ static void HUDScreen_BuildCrosshairsMesh(struct VertexTextured** ptr) {
|
|||||||
/* Only top quarter of icons.png is used */
|
/* Only top quarter of icons.png is used */
|
||||||
static struct Texture tex = { 0, Tex_Rect(0,0,0,0), Tex_UV(0.0f,0.0f, 15/256.0f,15/64.0f) };
|
static struct Texture tex = { 0, Tex_Rect(0,0,0,0), Tex_UV(0.0f,0.0f, 15/256.0f,15/64.0f) };
|
||||||
int extent;
|
int extent;
|
||||||
enum Screen3DS scr = Window_3DS_SetRenderScreen(TOP_SCREEN);
|
|
||||||
|
|
||||||
extent = (int)(CH_EXTENT * Gui_Scale(Window_Main.Height / 480.0f));
|
extent = (int)(CH_EXTENT * Gui_Scale(Window_UI.Height / 480.0f));
|
||||||
tex.x = (Window_Main.Width / 2) - extent;
|
tex.x = (Window_UI.Width / 2) - extent;
|
||||||
tex.y = (Window_Main.Height / 2) - extent;
|
tex.y = (Window_UI.Height / 2) - extent;
|
||||||
|
|
||||||
tex.Width = extent * 2;
|
tex.Width = extent * 2;
|
||||||
tex.Height = extent * 2;
|
tex.Height = extent * 2;
|
||||||
Gfx_Make2DQuad(&tex, PACKEDCOL_WHITE, ptr);
|
Gfx_Make2DQuad(&tex, PACKEDCOL_WHITE, ptr);
|
||||||
|
|
||||||
Window_3DS_SetRenderScreen(scr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void HUDScreen_BuildMesh(void* screen) {
|
static void HUDScreen_BuildMesh(void* screen) {
|
||||||
@ -504,8 +503,6 @@ static void TabListOverlay_Layout(void* screen) {
|
|||||||
int i, x, y, width = 0, height = 0;
|
int i, x, y, width = 0, height = 0;
|
||||||
int columns = Math_CeilDiv(s->usedCount, LIST_NAMES_PER_COLUMN);
|
int columns = Math_CeilDiv(s->usedCount, LIST_NAMES_PER_COLUMN);
|
||||||
|
|
||||||
enum Screen3DS scr = Window_3DS_SetRenderScreen(TOP_SCREEN);
|
|
||||||
|
|
||||||
for (i = 0; i < columns; i++)
|
for (i = 0; i < columns; i++)
|
||||||
{
|
{
|
||||||
width += TabListOverlay_GetColumnWidth(s, i);
|
width += TabListOverlay_GetColumnWidth(s, i);
|
||||||
@ -521,9 +518,9 @@ static void TabListOverlay_Layout(void* screen) {
|
|||||||
width += paddingX * 2;
|
width += paddingX * 2;
|
||||||
height += paddingY * 2;
|
height += paddingY * 2;
|
||||||
|
|
||||||
y = Window_Main.Height / 4 - height / 2;
|
y = Window_UI.Height / 4 - height / 2;
|
||||||
s->x = Gui_CalcPos(ANCHOR_CENTRE, 0, width , Window_Main.Width );
|
s->x = Gui_CalcPos(ANCHOR_CENTRE, 0, width , Window_UI.Width );
|
||||||
s->y = Gui_CalcPos(ANCHOR_CENTRE, -max(0, y), height, Window_Main.Height);
|
s->y = Gui_CalcPos(ANCHOR_CENTRE, -max(0, y), height, Window_UI.Height);
|
||||||
|
|
||||||
x = s->x + paddingX;
|
x = s->x + paddingX;
|
||||||
y = s->y + paddingY;
|
y = s->y + paddingY;
|
||||||
@ -542,8 +539,6 @@ static void TabListOverlay_Layout(void* screen) {
|
|||||||
s->title.horAnchor = ANCHOR_CENTRE;
|
s->title.horAnchor = ANCHOR_CENTRE;
|
||||||
s->title.yOffset = s->y + paddingY / 2;
|
s->title.yOffset = s->y + paddingY / 2;
|
||||||
Widget_Layout(&s->title);
|
Widget_Layout(&s->title);
|
||||||
|
|
||||||
Window_3DS_SetRenderScreen(scr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void TabListOverlay_AddName(struct TabListOverlay* s, EntityID id, int index) {
|
static void TabListOverlay_AddName(struct TabListOverlay* s, EntityID id, int index) {
|
||||||
@ -906,11 +901,11 @@ static void ChatScreen_UpdateChatYOffsets(struct ChatScreen* s) {
|
|||||||
|
|
||||||
y = min(s->input.base.y, Gui_HUD->hotbar.y);
|
y = min(s->input.base.y, Gui_HUD->hotbar.y);
|
||||||
y -= s->input.base.yOffset; /* add some padding */
|
y -= s->input.base.yOffset; /* add some padding */
|
||||||
s->altText.yOffset = Window_Main.Height - y;
|
s->altText.yOffset = Window_UI.Height - y;
|
||||||
Widget_Layout(&s->altText);
|
Widget_Layout(&s->altText);
|
||||||
|
|
||||||
pad = s->altText.active ? 5 : 10;
|
pad = s->altText.active ? 5 : 10;
|
||||||
s->clientStatus.yOffset = Window_Main.Height - s->altText.y + pad;
|
s->clientStatus.yOffset = Window_UI.Height - s->altText.y + pad;
|
||||||
Widget_Layout(&s->clientStatus);
|
Widget_Layout(&s->clientStatus);
|
||||||
s->chat.yOffset = s->clientStatus.yOffset + s->clientStatus.height;
|
s->chat.yOffset = s->clientStatus.yOffset + s->clientStatus.height;
|
||||||
Widget_Layout(&s->chat);
|
Widget_Layout(&s->chat);
|
||||||
@ -1239,8 +1234,6 @@ static void ChatScreen_BuildMesh(void* screen) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void ChatScreen_Layout(void* screen) {
|
static void ChatScreen_Layout(void* screen) {
|
||||||
enum Screen3DS scr = Window_3DS_SetRenderScreen(TOP_SCREEN);
|
|
||||||
|
|
||||||
struct ChatScreen* s = (struct ChatScreen*)screen;
|
struct ChatScreen* s = (struct ChatScreen*)screen;
|
||||||
if (ChatScreen_ChatUpdateFont(s)) ChatScreen_Redraw(s);
|
if (ChatScreen_ChatUpdateFont(s)) ChatScreen_Redraw(s);
|
||||||
|
|
||||||
@ -1260,19 +1253,17 @@ static void ChatScreen_Layout(void* screen) {
|
|||||||
Widget_Layout(&s->bottomRight);
|
Widget_Layout(&s->bottomRight);
|
||||||
|
|
||||||
Widget_SetLocation(&s->announcement, ANCHOR_CENTRE, ANCHOR_CENTRE, 0, 0);
|
Widget_SetLocation(&s->announcement, ANCHOR_CENTRE, ANCHOR_CENTRE, 0, 0);
|
||||||
s->announcement.yOffset = -Window_Main.Height / 4;
|
s->announcement.yOffset = -Window_UI.Height / 4;
|
||||||
Widget_Layout(&s->announcement);
|
Widget_Layout(&s->announcement);
|
||||||
|
|
||||||
Widget_SetLocation(&s->bigAnnouncement, ANCHOR_CENTRE, ANCHOR_CENTRE, 0, 0);
|
Widget_SetLocation(&s->bigAnnouncement, ANCHOR_CENTRE, ANCHOR_CENTRE, 0, 0);
|
||||||
s->bigAnnouncement.yOffset = -Window_Main.Height / 16;
|
s->bigAnnouncement.yOffset = -Window_UI.Height / 16;
|
||||||
Widget_Layout(&s->bigAnnouncement);
|
Widget_Layout(&s->bigAnnouncement);
|
||||||
|
|
||||||
Widget_SetLocation(&s->smallAnnouncement, ANCHOR_CENTRE, ANCHOR_CENTRE, 0, 0);
|
Widget_SetLocation(&s->smallAnnouncement, ANCHOR_CENTRE, ANCHOR_CENTRE, 0, 0);
|
||||||
s->smallAnnouncement.yOffset = Window_Main.Height / 20;
|
s->smallAnnouncement.yOffset = Window_UI.Height / 20;
|
||||||
Widget_Layout(&s->smallAnnouncement);
|
Widget_Layout(&s->smallAnnouncement);
|
||||||
|
|
||||||
Window_3DS_SetRenderScreen(scr);
|
|
||||||
|
|
||||||
#ifdef CC_BUILD_TOUCH
|
#ifdef CC_BUILD_TOUCH
|
||||||
if (Window_Main.SoftKeyboard == SOFT_KEYBOARD_SHIFT) {
|
if (Window_Main.SoftKeyboard == SOFT_KEYBOARD_SHIFT) {
|
||||||
Widget_SetLocation(&s->send, ANCHOR_MAX, ANCHOR_MAX, 10, 60);
|
Widget_SetLocation(&s->send, ANCHOR_MAX, ANCHOR_MAX, 10, 60);
|
||||||
@ -1472,6 +1463,19 @@ static void ChatScreen_Init(void* screen) {
|
|||||||
|
|
||||||
s->maxVertices = ChatScreen_CalcMaxVertices(s);
|
s->maxVertices = ChatScreen_CalcMaxVertices(s);
|
||||||
|
|
||||||
|
/* For dual screen builds, chat is still rendered on the main game screen */
|
||||||
|
s->input.base.flags |= WIDGET_FLAG_MAINSCREEN;
|
||||||
|
s->altText.flags |= WIDGET_FLAG_MAINSCREEN;
|
||||||
|
s->status.flags |= WIDGET_FLAG_MAINSCREEN;
|
||||||
|
s->bottomRight.flags |= WIDGET_FLAG_MAINSCREEN;
|
||||||
|
s->chat.flags |= WIDGET_FLAG_MAINSCREEN;
|
||||||
|
s->clientStatus.flags |= WIDGET_FLAG_MAINSCREEN;
|
||||||
|
|
||||||
|
s->bottomRight.flags |= WIDGET_FLAG_MAINSCREEN;
|
||||||
|
s->announcement.flags |= WIDGET_FLAG_MAINSCREEN;
|
||||||
|
s->bigAnnouncement.flags |= WIDGET_FLAG_MAINSCREEN;
|
||||||
|
s->smallAnnouncement.flags |= WIDGET_FLAG_MAINSCREEN;
|
||||||
|
|
||||||
#ifdef CC_BUILD_TOUCH
|
#ifdef CC_BUILD_TOUCH
|
||||||
ButtonWidget_Init(&s->send, 100, NULL);
|
ButtonWidget_Init(&s->send, 100, NULL);
|
||||||
ButtonWidget_Init(&s->cancel, 100, NULL);
|
ButtonWidget_Init(&s->cancel, 100, NULL);
|
||||||
@ -1802,7 +1806,7 @@ static void LoadingScreen_SetMessage(struct LoadingScreen* s) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void LoadingScreen_CalcMaxVertices(struct LoadingScreen* s) {
|
static void LoadingScreen_CalcMaxVertices(struct LoadingScreen* s) {
|
||||||
s->rows = Math_CeilDiv(Window_Main.Height, LOADING_TILE_SIZE);
|
s->rows = Math_CeilDiv(Window_UI.Height, LOADING_TILE_SIZE);
|
||||||
s->maxVertices = Screen_CalcDefaultMaxVertices(s) + s->rows * 4;
|
s->maxVertices = Screen_CalcDefaultMaxVertices(s) + s->rows * 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1814,9 +1818,9 @@ static void LoadingScreen_Layout(void* screen) {
|
|||||||
y = Display_ScaleY(34);
|
y = Display_ScaleY(34);
|
||||||
|
|
||||||
s->progWidth = Display_ScaleX(200);
|
s->progWidth = Display_ScaleX(200);
|
||||||
s->progX = Gui_CalcPos(ANCHOR_CENTRE, 0, s->progWidth, Window_Main.Width);
|
s->progX = Gui_CalcPos(ANCHOR_CENTRE, 0, s->progWidth, Window_UI.Width);
|
||||||
s->progHeight = Display_ScaleY(4);
|
s->progHeight = Display_ScaleY(4);
|
||||||
s->progY = Gui_CalcPos(ANCHOR_CENTRE, y, s->progHeight, Window_Main.Height);
|
s->progY = Gui_CalcPos(ANCHOR_CENTRE, y, s->progHeight, Window_UI.Height);
|
||||||
|
|
||||||
oldRows = s->rows;
|
oldRows = s->rows;
|
||||||
LoadingScreen_CalcMaxVertices(s);
|
LoadingScreen_CalcMaxVertices(s);
|
||||||
@ -1850,9 +1854,9 @@ static void LoadingScreen_BuildMesh(void* screen) {
|
|||||||
ptr = &data;
|
ptr = &data;
|
||||||
|
|
||||||
loc = Block_Tex(BLOCK_DIRT, FACE_YMAX);
|
loc = Block_Tex(BLOCK_DIRT, FACE_YMAX);
|
||||||
Tex_SetRect(tex, 0,0, Window_Main.Width,LOADING_TILE_SIZE);
|
Tex_SetRect(tex, 0,0, Window_UI.Width,LOADING_TILE_SIZE);
|
||||||
tex.uv = Atlas1D_TexRec(loc, 1, &atlasIndex);
|
tex.uv = Atlas1D_TexRec(loc, 1, &atlasIndex);
|
||||||
tex.uv.U2 = (float)Window_Main.Width / LOADING_TILE_SIZE;
|
tex.uv.U2 = (float)Window_UI.Width / LOADING_TILE_SIZE;
|
||||||
|
|
||||||
for (i = 0; i < s->rows; i++) {
|
for (i = 0; i < s->rows; i++) {
|
||||||
tex.y = i * LOADING_TILE_SIZE;
|
tex.y = i * LOADING_TILE_SIZE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user