more controller support and fix some crashes

This commit is contained in:
Ondřej Novák 2025-03-04 12:07:40 +01:00
parent 3f946405b9
commit 0e251dcd05
19 changed files with 608 additions and 195 deletions

View file

@ -17,6 +17,7 @@
#include <libs/pcx.h>
#include "globals.h"
#include <ctype.h>
#include <string.h>
#define AUTOMAP_BACK RGB555(8,4,0)
#define AUTOMAP_VODA RGB555(0,15,31)
@ -141,11 +142,15 @@ void save_text_to_map(int x,int y,int depth,char *text)
{
char c[512],*d;
if (text[0]==0) return;
d = text;
while (*d && isspace(*d)) ++d;
if (!*d) return;
memset(c,1,sizeof(c));
strncpy(c+12,text,sizeof(c)-13);
c[511] = 0;
if (texty_v_mape==NULL) texty_v_mape=create_list(8);
d=texty_v_mape[str_add(&texty_v_mape,c)];
int id = str_add(&texty_v_mape,c);
d=texty_v_mape[id];
x=(x-320)+map_xr;
y=(y-197)+map_yr;
memcpy(d,&x,4);memcpy(d+4,&y,4);memcpy(d+8,&depth,4);