Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Not showing everything on some computers  (Read 2883 times)

0 Members and 1 Guest are viewing this topic.

Voroz

  • Full Member
  • ***
  • Posts: 128
    • View Profile
Not showing everything on some computers
« on: March 25, 2010, 05:37:17 pm »
This is how it should look, and looks on my computer:


This is how it looks for another guy who tested it:


Any idea what is causing it?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Not showing everything on some computers
« Reply #1 on: March 25, 2010, 06:33:38 pm »
Can you show the code?
Laurent Gomila - SFML developer

Voroz

  • Full Member
  • ***
  • Posts: 128
    • View Profile
Not showing everything on some computers
« Reply #2 on: March 25, 2010, 11:04:49 pm »
i can post how i draw things, but most of that shouldn't matter much for what is happening on one computer right? Maybe something in the window settings though?

Code: [Select]
sf::WindowSettings Settings;
Settings.DepthBits         = 24; // Request a 24 bits depth buffer
Settings.StencilBits       = 8;  // Request a 8 bits stencil buffer
Settings.AntialiasingLevel = 0;  // Request 2 levels of antialiasing

//Create the Window
sf::RenderWindow App(sf::VideoMode(1280, 1024, 32), "SFML Game", sf::Style::Fullscreen, Settings);

//Vertical sync
App.UseVerticalSync(true);

//Load Images
sf::Image Image[8];

//smoothing
for (int i=0; i<8; i++){
Image[i].SetSmooth(true);
}

if (!Image[0].LoadFromFile("Background.png"))
    return 0;
sf::Sprite Background;
Background.SetImage(Image[0]);

if (!Image[1].LoadFromFile("InventoryBag.png"))
    return 0;
sf::Sprite InventoryBag;
InventoryBag.SetImage(Image[1]);

if (!Image[2].LoadFromFile("Character.png"))
    return 0;
sf::Sprite Character;
Character.SetImage(Image[2]);

//Change this
int numberOfIcons = 16;
if (!Image[3].LoadFromFile("InventoryIcons.png"))
    return 0;
sf::Sprite InventoryIcon[numberOfIcons];
for (int i = 0; i<numberOfIcons; i++){
InventoryIcon[i].SetImage(Image[3]);
}

if (!Image[4].LoadFromFile("WorldIcons.png"))
    return 0;
sf::Sprite WorldIcon[numberOfIcons];
for (int i = 0; i<numberOfIcons; i++){
WorldIcon[i].SetImage(Image[4]);
}

if (!Image[5].LoadFromFile("Tree.png"))
    return 0;
sf::Sprite Tree[11];
for (int i = 0; i<11; i++){
Tree[i].SetImage(Image[5]);
}

int numberOfTrees = 11;
if (!Image[6].LoadFromFile("Tree shadow.png"))
    return 0;
sf::Sprite TreeShadow[numberOfTrees];
for (int i = 0; i<numberOfTrees; i++){
TreeShadow[i].SetImage(Image[6]);
}

if (!Image[7].LoadFromFile("Cursor.png"))
    return 0;
sf::Sprite Cursor[2];
Cursor[0].SetImage(Image[7]);
Cursor[1].SetImage(Image[7]);
Cursor[0].SetSubRect(sf::IntRect(0,0,18,24));
Cursor[1].SetSubRect(sf::IntRect(18,0,49,24));
App.ShowMouseCursor(false);




//Background
App.Draw(Background);

for (int i=numberOfTrees - 1; i>=0; i--){
    App.Draw(TreeShadow[i]);
if (character.y >= Tree[i].GetPosition().y)
    App.Draw(Tree[i]);
}
//Draw icons in the world
for(int i=0; i<numberOfIcons; i++){
if (worldIcon[i].pickedUp == false && character.y >= WorldIcon[i].GetPosition().y + WorldIcon[i].GetSize().y)
    App.Draw(WorldIcon[i]);
}


//Character
App.Draw(Character);


for (int i=numberOfTrees - 1; i>=0; i--){
if (character.y < Tree[i].GetPosition().y)
    App.Draw(Tree[i]);
}
//Draw icons in the world
for(int i=0; i<numberOfIcons; i++){
if (worldIcon[i].pickedUp == false && character.y < WorldIcon[i].GetPosition().y + WorldIcon[i].GetSize().y)
    App.Draw(WorldIcon[i]);
}


if (inventory == true){
    //Inventory
    App.Draw(InventoryBag);
    //Icons in slots
    for (int i = 0; i<16; i++){
        if (slot[i].itemNumber != -1)
                App.Draw(InventoryIcon[slot[i].itemNumber]);
    }
//Draw Icon Text
if (slotMousePos != -1 && slot[slotMousePos].itemNumber != -1)
App.Draw(inventoryIcon[slot[slotMousePos].itemNumber].text);
}

//Icons on mouse
if (itemOnMouse != -1)
App.Draw(InventoryIcon[itemOnMouse]);

if (worldIconMousePos == -1 && inventoryIconMousePos == -1)
App.Draw(Cursor[0]);
else
App.Draw(Cursor[1]);

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Not showing everything on some computers
« Reply #3 on: March 25, 2010, 11:27:03 pm »
You should try SFML 1.6 (retrieve it from the SVN repository, or wait for the official release in a few days), there's a bug fix for a similar issue.
Laurent Gomila - SFML developer

Voroz

  • Full Member
  • ***
  • Posts: 128
    • View Profile
Not showing everything on some computers
« Reply #4 on: March 26, 2010, 02:03:43 am »
ok thanks. Do i need to change much to use it, or is it similar?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Not showing everything on some computers
« Reply #5 on: March 26, 2010, 07:25:10 am »
Nothing changes, this is just a bug fix release ;)
Laurent Gomila - SFML developer