Dear community,
I'm writing an application that has to load a lot of 'HI-RES' textures in (1280x800), 35 of them at the moment. This is an application that has to work on a windows 7 tablet and I have noticed it takes a quite a long time to load in all of them (aprox. 30 to 60 seconds).
I just want to know if this is normal and if not, what is the best way to load in textures (at the moment I am loading all of them in a separate thread while showing a loading screen in the main one). At the end I place all textures into a Vector, which allocated to the right size (maybe this is slowing things down, but I don't think so as I tried putting the vector code in comments);
An example:
void ThreadLoading::loadGame(){
t_All_Textures.clear();
s_All_Sprites.clear();
t_All_Textures.reserve(35);
s_All_Sprites.reserve(2);
//TEXTURES
//Global background
t_pPlayBackground.loadFromFile(".//Resources//PlayScreen//background.png");
//Status ribbons (Available,owned and sold)
t_pStatusAvailable.loadFromFile(".//Resources//PlayScreen//available.png");
t_pStatusOwned.loadFromFile(".//Resources//PlayScreen//owned.png");
t_pStatusSold.loadFromFile(".//Resources//PlayScreen//sold.png");
t_pStatusFree.loadFromFile(".//Resources//PlayScreen//available.png");
//Normal property/chance/community chest backgrounds
t_pProperty0.loadFromFile(".//Resources//PlayScreen//0.png");
t_pProperty1.loadFromFile(".//Resources//PlayScreen//1.png");
t_pProperty2.loadFromFile(".//Resources//PlayScreen//2.png");
t_pProperty3.loadFromFile(".//Resources//PlayScreen//3.png");
t_pProperty4.loadFromFile(".//Resources//PlayScreen//4.png");
t_pProperty5.loadFromFile(".//Resources//PlayScreen//5.png");
t_pProperty6.loadFromFile(".//Resources//PlayScreen//6.png");
t_pProperty7.loadFromFile(".//Resources//PlayScreen//7.png");
t_pProperty8.loadFromFile(".//Resources//PlayScreen//8.png");
t_pProperty9.loadFromFile(".//Resources//PlayScreen//9.png");
t_pProperty10.loadFromFile(".//Resources//PlayScreen//10.png");
//Buy backgrounds
t_pProperty1_buy.loadFromFile(".//Resources//PlayScreen//1b.png");
t_pProperty3_buy.loadFromFile(".//Resources//PlayScreen//3b.png");
t_pProperty5_buy.loadFromFile(".//Resources//PlayScreen//5b.png");
t_pProperty6_buy.loadFromFile(".//Resources//PlayScreen//6b.png");
t_pProperty8_buy.loadFromFile(".//Resources//PlayScreen//8b.png");
t_pProperty9_buy.loadFromFile(".//Resources//PlayScreen//9b.png");
//Buyerror backgrounds
t_pProperty1_buyError.loadFromFile(".//Resources//PlayScreen//1eb.png");
t_pProperty3_buyError.loadFromFile(".//Resources//PlayScreen//3eb.png");
t_pProperty5_buyError.loadFromFile(".//Resources//PlayScreen//5eb.png");
t_pProperty6_buyError.loadFromFile(".//Resources//PlayScreen//6eb.png");
t_pProperty8_buyError.loadFromFile(".//Resources//PlayScreen//8eb.png");
t_pProperty9_buyError.loadFromFile(".//Resources//PlayScreen//9eb.png");
//Playermenu background, different colours for each player
t_pPlayerMenu1.loadFromFile(".//Resources//PlayScreen//playermenu1.png");
t_pPlayerMenu2.loadFromFile(".//Resources//PlayScreen//playermenu2.png");
t_pPlayerMenu3.loadFromFile(".//Resources//PlayScreen//playermenu3.png");
t_pPlayerMenu4.loadFromFile(".//Resources//PlayScreen//playermenu4.png");
//Player pawns
t_pPlayerPawnCar.loadFromFile(".//Resources//PlayScreen//car.png");
t_pPlayerPawnIron.loadFromFile(".//Resources//PlayScreen//iron.png");
t_pPlayerPawnHat.loadFromFile(".//Resources//PlayScreen//hat.png");
t_pPlayerPawnBarrow.loadFromFile(".//Resources//PlayScreen//barrow.png");
....
Best regards
Yannick