]> git.vomp.tv Git - vompclient.git/commitdiff
Move interpol tables inside Surface class
authorChris Tallon <chris@vomp.tv>
Thu, 21 May 2020 17:07:59 +0000 (18:07 +0100)
committerChris Tallon <chris@vomp.tv>
Thu, 21 May 2020 17:07:59 +0000 (18:07 +0100)
surface.cc
surface.h

index 3322a871c33b827950f4374a4d141b78e8fa26eb..9c17aa848f15220a5bca08b7758d649be8dfe6da 100644 (file)
 #include "teletxt/txtfont.h"
 #include "staticartwork.h"
 
-unsigned int interpol_table_fac1[16][22];
-unsigned int interpol_table_fac2[16][22];
-unsigned int interpol_table_fac3[16][22];
-unsigned int interpol_table_fac4[16][22];
-int interpol_lowbit[16];
-int interpol_upbit[16];
-int interpol_lowline[22];
-int interpol_upline[22];
-bool pol_table_inited=false;
-
-void initpol_tables(){
+Surface* Surface::screen = NULL;
+
+#ifndef GRADIENT_DRAWING
+osd_font_t* Surface::font = &font_helvB18;
+#endif
+
+Surface::Surface(int id)
+{
+  if (id == SCREEN) screen = this;
+}
+
+Surface::~Surface()
+{
+}
+
+Surface* Surface::getScreen()
+{
+  return screen;
+}
+
+void Surface::initpol_tables()
+{
     int charsizex;
     int charsizey;
     charsizex=16;
@@ -68,31 +79,10 @@ void initpol_tables(){
             interpol_table_fac2[px][py]=(unsigned int)(xinvweight*yweight*256.);
             interpol_table_fac3[px][py]=(unsigned int)(xweight*yinvweight*256.);
             interpol_table_fac4[px][py]=(unsigned int)(xinvweight*yinvweight*256.);
-
         }
     }
 }
 
-
-Surface* Surface::screen = NULL;
-#ifndef GRADIENT_DRAWING
-osd_font_t* Surface::font = &font_helvB18;
-#endif
-
-Surface::Surface(int id)
-{
-  if (id == SCREEN) screen = this;
-}
-
-Surface::~Surface()
-{
-}
-
-Surface* Surface::getScreen()
-{
-  return screen;
-}
-
 int Surface::drawText(const char* text, int x, int y, const DrawStyle& c)
 {
   return drawText(text, x, y, 2000, c);
index ac75917a4fbce703ce23272418f7e457aaef2c5c..b0effd36a60c20c2528944362b99b25c69b86f06 100644 (file)
--- a/surface.h
+++ b/surface.h
@@ -29,6 +29,7 @@
 #ifndef GRADIENT_DRAWING
 // Font stuff
 
+// FIXME does anything use this anymore?
 typedef struct bogl_font {
   char *name;     /* Font name. */
   int height;     /* Height in pixels. */
@@ -114,6 +115,17 @@ public:
     virtual void drawPixel(int x, int y, unsigned int c, bool fastdraw=false)=0; // deprecated preparation for vector based drawing, only allowed to be called inside implementation
     virtual void drawPixel(int x, int y, Colour& c, bool fastdraw=false)=0; // deprecated preparation for vector based drawing, only allowed to be called inside implementation
 
+  private:
+    void initpol_tables();
+    unsigned int interpol_table_fac1[16][22];
+    unsigned int interpol_table_fac2[16][22];
+    unsigned int interpol_table_fac3[16][22];
+    unsigned int interpol_table_fac4[16][22];
+    int interpol_lowbit[16];
+    int interpol_upbit[16];
+    int interpol_lowline[22];
+    int interpol_upline[22];
+    bool pol_table_inited=false;
 };
 
 #endif