Skip to content

Commit

Permalink
Fix : minor fix of platform
Browse files Browse the repository at this point in the history
  • Loading branch information
김도엽 authored and 김도엽 committed Dec 11, 2022
1 parent 8d81eb5 commit 32cfa56
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 32 deletions.
Binary file modified Debug/VirtualLego.bsc
Binary file not shown.
Binary file modified Debug/VirtualLego.exe
Binary file not shown.
Binary file modified Debug/VirtualLego.ilk
Binary file not shown.
3 changes: 2 additions & 1 deletion Debug/VirtualLego.log
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_math.h(
C:\Users\김도엽\source\repos\Kredsya\OOP-Proj4\Status.h(19,3): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Users\김도엽\source\repos\Kredsya\OOP-Proj4\Status.h(53,65): warning C4290: 함수가 __declspec(nothrow)가 아님을 나타내려는 경우를 제외하고 C++ 예외 사양은 무시됩니다.
C:\Users\김도엽\source\repos\Kredsya\OOP-Proj4\virtualLego.cpp(82,6): warning C4101: 'i' :참조되지 않은 지역 변수입니다.
C:\Users\김도엽\source\repos\Kredsya\OOP-Proj4\virtualLego.cpp(219,39): warning C4244: '인수': 'double'에서 'float'(으)로 변환하면서 데이터가 손실될 수 있습니다.
C:\Users\김도엽\source\repos\Kredsya\OOP-Proj4\virtualLego.cpp(223,39): warning C4244: '인수': 'double'에서 'float'(으)로 변환하면서 데이터가 손실될 수 있습니다.
CBottomWall.obj : warning LNK4075: '/EDITANDCONTINUE'이(가) '/SAFESEH' 사양으로 인해 무시됩니다.
VirtualLego.vcxproj -> C:\Users\김도엽\source\repos\Kredsya\OOP-Proj4\Debug\VirtualLego.exe
Binary file modified Debug/VirtualLego.pdb
Binary file not shown.
Binary file modified Debug/VirtualLego.tlog/CL.write.1.tlog
Binary file not shown.
Binary file modified Debug/VirtualLego.tlog/link.read.1.tlog
Binary file not shown.
Binary file modified Debug/VirtualLego.tlog/link.write.1.tlog
Binary file not shown.
Binary file modified Debug/vc143.idb
Binary file not shown.
Binary file modified Debug/vc143.pdb
Binary file not shown.
Binary file modified Debug/virtualLego.obj
Binary file not shown.
6 changes: 4 additions & 2 deletions Jumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ bool Jumper::hasIntersected(Platform& platform) {
double xDiff = cord.x - platform_cord.x;
double zDiff = (cord.z - JUMPERDEPTH / 2) - (platform_cord.z + PLATFORMDEPTH / 2);

if (-JUMPERWIDTH < xDiff && xDiff < PLATFORMWIDTH / 2) {
if (-PLATFORMDEPTH / 4 < zDiff && zDiff < 0) {
double xBoundary = PLATFORMWIDTH / 2 + JUMPERWIDTH / 2;

if (-xBoundary < xDiff && xDiff < xBoundary) {
if (-PLATFORMDEPTH < zDiff && zDiff < 0) {
return true;
}
}
Expand Down
29 changes: 5 additions & 24 deletions Platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,17 @@ Platform::Platform(void) {
D3DXMatrixIdentity(&m_mLocal);
ZeroMemory(&m_mtrl, sizeof(m_mtrl));
x, z = 0;
width = depth = height = 0;
m_pBoundMesh = NULL;
}

Platform::Platform(float iwidth, float iheight, float idepth, D3DXCOLOR color) {
D3DXMatrixIdentity(&m_mLocal);
ZeroMemory(&m_mtrl, sizeof(m_mtrl));
x, z = 0;

m_mtrl.Ambient = color;
m_mtrl.Diffuse = color;
m_mtrl.Specular = color;
m_mtrl.Emissive = d3d::BLACK;
m_mtrl.Power = 5.0f;

width = iwidth;
height = iheight;
depth = idepth;

width = PLATFORMWIDTH;
height = PLATFORMHEIGHT;
depth = PLATFORMDEPTH;
m_pBoundMesh = nullptr;
}

Platform::~Platform(void) {

}

bool Platform::create(IDirect3DDevice9* pDevice, float iwidth, float iheight, float idepth, D3DXCOLOR color) {
bool Platform::create(IDirect3DDevice9* pDevice, D3DXCOLOR color) {
if (NULL == pDevice)
return false;

Expand All @@ -40,10 +24,7 @@ bool Platform::create(IDirect3DDevice9* pDevice, float iwidth, float iheight, fl
m_mtrl.Emissive = d3d::BLACK;
m_mtrl.Power = 5.0f;

width = iwidth;
depth = idepth;

if (FAILED(D3DXCreateBox(pDevice, iwidth, iheight, idepth, &m_pBoundMesh, NULL)))
if (FAILED(D3DXCreateBox(pDevice, PLATFORMWIDTH, PLATFORMHEIGHT, PLATFORMDEPTH, &m_pBoundMesh, NULL)))
return false;
return true;
}
Expand Down
5 changes: 2 additions & 3 deletions Platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#define PLATFORMWIDTH 0.4f
#define PLATFORMHEIGHT 0.1f
#define PLATFORMDEPTH 0.1f
#define PLATFORMDEPTH 0.05f
#define LTX(x) x - PLATFORMWIDTH / 2 // x of Left Top point
#define LTZ(z) z + PLATFORMHEIGHT / 2 // z of Left Top point

Expand All @@ -22,9 +22,8 @@ class Platform {

public:
Platform(void);
Platform(float iwidth, float iheight, float idepth, D3DXCOLOR color);
~Platform(void);
bool create(IDirect3DDevice9* pDevice, float iwidth, float iheight, float idepth, D3DXCOLOR color);
bool create(IDirect3DDevice9* pDevice, D3DXCOLOR color);
void destroy(void);
void draw(IDirect3DDevice9* pDevice, const D3DXMATRIX& mWorld);
void setPosition(float x, float y, float z);
Expand Down
8 changes: 6 additions & 2 deletions virtualLego.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,13 @@ bool Setup() {
//if (!displayGameStatus.create("Times New Roman", 16, Device)) return false;

// create platform
g_platforms[0].setPosition(0, 0, 0);
//g_platforms[1].setPosition(-0.5, 0, 0.5);

for (int i = 0; i < NUM_PLATFORM; i++) {
if (!g_platforms[i].create(Device, PLATFORMWIDTH, PLATFORMHEIGHT, PLATFORMDEPTH, d3d::GREEN)) return false;
g_platforms[i].setPosition(0, 0, 0);
if (!g_platforms[i].create(Device, d3d::GREEN)) return false;
D3DXVECTOR3 m = g_platforms[i].getPosition();
g_platforms[i].setPosition(m.x, m.y, m.z);
}

// create jumper
Expand Down

0 comments on commit 32cfa56

Please sign in to comment.