Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI ux tweaks #152

Merged
merged 48 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
1621466
fix: some UI tweaks and text align corrections
TheFakeMontyOnTheRun Jun 3, 2024
10e37d2
[EE] Fix floor map position for ES
TheFakeMontyOnTheRun Jun 3, 2024
3eed3ae
[GL] Handle margins when printing text
TheFakeMontyOnTheRun Jun 3, 2024
6d628f7
[GL] Properly indent text when breaking a line
TheFakeMontyOnTheRun Jun 3, 2024
15b5dfe
[GL] Properly position text when breaking lines in N64
TheFakeMontyOnTheRun Jun 3, 2024
bae8c2f
fix: window drawing positioning
TheFakeMontyOnTheRun Jun 3, 2024
0e1d417
[MY] fix in game UI (items display) for 320-wide resolution games
TheFakeMontyOnTheRun Jun 4, 2024
4bfa02f
[MY] Fix ia16 string printing
TheFakeMontyOnTheRun Jun 4, 2024
243211d
[MX] Reflow strings as it is printed, so it will break the sentence b…
TheFakeMontyOnTheRun Jun 5, 2024
d500006
feat: add basic background colour for screens that support it
TheFakeMontyOnTheRun Jun 5, 2024
c614bfe
[EE] Replicate text reflowing from MX to EE
TheFakeMontyOnTheRun Jun 5, 2024
ec1a3a4
[MY] Add text reflowing to TMS9918 and SDL 2 ports
TheFakeMontyOnTheRun Jun 8, 2024
f5b1872
[MZ] Very basic integration of the state machine into the enhanced en…
TheFakeMontyOnTheRun Jun 9, 2024
2b9a7e4
[MY] Filter elevator text to only display "go up" or "go down"
TheFakeMontyOnTheRun Jun 10, 2024
c471b2d
[MY] Fix ia16 port
TheFakeMontyOnTheRun Jun 11, 2024
4094850
[MY] Fix CPC port, with text reflowing
TheFakeMontyOnTheRun Jun 11, 2024
78a70f9
feat: add very basic, temporary, logo for the main menu
TheFakeMontyOnTheRun Jun 13, 2024
dec659f
[MY] Fix Xcode2 builds
TheFakeMontyOnTheRun Jun 13, 2024
02b7ba5
[CORE] Fix being able to search the clogged flush twice and always pr…
TheFakeMontyOnTheRun Jun 14, 2024
843ddc6
[MY] Fix elevator positioning when going up or down
TheFakeMontyOnTheRun Jun 16, 2024
bd81ec4
fix: title screen shapes going out of bounds
TheFakeMontyOnTheRun Jun 18, 2024
a68f5bd
feat: add _FORTIFY_SOURCE to all CMake recipes
TheFakeMontyOnTheRun Jun 18, 2024
8134435
[MY] Improve handling of popup dismissal
TheFakeMontyOnTheRun Jun 18, 2024
a318d75
[MX] Fix polygon drawing boundaries
TheFakeMontyOnTheRun Jun 19, 2024
77ce19c
refactor: rename dungeon_tick to be less Lua-like
TheFakeMontyOnTheRun Jun 20, 2024
969c80e
[MY, MZ] Fix accessing the hacking mini game
TheFakeMontyOnTheRun Jun 20, 2024
b55101c
[MY] Trade input latency with redraw for TMS9918 ports
TheFakeMontyOnTheRun Jun 20, 2024
ebba50d
[MY] Fix switching room items for SDL2 port
TheFakeMontyOnTheRun Jun 20, 2024
d4700cb
fix: displaying focused item name on screen
TheFakeMontyOnTheRun Jun 20, 2024
921eebc
[MY] Minor tweak to actions menu in keyboard ports
TheFakeMontyOnTheRun Jun 20, 2024
19a98c6
feat: scale geometric shapes when rendering it
TheFakeMontyOnTheRun Jun 21, 2024
656acdb
Trim memory usage and dead code
TheFakeMontyOnTheRun Jun 24, 2024
429b840
[MY] Fix ia16 builds
TheFakeMontyOnTheRun Jun 24, 2024
7370f90
Introduce new (final?) logo to the splash screen
TheFakeMontyOnTheRun Jun 25, 2024
05ffdd7
fix main menu background colour
TheFakeMontyOnTheRun Jun 25, 2024
4b8714a
feat: some simplification to the splash art
TheFakeMontyOnTheRun Jun 25, 2024
86e9335
[MY] Fix ending processing on Master System
TheFakeMontyOnTheRun Jun 26, 2024
62d68df
[MY] Fix ending detection on ia16
TheFakeMontyOnTheRun Jun 26, 2024
7ba87ac
[MY] Count lines of text for properly sizing the text popups
TheFakeMontyOnTheRun Jun 28, 2024
64d69b4
[MY] Add proper ending to the game, along with a simple image
TheFakeMontyOnTheRun Jun 28, 2024
36dc1cd
fix: transitioning from the hacking screen back into the 3D view
TheFakeMontyOnTheRun Jun 29, 2024
d157ef8
[MY] fix the UI showing players focusing inventory items they no long…
TheFakeMontyOnTheRun Jun 30, 2024
da604b1
[MY] Remove eng game graphic
TheFakeMontyOnTheRun Jun 30, 2024
eb4df7c
[MY] Avoid clearing map twice before redrawing
TheFakeMontyOnTheRun Jun 30, 2024
4ab377b
[MZ] Some tweaks to UI rendering
TheFakeMontyOnTheRun Jun 30, 2024
a24763a
[CORE] Fix unit test builds
TheFakeMontyOnTheRun Jul 1, 2024
e376830
[MY] Fix annoying continuous beep when the game ends
TheFakeMontyOnTheRun Jul 1, 2024
0164108
[MX, GL, EE] Fixes crash when completing the game or on game over
TheFakeMontyOnTheRun Jul 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added art/Blaec-gw22P.ttf
Binary file not shown.
160 changes: 160 additions & 0 deletions art/ending.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions art/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 12 additions & 2 deletions common/include/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,25 @@ struct StaticBuffer {
size_t size;
};

#ifndef USE_CUSTOM_MEMORY_HANDLER
#ifndef NO_DYNAMIC_MEMORY_ALLOC
void *allocMem(size_t sizeInBytes, enum MemoryType type, uint8_t clearAfterAlloc);

void disposeMem(void* ptr);
#endif

void memCopyToFrom(void* dst, void* src, size_t sizeInBytes);

void memFill(void* dst, uint8_t val, size_t sizeInBytes);
#endif

#ifdef ENDIANESS_AWARE
uint8_t isBigEndian(void);

void initFileReader(const char * dataFilePath);

uint32_t toNativeEndianess(const uint32_t val);
#endif

int countLines(const char* text);

extern const char *mainText;
extern char *textBuffer;
Expand All @@ -70,6 +75,9 @@ extern size_t biggestOption;

#define TEXT_BUFFER_SIZE (40 * 25)


#ifndef USE_OWN_MIN_MAX

#ifndef SMD
#ifndef WIN32
#ifndef LEAN_BUILD
Expand All @@ -80,3 +88,5 @@ extern size_t biggestOption;
#endif

#endif

#endif
2 changes: 1 addition & 1 deletion common/include/Dungeon.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct GameSnapshot {
struct Vec2i playerTarget;
};

struct GameSnapshot dungeon_tick(const enum ECommand cmd);
struct GameSnapshot dungeonTick(const enum ECommand command);

void dungeon_loadMap(
const uint8_t *__restrict__ mapData,
Expand Down
2 changes: 0 additions & 2 deletions common/include/Engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ enum EGameMenuState HackingScreen_tickCallback(enum ECommand, void* data);

void HackingScreen_unloadStateCallback(enum EGameMenuState newState);

int countLines(void);

void enterState(enum EGameMenuState State);

int loopTick(enum ECommand cmd);
Expand Down
3 changes: 2 additions & 1 deletion common/include/Enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ enum EDirection {
enum CrawlerState {
kCrawlerGameOver = -1,
kCrawlerQuit = 0,
kCrawlerGameInProgress = 1
kCrawlerGameInProgress = 1,
kCrawlerGameFinished = 2
};

enum ECommand {
Expand Down
2 changes: 1 addition & 1 deletion common/include/UI.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ enum EGameMenuState handleCursor(const enum EGameMenuState* options,
const enum ECommand cmd,
enum EGameMenuState backState);

void drawGraphic(const uint8_t *shapes);
void drawGraphic(uint16_t x, uint8_t y, uint16_t dx, uint8_t dy, const uint8_t *shapes);

extern int8_t cursorPosition;

Expand Down
2 changes: 1 addition & 1 deletion common/src/CTile3DProperties.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void loadPropertyList(const char *propertyFile, struct MapWithCharKey *map, stru
uint8_t len = *(bufferHead++);

char* meshName = (char*)allocMem(len + 1, GENERAL_MEMORY, 1);
memcpy(meshName, bufferHead, len);
memCopyToFrom(meshName, (char*)bufferHead, len);
mesh = (struct Mesh*)allocMem(sizeof(struct Mesh), GENERAL_MEMORY, 1);
sprintf(&meshNameWithExtension[0], "%s.mdl", meshName);
loadMesh(mesh, &meshNameWithExtension[0]);
Expand Down
30 changes: 27 additions & 3 deletions common/src/Common.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@


#ifndef USE_CUSTOM_MEMORY_HANDLER

#ifndef NO_DYNAMIC_MEMORY_ALLOC
void *allocMem(size_t sizeInBytes, enum MemoryType type, uint8_t clearAfterAlloc) {
/*
For the general allocator, we're not worried about the type of memory. It all comes from the
Expand All @@ -60,7 +60,7 @@ void *allocMem(size_t sizeInBytes, enum MemoryType type, uint8_t clearAfterAlloc
if (clearAfterAlloc) {
memset(ptr, 0, sizeInBytes);
}

(void)type;

return ptr;
Expand All @@ -74,7 +74,7 @@ void disposeMem(void *ptr) {
#endif

}

#endif
void memCopyToFrom(void *dst, void *src, size_t sizeInBytes) {
memcpy(dst, src, sizeInBytes);
}
Expand Down Expand Up @@ -112,3 +112,27 @@ uint32_t toNativeEndianess(const uint32_t val) {
return val2;
}
#endif


int countLines(const char* text) {
int lines = 1;
int chars = 0;

while(*text) {
++chars;

if (
#ifdef XRES_FRAMEBUFFER
(chars >= (XRES_FRAMEBUFFER / 8)) ||
#endif
*text == '\n') {
++lines;
chars = 0;
}

++text;
}


return lines;
}
4 changes: 2 additions & 2 deletions common/src/Crawler.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ void Crawler_repaintCallback(void) {
/* The dithered filter on top of the 3D rendering*/
fillRect(0, 0, XRES_FRAMEBUFFER, YRES_FRAMEBUFFER, getPaletteEntry(0xFF000000), TRUE);

drawWindowWithOptions((XRES_FRAMEBUFFER / 8) - biggestOption - 3,
((YRES_FRAMEBUFFER / 8) + 1) - (optionsHeight / 8) - 3,
drawWindowWithOptions((XRES_FRAMEBUFFER / 8) - biggestOption - 4,
((YRES_FRAMEBUFFER / 8) + 1) - (optionsHeight / 8) - 4,
biggestOption + 2,
(optionsHeight / 8) + 2,
AbandonMission_Title,
Expand Down
Loading
Loading