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 - Fyuchanick

Pages: [1]
1
Audio / Re: Access violation executing location 0x0000000000000000.
« on: September 08, 2018, 02:26:32 pm »
I don't see how my code is not minimal. It is not complete enough to compile, but that would require virtually rewriting it. There are two functions that have the error, which are part of a class which defines the variables, an instance of the class is defined in main, and the functions are run as part of the game loop in main, all of which functions correctly except for the code inside of the functions.

2
Audio / Re: Access violation executing location 0x0000000000000000.
« on: September 01, 2018, 02:21:20 pm »
Did you read the link FRex posted? It describes what a minimal example should be and why.

From the posted code, I can't tell you what's wrong. If had created a minimal examples that I can compile and reproduce the issue locally on my machine, I'd be able to tell you what's wrong with the code and even better, chances are, you'd notice your mistake on your own while creating the minimal example.

0x0000000 etc means you're most likely trying to dereference a null pointer somewhere.

I read the link. It only talked about "maybe you would spot the error yourself." I've written my code in a way that I understand it well enough. I'm not trying to use any pointers in that case, just use soundBuffer. I can maybe see why you might be able to figure something out by running the compiled exe on your computer, but I don't see it as worth the effort of me rewriting my code all over again.

3
Audio / Re: Access violation executing location 0x0000000000000000.
« on: August 31, 2018, 04:33:21 pm »
That's not a minimal example. I can't take that code and compile it.

I don't see why you need to compile it.

4
Audio / Re: Access violation executing location 0x0000000000000000.
« on: August 29, 2018, 08:26:26 pm »
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <iostream>
#include <math.h>
#include <random>
#include <iterator>
using namespace std;
Particle::Particle(string soundEffect) {
   sprite = sf::CircleShape(5.f);
   //positionIterator = 0;
   positions = {};
   movements = {};
   animationPreviousTime = 0;
   durationPreviousTime = 0;
   currentTime = 0;
   animationDelay = 0.01;
   buffer.loadFromFile(soundEffect);
   sound.setBuffer(buffer);
}
void Particle::activate(int startX, int startY, sf::Color color, int amount, float newDuration) {
   if (positions.size() < 100) {
      sprite.setFillColor(color);
      duration = newDuration;
      sound.setBuffer(buffer);
      sound.play();
      createPositions(startX, startY, amount);
      durationPreviousTime = gameClock.getElapsedTime().asSeconds();
   }
}

5
Audio / Re: Access violation executing location 0x0000000000000000.
« on: August 29, 2018, 07:11:04 pm »
What do you mean by minimal example?

6
Audio / Access violation executing location 0x0000000000000000.
« on: August 29, 2018, 06:21:31 pm »
So when I try to play sound using soundBuffer, my game crashes. When I use visual studio's debugger, it gives me this exception:

Exception thrown at 0x0000000000000000 in SFML_Project1.exe: 0xC0000005: Access violation executing location 0x0000000000000000.

I have all the project settings done correctly and have copied the correct files into the correct folder, and there are no syntax errors or runtime errors. Not only that but I also ended up working on this on a different computer for personal reasons (copied using sourcetree + git), and the program runs fine on that computer. I have all my drivers up to date as well. So why does it give me this exception?

7
General / Re: Best way to make tiles not have borders in between them?
« on: August 22, 2017, 12:55:40 am »
This is the code:
//Render tiles
                for (int i = 0; i < blockX.size(); i++) {
                        block.setPosition(float(blockX[i]), float(blockY[i]));
                        if (blockType[i] == "metal") {
                                //if block is metal tile
                                block.setTexture(metalBlockSingle);
                                if (doesBlockExist(blockX[i] + 20, blockY[i])) {
                                        //if block is to right
                                        if (doesBlockExist(blockX[i], blockY[i] + 20)) {
                                                //if block is below
                                                if (doesBlockExist(blockX[i] - 20, blockY[i])) {
                                                        //if block is to left
                                                        if (doesBlockExist(blockX[i], blockY[i] - 20)) {
                                                                //if block is above
                                                                block.setTexture(metalBlockCenter);
                                                        }
                                                        else {
                                                                block.setTexture(metalBlockBottomRightLeft);
                                                        }
                                                }
                                                else if (doesBlockExist(blockX[i], blockY[i] - 20)) {
                                                        //if block is above
                                                        block.setTexture(metalBlockTopBottomRight);
                                                }
                                                else {
                                                        //if block is neither above nor to left
                                                        block.setTexture(metalBlockBottomRight);
                                                }
                                        }
                                        else if (doesBlockExist(blockX[i] - 20, blockY[i])) {
                                                //if block is to left
                                                if (doesBlockExist(blockX[i], blockY[i] - 20)) {
                                                        //if block is above
                                                        block.setTexture(metalBlockTopRightLeft);
                                                }
                                                else {
                                                        block.setTexture(metalBlockRightLeft);
                                                }
                                        }
                                        else if (doesBlockExist(blockX[i], blockY[i] - 20)) {
                                                //if block is above
                                                block.setTexture(metalBlockTopRight);
                                        }
                                        else {
                                                //if block is only right
                                                block.setTexture(metalBlockRight);
                                        }
                                }
                                else if (doesBlockExist(blockX[i], blockY[i] + 20)) {
                                        //if block is below
                                        if (doesBlockExist(blockX[i] - 20, blockY[i])) {
                                                //if block is to left
                                                if (doesBlockExist(blockX[i], blockY[i] - 20)) {
                                                        //if block is above
                                                        block.setTexture(metalBlockTopBottomLeft);
                                                }
                                                else {
                                                        //if block is not above
                                                        block.setTexture(metalBlockBottomLeft);
                                                }
                                        }
                                        else {
                                                //if block is not to left
                                                if (doesBlockExist(blockX[i], blockY[i] - 20)) {
                                                        //if block is above
                                                        block.setTexture(metalBlockTopBottom);
                                                }
                                                else {
                                                        //if metal block is not above
                                                        block.setTexture(metalBlockBottom);
                                                }
                                        }
                                }
                                else if (doesBlockExist(blockX[i] - 20, blockY[i])) {
                                        //if block is to left
                                        if (doesBlockExist(blockX[i], blockY[i] - 20)) {
                                                //if block is above
                                                block.setTexture(metalBlockTopLeft);
                                        }
                                        else {
                                                block.setTexture(metalBlockLeft);
                                        }
                                }
                                else if (doesBlockExist(blockX[i], blockY[i] - 20)) {
                                        //if block is above
                                        block.setTexture(metalBlockTop);
                                }
                        }
                        window.draw(block);
                }

8
General / Best way to make tiles not have borders in between them?
« on: August 21, 2017, 03:37:37 pm »
So I am trying to make a game using SFML and visual c++. Currently I have different sprites without borders on certain sides for every combination of tiles that could be bordering each other, then used nested if statements to check which sprite to use. However, this slows down my game to the point where I can't even play it. Is there a better way to do this?

Pages: [1]