mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-01-22 17:12:25 -05:00
Wii/Dreamcast: Display crosshairs at cursor position
This commit is contained in:
parent
59156fa865
commit
e7f9ab9797
30 changed files with 110 additions and 94 deletions
|
@ -33,8 +33,9 @@ struct FontDesc titleFont, textFont, hintFont, logoFont, rowFont;
|
|||
static struct Context2D framebuffer;
|
||||
/* The area/region of the window that needs to be redrawn and presented to the screen. */
|
||||
/* If width is 0, means no area needs to be redrawn. */
|
||||
Rect2D dirty_rect;
|
||||
static Rect2D dirty_rect;
|
||||
|
||||
LBackend_DrawHook LBackend_Hooks[4];
|
||||
static cc_uint8 pendingRedraw;
|
||||
#define REDRAW_ALL 0x02
|
||||
#define REDRAW_SOME 0x01
|
||||
|
@ -179,20 +180,18 @@ void LBackend_LayoutWidget(struct LWidget* w) {
|
|||
LBackend_TableReposition((struct LTable*)w);
|
||||
}
|
||||
|
||||
void LBackend_MarkDirty(void* widget) {
|
||||
void LBackend_NeedsRedraw(void* widget) {
|
||||
struct LWidget* w = (struct LWidget*)widget;
|
||||
pendingRedraw |= REDRAW_SOME;
|
||||
w->dirty = true;
|
||||
}
|
||||
|
||||
/* Marks the entire window as needing to be redrawn. */
|
||||
static CC_NOINLINE void MarkAllDirty(void) {
|
||||
void LBackend_MarkAllDirty(void) {
|
||||
dirty_rect.x = 0; dirty_rect.width = framebuffer.width;
|
||||
dirty_rect.y = 0; dirty_rect.height = framebuffer.height;
|
||||
}
|
||||
|
||||
/* Marks the given area/region as needing to be redrawn. */
|
||||
static CC_NOINLINE void MarkAreaDirty(int x, int y, int width, int height) {
|
||||
void LBackend_MarkAreaDirty(int x, int y, int width, int height) {
|
||||
int x1, y1, x2, y2;
|
||||
if (!Drawer2D_Clamp(&framebuffer, &x, &y, &width, &height)) return;
|
||||
|
||||
|
@ -253,7 +252,7 @@ static CC_NOINLINE void DrawWidget(struct LWidget* w) {
|
|||
|
||||
w->dirty = false;
|
||||
w->VTABLE->Draw(w);
|
||||
MarkAreaDirty(w->x, w->y, w->width, w->height);
|
||||
LBackend_MarkAreaDirty(w->x, w->y, w->width, w->height);
|
||||
}
|
||||
|
||||
static CC_NOINLINE void RedrawAll(void) {
|
||||
|
@ -264,7 +263,7 @@ static CC_NOINLINE void RedrawAll(void) {
|
|||
for (i = 0; i < s->numWidgets; i++) {
|
||||
DrawWidget(s->widgets[i]);
|
||||
}
|
||||
MarkAllDirty();
|
||||
LBackend_MarkAllDirty();
|
||||
}
|
||||
|
||||
static CC_NOINLINE void RedrawDirty(void) {
|
||||
|
@ -280,7 +279,7 @@ static CC_NOINLINE void RedrawDirty(void) {
|
|||
if (!w->opaque || w->last.width > w->width || w->last.height > w->height) {
|
||||
s->ResetArea(&framebuffer,
|
||||
w->last.x, w->last.y, w->last.width, w->last.height);
|
||||
MarkAreaDirty(w->last.x, w->last.y, w->last.width, w->last.height);
|
||||
LBackend_MarkAreaDirty(w->last.x, w->last.y, w->last.width, w->last.height);
|
||||
}
|
||||
DrawWidget(w);
|
||||
}
|
||||
|
@ -298,16 +297,20 @@ static CC_NOINLINE void DoRedraw(void) {
|
|||
|
||||
void LBackend_Redraw(void) {
|
||||
pendingRedraw = REDRAW_ALL;
|
||||
MarkAllDirty();
|
||||
LBackend_MarkAllDirty();
|
||||
}
|
||||
void LBackend_ThemeChanged(void) { LBackend_Redraw(); }
|
||||
|
||||
void LBackend_Tick(void) {
|
||||
int i;
|
||||
DoRedraw();
|
||||
if (!dirty_rect.width) return;
|
||||
|
||||
OnscreenKeyboard_Draw2D(&dirty_rect, &framebuffer.bmp);
|
||||
Window_DrawFramebuffer(dirty_rect, &framebuffer.bmp);
|
||||
for (i = 0; i < Array_Elems(LBackend_Hooks); i++)
|
||||
{
|
||||
if (LBackend_Hooks[i]) LBackend_Hooks[i](&framebuffer);
|
||||
}
|
||||
Window_DrawFramebuffer(dirty_rect, &framebuffer.bmp);
|
||||
|
||||
dirty_rect.x = 0; dirty_rect.width = 0;
|
||||
dirty_rect.y = 0; dirty_rect.height = 0;
|
||||
|
@ -439,7 +442,7 @@ void LBackend_ButtonInit(struct LButton* w, int width, int height) {
|
|||
void LBackend_ButtonUpdate(struct LButton* w) {
|
||||
struct DrawTextArgs args;
|
||||
DrawTextArgs_Make(&args, &w->text, &titleFont, true);
|
||||
LBackend_MarkDirty(w);
|
||||
LBackend_NeedsRedraw(w);
|
||||
|
||||
w->_textWidth = Drawer2D_TextWidth(&args);
|
||||
w->_textHeight = Drawer2D_TextHeight(&args);
|
||||
|
@ -471,7 +474,7 @@ void LBackend_ButtonDraw(struct LButton* w) {
|
|||
|
||||
static void LCheckbox_OnClick(void* w) {
|
||||
struct LCheckbox* cb = (struct LCheckbox*)w;
|
||||
LBackend_MarkDirty(cb);
|
||||
LBackend_NeedsRedraw(cb);
|
||||
|
||||
cb->value = !cb->value;
|
||||
if (cb->ValueChanged) cb->ValueChanged(cb);
|
||||
|
@ -487,7 +490,7 @@ void LBackend_CheckboxInit(struct LCheckbox* w) {
|
|||
}
|
||||
|
||||
void LBackend_CheckboxUpdate(struct LCheckbox* w) {
|
||||
LBackend_MarkDirty(w);
|
||||
LBackend_NeedsRedraw(w);
|
||||
}
|
||||
|
||||
/* Based off checkbox from original ClassiCube Launcher */
|
||||
|
@ -611,7 +614,7 @@ void LBackend_InputUpdate(struct LInput* w) {
|
|||
|
||||
String_InitArray(text, textBuffer);
|
||||
LInput_UNSAFE_GetText(w, &text);
|
||||
LBackend_MarkDirty(w);
|
||||
LBackend_NeedsRedraw(w);
|
||||
|
||||
DrawTextArgs_Make(&args, &text, &textFont, false);
|
||||
textWidth = Drawer2D_TextWidth(&args);
|
||||
|
@ -688,10 +691,10 @@ void LBackend_InputTick(struct LInput* w) {
|
|||
|
||||
if (Rect2D_Equals(r, lastCaretRect)) {
|
||||
/* Fast path, caret is blinking in same spot */
|
||||
MarkAreaDirty(r.x, r.y, r.width, r.height);
|
||||
LBackend_MarkAreaDirty(r.x, r.y, r.width, r.height);
|
||||
} else {
|
||||
/* Slow path (new widget, caret moved, etc) */
|
||||
MarkAreaDirty(w->x, w->y, w->width, w->height);
|
||||
LBackend_MarkAreaDirty(w->x, w->y, w->width, w->height);
|
||||
}
|
||||
lastCaretRect = r;
|
||||
}
|
||||
|
@ -700,7 +703,7 @@ void LBackend_InputSelect(struct LInput* w, int idx, cc_bool wasSelected) {
|
|||
caretStart = Stopwatch_Measure();
|
||||
w->caretShow = true;
|
||||
LInput_MoveCaretToCursor(w, idx);
|
||||
LBackend_MarkDirty(w);
|
||||
LBackend_NeedsRedraw(w);
|
||||
|
||||
if (Window_Main.SoftKeyboardInstant)
|
||||
LInput_OpenKeyboard(w);
|
||||
|
@ -709,7 +712,7 @@ void LBackend_InputSelect(struct LInput* w, int idx, cc_bool wasSelected) {
|
|||
void LBackend_InputUnselect(struct LInput* w) {
|
||||
caretStart = 0;
|
||||
w->caretShow = false;
|
||||
LBackend_MarkDirty(w);
|
||||
LBackend_NeedsRedraw(w);
|
||||
OnscreenKeyboard_Close();
|
||||
}
|
||||
|
||||
|
@ -821,7 +824,7 @@ void LBackend_LabelInit(struct LLabel* w) { }
|
|||
void LBackend_LabelUpdate(struct LLabel* w) {
|
||||
struct DrawTextArgs args;
|
||||
DrawTextArgs_Make(&args, &w->text, LLabel_GetFont(w), true);
|
||||
LBackend_MarkDirty(w);
|
||||
LBackend_NeedsRedraw(w);
|
||||
|
||||
w->width = Drawer2D_TextWidth(&args);
|
||||
w->height = Drawer2D_TextHeight(&args);
|
||||
|
@ -857,7 +860,7 @@ void LBackend_SliderInit(struct LSlider* w, int width, int height) {
|
|||
}
|
||||
|
||||
void LBackend_SliderUpdate(struct LSlider* w) {
|
||||
LBackend_MarkDirty(w);
|
||||
LBackend_NeedsRedraw(w);
|
||||
}
|
||||
|
||||
static void LSlider_DrawBoxBounds(struct LSlider* w) {
|
||||
|
@ -933,7 +936,7 @@ void LBackend_TableReposition(struct LTable* w) {
|
|||
|
||||
void LBackend_TableFlagAdded(struct LTable* w) {
|
||||
/* TODO: Only redraw flags */
|
||||
LBackend_MarkDirty(w);
|
||||
LBackend_NeedsRedraw(w);
|
||||
}
|
||||
|
||||
/* Draws background behind column headers */
|
||||
|
@ -1087,7 +1090,7 @@ void LBackend_TableDraw(struct LTable* w) {
|
|||
LTable_DrawHeaders(w);
|
||||
LTable_DrawRows(w);
|
||||
LTable_DrawScrollbar(w);
|
||||
MarkAllDirty();
|
||||
LBackend_MarkAllDirty();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1153,7 +1156,7 @@ void LBackend_TableMouseDown(struct LTable* w, int idx) {
|
|||
} else {
|
||||
LTable_RowsClick(w, idx);
|
||||
}
|
||||
LBackend_MarkDirty(w);
|
||||
LBackend_NeedsRedraw(w);
|
||||
}
|
||||
|
||||
void LBackend_TableMouseMove(struct LTable* w, int idx) {
|
||||
|
@ -1168,7 +1171,7 @@ void LBackend_TableMouseMove(struct LTable* w, int idx) {
|
|||
|
||||
w->topRow = row;
|
||||
LTable_ClampTopRow(w);
|
||||
LBackend_MarkDirty(w);
|
||||
LBackend_NeedsRedraw(w);
|
||||
} else if (w->draggingColumn >= 0) {
|
||||
col = w->draggingColumn;
|
||||
width = x - w->dragXStart;
|
||||
|
@ -1180,7 +1183,7 @@ void LBackend_TableMouseMove(struct LTable* w, int idx) {
|
|||
Math_Clamp(width, cellMinWidth, maxW - cellMinWidth);
|
||||
if (width == w->columns[col].width) return;
|
||||
w->columns[col].width = width;
|
||||
LBackend_MarkDirty(w);
|
||||
LBackend_NeedsRedraw(w);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,9 @@ struct LSlider;
|
|||
struct LTable;
|
||||
struct Flag;
|
||||
|
||||
typedef void (*LBackend_DrawHook)(struct Context2D* ctx);
|
||||
extern LBackend_DrawHook LBackend_Hooks[4];
|
||||
|
||||
void LBackend_Init(void);
|
||||
void LBackend_Free(void);
|
||||
void LBackend_SetScreen(struct LScreen* s);
|
||||
|
@ -27,12 +30,18 @@ void LBackend_DrawTitle(struct Context2D* ctx, const char* title);
|
|||
|
||||
void LBackend_DecodeFlag(struct Flag* flag, cc_uint8* data, cc_uint32 len);
|
||||
|
||||
/* Resets pixels to default, then draws widgets of current screen over it */
|
||||
/* Marks the entire launcher contents as needing to be redrawn */
|
||||
void LBackend_Redraw(void);
|
||||
/* Marks the given widget as needing to be redrawn */
|
||||
void LBackend_NeedsRedraw(void* widget);
|
||||
/* Marks the entire window as needing to be redrawn */
|
||||
void LBackend_MarkAllDirty(void);
|
||||
/* Marks the given area/region as needing to be redrawn */
|
||||
void LBackend_MarkAreaDirty(int x, int y, int width, int height);
|
||||
|
||||
void LBackend_ThemeChanged(void);
|
||||
void LBackend_Tick(void);
|
||||
void LBackend_LayoutWidget(struct LWidget* w);
|
||||
void LBackend_MarkDirty(void* widget);
|
||||
|
||||
void LBackend_InitFramebuffer(void);
|
||||
void LBackend_FreeFramebuffer(void);
|
||||
|
|
|
@ -81,7 +81,7 @@ void LBackend_LayoutWidget(struct LWidget* w) {
|
|||
LBackend_LayoutDimensions(w);
|
||||
}
|
||||
|
||||
void LBackend_MarkDirty(void* widget) { }
|
||||
void LBackend_NeedsRedraw(void* widget) { }
|
||||
void LBackend_InitFramebuffer(void) { }
|
||||
void LBackend_FreeFramebuffer(void) { }
|
||||
|
||||
|
|
|
@ -225,7 +225,7 @@ void LBackend_Init(void) {
|
|||
CFBridgingRetain(ui_controller); // prevent GC TODO even needed?
|
||||
}
|
||||
|
||||
void LBackend_MarkDirty(void* widget) { }
|
||||
void LBackend_NeedsRedraw(void* widget) { }
|
||||
void LBackend_Tick(void) { }
|
||||
void LBackend_Free(void) { }
|
||||
void LBackend_UpdateTitleFont(void) { }
|
||||
|
|
|
@ -1296,19 +1296,19 @@ static void ServersScreen_HashFilter(cc_string* str) {
|
|||
static void ServersScreen_SearchChanged(struct LInput* w) {
|
||||
struct ServersScreen* s = &ServersScreen;
|
||||
LTable_ApplyFilter(&s->table);
|
||||
LBackend_MarkDirty(&s->table);
|
||||
LBackend_NeedsRedraw(&s->table);
|
||||
}
|
||||
|
||||
static void ServersScreen_HashChanged(struct LInput* w) {
|
||||
struct ServersScreen* s = &ServersScreen;
|
||||
LTable_ShowSelected(&s->table);
|
||||
LBackend_MarkDirty(&s->table);
|
||||
LBackend_NeedsRedraw(&s->table);
|
||||
}
|
||||
|
||||
static void ServersScreen_OnSelectedChanged(void) {
|
||||
struct ServersScreen* s = &ServersScreen;
|
||||
LBackend_MarkDirty(&s->iptHash);
|
||||
LBackend_MarkDirty(&s->table);
|
||||
LBackend_NeedsRedraw(&s->iptHash);
|
||||
LBackend_NeedsRedraw(&s->table);
|
||||
}
|
||||
|
||||
static void ServersScreen_ReloadServers(struct ServersScreen* s) {
|
||||
|
@ -1375,7 +1375,7 @@ static void ServersScreen_Tick(struct LScreen* s_) {
|
|||
|
||||
if (FetchServersTask.Base.success) {
|
||||
ServersScreen_ReloadServers(s);
|
||||
LBackend_MarkDirty(&s->table);
|
||||
LBackend_NeedsRedraw(&s->table);
|
||||
}
|
||||
|
||||
LButton_SetConst(&s->btnRefresh,
|
||||
|
|
|
@ -125,12 +125,12 @@ static void LButton_Draw(void* widget) {
|
|||
|
||||
static void LButton_Hover(void* w, int idx, cc_bool wasOver) {
|
||||
/* only need to redraw when changing from unhovered to active */
|
||||
if (!wasOver) LBackend_MarkDirty(w);
|
||||
if (!wasOver) LBackend_NeedsRedraw(w);
|
||||
}
|
||||
|
||||
static void LButton_Unhover(void* w) { LBackend_MarkDirty(w); }
|
||||
static void LButton_OnSelect(void* w, int idx, cc_bool wasSelected) { LBackend_MarkDirty(w); }
|
||||
static void LButton_OnUnselect(void* w, int idx) { LBackend_MarkDirty(w); }
|
||||
static void LButton_Unhover(void* w) { LBackend_NeedsRedraw(w); }
|
||||
static void LButton_OnSelect(void* w, int idx, cc_bool wasSelected) { LBackend_NeedsRedraw(w); }
|
||||
static void LButton_OnUnselect(void* w, int idx) { LBackend_NeedsRedraw(w); }
|
||||
|
||||
static const struct LWidgetVTABLE lbutton_VTABLE = {
|
||||
LButton_Draw, NULL,
|
||||
|
@ -651,7 +651,7 @@ static void LTable_MouseWheel(void* widget, float delta) {
|
|||
struct LTable* w = (struct LTable*)widget;
|
||||
w->topRow -= Utils_AccumulateWheelDelta(&w->_wheelAcc, delta);
|
||||
LTable_ClampTopRow(w);
|
||||
LBackend_MarkDirty(w);
|
||||
LBackend_NeedsRedraw(w);
|
||||
w->_lastRow = -1;
|
||||
}
|
||||
|
||||
|
|
34
src/VirtualCursor.h
Normal file
34
src/VirtualCursor.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
#include "Core.h"
|
||||
#include "Funcs.h"
|
||||
#include "Drawer2D.h"
|
||||
#include "Input.h"
|
||||
#include "LBackend.h"
|
||||
|
||||
#define CURSOR_SIZE 1
|
||||
#define CURSOR_EXTENT 5
|
||||
|
||||
static void VirtualCursor_Display2D(struct Context2D* ctx) {
|
||||
int x, y;
|
||||
LBackend_MarkAllDirty();
|
||||
|
||||
x = Pointers[0].x;
|
||||
y = Pointers[0].y;
|
||||
|
||||
Context2D_Clear(ctx, BITMAPCOLOR_WHITE,
|
||||
x - CURSOR_EXTENT, y - CURSOR_SIZE, CURSOR_EXTENT * 2, CURSOR_SIZE * 3);
|
||||
Context2D_Clear(ctx, BITMAPCOLOR_WHITE,
|
||||
x - CURSOR_SIZE, y - CURSOR_EXTENT, CURSOR_SIZE * 3, CURSOR_EXTENT * 2);
|
||||
}
|
||||
|
||||
static void VirtualCursor_SetPosition(int x, int y) {
|
||||
x = max(0, min(x, Window_Main.Width - 1));
|
||||
y = max(0, min(y, Window_Main.Height - 1));
|
||||
|
||||
if (x == Pointers[0].x && y == Pointers[0].y) return;
|
||||
Pointer_SetPosition(0, x, y);
|
||||
LBackend_Hooks[3] = VirtualCursor_Display2D;
|
||||
|
||||
/* TODO better dirty region tracking */
|
||||
if (launcherMode) LBackend_Redraw();
|
||||
}
|
||||
|
|
@ -285,21 +285,19 @@ static void VirtualKeyboard_PadAxis(void* obj, int port, int axis, float x, floa
|
|||
extern Rect2D dirty_rect;
|
||||
|
||||
static void VirtualKeyboard_MarkDirty2D(void) {
|
||||
if (!dirty_rect.width) dirty_rect.width = 2;
|
||||
LBackend_MarkAllDirty();
|
||||
}
|
||||
|
||||
static void VirtualKeyboard_Display2D(Rect2D* r, struct Bitmap* bmp) {
|
||||
static void VirtualKeyboard_Display2D(struct Context2D* real_ctx) {
|
||||
struct Context2D ctx;
|
||||
struct Bitmap copy = *bmp;
|
||||
struct Bitmap copy = real_ctx->bmp;
|
||||
int x, y;
|
||||
|
||||
if (!DisplayInfo.ShowingSoftKeyboard) return;
|
||||
LBackend_MarkAllDirty();
|
||||
|
||||
/* Mark entire framebuffer as needing to be redrawn */
|
||||
r->x = 0; r->width = bmp->width;
|
||||
r->y = 0; r->height = bmp->height;
|
||||
|
||||
VirtualKeyboard_CalcPosition(&x, &y, bmp->width, bmp->height);
|
||||
copy.scan0 = Bitmap_GetRow(bmp, y);
|
||||
VirtualKeyboard_CalcPosition(&x, &y, copy.width, copy.height);
|
||||
copy.scan0 = Bitmap_GetRow(&real_ctx->bmp, y);
|
||||
copy.scan0 += x;
|
||||
|
||||
Context2D_Wrap(&ctx, ©);
|
||||
|
@ -307,6 +305,7 @@ static void VirtualKeyboard_Display2D(Rect2D* r, struct Bitmap* bmp) {
|
|||
}
|
||||
|
||||
static void VirtualKeyboard_Close2D(void) {
|
||||
LBackend_Hooks[0] = NULL;
|
||||
LBackend_Redraw();
|
||||
}
|
||||
|
||||
|
@ -400,6 +399,7 @@ static void VirtualKeyboard_Open(struct OpenKeyboardArgs* args, cc_bool launcher
|
|||
|
||||
Window_Main.SoftKeyboardFocus = true;
|
||||
Input.DownHook = VirtualKeyboard_ProcessDown;
|
||||
LBackend_Hooks[0] = VirtualKeyboard_Display2D;
|
||||
}
|
||||
|
||||
static void VirtualKeyboard_SetText(const cc_string* text) {
|
||||
|
|
|
@ -681,7 +681,6 @@ void Window_FreeFramebuffer(struct Bitmap* bmp) {
|
|||
|
||||
void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { }
|
||||
void OnscreenKeyboard_SetText(const cc_string* text) { }
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) { }
|
||||
void OnscreenKeyboard_Draw3D(void) { }
|
||||
void OnscreenKeyboard_Close(void) { }
|
||||
|
||||
|
|
|
@ -12,7 +12,10 @@
|
|||
#include "ExtMath.h"
|
||||
#include "VirtualKeyboard.h"
|
||||
#include <kos.h>
|
||||
|
||||
static cc_bool launcherMode;
|
||||
static cc_bool vc_hooked;
|
||||
#include "VirtualCursor.h"
|
||||
cc_bool window_inited;
|
||||
|
||||
struct _DisplayData DisplayInfo;
|
||||
|
@ -200,6 +203,13 @@ static void ProcessMouseInput(float delta) {
|
|||
Input_SetNonRepeatable(CCMOUSE_L, mods & MOUSE_LEFTBUTTON);
|
||||
Input_SetNonRepeatable(CCMOUSE_R, mods & MOUSE_RIGHTBUTTON);
|
||||
Input_SetNonRepeatable(CCMOUSE_M, mods & MOUSE_SIDEBUTTON);
|
||||
|
||||
/* Start cursor at window middle */
|
||||
if (!vc_hooked) {
|
||||
vc_hooked = true;
|
||||
Pointer_SetPosition(0, Window_Main.Width / 2, Window_Main.Height / 2);
|
||||
}
|
||||
VirtualCursor_SetPosition(Pointers[0].x + state->dx, Pointers[0].y + state->dy);
|
||||
|
||||
if (!Input.RawMode) return;
|
||||
float scale = (delta * 60.0) / 2.0f;
|
||||
|
@ -340,10 +350,6 @@ void OnscreenKeyboard_SetText(const cc_string* text) {
|
|||
VirtualKeyboard_SetText(text);
|
||||
}
|
||||
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) {
|
||||
VirtualKeyboard_Display2D(r, bmp);
|
||||
}
|
||||
|
||||
void OnscreenKeyboard_Draw3D(void) {
|
||||
VirtualKeyboard_Display3D();
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
static cc_bool needsFBUpdate;
|
||||
static cc_bool launcherMode;
|
||||
#include "VirtualCursor.h"
|
||||
static void* xfb;
|
||||
static GXRModeObj* rmode;
|
||||
void* Window_XFB;
|
||||
|
@ -268,7 +269,7 @@ static void ProcessWPADDrag(int res, u32 mods) {
|
|||
} else {
|
||||
dragActive = false;
|
||||
}
|
||||
Pointer_SetPosition(0, x, y);
|
||||
VirtualCursor_SetPosition(x, y);
|
||||
}
|
||||
|
||||
#define FACTOR 2
|
||||
|
@ -525,10 +526,6 @@ void OnscreenKeyboard_SetText(const cc_string* text) {
|
|||
VirtualKeyboard_SetText(text);
|
||||
}
|
||||
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) {
|
||||
VirtualKeyboard_Display2D(r, bmp);
|
||||
}
|
||||
|
||||
void OnscreenKeyboard_Draw3D(void) {
|
||||
VirtualKeyboard_Display3D();
|
||||
}
|
||||
|
|
|
@ -518,7 +518,6 @@ void Window_FreeFramebuffer(struct Bitmap* bmp) {
|
|||
|
||||
void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { }
|
||||
void OnscreenKeyboard_SetText(const cc_string* text) { }
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) { }
|
||||
void OnscreenKeyboard_Draw3D(void) { }
|
||||
void OnscreenKeyboard_Close(void) { }
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "Window.h"
|
||||
#include "Platform.h"
|
||||
#include "Input.h"
|
||||
#include "InputHandler.h"
|
||||
#include "Event.h"
|
||||
#include "Graphics.h"
|
||||
#include "String.h"
|
||||
|
@ -139,7 +140,7 @@ void Gamepads_Process(float delta) {
|
|||
|
||||
for (int i = 0; i < INPUT_MAX_GAMEPADS; i++)
|
||||
{
|
||||
if (!joypad_is_connected(port)) continue;
|
||||
if (!joypad_is_connected(i)) continue;
|
||||
int port = Gamepad_MapPort(i + 10);
|
||||
|
||||
joypad_inputs_t inputs = joypad_get_inputs(i);
|
||||
|
|
|
@ -323,7 +323,6 @@ void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) {
|
|||
|
||||
void OnscreenKeyboard_SetText(const cc_string* text) { }
|
||||
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) { }
|
||||
void OnscreenKeyboard_Draw3D(void) { }
|
||||
|
||||
void OnscreenKeyboard_Close(void) {
|
||||
|
|
|
@ -193,7 +193,6 @@ void Window_FreeFramebuffer(struct Bitmap* bmp) {
|
|||
*#########################################################################################################################*/
|
||||
void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { /* TODO implement */ }
|
||||
void OnscreenKeyboard_SetText(const cc_string* text) { }
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) { }
|
||||
void OnscreenKeyboard_Draw3D(void) { }
|
||||
void OnscreenKeyboard_Close(void) { /* TODO implement */ }
|
||||
|
||||
|
|
|
@ -316,10 +316,6 @@ void OnscreenKeyboard_SetText(const cc_string* text) {
|
|||
VirtualKeyboard_SetText(text);
|
||||
}
|
||||
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) {
|
||||
VirtualKeyboard_Display2D(r, bmp);
|
||||
}
|
||||
|
||||
void OnscreenKeyboard_Draw3D(void) {
|
||||
VirtualKeyboard_Display3D();
|
||||
}
|
||||
|
|
|
@ -378,10 +378,6 @@ void OnscreenKeyboard_SetText(const cc_string* text) {
|
|||
VirtualKeyboard_SetText(text);
|
||||
}
|
||||
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) {
|
||||
VirtualKeyboard_Display2D(r, bmp);
|
||||
}
|
||||
|
||||
void OnscreenKeyboard_Draw3D(void) {
|
||||
VirtualKeyboard_Display3D();
|
||||
}
|
||||
|
|
|
@ -179,10 +179,6 @@ void OnscreenKeyboard_SetText(const cc_string* text) {
|
|||
VirtualKeyboard_SetText(text);
|
||||
}
|
||||
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) {
|
||||
VirtualKeyboard_Display2D(r, bmp);
|
||||
}
|
||||
|
||||
void OnscreenKeyboard_Draw3D(void) {
|
||||
VirtualKeyboard_Display3D();
|
||||
}
|
||||
|
|
|
@ -351,7 +351,6 @@ void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) {
|
|||
/* TODO implement */
|
||||
}
|
||||
void OnscreenKeyboard_SetText(const cc_string* text) { }
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) { }
|
||||
void OnscreenKeyboard_Draw3D(void) { }
|
||||
void OnscreenKeyboard_Close(void) { /* TODO implement */ }
|
||||
|
||||
|
|
|
@ -445,7 +445,6 @@ void Window_FreeFramebuffer(struct Bitmap* bmp) {
|
|||
|
||||
void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { SDL_StartTextInput(); }
|
||||
void OnscreenKeyboard_SetText(const cc_string* text) { }
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) { }
|
||||
void OnscreenKeyboard_Draw3D(void) { }
|
||||
void OnscreenKeyboard_Close(void) { SDL_StopTextInput(); }
|
||||
|
||||
|
|
|
@ -477,7 +477,6 @@ void Window_FreeFramebuffer(struct Bitmap* bmp) {
|
|||
|
||||
void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { SDL_StartTextInput(win_handle); }
|
||||
void OnscreenKeyboard_SetText(const cc_string* text) { }
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) { }
|
||||
void OnscreenKeyboard_Draw3D(void) { }
|
||||
void OnscreenKeyboard_Close(void) { SDL_StopTextInput(win_handle); }
|
||||
|
||||
|
|
|
@ -233,7 +233,6 @@ void Window_FreeFramebuffer(struct Bitmap* bmp) {
|
|||
*#########################################################################################################################*/
|
||||
void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { /* TODO implement */ }
|
||||
void OnscreenKeyboard_SetText(const cc_string* text) { }
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) { }
|
||||
void OnscreenKeyboard_Draw3D(void) { }
|
||||
void OnscreenKeyboard_Close(void) { /* TODO implement */ }
|
||||
|
||||
|
|
|
@ -291,7 +291,6 @@ void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) {
|
|||
swkbdClose(&kbd);
|
||||
}
|
||||
void OnscreenKeyboard_SetText(const cc_string* text) { }
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) { }
|
||||
void OnscreenKeyboard_Draw3D(void) { }
|
||||
void OnscreenKeyboard_Close(void) { /* TODO implement */ }
|
||||
|
||||
|
|
|
@ -540,7 +540,6 @@ void Window_FreeFramebuffer(struct Bitmap* bmp) {
|
|||
|
||||
void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { }
|
||||
void OnscreenKeyboard_SetText(const cc_string* text) { }
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) { }
|
||||
void OnscreenKeyboard_Draw3D(void) { }
|
||||
void OnscreenKeyboard_Close(void) { }
|
||||
|
||||
|
|
|
@ -724,7 +724,6 @@ void OnscreenKeyboard_SetText(const cc_string* text) {
|
|||
interop_SetKeyboardText(str);
|
||||
}
|
||||
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) { }
|
||||
void OnscreenKeyboard_Draw3D(void) { }
|
||||
|
||||
void OnscreenKeyboard_Close(void) {
|
||||
|
|
|
@ -602,7 +602,6 @@ static void OnscreenKeyboard_DrawDRC(void) {
|
|||
|
||||
|
||||
void OnscreenKeyboard_SetText(const cc_string* text) { }
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) { }
|
||||
void OnscreenKeyboard_Draw3D(void) { }
|
||||
|
||||
void OnscreenKeyboard_Close(void) {
|
||||
|
|
|
@ -754,7 +754,6 @@ static void InitRawMouse(void) {
|
|||
|
||||
void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { }
|
||||
void OnscreenKeyboard_SetText(const cc_string* text) { }
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) { }
|
||||
void OnscreenKeyboard_Draw3D(void) { }
|
||||
void OnscreenKeyboard_Close(void) { }
|
||||
|
||||
|
|
|
@ -231,10 +231,6 @@ void OnscreenKeyboard_SetText(const cc_string* text) {
|
|||
VirtualKeyboard_SetText(text);
|
||||
}
|
||||
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) {
|
||||
VirtualKeyboard_Display2D(r, bmp);
|
||||
}
|
||||
|
||||
void OnscreenKeyboard_Draw3D(void) {
|
||||
VirtualKeyboard_Display3D();
|
||||
}
|
||||
|
|
|
@ -193,10 +193,6 @@ void OnscreenKeyboard_SetText(const cc_string* text) {
|
|||
VirtualKeyboard_SetText(text);
|
||||
}
|
||||
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) {
|
||||
VirtualKeyboard_Display2D(r, bmp);
|
||||
}
|
||||
|
||||
void OnscreenKeyboard_Draw3D(void) {
|
||||
VirtualKeyboard_Display3D();
|
||||
}
|
||||
|
|
|
@ -761,7 +761,6 @@ void Window_FreeFramebuffer(struct Bitmap* bmp) {
|
|||
|
||||
void OnscreenKeyboard_Open(struct OpenKeyboardArgs* args) { }
|
||||
void OnscreenKeyboard_SetText(const cc_string* text) { }
|
||||
void OnscreenKeyboard_Draw2D(Rect2D* r, struct Bitmap* bmp) { }
|
||||
void OnscreenKeyboard_Draw3D(void) { }
|
||||
void OnscreenKeyboard_Close(void) { }
|
||||
|
||||
|
|
Loading…
Reference in a new issue