Exception cleanup. Code cleanup.
This commit is contained in:
@@ -19,7 +19,7 @@ namespace Cryville.Crtr.Components {
|
||||
private set;
|
||||
}
|
||||
public Rect Rect {
|
||||
get { return Frame.frame; }
|
||||
get { return Frame.Frame; }
|
||||
}
|
||||
/// <summary>
|
||||
/// The ratio of width divided by height.
|
||||
|
@@ -63,13 +63,13 @@ namespace Cryville.Crtr.Components {
|
||||
case 1: x = _border.x; bx = b.x; break;
|
||||
case 2: x = _border.y; bx = b.y; break;
|
||||
case 3: x = 1; bx = 1; break;
|
||||
default: throw new Exception();
|
||||
default: throw new NotSupportedException("Built-in resource corrupted");
|
||||
}
|
||||
float y;
|
||||
switch ((int)muv[i].y) {
|
||||
case 0: y = 0; break;
|
||||
case 3: y = 1; break;
|
||||
default: throw new Exception();
|
||||
default: throw new NotSupportedException("Built-in resource corrupted");
|
||||
}
|
||||
uv[i] = frameInfo.Frame.GetUV(x, y);
|
||||
bx -= 0.5f; y -= 0.5f;
|
||||
|
@@ -79,7 +79,7 @@ namespace Cryville.Crtr.Components {
|
||||
foreach (var f in m_frames) {
|
||||
f.Value.Load();
|
||||
if (frameHeight == 0) frameHeight = f.Value.Rect.height;
|
||||
else if (frameHeight != f.Value.Rect.height) throw new Exception("Inconsistent frame height");
|
||||
else if (frameHeight != f.Value.Rect.height) throw new Exception("Inconsistent frame height for text component");
|
||||
var tex = f.Value.Frame.Texture;
|
||||
if (!meshes.ContainsKey(tex)) {
|
||||
var m = new MeshWrapper();
|
||||
|
Reference in New Issue
Block a user