![]() |
#41 |
Knight
Join Date: Jan 2017
Posts: 961
![]() |
It is indeed the gcu port, that's my universal point of compatibility for all the variants. It would be a nightmare patching in the code to do anything else for each variant individually.
I have vague plans for some angband-specific javascript version of noteye in the future, which would then also solve graphics for every variant at once. |
![]() |
![]() |
![]() |
#42 | ||
Veteran
Join Date: Jun 2007
Posts: 1,393
![]() |
Quote:
![]() (What I've been experimenting with is basically completely gutting the Term subsystem and going towards supporting only an Allegro5-based frontend -- and hopefully Windows via cross-compilation, but that's a bit further off. The whole UI/keyboard subsystem is so unbelievably hackish and broken... :/ ) Quote:
(Just had a look at NotEye and it looks like even more hacks piled on top... it's kind of miraculous that such a monstrosity could even be made to work.) |
||
![]() |
![]() |
![]() |
#43 | ||
Swordsman
Join Date: May 2016
Posts: 336
![]() |
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#44 | |
Veteran
Join Date: Jun 2007
Posts: 1,393
![]() |
Quote:
Still, I'd argue that these are design problems:
(I'm sure there's more that I'm forgetting right now.) |
|
![]() |
![]() |
![]() |
#45 | |||
Swordsman
Join Date: May 2016
Posts: 336
![]() |
Quote:
![]() Quote:
Quote:
Code:
void al_set_target_bitmap(ALLEGRO_BITMAP *bitmap); That's how it's done in low level APIs (OpenGL, DirectX). Of course, it's not the only possible way of doing things, but it's pretty standard and it doesn't seem overly crazy to me. When working on textui2, I came to the conclusion that it's useful to divide the Terms into two kinds; permanent (map, messages, sidebar, monster list) and temporary (inventory, options, knowledge menu - the stuff that goes away when the user presses ESC). Organizing temporary terms as a stack, with the top of the stack being the current target of rendering operations, is very convenient (and there were no problems with using this architecture while writing ncurses frontend). OTOH, permanent terms don't need to be on the stack. I'm actually (very slowly) writing an Angband-insired roguelike (in D ![]() ![]() Last edited by t4nk; August 13, 2018 at 22:04. |
|||
![]() |
![]() |
![]() |
#46 | |||
Veteran
Join Date: Jun 2007
Posts: 1,393
![]() |
Quote:
The problem is much lesser in programming graphics because the "display list" only sticks around for a single frame and then you start over. (Also known as "immediate mode".) For a game like Angband, that's pretty simple to manage because the scope is very limited -- I think the entirety of the code which does this in my T2 branch is about 50-100 lines? I'm pretty sure I can eventually get rid of the "damage" tracking that the term structure does -- leaving me with a simple 2D array of char+attribute... which might as well be inside the frontend code. (In fact the frontend code already has such a structure because I want it to be able to redraw without having to call back into the term code.) Just to be clear: There are much better ways to manage the global drawing context which al_set_target_bitmap or whatever just hide under the carpet, such that you could actually have the compiler check your work, but they require pretty advanced type systems which C in the very least doesn't really support. They'd also get pretty hairy in C++, I imagine. Since most of the graphics APIs target C or C++, that's what we get. Quote:
Quote:
I'm not convinced in any way that tracking "damage" at a single-character level is a useful thing -- just redraw from scratch for every frame[1]. An even reasonably modern GPU should be able to draw Angband at several hundred (if not thousands) of FPS. (The exceptions here would be old frameworks where this type of drawing is not really supported very well. My experiences in SDL2.x and Allegro 5 suggest that at least there's no problem there.) [1] Here's another mismatch between that UI code and the modern world. You really want do just draw on every frame (if there have been any changes) and the Angband/T2 code contains sleep, etc. in various places in the code. These could end up being pretty non-trivial to avoid because changing the structure around an event loop might end up being difficult... I'm not quite giving up yet because it might be reasonable to with coroutines or similar. EDIT: Anyway, this is ranting at this point... ![]() |
|||
![]() |
![]() |
![]() |
#47 |
Vanilla maintainer
Join Date: Apr 2007
Location: Canberra, Australia
Age: 58
Posts: 9,560
Donated: $60
![]() ![]() |
Veering temporarily off-topic (sorry AH), I'm really sorry that is not incorporated in V yet - both takkaria and I have thought about it and got no further than that. I'm tempted to say I'll add that to the list of things for the next version...
__________________
One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. |
![]() |
![]() |
![]() |
#48 |
Veteran
Join Date: Jun 2007
Posts: 1,393
![]() |
@Nick Heh, I think it's just descended into ranting at this point, so a break from that is nice
![]() I definitely agree about textui2, btw. It looked really nice. |
![]() |
![]() |
![]() |
#49 | |||
Swordsman
Join Date: May 2016
Posts: 336
![]() |
Quote:
1) When the game is waiting for user input (so the user should see the latest state of the game) 2) When some animation is played Overly frequent screen redraws is the number one cause of slowdowns in textui1 (and requires hacks to work around), since most displays can be redrawn no more than 60 times per second. Thus, there is some synchronization between handling events and drawing to the screen. Quote:
Code:
struct TermCell { dchar codepoint = 0; RGBA foreground = Color.white; // Hack - the biggest codepoint is 0x10_FFFF, which is 21 bits; // that leaves 11 more bits in a dchar, which we use for bitflags. // The flags are used only in this module; don't forget to clear them. private: enum _Mask : uint { dirty = 1 << 31, clear = 0x1F_FFFF, } TermCell dirty() const pure { return TermCell(this.codepoint | _Mask.dirty, this.foreground); } TermCell clear() const pure { return TermCell(this.codepoint & _Mask.clear, this.foreground); } bool isDirty() const pure { return this.codepoint & _Mask.dirty; } bool isClear() const pure { return (this.codepoint & _Mask.clear) == this.codepoint; } } Quote:
![]() ![]() |
|||
![]() |
![]() |
![]() |
#50 |
Knight
Join Date: Jan 2017
Posts: 961
![]() |
Bump. If we can get user directory command line arguments back this week, we'll have a competition next month.
|
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
ToME 2.3.5 Questions | Sooty | ToME | 9 | January 20, 2012 14:12 |
Why ToME 2.3.5? | caruso | ToME | 4 | August 28, 2011 16:48 |
New to Tome | barna10 | ToME | 0 | August 13, 2010 07:24 |
ToME - Genocide? | Narvius | Variants | 4 | December 27, 2007 21:09 |
ToME - Tik | desmondch | Variants | 2 | May 10, 2007 12:54 |