Browse Source

* Cosmetic code changes and minor optimisations.

tags/v0.99.beta14
Sam Hocevar sam 18 years ago
parent
commit
ac3283f07f
2 changed files with 9 additions and 9 deletions
  1. +8
    -8
      cucul/export.c
  2. +1
    -1
      tools/makefont.c

+ 8
- 8
cucul/export.c View File

@@ -127,7 +127,7 @@ char const * const * cucul_get_export_list(void)
/* Generate ANSI representation of current canvas. */ /* Generate ANSI representation of current canvas. */
static void export_ansi(cucul_t *qq, cucul_buffer_t *ex) static void export_ansi(cucul_t *qq, cucul_buffer_t *ex)
{ {
static int const palette[] =
static uint8_t const palette[] =
{ {
0, 4, 2, 6, 1, 5, 3, 7, 0, 4, 2, 6, 1, 5, 3, 7,
8, 12, 10, 14, 9, 13, 11, 15 8, 12, 10, 14, 9, 13, 11, 15
@@ -194,7 +194,7 @@ static void export_ansi(cucul_t *qq, cucul_buffer_t *ex)
/* Generate HTML representation of current canvas. */ /* Generate HTML representation of current canvas. */
static void export_html(cucul_t *qq, cucul_buffer_t *ex) static void export_html(cucul_t *qq, cucul_buffer_t *ex)
{ {
static int const palette[] =
static uint16_t const palette[] =
{ {
0x000, 0x008, 0x080, 0x088, 0x800, 0x808, 0x880, 0x888, 0x000, 0x008, 0x080, 0x088, 0x800, 0x808, 0x880, 0x888,
0x444, 0x44f, 0x4f4, 0x4ff, 0xf44, 0xf4f, 0xff4, 0xfff, 0x444, 0x44f, 0x4f4, 0x4ff, 0xf44, 0xf4f, 0xff4, 0xfff,
@@ -268,7 +268,7 @@ static void export_html(cucul_t *qq, cucul_buffer_t *ex)
* correct header. */ * correct header. */
static void export_html3(cucul_t *qq, cucul_buffer_t *ex) static void export_html3(cucul_t *qq, cucul_buffer_t *ex)
{ {
static int const palette[] =
static uint32_t const palette[] =
{ {
0x000000, 0x000088, 0x008800, 0x008888, 0x000000, 0x000088, 0x008800, 0x008888,
0x880000, 0x880088, 0x888800, 0x888888, 0x880000, 0x880088, 0x888800, 0x888888,
@@ -345,7 +345,7 @@ static void export_html3(cucul_t *qq, cucul_buffer_t *ex)
/* Export a text file with IRC colours */ /* Export a text file with IRC colours */
static void export_irc(cucul_t *qq, cucul_buffer_t *ex) static void export_irc(cucul_t *qq, cucul_buffer_t *ex)
{ {
static int const palette[] =
static uint8_t const palette[] =
{ {
1, 2, 3, 10, 5, 6, 7, 15, /* Dark */ 1, 2, 3, 10, 5, 6, 7, 15, /* Dark */
14, 12, 9, 11, 4, 13, 8, 0, /* Light */ 14, 12, 9, 11, 4, 13, 8, 0, /* Light */
@@ -622,16 +622,16 @@ static void export_svg(cucul_t *qq, cucul_buffer_t *ex)
/* Export a TGA image */ /* Export a TGA image */
static void export_tga(cucul_t *qq, cucul_buffer_t *ex) static void export_tga(cucul_t *qq, cucul_buffer_t *ex)
{ {
char const * const * fonts;
char const * const * fontlist;
char * cur; char * cur;
cucul_font_t *f; cucul_font_t *f;
unsigned int i, w, h; unsigned int i, w, h;


fonts = cucul_get_font_list();
if(!fonts[0])
fontlist = cucul_get_font_list();
if(!fontlist[0])
return; return;


f = cucul_load_font(fonts[0], 0);
f = cucul_load_font(fontlist[0], 0);


w = cucul_get_width(qq) * cucul_get_font_width(f); w = cucul_get_width(qq) * cucul_get_font_width(f);
h = cucul_get_height(qq) * cucul_get_font_height(f); h = cucul_get_height(qq) * cucul_get_font_height(f);


+ 1
- 1
tools/makefont.c View File

@@ -11,7 +11,7 @@
* http://sam.zoy.org/wtfpl/COPYING for more details. * http://sam.zoy.org/wtfpl/COPYING for more details.
* *
* Usage: * Usage:
* makefont
* makefont <prefix> <font> <dpi> <bpp>
*/ */


#include <stdio.h> #include <stdio.h>


Loading…
Cancel
Save