//생성자 CGameProcessManager::CGameProcessManager() { //그래픽 읽기 JPictureInfo jpi; jpi.SetColorKey(JColor(0, 0, 255)); jdd->LoadPicture("SPRITE", "data\\sprite.gif", &jpi, true); //데이터 초기화 InitPlayData(); //시작 프로세스를 넣자 NewProcess(proc_dungeon); }
JColor JColor::brighter() { double f = 1.0/FACTOR; return JColor(min((int)(getRed()*f), 255), min((int)(getGreen()*f), 255), min((int)(getBlue()*f), 255)); }
JColor JColor::darker() { return JColor(max((int)(getRed()*FACTOR), 0), max((int)(getGreen()*FACTOR), 0), max((int)(getBlue() *FACTOR), 0)); }
JColor::JColor(float r, float g, float b, float a) { *this = JColor((int)(r*255), (int)(g*255), (int)(b*255), (int)(a*255));}
JColor JColor::getHSBJColor(float h, float s, float b) { return JColor(HSBtoRGB(h, s, b)); }
JColor JColor::white(255, 255, 255); JColor JColor::lightGray(192, 192, 192); JColor JColor::gray(128, 128, 128); JColor JColor::darkGray(64, 64, 64); JColor JColor::black(0, 0, 0); JColor JColor::red(255, 0, 0); JColor JColor::pink(255, 175, 175); JColor JColor::orange(255, 200, 0); JColor JColor::yellow(255, 255, 0); JColor JColor::green(0, 255, 0); JColor JColor::magenta(255, 0, 255); JColor JColor::cyan(0, 255, 255); JColor JColor::blue(0, 0, 255); double JColor::FACTOR = 0.70711; char* theJColor = JColor().Register(); void JColor::writeContent(JOutputStream& os) { JObject::writeContent(os); putInteger(os, "value", value); } void JColor::readContent(JDictionary& dict) { JObject::readContent(dict); value = getInteger(dict, "value"); } const char* JColor::className() const { return "JColor";} int JColor::hashCode() const { return hashMask & value;} JObject* JColor::clone() const { return new JColor(*this);} int JColor::compareTo(const JObject& s) const { if (className() != s.className())
#include "JBytesData.h" #include "JMath.h" const int JBytesData::id = 8; const JColor JBytesData::color = JColor(192, 192, 255).darker(); const char* JBytesData::className() const { return "JBytesData";} const char* JBytesData::sid() const { return "B";} JObject* JBytesData::clone() const { return new JBytesData(*this);} JBytesData::JBytesData(JBlock& _value) : JBlockData(_value) {}
#include "JComplexData.h" #include "JComplex.h" #include "JMath.h" const int JComplexData::id = 12; const JColor JComplexData::color = JColor(128, 128, 128).darker(); const char* JComplexData::className() const { return "JComplexData";} const char* JComplexData::sid() const { return "c";} JObject* JComplexData::clone() const { return new JComplexData(*this);} int JComplexData::compareTo(const JObject& s) const { if (className() != s.className()) return JObject::compareTo(s); return cmp(value.norm(), ((JComplexData*)&s)->value.norm()); } JComplexData::JComplexData(jcomplex& _value) : value(_value) {} JComplexData::operator jcomplex&() const { return value;} void JComplexData::reset() const { value = jcomplex();} void JComplexData::assign(const JObject& obj) const { value = *(JComplex*)&obj;}