Rogue Class Linux Download Login

Artifact Content

Artifact 496b280565c3be277ed27c6009a23f4dda89a433:


--- escape-src/commenting.cc.orig	2014-07-19 19:13:52.995320790 -0700
+++ escape-src/commenting.cc	2014-07-20 10:15:04.843776111 -0700
@@ -12,6 +12,7 @@
 #include "client.h"
 #include "commenting.h"
 #include "httputil.h"
+#include "rcl.h"
 
 struct cscreen : public drawable {
   virtual void draw () {
@@ -46,6 +47,9 @@
 
   void redraw () {
     draw ();
+#ifdef RCL
+    vkbdBlitGraphics(NULL);
+#endif
     SDL_Flip(screen);
   }
 
@@ -66,6 +70,33 @@
 
 };
 
+#ifdef RCL
+extern "C" {
+void escapeCommentFlushGraphics(vkbd *kbd) {
+  cscreen *p;
+  p = kbd->data;
+  p->redraw();
+  return;
+}
+
+void escapeCommentHook(cscreen *cs) {
+  vkbd *kbd;
+  kbd = vkbdGetContext();
+  kbd->data = cs;
+  kbd->flushGraphics = escapeCommentFlushGraphics;
+  return;
+}
+
+void escapeCommentUnhook() {
+  vkbd *kbd;
+  kbd = vkbdGetContext();
+  kbd->data = NULL;
+  kbd->flushGraphics = NULL;
+  return;
+}
+} /* extern "C" */
+#endif
+
 void commentscreen::comment(player * p, level * lev, string md5,
 			    bool cookmode) {
   cscreen cs;
@@ -75,7 +106,6 @@
   solution * sol = p->getsol(md5);
   cs.nsolved = sol?sol->length:0;
 
-
   cs.redraw();
 
   /* XXX if cookmode, then we have already just connected.. */
@@ -119,6 +149,10 @@
 
   }
 
+#ifdef RCL
+  escapeCommentHook(&cs);
+#endif
+
   cs.tx->say(GREY "ok.");
   cs.redraw ();
 
@@ -201,4 +235,7 @@
    
   }
 
+#ifdef RCL
+  escapeCommentUnhook();
+#endif
 }