Skip to content

Commit

Permalink
24.12.8
Browse files Browse the repository at this point in the history
24.12.4

[Diggers]

[Assets]
* Rebuild API documentation.

[Engine]
* Fix window resize issues and errors with terminal console.
* Fix sporadic and erroneous references to 'bot mode', it just means a terminal version of the console using NCurses.
  • Loading branch information
Mhatxotic committed Dec 8, 2024
1 parent 4865103 commit 951cc25
Show file tree
Hide file tree
Showing 12 changed files with 130 additions and 124 deletions.
3 changes: 2 additions & 1 deletion diggers/src/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,8 @@ local function fcbTick()
local iYBack<const> = iY + iHeight + iBorderX2;
local iXBack2<const> = iX + iWidth + iBorder;
local iYBack2<const> = iY + iHeight + (iBorderX2 - iBorder);
local iXText<const>, iYText<const> = iX + iWidth + iBorderX2, iY - 12;
local iXText<const> = iX + iWidth + iBorderX2;
local iYText<const> = iY - (3 * iTexScale);
-- Last percentage
local nLastPercentage = -1;
-- Loader display function
Expand Down
42 changes: 24 additions & 18 deletions diggers/src/title.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ local fcbEnterAnimProc, -- Enter animation procedure
iKeyBankId, -- Title key bank id
iNextUpdate, -- Next system information update
iSSelect, -- Select sound id
iStageL, iStageR, -- Stage bounds
iStageL, iStageR, iStageB, -- Stage bounds
iTexScale, -- Texture scale
texTitle, -- Texture tile
strCredits, -- Credits
Expand All @@ -44,42 +44,42 @@ local sAppTitle, sAppVendor, iAppMajor<const>, iAppMinor<const>,
iAppBuild<const>, iAppRevision<const>, _, _, sAppExeType = Core.Engine();
sAppTitle, sAppVendor, sAppExeType =
sAppTitle:upper(), sAppVendor:upper(), sAppExeType:upper();
-- Static element positions ------------------------------------------------ --
local iCentreX, iCreditsY, iLogoX, iLogoY, iPostQuitX, iPostY, iSubTitleY;
-- Render in procedure ----------------------------------------------------- --
local function RenderEnterAnimProc()
-- Scroll in amount
local n1, n2 = 160, 168;
-- Centre of screen
local iCentreX<const> = 160 * iTexScale;
-- Initial animation procedure
local function RenderAnimProcInitial()
-- Render terrain and game objects
RenderTerrain();
RenderObjects();
-- Render title objects
texTitle:BlitLT(79, 12 - n1);
texTitle:BlitSLT(1, iStageL - n1, 72);
texTitle:BlitSLT(2, (iStageR - 168) + n2, 72);
texTitle:BlitLT(iLogoX, iTexScale * (12 - n1));
texTitle:BlitSLT(1, iStageL - (iTexScale * n1), iPostY);
texTitle:BlitSLT(2, iStageR - (iTexScale * (168 - n2)), iPostY);
-- Render status text
fontTiny:SetCRGB(1, 0.9, 0);
fontTiny:PrintC(iCentreX, 58 - n1, strSubTitle);
fontTiny:PrintC(iCentreX, 206 + n1, strCredits);
fontTiny:PrintC(iCentreX, iTexScale * (58 - n1), strSubTitle);
fontTiny:PrintC(iCentreX, iTexScale * (206 + n1), strCredits);
-- Move components in
n1 = n1 - (n1 * 0.1);
n2 = n2 - (n2 * 0.1);
if n1 >= 1 and n2 >= 1 then return end;
if n1 > 1 and n2 > 1 then return end;
-- Animation completed
local function RenderAnimProcFinished()
-- Render terrain and game objects
RenderTerrain();
RenderObjects();
-- Render title objects
texTitle:BlitLT(79, 12);
texTitle:BlitSLT(1, iStageL, 72);
texTitle:BlitSLT(2, iStageR - 168, 72);
texTitle:BlitLT(iLogoX, iLogoY);
texTitle:BlitSLT(1, iStageL, iPostY);
texTitle:BlitSLT(2, iPostQuitX, iPostY);
-- Render status text
fontTiny:SetCRGB(1, 0.9, 0);
fontTiny:PrintC(iCentreX, 58, strSubTitle);
fontTiny:PrintC(iCentreX, 206, strCredits);
fontTiny:PrintC(iCentreX, iSubTitleY, strSubTitle);
fontTiny:PrintC(iCentreX, iCreditsY, strCredits);
end
-- Set finished callback and execute it
fcbEnterAnimProc = RenderAnimProcFinished;
Expand All @@ -93,15 +93,13 @@ end
local function RenderLeaveAnimProc()
-- Scroll in amount
local n1, n2 = 160, 168;
-- Centre of screen
local iCentreX<const> = 160 * iTexScale;
-- Initial animation procedure
local function RenderAnimProcInitial()
-- Render terrain and game objects
RenderTerrain();
RenderObjects();
-- Render title objects
texTitle:BlitLT(79, -148 + n1);
texTitle:BlitLT(79, iTexScale * (-148 + n1));
texTitle:BlitSLT(1, iStageL - 168 + n1, 72);
texTitle:BlitSLT(2, iStageR - n2, 72);
-- Render status text
Expand Down Expand Up @@ -259,7 +257,15 @@ end
-- Framebuffer changed callback -------------------------------------------- --
local function OnFrameBufferUpdated(...)
-- Update stage bounds
local _ _, _, iStageL, _, iStageR, _ = ...;
local _ _, _, iStageL, _, iStageR, iStageB = ...;
-- Recalculate static element positions
iCentreX = iTexScale * 160;
iCreditsY = iTexScale * 206;
iLogoX = iTexScale * 79;
iLogoY = iTexScale * 12;
iPostQuitX = iStageR - (iTexScale * 168);
iPostY = iTexScale * 72;
iSubTitleY = iTexScale * 58;
-- Re-detect video RAM
DetectVRAM();
end
Expand Down
30 changes: 15 additions & 15 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<!-- Reference for the Mhatxotic Engine API version 24.12.4.43 -->
<!-- Automatically built at Wed Dec 04 23:51:39 2024 +0000 -->
<!-- With Mhatxotic Engine Project Management Utility version 24.12.4.43 -->
<!-- Reference for the Mhatxotic Engine API version 24.12.5.12 -->
<!-- Automatically built at Thu Dec 05 17:19:14 2024 +0000 -->
<!-- With Mhatxotic Engine Project Management Utility version 24.12.5.12 -->
<!-- Copyright (c) 2006-2024 Mhatxotic Design, All Rights Reserved Worldwide -->
<HTML lang="en-GB">
<HEAD>
Expand All @@ -11,18 +11,18 @@
<META name="apple-mobile-web-app-title" content="Mhatxotic Engine API">
<META name="author" content="Mhatxotic Design">
<META name="copyright" content="Copyright © 2006-2024 Mhatxotic Design, All Rights Reserved">
<META name="description" content="Reference for the Mhatxotic Engine API version 24.12.4.43">
<META name="description" content="Reference for the Mhatxotic Engine API version 24.12.5.12">
<META name="format-detection" content="telephone=no">
<META name="generator" content="Mhatxotic Engine Project Management Utility version 24.12.4.43">
<META name="generator" content="Mhatxotic Engine Project Management Utility version 24.12.5.12">
<META name="google-site-verification" content="BvWxrqmgaIxqe_W8AW3OGK0fdCI_JfB_-gcOOxCF9_4">
<META name="googlebot" content="index,follow">
<META name="og:description" content="Reference for the Mhatxotic Engine API version 24.12.4.43">
<META name="og:description" content="Reference for the Mhatxotic Engine API version 24.12.5.12">
<META name="og:image" content="https://repository-images.githubusercontent.com/611875607/ee7aa468-9797-4763-9a2d-ea3d782ef413">
<META name="og:title" content="Mhatxotic Engine 24.12.4.43 API reference">
<META name="og:title" content="Mhatxotic Engine 24.12.5.12 API reference">
<META name="og:url" content="https://mhatxotic.github.io/Engine/">
<META name="robots" content="index,follow">
<META name="viewport" content="width=device-width, initial-scale=1">
<TITLE>Mhatxotic Engine 24.12.4.43 API reference</TITLE>
<TITLE>Mhatxotic Engine 24.12.5.12 API reference</TITLE>
<STYLE media="screen">
* { margin:0; padding:0 }
BODY { background-color:#111; border:0; font-family:sans-serif; overflow-x:hidden; text-shadow: 1px 1px #111 }
Expand Down Expand Up @@ -60,7 +60,7 @@
</STYLE>
</HEAD>
<BODY id="idx.top">
<H1>Mhatxotic Engine 24.12.4.43 API reference</H1>
<H1>Mhatxotic Engine 24.12.5.12 API reference</H1>
<NOSCRIPT>
<H2>JavaScript is required to show and hide elements.</H2>
</NOSCRIPT>
Expand Down Expand Up @@ -3410,7 +3410,7 @@ <H4>Syntax:-</H4>
<H4>Function Parameters:-</H4>
<PRE><U>String</U> <I>(string)</I> = Console status text.<BR></PRE>
<H4>Synopsis:-</H4>
<PRE>In bot mode&#x2c; this function will set the text to appear when no text is input into the input bar&#x2e; Useful for customised stats&#x2e; It will update every second&#x2e;<BR></PRE>
<PRE>In terminal mode&#x2c; this function will set the text to appear when no text is input into the input bar&#x2e; Useful for customised stats&#x2e; It will update every second&#x2e;<BR></PRE>
<H4><A href="#idx:Core">&#x25B2; Return to table of contents</A></H4>
</DIV>
<DIV id="Core.StatusRight" style="display:none">
Expand All @@ -3420,7 +3420,7 @@ <H4>Syntax:-</H4>
<H4>Function Parameters:-</H4>
<PRE><U>String</U> <I>(string)</I> = Console status text.<BR></PRE>
<H4>Synopsis:-</H4>
<PRE>In bot mode&#x2c; this function will set the text to appear when no text is input into the input bar&#x2e; Useful for customised stats&#x2e; It will update every second&#x2e;<BR></PRE>
<PRE>In terminal mode&#x2c; this function will set the text to appear when no text is input into the input bar&#x2e; Useful for customised stats&#x2e; It will update every second&#x2e;<BR></PRE>
<H4><A href="#idx:Core">&#x25B2; Return to table of contents</A></H4>
</DIV>
<DIV id="Core.Suspend" style="display:none">
Expand Down Expand Up @@ -11240,7 +11240,7 @@ <H4><A href="#idx.cv">&#x25B2; Return to table of contents</A></H4>
</DIV>
<DIV id="cv.app_delay" style="display:none">
<H3>app_delay</H3>
<PRE>Specifies an artificial delay to force for bot mode in milliseconds&#x2e; This is ignored on interactive mode because a one millisecond delay is forced for every frame under the target rate&#x2e;<BR></PRE>
<PRE>Specifies an artificial delay to force for terminal mode in milliseconds&#x2e;<BR>This is ignored on interactive mode because a one millisecond delay is forced for every frame under the target rate&#x2e;<BR></PRE>
<H4><A href="#idx.cv">&#x25B2; Return to table of contents</A></H4>
</DIV>
<DIV id="cv.app_description" style="display:none">
Expand Down Expand Up @@ -11520,7 +11520,7 @@ <H4><A href="#idx.cv">&#x25B2; Return to table of contents</A></H4>
</DIV>
<DIV id="cv.con_tmccols" style="display:none">
<H3>con_tmccols</H3>
<PRE>In bot mode&#x2c; this is the maximum number of columns to draw&#x2e; The larger this value is&#x2c; the more text that can be displayed at once but will increase CPU usage from the operating system&#x2e;<BR></PRE>
<PRE>In terminal mode&#x2c; this is the maximum number of columns to draw&#x2e; The larger this value is&#x2c; the more text that can be displayed at once but will increase CPU usage from the operating system&#x2e;<BR></PRE>
<H4><A href="#idx.cv">&#x25B2; Return to table of contents</A></H4>
</DIV>
<DIV id="cv.con_tmcnoclose" style="display:none">
Expand All @@ -11535,7 +11535,7 @@ <H4><A href="#idx.cv">&#x25B2; Return to table of contents</A></H4>
</DIV>
<DIV id="cv.con_tmcrows" style="display:none">
<H3>con_tmcrows</H3>
<PRE>In bot mode&#x2c; this is the maximum number of rows to draw&#x2e; The larger this value is&#x2c; the more text that can be displayed at once but will increase CPU usage from the operating system&#x2e;<BR></PRE>
<PRE>In terminal mode&#x2c; this is the maximum number of rows to draw&#x2e; The larger this value is&#x2c; the more text that can be displayed at once but will increase CPU usage from the operating system&#x2e;<BR></PRE>
<H4><A href="#idx.cv">&#x25B2; Return to table of contents</A></H4>
</DIV>
<DIV id="cv.con_tmctformat" style="display:none">
Expand Down Expand Up @@ -12244,6 +12244,6 @@ <H3>win_widthmin</H3>
<H4><A href="#idx.cv">&#x25B2; Return to table of contents</A></H4>
</DIV>
<ADDRESS>Copyright &copy; 2024 Mhatxotic Design, All Rights Reserved.<BR>
This document was generated at Wed Dec 04 23:51:39 2024 +0000</ADDRESS>
This document was generated at Thu Dec 05 17:19:14 2024 +0000</ADDRESS>
</BODY>
</HTML>
7 changes: 3 additions & 4 deletions scripts/ncurses.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ build()
make clean 2>/dev/null

./configure --prefix=/usr --without-cxx --without-cxx-binding \
--without-ada --without-progs --without-curses-h \
--with-static --without-debug \
--enable-widec --enable-const --enable-ext-colors --enable-sigwinch \
--enable-wgetch-events --target=${1}-apple-darwin
--without-ada --without-progs --without-curses-h --with-static \
--without-debug --enable-widec --enable-const --enable-ext-colors \
--enable-sigwinch --enable-wgetch-events --target=${1}-apple-darwin
if [ ! $? -eq 0 ]; then
exit 11
fi
Expand Down
4 changes: 2 additions & 2 deletions src/congraph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ static class ConGraphics final : // Members initially private
/* -- Set Console status ------------------------------------------------- */
void SetCantDisable(const bool bState)
{ // Ignore if not in graphical mode because CON_HEIGHT isn't defined in
// bot mode as it is unneeded or the flag is already set as such.
// terminal mode as it is unneeded or the flag is already set as such.
if(cSystem->IsNotGraphicalMode()) return;
// Return if state not changed
if(cConsole->FlagIsEqualToBool(CF_CANTDISABLE, bState)) return;
Expand Down Expand Up @@ -291,7 +291,7 @@ static class ConGraphics final : // Members initially private
{ GetTextureRef().ReloadTexture(); GetFontRef().ReloadTexture(); }
/* -- Init framebuffer object -------------------------------------------- */
void InitFBO(void)
{ // Ignore if bot mode
{ // Ignore if terminal mode
if(GetFontRef().IsNotInitialised()) return;
// Get reference to main FBO and initialise it
cFboCore->InitConsoleFBO();
Expand Down
25 changes: 14 additions & 11 deletions src/console.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,9 @@ static class Console final : // Members initially private
// Repalce character in input buffer
else ReplaceInputChar(uiKey);
}
/* -- OnForceRedraw ---------------- Force a bot console display update -- */
/* -- OnForceRedraw ------------------- Force a terminal display update -- */
void OnForceRedraw(const EvtMainEvent&)
{ SetRedraw(); ciOutputRefresh.CISync(); }
/* -- Size updated event (unused on win32) ------------------------------- */
void OnResize(const EvtMainEvent &emeEvent)
{ // Send the event to SysCon
cSystem->OnResize();
// Force a redraw
OnForceRedraw(emeEvent);
}
/* -- OnKeyPress ---------------------------------- Console key pressed -- */
void OnKeyPress(const int iKey, const int iAction, const int iMods)
{ // Key released? Ignore
Expand Down Expand Up @@ -681,14 +674,25 @@ static class Console final : // Members initially private
for(int iKey, iMods;;) switch(cSystem->GetKey(iKey, iMods))
{ // No key is pressed (ignore)
case SysBase::SysCon::KT_NONE: goto Done;
// A key was pressed
// A key was pressed?
case SysBase::SysCon::KT_KEY:
// Send it to the key press handler
OnKeyPress(iKey, GLFW_PRESS, iMods);
// Try more keys
continue;
// A scan code was pressed
// A scan code was pressed?
case SysBase::SysCon::KT_CHAR:
// Send it to the key character handler
OnCharPress(static_cast<unsigned int>(iKey));
// Try more keys
continue;
// No key is pressed but a reset was requested?
case SysBase::SysCon::KT_RESET:
// Set to redraw entire screen
ciOutputRefresh.CISync();
rfFlags.FlagSet(RD_TEXT);
// Break the for loop
goto Done;
} // Only clean way to double-break without extra vars or functions
Done:;
} // Status update elapsed?
Expand Down Expand Up @@ -897,7 +901,6 @@ static class Console final : // Members initially private
/* --------------------------------------------------------------------- */
reEvents{ // Default events
{ EMC_CON_UPDATE, bind(&Console::OnForceRedraw, this, _1) },
{ EMC_CON_RESIZE, bind(&Console::OnResize, this, _1) },
}
/* --------------------------------------------------------------------- */
{ }
Expand Down
14 changes: 7 additions & 7 deletions src/cvarlib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,9 @@ const CVarItemStaticList cvislList{ { // Default cvars (from cvars.hpp)
CB(cTimer->TimerTickRateModified, uint64_t), TUINTEGER|PSYSTEM },
/* ------------------------------------------------------------------------- */
// ! APP_DELAY
// ? Specifies an artificial delay to force for bot mode in milliseconds. This
// ? is ignored on interactive mode because a one millisecond delay is forced
// ? for every frame under the target rate.
// ? Specifies an artificial delay to force for terminal mode in milliseconds.
// ? This is ignored on interactive mode because a one millisecond delay is
// ? forced for every frame under the target rate.
/* ------------------------------------------------------------------------- */
{ CFL_NONE, "app_delay", cCommon->One(),
CB(cTimer->TimerSetDelay, unsigned int), TUINTEGERSAVE|PANY },
Expand Down Expand Up @@ -1021,15 +1021,15 @@ const CVarItemStaticList cvislList{ { // Default cvars (from cvars.hpp)
CB(cConsole->SetPageMoveCount, ssize_t), TUINTEGERSAVE|PANY },
/* ------------------------------------------------------------------------- */
// ! CON_TMCCOLS
// ? In bot mode, this is the maximum number of columns to draw. The larger
// ? this value is, the more text that can be displayed at once but will
// ? increase CPU usage from the operating system.
// ? In terminal mode, this is the maximum number of columns to draw. The
// ? larger this value is, the more text that can be displayed at once but
// ? will increase CPU usage from the operating system.
/* ------------------------------------------------------------------------- */
{ CFL_TERMINAL, "con_tmccols", "80",
CB(cSystem->ColsModified, unsigned int), TUINTEGERSAVE|PANY },
/* ------------------------------------------------------------------------- */
// ! CON_TMCROWS
// ? In bot mode, this is the maximum number of rows to draw. The larger
// ? In terminal mode, this is the maximum number of rows to draw. The larger
// ? this value is, the more text that can be displayed at once but will
// ? increase CPU usage from the operating system.
/* ------------------------------------------------------------------------- */
Expand Down
10 changes: 5 additions & 5 deletions src/engine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
#define VER_AUTHOR "Mhatxotic Design" // Author of engine
#define VER_MAJOR 24 // Version major (year)
#define VER_MINOR 12 // Version minor (month)
#define VER_BUILD 4 // Version build (day)
#define VER_REV 43 // Version rev (build#)
#define VER_STR_NQ 24,12,4,43 // Version as literal
#define VER_STR "24.12.4.43" // Version as string
#define VER_DATE "Wed Dec 04 23:22:25 2024 +0000" // Compilation date
#define VER_BUILD 5 // Version build (day)
#define VER_REV 21 // Version rev (build#)
#define VER_STR_NQ 24,12,5,21 // Version as literal
#define VER_STR "24.12.5.21" // Version as string
#define VER_DATE "Thu Dec 05 18:21:16 2024 +0000" // Compilation date
/* == EoF =========================================================== EoF == */
Loading

0 comments on commit 951cc25

Please sign in to comment.