Commits

Anonymous committed 5b6ada7

Fixed PD texture load problem

  • Participants
  • Parent commits 9c0fd34

Comments (0)

Files changed (2)

File src/Main.cpp

 
 #endif
 
+#endif
 
-
-#endif
   //angrylion's advice to use ul_s in texture image offset and cnt calculations.
   //Helps to fix Vigilante 8 jpeg backgrounds and logos
   wxUint32 offs = rdp.timg.addr + (ul_s << rdp.tiles[tile].size >> 1);
-  // wxUIntPtr dst = wxPtrToUInt(rdp.tmem)+(rdp.tiles[tile].t_mem<<3);
   int * pDst = (int *) (wxPtrToUInt(rdp.tmem)+(rdp.tiles[tile].t_mem<<3));
   wxUint32 cnt = lr_s-ul_s+1;
   if (rdp.tiles[tile].size == 3)
     cnt <<= 1;
 
-  // wxUIntPtr SwapMethod = wxPtrToUInt(reinterpret_cast<void*>(SwapBlock32));
+  rdp.timg.addr += cnt << 3;
+  rdp.tiles[tile].lr_t = ul_t + ((dxt*cnt)>>11);
+
 
   if (rdp.timg.size == 3)
     LoadBlock32b(tile, ul_s, ul_t, lr_s, dxt);
     }
   }
   
-  rdp.timg.addr += cnt << 3;
-  rdp.tiles[tile].lr_t = ul_t + ((dxt*cnt)>>11);
-
   rdp.update |= UPDATE_TEXTURE;
 
   FRDP ("loadblock: tile: %d, ul_s: %d, ul_t: %d, lr_s: %d, dxt: %08lx -> %08lx\n",
     setTBufTex(rdp.tiles[tile].t_mem, cnt);
 }
 
-// void LoadTile32b (wxUint32 tile, wxUint32 ul_s, wxUint32 ul_t, wxUint32 width, wxUint32 height);
 static void rdp_loadtile()
 {
   if (rdp.skip_drawing)