00001 // $Id: newfont.h,v 1.18 2009-12-26 18:44:59 mbickel Exp $ 00002 // 00003 // $Log: not supported by cvs2svn $ 00004 // Revision 1.17 2009-04-18 13:48:38 mbickel 00005 // Major refactoring: 00006 // Added many more unittests 00007 // Changed AI to use commands 00008 // Removed and separated lots of legacy code 00009 // TransferUnitControl is now undo capable 00010 // 00011 // Revision 1.16 2007/04/13 16:15:53 mbickel 00012 // Merged ASC2 branch 00013 // 00014 // Revision 1.14.2.1 2006/03/01 21:00:50 mbickel 00015 // Clean up of source 00016 // Fixed to construction icons 00017 // 00018 // Revision 1.14 2004/07/14 19:26:48 mbickel 00019 // Fixed display glitches 00020 // Rewrote some endian dependent parts 00021 // 00022 // Revision 1.13 2004/07/12 18:15:08 mbickel 00023 // Lots of tweaks and fixed for more portability and compilation with mingw 00024 // 00025 // Revision 1.12 2004/05/20 14:01:10 mbickel 00026 // Many bugfixes and new features, among them: 00027 // - Container.FillUnitsAutomatically = 2 00028 // - generate Tech Tree 00029 // - show research info 00030 // - edit research in mapeditor 00031 // - limit production to units that can leave a building 00032 // 00033 // Revision 1.11 2001/12/14 10:20:05 mbickel 00034 // Cleanup and enhancements to configure.in 00035 // Removed last remains of octagonal version from source files 00036 // 00037 // Revision 1.10 2001/07/15 21:00:25 mbickel 00038 // Some cleanup in the vehicletype class 00039 // 00040 // Revision 1.9 2001/02/06 17:15:11 mbickel 00041 // Some changes for compilation by Borland C++ Builder 00042 // 00043 // Revision 1.8 2000/08/12 12:52:50 mbickel 00044 // Made DOS-Version compile and run again. 00045 // 00046 // Revision 1.7 2000/08/02 10:28:27 mbickel 00047 // Fixed: generator vehicle not working 00048 // Streams can now report their name 00049 // Field information shows units filename 00050 // 00051 // Revision 1.6 2000/05/23 20:40:48 mbickel 00052 // Removed boolean type 00053 // 00054 // Revision 1.5 1999/12/28 21:03:14 mbickel 00055 // Continued Linux port 00056 // Added KDevelop project files 00057 // 00058 // Revision 1.4 1999/11/25 22:00:07 mbickel 00059 // Added weapon information window 00060 // Added support for primary offscreen frame buffers to graphics engine 00061 // Restored file time handling for DOS version 00062 // 00063 // Revision 1.3 1999/11/22 18:27:45 mbickel 00064 // Restructured graphics engine: 00065 // VESA now only for DOS 00066 // BASEGFX should be platform independant 00067 // new interface for initialization 00068 // Rewrote all ASM code in C++, but it is still available for the Watcom 00069 // versions 00070 // Fixed bugs in RLE decompression, BI map importer and the view calculation 00071 // 00072 // Revision 1.2 1999/11/16 03:42:16 tmwilson 00073 // Added CVS keywords to most of the files. 00074 // Started porting the code to Linux (ifdef'ing the DOS specific stuff) 00075 // Wrote replacement routines for kbhit/getch for Linux 00076 // Cleaned up parts of the code that gcc barfed on (char vs unsigned char) 00077 // Added autoconf/automake capabilities 00078 // Added files used by 'automake --gnu' 00079 // 00080 // 00081 /* 00082 This file is part of Advanced Strategic Command; http://www.asc-hq.de 00083 Copyright (C) 1994-2010 Martin Bickel and Marc Schellenberger 00084 00085 This program is free software; you can redistribute it and/or modify 00086 it under the terms of the GNU General Public License as published by 00087 the Free Software Foundation; either version 2 of the License, or 00088 (at your option) any later version. 00089 00090 This program is distributed in the hope that it will be useful, 00091 but WITHOUT ANY WARRANTY; without even the implied warranty of 00092 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00093 GNU General Public License for more details. 00094 00095 You should have received a copy of the GNU General Public License 00096 along with this program; see the file COPYING. If not, write to the 00097 Free Software Foundation, Inc., 59 Temple Place, Suite 330, 00098 Boston, MA 02111-1307 USA 00099 */ 00100 00101 #ifndef newfont_h 00102 00103 #define newfont_h 00104 #include "global.h" 00105 #include "basestrm.h" 00106 #include "palette.h" 00107 00108 #pragma pack(1) 00109 00110 typedef char charr[49]; 00111 00112 struct toldcharacter { 00113 char width; 00114 Uint16 size; 00115 int diskposition; 00116 char* memposition; 00117 char dummy; 00118 }; 00119 00120 typedef signed char tkerning[101][101]; 00121 typedef char tkernchartable[256]; 00122 00123 // tkerning=Array[0..100,0..100] of Shortint; 00124 00125 struct toldfont { 00126 charr id; 00127 char name[256]; 00128 char number; 00129 char color; 00130 toldcharacter character[256]; 00131 Sint16 height; 00132 tkernchartable kernchartable; 00133 tkerning kerning; 00134 Uint16 dummy; 00135 char useems; 00136 char caps; 00137 dacpalette256* palette; 00138 char groundline; 00139 void read ( tnstream& stream ); 00140 }; 00141 00142 00143 00144 struct tcharacter { 00145 Uint16 width; 00146 Uint16 size; 00147 char* memposition; 00148 }; 00149 00150 struct tfont { 00151 char* name; 00152 char color; 00153 char caps; 00154 Sint16 height; 00155 tcharacter character[256]; 00156 signed char kerning[256][256]; 00157 dacpalette256* palette; 00158 char groundline; 00159 }; 00160 00161 00162 typedef tfont* pfont; 00163 00164 00165 00166 00167 00168 struct tfontsettings { 00169 pfont font; 00170 char color; 00171 char background; 00172 char markcolor; 00173 char colorfont; 00174 Uint16 length; 00175 char direction; 00176 char justify; 00177 signed char italic; 00178 char height; 00179 char compmode; 00180 pfont markfont; 00181 }; 00182 00183 00184 #define lefttext 0 00185 #define centertext 1 00186 #define righttext 2 00187 00188 extern void expand(void* p1, void* q1, int size); 00189 extern void showtext2( const ASCString& TextToOutput, int x1, int x2 ); 00190 extern void showtext2c( const ASCString& TextToOutput, int x1, int x2 ); 00191 00192 extern tfontsettings activefontsettings; 00193 00194 extern pfont loadfont( tnstream* stream ); 00195 00196 extern void showtext4 ( const char* TextToOutput, int x1, int y1, ... ); 00197 extern void showtext4c ( const char* TextToOutput, int x1, int y1, ... ); 00198 00199 00200 extern void showtext3( const char * txt, int xpos, int ypos); 00201 extern void showtext3c( const char * txt, int xpos, int ypos); 00202 00203 extern int gettextwdth ( const char* txt, pfont font ); 00204 extern void shrinkfont ( pfont font, int diff ); 00205 00206 00207 extern const char* fontid; 00208 extern char* int2string ( int i, char* buf ); 00209 00210 #pragma pack() 00211 00212 #endif
1.5.1