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

Pages: [1]
1
General / Re: Attempting to reference a deleted function
« on: October 08, 2019, 05:25:25 pm »
Nevermind, I've just noticed I had a stray reference to Sprite I put accidentally. Instead of
sf::Sprite sprite;
I had
sf::Sprite& sprite;

The code works now that I've removed it. Thanks Laurent

2
General / Re: Attempting to reference a deleted function
« on: October 08, 2019, 05:12:11 pm »
Thanks for the quick reply Laurent

Now that I put it in, IntelliSense is telling me that
"at::Effect::Effect()" provides no initializer for:
reference member  "at::effect::sprite"
   

No matter if I put it after
sf::Sprite sprite
or before it

3
General / Attempting to reference a deleted function
« on: October 08, 2019, 03:02:25 pm »
I've created a namespace for my game, and inside it a class with sf::Texture and sf::Sprite inside.

The code looks like this:

Classes.h

namespace at
{
        class Effect
        {
        public:

                int rotation = 0;

                std::string currentAnimation = "";

                sf::Vector2f position = sf::Vector2f(0.0f, 0.0f);

                sf::Texture texture;

                sf::Sprite sprite;

                thor::AnimationMap<sf::Sprite, std::string> aMap;

                thor::Animator<sf::Sprite, std::string> animator;
        };
}

Globals.h

extern at::Effect fireballGlow;

Globals.cpp

at::Effect fireballGlow;

Now I created an at::Effect in order to store a fireball glow inside. But when I try to build it VS throws
Error C2280 'at::Effect::Effect(void)': attempting to reference a deleted function
when I declare the glow in Globals.cpp.

I need an idea what's wrong here. I never call a missing function. I don't even have a void in that class, in fact.

4
Oh, I've just noticed that half the code didn't get through properly. I said later in the part that didn't go through that neither the updating particle system nor setting the particle position works, unless I re-add the emitter.
When I run the .setParticlePosition or .updateParticleSystem I'd need to add the emitter again in order for it to actually update.

As I said, the work-around is to add the emitter again (in my case for 0.006 seconds) and add the emitter each frame, clearing emitters before and then update.

Right now I'm working on rebuilding the whole code, so I'll keep the thread updated if I find a solution, but the workaround is really imperfect.

5
I don't know if you saw, but I've said that I used setParticlePosition, but in order for that to work, I'd need to add an Emitter again, because, for some reason, it wouldn't update it when I run the function on its own.

I worked it around by adding an emitter every frame for 0.006 seconds with emission rate 100, but it's not a good solution and I know it.

6
I want to enable particles on a fireball, but the fireball's position is dynamically changing via a Vector2f position, to which the Sprite position is adjusted. Basically I've got a Vector2f fireball.position and then I'm using sprFireball.setPosition(fireball.position). It's for convenience only.

But to the point. I've got a ParticleSystem and most basic Emitter properties declared outside the game loop, but as the fireball's position is changing in the game loop, I need to somehow move the Emitter's particle position to that of the fireball. I've looked up Bromeon's tutorial on Particles and Connections, but that didn't help in my case. I was toying around with it for the past 2 hours or so and can't find a solution.

I'll try to minimize the code and put it below

        thor::ParticleSystem fireballParticleSystem;
        //adding textures

        thor::UniversalEmitter fireballEmitter;
        //setting properties

        fireballParticleSystem.addEmitter(fireballEmitter);
        // adding the emitter for the first time

        sf::Clock fireballFrameTime;
        // for emitter updates      

        // window and isOpen,

        { // game loop

       

        // setting the position of the fireball, its rotation, moving it and using the fireball.position to store the
           position
       
           

        }

     
 

7
General / Re: [Thor] Animator class constructor
« on: September 18, 2019, 12:16:00 am »
Well, I got that working after a few attempts, but now I'm facing another issue I described here https://stackoverflow.com/questions/57980768/thoranimator-playing-only-one-frame

Basically Animator plays only one frame, but if you can take a look there, since I'm sure you have way more experience than me, I'd be really grateful

Thanks for developing SFML by the way, I could learn much stuff because of it

8
General / Re: [Thor] Animator class constructor
« on: September 17, 2019, 04:58:01 pm »
As I said, I'm using Thor 2.0, the one from http://www.bromeon.ch/libraries/thor/download/index.html, under latest release.

Edit. well, as soon as Bromeon replied to my email it turns out Thor is now in 2.1, along with new documentation, so that's my bad. Now the question is, is the "latest release", which is said to be 2.0, actually 2.1?

9
Okay, after trying for a bit, I'll just assume I'm doing something wrong while making debug libraries.

I'll ask a simple question, answer for which may or may not be so simple - in order to create debug libraries, do I need to change only CMAKE_BUILD_TYPE to Debug, or do I need to do something else? I can't seem to make them work, even though they generate as -d.

I'll attach a picture of CMake with settings I use

10
I believe OpenGL libs are linked by NuGet automatically, because I don't have them under input.

I'll rebuild both SFML and Thor again for Debug and get back with news.

By the way, does building for debug differ anyhow from buiding for release, other than changing the cmake option from Release to Debug in configuration?

11
General / [Thor] Animator class constructor
« on: September 17, 2019, 02:28:45 pm »
I'm using newly-built Thor 2.0 in VS2019 Community.

Yesterday I've encountered a problem, which I sadly cannot resolve myself

I was trying to animate an sf::Sprite, using thor::Animator class, referring to a guide on Bromeon's website under http://www.bromeon.ch/libraries/thor/tutorials/v2.0/animations.html

The problem is, even when copying that code into my VS, it automatically underlines the code red and says I'm missing default constructor (as in attachment 1).

In attachment 2 the code is literally copied.
I'm including <Thor/Animations/Animator.hpp> and overall <Thor/Animations.hpp> and have Thor linked both under release and debug versions, with and without -d respectively.

12
I got to it, it says it succeeds, but console's output is the same as before
Now I'll try to fix most of the warnings, but still the release version works fine.

edit. now that I've noticed this part
2\freeglut.lib "sfml-window-d.lib" "sfml-main-d.lib" "sfml-graphics-d.lib" "sfml-audio-d.lib" "sfml-system-d.lib" "thor-d.lib" openal32.lib ogg.lib freetype.lib flac.lib vorbis.lib vorbisenc.lib vorbisfile.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
I'm wondering what sfml's libraries in quotes mean.

1>------ Rebuild All started: Project: Ripoff, Configuration: Debug Win32 ------
1>Microsoft (R) C/C++ Optimizing Compiler Version 19.22.27905 for x86
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>cl /c /IC:\Users\Shadow\source\repos\Ripoff\packages\nupengl.core.0.1.0.1\build\native\../..//build/native/include/ /I"C:\Users\Shadow\Documents\C++ libs\SFML\include" /I"C:\Users\Shadow\Documents\C++ libs\Thor\include" /ZI /JMC /W3 /WX- /diagnostics:column /sdl /Od /Oy- /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /permissive- /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc142.pdb" /Gd /TP /analyze- /FC /errorReport:prompt Animations.cpp Main.cpp Cameraworks.cpp Utilities.cpp
1>Animations.cpp
1>Main.cpp
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Animations.cpp(11,20): warning C4018:  '<': signed/unsigned mismatch
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Main.cpp(385,183): warning C4244:  'argument': conversion from 'double' to 'T', possible loss of data
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Main.cpp(385,183): warning C4244:         with
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Main.cpp(385,183): warning C4244:         [
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Main.cpp(385,183): warning C4244:             T=float
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Main.cpp(385,183): warning C4244:         ]
1>Cameraworks.cpp
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Main.cpp(384,183): warning C4244:  'argument': conversion from 'double' to 'T', possible loss of data
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Main.cpp(384,183): warning C4244:         with
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Main.cpp(384,183): warning C4244:         [
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Main.cpp(384,183): warning C4244:             T=float
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Main.cpp(384,183): warning C4244:         ]
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(68,19): warning C4018:  '>': signed/unsigned mismatch
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(70,18): warning C4018:  '<': signed/unsigned mismatch
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(75,18): warning C4018:  '>': signed/unsigned mismatch
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(81,19): warning C4018:  '>': signed/unsigned mismatch
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(83,18): warning C4018:  '<': signed/unsigned mismatch
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(88,18): warning C4018:  '>': signed/unsigned mismatch
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,110): warning C4244:  'argument': conversion from 'T' to 'T', possible loss of data
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,110): warning C4244:         with
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,110): warning C4244:         [
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,110): warning C4244:             T=float
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,110): warning C4244:         ]
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,110): warning C4244:         and
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,110): warning C4244:         [
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,110): warning C4244:             T=int
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,110): warning C4244:         ]
1>Utilities.cpp
1>Generating Code...
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,63): warning C4244:  'argument': conversion from 'T' to 'T', possible loss of data
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,63): warning C4244:         with
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,63): warning C4244:         [
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,63): warning C4244:             T=float
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,63): warning C4244:         ]
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,63): warning C4244:         and
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,63): warning C4244:         [
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,63): warning C4244:             T=int
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,63): warning C4244:         ]
1>Microsoft (R) Incremental Linker Version 14.22.27905.0
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>
1>"/OUT:C:\Users\Shadow\source\repos\Ripoff\Debug\Ripoff.exe" /INCREMENTAL "/LIBPATH:C:\Users\Shadow\Documents\C++ libs\SFML\libs" "/LIBPATH:C:\Users\Shadow\Documents\C++ libs\Thor\libs" C:\Users\Shadow\source\repos\Ripoff\packages\nupengl.core.0.1.0.1\build\native\../..//build/native/lib/Win32\glew32.lib C:\Users\Shadow\source\repos\Ripoff\packages\nupengl.core.0.1.0.1\build\native\../..//build/native/lib/Win32\glfw3dll.lib C:\Users\Shadow\source\repos\Ripoff\packages\nupengl.core.0.1.0.1\build\native\../..//build/native/lib/Win32\freeglut.lib "sfml-window-d.lib" "sfml-main-d.lib" "sfml-graphics-d.lib" "sfml-audio-d.lib" "sfml-system-d.lib" "thor-d.lib" openal32.lib ogg.lib freetype.lib flac.lib vorbis.lib vorbisenc.lib vorbisfile.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST "/MANIFESTUAC:level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG:FASTLINK "/PDB:C:\Users\Shadow\source\repos\Ripoff\Debug\Ripoff.pdb" /TLBID:1 /DYNAMICBASE /NXCOMPAT "/IMPLIB:C:\Users\Shadow\source\repos\Ripoff\Debug\Ripoff.lib" /MACHINE:X86 Debug\Animations.obj
1>Debug\Main.obj
1>Debug\Cameraworks.obj
1>Debug\Utilities.obj
1>Ripoff.vcxproj -> C:\Users\Shadow\source\repos\Ripoff\Debug\Ripoff.exe
1>Done building project "Ripoff.vcxproj".
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

13
I've rebuilt the SFML code, along with Thor's code, to use with VS2019 (Community, to be exact). I used CMake and NMake, referring to the tutorial on the forums.
The thing is, I can't load any textures, the output is buggy. I'll attach screenshots below.
I've got everything linked correctly (at least I think I do). -d libs in debug mode, normal ones in release mode, every path set correctly. I've built everything with CMake for NMake, 32-bit, changing the parameters to Release and Debug respectively.
Everything is working fine in Release mode, textures loading, no weird output.
I'm linking dynamically.
In both debug and release modes there are no missing libs or anything that Visual Studio would notify me of.

Below screenshots of linkers and console output.


Pages: [1]
anything