Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #13 from idietmoran/dev
Browse files Browse the repository at this point in the history
fixed crash
  • Loading branch information
Stateford committed Nov 13, 2017
2 parents 2a1f84f + 6ee1443 commit c49b814
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 21 deletions.
3 changes: 2 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
int main()
{
Menu menu;

std::thread t1([=, &menu] { menu.start(); });
t1.join();

menu.start();

return 0;
}
3 changes: 1 addition & 2 deletions src/arch/arch.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "arch.h"
#include <iostream>


bool Arch::x64 = false;
Expand Down Expand Up @@ -39,7 +38,7 @@ bool Arch::checkArrayForDoubles(std::string name)
void Arch::filterAllies()
{
filteredAllies_.clear();
filteredAllies_.reserve(8);
//filteredAllies_.reserve(8);
filteredAllies_.push_back(allies_[0]);
for (auto &p : allies_)
{
Expand Down
1 change: 0 additions & 1 deletion src/arch/x64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ x64::~x64()

void x64::createAllies()
{
allies_.reserve(8);
// dx11 64-bit offsets
allies_.push_back(new YOU(0x1828AE1));
allies_.push_back(new Ally(0x184A170));
Expand Down
20 changes: 4 additions & 16 deletions src/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ Menu::~Menu()
void Menu::displayAllies()
{
// update play characters names
//fflogs_->arch_->updateNames(fflogs_->ffxiv_, fflogs_->partyMembers_);
fflogs_->arch_->updateNames(fflogs_->ffxiv_, fflogs_->partyMembers_);


SetConsoleTextAttribute(hConsole_, 7);
// display title
std::cout << "FFXIV Party Logs\n";
std::cout << "--------------------\n";


/*
* NOTE: It's impossible to determine people no longer in the party without parsing the chat log
* TODO: Maybe in the future
Expand All @@ -41,6 +40,7 @@ void Menu::displayAllies()
{
SetConsoleTextAttribute(hConsole_, 23);
}
//fflogs_->arch_->getFilteredAllies()[i]->display();
fflogs_->arch_->getFilteredAllies()[i]->display();
}
// this prevents the colors from breaking
Expand All @@ -50,14 +50,14 @@ void Menu::displayAllies()

void Menu::redraw()
{
std::cout.flush();
//std::cout.flush();
system("CLS");
displayAllies();
}

void Menu::alliesMenu(DWORD &mode, INPUT_RECORD &event, HANDLE &hstdin)
{
std::cout.flush();
//std::cout.flush();
system("CLS");
displayAllies();
prevPartySize_ = fflogs_->partyMembers_;
Expand Down Expand Up @@ -117,17 +117,5 @@ void Menu::start()

std::thread t1([=, &mode, &event, &hstdin] { alliesMenu(mode, event, hstdin); });

std::thread t2([=] {
while (live_)
{
fflogs_->arch_->updateNames(fflogs_->ffxiv_, fflogs_->partyMembers_);
Sleep(1);
}
});

// these threads will run in parallel.
// one thread will power the menu
// the other thread will updatenames
t1.join();
t2.join();
}
1 change: 0 additions & 1 deletion src/process/module.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "module.h"
#include <iostream>

// constructor
Module::Module(TCHAR moduleName[])
Expand Down

0 comments on commit c49b814

Please sign in to comment.