Skip to content

Instantly share code, notes, and snippets.

@hirosof
hirosof / WaitPressKey.hsp
Created August 19, 2012 21:38
WaitPressKey.cppのHSP版
#include "user32.as"
#include "winmm.as"
#module
#deffunc WaitPressKey int virtualkeycode , int timeout
mref retkey , 64
flag = 0
timeBeginPeriod 1
timeGetTime
timed = stat
#include "WaitPressKey.h"
int WaitPressKey(int keyid,int timeout){
int byteKeyState[256];
int flag = 0 , i , retkey = keyid;
int starttime;
if(keyid >= 256)return -1;
timeBeginPeriod(1);
@hirosof
hirosof / HSFFT.cpp
Created September 30, 2012 08:24
HSFFT
#include "HSFFT.h"
#include <Windows.h>
#ifndef __HSFFT_CPP__
#define __HSFFT_CPP__
//2を底としたlog(対数)関数 for FFT・IFFT
unsigned int HS_fft_log2(unsigned int r){
double log_num , integer;
log_num = log((double)r) / log(2.0);
if(modf(log_num , &integer))return 0;
#module
#deffunc hsline int sx , int sy , int ex , int ey , int r,int g, int b
x1 = sx
y1 = sy
x2 = ex
y2 = ey
namera = 0
#include "HSCOLOR.h"
#ifndef __HS_MYCOLOR__
#define __HS_MYCOLOR__
/*************************************************************************
関数名 :max3
機能 :3つの実数値より最大の値を返す
定義 :double max3(double num1,double num2,double num3);
書式 :maxnum = max3(num1,num2,num3);
戻り値 :渡された値のうち最大の値
#include <Windows.h>
#ifndef _CHSLine_H_
#define _CHSLine_H_
class CHSLine{
private:
HDC hdc; //デバイスコンテキストハンドル
#include <Windows.h>
#ifndef _CHSLine_H_
#define _CHSLine_H_
class CHSLine{
private:
HDC hdc; //デバイスコンテキストハンドル
#include "HSFFT.h"
#include <Windows.h>
#ifndef __HSFFT_CPP__
#define __HSFFT_CPP__
//2を底としたlog(対数)関数 for FFT・IFFT
unsigned int HS_fft_log2(unsigned int r){
double log_num , integer;
log_num = log((double)r) / log(2.0);
if(modf(log_num , &integer))return 0;
#include <Windows.h>
#ifndef _CHSLine_H_
#define _CHSLine_H_
typedef struct tagCHSLine_Color{
int rgbflag;
union{
COLORREF rgb;
struct{
#include "CHSLine.h"
#ifndef _CHSLine_CPP_
#define _CHSLine_CPP_
//コンストラクタ
CHSLine::CHSLine(void){
this->hdc = 0;
this->SetColor(0);