GIRL.CPP
上传用户:abcdshs
上传日期:2007-01-07
资源大小:1858k
文件大小:2k
源码类别:

游戏

开发平台:

Visual C++

  1. // (C) Copyright 1996 by Anthony J. Carin.  All Rights Reserved.
  2. #include <stdafx.h>
  3. #include <girl.h>
  4. girl::girl(personal *p) : dude(p)
  5. {
  6.    lchest  = new attachment(coordinate(0.13f,-0.03f,0.1f));
  7.    rchest  = new attachment(coordinate(-0.13f,-0.03f,0.1f));
  8.    pelvis  = new attachment(coordinate(0.0f,-0.65f,-0.12f));
  9.    m_lboob = new baseobject(m_personal.boob());
  10.    m_rboob = new baseobject(m_personal.boob());
  11.    m_butt  = new baseobject(m_personal.gluts());
  12.    lchest->attachto(m_lboob);
  13.    rchest->attachto(m_rboob);
  14.    pelvis->attachto(m_butt);
  15.    delete m_head;
  16.    m_head  = new girlhead(&m_personal);
  17.    neck->attachto(m_head);
  18.    shirtcolor(RGB(0,148,0));
  19.    pantscolor(RGB(0,0,200));
  20.    skincolor(RGB(240,200,0));
  21.    haircolor(RGB(240,0,0));
  22.    personaleffect();
  23. }
  24. girl::~girl()
  25. {
  26.    delete lchest;
  27.    delete rchest;
  28.    delete pelvis;
  29.    delete m_lboob;
  30.    delete m_rboob;
  31.    delete m_butt;
  32.    delete m_head;
  33.    m_head = 0;
  34. }
  35. void girl::shirtcolor(COLORREF c)
  36. {
  37.    dude::shirtcolor(c);
  38.    m_lboob->setcolor(c);
  39.    m_rboob->setcolor(c);
  40. }
  41. void girl::pantscolor(COLORREF c)
  42. {
  43.    dude::pantscolor(c);
  44.    m_butt->setcolor(c);
  45. }
  46. void girl::haircolor(COLORREF c)
  47. {
  48.    m_head->haircolor(c);
  49. }
  50. void girl::draw()
  51. {
  52.    lchest->setto(m_view);
  53.    rchest->setto(m_view);
  54.    pelvis->setto(m_view);
  55.    dude::draw();
  56.    lchest->draw();
  57.    rchest->draw();
  58.    pelvis->draw();
  59. }
  60. void girl::setto(view& v)
  61. {
  62.    dude::setto(v);
  63. }
  64. void girl::personaleffect()
  65. {
  66.     haircolor(m_personal.haircolor());
  67.     dude::personaleffect();
  68. }
  69. girlhead::girlhead(personal *p) : head(p)
  70. {
  71.    roots = new attachment(coordinate(0.0f,0.05f,0.04f));
  72.    hair  = new baseobject(p->hair());
  73.    roots->attachto(hair);
  74.    haircolor(RGB(255,255,0));
  75. }
  76. girlhead::~girlhead()
  77. {
  78.    delete roots;
  79.    delete hair;
  80. }
  81. void girlhead::haircolor(COLORREF c)
  82. {
  83.    hair->setcolor(c);
  84. }
  85. void girlhead::draw()
  86. {
  87.    head::draw();
  88.    roots->draw();
  89. }
  90. void girlhead::setto(view &v)
  91. {
  92.    head::setto(v);
  93.    roots->setxoff(xposition);
  94.    roots->setyoff(yposition);
  95.    roots->setzoff(zposition);
  96.    roots->setto(v);
  97. }