From b7f643a6326236f8bf3d8a8910c91aacb80cf1c3 Mon Sep 17 00:00:00 2001 From: aap Date: Sun, 27 Aug 2017 22:47:54 +0200 Subject: [PATCH] some font rendering --- tools/clumpview/Bm437_IBM_BIOS.tga | Bin 0 -> 65554 bytes tools/clumpview/Bm437_IBM_VGA8.tga | Bin 0 -> 131090 bytes tools/clumpview/font.cpp | 162 +++++++++++++++++++++++++++++ tools/clumpview/foobar.tga | Bin 0 -> 65554 bytes tools/clumpview/main.cpp | 5 + 5 files changed, 167 insertions(+) create mode 100644 tools/clumpview/Bm437_IBM_BIOS.tga create mode 100644 tools/clumpview/Bm437_IBM_VGA8.tga create mode 100644 tools/clumpview/font.cpp create mode 100644 tools/clumpview/foobar.tga diff --git a/tools/clumpview/Bm437_IBM_BIOS.tga b/tools/clumpview/Bm437_IBM_BIOS.tga new file mode 100644 index 0000000000000000000000000000000000000000..50034b418770acf9b6adc9760faf0b203d46edeb GIT binary patch literal 65554 zcmeH_Tap~f4FqXAi9U7Ay}4xAk=r_hKxS4|H#vOt#{>{BWHddq|E69$UNmEA-aV7sd7L?!-JA0}^1k7I^EF$mIdywF4IOkxcCU8lJKuDh z+)k&{J~+@CGn%n9?fcX7m+yemHvA3+n?9 zez4#En|$y_x>h+nQ!aJ(#8uwfYOcwDmU(VA_eDrmQ2R!M*o9O=3 zYTxNyCUfq{w@w;-_LEON_thIZt-F(*-R>^t?3#A^67eU`j{X$sGrH3}v-Q=Czr$4y zt;@kp9{9w}l@3>!e(Rlvjz$-I>gIQI_nxkw8}_Gj=knOo; zK{Bbsmk;do_tiZSpw7+#&hG)X~htt+4Z(^StWmG_s}DY!6!Uc&#%}`L4q~&N0&o z!W-{sWID`l_VRk}vi78xy|D9HpXSWv8=OOf%e~|2PjBv(g-fItL}yQYs%PKtw(oww zyT1p$;FTUS9bW1A-M##N-S1${GhTC^(F-Tup4CjgFnwsr=RWx+KJ!1ze)ap{2lIQH z_l(b+=hV>(Q)4g02j|^$r^6+7IeS)mYPn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|)J?~Hc*L+MD<0oR z!`JUY+vT10Ox~Pl^mq6Brf1)O_q@7Wn(upOPR!q|^!mWN4-P%Gr~2QAbvy6u^xgek z{;A&m9 zx;4*Tcc7E@KY3?7r*GPw@ofLZ<9VvnGvTg(%E9mQ=pea5bDr^-^PDJa=DtTicRTd`SIpd)x_0`MgWu&>x;4*q z@6Z{~yBxYRo=jJ`u>JnwR^ z)OUAx`tB{e{7Sdxd3O`t8PDiDbjC9|bDq(6=#1xG4&52g=ugp|p4~g~_S~J_?b&@3 zk7uXjGm`1hzG=?f5N?%~O4KKl^sxt2%G&a@IU|-n-nY*P3T;ne&WZIPvzZ<}MG{p>Lk*tNYov^Ip|? zW0$k$x%1xTR=w6dbIY7(^umd^XEk?uxDI{uRA1fCzMc0o=-u}&?t8uM^uB%F+je?o zPCQ+Aa`c#oD>PrTwN6ie?yG!i>~yeqSRVNFv!CFu1HG{N*xlW6=+-=+>gDTl`JJ8gEBy41);{mJK^+046Zn(3VMykTEvbGNsfull==cXChPM?UeL zZ@$vayRKy3;a$CBrTHxu%5KMN6Lj zsa`$qsF`liIvjYS(V1TFp6PxicKzl&=iQZ--dFA1Oziscq&D#@Uu9N$YSZr9%-IcJ z9iFGoCw$j$&a>}KJRWoqeuwxIGl!l$`%}Go?sSkzGVa_vs9ftIY@8o%dZ5RXRO|+?cpd$Gg(-{7B?|;E#OEXT3fBHt>a? M_3bC``fT6he=_nh?*IS* literal 0 HcmV?d00001 diff --git a/tools/clumpview/Bm437_IBM_VGA8.tga b/tools/clumpview/Bm437_IBM_VGA8.tga new file mode 100644 index 0000000000000000000000000000000000000000..521fb4062e1b8b56b6a439bcbc957ea362a1e3e7 GIT binary patch literal 131090 zcmeH~TaqNZk!0DklKGrv_RhP-s_v0FqBH~G9uZlUNskYznZ5u=l9%Ma{`G(U#qYoW z^{@Z>zyFWzKNUXh-DEmE>FIKCT^_9v9d6o-?>sv{I+z{s zE38cEU^k-`*6-9)KL5y?WBygFe}M-j{TktSm^tseZ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?b7k2qiahzNIp5JvIoyOB{XL3I6c$bg!-Dl3TJvTeT8t}5r4{eeCq9apHKBay?^%$Jb(Yc`|tDV U+dY5(PrvZr-T(akzxMC*zlBv_bN~PV literal 0 HcmV?d00001 diff --git a/tools/clumpview/font.cpp b/tools/clumpview/font.cpp new file mode 100644 index 0000000..fc17017 --- /dev/null +++ b/tools/clumpview/font.cpp @@ -0,0 +1,162 @@ +#include +#include + +using namespace rw; + +struct Font +{ + Texture *tex; + int32 glyphwidth, glyphheight; + int32 numglyphs; +}; +Font vga = { nil, 8, 16, 256 }; +Font bios = { nil, 8, 8, 256 }; +Font *curfont = &bios; + +#define NUMCHARS 100 +uint16 indices[NUMCHARS*6]; +RWDEVICE::Im2DVertex vertices[NUMCHARS*4]; +int32 curVert; +int32 curIndex; + +void +printScreen(const char *s, float32 x, float32 y) +{ + char c; + Camera *cam; + RWDEVICE::Im2DVertex *vert; + uint16 *ix; + curVert = 0; + curIndex = 0; + float32 u, v, du, dv; + + cam = (Camera*)engine->currentCamera; + vert = &vertices[curVert]; + ix = &indices[curIndex]; + du = curfont->glyphwidth/(float32)curfont->tex->raster->width; + dv = curfont->glyphheight/(float32)curfont->tex->raster->height; + while(c = *s){ + if(c >= curfont->numglyphs) + c = 0; + u = (c % 16)*curfont->glyphwidth / (float32)curfont->tex->raster->width; + v = (c / 16)*curfont->glyphheight / (float32)curfont->tex->raster->height; + + vert->setScreenX(x); + vert->setScreenY(y); + vert->setScreenZ(rw::GetNearZ()); + vert->setCameraZ(cam->nearPlane); + vert->setRecipCameraZ(1.0f/cam->nearPlane); + vert->setColor(255, 255, 255, 255); + vert->setU(u); + vert->setV(v); + vert++; + + vert->setScreenX(x+curfont->glyphwidth); + vert->setScreenY(y); + vert->setScreenZ(rw::GetNearZ()); + vert->setCameraZ(cam->nearPlane); + vert->setRecipCameraZ(1.0f/cam->nearPlane); + vert->setColor(255, 255, 255, 255); + vert->setU(u+du); + vert->setV(v); + vert++; + + vert->setScreenX(x); + vert->setScreenY(y+curfont->glyphheight); + vert->setScreenZ(rw::GetNearZ()); + vert->setCameraZ(cam->nearPlane); + vert->setRecipCameraZ(1.0f/cam->nearPlane); + vert->setColor(255, 255, 255, 255); + vert->setU(u); + vert->setV(v+dv); + vert++; + + vert->setScreenX(x+curfont->glyphwidth); + vert->setScreenY(y+curfont->glyphheight); + vert->setScreenZ(rw::GetNearZ()); + vert->setCameraZ(cam->nearPlane); + vert->setRecipCameraZ(1.0f/cam->nearPlane); + vert->setColor(255, 255, 255, 255); + vert->setU(u+du); + vert->setV(v+dv); + vert++; + + *ix++ = curVert; + *ix++ = curVert+1; + *ix++ = curVert+2; + *ix++ = curVert+2; + *ix++ = curVert+1; + *ix++ = curVert+3; + + curVert += 4; + curIndex += 6; + x += curfont->glyphwidth+1; + + s++; + } + engine->imtexture = curfont->tex; + rw::engine->device.im2DRenderIndexedPrimitive(rw::PRIMTYPETRILIST, + vertices, curVert, indices, curIndex); + +} + +void +initFont(void) +{ + vga.tex = Texture::read("Bm437_IBM_VGA8", ""); + bios.tex = Texture::read("Bm437_IBM_BIOS", ""); +} + +/* +#define NUMGLYPHS 256 +#define GLYPHWIDTH 8 +#define GLYPHHEIGHT 16 + + +void +convertFont(void) +{ + FILE *f; + Image *img; + uint8 data[NUMGLYPHS*GLYPHHEIGHT]; + int32 i, x, y; + uint8 *px, *line, *glyph; +// f = fopen("font0.bin", "rb"); + f = fopen("Bm437_IBM_VGA8.FON", "rb"); +// f = fopen("Bm437_IBM_BIOS.FON", "rb"); + if(f == nil) + return; +fseek(f, 0x65A, 0); + fread(data, 1, NUMGLYPHS*GLYPHHEIGHT, f); + fclose(f); + + img = Image::create(16*GLYPHWIDTH, NUMGLYPHS/16*GLYPHHEIGHT, 32); + img->allocate(); + for(i = 0; i < NUMGLYPHS; i++){ + glyph = &data[i*GLYPHHEIGHT]; + x = (i % 16)*GLYPHWIDTH; + y = (i / 16)*GLYPHHEIGHT; + line = &img->pixels[x*4 + y*img->stride]; + for(y = 0; y < GLYPHHEIGHT; y++){ + px = line; + for(x = 0; x < 8; x++){ + if(*glyph & 1<<(8-x)){ + *px++ = 255; + *px++ = 255; + *px++ = 255; + *px++ = 255; + }else{ + *px++ = 0; + *px++ = 0; + *px++ = 0; + *px++ = 0; + } + } + glyph++; + line += img->stride; + } + } +// writeTGA(img, "Bm437_IBM_BIOS.tga"); + writeTGA(img, "Bm437_IBM_VGA8.tga"); +} +*/ \ No newline at end of file diff --git a/tools/clumpview/foobar.tga b/tools/clumpview/foobar.tga new file mode 100644 index 0000000000000000000000000000000000000000..895bae03f18c6550fc34149d8c4b6a8974148d3a GIT binary patch literal 65554 zcmeH~U6$m=t%T=zC4TfWwR8JK*L+8zFpx>I$myPG-D$OE8e-)Ju8hFM?82x6R*5;l|cimZ$lI6xaYbE&0Ke-^&; zhP$%W9C4g(H|Rq5c;D6T?`qGU@hGRGjN=En_|x6-B+vV<+;Jtl`22tThP=o9$*uZI zJNw=v{+(x~uQcA@p|YILv*X{*@8+*`-7OvLysmqV-#Kb9J;|eYc*K9i^UnM(dk6o{ z+jaldyyv{;o1E+Fl~)-ZJi_cVpi`^4vQ z-D`Xm=bCEw9I02Cm3CzI&ZGG{J71^2(sllwx!rwF@L%Db)f-m3y=xEEy}!fkyWXfd zPwwE(ciuhg$?tx0_T77!d9#7pz-(YPFdLW+%m!uyzitEi??g`C3NK7ez3bHOgL8D< zYdmoDiRfUbC+~fil?P4enbh3(Rcn8L^~U_B?8#Jo$H9Zl04p92l-FyriIu0~$hqb< zx)5HdQ)$k9)q3~#)cKBzuQ>dPJ8$ahbuhQ6HJ~XW#kG-qp=zPU_xgt=8SjX&GpO0_&mQe8uUwT8r^DPt*Sy9j zPRDy{;Yt{nb3zsCff@g)0wQg_`Aj&UTG@ z<;i(uz|5vUb#jh)ob!68yZ4DYzv+oPW@f*E*?+&AKV6yM{!jmf=lf;@vw_*bY+yDp z8<-9JejDKbKLx8VsQx<^e`4l4J$dz>t#ml~s4HB}K~s*}5q>w9jQ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(>>SKnvn;ucxuo&uhAVV-8t3O@foV+Nv`AF>oxhK9DcCN ziPynbVW&G^)y^^3Ij<`nuESmaitcy4n`c%vM_R=@=k;n<<--qF9_PF!19qD8Rqb3g zYp0XxF!Snl@V~mgm(Ts#@A9cya@{{{6_|y)bn)_XTm#4lnf0yj z1G9m5HsJqms_J)UPxjmfeE(HaddHKk^c6?0!&P>)dpDrpU^Vewy_((q?(kLSv$);& zf7ZM1x_9?|@9Nb%`JFqgGM~lmzW=k{b=SSS?|WCT-r4=`@XAm-<}BB!-2(@@rWzh} z9WD`%cxuo&uT!tI%HuxOI_aYqrv4F#Kkm;=YIo?}%y`y6TJ9A|9>dYTo8ftC(C=Gu z(stg}d#h}9pZmP7yxp7drk?L}pV!sBt~2+Dj~sV*$V~j8-{EzocQZOKd}4J^H#@!F zd+mAgI?nkUUh3cfJ4lV58T5&r-tpw$(Us-+Jh%?!l|}}1&g)7SS9$QF%foSvS{k)u z#V6;z*P25w)NwBFL3cj=D^I88jGX_Do_DI(Vdkr=|KiE_kUye#o}B5u&xfzLZgzUr z`(dW%(Va`5JkEKI23DGLSywstysP^xYRz07`Oq_Sv}XqXM9sg-RkQQG%@t%e#A*&!fJQA^SVyyWh?Js~vQ+SD9*#b7VV|x4YNpWPK%*Gk&-J u>2H2wzGkkDego-ee~T-bvv+(YKRf(NZ#wc8-reDm8RPkVH_-j=@c#pASs}sz literal 0 HcmV?d00001 diff --git a/tools/clumpview/main.cpp b/tools/clumpview/main.cpp index 7c5905c..d193f1e 100644 --- a/tools/clumpview/main.cpp +++ b/tools/clumpview/main.cpp @@ -14,6 +14,8 @@ rw::Texture *tex; rw::EngineStartParams engineStartParams; void tlTest(rw::Clump *clump); +void initFont(void); +void printScreen(const char *s, float x, float y); void Init(void) @@ -158,6 +160,8 @@ InitRW(void) if(!sk::InitRW()) return false; + initFont(); + tex = rw::Texture::read("maze", nil); char *filename = "teapot.dff"; @@ -270,6 +274,7 @@ Draw(float timeDelta) Scene.clump->render(); im2dtest(); // tlTest(Scene.clump); + printScreen("Hello, World!", 10, 10); camera->m_rwcam->endUpdate(); camera->m_rwcam->showRaster();