about summary refs log tree commit diff stats
path: root/data/maps/the_lionized
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-08-24 18:23:46 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2025-08-24 18:23:46 -0400
commitf1cf0b7e2af620fb62dd44c7a5bda3fa0fd972d5 (patch)
tree9b5c13c45756bd8d20b5a9641db40f08f5b83858 /data/maps/the_lionized
parentb7efc4f591dc91876c573e5361f52689705e6e50 (diff)
downloadlingo2-archipelago-f1cf0b7e2af620fb62dd44c7a5bda3fa0fd972d5.tar.gz
lingo2-archipelago-f1cf0b7e2af620fb62dd44c7a5bda3fa0fd972d5.tar.bz2
lingo2-archipelago-f1cf0b7e2af620fb62dd44c7a5bda3fa0fd972d5.zip
Fixed typo in Blue Smiley Annex connection
Diffstat (limited to 'data/maps/the_lionized')
0 files changed, 0 insertions, 0 deletions
'#n12'>12 13 14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40





                        

                                                                       





                                                             
                                                             










                                               


                                                                       










                                                                               
#include "area_window.h"

#include <iostream>

#include "game_data.h"

AreaWindow::AreaWindow(wxWindow* parent, int area_id, AreaPopup* popup)
    : wxWindow(parent, wxID_ANY), area_id_(area_id), popup_(popup) {
  SetSize(EFFECTIVE_SIZE, EFFECTIVE_SIZE);

  Redraw();

  Bind(wxEVT_PAINT, &AreaWindow::OnPaint, this);
  Bind(wxEVT_ENTER_WINDOW, &AreaWindow::OnEnterWindow, this);
  Bind(wxEVT_LEAVE_WINDOW, &AreaWindow::OnLeaveWindow, this);
}

void AreaWindow::OnPaint(wxPaintEvent& event) {
  if (GetSize() != rendered_.GetSize()) {
    Redraw();
  }

  wxPaintDC dc(this);
  dc.DrawBitmap(rendered_, 0, 0);
}

void AreaWindow::OnEnterWindow(wxMouseEvent& event) { popup_->Show(); }

void AreaWindow::OnLeaveWindow(wxMouseEvent& event) { popup_->Hide(); }

void AreaWindow::Redraw() {
  int actual_border_size = GetSize().GetWidth() * BORDER_SIZE / EFFECTIVE_SIZE;

  rendered_ = wxBitmap(GetSize());
  wxMemoryDC dc;
  dc.SelectObject(rendered_);
  dc.SetPen(*wxThePenList->FindOrCreatePen(*wxBLACK, actual_border_size));
  dc.SetBrush(*wxGREEN_BRUSH);
  dc.DrawRectangle({0, 0}, GetSize());
}