Chuck Adams  committed ad77bad

more tcod funcs

  • Participants
  • Parent commits 175f2f8

Comments (0)

Files changed (1)

File src/main/java/net/fishbulb/jcod/

  * ==Incompatibilities==
  * <p/>
- * Methods not supported: <ul> <li>initRoot (create and set root directly)</li> <li>setCustomFont (set tileset
- * instead)</li> <li>isFullScreen</li> <li>setFullScreen</li> <li>setWindowTitle</li> <li>isWindowClosed</li> <li></li>
- * <li></li> </ul>
+ * Methods not supported:
+ * <ul>
+ * <li>initRoot (there is no static root, just create a console)</li>
+ * <li>setCustomFont (use setTileSet instead)</li>
+ * <li>is/setFullScreen,setWindowTitle,isWindowClosed (window control not possible)</li>
+ * <li>get/setFade,getFadingColor (control the TileDisplay actor instead)</li>
+ * <li>all keyboard functions (use GDX)</li>
+ * <li></li>
+ * </ul>
 public class Console {
         cellAt(x, y).c(c);
+    //void putChar(int x, int y, int c, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT);
+    /** Blends the current background with itself using the given BlendFunction Makes no sense to me, but that's TCOD. */
+    public void putChar(int x, int y, char c, BlendFunction func) {
+        setChar(x, y, c);
+        if (func != null) {
+            setCharBackground(x, y, cellAt(x, y).bg(), func);
+        }
+    }
+    public void putChar(int x, int y, char c) {
+        putChar(x, y, c, blendFunction);
+    }
+    /** Sets all character properties at once.  Background is set unconditionally (no blend function) */
+    public void putCharEx(int x, int y, char c, Color fore, Color back) {
+        cellAt(x, y).c(c).fg(fore).bg(back);
+    }
+    public BlendFunction getBackgroundFlag() {
+        return getBlendFunction();
+    }
+    public void setBackgroundFlag(BlendFunction func) {
+        setBlendFunction(func);
+    }
     public void flush() {
         // blit tiles from cells (upper-left origin) onto display (lower-left origin)
         for (int y = 1; y <= height; y++) {
     protected class Cell {
         private char c;
         private Tile tile;
 //void clear();
-//void setBackgroundFlag(TCOD_bkgnd_flag_t flag);
-//TCOD_bkgnd_flag_t getBackgroundFlag() const;
 //void setAlignment(TCOD_alignment_t alignment);
 //TCOD_alignment_t getAlignment() const;
 //void print(int x, int y, String fmt, ...);
 //int printRectEx(int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, String fmt, ...);
 //int getHeightRect(int x, int y, int w, int h, String fmt, ...);
 //static void setColorControl(TCOD_colctrl_t con, const TCODColor &fore, const TCODColor &back);
-//static void mapStringToFont(const wchar_t *s, int fontCharX, int fontCharY);
 //void print(int x, int y, const wchar_t *fmt, ...);
 //void printEx(int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt, ...);
 //int printRect(int x, int y, int w, int h, const wchar_t *fmt, ...);
 //void hline(int x,int y, int l, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT);
 //void vline(int x,int y, int l, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT);
 //void printFrame(int x,int y,int w,int h, boolean clear=true, TCOD_bkgnd_flag_t flag = TCOD_BKGND_DEFAULT, String fmt=NULL, ...);
-//int getWidth() const;
-//int getHeight() const;
-//TCODColor getDefaultBackground() const;
-//TCODColor getDefaultForeground() const;
 //TCODColor getCharBackground(int x, int y) const;
 //TCODColor getCharForeground(int x, int y) const;
 //int getChar(int x, int y) const;
-//static void setFade(uint8 fade, const TCODColor &fadingColor);
-//static uint8 getFade();
-//static TCODColor getFadingColor();
-//static void flush();
-//static TCOD_key_t waitForKeypress(boolean flush);
-//static TCOD_key_t checkForKeypress(int flags=TCOD_KEY_RELEASED);
-//static boolean isKeyPressed(TCOD_keycode_t key);
-//static void setKeyboardRepeat(int initialDelay,int interval);
-//static void disableKeyboardRepeat();
-//TCODConsole(int w, int h);
-//TCODConsole(String filename);
 //boolean loadAsc(String filename);
 //boolean loadApf(String filename);
 //boolean saveAsc(String filename) const;