Committing current progress.
This commit is contained in:
@ -66,6 +66,7 @@
|
||||
// User Interface Objects
|
||||
#include "ui/frame.h"
|
||||
#include "ui/label.h"
|
||||
#include "ui/menu.h"
|
||||
|
||||
// Utility Objects
|
||||
#include "util/array.h"
|
||||
|
@ -13,4 +13,14 @@ typedef struct {
|
||||
|
||||
float normalX;
|
||||
float normalY;
|
||||
} aabbpointhit_t;
|
||||
} aabbpointhit2d_t;
|
||||
|
||||
typedef struct {
|
||||
float time;
|
||||
|
||||
float normalX;
|
||||
float normalY;
|
||||
|
||||
float hitX;
|
||||
float hitY;
|
||||
} aabbvectorhit2d_t;
|
38
include/dawn/ui/menu.h
Normal file
38
include/dawn/ui/menu.h
Normal file
@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Copyright (c) 2021 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "../libs.h"
|
||||
|
||||
#define MENU_ITEMS_COLUMNS_MAX 16
|
||||
#define MENU_ITEMS_ROWS_MAX 128
|
||||
#define MENU_ITEMS_MAX MENU_ITEMS_COLUMNS_MAX * MENU_ITEMS_ROWS_MAX
|
||||
|
||||
#define MENU_DIRECTION_DOWN 0x01
|
||||
#define MENU_DIRECTION_UP 0x02
|
||||
#define MENU_DIRECTION_LEFT 0x03
|
||||
#define MENU_DIRECTION_RIGHT 0x04
|
||||
|
||||
#define MENU_HOLD_DURATION 1.0
|
||||
|
||||
typedef struct {
|
||||
int32_t bruh;
|
||||
} menuitem_t;
|
||||
|
||||
typedef struct {
|
||||
int32_t columns;
|
||||
int32_t rows;
|
||||
|
||||
int32_t x;
|
||||
int32_t y;
|
||||
|
||||
uint8_t direction;
|
||||
|
||||
menuitem_t* items[MENU_ITEMS_MAX];
|
||||
bool holdAllow;
|
||||
float holdLast;
|
||||
} menu_t;
|
@ -16,4 +16,5 @@
|
||||
#define mathAbs(n) (n<0?-n:n)
|
||||
#define mathDeg2Rad(n) (n * M_PI / 180.0)
|
||||
#define mathRad2Deg(n) (n * 180 / M_PI)
|
||||
#define mathSign(n) (n>=0 ? 1 : -1)
|
||||
#define mathSign(n) (n>=0 ? 1 : -1)
|
||||
#define mathClamp(val,min,max) mathMin(mathMax(val,min),max)
|
Reference in New Issue
Block a user