summaryrefslogtreecommitdiffhomepage
path: root/dev/ZKA/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'dev/ZKA/Modules')
-rw-r--r--dev/ZKA/Modules/CoreCG/Accessibility.hxx14
-rw-r--r--dev/ZKA/Modules/CoreCG/Math.hxx (renamed from dev/ZKA/Modules/CoreCG/Lerp.hxx)2
-rw-r--r--dev/ZKA/Modules/CoreCG/TextRenderer.hxx25
-rw-r--r--dev/ZKA/Modules/CoreCG/WindowRenderer.hxx18
-rw-r--r--dev/ZKA/Modules/Flash/Flash.hxx2
5 files changed, 27 insertions, 34 deletions
diff --git a/dev/ZKA/Modules/CoreCG/Accessibility.hxx b/dev/ZKA/Modules/CoreCG/Accessibility.hxx
index 11fed494..b5ce03e9 100644
--- a/dev/ZKA/Modules/CoreCG/Accessibility.hxx
+++ b/dev/ZKA/Modules/CoreCG/Accessibility.hxx
@@ -10,29 +10,25 @@
#include <NewKit/NewKit.hxx>
#include <KernelKit/LPC.hxx>
#include <Modules/CoreCG/FbRenderer.hxx>
-#include <Modules/CoreCG/Lerp.hxx>
+#include <Modules/CoreCG/Math.hxx>
#include <ArchKit/ArchKit.hxx>
namespace CG
{
using namespace Kernel;
- inline Bool cKTSyncCall = false;
-
- inline float cDeviceWidthAlert = 150;
- inline float cDeviceHeightAlert = 141;
-
- /// @brief common user interface class.
+ /// @brief common User interface class.
class UIAccessibilty final
{
explicit UIAccessibilty() = default;
+ ~UIAccessibilty() = default;
public:
ZKA_COPY_DELETE(UIAccessibilty);
- static UIAccessibilty& The()
+ STATIC UIAccessibilty& The()
{
- static UIAccessibilty the;
+ STATIC UIAccessibilty the;
return the;
}
diff --git a/dev/ZKA/Modules/CoreCG/Lerp.hxx b/dev/ZKA/Modules/CoreCG/Math.hxx
index ea2de1dd..bfa28a3d 100644
--- a/dev/ZKA/Modules/CoreCG/Lerp.hxx
+++ b/dev/ZKA/Modules/CoreCG/Math.hxx
@@ -6,7 +6,7 @@
#pragma once
-/// @file Lerp.hxx
+/// @file Math.hxx
/// @brief Linear interpolation implementation.
typedef float CGReal;
diff --git a/dev/ZKA/Modules/CoreCG/TextRenderer.hxx b/dev/ZKA/Modules/CoreCG/TextRenderer.hxx
index 086d0399..34caa420 100644
--- a/dev/ZKA/Modules/CoreCG/TextRenderer.hxx
+++ b/dev/ZKA/Modules/CoreCG/TextRenderer.hxx
@@ -145,19 +145,20 @@ inline const Kernel::UInt8 cFontBitmap[FONT_NOF_CHARS][FONT_SIZE_X] = {
};
-inline Kernel::Void cg_render_text_font(const Kernel::UInt8* bitmap, Kernel::Int32& x_dst, Kernel::Int32& y_dst, Kernel::Int32& color)
+inline Kernel::Void CGRenderStringFromBitMap(const Kernel::UInt8* bitmap, const Kernel::SizeT& x_sz, const Kernel::SizeT& y_sz, Kernel::Int32& x_dst, Kernel::Int32& y_dst, Kernel::Int32& color)
{
Kernel::Int32 x, y;
Kernel::Int32 set;
- x = 0;
- y = 0;
+ x = 0;
+ y = 0;
+ set = 0;
- for (; y < FONT_SIZE_Y; y++)
+ for (; y < y_sz; ++y)
{
- for (x = 0; x < FONT_SIZE_X; x++)
+ for (x = 0; x < x_sz; ++x)
{
- set = bitmap[x] & 1 << y;
+ set = bitmap[x] & (1 << y);
if (set)
CGDrawInRegion(color, 1, 1, ((x_dst) + x), ((y_dst) + y));
@@ -165,19 +166,11 @@ inline Kernel::Void cg_render_text_font(const Kernel::UInt8* bitmap, Kernel::Int
}
}
-inline Kernel::Void cg_write_text(const Kernel::Char* text, Kernel::Int32 x_dst, Kernel::Int32 y_dst, Kernel::Int32 color)
+inline Kernel::Void CGDrawString(const Kernel::Char* text, Kernel::Int32 x_dst, Kernel::Int32 y_dst, Kernel::Int32 color)
{
for (Kernel::SizeT i = 0; text[i] != 0; ++i)
{
- if (text[i] == '\r' ||
- text[i] == '\n')
- {
- y_dst += FONT_SIZE_Y;
-
- continue;
- }
-
- cg_render_text_font(&cFontBitmap[text[i]][0], x_dst, y_dst, color);
+ CGRenderStringFromBitMap(&cFontBitmap[text[i]][0], FONT_SIZE_X, FONT_SIZE_Y, x_dst, y_dst, color);
y_dst += FONT_SIZE_Y;
}
}
diff --git a/dev/ZKA/Modules/CoreCG/WindowRenderer.hxx b/dev/ZKA/Modules/CoreCG/WindowRenderer.hxx
index a1aadf8a..59ebd9f2 100644
--- a/dev/ZKA/Modules/CoreCG/WindowRenderer.hxx
+++ b/dev/ZKA/Modules/CoreCG/WindowRenderer.hxx
@@ -20,12 +20,14 @@ namespace CG
{
using namespace Kernel;
+ struct UI_WINDOW_STRUCT;
+
enum
{
cWndFlagNoShow = 0x04,
};
- struct CG_WINDOW
+ struct UI_WINDOW_STRUCT final
{
Int32 w_flags{0};
Char w_window_name[255]{0};
@@ -38,9 +40,9 @@ namespace CG
Bool w_needs_repaint{false};
};
- typedef struct CG_WINDOW CG_WINDOW;
+ typedef struct UI_WINDOW_STRUCT UI_WINDOW_STRUCT;
- inline struct CG_WINDOW* CGCreateWindow(Int32 flags, const Char* window_name, const Char* class_name, Int32 x, Int32 y, Int32 width, Int32 height)
+ inline struct UI_WINDOW_STRUCT* CGCreateWindow(Int32 flags, const Char* window_name, const Char* class_name, Int32 x, Int32 y, Int32 width, Int32 height)
{
const auto cMaxLimit = 214;
@@ -51,7 +53,7 @@ namespace CG
return nullptr;
}
- CG_WINDOW* wnd = new CG_WINDOW();
+ UI_WINDOW_STRUCT* wnd = new UI_WINDOW_STRUCT();
if (!wnd)
{
@@ -75,7 +77,7 @@ namespace CG
return wnd;
}
- inline bool CGDestroyWindow(struct CG_WINDOW* wnd)
+ inline bool CGDestroyWindow(struct UI_WINDOW_STRUCT* wnd)
{
if (wnd)
{
@@ -93,7 +95,7 @@ namespace CG
return false;
}
- inline SizeT CGDrawWindowList(CG_WINDOW** wnd, SizeT wnd_cnt)
+ inline SizeT CGDrawWindowList(UI_WINDOW_STRUCT** wnd, SizeT wnd_cnt)
{
if (wnd_cnt == 0 ||
!wnd)
@@ -138,11 +140,11 @@ namespace CG
CGInit();
- CGDrawBitMapInRegionA(wnd[index]->display_ptr, wnd[index]->w_h, wnd[index]->w_w, wnd[index]->w_y, wnd[index]->w_x);
+ CGDrawBitMapInRegion(wnd[index]->display_ptr, wnd[index]->w_h, wnd[index]->w_w, wnd[index]->w_y, wnd[index]->w_x);
CGDrawInRegion(CGColor(0xFF, 0xFF, 0xFF), wnd[index]->w_w, FLATCONTROLS_HEIGHT, wnd[index]->w_y, wnd[index]->w_x);
CGDrawBitMapInRegion(FlatControls, FLATCONTROLS_HEIGHT, FLATCONTROLS_WIDTH, wnd[index]->w_y, wnd[index]->w_x+wnd[index]->w_w-FLATCONTROLS_WIDTH);
- cg_write_text(wnd[index]->w_window_name, wnd[index]->w_y + 8, wnd[index]->w_x + 8, CGColor(0x00, 0x00, 0x00));
+ CGDrawString(wnd[index]->w_window_name, wnd[index]->w_y + 8, wnd[index]->w_x + 8, CGColor(0x00, 0x00, 0x00));
CGFini();
}
diff --git a/dev/ZKA/Modules/Flash/Flash.hxx b/dev/ZKA/Modules/Flash/Flash.hxx
index d8cfc28f..b5878d6d 100644
--- a/dev/ZKA/Modules/Flash/Flash.hxx
+++ b/dev/ZKA/Modules/Flash/Flash.hxx
@@ -8,6 +8,8 @@
#ifdef __FLASH_MEM__
+#include <NewKit/Defines.hxx>
+
/// @brief get sector count.
/// @return drive sector count.
Kernel::SizeT drv_std_get_sector_count();