client almost builds
This commit is contained in:
@@ -22,7 +22,7 @@ void CAffectFlagContainer::CopyInstance(const CAffectFlagContainer& c_rkAffectCo
|
||||
|
||||
void CAffectFlagContainer::CopyData(UINT uPos, UINT uByteSize, const void* c_pvData)
|
||||
{
|
||||
const BYTE* c_pbData=(const BYTE*)c_pvData;
|
||||
const uint8_t* c_pbData=(const uint8_t*)c_pvData;
|
||||
Element bMask=0x01;
|
||||
|
||||
UINT uBitEnd=uPos+uByteSize*8;
|
||||
@@ -65,9 +65,9 @@ void CAffectFlagContainer::Set(UINT uPos, bool isSet)
|
||||
return;
|
||||
}
|
||||
|
||||
BYTE& rElement=m_aElement[uPos/8];
|
||||
uint8_t& rElement=m_aElement[uPos/8];
|
||||
|
||||
BYTE bMask=BYTE(1<<(uPos&7));
|
||||
uint8_t bMask= uint8_t(1<<(uPos&7));
|
||||
if (isSet)
|
||||
rElement|=bMask;
|
||||
else
|
||||
@@ -82,9 +82,9 @@ bool CAffectFlagContainer::IsSet(UINT uPos) const
|
||||
return false;
|
||||
}
|
||||
|
||||
const BYTE& c_rElement=m_aElement[uPos/8];
|
||||
const uint8_t& c_rElement=m_aElement[uPos/8];
|
||||
|
||||
BYTE bMask=BYTE(1<<(uPos&7));
|
||||
uint8_t bMask= uint8_t(1<<(uPos&7));
|
||||
if (c_rElement&bMask)
|
||||
return true;
|
||||
|
||||
|
||||
@@ -27,10 +27,13 @@ target_link_libraries(UserInterface
|
||||
SphereLib
|
||||
|
||||
ws2_32
|
||||
version
|
||||
ddraw
|
||||
dmoguids
|
||||
dbghelp
|
||||
cryptopp-static
|
||||
lzo2
|
||||
|
||||
DirectX
|
||||
Granny
|
||||
SpeedTree
|
||||
MilesSoundSystem
|
||||
)
|
||||
|
||||
GroupSourcesByFolder(UserInterface)
|
||||
@@ -179,14 +179,14 @@ enum EDSInventoryMaxNum
|
||||
|
||||
typedef struct SItemPos
|
||||
{
|
||||
BYTE window_type;
|
||||
uint8_t window_type;
|
||||
WORD cell;
|
||||
SItemPos ()
|
||||
{
|
||||
window_type = INVENTORY;
|
||||
cell = WORD_MAX;
|
||||
}
|
||||
SItemPos (BYTE _window_type, WORD _cell)
|
||||
SItemPos (uint8_t _window_type, WORD _cell)
|
||||
{
|
||||
window_type = _window_type;
|
||||
cell = _cell;
|
||||
|
||||
@@ -381,7 +381,7 @@ bool CGuildMarkDownloader::__LoginState_RecvMarkBlock()
|
||||
{
|
||||
Recv(compSize, compBuf);
|
||||
// 압축된 이미지를 실제로 저장한다. CRC등 여러가지 정보가 함께 빌드된다.
|
||||
CGuildMarkManager::Instance().SaveBlockFromCompressedData(kPacket.imgIdx, posBlock, (const BYTE *) compBuf, compSize);
|
||||
CGuildMarkManager::Instance().SaveBlockFromCompressedData(kPacket.imgIdx, posBlock, (const uint8_t *) compBuf, compSize);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
#include "Packet.h"
|
||||
#include "Test.h"
|
||||
|
||||
#include "stb_image.h"
|
||||
#include "stb_image_write.h"
|
||||
|
||||
#ifdef __VTUNE__
|
||||
#else
|
||||
|
||||
@@ -31,123 +34,101 @@ bool CGuildMarkUploader::IsCompleteUploading()
|
||||
|
||||
bool CGuildMarkUploader::__Save(const char* c_szFileName)
|
||||
{
|
||||
/* 업로더에서 저장하지 않아야 함;
|
||||
ILuint uImg;
|
||||
ilGenImages(1, &uImg);
|
||||
ilBindImage(uImg);
|
||||
ilEnable(IL_FILE_OVERWRITE);
|
||||
ilEnable(IL_ORIGIN_SET);
|
||||
ilOriginFunc(IL_ORIGIN_UPPER_LEFT);
|
||||
/*
|
||||
int width = CGuildMarkImage::WIDTH;
|
||||
int height = CGuildMarkImage::HEIGHT;
|
||||
std::vector<unsigned char> rgba(width * height * 4);
|
||||
|
||||
if (!ilLoad(IL_TYPE_UNKNOWN, (const ILstring)c_szFileName))
|
||||
{
|
||||
for (int i = 0; i < width * height; ++i) {
|
||||
rgba[i * 4 + 0] = m_kMark.m_apxBuf[i * 4 + 2]; // R
|
||||
rgba[i * 4 + 1] = m_kMark.m_apxBuf[i * 4 + 1]; // G
|
||||
rgba[i * 4 + 2] = m_kMark.m_apxBuf[i * 4 + 0]; // B
|
||||
rgba[i * 4 + 3] = m_kMark.m_apxBuf[i * 4 + 3]; // A
|
||||
}
|
||||
|
||||
// Save as PNG
|
||||
if (!stbi_write_png(c_szFileName, width, height, 4, rgba.data(), width * 4)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ilGetInteger(IL_IMAGE_WIDTH) != CGuildMarkImage::WIDTH)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ilGetInteger(IL_IMAGE_HEIGHT) != CGuildMarkImage::HEIGHT)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ilConvertImage(IL_BGRA, IL_BYTE);
|
||||
|
||||
UINT uColCount = CGuildMarkImage::MARK_COL_COUNT;
|
||||
UINT uCol = m_dwGuildID % uColCount;
|
||||
UINT uRow = m_dwGuildID / uColCount;
|
||||
|
||||
ilSetPixels(uCol*SGuildMark::WIDTH, uRow*SGuildMark::HEIGHT, 0, SGuildMark::WIDTH, SGuildMark::HEIGHT, 1, IL_BGRA, IL_BYTE, (ILvoid*)m_kMark.m_apxBuf);
|
||||
|
||||
ilSave(IL_TGA, (ILstring)c_szFileName);
|
||||
|
||||
ilDeleteImages(1, &uImg);
|
||||
return true;
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CGuildMarkUploader::__Load(const char* c_szFileName, UINT* peError)
|
||||
{
|
||||
ILuint uImg;
|
||||
ilGenImages(1, &uImg);
|
||||
ilBindImage(uImg);
|
||||
ilEnable(IL_ORIGIN_SET);
|
||||
ilOriginFunc(IL_ORIGIN_UPPER_LEFT);
|
||||
int width, height, channels;
|
||||
unsigned char* data = stbi_load(c_szFileName, &width, &height, &channels, 4); // force RGBA
|
||||
|
||||
if (!ilLoad(IL_TYPE_UNKNOWN, (const ILstring)c_szFileName))
|
||||
{
|
||||
*peError=ERROR_LOAD;
|
||||
if (!data) {
|
||||
*peError = ERROR_LOAD;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ilGetInteger(IL_IMAGE_WIDTH)!=SGuildMark::WIDTH)
|
||||
{
|
||||
*peError=ERROR_WIDTH;
|
||||
if (width != SGuildMark::WIDTH) {
|
||||
stbi_image_free(data);
|
||||
*peError = ERROR_WIDTH;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ilGetInteger(IL_IMAGE_HEIGHT)!=SGuildMark::HEIGHT)
|
||||
{
|
||||
*peError=ERROR_HEIGHT;
|
||||
if (height != SGuildMark::HEIGHT) {
|
||||
stbi_image_free(data);
|
||||
*peError = ERROR_HEIGHT;
|
||||
return false;
|
||||
}
|
||||
|
||||
ilConvertImage(IL_BGRA, IL_BYTE);
|
||||
// Copy into our mark buffer (BGRA expected)
|
||||
for (int i = 0; i < width * height; ++i) {
|
||||
m_kMark.m_apxBuf[i * 4 + 0] = data[i * 4 + 2]; // B
|
||||
m_kMark.m_apxBuf[i * 4 + 1] = data[i * 4 + 1]; // G
|
||||
m_kMark.m_apxBuf[i * 4 + 2] = data[i * 4 + 0]; // R
|
||||
m_kMark.m_apxBuf[i * 4 + 3] = data[i * 4 + 3]; // A
|
||||
}
|
||||
|
||||
ilCopyPixels(0, 0, 0, SGuildMark::WIDTH, SGuildMark::HEIGHT, 1, IL_BGRA, IL_BYTE, (ILvoid*)m_kMark.m_apxBuf);
|
||||
|
||||
ilDeleteImages(1, &uImg);
|
||||
stbi_image_free(data);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CGuildMarkUploader::__LoadSymbol(const char* c_szFileName, UINT* peError)
|
||||
{
|
||||
// For Check Image
|
||||
ILuint uImg;
|
||||
ilGenImages(1, &uImg);
|
||||
ilBindImage(uImg);
|
||||
ilEnable(IL_ORIGIN_SET);
|
||||
ilOriginFunc(IL_ORIGIN_UPPER_LEFT);
|
||||
if (!ilLoad(IL_TYPE_UNKNOWN, (const ILstring)c_szFileName))
|
||||
{
|
||||
*peError=ERROR_LOAD;
|
||||
return false;
|
||||
}
|
||||
if (ilGetInteger(IL_IMAGE_WIDTH) != 64)
|
||||
{
|
||||
*peError=ERROR_WIDTH;
|
||||
return false;
|
||||
}
|
||||
if (ilGetInteger(IL_IMAGE_HEIGHT) != 128)
|
||||
{
|
||||
*peError=ERROR_HEIGHT;
|
||||
return false;
|
||||
}
|
||||
ilDeleteImages(1, &uImg);
|
||||
ilShutDown();
|
||||
int width, height, channels;
|
||||
unsigned char* data = stbi_load(c_szFileName, &width, &height, &channels, 4);
|
||||
|
||||
/////
|
||||
if (!data) {
|
||||
*peError = ERROR_LOAD;
|
||||
return false;
|
||||
}
|
||||
|
||||
FILE * file = fopen(c_szFileName, "rb");
|
||||
if (!file)
|
||||
{
|
||||
*peError=ERROR_LOAD;
|
||||
if (width != 64) {
|
||||
stbi_image_free(data);
|
||||
*peError = ERROR_WIDTH;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (height != 128) {
|
||||
stbi_image_free(data);
|
||||
*peError = ERROR_HEIGHT;
|
||||
return false;
|
||||
}
|
||||
|
||||
stbi_image_free(data);
|
||||
|
||||
// Now read raw file into m_pbySymbolBuf (same as original code did)
|
||||
FILE* file = fopen(c_szFileName, "rb");
|
||||
if (!file) {
|
||||
*peError = ERROR_LOAD;
|
||||
return false;
|
||||
}
|
||||
|
||||
fseek(file, 0, SEEK_END);
|
||||
m_dwSymbolBufSize = ftell(file);
|
||||
fseek(file, 0, SEEK_SET);
|
||||
|
||||
m_pbySymbolBuf = new BYTE [m_dwSymbolBufSize];
|
||||
m_pbySymbolBuf = new uint8_t[m_dwSymbolBufSize];
|
||||
fread(m_pbySymbolBuf, m_dwSymbolBufSize, 1, file);
|
||||
|
||||
fclose(file);
|
||||
|
||||
/////
|
||||
|
||||
m_dwSymbolCRC32 = GetFileCRC32(c_szFileName);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -29,8 +29,6 @@ class CGuildMarkUploader : public CNetworkStream, public CSingleton<CGuildMarkUp
|
||||
|
||||
#else
|
||||
|
||||
#include <il/il.h>
|
||||
|
||||
class CGuildMarkUploader : public CNetworkStream, public CSingleton<CGuildMarkUploader>
|
||||
{
|
||||
public:
|
||||
@@ -112,7 +110,7 @@ class CGuildMarkUploader : public CNetworkStream, public CSingleton<CGuildMarkUp
|
||||
|
||||
DWORD m_dwSymbolBufSize;
|
||||
DWORD m_dwSymbolCRC32;
|
||||
BYTE * m_pbySymbolBuf;
|
||||
uint8_t * m_pbySymbolBuf;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -2685,7 +2685,7 @@ void CInstanceBase::__ClearArmorRefineEffect()
|
||||
|
||||
UINT CInstanceBase::__GetRefinedEffect(CItemData* pItem)
|
||||
{
|
||||
DWORD refine = max(pItem->GetRefine() + pItem->GetSocketCount(),CItemData::ITEM_SOCKET_MAX_NUM) - CItemData::ITEM_SOCKET_MAX_NUM;
|
||||
DWORD refine = std::max(pItem->GetRefine() + pItem->GetSocketCount(), (UINT)CItemData::ITEM_SOCKET_MAX_NUM) - CItemData::ITEM_SOCKET_MAX_NUM;
|
||||
switch (pItem->GetType())
|
||||
{
|
||||
case CItemData::ITEM_TYPE_WEAPON:
|
||||
|
||||
@@ -167,7 +167,7 @@ bool CInstanceBase::NEW_GetFrontInstance(CInstanceBase ** ppoutTargetInstance, f
|
||||
if (NEW_GetDistanceFromDestInstance(*pkInstEach) > fDistance)
|
||||
continue;
|
||||
|
||||
float fEachInstDistance=min(NEW_GetDistanceFromDestInstance(*pkInstEach), HALF_FAN_ROT_MIN_DISTANCE);
|
||||
float fEachInstDistance=std::min(NEW_GetDistanceFromDestInstance(*pkInstEach), HALF_FAN_ROT_MIN_DISTANCE);
|
||||
float fEachInstDirRot=NEW_GetRotationFromDestInstance(*pkInstEach);
|
||||
|
||||
float fHalfFanRot=(HALF_FAN_ROT_MAX-HALF_FAN_ROT_MIN)-RPM*fEachInstDistance+HALF_FAN_ROT_MIN;
|
||||
@@ -216,7 +216,7 @@ bool CInstanceBase::NEW_GetInstanceVectorInFanRange(float fSkillDistance, CInsta
|
||||
// 2004.07.21.levites - 비파부 다중 타겟 지원
|
||||
if (m_GraphicThingInstance.IsClickableDistanceDestInstance(pkInstEach->m_GraphicThingInstance, fSkillDistance))
|
||||
{
|
||||
float fEachInstDistance=min(NEW_GetDistanceFromDestInstance(*pkInstEach), HALF_FAN_ROT_MIN_DISTANCE);
|
||||
float fEachInstDistance=std::min(NEW_GetDistanceFromDestInstance(*pkInstEach), HALF_FAN_ROT_MIN_DISTANCE);
|
||||
float fEachInstDirRot=NEW_GetRotationFromDestInstance(*pkInstEach);
|
||||
|
||||
float fHalfFanRot=(HALF_FAN_ROT_MAX-HALF_FAN_ROT_MIN)-RPM*fEachInstDistance+HALF_FAN_ROT_MIN;
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "MarkImage.h"
|
||||
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
||||
#include "stb_image.h"
|
||||
#include "stb_image_write.h"
|
||||
|
||||
#if !defined(_MSC_VER)
|
||||
#include <IL/il.h>
|
||||
#include "crc32.h"
|
||||
@@ -26,7 +31,7 @@ void DeleteMarkImage(CGuildMarkImage * pkImage)
|
||||
|
||||
CGuildMarkImage::CGuildMarkImage()
|
||||
{
|
||||
m_uImg = INVALID_HANDLE;
|
||||
memset(&m_apxImage, 0, sizeof(m_apxImage));
|
||||
}
|
||||
|
||||
CGuildMarkImage::~CGuildMarkImage()
|
||||
@@ -36,93 +41,48 @@ CGuildMarkImage::~CGuildMarkImage()
|
||||
|
||||
void CGuildMarkImage::Destroy()
|
||||
{
|
||||
if (INVALID_HANDLE == m_uImg)
|
||||
return;
|
||||
|
||||
ilDeleteImages(1, &m_uImg);
|
||||
m_uImg = INVALID_HANDLE;
|
||||
memset(&m_apxImage, 0, sizeof(m_apxImage));
|
||||
}
|
||||
|
||||
void CGuildMarkImage::Create()
|
||||
{
|
||||
if (INVALID_HANDLE != m_uImg)
|
||||
return;
|
||||
|
||||
ilGenImages(1, &m_uImg);
|
||||
memset(m_apxImage, 0, sizeof(m_apxImage));
|
||||
}
|
||||
|
||||
bool CGuildMarkImage::Save(const char* c_szFileName)
|
||||
{
|
||||
ilEnable(IL_FILE_OVERWRITE);
|
||||
ilBindImage(m_uImg);
|
||||
|
||||
if (!ilSave(IL_TGA, (const ILstring)c_szFileName))
|
||||
if (stbi_write_tga(c_szFileName, WIDTH, HEIGHT, 4, m_apxImage) == 0)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CGuildMarkImage::Build(const char * c_szFileName)
|
||||
{
|
||||
Destroy();
|
||||
Create();
|
||||
|
||||
ilBindImage(m_uImg);
|
||||
ilEnable(IL_ORIGIN_SET);
|
||||
ilOriginFunc(IL_ORIGIN_UPPER_LEFT);
|
||||
|
||||
BYTE * data = (BYTE *) malloc(sizeof(Pixel) * WIDTH * HEIGHT);
|
||||
memset(data, 0, sizeof(Pixel) * WIDTH * HEIGHT);
|
||||
|
||||
if (!ilTexImage(WIDTH, HEIGHT, 1, 4, IL_BGRA, IL_UNSIGNED_BYTE, data))
|
||||
{
|
||||
sys_err("CGuildMarkImage: cannot initialize image");
|
||||
memset(m_apxImage, 0, sizeof(m_apxImage));
|
||||
if (!Save(c_szFileName)) {
|
||||
sys_err("GuildMarkImage: cannot initialize image");
|
||||
return false;
|
||||
}
|
||||
|
||||
free(data);
|
||||
|
||||
ilEnable(IL_FILE_OVERWRITE);
|
||||
|
||||
if (!ilSave(IL_TGA, (const ILstring)c_szFileName))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CGuildMarkImage::Load(const char * c_szFileName)
|
||||
{
|
||||
Destroy();
|
||||
Create();
|
||||
|
||||
ilBindImage(m_uImg);
|
||||
ilEnable(IL_ORIGIN_SET);
|
||||
ilOriginFunc(IL_ORIGIN_UPPER_LEFT);
|
||||
|
||||
if (!ilLoad(IL_TYPE_UNKNOWN, (const ILstring) c_szFileName))
|
||||
{
|
||||
Build(c_szFileName);
|
||||
|
||||
if (!Load(c_szFileName))
|
||||
{
|
||||
sys_err("CGuildMarkImage: cannot open file for writing %s", c_szFileName);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (ilGetInteger(IL_IMAGE_WIDTH) != WIDTH)
|
||||
{
|
||||
sys_err("CGuildMarkImage: %s width must be %u", c_szFileName, WIDTH);
|
||||
int w, h, channels;
|
||||
unsigned char* data = stbi_load(c_szFileName, &w, &h, &channels, 4);
|
||||
if (!data) {
|
||||
sys_err("GuildMarkImage: %s cannot open file.", c_szFileName);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ilGetInteger(IL_IMAGE_HEIGHT) != HEIGHT)
|
||||
{
|
||||
sys_err("CGuildMarkImage: %s height must be %u", c_szFileName, HEIGHT);
|
||||
if (w != WIDTH || h != HEIGHT) {
|
||||
sys_err("GuildMarkImage: %s wrong dimensions (%d x %d)", c_szFileName, w, h);
|
||||
stbi_image_free(data);
|
||||
return false;
|
||||
}
|
||||
|
||||
ilConvertImage(IL_BGRA, IL_UNSIGNED_BYTE);
|
||||
memcpy(m_apxImage, data, WIDTH * HEIGHT * 4);
|
||||
stbi_image_free(data);
|
||||
|
||||
BuildAllBlocks();
|
||||
return true;
|
||||
@@ -130,14 +90,20 @@ bool CGuildMarkImage::Load(const char * c_szFileName)
|
||||
|
||||
void CGuildMarkImage::PutData(UINT x, UINT y, UINT width, UINT height, void * data)
|
||||
{
|
||||
ilBindImage(m_uImg);
|
||||
ilSetPixels(x, y, 0, width, height, 1, IL_BGRA, IL_UNSIGNED_BYTE, data);
|
||||
for (UINT row = 0; row < height; ++row) {
|
||||
Pixel* dst = m_apxImage + (y + row) * WIDTH + x;
|
||||
Pixel* src = (Pixel*)data + row * width;
|
||||
memcpy(dst, src, width * sizeof(Pixel));
|
||||
}
|
||||
}
|
||||
|
||||
void CGuildMarkImage::GetData(UINT x, UINT y, UINT width, UINT height, void * data)
|
||||
{
|
||||
ilBindImage(m_uImg);
|
||||
ilCopyPixels(x, y, 0, width, height, 1, IL_BGRA, IL_UNSIGNED_BYTE, data);
|
||||
for (UINT row = 0; row < height; ++row) {
|
||||
Pixel* src = m_apxImage + (y + row) * WIDTH + x;
|
||||
Pixel* dst = (Pixel*)data + row * width;
|
||||
memcpy(dst, src, width * sizeof(Pixel));
|
||||
}
|
||||
}
|
||||
|
||||
// 이미지 = 512x512
|
||||
@@ -146,7 +112,7 @@ void CGuildMarkImage::GetData(UINT x, UINT y, UINT width, UINT height, void * da
|
||||
// 한 이미지의 블럭 = 8 x 10
|
||||
|
||||
// SERVER
|
||||
bool CGuildMarkImage::SaveMark(DWORD posMark, BYTE * pbImage)
|
||||
bool CGuildMarkImage::SaveMark(DWORD posMark, uint8_t* pbImage)
|
||||
{
|
||||
if (posMark >= MARK_TOTAL_COUNT)
|
||||
{
|
||||
@@ -175,11 +141,11 @@ bool CGuildMarkImage::DeleteMark(DWORD posMark)
|
||||
{
|
||||
Pixel image[SGuildMark::SIZE];
|
||||
memset(&image, 0, sizeof(image));
|
||||
return SaveMark(posMark, (BYTE *) &image);
|
||||
return SaveMark(posMark, (uint8_t*) &image);
|
||||
}
|
||||
|
||||
// CLIENT
|
||||
bool CGuildMarkImage::SaveBlockFromCompressedData(DWORD posBlock, const BYTE * pbComp, DWORD dwCompSize)
|
||||
bool CGuildMarkImage::SaveBlockFromCompressedData(DWORD posBlock, const uint8_t* pbComp, DWORD dwCompSize)
|
||||
{
|
||||
if (posBlock >= BLOCK_TOTAL_COUNT)
|
||||
return false;
|
||||
@@ -187,7 +153,7 @@ bool CGuildMarkImage::SaveBlockFromCompressedData(DWORD posBlock, const BYTE * p
|
||||
Pixel apxBuf[SGuildMarkBlock::SIZE];
|
||||
size_t sizeBuf = sizeof(apxBuf);
|
||||
|
||||
if (LZO_E_OK != lzo1x_decompress_safe(pbComp, dwCompSize, (BYTE *) apxBuf, (lzo_uint*) &sizeBuf, CLZO::Instance().GetWorkMemory()))
|
||||
if (LZO_E_OK != lzo1x_decompress_safe(pbComp, dwCompSize, (uint8_t*) apxBuf, (lzo_uint*) &sizeBuf, CLZO::Instance().GetWorkMemory()))
|
||||
{
|
||||
sys_err("CGuildMarkImage::CopyBlockFromCompressedData: cannot decompress, compressed size = %u", dwCompSize);
|
||||
return false;
|
||||
@@ -239,16 +205,16 @@ DWORD CGuildMarkImage::GetEmptyPosition()
|
||||
return INVALID_MARK_POSITION;
|
||||
}
|
||||
|
||||
void CGuildMarkImage::GetDiffBlocks(const DWORD * crcList, std::map<BYTE, const SGuildMarkBlock *> & mapDiffBlocks)
|
||||
void CGuildMarkImage::GetDiffBlocks(const DWORD * crcList, std::map<uint8_t, const SGuildMarkBlock *> & mapDiffBlocks)
|
||||
{
|
||||
BYTE posBlock = 0;
|
||||
uint8_t posBlock = 0;
|
||||
|
||||
for (DWORD row = 0; row < BLOCK_ROW_COUNT; ++row)
|
||||
for (DWORD col = 0; col < BLOCK_COL_COUNT; ++col)
|
||||
{
|
||||
if (m_aakBlock[row][col].m_crc != *crcList)
|
||||
{
|
||||
mapDiffBlocks.insert(std::map<BYTE, const SGuildMarkBlock *>::value_type(posBlock, &m_aakBlock[row][col]));
|
||||
mapDiffBlocks.insert(std::map<uint8_t, const SGuildMarkBlock *>::value_type(posBlock, &m_aakBlock[row][col]));
|
||||
}
|
||||
++crcList;
|
||||
++posBlock;
|
||||
@@ -284,7 +250,7 @@ DWORD SGuildMarkBlock::GetCRC() const
|
||||
return m_crc;
|
||||
}
|
||||
|
||||
void SGuildMarkBlock::CopyFrom(const BYTE * pbCompBuf, DWORD dwCompSize, DWORD crc)
|
||||
void SGuildMarkBlock::CopyFrom(const uint8_t* pbCompBuf, DWORD dwCompSize, DWORD crc)
|
||||
{
|
||||
if (dwCompSize > MAX_COMP_SIZE)
|
||||
return;
|
||||
@@ -299,7 +265,7 @@ void SGuildMarkBlock::Compress(const Pixel * pxBuf)
|
||||
{
|
||||
m_sizeCompBuf = MAX_COMP_SIZE;
|
||||
|
||||
if (LZO_E_OK != lzo1x_999_compress((const BYTE *) pxBuf,
|
||||
if (LZO_E_OK != lzo1x_999_compress((const uint8_t*) pxBuf,
|
||||
sizeof(Pixel) * SGuildMarkBlock::SIZE, m_abCompBuf,
|
||||
(lzo_uint*) &m_sizeCompBuf,
|
||||
CLZO::Instance().GetWorkMemory()))
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef __INC_METIN_II_MARKIMAGE_H__
|
||||
#define __INC_METIN_II_MARKIMAGE_H__
|
||||
|
||||
#include <IL/il.h>
|
||||
|
||||
typedef unsigned long Pixel;
|
||||
|
||||
struct SGuildMark
|
||||
@@ -39,14 +37,14 @@ struct SGuildMarkBlock
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
Pixel m_apxBuf[SIZE]; // 실제 이미지
|
||||
|
||||
BYTE m_abCompBuf[MAX_COMP_SIZE]; // 압축된 데이터
|
||||
uint8_t m_abCompBuf[MAX_COMP_SIZE]; // 압축된 데이터
|
||||
size_t m_sizeCompBuf; // 압축된 크기
|
||||
DWORD m_crc; // 압축된 데이터의 CRC
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
DWORD GetCRC() const;
|
||||
|
||||
void CopyFrom(const BYTE * pbCompBuf, DWORD dwCompSize, DWORD crc);
|
||||
void CopyFrom(const uint8_t* pbCompBuf, DWORD dwCompSize, DWORD crc);
|
||||
void Compress(const Pixel * pxBuf);
|
||||
};
|
||||
|
||||
@@ -84,14 +82,14 @@ class CGuildMarkImage
|
||||
void PutData(UINT x, UINT y, UINT width, UINT height, void* data);
|
||||
void GetData(UINT x, UINT y, UINT width, UINT height, void* data);
|
||||
|
||||
bool SaveMark(DWORD posMark, BYTE * pbMarkImage);
|
||||
bool SaveMark(DWORD posMark, uint8_t* pbMarkImage);
|
||||
bool DeleteMark(DWORD posMark);
|
||||
bool SaveBlockFromCompressedData(DWORD posBlock, const BYTE * pbComp, DWORD dwCompSize); // 서버 -> 클라이언트
|
||||
bool SaveBlockFromCompressedData(DWORD posBlock, const uint8_t * pbComp, DWORD dwCompSize); // 서버 -> 클라이언트
|
||||
|
||||
DWORD GetEmptyPosition(); // 빈 마크 위치를 얻는다.
|
||||
|
||||
void GetBlockCRCList(DWORD * crcList);
|
||||
void GetDiffBlocks(const DWORD * crcList, std::map<BYTE, const SGuildMarkBlock *> & mapDiffBlocks);
|
||||
void GetDiffBlocks(const DWORD * crcList, std::map<uint8_t, const SGuildMarkBlock *> & mapDiffBlocks);
|
||||
|
||||
private:
|
||||
enum
|
||||
@@ -103,8 +101,6 @@ class CGuildMarkImage
|
||||
|
||||
SGuildMarkBlock m_aakBlock[BLOCK_ROW_COUNT][BLOCK_COL_COUNT];
|
||||
Pixel m_apxImage[WIDTH * HEIGHT * sizeof(Pixel)];
|
||||
|
||||
ILuint m_uImg;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -213,7 +213,7 @@ void CGuildMarkManager::CopyMarkIdx(char * pcBuf) const
|
||||
}
|
||||
|
||||
// SERVER
|
||||
DWORD CGuildMarkManager::SaveMark(DWORD guildID, BYTE * pbMarkImage)
|
||||
DWORD CGuildMarkManager::SaveMark(DWORD guildID, uint8_t* pbMarkImage)
|
||||
{
|
||||
DWORD idMark;
|
||||
|
||||
@@ -267,7 +267,7 @@ void CGuildMarkManager::DeleteMark(DWORD guildID)
|
||||
}
|
||||
|
||||
// SERVER
|
||||
void CGuildMarkManager::GetDiffBlocks(DWORD imgIdx, const DWORD * crcList, std::map<BYTE, const SGuildMarkBlock *> & mapDiffBlocks)
|
||||
void CGuildMarkManager::GetDiffBlocks(DWORD imgIdx, const DWORD * crcList, std::map<uint8_t, const SGuildMarkBlock *> & mapDiffBlocks)
|
||||
{
|
||||
mapDiffBlocks.clear();
|
||||
|
||||
@@ -285,7 +285,7 @@ void CGuildMarkManager::GetDiffBlocks(DWORD imgIdx, const DWORD * crcList, std::
|
||||
}
|
||||
|
||||
// CLIENT
|
||||
bool CGuildMarkManager::SaveBlockFromCompressedData(DWORD imgIdx, DWORD posBlock, const BYTE * pbBlock, DWORD dwSize)
|
||||
bool CGuildMarkManager::SaveBlockFromCompressedData(DWORD imgIdx, DWORD posBlock, const uint8_t* pbBlock, DWORD dwSize)
|
||||
{
|
||||
CGuildMarkImage * pkImage = __GetImage(imgIdx);
|
||||
|
||||
@@ -380,7 +380,7 @@ void CGuildMarkManager::SaveSymbol(const char* filename)
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
void CGuildMarkManager::UploadSymbol(DWORD guildID, int iSize, const BYTE* pbyData)
|
||||
void CGuildMarkManager::UploadSymbol(DWORD guildID, int iSize, const uint8_t* pbyData)
|
||||
{
|
||||
sys_log(0, "GuildSymbolUpload guildID %lu Size %d", guildID, iSize);
|
||||
|
||||
@@ -424,7 +424,7 @@ void SaveMark(DWORD guildID, const char * filename)
|
||||
|
||||
ilConvertImage(IL_BGRA, IL_UNSIGNED_BYTE);
|
||||
|
||||
BYTE * data = (BYTE *) malloc(sizeof(DWORD) * width * height);
|
||||
uint8_t* data = (uint8_t*) malloc(sizeof(DWORD) * width * height);
|
||||
ilCopyPixels(0, 0, 0, width, height, 1, IL_BGRA, IL_UNSIGNED_BYTE, data);
|
||||
ilDeleteImages(1, &m_uImg);
|
||||
|
||||
@@ -468,7 +468,7 @@ int main(int argc, char **argv)
|
||||
mgr->GetBlockCRCList(0, idx_client);
|
||||
mgr->GetBlockCRCList(1, idx_server);
|
||||
|
||||
std::map<BYTE, const SGuildMarkBlock *> mapDiff;
|
||||
std::map<uint8_t, const SGuildMarkBlock *> mapDiff;
|
||||
mgr->GetDiffBlocks(1, idx_client, mapDiff);
|
||||
|
||||
printf("#1 Diff %u\n", mapDiff.size());
|
||||
|
||||
@@ -16,7 +16,7 @@ class CGuildMarkManager : public singleton<CGuildMarkManager>
|
||||
struct TGuildSymbol
|
||||
{
|
||||
DWORD crc;
|
||||
std::vector<BYTE> raw;
|
||||
std::vector<uint8_t> raw;
|
||||
};
|
||||
|
||||
CGuildMarkManager();
|
||||
@@ -25,7 +25,7 @@ class CGuildMarkManager : public singleton<CGuildMarkManager>
|
||||
const TGuildSymbol * GetGuildSymbol(DWORD GID);
|
||||
bool LoadSymbol(const char* filename);
|
||||
void SaveSymbol(const char* filename);
|
||||
void UploadSymbol(DWORD guildID, int iSize, const BYTE* pbyData);
|
||||
void UploadSymbol(DWORD guildID, int iSize, const uint8_t* pbyData);
|
||||
|
||||
//
|
||||
// Mark
|
||||
@@ -46,12 +46,12 @@ class CGuildMarkManager : public singleton<CGuildMarkManager>
|
||||
|
||||
// SERVER
|
||||
void CopyMarkIdx(char * pcBuf) const;
|
||||
DWORD SaveMark(DWORD guildID, BYTE * pbMarkImage);
|
||||
DWORD SaveMark(DWORD guildID, uint8_t* pbMarkImage);
|
||||
void DeleteMark(DWORD guildID);
|
||||
void GetDiffBlocks(DWORD imgIdx, const DWORD * crcList, std::map<BYTE, const SGuildMarkBlock *> & mapDiffBlocks);
|
||||
void GetDiffBlocks(DWORD imgIdx, const DWORD * crcList, std::map<uint8_t, const SGuildMarkBlock *> & mapDiffBlocks);
|
||||
|
||||
// CLIENT
|
||||
bool SaveBlockFromCompressedData(DWORD imgIdx, DWORD idBlock, const BYTE * pbBlock, DWORD dwSize);
|
||||
bool SaveBlockFromCompressedData(DWORD imgIdx, DWORD idBlock, const uint8_t * pbBlock, DWORD dwSize);
|
||||
bool GetBlockCRCList(DWORD imgIdx, DWORD * crcList);
|
||||
|
||||
private:
|
||||
|
||||
@@ -59,7 +59,7 @@ DWORD GetProcessMemoryCRC(LPCVOID c_pvBaseAddress)
|
||||
{
|
||||
HANDLE hProcess = GetCurrentProcess();
|
||||
char * pBuf = new char[1024*1024];
|
||||
DWORD dwBytesRead;
|
||||
SIZE_T dwBytesRead;
|
||||
|
||||
BOOL bRet = ReadProcessMemory(hProcess, c_pvBaseAddress, pBuf, 1024*1024, &dwBytesRead);
|
||||
|
||||
|
||||
@@ -427,7 +427,7 @@ bool CPythonApplication::Process()
|
||||
m_dwRenderFPS = s_dwRenderFrameCount;
|
||||
m_dwLoad = s_uiLoad;
|
||||
|
||||
m_dwFaceCount = s_dwFaceCount / max(1, s_dwRenderFrameCount);
|
||||
m_dwFaceCount = s_dwFaceCount / std::max(1ul, s_dwRenderFrameCount);
|
||||
|
||||
s_dwCheckTime = ELTimer_GetMSec();
|
||||
|
||||
@@ -819,14 +819,14 @@ bool CPythonApplication::Process()
|
||||
{
|
||||
static float s_fAveRenderTime = 16.0f;
|
||||
float fRatio=0.3f;
|
||||
s_fAveRenderTime=(s_fAveRenderTime*(100.0f-fRatio)+max(16.0f, m_dwCurRenderTime)*fRatio)/100.0f;
|
||||
s_fAveRenderTime=(s_fAveRenderTime*(100.0f-fRatio)+std::max(16.0f, (float)m_dwCurRenderTime)*fRatio)/100.0f;
|
||||
|
||||
|
||||
float fFar=25600.0f;
|
||||
float fNear=MIN_FOG;
|
||||
double dbAvePow=double(1000.0f/s_fAveRenderTime);
|
||||
double dbMaxPow=60.0;
|
||||
float fDistance=max(fNear+(fFar-fNear)*(dbAvePow)/dbMaxPow, fNear);
|
||||
float fDistance=std::max((float)(fNear+(fFar-fNear)*(dbAvePow)/dbMaxPow), fNear);
|
||||
m_pyBackground.SetViewDistanceSet(0, fDistance);
|
||||
}
|
||||
// 거리 강제 설정시
|
||||
@@ -1438,8 +1438,6 @@ void CPythonApplication::Destroy()
|
||||
CGrannyModelInstance::DestroySystem();
|
||||
CGraphicImageInstance::DestroySystem();
|
||||
|
||||
|
||||
m_SoundManager.Destroy();
|
||||
m_grpDevice.Destroy();
|
||||
|
||||
// FIXME : 만들어져 있지 않음 - [levites]
|
||||
|
||||
@@ -260,7 +260,7 @@ class CPythonApplication : public CMSApplication, public CInputKeyboard, public
|
||||
IMediaEventEx* m_pMediaEvent; // Media Event
|
||||
IVideoWindow* m_pVideoWnd; // Video Window
|
||||
IBasicVideo* m_pBasicVideo;
|
||||
BYTE* m_pCaptureBuffer; // 영상 이미지를 캡처한 버퍼
|
||||
uint8_t* m_pCaptureBuffer; // 영상 이미지를 캡처한 버퍼
|
||||
LONG m_lBufferSize; // Video 버퍼 크기 변수
|
||||
CGraphicImageTexture* m_pLogoTex; // 출력할 텍스쳐
|
||||
bool m_bLogoError; // 영상 읽기 상태
|
||||
|
||||
@@ -92,7 +92,7 @@ int CPythonApplication::OnLogoUpdate()
|
||||
return 0;
|
||||
}
|
||||
|
||||
BYTE* pBuffer = m_pCaptureBuffer; LONG lBufferSize = m_lBufferSize;
|
||||
uint8_t* pBuffer = m_pCaptureBuffer; LONG lBufferSize = m_lBufferSize;
|
||||
|
||||
// 재생이 안됬<EC9588>?경우 재생.
|
||||
if(!m_bLogoPlay) { m_pMediaCtrl->Run(); m_bLogoPlay = true; }
|
||||
@@ -102,7 +102,7 @@ int CPythonApplication::OnLogoUpdate()
|
||||
m_pSampleGrabber->GetCurrentBuffer(&m_lBufferSize, NULL);
|
||||
|
||||
SAFE_DELETE_ARRAY(m_pCaptureBuffer);
|
||||
m_pCaptureBuffer = new BYTE[ m_lBufferSize ];
|
||||
m_pCaptureBuffer = new uint8_t[ m_lBufferSize ];
|
||||
pBuffer = m_pCaptureBuffer;
|
||||
lBufferSize = m_lBufferSize;
|
||||
}
|
||||
@@ -119,10 +119,10 @@ int CPythonApplication::OnLogoUpdate()
|
||||
|
||||
// 실패한 경우에는 텍스쳐를 까맣게 비운다.
|
||||
tex->LockRect(0, &rt, 0, 0);
|
||||
BYTE* destb = static_cast<unsigned char*>(rt.pBits);
|
||||
uint8_t* destb = static_cast<unsigned char*>(rt.pBits);
|
||||
for(int a = 0; a < 4; a+= 4)
|
||||
{
|
||||
BYTE* dest = &destb[a];
|
||||
uint8_t* dest = &destb[a];
|
||||
dest[0] = 0; dest[1] = 0; dest[2] = 0; dest[3] = 0xff;
|
||||
}
|
||||
tex->UnlockRect(0);
|
||||
@@ -163,16 +163,17 @@ int CPythonApplication::OnLogoUpdate()
|
||||
ZeroMemory(&rt, sizeof(rt));
|
||||
|
||||
tex->LockRect(0, &rt, 0, 0);
|
||||
BYTE* destb = static_cast<unsigned char*>(rt.pBits);
|
||||
uint8_t* destb = static_cast<unsigned char*>(rt.pBits);
|
||||
for(int a = 0; a < lBufferSize; a+= 4)
|
||||
{
|
||||
BYTE* src = &m_pCaptureBuffer[a]; BYTE* dest = &destb[a];
|
||||
uint8_t* src = &m_pCaptureBuffer[a]; uint8_t* dest = &destb[a];
|
||||
dest[0] = src[0]; dest[1] = src[1]; dest[2] = src[2]; dest[3] = 0xff;
|
||||
}
|
||||
tex->UnlockRect(0);
|
||||
|
||||
// 영상의 상태 체크 (종료되었는지)
|
||||
long evCode, param1, param2;
|
||||
long evCode;
|
||||
LONG_PTR param1, param2;
|
||||
|
||||
while(SUCCEEDED(m_pMediaEvent->GetEvent(&evCode, ¶m1, ¶m2, 0)))
|
||||
{
|
||||
switch(evCode)
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#include "StdAfx.h"
|
||||
#include "Resource.h"
|
||||
#include "PythonApplication.h"
|
||||
#include "../EterLib/Camera.h"
|
||||
#include "EterLib/Camera.h"
|
||||
|
||||
#include <stb_image.h>
|
||||
|
||||
extern bool PERF_CHECKER_RENDER_GAME;
|
||||
extern D3DXCOLOR g_fSpecularColor;
|
||||
@@ -332,31 +334,16 @@ PyObject* appGetImageInfo(PyObject* poSelf, PyObject* poArgs)
|
||||
|
||||
#else
|
||||
|
||||
#include <il/il.h>
|
||||
|
||||
PyObject* appGetImageInfo(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
char* szFileName;
|
||||
if (!PyTuple_GetString(poArgs, 0, &szFileName))
|
||||
return Py_BuildException();
|
||||
|
||||
BOOL canLoad=FALSE;
|
||||
ILuint uWidth=0;
|
||||
ILuint uHeight=0;
|
||||
int w = 0, h = 0, comp = 0;
|
||||
int canLoad = stbi_info(szFileName, &w, &h, &comp) ? 1 : 0;
|
||||
|
||||
ILuint uImg;
|
||||
ilGenImages(1, &uImg);
|
||||
ilBindImage(uImg);
|
||||
if (ilLoad(IL_TYPE_UNKNOWN, szFileName))
|
||||
{
|
||||
canLoad=TRUE;
|
||||
uWidth=ilGetInteger(IL_IMAGE_WIDTH);
|
||||
uHeight=ilGetInteger(IL_IMAGE_HEIGHT);
|
||||
}
|
||||
|
||||
ilDeleteImages(1, &uImg);
|
||||
|
||||
return Py_BuildValue("iii", canLoad, uWidth, uHeight);
|
||||
return Py_BuildValue("iii", canLoad, w, h);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -845,8 +845,8 @@ void CPythonBackground::SetXMaxTree(int iGrade)
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
iGrade -= 1;
|
||||
iGrade = max(iGrade, 0);
|
||||
iGrade = min(iGrade, 2);
|
||||
iGrade = std::max(iGrade, 0);
|
||||
iGrade = std::min(iGrade, 2);
|
||||
|
||||
static std::string s_strTreeName[3] = {
|
||||
"d:/ymir work/tree/christmastree1.spt",
|
||||
|
||||
@@ -146,7 +146,7 @@ void CPythonChat::UpdateEditMode(DWORD dwID)
|
||||
if (!pChatSet)
|
||||
return;
|
||||
|
||||
const int c_iAlphaLine = max(0, GetVisibleLineCount(dwID) - GetEditableLineCount(dwID) + 2);
|
||||
const int c_iAlphaLine = std::max(0, GetVisibleLineCount(dwID) - GetEditableLineCount(dwID) + 2);
|
||||
|
||||
int iLineIndex = 0;
|
||||
float fAlpha = 0.0f;
|
||||
@@ -322,8 +322,8 @@ void CPythonChat::SetEndPos(DWORD dwID, float fPos)
|
||||
if (!pChatSet)
|
||||
return;
|
||||
|
||||
fPos = max(0.0f, fPos);
|
||||
fPos = min(1.0f, fPos);
|
||||
fPos = std::max(0.0f, fPos);
|
||||
fPos = std::min(1.0f, fPos);
|
||||
if (pChatSet->m_fEndPos != fPos)
|
||||
{
|
||||
pChatSet->m_fEndPos = fPos;
|
||||
@@ -414,13 +414,13 @@ void CPythonChat::ArrangeShowingChat(DWORD dwID)
|
||||
}
|
||||
|
||||
int icurLineCount = TempChatLineDeque.size();
|
||||
int iVisibleLineCount = min(icurLineCount, (pChatSet->m_iHeight + pChatSet->m_iStep) / pChatSet->m_iStep);
|
||||
int iVisibleLineCount = std::min(icurLineCount, (pChatSet->m_iHeight + pChatSet->m_iStep) / pChatSet->m_iStep);
|
||||
int iEndLine = iVisibleLineCount + int(float(icurLineCount - iVisibleLineCount - 1) * pChatSet->m_fEndPos);
|
||||
|
||||
/////
|
||||
|
||||
int iHeight = 12;
|
||||
for (int i = min(icurLineCount-1, iEndLine); i >= 0; --i)
|
||||
for (int i = std::min(icurLineCount-1, iEndLine); i >= 0; --i)
|
||||
{
|
||||
if (!pChatSet->CheckMode(TempChatLineDeque[i]->iType))
|
||||
continue;
|
||||
|
||||
@@ -325,7 +325,7 @@ void CPythonEventManager::UpdateEventSet(int iIndex, int ix, int iy)
|
||||
|
||||
if (pEventSet->isConfirmWait)
|
||||
{
|
||||
int iLeftTime = max(0, pEventSet->iConfirmEndTime - timeGetTime()/1000);
|
||||
int iLeftTime = std::max(0ul, pEventSet->iConfirmEndTime - timeGetTime()/1000);
|
||||
pEventSet->pConfirmTimeTextLine->SetValue(_getf(m_strLeftTimeString.c_str(), iLeftTime));
|
||||
}
|
||||
|
||||
@@ -337,7 +337,7 @@ void CPythonEventManager::UpdateEventSet(int iIndex, int ix, int iy)
|
||||
// Process EventSet
|
||||
long lElapsedTime = CTimer::Instance().GetElapsedMilliecond();
|
||||
|
||||
pEventSet->lLastDelayTime = max(0, pEventSet->lLastDelayTime - lElapsedTime);
|
||||
pEventSet->lLastDelayTime = std::max(0l, pEventSet->lLastDelayTime - lElapsedTime);
|
||||
|
||||
while (lElapsedTime > 0)
|
||||
{
|
||||
|
||||
@@ -949,7 +949,7 @@ PyObject* netSendExchangeElkAddPacket(PyObject* poSelf, PyObject* poArgs)
|
||||
|
||||
PyObject* netSendExchangeItemAddPacket(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
BYTE bWindowType;
|
||||
int bWindowType;
|
||||
if (!PyTuple_GetInteger(poArgs, 0, &bWindowType))
|
||||
return Py_BuildException();
|
||||
WORD wSlotIndex;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
bool CPythonNetworkStream::SendSafeBoxMoneyPacket(BYTE byState, DWORD dwMoney)
|
||||
{
|
||||
assert(!"CPythonNetworkStream::SendSafeBoxMoneyPacket - 사용하지 않는 함수");
|
||||
assert(!"CPythonNetworkStream::SendSafeBoxMoneyPacket");
|
||||
return false;
|
||||
|
||||
// TPacketCGSafeboxMoney kSafeboxMoney;
|
||||
|
||||
@@ -402,7 +402,7 @@ DWORD CPythonPlayer::__GetHitRate()
|
||||
src = (GetStatus(POINT_DX) * 4 + GetStatus(POINT_LEVEL) * 2)/6;
|
||||
}
|
||||
|
||||
return 100*(min(90, src)+210)/300;
|
||||
return 100*(std::min(90, src)+210)/300;
|
||||
}
|
||||
|
||||
DWORD CPythonPlayer::__GetEvadeRate()
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
// *pdwItemID=itemData->vnum;
|
||||
// return TRUE;
|
||||
//}
|
||||
void CPythonShop::SetTabCoinType(BYTE tabIdx, BYTE coinType)
|
||||
void CPythonShop::SetTabCoinType(uint8_t tabIdx, uint8_t coinType)
|
||||
{
|
||||
if (tabIdx >= m_bTabCount)
|
||||
{
|
||||
@@ -23,7 +23,7 @@ void CPythonShop::SetTabCoinType(BYTE tabIdx, BYTE coinType)
|
||||
m_aShoptabs[tabIdx].coinType = coinType;
|
||||
}
|
||||
|
||||
BYTE CPythonShop::GetTabCoinType(BYTE tabIdx)
|
||||
uint8_t CPythonShop::GetTabCoinType(uint8_t tabIdx)
|
||||
{
|
||||
if (tabIdx >= m_bTabCount)
|
||||
{
|
||||
@@ -33,7 +33,7 @@ BYTE CPythonShop::GetTabCoinType(BYTE tabIdx)
|
||||
return m_aShoptabs[tabIdx].coinType;
|
||||
}
|
||||
|
||||
void CPythonShop::SetTabName(BYTE tabIdx, const char* name)
|
||||
void CPythonShop::SetTabName(uint8_t tabIdx, const char* name)
|
||||
{
|
||||
if (tabIdx >= m_bTabCount)
|
||||
{
|
||||
@@ -43,7 +43,7 @@ void CPythonShop::SetTabName(BYTE tabIdx, const char* name)
|
||||
m_aShoptabs[tabIdx].name = name;
|
||||
}
|
||||
|
||||
const char* CPythonShop::GetTabName(BYTE tabIdx)
|
||||
const char* CPythonShop::GetTabName(uint8_t tabIdx)
|
||||
{
|
||||
if (tabIdx >= m_bTabCount)
|
||||
{
|
||||
@@ -56,7 +56,7 @@ const char* CPythonShop::GetTabName(BYTE tabIdx)
|
||||
|
||||
void CPythonShop::SetItemData(DWORD dwIndex, const TShopItemData & c_rShopItemData)
|
||||
{
|
||||
BYTE tabIdx = dwIndex / SHOP_HOST_ITEM_MAX_NUM;
|
||||
uint8_t tabIdx = dwIndex / SHOP_HOST_ITEM_MAX_NUM;
|
||||
DWORD dwSlotPos = dwIndex % SHOP_HOST_ITEM_MAX_NUM;
|
||||
|
||||
SetItemData(tabIdx, dwSlotPos, c_rShopItemData);
|
||||
@@ -64,13 +64,13 @@ void CPythonShop::SetItemData(DWORD dwIndex, const TShopItemData & c_rShopItemDa
|
||||
|
||||
BOOL CPythonShop::GetItemData(DWORD dwIndex, const TShopItemData ** c_ppItemData)
|
||||
{
|
||||
BYTE tabIdx = dwIndex / SHOP_HOST_ITEM_MAX_NUM;
|
||||
uint8_t tabIdx = dwIndex / SHOP_HOST_ITEM_MAX_NUM;
|
||||
DWORD dwSlotPos = dwIndex % SHOP_HOST_ITEM_MAX_NUM;
|
||||
|
||||
return GetItemData(tabIdx, dwSlotPos, c_ppItemData);
|
||||
}
|
||||
|
||||
void CPythonShop::SetItemData(BYTE tabIdx, DWORD dwSlotPos, const TShopItemData & c_rShopItemData)
|
||||
void CPythonShop::SetItemData(uint8_t tabIdx, DWORD dwSlotPos, const TShopItemData & c_rShopItemData)
|
||||
{
|
||||
if (tabIdx >= SHOP_TAB_COUNT_MAX || dwSlotPos >= SHOP_HOST_ITEM_MAX_NUM)
|
||||
{
|
||||
@@ -81,7 +81,7 @@ void CPythonShop::SetItemData(BYTE tabIdx, DWORD dwSlotPos, const TShopItemData
|
||||
m_aShoptabs[tabIdx].items[dwSlotPos] = c_rShopItemData;
|
||||
}
|
||||
|
||||
BOOL CPythonShop::GetItemData(BYTE tabIdx, DWORD dwSlotPos, const TShopItemData ** c_ppItemData)
|
||||
BOOL CPythonShop::GetItemData(uint8_t tabIdx, DWORD dwSlotPos, const TShopItemData ** c_ppItemData)
|
||||
{
|
||||
if (tabIdx >= SHOP_TAB_COUNT_MAX || dwSlotPos >= SHOP_HOST_ITEM_MAX_NUM)
|
||||
{
|
||||
@@ -106,7 +106,7 @@ void CPythonShop::ClearPrivateShopStock()
|
||||
{
|
||||
m_PrivateShopItemStock.clear();
|
||||
}
|
||||
void CPythonShop::AddPrivateShopItemStock(TItemPos ItemPos, BYTE dwDisplayPos, DWORD dwPrice)
|
||||
void CPythonShop::AddPrivateShopItemStock(TItemPos ItemPos, uint8_t dwDisplayPos, DWORD dwPrice)
|
||||
{
|
||||
DelPrivateShopItemStock(ItemPos);
|
||||
|
||||
@@ -326,7 +326,7 @@ PyObject * shopClearPrivateShopStock(PyObject * poSelf, PyObject * poArgs)
|
||||
}
|
||||
PyObject * shopAddPrivateShopItemStock(PyObject * poSelf, PyObject * poArgs)
|
||||
{
|
||||
BYTE bItemWindowType;
|
||||
uint8_t bItemWindowType;
|
||||
if (!PyTuple_GetInteger(poArgs, 0, &bItemWindowType))
|
||||
return Py_BuildException();
|
||||
WORD wItemSlotIndex;
|
||||
@@ -344,7 +344,7 @@ PyObject * shopAddPrivateShopItemStock(PyObject * poSelf, PyObject * poArgs)
|
||||
}
|
||||
PyObject * shopDelPrivateShopItemStock(PyObject * poSelf, PyObject * poArgs)
|
||||
{
|
||||
BYTE bItemWindowType;
|
||||
uint8_t bItemWindowType;
|
||||
if (!PyTuple_GetInteger(poArgs, 0, &bItemWindowType))
|
||||
return Py_BuildException();
|
||||
WORD wItemSlotIndex;
|
||||
@@ -356,7 +356,7 @@ PyObject * shopDelPrivateShopItemStock(PyObject * poSelf, PyObject * poArgs)
|
||||
}
|
||||
PyObject * shopGetPrivateShopItemPrice(PyObject * poSelf, PyObject * poArgs)
|
||||
{
|
||||
BYTE bItemWindowType;
|
||||
uint8_t bItemWindowType;
|
||||
if (!PyTuple_GetInteger(poArgs, 0, &bItemWindowType))
|
||||
return Py_BuildException();
|
||||
WORD wItemSlotIndex;
|
||||
@@ -383,7 +383,7 @@ PyObject * shopGetTabCount(PyObject * poSelf, PyObject * poArgs)
|
||||
|
||||
PyObject * shopGetTabName(PyObject * poSelf, PyObject * poArgs)
|
||||
{
|
||||
BYTE bTabIdx;
|
||||
uint8_t bTabIdx;
|
||||
if (!PyTuple_GetInteger(poArgs, 0, &bTabIdx))
|
||||
return Py_BuildException();
|
||||
|
||||
@@ -392,7 +392,7 @@ PyObject * shopGetTabName(PyObject * poSelf, PyObject * poArgs)
|
||||
|
||||
PyObject * shopGetTabCoinType(PyObject * poSelf, PyObject * poArgs)
|
||||
{
|
||||
BYTE bTabIdx;
|
||||
uint8_t bTabIdx;
|
||||
if (!PyTuple_GetInteger(poArgs, 0, &bTabIdx))
|
||||
return Py_BuildException();
|
||||
|
||||
|
||||
@@ -28,17 +28,17 @@ class CPythonShop : public CSingleton<CPythonShop>
|
||||
void SetItemData(DWORD dwIndex, const TShopItemData & c_rShopItemData);
|
||||
BOOL GetItemData(DWORD dwIndex, const TShopItemData ** c_ppItemData);
|
||||
|
||||
void SetItemData(BYTE tabIdx, DWORD dwSlotPos, const TShopItemData & c_rShopItemData);
|
||||
BOOL GetItemData(BYTE tabIdx, DWORD dwSlotPos, const TShopItemData ** c_ppItemData);
|
||||
void SetItemData(uint8_t tabIdx, DWORD dwSlotPos, const TShopItemData & c_rShopItemData);
|
||||
BOOL GetItemData(uint8_t tabIdx, DWORD dwSlotPos, const TShopItemData ** c_ppItemData);
|
||||
|
||||
void SetTabCount(BYTE bTabCount) { m_bTabCount = bTabCount; }
|
||||
BYTE GetTabCount() { return m_bTabCount; }
|
||||
void SetTabCount(uint8_t bTabCount) { m_bTabCount = bTabCount; }
|
||||
uint8_t GetTabCount() { return m_bTabCount; }
|
||||
|
||||
void SetTabCoinType(BYTE tabIdx, BYTE coinType);
|
||||
BYTE GetTabCoinType(BYTE tabIdx);
|
||||
void SetTabCoinType(uint8_t tabIdx, uint8_t coinType);
|
||||
uint8_t GetTabCoinType(uint8_t tabIdx);
|
||||
|
||||
void SetTabName(BYTE tabIdx, const char* name);
|
||||
const char* GetTabName(BYTE tabIdx);
|
||||
void SetTabName(uint8_t tabIdx, const char* name);
|
||||
const char* GetTabName(uint8_t tabIdx);
|
||||
|
||||
|
||||
//BOOL GetSlotItemID(DWORD dwSlotPos, DWORD* pdwItemID);
|
||||
@@ -50,7 +50,7 @@ class CPythonShop : public CSingleton<CPythonShop>
|
||||
BOOL IsMainPlayerPrivateShop();
|
||||
|
||||
void ClearPrivateShopStock();
|
||||
void AddPrivateShopItemStock(TItemPos ItemPos, BYTE byDisplayPos, DWORD dwPrice);
|
||||
void AddPrivateShopItemStock(TItemPos ItemPos, uint8_t byDisplayPos, DWORD dwPrice);
|
||||
void DelPrivateShopItemStock(TItemPos ItemPos);
|
||||
int GetPrivateShopItemPrice(TItemPos ItemPos);
|
||||
void BuildPrivateShop(const char * c_szName);
|
||||
@@ -69,12 +69,12 @@ class CPythonShop : public CSingleton<CPythonShop>
|
||||
{
|
||||
coinType = SHOP_COIN_TYPE_GOLD;
|
||||
}
|
||||
BYTE coinType;
|
||||
uint8_t coinType;
|
||||
std::string name;
|
||||
TShopItemData items[SHOP_HOST_ITEM_MAX_NUM];
|
||||
};
|
||||
|
||||
BYTE m_bTabCount;
|
||||
uint8_t m_bTabCount;
|
||||
ShopTab m_aShoptabs[SHOP_TAB_COUNT_MAX];
|
||||
|
||||
typedef std::map<TItemPos, TShopItemTable> TPrivateShopItemStock;
|
||||
|
||||
@@ -692,7 +692,7 @@ bool CPythonSkill::RegisterSkill(DWORD dwSkillIndex, const char * c_szFileName)
|
||||
if (SKILL_GRADE_COUNT*2 != pGradeDataVector->size())
|
||||
TraceError("CPythonSkill::RegisterSkill(dwSkillIndex=%d, c_szFileName=%s) - Strange Grade Data Count", dwSkillIndex, c_szFileName);
|
||||
|
||||
for (DWORD i = 0; i < min(SKILL_GRADE_COUNT, pGradeDataVector->size()/2); ++i)
|
||||
for (DWORD i = 0; i < std::min((size_t)SKILL_GRADE_COUNT, pGradeDataVector->size()/2); ++i)
|
||||
{
|
||||
SkillData.GradeData[i].strName = pGradeDataVector->at(i*2+0);
|
||||
std::string strIconFileName = g_strImagePath + pGradeDataVector->at(i*2+1);
|
||||
@@ -1792,7 +1792,7 @@ PyObject * skillGetSkillRequirementData(PyObject * poSelf, PyObject * poArgs)
|
||||
if (!CPythonSkill::Instance().GetSkillDataByName(c_pSkillData->strRequireSkillName.c_str(), &pRequireSkillData))
|
||||
return Py_BuildValue("si", 0, "None", 0);
|
||||
|
||||
int ireqLevel = (int)ceil(float(c_pSkillData->byRequireSkillLevel)/float(max(1, pRequireSkillData->byLevelUpPoint)));
|
||||
int ireqLevel = (int)ceil(float(c_pSkillData->byRequireSkillLevel)/float(std::max(1, (int)pRequireSkillData->byLevelUpPoint)));
|
||||
return Py_BuildValue("si", c_pSkillData->strRequireSkillName.c_str(), ireqLevel);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,19 +9,14 @@
|
||||
#pragma warning(disable:4245)
|
||||
#pragma warning(disable:4995)
|
||||
|
||||
#if _MSC_VER >= 1400
|
||||
//if don't use below, time_t is 64bit
|
||||
#define _USE_32BIT_TIME_T
|
||||
#endif
|
||||
|
||||
#include "../eterLib/StdAfx.h"
|
||||
#include "../eterPythonLib/StdAfx.h"
|
||||
#include "../gameLib/StdAfx.h"
|
||||
#include "../scriptLib/StdAfx.h"
|
||||
#include "../milesLib/StdAfx.h"
|
||||
#include "../EffectLib/StdAfx.h"
|
||||
#include "../PRTerrainLib/StdAfx.h"
|
||||
#include "../SpeedTreeLib/StdAfx.h"
|
||||
#include "eterLib/StdAfx.h"
|
||||
#include "eterPythonLib/StdAfx.h"
|
||||
#include "gameLib/StdAfx.h"
|
||||
#include "scriptLib/StdAfx.h"
|
||||
#include "milesLib/StdAfx.h"
|
||||
#include "EffectLib/StdAfx.h"
|
||||
#include "PRTerrainLib/StdAfx.h"
|
||||
#include "SpeedTreeLib/StdAfx.h"
|
||||
|
||||
#ifndef __D3DRM_H__
|
||||
#define __D3DRM_H__
|
||||
|
||||
Reference in New Issue
Block a user