parent
86fd6238bd
commit
4d04bc009b
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2008 shash
|
Copyright (C) 2008 shash
|
||||||
Copyright (C) 2008-2012 DeSmuME team
|
Copyright (C) 2008-2013 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -24,11 +24,8 @@
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
|
||||||
#define ABOUT_TIMER_ID 110222
|
#define ABOUT_TIMER_ID 110222
|
||||||
#define PER_PAGE_TEAM 23
|
|
||||||
#define SIZE_SCROLL_BUFFER PER_PAGE_TEAM + TEAM
|
|
||||||
const char *team[] = {
|
const char *team[] = {
|
||||||
"Current Team",
|
"Current Team\1",
|
||||||
"------------",
|
|
||||||
"Guillaume Duhamel",
|
"Guillaume Duhamel",
|
||||||
"Normmatt",
|
"Normmatt",
|
||||||
"Riccardo Magliocchetti",
|
"Riccardo Magliocchetti",
|
||||||
|
@ -37,8 +34,7 @@ const char *team[] = {
|
||||||
"rogerman",
|
"rogerman",
|
||||||
"Luigi__",
|
"Luigi__",
|
||||||
"",
|
"",
|
||||||
"Contributors",
|
"Contributors\1",
|
||||||
"------------",
|
|
||||||
"Allustar",
|
"Allustar",
|
||||||
"amponzi",
|
"amponzi",
|
||||||
"Anthony Molinaro",
|
"Anthony Molinaro",
|
||||||
|
@ -64,18 +60,63 @@ const char *team[] = {
|
||||||
"pengvado",
|
"pengvado",
|
||||||
"dormito",
|
"dormito",
|
||||||
"",
|
"",
|
||||||
"Honorary Nagmasters",
|
"Honorary Nagmasters\1",
|
||||||
"(Thanks to our super testers!)",
|
"(Thanks to our super testers!)\1",
|
||||||
"------------",
|
|
||||||
"nash679",
|
"nash679",
|
||||||
"pokefan999",
|
"pokefan999",
|
||||||
"dottorleo",
|
"dottorleo",
|
||||||
};
|
};
|
||||||
|
|
||||||
const int TEAM = ARRAY_SIZE(team);
|
static HWND gList = NULL;
|
||||||
|
static RECT gRc = {0};
|
||||||
|
static s32 gPosY = 0;
|
||||||
|
const u32 size = ARRAY_SIZE(team);
|
||||||
|
|
||||||
u8 scroll_start;
|
BOOL CALLBACK ListProc(HWND Dlg, UINT msg,WPARAM wparam,LPARAM lparam)
|
||||||
u8 scroll_buffer[SIZE_SCROLL_BUFFER][255];
|
{
|
||||||
|
|
||||||
|
switch (msg)
|
||||||
|
{
|
||||||
|
case WM_PAINT:
|
||||||
|
{
|
||||||
|
PAINTSTRUCT ps = {0};
|
||||||
|
|
||||||
|
HDC hDC = BeginPaint(Dlg, &ps);
|
||||||
|
HDC hdcMem = CreateCompatibleDC(hDC);
|
||||||
|
HBITMAP hbmMem = CreateCompatibleBitmap(hDC, gRc.right, gRc.bottom);
|
||||||
|
HANDLE hOld = SelectObject(hdcMem, hbmMem);
|
||||||
|
SetTextAlign(hdcMem, TA_CENTER);
|
||||||
|
u32 x = gRc.right / 2;
|
||||||
|
FillRect(hdcMem, &gRc, (HBRUSH)GetStockObject(WHITE_BRUSH));
|
||||||
|
SetTextColor(hdcMem, RGB(255, 0, 0));
|
||||||
|
for (u32 i = 0; i < size; i++)
|
||||||
|
{
|
||||||
|
s32 pos = gPosY+(i*20);
|
||||||
|
if (pos > gRc.bottom) break;
|
||||||
|
if (team[i][strlen(team[i])-1] == 1)
|
||||||
|
{
|
||||||
|
SetTextColor(hdcMem, RGB(255, 0, 0));
|
||||||
|
ExtTextOut(hdcMem, x, pos, ETO_CLIPPED, &gRc, team[i], strlen(team[i])-1, NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetTextColor(hdcMem, RGB(0, 0, 0));
|
||||||
|
ExtTextOut(hdcMem, x, pos, ETO_CLIPPED, &gRc, team[i], strlen(team[i]), NULL);
|
||||||
|
}
|
||||||
|
if ((i == size-1) && (pos < (s32)(gRc.top - 20))) gPosY = gRc.bottom;
|
||||||
|
}
|
||||||
|
FrameRect(hdcMem, &gRc, (HBRUSH)GetStockObject(BLACK_BRUSH));
|
||||||
|
|
||||||
|
BitBlt(hDC, 0, 0, gRc.right, gRc.bottom, hdcMem, 0, 0, SRCCOPY);
|
||||||
|
SelectObject(hdcMem, hOld);
|
||||||
|
DeleteObject(hbmMem);
|
||||||
|
DeleteDC(hdcMem);
|
||||||
|
EndPaint(Dlg, &ps);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
BOOL CALLBACK AboutBox_Proc (HWND dialog, UINT message,WPARAM wparam,LPARAM lparam)
|
BOOL CALLBACK AboutBox_Proc (HWND dialog, UINT message,WPARAM wparam,LPARAM lparam)
|
||||||
{
|
{
|
||||||
|
@ -100,15 +141,12 @@ BOOL CALLBACK AboutBox_Proc (HWND dialog, UINT message,WPARAM wparam,LPARAM lpar
|
||||||
wcscat(wstr, wcscat(wcscat(wstr1, L" "), wstr2));
|
wcscat(wstr, wcscat(wcscat(wstr1, L" "), wstr2));
|
||||||
SetDlgItemTextW(dialog, IDC_TXT_COMPILED, wstr);
|
SetDlgItemTextW(dialog, IDC_TXT_COMPILED, wstr);
|
||||||
|
|
||||||
for (int i = 0; i < SIZE_SCROLL_BUFFER; i++)
|
gList = GetDlgItem(dialog, IDC_AUTHORS_LIST);
|
||||||
strcpy((char *)scroll_buffer[i], "\n");
|
SetWindowLongPtr(gList, GWLP_WNDPROC, (LONG_PTR)ListProc);
|
||||||
for (int i = 0; i < TEAM; i++)
|
GetClientRect(gList, &gRc);
|
||||||
{
|
gPosY = gRc.bottom;
|
||||||
strcpy((char *)scroll_buffer[i + PER_PAGE_TEAM], team[i]);
|
|
||||||
strcat((char *)scroll_buffer[i + PER_PAGE_TEAM], "\n");
|
SetTimer(dialog, ABOUT_TIMER_ID, 10, (TIMERPROC) NULL);
|
||||||
}
|
|
||||||
SetTimer(dialog, ABOUT_TIMER_ID, 400, (TIMERPROC) NULL);
|
|
||||||
scroll_start = 1;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,15 +163,8 @@ BOOL CALLBACK AboutBox_Proc (HWND dialog, UINT message,WPARAM wparam,LPARAM lpar
|
||||||
|
|
||||||
case WM_TIMER:
|
case WM_TIMER:
|
||||||
{
|
{
|
||||||
char buf[4096];
|
gPosY--;
|
||||||
memset(buf, 0, sizeof(buf));
|
InvalidateRect(gList, &gRc, false);
|
||||||
for (int i = 0; i < PER_PAGE_TEAM; i++)
|
|
||||||
if(i+scroll_start < SIZE_SCROLL_BUFFER)
|
|
||||||
strcat(buf, (char *)scroll_buffer[i + scroll_start]);
|
|
||||||
scroll_start++;
|
|
||||||
if (scroll_start >= SIZE_SCROLL_BUFFER)
|
|
||||||
scroll_start = 0;
|
|
||||||
SetDlgItemText(dialog, IDC_AUTHORS_LIST, buf);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue