Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Wasin Thonkaew haxpor

🎯
Focusing
View GitHub Profile
@haxpor
haxpor / BELL-412-Model-Output.txt
Created Apr 30, 2012
BELL-412 Model Structure
View BELL-412-Model-Output.txt
-- Model Bone Information --
-Name: RootNode
Index: 0
-Name: BELL412
Index: 1
-Name: group
Index: 2
-Name: BELL412_Pop1
Index: 3
-Name: BELL412_Pop1_ncl1_1
@haxpor
haxpor / SMAA.fx
Created Jul 8, 2012
Modified version of SMAA effect files to make it able to be compiled and run on XNA 3.1. Original sources taken from https://github.com/iryoku/smaa. NOTE: The code seen here don't work yet, it can be compiled and run but I'm trying to figure out the alway
View SMAA.fx
// ------------------------------------------------------
// -- SMAA ----------------------------------------------
// ------------------------------------------------------
#define SMAA_PIXEL_SIZE float2(1.0/ viewport_width, 1.0/ viewport_height)
#define SMAA_HLSL_3 1
#define SMAA_PRESET_HIGH 1
#include "SMAA.h"
/**
@haxpor
haxpor / AppDelegate.js
Created Aug 29, 2012
Example to scale content to fit the current screen resolution with the option to recieve "width" and "height" from external or from browser's available client screen.
View AppDelegate.js
/****************************************************************************
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2008-2010 Ricardo Quesada
Copyright (c) 2011 Zynga Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
View ObjectSpawner.cpp
template <>
struct ObjectSpawner::EnemyTraits<Zombie01> { const int enemy_type = (int)ZOMBIE_01; };
@haxpor
haxpor / README.md
Last active Dec 16, 2015
TestFlight Wrapper for C++ coder See README.md
View README.md

TestFlightWrapper

Created as a C++ wrapper for TestFlight SDK v.1.2.4 with the aim to clear cut using Objective-C from C++ code.
I tested with cocos2d-x v.2.0.3 (which is adhered to cocos2d v.2.0) on iOS platform.
The test includes uploading build to TestFlight and play-through testing functionality of TestFlight.

Testing

Tested

  • setDeviceIdentifier()
@haxpor
haxpor / CCMenu.cpp
Last active Dec 21, 2015
Added holding touch functionality to CCMenuItem, thus related to CCMenu. It can return time passed since the previous holding touch. Holding touch functionality can be turned on/off on the fly during run-time. The benefit is that we can use CCMenu with holding touch functionality without a need to implement on our own in external checking inside…
View CCMenu.cpp
/****************************************************************************
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2008-2010 Ricardo Quesada
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@haxpor
haxpor / convertToCaf-sfx.sh
Last active Aug 29, 2015
Converter to .caf from .wav in the current folder, nice export for ios game
View convertToCaf-sfx.sh
#!/bin/bash
# This script is for converting sound files into .caf (for sfx)
for i in *.wav; do
afconvert -f caff -d LEI16@22050 -c 1 "$i"
done
# create a new folder then move newly exported into it
mkdir caf
@haxpor
haxpor / convertToAifc-music.sh
Last active Nov 14, 2018
Convert from .wav & .mp3 to .aifc (music file) for all files in current folder, nice export for ios game
View convertToAifc-music.sh
#!/bin/bash
# This script is for converting sound files into .aifc (for music)
for i in *.wav; do
afconvert -f AIFC -d ima4 "$i"
done
for i in *.mp3; do
afconvert -f AIFC -d ima4 "$i"
@haxpor
haxpor / batchLayerTranslate.jsx
Created May 11, 2015
Batch translate layer in images residing in a folder for fixed x, and y amount. It will open each image file, then translate, then save the change replacing the file. If translating the layer outside of the image area, photoshop will interrupt and ask you whether or not to save. You can still continue to save manually. But make sure to select to…
View batchLayerTranslate.jsx
var inputFolder = Folder.selectDialog ("Select a folder to process");
var fileList = inputFolder.getFiles("*.png");
for(var i=0; i<fileList.length; i++) {
app.load(fileList[i]);
backFile = app.activeDocument;
backFile.layers[0].translate(10,-3);
backFile.close(SaveOptions.SAVECHANGES);
}
@haxpor
haxpor / exportAndSignIPA.sh
Last active Aug 29, 2015
Export Xcode's archive file to .ipa, and sign it with the proper code signing identity.
View exportAndSignIPA.sh
# Export .xcarchive file into .ipa and properly sign it with implied codesign identity
# Full credits to http://www.thecave.com/2014/09/16/using-xcodebuild-to-export-a-ipa-from-an-archive/
# Set the parameters here
archiveFileName="ZombieHero"
exportIPAFileName="ZombieHero"
provisioningProfileName="Journalists inhouse"
# Export into .ipa file
echo "-- Exporting into .ipa --"