Vita設定で
設定->機内モードにしてみる。
そうすると、再接続される。
2014年5月7日水曜日
2014年5月6日火曜日
独習C# P74 論理演算子を使って0と1を表示するリスト(テーブル)
論理演算子を使って0と1を表示するリスト(テーブル)
NOTの所だけint型なので工夫する必要が出てくる。
私は三項演算子を使いました。
下記C#ソース
using System;
class page74
{
static void Main()
{
int p , q;
Console.WriteLine("P\tQ\tAND\tOR\tXOR\tNOT");
p = 1 ;q = 1;
Console.Write(p + "\t" + q + "\t");
Console.Write((p&q) + "\t" + (p|q) + "\t");
Console.WriteLine((p^q) + "\t" + "{0}" , (!(p == 1))?1:0);
p = 1 ; q = 0;
Console.Write(p + "\t" + q + "\t");
Console.Write((p&q) + "\t" + (p|q) + "\t");
Console.WriteLine((p^q) + "\t" + "{0}" , (!(p == 1))?1:0);
p = 0 ; q = 1;
Console.Write(p + "\t" + q + "\t");
Console.Write((p&q) + "\t" + (p|q) + "\t");
Console.WriteLine((p^q) + "\t" + "{0}" , (!(p == 1))?1:0);
p = 0 ; q = 0;
Console.Write(p + "\t" + q + "\t");
Console.Write((p&q) + "\t" + (p|q) + "\t");
Console.WriteLine((p^q) + "\t" + "{0}" , (!(p == 1))?1:0);
Console.Read();
}
}
NOTの所だけint型なので工夫する必要が出てくる。
私は三項演算子を使いました。
下記C#ソース
using System;
class page74
{
static void Main()
{
int p , q;
Console.WriteLine("P\tQ\tAND\tOR\tXOR\tNOT");
p = 1 ;q = 1;
Console.Write(p + "\t" + q + "\t");
Console.Write((p&q) + "\t" + (p|q) + "\t");
Console.WriteLine((p^q) + "\t" + "{0}" , (!(p == 1))?1:0);
p = 1 ; q = 0;
Console.Write(p + "\t" + q + "\t");
Console.Write((p&q) + "\t" + (p|q) + "\t");
Console.WriteLine((p^q) + "\t" + "{0}" , (!(p == 1))?1:0);
p = 0 ; q = 1;
Console.Write(p + "\t" + q + "\t");
Console.Write((p&q) + "\t" + (p|q) + "\t");
Console.WriteLine((p^q) + "\t" + "{0}" , (!(p == 1))?1:0);
p = 0 ; q = 0;
Console.Write(p + "\t" + q + "\t");
Console.Write((p&q) + "\t" + (p|q) + "\t");
Console.WriteLine((p^q) + "\t" + "{0}" , (!(p == 1))?1:0);
Console.Read();
}
}
2014年4月29日火曜日
ゲームプログラマになる前に覚えておきたい技術 ch.2
最後に丸や三角形を描画すると見やすい画面になると書いてありました。
サンプルコードを下記に書く。
丸のスクリプト
double型をint型にキャストしているので若干見栄えが良くない。
void drawCircle(int x , int y, unsigned color)
{
unsigned* vram = Framework::instance().videoMemory();
int w = Framework::instance().width();
int xx = 0 , yy = 0;
int hankei = 8;
for(int r = 0; r <= hankei;++r)
{
for(int i = 1 ; i < 360; ++i)
{
xx = hankei+cos(i)*r;
yy = hankei+sin(i)*r;
vram[(y*hankei*2+yy) * w + (x*hankei*2 + xx)] =color;
}
}
}
三角形のスクリプト
固定三角、同様にして色んな三角形を書けると思う。
void drawTriangle(int x , int y , unsigned color)
{
unsigned* vram = Framework::instance().videoMemory();
int w = Framework::instance().width();
int t = 1;
for(int i = 0 ; i < 16 ; ++i)
{
for(int j = 0; j < 16 ; ++j)
{
if((16 - t) > j)continue;
else vram[(y*16+j) * w + (x*16+i)] = color;
}
t++;
}
}
namespace GameLib{
void Framework::update(){
//mainLoop();
drawTriangle(0,0,0xff0000);
drawCircle(0,0,0x00ff00);
}
}
サンプルコードを下記に書く。
丸のスクリプト
double型をint型にキャストしているので若干見栄えが良くない。
void drawCircle(int x , int y, unsigned color)
{
unsigned* vram = Framework::instance().videoMemory();
int w = Framework::instance().width();
int xx = 0 , yy = 0;
int hankei = 8;
for(int r = 0; r <= hankei;++r)
{
for(int i = 1 ; i < 360; ++i)
{
xx = hankei+cos(i)*r;
yy = hankei+sin(i)*r;
vram[(y*hankei*2+yy) * w + (x*hankei*2 + xx)] =color;
}
}
}
三角形のスクリプト
固定三角、同様にして色んな三角形を書けると思う。
void drawTriangle(int x , int y , unsigned color)
{
unsigned* vram = Framework::instance().videoMemory();
int w = Framework::instance().width();
int t = 1;
for(int i = 0 ; i < 16 ; ++i)
{
for(int j = 0; j < 16 ; ++j)
{
if((16 - t) > j)continue;
else vram[(y*16+j) * w + (x*16+i)] = color;
}
t++;
}
}
namespace GameLib{
void Framework::update(){
//mainLoop();
drawTriangle(0,0,0xff0000);
drawCircle(0,0,0x00ff00);
}
}
2014年3月11日火曜日
2013年11月19日火曜日
メモ:C++のDLLをインポートしたUnityをLuaで制御する
使用したソフト:Visual Studio2013 express
使用したLua:lua-5.2.1_Win32_dll11_lib
使用したUnity:Unity Pro 4.3 体験版
まず初めにVisual Studioに解凍したLuaライブラリファイルを関連付ける。
C:\Lua\include インクルードファイルをここに置いてみた。
C:\Lua\lib ライブラリファイルをここに置いてみた。
C:\Lua\test 操作するluaスクリプトをここに置いてみた。
下記はC++のDLL用のスクリプト
#include <iostream>
#include "lua.hpp"
using namespace std;
#define DllExport extern "C" __declspec (dllexport)
DllExport int Func() {
lua_State *L = luaL_newstate();
luaL_openlibs(L);
luaL_dofile(L, "C:\\Lua\\test\\sample.lua");
lua_getglobal(L, "lua_Func");//luaスクリプトの関数を登録
lua_call(L, 0, 1);//引数の数 戻り値の数
int n = lua_tointeger(L, -1);
lua_pop(L, 1);
lua_close(L);
return n;
}
下記はsample.luaのスクリプト
function lua_Func()
return 3
end
C++のDLLを作成した後、UnityにDLLをPluginsフォルダに取り込む
下記はUnityのC#のスクリプト
using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;//ココ大事
public class Plugin : MonoBehaviour {
[DllImport("Hoge")]
private static extern int Func();
// Use this for initialization
void Start () {
Debug.Log(Func());
}
// Update is called once per frame
void Update () {
}
}

成功!!
続き:
メモ:UnityをLuaで制御する その2
使用したLua:lua-5.2.1_Win32_dll11_lib
使用したUnity:Unity Pro 4.3 体験版
まず初めにVisual Studioに解凍したLuaライブラリファイルを関連付ける。
C:\Lua\include インクルードファイルをここに置いてみた。
C:\Lua\lib ライブラリファイルをここに置いてみた。
C:\Lua\test 操作するluaスクリプトをここに置いてみた。
下記はC++のDLL用のスクリプト
#include <iostream>
#include "lua.hpp"
using namespace std;
#define DllExport extern "C" __declspec (dllexport)
DllExport int Func() {
lua_State *L = luaL_newstate();
luaL_openlibs(L);
luaL_dofile(L, "C:\\Lua\\test\\sample.lua");
lua_getglobal(L, "lua_Func");//luaスクリプトの関数を登録
lua_call(L, 0, 1);//引数の数 戻り値の数
int n = lua_tointeger(L, -1);
lua_pop(L, 1);
lua_close(L);
return n;
}
下記はsample.luaのスクリプト
function lua_Func()
return 3
end
C++のDLLを作成した後、UnityにDLLをPluginsフォルダに取り込む
下記はUnityのC#のスクリプト
using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;//ココ大事
public class Plugin : MonoBehaviour {
[DllImport("Hoge")]
private static extern int Func();
// Use this for initialization
void Start () {
Debug.Log(Func());
}
// Update is called once per frame
void Update () {
}
}

成功!!
続き:
メモ:UnityをLuaで制御する その2
2013年9月7日土曜日
YYC Compilerをセットアップ!
Windows 7の場合:
Windows SDK(8.0) とVisual Stduio 2012 Expressをダウンロードしてインストールする。
Game Maker Studio のメニュー内のFileからPreferencesを選択してWindowsタブを選択する。
Windows SDK と Visual Studioのディレクトリを各々選択する。
Check Windows SDKをクリックして、SDK StatusがSDK OKになればセットアップ完了する
OKを押して終了する。
Targetを(YYC)のものにするとコンパイルできる。
以上。
Windows SDK(8.0) とVisual Stduio 2012 Expressをダウンロードしてインストールする。
Game Maker Studio のメニュー内のFileからPreferencesを選択してWindowsタブを選択する。
Windows SDK と Visual Studioのディレクトリを各々選択する。
Check Windows SDKをクリックして、SDK StatusがSDK OKになればセットアップ完了する
OKを押して終了する。
Targetを(YYC)のものにするとコンパイルできる。
以上。
2013年7月28日日曜日
ベンチマーク3
前回グラボを交換しましたが
前回のベンチマーク結果はマザーボードをPCI 2.0 x16で動作させたものでした。
今回は、PCI 3.0 x16で動作させたベンチマークです。
スペック
OS:Windows 7 Ultimate x64
CPU:intel core i7 2600K 3.40GHz
Memory:8GB
MB:P8Z77-V PRO(PCI 3.0)←ここ変更
GPU:GTX 770 OC 2GB
SSD:Intel 128GB
PCケース:CM690 II Plus
電源:剛力3プラグイン 700W
http://www.scythe.co.jp/power/gouriki3p.html
http://www.gdm.or.jp/archive/review/690ii/index_02.html
■FF14 新生ベンチマーク(解像度を1200と1080にしてみた)


■3DMark Vantage ベンチマーク結果(1920x1200 フルスクリーン)

■PSO2 ベンチマーク結果(設定5 1920x1200 フルスクリーン)

■ラストレムナント

結論としては、他のレビューされてる方の通り2%~3%の違いでした。
FF14はCPUも使うみたいで4770Kクラスだと8000台になるみたいです。
前回のベンチマーク結果はマザーボードをPCI 2.0 x16で動作させたものでした。
今回は、PCI 3.0 x16で動作させたベンチマークです。
スペック
OS:Windows 7 Ultimate x64
CPU:intel core i7 2600K 3.40GHz
Memory:8GB
MB:P8Z77-V PRO(PCI 3.0)←ここ変更
GPU:GTX 770 OC 2GB
SSD:Intel 128GB
PCケース:CM690 II Plus
電源:剛力3プラグイン 700W
http://www.scythe.co.jp/power/gouriki3p.html
http://www.gdm.or.jp/archive/review/690ii/index_02.html
■FF14 新生ベンチマーク(解像度を1200と1080にしてみた)
■3DMark Vantage ベンチマーク結果(1920x1200 フルスクリーン)
■PSO2 ベンチマーク結果(設定5 1920x1200 フルスクリーン)
■ラストレムナント
結論としては、他のレビューされてる方の通り2%~3%の違いでした。
FF14はCPUも使うみたいで4770Kクラスだと8000台になるみたいです。
登録:
投稿 (Atom)