2013-03-15 13:11:33 +00:00
|
|
|
namespace phoenix {
|
|
|
|
|
2012-06-25 12:49:39 +00:00
|
|
|
unsigned ListView_GetColumnCount(HWND hwnd) {
|
|
|
|
unsigned count = 0;
|
|
|
|
LVCOLUMN column;
|
|
|
|
column.mask = LVCF_WIDTH;
|
|
|
|
while(ListView_GetColumn(hwnd, count++, &column));
|
|
|
|
return --count;
|
|
|
|
}
|
|
|
|
|
2012-08-11 02:18:19 +00:00
|
|
|
void ListView_SetImage(HWND hwnd, HIMAGELIST imageList, unsigned row, unsigned column, unsigned imageID) {
|
|
|
|
//if this is the first image assigned, set image list now
|
|
|
|
//do not set sooner, or image blocks will appear in a list with no images
|
|
|
|
if(ListView_GetImageList(hwnd, LVSIL_SMALL) != imageList) {
|
|
|
|
ListView_SetImageList(hwnd, imageList, LVSIL_SMALL);
|
|
|
|
}
|
|
|
|
|
|
|
|
LVITEM item;
|
|
|
|
item.mask = LVIF_IMAGE;
|
|
|
|
item.iItem = row;
|
|
|
|
item.iSubItem = column;
|
|
|
|
item.iImage = imageID;
|
|
|
|
ListView_SetItem(hwnd, &item);
|
|
|
|
}
|
|
|
|
|
2013-05-02 11:25:45 +00:00
|
|
|
void pListView::append(const lstring& list) {
|
2011-02-24 09:25:20 +00:00
|
|
|
wchar_t empty[] = L"";
|
|
|
|
unsigned row = ListView_GetItemCount(hwnd);
|
|
|
|
LVITEM item;
|
2012-06-25 12:49:39 +00:00
|
|
|
item.mask = LVIF_TEXT;
|
2011-02-24 09:25:20 +00:00
|
|
|
item.iItem = row;
|
|
|
|
item.iSubItem = 0;
|
|
|
|
item.pszText = empty;
|
|
|
|
locked = true;
|
|
|
|
ListView_InsertItem(hwnd, &item);
|
|
|
|
locked = false;
|
2012-06-25 12:49:39 +00:00
|
|
|
for(unsigned column = 0; column < list.size(); column++) {
|
|
|
|
utf16_t wtext(list(column, ""));
|
|
|
|
ListView_SetItemText(hwnd, row, column, wtext);
|
2011-02-24 09:25:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-27 09:05:10 +00:00
|
|
|
void pListView::autoSizeColumns() {
|
2012-06-25 12:49:39 +00:00
|
|
|
unsigned columns = ListView_GetColumnCount(hwnd);
|
|
|
|
for(unsigned n = 0; n < columns; n++) {
|
2011-02-24 09:25:20 +00:00
|
|
|
ListView_SetColumnWidth(hwnd, n, LVSCW_AUTOSIZE_USEHEADER);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-28 10:29:01 +00:00
|
|
|
void pListView::remove(unsigned selection) {
|
|
|
|
ListView_DeleteItem(hwnd, selection);
|
2012-06-25 12:49:39 +00:00
|
|
|
}
|
|
|
|
|
2011-02-24 09:25:20 +00:00
|
|
|
void pListView::reset() {
|
|
|
|
ListView_DeleteAllItems(hwnd);
|
2012-08-11 02:18:19 +00:00
|
|
|
buildImageList(); //free previously allocated images
|
2011-02-24 09:25:20 +00:00
|
|
|
}
|
|
|
|
|
Update to v094r08 release.
byuu says:
Lots of changes this time around. FreeBSD stability and compilation is
still a work in progress.
FreeBSD 10 + Clang 3.3 = 108fps
FreeBSD 10 + GCC 4.7 = 130fps
Errata 1: I've been fighting that god-damned endian.h header for the
past nine WIPs now. The above WIP isn't building now because FreeBSD
isn't including headers before using certain types, and you end up with
a trillion error messages. So just delete all the endian.h includes from
nall/intrinsics.hpp to build.
Errata 2: I was trying to match g++ and g++47, so I used $(findstring
g++,$(compiler)), which ends up also matching clang++. Oops. Easy fix,
put Clang first and then else if g++ next. Not ideal, but oh well. All
it's doing for now is declaring -fwrapv twice, so you don't have to fix
it just yet. Probably just going to alias g++="g++47" and do exact
matching instead.
Errata 3: both OpenGL::term and VideoGLX::term are causing a core dump
on BSD. No idea why. The resources are initialized and valid, but
releasing them crashes the application.
Changelog:
- nall/Makefile is more flexible with overriding $(compiler), so you can
build with GCC or Clang on BSD (defaults to GCC now)
- PLATFORM_X was renamed to PLATFORM_XORG, and it's also declared with
PLATFORM_LINUX or PLATFORM_BSD
- PLATFORM_XORG probably isn't the best name ... still thinking about
what best to call LINUX|BSD|SOLARIS or ^(WINDOWS|MACOSX)
- fixed a few legitimate Clang warning messages in nall
- Compiler::VisualCPP is ugly as hell, renamed to Compiler::CL
- nall/platform includes nall/intrinsics first. Trying to move away from
testing for _WIN32, etc directly in all files. Work in progress.
- nall turns off Clang warnings that I won't "fix", because they aren't
broken. It's much less noisy to compile with warnings on now.
- phoenix gains the ability to set background and foreground colors on
various text container widgets (GTK only for now.)
- rewrote a lot of the MSU1 code to try and simplify it. Really hope
I didn't break anything ... I don't have any MSU1 test ROMs handy
- SNES coprocessor audio is now mixed as sclamp<16>(system_sample
+ coprocessor_sample) instead of sclamp<16>((sys + cop) / 2)
- allows for greater chance of aliasing (still low, SNES audio is
quiet), but doesn't cut base system volume in half anymore
- fixed Super Scope and Justifier cursor colors
- use input.xlib instead of input.x ... allows Xlib input driver to be
visible on Linux and BSD once again
- make install and make uninstall must be run as root again; no longer
using install but cp instead for BSD compatibility
- killed $(DESTDIR) ... use make prefix=$DESTDIR$prefix instead
- you can now set text/background colors for the loki console via (eg):
- settings.terminal.background-color 0x000000
- settings.terminal.foreground-color 0xffffff
2014-02-24 09:39:09 +00:00
|
|
|
void pListView::setBackgroundColor(Color color) {
|
Update to v094r09 release.
byuu says:
This will easily be the biggest diff in the history of higan. And not in
a good way.
* target-higan and target-loki have been blown away completely
* nall and ruby massively updated
* phoenix replaced with hiro (pretty near a total rewrite)
* target-higan restarted using hiro (just a window for now)
* all emulation cores updated to compile again
* installation changed to not require root privileges (installs locally)
For the foreseeable future (maybe even permanently?), the new higan UI
will only build under Linux/BSD with GTK+ 2.20+. Probably the most
likely route for Windows/OS X will be to try and figure out how to build
hiro/GTK on those platforms, as awful as that would be. The other
alternative would be to produce new UIs for those platforms ... which
would actually be a good opportunity to make something much more user
friendly.
Being that I just started on this a few hours ago, that means that for
at least a few weeks, don't expect to be able to actually play any
games. Right now, you can pretty much just compile the binary and that's
it. It's quite possible that some nall changes didn't produce
compilation errors, but will produce runtime errors. So until the UI can
actually load games, we won't know if anything is broken. But we should
mostly be okay. It was mostly just trim<1> -> trim changes, moving to
Hash::SHA256 (much cleaner), and patching some reckless memory copy
functions enough to compile.
Progress isn't going to be like it was before: I'm now dividing my time
much thinner between studying and other hobbies.
My aim this time is not to produce a binary for everyone to play games
on. Rather, it's to keep the emulator alive. I want to be able to apply
critical patches again. And I would also like the base of the emulator
to live on, for use in other emulator frontends that utilize higan.
2015-02-26 10:10:46 +00:00
|
|
|
ListView_SetBkColor(hwnd, RGB(color.red, color.green, color.blue));
|
Update to v094r08 release.
byuu says:
Lots of changes this time around. FreeBSD stability and compilation is
still a work in progress.
FreeBSD 10 + Clang 3.3 = 108fps
FreeBSD 10 + GCC 4.7 = 130fps
Errata 1: I've been fighting that god-damned endian.h header for the
past nine WIPs now. The above WIP isn't building now because FreeBSD
isn't including headers before using certain types, and you end up with
a trillion error messages. So just delete all the endian.h includes from
nall/intrinsics.hpp to build.
Errata 2: I was trying to match g++ and g++47, so I used $(findstring
g++,$(compiler)), which ends up also matching clang++. Oops. Easy fix,
put Clang first and then else if g++ next. Not ideal, but oh well. All
it's doing for now is declaring -fwrapv twice, so you don't have to fix
it just yet. Probably just going to alias g++="g++47" and do exact
matching instead.
Errata 3: both OpenGL::term and VideoGLX::term are causing a core dump
on BSD. No idea why. The resources are initialized and valid, but
releasing them crashes the application.
Changelog:
- nall/Makefile is more flexible with overriding $(compiler), so you can
build with GCC or Clang on BSD (defaults to GCC now)
- PLATFORM_X was renamed to PLATFORM_XORG, and it's also declared with
PLATFORM_LINUX or PLATFORM_BSD
- PLATFORM_XORG probably isn't the best name ... still thinking about
what best to call LINUX|BSD|SOLARIS or ^(WINDOWS|MACOSX)
- fixed a few legitimate Clang warning messages in nall
- Compiler::VisualCPP is ugly as hell, renamed to Compiler::CL
- nall/platform includes nall/intrinsics first. Trying to move away from
testing for _WIN32, etc directly in all files. Work in progress.
- nall turns off Clang warnings that I won't "fix", because they aren't
broken. It's much less noisy to compile with warnings on now.
- phoenix gains the ability to set background and foreground colors on
various text container widgets (GTK only for now.)
- rewrote a lot of the MSU1 code to try and simplify it. Really hope
I didn't break anything ... I don't have any MSU1 test ROMs handy
- SNES coprocessor audio is now mixed as sclamp<16>(system_sample
+ coprocessor_sample) instead of sclamp<16>((sys + cop) / 2)
- allows for greater chance of aliasing (still low, SNES audio is
quiet), but doesn't cut base system volume in half anymore
- fixed Super Scope and Justifier cursor colors
- use input.xlib instead of input.x ... allows Xlib input driver to be
visible on Linux and BSD once again
- make install and make uninstall must be run as root again; no longer
using install but cp instead for BSD compatibility
- killed $(DESTDIR) ... use make prefix=$DESTDIR$prefix instead
- you can now set text/background colors for the loki console via (eg):
- settings.terminal.background-color 0x000000
- settings.terminal.foreground-color 0xffffff
2014-02-24 09:39:09 +00:00
|
|
|
}
|
|
|
|
|
2011-02-24 09:25:20 +00:00
|
|
|
void pListView::setCheckable(bool checkable) {
|
2012-06-25 12:49:39 +00:00
|
|
|
ListView_SetExtendedListViewStyle(hwnd, LVS_EX_FULLROWSELECT | LVS_EX_SUBITEMIMAGES | (checkable ? LVS_EX_CHECKBOXES : 0));
|
2011-02-24 09:25:20 +00:00
|
|
|
}
|
|
|
|
|
2013-11-28 10:29:01 +00:00
|
|
|
void pListView::setChecked(unsigned selection, bool checked) {
|
2011-02-24 09:25:20 +00:00
|
|
|
locked = true;
|
2013-11-28 10:29:01 +00:00
|
|
|
ListView_SetCheckState(hwnd, selection, checked);
|
2011-02-24 09:25:20 +00:00
|
|
|
locked = false;
|
|
|
|
}
|
|
|
|
|
Update to v094r08 release.
byuu says:
Lots of changes this time around. FreeBSD stability and compilation is
still a work in progress.
FreeBSD 10 + Clang 3.3 = 108fps
FreeBSD 10 + GCC 4.7 = 130fps
Errata 1: I've been fighting that god-damned endian.h header for the
past nine WIPs now. The above WIP isn't building now because FreeBSD
isn't including headers before using certain types, and you end up with
a trillion error messages. So just delete all the endian.h includes from
nall/intrinsics.hpp to build.
Errata 2: I was trying to match g++ and g++47, so I used $(findstring
g++,$(compiler)), which ends up also matching clang++. Oops. Easy fix,
put Clang first and then else if g++ next. Not ideal, but oh well. All
it's doing for now is declaring -fwrapv twice, so you don't have to fix
it just yet. Probably just going to alias g++="g++47" and do exact
matching instead.
Errata 3: both OpenGL::term and VideoGLX::term are causing a core dump
on BSD. No idea why. The resources are initialized and valid, but
releasing them crashes the application.
Changelog:
- nall/Makefile is more flexible with overriding $(compiler), so you can
build with GCC or Clang on BSD (defaults to GCC now)
- PLATFORM_X was renamed to PLATFORM_XORG, and it's also declared with
PLATFORM_LINUX or PLATFORM_BSD
- PLATFORM_XORG probably isn't the best name ... still thinking about
what best to call LINUX|BSD|SOLARIS or ^(WINDOWS|MACOSX)
- fixed a few legitimate Clang warning messages in nall
- Compiler::VisualCPP is ugly as hell, renamed to Compiler::CL
- nall/platform includes nall/intrinsics first. Trying to move away from
testing for _WIN32, etc directly in all files. Work in progress.
- nall turns off Clang warnings that I won't "fix", because they aren't
broken. It's much less noisy to compile with warnings on now.
- phoenix gains the ability to set background and foreground colors on
various text container widgets (GTK only for now.)
- rewrote a lot of the MSU1 code to try and simplify it. Really hope
I didn't break anything ... I don't have any MSU1 test ROMs handy
- SNES coprocessor audio is now mixed as sclamp<16>(system_sample
+ coprocessor_sample) instead of sclamp<16>((sys + cop) / 2)
- allows for greater chance of aliasing (still low, SNES audio is
quiet), but doesn't cut base system volume in half anymore
- fixed Super Scope and Justifier cursor colors
- use input.xlib instead of input.x ... allows Xlib input driver to be
visible on Linux and BSD once again
- make install and make uninstall must be run as root again; no longer
using install but cp instead for BSD compatibility
- killed $(DESTDIR) ... use make prefix=$DESTDIR$prefix instead
- you can now set text/background colors for the loki console via (eg):
- settings.terminal.background-color 0x000000
- settings.terminal.foreground-color 0xffffff
2014-02-24 09:39:09 +00:00
|
|
|
void pListView::setForegroundColor(Color color) {
|
|
|
|
}
|
|
|
|
|
2013-11-28 10:29:01 +00:00
|
|
|
void pListView::setGeometry(Geometry geometry) {
|
|
|
|
pWidget::setGeometry(geometry);
|
|
|
|
autoSizeColumns();
|
|
|
|
}
|
|
|
|
|
2013-05-02 11:25:45 +00:00
|
|
|
void pListView::setHeaderText(const lstring& list) {
|
2011-02-24 09:25:20 +00:00
|
|
|
while(ListView_DeleteColumn(hwnd, 0));
|
|
|
|
|
|
|
|
lstring headers = list;
|
|
|
|
if(headers.size() == 0) headers.append(""); //must have at least one column
|
|
|
|
|
2011-09-27 11:55:02 +00:00
|
|
|
for(unsigned n = 0; n < headers.size(); n++) {
|
2011-02-24 09:25:20 +00:00
|
|
|
LVCOLUMN column;
|
|
|
|
column.mask = LVCF_FMT | LVCF_TEXT | LVCF_SUBITEM;
|
|
|
|
column.fmt = LVCFMT_LEFT;
|
|
|
|
column.iSubItem = n;
|
2011-09-27 11:55:02 +00:00
|
|
|
utf16_t headerText(headers[n]);
|
2011-02-24 09:25:20 +00:00
|
|
|
column.pszText = headerText;
|
|
|
|
ListView_InsertColumn(hwnd, n, &column);
|
|
|
|
}
|
2011-02-27 09:05:10 +00:00
|
|
|
autoSizeColumns();
|
2011-02-24 09:25:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void pListView::setHeaderVisible(bool visible) {
|
|
|
|
SetWindowLong(
|
|
|
|
hwnd, GWL_STYLE,
|
|
|
|
(GetWindowLong(hwnd, GWL_STYLE) & ~LVS_NOCOLUMNHEADER) |
|
|
|
|
(visible ? 0 : LVS_NOCOLUMNHEADER)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2013-11-28 10:29:01 +00:00
|
|
|
void pListView::setImage(unsigned selection, unsigned position, const image& image) {
|
2012-08-11 02:18:19 +00:00
|
|
|
//assign existing image
|
|
|
|
for(unsigned n = 0; n < images.size(); n++) {
|
|
|
|
if(images[n] == image) {
|
2013-11-28 10:29:01 +00:00
|
|
|
imageMap(selection)(position) = n;
|
|
|
|
return ListView_SetImage(hwnd, imageList, selection, position, n);
|
2012-08-11 02:18:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//append and assign new image
|
2013-11-28 10:29:01 +00:00
|
|
|
imageMap(selection)(position) = images.size();
|
2012-08-11 02:18:19 +00:00
|
|
|
images.append(image);
|
2013-11-28 10:32:53 +00:00
|
|
|
ImageList_Append(imageList, image, 15);
|
2013-11-28 10:29:01 +00:00
|
|
|
ListView_SetImage(hwnd, imageList, selection, position, imageMap(selection)(position));
|
2012-06-18 10:13:51 +00:00
|
|
|
}
|
|
|
|
|
2011-02-27 09:05:10 +00:00
|
|
|
void pListView::setSelected(bool selected) {
|
|
|
|
locked = true;
|
2011-10-24 11:35:34 +00:00
|
|
|
lostFocus = false;
|
2011-02-27 09:05:10 +00:00
|
|
|
if(selected == false) {
|
|
|
|
ListView_SetItemState(hwnd, -1, 0, LVIS_FOCUSED | LVIS_SELECTED);
|
|
|
|
} else {
|
|
|
|
setSelection(listView.state.selection);
|
2011-02-24 09:25:20 +00:00
|
|
|
}
|
2011-02-27 09:05:10 +00:00
|
|
|
locked = false;
|
|
|
|
}
|
|
|
|
|
2013-11-28 10:29:01 +00:00
|
|
|
void pListView::setSelection(unsigned selection) {
|
2011-02-27 09:05:10 +00:00
|
|
|
locked = true;
|
2011-10-24 11:35:34 +00:00
|
|
|
lostFocus = false;
|
2013-11-28 10:29:01 +00:00
|
|
|
ListView_SetItemState(hwnd, selection, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
|
2011-02-27 09:05:10 +00:00
|
|
|
locked = false;
|
2011-02-24 09:25:20 +00:00
|
|
|
}
|
|
|
|
|
2013-11-28 10:29:01 +00:00
|
|
|
void pListView::setText(unsigned selection, unsigned position, string text) {
|
|
|
|
utf16_t wtext(text);
|
|
|
|
ListView_SetItemText(hwnd, selection, position, wtext);
|
|
|
|
}
|
|
|
|
|
2011-02-24 09:25:20 +00:00
|
|
|
void pListView::constructor() {
|
|
|
|
lostFocus = false;
|
|
|
|
hwnd = CreateWindowEx(
|
|
|
|
WS_EX_CLIENTEDGE, WC_LISTVIEW, L"",
|
2011-09-05 03:48:23 +00:00
|
|
|
WS_CHILD | WS_TABSTOP | LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | LVS_NOCOLUMNHEADER,
|
2013-11-28 10:29:01 +00:00
|
|
|
0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0
|
2011-02-24 09:25:20 +00:00
|
|
|
);
|
|
|
|
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&listView);
|
|
|
|
setDefaultFont();
|
|
|
|
setHeaderText(listView.state.headerText);
|
Update to v094r09 release.
byuu says:
This will easily be the biggest diff in the history of higan. And not in
a good way.
* target-higan and target-loki have been blown away completely
* nall and ruby massively updated
* phoenix replaced with hiro (pretty near a total rewrite)
* target-higan restarted using hiro (just a window for now)
* all emulation cores updated to compile again
* installation changed to not require root privileges (installs locally)
For the foreseeable future (maybe even permanently?), the new higan UI
will only build under Linux/BSD with GTK+ 2.20+. Probably the most
likely route for Windows/OS X will be to try and figure out how to build
hiro/GTK on those platforms, as awful as that would be. The other
alternative would be to produce new UIs for those platforms ... which
would actually be a good opportunity to make something much more user
friendly.
Being that I just started on this a few hours ago, that means that for
at least a few weeks, don't expect to be able to actually play any
games. Right now, you can pretty much just compile the binary and that's
it. It's quite possible that some nall changes didn't produce
compilation errors, but will produce runtime errors. So until the UI can
actually load games, we won't know if anything is broken. But we should
mostly be okay. It was mostly just trim<1> -> trim changes, moving to
Hash::SHA256 (much cleaner), and patching some reckless memory copy
functions enough to compile.
Progress isn't going to be like it was before: I'm now dividing my time
much thinner between studying and other hobbies.
My aim this time is not to produce a binary for everyone to play games
on. Rather, it's to keep the emulator alive. I want to be able to apply
critical patches again. And I would also like the base of the emulator
to live on, for use in other emulator frontends that utilize higan.
2015-02-26 10:10:46 +00:00
|
|
|
setBackgroundColor(listView.state.backgroundColor);
|
2011-02-24 09:25:20 +00:00
|
|
|
setHeaderVisible(listView.state.headerVisible);
|
|
|
|
setCheckable(listView.state.checkable);
|
2013-05-02 11:25:45 +00:00
|
|
|
for(auto& text : listView.state.text) append(text);
|
2011-09-27 11:55:02 +00:00
|
|
|
for(unsigned n = 0; n < listView.state.checked.size(); n++) setChecked(n, listView.state.checked[n]);
|
2012-08-11 02:18:19 +00:00
|
|
|
buildImageList();
|
2011-02-27 09:05:10 +00:00
|
|
|
if(listView.state.selected) setSelection(listView.state.selection);
|
|
|
|
autoSizeColumns();
|
2011-09-05 03:48:23 +00:00
|
|
|
synchronize();
|
|
|
|
}
|
|
|
|
|
|
|
|
void pListView::destructor() {
|
|
|
|
DestroyWindow(hwnd);
|
|
|
|
}
|
|
|
|
|
|
|
|
void pListView::orphan() {
|
|
|
|
destructor();
|
|
|
|
constructor();
|
|
|
|
}
|
|
|
|
|
2012-08-11 02:18:19 +00:00
|
|
|
void pListView::buildImageList() {
|
2013-05-02 11:25:45 +00:00
|
|
|
auto& list = listView.state.image;
|
2012-08-11 02:18:19 +00:00
|
|
|
unsigned columns = listView.state.text.size();
|
|
|
|
unsigned rows = max(1u, listView.state.headerText.size());
|
2012-06-25 12:49:39 +00:00
|
|
|
|
2012-08-11 02:18:19 +00:00
|
|
|
ListView_SetImageList(hwnd, NULL, LVSIL_SMALL);
|
|
|
|
if(imageList) ImageList_Destroy(imageList);
|
|
|
|
imageList = ImageList_Create(15, 15, ILC_COLOR32, 1, 0);
|
2012-06-18 10:13:51 +00:00
|
|
|
|
2012-08-11 02:18:19 +00:00
|
|
|
imageMap.reset();
|
|
|
|
images.reset();
|
|
|
|
images.append(nall::image()); //empty icon for cells without an image assigned (I_IMAGENONE does not work)
|
|
|
|
|
|
|
|
//create a vector of unique images from all images used (many cells may use the same image)
|
|
|
|
for(unsigned y = 0; y < list.size(); y++) {
|
|
|
|
for(unsigned x = 0; x < list[y].size(); x++) {
|
|
|
|
bool found = false;
|
|
|
|
for(unsigned z = 0; z < images.size(); z++) {
|
|
|
|
if(list[y][x] == images[z]) {
|
|
|
|
found = true;
|
|
|
|
imageMap(y)(x) = z;
|
|
|
|
break;
|
|
|
|
}
|
2012-06-25 12:49:39 +00:00
|
|
|
}
|
|
|
|
|
2012-08-11 02:18:19 +00:00
|
|
|
if(found == false) {
|
|
|
|
imageMap(y)(x) = images.size();
|
|
|
|
images.append(list[y][x]);
|
|
|
|
}
|
2012-06-18 10:13:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-11 02:18:19 +00:00
|
|
|
//build image list
|
2013-11-28 10:32:53 +00:00
|
|
|
for(auto& imageItem : images) ImageList_Append(imageList, imageItem, 15);
|
2012-08-11 02:18:19 +00:00
|
|
|
if(images.size() <= 1) return;
|
|
|
|
|
|
|
|
//set images for all cells
|
|
|
|
for(unsigned y = 0; y < columns; y++) {
|
|
|
|
for(unsigned x = 0; x < rows; x++) {
|
|
|
|
ListView_SetImage(hwnd, imageList, y, x, imageMap(y)(x));
|
2012-06-25 12:49:39 +00:00
|
|
|
}
|
|
|
|
}
|
2012-06-18 10:13:51 +00:00
|
|
|
}
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2013-11-28 10:29:01 +00:00
|
|
|
void pListView::onActivate(LPARAM lparam) {
|
|
|
|
LPNMLISTVIEW nmlistview = (LPNMLISTVIEW)lparam;
|
|
|
|
if(listView.state.text.empty() || !listView.state.selected) return;
|
2013-12-21 10:45:58 +00:00
|
|
|
//LVN_ITEMACTIVATE is not re-entrant until DispatchMessage() completes
|
|
|
|
//if(listView.onActivate) listView.onActivate();
|
Update to v094 release.
byuu says:
This release adds support for game libraries, and substantially improves
Game Boy and Game Boy Color emulation with cycle-based renderers. Many
other changes are also present.
It's very important to note that this release now defaults to optimal
drivers rather than safe drivers. This is particularly important if you
do not have strong OpenGL 3.2 drivers. If performance is bad, go to
Settings -> Configuration -> Advanced, change the video driver, and
restart higan. In the rare case that you have trouble opening higan, you
can edit settings.bml directly and change the setting there. The Windows
safe driver is Direct3D, and the Linux safe driver is XShm.
Also note that although display emulation shaders are now supported,
they have not been included in this release as they are not ready yet.
The support has been built-in anyway, so that they can be tested by
everyone. Once refined, future releases of higan will come with built-in
shaders for each emulated system that simulates the unique display
characteristics of each.
Changelog (since v093):
- sfc: added SA-1 MDR support (fixes SD Gundam G-Next bug)
- sfc: remove random/ and config/, merge to system/ with better
randomization
- gb: improved color emulation palette contrast
- gbc: do not sort sprites by X-priority
- gbc: allow transparency on BG priority pixels
- gbc: VRAM DMA timing and register fixes
- gbc: block invalid VRAM DMA transfer source and target addresses
- gba: added LCD color emulation (without it, colors are grossly
over-saturated)
- gba: removed internal frame blending (use shaders to simulate motion
blur if desired)
- gba: added Game Boy Player support (adds joypad rumble support to
supported games)
- gba: SOUND_CTL_H is readable
- gb/gbc: PPU renderer is now cycle-based (major accuracy improvement)
- gb/gbc: OAM DMA runs in parallel with the CPU
- gb/gbc: only HRAM can be accessed during OAM DMA
- gb/gbc: fixed serialization of games with SRAM
- gb/gbc: disallow up+down or left+right at the same time
- gb/gbc: added weak hipass filter to remove DC bias
- gb/gbc: STAT OAM+Hblank IRQs only trigger during active display
- gb/gbc: fixed underflow in window clamping
- gb/gbc/gba: audio mixes internally at 2MHz now instead of 4MHz (does
not affect accuracy)
- gb/gbc/gba: audio volume reduced for consistency with other systems
- fc/sfc/gb/gbc/gba: cheat codes are now stored in universal, decrypted
format
- ethos: replaced file loader with a proper game library
- ethos: added display emulation shader support
- ethos: added color emulation option to video settings
- ethos: program icon upgraded from 48x48 to 512x512
- ethos: settings and tools windows now use tab frames (less wasted
screen space)
- ethos: default to optimal (video, audio, input) drivers instead of
safest drivers
- ethos: input mapping system completely rewritten to support
hotplugging and unique device mappings
- ruby: added fixes for OpenGL 3.2 on AMD graphics cards
- ruby: quark shaders now support user settings inside of manifest
- ruby: quark shaders can use integral textures (allows display
emulation shaders to work with raw colors)
- ruby: add joypad rumble support
- ruby: XInput (Xbox 360) controllers now support hotplugging
- ruby: added Linux udev joypad driver with hotplug support
- phoenix: fixed a rare null pointer dereference issue on Windows
- port: target -std=c++11 instead of -std=gnu++11 (do not rely on GNU
C++ extensions)
- port: added out-of-the-box compilation support for BSD/Clang 3.3+
- port: applied a few Debian upstream patches
- cheats: updated to mightymo's 2014-01-02 release; decrypted all Game
Genie codes
2014-01-20 08:55:17 +00:00
|
|
|
PostMessage(parentHwnd, WM_APP + AppMessage::ListView_onActivate, 0, (LPARAM)&listView);
|
2013-11-28 10:29:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void pListView::onChange(LPARAM lparam) {
|
|
|
|
LPNMLISTVIEW nmlistview = (LPNMLISTVIEW)lparam;
|
|
|
|
if(!(nmlistview->uChanged & LVIF_STATE)) return;
|
|
|
|
|
|
|
|
unsigned selection = nmlistview->iItem;
|
|
|
|
unsigned imagemask = ((nmlistview->uNewState & LVIS_STATEIMAGEMASK) >> 12) - 1;
|
|
|
|
if(imagemask == 0 || imagemask == 1) {
|
|
|
|
if(!locked) {
|
|
|
|
listView.state.checked[selection] = !listView.state.checked[selection];
|
|
|
|
if(listView.onToggle) listView.onToggle(selection);
|
|
|
|
}
|
|
|
|
} else if((nmlistview->uOldState & LVIS_FOCUSED) && !(nmlistview->uNewState & LVIS_FOCUSED)) {
|
|
|
|
lostFocus = true;
|
2013-12-21 10:45:58 +00:00
|
|
|
listView.state.selected = false;
|
|
|
|
listView.state.selection = 0;
|
2013-11-28 10:29:01 +00:00
|
|
|
} else if(!(nmlistview->uOldState & LVIS_SELECTED) && (nmlistview->uNewState & LVIS_SELECTED)) {
|
|
|
|
lostFocus = false;
|
|
|
|
listView.state.selected = true;
|
|
|
|
listView.state.selection = selection;
|
|
|
|
if(!locked && listView.onChange) listView.onChange();
|
|
|
|
} else if(!lostFocus && !listView.state.selected) {
|
|
|
|
lostFocus = false;
|
|
|
|
listView.state.selected = false;
|
|
|
|
listView.state.selection = 0;
|
|
|
|
if(!locked && listView.onChange) listView.onChange();
|
2013-12-21 10:45:58 +00:00
|
|
|
} else if(listView.selected() && ListView_GetSelectedCount(hwnd) == 0) {
|
|
|
|
listView.state.selected = false;
|
|
|
|
listView.state.selection = 0;
|
|
|
|
if(!locked && listView.onChange) listView.onChange();
|
2013-11-28 10:29:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LRESULT pListView::onCustomDraw(LPARAM lparam) {
|
|
|
|
LPNMLVCUSTOMDRAW lvcd = (LPNMLVCUSTOMDRAW)lparam;
|
|
|
|
|
|
|
|
switch(lvcd->nmcd.dwDrawStage) {
|
Update to v094r09 release.
byuu says:
This will easily be the biggest diff in the history of higan. And not in
a good way.
* target-higan and target-loki have been blown away completely
* nall and ruby massively updated
* phoenix replaced with hiro (pretty near a total rewrite)
* target-higan restarted using hiro (just a window for now)
* all emulation cores updated to compile again
* installation changed to not require root privileges (installs locally)
For the foreseeable future (maybe even permanently?), the new higan UI
will only build under Linux/BSD with GTK+ 2.20+. Probably the most
likely route for Windows/OS X will be to try and figure out how to build
hiro/GTK on those platforms, as awful as that would be. The other
alternative would be to produce new UIs for those platforms ... which
would actually be a good opportunity to make something much more user
friendly.
Being that I just started on this a few hours ago, that means that for
at least a few weeks, don't expect to be able to actually play any
games. Right now, you can pretty much just compile the binary and that's
it. It's quite possible that some nall changes didn't produce
compilation errors, but will produce runtime errors. So until the UI can
actually load games, we won't know if anything is broken. But we should
mostly be okay. It was mostly just trim<1> -> trim changes, moving to
Hash::SHA256 (much cleaner), and patching some reckless memory copy
functions enough to compile.
Progress isn't going to be like it was before: I'm now dividing my time
much thinner between studying and other hobbies.
My aim this time is not to produce a binary for everyone to play games
on. Rather, it's to keep the emulator alive. I want to be able to apply
critical patches again. And I would also like the base of the emulator
to live on, for use in other emulator frontends that utilize higan.
2015-02-26 10:10:46 +00:00
|
|
|
|
|
|
|
case CDDS_PREPAINT: {
|
2013-11-28 10:29:01 +00:00
|
|
|
return CDRF_NOTIFYITEMDRAW;
|
Update to v094r09 release.
byuu says:
This will easily be the biggest diff in the history of higan. And not in
a good way.
* target-higan and target-loki have been blown away completely
* nall and ruby massively updated
* phoenix replaced with hiro (pretty near a total rewrite)
* target-higan restarted using hiro (just a window for now)
* all emulation cores updated to compile again
* installation changed to not require root privileges (installs locally)
For the foreseeable future (maybe even permanently?), the new higan UI
will only build under Linux/BSD with GTK+ 2.20+. Probably the most
likely route for Windows/OS X will be to try and figure out how to build
hiro/GTK on those platforms, as awful as that would be. The other
alternative would be to produce new UIs for those platforms ... which
would actually be a good opportunity to make something much more user
friendly.
Being that I just started on this a few hours ago, that means that for
at least a few weeks, don't expect to be able to actually play any
games. Right now, you can pretty much just compile the binary and that's
it. It's quite possible that some nall changes didn't produce
compilation errors, but will produce runtime errors. So until the UI can
actually load games, we won't know if anything is broken. But we should
mostly be okay. It was mostly just trim<1> -> trim changes, moving to
Hash::SHA256 (much cleaner), and patching some reckless memory copy
functions enough to compile.
Progress isn't going to be like it was before: I'm now dividing my time
much thinner between studying and other hobbies.
My aim this time is not to produce a binary for everyone to play games
on. Rather, it's to keep the emulator alive. I want to be able to apply
critical patches again. And I would also like the base of the emulator
to live on, for use in other emulator frontends that utilize higan.
2015-02-26 10:10:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
case CDDS_ITEMPREPAINT: {
|
|
|
|
Color& background = listView.state.backgroundColor;
|
|
|
|
Color& foreground = listView.state.foregroundColor;
|
|
|
|
lvcd->clrText = RGB(foreground.red, foreground.green, foreground.blue);
|
|
|
|
lvcd->clrTextBk = RGB(background.red, background.green, background.blue);
|
|
|
|
if(listView.state.headerText.size() >= 2 && lvcd->nmcd.dwItemSpec % 2) {
|
|
|
|
//draw alternating row colors if there are two or more columns
|
|
|
|
lvcd->clrTextBk = RGB(max(0, (signed)background.red - 17), max(0, (signed)background.green - 17), max(0, (signed)background.blue - 17));
|
2013-11-28 10:29:01 +00:00
|
|
|
}
|
|
|
|
return CDRF_DODEFAULT;
|
Update to v094r09 release.
byuu says:
This will easily be the biggest diff in the history of higan. And not in
a good way.
* target-higan and target-loki have been blown away completely
* nall and ruby massively updated
* phoenix replaced with hiro (pretty near a total rewrite)
* target-higan restarted using hiro (just a window for now)
* all emulation cores updated to compile again
* installation changed to not require root privileges (installs locally)
For the foreseeable future (maybe even permanently?), the new higan UI
will only build under Linux/BSD with GTK+ 2.20+. Probably the most
likely route for Windows/OS X will be to try and figure out how to build
hiro/GTK on those platforms, as awful as that would be. The other
alternative would be to produce new UIs for those platforms ... which
would actually be a good opportunity to make something much more user
friendly.
Being that I just started on this a few hours ago, that means that for
at least a few weeks, don't expect to be able to actually play any
games. Right now, you can pretty much just compile the binary and that's
it. It's quite possible that some nall changes didn't produce
compilation errors, but will produce runtime errors. So until the UI can
actually load games, we won't know if anything is broken. But we should
mostly be okay. It was mostly just trim<1> -> trim changes, moving to
Hash::SHA256 (much cleaner), and patching some reckless memory copy
functions enough to compile.
Progress isn't going to be like it was before: I'm now dividing my time
much thinner between studying and other hobbies.
My aim this time is not to produce a binary for everyone to play games
on. Rather, it's to keep the emulator alive. I want to be able to apply
critical patches again. And I would also like the base of the emulator
to live on, for use in other emulator frontends that utilize higan.
2015-02-26 10:10:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
default: {
|
2013-11-28 10:29:01 +00:00
|
|
|
return CDRF_DODEFAULT;
|
|
|
|
}
|
Update to v094r09 release.
byuu says:
This will easily be the biggest diff in the history of higan. And not in
a good way.
* target-higan and target-loki have been blown away completely
* nall and ruby massively updated
* phoenix replaced with hiro (pretty near a total rewrite)
* target-higan restarted using hiro (just a window for now)
* all emulation cores updated to compile again
* installation changed to not require root privileges (installs locally)
For the foreseeable future (maybe even permanently?), the new higan UI
will only build under Linux/BSD with GTK+ 2.20+. Probably the most
likely route for Windows/OS X will be to try and figure out how to build
hiro/GTK on those platforms, as awful as that would be. The other
alternative would be to produce new UIs for those platforms ... which
would actually be a good opportunity to make something much more user
friendly.
Being that I just started on this a few hours ago, that means that for
at least a few weeks, don't expect to be able to actually play any
games. Right now, you can pretty much just compile the binary and that's
it. It's quite possible that some nall changes didn't produce
compilation errors, but will produce runtime errors. So until the UI can
actually load games, we won't know if anything is broken. But we should
mostly be okay. It was mostly just trim<1> -> trim changes, moving to
Hash::SHA256 (much cleaner), and patching some reckless memory copy
functions enough to compile.
Progress isn't going to be like it was before: I'm now dividing my time
much thinner between studying and other hobbies.
My aim this time is not to produce a binary for everyone to play games
on. Rather, it's to keep the emulator alive. I want to be able to apply
critical patches again. And I would also like the base of the emulator
to live on, for use in other emulator frontends that utilize higan.
2015-02-26 10:10:46 +00:00
|
|
|
|
|
|
|
}
|
2013-11-28 10:29:01 +00:00
|
|
|
}
|
|
|
|
|
2013-03-15 13:11:33 +00:00
|
|
|
}
|