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

Pages: [1]
1
System / Re: People messing with my programs.
« on: December 05, 2016, 03:41:38 pm »
A lot of games use custom data containers to obfuscate assets, which wouldn't be hard to implement, and would be enough to deter most. For a small dataset I'd use a simple format of [id, filesize, data] for each asset, then concatenate. You'd reference the assets in your code by id, load the entire dataset upon loading, find the asset you require with a simple linear search, and call for example  texture.loadFromMemory() instead of texture.loadFromFile. For bigger projects you may want to separate the data from the metadata, to allow loading the data only when needed (and fancier things like binary-search). A helper tool to create the container from a directory would be recommended to ease asset updates.

A step beyond that would be encrypting the file so that the assets couldn't be retrieved with file dump tools (so they'd need to dump the files from memory), but that seems like overkill on what may already be overkill.

2
C / Noob link error, binding issue?
« on: December 05, 2016, 02:46:35 pm »
Hi,
I can get a test program running on Win 10 using SFML 2.4.1 (GCC 4.9.2 TDM (SJLJ) - 32-bit), but am having trouble doing the same with CSFML 2.3 (using the same compiler, using the CSFML files as supplied). I'm very rusty so expect it to be a noob error, please be gentle ;)

I can get to the same point in codeblocks and commandline. What I am doing and the output is this:
Code: [Select]
gcc -ICSFML/include -LCSFML/lib/gcc -LSFML-2.4.1/lib ctest/main.c -octest/main.exe
C:\Users\GAMING~1\AppData\Local\Temp\ccWpC4tj.o:main.c:(.text+0x56): undefined reference to `_imp__sfWindow_create'
C:\Users\GAMING~1\AppData\Local\Temp\ccWpC4tj.o:main.c:(.text+0x69): undefined reference to `_imp__sfWindow_isOpen'
collect2.exe: error: ld returned 1 exit status

So it read the header but couldn't find the definition. But looking in libcsfml-window.a with 7zip it appears to be there (but it's looking for "underscore imp double underscore", the lib has it as "double underscore imp underscore", no idea why that would be or if it matters):
Code: [Select]
...
d000025.o    sfWindow_createFromHandle
d000025.o    __imp_sfWindow_createFromHandle
d000024.o    sfWindow_create
d000024.o    __imp_sfWindow_create
d000023.o    sfWindow_close
d000023.o    __imp_sfWindow_close
...

Here's the test code, which is just example code cut down and converted to C:
Code: [Select]
#include <SFML/Window.h>
int main()
{
    sfWindow *window;
    sfVideoMode mode = {800, 600, 32};
    window = sfWindow_create(mode, "Title", sfTitlebar|sfClose, NULL);
    while (sfWindow_isOpen(window)){}
    return 0;
}

I've googled, changed the order of the gcc parameters, tried -std=c99, did the same in codeblocks using the c++ tutorial, and am out of ideas. Any ideas where I'm going wrong?

Pages: [1]