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.


Messages - miki151

Pages: 1 [2]
16
Graphics / Re: Visual glitches and flickering when drawing sprites
« on: April 13, 2015, 03:14:40 pm »
One other player had a similar glitch, and he said that also Minecraft wasn't working well for him, until he updated his drivers, at which point Minecraft was working ok, and the glitch in my game went from the map area into the menus. Btw, you can see in the screenshots that here the glitch only appears in the map area, which uses same sized sprites from about 5-6 different textures. The same sprites are also used in the menus on the right, but there they aren't glitching.

Similar glitches have been reported in a version of the game with unicode graphics, screenshot below.

The player says he updated his video drivers. I asked him about any error messages.

I use SFML 2.2. I'm not sure about using the master branch for production.

Thanks for your help :)


17
Graphics / Visual glitches and flickering when drawing sprites
« on: April 13, 2015, 02:54:54 pm »
A player has sent me screenshots of a visual glitch in my game. The first screenshot is what the game normally looks like. The glitches reportedly flicker very quickly.

The bug is pretty rare, probably no more than 1 in 200 players experience it. It seems to be related to having a dual video card setup. I asked the player to manually switch to his GTX 980 card, we'll see if that helps. Meanwhile, if anyone has any clue on how to resolve this, I would gladly hear it.

Michal




18
Graphics / Small max texture size on a fairly modern system
« on: April 10, 2015, 06:45:22 pm »
A user has reported a problem:
Quote
Failed to create texture, it's internal size is too high (2048x2048, maximum is 1024x1024)

His system is actually pretty modern, it seems weird that it can't load bigger textures. Any chance this is actually some kind of bug?

Quote
------------------
System Information
------------------
Operating System: Windows 7 Home Premium 64-bit (6.1, Build 7601) Service Pack 1 (7601.win7sp1_gdr.150202-1526)
Processor: Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz (4 CPUs), ~2.3GHz
Memory: 6144MB RAM

---------------
Display Devices
---------------
Card name: Mobile Intel(R) HD Graphics
Manufacturer: ATI Technologies Inc.
Chip type: Intel(R) HD Graphics Family
DAC type: Internal
Display Memory: 4095 MB
Dedicated Memory: 2092 MB
Shared Memory: 2003 MB
Current Mode: 1600 x 900 (32 bit) (60Hz)

19
Graphics / Re: Possible reasons for a garbled font?
« on: February 08, 2015, 09:45:32 am »
I made the switch to 2.2 recently.

I just realized that while I only call drawText from the rendering thread, I call getTextLength from two different threads. Could this be the reason?

20
Graphics / Re: Possible reasons for a garbled font?
« on: February 08, 2015, 09:22:41 am »
No, I'm quite sure I don't reload it anywhere. I don't think I'll be able to narrow it to a minimal example, as the bug got triggered by a seemingly innocent commit (moving some classes around), and the code base is pretty big.

Is it possible to set some breakpoints or something inside sfml to see what might be breaking?

Btw, here's how I use the font:


int Renderer::getTextLength(string s) {
  Text t(toUnicode(s), textFont, textSize);
  return t.getLocalBounds().width;
}

void Renderer::drawText(FontId id, int size, Color color, int x, int y, String s, bool center) {
  int ox = 0;
  int oy = 0;
  Text t(s, getFont(id), size);
  if (center) {
    sf::FloatRect bounds = t.getLocalBounds();
    ox -= bounds.left + bounds.width / 2;
  }
  t.setPosition(x + ox, y + oy);
  t.setColor(color);
  renderList.push_back(
      [this, t] { display->draw(t); });
}

String Renderer::toUnicode(const string& s) {
  std::basic_string<sf::Uint32> utf32;
  sf::Utf8::toUtf32(s.begin(), s.end(), std::back_inserter(utf32));
  return utf32;
}

Font& Renderer::getFont(Renderer::FontId id) {
  switch (id) {
    case Renderer::TEXT_FONT: return textFont;
    case Renderer::TILE_FONT: return tileFont;
    case Renderer::SYMBOL_FONT: return symbolFont;
  }
}

 

21
Graphics / Possible reasons for a garbled font?
« on: February 08, 2015, 12:00:30 am »
I've run into a very annoying problem with text rendering. Once every few runs of the program, it looks like this:


The way it should look like:


The second screenshot is actually from the same run, except the font was enlarged by one point (it scales with window size). This hints that only one specific size gets corrupted. Sometimes only a single letter or number is corrupted, and the rest of the font looks good. Sometimes the letter is only of a wrong size.

I checked the usual stuff, sf::Font is created inside of main(), and passed around by reference. I'm running the program with valgrind, but it doesn't detect any memory corruption. The problem occurs with different fonts, on both Linux and Windows, 32bit and 64bit, although in slightly different variations.

Any hint on how to tackle this would be greatly appreciated!

22
Window / Mouse wheel unusable on Mac
« on: January 26, 2015, 09:15:06 pm »
Mouse scrolling is very sensitive on Mac, merely touching the wheel or touchpad causes an event to be generated with non-zero delta.

I realize this is because OSX has a different scrolling mechanism. Is there any way around this?

23
Audio / Re: Music::~Music sometimes hangs
« on: April 28, 2014, 04:26:38 pm »
It worked, thanks!

24
Audio / Re: Music::~Music sometimes hangs
« on: April 28, 2014, 01:13:18 pm »
Ok I switched to return instead of exit() and it didn't help. Any other ideas?

25
Audio / Re: Music::~Music sometimes hangs
« on: April 28, 2014, 12:55:27 pm »
Note that sf::Music itself is not a global variable, it's on the heap.

26
Audio / Music::~Music sometimes hangs
« on: April 28, 2014, 12:05:15 pm »
I'm using SFML 2.1 and my program sometimes hangs when I call exit(0). A stack trace reveals:

#0  0xf7fdb430 in __kernel_vsyscall ()
#1  0xf7cc3e1c in pthread_join () from /lib/i386-linux-gnu/libpthread.so.0
#2  0xf7f753ab in sf::priv::ThreadImpl::wait() () from ./libsfml-system.so.2
#3  0xf7f743c8 in sf::Thread::wait() () from ./libsfml-system.so.2
#4  0xf7fd3f92 in sf::SoundStream::stop() () from ./libsfml-audio.so.2
#5  0xf7fcedf1 in sf::Music::~Music() () from ./libsfml-audio.so.2


I also get this error on start-up:
AL lib: pulseaudio.c:331: PulseAudio returned minreq > tlength/2; expect break up

This is a class that I use to handle music. Maybe I'm doing something wrong with the fact that it's a global variable. Jukebox::initialize is called from main().

#include <SFML/Audio/Music.hpp>

class Jukebox {
  public:
  enum Type { INTRO, PEACEFUL, BATTLE };
  void initialize(const string& introPath, const string& peacefulPath, const string& warPath);

  void setCurrent(Type);
  void toggle();
  void update();

  private:
  bool turnedOff();
  sf::Music& get(Type);
  unique_ptr<sf::Music[]> music;
  Type current = INTRO;
  Type currentPlaying;
  bool on = true;
};

extern Jukebox jukebox;
 

#include "music.h"

using sf::Music;

Jukebox jukebox;

void Jukebox::initialize(const string& introPath, const string& peacefulPath, const string& warPath) {
  music.reset(new Music[3]);
  music[0].openFromFile(introPath);
  music[1].openFromFile(peacefulPath);
  music[2].openFromFile(warPath);
  music[1].setLoop(true);
  music[2].setLoop(true);
  currentPlaying = current;
  if (!turnedOff())
    get(current).play();
  else
    on = false;
}

bool Jukebox::turnedOff() {
  return !Options::getValue(OptionId::MUSIC);
}

sf::Music& Jukebox::get(Type type) {
  return music[int(type)];
}

void Jukebox::toggle() {
  if ((on = !on)) {
    currentPlaying = current;
    get(current).play();
  } else
    get(current).stop();
}

void Jukebox::setCurrent(Type c) {
  if (current != INTRO)
    current = c;
}

const int volumeDec = 20;

void Jukebox::update() {
  if (turnedOff())
    return;
  if (currentPlaying == INTRO && music[0].getStatus() == sf::SoundSource::Stopped) {
    currentPlaying = current = PEACEFUL;
    get(current).play();
  }
  if (current != currentPlaying) {
    if (get(currentPlaying).getVolume() == 0) {
      get(currentPlaying).stop();
      currentPlaying = current;
      get(currentPlaying).setVolume(100);
      get(currentPlaying).play();
    } else
      get(currentPlaying).setVolume(max(0.0f, get(currentPlaying).getVolume() - volumeDec));
  }
}

27
Window / Re: Crash after failed inotify_init() call (Linux, SFML 2.1)
« on: August 05, 2013, 08:48:59 am »
It's because of too many open files. I'm not sure why this is happening, but it seems to be a common problem on Ubuntu.

Thanks for the quick reply.

28
Window / Crash after failed inotify_init() call (Linux, SFML 2.1)
« on: August 05, 2013, 08:17:57 am »
Everything was working fine, when my game started crashing as follows (without recompiling):

Failed to initialize inotify, joystick connections and disconnections won't be notified
*** buffer overflow detected ***: /home/michal/zagadka/zagadka terminated
======= Backtrace: =========
[...]

Gdb shows this:
#0  0x00007ffff6ee6425 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff6ee9b8b in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007ffff6f2439e in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3  0x00007ffff6fba817 in __fortify_fail () from /lib/x86_64-linux-gnu/libc.so.6
#4  0x00007ffff6fb9710 in __chk_fail () from /lib/x86_64-linux-gnu/libc.so.6
#5  0x00007ffff6fba7ce in __fdelt_warn () from /lib/x86_64-linux-gnu/libc.so.6
#6  0x00007ffff7996b61 in (anonymous namespace)::canRead(int) () from /usr/local/lib/libsfml-window.so.2
#7  0x00007ffff7996f98 in sf::priv::JoystickImpl::isConnected(unsigned int) () from /usr/local/lib/libsfml-window.so.2
#8  0x00007ffff7992541 in sf::priv::JoystickManager::update() () from /usr/local/lib/libsfml-window.so.2
#9  0x00007ffff79955ff in sf::priv::WindowImpl::WindowImpl() () from /usr/local/lib/libsfml-window.so.2
#10 0x00007ffff799926c in sf::priv::WindowImplX11::WindowImplX11(sf::VideoMode, sf::String const&, unsigned long, sf::ContextSettings const&) ()
   from /usr/local/lib/libsfml-window.so.2
#11 0x00007ffff79942cf in sf::priv::WindowImpl::create(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&) ()
   from /usr/local/lib/libsfml-window.so.2
#12 0x00007ffff7993e6a in sf::Window::create(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&) ()
   from /usr/local/lib/libsfml-window.so.2
#13 0x00007ffff7bc6881 in sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&) ()
   from /usr/local/lib/libsfml-graphics.so.2

Apparently joystick (which I'm not using) was not initialized correctly, but something tried to use it anyway. This is the line that fails (Linux/JoystickImpl.cpp):
114:  if (canRead(notifyFd))     // notifyFd is negative here

It would be great to be able to turn this functionality off altogether, so people don't get bogus crashes when playing my game.

29
Window / Re: Shift + numpad keys
« on: August 04, 2013, 07:15:16 pm »
Ubuntu & SFML 2.1

30
Window / Shift + numpad keys
« on: August 04, 2013, 06:25:12 pm »
Hello,

I'm porting my game from another library to SFML. I was using a shift + numpad arrows combination for specific movement commands, but in SFML they don't produce the right event (which should be Keyboard::NumpadX with the shift modifier I think). I've temporarily switched to using the control key, but it would be great to use shift.

Pages: 1 [2]