Skip to content

Instantly share code, notes, and snippets.

@mamontov-cpp
mamontov-cpp / pngloader_libpng.cpp
Created April 24, 2024 07:58
PNG Loader via libPNG
#include "imageformats/pngloader.h"
#define TAR7Z_SADDY
#include "3rdparty/tar7z/include/tar.h"
#define STBI_ONLY_PNG
#define STB_IMAGE_IMPLEMENTATION
#include "3rdparty/stb/stb_image.h"
// пусть 1 - красный, 2 - желтый, 0 - пустота, 3 - синий, 4 - светолосиний, 5 - зелёный, 6 - белый, 7 - розовый
// пусть в массиве индекс идёт по часовой стрелке 0 - 12 часов, 1 - 1, 2 - 2 - 3 часа, 3 - 3, 4 - 6 часов, 5 -5, 6 - 9 часов, 7 - 7
// тогда q - сдвиг влево на 2, e - сдвиг вправо на 2
// switch (S) - циклический сдвиг внизу 3, 4, 5
#include <string>
#include <cstdlib>
#include <iostream>
#include <unordered_set>
#include <unordered_map>
@mamontov-cpp
mamontov-cpp / custom_game_engines_small_study.md
Created September 22, 2020 07:57 — forked from raysan5/custom_game_engines_small_study.md
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) because d

@mamontov-cpp
mamontov-cpp / sendcurrentbasket.php
Last active July 23, 2018 11:36
Послать текущую корзину
\CModule::IncludeModule('intervolga.mybox');
\CModule::IncludeModule('sale');
$fuserId = \CSaleBasket::GetBasketUserID();
$arBasketRequest = \Intervolga\Mybox\Tool\Basket::getBasketForRequest($fuserId);
$arData = \Intervolga\Mybox\Tool\Front\RealTime::xmlEncode($arBasketRequest);
/**
* Обновляет координаты склада, если они не заданы, но известен адрес.
*
* @param int $id
* @param bool $forceUpdate принудительно обновить координаты склада
*/
public static function updateGpsGeocode($id, $forceUpdate = false)
{
$arStore = self::getGeoData($id);
$shouldUpdate = true;
@mamontov-cpp
mamontov-cpp / rabbitmqreceiver.php
Created June 27, 2018 14:44
rabbitmqreceiver.php
<?
namespace Intervolga\Mybox\Tool\Front\Sku;
use Intervolga\Mybox\Main;
use PhpAmqpLib\Channel\AMQPChannel;
use PhpAmqpLib\Connection\AMQPStreamConnection;
use PhpAmqpLib\Exception\AMQPRuntimeException;
use PhpAmqpLib\Message\AMQPMessage;
use PhpAmqpLib\Wire\AMQPTable;
<skus name=”sku-14.06.2018-16-54-00”>
<sku>
<store>6d38791d-8213-4810-b3f4-ece5e8734098</store>
<item>43fd919a-9a7a-40cb-849b-fb7778df00a0</item>
<menuId>416</menuId>
<active>Y</active>
<benefit>64.000</benefit>
<price>64.000</price>
<menuStart>2018-06-13T00:00:00</menuStart>
<menuEnd>9999-12-31T00:00:00</menuEnd>
@mamontov-cpp
mamontov-cpp / DateTime.php
Created June 21, 2018 13:37
DateTime.php
<?php
/**
* Автор: Бурым
* Описание: вспомогательный класс для работы с датой и временем
*/
class CC_DateTime
{
/**
* Номер первого месяца в году
*/
<?php
$options = array(
CURLOPT_POST => false,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => false,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_AUTOREFERER => true,
CURLOPT_CONNECTTIMEOUT => 120,
CURLOPT_TIMEOUT => 120,
CURLOPT_MAXREDIRS => 10,
@mamontov-cpp
mamontov-cpp / VBOUtils.java
Created April 26, 2018 11:49
VBOUtils.java
package gl;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.util.ArrayList;
import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.ARBVertexBufferObject;
import org.lwjgl.opengl.ContextCapabilities;
import org.lwjgl.opengl.GLContext;