Update of /cvsroot/lapetus/lapetus
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4187
Modified Files:
text.c
Added Files:
text.h
Log Message:
-Updated to use new font system
--- NEW FILE: text.h ---
/* Copyright 2007 Theo Berkau
This file is part of Lapetus.
Lapetus is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Lapetus is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Lapetus; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef TEXT_H
#define TEXT_H
void VdpPrintText(font_struct * font, int x, int y, int color, const char *text);
void VdpPrintf(font_struct * font, int x, int y, int color, char *format, ...);
#endif
Index: text.c
===================================================================
RCS file: /cvsroot/lapetus/lapetus/text.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- text.c 1 Mar 2007 00:50:42 -0000 1.2
+++ text.c 3 Mar 2007 03:32:55 -0000 1.3
@@ -19,24 +19,34 @@
#include <stdio.h>
#include <stdarg.h>
+#include <string.h>
#include "lapetus.h"
//////////////////////////////////////////////////////////////////////////////
-void VdpPrintText(int x, int y, int color, const char *text)
+extern vdp2settings_struct vdp2settings;
+
+//////////////////////////////////////////////////////////////////////////////
+
+void VdpPrintText(font_struct *font, int x, int y, int color, const char *text)
{
+ int i;
+ int length = strlen(text);
+
+ for (i = 0; i < length; i++)
+ x += font->drawchar(font, x, y, color, text[i]);
}
//////////////////////////////////////////////////////////////////////////////
-void VdpPrintf(int x, int y, int color, char *format, ...)
+void VdpPrintf(font_struct *font, int x, int y, int color, char *format, ...)
{
char string[256]; // I hope that's enough
va_list arg;
va_start(arg, format);
vsprintf(string, format, arg);
- VdpPrintText(x, y, color, string);
+ VdpPrintText(font, x, y, color, string);
va_end(arg);
}
|