├── src ├── pch.cpp ├── hooks │ ├── movelocalplayer.cpp │ ├── drawscope.cpp │ ├── checkheadshot.cpp │ ├── servertoclient.cpp │ ├── mousemove.cpp │ ├── attackphysics.cpp │ ├── glDrawRangeElements.cpp │ ├── ShowCursor.cpp │ ├── drawcrosshair.cpp │ ├── c2sinfo.cpp │ ├── dodamage.cpp │ ├── WndProc.cpp │ └── hooks.cpp ├── hacks │ ├── Godmode.cpp │ ├── InstantKill.cpp │ ├── PingChanger.cpp │ ├── NoScope.cpp │ ├── InfiniteArmor.cpp │ ├── InfiniteHealth.cpp │ ├── Bunnyhop.cpp │ ├── Wallhack.cpp │ ├── NoRecoil.cpp │ ├── AlwaysHeadshot.cpp │ ├── FullBright.cpp │ ├── InfiniteAmmo.cpp │ ├── FlyHack.cpp │ ├── AutoGuns.cpp │ ├── NoGunWait.cpp │ ├── TeleportItems.cpp │ ├── Speedhack.cpp │ ├── TeleportPlayers.cpp │ ├── ChatSpam.cpp │ ├── Teleport.cpp │ ├── Triggerbot.cpp │ ├── Aimbot.cpp │ ├── ESP_Snaplines.cpp │ ├── ESP_Box.cpp │ ├── RadarHack.cpp │ ├── NameChanger.cpp │ ├── ESP_Info.cpp │ └── Crosshair.cpp ├── pch.h ├── main.cpp └── game.cpp ├── include ├── assaultcube │ ├── src │ │ ├── vote.h │ │ ├── crypto_tools.h │ │ ├── i18n.h │ │ ├── bot │ │ │ └── ac_bot.h │ │ ├── winserviceinstaller.h │ │ ├── platform.h │ │ ├── cube.h │ │ ├── model.h │ │ ├── modelcache.h │ │ ├── scale.h │ │ ├── hudgun.h │ │ ├── servercontroller.h │ │ ├── command.h │ │ ├── weapon.h │ │ └── world.h │ ├── include │ │ ├── curl │ │ │ ├── types.h │ │ │ ├── stdcheaders.h │ │ │ ├── curlver.h │ │ │ ├── mprintf.h │ │ │ └── easy.h │ │ ├── AL │ │ │ ├── XiphLicense.txt │ │ │ └── xram.h │ │ ├── SDL_name.h │ │ ├── enet │ │ │ ├── utility.h │ │ │ ├── types.h │ │ │ ├── time.h │ │ │ ├── callbacks.h │ │ │ ├── list.h │ │ │ ├── unix.h │ │ │ └── win32.h │ │ ├── SDL_copying.h │ │ ├── SDL_getenv.h │ │ ├── SDL_types.h │ │ ├── SDL_byteorder.h │ │ ├── jconfig.h │ │ ├── utf8.h │ │ ├── SDL_config.h │ │ ├── close_code.h │ │ ├── SDL_error.h │ │ ├── SDL_active.h │ │ ├── SDL_quit.h │ │ ├── SDL_cpuinfo.h │ │ ├── SDL_version.h │ │ ├── SDL_loadso.h │ │ ├── SDL_platform.h │ │ ├── SDL_main.h │ │ ├── vorbis │ │ │ └── vorbisenc.h │ │ ├── SDL.h │ │ ├── ogg │ │ │ └── os_types.h │ │ ├── SDL_keyboard.h │ │ ├── SDL_config_macosx.h │ │ ├── SDL_thread.h │ │ ├── SDL_timer.h │ │ ├── SDL_mouse.h │ │ └── SDL_config_win32.h │ ├── sdk.h │ └── lib │ │ ├── SDL.lib │ │ ├── enet.lib │ │ ├── jpeg.lib │ │ ├── ogg.lib │ │ ├── winmm.lib │ │ ├── zdll.lib │ │ ├── SDL_ttf.lib │ │ ├── libcurl.lib │ │ ├── libintl.lib │ │ ├── vorbis.lib │ │ ├── wldap32.lib │ │ ├── ws2_32.lib │ │ ├── EFX-Util.lib │ │ ├── OpenAL32.lib │ │ ├── SDL_image.lib │ │ └── libvorbisfile.lib └── imgui │ ├── LICENSE.txt │ ├── imgui_impl_opengl2.h │ └── imgui_impl_win32.h ├── assets ├── readme.txt ├── img │ ├── acmh_0.PNG │ ├── acmh_1.PNG │ ├── acmh_2.PNG │ ├── acmh_3.PNG │ ├── acmh_4.PNG │ ├── acmh_5.PNG │ ├── acmh_6.PNG │ └── acmh_7.PNG └── font │ ├── Ubuntu-Regular.ttf │ ├── UbuntuMono-Regular.ttf │ ├── create_font_headers.py │ └── UFL.txt ├── AssaultCube-Multihack.vcxproj.user ├── AssaultCube-Multihack.sln └── README.md /src/pch.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" -------------------------------------------------------------------------------- /include/assaultcube/src/vote.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /include/assaultcube/include/curl/types.h: -------------------------------------------------------------------------------- 1 | /* not used */ 2 | -------------------------------------------------------------------------------- /assets/readme.txt: -------------------------------------------------------------------------------- 1 | This is the assets folder. Images, fonts, etc should go here. 2 | -------------------------------------------------------------------------------- /assets/img/acmh_0.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/assets/img/acmh_0.PNG -------------------------------------------------------------------------------- /assets/img/acmh_1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/assets/img/acmh_1.PNG -------------------------------------------------------------------------------- /assets/img/acmh_2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/assets/img/acmh_2.PNG -------------------------------------------------------------------------------- /assets/img/acmh_3.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/assets/img/acmh_3.PNG -------------------------------------------------------------------------------- /assets/img/acmh_4.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/assets/img/acmh_4.PNG -------------------------------------------------------------------------------- /assets/img/acmh_5.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/assets/img/acmh_5.PNG -------------------------------------------------------------------------------- /assets/img/acmh_6.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/assets/img/acmh_6.PNG -------------------------------------------------------------------------------- /assets/img/acmh_7.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/assets/img/acmh_7.PNG -------------------------------------------------------------------------------- /assets/font/Ubuntu-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/assets/font/Ubuntu-Regular.ttf -------------------------------------------------------------------------------- /include/assaultcube/sdk.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef SDK_H 3 | #define SDK_H 4 | 5 | #include "src/cube.h" 6 | 7 | #endif -------------------------------------------------------------------------------- /include/assaultcube/lib/SDL.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/include/assaultcube/lib/SDL.lib -------------------------------------------------------------------------------- /include/assaultcube/lib/enet.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/include/assaultcube/lib/enet.lib -------------------------------------------------------------------------------- /include/assaultcube/lib/jpeg.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/include/assaultcube/lib/jpeg.lib -------------------------------------------------------------------------------- /include/assaultcube/lib/ogg.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/include/assaultcube/lib/ogg.lib -------------------------------------------------------------------------------- /include/assaultcube/lib/winmm.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/include/assaultcube/lib/winmm.lib -------------------------------------------------------------------------------- /include/assaultcube/lib/zdll.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/include/assaultcube/lib/zdll.lib -------------------------------------------------------------------------------- /assets/font/UbuntuMono-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/assets/font/UbuntuMono-Regular.ttf -------------------------------------------------------------------------------- /include/assaultcube/lib/SDL_ttf.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/include/assaultcube/lib/SDL_ttf.lib -------------------------------------------------------------------------------- /include/assaultcube/lib/libcurl.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/include/assaultcube/lib/libcurl.lib -------------------------------------------------------------------------------- /include/assaultcube/lib/libintl.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/include/assaultcube/lib/libintl.lib -------------------------------------------------------------------------------- /include/assaultcube/lib/vorbis.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/include/assaultcube/lib/vorbis.lib -------------------------------------------------------------------------------- /include/assaultcube/lib/wldap32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/include/assaultcube/lib/wldap32.lib -------------------------------------------------------------------------------- /include/assaultcube/lib/ws2_32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/include/assaultcube/lib/ws2_32.lib -------------------------------------------------------------------------------- /include/assaultcube/lib/EFX-Util.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/include/assaultcube/lib/EFX-Util.lib -------------------------------------------------------------------------------- /include/assaultcube/lib/OpenAL32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/include/assaultcube/lib/OpenAL32.lib -------------------------------------------------------------------------------- /include/assaultcube/lib/SDL_image.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/include/assaultcube/lib/SDL_image.lib -------------------------------------------------------------------------------- /include/assaultcube/lib/libvorbisfile.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/include/assaultcube/lib/libvorbisfile.lib -------------------------------------------------------------------------------- /include/assaultcube/include/AL/XiphLicense.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdbo/AssaultCube-Multihack/HEAD/include/assaultcube/include/AL/XiphLicense.txt -------------------------------------------------------------------------------- /src/hooks/movelocalplayer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void Base::Hooks::movelocalplayer() 5 | { 6 | return Data::o_movelocalplayer(); 7 | } -------------------------------------------------------------------------------- /src/hacks/Godmode.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | __declspec(naked) void Base::Hacks::Godmode() 5 | { 6 | __asm 7 | { 8 | mov edi, 0x0 9 | ret 10 | } 11 | } -------------------------------------------------------------------------------- /src/hooks/drawscope.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | __declspec(naked) void Base::Hooks::drawscope() 5 | { 6 | __asm 7 | { 8 | jmp Hacks::NoScope 9 | } 10 | } -------------------------------------------------------------------------------- /src/hacks/InstantKill.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | __declspec(naked) void Base::Hacks::InstantKill() 5 | { 6 | __asm 7 | { 8 | mov edi, INT_MAX 9 | ret 10 | } 11 | } -------------------------------------------------------------------------------- /src/hooks/checkheadshot.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | __declspec(naked) void Base::Hooks::checkheadshot(void) 5 | { 6 | __asm 7 | { 8 | jmp Hacks::AlwaysHeadshot 9 | } 10 | } -------------------------------------------------------------------------------- /src/hooks/servertoclient.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void Base::Hooks::servertoclient(int chan, uchar* buf, int len, bool demo) 5 | { 6 | return Data::o_servertoclient(chan, buf, len, demo); 7 | } -------------------------------------------------------------------------------- /src/hooks/mousemove.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void __cdecl Base::Hooks::mousemove(int idx, int idy) 5 | { 6 | if (Data::ShowMenu) 7 | return; 8 | 9 | return Data::o_mousemove(idx, idy); 10 | } -------------------------------------------------------------------------------- /src/hacks/PingChanger.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void Base::Hacks::PingChanger() 5 | { 6 | if (Data::Settings::EnablePingChanger) 7 | { 8 | Data::game.player1->ping = Data::Settings::PingChangerValue; 9 | } 10 | } -------------------------------------------------------------------------------- /AssaultCube-Multihack.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | 6 | -------------------------------------------------------------------------------- /include/assaultcube/include/SDL_name.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SDLname_h_ 3 | #define _SDLname_h_ 4 | 5 | #if defined(__STDC__) || defined(__cplusplus) 6 | #define NeedFunctionPrototypes 1 7 | #endif 8 | 9 | #define SDL_NAME(X) SDL_##X 10 | 11 | #endif /* _SDLname_h_ */ 12 | -------------------------------------------------------------------------------- /src/hacks/NoScope.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | __declspec(naked) void Base::Hacks::NoScope() 5 | { 6 | __asm 7 | { 8 | test Data::Settings::EnableNoScope, 0x1 9 | je orig_code 10 | ret 11 | 12 | orig_code: 13 | jmp Data::o_drawscope 14 | } 15 | } -------------------------------------------------------------------------------- /src/hacks/InfiniteArmor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void Base::Hacks::InfiniteArmor() 5 | { 6 | if (Data::Settings::EnableServerSide && Data::Settings::EnableInfiniteArmor) 7 | { 8 | if (Data::game.player1->armour < 100) 9 | Data::game.player1->armour = 100; 10 | } 11 | } -------------------------------------------------------------------------------- /src/hacks/InfiniteHealth.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void Base::Hacks::InfiniteHealth() 5 | { 6 | if (Data::Settings::EnableServerSide && Data::Settings::EnableInfiniteHealth) 7 | { 8 | if (Data::game.player1->health < 100) 9 | Data::game.player1->health = 100; 10 | } 11 | } -------------------------------------------------------------------------------- /include/assaultcube/include/enet/utility.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file utility.h 3 | @brief ENet utility header 4 | */ 5 | #ifndef __ENET_UTILITY_H__ 6 | #define __ENET_UTILITY_H__ 7 | 8 | #define ENET_MAX(x, y) ((x) > (y) ? (x) : (y)) 9 | #define ENET_MIN(x, y) ((x) < (y) ? (x) : (y)) 10 | 11 | #endif /* __ENET_UTILITY_H__ */ 12 | 13 | -------------------------------------------------------------------------------- /src/hooks/attackphysics.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | __declspec(naked) void Base::Hooks::attackphysics(void) 5 | { 6 | __asm 7 | { 8 | test Data::Settings::EnableNoRecoil, 0x1 9 | jne ignore_recoil 10 | orig_code: 11 | jmp Data::o_attackphysics 12 | 13 | ignore_recoil: 14 | jmp Hacks::NoRecoil 15 | } 16 | } -------------------------------------------------------------------------------- /src/hacks/Bunnyhop.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void Base::Hacks::Bunnyhop() 5 | { 6 | if (Data::Settings::EnableBunnyhop && (Data::WMKeys[Data::Keys::Bhop] && !Data::Settings::BunnyhopToggle || Data::Settings::BunnyhopToggle && Data::Settings::BunnyhopToggleState) && Data::game.player1->onfloor && !Data::game.player1->jumpnext) 7 | Data::game.player1->jumpnext = true; 8 | } -------------------------------------------------------------------------------- /src/hacks/Wallhack.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void Base::Hacks::Wallhack(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void* indices) 5 | { 6 | if (Data::Settings::EnableWallhack) 7 | { 8 | glDisable(GL_DEPTH_TEST); 9 | Data::o_glDrawRangeElements(mode, start, end, count, type, indices); 10 | glEnable(GL_DEPTH_TEST); 11 | } 12 | } -------------------------------------------------------------------------------- /src/hacks/NoRecoil.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | __declspec(naked) void Base::Hacks::NoRecoil() 5 | { 6 | /* 7 | * This function is symbolic 8 | * The entire NoRecoil hack is 9 | * handled inside the 'attackphysics' hook. 10 | * This function only continues the code execution 11 | */ 12 | 13 | __asm 14 | { 15 | jmp Data::p_attackphysics_ret 16 | } 17 | } -------------------------------------------------------------------------------- /include/assaultcube/src/crypto_tools.h: -------------------------------------------------------------------------------- 1 | #ifndef __CRYPTO_TOOLS_H__ 2 | #define __CRYPTO_TOOLS_H__ 3 | #ifdef NULL 4 | #undef NULL 5 | #endif 6 | #define NULL 0 7 | 8 | typedef unsigned int uint; 9 | 10 | #define rndmt(x) ((int)(randomMT()&0xFFFFFF)%(x)) 11 | #define rndscale(x) (float((randomMT()&0xFFFFFF)*double(x)/double(0xFFFFFF))) 12 | 13 | extern void seedMT(uint seed); 14 | extern uint randomMT(void); 15 | #endif 16 | -------------------------------------------------------------------------------- /include/assaultcube/include/enet/types.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file types.h 3 | @brief type definitions for ENet 4 | */ 5 | #ifndef __ENET_TYPES_H__ 6 | #define __ENET_TYPES_H__ 7 | 8 | typedef unsigned char enet_uint8; /**< unsigned 8-bit type */ 9 | typedef unsigned short enet_uint16; /**< unsigned 16-bit type */ 10 | typedef unsigned int enet_uint32; /**< unsigned 32-bit type */ 11 | 12 | #endif /* __ENET_TYPES_H__ */ 13 | 14 | -------------------------------------------------------------------------------- /src/hacks/AlwaysHeadshot.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | __declspec(naked) void Base::Hacks::AlwaysHeadshot() 5 | { 6 | __asm 7 | { 8 | cmp esi, Data::game.player1 9 | jne original_code 10 | test Data::Settings::EnableAlwaysHeadshot, 0x1 11 | je original_code 12 | mov[esp + 0x18], cl 13 | jmp Data::game.doheadshot 14 | 15 | original_code: 16 | jmp Data::o_checkheadshot 17 | } 18 | } -------------------------------------------------------------------------------- /src/hooks/glDrawRangeElements.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void __stdcall Base::Hooks::glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void* indices) 5 | { 6 | if (Data::Settings::EnableWallhack) 7 | Hacks::Wallhack(mode, start, end, count, type, indices); 8 | else 9 | Data::o_glDrawRangeElements(mode, start, end, count, type, indices); 10 | 11 | return; 12 | } -------------------------------------------------------------------------------- /src/hacks/FullBright.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static bool bForced = false; 5 | 6 | void Base::Hacks::FullBright() 7 | { 8 | if (Data::Settings::EnableFullBright) 9 | { 10 | if (!(*Data::game.fullbright)) 11 | { 12 | Data::game.fullbrightlight(); 13 | bForced = true; 14 | } 15 | } 16 | 17 | else if (bForced) 18 | { 19 | Data::game.calclight(); 20 | bForced = false; 21 | } 22 | } -------------------------------------------------------------------------------- /include/assaultcube/src/i18n.h: -------------------------------------------------------------------------------- 1 | // internationalization and localization 2 | 3 | // localization manager 4 | struct i18nmanager 5 | { 6 | const char *domain; 7 | const char *basepath; 8 | char *locale; 9 | 10 | i18nmanager(const char *domain, const char *basepath); // initialize locale system 11 | 12 | }; 13 | 14 | extern char *lang; 15 | 16 | enum { CF_NONE = 0, CF_OK, CF_FAIL, CF_SIZE }; 17 | 18 | #define FONTSTART 33 19 | #define FONTCHARS 94 20 | -------------------------------------------------------------------------------- /src/hooks/ShowCursor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static bool bEnabled = false; 5 | 6 | int SDLCALL Base::Hooks::ShowCursor(int toggle) 7 | { 8 | if (Data::ShowMenu) 9 | { 10 | SDL_WM_GrabInput(SDL_GRAB_OFF); 11 | Data::oShowCursor(SDL_ENABLE); 12 | bEnabled = true; 13 | } 14 | 15 | else if(bEnabled) 16 | { 17 | SDL_WM_GrabInput(SDL_GRAB_ON); 18 | Data::oShowCursor(SDL_DISABLE); 19 | bEnabled = false; 20 | } 21 | 22 | return 0; 23 | } -------------------------------------------------------------------------------- /src/pch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef PCH_H 3 | #define PCH_H 4 | 5 | #ifndef WIN32_LEAN_AND_MEAN 6 | #define WIN32_LEAN_AND_MEAN 7 | #endif 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #endif -------------------------------------------------------------------------------- /src/hacks/InfiniteAmmo.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void Base::Hacks::InfiniteAmmo() 5 | { 6 | if (Data::Settings::EnableServerSide && Data::Settings::EnableInfiniteAmmo) 7 | { 8 | int wpn_count = sizeof(Data::game.player1->weapons)/sizeof(Data::game.player1->weapons[0]); 9 | for (int i = 0; i < wpn_count; i++) 10 | { 11 | weapon* wpn = Data::game.player1->weapons[i]; 12 | if (wpn->mag < wpn->info.magsize) 13 | wpn->mag = wpn->info.magsize; 14 | if (wpn->ammo < wpn->info.magsize) 15 | wpn->ammo = wpn->info.magsize; 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/hooks/drawcrosshair.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /* 5 | //This function is causing crashes 6 | void Base::Hooks::drawcrosshair(playerent* p, int n, struct color* c, float size) 7 | { 8 | if(!Data::Settings::EnableCrosshair) 9 | return Data::o_drawcrosshair(p, n, c, size); 10 | } 11 | */ 12 | 13 | __declspec(naked) void Base::Hooks::drawcrosshair(void) 14 | { 15 | __asm 16 | { 17 | test Data::Settings::EnableCrosshair, 0x1 18 | jne ignore_draw 19 | 20 | orig_code: 21 | mov edi, Data::o_drawcrosshair 22 | jmp edi 23 | 24 | ignore_draw: 25 | ret 26 | } 27 | } -------------------------------------------------------------------------------- /src/hacks/FlyHack.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static bool bEnabled = false; 5 | 6 | void Base::Hacks::FlyHack() 7 | { 8 | if (Data::Settings::EnableFlyHack && ((Data::Settings::FlyHackToggle && Data::Settings::FlyHackToggleState) || (!Data::Settings::FlyHackToggle && Data::WMKeys[Data::Keys::FlyHack]))) 9 | { 10 | if (Data::game.player1->spectatemode != SM_FLY) 11 | { 12 | Data::game.player1->spectatemode = SM_FLY; 13 | bEnabled = true; 14 | } 15 | } 16 | 17 | else if(bEnabled) 18 | { 19 | Data::game.player1->spectatemode = SM_NONE; 20 | bEnabled = false; 21 | } 22 | } -------------------------------------------------------------------------------- /include/assaultcube/include/enet/time.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file time.h 3 | @brief ENet time constants and macros 4 | */ 5 | #ifndef __ENET_TIME_H__ 6 | #define __ENET_TIME_H__ 7 | 8 | #define ENET_TIME_OVERFLOW 86400000 9 | 10 | #define ENET_TIME_LESS(a, b) ((a) - (b) >= ENET_TIME_OVERFLOW) 11 | #define ENET_TIME_GREATER(a, b) ((b) - (a) >= ENET_TIME_OVERFLOW) 12 | #define ENET_TIME_LESS_EQUAL(a, b) (! ENET_TIME_GREATER (a, b)) 13 | #define ENET_TIME_GREATER_EQUAL(a, b) (! ENET_TIME_LESS (a, b)) 14 | 15 | #define ENET_TIME_DIFFERENCE(a, b) ((a) - (b) >= ENET_TIME_OVERFLOW ? (b) - (a) : (a) - (b)) 16 | 17 | #endif /* __ENET_TIME_H__ */ 18 | 19 | -------------------------------------------------------------------------------- /include/assaultcube/include/enet/callbacks.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file callbacks.h 3 | @brief ENet callbacks 4 | */ 5 | #ifndef __ENET_CALLBACKS_H__ 6 | #define __ENET_CALLBACKS_H__ 7 | 8 | #include 9 | 10 | typedef struct _ENetCallbacks 11 | { 12 | void * (ENET_CALLBACK * malloc) (size_t size); 13 | void (ENET_CALLBACK * free) (void * memory); 14 | void (ENET_CALLBACK * no_memory) (void); 15 | } ENetCallbacks; 16 | 17 | /** @defgroup callbacks ENet internal callbacks 18 | @{ 19 | @ingroup private 20 | */ 21 | extern void * enet_malloc (size_t); 22 | extern void enet_free (void *); 23 | 24 | /** @} */ 25 | 26 | #endif /* __ENET_CALLBACKS_H__ */ 27 | 28 | -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | DWORD WINAPI EntryThread(LPVOID lpReserved) 5 | { 6 | Base::Init((HMODULE)lpReserved); 7 | return TRUE; 8 | } 9 | 10 | DWORD WINAPI ExitThread(LPVOID lpReserved) 11 | { 12 | FreeLibraryAndExitThread(Base::Data::hModule, TRUE); 13 | return TRUE; 14 | } 15 | 16 | BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved) 17 | { 18 | switch (dwReason) 19 | { 20 | case DLL_THREAD_ATTACH: break; 21 | case DLL_THREAD_DETACH: break; 22 | case DLL_PROCESS_ATTACH: CreateThread(nullptr, 0, EntryThread, hModule, 0, nullptr); break; 23 | case DLL_PROCESS_DETACH: Base::Shutdown(); break; 24 | } 25 | return TRUE; 26 | } -------------------------------------------------------------------------------- /src/hacks/AutoGuns.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static bool bModified[sizeof(Base::Data::game.player1->weapons)/sizeof(Base::Data::game.player1->weapons[0])]; 5 | 6 | void Base::Hacks::AutoGuns() 7 | { 8 | if (Data::Settings::EnableAutoGuns) 9 | { 10 | if (!Data::game.player1->weaponsel->info.isauto) 11 | { 12 | bModified[Data::game.player1->weaponsel->type] = true; 13 | *(bool*)&Data::game.player1->weaponsel->info.isauto = true; 14 | } 15 | } 16 | 17 | else if (bModified[Data::game.player1->weaponsel->type]) 18 | { 19 | *(bool*)&Data::game.player1->weaponsel->info.isauto = !Data::game.player1->weaponsel->info.isauto; 20 | bModified[Data::game.player1->weaponsel->type] = false; 21 | } 22 | } -------------------------------------------------------------------------------- /assets/font/create_font_headers.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | for root, dirnames, files in os.walk("."): 4 | for file in files: 5 | if file.endswith(".ttf"): 6 | file_handle = open(file, "rb") 7 | file_data = file_handle.read() 8 | file_handle.close() 9 | 10 | file_data_str = "" 11 | 12 | for byte in file_data: 13 | file_data_str += f"{hex(byte)}, " 14 | 15 | file_data_str = "".join(file_data_str.rsplit(", ", 1)) #Remove last ', ' 16 | 17 | font_name = "".join(file.rsplit(".ttf", 1)) 18 | font_name = font_name.replace("-", "_") 19 | cpp_header = "#pragma once\nconst unsigned char %s[] = { %s };\n" %(font_name, file_data_str) 20 | 21 | header_file = f"{font_name}.h" 22 | header_handle = open(header_file, "w") 23 | header_handle.write(cpp_header) 24 | header_handle.close() -------------------------------------------------------------------------------- /src/hacks/NoGunWait.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static int OriginalThrowWait = 0; 5 | 6 | void Base::Hacks::NoGunWait() 7 | { 8 | if (Data::Settings::EnableServerSide && Data::Settings::EnableNoGunWait) 9 | { 10 | if (Data::game.player1->weaponsel->gunwait > 0) 11 | Data::game.player1->weaponsel->gunwait = 0; 12 | 13 | if (Data::game.player1->weaponsel->type == GUN_GRENADE) 14 | { 15 | if (!OriginalThrowWait) 16 | ((grenades*)Data::game.player1->weaponsel)->throwwait; 17 | 18 | *(int*)&((grenades*)Data::game.player1->weaponsel)->throwwait = 0; 19 | } 20 | } 21 | 22 | else if (OriginalThrowWait && ((grenades*)Data::game.player1->weaponsel)->throwwait != OriginalThrowWait) 23 | { 24 | *(int*)&((grenades*)Data::game.player1->weaponsel)->throwwait = OriginalThrowWait; 25 | } 26 | } -------------------------------------------------------------------------------- /src/hacks/TeleportItems.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void Base::Hacks::TeleportItems(entity& p_item) 5 | { 6 | if (Data::Settings::EnableTeleportItems) 7 | { 8 | if ( 9 | Data::Settings::TeleportItemsHealth && p_item.type == I_HEALTH || 10 | Data::Settings::TeleportItemsArmor && p_item.type == I_ARMOUR || 11 | Data::Settings::TeleportItemsArmor && p_item.type == I_HELMET || 12 | Data::Settings::TeleportItemsGrenade && p_item.type == I_GRENADE || 13 | Data::Settings::TeleportItemsAmmo && p_item.type == I_AMMO || 14 | Data::Settings::TeleportItemsClips && p_item.type == I_CLIPS || 15 | Data::Settings::TeleportItemsAkimbo && p_item.type == I_AKIMBO 16 | ) 17 | { 18 | p_item.x = Data::game.player1->o.x; 19 | p_item.y = Data::game.player1->o.y; 20 | p_item.z = Data::game.player1->o.z - Data::game.player1->eyeheight; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/hacks/Speedhack.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void Base::Hacks::Speedhack() 5 | { 6 | if (Data::Settings::EnableSpeedhack && ((Data::Settings::SpeedhackToggle && Data::Settings::SpeedhackToggleState) || (!Data::Settings::SpeedhackToggle && Data::WMKeys[Data::Keys::Speedhack]))) 7 | { 8 | float speed_val = Data::game.player1->maxspeed * Data::Settings::SpeedhackValue; 9 | 10 | if (!(Data::game.player1->k_up && Data::game.player1->k_down)) 11 | { 12 | if (Data::game.player1->k_up) 13 | Data::game.player1->move = speed_val; 14 | if (Data::game.player1->k_down) 15 | Data::game.player1->move = -speed_val; 16 | } 17 | 18 | if (!(Data::game.player1->k_left && Data::game.player1->k_right)) 19 | { 20 | if (Data::game.player1->k_left) 21 | Data::game.player1->strafe = speed_val; 22 | if (Data::game.player1->k_right) 23 | Data::game.player1->strafe = -speed_val; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /include/assaultcube/include/SDL_copying.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | -------------------------------------------------------------------------------- /src/hooks/c2sinfo.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void Base::Hooks::c2sinfo(playerent* d) 5 | { 6 | Hacks::Teleport(); 7 | Hacks::Speedhack(); 8 | Hacks::Triggerbot(); 9 | Hacks::FlyHack(); 10 | Hacks::Bunnyhop(); 11 | Hacks::Aimbot(); 12 | Hacks::InfiniteAmmo(); 13 | Hacks::NoGunWait(); 14 | Hacks::InfiniteArmor(); 15 | Hacks::InfiniteHealth(); 16 | Hacks::AutoGuns(); 17 | Hacks::FullBright(); 18 | Hacks::NameChanger(); 19 | Hacks::RadarHack(); 20 | Hacks::PingChanger(); 21 | Hacks::ChatSpam(); 22 | 23 | for (int i = 0; Data::game.players && Data::game.players->inrange(i); i++) 24 | { 25 | playerent* ent = Data::game.players->operator[](i); 26 | if (!ent || ent->state != CS_ALIVE) continue; 27 | 28 | Hacks::TeleportPlayers(ent); 29 | } 30 | 31 | for (int i = 0; Data::game.ents->inrange(i); i++) 32 | { 33 | entity& ent = Data::game.ents->operator[](i); 34 | Hacks::TeleportItems(ent); 35 | } 36 | 37 | return Data::o_c2sinfo(d); 38 | } -------------------------------------------------------------------------------- /src/hacks/TeleportPlayers.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void Base::Hacks::TeleportPlayers(playerent* p_ent) 5 | { 6 | if (Data::Settings::EnableTeleportPlayers) 7 | { 8 | if (Data::Settings::TeleportPlayersTeam && p_ent->team == Data::game.player1->team && (m_teammode || m_coop) || Data::Settings::TeleportPlayersEnemy && p_ent->team != Data::game.player1->team) 9 | { 10 | vec pos = Data::game.player1->o; 11 | float yaw = Data::game.player1->yaw; 12 | yaw -= 90.0f; 13 | if (yaw < 0.0f) yaw += 360.0f; 14 | pos.x += cos(yaw * (PI / 180.0f)) * Data::Settings::TeleportPlayersDistance; 15 | pos.y += sin(yaw * (PI / 180.0f)) * Data::Settings::TeleportPlayersDistance; 16 | p_ent->o = pos; 17 | 18 | //Make teleported player look at localplayer 19 | 20 | float ent_yaw = Data::game.player1->yaw + 180.0f; 21 | if (ent_yaw > 360.0f) ent_yaw -= 360.0f; 22 | 23 | p_ent->yaw = ent_yaw; 24 | p_ent->pitch = Data::game.player1->pitch; 25 | } 26 | 27 | } 28 | } -------------------------------------------------------------------------------- /src/hacks/ChatSpam.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static clock_t LastMessage = 0; 5 | 6 | void Base::Hacks::ChatSpam() 7 | { 8 | if (Data::Settings::EnableChatSpam) 9 | { 10 | clock_t now = clock(); 11 | 12 | if (!LastMessage) LastMessage = now; 13 | if (Data::Settings::ChatSpamDelay && now - LastMessage < (clock_t)(Data::Settings::ChatSpamDelayValue * 1000.0f)) return; 14 | 15 | char Message[sizeof(Data::Settings::ChatSpamText) + 2]; 16 | switch (Data::Settings::ChatSpamType) 17 | { 18 | case 0: //None 19 | break; 20 | case 1: //Team 21 | snprintf(Message, sizeof(Message), "%s%s", "% ", Data::Settings::ChatSpamText); 22 | Data::game.toserver(Message); 23 | LastMessage = now; 24 | break; 25 | case 2: //All 26 | snprintf(Message, sizeof(Message), " %s", Data::Settings::ChatSpamText); 27 | Data::game.toserver(Message); 28 | LastMessage = now; 29 | break; 30 | default: 31 | Data::Settings::ChatSpamType = 0; 32 | break; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/hooks/dodamage.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static playerent* actor = nullptr; 5 | static playerent* receiver = nullptr; 6 | 7 | __declspec(naked) void Base::Hooks::dodamage(void) 8 | { 9 | __asm 10 | { 11 | mov actor, edi 12 | mov receiver, esi 13 | jmp Data::o_dodamage 14 | } 15 | } 16 | 17 | __declspec(naked) void Base::Hooks::dodamage2(void) 18 | { 19 | __asm 20 | { 21 | test Data::Settings::EnableServerSide, 0x1 22 | je original_code 23 | push eax 24 | mov eax, receiver 25 | cmp eax, Data::game.player1 26 | pop eax 27 | jne instant_kill 28 | godmode: 29 | test Data::Settings::EnableGodmode, 0x1 30 | je original_code 31 | call Hacks::Godmode 32 | jmp original_code 33 | 34 | instant_kill: 35 | test Data::Settings::EnableInstantKill, 0x1 36 | je original_code 37 | push eax 38 | mov eax, actor 39 | cmp eax, Data::game.player1 40 | pop eax 41 | jne original_code 42 | call Hacks::InstantKill 43 | 44 | original_code: 45 | jmp Data::o_dodamage2 46 | } 47 | } -------------------------------------------------------------------------------- /include/assaultcube/include/SDL_getenv.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** @file SDL_getenv.h 24 | * @deprecated Use SDL_stdinc.h instead 25 | */ 26 | 27 | /* DEPRECATED */ 28 | #include "SDL_stdinc.h" 29 | -------------------------------------------------------------------------------- /include/assaultcube/include/SDL_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** @file SDL_types.h 24 | * @deprecated Use SDL_stdinc.h instead. 25 | */ 26 | 27 | /* DEPRECATED */ 28 | #include "SDL_stdinc.h" 29 | -------------------------------------------------------------------------------- /include/assaultcube/include/SDL_byteorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** 24 | * @file SDL_byteorder.h 25 | * @deprecated Use SDL_endian.h instead 26 | */ 27 | 28 | /* DEPRECATED */ 29 | #include "SDL_endian.h" 30 | -------------------------------------------------------------------------------- /src/hacks/Teleport.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void Base::Hacks::Teleport() 5 | { 6 | if (Data::Settings::EnableTeleport) 7 | { 8 | vec* PlayerPos = (vec*)& Data::game.player1->newpos; 9 | if (Data::Settings::TeleportSaveQueued) 10 | { 11 | Data::Settings::TeleportPosition[0] = PlayerPos->x; 12 | Data::Settings::TeleportPosition[1] = PlayerPos->y; 13 | Data::Settings::TeleportPosition[2] = PlayerPos->z; 14 | Data::Settings::TeleportSaveQueued = false; 15 | } 16 | 17 | if (Data::Settings::TeleportQueued) 18 | { 19 | PlayerPos->x = Data::Settings::TeleportPosition[0]; 20 | PlayerPos->y = Data::Settings::TeleportPosition[1]; 21 | PlayerPos->z = Data::Settings::TeleportPosition[2]; 22 | Data::Settings::TeleportQueued = false; 23 | } 24 | 25 | if (Data::Settings::TeleportForce[0]) 26 | PlayerPos->x = Data::Settings::TeleportPosition[0]; 27 | 28 | if (Data::Settings::TeleportForce[1]) 29 | PlayerPos->y = Data::Settings::TeleportPosition[1]; 30 | 31 | if (Data::Settings::TeleportForce[2]) 32 | PlayerPos->z = Data::Settings::TeleportPosition[2]; 33 | } 34 | } -------------------------------------------------------------------------------- /include/imgui/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2021 Omar Cornut 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /AssaultCube-Multihack.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.28803.202 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AssaultCube-Multihack", "AssaultCube-Multihack.vcxproj", "{C4BCE33D-DE51-4D37-8BC4-63473F4A329A}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x86 = Debug|x86 11 | Release|x86 = Release|x86 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {C4BCE33D-DE51-4D37-8BC4-63473F4A329A}.Debug|x86.ActiveCfg = Debug|Win32 15 | {C4BCE33D-DE51-4D37-8BC4-63473F4A329A}.Debug|x86.Build.0 = Debug|Win32 16 | {C4BCE33D-DE51-4D37-8BC4-63473F4A329A}.Release|x86.ActiveCfg = Release|Win32 17 | {C4BCE33D-DE51-4D37-8BC4-63473F4A329A}.Release|x86.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {6B899A79-530C-4B9E-95E4-204E772C26B1} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /include/assaultcube/src/bot/ac_bot.h: -------------------------------------------------------------------------------- 1 | // 2 | // C++ Implementation: bot 3 | // 4 | // Description: 5 | // 6 | // Header specific for AC_CUBE 7 | // 8 | // Author: Rick 9 | // 10 | // 11 | // 12 | 13 | #ifndef AC_BOT_H 14 | #define AC_BOT_H 15 | 16 | #ifdef AC_CUBE 17 | 18 | #define MAX_WEAPONS 10 19 | 20 | class CACBot: public CBot 21 | { 22 | public: 23 | friend class CBotManager; 24 | friend class CWaypointClass; 25 | 26 | virtual void CheckItemPickup(void); 27 | 28 | // AI Functions 29 | virtual bool ChoosePreferredWeapon(void); 30 | void Reload(int Gun); 31 | virtual entity *SearchForEnts(bool bUseWPs, float flRange=9999.0f, 32 | float flMaxHeight=JUMP_HEIGHT); 33 | virtual bool HeadToTargetEnt(void); 34 | virtual bool DoSPStuff(void); 35 | 36 | virtual void Spawn(void); 37 | }; 38 | 39 | inline void AddScreenText(const char *t, ...) {} // UNDONE 40 | inline void AddDebugText(const char *t, ...) 41 | { 42 | #ifdef _DEBUG 43 | va_list v; 44 | va_start(v, t); 45 | conoutf(t,v); 46 | va_end(v); 47 | #endif 48 | } 49 | 50 | 51 | 52 | 53 | #endif 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /src/hacks/Triggerbot.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static bool bEnabled = false; 5 | static clock_t LastShot = 0; 6 | 7 | void Base::Hacks::Triggerbot() 8 | { 9 | if (Data::Settings::EnableTriggerbot) 10 | { 11 | clock_t now = clock(); 12 | 13 | playerent* pCrosshairPlayer = Data::game.playerincrosshair(); 14 | 15 | if (!LastShot && pCrosshairPlayer) LastShot = now; 16 | if (!pCrosshairPlayer) LastShot = 0; 17 | 18 | if ((pCrosshairPlayer && pCrosshairPlayer->state == CS_ALIVE && !Data::game.player1->attacking && ((Data::Settings::TriggerbotDelay && (now - LastShot >= (clock_t)(Data::Settings::TriggerbotDelayValue * 1000.0f))) || !Data::Settings::TriggerbotDelay) && (pCrosshairPlayer->team != Data::game.player1->team || !m_teammode && !m_coop)) && (!Data::Settings::TriggerbotToggle && Data::WMKeys[Data::Keys::Triggerbot] || Data::Settings::TriggerbotToggle && Data::Settings::TriggerbotToggleState)) 19 | { 20 | Data::game.player1->attacking = true; 21 | LastShot = now; 22 | bEnabled = true; 23 | } 24 | else if (bEnabled) 25 | { 26 | Data::game.player1->attacking = false; 27 | LastShot = 0; 28 | bEnabled = false; 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /include/assaultcube/include/enet/list.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file list.h 3 | @brief ENet list management 4 | */ 5 | #ifndef __ENET_LIST_H__ 6 | #define __ENET_LIST_H__ 7 | 8 | #include 9 | 10 | typedef struct _ENetListNode 11 | { 12 | struct _ENetListNode * next; 13 | struct _ENetListNode * previous; 14 | } ENetListNode; 15 | 16 | typedef ENetListNode * ENetListIterator; 17 | 18 | typedef struct _ENetList 19 | { 20 | ENetListNode sentinel; 21 | } ENetList; 22 | 23 | extern void enet_list_clear (ENetList *); 24 | 25 | extern ENetListIterator enet_list_insert (ENetListIterator, void *); 26 | extern void * enet_list_remove (ENetListIterator); 27 | extern ENetListIterator enet_list_move (ENetListIterator, void *, void *); 28 | 29 | extern size_t enet_list_size (ENetList *); 30 | 31 | #define enet_list_begin(list) ((list) -> sentinel.next) 32 | #define enet_list_end(list) (& (list) -> sentinel) 33 | 34 | #define enet_list_empty(list) (enet_list_begin (list) == enet_list_end (list)) 35 | 36 | #define enet_list_next(iterator) ((iterator) -> next) 37 | #define enet_list_previous(iterator) ((iterator) -> previous) 38 | 39 | #define enet_list_front(list) ((void *) (list) -> sentinel.next) 40 | #define enet_list_back(list) ((void *) (list) -> sentinel.previous) 41 | 42 | #endif /* __ENET_LIST_H__ */ 43 | 44 | -------------------------------------------------------------------------------- /src/hacks/Aimbot.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void Base::Hacks::Aimbot() 5 | { 6 | if (Data::Settings::EnableAimbot && (Data::WMKeys[Data::Keys::Aimbot] && !Data::Settings::AimbotToggle || Data::Settings::AimbotToggle && Data::Settings::AimbotToggleState)) 7 | { 8 | playerent* p_target = nullptr; 9 | switch (Data::Settings::AimbotTargetPreference) 10 | { 11 | case 0: 12 | p_target = GetClosestTarget(); 13 | break; 14 | case 1: 15 | p_target = GetCrosshairClosestTarget(); 16 | break; 17 | default: 18 | Data::Settings::AimbotTargetPreference = 0; 19 | break; 20 | } 21 | 22 | if (!p_target) return; 23 | 24 | vec head = p_target->head; 25 | 26 | if (head.x == -1.0f && head.x == -1.0f && head.z == -1.0f) 27 | head = p_target->o; 28 | 29 | vec Angles = CalcAngles(Data::game.player1->o, head); 30 | 31 | if (Data::Settings::AimbotSmooth) 32 | { 33 | vec SmoothAngles = {}; 34 | SmoothAngles.x = Angles.x - Data::game.player1->yaw; 35 | SmoothAngles.y = Angles.y - Data::game.player1->pitch; 36 | Data::game.player1->yaw += SmoothAngles.x / Data::Settings::AimbotSmoothValue; 37 | Data::game.player1->pitch += SmoothAngles.y / Data::Settings::AimbotSmoothValue; 38 | } 39 | 40 | else 41 | { 42 | Data::game.player1->yaw = Angles.x; 43 | Data::game.player1->pitch = Angles.y; 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /include/assaultcube/include/enet/unix.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file unix.h 3 | @brief ENet Unix header 4 | */ 5 | #ifndef __ENET_UNIX_H__ 6 | #define __ENET_UNIX_H__ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | typedef int ENetSocket; 15 | 16 | enum 17 | { 18 | ENET_SOCKET_NULL = -1 19 | }; 20 | 21 | #define ENET_HOST_TO_NET_16(value) (htons (value)) /**< macro that converts host to net byte-order of a 16-bit value */ 22 | #define ENET_HOST_TO_NET_32(value) (htonl (value)) /**< macro that converts host to net byte-order of a 32-bit value */ 23 | 24 | #define ENET_NET_TO_HOST_16(value) (ntohs (value)) /**< macro that converts net to host byte-order of a 16-bit value */ 25 | #define ENET_NET_TO_HOST_32(value) (ntohl (value)) /**< macro that converts net to host byte-order of a 32-bit value */ 26 | 27 | typedef struct 28 | { 29 | void * data; 30 | size_t dataLength; 31 | } ENetBuffer; 32 | 33 | #define ENET_CALLBACK 34 | 35 | #define ENET_API extern 36 | 37 | typedef fd_set ENetSocketSet; 38 | 39 | #define ENET_SOCKETSET_EMPTY(sockset) FD_ZERO (& (sockset)) 40 | #define ENET_SOCKETSET_ADD(sockset, socket) FD_SET (socket, & (sockset)) 41 | #define ENET_SOCKETSET_REMOVE(sockset, socket) FD_CLEAR (socket, & (sockset)) 42 | #define ENET_SOCKETSET_CHECK(sockset, socket) FD_ISSET (socket, & (sockset)) 43 | 44 | #endif /* __ENET_UNIX_H__ */ 45 | 46 | -------------------------------------------------------------------------------- /include/assaultcube/src/winserviceinstaller.h: -------------------------------------------------------------------------------- 1 | // minimal windows service installer 2 | 3 | class winserviceinstaller 4 | { 5 | 6 | private: 7 | LPCSTR name; 8 | LPCSTR displayName; 9 | LPCSTR path; 10 | 11 | SC_HANDLE scm; 12 | 13 | public: 14 | winserviceinstaller(LPCSTR name, LPCSTR displayName, LPCSTR path) : name(name), displayName(displayName), path(path), scm(NULL) 15 | { 16 | } 17 | 18 | ~winserviceinstaller() 19 | { 20 | CloseManager(); 21 | } 22 | 23 | bool OpenManger() 24 | { 25 | return ((scm = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS)) != NULL); 26 | } 27 | 28 | void CloseManager() 29 | { 30 | if(scm) CloseServiceHandle(scm); 31 | } 32 | 33 | int IsInstalled() 34 | { 35 | if(!scm) return -1; 36 | SC_HANDLE svc = OpenService(scm, name, SC_MANAGER_CONNECT); 37 | bool installed = svc != NULL; 38 | CloseServiceHandle(svc); 39 | return installed ? 1 : 0; 40 | } 41 | 42 | int Install() 43 | { 44 | if(!scm) return -1; 45 | SC_HANDLE svc = CreateService(scm, name, displayName, SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL, path, NULL, NULL, NULL, NULL, NULL); 46 | if(svc == NULL) return 0; 47 | else 48 | { 49 | CloseServiceHandle(svc); 50 | return 1; 51 | } 52 | } 53 | }; 54 | 55 | -------------------------------------------------------------------------------- /include/assaultcube/include/jconfig.h: -------------------------------------------------------------------------------- 1 | /* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */ 2 | /* see jconfig.doc for explanations */ 3 | 4 | #define HAVE_PROTOTYPES 5 | #define HAVE_UNSIGNED_CHAR 6 | #define HAVE_UNSIGNED_SHORT 7 | /* #define void char */ 8 | /* #define const */ 9 | #undef CHAR_IS_UNSIGNED 10 | #define HAVE_STDDEF_H 11 | #define HAVE_STDLIB_H 12 | #undef NEED_BSD_STRINGS 13 | #undef NEED_SYS_TYPES_H 14 | #undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */ 15 | #undef NEED_SHORT_EXTERNAL_NAMES 16 | #undef INCOMPLETE_TYPES_BROKEN 17 | 18 | #if 0 19 | /* Define "boolean" as unsigned char, not int, per Windows custom */ 20 | typedef unsigned char boolean; 21 | #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ 22 | #else 23 | #define boolean jboolean 24 | #endif 25 | 26 | #ifdef JPEG_INTERNALS 27 | 28 | #undef RIGHT_SHIFT_IS_UNSIGNED 29 | 30 | #endif /* JPEG_INTERNALS */ 31 | 32 | #ifdef JPEG_CJPEG_DJPEG 33 | 34 | #define BMP_SUPPORTED /* BMP image file format */ 35 | #define GIF_SUPPORTED /* GIF image file format */ 36 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 37 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 38 | #define TARGA_SUPPORTED /* Targa image file format */ 39 | 40 | #define TWO_FILE_COMMANDLINE /* optional */ 41 | #define USE_SETMODE /* Microsoft has setmode() */ 42 | #undef NEED_SIGNAL_CATCHER 43 | #undef DONT_USE_B_MODE 44 | #undef PROGRESS_REPORT /* optional */ 45 | 46 | #endif /* JPEG_CJPEG_DJPEG */ 47 | -------------------------------------------------------------------------------- /include/assaultcube/include/curl/stdcheaders.h: -------------------------------------------------------------------------------- 1 | #ifndef __STDC_HEADERS_H 2 | #define __STDC_HEADERS_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | * $Id: stdcheaders.h,v 1.8 2004/01/07 09:19:34 bagder Exp $ 24 | ***************************************************************************/ 25 | 26 | #include 27 | 28 | size_t fread (void *, size_t, size_t, FILE *); 29 | size_t fwrite (const void *, size_t, size_t, FILE *); 30 | 31 | int strcasecmp(const char *, const char *); 32 | int strncasecmp(const char *, const char *, size_t); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AssaultCube Multihack 2 | Multihack for Assault Cube (1.2.0.2). 3 | Based on rdbo/AssaultCube-SDK-DLL-Template 4 | 5 | # License 6 | Read the `LICENSE` file. 7 | 8 | # How to use 9 | Open the solution on Visual Studio. 10 | Compile as Release (x86). 11 | Inject the DLL at 'build/Win32/Release/AssaultCube-Multihack.dll' into the game. 12 | Enjoy. 13 | 14 | # Screenshots 15 | 16 | 17 |
18 | 19 | 20 |
21 | 22 | 23 |
24 | 25 | 26 |
27 | -------------------------------------------------------------------------------- /include/assaultcube/include/utf8.h: -------------------------------------------------------------------------------- 1 | // Copyright 2006 Nemanja Trifunovic 2 | 3 | /* 4 | Permission is hereby granted, free of charge, to any person or organization 5 | obtaining a copy of the software and accompanying documentation covered by 6 | this license (the "Software") to use, reproduce, display, distribute, 7 | execute, and transmit the Software, and to prepare derivative works of the 8 | Software, and to permit third-parties to whom the Software is furnished to 9 | do so, all subject to the following: 10 | 11 | The copyright notices in the Software and this entire statement, including 12 | the above license grant, this restriction and the following disclaimer, 13 | must be included in all copies of the Software, in whole or in part, and 14 | all derivative works of the Software, unless such copies or derivative 15 | works are solely in the form of machine-executable object code generated by 16 | a source language processor. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 21 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 22 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 23 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 24 | DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | 28 | #ifndef UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731 29 | #define UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731 30 | 31 | #include "utf8/checked.h" 32 | #include "utf8/unchecked.h" 33 | 34 | #endif // header guard 35 | -------------------------------------------------------------------------------- /include/assaultcube/include/SDL_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | #ifndef _SDL_config_h 24 | #define _SDL_config_h 25 | 26 | #include "SDL_platform.h" 27 | 28 | /* Add any platform that doesn't build using the configure system */ 29 | #if defined(__DREAMCAST__) 30 | #include "SDL_config_dreamcast.h" 31 | #elif defined(__MACOS__) 32 | #include "SDL_config_macos.h" 33 | #elif defined(__MACOSX__) 34 | #include "SDL_config_macosx.h" 35 | #elif defined(__SYMBIAN32__) 36 | #include "SDL_config_symbian.h" /* must be before win32! */ 37 | #elif defined(__WIN32__) 38 | #include "SDL_config_win32.h" 39 | #elif defined(__OS2__) 40 | #include "SDL_config_os2.h" 41 | #else 42 | #include "SDL_config_minimal.h" 43 | #endif /* platform config */ 44 | 45 | #endif /* _SDL_config_h */ 46 | -------------------------------------------------------------------------------- /include/assaultcube/include/enet/win32.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file win32.h 3 | @brief ENet Win32 header 4 | */ 5 | #ifndef __ENET_WIN32_H__ 6 | #define __ENET_WIN32_H__ 7 | 8 | #ifdef ENET_BUILDING_LIB 9 | #pragma warning (disable: 4996) // 'strncpy' was declared deprecated 10 | #pragma warning (disable: 4267) // size_t to int conversion 11 | #pragma warning (disable: 4244) // 64bit to 32bit int 12 | #pragma warning (disable: 4018) // signed/unsigned mismatch 13 | #endif 14 | 15 | #include 16 | #include 17 | 18 | typedef SOCKET ENetSocket; 19 | 20 | enum 21 | { 22 | ENET_SOCKET_NULL = INVALID_SOCKET 23 | }; 24 | 25 | #define ENET_HOST_TO_NET_16(value) (htons (value)) 26 | #define ENET_HOST_TO_NET_32(value) (htonl (value)) 27 | 28 | #define ENET_NET_TO_HOST_16(value) (ntohs (value)) 29 | #define ENET_NET_TO_HOST_32(value) (ntohl (value)) 30 | 31 | typedef struct 32 | { 33 | size_t dataLength; 34 | void * data; 35 | } ENetBuffer; 36 | 37 | #define ENET_CALLBACK __cdecl 38 | 39 | #if defined ENET_DLL 40 | #if defined ENET_BUILDING_LIB 41 | #define ENET_API __declspec( dllexport ) 42 | #else 43 | #define ENET_API __declspec( dllimport ) 44 | #endif /* ENET_BUILDING_LIB */ 45 | #else /* !ENET_DLL */ 46 | #define ENET_API extern 47 | #endif /* ENET_DLL */ 48 | 49 | typedef fd_set ENetSocketSet; 50 | 51 | #define ENET_SOCKETSET_EMPTY(sockset) FD_ZERO (& (sockset)) 52 | #define ENET_SOCKETSET_ADD(sockset, socket) FD_SET (socket, & (sockset)) 53 | #define ENET_SOCKETSET_REMOVE(sockset, socket) FD_CLEAR (socket, & (sockset)) 54 | #define ENET_SOCKETSET_CHECK(sockset, socket) FD_ISSET (socket, & (sockset)) 55 | 56 | #endif /* __ENET_WIN32_H__ */ 57 | 58 | 59 | -------------------------------------------------------------------------------- /include/assaultcube/include/close_code.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** 24 | * @file close_code.h 25 | * This file reverses the effects of begin_code.h and should be included 26 | * after you finish any function and structure declarations in your headers 27 | */ 28 | 29 | #undef _begin_code_h 30 | 31 | /** 32 | * @file close_code.h 33 | * Reset structure packing at previous byte alignment 34 | */ 35 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__) 36 | #ifdef __BORLANDC__ 37 | #pragma nopackwarning 38 | #endif 39 | #if (defined(__MWERKS__) && defined(__MACOS__)) 40 | #pragma options align=reset 41 | #pragma enumsalwaysint reset 42 | #else 43 | #pragma pack(pop) 44 | #endif 45 | #endif /* Compiler needs structure packing set */ 46 | 47 | -------------------------------------------------------------------------------- /include/assaultcube/src/platform.h: -------------------------------------------------------------------------------- 1 | #ifdef __GNUC__ 2 | #ifdef _FORTIFY_SOURCE 3 | #undef _FORTIFY_SOURCE 4 | #endif 5 | 6 | #define gamma __gamma 7 | #endif 8 | 9 | #include 10 | 11 | #ifdef __GNUC__ 12 | #undef gamma 13 | #endif 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #ifdef __GNUC__ 23 | #include 24 | #include 25 | #else 26 | #include 27 | #endif 28 | 29 | #include 30 | #include 31 | 32 | #ifdef WIN32 33 | #define WIN32_LEAN_AND_MEAN 34 | #include "windows.h" 35 | #ifndef _WINDOWS 36 | #define _WINDOWS 37 | #endif 38 | #include 39 | #ifndef __GNUC__ 40 | #include 41 | #endif 42 | #define ZLIB_DLL 43 | #endif 44 | 45 | #ifndef STANDALONE 46 | #include 47 | #include 48 | //#include 49 | 50 | #include 51 | 52 | #define GL_GLEXT_LEGACY 53 | #define __glext_h__ 54 | #define NO_SDL_GLEXT 55 | #include 56 | #undef __glext_h__ 57 | 58 | #include "GL/glext.h" 59 | 60 | #ifdef __APPLE__ 61 | #include "INTL/libintl.h" 62 | #include "OpenAL/al.h" 63 | #include "OpenAL/alc.h" 64 | #include "Vorbis/vorbisfile.h" 65 | #else 66 | #include 67 | #include "AL/al.h" 68 | #include "AL/alc.h" 69 | #include "vorbis/vorbisfile.h" 70 | #endif 71 | 72 | #include 73 | #endif 74 | 75 | #ifndef CURL_STATICLIB 76 | #define CURL_STATICLIB 77 | #endif 78 | #ifndef STANDALONE 79 | #include "curl/curl.h" 80 | #endif 81 | -------------------------------------------------------------------------------- /include/imgui/imgui_impl_opengl2.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for OpenGL2 (legacy OpenGL, fixed pipeline) 2 | // This needs to be used along with a Platform Backend (e.g. GLFW, SDL, Win32, custom..) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID! 6 | 7 | // You can copy and use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 8 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 9 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 10 | 11 | // **DO NOT USE THIS CODE IF YOUR CODE/ENGINE IS USING MODERN OPENGL (SHADERS, VBO, VAO, etc.)** 12 | // **Prefer using the code in imgui_impl_opengl3.cpp** 13 | // This code is mostly provided as a reference to learn how ImGui integration works, because it is shorter to read. 14 | // If your code is using GL3+ context or any semi modern OpenGL calls, using this is likely to make everything more 15 | // complicated, will require your code to reset every single OpenGL attributes to their initial state, and might 16 | // confuse your GPU driver. 17 | // The GL2 code is unable to reset attributes or even call e.g. "glUseProgram(0)" because they don't exist in that API. 18 | 19 | #pragma once 20 | #include "imgui.h" // IMGUI_IMPL_API 21 | 22 | IMGUI_IMPL_API bool ImGui_ImplOpenGL2_Init(); 23 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_Shutdown(); 24 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_NewFrame(); 25 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_RenderDrawData(ImDrawData* draw_data); 26 | 27 | // Called by Init/NewFrame/Shutdown 28 | IMGUI_IMPL_API bool ImGui_ImplOpenGL2_CreateFontsTexture(); 29 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_DestroyFontsTexture(); 30 | IMGUI_IMPL_API bool ImGui_ImplOpenGL2_CreateDeviceObjects(); 31 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_DestroyDeviceObjects(); 32 | -------------------------------------------------------------------------------- /include/assaultcube/include/SDL_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** 24 | * @file SDL_error.h 25 | * Simple error message routines for SDL 26 | */ 27 | 28 | #ifndef _SDL_error_h 29 | #define _SDL_error_h 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * @name Public functions 41 | */ 42 | /*@{*/ 43 | extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...); 44 | extern DECLSPEC char * SDLCALL SDL_GetError(void); 45 | extern DECLSPEC void SDLCALL SDL_ClearError(void); 46 | /*@}*/ 47 | 48 | /** 49 | * @name Private functions 50 | * @internal Private error message function - used internally 51 | */ 52 | /*@{*/ 53 | #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) 54 | #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) 55 | typedef enum { 56 | SDL_ENOMEM, 57 | SDL_EFREAD, 58 | SDL_EFWRITE, 59 | SDL_EFSEEK, 60 | SDL_UNSUPPORTED, 61 | SDL_LASTERROR 62 | } SDL_errorcode; 63 | extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code); 64 | /*@}*/ 65 | 66 | /* Ends C function definitions when using C++ */ 67 | #ifdef __cplusplus 68 | } 69 | #endif 70 | #include "close_code.h" 71 | 72 | #endif /* _SDL_error_h */ 73 | -------------------------------------------------------------------------------- /include/assaultcube/include/SDL_active.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** 24 | * @file SDL_active.h 25 | * Include file for SDL application focus event handling 26 | */ 27 | 28 | #ifndef _SDL_active_h 29 | #define _SDL_active_h 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | 34 | #include "begin_code.h" 35 | /* Set up for C function definitions, even when using C++ */ 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** @name The available application states */ 41 | /*@{*/ 42 | #define SDL_APPMOUSEFOCUS 0x01 /**< The app has mouse coverage */ 43 | #define SDL_APPINPUTFOCUS 0x02 /**< The app has input focus */ 44 | #define SDL_APPACTIVE 0x04 /**< The application is active */ 45 | /*@}*/ 46 | 47 | /* Function prototypes */ 48 | /** 49 | * This function returns the current state of the application, which is a 50 | * bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and 51 | * SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to 52 | * see your application, otherwise it has been iconified or disabled. 53 | */ 54 | extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void); 55 | 56 | 57 | /* Ends C function definitions when using C++ */ 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | #include "close_code.h" 62 | 63 | #endif /* _SDL_active_h */ 64 | -------------------------------------------------------------------------------- /include/assaultcube/include/SDL_quit.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** @file SDL_quit.h 24 | * Include file for SDL quit event handling 25 | */ 26 | 27 | #ifndef _SDL_quit_h 28 | #define _SDL_quit_h 29 | 30 | #include "SDL_stdinc.h" 31 | #include "SDL_error.h" 32 | 33 | /** @file SDL_quit.h 34 | * An SDL_QUITEVENT is generated when the user tries to close the application 35 | * window. If it is ignored or filtered out, the window will remain open. 36 | * If it is not ignored or filtered, it is queued normally and the window 37 | * is allowed to close. When the window is closed, screen updates will 38 | * complete, but have no effect. 39 | * 40 | * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) 41 | * and SIGTERM (system termination request), if handlers do not already 42 | * exist, that generate SDL_QUITEVENT events as well. There is no way 43 | * to determine the cause of an SDL_QUITEVENT, but setting a signal 44 | * handler in your application will override the default generation of 45 | * quit events for that signal. 46 | */ 47 | 48 | /** @file SDL_quit.h 49 | * There are no functions directly affecting the quit event 50 | */ 51 | 52 | #define SDL_QuitRequested() \ 53 | (SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK)) 54 | 55 | #endif /* _SDL_quit_h */ 56 | -------------------------------------------------------------------------------- /src/hacks/ESP_Snaplines.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void Base::Hacks::ESP_Snaplines(playerinfo_t* p_info) 5 | { 6 | if (Data::Settings::EnableEspSnaplines && p_info && p_info->is_valid && ((Data::Settings::EnableEspTeam && p_info->ent->team == Data::game.player1->team) || (Data::Settings::EnableEspEnemy && p_info->ent->team != Data::game.player1->team))) 7 | { 8 | ImVec2 LineOrigin = {}; 9 | ImVec2 LineEnd = {}; 10 | switch (Data::Settings::EspSnaplinesPos) 11 | { 12 | case 0: 13 | LineOrigin = { (float)Data::WindowWidth / 2, (float)Data::WindowHeight }; 14 | LineEnd = ImVec2(p_info->pos2D.x, p_info->pos2D.y); 15 | break; 16 | case 1: 17 | LineOrigin = { (float)Data::WindowWidth / 2, 0.0f }; 18 | LineEnd = ImVec2(p_info->headpos2D.x, p_info->headpos2D.y); 19 | break; 20 | default: 21 | Data::Settings::EspSnaplinesPos = 0; 22 | return; 23 | //break; 24 | } 25 | 26 | ImDrawList* Draw = ImGui::GetBackgroundDrawList(); 27 | 28 | float LineThickness = Data::Settings::EspSnaplinesThickness; 29 | ImColor LineColor = ImColor(0.0f, 0.0f, 0.0f, 0.0f); 30 | 31 | if (p_info->ent->team == Data::game.player1->team && (m_teammode || m_coop)) 32 | { 33 | if(Data::Settings::EspSnaplinesVisibilityCheck && p_info->is_visible) 34 | LineColor = ImColor(Data::Settings::EspSnaplinesColorTeamVisible[0], Data::Settings::EspSnaplinesColorTeamVisible[1], Data::Settings::EspSnaplinesColorTeamVisible[2], Data::Settings::EspSnaplinesColorTeamVisible[3]); 35 | else 36 | LineColor = ImColor(Data::Settings::EspSnaplinesColorTeam[0], Data::Settings::EspSnaplinesColorTeam[1], Data::Settings::EspSnaplinesColorTeam[2], Data::Settings::EspSnaplinesColorTeam[3]); 37 | } 38 | else 39 | { 40 | if(Data::Settings::EspSnaplinesVisibilityCheck && p_info->is_visible) 41 | LineColor = ImColor(Data::Settings::EspSnaplinesColorEnemyVisible[0], Data::Settings::EspSnaplinesColorEnemyVisible[1], Data::Settings::EspSnaplinesColorEnemyVisible[2], Data::Settings::EspSnaplinesColorEnemyVisible[3]); 42 | else 43 | LineColor = ImColor(Data::Settings::EspSnaplinesColorEnemy[0], Data::Settings::EspSnaplinesColorEnemy[1], Data::Settings::EspSnaplinesColorEnemy[2], Data::Settings::EspSnaplinesColorEnemy[3]); 44 | } 45 | 46 | Draw->AddLine(LineOrigin, LineEnd, LineColor, LineThickness); 47 | } 48 | } -------------------------------------------------------------------------------- /include/assaultcube/src/cube.h: -------------------------------------------------------------------------------- 1 | #ifndef __CUBE_H__ 2 | #define __CUBE_H__ 3 | 4 | // to "trick" i18n/gettext 5 | #define CC '\f' 6 | 7 | #include "platform.h" 8 | #include "tools.h" 9 | #include "geom.h" 10 | #include "model.h" 11 | #include "protocol.h" 12 | #include "sound.h" 13 | #include "weapon.h" 14 | #include "entity.h" 15 | #include "world.h" 16 | #include "i18n.h" 17 | #include "command.h" 18 | 19 | #ifndef STANDALONE 20 | #include "varray.h" 21 | #include "vote.h" 22 | #include "console.h" 23 | enum 24 | { 25 | SDL_AC_BUTTON_WHEELDOWN = -5, 26 | SDL_AC_BUTTON_WHEELUP = -4, 27 | SDL_AC_BUTTON_RIGHT = -3, 28 | SDL_AC_BUTTON_MIDDLE = -2, 29 | SDL_AC_BUTTON_LEFT = -1 30 | }; 31 | #endif 32 | 33 | extern sqr *world, *wmip[]; // map data, the mips are sequential 2D arrays in memory 34 | extern header hdr; // current map header 35 | extern int sfactor, ssize; // ssize = 2^sfactor 36 | extern int cubicsize, mipsize; // cubicsize = ssize^2 37 | extern physent *camera1; // camera representing perspective of player, usually player1 38 | extern playerent *player1; // special client ent that receives input and acts as camera 39 | extern vector players; // all the other clients (in multiplayer) 40 | extern vector bounceents; 41 | extern bool editmode; 42 | extern vector ents; // map entities 43 | extern vector eh_ents; // edithide entities 44 | extern vec worldpos, camup, camright, camdir; // current target of the crosshair in the world 45 | extern int lastmillis, totalmillis, nextmillis; // last time 46 | extern int curtime; // current frame time 47 | extern int interm; 48 | extern int gamemode, nextmode; 49 | extern int gamespeed; 50 | extern int xtraverts; 51 | extern float fovy, aspect; 52 | extern int farplane; 53 | extern bool minimap, reflecting, refracting; 54 | extern int stenciling, stencilshadow; 55 | extern bool intermission; 56 | extern int arenaintermission; 57 | extern hashtable mapinfo; 58 | extern int hwtexsize, hwmaxaniso; 59 | extern int numspawn[3], maploaded, numflagspawn[2]; 60 | extern int verbose; 61 | 62 | #define AC_VERSION 1202 63 | #define AC_MASTER_URI "ms.cubers.net" 64 | #define AC_MASTER_PORT 28760 65 | #define AC_MASTER_HTTP 1 // default 66 | #define AC_MASTER_RAW 0 67 | #define MAXCL 16 68 | 69 | #include "protos.h" // external function decls 70 | 71 | #endif 72 | 73 | -------------------------------------------------------------------------------- /include/assaultcube/include/SDL_cpuinfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** 24 | * @file SDL_cpuinfo.h 25 | * CPU feature detection for SDL 26 | */ 27 | 28 | #ifndef _SDL_cpuinfo_h 29 | #define _SDL_cpuinfo_h 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** This function returns true if the CPU has the RDTSC instruction */ 40 | extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void); 41 | 42 | /** This function returns true if the CPU has MMX features */ 43 | extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); 44 | 45 | /** This function returns true if the CPU has MMX Ext. features */ 46 | extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void); 47 | 48 | /** This function returns true if the CPU has 3DNow features */ 49 | extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void); 50 | 51 | /** This function returns true if the CPU has 3DNow! Ext. features */ 52 | extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void); 53 | 54 | /** This function returns true if the CPU has SSE features */ 55 | extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); 56 | 57 | /** This function returns true if the CPU has SSE2 features */ 58 | extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); 59 | 60 | /** This function returns true if the CPU has AltiVec features */ 61 | extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); 62 | 63 | /* Ends C function definitions when using C++ */ 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | #include "close_code.h" 68 | 69 | #endif /* _SDL_cpuinfo_h */ 70 | -------------------------------------------------------------------------------- /include/imgui/imgui_impl_win32.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Backend for Windows (standard windows API for 32 and 64 bits applications) 2 | // This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..) 3 | 4 | // Implemented features: 5 | // [X] Platform: Clipboard support (for Win32 this is actually part of core dear imgui) 6 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. 7 | // [X] Platform: Keyboard arrays indexed using VK_* Virtual Key Codes, e.g. ImGui::IsKeyPressed(VK_SPACE). 8 | // [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 9 | 10 | // You can copy and use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 11 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 12 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 13 | 14 | #pragma once 15 | #include "imgui.h" // IMGUI_IMPL_API 16 | 17 | IMGUI_IMPL_API bool ImGui_ImplWin32_Init(void* hwnd); 18 | IMGUI_IMPL_API void ImGui_ImplWin32_Shutdown(); 19 | IMGUI_IMPL_API void ImGui_ImplWin32_NewFrame(); 20 | 21 | // Configuration 22 | // - Disable gamepad support or linking with xinput.lib 23 | //#define IMGUI_IMPL_WIN32_DISABLE_GAMEPAD 24 | //#define IMGUI_IMPL_WIN32_DISABLE_LINKING_XINPUT 25 | 26 | // Win32 message handler your application need to call. 27 | // - Intentionally commented out in a '#if 0' block to avoid dragging dependencies on from this helper. 28 | // - You should COPY the line below into your .cpp code to forward declare the function and then you can call it. 29 | #if 0 30 | extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 31 | #endif 32 | 33 | // DPI-related helpers (optional) 34 | // - Use to enable DPI awareness without having to create an application manifest. 35 | // - Your own app may already do this via a manifest or explicit calls. This is mostly useful for our examples/ apps. 36 | // - In theory we could call simple functions from Windows SDK such as SetProcessDPIAware(), SetProcessDpiAwareness(), etc. 37 | // but most of the functions provided by Microsoft require Windows 8.1/10+ SDK at compile time and Windows 8/10+ at runtime, 38 | // neither we want to require the user to have. So we dynamically select and load those functions to avoid dependencies. 39 | IMGUI_IMPL_API void ImGui_ImplWin32_EnableDpiAwareness(); 40 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd); // HWND hwnd 41 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor); // HMONITOR monitor 42 | -------------------------------------------------------------------------------- /include/assaultcube/include/curl/curlver.h: -------------------------------------------------------------------------------- 1 | #ifndef __CURL_CURLVER_H 2 | #define __CURL_CURLVER_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | * $Id: curlver.h,v 1.32 2007-09-13 21:06:19 bagder Exp $ 24 | ***************************************************************************/ 25 | 26 | /* This header file contains nothing but libcurl version info, generated by 27 | a script at release-time. This was made its own header file in 7.11.2 */ 28 | 29 | /* This is the version number of the libcurl package from which this header 30 | file origins: */ 31 | #define LIBCURL_VERSION "7.17.1" 32 | 33 | /* The numeric version number is also available "in parts" by using these 34 | defines: */ 35 | #define LIBCURL_VERSION_MAJOR 7 36 | #define LIBCURL_VERSION_MINOR 17 37 | #define LIBCURL_VERSION_PATCH 1 38 | 39 | /* This is the numeric version of the libcurl version number, meant for easier 40 | parsing and comparions by programs. The LIBCURL_VERSION_NUM define will 41 | always follow this syntax: 42 | 43 | 0xXXYYZZ 44 | 45 | Where XX, YY and ZZ are the main version, release and patch numbers in 46 | hexadecimal (using 8 bits each). All three numbers are always represented 47 | using two digits. 1.2 would appear as "0x010200" while version 9.11.7 48 | appears as "0x090b07". 49 | 50 | This 6-digit (24 bits) hexadecimal number does not show pre-release number, 51 | and it is always a greater number in a more recent release. It makes 52 | comparisons with greater than and less than work. 53 | */ 54 | #define LIBCURL_VERSION_NUM 0x071101 55 | 56 | /* 57 | * This is the date and time when the full source package was created. The 58 | * timestamp is not stored in CVS, as the timestamp is properly set in the 59 | * tarballs by the maketgz script. 60 | * 61 | * The format of the date should follow this template: 62 | * 63 | * "Mon Feb 12 11:35:33 UTC 2007" 64 | */ 65 | #define LIBCURL_TIMESTAMP "Mon Oct 29 14:49:22 UTC 2007" 66 | 67 | #endif /* __CURL_CURLVER_H */ 68 | -------------------------------------------------------------------------------- /include/assaultcube/include/SDL_version.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** @file SDL_version.h 24 | * This header defines the current SDL version 25 | */ 26 | 27 | #ifndef _SDL_version_h 28 | #define _SDL_version_h 29 | 30 | #include "SDL_stdinc.h" 31 | 32 | #include "begin_code.h" 33 | /* Set up for C function definitions, even when using C++ */ 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | /** @name Version Number 39 | * Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL 40 | */ 41 | /*@{*/ 42 | #define SDL_MAJOR_VERSION 1 43 | #define SDL_MINOR_VERSION 2 44 | #define SDL_PATCHLEVEL 14 45 | /*@}*/ 46 | 47 | typedef struct SDL_version { 48 | Uint8 major; 49 | Uint8 minor; 50 | Uint8 patch; 51 | } SDL_version; 52 | 53 | /** 54 | * This macro can be used to fill a version structure with the compile-time 55 | * version of the SDL library. 56 | */ 57 | #define SDL_VERSION(X) \ 58 | { \ 59 | (X)->major = SDL_MAJOR_VERSION; \ 60 | (X)->minor = SDL_MINOR_VERSION; \ 61 | (X)->patch = SDL_PATCHLEVEL; \ 62 | } 63 | 64 | /** This macro turns the version numbers into a numeric value: 65 | * (1,2,3) -> (1203) 66 | * This assumes that there will never be more than 100 patchlevels 67 | */ 68 | #define SDL_VERSIONNUM(X, Y, Z) \ 69 | ((X)*1000 + (Y)*100 + (Z)) 70 | 71 | /** This is the version number macro for the current SDL version */ 72 | #define SDL_COMPILEDVERSION \ 73 | SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) 74 | 75 | /** This macro will evaluate to true if compiled with SDL at least X.Y.Z */ 76 | #define SDL_VERSION_ATLEAST(X, Y, Z) \ 77 | (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) 78 | 79 | /** This function gets the version of the dynamically linked SDL library. 80 | * it should NOT be used to fill a version structure, instead you should 81 | * use the SDL_Version() macro. 82 | */ 83 | extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void); 84 | 85 | /* Ends C function definitions when using C++ */ 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | #include "close_code.h" 90 | 91 | #endif /* _SDL_version_h */ 92 | -------------------------------------------------------------------------------- /include/assaultcube/include/SDL_loadso.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** @file SDL_loadso.h 24 | * System dependent library loading routines 25 | */ 26 | 27 | /** @file SDL_loadso.h 28 | * Some things to keep in mind: 29 | * - These functions only work on C function names. Other languages may 30 | * have name mangling and intrinsic language support that varies from 31 | * compiler to compiler. 32 | * - Make sure you declare your function pointers with the same calling 33 | * convention as the actual library function. Your code will crash 34 | * mysteriously if you do not do this. 35 | * - Avoid namespace collisions. If you load a symbol from the library, 36 | * it is not defined whether or not it goes into the global symbol 37 | * namespace for the application. If it does and it conflicts with 38 | * symbols in your code or other shared libraries, you will not get 39 | * the results you expect. :) 40 | */ 41 | 42 | 43 | #ifndef _SDL_loadso_h 44 | #define _SDL_loadso_h 45 | 46 | #include "SDL_stdinc.h" 47 | #include "SDL_error.h" 48 | 49 | #include "begin_code.h" 50 | /* Set up for C function definitions, even when using C++ */ 51 | #ifdef __cplusplus 52 | extern "C" { 53 | #endif 54 | 55 | /** 56 | * This function dynamically loads a shared object and returns a pointer 57 | * to the object handle (or NULL if there was an error). 58 | * The 'sofile' parameter is a system dependent name of the object file. 59 | */ 60 | extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile); 61 | 62 | /** 63 | * Given an object handle, this function looks up the address of the 64 | * named function in the shared object and returns it. This address 65 | * is no longer valid after calling SDL_UnloadObject(). 66 | */ 67 | extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name); 68 | 69 | /** Unload a shared object from memory */ 70 | extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); 71 | 72 | /* Ends C function definitions when using C++ */ 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | #include "close_code.h" 77 | 78 | #endif /* _SDL_loadso_h */ 79 | -------------------------------------------------------------------------------- /include/assaultcube/include/curl/mprintf.h: -------------------------------------------------------------------------------- 1 | #ifndef __CURL_MPRINTF_H 2 | #define __CURL_MPRINTF_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | * $Id: mprintf.h,v 1.15 2007-08-07 12:44:38 patrickm Exp $ 24 | ***************************************************************************/ 25 | 26 | #include 27 | #include /* needed for FILE */ 28 | 29 | #include "curl.h" 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | CURL_EXTERN int curl_mprintf(const char *format, ...); 36 | CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...); 37 | CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...); 38 | CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, const char *format, ...); 39 | CURL_EXTERN int curl_mvprintf(const char *format, va_list args); 40 | CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args); 41 | CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args); 42 | CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, const char *format, va_list args); 43 | CURL_EXTERN char *curl_maprintf(const char *format, ...); 44 | CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args); 45 | 46 | #ifdef _MPRINTF_REPLACE 47 | # undef printf 48 | # undef fprintf 49 | # undef sprintf 50 | # undef vsprintf 51 | # undef snprintf 52 | # undef vprintf 53 | # undef vfprintf 54 | # undef vsnprintf 55 | # undef aprintf 56 | # undef vaprintf 57 | # define printf curl_mprintf 58 | # define fprintf curl_mfprintf 59 | #ifdef CURLDEBUG 60 | /* When built with CURLDEBUG we define away the sprintf() functions since we 61 | don't want internal code to be using them */ 62 | # define sprintf sprintf_was_used 63 | # define vsprintf vsprintf_was_used 64 | #else 65 | # define sprintf curl_msprintf 66 | # define vsprintf curl_mvsprintf 67 | #endif 68 | # define snprintf curl_msnprintf 69 | # define vprintf curl_mvprintf 70 | # define vfprintf curl_mvfprintf 71 | # define vsnprintf curl_mvsnprintf 72 | # define aprintf curl_maprintf 73 | # define vaprintf curl_mvaprintf 74 | #endif 75 | 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #endif /* __CURL_MPRINTF_H */ 81 | -------------------------------------------------------------------------------- /include/assaultcube/include/curl/easy.h: -------------------------------------------------------------------------------- 1 | #ifndef __CURL_EASY_H 2 | #define __CURL_EASY_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | * $Id: easy.h,v 1.13 2004/11/09 14:02:58 giva Exp $ 24 | ***************************************************************************/ 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | CURL_EXTERN CURL *curl_easy_init(void); 30 | CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...); 31 | CURL_EXTERN CURLcode curl_easy_perform(CURL *curl); 32 | CURL_EXTERN void curl_easy_cleanup(CURL *curl); 33 | 34 | /* 35 | * NAME curl_easy_getinfo() 36 | * 37 | * DESCRIPTION 38 | * 39 | * Request internal information from the curl session with this function. The 40 | * third argument MUST be a pointer to a long, a pointer to a char * or a 41 | * pointer to a double (as the documentation describes elsewhere). The data 42 | * pointed to will be filled in accordingly and can be relied upon only if the 43 | * function returns CURLE_OK. This function is intended to get used *AFTER* a 44 | * performed transfer, all results from this function are undefined until the 45 | * transfer is completed. 46 | */ 47 | CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...); 48 | 49 | 50 | /* 51 | * NAME curl_easy_duphandle() 52 | * 53 | * DESCRIPTION 54 | * 55 | * Creates a new curl session handle with the same options set for the handle 56 | * passed in. Duplicating a handle could only be a matter of cloning data and 57 | * options, internal state info and things like persistant connections cannot 58 | * be transfered. It is useful in multithreaded applications when you can run 59 | * curl_easy_duphandle() for each new thread to avoid a series of identical 60 | * curl_easy_setopt() invokes in every thread. 61 | */ 62 | CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl); 63 | 64 | /* 65 | * NAME curl_easy_reset() 66 | * 67 | * DESCRIPTION 68 | * 69 | * Re-initializes a CURL handle to the default values. This puts back the 70 | * handle to the same state as it was in when it was just created. 71 | * 72 | * It does keep: live connections, the Session ID cache, the DNS cache and the 73 | * cookies. 74 | */ 75 | CURL_EXTERN void curl_easy_reset(CURL *curl); 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /include/assaultcube/src/model.h: -------------------------------------------------------------------------------- 1 | enum { ANIM_IDLE = 0, ANIM_RUN, ANIM_ATTACK, ANIM_PAIN, ANIM_JUMP, ANIM_LAND, ANIM_FLIPOFF, ANIM_SALUTE, ANIM_TAUNT, ANIM_WAVE, ANIM_POINT, ANIM_CROUCH_IDLE, ANIM_CROUCH_WALK, ANIM_CROUCH_ATTACK, ANIM_CROUCH_PAIN, ANIM_CROUCH_DEATH, ANIM_DEATH, ANIM_LYING_DEAD, ANIM_FLAG, ANIM_GUN_IDLE, ANIM_GUN_SHOOT, ANIM_GUN_RELOAD, ANIM_GUN_THROW, ANIM_MAPMODEL, ANIM_TRIGGER, ANIM_DECAY, ANIM_ALL, NUMANIMS }; 2 | 3 | #define ANIM_INDEX 0xFF 4 | #define ANIM_LOOP (1<<8) 5 | #define ANIM_START (1<<9) 6 | #define ANIM_END (1<<10) 7 | #define ANIM_REVERSE (1<<11) 8 | #define ANIM_NOINTERP (1<<12) 9 | #define ANIM_MIRROR (1<<13) 10 | #define ANIM_NOSKIN (1<<14) 11 | #define ANIM_TRANSLUCENT (1<<15) 12 | #define ANIM_PARTICLE (1<<16) 13 | #define ANIM_DYNALLOC (1<<17) 14 | 15 | struct animstate // used for animation blending of animated characters 16 | { 17 | int anim, frame, range, basetime; 18 | float speed; 19 | animstate() { reset(); } 20 | void reset() { anim = frame = range = basetime = 0; speed = 100.0f; }; 21 | 22 | bool operator==(const animstate &o) const { return frame==o.frame && range==o.range && basetime==o.basetime && speed==o.speed; } 23 | bool operator!=(const animstate &o) const { return frame!=o.frame || range!=o.range || basetime!=o.basetime || speed!=o.speed; } 24 | }; 25 | 26 | enum { MDL_MD2 = 1, MDL_MD3 }; 27 | 28 | struct model; 29 | struct modelattach 30 | { 31 | const char *tag, *name; 32 | vec *pos; 33 | model *m; 34 | 35 | modelattach() : tag(NULL), name(NULL), pos(NULL), m(NULL) {} 36 | modelattach(const char *tag, const char *name) : tag(tag), name(name), pos(NULL), m(NULL) {} 37 | modelattach(const char *tag, vec *pos) : tag(tag), name(NULL), pos(pos), m(NULL) {} 38 | }; 39 | 40 | class dynent; 41 | 42 | struct model 43 | { 44 | bool cullface, vertexlight, alphablend; //ALX Alpha channel models 45 | float alphatest, translucency, scale, radius, shadowdist; 46 | vec translate; 47 | int cachelimit, batch; 48 | 49 | //model() : cullface(true), vertexlight(false), alphatest(0.9f), translucency(0.25f), scale(1), radius(0), shadowdist(0), translate(0, 0, 0), cachelimit(8), batch(-1) {} 50 | model() : cullface(true), vertexlight(false), alphablend(false), alphatest(0.9f), translucency(0.25f), scale(1), radius(0), shadowdist(0), translate(0, 0, 0), cachelimit(8), batch(-1) {} 51 | virtual ~model() {} 52 | 53 | virtual bool load() = 0; 54 | virtual char *name() = 0; 55 | virtual int type() = 0; 56 | 57 | virtual void cleanup() = 0; 58 | 59 | virtual void render(int anim, int varseed, float speed, int basetime, const vec &o, float yaw, float pitch, dynent *d, modelattach *a = NULL, float scale = 1.0f) = 0; 60 | virtual void setskin(int tex = 0) = 0; 61 | 62 | virtual void genshadows(float height, float rad) {} 63 | virtual void rendershadow(int anim, int varseed, float speed, int basetime, const vec &o, float yaw, modelattach *a = NULL) {} 64 | virtual bool hasshadows() { return false; } 65 | 66 | virtual void startrender() {} 67 | virtual void endrender() {} 68 | }; 69 | 70 | struct mapmodelinfo { int rad, h, zoff; string name; model *m; }; 71 | -------------------------------------------------------------------------------- /include/assaultcube/include/SDL_platform.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** @file SDL_platform.h 24 | * Try to get a standard set of platform defines 25 | */ 26 | 27 | #ifndef _SDL_platform_h 28 | #define _SDL_platform_h 29 | 30 | #if defined(_AIX) 31 | #undef __AIX__ 32 | #define __AIX__ 1 33 | #endif 34 | #if defined(__BEOS__) 35 | #undef __BEOS__ 36 | #define __BEOS__ 1 37 | #endif 38 | #if defined(__HAIKU__) 39 | #undef __HAIKU__ 40 | #define __HAIKU__ 1 41 | #endif 42 | #if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) 43 | #undef __BSDI__ 44 | #define __BSDI__ 1 45 | #endif 46 | #if defined(_arch_dreamcast) 47 | #undef __DREAMCAST__ 48 | #define __DREAMCAST__ 1 49 | #endif 50 | #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) 51 | #undef __FREEBSD__ 52 | #define __FREEBSD__ 1 53 | #endif 54 | #if defined(__HAIKU__) 55 | #undef __HAIKU__ 56 | #define __HAIKU__ 1 57 | #endif 58 | #if defined(hpux) || defined(__hpux) || defined(__hpux__) 59 | #undef __HPUX__ 60 | #define __HPUX__ 1 61 | #endif 62 | #if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) 63 | #undef __IRIX__ 64 | #define __IRIX__ 1 65 | #endif 66 | #if defined(linux) || defined(__linux) || defined(__linux__) 67 | #undef __LINUX__ 68 | #define __LINUX__ 1 69 | #endif 70 | #if defined(__APPLE__) 71 | #undef __MACOSX__ 72 | #define __MACOSX__ 1 73 | #elif defined(macintosh) 74 | #undef __MACOS__ 75 | #define __MACOS__ 1 76 | #endif 77 | #if defined(__NetBSD__) 78 | #undef __NETBSD__ 79 | #define __NETBSD__ 1 80 | #endif 81 | #if defined(__OpenBSD__) 82 | #undef __OPENBSD__ 83 | #define __OPENBSD__ 1 84 | #endif 85 | #if defined(__OS2__) 86 | #undef __OS2__ 87 | #define __OS2__ 1 88 | #endif 89 | #if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) 90 | #undef __OSF__ 91 | #define __OSF__ 1 92 | #endif 93 | #if defined(__QNXNTO__) 94 | #undef __QNXNTO__ 95 | #define __QNXNTO__ 1 96 | #endif 97 | #if defined(riscos) || defined(__riscos) || defined(__riscos__) 98 | #undef __RISCOS__ 99 | #define __RISCOS__ 1 100 | #endif 101 | #if defined(__SVR4) 102 | #undef __SOLARIS__ 103 | #define __SOLARIS__ 1 104 | #endif 105 | #if defined(WIN32) || defined(_WIN32) 106 | #undef __WIN32__ 107 | #define __WIN32__ 1 108 | #endif 109 | 110 | #endif /* _SDL_platform_h */ 111 | -------------------------------------------------------------------------------- /src/hacks/ESP_Box.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void Base::Hacks::ESP_Box(playerinfo_t* p_info) 5 | { 6 | if (Data::Settings::EnableEspBox && p_info && p_info->is_valid && !((p_info->headpos2D_out & (OUT_BOTTOM)) || (p_info->pos2D_out & (OUT_TOP))) && !((p_info->headpos2D_out_margin & (OUT_LEFT | OUT_RIGHT)) && p_info->pos2D_out_margin & (OUT_LEFT | OUT_RIGHT))&& ((Data::Settings::EnableEspTeam && p_info->ent->team == Data::game.player1->team) || (Data::Settings::EnableEspEnemy && p_info->ent->team != Data::game.player1->team))) 7 | { 8 | ImDrawList* Draw = ImGui::GetBackgroundDrawList(); 9 | float Height = p_info->pos2D.y - p_info->headpos2D.y; 10 | float BoxWidth = Height / 2; 11 | float BoxHeight = Height; 12 | ImVec2 TopLeft = { p_info->pos2D.x - BoxWidth / 2, p_info->pos2D.y - BoxHeight }; 13 | ImVec2 BottomLeft = { TopLeft.x, TopLeft.y + BoxHeight }; 14 | ImVec2 BottomRight = { BottomLeft.x + BoxWidth, BottomLeft.y }; 15 | ImVec2 TopRight = { BottomRight.x, TopLeft.y }; 16 | ImColor BoxColor = {}; 17 | ImColor BoxFillColor = {}; 18 | float BoxThickness = Data::Settings::EspBoxThickness; 19 | 20 | if (p_info->ent->team == Data::game.player1->team && (m_teammode || m_coop)) 21 | { 22 | if (Data::Settings::EspBoxVisibilyCheck && p_info->is_visible) 23 | { 24 | BoxColor = ImColor(Data::Settings::EspBoxColorTeamVisible[0], Data::Settings::EspBoxColorTeamVisible[1], Data::Settings::EspBoxColorTeamVisible[2], Data::Settings::EspBoxColorTeamVisible[3]); 25 | BoxFillColor = ImColor(Data::Settings::EspBoxColorFillTeamVisible[0], Data::Settings::EspBoxColorFillTeamVisible[1], Data::Settings::EspBoxColorFillTeamVisible[2], Data::Settings::EspBoxColorFillTeamVisible[3]); 26 | } 27 | 28 | else 29 | { 30 | BoxColor = ImColor(Data::Settings::EspBoxColorTeam[0], Data::Settings::EspBoxColorTeam[1], Data::Settings::EspBoxColorTeam[2], Data::Settings::EspBoxColorTeam[3]); 31 | BoxFillColor = ImColor(Data::Settings::EspBoxColorFillTeam[0], Data::Settings::EspBoxColorFillTeam[1], Data::Settings::EspBoxColorFillTeam[2], Data::Settings::EspBoxColorFillTeam[3]); 32 | } 33 | } 34 | 35 | else 36 | { 37 | if (Data::Settings::EspBoxVisibilyCheck && p_info->is_visible) 38 | { 39 | BoxColor = ImColor(Data::Settings::EspBoxColorEnemyVisible[0], Data::Settings::EspBoxColorEnemyVisible[1], Data::Settings::EspBoxColorEnemyVisible[2], Data::Settings::EspBoxColorEnemyVisible[3]); 40 | BoxFillColor = ImColor(Data::Settings::EspBoxColorFillEnemyVisible[0], Data::Settings::EspBoxColorFillEnemyVisible[1], Data::Settings::EspBoxColorFillEnemyVisible[2], Data::Settings::EspBoxColorFillEnemyVisible[3]); 41 | } 42 | 43 | else 44 | { 45 | BoxColor = ImColor(Data::Settings::EspBoxColorEnemy[0], Data::Settings::EspBoxColorEnemy[1], Data::Settings::EspBoxColorEnemy[2], Data::Settings::EspBoxColorEnemy[3]); 46 | BoxFillColor = ImColor(Data::Settings::EspBoxColorFillEnemy[0], Data::Settings::EspBoxColorFillEnemy[1], Data::Settings::EspBoxColorFillEnemy[2], Data::Settings::EspBoxColorFillEnemy[3]); 47 | } 48 | } 49 | 50 | Draw->AddQuadFilled(TopLeft, BottomLeft, BottomRight, TopRight, BoxFillColor); 51 | Draw->AddQuad(TopLeft, BottomLeft, BottomRight, TopRight, BoxColor, BoxThickness); 52 | } 53 | } -------------------------------------------------------------------------------- /src/hooks/WndProc.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static bool bUnloadState = false; 5 | 6 | extern LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 7 | LRESULT CALLBACK Base::Hooks::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) 8 | { 9 | if(bUnloadState && Data::UnloadReady) 10 | Base::Unload(); 11 | 12 | if (uMsg == WM_KEYDOWN || uMsg == WM_KEYUP) 13 | Data::WMKeys[wParam] = (uMsg == WM_KEYDOWN) ? true : false; 14 | 15 | switch (uMsg) 16 | { 17 | case WM_KEYDOWN: 18 | switch (wParam) 19 | { 20 | case Data::Keys::Menu: 21 | Data::ShowMenu = !Data::ShowMenu; 22 | break; 23 | case Data::Keys::Unload: 24 | if (Data::ShowMenu) break; //Avoid White Render Bug 25 | bUnloadState = true; 26 | Data::UnloadReady = false; 27 | try 28 | { 29 | Base::LoadConfig(Data::CleanConfig); 30 | } 31 | 32 | catch (...) 33 | { 34 | 35 | } 36 | 37 | break; 38 | case Data::Keys::Cancel: 39 | if (Data::Keys::ToChange != nullptr) 40 | Data::Keys::ToChange = nullptr; 41 | break; 42 | default: 43 | if (Data::Keys::ToChange != nullptr) 44 | { 45 | *Data::Keys::ToChange = (UINT)wParam; 46 | Data::Keys::ToChange = nullptr; 47 | break; 48 | } 49 | 50 | if (wParam == Data::Keys::Bhop && Data::Settings::BunnyhopToggle) 51 | Data::Settings::BunnyhopToggleState = !Data::Settings::BunnyhopToggleState; 52 | 53 | if (wParam == Data::Keys::Triggerbot && Data::Settings::TriggerbotToggle) 54 | Data::Settings::TriggerbotToggleState = !Data::Settings::TriggerbotToggleState; 55 | 56 | if (wParam == Data::Keys::TeleportSavePos) 57 | Data::Settings::TeleportSaveQueued = true; 58 | 59 | if (wParam == Data::Keys::Teleport) 60 | Data::Settings::TeleportQueued = true; 61 | 62 | if(wParam == Data::Keys::Aimbot && Data::Settings::AimbotToggle) 63 | Data::Settings::AimbotToggleState = !Data::Settings::AimbotToggleState; 64 | 65 | if (wParam == Data::Keys::Speedhack && Data::Settings::SpeedhackToggle) 66 | Data::Settings::SpeedhackToggleState = !Data::Settings::SpeedhackToggleState; 67 | 68 | if (wParam == Data::Keys::FlyHack && Data::Settings::FlyHackToggle) 69 | Data::Settings::FlyHackToggleState = !Data::Settings::FlyHackToggleState; 70 | 71 | break; 72 | } 73 | } 74 | 75 | if (Data::ShowMenu && Data::InitSwapBuffers) 76 | { 77 | switch (uMsg) 78 | { 79 | case WM_LBUTTONDOWN: 80 | case WM_LBUTTONDBLCLK: 81 | case WM_RBUTTONDOWN: 82 | case WM_RBUTTONDBLCLK: 83 | case WM_MBUTTONDOWN: 84 | case WM_MBUTTONDBLCLK: 85 | case WM_XBUTTONDOWN: 86 | case WM_XBUTTONDBLCLK: 87 | case WM_LBUTTONUP: 88 | case WM_RBUTTONUP: 89 | case WM_MBUTTONUP: 90 | case WM_XBUTTONUP: 91 | case WM_MOUSEWHEEL: 92 | case WM_MOUSEHWHEEL: 93 | case WM_KEYDOWN: 94 | case WM_SYSKEYDOWN: 95 | case WM_KEYUP: 96 | case WM_SYSKEYUP: 97 | case WM_CHAR: 98 | case WM_SETCURSOR: 99 | case WM_DEVICECHANGE: 100 | ImGui_ImplWin32_WndProcHandler(hWnd, uMsg, wParam, lParam); 101 | return true; 102 | default: 103 | break; 104 | } 105 | } 106 | 107 | SDL_ShowCursor(-1); 108 | 109 | return CallWindowProc(Data::oWndProc, hWnd, uMsg, wParam, lParam); 110 | } -------------------------------------------------------------------------------- /include/assaultcube/include/SDL_main.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | #ifndef _SDL_main_h 24 | #define _SDL_main_h 25 | 26 | #include "SDL_stdinc.h" 27 | 28 | /** @file SDL_main.h 29 | * Redefine main() on Win32 and MacOS so that it is called by winmain.c 30 | */ 31 | 32 | #if defined(__WIN32__) || \ 33 | (defined(__MWERKS__) && !defined(__BEOS__)) || \ 34 | defined(__MACOS__) || defined(__MACOSX__) || \ 35 | defined(__SYMBIAN32__) || defined(QWS) 36 | 37 | #ifdef __cplusplus 38 | #define C_LINKAGE "C" 39 | #else 40 | #define C_LINKAGE 41 | #endif /* __cplusplus */ 42 | 43 | /** The application's main() function must be called with C linkage, 44 | * and should be declared like this: 45 | * @code 46 | * #ifdef __cplusplus 47 | * extern "C" 48 | * #endif 49 | * int main(int argc, char *argv[]) 50 | * { 51 | * } 52 | * @endcode 53 | */ 54 | #define main SDL_main 55 | 56 | /** The prototype for the application's main() function */ 57 | extern C_LINKAGE int SDL_main(int argc, char *argv[]); 58 | 59 | 60 | /** @name From the SDL library code -- needed for registering the app on Win32 */ 61 | /*@{*/ 62 | #ifdef __WIN32__ 63 | 64 | #include "begin_code.h" 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | /** This should be called from your WinMain() function, if any */ 70 | extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst); 71 | /** This can also be called, but is no longer necessary */ 72 | extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst); 73 | /** This can also be called, but is no longer necessary (SDL_Quit calls it) */ 74 | extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | #include "close_code.h" 79 | #endif 80 | /*@}*/ 81 | 82 | /** @name From the SDL library code -- needed for registering QuickDraw on MacOS */ 83 | /*@{*/ 84 | #if defined(__MACOS__) 85 | 86 | #include "begin_code.h" 87 | #ifdef __cplusplus 88 | extern "C" { 89 | #endif 90 | 91 | /** Forward declaration so we don't need to include QuickDraw.h */ 92 | struct QDGlobals; 93 | 94 | /** This should be called from your main() function, if any */ 95 | extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd); 96 | 97 | #ifdef __cplusplus 98 | } 99 | #endif 100 | #include "close_code.h" 101 | #endif 102 | /*@}*/ 103 | 104 | #endif /* Need to redefine main()? */ 105 | 106 | #endif /* _SDL_main_h */ 107 | -------------------------------------------------------------------------------- /include/assaultcube/include/AL/xram.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // X-RAM Function pointer definitions 4 | typedef ALboolean (__cdecl *EAXSetBufferMode)(ALsizei n, ALuint *buffers, ALint value); 5 | typedef ALenum (__cdecl *EAXGetBufferMode)(ALuint buffer, ALint *value); 6 | 7 | ////////////////////////////////////////////////////////////////////////////// 8 | // Query for X-RAM extension 9 | // 10 | // if (alIsExtensionPresent("EAX-RAM") == AL_TRUE) 11 | // X-RAM Extension found 12 | // 13 | ////////////////////////////////////////////////////////////////////////////// 14 | 15 | 16 | ////////////////////////////////////////////////////////////////////////////// 17 | // X-RAM enum names 18 | // 19 | // "AL_EAX_RAM_SIZE" 20 | // "AL_EAX_RAM_FREE" 21 | // "AL_STORAGE_AUTOMATIC" 22 | // "AL_STORAGE_HARDWARE" 23 | // "AL_STORAGE_ACCESSIBLE" 24 | // 25 | // Query enum values using alGetEnumValue, for example 26 | // 27 | // long lRamSizeEnum = alGetEnumValue("AL_EAX_RAM_SIZE") 28 | // 29 | ////////////////////////////////////////////////////////////////////////////// 30 | 31 | 32 | ////////////////////////////////////////////////////////////////////////////// 33 | // Query total amount of X-RAM 34 | // 35 | // long lTotalSize = alGetInteger(alGetEnumValue("AL_EAX_RAM_SIZE") 36 | // 37 | ////////////////////////////////////////////////////////////////////////////// 38 | 39 | 40 | ////////////////////////////////////////////////////////////////////////////// 41 | // Query free X-RAM available 42 | // 43 | // long lFreeSize = alGetInteger(alGetEnumValue("AL_EAX_RAM_FREE") 44 | // 45 | ////////////////////////////////////////////////////////////////////////////// 46 | 47 | 48 | ////////////////////////////////////////////////////////////////////////////// 49 | // Query X-RAM Function pointers 50 | // 51 | // Use typedefs defined above to get the X-RAM function pointers using 52 | // alGetProcAddress 53 | // 54 | // EAXSetBufferMode eaxSetBufferMode; 55 | // EAXGetBufferMode eaxGetBufferMode; 56 | // 57 | // eaxSetBufferMode = (EAXSetBufferMode)alGetProcAddress("EAXSetBufferMode"); 58 | // eaxGetBufferMode = (EAXGetBufferMode)alGetProcAddress("EAXGetBufferMode"); 59 | // 60 | ////////////////////////////////////////////////////////////////////////////// 61 | 62 | 63 | ////////////////////////////////////////////////////////////////////////////// 64 | // Force an Open AL Buffer into X-RAM (good for non-streaming buffers) 65 | // 66 | // ALuint uiBuffer; 67 | // alGenBuffers(1, &uiBuffer); 68 | // eaxSetBufferMode(1, &uiBuffer, alGetEnumValue("AL_STORAGE_HARDWARE")); 69 | // alBufferData(...); 70 | // 71 | ////////////////////////////////////////////////////////////////////////////// 72 | 73 | 74 | ////////////////////////////////////////////////////////////////////////////// 75 | // Force an Open AL Buffer into 'accessible' (currently host) RAM (good for streaming buffers) 76 | // 77 | // ALuint uiBuffer; 78 | // alGenBuffers(1, &uiBuffer); 79 | // eaxSetBufferMode(1, &uiBuffer, alGetEnumValue("AL_STORAGE_ACCESSIBLE")); 80 | // alBufferData(...); 81 | // 82 | ////////////////////////////////////////////////////////////////////////////// 83 | 84 | 85 | ////////////////////////////////////////////////////////////////////////////// 86 | // Put an Open AL Buffer into X-RAM if memory is available, otherwise use 87 | // host RAM. This is the default mode. 88 | // 89 | // ALuint uiBuffer; 90 | // alGenBuffers(1, &uiBuffer); 91 | // eaxSetBufferMode(1, &uiBuffer, alGetEnumValue("AL_STORAGE_AUTOMATIC")); 92 | // alBufferData(...); 93 | // 94 | ////////////////////////////////////////////////////////////////////////////// -------------------------------------------------------------------------------- /include/assaultcube/include/vorbis/vorbisenc.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 * 9 | * by the Xiph.Org Foundation http://www.xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: vorbis encode-engine setup 14 | last mod: $Id: vorbisenc.h,v 1.2 2008-04-10 22:54:16 adrian_henke Exp $ 15 | 16 | ********************************************************************/ 17 | 18 | #ifndef _OV_ENC_H_ 19 | #define _OV_ENC_H_ 20 | 21 | #ifdef __cplusplus 22 | extern "C" 23 | { 24 | #endif /* __cplusplus */ 25 | 26 | #include "codec.h" 27 | 28 | extern int vorbis_encode_init(vorbis_info *vi, 29 | long channels, 30 | long rate, 31 | 32 | long max_bitrate, 33 | long nominal_bitrate, 34 | long min_bitrate); 35 | 36 | extern int vorbis_encode_setup_managed(vorbis_info *vi, 37 | long channels, 38 | long rate, 39 | 40 | long max_bitrate, 41 | long nominal_bitrate, 42 | long min_bitrate); 43 | 44 | extern int vorbis_encode_setup_vbr(vorbis_info *vi, 45 | long channels, 46 | long rate, 47 | 48 | float quality /* quality level from 0. (lo) to 1. (hi) */ 49 | ); 50 | 51 | extern int vorbis_encode_init_vbr(vorbis_info *vi, 52 | long channels, 53 | long rate, 54 | 55 | float base_quality /* quality level from 0. (lo) to 1. (hi) */ 56 | ); 57 | 58 | extern int vorbis_encode_setup_init(vorbis_info *vi); 59 | 60 | extern int vorbis_encode_ctl(vorbis_info *vi,int number,void *arg); 61 | 62 | /* deprecated rate management supported only for compatability */ 63 | #define OV_ECTL_RATEMANAGE_GET 0x10 64 | #define OV_ECTL_RATEMANAGE_SET 0x11 65 | #define OV_ECTL_RATEMANAGE_AVG 0x12 66 | #define OV_ECTL_RATEMANAGE_HARD 0x13 67 | 68 | struct ovectl_ratemanage_arg { 69 | int management_active; 70 | 71 | long bitrate_hard_min; 72 | long bitrate_hard_max; 73 | double bitrate_hard_window; 74 | 75 | long bitrate_av_lo; 76 | long bitrate_av_hi; 77 | double bitrate_av_window; 78 | double bitrate_av_window_center; 79 | }; 80 | 81 | 82 | /* new rate setup */ 83 | #define OV_ECTL_RATEMANAGE2_GET 0x14 84 | #define OV_ECTL_RATEMANAGE2_SET 0x15 85 | 86 | struct ovectl_ratemanage2_arg { 87 | int management_active; 88 | 89 | long bitrate_limit_min_kbps; 90 | long bitrate_limit_max_kbps; 91 | long bitrate_limit_reservoir_bits; 92 | double bitrate_limit_reservoir_bias; 93 | 94 | long bitrate_average_kbps; 95 | double bitrate_average_damping; 96 | }; 97 | 98 | 99 | 100 | #define OV_ECTL_LOWPASS_GET 0x20 101 | #define OV_ECTL_LOWPASS_SET 0x21 102 | 103 | #define OV_ECTL_IBLOCK_GET 0x30 104 | #define OV_ECTL_IBLOCK_SET 0x31 105 | 106 | #ifdef __cplusplus 107 | } 108 | #endif /* __cplusplus */ 109 | 110 | #endif 111 | 112 | 113 | -------------------------------------------------------------------------------- /src/hooks/hooks.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void Base::Hooks::Init() 5 | { 6 | Data::oSwapBuffers = (SwapBuffers_t)mem::in::detour_trampoline(Data::pSwapBuffers, (mem::voidptr_t)Hooks::SwapBuffers, Data::szSwapBuffers, mem::MEM_DT_M1); 7 | Data::oShowCursor = (ShowCursor_t)mem::in::detour_trampoline(Data::pShowCursor, (mem::voidptr_t)Hooks::ShowCursor, Data::szShowCursor, mem::MEM_DT_M1); 8 | Data::o_c2sinfo = (c2sinfo_t)mem::in::detour_trampoline(Data::p_c2sinfo, (mem::voidptr_t)Hooks::c2sinfo, Data::sz_c2sinfo, mem::MEM_DT_M1); 9 | //Data::o_servertoclient = (servertoclient_t)mem::in::detour_trampoline(Data::p_servertoclient, (mem::voidptr_t)Hooks::servertoclient, Data::sz_servertoclient, mem::MEM_DT_M1); 10 | //Data::o_movelocalplayer = (movelocalplayer_t)mem::in::detour_trampoline(Data::p_movelocalplayer, (mem::voidptr_t)Hooks::movelocalplayer, Data::sz_movelocalplayer); 11 | Data::o_drawcrosshair = (drawcrosshair_t)mem::in::detour_trampoline(Data::p_drawcrosshair, (mem::voidptr_t)Hooks::drawcrosshair, Data::sz_drawcrosshair, mem::MEM_DT_M1); 12 | Data::o_attackphysics = (attackphysics_t)mem::in::detour_trampoline(Data::p_attackphysics, (mem::voidptr_t)Hooks::attackphysics, Data::sz_attackphysics, mem::MEM_DT_M1); 13 | Data::o_drawscope = (drawscope_t)mem::in::detour_trampoline(Data::p_drawscope, (mem::voidptr_t)Hooks::drawscope, Data::sz_drawscope, mem::MEM_DT_M1); 14 | Data::o_glDrawRangeElements = *Data::game.p_glDrawRangeElements; 15 | *Data::game.p_glDrawRangeElements = (glDrawRangeElements_t)Hooks::glDrawRangeElements; 16 | Data::o_dodamage = (dodamage_t)mem::in::detour_trampoline(Data::p_dodamage, (mem::voidptr_t)Hooks::dodamage, Data::sz_dodamage, mem::MEM_DT_M1); 17 | Data::o_dodamage2 = (dodamage2_t)mem::in::detour_trampoline(Data::p_dodamage2, (mem::voidptr_t)Hooks::dodamage2, Data::sz_dodamage2, mem::MEM_DT_M1); 18 | Data::o_checkheadshot = (midfunction_t)mem::in::detour_trampoline(Data::p_checkheadshot, (mem::voidptr_t)Hooks::checkheadshot, Data::sz_checkheadshot, mem::MEM_DT_M1); 19 | Data::o_mousemove = (mousemove_t)mem::in::detour_trampoline(Data::p_mousemove, (mem::voidptr_t)Hooks::mousemove, Data::sz_mousemove, mem::MEM_DT_M1); 20 | } 21 | 22 | void Base::Hooks::Shutdown() 23 | { 24 | SetWindowLongPtr(Data::hWindow, GWL_WNDPROC, (LONG_PTR)Data::oWndProc); 25 | mem::in::detour_restore(Data::p_mousemove, (mem::byte_t*)Data::o_mousemove, Data::sz_mousemove); 26 | mem::in::detour_restore(Data::p_checkheadshot, (mem::byte_t*)Data::o_checkheadshot, Data::sz_checkheadshot); 27 | mem::in::detour_restore(Data::p_dodamage2, (mem::byte_t*)Data::o_dodamage2, Data::sz_dodamage2); 28 | mem::in::detour_restore(Data::p_dodamage, (mem::byte_t*)Data::o_dodamage, Data::sz_dodamage); 29 | *Data::game.p_glDrawRangeElements = Data::o_glDrawRangeElements; 30 | mem::in::detour_restore(Data::p_drawscope, (mem::byte_t*)Data::o_drawscope, Data::sz_drawscope); 31 | mem::in::detour_restore(Data::p_attackphysics, (mem::byte_t*)Data::o_attackphysics, Data::sz_attackphysics); 32 | mem::in::detour_restore(Data::p_drawcrosshair, (mem::byte_t*)Data::o_drawcrosshair, Data::sz_drawcrosshair); 33 | //mem::in::detour_restore(Data::p_movelocalplayer, (mem::byte_t*)Data::o_movelocalplayer, Data::sz_movelocalplayer); 34 | //mem::in::detour_restore(Data::p_servertoclient, (mem::byte_t*)Data::o_servertoclient, Data::sz_servertoclient); 35 | mem::in::detour_restore(Data::p_c2sinfo, (mem::byte_t*)Data::o_c2sinfo, Data::sz_c2sinfo); 36 | mem::in::detour_restore(Data::pSwapBuffers, (mem::byte_t*)Data::oSwapBuffers, Data::szSwapBuffers); 37 | mem::in::detour_restore(Data::pShowCursor, (mem::byte_t*)Data::oShowCursor, Data::szShowCursor); 38 | } -------------------------------------------------------------------------------- /include/assaultcube/include/SDL.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** @file SDL.h 24 | * Main include header for the SDL library 25 | */ 26 | 27 | #ifndef _SDL_H 28 | #define _SDL_H 29 | 30 | #include "SDL_main.h" 31 | #include "SDL_stdinc.h" 32 | #include "SDL_audio.h" 33 | #include "SDL_cdrom.h" 34 | #include "SDL_cpuinfo.h" 35 | #include "SDL_endian.h" 36 | #include "SDL_error.h" 37 | #include "SDL_events.h" 38 | #include "SDL_loadso.h" 39 | #include "SDL_mutex.h" 40 | #include "SDL_rwops.h" 41 | #include "SDL_thread.h" 42 | #include "SDL_timer.h" 43 | #include "SDL_video.h" 44 | #include "SDL_version.h" 45 | 46 | #include "begin_code.h" 47 | /* Set up for C function definitions, even when using C++ */ 48 | #ifdef __cplusplus 49 | extern "C" { 50 | #endif 51 | 52 | /** @file SDL.h 53 | * @note As of version 0.5, SDL is loaded dynamically into the application 54 | */ 55 | 56 | /** @name SDL_INIT Flags 57 | * These are the flags which may be passed to SDL_Init() -- you should 58 | * specify the subsystems which you will be using in your application. 59 | */ 60 | /*@{*/ 61 | #define SDL_INIT_TIMER 0x00000001 62 | #define SDL_INIT_AUDIO 0x00000010 63 | #define SDL_INIT_VIDEO 0x00000020 64 | #define SDL_INIT_CDROM 0x00000100 65 | #define SDL_INIT_JOYSTICK 0x00000200 66 | #define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */ 67 | #define SDL_INIT_EVENTTHREAD 0x01000000 /**< Not supported on all OS's */ 68 | #define SDL_INIT_EVERYTHING 0x0000FFFF 69 | /*@}*/ 70 | 71 | /** This function loads the SDL dynamically linked library and initializes 72 | * the subsystems specified by 'flags' (and those satisfying dependencies) 73 | * Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup 74 | * signal handlers for some commonly ignored fatal signals (like SIGSEGV) 75 | */ 76 | extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); 77 | 78 | /** This function initializes specific SDL subsystems */ 79 | extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); 80 | 81 | /** This function cleans up specific SDL subsystems */ 82 | extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); 83 | 84 | /** This function returns mask of the specified subsystems which have 85 | * been initialized. 86 | * If 'flags' is 0, it returns a mask of all initialized subsystems. 87 | */ 88 | extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); 89 | 90 | /** This function cleans up all initialized subsystems and unloads the 91 | * dynamically linked library. You should call it upon all exit conditions. 92 | */ 93 | extern DECLSPEC void SDLCALL SDL_Quit(void); 94 | 95 | /* Ends C function definitions when using C++ */ 96 | #ifdef __cplusplus 97 | } 98 | #endif 99 | #include "close_code.h" 100 | 101 | #endif /* _SDL_H */ 102 | -------------------------------------------------------------------------------- /src/game.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "game.h" 4 | 5 | bool WorldToScreen(vec pos3D, vec* pos2D) 6 | { 7 | float mX = (float)Base::Data::WindowWidth / 2.0f; 8 | float mY = (float)Base::Data::WindowHeight / 2.0f; 9 | 10 | float x = Base::Data::game.mvpmatrix->transformx(pos3D); 11 | float y = Base::Data::game.mvpmatrix->transformy(pos3D); 12 | float z = Base::Data::game.mvpmatrix->transformz(pos3D); 13 | float w = Base::Data::game.mvpmatrix->transformw(pos3D); 14 | 15 | if (w < 0.01F) 16 | return false; 17 | 18 | pos2D->x = mX + (mX * x / w); 19 | pos2D->y = mY - (mY * y / w); 20 | pos2D->z = 0; 21 | 22 | return true; 23 | } 24 | 25 | bool IsVisible(playerent* p_ent) 26 | { 27 | traceresult_s tr = {}; 28 | tr.collided = false; 29 | playerent* LocalPlayer = Base::Data::game.player1; 30 | mem::voidptr_t fnTraceLine = (mem::voidptr_t)Base::Data::game.TraceLine; 31 | vec from = Base::Data::game.player1->o; 32 | vec to = p_ent->o; 33 | 34 | __asm 35 | { 36 | push 0 37 | push 0 38 | push LocalPlayer 39 | push to.z 40 | push to.y 41 | push to.x 42 | push from.z 43 | push from.y 44 | push from.x 45 | lea eax, [tr] 46 | call fnTraceLine; 47 | add esp, 36 48 | } 49 | 50 | return !tr.collided; 51 | } 52 | 53 | float GetDistance(vec src, vec dst) 54 | { 55 | return sqrtf( 56 | powf(dst.x - src.x, 2.0f) + 57 | powf(dst.y - src.y, 2.0f) + 58 | powf(dst.z - src.z, 2.0f) 59 | ); 60 | } 61 | 62 | float GetDistance2D(vec src, vec dst) 63 | { 64 | return sqrtf( 65 | powf(dst.x - src.x, 2.0f) + 66 | powf(dst.y - src.y, 2.0f) 67 | ); 68 | } 69 | 70 | playerent* GetClosestTarget() 71 | { 72 | playerent* current = nullptr; 73 | float last_dist = -1.0f; 74 | 75 | for (int i = 0; Base::Data::game.players->inrange(i); i++) 76 | { 77 | playerent* p_ent = Base::Data::game.players->operator[](i); 78 | if (!(p_ent && p_ent->state == CS_ALIVE && (p_ent->team != Base::Data::game.player1->team || (!m_teammode && !m_coop)))) continue; 79 | 80 | if (!current) 81 | { 82 | current = p_ent; 83 | last_dist = GetDistance(p_ent->o, Base::Data::game.player1->o); 84 | continue; 85 | } 86 | 87 | float dist = GetDistance(p_ent->o, Base::Data::game.player1->o); 88 | if (dist < last_dist) 89 | { 90 | current = p_ent; 91 | last_dist = dist; 92 | } 93 | } 94 | 95 | return current; 96 | } 97 | 98 | playerent* GetCrosshairClosestTarget() 99 | { 100 | playerent* current = nullptr; 101 | float last_dist = -1.0f; 102 | vec CrosshairPos = { (float)Base::Data::WindowWidth / 2.0f, (float)Base::Data::WindowHeight / 2.0f, 0.0f }; 103 | 104 | for (int i = 0; Base::Data::game.players->inrange(i); i++) 105 | { 106 | playerent* p_ent = Base::Data::game.players->operator[](i); 107 | if (!(p_ent && p_ent->state == CS_ALIVE && (p_ent->team != Base::Data::game.player1->team || (!m_teammode && !m_coop)))) continue; 108 | 109 | vec pos2D = {}; 110 | if (!WorldToScreen(p_ent->o, &pos2D)) continue; 111 | 112 | if (!current) 113 | { 114 | current = p_ent; 115 | last_dist = GetDistance2D(pos2D, CrosshairPos); 116 | continue; 117 | } 118 | 119 | float dist = GetDistance2D(pos2D, CrosshairPos); 120 | if (dist < last_dist) 121 | { 122 | current = p_ent; 123 | last_dist = dist; 124 | } 125 | } 126 | 127 | return current; 128 | } 129 | 130 | vec CalcAngles(vec src, vec dst) 131 | { 132 | vec angles = {}; 133 | angles.x = -atan2f(dst.x - src.x, dst.y - src.y) / PI * 180.0f + 180.0f; 134 | angles.y = asinf((dst.z - src.z) / GetDistance(src, dst)) * 180.0f / PI; 135 | angles.z = 0.0f; 136 | 137 | return angles; 138 | } -------------------------------------------------------------------------------- /src/hacks/RadarHack.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static bool bEnabled = false; 5 | static constexpr size_t szOriginalCode[4] = { 3, 6, 3, 6 }; 6 | static mem::byte_t OriginalCode[szOriginalCode[0] + szOriginalCode[1] + szOriginalCode[2] + szOriginalCode[3]]; 7 | static mem::byte_t Payload[sizeof(OriginalCode)] = { /* 0 */ 0x39, 0xC0, 0x90, /* 1 */ 0x39, 0xC9, 0x90, 0x90, 0x90, 0x90, /* 2 */ 0x39, 0xDB, 0x90, /* 3 */ 0x39, 0xC0, 0x90, 0x90, 0x90, 0x90 }; 8 | 9 | void Base::Hacks::RadarHack() 10 | { 11 | if (Data::Settings::EnableRadarHack) 12 | { 13 | if (!bEnabled) 14 | { 15 | DWORD OldProtect[4] = {}; 16 | VirtualProtect(Data::game.radar_check0, szOriginalCode[0], PAGE_EXECUTE_READWRITE, &OldProtect[0]); 17 | VirtualProtect(Data::game.radar_check1, szOriginalCode[1], PAGE_EXECUTE_READWRITE, &OldProtect[1]); 18 | VirtualProtect(Data::game.radar_check2, szOriginalCode[2], PAGE_EXECUTE_READWRITE, &OldProtect[2]); 19 | VirtualProtect(Data::game.radar_check3, szOriginalCode[3], PAGE_EXECUTE_READWRITE, &OldProtect[3]); 20 | 21 | mem::in::read(Data::game.radar_check0, (mem::voidptr_t)OriginalCode, szOriginalCode[0]); 22 | mem::in::read(Data::game.radar_check1, (mem::voidptr_t)POINTER_OFFSET(OriginalCode, szOriginalCode[0]), szOriginalCode[1]); 23 | mem::in::read(Data::game.radar_check2, (mem::voidptr_t)POINTER_OFFSET(OriginalCode, szOriginalCode[1]), szOriginalCode[2]); 24 | mem::in::read(Data::game.radar_check3, (mem::voidptr_t)POINTER_OFFSET(OriginalCode, szOriginalCode[2]), szOriginalCode[3]); 25 | 26 | mem::in::write(Data::game.radar_check0, (mem::voidptr_t)Payload, szOriginalCode[0]); 27 | mem::in::write(Data::game.radar_check1, (mem::voidptr_t)POINTER_OFFSET(Payload, szOriginalCode[0]), szOriginalCode[1]); 28 | mem::in::write(Data::game.radar_check2, (mem::voidptr_t)POINTER_OFFSET(Payload, szOriginalCode[1]), szOriginalCode[2]); 29 | mem::in::write(Data::game.radar_check3, (mem::voidptr_t)POINTER_OFFSET(Payload, szOriginalCode[2]), szOriginalCode[3]); 30 | 31 | VirtualProtect(Data::game.radar_check0, szOriginalCode[0], OldProtect[0], &OldProtect[0]); 32 | VirtualProtect(Data::game.radar_check1, szOriginalCode[1], OldProtect[1], &OldProtect[1]); 33 | VirtualProtect(Data::game.radar_check2, szOriginalCode[2], OldProtect[2], &OldProtect[2]); 34 | VirtualProtect(Data::game.radar_check3, szOriginalCode[3], OldProtect[3], &OldProtect[3]); 35 | 36 | bEnabled = true; 37 | } 38 | } 39 | 40 | else if(bEnabled) 41 | { 42 | DWORD OldProtect[4] = {}; 43 | VirtualProtect(Data::game.radar_check0, szOriginalCode[0], PAGE_EXECUTE_READWRITE, &OldProtect[0]); 44 | VirtualProtect(Data::game.radar_check1, szOriginalCode[1], PAGE_EXECUTE_READWRITE, &OldProtect[1]); 45 | VirtualProtect(Data::game.radar_check2, szOriginalCode[2], PAGE_EXECUTE_READWRITE, &OldProtect[2]); 46 | VirtualProtect(Data::game.radar_check3, szOriginalCode[3], PAGE_EXECUTE_READWRITE, &OldProtect[3]); 47 | 48 | mem::in::write(Data::game.radar_check0, (mem::voidptr_t)OriginalCode, szOriginalCode[0]); 49 | mem::in::write(Data::game.radar_check1, (mem::voidptr_t)POINTER_OFFSET(OriginalCode, szOriginalCode[0]), szOriginalCode[1]); 50 | mem::in::write(Data::game.radar_check2, (mem::voidptr_t)POINTER_OFFSET(OriginalCode, szOriginalCode[1]), szOriginalCode[2]); 51 | mem::in::write(Data::game.radar_check3, (mem::voidptr_t)POINTER_OFFSET(OriginalCode, szOriginalCode[2]), szOriginalCode[3]); 52 | 53 | VirtualProtect(Data::game.radar_check0, szOriginalCode[0], OldProtect[0], &OldProtect[0]); 54 | VirtualProtect(Data::game.radar_check1, szOriginalCode[1], OldProtect[1], &OldProtect[1]); 55 | VirtualProtect(Data::game.radar_check2, szOriginalCode[2], OldProtect[2], &OldProtect[2]); 56 | VirtualProtect(Data::game.radar_check3, szOriginalCode[3], OldProtect[3], &OldProtect[3]); 57 | 58 | bEnabled = false; 59 | } 60 | } -------------------------------------------------------------------------------- /src/hacks/NameChanger.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static std::string sOriginal = ""; 5 | static bool bChanged = false; 6 | static clock_t last = 0; 7 | static int LastIndex = 0; 8 | 9 | static const char* BotNames[] = { 10 | "Killer", 11 | "Mike", 12 | "ACAddict", 13 | "Supa", 14 | "Shootme", 15 | "Coolbot", 16 | "stefanhendriks", 17 | "Dude", 18 | "Dumb", 19 | "Rabid_Newb", 20 | "Eek", 21 | "w00t", 22 | "Pwned", 23 | "Indoor_Terrain", 24 | "Dumbstruck", 25 | "[prrt]brainfart", 26 | "Santa_Far", 27 | "TinCan-Sam", 28 | "Aristotles", 29 | "MuHaHaHa", 30 | "0x0DEFACED", 31 | "James_Bonk", 32 | "Rotaredom_Murof", 33 | "zaiBan", 34 | "YHWH", 35 | "gruiiik_gruiiik", 36 | "Lady_Die", 37 | "!!!BUY_NOW!!!", 38 | "where_am_i", 39 | "PMB", 40 | "Leagle_Eagle", 41 | "Maleficus", 42 | "Grolsch", 43 | "Gambrinius", 44 | "Staropramen", 45 | "Carlsberg", 46 | "Tuborg", 47 | "Heineken", 48 | "Amstel", 49 | "Kilkenny", 50 | "Kronebourg", 51 | "Hell", 52 | "Koff", 53 | "Orval", 54 | "Zlatopramen", 55 | "Lapin_Kulta", 56 | "Kaltenberg", 57 | "Zeunerts", 58 | "Bluesman", 59 | "Stefan", 60 | "Dumber", 61 | "XP|TheNameless", 62 | "todesgurke", 63 | "trm", 64 | "Sabre", 65 | "Oldy", 66 | "kiki", 67 | "b00nkind", 68 | "Spider_Scouter", 69 | "GDawg", 70 | "Memed", 71 | "Whistler", 72 | "SoUlFaThEr", 73 | "botmeister", 74 | "davek", 75 | "Dave", 76 | "Siro", 77 | "MikeJ", 78 | "Dude", 79 | "Dodging_Bullet", 80 | "Tomahawk", 81 | "Target", 82 | "Mom", 83 | "Newbie", 84 | "Killah", 85 | "Azrael", 86 | "Blaster", 87 | "GrandMa", 88 | "Robot", 89 | "CPU", 90 | "Coward", 91 | "FragMe", 92 | "ILikeCheese", 93 | "Freshmeat", 94 | "Dragon", 95 | "Dr00l", 96 | "Dunno", 97 | "New_B", 98 | "L33t_kR3W", 99 | "Bones", 100 | "MrJoe", 101 | "Shrike", 102 | "Captain_Shrimps", 103 | "Count_Draculol", 104 | "Harun_Al-RushIt", 105 | "Honey_Bunny", 106 | "Joe_Blow", 107 | "Z00per_N00b", 108 | "Corporal_Clegg", 109 | "Rushing_Russian", 110 | "Johnny_Crash", 111 | "Private_Parts", 112 | "Major_Headache", 113 | "General_Surgery", 114 | "luggable", 115 | "fried_circuits", 116 | "Byte_my_ASCII!", 117 | "CPLD", 118 | "FPGA", 119 | "THE_STORM", 120 | "Die_Hard", 121 | "Bad_boy", 122 | "Beast", 123 | "Dead_man", 124 | "chibby", 125 | "teh_ownerer", 126 | "teh_masterer", 127 | "ThE_MarD", 128 | "teh_smex", 129 | "t3h_p@!|\\|", 130 | "KillSwitch", 131 | "InsertNameHere", 132 | "Sprah", 133 | "Johnny5" 134 | }; 135 | 136 | void Base::Hacks::NameChanger() 137 | { 138 | if (Data::Settings::EnableNameChanger && Data::Settings::NameChangerType != 0) 139 | { 140 | clock_t now = clock(); 141 | playerent* ent = nullptr; 142 | int bot_list_len = sizeof(BotNames) / sizeof(BotNames[0]); 143 | 144 | if (((Data::Settings::NameChangerAntiSpam && (now - last >= (clock_t)(Data::Settings::NameChangerAntiSpamValue * 1000.0f)))) || !Data::Settings::NameChangerAntiSpam) 145 | { 146 | last = now; 147 | switch (Data::Settings::NameChangerType) 148 | { 149 | case 0: //None 150 | break; 151 | case 1: //Bot Names 152 | ++LastIndex; 153 | if (LastIndex >= bot_list_len) 154 | LastIndex = 0; 155 | Data::game.newname(BotNames[LastIndex]); 156 | bChanged = true; 157 | break; 158 | case 2: //Connected Player Names 159 | if (!Data::game.players->inrange(0)) break; 160 | ++LastIndex; 161 | if (!Data::game.players->inrange(LastIndex)) 162 | LastIndex = 0; 163 | ent = Data::game.players->operator[](LastIndex); 164 | 165 | if (!ent) 166 | { 167 | ++LastIndex; 168 | if (!Data::game.players->inrange(LastIndex)) 169 | LastIndex = 0; 170 | ent = Data::game.players->operator[](LastIndex); 171 | } 172 | 173 | if (!ent) break; 174 | Data::game.newname(ent->name); 175 | ent = nullptr; 176 | bChanged = true; 177 | break; 178 | default: 179 | Data::Settings::NameChangerType = 0; 180 | break; 181 | } 182 | } 183 | } 184 | 185 | else if (bChanged) 186 | { 187 | Data::game.newname(sOriginal.c_str()); 188 | bChanged = false; 189 | } 190 | 191 | else 192 | { 193 | sOriginal = Data::game.player1->name; 194 | } 195 | } -------------------------------------------------------------------------------- /include/assaultcube/src/modelcache.h: -------------------------------------------------------------------------------- 1 | template struct modelcacheentry 2 | { 3 | typedef modelcacheentry entry; 4 | 5 | T *prev, *next, *nextalloc; 6 | size_t size; 7 | bool locked; 8 | 9 | modelcacheentry(T *prev = NULL, T *next = NULL) : prev(prev), next(next), nextalloc(NULL), size(0), locked(false) {} 10 | 11 | bool empty() const 12 | { 13 | return prev==next; 14 | } 15 | 16 | void linkbefore(T *pos) 17 | { 18 | next = pos; 19 | prev = pos->entry::prev; 20 | prev->entry::next = (T *)this; 21 | next->entry::prev = (T *)this; 22 | } 23 | 24 | void linkafter(T *pos) 25 | { 26 | next = pos->entry::next; 27 | prev = pos; 28 | prev->entry::next = (T *)this; 29 | next->entry::prev = (T *)this; 30 | } 31 | 32 | void unlink() 33 | { 34 | prev->modelcacheentry::next = next; 35 | next->modelcacheentry::prev = prev; 36 | prev = next = (T *)this; 37 | } 38 | 39 | void *getdata() 40 | { 41 | return (T *)this + 1; 42 | } 43 | }; 44 | 45 | template struct modelcachelist : modelcacheentry 46 | { 47 | typedef modelcacheentry entry; 48 | 49 | modelcachelist() : entry((T *)this, (T *)this) {} 50 | 51 | T *start() { return entry::next; } 52 | T *end() { return (T *)this; } 53 | 54 | void addfirst(entry *e) 55 | { 56 | e->linkafter((T *)this); 57 | } 58 | 59 | void addlast(entry *e) 60 | { 61 | e->linkbefore((T *)this); 62 | } 63 | 64 | void removefirst() 65 | { 66 | if(!entry::empty()) entry::next->unlink(); 67 | } 68 | 69 | void removelast() 70 | { 71 | if(!entry::empty()) entry::prev->unlink(); 72 | } 73 | }; 74 | 75 | struct modelcache 76 | { 77 | struct entry : modelcacheentry {}; 78 | 79 | uchar *buf; 80 | size_t size; 81 | entry *curalloc; 82 | 83 | modelcache(size_t size = 0) : buf(size ? new uchar[size] : NULL), size(size), curalloc(NULL) {} 84 | ~modelcache() { DELETEA(buf); } 85 | 86 | void resize(size_t nsize) 87 | { 88 | if(curalloc) 89 | { 90 | for(curalloc = (entry *)buf; curalloc; curalloc = curalloc->nextalloc) curalloc->unlink(); 91 | } 92 | DELETEA(buf); 93 | buf = nsize ? new uchar[nsize] : 0; 94 | size = nsize; 95 | } 96 | 97 | template 98 | T *allocate(size_t reqsize) 99 | { 100 | reqsize += sizeof(T); 101 | if(reqsize > size) return NULL; 102 | 103 | if(!curalloc) 104 | { 105 | curalloc = (entry *)buf; 106 | curalloc->size = reqsize; 107 | curalloc->locked = false; 108 | curalloc->nextalloc = NULL; 109 | return (T *)curalloc; 110 | } 111 | 112 | if(curalloc) for(bool failed = false;;) 113 | { 114 | uchar *nextfree = curalloc ? (uchar *)curalloc + curalloc->size : (uchar *)buf; 115 | entry *nextused = curalloc ? curalloc->nextalloc : (entry *)buf; 116 | for(;;) 117 | { 118 | if(!nextused) 119 | { 120 | if(size_t(&buf[size] - nextfree) >= reqsize) goto success; 121 | break; 122 | } 123 | else if(size_t((uchar *)nextused - nextfree) >= reqsize) goto success; 124 | else if(nextused->locked) break; 125 | nextused->unlink(); 126 | nextused = nextused->nextalloc; 127 | } 128 | if(curalloc) curalloc->nextalloc = nextused; 129 | else if(failed) { curalloc = nextused; break; } 130 | else failed = true; 131 | curalloc = nextused; 132 | continue; 133 | 134 | success: 135 | entry *result = (entry *)nextfree; 136 | result->size = reqsize; 137 | result->locked = false; 138 | result->nextalloc = nextused; 139 | if(curalloc) curalloc->nextalloc = result; 140 | curalloc = result; 141 | return (T *)curalloc; 142 | } 143 | 144 | curalloc = (entry *)buf; 145 | return NULL; 146 | } 147 | 148 | template 149 | void release(modelcacheentry *e) 150 | { 151 | e->unlink(); 152 | } 153 | }; 154 | 155 | -------------------------------------------------------------------------------- /include/assaultcube/src/scale.h: -------------------------------------------------------------------------------- 1 | static void FUNCNAME(halvetexture)(uchar *src, uint sw, uint sh, uchar *dst) 2 | { 3 | uint stride = sw*BPP; 4 | for(uchar *yend = &src[sh*stride]; src < yend;) 5 | { 6 | for(uchar *xend = &src[stride]; src < xend; src += 2*BPP, dst += BPP) 7 | { 8 | #define OP(c, n) dst[n] = (uint(src[n]) + uint(src[n+BPP]) + uint(src[stride+n]) + uint(src[stride+n+BPP]))>>2 9 | PIXELOP 10 | #undef OP 11 | } 12 | src += stride; 13 | } 14 | } 15 | 16 | static void FUNCNAME(shifttexture)(uchar *src, uint sw, uint sh, uchar *dst, uint dw, uint dh) 17 | { 18 | uint stride = sw*BPP, wfrac = sw/dw, hfrac = sh/dh, wshift = 0, hshift = 0; 19 | while(dw<>tshift 41 | PIXELOP 42 | #undef OP 43 | } 44 | src += (hfrac-1)*stride; 45 | } 46 | } 47 | 48 | static void FUNCNAME(scaletexture)(uchar *src, uint sw, uint sh, uchar *dst, uint dw, uint dh) 49 | { 50 | uint stride = sw*BPP, wfrac = (sw<<12)/dw, hfrac = (sh<<12)/dh; 51 | for(uint dy = 0, y = 0, yi = 0; dy < dh; dy++) 52 | { 53 | uint y2 = y + hfrac, yi2 = y2>>12, 54 | h = y2 - y, ih = yi2 - yi, 55 | ylow, yhigh; 56 | if(yi < yi2) { ylow = 0x1000U - (y&0xFFFU); yhigh = y2&0xFFFU; } 57 | else { ylow = y2 - y; yhigh = 0; } 58 | 59 | for(uint dx = 0, x = 0, xi = 0; dx < dw; dx++) 60 | { 61 | uint x2 = x + wfrac, xi2 = x2>>12, 62 | w = x2 - x, iw = xi2 - xi, iy = 0, 63 | xlow, xhigh; 64 | if(xi < xi2) { xlow = 0x1000U - (x&0xFFFU); xhigh = x2&0xFFFU; } 65 | else { xlow = x2 - x; xhigh = 0; } 66 | 67 | #define OP(c, n) c##t = 0 68 | DEFPIXEL 69 | #undef OP 70 | for(uchar *ycur = &src[xi*BPP], *xend = &ycur[max(iw, 1U)*BPP], *yend = &ycur[stride*(max(ih, 1U) + (yhigh ? 1 : 0))]; 71 | ycur < yend; 72 | ycur += stride, xend += stride, iy++) 73 | { 74 | #define OP(c, n) c = (ycur[n]*xlow)>>12 75 | DEFPIXEL 76 | #undef OP 77 | for(uchar *xcur = &ycur[BPP]; xcur < xend; xcur += BPP) 78 | { 79 | #define OP(c, n) c += xcur[n] 80 | PIXELOP 81 | #undef OP 82 | } 83 | if(xhigh) 84 | { 85 | #define OP(c, n) c += (xend[n]*xhigh)>>12 86 | PIXELOP 87 | #undef OP 88 | } 89 | #define OP(c, n) c = (c<<12)/w 90 | PIXELOP 91 | #undef OP 92 | if(!iy) 93 | { 94 | #define OP(c, n) c##t += (c*ylow)>>12 95 | PIXELOP 96 | #undef OP 97 | } 98 | else if(iy==ih) 99 | { 100 | #define OP(c, n) c##t += (c*yhigh)>>12 101 | PIXELOP 102 | #undef OP 103 | } 104 | else 105 | { 106 | #define OP(c, n) c##t += c 107 | PIXELOP 108 | #undef OP 109 | } 110 | } 111 | 112 | #define OP(c, n) dst[n] = ((c##t)<<12)/h 113 | PIXELOP 114 | #undef OP 115 | 116 | dst += BPP; 117 | x = x2; 118 | xi = xi2; 119 | } 120 | 121 | src += ih*stride; 122 | y = y2; 123 | yi = yi2; 124 | } 125 | } 126 | 127 | #undef FUNCNAME 128 | #undef DEFPIXEL 129 | #undef PIXELOP 130 | #undef BPP 131 | 132 | -------------------------------------------------------------------------------- /include/assaultcube/src/hudgun.h: -------------------------------------------------------------------------------- 1 | VARP(nosway, 0, 0, 1); 2 | VARP(swayspeeddiv, 1, 105, 1000); 3 | VARP(swaymovediv, 1, 200, 1000); 4 | VARP(swayupspeeddiv, 1, 105, 1000); 5 | VARP(swayupmovediv, 1, 200, 1000); 6 | 7 | struct weaponmove 8 | { 9 | static vec swaydir; 10 | static int swaymillis, lastsway; 11 | 12 | float k_rot, kick; 13 | vec pos; 14 | int anim, basetime; 15 | 16 | weaponmove() : k_rot(0), kick(0), anim(0), basetime(0) { pos.x = pos.y = pos.z = 0.0f; } 17 | 18 | void calcmove(vec aimdir, int lastaction, playerent *p) 19 | { 20 | kick = k_rot = 0.0f; 21 | pos = p->o; 22 | 23 | if(!nosway) 24 | { 25 | float k = pow(0.7f, (lastmillis-lastsway)/10.0f); 26 | swaydir.mul(k); 27 | vec dv(p->vel); 28 | dv.mul((1-k)/max(p->vel.magnitude(), p->maxspeed)); 29 | dv.x *= 1.5f; 30 | dv.y *= 1.5f; 31 | dv.z *= 0.4f; 32 | swaydir.add(dv); 33 | pos.add(swaydir); 34 | } 35 | 36 | if(p->onfloor || p->onladder || p->inwater) swaymillis += lastmillis-lastsway; 37 | lastsway = lastmillis; 38 | 39 | if(p->weaponchanging) 40 | { 41 | anim = ANIM_GUN_RELOAD; 42 | basetime = p->weaponchanging; 43 | float progress = clamp((lastmillis - p->weaponchanging)/(float)weapon::weaponchangetime, 0.0f, 1.0f); 44 | k_rot = -90*sinf(progress*M_PI); 45 | } 46 | else if(p->weaponsel->reloading) 47 | { 48 | anim = ANIM_GUN_RELOAD; 49 | basetime = p->weaponsel->reloading; 50 | float reloadtime = (float)p->weaponsel->info.reloadtime, 51 | progress = clamp((lastmillis - p->weaponsel->reloading)/reloadtime, 0.0f, clamp(1.0f - (p->lastaction + p->weaponsel->gunwait - lastmillis)/reloadtime, 0.5f, 1.0f)); 52 | k_rot = -90*sinf(progress*M_PI); 53 | } 54 | else 55 | { 56 | anim = ANIM_GUN_IDLE; 57 | basetime = lastaction; 58 | 59 | int timediff = lastmillis-lastaction, 60 | animtime = min(p->weaponsel->gunwait, (int)p->weaponsel->info.attackdelay); 61 | vec sway = aimdir; 62 | float progress = 0.0f; 63 | float k_back = 0.0f; 64 | 65 | if(p->weaponsel==p->lastattackweapon) 66 | { 67 | progress = max(0.0f, min(1.0f, timediff/(float)animtime)); 68 | // f(x) = -sin(x-1.5)^3 69 | kick = -sinf(pow((1.5f*progress)-1.5f,3)); 70 | if(p->crouching) kick *= 0.75f; 71 | if(p->lastaction) anim = p->weaponsel->modelanim(); 72 | } 73 | 74 | if(p->weaponsel->info.mdl_kick_rot || p->weaponsel->info.mdl_kick_back) 75 | { 76 | k_rot = p->weaponsel->info.mdl_kick_rot*kick; 77 | k_back = p->weaponsel->info.mdl_kick_back*kick/10; 78 | } 79 | 80 | if(nosway) sway.x = sway.y = sway.z = 0; 81 | else 82 | { 83 | float swayspeed = sinf((float)swaymillis/swayspeeddiv)/(swaymovediv/10.0f); 84 | float swayupspeed = cosf((float)swaymillis/swayupspeeddiv)/(swayupmovediv/10.0f); 85 | 86 | float plspeed = min(1.0f, sqrtf(p->vel.x*p->vel.x + p->vel.y*p->vel.y)); 87 | 88 | swayspeed *= plspeed/2; 89 | swayupspeed *= plspeed/2; 90 | 91 | swap(sway.x, sway.y); 92 | sway.y = -sway.y; 93 | 94 | swayupspeed = fabs(swayupspeed); // sway a semicirle only 95 | sway.z = 1.0f; 96 | 97 | sway.x *= swayspeed; 98 | sway.y *= swayspeed; 99 | sway.z *= swayupspeed; 100 | 101 | if(p->crouching) sway.mul(0.75f); 102 | } 103 | 104 | pos.x -= aimdir.x*k_back+sway.x; 105 | pos.y -= aimdir.y*k_back+sway.y; 106 | pos.z -= aimdir.z*k_back+sway.z; 107 | } 108 | } 109 | }; 110 | 111 | vec weaponmove::swaydir(0, 0, 0); 112 | int weaponmove::lastsway = 0, weaponmove::swaymillis = 0; 113 | 114 | void preload_hudguns() 115 | { 116 | loopi(NUMGUNS) 117 | { 118 | if (i==GUN_CPISTOL) continue; //RR 18/12/12 - Remove when cpistol is added. 119 | defformatstring(widn)("modmdlweap%d", i); 120 | defformatstring(path)("weapons/%s", identexists(widn)?getalias(widn):guns[i].modelname); 121 | loadmodel(path); 122 | } 123 | } 124 | 125 | -------------------------------------------------------------------------------- /include/assaultcube/include/ogg/os_types.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 * 9 | * by the Xiph.Org Foundation http://www.xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: #ifdef jail to whip a few platforms into the UNIX ideal. 14 | last mod: $Id: os_types.h,v 1.1 2008-04-10 22:50:38 adrian_henke Exp $ 15 | 16 | ********************************************************************/ 17 | #ifndef _OS_TYPES_H 18 | #define _OS_TYPES_H 19 | 20 | /* make it easy on the folks that want to compile the libs with a 21 | different malloc than stdlib */ 22 | #define _ogg_malloc malloc 23 | #define _ogg_calloc calloc 24 | #define _ogg_realloc realloc 25 | #define _ogg_free free 26 | 27 | #if defined(_WIN32) 28 | 29 | # if defined(__CYGWIN__) 30 | # include <_G_config.h> 31 | typedef _G_int64_t ogg_int64_t; 32 | typedef _G_int32_t ogg_int32_t; 33 | typedef _G_uint32_t ogg_uint32_t; 34 | typedef _G_int16_t ogg_int16_t; 35 | typedef _G_uint16_t ogg_uint16_t; 36 | # elif defined(__MINGW32__) 37 | typedef short ogg_int16_t; 38 | typedef unsigned short ogg_uint16_t; 39 | typedef int ogg_int32_t; 40 | typedef unsigned int ogg_uint32_t; 41 | typedef long long ogg_int64_t; 42 | typedef unsigned long long ogg_uint64_t; 43 | # elif defined(__MWERKS__) 44 | typedef long long ogg_int64_t; 45 | typedef int ogg_int32_t; 46 | typedef unsigned int ogg_uint32_t; 47 | typedef short ogg_int16_t; 48 | typedef unsigned short ogg_uint16_t; 49 | # else 50 | /* MSVC/Borland */ 51 | typedef __int64 ogg_int64_t; 52 | typedef __int32 ogg_int32_t; 53 | typedef unsigned __int32 ogg_uint32_t; 54 | typedef __int16 ogg_int16_t; 55 | typedef unsigned __int16 ogg_uint16_t; 56 | # endif 57 | 58 | #elif defined(__MACOS__) 59 | 60 | # include 61 | typedef SInt16 ogg_int16_t; 62 | typedef UInt16 ogg_uint16_t; 63 | typedef SInt32 ogg_int32_t; 64 | typedef UInt32 ogg_uint32_t; 65 | typedef SInt64 ogg_int64_t; 66 | 67 | #elif defined(__MACOSX__) /* MacOS X Framework build */ 68 | 69 | # include 70 | typedef int16_t ogg_int16_t; 71 | typedef u_int16_t ogg_uint16_t; 72 | typedef int32_t ogg_int32_t; 73 | typedef u_int32_t ogg_uint32_t; 74 | typedef int64_t ogg_int64_t; 75 | 76 | #elif defined(__BEOS__) 77 | 78 | /* Be */ 79 | # include 80 | typedef int16_t ogg_int16_t; 81 | typedef u_int16_t ogg_uint16_t; 82 | typedef int32_t ogg_int32_t; 83 | typedef u_int32_t ogg_uint32_t; 84 | typedef int64_t ogg_int64_t; 85 | 86 | #elif defined (__EMX__) 87 | 88 | /* OS/2 GCC */ 89 | typedef short ogg_int16_t; 90 | typedef unsigned short ogg_uint16_t; 91 | typedef int ogg_int32_t; 92 | typedef unsigned int ogg_uint32_t; 93 | typedef long long ogg_int64_t; 94 | 95 | #elif defined (DJGPP) 96 | 97 | /* DJGPP */ 98 | typedef short ogg_int16_t; 99 | typedef int ogg_int32_t; 100 | typedef unsigned int ogg_uint32_t; 101 | typedef long long ogg_int64_t; 102 | 103 | #elif defined(R5900) 104 | 105 | /* PS2 EE */ 106 | typedef long ogg_int64_t; 107 | typedef int ogg_int32_t; 108 | typedef unsigned ogg_uint32_t; 109 | typedef short ogg_int16_t; 110 | 111 | #elif defined(__SYMBIAN32__) 112 | 113 | /* Symbian GCC */ 114 | typedef signed short ogg_int16_t; 115 | typedef unsigned short ogg_uint16_t; 116 | typedef signed int ogg_int32_t; 117 | typedef unsigned int ogg_uint32_t; 118 | typedef long long int ogg_int64_t; 119 | 120 | #else 121 | 122 | # include 123 | # include 124 | 125 | #endif 126 | 127 | #endif /* _OS_TYPES_H */ 128 | -------------------------------------------------------------------------------- /include/assaultcube/include/SDL_keyboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** @file SDL_keyboard.h 24 | * Include file for SDL keyboard event handling 25 | */ 26 | 27 | #ifndef _SDL_keyboard_h 28 | #define _SDL_keyboard_h 29 | 30 | #include "SDL_stdinc.h" 31 | #include "SDL_error.h" 32 | #include "SDL_keysym.h" 33 | 34 | #include "begin_code.h" 35 | /* Set up for C function definitions, even when using C++ */ 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** Keysym structure 41 | * 42 | * - The scancode is hardware dependent, and should not be used by general 43 | * applications. If no hardware scancode is available, it will be 0. 44 | * 45 | * - The 'unicode' translated character is only available when character 46 | * translation is enabled by the SDL_EnableUNICODE() API. If non-zero, 47 | * this is a UNICODE character corresponding to the keypress. If the 48 | * high 9 bits of the character are 0, then this maps to the equivalent 49 | * ASCII character: 50 | * @code 51 | * char ch; 52 | * if ( (keysym.unicode & 0xFF80) == 0 ) { 53 | * ch = keysym.unicode & 0x7F; 54 | * } else { 55 | * An international character.. 56 | * } 57 | * @endcode 58 | */ 59 | typedef struct SDL_keysym { 60 | Uint8 scancode; /**< hardware specific scancode */ 61 | SDLKey sym; /**< SDL virtual keysym */ 62 | SDLMod mod; /**< current key modifiers */ 63 | Uint16 unicode; /**< translated character */ 64 | } SDL_keysym; 65 | 66 | /** This is the mask which refers to all hotkey bindings */ 67 | #define SDL_ALL_HOTKEYS 0xFFFFFFFF 68 | 69 | /* Function prototypes */ 70 | /** 71 | * Enable/Disable UNICODE translation of keyboard input. 72 | * 73 | * This translation has some overhead, so translation defaults off. 74 | * 75 | * @param[in] enable 76 | * If 'enable' is 1, translation is enabled. 77 | * If 'enable' is 0, translation is disabled. 78 | * If 'enable' is -1, the translation state is not changed. 79 | * 80 | * @return It returns the previous state of keyboard translation. 81 | */ 82 | extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable); 83 | 84 | #define SDL_DEFAULT_REPEAT_DELAY 500 85 | #define SDL_DEFAULT_REPEAT_INTERVAL 30 86 | /** 87 | * Enable/Disable keyboard repeat. Keyboard repeat defaults to off. 88 | * 89 | * @param[in] delay 90 | * 'delay' is the initial delay in ms between the time when a key is 91 | * pressed, and keyboard repeat begins. 92 | * 93 | * @param[in] interval 94 | * 'interval' is the time in ms between keyboard repeat events. 95 | * 96 | * If 'delay' is set to 0, keyboard repeat is disabled. 97 | */ 98 | extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval); 99 | extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval); 100 | 101 | /** 102 | * Get a snapshot of the current state of the keyboard. 103 | * Returns an array of keystates, indexed by the SDLK_* syms. 104 | * Usage: 105 | * @code 106 | * Uint8 *keystate = SDL_GetKeyState(NULL); 107 | * if ( keystate[SDLK_RETURN] ) //... \ is pressed. 108 | * @endcode 109 | */ 110 | extern DECLSPEC Uint8 * SDLCALL SDL_GetKeyState(int *numkeys); 111 | 112 | /** 113 | * Get the current key modifier state 114 | */ 115 | extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void); 116 | 117 | /** 118 | * Set the current key modifier state. 119 | * This does not change the keyboard state, only the key modifier flags. 120 | */ 121 | extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate); 122 | 123 | /** 124 | * Get the name of an SDL virtual keysym 125 | */ 126 | extern DECLSPEC char * SDLCALL SDL_GetKeyName(SDLKey key); 127 | 128 | 129 | /* Ends C function definitions when using C++ */ 130 | #ifdef __cplusplus 131 | } 132 | #endif 133 | #include "close_code.h" 134 | 135 | #endif /* _SDL_keyboard_h */ 136 | -------------------------------------------------------------------------------- /include/assaultcube/src/servercontroller.h: -------------------------------------------------------------------------------- 1 | // code for running the server as a background process/daemon/service 2 | 3 | struct servercontroller 4 | { 5 | virtual void start() = 0; 6 | virtual void keepalive() = 0; 7 | virtual void stop() = 0; 8 | virtual ~servercontroller() {} 9 | int argc; 10 | char **argv; 11 | }; 12 | 13 | #ifdef WIN32 14 | 15 | struct winservice : servercontroller 16 | { 17 | SERVICE_STATUS_HANDLE statushandle; 18 | SERVICE_STATUS status; 19 | HANDLE stopevent; 20 | const char *name; 21 | 22 | winservice(const char *name) : name(name) 23 | { 24 | callbacks::svc = this; 25 | statushandle = 0; 26 | }; 27 | 28 | ~winservice() 29 | { 30 | if(status.dwCurrentState != SERVICE_STOPPED) stop(); 31 | callbacks::svc = NULL; 32 | } 33 | 34 | void start() // starts the server again on a new thread and returns once the windows service has stopped 35 | { 36 | SERVICE_TABLE_ENTRY dispatchtable[] = { { (LPSTR)name, (LPSERVICE_MAIN_FUNCTION)callbacks::main }, { NULL, NULL } }; 37 | if(StartServiceCtrlDispatcher(dispatchtable)) exit(EXIT_SUCCESS); 38 | else fatal("an error occurred running the AC server as windows service. make sure you start the server from the service control manager and not from the command line."); 39 | } 40 | 41 | void keepalive() 42 | { 43 | if(statushandle) 44 | { 45 | report(SERVICE_RUNNING, 0); 46 | handleevents(); 47 | } 48 | }; 49 | 50 | void stop() 51 | { 52 | if(statushandle) 53 | { 54 | report(SERVICE_STOP_PENDING, 0); 55 | if(stopevent) CloseHandle(stopevent); 56 | status.dwControlsAccepted &= ~(SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN); 57 | report(SERVICE_STOPPED, 0); 58 | } 59 | } 60 | 61 | void handleevents() 62 | { 63 | if(WaitForSingleObject(stopevent, 0) == WAIT_OBJECT_0) stop(); 64 | } 65 | 66 | void WINAPI requesthandler(DWORD ctrl) 67 | { 68 | switch(ctrl) 69 | { 70 | case SERVICE_CONTROL_STOP: 71 | report(SERVICE_STOP_PENDING, 0); 72 | SetEvent(stopevent); 73 | return; 74 | default: break; 75 | } 76 | report(status.dwCurrentState, 0); 77 | } 78 | 79 | void report(DWORD state, DWORD wait) 80 | { 81 | status.dwCurrentState = state; 82 | status.dwWaitHint = wait; 83 | status.dwWin32ExitCode = NO_ERROR; 84 | status.dwControlsAccepted = SERVICE_START_PENDING == state || SERVICE_STOP_PENDING == state ? 0 : SERVICE_ACCEPT_STOP; 85 | if(state == SERVICE_RUNNING || state == SERVICE_STOPPED) status.dwCheckPoint = 0; 86 | else status.dwCheckPoint++; 87 | SetServiceStatus(statushandle, &status); 88 | } 89 | 90 | int WINAPI svcmain() // new server thread's entry point 91 | { 92 | // fix working directory to make relative paths work 93 | if(argv && argv[0]) 94 | { 95 | string procpath; 96 | copystring(procpath, parentdir(argv[0])); 97 | copystring(procpath, parentdir(procpath)); 98 | SetCurrentDirectory((LPSTR)procpath); 99 | } 100 | 101 | statushandle = RegisterServiceCtrlHandler(name, (LPHANDLER_FUNCTION)callbacks::requesthandler); 102 | if(!statushandle) return EXIT_FAILURE; 103 | status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; 104 | status.dwServiceSpecificExitCode = 0; 105 | report(SERVICE_START_PENDING, 3000); 106 | stopevent = CreateEvent(NULL, true, false, NULL); 107 | if(!stopevent) { stop(); return EXIT_FAILURE; } 108 | extern int main(int argc, char **argv); 109 | return main(argc, argv); 110 | } 111 | 112 | 113 | struct callbacks 114 | { 115 | static winservice *svc; 116 | static int WINAPI main() { return svc->svcmain(); }; 117 | static void WINAPI requesthandler(DWORD request) { svc->requesthandler(request); }; 118 | }; 119 | 120 | /*void log(const char *msg, bool error) 121 | { 122 | HANDLE eventsrc = RegisterEventSource(NULL, "AC Server"); 123 | if(eventsrc) 124 | { 125 | int eventid = ((error ? 0x11 : 0x1) << 10) & (0x1 << 9) & (FACILITY_NULL << 6) & 0x1; // TODO: create event definitions 126 | LPCTSTR msgs[1] = { msg }; 127 | int r = ReportEvent(eventsrc, error ? EVENTLOG_ERROR_TYPE : EVENTLOG_INFORMATION_TYPE, 0, 4, NULL, 1, 0, msgs, NULL); 128 | DeregisterEventSource(eventsrc); 129 | } 130 | }*/ 131 | }; 132 | 133 | winservice *winservice::callbacks::svc = (winservice *)NULL; 134 | 135 | #endif 136 | -------------------------------------------------------------------------------- /include/assaultcube/include/SDL_config_macosx.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | #ifndef _SDL_config_macosx_h 24 | #define _SDL_config_macosx_h 25 | 26 | #include "SDL_platform.h" 27 | 28 | /* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */ 29 | #include 30 | 31 | /* This is a set of defines to configure the SDL features */ 32 | 33 | #define SDL_HAS_64BIT_TYPE 1 34 | 35 | /* Useful headers */ 36 | /* If we specified an SDK or have a post-PowerPC chip, then alloca.h exists. */ 37 | #if ( (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (!defined(__POWERPC__)) ) 38 | #define HAVE_ALLOCA_H 1 39 | #endif 40 | #define HAVE_SYS_TYPES_H 1 41 | #define HAVE_STDIO_H 1 42 | #define STDC_HEADERS 1 43 | #define HAVE_STRING_H 1 44 | #define HAVE_INTTYPES_H 1 45 | #define HAVE_STDINT_H 1 46 | #define HAVE_CTYPE_H 1 47 | #define HAVE_MATH_H 1 48 | #define HAVE_SIGNAL_H 1 49 | 50 | /* C library functions */ 51 | #define HAVE_MALLOC 1 52 | #define HAVE_CALLOC 1 53 | #define HAVE_REALLOC 1 54 | #define HAVE_FREE 1 55 | #define HAVE_ALLOCA 1 56 | #define HAVE_GETENV 1 57 | #define HAVE_PUTENV 1 58 | #define HAVE_UNSETENV 1 59 | #define HAVE_QSORT 1 60 | #define HAVE_ABS 1 61 | #define HAVE_BCOPY 1 62 | #define HAVE_MEMSET 1 63 | #define HAVE_MEMCPY 1 64 | #define HAVE_MEMMOVE 1 65 | #define HAVE_MEMCMP 1 66 | #define HAVE_STRLEN 1 67 | #define HAVE_STRLCPY 1 68 | #define HAVE_STRLCAT 1 69 | #define HAVE_STRDUP 1 70 | #define HAVE_STRCHR 1 71 | #define HAVE_STRRCHR 1 72 | #define HAVE_STRSTR 1 73 | #define HAVE_STRTOL 1 74 | #define HAVE_STRTOUL 1 75 | #define HAVE_STRTOLL 1 76 | #define HAVE_STRTOULL 1 77 | #define HAVE_STRTOD 1 78 | #define HAVE_ATOI 1 79 | #define HAVE_ATOF 1 80 | #define HAVE_STRCMP 1 81 | #define HAVE_STRNCMP 1 82 | #define HAVE_STRCASECMP 1 83 | #define HAVE_STRNCASECMP 1 84 | #define HAVE_SSCANF 1 85 | #define HAVE_SNPRINTF 1 86 | #define HAVE_VSNPRINTF 1 87 | #define HAVE_SIGACTION 1 88 | #define HAVE_SETJMP 1 89 | #define HAVE_NANOSLEEP 1 90 | 91 | /* Enable various audio drivers */ 92 | #define SDL_AUDIO_DRIVER_COREAUDIO 1 93 | #define SDL_AUDIO_DRIVER_DISK 1 94 | #define SDL_AUDIO_DRIVER_DUMMY 1 95 | 96 | /* Enable various cdrom drivers */ 97 | #define SDL_CDROM_MACOSX 1 98 | 99 | /* Enable various input drivers */ 100 | #define SDL_JOYSTICK_IOKIT 1 101 | 102 | /* Enable various shared object loading systems */ 103 | #ifdef __ppc__ 104 | /* For Mac OS X 10.2 compatibility */ 105 | #define SDL_LOADSO_DLCOMPAT 1 106 | #else 107 | #define SDL_LOADSO_DLOPEN 1 108 | #endif 109 | 110 | /* Enable various threading systems */ 111 | #define SDL_THREAD_PTHREAD 1 112 | #define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 113 | 114 | /* Enable various timer systems */ 115 | #define SDL_TIMER_UNIX 1 116 | 117 | /* Enable various video drivers */ 118 | #define SDL_VIDEO_DRIVER_DUMMY 1 119 | #if ((defined TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON)) 120 | #define SDL_VIDEO_DRIVER_TOOLBOX 1 121 | #else 122 | #define SDL_VIDEO_DRIVER_QUARTZ 1 123 | #endif 124 | #define SDL_VIDEO_DRIVER_DGA 1 125 | #define SDL_VIDEO_DRIVER_X11 1 126 | #define SDL_VIDEO_DRIVER_X11_DGAMOUSE 1 127 | #define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib" 128 | #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib" 129 | #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib" 130 | #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER "/usr/X11R6/lib/libXrender.1.dylib" 131 | #define SDL_VIDEO_DRIVER_X11_VIDMODE 1 132 | #define SDL_VIDEO_DRIVER_X11_XINERAMA 1 133 | #define SDL_VIDEO_DRIVER_X11_XME 1 134 | #define SDL_VIDEO_DRIVER_X11_XRANDR 1 135 | #define SDL_VIDEO_DRIVER_X11_XV 1 136 | 137 | /* Enable OpenGL support */ 138 | #define SDL_VIDEO_OPENGL 1 139 | #define SDL_VIDEO_OPENGL_GLX 1 140 | 141 | /* Disable screensaver */ 142 | #define SDL_VIDEO_DISABLE_SCREENSAVER 1 143 | 144 | /* Enable assembly routines */ 145 | #define SDL_ASSEMBLY_ROUTINES 1 146 | #ifdef __ppc__ 147 | #define SDL_ALTIVEC_BLITTERS 1 148 | #endif 149 | 150 | #endif /* _SDL_config_macosx_h */ 151 | -------------------------------------------------------------------------------- /include/assaultcube/src/command.h: -------------------------------------------------------------------------------- 1 | enum { ID_VAR, ID_FVAR, ID_SVAR, ID_COMMAND, ID_ALIAS }; 2 | 3 | struct identstack 4 | { 5 | char *action; 6 | int context; 7 | identstack *next; 8 | }; 9 | 10 | struct ident 11 | { 12 | int type; // one of ID_* above 13 | const char *name; 14 | bool isconst; 15 | union 16 | { 17 | int minval; // ID_VAR 18 | float minvalf; // ID_FVAR 19 | }; 20 | union 21 | { 22 | int maxval; // ID_VAR 23 | float maxvalf; // ID_FVAR 24 | }; 25 | union 26 | { 27 | int *i; // ID_VAR 28 | float *f; // ID_FVAR 29 | char **s; // ID_SVAR; 30 | } storage; 31 | union 32 | { 33 | void (*fun)(); // ID_VAR, ID_COMMAND 34 | identstack *stack; // ID_ALIAS 35 | }; 36 | const char *sig; // command signature 37 | char *action, *executing; // ID_ALIAS 38 | bool persist; 39 | 40 | int context; 41 | 42 | 43 | ident() {} 44 | 45 | // ID_VAR 46 | ident(int type, const char *name, int minval, int maxval, int *i, void (*fun)(), bool persist, int context) 47 | : type(type), name(name), isconst(false), minval(minval), maxval(maxval), fun(fun), 48 | sig(NULL), action(NULL), executing(NULL), persist(persist), context(context) 49 | { storage.i = i; } 50 | 51 | // ID_FVAR 52 | ident(int type, const char *name, float minval, float maxval, float *f, void (*fun)(), bool persist, int context) 53 | : type(type), name(name), isconst(false), minvalf(minval), maxvalf(maxval), fun(fun), 54 | sig(NULL), action(NULL), executing(NULL), persist(persist), context(context) 55 | { storage.f = f; } 56 | 57 | // ID_SVAR 58 | ident(int type, const char *name, char **s, void (*fun)(), bool persist, int context) 59 | : type(type), name(name), isconst(false), minval(0), maxval(0), fun(fun), 60 | sig(NULL), action(NULL), executing(NULL), persist(persist), context(context) 61 | { storage.s = s; } 62 | 63 | // ID_ALIAS 64 | ident(int type, const char *name, char *action, bool persist, int context) 65 | : type(type), name(name), isconst(false), minval(0), maxval(0), stack(0), 66 | sig(NULL), action(action), executing(NULL), persist(persist), context(context) 67 | { storage.i = NULL; } 68 | 69 | // ID_COMMAND 70 | ident(int type, const char *name, void (*fun)(), const char *sig, int context) 71 | : type(type), name(name), isconst(false), minval(0), maxval(0), fun(fun), 72 | sig(sig), action(NULL), executing(NULL), persist(false), context(context) 73 | { storage.i = NULL; } 74 | }; 75 | 76 | enum { IEXC_CORE = 0, IEXC_CFG, IEXC_PROMPT, IEXC_MAPCFG, IEXC_MDLCFG, IEXC_NUM }; // script execution context 77 | 78 | // nasty macros for registering script functions, abuses globals to avoid excessive infrastructure 79 | #define COMMANDN(name, fun, sig) static bool __dummy_##fun = addcommand(#name, (void (*)())fun, sig) 80 | #define COMMAND(name, sig) COMMANDN(name, name, sig) 81 | #define COMMANDF(name, sig, inlinefunc) static void __dummy_##name inlinefunc ; COMMANDN(name, __dummy_##name, sig) 82 | 83 | #define VARP(name, min, cur, max) int name = variable(#name, min, cur, max, &name, NULL, true) 84 | #define VAR(name, min, cur, max) int name = variable(#name, min, cur, max, &name, NULL, false) 85 | #define VARN(name, global, min, cur, max) int global = variable(#name, min, cur, max, &global, NULL, false) 86 | #define VARNP(name, global, min, cur, max) int global = variable(#name, min, cur, max, &global, NULL, true) 87 | #define VARF(name, min, cur, max, body) extern int name; void var_##name() { body; } int name = variable(#name, min, cur, max, &name, var_##name, false) 88 | #define VARFP(name, min, cur, max, body) extern int name; void var_##name() { body; } int name = variable(#name, min, cur, max, &name, var_##name, true) 89 | 90 | #define FVARP(name, min, cur, max) float name = fvariable(#name, min, cur, max, &name, NULL, true) 91 | #define FVAR(name, min, cur, max) float name = fvariable(#name, min, cur, max, &name, NULL, false) 92 | #define FVARF(name, min, cur, max, body) extern float name; void var_##name() { body; } float name = fvariable(#name, min, cur, max, &name, var_##name, false) 93 | #define FVARFP(name, min, cur, max, body) extern float name; void var_##name() { body; } float name = fvariable(#name, min, cur, max, &name, var_##name, true) 94 | 95 | #define SVARP(name, cur) char *name = svariable(#name, cur, &name, NULL, true) 96 | #define SVAR(name, cur) char *name = svariable(#name, cur, &name, NULL, false) 97 | #define SVARF(name, cur, body) extern char *name; void var_##name() { body; } char *name = svariable(#name, cur, &name, var_##name, false) 98 | #define SVARFP(name, cur, body) extern char *name; void var_##name() { body; } char *name = svariable(#name, cur, &name, var_##name, true) 99 | 100 | #define ATOI(s) strtol(s, NULL, 0) // supports hexadecimal numbers 101 | 102 | -------------------------------------------------------------------------------- /include/assaultcube/include/SDL_thread.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | #ifndef _SDL_thread_h 24 | #define _SDL_thread_h 25 | 26 | /** @file SDL_thread.h 27 | * Header for the SDL thread management routines 28 | * 29 | * @note These are independent of the other SDL routines. 30 | */ 31 | 32 | #include "SDL_stdinc.h" 33 | #include "SDL_error.h" 34 | 35 | /* Thread synchronization primitives */ 36 | #include "SDL_mutex.h" 37 | 38 | #include "begin_code.h" 39 | /* Set up for C function definitions, even when using C++ */ 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | /** The SDL thread structure, defined in SDL_thread.c */ 45 | struct SDL_Thread; 46 | typedef struct SDL_Thread SDL_Thread; 47 | 48 | /** Create a thread */ 49 | #if ((defined(__WIN32__) && !defined(HAVE_LIBC)) || defined(__OS2__)) && !defined(__SYMBIAN32__) 50 | /** 51 | * We compile SDL into a DLL on OS/2. This means, that it's the DLL which 52 | * creates a new thread for the calling process with the SDL_CreateThread() 53 | * API. There is a problem with this, that only the RTL of the SDL.DLL will 54 | * be initialized for those threads, and not the RTL of the calling application! 55 | * To solve this, we make a little hack here. 56 | * We'll always use the caller's _beginthread() and _endthread() APIs to 57 | * start a new thread. This way, if it's the SDL.DLL which uses this API, 58 | * then the RTL of SDL.DLL will be used to create the new thread, and if it's 59 | * the application, then the RTL of the application will be used. 60 | * So, in short: 61 | * Always use the _beginthread() and _endthread() of the calling runtime library! 62 | */ 63 | #define SDL_PASSED_BEGINTHREAD_ENDTHREAD 64 | #ifndef _WIN32_WCE 65 | #include /* This has _beginthread() and _endthread() defined! */ 66 | #endif 67 | 68 | #ifdef __OS2__ 69 | typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg); 70 | typedef void (*pfnSDL_CurrentEndThread)(void); 71 | #elif __GNUC__ 72 | typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, 73 | unsigned (__stdcall *func)(void *), void *arg, 74 | unsigned, unsigned *threadID); 75 | typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); 76 | #else 77 | typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, 78 | unsigned (__stdcall *func)(void *), void *arg, 79 | unsigned, unsigned *threadID); 80 | typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); 81 | #endif 82 | 83 | extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread); 84 | 85 | #ifdef __OS2__ 86 | #define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthread, _endthread) 87 | #elif defined(_WIN32_WCE) 88 | #define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, NULL, NULL) 89 | #else 90 | #define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex) 91 | #endif 92 | #else 93 | extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data); 94 | #endif 95 | 96 | /** Get the 32-bit thread identifier for the current thread */ 97 | extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void); 98 | 99 | /** Get the 32-bit thread identifier for the specified thread, 100 | * equivalent to SDL_ThreadID() if the specified thread is NULL. 101 | */ 102 | extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread); 103 | 104 | /** Wait for a thread to finish. 105 | * The return code for the thread function is placed in the area 106 | * pointed to by 'status', if 'status' is not NULL. 107 | */ 108 | extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status); 109 | 110 | /** Forcefully kill a thread without worrying about its state */ 111 | extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread); 112 | 113 | 114 | /* Ends C function definitions when using C++ */ 115 | #ifdef __cplusplus 116 | } 117 | #endif 118 | #include "close_code.h" 119 | 120 | #endif /* _SDL_thread_h */ 121 | -------------------------------------------------------------------------------- /assets/font/UFL.txt: -------------------------------------------------------------------------------- 1 | ------------------------------- 2 | UBUNTU FONT LICENCE Version 1.0 3 | ------------------------------- 4 | 5 | PREAMBLE 6 | This licence allows the licensed fonts to be used, studied, modified and 7 | redistributed freely. The fonts, including any derivative works, can be 8 | bundled, embedded, and redistributed provided the terms of this licence 9 | are met. The fonts and derivatives, however, cannot be released under 10 | any other licence. The requirement for fonts to remain under this 11 | licence does not require any document created using the fonts or their 12 | derivatives to be published under this licence, as long as the primary 13 | purpose of the document is not to be a vehicle for the distribution of 14 | the fonts. 15 | 16 | DEFINITIONS 17 | "Font Software" refers to the set of files released by the Copyright 18 | Holder(s) under this licence and clearly marked as such. This may 19 | include source files, build scripts and documentation. 20 | 21 | "Original Version" refers to the collection of Font Software components 22 | as received under this licence. 23 | 24 | "Modified Version" refers to any derivative made by adding to, deleting, 25 | or substituting -- in part or in whole -- any of the components of the 26 | Original Version, by changing formats or by porting the Font Software to 27 | a new environment. 28 | 29 | "Copyright Holder(s)" refers to all individuals and companies who have a 30 | copyright ownership of the Font Software. 31 | 32 | "Substantially Changed" refers to Modified Versions which can be easily 33 | identified as dissimilar to the Font Software by users of the Font 34 | Software comparing the Original Version with the Modified Version. 35 | 36 | To "Propagate" a work means to do anything with it that, without 37 | permission, would make you directly or secondarily liable for 38 | infringement under applicable copyright law, except executing it on a 39 | computer or modifying a private copy. Propagation includes copying, 40 | distribution (with or without modification and with or without charging 41 | a redistribution fee), making available to the public, and in some 42 | countries other activities as well. 43 | 44 | PERMISSION & CONDITIONS 45 | This licence does not grant any rights under trademark law and all such 46 | rights are reserved. 47 | 48 | Permission is hereby granted, free of charge, to any person obtaining a 49 | copy of the Font Software, to propagate the Font Software, subject to 50 | the below conditions: 51 | 52 | 1) Each copy of the Font Software must contain the above copyright 53 | notice and this licence. These can be included either as stand-alone 54 | text files, human-readable headers or in the appropriate machine- 55 | readable metadata fields within text or binary files as long as those 56 | fields can be easily viewed by the user. 57 | 58 | 2) The font name complies with the following: 59 | (a) The Original Version must retain its name, unmodified. 60 | (b) Modified Versions which are Substantially Changed must be renamed to 61 | avoid use of the name of the Original Version or similar names entirely. 62 | (c) Modified Versions which are not Substantially Changed must be 63 | renamed to both (i) retain the name of the Original Version and (ii) add 64 | additional naming elements to distinguish the Modified Version from the 65 | Original Version. The name of such Modified Versions must be the name of 66 | the Original Version, with "derivative X" where X represents the name of 67 | the new work, appended to that name. 68 | 69 | 3) The name(s) of the Copyright Holder(s) and any contributor to the 70 | Font Software shall not be used to promote, endorse or advertise any 71 | Modified Version, except (i) as required by this licence, (ii) to 72 | acknowledge the contribution(s) of the Copyright Holder(s) or (iii) with 73 | their explicit written permission. 74 | 75 | 4) The Font Software, modified or unmodified, in part or in whole, must 76 | be distributed entirely under this licence, and must not be distributed 77 | under any other licence. The requirement for fonts to remain under this 78 | licence does not affect any document created using the Font Software, 79 | except any version of the Font Software extracted from a document 80 | created using the Font Software may only be distributed under this 81 | licence. 82 | 83 | TERMINATION 84 | This licence becomes null and void if any of the above conditions are 85 | not met. 86 | 87 | DISCLAIMER 88 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 89 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 90 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 91 | COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 92 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 93 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 94 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 95 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER 96 | DEALINGS IN THE FONT SOFTWARE. 97 | -------------------------------------------------------------------------------- /src/hacks/ESP_Info.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void Base::Hacks::ESP_Info(playerinfo_t* p_info) 5 | { 6 | if (!p_info || !p_info->is_valid || !((Data::Settings::EnableEspTeam && p_info->ent->team == Data::game.player1->team) || (Data::Settings::EnableEspEnemy && p_info->ent->team != Data::game.player1->team))) return; 7 | 8 | ImDrawList* Draw = ImGui::GetBackgroundDrawList(); 9 | float Height = p_info->pos2D.y - p_info->headpos2D.y; 10 | float BarWidth = Height / 2; 11 | float BarHeight = Height / 20; 12 | float Padding = Height / 14; 13 | float SpaceDown = 0.0f; 14 | float SpaceUp = 0.0f; 15 | float FontHeight = 18.0f; 16 | float FontWidth = FontHeight * 0.325f; 17 | 18 | if (Data::Settings::EnableEspHealth && !(p_info->pos2D_out & (OUT_TOP | OUT_BOTTOM | OUT_LEFT | OUT_RIGHT))) 19 | { 20 | SpaceDown += Padding; 21 | ImVec2 HealthBarPos = ImVec2(p_info->pos2D.x - BarWidth / 2, p_info->pos2D.y + SpaceDown); 22 | ImVec2 HealthBarEnd = ImVec2(p_info->pos2D.x + BarWidth / 2, HealthBarPos.y + BarHeight); 23 | ImColor DamageColor = ImColor(Data::Settings::EspHealthDmgColor[0], Data::Settings::EspHealthDmgColor[1], Data::Settings::EspHealthDmgColor[2], Data::Settings::EspHealthDmgColor[3]); 24 | ImColor HealthColor = ImColor(Data::Settings::EspHealthColor[0], Data::Settings::EspHealthColor[1], Data::Settings::EspHealthColor[2], Data::Settings::EspHealthColor[3]); 25 | 26 | ImVec2 p1 = HealthBarPos; 27 | ImVec2 p2 = ImVec2(p1.x, HealthBarEnd.y); 28 | ImVec2 p3 = HealthBarEnd; 29 | ImVec2 p4 = ImVec2(p3.x, p1.y); 30 | 31 | float OutlineThickness = (p2.y - p1.y) / 4.0f; 32 | ImVec2 op1 = { p1.x - OutlineThickness / 2.0f, p1.y - OutlineThickness / 2.0f }; 33 | ImVec2 op2 = { p2.x - OutlineThickness / 2.0f, p2.y + OutlineThickness / 2.0f }; 34 | ImVec2 op3 = { p3.x + OutlineThickness / 2.0f, p3.y + OutlineThickness / 2.0f }; 35 | ImVec2 op4 = { p4.x + OutlineThickness / 2.0f, p4.y - OutlineThickness / 2.0f }; 36 | 37 | Draw->AddQuadFilled(p1, p2, p3, p4, DamageColor); 38 | 39 | p1 = p4; 40 | p1.x -= ((float)p_info->ent->health / 100.0f) * BarWidth; 41 | p2.x = p1.x; 42 | 43 | Draw->AddQuadFilled(p1, p2, p3, p4, HealthColor); 44 | Draw->AddQuad(op1, op2, op3, op4, ImColor(0.0f, 0.0f, 0.0f, 1.0f), OutlineThickness); 45 | 46 | SpaceDown += BarHeight; 47 | SpaceDown += OutlineThickness; 48 | } 49 | 50 | if (Data::Settings::EnableEspArmor && !(p_info->pos2D_out & (OUT_TOP | OUT_BOTTOM | OUT_LEFT | OUT_RIGHT))) 51 | { 52 | SpaceDown += Padding; 53 | ImVec2 ArmorBarPos = ImVec2(p_info->pos2D.x - BarWidth / 2, p_info->pos2D.y + SpaceDown); 54 | ImVec2 ArmorBarEnd = ImVec2(p_info->pos2D.x + BarWidth / 2, ArmorBarPos.y + BarHeight); 55 | ImColor DamageColor = ImColor(Data::Settings::EspArmorDmgColor[0], Data::Settings::EspArmorDmgColor[1], Data::Settings::EspArmorDmgColor[2], Data::Settings::EspArmorDmgColor[3]); 56 | ImColor ArmorColor = ImColor(Data::Settings::EspArmorColor[0], Data::Settings::EspArmorColor[1], Data::Settings::EspArmorColor[2], Data::Settings::EspArmorColor[3]); 57 | 58 | ImVec2 p1 = ArmorBarPos; 59 | ImVec2 p2 = ImVec2(p1.x, ArmorBarEnd.y); 60 | ImVec2 p3 = ArmorBarEnd; 61 | ImVec2 p4 = ImVec2(p3.x, p1.y); 62 | 63 | float OutlineThickness = (p2.y - p1.y) / 4.0f; 64 | ImVec2 op1 = { p1.x - OutlineThickness / 2.0f, p1.y - OutlineThickness / 2.0f }; 65 | ImVec2 op2 = { p2.x - OutlineThickness / 2.0f, p2.y + OutlineThickness / 2.0f }; 66 | ImVec2 op3 = { p3.x + OutlineThickness / 2.0f, p3.y + OutlineThickness / 2.0f }; 67 | ImVec2 op4 = { p4.x + OutlineThickness / 2.0f, p4.y - OutlineThickness / 2.0f }; 68 | 69 | Draw->AddQuadFilled(p1, p2, p3, p4, DamageColor); 70 | 71 | p1 = p4; 72 | p1.x -= ((float)p_info->ent->armour / 100.0f) * BarWidth; 73 | p2.x = p1.x; 74 | 75 | Draw->AddQuadFilled(p1, p2, p3, p4, ArmorColor); 76 | Draw->AddQuad(op1, op2, op3, op4, ImColor(0.0f, 0.0f, 0.0f, 1.0f), OutlineThickness); 77 | 78 | SpaceDown += BarHeight; 79 | SpaceDown += OutlineThickness; 80 | } 81 | 82 | if (Data::Settings::EnableEspName && !(p_info->headpos2D_out & (OUT_TOP | OUT_BOTTOM | OUT_LEFT | OUT_RIGHT))) 83 | { 84 | SpaceUp += Padding; 85 | size_t TextLength = strlen(p_info->ent->name); 86 | float TextWidth = (float)TextLength * FontWidth; 87 | float TextHeight = FontHeight; 88 | ImColor TextColor = ImColor(1.0f, 1.0f, 1.0f, 1.0f); 89 | if(p_info->ent->team == Data::game.player1->team && (m_teammode || m_coop)) 90 | TextColor = ImColor(Data::Settings::EspNameColorTeam[0], Data::Settings::EspNameColorTeam[1], Data::Settings::EspNameColorTeam[2], Data::Settings::EspNameColorTeam[3]); 91 | else 92 | TextColor = ImColor(Data::Settings::EspNameColorEnemy[0], Data::Settings::EspNameColorEnemy[1], Data::Settings::EspNameColorEnemy[2], Data::Settings::EspNameColorEnemy[3]); 93 | ImVec2 TextPos = ImVec2(p_info->pos2D.x - (TextWidth / 2), p_info->pos2D.y - Height - SpaceUp - TextHeight); 94 | 95 | Draw->AddText(TextPos, TextColor, (const char*)p_info->ent->name); 96 | 97 | SpaceUp += TextHeight; 98 | } 99 | } -------------------------------------------------------------------------------- /include/assaultcube/include/SDL_timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | #ifndef _SDL_timer_h 24 | #define _SDL_timer_h 25 | 26 | /** @file SDL_timer.h 27 | * Header for the SDL time management routines 28 | */ 29 | 30 | #include "SDL_stdinc.h" 31 | #include "SDL_error.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** This is the OS scheduler timeslice, in milliseconds */ 40 | #define SDL_TIMESLICE 10 41 | 42 | /** This is the maximum resolution of the SDL timer on all platforms */ 43 | #define TIMER_RESOLUTION 10 /**< Experimentally determined */ 44 | 45 | /** 46 | * Get the number of milliseconds since the SDL library initialization. 47 | * Note that this value wraps if the program runs for more than ~49 days. 48 | */ 49 | extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); 50 | 51 | /** Wait a specified number of milliseconds before returning */ 52 | extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); 53 | 54 | /** Function prototype for the timer callback function */ 55 | typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval); 56 | 57 | /** 58 | * Set a callback to run after the specified number of milliseconds has 59 | * elapsed. The callback function is passed the current timer interval 60 | * and returns the next timer interval. If the returned value is the 61 | * same as the one passed in, the periodic alarm continues, otherwise a 62 | * new alarm is scheduled. If the callback returns 0, the periodic alarm 63 | * is cancelled. 64 | * 65 | * To cancel a currently running timer, call SDL_SetTimer(0, NULL); 66 | * 67 | * The timer callback function may run in a different thread than your 68 | * main code, and so shouldn't call any functions from within itself. 69 | * 70 | * The maximum resolution of this timer is 10 ms, which means that if 71 | * you request a 16 ms timer, your callback will run approximately 20 ms 72 | * later on an unloaded system. If you wanted to set a flag signaling 73 | * a frame update at 30 frames per second (every 33 ms), you might set a 74 | * timer for 30 ms: 75 | * @code SDL_SetTimer((33/10)*10, flag_update); @endcode 76 | * 77 | * If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init(). 78 | * 79 | * Under UNIX, you should not use raise or use SIGALRM and this function 80 | * in the same program, as it is implemented using setitimer(). You also 81 | * should not use this function in multi-threaded applications as signals 82 | * to multi-threaded apps have undefined behavior in some implementations. 83 | * 84 | * This function returns 0 if successful, or -1 if there was an error. 85 | */ 86 | extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback); 87 | 88 | /** @name New timer API 89 | * New timer API, supports multiple timers 90 | * Written by Stephane Peter 91 | */ 92 | /*@{*/ 93 | 94 | /** 95 | * Function prototype for the new timer callback function. 96 | * The callback function is passed the current timer interval and returns 97 | * the next timer interval. If the returned value is the same as the one 98 | * passed in, the periodic alarm continues, otherwise a new alarm is 99 | * scheduled. If the callback returns 0, the periodic alarm is cancelled. 100 | */ 101 | typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param); 102 | 103 | /** Definition of the timer ID type */ 104 | typedef struct _SDL_TimerID *SDL_TimerID; 105 | 106 | /** Add a new timer to the pool of timers already running. 107 | * Returns a timer ID, or NULL when an error occurs. 108 | */ 109 | extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param); 110 | 111 | /** 112 | * Remove one of the multiple timers knowing its ID. 113 | * Returns a boolean value indicating success. 114 | */ 115 | extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t); 116 | 117 | /*@}*/ 118 | 119 | /* Ends C function definitions when using C++ */ 120 | #ifdef __cplusplus 121 | } 122 | #endif 123 | #include "close_code.h" 124 | 125 | #endif /* _SDL_timer_h */ 126 | -------------------------------------------------------------------------------- /include/assaultcube/src/weapon.h: -------------------------------------------------------------------------------- 1 | 2 | class playerent; 3 | class bounceent; 4 | 5 | struct weapon 6 | { 7 | const static int weaponchangetime; 8 | const static float weaponbeloweye; 9 | static void equipplayer(playerent *pl); 10 | 11 | weapon(class playerent *owner, int type); 12 | virtual ~weapon() {} 13 | 14 | int type; 15 | playerent *owner; 16 | const struct guninfo &info; 17 | int &ammo, &mag, &gunwait, shots; 18 | virtual int dynspread(); 19 | virtual float dynrecoil(); 20 | int reloading, lastaction; 21 | 22 | virtual bool attack(vec &targ) = 0; 23 | virtual void attackfx(const vec &from, const vec &to, int millis) = 0; 24 | virtual void attackphysics(vec &from, vec &to); 25 | virtual void attacksound(); 26 | virtual bool reload(bool autoreloaded); 27 | virtual void reset() {} 28 | virtual bool busy() { return false; } 29 | 30 | virtual int modelanim() = 0; 31 | virtual void updatetimers(int millis); 32 | virtual bool selectable(); 33 | virtual bool deselectable(); 34 | virtual void renderstats(); 35 | virtual void renderhudmodel(); 36 | virtual void renderaimhelp(bool teamwarning); 37 | 38 | virtual void onselecting(); 39 | virtual void ondeselecting() {} 40 | virtual void onammopicked() {} 41 | virtual void onownerdies() {} 42 | virtual void removebounceent(bounceent *b) {} 43 | 44 | void sendshoot(vec &from, vec &to, int millis); 45 | bool modelattacking(); 46 | void renderhudmodel(int lastaction, int index = 0); 47 | 48 | static bool valid(int id); 49 | 50 | virtual int flashtime() const; 51 | }; 52 | 53 | class grenadeent; 54 | 55 | enum { GST_NONE = 0, GST_INHAND, GST_THROWING }; 56 | 57 | struct grenades : weapon 58 | { 59 | grenadeent *inhandnade; 60 | const int throwwait; 61 | int throwmillis; 62 | int state; 63 | 64 | grenades(playerent *owner); 65 | bool attack(vec &targ); 66 | void attackfx(const vec &from, const vec &to, int millis); 67 | int modelanim(); 68 | void activatenade(const vec &to); 69 | void thrownade(); 70 | void thrownade(const vec &vel); 71 | void dropnade(); 72 | void renderstats(); 73 | bool selectable(); 74 | void reset(); 75 | bool busy(); 76 | void onselecting(); 77 | void onownerdies(); 78 | void removebounceent(bounceent *b); 79 | int flashtime() const; 80 | }; 81 | 82 | 83 | struct gun : weapon 84 | { 85 | gun(playerent *owner, int type); 86 | virtual bool attack(vec &targ); 87 | virtual void attackfx(const vec &from, const vec &to, int millis); 88 | int modelanim(); 89 | void checkautoreload(); 90 | }; 91 | 92 | 93 | struct subgun : gun 94 | { 95 | subgun(playerent *owner); 96 | int dynspread(); 97 | bool selectable(); 98 | }; 99 | 100 | 101 | struct sniperrifle : gun 102 | { 103 | bool scoped; 104 | int scoped_since; 105 | 106 | sniperrifle(playerent *owner); 107 | void attackfx(const vec &from, const vec &to, int millis); 108 | bool reload(bool autoreloaded); 109 | 110 | int dynspread(); 111 | float dynrecoil(); 112 | bool selectable(); 113 | void onselecting(); 114 | void ondeselecting(); 115 | void onownerdies(); 116 | void renderhudmodel(); 117 | void renderaimhelp(bool teamwarning); 118 | void setscope(bool enable); 119 | }; 120 | 121 | 122 | struct carbine : gun 123 | { 124 | carbine(playerent *owner); 125 | bool selectable(); 126 | }; 127 | 128 | struct shotgun : gun 129 | { 130 | shotgun(playerent *owner); 131 | void attackphysics(vec &from, vec &to); 132 | bool attack(vec &targ); 133 | void attackfx(const vec &from, const vec &to, int millis); 134 | bool selectable(); 135 | }; 136 | 137 | 138 | struct assaultrifle : gun 139 | { 140 | assaultrifle(playerent *owner); 141 | int dynspread(); 142 | float dynrecoil(); 143 | bool selectable(); 144 | }; 145 | 146 | struct cpistol : gun 147 | { 148 | bool bursting; 149 | cpistol(playerent *owner); 150 | bool reload(bool autoreloaded); 151 | bool selectable(); 152 | void onselecting(); 153 | void ondeselecting(); 154 | bool attack(vec &targ); 155 | void setburst(bool enable); 156 | }; 157 | 158 | struct pistol : gun 159 | { 160 | pistol(playerent *owner); 161 | bool selectable(); 162 | }; 163 | 164 | 165 | struct akimbo : gun 166 | { 167 | akimbo(playerent *owner); 168 | 169 | int akimboside; 170 | int akimbomillis; 171 | int akimbolastaction[2]; 172 | 173 | void attackfx(const vec &from, const vec &to, int millis); 174 | void onammopicked(); 175 | void onselecting(); 176 | bool selectable(); 177 | void updatetimers(int millis); 178 | void reset(); 179 | void renderhudmodel(); 180 | bool timerout(); 181 | }; 182 | 183 | 184 | struct knife : weapon 185 | { 186 | knife(playerent *owner); 187 | 188 | bool attack(vec &targ); 189 | int modelanim(); 190 | 191 | void drawstats(); 192 | void attackfx(const vec &from, const vec &to, int millis); 193 | void renderstats(); 194 | 195 | int flashtime() const; 196 | }; 197 | 198 | -------------------------------------------------------------------------------- /src/hacks/Crosshair.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void Base::Hacks::Crosshair() 5 | { 6 | if (Data::Settings::EnableCrosshair) 7 | { 8 | ImDrawList* Draw = ImGui::GetBackgroundDrawList(); 9 | ImVec2 WindowCenter = ImVec2((float)Data::WindowWidth / 2, (float)Data::WindowHeight / 2); 10 | ImColor LineColor = ImColor(Data::Settings::CrosshairColor[0], Data::Settings::CrosshairColor[1], Data::Settings::CrosshairColor[2], Data::Settings::CrosshairColor[3]); 11 | float LineLength = Data::Settings::CrosshairLength; 12 | float LineThickness = Data::Settings::CrosshairThickness; 13 | float Gap = Data::Settings::CrosshairGap; 14 | 15 | if (Data::Settings::CrosshairDot) 16 | { 17 | if(Data::Settings::CrosshairDotFilled) 18 | Draw->AddCircleFilled(WindowCenter, LineThickness, LineColor); 19 | else 20 | Draw->AddCircle(WindowCenter, LineThickness, LineColor); 21 | } 22 | 23 | switch(Data::Settings::CrosshairType) 24 | { 25 | case 0: //Default Crosshair 26 | if (Data::Settings::CrosshairTop) 27 | { 28 | ImVec2 LineTop[2] = { 29 | ImVec2(WindowCenter.x, WindowCenter.y - Gap), 30 | ImVec2(WindowCenter.x, WindowCenter.y - Gap - LineLength) 31 | }; 32 | 33 | Draw->AddLine(LineTop[0], LineTop[1], LineColor, LineThickness); 34 | } 35 | 36 | if (Data::Settings::CrosshairLeft) 37 | { 38 | ImVec2 LineLeft[2] = { 39 | ImVec2(WindowCenter.x - Gap, WindowCenter.y), 40 | ImVec2(WindowCenter.x - Gap - LineLength, WindowCenter.y) 41 | }; 42 | 43 | Draw->AddLine(LineLeft[0], LineLeft[1], LineColor, LineThickness); 44 | } 45 | 46 | if (Data::Settings::CrosshairBottom) 47 | { 48 | ImVec2 LineBottom[2] = { 49 | ImVec2(WindowCenter.x, WindowCenter.y + Gap), 50 | ImVec2(WindowCenter.x, WindowCenter.y + Gap + LineLength) 51 | }; 52 | 53 | Draw->AddLine(LineBottom[0], LineBottom[1], LineColor, LineThickness); 54 | } 55 | 56 | 57 | if (Data::Settings::CrosshairRight) 58 | { 59 | ImVec2 LineRight[2] = { 60 | ImVec2(WindowCenter.x + Gap, WindowCenter.y), 61 | ImVec2(WindowCenter.x + Gap + LineLength, WindowCenter.y) 62 | }; 63 | 64 | Draw->AddLine(LineRight[0], LineRight[1], LineColor, LineThickness); 65 | } 66 | 67 | break; 68 | 69 | case 1: //Triangle Crosshair 70 | LineLength += Gap; 71 | if (Data::Settings::CrosshairTop) 72 | { 73 | ImVec2 LineTop[] = { 74 | ImVec2(WindowCenter.x - LineLength, WindowCenter.y - LineLength / 2), 75 | ImVec2(WindowCenter.x + LineLength, WindowCenter.y - LineLength / 2) 76 | }; 77 | 78 | Draw->AddLine(LineTop[0], LineTop[1], LineColor, LineThickness); 79 | } 80 | 81 | if (Data::Settings::CrosshairLeft) 82 | { 83 | ImVec2 LineLeft[] = { 84 | ImVec2(WindowCenter.x - LineLength, WindowCenter.y - LineLength / 2), 85 | ImVec2(WindowCenter.x, WindowCenter.y + LineLength / 2) 86 | }; 87 | 88 | Draw->AddLine(LineLeft[0], LineLeft[1], LineColor, LineThickness); 89 | } 90 | 91 | if (Data::Settings::CrosshairRight) 92 | { 93 | ImVec2 LineRight[] = { 94 | ImVec2(WindowCenter.x, WindowCenter.y + LineLength / 2), 95 | ImVec2(WindowCenter.x + LineLength, WindowCenter.y - LineLength / 2) 96 | }; 97 | 98 | Draw->AddLine(LineRight[0], LineRight[1], LineColor, LineThickness); 99 | } 100 | 101 | break; 102 | 103 | case 2: //Square Crosshair 104 | LineLength += Gap; 105 | if (Data::Settings::CrosshairTop) 106 | { 107 | ImVec2 LineTop[2] = { 108 | ImVec2(WindowCenter.x - LineLength / 2, WindowCenter.y - LineLength / 2), 109 | ImVec2(WindowCenter.x + LineLength / 2, WindowCenter.y - LineLength / 2) 110 | }; 111 | 112 | Draw->AddLine(LineTop[0], LineTop[1], LineColor, LineThickness); 113 | } 114 | 115 | if (Data::Settings::CrosshairLeft) 116 | { 117 | ImVec2 LineLeft[2] = { 118 | ImVec2(WindowCenter.x - LineLength / 2, WindowCenter.y - LineLength / 2), 119 | ImVec2(WindowCenter.x - LineLength / 2, WindowCenter.y + LineLength / 2) 120 | }; 121 | 122 | Draw->AddLine(LineLeft[0], LineLeft[1], LineColor, LineThickness); 123 | } 124 | 125 | if (Data::Settings::CrosshairBottom) 126 | { 127 | ImVec2 LineBottom[2] = { 128 | ImVec2(WindowCenter.x - LineLength / 2, WindowCenter.y + LineLength / 2), 129 | ImVec2(WindowCenter.x + LineLength / 2, WindowCenter.y + LineLength / 2) 130 | }; 131 | 132 | Draw->AddLine(LineBottom[0], LineBottom[1], LineColor, LineThickness); 133 | } 134 | 135 | 136 | if (Data::Settings::CrosshairRight) 137 | { 138 | ImVec2 LineRight[2] = { 139 | ImVec2(WindowCenter.x + LineLength / 2, WindowCenter.y + LineLength / 2), 140 | ImVec2(WindowCenter.x + LineLength / 2, WindowCenter.y - LineLength / 2) 141 | }; 142 | 143 | Draw->AddLine(LineRight[0], LineRight[1], LineColor, LineThickness); 144 | } 145 | break; 146 | 147 | case 3: //Circle Crosshair 148 | LineLength += Gap; 149 | 150 | Draw->AddCircle(WindowCenter, LineLength, LineColor, 0, LineThickness); 151 | 152 | break; 153 | default: //Unknown crosshair 154 | Data::Settings::CrosshairType = 0; 155 | return; 156 | //break; 157 | } 158 | } 159 | } -------------------------------------------------------------------------------- /include/assaultcube/include/SDL_mouse.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** @file SDL_mouse.h 24 | * Include file for SDL mouse event handling 25 | */ 26 | 27 | #ifndef _SDL_mouse_h 28 | #define _SDL_mouse_h 29 | 30 | #include "SDL_stdinc.h" 31 | #include "SDL_error.h" 32 | #include "SDL_video.h" 33 | 34 | #include "begin_code.h" 35 | /* Set up for C function definitions, even when using C++ */ 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | typedef struct WMcursor WMcursor; /**< Implementation dependent */ 41 | typedef struct SDL_Cursor { 42 | SDL_Rect area; /**< The area of the mouse cursor */ 43 | Sint16 hot_x, hot_y; /**< The "tip" of the cursor */ 44 | Uint8 *data; /**< B/W cursor data */ 45 | Uint8 *mask; /**< B/W cursor mask */ 46 | Uint8 *save[2]; /**< Place to save cursor area */ 47 | WMcursor *wm_cursor; /**< Window-manager cursor */ 48 | } SDL_Cursor; 49 | 50 | /* Function prototypes */ 51 | /** 52 | * Retrieve the current state of the mouse. 53 | * The current button state is returned as a button bitmask, which can 54 | * be tested using the SDL_BUTTON(X) macros, and x and y are set to the 55 | * current mouse cursor position. You can pass NULL for either x or y. 56 | */ 57 | extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y); 58 | 59 | /** 60 | * Retrieve the current state of the mouse. 61 | * The current button state is returned as a button bitmask, which can 62 | * be tested using the SDL_BUTTON(X) macros, and x and y are set to the 63 | * mouse deltas since the last call to SDL_GetRelativeMouseState(). 64 | */ 65 | extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); 66 | 67 | /** 68 | * Set the position of the mouse cursor (generates a mouse motion event) 69 | */ 70 | extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y); 71 | 72 | /** 73 | * Create a cursor using the specified data and mask (in MSB format). 74 | * The cursor width must be a multiple of 8 bits. 75 | * 76 | * The cursor is created in black and white according to the following: 77 | * data mask resulting pixel on screen 78 | * 0 1 White 79 | * 1 1 Black 80 | * 0 0 Transparent 81 | * 1 0 Inverted color if possible, black if not. 82 | * 83 | * Cursors created with this function must be freed with SDL_FreeCursor(). 84 | */ 85 | extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor 86 | (Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y); 87 | 88 | /** 89 | * Set the currently active cursor to the specified one. 90 | * If the cursor is currently visible, the change will be immediately 91 | * represented on the display. 92 | */ 93 | extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor); 94 | 95 | /** 96 | * Returns the currently active cursor. 97 | */ 98 | extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void); 99 | 100 | /** 101 | * Deallocates a cursor created with SDL_CreateCursor(). 102 | */ 103 | extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor); 104 | 105 | /** 106 | * Toggle whether or not the cursor is shown on the screen. 107 | * The cursor start off displayed, but can be turned off. 108 | * SDL_ShowCursor() returns 1 if the cursor was being displayed 109 | * before the call, or 0 if it was not. You can query the current 110 | * state by passing a 'toggle' value of -1. 111 | */ 112 | extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); 113 | 114 | /*@{*/ 115 | /** Used as a mask when testing buttons in buttonstate 116 | * Button 1: Left mouse button 117 | * Button 2: Middle mouse button 118 | * Button 3: Right mouse button 119 | * Button 4: Mouse wheel up (may also be a real button) 120 | * Button 5: Mouse wheel down (may also be a real button) 121 | */ 122 | #define SDL_BUTTON(X) (1 << ((X)-1)) 123 | #define SDL_BUTTON_LEFT 1 124 | #define SDL_BUTTON_MIDDLE 2 125 | #define SDL_BUTTON_RIGHT 3 126 | #define SDL_BUTTON_WHEELUP 4 127 | #define SDL_BUTTON_WHEELDOWN 5 128 | #define SDL_BUTTON_X1 6 129 | #define SDL_BUTTON_X2 7 130 | #define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) 131 | #define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) 132 | #define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) 133 | #define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) 134 | #define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) 135 | /*@}*/ 136 | 137 | /* Ends C function definitions when using C++ */ 138 | #ifdef __cplusplus 139 | } 140 | #endif 141 | #include "close_code.h" 142 | 143 | #endif /* _SDL_mouse_h */ 144 | -------------------------------------------------------------------------------- /include/assaultcube/include/SDL_config_win32.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | #ifndef _SDL_config_win32_h 24 | #define _SDL_config_win32_h 25 | 26 | #include "SDL_platform.h" 27 | 28 | /* This is a set of defines to configure the SDL features */ 29 | 30 | #if defined(__GNUC__) || defined(__DMC__) 31 | #define HAVE_STDINT_H 1 32 | #elif defined(_MSC_VER) 33 | typedef signed __int8 int8_t; 34 | typedef unsigned __int8 uint8_t; 35 | typedef signed __int16 int16_t; 36 | typedef unsigned __int16 uint16_t; 37 | typedef signed __int32 int32_t; 38 | typedef unsigned __int32 uint32_t; 39 | typedef signed __int64 int64_t; 40 | typedef unsigned __int64 uint64_t; 41 | #ifndef _UINTPTR_T_DEFINED 42 | #ifdef _WIN64 43 | typedef unsigned __int64 uintptr_t; 44 | #else 45 | typedef unsigned int uintptr_t; 46 | #endif 47 | #define _UINTPTR_T_DEFINED 48 | #endif 49 | /* Older Visual C++ headers don't have the Win64-compatible typedefs... */ 50 | #if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) 51 | #define DWORD_PTR DWORD 52 | #endif 53 | #if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) 54 | #define LONG_PTR LONG 55 | #endif 56 | #else /* !__GNUC__ && !_MSC_VER */ 57 | typedef signed char int8_t; 58 | typedef unsigned char uint8_t; 59 | typedef signed short int16_t; 60 | typedef unsigned short uint16_t; 61 | typedef signed int int32_t; 62 | typedef unsigned int uint32_t; 63 | typedef signed long long int64_t; 64 | typedef unsigned long long uint64_t; 65 | #ifndef _SIZE_T_DEFINED_ 66 | #define _SIZE_T_DEFINED_ 67 | typedef unsigned int size_t; 68 | #endif 69 | typedef unsigned int uintptr_t; 70 | #endif /* __GNUC__ || _MSC_VER */ 71 | #define SDL_HAS_64BIT_TYPE 1 72 | 73 | /* Enabled for SDL 1.2 (binary compatibility) */ 74 | #define HAVE_LIBC 1 75 | #ifdef HAVE_LIBC 76 | /* Useful headers */ 77 | #define HAVE_STDIO_H 1 78 | #define STDC_HEADERS 1 79 | #define HAVE_STRING_H 1 80 | #define HAVE_CTYPE_H 1 81 | #define HAVE_MATH_H 1 82 | #ifndef _WIN32_WCE 83 | #define HAVE_SIGNAL_H 1 84 | #endif 85 | 86 | /* C library functions */ 87 | #define HAVE_MALLOC 1 88 | #define HAVE_CALLOC 1 89 | #define HAVE_REALLOC 1 90 | #define HAVE_FREE 1 91 | #define HAVE_ALLOCA 1 92 | #define HAVE_QSORT 1 93 | #define HAVE_ABS 1 94 | #define HAVE_MEMSET 1 95 | #define HAVE_MEMCPY 1 96 | #define HAVE_MEMMOVE 1 97 | #define HAVE_MEMCMP 1 98 | #define HAVE_STRLEN 1 99 | #define HAVE__STRREV 1 100 | #define HAVE__STRUPR 1 101 | #define HAVE__STRLWR 1 102 | #define HAVE_STRCHR 1 103 | #define HAVE_STRRCHR 1 104 | #define HAVE_STRSTR 1 105 | #define HAVE_ITOA 1 106 | #define HAVE__LTOA 1 107 | #define HAVE__ULTOA 1 108 | #define HAVE_STRTOL 1 109 | #define HAVE_STRTOUL 1 110 | #define HAVE_STRTOLL 1 111 | #define HAVE_STRTOD 1 112 | #define HAVE_ATOI 1 113 | #define HAVE_ATOF 1 114 | #define HAVE_STRCMP 1 115 | #define HAVE_STRNCMP 1 116 | #define HAVE__STRICMP 1 117 | #define HAVE__STRNICMP 1 118 | #define HAVE_SSCANF 1 119 | #else 120 | #define HAVE_STDARG_H 1 121 | #define HAVE_STDDEF_H 1 122 | #endif 123 | 124 | /* Enable various audio drivers */ 125 | #ifndef _WIN32_WCE 126 | #define SDL_AUDIO_DRIVER_DSOUND 1 127 | #endif 128 | #define SDL_AUDIO_DRIVER_WAVEOUT 1 129 | #define SDL_AUDIO_DRIVER_DISK 1 130 | #define SDL_AUDIO_DRIVER_DUMMY 1 131 | 132 | /* Enable various cdrom drivers */ 133 | #ifdef _WIN32_WCE 134 | #define SDL_CDROM_DISABLED 1 135 | #else 136 | #define SDL_CDROM_WIN32 1 137 | #endif 138 | 139 | /* Enable various input drivers */ 140 | #ifdef _WIN32_WCE 141 | #define SDL_JOYSTICK_DISABLED 1 142 | #else 143 | #define SDL_JOYSTICK_WINMM 1 144 | #endif 145 | 146 | /* Enable various shared object loading systems */ 147 | #define SDL_LOADSO_WIN32 1 148 | 149 | /* Enable various threading systems */ 150 | #define SDL_THREAD_WIN32 1 151 | 152 | /* Enable various timer systems */ 153 | #ifdef _WIN32_WCE 154 | #define SDL_TIMER_WINCE 1 155 | #else 156 | #define SDL_TIMER_WIN32 1 157 | #endif 158 | 159 | /* Enable various video drivers */ 160 | #ifdef _WIN32_WCE 161 | #define SDL_VIDEO_DRIVER_GAPI 1 162 | #endif 163 | #ifndef _WIN32_WCE 164 | #define SDL_VIDEO_DRIVER_DDRAW 1 165 | #endif 166 | #define SDL_VIDEO_DRIVER_DUMMY 1 167 | #define SDL_VIDEO_DRIVER_WINDIB 1 168 | 169 | /* Enable OpenGL support */ 170 | #ifndef _WIN32_WCE 171 | #define SDL_VIDEO_OPENGL 1 172 | #define SDL_VIDEO_OPENGL_WGL 1 173 | #endif 174 | 175 | /* Disable screensaver */ 176 | #define SDL_VIDEO_DISABLE_SCREENSAVER 1 177 | 178 | /* Enable assembly routines (Win64 doesn't have inline asm) */ 179 | #ifndef _WIN64 180 | #define SDL_ASSEMBLY_ROUTINES 1 181 | #endif 182 | 183 | #endif /* _SDL_config_win32_h */ 184 | -------------------------------------------------------------------------------- /include/assaultcube/src/world.h: -------------------------------------------------------------------------------- 1 | enum // block types, order matters! 2 | { 3 | SOLID = 0, // entirely solid cube [only specifies wtex] 4 | CORNER, // half full corner of a wall 5 | FHF, // floor heightfield using neighbour vdelta values 6 | CHF, // idem ceiling 7 | SPACE, // entirely empty cube 8 | SEMISOLID, // generated by mipmapping 9 | MAXTYPE 10 | }; 11 | 12 | struct sqr 13 | { 14 | uchar type; // one of the above 15 | char floor, ceil; // height, in cubes 16 | uchar wtex, ftex, ctex; // wall/floor/ceil texture ids 17 | uchar r, g, b; // light value at upper left vertex 18 | uchar vdelta; // vertex delta, used for heightfield cubes 19 | char defer; // used in mipmapping, when true this cube is not a perfect mip 20 | char occluded; // true when occluded 21 | uchar utex; // upper wall tex id 22 | uchar tag; // used by triggers 23 | uchar reserved[2]; 24 | }; 25 | 26 | enum // hardcoded texture numbers 27 | { 28 | DEFAULT_SKY = 0, 29 | DEFAULT_LIQUID, 30 | DEFAULT_WALL, 31 | DEFAULT_FLOOR, 32 | DEFAULT_CEIL 33 | }; 34 | 35 | #define MAPVERSION 9 // bump if map format changes, see worldio.cpp 36 | 37 | struct header // map file format header 38 | { 39 | char head[4]; // "CUBE" 40 | int version; // any >8bit quantity is little endian 41 | int headersize; // sizeof(header) 42 | int sfactor; // in bits 43 | int numents; 44 | char maptitle[128]; 45 | uchar texlists[3][256]; 46 | int waterlevel; 47 | uchar watercolor[4]; 48 | int maprevision; 49 | int ambient; 50 | int reserved[12]; 51 | //char mediareq[128]; // version 7 and 8 only. 52 | }; 53 | 54 | struct mapstats 55 | { 56 | struct header hdr; 57 | int entcnt[MAXENTTYPES]; 58 | int cgzsize; 59 | uchar *enttypes; 60 | short *entposs; 61 | int spawns[3]; 62 | int flags[2]; 63 | int flagents[2]; 64 | bool hasffaspawns; 65 | bool hasteamspawns; 66 | bool hasflags; 67 | }; 68 | 69 | #define TRANSFORMOLDENTITIES(headr) \ 70 | if(e.type==LIGHT) \ 71 | { \ 72 | if(!e.attr2) e.attr2 = 255; /* needed for MAPVERSION<=2 */ \ 73 | if(e.attr1>32) e.attr1 = 32; /* 12_03 and below */ \ 74 | } \ 75 | if(headr.version<6 && strncmp(headr.head,"CUBE",4)==0) /* only render lights, pl starts and map models on old maps // <6 was =6 && headr.version<8) { \ 114 | if( e.type >= I_HELMET && e.type < (MAXENTTYPES - 1) ) { e.type += 1; } \ 115 | } 116 | 117 | #define SWS(w,x,y,s) (&(w)[((y)<<(s))+(x)]) 118 | #define SW(w,x,y) SWS(w,x,y,sfactor) 119 | #define S(x,y) SW(world,x,y) // convenient lookup of a lowest mip cube 120 | #define SMALLEST_FACTOR 6 // determines number of mips there can be 121 | #define DEFAULT_FACTOR 8 122 | #define LARGEST_FACTOR 11 // 10 is already insane 123 | #define MAXENTITIES 65535 124 | #define SOLID(x) ((x)->type==SOLID) 125 | #define MINBORD 2 // 2 cubes from the edge of the world are always solid 126 | #define OUTBORD(x,y) ((x)=ssize-MINBORD || (y)>=ssize-MINBORD) 127 | #define OUTBORDRAD(x,y,rad) (int(x-rad)=ssize-MINBORD || (y+rad)>=ssize-MINBORD) 128 | #define MAXMHEIGHT 30 129 | #define MAXMAREA 10000 130 | #define MAXHHITS 50000 // was 6000, which denied my fav. maps - jamz, 2012-06-12; 15000 denies sane map too - lucas 131 | #define MINFF 2500 132 | 133 | struct block { int x, y, xs, ys, h; }; 134 | 135 | // vertex array format 136 | 137 | struct vertex { float u, v, x, y, z; uchar r, g, b, a; }; 138 | 139 | --------------------------------------------------------------------------------