Skip to content

Commit

Permalink
Initial commit of all AC2D code, converting from the old SVN repository
Browse files Browse the repository at this point in the history
  • Loading branch information
deregtd committed Jan 20, 2015
1 parent 6ce63cc commit 7d0e96e
Show file tree
Hide file tree
Showing 211 changed files with 25,397 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*.sdf
*.suo
*.user
*.pch
Debug
Release
ipch
Thumbs.db

# Precached DAT files by AC2D
*.pre
Binary file added AC2DTest.aps
Binary file not shown.
154 changes: 154 additions & 0 deletions AC2DTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
// AC2DTest.cpp : Defines the entry point for the application.
//

#include "stdafx.h"
#include "AC2DTest.h"
#include "cClient.h"

#define MAX_LOADSTRING 100

// Global Variables:
HINSTANCE hInst; // current instance
cClient *Client;

// Forward declarations of functions included in this code module:
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
//MessageBox(NULL, lpCmdLine, NULL, MB_OK);

hInst = hInstance;

// _CrtSetDbgFlag ( _CRTDBG_LEAK_CHECK_DF | _CRTDBG_ALLOC_MEM_DF | _CRTDBG_CHECK_ALWAYS_DF );

// Initialize global strings
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
wcex.lpfnWndProc = (WNDPROC)WndProc;
wcex.cbClsExtra = 64;
wcex.cbWndExtra = 0;
wcex.hInstance = hInst;
wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_AC2DTEST);
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = (LPCTSTR)IDC_AC2DTEST;
wcex.lpszClassName = "AC2D";
wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_ICON1);
RegisterClassEx(&wcex);

HWND hWnd = CreateWindow("AC2D", "AC2D", WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);

srand((DWORD) time(0));

if (!hWnd)
return FALSE;

//Now initialize our Client...
Client = new cClient(hInst, hWnd);

//Launch client
Client->Start();

ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);

MSG msg;
HACCEL hAccelTable;
hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_AC2DTEST);

// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}

Client->Stop();

delete Client;

//_CrtDumpMemoryLeaks();

return (int) msg.wParam;
}


//
// FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
//
// PURPOSE: Processes messages for the main window.
//
// WM_COMMAND - process the application menu
// WM_PAINT - Paint the main window
// WM_DESTROY - post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;

if (Client)
{
while (!Client->Initted())
Sleep(1);

Client->WindowsMessage(message, wParam, lParam);
}

switch (message)
{
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// Parse the menu selections:
switch (wmId)
{
case IDM_EXIT:
DestroyWindow(hWnd);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
break;
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
// TODO: Add any drawing code here...
EndPaint(hWnd, &ps);
break;
case WM_SIZE:
Client->Resize();
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}

void _ODS( const char *fmt, ... )
{
va_list valist;
va_start( valist, fmt );

char szText[2048];
memset( szText, 0, 2048 );

_vsnprintf( szText, 2048, fmt, valist );

OutputDebugString( szText );

va_end( valist );
}
3 changes: 3 additions & 0 deletions AC2DTest.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once

#include "resource.h"
Binary file added AC2DTest.ico
Binary file not shown.
133 changes: 133 additions & 0 deletions AC2DTest.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (United States) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)

/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_AC2DTEST ICON "AC2DTest.ico"
IDI_SMALL ICON "small.ico"
IDI_ICON1 ICON "client.ico"

/////////////////////////////////////////////////////////////////////////////
//
// Menu
//

IDC_AC2DTEST MENU
BEGIN
POPUP "&File"
BEGIN
MENUITEM "E&xit", IDM_EXIT
END
END


#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE
BEGIN
"resource.h\0"
END

2 TEXTINCLUDE
BEGIN
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""windows.h""\r\n"
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
"\0"
END

3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END

#endif // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,0,11,4104
PRODUCTVERSION 0,0,11,4104
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "compiled Thu Aug 11 03:14:56 2005 : RETAIL"
VALUE "CompanyName", "Turbine, Inc."
VALUE "FileDescription", "acclient"
VALUE "FileVersion", "0.0.11.4104"
VALUE "InternalName", "acclient"
VALUE "LegalCopyright", "Copyright � Turbine, Inc."
VALUE "NetVersion", "2005"
VALUE "OriginalFilename", "acclient.exe"
VALUE "ProductName", "acclient"
VALUE "ProductVersion", "0.0.11.4104"
VALUE "TurbineBuildVersion", "00.00.11.4104.r"
VALUE "TurbineType", "Player External"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

19 changes: 19 additions & 0 deletions AC2DTest.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AC2DTest", "AC2DTest.vcxproj", "{6502958E-D1EB-42B1-93D7-7A295B59014C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6502958E-D1EB-42B1-93D7-7A295B59014C}.Debug|Win32.ActiveCfg = Debug|Win32
{6502958E-D1EB-42B1-93D7-7A295B59014C}.Debug|Win32.Build.0 = Debug|Win32
{6502958E-D1EB-42B1-93D7-7A295B59014C}.Release|Win32.ActiveCfg = Release|Win32
{6502958E-D1EB-42B1-93D7-7A295B59014C}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Loading

0 comments on commit 7d0e96e

Please sign in to comment.