]> git.vomp.tv Git - vompclient.git/commitdiff
Efficiency, code cleanup
authorChris Tallon <chris@vomp.tv>
Sun, 6 Jan 2013 15:32:40 +0000 (15:32 +0000)
committerChris Tallon <chris@vomp.tv>
Sun, 6 Jan 2013 15:32:40 +0000 (15:32 +0000)
wwss.cc

diff --git a/wwss.cc b/wwss.cc
index ef9793b554d5f90a20ac56813611ff106f11f615..2f9cc9ca7feb2af22b0fa609fa38b9a9ff3820bb 100644 (file)
--- a/wwss.cc
+++ b/wwss.cc
@@ -62,7 +62,7 @@ void Wwss::setWide(bool twide)
 void Wwss::draw()
 {
   if (format == Video::PAL) drawPAL();
-//  else if (format == Video::NTSC) drawNTSC();
+  //  else if (format == Video::NTSC) drawNTSC();
 }
 
 void Wwss::drawPAL()
@@ -117,24 +117,25 @@ void Wwss::drawPAL()
   Colour c;
   UINT value;
 
+  Surface* mysurface = getSurface();
   for(UINT q = 0; q < Nd; q++)
   {
     value = (UINT)(dst[q] * 182); // Apparently this is a better number than 255 for the colour value
     c.set(value, value, value);
-    getSurface()->drawPixel(q, 6, c);
+    mysurface->drawPixel(q, 6, c);
   }
 }
 
 void Wwss::drawNTSC()
 {
-/*
+  /*
   static UCHAR startCode[] = {1,0,0,0,0,0,0};
   static UCHAR aspect43[]  = {0};
   static UCHAR aspect169[] = {1};
   static UCHAR theRest[]   = {0,0,0,0,0,0,0,0};
   static UCHAR crc43[]     = {0,0,0,0,0,0};
   static UCHAR crc169[]    = {0,0,1,1,0,0};
-*/
+  */
   /*
   Real NTSC pixel frequency: 13.5 MHz
   WSS bit frequency: 447.443125 kHz
@@ -149,22 +150,22 @@ void Wwss::drawNTSC()
 
   const UINT   Ns = 22;            // Num pix src
   const UINT   Nd = 664;           // Num pix dst
-//  const UINT   Nd = 518;           // Num pix dst
+  //  const UINT   Nd = 518;           // Num pix dst
   UINT         Nl = lcm(Ns, Nd);   // Num pix in lcm
   UINT         Ss = Nl / Ns;       // Source split (how many lcm px = 1 src px)
   UINT         Sd = Nl / Nd;       // Dst split
-//  UCHAR src[Ns];
+  //  UCHAR src[Ns];
 
-/*
+  /*
   memcpy(&src[0], startCode, 7);
   if (wide) memcpy(&src[7], aspect169, 1);
   else      memcpy(&src[7], aspect43, 1);
   memcpy(&src[8], theRest, 8);
   if (wide) memcpy(&src[16], crc169, 6);
   else      memcpy(&src[16], crc43, 6);
-*/
+  */
 
-static UCHAR src[22] = {1,0, 0,0,0,0,1,1, 0,0,0,0, 0,0,0,0, 0,0,1,0,0,1 };
+  static UCHAR src[22] = {1,0, 0,0,0,0,1,1, 0,0,0,0, 0,0,0,0, 0,0,1,0,0,1 };
 
 
   float dst[Nd];
@@ -183,31 +184,30 @@ static UCHAR src[22] = {1,0, 0,0,0,0,1,1, 0,0,0,0, 0,0,0,0, 0,0,1,0,0,1 };
   Colour c;
   UINT value;
 
-// This one is the real one
-/*
+  // This one is the real one
+  /*
+  Surface* mysurface = getSurface();
   for(UINT q = 0; q < Nd; q++)
   {
     value = (UINT)(dst[q] * 182); // Apparently this is a better number than 255 for the colour value
     c.set(value, value, value);
-    getSurface()->drawPixel(q, 6, c);
+    mysurface->drawPixel(q, 6, c);
   }
-*/
+  */
 
-// This one is testing active
-for(int yy = 0; yy < 100; yy++)
-{
-  for(UINT q = 0; q < Nd; q++)
+  // This one is testing active
+  Surface* mysurface = getSurface();
+  for(int yy = 0; yy < 100; yy++)
   {
-    value = (UINT)(dst[q] * 182); // Apparently this is a better number than 255 for the colour value
-    c.set(value, value, value);
-    getSurface()->drawPixel(q+0, yy, c);
+    for(UINT q = 0; q < Nd; q++)
+    {
+      value = (UINT)(dst[q] * 182); // Apparently this is a better number than 255 for the colour value
+      c.set(value, value, value);
+      mysurface->drawPixel(q+0, yy, c);
+    }
   }
 }
 
-
-
-}
-
 /*
 x6 + x + 1