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

Author Topic: Selba Ward  (Read 33958 times)

0 Members and 1 Guest are viewing this topic.

Hapax

  • Hero Member
  • *****
  • Posts: 2775
  • My number of posts is shown in hexadecimal.
    • View Profile
Re: Selba Ward
« Reply #75 on: July 01, 2016, 07:51:10 pm »
Major update of Console Screen
Console has been updated to version 2!
Some new features:
  • Streaming replaces printing and reading methods and a lot of other things can be streamed (e.g. cs << "Some text.";),
  • Now uses actual palettes - if a palette colour is changed then all cells set to that colour will also change,
  • Stack printing allows cells to be stacked on top - and below - the main cells (buffers can paste onto stacks too),
  • Cursor commands can be mapped to characters to greatly simplify input (e.g. using \n in a string - cs << "These\nwords\nwould\nall\nbe\non\nseparate\nlines.";),
  • Screen fill - similar to clear but replaces all cells with the given cell.

View the Change Log.

I've also started to create tutorials for using Selba Ward drawables. So far, the only drawable that has a tutorial is Console Screen and it is designed to get you started with using it. More Console Screen tutorials will follow that will introduce other features and more Selba Ward tutorials will follow to introduce you to the other drawables.

View the Selba Ward tutorials.

I'm also working on a small, demo/animation to kind of show some (all?) of the drawables in action. Created some music for it already  :)
« Last Edit: July 01, 2016, 07:53:08 pm by Hapax »
Selba Ward - SFML drawables
Kairos - Timing Library
Rectangular Boundary Collision - Rectangular SAT Collision

@Hapaxiation - Hapaxia on Twitter

Hapax

  • Hero Member
  • *****
  • Posts: 2775
  • My number of posts is shown in hexadecimal.
    • View Profile
Re: Selba Ward
« Reply #76 on: July 29, 2016, 10:37:02 pm »
Updates!

New Drawable!
Gallery Sprite
(wiki)
A sprite class that also stores texture rectangles so a single texture section can be recalled by a single value. Useful for spritesheets - even irregular ones!
Note that if you also use Plinth, you can pair this with Plinth's Frame Sequence to simplify frame animation (they were actually originally created to be used together). Eeach frame can have separate settings - including duration - and can use exhibits in any order as well as use them more than once.

Each texture rectangle also has an accompanying 'anchor' point by which the sprite is offset automatically. The texture rectangle and anchor are stored in a struct called "Exhibit" and this is the name given to an individual sprite 'frame' (hence the name Gallery Sprite).

Changing the exhibit can be done by specifying a specific exhibit or by adding or subtracting values from the object itself which offsets the exhibit number.

Console Screen (wiki) (change log)
The colours in the palette can now be 'cycled' e.g. colour-cycling. This can affect the entire palette or just a range of the colours and can be cycled in either direction.

Scrolling can now be restrained to a specified rectangular region instead of only being able to scroll the entire screen.

Console Screen can now inform you of the "perfect size" - the recommended size, in pixels, of the screen so that it would display the texture at its exact original size.

Starfield (wiki)
The colour of the stars can now be altered without having to regenerate the entire starfield.

Line (wiki)
When a thick line is used, it can now be textured.

Bitmap Text (wiki)
The local and global bounds are now available.



Selba Ward Demo Animation 2016
Still working on this demo animation that is intended to show the drawables in action.
All visuals in the demo are Selba Ward drawables and all resources used in the demo are/will be created by myself.
When it's ready, there will be available a full video of the animation.
For now though, here's a screenshot of the opening section (yes, this is Console Screen):

Hopefully, the animation will be finished soon otherwise it might need to be changed to 2017! ;D
Selba Ward - SFML drawables
Kairos - Timing Library
Rectangular Boundary Collision - Rectangular SAT Collision

@Hapaxiation - Hapaxia on Twitter

Elias Daler

  • Hero Member
  • *****
  • Posts: 587
    • View Profile
    • Blog
    • Email
Re: Selba Ward
« Reply #77 on: July 31, 2016, 01:16:28 pm »
Great job! Really looking forward to the demo. :)
And I think I'll try some things in your lib for fun, maybe I'll use them in my game or maybe I'll just learn some cool stuff that I'll shamelessly steal will inspire me to rewrite some of my own graphics code.
Tomb Painter, Re:creation dev | eliasdaler.github.io | @EliasDaler | Tomb Painter dev log

Tigre Pablito

  • Full Member
  • ***
  • Posts: 207
    • View Profile
    • Email
Re: Selba Ward
« Reply #78 on: August 08, 2016, 02:31:25 am »
Hi Hapax,

Is it posible to use Selba Ward in C#.Net  projects? Or will it be?

Thanks

Hapax

  • Hero Member
  • *****
  • Posts: 2775
  • My number of posts is shown in hexadecimal.
    • View Profile
Re: Selba Ward
« Reply #79 on: August 08, 2016, 11:00:23 am »
Great job! Really looking forward to the demo. :)
Thank you!

And I think I'll try some things in your lib for fun, maybe I'll use them in my game or maybe I'll just learn some cool stuff that I'll shamelessly steal will inspire me to rewrite some of my own graphics code.
Would be much better if you just used them, especially if you provided feedback so that they might improve. :P

Hi Hapax,
Is it posible to use Selba Ward in C#.Net  projects? Or will it be?
Hi.
Selba Ward is a collection of open source, cross-platform SFML-based C++ drawables and is, therefore, not going to be much use with C# unless anyone is interested in converting or binding it as I have very little experience with C# myself.
Selba Ward - SFML drawables
Kairos - Timing Library
Rectangular Boundary Collision - Rectangular SAT Collision

@Hapaxiation - Hapaxia on Twitter

Elias Daler

  • Hero Member
  • *****
  • Posts: 587
    • View Profile
    • Blog
    • Email
Re: Selba Ward
« Reply #80 on: August 08, 2016, 08:58:03 pm »
Would be much better if you just used them, especially if you provided feedback so that they might improve. :P
My game doesn't have much graphics stuff going on (and probably won't ever have....?), just some tiles, animation and simple shaders. So there's not much I need but I see how useful it can be for other people. :D
Tomb Painter, Re:creation dev | eliasdaler.github.io | @EliasDaler | Tomb Painter dev log

EllareMezzo

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Selba Ward
« Reply #81 on: October 01, 2016, 11:57:34 am »
Hi. Got a strange issue with a SelbaWard, can anyone help me?
When compiled for release I got some strange linking issue:
./Release/application.cpp.o:application.cpp:(.text+0x30b7): undefined reference to `selbaward::Line::isThick() const'
Compiler is MinGW (i686-posix-dwarf) with -O2 -std=c++11 -Wall -DNDEBUG under Windows.
With some vodoo I found that problem arose when compiling with any of -O keys and it's bothering me. I can't afford myself to compile without optimization, 'cause it's quite big project with massive calculations that should work on rusty toasters, my customer be damned.
So, any bright ideas? Excuse my english, not native.

Hapax

  • Hero Member
  • *****
  • Posts: 2775
  • My number of posts is shown in hexadecimal.
    • View Profile
Re: Selba Ward
« Reply #82 on: October 04, 2016, 05:35:11 pm »
Hi, EllareMezzo.

Thank you for your interest in Selba Ward.

Selba Ward's Line has been patched. Will you try the latest version and post here your results? If you are still having trouble, the problem will be investigated further.

Hapaxia.
Selba Ward - SFML drawables
Kairos - Timing Library
Rectangular Boundary Collision - Rectangular SAT Collision

@Hapaxiation - Hapaxia on Twitter

EllareMezzo

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Selba Ward
« Reply #83 on: October 12, 2016, 09:28:39 am »
Hi and thank you for your attention to your project, Hapaxia.

Issue already been solved by a hack on my side, just had a quick glance at your fix - you did the same thing with removing inline. So I'm sure it's right assumption you had there. Now it's linking allright. Kinda strange that no one had this problem before though, may be it was specific to MinGW. I'm gonna try my project with another compilers when it's over and post here if I'm to find anything else.

Thank you again for your work on SelbaWard, it's irreplaceable addition to SFML.

EllareMezzo

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Selba Ward
« Reply #84 on: October 13, 2016, 10:08:47 am »
Feels bad to bother you again with questions, Hapaxia, but can I ask with what compiler and what os in mind did you designed SelbaWard?

Just had multiply issues with ambiguous call to overloaded function with abs call somewhere in Sprite3d, in short it's all like in that SO question:
http://stackoverflow.com/questions/30084577/ambiguous-call-to-abs

Not sure if it's SelbaWard issue, though, it can be some interference from my side, still can't allow myself enough time to do proper testing due to work, sorry. Right now just hacked some more #include <cstdlib> in every .cpp that have had this issue, it's Line, PieChart, Ring, SpinningCard, Spline, Sprite3d and may be somewhere else I forgot, gonna clean up later. But I think you might be interested in knowing about that issue.

I'm still promise: just after I getting my things done on that week I'm gonna do some real testing to help you with your brilliant work on Selba Ward =)

Hapax

  • Hero Member
  • *****
  • Posts: 2775
  • My number of posts is shown in hexadecimal.
    • View Profile
Re: Selba Ward
« Reply #85 on: October 18, 2016, 12:52:44 pm »
Hi and thank you for your attention to your project, Hapaxia.
[...]
Thank you again for your work on SelbaWard, it's irreplaceable addition to SFML.
You're welcome and I am glad you enjoy it! :)

Kinda strange that no one had this problem before though, may be it was specific to MinGW.
It's an odd thing as inline was being used to inline within the translation unit as it's a private method but since it's declaration is public in the header, it doesn't like it. This is part of the reason I've started to use more anonymous/unnamed namespaces in cpp files instead of private method where possible.

Feels bad to bother you again with questions, Hapaxia, but can I ask with what compiler and what os in mind did you designed SelbaWard?
No worries. The more people inform me of things that can be done better, the better they can be done. I use Visual Studio 2015 (now) but developed most of Selba Ward using 2013. I don't have chance to test on others compilers, however, so feedback is essential to correct issues on other ones. I do aim to keep as generically C++ compatible as possible but all compilers have their quirks.

Just had multiply issues with ambiguous call to overloaded function with abs call somewhere in Sprite3d, in short it's all like in that SO question:
http://stackoverflow.com/questions/30084577/ambiguous-call-to-abs

Not sure if it's SelbaWard issue, though
When changing to VS 2015, I noticed that this problem appeared in my Plinth library, which should now be fixed by always using an internal abs function. As mentioned above, though, Selba Ward was mostly developed using VS 2013 and this abs thing didn't show up then and I haven't seen the problem arise yet. I'll consider options and fix it when I can. Thanks for the link.

I'm still promise: just after I getting my things done on that week I'm gonna do some real testing to help you with your brilliant work on Selba Ward =)
Test away! Let me know how it goes :D
Selba Ward - SFML drawables
Kairos - Timing Library
Rectangular Boundary Collision - Rectangular SAT Collision

@Hapaxiation - Hapaxia on Twitter

Hapax

  • Hero Member
  • *****
  • Posts: 2775
  • My number of posts is shown in hexadecimal.
    • View Profile
Re: Selba Ward
« Reply #86 on: November 04, 2016, 12:00:02 am »
every .cpp that have had this issue, it's Line, PieChart, Ring, SpinningCard, Spline, Sprite3d
I have patched all of these (except SpinningCard as it's old and is only included for completeness; I'll maybe tidy it up at some point or just remove it since Sprite3D is its successor) and hopefully will now no longer cause the error you were receiving.
Selba Ward - SFML drawables
Kairos - Timing Library
Rectangular Boundary Collision - Rectangular SAT Collision

@Hapaxiation - Hapaxia on Twitter

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 9324
    • View Profile
    • development blog
    • Email
Re: Selba Ward
« Reply #87 on: November 05, 2016, 01:31:30 pm »
What have you used to compile the code for the ConsoleScreen, because I seem to be getting a bunch of errors.

enum class Direction;
enum class Palette;
enum ColorCommand;
enum Direct;

The last two declarations give me errors (error: use of enum 'ColorCommand' without previous declaration). So I switch the deceleration and definition to enum class instead. (See also: http://stackoverflow.com/questions/71416/forward-declaring-an-enum-in-c)

void ConsoleScreen::clear(const ColorCommand backgroundColorCommand)
{
clear(priv_getModifiedColorFromColorPairUsingSpecifiedColorType({ m_cursorPrintProperties.colors.foreground, backgroundColorCommand }, ColorType::Background));
}
I guess this might be an issue because I switched to enum class which can't be implicitly converted to integer?
(The brace-enclosed values get interpreted as initialization-list which then of course don't match the function signature and it fails to compile. The priv function takes a ColorPair and the ColorPair takes two Colors, yet the code is trying to pass a ColorCommand, is that implicitly convertible to Color?)

I don't have time right now to further investigate, but maybe I'm just approaching this all wrong anyways?

I'm using MinGW-w64 (x64) with -std=c++14.
« Last Edit: November 05, 2016, 01:39:13 pm by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
——————————————————————
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/

Hapax

  • Hero Member
  • *****
  • Posts: 2775
  • My number of posts is shown in hexadecimal.
    • View Profile
Re: Selba Ward
« Reply #88 on: November 05, 2016, 08:45:44 pm »
Thanks for trying this out, eXpl0it3r. I will get this thing to work for everyone :-\

I'm using VS 2015 and the code doesn't result in any errors.
Console Screen only forward declares the enums which values aren't used until the source and the definition is still including in the header (they're at the bottom).
I guess VS allows this because it doesn't need to know the values or underlying storage, just that that particular enum will be passed as a parameter. Still, if others don't allow this, I can move the definitions inline or maybe just include the storage type (enum ColorCommand : int;). Is VS wrong here? The post you linked is unfortunately very old.

I'll modify it to use the (newer) storage type version. See if that works any better. I'll be uploading the newest updates with it so it'll be 2.2 ;)


Color can be created from a ColorCommand, yes, and is implicitly convertible. Color is basically an integer value: a positive value is a palette index whereas a negative value represents a command. ColorCommand is an enum with only negative values.
Selba Ward - SFML drawables
Kairos - Timing Library
Rectangular Boundary Collision - Rectangular SAT Collision

@Hapaxiation - Hapaxia on Twitter

Hapax

  • Hero Member
  • *****
  • Posts: 2775
  • My number of posts is shown in hexadecimal.
    • View Profile
Re: Selba Ward
« Reply #89 on: November 06, 2016, 01:28:05 pm »
Updates!

Console Screen (wiki) (change log)
v2.2.0
A single character can now be streamed directly without first requiring a string being constructed from it.

Buffers can now be added and resized as well as have their cells manipulated directly.

A few fixes since v2.1 including adding storage types to forward-declared enums

Global
Removed inline from multiple source files when declaration is in a header.

Fixed some function calls being ambiguous.

Selba Ward Demo Animation
I haven't had much time to work on this recently but I did create a small walking animation to be used for it so I thought I'd share that for you lovely people ;D
Selba Ward - SFML drawables
Kairos - Timing Library
Rectangular Boundary Collision - Rectangular SAT Collision

@Hapaxiation - Hapaxia on Twitter