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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - ingwik

Pages: 1 [2]
16
General / Ok in debug mode but error in release (w7, 1.6 and vc 2010)
« on: October 07, 2011, 09:31:12 pm »
Environment
Windows 7 Enterprise 64
SFML 1.6
Visual C++ 2010 Express

When I installed SFML in vc2010 I have followed all instructions in this video:

and made everything work in debug mode and have had some joy in making games for some weeks now.

Today, when I tried to build my first project in release mode, something went wrong.
I get the error:
Code: [Select]
cannot open input file 'sfml-system-s.lib'

It's not that odd I suppose, since all sfml-<name>-s.lib vas deleted in the process of creating a 2010 express install from the 2008 express files, all according to the install video on Youtube.

Under the heading Linker - Additional Dependencies. In debug mode I have:
Code: [Select]
sfml-system-s-d.lib
sfml-window-s-d.lib
sfml-graphics-s-d.lib
sfml-audio-s-d.lib


And in release mode I have:

Code: [Select]
sfml-system-s.lib
sfml-window-s.lib
sfml-graphics-s.lib
sfml-audio-s.lib


but when I take a peek in my 2010 lib which is linked through heading:
Linker-Additional Library Directories C:\sfml16\SFML-1.6\lib\vc2010;%(AdditionalLibraryDirectories)

I do find the sfml-<name>-s-d.lib
 and sfml-<name>-d.lib, but no sfml-<name>-s.lib.

Any idea where things have gone wrong? I have tried to change Heading Linker EnableIncrementalLinking to no avail.

PS.
Under heading C/C++-General I have AdditionalIncludeDirectories C:\sfml16\SFML-1.6\include;%(AdditionalIncludeDirectories)
if that can be of any help.

17
Graphics / Wwedish vowels in sf::Event::TextEntered, problem
« on: October 07, 2011, 01:02:30 pm »
Environment
VC++ 2010 Express
Windows 7 enterprise 64
SFML 1.6

I have a simple hangman game going on, but I've run into a nasty problem. In Sweden, we have three vowels not used in the english language, but could be called Å/AO, Ä/AE and Ö/OE.
I have changed VC++ to use swedish language by adding

        locale swedish("swedish");
        locale::global(swedish);

in the main code.

The wovels are placed on the keyboard as key 1 (Ö) and 2 (Ä) right of "L" and the (Å) key above those two.

If I write this code, I'll get the swedish wovels, but all other keys appear too.

Code: [Select]
if (Event.Type == sf::Event::KeyPressed)
 {
 if ( Event.Type == sf::Event::TextEntered )
        cout << "Char= " << (char)Event.Text.Unicode <<endl;  
 }




If I use this code instead to sort the other keys away, I won't get the swedish vowels

Code: [Select]
if (Event.Type == sf::Event::KeyPressed)
 {
     if ( Event.Text.Unicode < 0x80 ) // it's printable
           {

 if ( Event.Type == sf::Event::TextEntered )
                         
        cout << "Char= " << (char)Event.Text.Unicode <<endl;    
           }
}


I assume the "Unicode < 0x80" is the culprit to the behaviour. I just can't figure out what to write instead. Is there a solution to this problem?

18
Graphics / Animation only animates on stand still (solved)
« on: September 23, 2011, 11:34:54 am »
I have made a simple project with the class anisprite, more or less direct copied from the wiki:
http://www.sfml-dev.org/wiki/en/sources/anisprite

I need just a simple way to animate sprites, and that class seemed sufficient for my needs. The problem is that when everything is in place, the figure (boy with green hair) is animated when he is standing still. As soon as I try to move him by code or by key down, he moves but the animation stops. I suppose I can use the class still for explosions and such that aren't moving, but the idea to have animated sprites that move seems more tempting. If anyone has a solution to the problem, I would be grateful.

Environment:
SFML 1.6
Windows 7 Enterprise 64
Microsoft VC++ 2010 express

The code in main.cpp this far, the comment are in swedish since I intended to show the code for teenagers that want to create simple games, but I assume it can be read quite easy anyway by the pros in here :) The AniSprite header and cpp-file are more or less unchanged.
-------------------

Code: [Select]

#include <iostream>
#include <SFML\System.hpp>
#include <SFML\Graphics.hpp>
#include <SFML\Window.hpp>
#include <AniSprite.h> //länk saknas i originaldokumentet


  int main()
    {  //Början av programkörningen

sf::RenderWindow App(sf::VideoMode(800, 600, 32), "Test - animation");

float pojkfart = 0.05f; //hastigheten när pojken flyttar sig
                               
 // Ladda in in sprite-karta, en uppsättning bilder som skall visas i sekvens
  sf::Image pojkkarta;
   if (!pojkkarta.LoadFromFile("character.png"))
        return EXIT_FAILURE;
  AniSprite Spritepojk(pojkkarta,47,64); //storleken på varje enskild bild
   Spritepojk.SetLoopSpeed(12); //12 fps
    Spritepojk.Play(0,1); //Visa första och andra bilden enbart, får inte vara 0,0
      Spritepojk.SetPosition(200.f, 200.f); //Placera ut bilden

while(App.IsOpened())
{
        sf::Event Event;

       
while (App.GetEvent(Event)) // Ta hand om händelser
   { //while 2

      if (Event.Type == sf::Event::Closed) //kryssat på [x] symbolen? stäng programmet
         App.Close();

      if (Event.Type == sf::Event::KeyPressed) // En tangent har tryckts ner

             { //if 1

               if (Event.Key.Code == sf::Key::Escape) // ESC tangenten = stäng programmet
                    App.Close();

              } //slut if 1

  } //slut, while 2


if (App.GetInput().IsKeyDown(sf::Key::Left))
         {
          Spritepojk.Move(-pojkfart, 0);
     Spritepojk.Play(12,15);
   } //Visa nedersta raden, pojken går åt vänster

else if (App.GetInput().IsKeyDown(sf::Key::Right))
         {
          Spritepojk.Move( pojkfart, 0);
      Spritepojk.Play(4,7); //Visa andra raden, pojken går åt höger
    }
else if (App.GetInput().IsKeyDown(sf::Key::Up))
        {
        Spritepojk.Move(0, -pojkfart);
   Spritepojk.Play(0,3); //Visa första raden, man ser ryggen på pojken
   }
else if (App.GetInput().IsKeyDown(sf::Key::Down))
        {
        Spritepojk.Move(0, pojkfart);
   Spritepojk.Play(8,11); //Visa tredje raden, man ser ansiktet på pojken
   }

// Rensa skärmen
    App.Clear();        
//updatera animation
    Spritepojk.Update();
    App.Draw(Spritepojk);
    App.Display();
}

return 0;
} //slut på programkörningen

Pages: 1 [2]
anything