Jump to content
  • Advertisement

Finalspace

Member
  • Content Count

    578
  • Joined

  • Last visited

Everything posted by Finalspace

  1. Finalspace

    What's is the best story game you've played?

    I am 4 years away from 40 and never heard of this But looks very old indeed.
  2. I tested your sound file and i had the issue when playing it with the BASS audio library, which i have no idea what backend they are using. Maybe they use XAudio as well and for some reason, that wave file of yours will break XAudio? But everything else had no issues whatsoever. I also tested several configurations, including my platform abstraction library (FPL), which just uses pure directsound and there was no issue at: https://github.com/f1nalspace/final_game_tech/tree/develop/demos/FPL_Audio (If you want to try that demo out, just pass the full path to the wave file as argument to the executable - after you have compiled it) -> I recommend cloning the repo, so you have all the header files you need. I tested it with a sample rate of 44100 Hz, the formats (S16, S32, F32) and one or two channels. All backends, WASAPI, DirectSound, even WinMM had no sound issue with that configuration at all - and i tested it with a really crap bluetooth audio headset with integrated audio output device O_o Can you please verify that: https://github.com/f1nalspace/final_game_tech/tree/develop/demos/FPL_Audio and https://github.com/f1nalspace/final_game_tech/tree/develop/demos/FPL_MiniAL works or not? I changed the mini_al sample to use DirectSound first and WASAPI second. If nothing of that works, i would recommend creating a very small C/C++ project which just loads your wave file, parses it and plays it back using XAudio - including source, so we may can help you better?
  3. Maybe it uses the wrong or different audio device? Or some wrong format conversions ? Default settings are not always the best! Does the wave file play properly with mini_al.h ? (Mini-al supports WASAPI, which XAudio is based on).
  4. Finalspace

    What's is the best story game you've played?

    I played so many games in my life, but there only two exceptionally games which i can clearly mention and recommend here: Life is Strange I bought LIS as a total random buy on steam many many years ago and it was my very first game of this kind of movie-game genre. Normally i play more action adventures or hardcore jump & run games, but this game for some reason got me... I had no idea what this game was all about, as there was no hype at that time. I simply bought it, installed it and played it and was blown away by it. It was one of such games you start playing and cant stop until you finish it. Really glad that i had not to work on that week then. Really i loved everything about this game, the story, the graphics, the gameplay, even the menu and lastly that great Soundtrack. I dont listen to slower kind of music normally, but this soundtrack man - i really loved it. So what is this game all about? Its that kind of game where your actions and decisions may change the fate of others. Normally such decisisions cannot be reverted, but in Life in Strange you can actually revert it - at least to some extent. But doing so, comes with a a price. That price is so intense and emotional and LIS lets you feel it. So i literaly cried for hours after i finished this game. Of course i bought the soundtrack and the PS4 retail version as well - for no other reason as to lend it to my friends. Beyond Two Souls In 2016, i found a trailer by accident while listening to movie/game soundtracks, while lying sick in bed. That trailer was so fascinating, as it looked similar to Life is Strange, but more darker. So i bought it for PS4, directly on the PSN store for ~40 Euros, which is really expensive for a download-only game. I installed it, started it and that menu... that music... i instantly liked it. After watching the intro, i knew this was the game i was waiting for all those decades. This game is similar to Life is Strange, but is so much darker and intense -> LIS in comparisons feels like a kindergarten. In Beyond Two Souls you cannot revert your decisions. Every decision you made, change the future - whether in a bad, neutral or in a good way. The core elements of that game are horror, violence, mystery and a ton of action. Its like playing a movie, but actually changing the movie - while sitting in a roller coaster. It has an extraordinary emotional soundtrack, very good visuals with good capture of character feelings and a really good story with multiple endings. Of course i bought the soundtrack and the PS4 retail version as well - for no other reason as to lend it to my friends. But its not for everyone -> Some people dont like it, because it is not really a game - but rather a interactive movie. For me its the best game i ever have played, so i bought the soundtrack and the retail version as well - for no other reason as to lend it to my friends. And yes i shed a lot of tears for that game as well.
  5. Finalspace

    SetPixelFormat fails on Nvidia cards

    Damn it, i posted a full fletched text here, but now its gone 😞 Here is the short one: - stencil bits are missing! - use DescribePixelFormat() first and then use SetPixelFormat() See the following code, which works on all my machines: fplClearStruct(&pfd); pfd.nSize = sizeof(pfd); pfd.nVersion = 1; pfd.dwFlags = PFD_DOUBLEBUFFER | PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW; pfd.iPixelType = PFD_TYPE_RGBA; pfd.cColorBits = 32; pfd.cDepthBits = 24; pfd.cAlphaBits = 8; pfd.cStencilBits = 8; pfd.iLayerType = PFD_MAIN_PLANE; int pixelFormat = wapi->gdi.ChoosePixelFormat(deviceContext, &pfd); if(!pixelFormat) { FPL_ERROR(FPL__MODULE_VIDEO_OPENGL, "Failed choosing RGBA Legacy Pixelformat for Color/Depth/Alpha (%d,%d,%d) and DC '%x'", pfd.cColorBits, pfd.cDepthBits, pfd.cAlphaBits, deviceContext); return false; } wapi->gdi.DescribePixelFormat(deviceContext, pixelFormat, sizeof(pfd), &pfd); if(!wapi->gdi.SetPixelFormat(deviceContext, pixelFormat, &pfd)) { FPL_ERROR(FPL__MODULE_VIDEO_OPENGL, "Failed setting RGBA Pixelformat '%d' for Color/Depth/Alpha (%d,%d,%d and DC '%x')", pixelFormat, pfd.cColorBits, pfd.cDepthBits, pfd.cAlphaBits, deviceContext); return false; }
  6. I did a ton of tilebased stuff in the past, so i can share my ideas how i implemented them. So here we go: In a few of my game prototypes i used one texture tile sheet for each style. The outside of such sheets had a one pixel transparent space/border around the entire image and one pixel transparent border around each tile, so that every tile inside has two pixels of space between. This border/space gets really important when you use them in your shaders, like for example doing color corrections, doing blending etc. Without border you may get bleeding or other weird artifacts Also the tile sheet should be a power of two dimension, like for example 256x512 or 256x256 or 512x512, etc. This makes the computing of the UV´s much easier. For environment tiles i used at least 5 layers - each layer had a fixed tile size of 32x32. The first layer was a background layer used for filling background tiles, like gras, sky, etc. The second layer was another background layer used for more detailed backgrounds, like floors, trees, window, flowers, signs, etc. The next two layers was used for solid tiles only, meaning that it had some sort of collision/boundary. Each tile had a reference to a geometrical collision shape (rectangle, circle, polygon, etc). If you need pixel perfect collision, i highly recommend reading the "Sonic Physics Guide". If you need physics in your game, you should convert your solid tiles into connected line segments - making it very robust and fast for physics system such as Box2D. But computing these line segments from solid tiles are nasty and not that easy, but i did that in the past and released a public domain library: https://github.com/f1nalspace/final_game_tech/blob/master/demos/FTT_TileTracingDemo/ftt_tiletracingdemo.cpp https://github.com/f1nalspace/final_game_tech/blob/master/final_tiletrace.hpp The last layer was used for entities placed on tile boundaries, such as start-positions, savepoints, enemies, traps, liquid, etc. If you dont have much experience with programming, i highly recommend using the "TileD" editor which is super easy to use, with a fine and simple file format. Of course if you want, you can always write a editor yourself. Its not that hard and the only thing you need to know how to convert your mouse coordinates inside tile coordinates and vice versa + a sort of camera movement to navigate through your worlds. Of course if you use unity 3d or unreal engine, you should use their built-in tile editor ;) Now regarding rendering. Start of simple and draw each tile in the slowest possible way - make it functional first. You will see that you can draw thousands of tiles, without doing any kind of optimizations. These days, most graphics card can handle that. The only thing i would recommend to optimize are to only show the tiles visible on the screen and skip the tile which are outside. The order of drawing is back-to-front, so you draw the background layers first, then the solid layers and then the entities. Later on you may consider creating a batched sprite render, so you can render all tiles with just a couple of draw calls. Its as simple as a defining a vertex buffer, push vertices on for each tile and then issue a draw call for one tilesheet. So thats a rough idea how i implemented tile based stuff successfully. If you have more questions, feel free to ask.
  7. Finalspace

    Forza Horizon 4

    What do you think about the new Forza Horizon 4 game? I recently bought it for my Windows PC (Ultimate version) and its just awesome! I was never so addicted to any racing game before. The soundtrack is absolutely great, especially the opener from "ODESZA - A moment apart" which just blazed me away, even though i normally prefer much faster and harder music! I guess i needed softer music for a change of pace? Also the graphics looks really good - especially when in "Fall" season mode. I can play it at high detail on my GTX 1060 on my 8086k HDPC without any stutter. So far i hadn´t a single crash since i started playing it, so either i have good hardware or are just lucky (This game has normally a ton of technical issues since launch...). FH3 which i played before on my old system was crashing a lot... My current favorite cars are the Porsche Panamera Turbo tuned to +600KW and the Golf R tuned to +700KW. Both can be handled very well and are not bad for drifting as well. But choosing another car is hard, because there are so many of them.
  8. Finalspace

    Writing subjects in present and past is hard

    Thats neat. Thanks for the tip.
  9. I wanted a class which produces a string which is like: Aquiring, Aquired, Initializing, Initialized, Building, Built, Copy, Copied etc. Just to write "less" code... i thought... why did i do that, i have no idea... maybe because i can??? AddLog(SubjectBuilder.Build("C", false, "file A to B")); AddLog(SubjectBuilder.Build("C", true, "file A to B successfully")); Anyway this is the result: /// <summary> /// Simple class for genering a message using a subject as prefix /// </summary> public static class SubjectBuilder { private static readonly Dictionary<char, string> _subjectLetterMap = new Dictionary<char, string>() { { 'A', "Aquire" }, { 'B', "Build" }, { 'I', "Initialize" }, { 'G', "Generate" }, { 'D', "Destroy" }, { 'M', "Make" }, { 'C', "Copy" }, { 'P', "Publish" } }; class SubjectRule { public bool CurCut { get; set; } = true; public string Cur { get; set; } = "ing"; public bool PastCut { get; set; } = false; public string Past { get; set; } = "d"; } private static readonly Dictionary<char, SubjectRule> _rules = new Dictionary<char, SubjectRule>() { { 'e', new SubjectRule() }, { 'd', new SubjectRule() { CurCut = false, PastCut = true, Past = "t" } }, { 'y', new SubjectRule() { CurCut = false, PastCut = true, Past = "ied" } }, { 'h', new SubjectRule() { CurCut = false, PastCut = false, Past = "ed" } } }; /// <summary> /// Returns a simple string starting with a subject - like create, generate, copy. /// The subject is modified to satisfy the past or current time (creat-ing, creat-ed, etc.) /// </summary> /// <param name="firstLetterOrSubject">Subject or just the first letter of the subject</param> /// <param name="past">Is it now or in the past</param> /// <param name="text">The actual text</param> /// <returns>Builded message startin with the subject</returns> public static string Build(string firstLetterOrSubject, bool past, string text) { StringBuilder s = new StringBuilder(); string subject = null; if (!string.IsNullOrEmpty(firstLetterOrSubject)) { if (firstLetterOrSubject.Length == 1) { // Single letter - lookup into the subject table char upperCh = firstLetterOrSubject.ToUpper()[0]; if (_subjectLetterMap.ContainsKey(upperCh)) subject = _subjectLetterMap[upperCh]; } else subject = firstLetterOrSubject; } if (!string.IsNullOrEmpty(subject)) { char lastChar = subject.Substring(subject.Length - 1)[0]; SubjectRule rule = _rules.ContainsKey(lastChar) ? _rules[lastChar] : new SubjectRule(); if (past) { if (rule.PastCut) s.Append(subject.Substring(0, subject.Length - 1)); else s.Append(subject); s.Append(rule.Past); } else { if (rule.CurCut) s.Append(subject.Substring(0, subject.Length - 1)); else s.Append(subject); s.Append(rule.Cur); } s.Append(" "); } s.Append(text); return s.ToString(); } } And yes this is used in a productive every day used application...
  10. Finalspace

    Writing subjects in present and past is hard

    Really i have no idea why i did that, but hey its still used in a production tool i made, used to deploy updates to our applications. But this tool is used by developers only, so even when something would be wrong about the messages being written - nobody except me would notice it Ah wait, i know why i did it: I was tired of writing "Copy A to B" vs "Copied A to B successfully" vs "Failed to copy A to B" all the time. So i ended up writing that "thing". This saved me a few words of typing. Also this had the advantage to use it for other operations as well, like "Initialize", "Create", "Make", "Destroy", etc.
  11. Finalspace

    Demo Reels for programmers.

    The first time i ever heard of a demo-reel. This is much better than my video-showcase of ~60 minutes Also you can show off your video-editing skills this way. Awesome, i think i will may make one for my next job application. )
  12. Staying motivated at times when i dont have time to make my game is the hardest thing for me. As a matter of fact its the reason why i never completed making a single game in my entire life and are now left with a ton of prototypes.
  13. Finalspace

    C++ compiled EXE not running

    A few ideas to find this problem (CRT Linking/Runtime issue?): 1.) Check for errors https://wiki.libsdl.org/SDL_GetError 2.) Switch from static linking to dynamic linking for SDL You may already use that. 3.) Load SDL dynamically Remove and linking for SDL, provide function prototypes for every SDL function you use and load it dynamically (LoadLibraryA or dlopen) 4.) Fully include the SDL source code (All .c files) without any linking This sounds like its a ridiculous idea and it is indeed, but with this method you most likely can reproduce the problem on both sides after that. Also this has the advantage that you can fully debug it, so you see exactly where it is crashing. In the past i successfully used that method for Box2D and a insane huge crypto library, but it may not work for SDL due to fact SDL relies heavy on makefiles for building 😞 But you can try it. So when you want to go this route, you simply build up a simple script/tool which produces all the #include <sdl/whatever.c> for every C file (Order should not matter). After that you write a libsdl.c and a libsdl.h file which looks like this (Without any code sections): // libsdl.h file: #include <SDL/include/sdl.h> // libsdl.c file: #include "libsdl.h" // Manual code generated from the "SDL/src" folder in order of the OS file traversing api #include <SDL/src/SDL.c> #include <SDL/src/atomic/SDL_atomic.c> #include <SDL/src/atomic/SDL_spinlock.c> // ... #include <SDL/src/SDL.c> // ... Include both files in your IDE project and replace any SDL include in your app to "libsdl.h" only. Also do not worry about the number of source files you have to include, because SDL has guarded all the platform specific stuff - so you wont compile ALSA audio driver on Win32 for example.
  14. I am in search for a realtime algorythm to build fracture parts from a oriented box in 2D with respect of the impact point and the impact velocity, for building-up a exploding rock started as a box-shape. What techniques are there which are or can be easy translated to 2D?
  15. This is how i done it successful in the past. A system should have some sort of list of component types it requires + a list of optional component types it may need. A system contains a list of entities which always passes those type requirements. This list of entities are automatic populated as soon as a component is added/removed to/from a entity. When the system runs, it just iterate over that list, gets it components it needs, does the data transformation and its done. This way the system just updates the entities it cares and doesent care about anything else. But for heavy mathy stuff, this is not efficient. You always want to process just the data you care and nothing else. For that a data-oriented approach may be better, see the following video for a much better explanation: https://youtu.be/rX0ItVEVjHc?t=1941 Meaning that copy the data over to small designated structs, process them and then copy they back may be faster than operating on the components directly. Also this implementation is not suitable for scenarios where you do tons of component add/remove operations while the game is running. If you have something like that, you need a different approach.
  16. Finalspace

    How i failed the tower defense GD competition

    Thanks! Its my first time critizing myself in a blog like this so i had no idea how this will go. Yeah, writing a editor for such small projects are just overkill - especially if you dont have time for that. But using a existing one which is not suitable for your game is much worse - like in my case. i think it would have been better when i have written it myself - especially because i have a dozens in the past already and i know how this things are implemented. I always have the requirement to write everything myself, not using any engine or thirdparty library. I dont mind fighting against technical issues. Also i normally dont have technical issues, because i already did all those stuff a lot in the past, so i know how it works. The two issues i had was a typo and a too small sized font atlas - thats it. Everything else was just wrong decision making... But maybe i try to make the project with unreal, just to see if this would be a different.
  17. Finalspace

    Slowest AABB overlap test ever?

    Well found a very old aabb overlap test of mine, still works but well... it may be slow, maybe its slowest ever - or it is not that bad? Try to beat it union Vec2f { struct { float x, y; }; float m[2]; }; union AABB { struct { Vec2f min, max; }; Vec2f m[2]; }; bool IsAABBOverlap(const AABB &a, const AABB &b) { // @SPEED: This is the slowest aabb overlap test ever exists! float distanceX = a.max.x - a.min.x; float distanceY = a.max.y - a.min.y; float otherDistanceX = b.max.x - b.min.x; float otherDistanceY = b.max.y - b.min.y; float bothRadiusX = (Abs(distanceX) + Abs(otherDistanceX)) * 0.5f; float bothRadiusY = (Abs(distanceY) + Abs(otherDistanceY)) * 0.5f; float otherCenterX = b.min.x + otherDistanceX * 0.5f; float otherCenterY = b.min.y + otherDistanceY * 0.5f; float centerX = a.min.x + distanceX * 0.5f; float centerY = a.min.y + distanceY * 0.5f; float diffX = Abs(centerX - otherCenterX); float diffY = Abs(centerY - otherCenterY); float overlapX = diffX - bothRadiusX; float overlapY = diffY - bothRadiusY; float result = !(overlapX > 0 || overlapY > 0); return(result); }
  18. This will be a post mortem explaining how i failed the game dev competition for a tower defense game, so here it goes. In the start of june 2018 i found the tower challenge post by accident, read the description and was really excited. So i decided to apply and started right away - without any planning whatsoever. I created a new visual c++ project and after 3 evenings with a couple of hours i got the basic game mechanics nailed down: Enemies could be spawned and moved from waypoint to waypoint along a direction and randomly placed towers could hit and destroy it. Everything (tiles/enemies/towers) was defined in static int arrays, so i can adjust it however i like. It was going very smoothly and i was very happy with it. The next 2 evenings was a nightmare. I made a new map and suddently everything was broken. All the towers was shooting randomly, the enemies was not following the waypoints anymore, bullets missed all the enemies and so on, even the spawning was behaving weirdly. So it took me 7 hours to find all those bugs and fix them. After that in the next evening i refactored the current code, made it more robust and fixed a few bugs. In addition i added basic HUD rendering to display lives, score, money, current wave, etc. Now it was looking really good so far and the game was already playable. The next day for whatever reason i decided to use the editor "TileD" to setup everything. I have no idea why i wanted that, maybe i thought it would save me time or something but i was wrong. Even after 5 evenings, i still couldnt´t figure out how to get towers/enemies/waves defined in the TMX file. So i partly gave up on that idea and ended up just defining the walkable tiles and the waypoints in the TMX file. In addition i created a shitton of code just to parse a TMX file - including writing a generic xml parser in C99. The only thing useful i made in that 5 evening was that parser 😞 This entire process took me ~20 hours -> 4*8 useless workhours minus 2 hours for writing the xml parser. After that the next 3 evenings i did of lot of refactoring needed to get the TMX loaded in the way i wanted. The result was not that bad. I now could define all the waypoints, the walkable and placeable tiles in the editor and setup as many spawners as i want. This took me about ~6 hours. The next 2 evenings was a blast! I was very productive and added a lot of functionality and fixed a lot of bugs. I now had a fine looking HUD , multliple waves with multiple spawners for each wave. In addition i improved almost every part of the game, even the towers was rotating smoothly against the target now and you could lose or win the game. The "game" finally started to take shape. Of course after a blast, there comes the opposite of that: Destroying and unproductivity! In one evening i broke the tower rotation, the enemy position prediction, the rendering and even the HUD. Why of a sudden did everything brake? It may be that i just wanted to make it "even better" -> Over complicating simple things! In the following evening i reverted everything and simplified a lot of the game mechanics. Now all of a sudden the enemy prediction worked and the tower rotation was correct and very smooth. But the font rendering seems to be totally broken now - after switching to a new font. So i had no choice to still use the old font 😞 Many evenings later with a lot of delays between, i finally fixed the nasty font rendering bug. It took me over 10 hours to find that bug and 5 seconds to fix it... Now the new font or any other font works just fine. In addition i made a few simple functions to render and handle UI buttons - to select the appropriate tower. Now i got sick i could barely do anything, so i was of for over a week. After that i wanted get rid of the ugly dev graphics, so in 2 hours i made a push rendering system + opengl implementation and changed everything to it. It looked exactly the same as it was before, but now it was much more flexible and i finally could add sprites to the game. The next day i successfully added loading and rendering of sprites in just about 30 minutes. Then i searched the net for a free tileset, which i can use to test the sprite rendering. After i found one, i changed the TMX map to use it. The following 4 evenings i have written a lot of code for parsing/converting/rendering the tilesets from the TMX, but with wrong results. All the UV´s was incorrect and even after spending hours of debugging i could not find the bug at all. Now there was a full week where i didn´t do anything. The motivation was gone. The first evening in the following week i was still not motivated at all, but i wanted to get this finally fixed so i forced myself to analyze the code again - searching for the UV bug and after a short amount of time, i finally found the bug... It was just a typo... After fixing that typo now all the UV´s was correct and everything looked fine. In the next evening i added 3 more layers to the TMX map, trying to make it look more prettier. But there was a problem, the fixed map dimension was not sufficient to make use of the tilesheet i was going for. So i decided to change the entire system from a fixed map size to a dynamic one and this was pretty expensive from a time perspective, it took me around 2-3 hours. Now i had just a few days left before the deadline. The following days i moved all the wave/enemy/tower definitions into separated xml files, so i can starting making the actual 20 waves/enemies and a few towers. Of course this required me to change a lot of the internal systems, but the written xml parser now payed of and in an hour it was changed very easialy. Now i started to fiddle around with the data, trying to add more waves, more towers... Such tasks are not my thing, so it took me two hours just to add another wave and another tower 😞 So now i had one day left before the deadline and the game was not even close to be finished. I had one level, two waves, two towers, two enemies and very basic game mechanics working, without upgradable towers. Also i had no final art, no sound or music, not even a menu 😞 The following days i was really depressed about it, so i was not working at the project at all, so i failed and missed the deadline. So now comes my reasons why i failed it: 1.) I didn´t plan anything I had no idea which art style i was going for I had not slicest idea what type of waves/towers/enemies i want I had no idea how the level should look like I didn´t set any goals or milestones or tasks whatsoever 2.) Forcing myself to use the TileD editor was a huge mistake For such a little project, one level should be just fine. So why the heck do i need a editor when i just want to have one level anyway? The only thing i needed to setup in the editor was the visual tiles, the walkable and placable areas and the positions for the spawners and thats it. 3.) I added a lot of complexity without thinking it through At work i always do that, but for some f*cking reason on private projects i never do that and that always kills me. I should have sticked with the simplest solution in all cases, then i may had finished it in time. 4.) I didn´t continously worked on the game There was too many days of me not working on the game at all. I should at least made one little thing each day or something like that. But not everything was bad, at various point i made a lot of progress and the last build i made was not that bad. It was playable, you can win or lose the game - it just lacks content in a all places, so i decided to finish the game to end of september - to have at least one finished game made in my life. Thats almost two month´s from today - counting just the days, that should be doable - even with my limited time budget.
  19. Finalspace

    Towadev

    A simple technical tower defense 2D game
  20. To translate to modern OpenGL 3.3+ you have to: 1.) Build the matrix stack yourself, as every gl*Matrix* function is deprecated 2.) You cannot use any glBegin(), glVertex*(), glColor*() functions anymore -> Use VBO instead. 3.) You cannot use glClient*() related functions, such as glClientActiveTexture or glEnableClientState 4.) You need to use at least one active shader program, because there is no function pipeline anymore 5.) You need a active vertex array, otherwise you wont see anything (Some drivers have a default VA bound, so keep that in mind) For more details see the following tutorial: https://ahbejarano.gitbook.io/lwjglgamedev/
  21. "thebennybox" has a very good tutorial for 3D software rendering: https://www.youtube.com/channel/UCnlpv-hhcsAtEHKR2y2fW4Q
  22. Solved. The function was almost correct. Using uint32_t as a buffer was my mistake. It must be unsigned long instead! Also the RGBA byte swap was required, otherwise you get a weird or blank icon.
  23. I want to set a icon in Linux/X11 at the start of my C++ program. The following code i tried does not work at all - nether in XFCE or Gnome or KDE. Did i something wrong here, i dont see any mistakes? fpl_internal void fpl__X11LoadWindowIcon(const fpl__X11Api *x11Api, fpl__X11WindowState *x11WinState, fplWindowSettings *windowSettings) { // @TODO(final): Setting the window icon on X11 does not fail, but it does not show up in any of the bars // In gnome/ubuntu the icon is always shown as "unset" int iconSourceCount = 0; fplImageSource iconSources[2] = FPL_ZERO_INIT; if (windowSettings->icons[0].width > 0) { iconSources[iconSourceCount++] = windowSettings->icons[0]; } if (windowSettings->icons[1].width > 0) { iconSources[iconSourceCount++] = windowSettings->icons[1]; } if (iconSourceCount > 0) { int targetSize = 0; for (int i = 0; i < iconSourceCount; ++i) { targetSize += 2 + iconSources[i].width * iconSources[i].height; } // @MEMORY(final): Do not allocate memory here, use a static memory block or introduce a temporary memory arena! uint32_t *data = (uint32_t *) fplMemoryAllocate(sizeof(uint32_t) * targetSize); uint32_t *target = data; for (int i = 0; i < iconSourceCount; ++i) { const fplImageSource *iconSource = iconSources + i; FPL_ASSERT(iconSource->type == fplImageType_RGBA); *target++ = (int32_t) iconSource->width; *target++ = (int32_t) iconSource->height; const uint32_t *source = (const uint32_t *)iconSource->data; for (int j = 0; j < iconSource->width * iconSource->height; ++j) { // @TODO(final): Do we need to swap the byte order of the icon in X11? #if 0 *target++ = (iconSource->data[j * 4 + 0] << 16) | (iconSource->data[j * 4 + 1] << 8) | (iconSource->data[j * 4 + 2] << 0) | (iconSource->data[j * 4 + 3] << 24); #else *target++ = *source; #endif } } x11Api->XChangeProperty(x11WinState->display, x11WinState->window, x11WinState->netWMIcon, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) data, targetSize); // @MEMORY(final): Do not free memory here, see note above! fplMemoryFree(data); } else { x11Api->XDeleteProperty(x11WinState->display, x11WinState->window, x11WinState->netWMIcon); } x11Api->XFlush(x11WinState->display); }
  24. Finalspace

    Scrum metodology

    My wife works in a heavy agile environment and what i heard about is not that bad, but not great either - because it does not work for all customers. There are customers which always think in the waterfall method and does not want to get involved in the development process at all -> They want a fixed price, a fixed feature set based on a hard specification book. Other customers misuse the system to get features for free - using the blaiming scheme -> "It does not work as intended" > "Change it!", even though its 100% implemented as descriped in the product/backlog. But there are definitly customers which seems to be happy with the system as well. I personally dont work in a agile environment, i just had two professional trainings for SCRUM and know the basics - so i can at least apply for jobs which requires it.
  25. Finalspace

    Tower Defense almost over!

    I didn´t make it, there was too much stuff going on. Right know i have a playable prototype with bare minimum game mechanics and dev gfx, but nothing more. I even didn´t had time to create a short video showing my progress 😞 Maybe i will write down a blog entry about what went wrong...
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!