/
ansilove.h
63 lines (55 loc) · 1.8 KB
/
ansilove.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//
// ansilove.h
// AnsiLove/C
//
// Copyright (C) 2011-2016 Stefan Vogt, Brian Cassidy, Frederic Cambus.
// All rights reserved.
//
// This source code is licensed under the BSD 3-Clause License.
// See the file LICENSE for details.
//
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <math.h>
#include <gd.h>
#include "alconfig.h"
#include "albinfonts.h"
#include "strtolower.h"
#include "substr.h"
#include "explode.h"
#include "filesize.h"
#include "sauce.h"
#ifndef ansilove_h
#define ansilove_h
// prototypes
void alDrawChar(gdImagePtr im, const unsigned char *font_data, int32_t int_bits,
int32_t font_size_y, int32_t position_x, int32_t position_y,
int32_t color_background, int32_t color_foreground, unsigned char character);
void alAnsiLoader(char *input, char *output, char *retinaout, char *font, int32_t int_bits, char *mode, bool icecolors, char *fext, bool createRetinaRep);
void alPcBoardLoader(char *input, char *output, char *retinaout, char *font, int32_t int_bits, bool createRetinaRep);
void alTundraLoader(char *input, char *output, char *retinaout, char *font, int32_t int_bits, bool fileHasSAUCE, bool createRetinaRep);
void alXbinLoader(char *input, char *output, char *retinaout, bool createRetinaRep);
// helper functions
char *str_replace(const char *string, const char *substr, const char *replacement);
// character structures
struct pcbChar {
int32_t position_x;
int32_t position_y;
int32_t color_background;
int32_t color_foreground;
int32_t current_character;
};
struct ansiChar {
int32_t position_x;
int32_t position_y;
int32_t color_background;
int32_t color_foreground;
int32_t current_character;
bool bold;
bool italics;
bool underline;
};
#endif