Skip to content

Instantly share code, notes, and snippets.

View take-cheeze's full-sized avatar
💤

Takeshi Watanabe take-cheeze

💤
View GitHub Profile
/*
* Copyright 2009-2010 Cybozu Labs, Inc.
* Copyright 2011 Kazuho Oku
*
* 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.
* 2. Redistributions in binary form must reproduce the above copyright notice,
@take-cheeze
take-cheeze / convert_material.sh
Created November 21, 2012 06:41
mp3,midi -> wav -> ogg script
#!/usr/bin/env bash
EXEC_DIR=$(pwd)
cd $(dirname $0)
SCRIPT_DIR=$(pwd)
cd $EXEC_DIR
for dir in Music Sound
@take-cheeze
take-cheeze / semd_to_kindle.rb
Created November 21, 2012 15:42
PDF sending script
#!/usr/bin/env ruby
chunks = []
current_chunk = []
current_chunk_size = 0
CHUNK_MAX = 25
CHUNK_SIZE_MAX = 1000 * 1000 * 20
KINDLE_DIR = '%s/Dropbox/Kindle/' % [ENV['HOME']]
@take-cheeze
take-cheeze / gitignore
Created November 24, 2012 08:17
.gitignore
# emacs
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
.elc
auto-save-list
tramp
# sed
@take-cheeze
take-cheeze / libsndfile_test.cxx
Created December 7, 2012 13:07
libsndfile and OpenAL test
extern "C" {
#include <sndfile.h>
}
#include <AL/al.h>
#include <AL/alc.h>
#include <cassert>
#include <cstdlib>
#include <iostream>
@take-cheeze
take-cheeze / libsndfile_test.cxx
Created December 7, 2012 13:09
libsndfile and OpenAL test
/*
TO compile:
ccache g++ -Wall -Wextra -pipe -lsndfile -lopenal -lboost_chrono -lboost_system -lboost_thread libsndfile_test.cxx
TO run:
./a.out $AUDIO_FILE
*/
#include <sndfile.h>
#include <boost/assign/list_of.hpp>
#include <map>
using boost::assign::list_of;
using boost::assign::map_list_of;
typedef std::map<std::string, std::string> sub_map_type;
static sub_map_type sub_map;
typedef std::map<std::string, sub_map_type> rtp_table_type;
/////////////////////////////////////////////////////////////////////////////
// This file is part of EasyRPG Player.
//
// EasyRPG Player is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// EasyRPG Player is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
repeat this per each frame
1. mark already execuated event to unexecuted
2. mark map event executable that satisfy appear term and start term
3. continue following until you process 10000 step
* find from executable, smallest event id, unexecuted event.
1. find executing event from non-waiting events with following strategy
2. current executing event
3. type is map auto event.
4. type is map parallel event.
@take-cheeze
take-cheeze / gist:4411470
Last active December 10, 2015 08:58
battle formula in rpg2k
# Character #
* A: attacking character
* B: attacked character
# Note #
* On action that is decided from probability will be selected by random number.
* If the attack carry attribute, the effect change rate will be reflected to damage or effect amount.
# Normal attack damage #
* damage: decrease amount of hit point