FES 1.5.0 to RetroBlit 2.0.0 Porting Guide
There has been a number of changes in RetroBlit 2.0 from the previous version. If you plan on porting your project from an older version then this guide
should help ease the porting work. Before doing any porting make sure you make a backup of your project, or use source control software (eg. git or svn).
Follow these steps to get started:
-
Create a new dummy project and get the RetroBlit asset for it from the Asset Store
-
Go back to your original project and delete Assets/FES and replace with Assets/RetroBlit from the dummy project
- Replace:
-
Search and Replace these strings in your entire project:
- FES → RB
- Size2i → Vector2i
- ColorRGBA → Color32
- RetroBlit no longer supports indexed color mode. If your previous project was using indexed color mode then consider creating a color lookup table and using it in place of color indecies, for example:
using UnityEngine;
public class Pal
{
public static Color32[] C;
public static string[] S;
public static void Initialize()
{
C = new Color32[256];
C[0] = new Color32(0, 0, 0, 255);
C[1] = new Color32(254, 255, 255, 255);
C[2] = new Color32(46, 41, 40, 255);
C[3] = new Color32(226, 0, 0, 255);
C[4] = new Color32(224, 33, 34, 255);
S = new string[256];
for (int i = 0; i < C.Length; i++)
{
S[i] = "@" + C[i].r.ToString("X2") + C[i].g.ToString("X2") + C[i].b.ToString("X2");
}
System.GC.Collect();
}
} |
Now you can use your color palette like this:
|