--- deliantra/Deliantra-Client/Client.xs 2018/11/18 01:43:12 1.322 +++ deliantra/Deliantra-Client/Client.xs 2018/11/18 01:48:39 1.323 @@ -201,13 +201,15 @@ return 0; } -typedef struct cf_layout { +struct cf_layout { PangoLayout *pl; float r, g, b, a; // default color for rgba mode int base_height; DC__Font font; rc_t *rc; -} *DC__Layout; +}; + +typedef cf_layout *DC__Layout; static DC__Font default_font; static PangoContext *opengl_context; @@ -258,7 +260,8 @@ typedef uint16_t tileid; typedef uint16_t faceid; -typedef struct { +struct maptex +{ GLuint name; int w, h; float s, t; @@ -266,21 +269,23 @@ tileid smoothtile; uint8_t smoothlevel; uint8_t unused; /* set to zero on use */ -} maptex; +}; -typedef struct { +struct mapcell +{ uint32_t player; tileid tile[3]; uint16_t darkness; uint8_t stat_width, stat_hp, flags, smoothmax; -} mapcell; +}; -typedef struct { +struct maprow +{ int32_t c0, c1; mapcell *col; -} maprow; +}; -typedef struct map { +struct mapgrid { int x, y, w, h; int ox, oy; /* offset to virtual global coordinate system */ int faces; tileid *face2tile; // [faceid] @@ -288,7 +293,9 @@ int32_t rows; maprow *row; -} *DC__Map; +}; + +typedef mapgrid *DC__Map; static char * prepend (char *ptr, int sze, int inc) @@ -316,7 +323,7 @@ #define Prepend(type,ptr,sze,inc) (ptr) = (type *)prepend ((char *)ptr, (sze) * sizeof (type), (inc) * sizeof (type)) static void -need_facenum (struct map *self, faceid face) +need_facenum (struct mapgrid *self, faceid face) { while (self->faces <= face) { @@ -326,7 +333,7 @@ } static void -need_texid (struct map *self, int texid) +need_texid (struct mapgrid *self, int texid) { while (self->texs <= texid) { @@ -336,7 +343,7 @@ } static maprow * -map_get_row (DC__Map self, int y) +map_get_row (mapgrid *self, int y) { if (0 > y) { @@ -384,13 +391,13 @@ } static mapcell * -map_get_cell (DC__Map self, int x, int y) +map_get_cell (mapgrid *self, int x, int y) { return row_get_cell (map_get_row (self, y), x); } static void -map_clear (DC__Map self) +map_clear (mapgrid *self) { int r; @@ -418,7 +425,7 @@ } while (0) static void -map_blank (DC__Map self, int x0, int y0, int w, int h) +map_blank (mapgrid *self, int x0, int y0, int w, int h) { int x, y; maprow *row; @@ -1896,7 +1903,7 @@ DC::Map new (SV *klass) CODE: - New (0, RETVAL, 1, struct map); + New (0, RETVAL, 1, mapgrid); RETVAL->x = 0; RETVAL->y = 0; RETVAL->w = 0;