Fix reading + saving to db. Added first (test) logo.
This commit is contained in:
1 parent
bfb5ff3a04
commit
90d059b893
3 files changed
+16
-6
No files matched your search
Binary file not shown.
@@ -28,6 +28,7 @@ namespace Vocaluxe.Base
|
|||||||
InitHighscoreDB();
|
InitHighscoreDB();
|
||||||
InitCoverDB();
|
InitCoverDB();
|
||||||
InitCreditsRessourcesDB();
|
InitCreditsRessourcesDB();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Highscores
|
#region Highscores
|
||||||
@@ -617,12 +618,12 @@ namespace Vocaluxe.Base
|
|||||||
#endregion Cover
|
#endregion Cover
|
||||||
|
|
||||||
#region CreditsRessources
|
#region CreditsRessources
|
||||||
public static bool GetCreditsRessource(string FileName, ref STexture tex, int MaxSize)
|
public static bool GetCreditsRessource(string FileName, ref STexture tex)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
SQLiteConnection connection = new SQLiteConnection();
|
SQLiteConnection connection = new SQLiteConnection();
|
||||||
connection.ConnectionString = "Data Source=" + _CoverFilePath;
|
connection.ConnectionString = "Data Source=" + _CreditsRessourcesFilePath;
|
||||||
SQLiteCommand command;
|
SQLiteCommand command;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -686,6 +687,7 @@ namespace Vocaluxe.Base
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//If you want to add an image to db, call this method!
|
||||||
private static bool AddImageToCreditsDB(String ImagePath)
|
private static bool AddImageToCreditsDB(String ImagePath)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
@@ -751,11 +753,11 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
command.CommandText = "INSERT INTO Images (Path, width, height) " +
|
command.CommandText = "INSERT INTO Images (Path, width, height) " +
|
||||||
"VALUES (@path, " + w.ToString() + ", " + h.ToString() + ")";
|
"VALUES (@path, " + w.ToString() + ", " + h.ToString() + ")";
|
||||||
command.Parameters.Add("@path", System.Data.DbType.String, 0).Value = ImagePath;
|
command.Parameters.Add("@path", System.Data.DbType.String, 0).Value = Path.GetFileName(ImagePath);
|
||||||
command.ExecuteNonQuery();
|
command.ExecuteNonQuery();
|
||||||
|
|
||||||
command.CommandText = "SELECT id FROM Images WHERE [Path] = @path";
|
command.CommandText = "SELECT id FROM Images WHERE [Path] = @path";
|
||||||
command.Parameters.Add("@path", System.Data.DbType.String, 0).Value = ImagePath;
|
command.Parameters.Add("@path", System.Data.DbType.String, 0).Value = Path.GetFileName(ImagePath);
|
||||||
reader = null;
|
reader = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -873,7 +875,7 @@ namespace Vocaluxe.Base
|
|||||||
command.ExecuteNonQuery();
|
command.ExecuteNonQuery();
|
||||||
|
|
||||||
command.CommandText = "CREATE TABLE IF NOT EXISTS ImageData ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, " +
|
command.CommandText = "CREATE TABLE IF NOT EXISTS ImageData ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, " +
|
||||||
"CoverID INTEGER NOT NULL, Data BLOB NOT NULL);";
|
"ImageID INTEGER NOT NULL, Data BLOB NOT NULL);";
|
||||||
command.ExecuteNonQuery();
|
command.ExecuteNonQuery();
|
||||||
|
|
||||||
command.Dispose();
|
command.Dispose();
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ namespace Vocaluxe.Screens
|
|||||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||||
const int ScreenVersion = 1;
|
const int ScreenVersion = 1;
|
||||||
|
|
||||||
|
private CStatic logo;
|
||||||
|
|
||||||
public CScreenCredits()
|
public CScreenCredits()
|
||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
@@ -27,6 +29,11 @@ namespace Vocaluxe.Screens
|
|||||||
|
|
||||||
_ThemeName = "ScreenCredits";
|
_ThemeName = "ScreenCredits";
|
||||||
_ScreenVersion = ScreenVersion;
|
_ScreenVersion = ScreenVersion;
|
||||||
|
|
||||||
|
STexture tex = new STexture();
|
||||||
|
CDataBase.GetCreditsRessource("Logo.png", ref tex);
|
||||||
|
|
||||||
|
logo = new CStatic(tex, new SColorF(1,1,1,1), new SRectF(140,140,tex.width, tex.height, -1));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool HandleInput(KeyEvent KeyEvent)
|
public override bool HandleInput(KeyEvent KeyEvent)
|
||||||
@@ -89,7 +96,8 @@ namespace Vocaluxe.Screens
|
|||||||
base.Draw();
|
base.Draw();
|
||||||
|
|
||||||
//Draw white background
|
//Draw white background
|
||||||
CDraw.DrawColor(new SColorF(1, 1, 1, 1), new SRectF(0, 0, 1280, 720, 1));
|
CDraw.DrawColor(new SColorF(1, 1, 1, 1), new SRectF(0, 0, 1280, 720, 0));
|
||||||
|
logo.Draw();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user