Rogue Class Linux Download Login

Artifact Content

Artifact 306d27c8067ef59e2f6f39813cc873d7825e0354:


--- into-the-dungeon-0.9.2/src/CApp_OnInit.cpp.orig	2015-10-10 15:39:59.170664383 -0700
+++ into-the-dungeon-0.9.2/src/CApp_OnInit.cpp	2015-10-10 16:16:04.838713527 -0700
@@ -36,8 +36,31 @@
 #include "LevelLoader.h"
 #include "SpaceComponent.h"
 
+#ifdef RCL
+extern "C" {
+#include <libvjk.h>
+
+void itdBlitGraphics(vkbd *kbd) {
+  SDL_Rect r;
+  if (kbd->keysEmu) {
+    r.x = 32;
+    r.y = 32;
+    r.w = 0;
+    r.h = 0;
+    SDL_BlitSurface(kbd->sf, NULL, kbd->win, &r);
+  }
+  return;
+}
+
+} /* extern "C" */
+#endif
+
 bool CApp::OnInit()
 {
+#ifdef RCL
+  vjoy *joy = NULL;
+  vkbd *kbd = NULL;
+#endif
   COptions::options.LoadOptions();
   
   if (SDL_Init(SDL_INIT_EVERYTHING) < 0) {
@@ -70,6 +93,14 @@
         SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN);
   }
   
+#ifdef RCL
+  joy = vjoyNew(NULL, NULL, VJOY_FANCYHAT, NULL);
+  kbd = vkbdNew("into-the-dungeon", joy, Surf_Display, itdBlitGraphics,
+    NULL, VKBD_NONE, NULL);
+  vjoySetContext(joy);
+  vkbdSetContext(kbd);
+#endif
+
   Surf_LoadScreen = CSurface::OnLoad(
       data::FindFile("gfx/UI/MENU_BACKGROUND_800x600.png").c_str());
   if (!Surf_LoadScreen) {