don't click here

Continuing K-E

Discussion in 'Technical Discussion' started by saxman, Sep 3, 2008.

  1. Mad Echidna

    Mad Echidna

    Gone Oldbie
    5,219
    0
    0
    The GPL would be a bad thing, because the entire thing that makes this hacking community fun is the mistique and competition. Open Source code would make everything muddled and generic.

    Also, my point was that you shouldn't just go "uh no". You had a valid point, so why didn't you make it? That's all I'm saying.
     
  2. Christuserloeser

    Christuserloeser

    Member
    21
    0
    0
    Competition would be even harder if everyone was to work with the same sources, tools and knowledge. :)


    Good question.

    Guess, "uh no" is easier to type than a full explanation. English is my second language, so it's not easy to express myself the way I'd wish I could. In addition, I understood from Tweaker's post that this topic apparently was discussed in other threads already. But even (or especially) if that's the case, it would not make this "the GPL is the end" talk any better.

    Either you GPL your work (which would be good), or you don't (which would be not so good - maybe even a waste of the time you've put into your work and certainly a waste of the time of all those people that try to achieve the same things you did already).

    In the end it's not my decision, nor that of anyone else, but entirely yours. In my opinion it's just not a good idea to claim it would cause bad things, because that's wrong.
     
  3. Mad Echidna

    Mad Echidna

    Gone Oldbie
    5,219
    0
    0
    Fail enough, I just think some people might see at as arrogance to word it that way, that's all. The staff here generally don't appreciate such brief posts.
     
  4. saxman

    saxman

    Oldbie Tech Member
    *sigh*
     
  5. Nibble

    Nibble

    Oldbie
    (disclaimer: I am not a lawyer)

    But, since Sega *didn't* GPL any Sonic code, trying to apply the GPL to Sonic hacks would open a whole new can of worms.

    Speaking purely from a legal standpoint, Sega/Sonic Team may not find it to their best interests if we were to GPL code that they originally created; whether they would actually pursue legal action is a different matter. So far, Retro and similar communities have avoided any Sega lawyers, and I imagine it's because we're not making any profit from all the hacking we do.

    With Sonic hacks GPL'd, we still wouldn't make a profit, but the difference is that we would effectively be relicensing code that isn't ours. So, in the off-chance that Retro or a community member gets threatened or sued, the GPL in this case would only give them more ammunition against us.

    Edit: And sorry for continuing the off-topic train. I wanted to say something. :x
     
  6. Christuserloeser

    Christuserloeser

    Member
    21
    0
    0
    You're correct, but since we (at least initially) were talking about K-E, saxman's Kid Chameleon level editor...

    No one could actually GPL SEGA's code. What could be done would be to GPL your new code. Whether it's possible to GPL simple code changes, I am not sure, but it should be perfectly fine to GPL code additions (as if you were to add a spindash to Sonic 1, simulating the one from Sonic 2).
     
  7. saxman

    saxman

    Oldbie Tech Member
    Should I just change the title of the topic?
     
  8. Mad Echidna

    Mad Echidna

    Gone Oldbie
    5,219
    0
    0
    Poor Saxman, you make me LOL sympathetically XD

    [​IMG]
     
  9. OK, so on topic now...

    Even though I'm not interested in continuing this project, I decided to have a look. The code looks very clean and easy to maintain. I looked very quickly so I can't tell much.

    However, one thing I noticed is that you're using realloc improperly: if the new pointer is different from the old pointer, you must free the memory at the previous location yourself. Instead of this, you just replace the pointer and if the contents moved, you have a memory leak.

    Here's a proof (it should work if your computer doesn't have infinite memory):
    Code (C):
    1. #include <stdio.h>
    2. #include <stdlib.h>
    3.  
    4. int main(int, char **)
    5. {
    6.     int loops = 0;
    7.     int iterations;
    8.     do
    9.     {
    10.         int currentSize = 1024;
    11.         char *memory = (char *) malloc(currentSize);
    12.         iterations = 0;
    13.         while ((memory = (char *) realloc(memory, currentSize *= 2)))
    14.         {
    15.             ++iterations;
    16.         }
    17.         free(memory);
    18.         printf("Did %d iterations\n", iterations);
    19.         ++loops;
    20.     } while (iterations);
    21.     printf("Did %d loops\n", loops);
    22.     getchar();
    23.     return 0;
    24. }
    You'll see that even though I free memory, the previous locations where memory was allocated are not freed.
     
  10. saxman

    saxman

    Oldbie Tech Member

    I actually discovered I was using it improperly actually about a week or two ago! All this time I thought I was using it without complications. That's one of the reasons the public release of ProSonic kept crashing for people -- it was working with memory that wasn't even allocated. I've been using realloc() incorrectly for many years it would seem XD

    Anyway, thank you for taking a quick look into the code! I know it was a brief look into it, but the feedback is encouraging to hear.
     
  11. Mad Echidna

    Mad Echidna

    Gone Oldbie
    5,219
    0
    0
    BEHOLD THE POWER OF FORUM PICS

    I'm glad you finally got your feedback, Sax ^_^