Add support to compile with VS2013 x64

This commit is contained in:
David Capello 2015-03-06 17:01:08 -03:00
parent b23194dfae
commit e09cdd67cb
15 changed files with 33 additions and 29 deletions

View File

@ -12,7 +12,7 @@ if(MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT")
endif() endif()
if (CMAKE_SIZEOF_VOID_P EQUAL 8) if (CMAKE_CL_64)
# 64 bits # 64 bits
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MACHINE:X64") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MACHINE:X64")
else() else()

View File

@ -12,3 +12,7 @@ Changes:
audio, MIDI, joystick, etc.). audio, MIDI, joystick, etc.).
* The HWND class has CS_DBLCLKS enabled (so UI code can detect * The HWND class has CS_DBLCLKS enabled (so UI code can detect
double-clicks from Windows messages). double-clicks from Windows messages).
* Fixed issues recreating DirectX surfaces
* Fixed OS X mouse issues
* Support for x64
* Several [other changes](https://github.com/aseprite/aseprite/commits/master/src/allegro)

View File

@ -25,7 +25,7 @@
#define DRAW_GLYPH(bits, size) \ #define DRAW_GLYPH(bits, size) \
{ \ { \
AL_CONST unsigned char *data = glyph->dat; \ AL_CONST unsigned char *data = glyph->dat; \
unsigned long addr; \ uintptr_t addr; \
int w = glyph->w; \ int w = glyph->w; \
int h = glyph->h; \ int h = glyph->h; \
int stride = (w+7)/8; \ int stride = (w+7)/8; \

View File

@ -1,4 +1,4 @@
// Copyright (C) 2013 by David Capello // Copyright (C) 2013, 2015 by David Capello
#ifndef ALLEGRO_WIN_UTF8_H #ifndef ALLEGRO_WIN_UTF8_H
#define ALLEGRO_WIN_UTF8_H #define ALLEGRO_WIN_UTF8_H
@ -6,7 +6,7 @@
static char* convert_widechar_to_utf8(const wchar_t* wstr) static char* convert_widechar_to_utf8(const wchar_t* wstr)
{ {
char* u8str; char* u8str;
int wlen = wcslen(wstr); int wlen = (int)wcslen(wstr);
int u8len = WideCharToMultiByte(CP_UTF8, 0, wstr, wlen, NULL, 0, NULL, NULL); int u8len = WideCharToMultiByte(CP_UTF8, 0, wstr, wlen, NULL, 0, NULL, NULL);
u8len++; u8len++;
u8str = _AL_MALLOC(u8len); u8str = _AL_MALLOC(u8len);
@ -18,7 +18,7 @@ static char* convert_widechar_to_utf8(const wchar_t* wstr)
static wchar_t* convert_utf8_to_widechar(const char* u8str) static wchar_t* convert_utf8_to_widechar(const char* u8str)
{ {
wchar_t* wstr; wchar_t* wstr;
int u8len = strlen(u8str); int u8len = (int)strlen(u8str);
int wlen = MultiByteToWideChar(CP_UTF8, 0, u8str, u8len, NULL, 0); int wlen = MultiByteToWideChar(CP_UTF8, 0, u8str, u8len, NULL, 0);
wlen++; wlen++;
wstr = _AL_MALLOC(wlen * sizeof(wchar_t)); wstr = _AL_MALLOC(wlen * sizeof(wchar_t));

View File

@ -472,7 +472,7 @@ int _WinMain(void* _main, void* hInst, void* hPrev, char* Cmd, int nShow)
/* can't use parameter because it doesn't include the executable name */ /* can't use parameter because it doesn't include the executable name */
cmdline = GetCommandLine(); cmdline = GetCommandLine();
i = sizeof(wchar_t) * (wcslen(cmdline) + 1); i = (int)(sizeof(wchar_t) * (wcslen(cmdline) + 1));
argbuf = _AL_MALLOC(i); argbuf = _AL_MALLOC(i);
memcpy(argbuf, cmdline, i); memcpy(argbuf, cmdline, i);

View File

@ -92,7 +92,7 @@ typedef struct {
*/ */
int wnd_call_proc(int (*proc) (void)) int wnd_call_proc(int (*proc) (void))
{ {
return SendMessage(allegro_wnd, msg_call_proc, (DWORD) proc, 0); return SendMessage(allegro_wnd, msg_call_proc, (WPARAM)proc, 0);
} }
@ -103,7 +103,7 @@ int wnd_call_proc(int (*proc) (void))
*/ */
void wnd_schedule_proc(int (*proc) (void)) void wnd_schedule_proc(int (*proc) (void))
{ {
PostMessage(allegro_wnd, msg_call_proc, (DWORD) proc, 0); PostMessage(allegro_wnd, msg_call_proc, (WPARAM)proc, 0);
} }

View File

@ -146,7 +146,7 @@ bool has_file_extension(const std::string& filename, const std::string& csv_exte
if (!filename.empty()) { if (!filename.empty()) {
std::string ext = base::string_to_lower(get_file_extension(filename)); std::string ext = base::string_to_lower(get_file_extension(filename));
int extsz = ext.size(); int extsz = (int)ext.size();
std::string::const_iterator p = std::string::const_iterator p =
std::search(csv_extensions.begin(), std::search(csv_extensions.begin(),
csv_extensions.end(), csv_extensions.end(),

View File

@ -42,7 +42,7 @@ Sha1 Sha1::calculateFromFile(const std::string& fileName)
unsigned char buf[1024]; unsigned char buf[1024];
while (file.good()) { while (file.good()) {
file.read((char*)buf, 1024); file.read((char*)buf, 1024);
std::size_t len = (std::size_t)file.gcount(); unsigned int len = (unsigned int)file.gcount();
if (len > 0) if (len > 0)
SHA1Input(&sha, buf, len); SHA1Input(&sha, buf, len);
} }

View File

@ -161,7 +161,7 @@ int SHA1Result( SHA1Context *context,
*/ */
int SHA1Input( SHA1Context *context, int SHA1Input( SHA1Context *context,
const uint8_t *message_array, const uint8_t *message_array,
unsigned length) unsigned int length)
{ {
if (!length) if (!length)
{ {

View File

@ -45,8 +45,8 @@ std::string to_utf8(const std::wstring& src)
{ {
int required_size = int required_size =
::WideCharToMultiByte(CP_UTF8, 0, ::WideCharToMultiByte(CP_UTF8, 0,
src.c_str(), src.size(), src.c_str(), (int)src.size(),
NULL, 0, NULL, NULL); NULL, 0, NULL, NULL);
if (required_size == 0) if (required_size == 0)
return std::string(); return std::string();
@ -54,9 +54,9 @@ std::string to_utf8(const std::wstring& src)
std::vector<char> buf(++required_size); std::vector<char> buf(++required_size);
::WideCharToMultiByte(CP_UTF8, 0, ::WideCharToMultiByte(CP_UTF8, 0,
src.c_str(), src.size(), src.c_str(), (int)src.size(),
&buf[0], required_size, &buf[0], required_size,
NULL, NULL); NULL, NULL);
return std::string(&buf[0]); return std::string(&buf[0]);
} }
@ -65,8 +65,8 @@ std::wstring from_utf8(const std::string& src)
{ {
int required_size = int required_size =
MultiByteToWideChar(CP_UTF8, 0, MultiByteToWideChar(CP_UTF8, 0,
src.c_str(), src.size(), src.c_str(), (int)src.size(),
NULL, 0); NULL, 0);
if (required_size == 0) if (required_size == 0)
return std::wstring(); return std::wstring();
@ -74,8 +74,8 @@ std::wstring from_utf8(const std::string& src)
std::vector<wchar_t> buf(++required_size); std::vector<wchar_t> buf(++required_size);
::MultiByteToWideChar(CP_UTF8, 0, ::MultiByteToWideChar(CP_UTF8, 0,
src.c_str(), src.size(), src.c_str(), (int)src.size(),
&buf[0], required_size); &buf[0], required_size);
return std::wstring(&buf[0]); return std::wstring(&buf[0]);
} }

View File

@ -1,5 +1,5 @@
// Aseprite Document Library // Aseprite Document Library
// Copyright (c) 2001-2014 David Capello // Copyright (c) 2001-2015 David Capello
// //
// This file is released under the terms of the MIT license. // This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information. // Read LICENSE.txt for more information.
@ -37,7 +37,7 @@ namespace doc {
Document* back() const { return m_docs.back(); } Document* back() const { return m_docs.back(); }
Document* lastAdded() const { return front(); } Document* lastAdded() const { return front(); }
int size() const { return m_docs.size(); } int size() const { return (int)m_docs.size(); }
bool empty() const { return m_docs.empty(); } bool empty() const { return m_docs.empty(); }
// Add a new documents to the list. // Add a new documents to the list.

View File

@ -132,7 +132,7 @@ namespace doc {
CelIterator getCelEnd() { return m_cels.end(); } CelIterator getCelEnd() { return m_cels.end(); }
CelConstIterator getCelBegin() const { return m_cels.begin(); } CelConstIterator getCelBegin() const { return m_cels.begin(); }
CelConstIterator getCelEnd() const { return m_cels.end(); } CelConstIterator getCelEnd() const { return m_cels.end(); }
int getCelsCount() const { return m_cels.size(); } int getCelsCount() const { return (int)m_cels.size(); }
private: private:
void destroyAllCels(); void destroyAllCels();
@ -155,7 +155,7 @@ namespace doc {
LayerIterator getLayerEnd() { return m_layers.end(); } LayerIterator getLayerEnd() { return m_layers.end(); }
LayerConstIterator getLayerBegin() const { return m_layers.begin(); } LayerConstIterator getLayerBegin() const { return m_layers.begin(); }
LayerConstIterator getLayerEnd() const { return m_layers.end(); } LayerConstIterator getLayerEnd() const { return m_layers.end(); }
int getLayersCount() const { return m_layers.size(); } int getLayersCount() const { return (int)m_layers.size(); }
void addLayer(Layer* layer); void addLayer(Layer* layer);
void removeLayer(Layer* layer); void removeLayer(Layer* layer);

View File

@ -1,5 +1,5 @@
// Aseprite Document Library // Aseprite Document Library
// Copyright (c) 2001-2014 David Capello // Copyright (c) 2001-2015 David Capello
// //
// This file is released under the terms of the MIT license. // This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information. // Read LICENSE.txt for more information.
@ -53,7 +53,7 @@ namespace doc {
static Palette* createGrayscale(); static Palette* createGrayscale();
int size() const { return m_colors.size(); } int size() const { return (int)m_colors.size(); }
void resize(int ncolors); void resize(int ncolors);
std::string filename() const { return m_filename; } std::string filename() const { return m_filename; }

View File

@ -1,5 +1,5 @@
// Aseprite Document Library // Aseprite Document Library
// Copyright (c) 2001-2014 David Capello // Copyright (c) 2001-2015 David Capello
// //
// This file is released under the terms of the MIT license. // This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information. // Read LICENSE.txt for more information.
@ -36,7 +36,7 @@ namespace doc {
Sprite* front() const { return m_sprites.front(); } Sprite* front() const { return m_sprites.front(); }
Sprite* back() const { return m_sprites.back(); } Sprite* back() const { return m_sprites.back(); }
int size() const { return m_sprites.size(); } int size() const { return (int)m_sprites.size(); }
bool empty() const { return m_sprites.empty(); } bool empty() const { return m_sprites.empty(); }
Sprite* add(int width, int height, ColorMode mode = ColorMode::RGB, int ncolors = 256); Sprite* add(int width, int height, ColorMode mode = ColorMode::RGB, int ncolors = 256);

View File

@ -22,7 +22,7 @@ using namespace base::serialization::little_endian;
void write_string(std::ostream& os, const std::string& str) void write_string(std::ostream& os, const std::string& str)
{ {
write16(os, str.size()); write16(os, (int)str.size());
if (!str.empty()) if (!str.empty())
os.write(str.c_str(), str.size()); os.write(str.c_str(), str.size());
} }