Giter VIP home page Giter VIP logo

portal2-internal's Introduction

Man, this party stinks. I hate these people.

counter

portal2-internal's People

Contributors

es3n1n avatar sa68ru avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

portal2-internal's Issues

Air control fix doesn't work on alot of mods.

The air control fix thing that removes the speedcap Only seems to work for vanilla portal. Doesn't work on portal stories mel or Portal reloaded just crashes when you try to enable it

Doesn't work anymore

the first time i injected it with cheat engine everything was fine but after that it never worked again

CMake support

a modern sdk should have cmake support, because vcxproj is xml bullshit.

look into enabling [[maybe_unused]] for gcc

gcc has the -Wno-attributes flag..

gcc doesn't seem to support attributes for shit anyways (at least not for struct members, that is).. less macros = good, but more compiler flags = bad.. your call, man

a fun todo list

if (h < 1) {
return color_t((unsigned char)(brightness * 255), (unsigned char)(t * 255), (unsigned char)(p * 255));
} else if (h < 2) {
return color_t((unsigned char)(q * 255), (unsigned char)(brightness * 255), (unsigned char)(p * 255));
} else if (h < 3) {
return color_t((unsigned char)(p * 255), (unsigned char)(brightness * 255), (unsigned char)(t * 255));
} else if (h < 4) {
return color_t((unsigned char)(p * 255), (unsigned char)(q * 255), (unsigned char)(brightness * 255));
} else if (h < 5) {
return color_t((unsigned char)(t * 255), (unsigned char)(p * 255), (unsigned char)(brightness * 255));
} else {
return color_t((unsigned char)(brightness * 255), (unsigned char)(p * 255), (unsigned char)(q * 255));
}

This should be a truth table, with the values assigned at the top. A temporary color_t construction would be clearer, imo:

[[nodiscard]] color_t from_hsb(float h, float s, float b) {
   color_t tmp{};
   //
   //
   //: do stuff..
   
   switch(h):
      case 1:
         tmp.r = ...;
         tmp.b = ...;
         tmp.g = ...;
         return tmp;
      case 2:
         tmp.r = ...;
         tmp.b = ...;
         tmp.g = ...;
         return tmp;

et cetera.

  • done / fixed / invalid

std::int32_t r = 0, g = 0, b = 0, a = 255;

Those should be uint8_t. So should be the parameters in member functions.

  • done / fixed / invalid

return color_t(static_cast<unsigned char>((r_ * progress) + (r * (1.f - progress))),
static_cast<unsigned char>((g_ * progress) + (g * (1.f - progress))),
static_cast<unsigned char>((b_ * progress) + (b * (1.f - progress))));

This is highly unsafe. This probably should just error out on shit data.

  • done / fixed / invalid

return (unsigned long)((((int)this->a & 0xff) << 0x18) | (((int)this->r & 0xff) << 0x10) | (((int)this->g & 0xff) << 0x8) | ((int)this->b & 0xff));

I suggest this:

    std::uint32_t get_hex() {
        auto get_hex_byte = [&](std::uint8_t field, unsigned shift_amt) -> std::uint8_t {
            return (field & 0xff) << shift_amt;
        };
        
        enum {
            ALPHA = 24,
            RED = 16,
            GREEN = 8,
            BLUE = 0
        };

        return  get_hex_byte(this->a, ALPHA) |
                get_hex_byte(this->r, RED) |
                get_hex_byte(this->g, GREEN) |
                get_hex_byte(this->b, BLUE);
    }
  • done / fixed / invalid

Throughout the project you use #pragma once directives.

These were not supported by GCC. (Yeah, it was a long time ago. Poor little GNU compiler). Still, the #ifndef MY_SHIT is highly preferrable.

  • done / fixed / invalid

typedef i_client_networkable* (*create_client_class_fn)(int entnum, int serialNum);
typedef i_client_networkable* (*create_event_fn)();

  • Why not using create_client_class_fn? more modern shit, looks cool, LSP's love them.

  • Should these be publicly available?

  • done / fixed / invalid


return _mm_cvtss_f32(_mm_sqrt_ss(_mm_set_ss(x * x + y * y)));

Clang optimizes these away. This just restricts the usage availability.

  • done / fixed / invalid

There's probably a lot more that needs to be done, but these are the only ones that i've found.

add a stack-aware exception handler

the greatest p2internal cheat needs to have a (SEH/VEH/stack unwinding) little thing to handle da crashes so that the crash log might actually be useful in the github issues...

no `LICENSE` provided?

you're already using nlohmann's json, you probably should license the code provided..

Remove predetermined path in cfg.hpp

rn the _dir is c:\\portal2-internal which, well, fucking sucks for a lot of reasons

  1. can we force the configs to a user folder, so that in unix-like systems down the line the config doesn't just create a folder in root directory?

  2. can std::filesystem resolve paths in compiletime? if so, resolve in compile time we should

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.