diff --git a/src/platform/nix/.vscode/launch.json b/src/platform/nix/.vscode/launch.json new file mode 100644 index 0000000..484fda4 --- /dev/null +++ b/src/platform/nix/.vscode/launch.json @@ -0,0 +1,24 @@ +{ + "configurations": [ + { + "name": "(gdb) Launch", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/../../../bin/OpenLara", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}/../../../bin/", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + + ] +} \ No newline at end of file diff --git a/src/platform/nix/.vscode/settings.json b/src/platform/nix/.vscode/settings.json new file mode 100644 index 0000000..a1dc2ea --- /dev/null +++ b/src/platform/nix/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "typeinfo": "cpp" + } +} \ No newline at end of file diff --git a/src/platform/nix/.vscode/tasks.json b/src/platform/nix/.vscode/tasks.json new file mode 100644 index 0000000..391137a --- /dev/null +++ b/src/platform/nix/.vscode/tasks.json @@ -0,0 +1,47 @@ +{ + "version" : "2.0.0", + "tasks": [ + { + "type": "shell", + "label": "C/C++: clang++ build active file", + "command": "/usr/bin/clang++", + "args": [ + "-std=c++11", + "-Os", + "-s", + "-fno-exceptions", + "-fno-rtti", + "-ffunction-sections", + "-fdata-sections", + "-Wl,--gc-sections", + "-Wno-invalid-source-encoding", + "-DNDEBUG", + "-D_POSIX_THREADS", + "-D_POSIX_READER_WRITER_LOCKS", + "main.cpp", + "../../libs/stb_vorbis/stb_vorbis.c", + "../../libs/minimp3/minimp3.cpp", + "../../libs/tinf/tinflate.c", + "-I../../", + "-lX11", + "-lGL", + "-lm", + "-lpthread", + "-lpulse-simple", + "-lpulse", + "-o", + "../../../bin/OpenLara" + ], + "options": { + "cwd": "${workspaceFolder}" + }, + "problemMatcher": [ + "$gcc" + ], + "group": { + "kind": "build", + "isDefault": true + } + } + ] +} \ No newline at end of file diff --git a/src/utils.h b/src/utils.h index d5f1178..ae934ca 100644 --- a/src/utils.h +++ b/src/utils.h @@ -86,7 +86,7 @@ #define COS60 0.50000000000f #define SQR(x) ((x)*(x)) -#define randf() ((float)rand()/RAND_MAX) +#define randf() (float(rand())/float(RAND_MAX)) typedef signed char int8; typedef signed short int16;