aboutsummaryrefslogtreecommitdiff
path: root/source/nds/draw.h
diff options
context:
space:
mode:
authorNebuleon Fumika2012-12-19 18:38:04 -0500
committerNebuleon Fumika2012-12-19 18:38:04 -0500
commit973cd8d5e37dba2e15de3d3fd1965d2fbfc2cdab (patch)
tree9c4345f25d8c0f1d99ca5132c842882a11a40339 /source/nds/draw.h
parenteee0a7ecdaa08f15ebeb7821d6e805234dc78c33 (diff)
downloadsnes9x2005-973cd8d5e37dba2e15de3d3fd1965d2fbfc2cdab.tar.gz
snes9x2005-973cd8d5e37dba2e15de3d3fd1965d2fbfc2cdab.tar.bz2
snes9x2005-973cd8d5e37dba2e15de3d3fd1965d2fbfc2cdab.zip
EN: Link the French translation to the interface. FR: Ajout de la traduction française à l'interface.
EN: * bdf_font.c: Add support for having a main font, [0], of more than 128 characters. Refactor character width checks into a new function, BDF_width16_ucs. * bdf_font.h, draw.h, gui.c: Use UTF-8 for all strings to allow more translations. Use BDF_width16_ucs where possible. FR: * bdf_font.c: Prendre en charge une police principale, [0], de plus de 128 caractères. Diriger les vérifications de la largeur d'un caractère vers une nouvelle routine, BDF_width16_ucs. * bdf_font.h, draw.h, gui.c: Utiliser le codage UTF-8 pour toutes les chaînes pour permettre d'autres traductions. Utiliser BDF_width16_ucs là où c'est possible.
Diffstat (limited to 'source/nds/draw.h')
-rw-r--r--source/nds/draw.h118
1 files changed, 59 insertions, 59 deletions
diff --git a/source/nds/draw.h b/source/nds/draw.h
index 3bdf5be..f40aa23 100644
--- a/source/nds/draw.h
+++ b/source/nds/draw.h
@@ -17,8 +17,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __DRAW_H__
-#define __DRAW_H__
+#ifndef __DRAW_H__
+#define __DRAW_H__
#include "ds2_types.h"
#include "ds2io.h"
@@ -27,12 +27,12 @@
#define NDS_SCREEN_WIDTH 256
#define NDS_SCREEN_HEIGHT 192
#define NDS_SCREEN_SIZE (NDS_SCREEN_WIDTH*NDS_SCREEN_HEIGHT)
-
-#define COLOR16(red, green, blue) ((blue << 10) | (green << 5) | red)
-#define GET_R16(color) (color & 0x1f)
-#define GET_G16(color) ((color >> 5) & 0x1f)
-#define GET_B16(color) ((color >> 10)& 0x1f)
-#define COLOR32(red, green, blue) (0xff000000 | ((blue & 0xff) << 16) | ((green & 0xff) << 8) | (red & 0xff))
+
+#define COLOR16(red, green, blue) ((blue << 10) | (green << 5) | red)
+#define GET_R16(color) (color & 0x1f)
+#define GET_G16(color) ((color >> 5) & 0x1f)
+#define GET_B16(color) ((color >> 10)& 0x1f)
+#define COLOR32(red, green, blue) (0xff000000 | ((blue & 0xff) << 16) | ((green & 0xff) << 8) | (red & 0xff))
#define RGB24_15(pixel) ((((*pixel) & 0xF8) << 7) |\
(((*(pixel+1)) & 0xF8) << 2) |\
@@ -44,36 +44,36 @@
#define PRINT_STRING(screen, str, fg_color, x, y) \
- BDF_render_string(screen, x, y, COLOR_TRANS, fg_color, str) \
+ BDF_render_mix(screen, SCREEN_WIDTH, x, y, 0, COLOR_TRANS, fg_color, str) \
#define PRINT_STRING_SHADOW(screen, str, fg_color, x, y) \
- BDF_render_string(screen, x+1, y+1, 0, 0, str); \
- BDF_render_string(screen, x, y, 0, 0, str) \
+ BDF_render_mix(screen, SCREEN_WIDTH, x+1, y+1, 0, 0, 0, str); \
+ BDF_render_mix(screen, SCREEN_WIDTH, x, y, 0, 0, 0, str) \
#define PRINT_STRING_BG(screen, str, fg_color, bg_color, x, y) \
- BDF_render_string(screen, x, y, bg_color, fg_color, str) \
+ BDF_render_mix(screen, SCREEN_WIDTH, x, y, 0, bg_color, fg_color, str) \
+
+// #define PRINT_STRING_BG_UTF8(screen, utf8, fg_color, bg_color, x, y) \
+// BDF_render_mix(screen, SCREEN_WIDTH, x, y, 0, bg_color, fg_color, utf8) \
-#define PRINT_STRING_BG_UTF8(screen, utf8, fg_color, bg_color, x, y) \
- BDF_render_mix(screen, SCREEN_WIDTH, x, y, 0, bg_color, fg_color, utf8) \
-
//colors
-#define COLOR_TRANS COLOR16(31, 31, 63)
-#define COLOR_WHITE COLOR16(31, 31, 31)
-#define COLOR_BLACK COLOR16( 0, 0, 0)
-#define COLOR_TEXT COLOR16(31, 31, 31)
-#define COLOR_PROGRESS_TEXT COLOR16( 0, 0, 0)
-#define COLOR_PROGRESS_BAR COLOR16(15, 15, 15)
-#define COLOR_ERROR COLOR16(31, 0, 0)
-#define COLOR_BG COLOR16(2, 4, 10)
-#define COLOR_BG32 COLOR32(2*8, 4*8, 10*8)
-#define COLOR_ROM_INFO COLOR16(22, 18, 26)
-#define COLOR_ACTIVE_ITEM COLOR16(31, 31, 31)
-#define COLOR_INACTIVE_ITEM COLOR16(13, 20, 18)
-#define COLOR_HELP_TEXT COLOR16(16, 20, 24)
-#define COLOR_DIALOG COLOR16(31, 31, 31)
-#define COLOR_DIALOG_SHADOW COLOR16( 0, 2, 8)
-#define COLOR_FRAME COLOR16( 0, 0, 0)
+#define COLOR_TRANS COLOR16(31, 31, 63)
+#define COLOR_WHITE COLOR16(31, 31, 31)
+#define COLOR_BLACK COLOR16( 0, 0, 0)
+#define COLOR_TEXT COLOR16(31, 31, 31)
+#define COLOR_PROGRESS_TEXT COLOR16( 0, 0, 0)
+#define COLOR_PROGRESS_BAR COLOR16(15, 15, 15)
+#define COLOR_ERROR COLOR16(31, 0, 0)
+#define COLOR_BG COLOR16(2, 4, 10)
+#define COLOR_BG32 COLOR32(2*8, 4*8, 10*8)
+#define COLOR_ROM_INFO COLOR16(22, 18, 26)
+#define COLOR_ACTIVE_ITEM COLOR16(31, 31, 31)
+#define COLOR_INACTIVE_ITEM COLOR16(13, 20, 18)
+#define COLOR_HELP_TEXT COLOR16(16, 20, 24)
+#define COLOR_DIALOG COLOR16(31, 31, 31)
+#define COLOR_DIALOG_SHADOW COLOR16( 0, 2, 8)
+#define COLOR_FRAME COLOR16( 0, 0, 0)
#define COLOR_YESNO_TEXT COLOR16( 0, 0, 0)
#define COLOR_GREEN COLOR16( 0, 31, 0 )
#define COLOR_GREEN1 COLOR16( 0, 24, 0 )
@@ -81,14 +81,14 @@
#define COLOR_GREEN3 COLOR16( 0, 12, 0 )
#define COLOR_GREEN4 COLOR16( 0, 6, 0 )
#define COLOR_RED COLOR16( 31, 0, 0 )
-#define COLOR_MSSG COLOR16( 16, 8, 29)
-/******************************************************************************
- *
+#define COLOR_MSSG COLOR16( 16, 8, 29)
+/******************************************************************************
+ *
******************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
-
+
struct background{
char bgname[128];
char bgbuffer[256*192*2];
@@ -151,17 +151,17 @@ extern struct gui_iconlist gui_icon_list[];
#define ICON_CHTFILE gui_icon_list[38]
#define ICON_MSG gui_icon_list[39]
#define ICON_BUTTON gui_icon_list[40]
-
-/******************************************************************************
- *
- ******************************************************************************/
+
+/******************************************************************************
+ *
+ ******************************************************************************/
extern void print_string_center(void* screen_addr, u32 sy, u32 color, u32 bg_color, char *str);
-extern void print_string_shadow_center(void* screen_addr, u32 sy, u32 color, char *str);
-extern void hline(u32 sx, u32 ex, u32 y, u32 color);
-extern void hline_alpha(u32 sx, u32 ex, u32 y, u32 color, u32 alpha);
-extern void vline(u32 x, u32 sy, u32 ey, u32 color);
-extern void vline_alpha(u32 x, u32 sy, u32 ey, u32 color, u32 alpha);
-extern void drawbox(void* screen_address, u32 sx, u32 sy, u32 ex, u32 ey, u32 color);
+extern void print_string_shadow_center(void* screen_addr, u32 sy, u32 color, char *str);
+extern void hline(u32 sx, u32 ex, u32 y, u32 color);
+extern void hline_alpha(u32 sx, u32 ex, u32 y, u32 color, u32 alpha);
+extern void vline(u32 x, u32 sy, u32 ey, u32 color);
+extern void vline_alpha(u32 x, u32 sy, u32 ey, u32 color, u32 alpha);
+extern void drawbox(void* screen_address, u32 sx, u32 sy, u32 ex, u32 ey, u32 color);
extern void drawboxfill(void* screen_address, u32 sx, u32 sy, u32 ex, u32 ey, u32 color);
extern void draw_selitem(void* screen_address, u32 x, u32 y, u32 color, u32 active);
extern void draw_message(void* screen_address, u16 *screen_bg, u32 sx, u32 sy, u32 ex, u32 ey,
@@ -173,19 +173,19 @@ extern void draw_string_vcenter(void* screen_address, u32 sx, u32 sy, u32 width,
extern u32 draw_hscroll_init(void* screen_address, u32 sx, u32 sy, u32 width,
u32 color_bg, u32 color_fg, char *string);
extern u32 draw_hscroll(u32 index, s32 scroll_val);
-extern void draw_hscroll_over(u32 index);
-extern void boxfill_alpha(u32 sx, u32 sy, u32 ex, u32 ey, u32 color, u32 alpha);
-extern void init_progress(enum SCREEN_ID screen, u32 total, char *text);
-extern void update_progress(void);
-extern void show_progress(char *text);
-extern void scrollbar(void* screen_addr, u32 sx, u32 sy, u32 ex, u32 ey, u32 all, u32 view, u32 now);
+extern void draw_hscroll_over(u32 index);
+extern void boxfill_alpha(u32 sx, u32 sy, u32 ex, u32 ey, u32 color, u32 alpha);
+extern void init_progress(enum SCREEN_ID screen, u32 total, char *text);
+extern void update_progress(void);
+extern void show_progress(char *text);
+extern void scrollbar(void* screen_addr, u32 sx, u32 sy, u32 ex, u32 ey, u32 all, u32 view, u32 now);
extern u32 yesno_dialog(char *text);
-extern u32 draw_yesno_dialog(enum SCREEN_ID screen, u32 sy, char *yes, char *no);
-extern void msg_screen_init(const char *title);
-extern void msg_screen_draw();
-extern void msg_printf(const char *text, ...);
-extern void msg_screen_clear(void);
-extern void msg_set_text_color(u32 color);
+extern u32 draw_yesno_dialog(enum SCREEN_ID screen, u32 sy, char *yes, char *no);
+extern void msg_screen_init(const char *title);
+extern void msg_screen_draw();
+extern void msg_printf(const char *text, ...);
+extern void msg_screen_clear(void);
+extern void msg_set_text_color(u32 color);
extern int icon_init(u32 language_id);
extern int gui_change_icon(u32 language_id);
@@ -203,5 +203,5 @@ extern void blit_to_screen(void* screen_addr, u16 *src, u32 w, u32 h, u32 dest_x
}
#endif
-#endif //__DRAW_H__
-
+#endif //__DRAW_H__
+