Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts and experience preferred (super rare at this point).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// color1 and color2 are R4G4B4 12bit RGB color values, alpha is 0-255 | |
uint16_t blend_12bit( uint16_t color1, uint16_t color2, uint8_t alpha ) { | |
uint64_t c1 = (uint64_t) color1; | |
uint64_t c2 = (uint64_t) color2; | |
uint64_t a = (uint64_t)( alpha >> 4 ); | |
// bit magic to alpha blend R G B with single mul | |
c1 = ( c1 | ( c1 << 12 ) ) & 0x0f0f0f; | |
c2 = ( c2 | ( c2 << 12 ) ) & 0x0f0f0f; | |
uint32_t o = ( ( ( ( c2 - c1 ) * a ) >> 4 ) + c1 ) & 0x0f0f0f; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void login(httplib::Client& client) { | |
std::string user, pass; | |
std::cout << "user: "; | |
std::getline(std::cin, user); | |
std::cout << "pass: "; | |
char input[256]; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "cx_murmur3.h" | |
//---------------------------------------------------------------------------- | |
// constexpr typeid | |
namespace cx | |
{ | |
namespace err |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/****************************************************************************** | |
Swizzling demonstration | |
by James King (TheMaverickProgrammer on Github) | |
Uses strings and overloaded [] operator. | |
Malformed strings throw exception. | |
Supports any number of vectors by always returning the | |
biggest vector. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# File "Player.anims" generated 5/13/2018 @ 3:30pm | |
# Origin is relative to the rectangle defined by {x, y, x+w, y+h} | |
animation name="PLAYER_IDLE" | |
frame duration="0.01" x="0" y="0" w="36" h="60" originx="12" originy="0" | |
animation name="PLAYER_MOVING" | |
frame duration="0.01" x="0" y="0" w="36" h="60" originx="12" originy="0" | |
frame duration="0.01" x="0" y="0" w="36" h="80" originx="54" originy="12" | |
frame duration="0.01" x="0" y="0" w="36" h="20" originx="4" originy="0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************** | |
Author: Maverick Peppers | |
Date: 8/29/2016 | |
Transform a nested array glob into one linear array | |
Input: | |
- Glob. A nested array. | |
Returns: | |
- Queue. A linear array. | |
***************************************************/ |