Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

  • Days Won


Bregma last won the day on April 22

Bregma had the most liked content!

Community Reputation

9326 Excellent

1 Follower

About Bregma

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Bregma

    Why Gaming in the Browser is Inevitable

    Upside: increased ongoing revenue stream through ad insertion and subscription fees Downside: ad insertion and subscription fees
  2. Bregma

    Ascii Table and some Links

    That's not ASCII (an international standard character set), it's Microsoft Windows codepage 437 (a proprietary character set owned by Microsoft and only found in some their commercial products). Just so you know, for when you move to something that's not your personal desktop.
  3. OOP. You keep using that term. I don't think i means what you think it means.
  4. One more suggestion to help with your analysis: perform only one expression per statement in your loop body so you can see where the slowdown is. Instead of this rgba.push_back(<static_cast<sf::Uint8>(spectrum.r * max)); break it into three separate expressions. auto rtemp1 = spectrum.r * max; sf::Uint8 rtmp2 = static_cast<sf::Uint8>(rtemp1); rgba.push_back(rtmp2); Then your timings will show where you should be concentrating your tuning efforts. Note that once you fix the problem you don't have to leave it like this, it's just an analysis technique. Also, try making "max" an appropriate floating-point number to avoid so many type conversions. Also, try making your loop variable an auto const& instead of a copy of the colour vector. That's unlikely to improve performance much but might eliminate a memory access or three at low optimization levels.
  5. Your 'addMessage()' function displays values from 'message'. What is actually sent by the server?
  6. The 'Undefined' comes from JavaScript. It's the result of invoking the undefined name 'addMessages' for each message returned by the server. The undefined name 'addMessages' is undefined, so JS returns 'Undefined' when it's used. Think of it as an error message.
  7. The simple answer is yes. Although there are no "standard" implementations, dynamic memory allocation and de-allocation is non-deterministic, and the only way to map a contiguous memory address space into non-deterministic allocations and de-allocations is to use something like a linked list or a mark-and-sweep algorithm (or some other non-O(1) strategy). Even more fraught is that a single central memory allocator on a multi-threaded multi-processor environment (and they all are these days, even your toaster) you can one big lock to slow things down further. If profiling reveals that memory allocation is an issue, the strategy is generally to allocate all memory up front on startup and never use the central system allocator again. This is the norm in real time and embedded systems where the vagaries of malloc() can not be tolerated, and has become standard practice in many games for the same reason.
  8. I'm closer to 60 than to 50 and I've been seen stuff over the decades. I can vouch that despite claims of being age blind, hiring managers like to hire people who are similar to themselves, in age, in sex, and in socio-cultural background. Yes, it's not legal and it's not necessarily to the company's advantage, but it's human nature and you;re going to run into it. Expect to get fewer opportunities than someone who is younger together with excuses like "someone your age will expect to be paid more than we can afford" or "we're a young and agile team that needs to be able to pick up new technologies on the fly." Ageism in the industry is alive and well and rumours of its demise are greatly exaggerated.
  9. Without knowing the language and what a String is, I would venture that it's probably safe to compare the last character to '/'. If you're using a C-family language and String is some sort of aggregation of chars, then it's safe because single-byte UTF-8 character always have their most significant bit clear and are equivalent to 7-bit ASCII. All multibyte UTF-8 characters have their high-order bit(s) set. If you're using a C-family language and String is some sort of aggregation of wider characters, the integral promotion rules will come into play and '/' will be promoted to the larger type before comparison. If the promotion involves sign extension, it's still safe because sign extension of a value with a clear MSB is safe. If you're not using a C-family language, I don't know because various languages have different rules.
  10. Bregma

    Symbol lookup error on Linux

    Try playing with adding -Wl,--whole-archive to the LDFLAGS when building the bullet DSO. You're only doing partial linking when you're building your plugin, and the linker doesn't see the static object being used outside the library so it gets left behind in the static library. You need to tell the linker to put all of what's in the archive into the dynamic library. Creating shared libraries from static archives is tricky, that's why most build tools are a little goofy when dealing with that.
  11. Seems to me you changed your project from "multi-threaded" to "multi-threaded DLL" and now you need to change all the DLL binaries you supply to match, otherwise the linker will ignore them. No one ever said Microsoft Windows was easy on developers (and was telling the truth). All the binaries you link together in Microsoft Windows have to have the same [debug|multi-threaded|DLL] settings or you will get failure.
  12. Bregma

    calculating normal vectors

    Yes. It says the equation for the surface of the thing is f(p), and the equation for the normal to the surface f(p) is perpendiculart to grad f(p). The upside-down triangle thingie (nabla) is the symbol used to represent the gradient operator, and it refers to a vector-valued derivative. In other words it expresses how the normal is a parametric function of the surface equation in three variables in about as simple and precise a way as possible, in a way that only a mathematician would love.
  13. If you XOR the string with itself byte--by-byte, it will consist of only 0 bytes. Since it's all a known length of zeroes, you just need to store the length. Then, at runtime, you just need to allocate the length amount of space on the stack and XOR it once again with the original string, and voila, no need to store the string in the DATA segment, it can go in the BSS segment instead. It's called the "turtles all the way down" method.
  14. Bregma

    Programming and Higher Mathematics

    All of it.
  15. How to reinvent virtual dispatch using C++? There are many ways, all of them wrong. Perhaps you should just simplify instead. Have an Item class. Store objects of the Item class in your inventory. Give items properties, such as `is_wearable` and `melee_damage`. Use them as appropriate. RInse and repeat.
  • 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!