Skip to content

Instantly share code, notes, and snippets.

View untodesu's full-sized avatar
💣
アイウエオ > アエイオウ

Kirill Dmitrievich untodesu

💣
アイウエオ > アエイオウ
View GitHub Profile
#include "cbase.h"
#include "vgui/ISurface.h"
#define GAMEUI_ALLOW_INIT //GameUI: Foolproof
#define GAMEUI_ALLOW_OVERRIDE //GameUI: Foolproof
#include <gameui.h>
#include <gameui_override.h>
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
#include "cbase.h"
#include "iclientmode.h"
#include <vector>
#include <vgui/ILocalize.h>
#include <vgui/ISurface.h>
#define GAMEUI_ALLOW_INIT //GameUI: Idiot-proof
#include <gameui.h>
// memdbgon must be the last include file in a .cpp file!!!
//=============================================================================
// Purpose: Default Source SDK GameUI Wrapper API
//=============================================================================
#include "cbase.h"
#include "iclientmode.h"
#include <vector>
#include <vgui/ILocalize.h>
#include <vgui/ISurface.h>
#include <vgui_controls/Frame.h>
#include <platform.h> // .../src/public/platform.h
#include <dll.h> // .../src/public/dll.h
#if defined(_WIN32) //Implementation for WIN32
#include <Windows.h>
//Loads DLL from file
//I'm not sure about UTF-8 here, because i didn't try that.
//I think LoadLibraryA can work with multibyte shit though.
dll::dll(const char *filename)
@untodesu
untodesu / gameui.cpp
Created December 27, 2019 15:11
Source SDK GameUI wrapper
#include "cbase.h"
#include "iclientmode.h"
#include <vector>
#include <vgui/ILocalize.h>
#include <vgui/ISurface.h>
#include <vgui_controls/Frame.h>
#define GAMEUI_ALLOW_INIT //GameUI: Idiot-proof
#include <gameui.h>
//=======================================================================
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//=======================================================================
#include <libcommon/common.h>
int C_strlen(const char *s)
{
v//==============================================================================
// Copyright (c) 2020, undbsd
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
//==============================================================================
// Copyright (c) 2020, undbsd
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
math.h 1/sqrt(double) -- Q_rsqrt(double)
-nan --- -nan
inf --- inf
1.000000 --- 1.000000
0.707107 --- 0.707107
0.577350 --- 0.577350
0.500000 --- 0.500000
0.447214 --- 0.447214
0.408248 --- 0.408248
0.377964 --- 0.377964
======================================================
Calculating square root and inverse square root
for 64-bit floating point numbers.
======================================================
1. The basic constant values
> L constant is the maximum value can be stored in
the number's fraction ( for IEEE754 its 2^52 )
* L = 4503599627370496